]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
Clean up yacc.c a little.
[bison.git] / ChangeLog
... / ...
CommitLineData
12009-09-10 Joel E. Denny <jdenny@clemson.edu>
2
3 Clean up yacc.c a little.
4 * data/yacc.c: Clean up M4 for readability, and make output
5 whitespace more consistent. For the main parse function
6 comment, instead of saying "yyparse or yypush_parse", say either
7 "yyparse" or "yypush_parse" depending on which it actually is.
8
92009-09-03 Joel E. Denny <jdenny@clemson.edu>
10
11 Complain about unused %define variables and %code qualifiers.
12 * NEWS (2.5): Document.
13 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
14 * doc/bison.texinfo (Decl Summary): Document complaint, and
15 improve %define documentation a little otherwise.
16 * tests/input.at (Reject unused %code qualifiers): Update.
17 (%define errors): Update.
18 (%define, --define, --force-define): Update.
19 (%define backward compatibility): Update.
20 (Unused %define api.pure): Update.
21 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
22
232009-09-03 Joel E. Denny <jdenny@clemson.edu>
24
25 Use aver not assert.
26 * src/output.c: Don't include assert.h.
27 (output_skeleton): Use aver not assert.
28 * src/system.h (aver): In documentation of why, add links to
29 Paul Eggert's explanations in the mailing lists.
30
312009-09-05 Alex Rozenman <rozenman@gmail.com>
32
33 Use "Unresolved reference" error message when no symbols were found
34 in a symbolic reference resolution. Remove .expr and -expr from
35 the shown reference when the reference is unresolved.
36 * src/scan-code.l: Change the error message, adjust location columns,
37 rename variable "exact_mode" to "explicit_bracketing".
38 * tests/named-ref.at: Adjust existing tests and add a new one.
39
402009-09-03 Akim Demaille <demaille@gostai.com>
41
42 * NEWS (2.4.2): Add "Internationalization" item.
43
442009-09-03 Akim Demaille <demaille@gostai.com>
45
46 bootstrap: fix/improve find_tool.
47 * bootstrap (find_tool): Improve error messages.
48 Fix typo about find_tool_names.
49
502009-08-29 Joel E. Denny <jdenny@clemson.edu>
51
52 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
53 See
54 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
55 * src/scan-code.h (code_props_rule_action_init): Rename
56 named_ref arg to name so it doesn't shadow named_ref type. This
57 makes it consistent with the function definition in scan-code.l
58 anyway.
59
602009-08-28 Joel E. Denny <jdenny@clemson.edu>
61
62 %define: accept unquoted values.
63 * NEWS (2.5): Group all %define changes together, and document
64 this one. Remove quotes in IELR and canonical LR entry.
65 * doc/bison.texinfo: Remove quotes in most examples throughout.
66 (Decl Summary): Update %define documentation.
67 (Table of Symbols): Likewise.
68 * src/ielr.c (LrType): Update documentation.
69 * src/parse-gram.y (content.opt): Add production for ID.
70 * tests/calc.at: Remove quotes in most tests.
71 * tests/existing.at: Likewise.
72 * tests/input.at: Likewise.
73 * tests/local.at: Likewise.
74 * tests/push.at: Likewise.
75 * tests/reduce.at: Likewise.
76 * tests/torture.at: Likewise.
77
782009-08-28 Joel E. Denny <jdenny@clemson.edu>
79
80 %define lr.type: make values lowercase IDs.
81 That is, "LALR" => "lalr", "IELR" => "ielr", and
82 "canonical LR" => "canonical-lr".
83 * NEWS (2.5): Update documentation.
84 * doc/bison.texinfo (Decl Summary): Likewise.
85 * src/ielr.c (ielr): Use new values.
86 * src/ielr.h (ielr): Update documentation.
87 * src/reader.c (prepare_percent_define_front_end_variables): Use
88 and validate new values.
89 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
90 grammars.
91 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
92
932009-08-27 Eric Blake <ebb9@byu.net>
94
95 scan-gram: avoid portability trap with ctype usage.
96 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
97 Avoid compiler warning.
98
992009-08-27 Joel E. Denny <jdenny@clemson.edu>
100
101 tests: use perl for printing special sequences to files.
102 And skip tests if perl is not available. This is better than
103 playing tricks with shell portability. Suggested by Akim
104 Demaille.
105 * tests/input.at (Bad character literals): Use it here for
106 omitting final newlines.
107 (Bad escapes in literals): Use it here for special characters.
108
1092009-08-26 Joel E. Denny <jdenny@clemson.edu>
110
111 tests: show a use of %define lr.default-reductions "consistent"
112 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
113 prevents the omission of expected tokens for %error-verbose.
114
1152009-08-26 Akim Demaille <demaille@gostai.com>
116
117 tests: portability fix.
118 * tests/input.at (Bad escapes in literals): Don't expect "echo
119 '\0'" to output \ then 0.
120
1212009-08-26 Joel E. Denny <jdenny@clemson.edu>
122
123 Actually handle the yytable zero value correctly this time.
124 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Don't
125 mention zero values in the YYTABLE comments.
126 * data/glr.c (yytable_value_is_error): Don't check for zero
127 value.
128 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
129 * data/yacc.c (yytable_value_is_error): Likewise.
130 * data/lalr1.java (yy_table_value_is_error_): Likewise.
131 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
132 * src/tables.h: In header comments, explain why it's useless to
133 check for a zero value in yytable.
134
1352009-08-25 Joel E. Denny <jdenny@clemson.edu>
136
137 More fixes related to last two patches.
138 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
139 defined.
140 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Fix
141 yytable comments: zero indicates syntax error not default
142 action.
143 * data/glr.c (yyis_pact_ninf): Rename to...
144 (yypact_value_is_default): ... this.
145 (yyisDefaultedState): Update for rename.
146 (yyis_table_ninf): Rename to...
147 (yytable_value_is_error): ... this, and check for value zero
148 besides just YYTABLE_NINF.
149 (yygetLRActions): Check for default value from yypact. It
150 appears that this check is always performed before this function
151 is invoked, and so adding the check here is probably redundant.
152 However, the code may evolve after this subtlety is forgotten.
153 Also, update for rename to yytable_value_is_error. Because that
154 macro now checks for zero, a different but equivalent branch of
155 the if-then-else here is evaluated.
156 (yyreportSyntaxError): Update for rename to
157 yytable_value_is_error. The zero condition was mishandled
158 before.
159 (yyrecoverSyntaxError): Update for renames. No behavioral
160 changes.
161 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
162 New function.
163 (yy_table_value_is_error_): New function.
164 (parse): Use new functions where possible. No behavioral
165 changes.
166 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
167 The zero condition was mishandled before.
168 * data/yacc.c (yyis_pact_ninf): Rename to...
169 (yypact_value_is_default): ... this.
170 (yyis_table_ninf): Rename to...
171 (yytable_value_is_error): ... this, and check for value zero
172 besides just YYTABLE_NINF.
173 (yysyntax_error): Update for rename to yytable_value_is_error.
174 The zero condition was mishandled before.
175 (yyparse): Update for renames. No behavioral changes.
176 * src/tables.h: Improve comments about yypact, yytable, etc.
177 more. Most importantly, say yytable value of zero means syntax
178 error not default action.
179
1802009-08-25 Joel E. Denny <jdenny@clemson.edu>
181
182 Fix %error-verbose for conflicts resolved by %nonassoc.
183 * NEWS (2.5): Document.
184 * data/glr.c (yyreportSyntaxError): Fix this by checking
185 yyis_table_ninf.
186 * data/yacc.c (yysyntax_error): Likewise.
187 * data/lalr1.cc (yysyntax_error_): Fix this by checking
188 yytable_ninf_.
189 * data/lalr1.java (yysyntax_error): Likewise.
190 * tests/conflicts.at (%nonassoc and eof): Update expected output
191 and remove FIXME.
192
1932009-08-25 Joel E. Denny <jdenny@clemson.edu>
194
195 Some code and documentation improvements.
196 * data/c.m4 (b4_table_value_equals): New macro to capture
197 some repeated code.
198 * data/glr.c (yyis_pact_ninf): Use it here.
199 (yyis_table_ninf): Likewise.
200 (yyreportSyntaxError): Improve internal comments.
201 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
202 Use it everywhere possible.
203 (yyis_table_ninf): Likewise.
204 (yysyntax_error): Improve internal comments.
205 * data/lalr1.cc (yysyntax_error_): Likewise.
206 * data/lalr1.java (yysyntax_error): Likewise.
207 * src/tables.h: Improve comments about yypact, yytable, etc.
208
2092009-08-21 Joel E. Denny <jdenny@clemson.edu>
210
211 Use locale when quoting.
212 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
213 quote rather than implementing quoting here.
214
2152009-08-20 Eric Blake <ebb9@byu.net>
216
217 Make previous patch more robust.
218 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
219 argmatch.h.
220 (output_skeleton): Use it.
221 Suggested by Akim Demaille.
222
223 Import latest m4/m4.m4.
224 * submodules/autoconf: Update to autoconf 2.64.
225 * configure.ac (M4_GNU_OPTION): New define.
226 * src/output.c (output_skeleton): Use it to resolve FIXME.
227 * NEWS: Mention this.
228
2292009-08-19 Joel E. Denny <jdenny@clemson.edu>
230
231 Fix complaints about escape sequences.
232 Discussed starting at
233 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
234 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
235 For a \0 and similar escape sequences meaning the null
236 character, report an invalid escape sequence instead of an
237 invalid null character because the latter does not actually
238 appear in the user's input.
239 In all escape sequence complaints, don't escape the initial
240 backslash, and don't quote when the sequence appears at the end
241 of the complaint line unless there's whitespace that quotearg
242 won't escape.
243 Consistently say "invalid" not "unrecognized".
244 Consistently prefer "empty character literal" over "extra
245 characters in character literal" warning for invalid escape
246 sequences; that is, consistently discard those sequences.
247 * tests/input.at (Bad escapes in literals): New.
248
2492009-08-19 Akim Demaille <demaille@gostai.com>
250
251 doc: fixes.
252 * doc/bison.texinfo: Fix minor Texinfo errors.
253
2542009-08-19 Akim Demaille <demaille@gostai.com>
255
256 doc: %initial-action to initialize yylloc.
257 Reported by Bill Allombert.
258 * doc/bison.texinfo: Set fill-column to 76.
259 (Location Type): Document the use of %initial-action to initialize
260 yylloc.
261
2622009-08-18 Joel E. Denny <jdenny@clemson.edu>
263
264 maint: update for gnulib's recent update-copyright changes
265 * gnulib: Update.
266 * .x-update-copyright (COPYING): Add as it's no longer implied
267 when .x-update-copyright is present.
268 * cfg.mk (update-copyright-local): Remove, now ignored.
269 (update-copyright): Declare update-b4-copyright as a dependency.
270
2712009-08-17 Akim Demaille <demaille@gostai.com>
272
273 build: require gettext 0.17.
274
275 Suggested by Bruno Haible.
276 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
277 * configure.ac: require gettext 0.17 to ensure compatibility with
278 gnulib.
279
2802009-08-17 Akim Demaille <demaille@gostai.com>
281
282 build: lower gettext requirements.
283
284 Bison was uselessly requiring the formatstring macros from
285 gettext, which resulted in mo files not being installed on systems
286 that perfectly supported Bison mo files. Lower the requirement.
287 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
288
289 * configure.ac: Require need-ngettext instead of
290 need-formatstring-macros.
291 Reported by Martin Jabocs.
292 Suggested by Bruno Haible.
293 * INSTALL: Restructure.
294 (Internationalization): New.
295
2962009-08-14 Joel E. Denny <jdenny@clemson.edu>
297
298 maint: fix use of copyright year intervals.
299 * gnulib: Update.
300 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
301 as now recommended in gnulib/NEWS.
302 * build-aux/update-b4-copyright: Fix.
303 * cfg.mk (update-copyright-env): Configure update-copyright.
304
3052009-08-13 Joel E. Denny <jdenny@clemson.edu>
306
307 Make it easier to write deterministic tests.
308 Continues Akim's work from his 2009-06-10 commits.
309 * src/reader.c (check_and_convert_grammar): Don't add any
310 symbols after the first symbols_do invocation.
311 * src/symtab.c (symbols_sorted): New static global.
312 (user_token_number_redeclaration): Update comments.
313 (symbol_from_uniqstr): If a new symbol is being created, assert
314 that symbols_sorted hasn't been allocated yet.
315 (symbols_free): Free symbols_sorted.
316 (symbols_cmp, symbols_cmp_qsort): New functions.
317 (symbols_do): Sort symbol_table into symbols_sorted on first
318 invocation.
319 * tests/input.at (Numbered tokens): Recombine tests now that the
320 output should be deterministic across multiple numbers.
321
3222009-08-12 Akim Demaille <demaille@gostai.com>
323
324 distcheck: fix.
325
326 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
327
3282009-08-10 Joel E. Denny <jdenny@clemson.edu>
329
330 * tests/Makefile.am (TESTSUITE_AT): Add named-refs.at.
331
3322009-08-10 Joel E. Denny <jdenny@clemson.edu>
333
334 Miscellaneous code readability improvements.
335
336 * src/reader.c (reader): Move %define front-end variable
337 defaults and checking into...
338 (prepare_percent_define_front_end_variables): ... this new
339 function.
340
341 * src/scan-gram.l (INITIAL): For consistency with string
342 literals, don't store open quote on character literal. It's
343 discarded before returning anyway.
344 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
345 Make length test more readable, and make the character stored
346 for an empty literal more obvious while consistent with the
347 previous behavior.
348
349 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
350 USER_NUMBER_HAS_STRING_ALIAS throughout.
351 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
352 that is repeated in symtab.h. Improve argument names to make it
353 clear which side of the symbol-string alias pair is which.
354 (symbol_check_alias_consistency): Improve local variable names
355 for the same purpose.
356 * src/symtab.h (struct symbol): Make comments about aliases
357 clearer.
358 (symbol_make_alias): Improve comments and argument name.
359 * src/output.c (token_definitions_output): Update for rename to
360 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
361
3622009-08-08 Alex Rozenman <rozenman@gmail.com>
363
364 Convert "misleading reference" messages to warnings.
365 * src/scan-code.l: New function 'show_sub_messages', more
366 factoring.
367 * tests/named-ref.at: Adjust tests.
368
3692009-08-06 Joel E. Denny <jdenny@clemson.edu>
370
371 maint: run "make update-copyright"
372
3732009-08-06 Joel E. Denny <jdenny@clemson.edu>
374
375 maint: make update-b4-copyright easier to use
376 * build-aux/update-b4-copyright: In warnings, report line
377 numbers rather than character positions.
378 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
379 that update-copyright runs it.
380 * gnulib: Update.
381
3822009-08-05 Joel E. Denny <jdenny@clemson.edu>
383
384 maint: clean up update-b4-copyright code
385 * build-aux/update-b4-copyright: Do not accept 2-digit
386 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
387 Don't accept a `[' in a b4_copyright argument.
388 Format code more consistently.
389 Don't assume b4*copyright never occurs.
390
3912009-08-04 Joel E. Denny <jdenny@clemson.edu>
392
393 maint: automate b4_copyright updates.
394 * Makefile.am (update-b4-copyright): New target rule.
395 * build-aux/Makefile.am (EXTRA_DIST): Add update-b4-copyright.
396 * build-aux/update-b4-copyright: New.
397 * data/yacc.c: Remove stray characters around b4_copyright
398 invocations.
399
4002009-08-04 Joel E. Denny <jdenny@clemson.edu>
401
402 maint: automate annual package-wide copyright-year update.
403 * .x-update-copyright: New.
404 * Makefile.am (EXTRA_DIST): Remove maint.mk.
405 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
406 update-copyright. Remove gnumakefile, which is implied by
407 maintainer-makefile.
408 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
409 * gnulib: Update.
410 * maint.mk: Remove, now copied from gnulib.
411 * examples/extexi: Add missing "(C)" in copyright statement so
412 update-copyright can recognize it.
413 * src/LR0.h: Likewise.
414 * src/print.h: Likewise.
415 * src/print_graph.h: Likewise.
416 * src/gram.c: Add missing comma in copyright statement.
417 * src/gram.h: Likewise.
418
4192009-08-04 Joel E. Denny <jdenny@clemson.edu>
420
421 Fix "make distcheck".
422 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
423 of just calc.stamp.
424
4252009-08-01 Joel E. Denny <jdenny@clemson.edu>
426
427 Pacify "gcc -Wunused" for the input function from Flex.
428 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
429 and later.
430 * src/scan-code.l: Add "%option noinput", which I cannot find in
431 the Flex manual, but which Flex has supported since at least as
432 far back as 2.5.4. However, if any of our developers still use
433 Flex 2.5.4, they'll need to stop configuring with
434 --enable-gcc-warnings because "%option noinput" didn't work
435 correctly until Flex 2.5.6.
436 * src/scan-gram.l: Likewise.
437 * src/scan-skel.l: Likewise.
438
4392009-07-31 Alex Rozenman <rozenman@gmail.com>
440
441 Fix --enable-gcc-warnings problems.
442 * src/reader.c: Adjust variable names.
443 * src/scan-code.l: Fix prototypes and adjust names.
444 * src/named-ref.c: Remove redundant "if".
445
4462009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
447
448 Fix a --enable-gcc-warnings problem.
449 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
450 variable.
451
4522009-07-24 Alex Rozenman <rozenman@gmail.com>
453
454 Fix some memory leaks.
455 * src/named-ref.c: Add a pointer check (named_ref_free).
456 * src/scan-code.l: New function (variant_table_free). Called in
457 code_scanner_free.
458 * src/symlist.c: Call to named_ref_free (symbol_list_free).
459
4602009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
461
462 Warn about character literals not of length one.
463 * NEWS (2.5): Document.
464 * src/scan-gram.l (INITIAL): Remove comment that we don't check
465 the length.
466 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
467 * tests/input.at (Bad character literals): New test group.
468
4692009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
470
471 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
472
4732009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
474
475 Some M4 cleanup in the testsuite.
476 Suggested by Eric Blake at
477 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
478 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
479 complicate the code by distinguishing between a missing value
480 and an empty string value for an optional argument. This fix is
481 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
482 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
483 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
484 arguments are not needed because of the following changes.
485 Fix stale comments.
486 Bison developers should use GNU M4 and should not use
487 POSIXLY_CORRECT when building the test suite, so do not
488 complicate the code by avoiding $10 and above.
489 Do not quote an empty string value for an optional argument, and
490 do not distinguish between a missing value and an empty string
491 value.
492
4932009-07-21 Joel E. Denny <jdenny@ces.clemson.edu>
494
495 * m4/m4.m4: Make it a sym link to submodules/autoconf/m4/m4.m4.
496
4972009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
498
499 Revert unnecessary column realignment in --help output.
500 Reported by Akim Demaille at
501 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
502 * src/getargs.c (usage): Here.
503
5042009-07-04 Alex Rozenman <rozenman@gmail.com>
505
506 Alphabetical order in src/Makefile.am.
507 * src/Makefile.am: Adjust.
508
5092009-07-04 Alex Rozenman <rozenman@gmail.com>
510
511 Style changes and factoring.
512 * src/named-ref.h: Add comments.
513 * src/parse-gram.y: Readability and style changes.
514 * src/reader.c: Factoring: assign_named_ref function.
515 * src/scan-code.l: Factoring and style changes. Rename
516 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
517 Use "unsigned" type for variant index. Improve readablity.
518 * src/scan-gram.l: Change error messages and add comments.
519 * src/symlist.h: symbol_list_null: New function decl.
520 * src/symlist.c: symbol_list_null: Implement here.
521 * tests/named-refs.at: Adjust for new error messages.
522
5232009-06-29 Eric Blake <ebb9@byu.net>
524
525 scan-code: avoid compiler warnings
526 * src/scan-code.l (parse_named_ref): Use correct specifiers.
527
5282009-06-29 Akim Demaille <demaille@gostai.com>
529
530 build: avoid concurrent extraction of calc++.
531 * examples/calc++/Makefile.am (calc.stamp): New.
532 Depend on it to create the sources of calc++ so that concurrent
533 builds don't launch several "extexi" in parallel.
534 Not only this is inefficient, this also builds incorrect sources
535 with several extractions mixed together.
536
5372009-06-27 Alex Rozenman <rozenman@gmail.com>
538
539 Implement support for named symbol references.
540 * src/parse-gram.y: Add new syntax (named_ref.opt).
541 * src/reader.c: Store named refs in symbol lists.
542 * src/reader.h: New argument for symbol_append and
543 action_append functions.
544 * src/scan-code.h: Add new field (named_ref) into
545 code_props data structure. Keeps named ref of midrule
546 actions.
547 * src/scan-code.l: Support for named refs in semantic
548 action code. New function 'parse_named_ref'.
549 * src/scan-gram.l: Support bracketed id.
550 * src/symlist.c: Store named refs in symbol lists.
551 * src/symlist.h: New field in symbol list: named_ref.
552 * src/named-ref.h: New file, a struct for named_ref.
553 * src/named-ref.cp: New file, named_ref_new function.
554 * src/local.mk: Add two new files.
555 * tests/testsuite.at: Include new test group:
556 * tests/named-refs.at: this new file.
557
5582009-06-25 Akim Demaille <demaille@gostai.com>
559
560 hash: check insertion for memory exhaustion.
561 * src/uniqstr.c (uniqstr_new): New.
562
5632009-06-11 Akim Demaille <demaille@gostai.com>
564
565 style changes.
566 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
567 * src/print-xml.c: Style changes.
568 * tests/conflicts.at: Comment changes.
569
5702009-06-11 Akim Demaille <demaille@gostai.com>
571
572 xml: beware of user strings used to give a %prec to rules.
573 * tests/conflicts.at (%prec with user strings): New.
574 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
575 XML output.
576
5772009-06-11 Akim Demaille <demaille@gostai.com>
578
579 hash: check insertion for memory exhaustion.
580 * src/muscle-tab.c (muscle_insert, muscle_grow)
581 * src/state.c (state_hash_insert): Check the return value of
582 hash_insert.
583
5842009-06-10 Akim Demaille <demaille@gostai.com>
585
586 deterministic test suite.
587 Some consistency checks on symbols are performed after all the
588 symbols were read, by an iteration over the symbol table. This
589 traversal is nondeterministic, which can be a problem for test
590 cases.
591 Avoid this.
592 Addresses another form of nondeterminism reported by Joel E. Denny.
593 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
594
595 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
596 test in two.
597 Use different file names for the three tests to make the
598 maintenance easier.
599
6002009-06-10 Akim Demaille <demaille@gostai.com>
601
602 deterministic user-token-number redeclaration errors.
603 Address nondeterminism reported by Joel E. Denny.
604 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
605
606 * src/uniqstr.h: Comment changes.
607 * src/location.h (boundary_cmp, location_cmp): New.
608 * src/symtab.c (user_token_number_redeclaration): New.
609 (symbol_translation): Use it.
610 * tests/input.at (Numbered tokens): Adjust the expected output.
611
6122009-05-25 Akim Demaille <demaille@gostai.com>
613
614 gnulib: update.
615 * gnulib: Update to latest.
616 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
617 * m4/.gitignore: Regen.
618 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
619 Call xalloc_die on hash_insert failures.
620 Requested by the new __warn_unused_result__ attribute of
621 hash_insert.
622
6232009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
624
625 Convert multiple variable definition warnings to complaints.
626 * NEWS (2.5): Add a new entry for that change.
627 * doc/bison.texinfo (Decl Summary): Update %define entry.
628 (Bison Options): Update -D/--define/-F/--force-define entry.
629 * src/muscle_tab.c (muscle_percent_define_insert): Implement.
630 * src/muscle_tab.h (muscle_percent_define_insert): Update
631 comments.
632 * tests/input.at (`%define errors'): Update.
633 (`%define, --define, --force-define'): Update.
634
6352009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
636
637 -F/--force-define and relative %define/-D/--define priorities.
638 * NEWS (2.5): Add documentation to -D/--define entry.
639 * build-aux/cross-options.pl: Hard-code association of
640 --force-define with %define.
641 * doc/bison.texinfo (Decl Summary): In %define entry,
642 cross-reference command-line options.
643 (Bison Options): Add documentation to -D/--define entry.
644 (Option Cross Key): Widen column for --force-define row.
645 * src/getargs.c (usage): Document -F/--force-define. Realign
646 options in output.
647 (short_options, long_options, getargs): Parse -F/--force-define,
648 and update muscle_percent_define_insert invocation.
649 * src/muscle_tab.h (muscle_percent_define_how): New enum type.
650 (muscle_percent_define_insert): Add argument with that type.
651 * src/muscle_tab.c (muscle_percent_define_insert): Implement
652 -F/--force-define behavior and priorities.
653 * src/parse-gram.y (prologue_declaration): Update
654 muscle_percent_define_insert invocations.
655 * tests/input.at (`%define, --define'): Rename to...
656 (`%define, --define, --force-define'): ... this and extend.
657
6582009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
659
660 Update some comments to make sense for -D.
661 * data/bison.m4 (b4_check_user_names): In header comments, say
662 "user occurrence" instead of "grammar occurrence".
663 * src/muscle_tab.h (muscle_percent_define_insert): Likewise.
664 (muscle_percent_code_grow): Likewise just for consistency.
665
6662009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
667
668 * data/c++.m4: Update copyright year.
669
6702009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
671
672 * data/c++.m4 (b4_namespace_close): Simplify slightly.
673
6742009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
675
676 Handle a trailing `:' in a user-supplied C++ namespace better.
677 * data/c++.m4 (b4_namespace_close): Don't let it be printed
678 among the closing braces here. This fix might make the
679 generated code easier to debug, but otherwise it should be
680 insignificant because a trailing `:' is a C++ error already.
681
6822009-05-19 Akim Demaille <demaille@gostai.com>
683
684 remove useless variable.
685 * src/getargs.c (skeleton_arg): Remove now useless variable.
686 Should help the compiler see that this printf-like call is sane.
687
6882009-05-11 Akim Demaille <demaille@gostai.com>
689
690 doc: use C++ headers.
691 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
692 headers.
693
6942009-05-05 Akim Demaille <demaille@gostai.com>
695
696 fix hexadecimal token number support.
697 * src/scan-gram.l: Catch incorrect ids after hexadecimal numbers.
698
6992009-05-05 Akim Demaille <demaille@gostai.com>
700
701 tests: check token numbers.
702 * tests/input.at (Numbered tokens): New.
703
7042009-05-04 Akim Demaille <demaille@gostai.com>
705
706 bison: catch bad symbol names.
707 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
708 * tests/input.at: Adjust.
709
7102009-05-04 Akim Demaille <demaille@gostai.com>
711
712 space changes.
713 * src/scan-gram.l: Untabify to be robust to zealous editors.
714
7152009-05-04 Akim Demaille <demaille@gostai.com>
716
717 identifiers: dashes are letters.
718 Dashes can now start identifiers (symbols and directives).
719
720 * src/scan-gram.l ({letter}): Add dash.
721 ({id}): Remove it.
722 * tests/input.at (Symbols): Adjust.
723 Remove stray comment.
724 * tests/regression.at (Invalid inputs): Adjust error message.
725 * doc/bison.texinfo (Symbols): Update.
726
7272009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
728
729 Declare %code to be a permanent feature.
730 * NEWS (2.4.2): Here.
731 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
732 experimental.
733 (Decl Summary): Likewise.
734
7352009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
736
737 Convert underscores to dashes in some %define variable names.
738 For now, just api.push-pull and lr.keep-unreachable-states.
739 Maintain old names for backward compatibility.
740 * NEWS (2.5): Document.
741 * data/c.m4 (b4_identification): Update comment.
742 * data/yacc.c: Update access.
743 * doc/bison.texinfo: Update.
744 * etc/bench.pl.in (bench_grammar): Update use.
745 * src/files.c (tr): Move to...
746 * src/getargs.c, src/getargs.h (tr): ... here because I can't
747 think of a better place to expose it. My logic is that, for all
748 uses of tr so far, command-line arguments can be involved, and
749 getargs.h is already included.
750 * src/main.c (main): Update access.
751 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
752 variable names to new variable names before assigning value.
753 * src/reader.c (reader): Update setting default.
754 * tests/calc.at: Update uses.
755 * tests/conflicts.at (Unreachable States After Conflict
756 Resolution): Update use.
757 * tests/input.at (%define enum variables): Update use.
758 (%define backward compatibility): New test group.
759 * tests/push.at: Update uses.
760 * tests/reduce.at: Update uses.
761 * tests/torture.at: Update uses.
762
7632009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
764
765 Set all front-end %define defaults in one place.
766 * src/main.c (main): Move lr.keep_unreachable_states default...
767 * src/reader.c (reader): ... to here.
768
7692009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
770
771 Rename lr.default_reductions to lr.default-reductions.
772 * NEWS (2.5): Here.
773 * doc/bison.texinfo: Here.
774 * src/lalr.c (initialize_LA): Here.
775 * src/print.c (print_reductions): Here.
776 * src/reader.c (reader): Here.
777 * src/tables.c (action_row): Here.
778 * tests/input.at (%define enum variables): Here.
779 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
780
7812009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
782
783 Pacify ./configure --enable-gcc-warnings.
784 * tests/input.at (Symbols): Prototype yyerror and yylex.
785
7862009-04-21 Akim Demaille <demaille@gostai.com>
787
788 tests: check the use of dashes and periods in symbols.
789 * tests/input.at (Symbol): New test group.
790
7912009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
792
793 Document how `%define "var" "value"' is not M4-friendly.
794 * src/parse-gram.y (variable): In comments here.
795
7962009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
797
798 Add copyright updates missed during previous cherry pick.
799 * src/output.c: Here.
800 * src/parse-gram.y: Here.
801 * src/scan-gram.l: Here.
802
8032009-04-20 Akim Demaille <demaille@gostai.com>
804
805 variables: accept dashes.
806 * src/scan-gram.l ({id}): Also accept dashes after the initial
807 letter.
808 ({directive}): Use {id}.
809 * src/parse-gram.y: Comment and formatting changes.
810 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
811 symbols.
812 * src/complain.h, src/complain.c (yacc_at): New.
813 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
814 symbol names.
815 * src/output.c (token_definitions_output): Do not #define token
816 names with dashes.
817
8182009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
819
820 Clean up recent patches a little.
821 Reported by Akim Demaille.
822 * doc/bison.texinfo (Understanding): Fix typos.
823 * src/print.c (print_reductions): Don't use negated variable.
824
8252009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
826
827 List accepted values for a %define enum variable with an invalid value.
828 Suggested by Akim Demaille at
829 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
830 * data/bison.m4 (_b4_percent_define_check_values): Implement.
831 * src/muscle_tab.c (muscle_percent_define_check_values): Implement.
832 * tests/input.at (%define lr.default_reductions invalid values): Merge
833 into...
834 (%define enum variables): ... here, and update output.
835
8362009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
837
838 Rename "default rule" to "default reduction".
839 This includes changing variable names in code, changing
840 comments, and renaming %define lr.default_rules to %define
841 lr.default_reductions.
842 * NEWS (2.5): Update IELR documentation.
843 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c:
844 Adjust YYDEFACT and yydefact_ documentation.
845 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
846 and lr.type documentation. Make some other wording
847 improvements.
848 (Glossary): Adjust cross-references and Default Reduction
849 definition.
850 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
851 Remove a confusing comment pointed out by Akim Demaille.
852 (initialize_LA): Adjust code.
853 * src/print-xml.c (print_reductions): Adjust code.
854 * src/print.c (print_reductions): Adjust code.
855 * src/reader.c (reader): Adjust code.
856 * src/tables.c (action_row): Adjust code.
857 (token_actions): Adjust code.
858 * src/tables.h: Adjust YYDEFACT documentation.
859 * tests/input.at (%define lr.default_rules invalid values):
860 Rename test group to...
861 (%define lr.default_reductions invalid values): ... this, and
862 update grammar file and expected output.
863 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
864 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
865
8662009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
867
868 Document %define lr.type and lr.default_rules.
869 * NEWS (2.5): Add an entry.
870 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
871 besides just LALR(1) and GLR(1).
872 * doc/bison.texinfo (Introduction): Likewise.
873 (Language and Grammar): Bison is no longer limited to LALR(1)
874 restrictions.
875 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
876 when trying to distinguish from GLR. Talk about LR(1) grammars
877 rather than LALR(1) grammars.
878 (Decl Summary): In %define api.push_pull entry, say it applies
879 to deterministic parsers in C rather than LALR(1) parsers in C.
880 Add lr.default_rules entry.
881 Add lr.type entry.
882 (Mystery Conflicts): Bison is no longer limited to LALR(1)
883 restrictions.
884 (Generalized LR Parsing): Same changes as for the previous GLR
885 section.
886 (Memory Management): Say deterministic rather than LALR(1).
887 (Understanding): Correct some bison output.
888 Index discussion of "accepting state".
889 Say deterministic rather than LALR(1).
890 (Bison Options): In --yacc entry, say deterministic rather than
891 LALR(1).
892 In --report, --graph, and --xml entries, just don't mention
893 LALR(1).
894 (C++ Parsers): Say deterministic rather than LALR(1).
895 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
896 (Glossary): Add Accepting State, Consistent State, Default Rule,
897 and IELR(1) definitions.
898 In Generalized LR (GLR) definition, make same changes as in
899 previous GLR sections.
900 In LALR(1) definition, say Bison uses LALR(1) by default rather
901 than implying Bison is limited to LALR(1).
902 (LocalWords): Add IELR.
903
9042009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
905
906 Finish implementing %define lr.type.
907 Its value can be "LALR", "IELR", or "canonical LR".
908 * lib/timevar.def (TV_IELR_PHASE1): New var.
909 (TV_IELR_PHASE2): New var.
910 (TV_IELR_PHASE3): New var.
911 (TV_IELR_PHASE4): New var.
912 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
913 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
914 Sbitset.h, ielr.h, and ielr.c.
915 * src/getargs.h, src/getargs.c (enum trace, trace_args,
916 trace_types): Add trace_ielr.
917 * src/lalr.h, src/lalr.c (ngotos): Export it.
918 (F): Rename to...
919 (goto_follows): ... this, update all uses, and export it.
920 (set_goto_map): Export it.
921 (map_goto): Export it.
922 (compute_lookahead_tokens): Don't free goto_follows yet. Now
923 handled in ielr.
924 (initialize_LA): Export it. Move lookback allocation to...
925 (lalr): ... here because, for canonical LR, initialize_LA must
926 be invoked but lookback and much of the rest of LALR isn't
927 needed.
928 * main.c (main): Instead of lalr, invoke ielr, which invokes
929 lalr.
930 * src/reader.c (reader): Default lr.type to "LALR".
931 Default lr.default_rules to "accepting" if lr.type is "canonical
932 LR". Leave the default as "all" otherwise.
933 Check for a valid lr.type value.
934 * src/state.h, src/state.c (struct state_list): Add state_list
935 member.
936 (state_new): Initialize state_list member to NULL.
937 (state_new_isocore): New function, exported.
938 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
939 exercises all values of lr.type.
940 (GNU AWK Grammar): Rename test group to...
941 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
942 AT_TEST_EXISTING_GRAMMAR.
943 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
944 (GNU pic Grammar): Rename test group to...
945 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
946 AT_TEST_EXISTING_GRAMMAR.
947 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
948 all values of lr.type.
949 (Single State Split): New test groups using AT_TEST_LR_TYPE.
950 (Lane Split): Likewise.
951 (Complex Lane Split): Likewise.
952 (Split During Added Lookahead Propagation): Likewise.
953
9542009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
955
956 Add new files for IELR and canonical LR implementation.
957 * src/AnnotationList.c: New.
958 * src/AnnotationList.h: New.
959 * src/InadequacyList.c: New.
960 * src/InadequacyList.h: New.
961 * src/Sbitset.c: New.
962 * src/Sbitset.h: New.
963 * src/ielr.c: New.
964 * src/ielr.h: New.
965
9662009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
967
968 Implement %define lr.default_rules.
969 Its value describes the states that are permitted to contain
970 default rules: "all", "consistent", or "accepting".
971 * src/reader.c (reader): Default lr.default_rules to "all".
972 Check for a valid lr.default_rules value.
973 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
974 is "accepting", then only mark the accepting state as
975 consistent.
976 (initialize_LA): Tell state_lookahead_tokens_count whether
977 lr.default_rules is "accepting".
978 * src/tables.c (action_row): If lr.default_rules is not "all",
979 then disable default rules in inconsistent states.
980 * src/print.c (print_reductions): Use this opportunity to
981 perform some assertions about whether lr.default_rules was
982 obeyed correctly.
983 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
984 helps with checking the parser tables for a grammar.
985 * tests/input.at (%define lr.default_rules invalid values): New
986 test group.
987 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
988 AT_TEST_TABLES_AND_PARSE.
989 (`no %define lr.default_rules'): New test group generated by
990 AT_TEST_LR_DEFAULT_RULES.
991 (`%define lr.default_rules "all"'): Likewise.
992 (`%define lr.default_rules "consistent"'): Likewise.
993 (`%define lr.default_rules "accepting"'): Likewise.
994
9952009-04-20 Akim Demaille <demaille@gostai.com>
996
997 Consistently refer to Yacc, not YACC.
998 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
999
10002009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
1001
1002 Pacify make maintainer-check-posix.
1003 * tests/input.at (%define, --define): Move bison command-line
1004 options before grammar file name.
1005
10062009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1007
1008 Document semicolon warnings.
1009 * NEWS (2.5): Here.
1010
10112008-12-08 Akim Demaille <demaille@gostai.com>
1012
1013 Fix portability issue in the test suite.
1014 * tests/local.at (AT_MATCHES_CHECK): New.
1015 Based on Perl instead of Sed. Sed has too many portability
1016 pitfalls, not ever Sed is GNU Sed.
1017 * tests/actions.at (Fix user actions without a trailing semicolon):
1018 Use it.
1019
10202008-12-07 Di-an Jan <dianj@freeshell.org>
1021
1022 Implement the FIXME that ends an user action with a semicolon
1023 if it seems necessary.
1024 * src/scan-code.l (flex rules section): Flag cpp directive from
1025 any `#' to the first unescaped end-of-line. Semicolon is not
1026 needed after `;', `{', '}', or cpp directives and is needed after
1027 any other token (whitespaces and comments have no effect).
1028 * tests/actions.at (Fix user actions without a trailing semicolon):
1029 New test.
1030 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
1031 to make user actions complete statements.
1032 Adjust column numbers in error messages.
1033 * tests/regression.at (Fix user actions without a trailing semicolon):
1034 Remove. Covered by new test.
1035
10362009-04-14 Akim Demaille <demaille@gostai.com>
1037
1038 doc: minor fixes.
1039 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
1040 (Table of Symbols): Remove duplicate entry for %debug.
1041
10422009-04-10 Eric Blake <ebb9@byu.net>
1043
1044 submodules: update to latest
1045 * submodules/autoconf: Use latest upstream Autoconf.
1046
10472009-04-06 Eric Blake <ebb9@byu.net>
1048
1049 Work around autoconf 2.63b bug in testsuite.
1050 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
1051 autoconf bug related to # in test.
1052
10532009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1054
1055 * NEWS (2.5): Describe new -D/--define feature.
1056
10572008-11-10 Akim Demaille <demaille@gostai.com>
1058
1059 --trace=muscles
1060 * src/getargs.h, src/getargs.c (trace_muscle): New.
1061 (trace_types, trace_args): Support it.
1062 * src/output.c (output_skeleton): Use it.
1063
10642008-11-10 Akim Demaille <demaille@gostai.com>
1065
1066 muscles_output.
1067 * src/output.c (muscles_output): New, extracted from...
1068 (output_skeleton): here.
1069 Adjust.
1070
10712008-11-21 Akim Demaille <demaille@gostai.com>
1072
1073 Display the changes in cross-options.texi.
1074 * build-aux/cross-options.pl ($sep): New, to separate items.
1075 * doc/Makefile.am ($(srcdir)/cross-options.texi): Use diff to display
1076 the changes.
1077
10782008-11-20 Di-an Jan <dianj@freeshell.org>
1079
1080 Improves options in the manual.
1081 * doc/bison.texinfo (-g, -x): Add space before argument.
1082 (Option Cross Key): Implement FIXME: listing directives also.
1083 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
1084 (Short Option): Special case -d. Put arguments inside @option.
1085 (Bison Directive): Add column, automatically extracted from
1086 src/scan-gram.l (actual name passed as the first argument)
1087 with special case for %define.
1088 * doc/Makefile.am (doc/cross-options.texi): Pass src/scan-gram.l
1089 to build-aux/cross-options.pl.
1090 * src/getargs.c (usage): Document limitations of cross-options.pl.
1091 * src/scan-gram.l: Likewise.
1092
10932009-02-25 Akim Demaille <demaille@gostai.com>
1094
1095 Copyright years.
1096 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
1097
10982008-12-08 Akim Demaille <demaille@gostai.com>
1099
1100 Install autoconf as a submodule to get m4sugar.
1101 * .gitmodules: Add submodules/autoconf.
1102 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
1103 submodules/autoconf.
1104
11052008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1106
1107 Simplify last patch slightly.
1108 * src/getargs.c (getargs): Here.
1109
11102008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1111
1112 Fix last warning from --enable-gcc-warnings.
1113 * src/getargs.c (getargs): Don't assign const address to non-const
1114 pointer.
1115
11162008-11-17 Di-an Jan <dianj@freeshell.org>
1117
1118 Handle --enable-gcc-warnings.
1119 * src/getargs.c (command_line_location): Set parameters to void.
1120
11212008-11-11 Akim Demaille <demaille@gostai.com>
1122
1123 AT_FULL_COMPILE.
1124 * tests/actions.at, tests/regression.at: Use it.
1125
11262008-11-07 Akim Demaille <demaille@gostai.com>
1127
1128 Pass command line location to skeleton_arg and language_argmatch.
1129 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
1130 The location argument is now mandatory.
1131 Adjust all dependencies.
1132 (getargs): Use command_line_location.
1133
11342008-11-07 Akim Demaille <demaille@gostai.com>
1135
1136 -D, --define.
1137 * src/getargs.c (usage): Document -D.
1138 Fix help string for --locations.
1139 (command_line_location): New.
1140 (short_options, long_options, getargs): Support -D, --define.
1141 (getargs): Move -d support at the right place.
1142 * doc/bison.texinfo (Bison Options): Update.
1143 * tests/input.at (%define, --define): New.
1144
11452008-11-07 Akim Demaille <demaille@gostai.com>
1146
1147 Initialize the muscle table before parsing the command line.
1148 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
1149 (getargs): Define file_name.
1150 * src/main.c (main): Initialize muscle_tab before calling
1151 getargs.
1152 * src/muscle_tab.c (muscle_init): No longer define file_name, as
1153 its value is not available yet.
1154
11552008-11-09 Akim Demaille <demaille@gostai.com>
1156
1157 Require the generation of parse-gram.output.
1158 * src/Makefile.am (YACC): Pass --report=all.
1159
11602009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1161
1162 * NEWS (2.5): New stub.
1163
11642009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1165
1166 Fix options documentation.
1167 * build-aux/cross-options.pl: As in --help output, write optional
1168 arguments as [=ARG] not =[ARG].
1169 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
1170
11712008-11-07 Akim Demaille <demaille@gostai.com>
1172
1173 Fix --help.
1174 * src/getargs.c (usage): Fix help string for -W.
1175
11762008-11-07 Akim Demaille <demaille@gostai.com>
1177
1178 Handle more general types of option arguments.
1179 * build-aux/cross-options.pl: The argument ends at the first
1180 space, not the first non-symbol character.
1181 Use @var for each word appearing the argument description.
1182
11832009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1184
1185 Remove spurious initial empty lines.
1186 * data/location.cc: End the @output lines with an @.
1187
11882008-11-04 Akim Demaille <demaille@gostai.com>
1189
1190 Remove spurious initial empty lines.
1191 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1192 * data/yacc.c: End the @output lines with an @.
1193
11942009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1195
1196 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
1197 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
1198 requirements for a correct m4 are stricter.
1199 * m4/m4.m4: Replace with Autoconf 2.63's m4/m4.m4.
1200 * configure.ac: Update to use AC_PROG_GNU_M4.
1201 Reported by Eric Blake.
1202
12032009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1204
1205 Help with updating web manual.
1206 * HACKING: Incorporate instructions from gnulib/doc/README.
1207 * bootstrap.conf (gnulib_modules): Add gendocs.
1208
12092009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1210
1211 Fix strange %define locations for default values.
1212 Reported by Akim Demaille at
1213 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
1214 and discussed again starting at
1215 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
1216 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
1217 because location information is bogus.
1218 Use angle brackets to delimit fake file name because square brackets
1219 look like underexpanded m4. Choose a better fake file name.
1220 Use negative line numbers.
1221 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
1222 * src/location.c (location_print): If line for a boundary is negative,
1223 only print that boundary's file name.
1224 * src/location.h: Document that.
1225 * tests/skeletons.at (%define Boolean variables: invalid skeleton
1226 defaults): Update output.
1227
12282008-11-07 Akim Demaille <demaille@gostai.com>
1229
1230 Locations without columns for command line arguments.
1231 * src/location.c (location_print): Don't display negative columns.
1232 * src/location.h: Document this.
1233
12342009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
1235
1236 Add reminder about uploading public key to keys.gnupg.net.
1237 * HACKING (Release Procedure): Here.
1238
12392009-03-31 Akim Demaille <demaille@gostai.com>
1240
1241 bootstrap: --help to stdout.
1242 * bootstrap (usage): Don't send --help to stderr.
1243 Use a here doc instead of a long string.
1244
12452009-03-31 Akim Demaille <demaille@gostai.com>
1246
1247 bootstrap: README-hacking no longer exists
1248 * bootstrap (checkout_only_file): Set to HACKING.
1249
12502009-03-26 Akim Demaille <demaille@gostai.com>
1251
1252 doc: merge HACKING and README-hacking.
1253 Two files is confusing.
1254 Reported by Alexandre Duret-Lutz.
1255
1256 * README-hacking: Merge into...
1257 * HACKING (Working from the repository): here.
1258
12592009-03-26 Akim Demaille <demaille@gostai.com>
1260
1261 doc: update README-hacking.
1262 * README-hacking: We now use git and git submodules.
1263 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
1264
12652009-03-26 Akim Demaille <demaille@gostai.com>
1266
1267 lalr1.cc: avoid GCC 4.3 warnings.
1268 GCC 4.3 now warns about "a || b && c" and asks for explicit
1269 parentheses.
1270 Reported by Alexandre Duret-Lutz.
1271 * data/location.cc: Update copyright years.
1272 (Position::operator==): Use parens to make precedence explicit.
1273 Compare lines and columns first, as they are more likely to be
1274 different, and they are faster to compare.
1275
12762009-03-26 Akim Demaille <demaille@gostai.com>
1277
1278 gnulib: update.
1279 * gnulib: Update to latest.
1280 * lib/Makefile.am (AM_CPPFLAGS): It is now defined by gnulib, so
1281 use +=.
1282
12832009-01-08 Akim Demaille <demaille@gostai.com>
1284
1285 Fix grep portability issues.
1286 Grep on Solaris does not support -q.
1287 Reported by Summum Bonum.
1288
1289 * NEWS: Add a stub for 2.4.2.
1290 * THANKS: Add Summum Bonum.
1291 * tests/atlocal.in (EGREP): New.
1292 (CC, CXX, XSLTPROC): Make it possible to override them via
1293 envvars.
1294 * tests/java.at: Use $EGREP instead of egrep.
1295 Use AT_CHECK's ignore instead of grep's -q.
1296
12972008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1298
1299 Version 2.4.1.
1300 * NEWS: Set version and date.
1301 * lib/Makefile.am: Update copyright year.
1302 * tests/atlocal.in: Update copyright year.
1303
13042008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1305
1306 Semicolon feature removal is not about future language support.
1307 * NEWS: The semicolon feature is no longer active for newer languages,
1308 so don't claim that it causes trouble for them.
1309
13102008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1311
1312 * gnulib: Update submodule to HEAD.
1313
13142008-12-09 Akim Demaille <demaille@gostai.com>
1315
1316 Update data/README.
1317 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
1318
13192008-12-05 Eric Blake <ebb9@byu.net>
1320
1321 Build testsuite with newer autoconf.
1322 * tests/output.at (m4_expand): Don't override in newer autoconf,
1323 where the underlying implementation changed.
1324 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
1325 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
1326 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
1327 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
1328 since some of them contain unbalanced ')'.
1329
13302008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
1331
1332 * NEWS: Clarify a little.
1333
13342008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
1335
1336 * NEWS: Update for recent changes.
1337
13382008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1339
1340 Fix unexpanded macros in GLR defines file.
1341 Reported by Csaba Raduly at
1342 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
1343 * THANKS (Csaba Raduly): Add.
1344 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
1345 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
1346 lexer in a separate module that includes the defines file.
1347 (AT_CHECK_CALC): Use AT_FULL_COMPILE and request compilation of lexer
1348 source.
1349 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
1350 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
1351 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
1352 (AT_DATA_SOURCE_PROLOGUE): New.
1353 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
1354 (AT_DATA_SOURCE): New.
1355 (AT_FULL_COMPILE): New, copied from master branch and extended to
1356 support an additional source file.
1357
13582008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1359
1360 Don't let maintainer-*-check targets force a version update.
1361 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
1362 handled.
1363
13642008-11-17 Di-an Jan <dianj@freeshell.org>
1365
1366 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
1367 Align menus. Adjust word wrapping. Use node names for menu names.
1368 (Examples): Don't abbreviate node names.
1369 (LocalWords): Remove abbreviations.
1370 (Copying): Make description a sentence.
1371 (Java Action Features): Remove period to match the rest of menu.
1372
13732008-11-11 Paolo Bonzini <bonzini@gnu.org>
1374
1375 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
1376 * configure.ac: Adjust usage.
1377 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1378 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1379 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
1380
13812008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1382
1383 Don't add a semicolon to actions for %skeleton or %language.
1384 It breaks Java test cases as reported by Akim Demaille.
1385 * src/scan-code.l: Implement.
1386
13872008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1388
1389 Clean up %skeleton and %language priority implementation.
1390 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
1391 remove static qualifier because others will soon need to see it.
1392 (language_prio): Likewise.
1393 (getargs): Use command_line_prio rather than 0.
1394 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
1395 enum fields.
1396 (skeleton_prio): Extern it.
1397 (language_prio): Extern it.
1398 * src/parse-gram.y: Use grammar_prio rather than 1.
1399
14002008-11-04 Akim Demaille <demaille@gostai.com>
1401
1402 * NEWS: Mention the trailing semicolon in action.
1403
14042008-11-04 Akim Demaille <demaille@gostai.com>
1405
1406 Reformat NEWS.
1407 * NEWS: Use more outline-mode markup.
1408 Suggested by Jim Meyering.
1409
14102008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
1411
1412 Fix user actions without a trailing semicolon.
1413 Reported by Sergei Steshenko at
1414 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
1415 * THANKS (Sergei Steshenko): Add.
1416 * src/scan-code.l (SC_RULE_ACTION): Fix it.
1417 * tests/regression.at (Fix user actions without a trailing semicolon):
1418 New test case.
1419
14202008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1421
1422 Initiate further development.
1423 * NEWS: Create an empty section for new entries.
1424 * gnulib: Update submodule to HEAD.
1425
14262008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1427
1428 * NEWS: Version 2.4.
1429
14302008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1431
1432 Prepare for next release.
1433 * NEWS: Briefly mention changes since 2.3b.
1434 * README: Say GNU m4 1.4.6, which we've been requiring in release
1435 announcements already, not 1.4.3, which breaks the build.
1436
14372008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1438
1439 Say %language is experimental.
1440 We're thinking of extending it's effect on output file naming. See the
1441 thread at
1442 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
1443 * NEWS: Say it's experimental.
1444 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
1445 recommend it over %skeleton for now.
1446 (Bison Options): Likewise.
1447 (C++ Bison Interface): Use %skeleton not %language.
1448 (Calc++ Parser): Use %skeleton not %language.
1449 * src/getargs.c (usage): Say it's experimental.
1450
14512008-11-01 Di-an Jan <dianj@freeshell.org>
1452 Paolo Bonzini <bonzini@gnu.org>
1453
1454 Support all Java parser class modifiers.
1455 * data/java.m4 (b4_percent_define_get3): New.
1456 (b4_final_if, b4_strictfp_if): New.
1457 * data/lalr1.java (final, strictfp, extends, implements): Support.
1458 * doc/bison.texinfo (final, strictfp, extends, implements): Add
1459 documentation.
1460 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
1461 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
1462 (AT_CHECK_JAVA_GREP): New.
1463 (Java parser class modifiers): New test.
1464 (Java parser class extends and implements): New test.
1465
1466 Model exception propagation better with throws and lex_throws.
1467 * data/java.m4 (b4_list2): New.
1468 (throws): Change default.
1469 * data/lalr1.java (yyaction): Add throws.
1470 (parse): Add lex_throws in addition to throws.
1471 * doc/bison.texinfo (throws, lex_throws): Add documentation.
1472 * tests/java.at (Java throws specifications): New test.
1473
1474 Improve documentation for Java parsers.
1475 * doc/bison.texinfo (Java Parsers): Add subsections.
1476 Don't quote first argument of %define.
1477 (Java Bison Interface): Document output files. Move documentation
1478 of parser class and merge into Java Parser Interface. Document
1479 features that error out. Document directives with no effect.
1480 Move note about Javadoc higher.
1481 (Java Semantic Values): Explicitly mention stype.
1482 Document that generic types cannot be used.
1483 (Java Location Values): Use @deftypeivar. Document constructors.
1484 Correct return value for toString.
1485 (Java Parser Interface): List undocumented constants/fields.
1486 Move documentation of fields added by %parse-param closer to list
1487 of members. Document that token names are added as fields.
1488 Document constructors accurately. Remove error method.
1489 (Java Scanner Interface): Move note on %pure-parser to Java Bison
1490 Interface. Describe %code lexer and yylex accutately.
1491 Remove documentation that does not match the code.
1492 (Java Action Features): New.
1493 (Java Differences): Add reference. Add item on semantic values.
1494 Add note about @{ ... @}. Clarify %% epilogue placement.
1495 (Java Declarations Summary): New.
1496
1497 Fix Java skeleton.
1498 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
1499 (b4_remove_comma): Quote test argument.
1500 (b4_identification): Remove "bison" field.
1501 * tests/java.at (Java parser class and package names): New test.
1502 (Java %parse-param and %lex-param): New test.
1503 (Java stype, position_class and location_class): New test.
1504
15052008-10-31 Di-an Jan <dianj@freeshell.org>
1506
1507 * data/lalr1.jave: Update copyright years.
1508 (YYParser): Correct name of "generated from" file in Javadoc:
1509 use b4_file_name instead of @ofile@.
1510 (Location constructor): Correct Javadoc parameter name.
1511 (yylloc): Add missing opening m4 quote after b4_location_if.
1512 This removes a stray [ in the Javadoc of Lexer.getStartPos.
1513 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
1514 (YYParser constructor): Correct Javadoc parameter name.
1515
15162008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
1517
1518 Always put auxiliary code files in the same dir as other output files.
1519 * src/files.c (compute_file_name_parts): When the user specifies
1520 --output but not --file-prefix, extract the directory prefix from the
1521 file prefix not from the grammar file name. This affects the location
1522 of files like location.hh generated by the C++ skeleton. The includes
1523 in the other output files require this fix.
1524 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
1525 for expected output files.
1526 (Output files): Add a test for the above.
1527
15282008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
1529
1530 * gnulib: Update submodule to HEAD.
1531
15322008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1533
1534 Update copyright year.
1535 * src/files.c: Here.
1536
15372008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
1538
1539 Don't overwrite the input file.
1540 * src/files.c (output_file_name_check): Fatal error if using input file
1541 for output.
1542 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
1543 argument.
1544 (Conflicting output files): Add test.
1545
15462008-10-28 Akim Demaille <demaille@gostai.com>
1547
1548 Space changes.
1549 * data/lalr1.cc: Formatting changes.
1550
15512008-10-28 Akim Demaille <demaille@gostai.com>
1552
1553 Don't define debugging functions when !YYDEBUG.
1554 * data/lalr1.cc (debug_stream, set_debug_stream)
1555 (debug_level_type, debug_level, set_debug_level): Don't
1556 declare them when YYDEBUG is not defined.
1557 The implementation are already YYDEBUG-aware.
1558
15592008-10-28 Akim Demaille <demaille@gostai.com>
1560
1561 Prefer "continue" for empty loop bodies.
1562 * etc/bench.pl.in: Use "continue" instead of {}.
1563
15642008-10-28 Akim Demaille <demaille@gostai.com>
1565
1566 Space and comments changes.
1567 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
1568 * data/c.m4, data/lalr1.cc: Space changes.
1569
15702008-10-28 Akim Demaille <demaille@gostai.com>
1571
1572 Make gnulib a submodule.
1573 * gnulib: New.
1574 * .gitmodules (gnulib): New.
1575
15762008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1577
1578 Fix yyerror_range for user-defined location type in C++. Reported by
1579 Georg Sauthoff at
1580 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
1581 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
1582 * THANKS (Georg Sauthoff): Add.
1583
15842008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1585
1586 Update several administrative files mainly to facilitate releasing.
1587 * HACKING (Administrivia): Make the git-merge-changelog notes more
1588 helpful.
1589 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
1590 (Release Procedure): Update for git and add numerous details that were
1591 previously missing.
1592 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
1593 * maint.mk (announcement): Don't list bison as a bootstrap tool so
1594 that announcements don't claim we bootstrapped with whatever bison
1595 happened to be in PATH. Add flex as a bootstrap tool.
1596 * Makefile.maint: Remove, previously replaced by maint.mk.
1597 * Makefile.cfg: Remove, and migrate settings to...
1598 * cfg.mk: ... here for the sake of `make announcement'.
1599 * bootstrap.conf (gnulib_modules): Add announce-gen.
1600 * README: Say GNU Bison instead of just Bison. Suggested by Karl
1601 Berry.
1602
16032008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
1604
1605 Small but important bugfixes for the Java skeleton.
1606 * data/lalr1.java (yyerror): Change Location to b4_location_type.
1607 (yy_symbol_print): Call toString on yyvaluep.
1608
16092008-08-29 Akim Demaille <demaille@gostai.com>
1610
1611 Clarify UPDATED use.
1612 * doc/bison.texinfo: It refers to the last edition of this file,
1613 not to the release date of Bison.
1614 Reported by Joel E. Denny.
1615
16162008-08-29 Akim Demaille <demaille@gostai.com>
1617
1618 * README: Update FAQ pointer.
1619 Reported by Joel E. Denny.
1620
16212008-08-27 Eric Blake <ebb9@byu.net>
1622
1623 Resync m4sugar from autoconf.
1624 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
1625 (m4_init): Adjust to latest m4.git changes.
1626 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
1627 effects.
1628 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
1629 (_m4_list_cmp): Reduce side effects.
1630
16312008-08-27 Akim Demaille <demaille@gostai.com>
1632
1633 Check yyerrok in calc.at.
1634 * tests/calc.at (calc.y): Use yyerrok on "( error )".
1635 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
1636 expected.
1637
16382008-08-27 Akim Demaille <demaille@gostai.com>
1639
1640 Support yyerrok in lalr1.cc.
1641 YYBACKUP is still to import back into lalr1.cc.
1642 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
1643
16442008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1645
1646 For maintainer-check*, don't recompile for a $(VERSION) update.
1647 * cfg.mk: New file.
1648 (_is-dist-target): Override the one in GNUmakefile.
1649 * Makefile.am (EXTRA_DIST): Add cfg.mk.
1650
16512008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1652
1653 Update for recent change to gnulib.
1654 * src/parse-gram.y: Don't include strverscmp.h. It comes from
1655 string.h now.
1656
16572008-08-15 Eric Blake <ebb9@byu.net>
1658
1659 Remaining m4sugar merge from autoconf.
1660 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
1661 * data/m4sugar/foreach.m4: New file, copied from autoconf.
1662 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
1663 * src/output.c (output_skeleton): Tell m4 how to find it.
1664
1665 Partial m4sugar merge from autoconf: m4_map.
1666 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
1667 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
1668 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
1669 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
1670 for empty list.
1671 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
1672 Likewise.
1673 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
1674 declares it.
1675
16762008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
1677
1678 Keep .version and PACKAGE_VERSION in sync.
1679 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
1680 dependency, and add comments justifying this in more detail. Discussed
1681 starting at
1682 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
1683
16842008-08-06 Eric Blake <ebb9@byu.net>
1685
1686 Partial m4sugar merge from autoconf: m4_shiftn.
1687 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
1688 (m4_shift2, m4_shift3): New macros.
1689 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
1690 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
1691 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
1692 * data/java.m4 (b4_remove_comma): Likewise.
1693
1694 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
1695 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
1696 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
1697 (m4_init): Consolidate wrapped text into single m4_wrap.
1698 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
1699 in wrapped text.
1700
17012008-08-05 Eric Blake <ebb9@byu.net>
1702
1703 Partial m4sugar merge from autoconf: builtins, version.m4.
1704 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
1705 (m4_prepend): Remove, as it is unused and inherently quadratic,
1706 whereas m4_append is linear in newer m4.
1707 (m4_mkstemp): New builtin.
1708 (m4_symbols): Make rename conditional.
1709 (m4_version_prereq): Ensure fatal error if used in bison, which
1710 intentionally lacks version.m4.
1711
1712 Fix comments in m4sugar.
1713 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
1714
17152008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1716
1717 Update for recent .gitignore fix in Gnulib.
1718 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
1719 anchored .gitignore entries.
1720
17212008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1722
1723 Set gnu or gnits strictness.
1724 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
1725 development and gnits strictness for releases. Based on Eric Blake's
1726 suggestion at
1727 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
1728
17292008-07-31 Paolo Bonzini <bonzini@gnu.org>
1730
1731 * NEWS: Clarify documentation of %language.
1732
17332008-07-31 Paolo Bonzini <bonzini@gnu.org>
1734
1735 Support usage of git-merge-changelog.
1736 * .gitattributes: New.
1737 * HACKING: Document usage of git-merge-changelog.
1738 * bootstrap: Install git-merge-changelog entries in .git/config
1739 if appropriate.
1740
17412008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1742
1743 Remove remaining dependence on CVS Id keyword.
1744 * ChangeLog: For the sake of people still using CVS, don't use dollars
1745 when mentioning Id.
1746 * data/xslt/bison.xsl: Remove Id from header comments, where it was
1747 unusual anyway.
1748 * data/xslt/xml2dot.xsl: Likewise.
1749 * data/xslt/xml2text.xsl: Likewise.
1750 * data/xslt/xml2xhtml.xsl: Likewise.
1751 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
1752 * doc/Makefile.am (neutralize): Remove, no longer needed.
1753 (.x.1): Don't use neutralize.
1754 (edit): Don't substitute for ID.
1755 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
1756
17572008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1758
1759 Fix dependence on computed configure variables.
1760 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
1761 $(top_srcdir)/configure.ac so that changes to computed variables, such
1762 as PACKAGE_VERSION, are seen.
1763 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
1764
17652008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
1766
1767 Update copyright dates for recent changes.
1768 * Makefile.am: Here.
1769 * src/Makefile.am: Here.
1770 * src/reduce.c: Here.
1771 * tests/reduce.at: Here.
1772
17732008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
1774
1775 Use git-version-gen for version names between releases.
1776 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
1777 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
1778 * .prev-version: New.
1779 * .version.in: Remove.
1780 * ChangeLog: Remove the Id previously used for capturing the CVS
1781 revision.
1782 * GNUmakefile: Remove, now copied from Gnulib.
1783 * Makefile.am: Add code suggested by comments in
1784 build-aux/git-version-gen.
1785 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
1786 .prev-version, and .version.
1787 * NEWS (2.3b+): Rename to...
1788 (?.?): ... this because we're dropping the "+" version naming scheme,
1789 but, in general, we still can't be sure of our next release name.
1790 * bootstrap: Add a quick hack to remove from .gitignore the
1791 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
1792 entry. This should really be fixed in gnulib instead.
1793 * bootstrap.conf (gnulib_modules): Add gnumakefile.
1794 * configure.ac (AC_INIT): Set version name by invoking
1795 build-aux/git-version-gen.
1796 (AC_CONFIG_FILES): Remove .version, now generated by
1797 build-aux/git-version-gen.
1798 * maint.mk: New, copied from coreutils.
1799 * doc/.cvsignore (bison.1): Add.
1800 * doc/.gitignore (/bison.1): Add.
1801 * doc/bison.1: Remove, generated.
1802 * src/.cvsignore (revision.c): Remove.
1803 * src/.gitignore (/revision.c): Remove.
1804 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
1805 (BUILT_SOURCES): Remove revision.c.
1806 (revision.c): Remove.
1807 * src/getargs.c (version): Don't print revision after the VERSION.
1808 * src/revision.h: Remove.
1809
18102008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1811
1812 Fix untranslatable composition of sentences. Reported by Goran
1813 Uddeborg at
1814 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
1815 * THANKS (Goran Uddeborg): Add.
1816 * src/reduce.c (reduce_print): Report the number of nonterminals and
1817 rules useless in the grammar in separate sentences.
1818 * tests/reduce.at (Useless Rules): Update output.
1819 (Reduced Automaton): Likewise.
1820 (Underivable Rules): Likewise.
1821 (Empty Language): Likewise.
1822
18232008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1824
1825 Fix some .gitignore and .cvsignore problems.
1826 * bootstrap (insert_sorted_if_absent): Replace all uses with...
1827 (insert_vc_ignore): ... this new function, which prepends `/' to all
1828 .gitignore entries before passing them to insert_sorted_if_absent.
1829 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
1830 .cvsignore files are maintained even though Bison developers run
1831 bootstrap while using Git.
1832 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
1833 unneeded by Bison.
1834 (gnulib): Add.
1835 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
1836 unneeded. Reported by Eric Blake.
1837 * lib/.gitignore (/*~): Add.
1838 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
1839 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
1840 Blake.
1841 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
1842
18432008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1844
1845 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
1846 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
1847 * bootstrap.conf (gnulib_modules): Add unsetenv.
1848 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
1849 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
1850 (/setenv.m4): Add.
1851 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
1852 the first argument because it may become position-dependent, and unset
1853 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
1854 Add comments explaining these issues in more detail.
1855
18562008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
1857
1858 Add .gitignore everywhere based on .cvsignore.
1859 * .gitignore: New.
1860 * build-aux/.gitignore: New.
1861 * data/.gitignore: New.
1862 * doc/.gitignore: New.
1863 * etc/.gitignore: New.
1864 * examples/.gitignore: New.
1865 * examples/calc++/.gitignore: New.
1866 * lib/.gitignore: New.
1867 * m4/.gitignore: New.
1868 * po/.gitignore: New.
1869 * runtime-po/.gitignore: New.
1870 * src/.gitignore: New.
1871 * tests/.gitignore: New.
1872
18732008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1874
1875 * NEWS (2.3b+): New section, empty for now.
1876 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
1877
18782008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1879
1880 * NEWS (2.3b): Update release date since there has been a delay in
1881 getting the announcements and tarballs out.
1882
18832008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1884
1885 * NEWS: Version 2.3b.
1886 * configure.ac (AC_INIT): Likewise.
1887 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
1888
18892008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1890
1891 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
1892 been doing it for years.
1893 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
1894 (Release Procedure): Add FIXME about make alpha being unmaintained.
1895
18962008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
1897
1898 * data/yacc.c: Reformat m4 a little for readability.
1899 * src/lalr.c (build_relations): Correct comment.
1900
19012008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1902
1903 DJGPP specific issue.
1904 * djgpp/config.sed: Fixes required to run configure scripts generated
1905 by autoconf 2.62.
1906
19072008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1908
1909 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
1910 coordinator@translationproject.org.
1911
19122008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1913
1914 * THANKS: Add Eric Blake.
1915
19162008-04-23 Eric Blake <ebb9@byu.net>
1917
1918 Revert prior patch, by working around autoconf regression.
1919 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
1920 ("Output file name: ("): Uncomment test.
1921 ("Output file name: )"): Likewise.
1922 Based on an idea from Noah Misch.
1923
19242008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1925
1926 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
1927 2.61. Reported by Juan Manuel Guerrero at
1928 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
1929 * tests/output.at ("Output file name: ("): Comment out test case for
1930 now.
1931 ("Output file name: )"): Likewise.
1932
19332008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1934
1935 * GNUmakefile: Update git-version-gen invocation so make dist
1936 succeeds.
1937
19382008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1939
1940 Update to the current gnulib CVS repository, and fix trigraph handling
1941 in Bison.
1942 * bootstrap: Update gnulib CVS repository URL.
1943 (symlink_to_dir): Encapsulate the code that guarantees the destination
1944 directory exists into...
1945 (check_dst_dir): ... this new function, and...
1946 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
1947 fail when copying files into lib/uniwidth/.
1948 * src/output.c (prepare_symbols): When writing yytname muscles, where
1949 symbol names will be encoded in C-string literals, tell quotearg to
1950 escape trigraphs. This used to be the default in gnulib.
1951 * tests/regression.at (Token definitions): Because of the change in
1952 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
1953 escapes trigraphs in symbol names. Thus, yytname no longer has
1954 trigraphs unnecessarily doubly escaped. Update test case output.
1955 Extend test case to be sure Bison's own error messages will no longer
1956 have trigraphs in symbol names unnecessarily escaped once.
1957
19582008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1959
1960 Fix make dist infinite loop reported by Juan Manuel Guerrero at
1961 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
1962 * .cvsignore: Add .version.
1963 * .version.in: New.
1964 * bootstrap.conf (gnulib_modules): Add git-version-gen.
1965 * configure.ac (AC_CONFIG_FILES): Add .version.
1966 * build-aux/.cvsignore: Add git-version-gen.
1967
19682008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
1969
1970 * NEWS (2.3a+): Mention that -g now takes an argument.
1971 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
1972 consistency. Update the -g and -x entries now that they take
1973 arguments. Use brackets to indicate optional arguments.
1974 * src/getargs.c (usage): Explain the relationship between arguments of
1975 long and short options more completely. Document --defines and -d
1976 separately since the former takes an argument but, for POSIX Yacc, the
1977 latter does not.
1978 (short_options): Let -W take an optional argument like --warnings.
1979 (getargs): Sort cases.
1980
19812008-02-28 Akim Demaille <demaille@gostai.com>
1982
1983 * doc/bison.texinfo: Fix a few typos.
1984
19852008-02-28 Akim Demaille <akim@epita.fr>
1986
1987 * doc/bison.texinfo (Bison Options): Document -W.
1988 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
1989
19902008-02-28 Akim Demaille <akim@epita.fr>
1991
1992 * src/getargs.c (short_options): Split and sort for readability.
1993 -g and -x take optional arguments, just like their long options.
1994 * build-aux/cross-options.pl: Use /x to make the regexp easier to
1995 understand.
1996 Fix the handling of $opt which resulted in all the argument to be
1997 considered as optional.
1998
19992008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
2000
2001 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
2002 say its interface is experimental.
2003 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
2004 Java.
2005 (Bison Options): In the -L and --language entry, mention Java.
2006 (Java Bison Interface): Say the interface is experimental.
2007 * src/getargs.c (usage): Mention -L and --language.
2008
2009 * NEWS (2.3a+): Say the push parsing interface is experimental.
2010 * doc/bison.texinfo (Push Decl): Likewise.
2011 (Decl Summary): Likewise in the "%define api.push_pull" entry.
2012 (Push Parser Function): Likewise.
2013 (Pull Parser Function): Likewise.
2014 (Parser Create Function): Likewise.
2015 (Parser Delete Function): Likewise.
2016 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
2017 yypull_parse, and yypush_parse entries.
2018
2019 * NEWS (2.3a+): Mention XML support, and say the schema is
2020 experimental.
2021 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
2022 * src/getargs.c (usage): Say the XML schema is experimental.
2023
2024 * NEWS (2.3a+): Say option instead of flag.
2025
20262008-02-21 Wojciech Polak <polak@gnu.org>
2027
2028 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
2029 text.
2030
20312008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
2032
2033 Fix impure push parser compile error reported by Bob Rossi at
2034 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
2035 * data/yacc.c: Clean up whitespace in the output a little.
2036 (yypstate_allocated): Define for impure push parsers regardless of
2037 whether the pull interface is also requested.
2038 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
2039 check impure push parsers without the pull interface.
2040
2041 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
2042 yyerror takes arguments specified by %parse-param while yypstate_new
2043 does not.
2044 * doc/bison.texinfo (Parser Create Function): Document that
2045 yypstate_new returns 0 for multiple impure parser instances.
2046 * tests/push.at (Push Parsing: Multiple impure instances): Update
2047 expected stderr output.
2048
20492008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
2050
2051 * runtime-po/POTFILES.in (push.c): Remove.
2052
20532008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
2054
2055 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
2056 * data/push.c: Rename to...
2057 * data/yacc.c: ... this, overwriting it.
2058 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
2059 `%push-pull-parser' -> `%define api.push_pull "both"'.
2060 Remove old yacc.c tests, and update push.c tests to yacc.c.
2061
20622008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
2063
2064 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
2065 `"%code top" blocks' instead of `%code "top" blocks'.
2066 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
2067 Clean up whitespace in the output a little.
2068
20692008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
2070
2071 Fix documentation problems reported by Tim Josling at
2072 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
2073 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
2074 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
2075 integers. Explain the effect of literal string aliases on error
2076 messages. Copy token 0 documentation from the C++ skeleton
2077 documentation.
2078
20792008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
2080
2081 Accept a token number in a %left, %right, or %nonassoc for POSIX
2082 conformance. Reported by Tim Josling at
2083 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
2084 * NEWS (2.3a+): Mention.
2085 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
2086 and code numbers are treated by precedence declarations.
2087 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
2088 of symbols.1.
2089 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
2090 of symbol.
2091 (symbol.prec): New, just like symbol but allows INT.
2092 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
2093 longer holds.
2094 * tests/regression.at (Token number in precedence declaration): New
2095 test case.
2096
20972008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2098
2099 DJGPP specific issues.
2100 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
2101 be changed. Copyright timestamp adjusted.
2102 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
2103 be changed. Copyright timestamp adjusted.
2104 * djgpp/config.site: Copyright timestamp adjusted.
2105 * djgpp/config_h.sed: Copyright timestamp adjusted.
2106 * djgpp/djunpack.bat: Copyright timestamp adjusted.
2107 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
2108 filename translation list.
2109 * djgpp/subpipe.c (init_subpipe): Check the environment variables
2110 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
2111 files shall be created. Before trying to use the temp dir where the
2112 environment variable points to check that the dir really exists. If
2113 not default to the cwd as temp dir. Copyright timestamp adjusted.
2114 * djgpp/subpipe.h: Copyright timestamp adjusted.
2115 * djgpp/testsuite.sed: Copyright timestamp adjusted.
2116
21172008-01-30 Paul Eggert <eggert@cs.ucla.edu>
2118
2119 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
2120
21212008-01-09 Paul Eggert <eggert@cs.ucla.edu>
2122
2123 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
2124 Problem reported by Claudio Saavedra in
2125 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
2126
21272008-01-05 Wojciech Polak <polak@gnu.org>
2128
2129 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
2130 document's title with the input grammar file name.
2131
21322007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
2133
2134 Automate regression testing of the XML/XSLT implementation. Discussed
2135 starting at
2136 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
2137 * configure.ac (XSLTPROC): New substitution.
2138 * Makefile.am (maintainer-xml-check): New phony target invoking...
2139 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
2140 invoking make maintainer-check with BISON_TEST_XML=1.
2141 * tests/atlocal.in (XSLTPROC): New.
2142 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
2143 not to report reachable memory when Bison is expected to have a
2144 non-zero exit status and (2) to compare XML/XSLT output with --graph
2145 and --report=all output for every working grammar when
2146 BISON_TEST_XML=1.
2147 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
2148 (AT_BISON_CHECK_XML): New.
2149 (AT_QUELL_VALGRIND): New.
2150 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
2151 (AT_CHECK): ... don't redefine this since this was the old way to
2152 quell Valgrind.
2153 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
2154 AT_BISON_CHECK invocations.
2155 * tests/c++.at: Likewise.
2156 * tests/calc.at: Likewise.
2157 * tests/conflicts.at: Likewise.
2158 * tests/cxx-type.at: Likewise.
2159 * tests/existing.at: Likewise.
2160 * tests/glr-regression.at: Likewise.
2161 * tests/headers.at: Likewise.
2162 * tests/input.at: Likewise.
2163 * tests/java.at: Likewise.
2164 * tests/output.at: Likewise.
2165 * tests/push.at: Likewise.
2166 * tests/reduce.at: Likewise.
2167 * tests/regression.at: Likewise.
2168 * tests/sets.at: Likewise.
2169 * tests/skeletons.at: Likewise.
2170 * tests/synclines.at: Likewise.
2171 * tests/torture.at: Likewise.
2172 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
2173 tends to hang xsltproc.
2174 (Big horizontal): Likewise.
2175
21762007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2177
2178 In XML output, remove redundant class attribute on symbol element.
2179 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
2180 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
2181 look up a symbol to determine whether it's a nonterminal or terminal.
2182 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
2183 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
2184
2185 Add prec/assoc information to XML output.
2186 * src/gram.c (grammar_rules_print_xml): For each rule that has a
2187 %prec, add a percent_prec attribute.
2188 * src/print-xml.c (print_grammar): For each terminal that has a
2189 precedence or associativity, add a prec or assoc attribute.
2190 (xml_indent): New.
2191 (xml_puts): Use xml_indent.
2192 (xml_printf): Use xml_indent.
2193 * src/print-xml.h (xml_indent): Prototype.
2194
2195 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
2196 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
2197
21982007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2199
2200 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
2201 (bison:ruleByNumber): ... this for clarity.
2202 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
2203 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
2204 (xsl:template match="reduction"): Update.
2205 (xsl:template match="item"): Update.
2206 (xsl:template match="reduction"): Update.
2207
2208 In the XML output, don't print the list of rules where symbols appear.
2209 Compute it in XSLT instead. Discussed at
2210 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
2211 * data/xslt/bison.xsl (bison:ruleByLhs): New.
2212 (bison:ruleByRhs): New.
2213 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
2214 bison:ruleByRhs.
2215 (xsl:template match="terminal/rule"): Remove.
2216 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2217 bison:ruleByRhs.
2218 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2219 Remove.
2220 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
2221 bison:ruleByRhs and mode="number-link" for rule template.
2222 (xsl:template match="terminal/rule"): Remove.
2223 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2224 bison:ruleByRhs and mode="number-link" for rule template.
2225 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2226 Rewrite as...
2227 (xsl:template match="rule" mode="number-link"): ... this.
2228 * src/print-xml.c (print_grammar): Don't print the list of rules.
2229
22302007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2231
2232 Don't let --report affect XML output; always print all information.
2233 Discussed at
2234 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
2235 * src/conflicts.c (log_resolution): Implement.
2236 * src/print-xml.c (print_core): Implement.
2237 (print_state): Implement.
2238 (print_xml): Implement.
2239
2240 * NEWS (2.3a+): Fix quotes.
2241 * src/parse-gram.y (prologue_declaration): For consistency with -v,
2242 don't let %verbose clear the list specified by --report.
2243
22442007-11-26 Akim Demaille <akim@epita.fr>
2245
2246 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
2247
22482007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
2249
2250 In the XML output, list useless and unused symbols and rules with the
2251 useful ones and add a "usefulness" attribute. Discussed starting at
2252 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
2253 * src/gram.c (grammar_rules_partial_print_xml): Remove.
2254 (grammar_rules_print_xml): Print all rules instead of just those
2255 useful in the grammar, and add a "usefulness" attribute.
2256 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
2257 * src/print-xml.c (print_rules_useless_in_parser): Remove.
2258 (print_grammar): Print all nonterminals instead of just useful ones,
2259 and add a "usefulness" attribute to nonterminals and terminals.
2260 (print_xml): Don't print a separate "reductions" or
2261 "rules-useless-in-parser" element.
2262 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
2263 (reduce_xml): Remove.
2264 (reduce_token_unused_in_grammar): New.
2265 (reduce_nonterminal_useless_in_grammar): New.
2266 * src/reduce.h (reduce_xml): Remove prototype.
2267 (reduce_token_unused_in_grammar): Add prototype.
2268 (reduce_nonterminal_useless_in_grammar): Add prototype.
2269 * data/xslt/xml2text.xsl: Update for XML changes.
2270 * data/xslt/xml2xhtml.xsl: Update for XML changes.
2271 * tests/reduce.at (Useless Terminals): Update output.
2272 (Useless Rules): Update output.
2273 (Reduced Automaton): Update output.
2274
2275 Say "Terminals unused in grammar" instead of "Unused terminals".
2276 * NEWS (2.3a+): Update.
2277 * doc/bison.texinfo (Understanding): Update example output.
2278 * src/reduce.c (reduce_output): Implement.
2279 * data/xslt/xml2text.xsl: Implement.
2280 * data/xslt/xml2xhtml.xsl: Implement.
2281
22822007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2283
2284 Accept --report-file=FILE to override the default `.output' filename.
2285 * NEWS (2.3a+): Mention.
2286 * doc/bison.texinfo (Bison Options): Add an entry.
2287 * src/files.c (compute_output_file_names): Don't override
2288 spec_verbose_file if already set.
2289 * src/getargs.c (usage): Document --report-file.
2290 (REPORT_FILE_OPTION): New anonymous enum member.
2291 (long_options): Add entry for it.
2292 (getargs): Add case for it setting spec_verbose_file.
2293
2294 * build-aux/cross-options.pl: Don't record a short option just because
2295 there's an arg.
2296 * doc/.cvsignore: Add yacc.1.
2297
22982007-11-14 Akim Demaille <akim@epita.fr>
2299
2300 * doc/yacc.1.in: New.
2301 * configure.ac, doc/Makefile.am: Adjust.
2302 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
2303 config.h symbol.
2304 Use AC_SUBST for assignments too.
2305 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
2306
23072007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2308
2309 * src/gram.c: Remove comments that duplicate comments in gram.h.
2310
2311 When reporting useless rules and nonterminals, say "useless in grammar"
2312 instead of "useless", and say "useless in parser" instead of "never
2313 reduced". Discussed starting at
2314 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
2315 * NEWS (2.3a+): Mention this change.
2316 * data/xslt/xml2text.xsl: Update output text and expected input XML
2317 element names to match changes below.
2318 * data/xslt/xml2xhtml.xsl: Likewise.
2319 (xsl:template match="bison-xml-report"): Add missing entry in Table of
2320 Contents: "Rules useless in parser due to conflicts".
2321 * doc/bison.texinfo (Decl Summary): Reword a little.
2322 (Understanding): Update example output for changes below.
2323 * src/gram.c: (rule_useful_p): Rename to...
2324 (rule_useful_in_grammar_p): ... this.
2325 (rule_useless_p): Rename to...
2326 (rule_useless_in_grammar_p): ... this.
2327 (rule_never_reduced_p): Rename to...
2328 (rule_useless_in_parser_p): ... this.
2329 (grammar_rules_print): Update for renames.
2330 (grammar_rules_print_xml): Update for renames.
2331 (grammar_rules_never_reduced_report): Rename to...
2332 (grammar_rules_useless_report): ... this since it is used for either
2333 kind of useless rule.
2334 * src/gram.h: Reword comments and update function names in prototypes.
2335 * src/main.c (main): Say "rule useless in parser due to conflicts".
2336 * src/print-xml.c (print_rules_never_reduced): Rename to...
2337 (print_rules_useless_in_parser): ... this, and rename output XML
2338 element "rules-never-reduced" to "rules-useless-in-parser".
2339 (print_xml): Update for rename.
2340 * src/print.c (print_results): Say "Rules useless in parser due to
2341 conflicts".
2342 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
2343 (nonterminals_reduce): Say "nonterminal useless in grammar".
2344 (reduce_output): Say "Nonterminals useless in grammar".
2345 Say "Rules useless in grammar".
2346 (reduce_xml): Rename output XML element "useless" to
2347 "useless-in-grammar".
2348 (reduce_print): Don't report the count of grammatically useless rules
2349 as "rules never reduced" just because %yacc is specified.
2350 In the correct report of this count, say nonterminal(s) and rule(s)
2351 "useless in grammar".
2352 * tests/conflicts.at (S/R in initial): Update expected output.
2353 (Defaulted Conflicted Reduction): Likewise.
2354 (Unreachable States After Conflict Resolution): Likewise.
2355 * tests/existing.at (GNU pic Grammar): Likewise.
2356 * tests/reduce.at (Useless Nonterminals): Likewise.
2357 (Useless Rules): Likewise.
2358 (Reduced Automaton): Likewise.
2359 (Underivable Rules): Likewise.
2360 (Empty Language): Likewise.
2361
23622007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2363
2364 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
2365 here document and before the EOF so that BSD's implementation of Bourne
2366 shell doesn't parse the delimiter as part of the here document.
2367 * doc/.cvsignore: Add cross-options.texi.
2368 * src/getargs.c (usage): Add a blank line after the warning categories.
2369
23702007-11-08 Paolo Bonzini <bonzini@gnu.org>
2371
2372 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
2373
23742007-11-05 Akim Demaille <akim@epita.fr>
2375
2376 Remove Id: from bison.1.
2377 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
2378 (perl -0777 -pi -e 's/\.PP\nId): New.
2379 (.x.1): Use it to ignore the version control revision.
2380
23812007-11-05 Akim Demaille <demaille@gostai.com>
2382
2383 * build-aux/Makefile.am: Ship cross-options.pl.
2384 * doc/Makefile.am: Always refer to cross-options.texi with
2385 $(srcdir).
2386 (MAINTAINERCLEANFILES): Add it.
2387
23882007-11-04 Akim Demaille <demaille@gostai.com>
2389
2390 Generate the long/short option cross-table.
2391 * build-aux/cross-options.pl: New.
2392 * doc/Makefile.am (cross-options.texi): New.
2393 * doc/bison.texinfo: Use it.
2394
23952007-11-04 Akim Demaille <demaille@gostai.com>
2396
2397 Generate bison.1 using help2man.
2398 * doc/common.x, doc/bison.x: New.
2399 * doc/Makefile.am (bison.1, .x.1): New.
2400 The code is taken from autoconf-2.61/man/Makefile.am.
2401 * configure.ac: Look for help2man.
2402
24032007-11-04 Akim Demaille <demaille@gostai.com>
2404
2405 Complete --help.
2406 * src/getargs.c (usage): Document -W, make it clear that -d,
2407 -g and -x have optional arguments.
2408
24092007-11-04 Akim Demaille <demaille@gostai.com>
2410
2411 Find sha1sum when named gsha1sum.
2412 * bootstrap (find_tool): New.
2413 ($SHA1SUM): New.
2414
24152007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2416
2417 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
2418 at
2419 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
2420 * NEWS (2.3a+): Mention.
2421 * data/bison.m4 (b4_pure_if): Don't define it here.
2422 * data/c.m4 (b4_identification): Depend on individual skeletons to
2423 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
2424 values of the %define variables api.pure or api.push_pull. Define
2425 YYPURE, YYPUSH, and YYPULL accordingly.
2426 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
2427 glr.cc has already defined b4_pure_flag.
2428 * data/push.c: Define b4_pure_if based on `%define api.pure'.
2429 Remove YYPUSH and YYPULL since they're back in b4_identification again.
2430 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
2431 * doc/bison.texinfo (Pure Decl): Update.
2432 (Push Decl): Update.
2433 (Decl Summary): Add api.pure to %define entry.
2434 In %pure-parser entry, say it's deprecated and reference %define.
2435 (Pure Calling): Update.
2436 (Error Reporting): Update.
2437 (C++ Scanner Interface): Update.
2438 (How Can I Reset the Parser): Update.
2439 (Table of Symbols): In %pure-parser entry, say it's deprecated and
2440 reference %define.
2441 * src/getargs.c (pure_parser): Remove global variable.
2442 * src/getargs.h (pure_parser): Remove extern.
2443 * src/output.c (prepare): Don't define pure_flag muscle.
2444 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
2445 wrapper around `%define api.pure'.
2446 * tests/calc.at (Simple LALR Calculator): Update.
2447 (Simple GLR Calculator): Update.
2448 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
2449 Update.
2450 (GLR: Resolve ambiguity, pure, locations): Update.
2451 (GLR: Merge conflicting parses, pure, no locations): Update.
2452 (GLR: Merge conflicting parses, pure, locations): Update.
2453 * tests/glr-regression.at (Uninitialized location when reporting
2454 ambiguity): Update
2455 * tests/input.at (Unused %define api.pure): New test case.
2456 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
2457 AT_PURE_IF and AT_PURE_AND_LOC_IF.
2458 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2459
24602007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2461
2462 %define push_pull -> %define api.push_pull. Discussed starting at
2463 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
2464 * data/push.c: Expect the new name.
2465 * data/yacc.c: Likewise.
2466 * doc/bison.texinfo (Push Decl): Update.
2467 (Decl Summary): Update %define entry.
2468 (Push Parser Function): Update.
2469 (Pull Parser Function): Update.
2470 (Parser Create Function): Update.
2471 (Parser Delete Function): Update.
2472 * tests/calc.at (Simple LALR Calculator): Update.
2473 * tests/input.at (%define enum variables): Update.
2474 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2475 (Push Parsing: Multiple impure instances): Update.
2476 (Push Parsing: Unsupported Skeletons): Update.
2477 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
2478 (Exploding the Stack Size with Malloc): Update.
2479
2480 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
2481 other entries some.
2482
24832007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
2484
2485 For the XML output's terminal element, rename @number to @token-number,
2486 and add @symbol-number. In the nonterminal element, rename @number to
2487 @symbol-number. Discussed starting at
2488 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
2489 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
2490 renames.
2491 (xsl:template match="nonterminal"): Likewise.
2492 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
2493 (xsl:template match="nonterminal"): Likewise.
2494 * src/print-xml.c (print_grammar): Implement.
2495
24962007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2497
2498 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
2499 2007-10-11 change, the child elements here are items not rules.
2500 (xsl:template match="item"): New.
2501 (xsl:template match="rule"): Update for new reduced itemset.
2502 (xsl:template match="point"): Remove.
2503 (xsl:template match="empty"): For consistency with --graph, don't
2504 output "/* empty */".
2505 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
2506 line-wrap, don't pass a negative value as first-line-length since this
2507 won't work with the following changes.
2508 (xsl:template name="line-wrap"): Simplify slightly.
2509 (xsl:template name="ws-search"): Eliminate recursion.
2510 * src/print_graph.c (print_core): Don't print a reduction's lookahead
2511 set next to an item whose dot is not at the end of the RHS even if it
2512 happens to be associated with the same rule.
2513
25142007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2515
2516 Add %define lr.keep_unreachable_states.
2517 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
2518 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
2519 * src/main.c (main): Implement it.
2520 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2521 Extend to test it, and fix a typo.
2522
25232007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2524
2525 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
2526 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
2527 the example .output text.
2528 * tests/regression.at (Extra lookahead sets in report): Improve wording
2529 of comments.
2530
25312007-10-17 Wojciech Polak <polak@gnu.org>
2532
2533 * src/print-xml.c (print_grammar): Renamed
2534 <terminal> and <nonterminal> attributes:
2535 "type" to "number" and "symbol" to "name".
2536 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
2537 Use new attribute names.
2538 (xsl:template match="nonterminal"): Likewise.
2539 * data/xslt/xml2xhtml.xsl: Likewise.
2540
25412007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
2542
2543 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
2544 (Option Cross Key): Likewise.
2545
2546 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
2547 next to an item whose dot is not at the end of the RHS even if it
2548 happens to be associated with the same rule.
2549 * src/print.c (print_core): Likewise.
2550 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
2551 (Resolved SR Conflicts): Update output.
2552 * tests/regression.at (Extra lookahead sets in report): New test case.
2553
25542007-10-11 Wojciech Polak <polak@gnu.org>
2555
2556 * src/print-xml.c (print_core): Remove item set
2557 redundancy.
2558 * data/xslt/bison.xsl (bison:ruleNumber): New key.
2559 Improve processing time. Suggested by Joel E. Denny.
2560 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
2561 Write xsl:param "required" attribute as comment.
2562 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
2563 (xsl:template match="rule"): Support new reduced itemset.
2564 (xsl:template match="point"): Remove.
2565 * data/xslt/xml2xhtml.xsl: Likewise.
2566
25672007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2568
2569 * src/getargs.c (version): Update copyright year.
2570
25712007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2572
2573 Make xml2dot.xsl and --graph produce the same output.
2574 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
2575 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
2576 escaped later.
2577 (xsl:template name="output-node"): Use the new escape template instead
2578 of the string-replace template directly.
2579 (xsl:template name="output-edge"): Likewise.
2580 (xsl:template name="escape"): New, escapes backslashes and newlines in
2581 addition to quotation marks.
2582 * src/graphviz.c (start_graph, output_node, output_edge): Add
2583 whitespace to output for legibility.
2584
2585 Make xml2text.xsl and --report produce the same output, and remove the
2586 XML "conflicts" element since a conflict summary is easily extracted
2587 from the automaton.
2588 * data/xslt/bison.xsl: New.
2589 (xsl:template match="state" mode="bison:count-conflicts): New.
2590 * data/xslt/xml2text.xsl: Import bison.xsl.
2591 (xsl:template match="bison-xml-report"): Instead of styling the
2592 "conflicts" element, style the "automaton" element with mode
2593 "conflicts". Unlike the former, the latter lists S/R and R/R
2594 conflicts for a state on the same line.
2595 (xsl:template match="conflicts"): Remove.
2596 (xsl:template match="conflict"): Remove.
2597 (xsl:template match="terminal"): Line-wrap the list of rules in which
2598 the terminal is used.
2599 (xsl:template match="nonterminal"): Likewise for nonterminals.
2600 (xsl:template match="automaton" mode="conflicts"): New.
2601 (xsl:template match="state" mode="conflicts"): New.
2602 (xsl:template name="line-wrap"): New.
2603 (xsl:template name="ws-search"): New.
2604 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
2605 (xsl:template match="bison-xml-report"): Instead of styling the
2606 "conflicts" element, style the "automaton" element with mode
2607 "conflicts."
2608 (xsl:template match="conflicts"): Remove.
2609 (xsl:template match="conflict"): Remove.
2610 (xsl:template match="automaton" mode="conflicts"): New.
2611 (xsl:template match="state" mode="conflicts): New.
2612 * src/conflicts.c (conflicts_output_xml): Remove.
2613 * src/conflicts.h (conflicts_output_xml): Remove prototype.
2614 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
2615 * src/print.c (print_grammar): Consistently wrap at the 66th column so
2616 the corresponding XSLT is easier. Also, never wrap between a word and
2617 the comma that follows it.
2618
26192007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2620
2621 Improve C++ namespace support. Discussed starting at
2622 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
2623 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
2624 b4_namespace_close): New macros that interpret the %define variable
2625 "namespace" so its value can contain "::" to indicate nested
2626 namespaces.
2627 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
2628 the above macros.
2629 * data/lalr1.cc (b4_namespace): Likewise.
2630 * data/location.cc (b4_namespace): Likewise.
2631 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
2632 inside a new table in the general %define entry. Document `%define
2633 namespace' there as well. Point the %name-prefix entry to it since it
2634 explains it more completely in the case of C++.
2635 (C++ Bison Interface): Mention `%define namespace' instead of
2636 %name-prefix.
2637 (Table of Symbols): Remove the `%define push_pull' entry. The %define
2638 entry suffices.
2639 * tests/c++.at (Relative namespace references): New test case.
2640 (Absolute namespace references): New test case.
2641 (Syntactically invalid namespace references): New test case.
2642 * tests/input.at (C++ namespace reference errors): New test case.
2643
26442007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2645
2646 Add syncline support and location accessor to internal %define
2647 interfaces.
2648 * data/bison.m4 (b4_percent_define_get_loc): New.
2649 (b4_percent_define_get_syncline): New.
2650 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
2651 (b4_percent_define_default): Record defining location as line 1 rather
2652 than 0 for the sake of synchronizing #line's, and define
2653 b4_percent_define_syncline(VARIABLE).
2654 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
2655 * src/muscle_tab.c (muscle_syncline_grow): New.
2656 (muscle_code_grow): Use muscle_syncline_grow.
2657 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
2658 define b4_percent_define_syncline(VARIABLE).
2659 (muscle_percent_define_get_loc): New.
2660 (muscle_percent_define_get_syncline): New.
2661 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
2662 remove some unused variables.
2663 (muscle_percent_define_default): Record defining location as line 1
2664 rather than 0 for the sake of synchronizing #line's, and define
2665 b4_percent_define_syncline(VARIABLE).
2666 (muscle_percent_define_check_values): Use
2667 muscle_percent_define_get_loc.
2668 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
2669 (muscle_percent_define_get_syncline): Prototype.
2670 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2671 defaults): Update output for location change.
2672 (Complaining during macro argument expansion): Extend to test
2673 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
2674
26752007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
2676
2677 Fix some error-reporting macro bugs.
2678 * data/bison.m4 (b4_cat): New.
2679 (b4_error, b4_error_at): Use b4_cat to send error directives directly
2680 to stdout so they don't become arguments to other macros. Update
2681 comments and add examples.
2682 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
2683 add examples.
2684 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
2685 after printing the error directive so that M4 doesn't report subsequent
2686 problems that are induced by this problem.
2687 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
2688 instead of just in them. Recognize @\n in both places. Both expand to
2689 the empty string. Needed by b4_cat.
2690 * tests/skeletons.at (Complaining during macro argument expansion):
2691 New test case.
2692 (Fatal errors make M4 exit immediately): New test case.
2693
26942007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
2695
2696 Implement --print-datadir.
2697 * src/getargs.c (usage): Mention.
2698 (PRINT_DATADIR_OPTION): New anonymous enum member.
2699 (long_options): Add entry for it.
2700 (getargs): Add case for it calling compute_pkgdatadir.
2701 * src/output.c (output_skeleton): Encapsulate data directory
2702 computation from here...
2703 (prepare): ... and from here...
2704 (compute_pkgdatadir): ... into this new function.
2705 * src/output.h (compute_pkgdatadir): Prototype.
2706
27072007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
2708
2709 * src/print-xml.c (escape_bufs): New static global variable
2710 replacing...
2711 (xml_escape_n): ... the static local variable buf here.
2712 (print_xml): Free memory for escape_bufs.
2713 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
2714
27152007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
2716
2717 Replace `%push-parser' and `%push-pull-parser' with
2718 `%define push_pull "push"' and `%define push_pull "both"'.
2719 `%define push_pull "pull"' is the default.
2720 * doc/bison.texinfo (Push Decl, Push Parser Function,
2721 Pull Parser Function, Parser Create Function, Parser Delete Function):
2722 Update declarations.
2723 (Decl Summary, Table of Symbols): Replace %push-parser and
2724 %push-pull-parser entries with a %define push_pull entry.
2725 * data/bison.m4 (b4_percent_define_check_values): New macro.
2726 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
2727 definitions...
2728 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
2729 definitions...
2730 * data/push.c: ... to here and compute them from the value of the
2731 %define variable push_pull.
2732 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
2733 parsing requests here...
2734 * data/yacc.c: ... hack this to switch to push.c any time
2735 b4_use_push_pull_flag or the %define variable push_pull is set. This
2736 will go away when we mv push.c yacc.c.
2737 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
2738 push parsing is not supported since unused %define variables are
2739 reported anyway.
2740 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
2741 * src/muscle_tab.h (muscle_percent_define_check_values): Update
2742 comments for consistency with b4_percent_define_check_values.
2743 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
2744 muscles.
2745 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
2746 Remove.
2747 (prologue_declaration): Remove %push-parser and %push-pull-parser
2748 rules.
2749 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
2750 * tests/calc.at: Update declarations.
2751 * tests/input.at (%define enum variables): New test case.
2752 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
2753 declaration.
2754 (Push Parsing: Multiple impure instances): Update declaration.
2755 (Push Parsing: Unsupported Skeletons): New test case.
2756 * tests/torture.at (Exploding the Stack Size with Alloca): Update
2757 declaration.
2758 (Exploding the Stack Size with Malloc): Update declaration.
2759
27602007-09-24 Wojciech Polak <polak@gnu.org>
2761
2762 Add XSLT transformations.
2763
2764 * data/xslt/xml2dot.xsl: Transform XML into DOT.
2765 * data/xslt/xml2text.xsl: Transform XML into plain text.
2766 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
2767 * data/Makefile.am (xsltdir): New variable.
2768 (dist_xslt_DATA): Add xslt/*.xsl files.
2769
27702007-09-23 Paul Eggert <eggert@cs.ucla.edu>
2771
2772 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
2773 Problem reported by Wojciech Polak.
2774 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
2775 (xml_printf): Undo change I made on 21 September; that is,
2776 indent 2 spaces, not 1.
2777
27782007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
2779
2780 Pacify ./configure --enable-gcc-warnings.
2781 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
2782 `char const *' instead of `char *'.
2783 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
2784 local variable `sep'.
2785
27862007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2787
2788 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
2789 elsewhere.
2790 * src/print-xml.c: Prefer "const" after types; that's more consistent.
2791 (xml_printf): Indent just 1 space for level.
2792 (e_char, xlate_char): Remove.
2793 (xml_escape_string): Rewrite to avoid undefined behavior (used
2794 storage that was freed from the stack).
2795 (xml_escape_n): Don't bother checking for subscript error.
2796
27972007-09-21 Wojciech Polak <polak@gnu.org>
2798
2799 Add Bison XML Automaton Report.
2800
2801 Add support for an -x option to generate an XML report.
2802 It is not documented yet.
2803 * src/print-xml.c: New file.
2804 * src/print-xml.h: Likewise.
2805 * lib/timevar.def (TV_XML): New var.
2806 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
2807 * src/conflicts.c: Include print-xml.h.
2808 (solved_conflicts_xml_obstack): New var.
2809 (log_resolution, conflicts_solve, conflicts_free):
2810 Add support for XML report.
2811 (conflicts_output_val): New function.
2812 * src/conflicts.h (conflicts_output_val): New decl.
2813 * src/files.c (spec_xml_file): New var.
2814 (compute_output_file_names, output_file_names_free): Add XML support.
2815 * src/files.h (spec_xml_file): New decl.
2816 * src/getargs.c (xml_flag): New var.
2817 (usage, short_options, long_options, getargs): Add XML support.
2818 * src/getargs.h (xml_flag): New decl.
2819 * src/gram.c: Include print-xml.h.
2820 (rule_lhs_print_xml, rule_rhs_print_xml):
2821 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
2822 New functions.
2823 * src/gram.h: Declare external ones.
2824 * src/main.c: Include print-xml.h.
2825 (main): Add XML support.
2826 * src/reduce.c: Include print-xml.h.
2827 (reduce_xml): New function.
2828 * src/reduce.h: Declare it.
2829 * src/state.c: Include print-xml.h.
2830 (state_new): Add XML support.
2831 (state_rule_lookahead_tokens_print_xml): New function.
2832 * src/state.h: Declare it.
2833 (struct state): New member solved_conflicts_xml.
2834 * src/symtab.c (symbol_class_get_string): New function.
2835 * src/symtab.h: Declare it.
2836
28372007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2838
2839 * GNUmakefile: Switch to coreutils's version.
2840 * bootstrap: Likewise.
2841 * Makefile.cfg: Adjust to new GNUmakefile.
2842 * README-hacking: Likewise.
2843
2844 Import from gnulib:
2845
2846 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
2847 Bruno Haible <bruno@clisp.org>
2848
2849 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
2850 and is a script that invokes bison. Tighten the code. Add comments.
2851
28522007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
2853
2854 Spell "boolean" as "Boolean". Reported by Akim Demaille.
2855 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
2856 * doc/bison.texinfo (Decl Summary): Fix.
2857 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
2858 * tests/input.at (Boolean %define variables): Update output.
2859 * tests/skeletons.at (%define boolean variables: invalid skeleton
2860 defaults): Rename to...
2861 (%define Boolean variables: invalid skeleton defaults): ... this and
2862 update output.
2863
28642007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
2865
2866 In impure push mode, don't allow more than one yypstate to be allocated
2867 since multiple impure parsers would corrupt yynerrs.
2868 * data/push.c (yypstate_allocated): New static global variable
2869 initialized to 0.
2870 (yypull_parse): If yypstate_new returns 0, don't report it as memory
2871 exhaustion if yypstate_allocated is 1, but still return 2.
2872 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
2873 already 1. Otherwise, set it to 1.
2874 (yypstate_delete): Set it to 0.
2875 * tests/push.at (Push Parsing: Multiple impure instances): New test
2876 case.
2877
28782007-08-17 Bob Rossi <bob@brasko.net>
2879
2880 * doc/bison.texinfo (Push Decl): Document the push parser.
2881 (Table of Symbols): Ditto.
2882 (Pure Decl): Ditto.
2883 (Decl Summary): Ditto.
2884 (Multiple Parsers, Push Parser Function, Pull Parser Function,
2885 Parser Create Function, Parser Delete Function):
2886 Add new push parser symbols.
2887 (Table of Symbols): Document push-parser, push-pull-parser,
2888 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
2889
28902007-08-15 Paul Eggert <eggert@cs.ucla.edu>
2891
2892 Update to GPLv3.
2893 * doc/gpl-3.0.texi: New file.
2894 * doc/gpl.texi: Remove.
2895 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
2896 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
2897 * README-hacking, TODO, bootstrap, bootstrap.conf:
2898 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
2899 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
2900 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
2901 * data/lalr1.cc, data/lalr1.java, data/location.cc:
2902 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
2903 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
2904 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
2905 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
2906 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
2907 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
2908 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
2909 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
2910 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
2911 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
2912 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
2913 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
2914 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
2915 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
2916 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
2917 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
2918 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
2919 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
2920 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
2921 * src/complain.c, src/complain.h, src/conflicts.c:
2922 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
2923 * src/files.h, src/flex-scanner.h, src/getargs.c:
2924 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
2925 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
2926 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
2927 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
2928 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
2929 * src/print.c, src/print.h, src/print_graph.c:
2930 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
2931 * src/reduce.h, src/relation.c, src/relation.h:
2932 * src/revision.h, src/scan-code.h, src/scan-code.l:
2933 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
2934 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
2935 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
2936 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
2937 * tests/Makefile.am, tests/actions.at, tests/c++.at:
2938 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
2939 * tests/existing.at, tests/glr-regression.at:
2940 * tests/headers.at, tests/input.at, tests/java.at:
2941 * tests/local.at, tests/output.at, tests/push.at:
2942 * tests/reduce.at, tests/regression.at, tests/sets.at:
2943 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
2944 * tests/torture.at:
2945 Update to GPLv3.
2946
29472007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2948
2949 Get rid of broken %no-parser, -n, and --no-parser implementation and
2950 documentation.
2951 * TODO: Don't mention them.
2952 * doc/bison.1: Likewise.
2953 * doc/bison.texinfo (Decl Summary): Likewise.
2954 (Bison Options): Likewise.
2955 (Option Cross Key): Likewise.
2956 * src/getargs.c (no_parser_flag): Remove global variable.
2957 (usage): Don't print description of -n and --no-parser.
2958 (long_options): Remove --no-parser entry here.
2959 (getargs): Remove -n case in the switch here.
2960 * src/getargs.h (no_parser_flag): Remove extern.
2961 * tests/regression.at (Web2c Actions): Remove comment that mentions
2962 --no-parser.
2963
29642007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
2965
2966 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
2967 name user variables starting with `yy'. Just pass NULL instead of a
2968 dummy local &yylval to yypush_parse.
2969 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
2970 starting with `yy'.
2971
29722007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
2973
2974 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
2975 true since it's then always used regardless of whether yyoverflow is
2976 defined. Reported by Christian Burger at
2977 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
2978 * THANKS: Add Christian Burger.
2979
2980 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
2981 node names: say "Decl Summary" not "Bison Declaration Summary".
2982
29832007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
2984
2985 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
2986 determine whether this function has already complained about an invalid
2987 value for a %define boolean variable, don't check whether Bison has
2988 ever examined the value. As written, the check was a tautology.
2989 Instead, record and check for this complaint using a separate muscle.
2990
29912007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2992
2993 Fix push parsing memory leak reported by Brandon Lucia at
2994 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
2995 * THANKS: Add Brandon Lucia.
2996 * data/push.c (yypstate_delete): Free the stack if it was reallocated
2997 but the parse never completed and thus freed it.
2998 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
2999 * tests/testsuite.at: Include push.at.
3000 * test/push.at: New.
3001 (Push Parsing: Memory Leak for Early Deletion): New test case.
3002
30032007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
3004
3005 Improve handling of multiple S/R conflicts in the same state and of S/R
3006 conflicts involving multiple reductions.
3007 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
3008 set for a state here or Bison will abort if it is reassigned on a
3009 later conflicted reduction in the same state.
3010 Similarly, don't finalize and assign the solved conflicts report here
3011 or it will be lost if it is reassigned on a later conflicted reduction
3012 in the same state.
3013 (set_conflicts): Instead, assign them both here after all S/R conflicts
3014 in the state have been fully examined.
3015 * src/print.c (shift_set): Rename to...
3016 (no_reduce_set): ... this.
3017 (print_reductions): Update for rename, and add %nonassoc error action
3018 tokens to no_reduce_set so that, when printing the first remaining
3019 reduction on an error action token, the reduction is enclosed in
3020 brackets.
3021 (print_results): Update for rename.
3022 * tests/conflicts.at (Solved conflicts report for multiple reductions
3023 in a state): New test case.
3024 (%nonassoc error actions for multiple reductions in a state): New test
3025 case.
3026
3027 * src/main.c (main): Don't depend on C99 features.
3028
30292007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3030
3031 * build-aux/.cvsignore: Add compile.
3032 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
3033 uniwidth.
3034
30352007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
3036
3037 * bootstrap (slurp): Create target directories that don't exist.
3038 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
3039
30402007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3041
3042 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
3043 than item number.
3044 * closure.c (closure): Likewise.
3045 * state.h (reductions): Comment sorting of rules.
3046 (state): Comment sorting of items.
3047
30482007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
3049
3050 Fix C++ test cases after recent Gnulib changes. Discussed starting at
3051 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
3052 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
3053 definition in order to avoid Gnulib headers since we don't use config.h
3054 here.
3055 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
3056 rather than AT_DATA so that config.h is included.
3057
30582007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
3059
3060 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
3061 instead of fprintf. Guard these functions with #if YYDEBUG instead of
3062 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
3063 and so that YYFPRINTF is guaranteed to be defined here.
3064
30652007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
3066
3067 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
3068 with...
3069 (muscle_percent_define_check_values): ... this more helpful function.
3070 Again, it's not used yet, but it will be.
3071 * src/muscle_tab.h: Likewise.
3072
3073 Improve some comments in parser table construction.
3074 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
3075 (generate_states): Don't mention ruleset, which is internal to closure.
3076 * src/closure.c (closure): Explain sorting of core and itemset, which
3077 is required for this function to behave correctly.
3078 * src/closure.h (closure): Mention sorting.
3079
30802007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
3081
3082 * src/lalr.c (state_lookahead_tokens_count): For code readability,
3083 move the check for disabled transitions to an aver since conflict
3084 resolution hasn't happened yet.
3085
3086 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
3087 labels a state as inconsistent just because it has error transitions.
3088 The original form of this check appeared in revision 1.1 of lalr.c,
3089 which was committed on 1991-12-21. Now (at least), changing the
3090 consistency label on such a state appears to have no useful effect in
3091 any of the places it is examined, which I enumerate below. The key
3092 point to understanding each item in this enumeration is that a state
3093 with an error transition is labelled consistent in the first place only
3094 if it has no rules, so the check cannot matter for states that have
3095 rules. (1) Labelling a state as inconsistent will cause set_conflicts
3096 to try to identify its conflicts, and a state must have *rules* to have
3097 conflicts. (2) Labelling a state as inconsistent will affect how
3098 action_row sets the default *rule* for the state. (3) Labelling a
3099 state as inconsistent will cause build_relations to add lookback edges
3100 to *rules* in that state.
3101 * src/state.h (struct state): Word the comment for member consistent
3102 more carefully.
3103
31042007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3105
3106 Don't depend on C99 features.
3107 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
3108 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
3109 * src/reader.c (check_and_convert_grammar): Fix for-loop.
3110 * src/state.c (state_mark_reachable_states): Fix for-loop.
3111 (state_remove_unreachable_states): Fix for-loop.
3112
3113 Don't widen struct state with member reachable just to temporarily
3114 record reachability. Instead, use a local bitset.
3115 * src/state.h (struct state): Remove member.
3116 * src/state.c (state_new): Don't initialize it.
3117 (state_mark_reachable_states): Rename to...
3118 (state_record_reachable_states): ... this, and use bitset.
3119 (state_remove_unreachable_states): Use bitset.
3120
31212007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
3122
3123 * src/Makefile.am (yacc): Quote target action commands properly so
3124 that the yacc script isn't corrupt. Reported by Hans Aberg at
3125 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
3126
3127 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
3128 the case of pure parsers. Reported by Frans Englich at
3129 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
3130 * THANKS: Add Frans Englich.
3131
3132 * NEWS (2.3a+): In the %code entry, reference section `Bison
3133 Declaration Summary' from the manual now since the %code summary has
3134 moved there.
3135 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
3136 in the rules section must be terminated by semicolons.
3137
31382007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
3139
3140 Extend the front-end API for %define variables to more completely
3141 mirror the back-end. This will be useful in the future.
3142 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
3143 Update comments to mention the new front-end counterparts of these
3144 macros.
3145 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
3146 for muscle_string_decode and muscle_location_decode.
3147 (muscle_string_decode): New static function.
3148 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
3149 (muscle_percent_define_get, muscle_percent_define_ifdef): New
3150 functions.
3151 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
3152 muscle_percent_define_get to mimic the b4_percent_define_flag_if
3153 implementation more closely.
3154 (muscle_percent_define_invalid_value): New function.
3155 * src/muscle_tab.h (muscle_percent_define_get,
3156 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
3157 Prototype.
3158
31592007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3160
3161 * NEWS (2.3a+): Mention yesterday's state-removal change.
3162 (2.3a): Remove the %language entry, which was added after 2.3a.
3163 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
3164 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
3165 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
3166 tests/existing.at: Update copyright date.
3167
31682007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3169
3170 If conflict resolution makes states unreachable, remove those states,
3171 report rules that are then unused, and don't report conflicts in those
3172 states.
3173 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
3174 New global function.
3175 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
3176 function.
3177 * src/main.c (main): After conflict resolution, remove the unreachable
3178 states and update all data structures that reference states by number.
3179 * src/state.c (state_new): Initialize each state's reachable member to
3180 false.
3181 (state_mark_reachable_states): New static function.
3182 (state_remove_unreachable_states): New global function.
3183 * src/state.h (struct state): Add member bool reachable.
3184 (state_remove_unreachable_states): Prototype.
3185 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3186 New test case.
3187 * tests/existing.at (GNU pic Grammar): Update test case output now that
3188 an unused rule is discovered.
3189
31902007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3191
3192 Minor code cleanup in parser table construction.
3193 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
3194 (new_itemsets, save_reductions): Update for rename to nitemset.
3195 * src/closure.c (nritemset): Rename to...
3196 (nitemset): ... this since the "r" appears to meaningless and isn't
3197 used in the comments.
3198 (closure): Update for rename.
3199 * src/closure.h (nritemset): Update extern to...
3200 (nitemset): ... this.
3201 * src/lalr.c (LA): Fix a typo in comments.
3202 * src/print.c (print_core): Update for rename to nitemset.
3203 * src/print_graph.c (print_graph): Likewise.
3204 * src/state.h: Fix some typos in header comments.
3205
32062007-04-04 Paul Eggert <eggert@cs.ucla.edu>
3207
3208 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
3209 still sticks to ASCII. Sorry!
3210
3211 * README-hacking: New file, taken mostly from coreutils, with changes
3212 for Bison. Contains much of the contents of:
3213 * README-cvs: Remove.
3214 * bootstrap: Sync from gnulib.
3215 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
3216 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
3217
32182007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
3219
3220 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
3221 Setzer.
3222 (Java Differences): Fix some typos.
3223 * THANKS: Add Sebastian Setzer.
3224
32252007-03-07 Paolo Bonzini <bonzini@gnu.org>
3226
3227 * data/java.m4 (b4_single_class_if): Remove.
3228 (b4_abstract_if): Look at "%define abstract".
3229 (b4_lexer_if): New.
3230 (b4_union_name): Rename...
3231 (b4_yystype): ... to this. Map to "%define stype".
3232 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
3233 b4_maybe_throws): Fix quoting.
3234 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
3235 * data/lalr1.java (Lexer interface): Always define.
3236 (Lexer interface within parser class): Remove.
3237 (YYLexer class): New, used when "%code lexer" is present.
3238 (constructor): When "%code lexer" is used, pass %lex-param
3239 to the lexer constructor.
3240 (yylex, yyparse): Remove %lex-param from method invocations
3241 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
3242
3243 * doc/bison.texinfo (Java Bison Interface): Mention "%define
3244 abstract". Rename "%define union_name" to "%define stype".
3245 Rename method names according to previous patch.
3246 (Java Scanner Interface): Describe "%code lexer" instead of
3247 "%pure-parser" and "%define single_class".
3248 (Java Differences): Mention "%code lexer".
3249
3250 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
3251 Include scanner here, using macros from tests/local.at.
3252 (AT_DATA_CALC_Y): Remove final argument.
3253 (_AT_CHECK_JAVA_CALC): Likewise.
3254 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
3255 of %locations and %error-verbose.
3256 (main): Test with and without %lex-param.
3257 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
3258 (AT_BISON_OPTION_POPDEFS): Pop it.
3259
32602007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3261
3262 DJGPP spefic issue. Inhibit the use of disallowed characters for
3263 file name genertion on Win98, WinXP, etc. These are |<>":?*\
3264 and concern testsuite case 46.
3265 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
3266 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
3267 * djgpp/config.bat: Inhibit the use of disallowed characters.
3268
32692007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3270
3271 Miscellaneous %define and %code cleanup.
3272 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
3273 values are interpreted.
3274 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
3275 documentation a little more.
3276 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
3277 muscle_percent_define_insert, muscle_percent_code_grow): New
3278 functions/macros.
3279 * src/muscle_tab.h (muscle_percent_define_insert,
3280 muscle_percent_code_grow): Prototype.
3281 * src/parse-gram.y (prologue_declaration): Use
3282 muscle_percent_define_insert and muscle_percent_code_grow when parsing
3283 %define and %code directives.
3284
3285 Make it easy to share %define boolean variables between the front-end
3286 and back-end. Though not used yet, this will be useful in the future.
3287 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
3288 Bison uses of names rather than just skeleton uses of names.
3289 (b4_percent_define_get, b4_percent_define_ifdef): Rename
3290 b4_percent_define_skeleton_variables(VARIABLE) to
3291 b4_percent_define_bison_variables(VARIABLE).
3292 (b4_percent_code_get, b4_percent_code_ifdef): Rename
3293 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
3294 b4_percent_code_bison_qualifiers(QUALIFIER).
3295 (b4_check_user_names_wrap): Update for renames.
3296 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
3297 muscle_percent_define_default): New functions mimicking
3298 b4_percent_define_flag_if and b4_percent_define_default.
3299
3300 For %define variables, report locations for invalid values and
3301 redefinitions.
3302 * data/bison.m4 (b4_percent_define_flag_if): Read
3303 b4_percent_define_loc(VARIABLE) to report the location of an invalid
3304 value for VARIABLE.
3305 (b4_percent_define_default): Save a special location in
3306 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
3307 must later be reported as invalid.
3308 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
3309 functions.
3310 (muscle_percent_define_insert): Record the location of VARIABLE in
3311 muscle percent_define_loc(VARIABLE), and use it to report the previous
3312 location for a redefinition.
3313 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
3314 (muscle_percent_define_default): Update like b4_percent_define_default.
3315 (muscle_grow_user_name_list): Rename to...
3316 (muscle_user_name_list_grow): ... this for consistency and use
3317 muscle_location_grow.
3318 * src/muscle_tab.h (muscle_location_grow): Prototype.
3319 * tests/input.at (%define errors): Update expected output.
3320 * tests/skeletons.at (%define boolean variables: invalid skeleton
3321 defaults): New test case.
3322
33232007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
3324
3325 * src/print.c (lookahead_set, state_default_rule): Remove.
3326 (print_reductions): Replace state_default_rule invocation with
3327 equivalent use of yydefact, which was computed in token_actions in
3328 tables.c.
3329 (print_results): Don't allocate lookahead_set.
3330
33312007-02-27 Paolo Bonzini <bonzini@gnu.org>
3332
3333 * data/lalr1.java: Prefix all private members with yy.
3334
33352007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
3336
3337 Use YYFPRINTF instead of fprintf where appropriate. Reported by
3338 Sebastien Fricker at
3339 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
3340 * THANKS: Add Sebastien Fricker.
3341 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
3342 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
3343 accept a variable number of arguments.
3344
33452007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3346
3347 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
3348
33492007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3350
3351 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
3352 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
3353 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
3354
33552007-02-11 Paul Eggert <eggert@cs.ucla.edu>
3356
3357 Undo my 2007-02-07 change, switching back to the c-strcase module
3358 introduced in the 2007-02-03 change. Bruno Haible reported that
3359 the 2007-02-07 change would be dangerous in Turkish if we add a
3360 language whose name contains "i", since "i" is not lowercase "I"
3361 in Turkish.
3362 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
3363 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
3364 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
3365 * m4/.cvsignore: Remove strcase.m4.
3366 * src/getargs.c: Revert 2007-02-07 change, as follows.
3367 Include c-strcase.h.
3368 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
3369
33702007-02-11 Bruno Haible <bruno@clisp.org>
3371
3372 Enable the Java related testsuite tests when the only Java compiler
3373 found is a gcj < 4.3. Discussed at
3374 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
3375 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
3376
33772007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
3378
3379 * data/Makefile.am: Update copyright date.
3380 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
3381 yypstate_new returns NULL.
3382 (yypstate_new): Return NULL if malloc does.
3383 * src/reader.c (packgram): Move translation of rule actions from the
3384 beginning of packgram to...
3385 (check_and_convert_grammar): ... here right before packgram is invoked
3386 so it's easier to write more complete comments, and remove redundant
3387 code.
3388
33892007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
3390
3391 As in semantic actions, make @$ in %initial-action, %destructor, and
3392 %printer imply %locations.
3393 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
3394 scanning @$.
3395 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
3396 (@$ in %initial-action implies %locations,
3397 @$ in %destructor implies %locations,
3398 @$ in %printer implies %locations): ... these new test cases.
3399
34002007-02-07 Paul Eggert <eggert@cs.ucla.edu>
3401
3402 Undo most of the 2007-02-03 change, switching to the strcase module
3403 now that gnulib strcase has been fixed.
3404 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
3405 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
3406 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
3407 * m4/.cvsignore: Add strcase.m4.
3408 * src/getargs.c: Revert 2007-02-03 change, as follows.
3409 Don't include c-strcase.h.
3410 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
3411 strcasecmp has "unspecified behavior" outside the POSIX locale,
3412 but it works fine in practice if at least one argument is ASCII,
3413 as is the case in Bison.
3414
34152007-02-07 Paolo Bonzini <bonzini@gnu.org>
3416
3417 * tests/java.at: Skip tests if only one of javac/java is present.
3418 Reported by Joel E. Denny.
3419 * tests/atlocal.in: Adjust copyright years.
3420
34212007-02-05 Paolo Bonzini <bonzini@gnu.org>
3422
3423 * data/lalr1.java (Stack): Work around old verifiers that disallow
3424 access to the private fields of an inner class, from the outer class.
3425 We can make Stack's fields public because user code doesn't have access
3426 to the instance of Stack used by parse(). Reported by Paul Eggert.
3427
34282007-02-03 Paul Eggert <eggert@cs.ucla.edu>
3429
3430 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
3431 the right spot for these files?
3432 * bootstrap.conf (gnulib_modules): Add c-strcase.
3433 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
3434 c-strncasecmp.c.
3435 * src/getargs.c: Include c-strcase.h.
3436 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
3437 to avoid unspecified behavior.
3438
34392007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
3440
3441 * doc/bison.texinfo (Decl Summary): Correct typo.
3442
34432007-01-30 Paolo Bonzini <bonzini@gnu.org>
3444
3445 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
3446 Complain if the value does not match empty, "true" or "false".
3447 * data/c++.m4: Adjust default definitions of %define variables.
3448 * data/java.m4: Adjust default definitions of %define variables.
3449 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
3450 to above behavior.
3451 * tests/input.at (Boolean %define variables): Test new behavior.
3452
34532007-01-29 Paolo Bonzini <bonzini@gnu.org>
3454
3455 * NEWS: Mention java.
3456 * TODO: Remove things that are done.
3457 * bootstrap.conf: Add javacomp-script and javaexec-script.
3458 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
3459
3460 * data/Makefile.am: Add new files.
3461 * data/java-skel.m4: New.
3462 * data/java.m4: New.
3463 * data/lalr1.java: New.
3464
3465 * doc/bison.texinfo: Put "A Complete C++ Example" under
3466 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
3467 under Other Languages.
3468
3469 * src/getargs.c (valid_languages): Add Java.
3470 * src/getargs.h (struct bison_language): Update size of string fields.
3471
3472 * tests/Makefile.am: Add java.at.
3473 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
3474 * tests/java.at: New.
3475 * tests/testsuite.at: Include it.
3476
34772007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
3478
3479 Clean up.
3480 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
3481 at_directive_argv arguments so these no longer have to be global
3482 variables. Also, update the implementation for the following changes.
3483 (fail_for_at_directive_too_many_args,
3484 fail_for_at_directive_too_few_args): Add at_directive_name argument.
3485 (at_directive_name): Remove as at_directive_argv[0] will be used for
3486 this now.
3487 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
3488 for the directive name.
3489 (at_directive_argc, at_directive_argv): Make these local within
3490 skel_lex instead of global.
3491 (INITIAL): Update directive start action for above changes.
3492 (SC_AT_DIRECTIVE_ARG): Rename to...
3493 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
3494 (SC_AT_DIRECTIVE_SKIP_WS): Update.
3495 (scan_skel): Move yylex_destroy to...
3496 (skel_scanner_free): ... here.
3497 * tests/skeletons.at (installed skeleton file name): Rename to...
3498 (installed skeleton file names): ... this.
3499
35002007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
3501
3502 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3503 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
3504 Summary" not "Directives".
3505 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
3506 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
3507 since the former is now the more complete one.
3508 (Prologue Alternatives): Likewise and do the same for %defines.
3509 (Table of Symbols): Add summary of %code, add summary of %define, and
3510 move full %code documentation to...
3511 (Decl Summary): ... here for consistency with other entries in these
3512 sections.
3513 Move %define entry in order to keep this list alphabetized.
3514 Reword %define entry a little to put less emphasis on the skeleton
3515 concept, which most users shouldn't have to think about.
3516
35172007-01-26 Paul Eggert <eggert@cs.ucla.edu>
3518
3519 Adjust to recent gnulib changes.
3520 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
3521 Add string.h, string_.h, unistd_.h, wchar_.h.
3522 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
3523 * src/system.h: Don't include <stpcpy.h>; this is now done by
3524 <string.h>.
3525
35262007-01-23 Paolo Bonzini <bonzini@gnu.org>
3527
3528 Simplify implementation of unqualified %code, implement macros for
3529 uniform treatment of boolean %define flags. Document %define.
3530 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
3531 b4_percent_code_ifdef): New.
3532 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
3533 * data/c++.m4: Define default value for global_tokens_and_yystype.
3534 * data/glr.cc: Likewise.
3535 * data/location.cc: Use b4_percent_define_flag_if.
3536
3537 * doc/bison.texinfo (Decl Summary): Document %define.
3538
3539 * src/parse-gram.y (Unqualified %code): Change muscle name to
3540 b4_percent_code().
3541 (content.opt): Default to empty.
3542
35432007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3544
3545 Implement support for relative and absolute skeleton file names.
3546 Discussed starting at
3547 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
3548 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
3549 (Bison Options): Document in --skeleton entry.
3550 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
3551 full_skeleton can't necessarily hold all of pkgdatadir.
3552 If the specified skeleton file name contains a `/', don't prepend
3553 pkgdatadir.
3554 * src/parse-gram.y (prologue_declaration): If the specified skeleton
3555 file name contains a `/', prepend the grammar file directory.
3556 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
3557 * skeletons.at: New file.
3558 (relative skeleton file names): New test case.
3559 (installed skeleton file names): New test case.
3560 * tests/testsuite.at: Include skeletons.at.
3561
3562 * bootstrap: Update copyright to 2007.
3563
35642007-01-17 Paolo Bonzini <bonzini@gnu.org>
3565
3566 * bootstrap: Remove occurrences of .#bootmp from the files.
3567
35682007-01-17 Akim Demaille <akim@epita.fr>
3569
3570 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
3571 nonterminals.
3572 Use per-type %printer.
3573
35742007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3575
3576 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
3577 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3578 djgpp/config.site, src/files.c, src/files.h, src/main.c,
3579 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
3580 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
3581 tests/glr-regression.at, tests/input.at, tests/local.at,
3582 tests/output.at, tests/torture.at: Update copyright to 2007.
3583
35842007-01-16 Akim Demaille <akim@epita.fr>
3585
3586 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
3587 error code.
3588 (Calc++ Scanner): Exit with failure if we can't open the input
3589 file.
3590 Accept "-" standing for stdin.
3591 (Calc++ Top Level): Print the result only if the parsing was
3592 successful.
3593
35942007-01-16 Akim Demaille <akim@epita.fr>
3595
3596 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
3597
35982007-01-15 Paolo Bonzini <bonzini@gnu.org>
3599 and Joel E. Denny <jdenny@ces.clemson.edu>
3600
3601 Clean up %define and %code implementation in M4 some. Most
3602 importantly, rename all related macros to be in the b4_percent_define
3603 and b4_percent_code namespaces. Also, complete support for `.' in
3604 %define variable names and %code qualifiers.
3605 * data/bison.m4 (b4_check_user_names): Check for special
3606 "SKELETON-NAMESPACE(name)" macros instead of using two nested
3607 m4_foreach loops.
3608 (b4_get_percent_define, b4_get_percent_code): Rename to...
3609 (b4_percent_define_get, b4_percent_code_get): ... these.
3610 Extend documentation with examples.
3611 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
3612 b4_percent_define_skeleton_variables and
3613 b4_percent_code_skeleton_qualifiers.
3614 Expect any value for the %define variable `foo' to be stored in the
3615 macro named `b4_percent_define(foo)'; expect any %code blocks for the
3616 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
3617 expect any unqualified %code blocks to be stored in a macro named
3618 `b4_percent_code_unqualified'.
3619 Use m4_indir so that %define variable names and %code qualifiers can
3620 contain `.', which is allowed by the grammar parser.
3621 (b4_percent_define_default): New macro to set a default value for a
3622 %define variable.
3623 (m4_wrap): Update wrapped code, and fix some underquoting.
3624 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
3625 Expect grammar uses of %define variables and %code qualifiers to be
3626 defined in b4_percent_define_user_variables and
3627 b4_percent_code_user_qualifiers.
3628 * data/c++.m4: Use b4_percent_define_default rather than
3629 m4_define_default. Fix some underquoting. Skeleton usage of %define
3630 variable define_location_comparison now implies skeleton usage of
3631 %define variable filename_type.
3632 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3633 data/push.c, data/yacc.c: Update macro names.
3634 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
3635 muscle names.
3636
36372007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3638
3639 DJGPP specific issues.
3640
3641 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
3642 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
3643
36442007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3645
3646 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
3647 run parsers in all tests so that Valgrind is invoked during
3648 maintainer-check-valgrind.
3649 (Duplicate representation of merged trees): Free all semantic values.
3650 (Duplicated user destructor for lookahead): Likewise.
3651
36522007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3653
3654 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
3655 command-line prefix.
3656 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
3657 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
3658 miss Valgrind messages.
3659 (Exploding the Stack Size with Malloc): Likewise.
3660
36612007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3662
3663 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
3664 locals. Reported by Juan Manuel Guerrero at
3665 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
3666 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
3667 Fix some indentation also.
3668 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
3669 explaining this issue.
3670
36712007-01-09 Paolo Bonzini <bonzini@gnu.org>
3672 and Joel E. Denny <jdenny@ces.clemson.edu>
3673
3674 Simplify union and prologue handling, and escape union and lex/parse
3675 params with digraphs.
3676 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
3677 values to the empty string since these are no longer guaranteed
3678 initialized by the front-end.
3679 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
3680 braces around b4_user_stype since this is no longer done by the
3681 front-end.
3682 * src/files.c, src/files.h (pre_prologue_obstack,
3683 post_prologue_obstack): Remove.
3684 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
3685 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
3686 with digraphs. This fixes lex params and parse params.
3687 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
3688 * src/output.c (prepare): Remove muscle insertion of the prologues.
3689 (output): Remove freeing of pre_prologue_obstack and
3690 post_prologue_obstack.
3691 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
3692 than prologue_augment for prologue parsing so you don't need prologue
3693 obstacks.
3694 (grammar_declaration): For %union RHS, use `braceless' instead of
3695 "{...}" so that braces are already stripped and code is escaped with
3696 digraphs.
3697 * src/reader.c (prologue_augment): Remove.
3698 (reader): Remove initialization of pre_prologue_obstack and
3699 post_prologue_obstack.
3700 * src/reader.h (prologue_augment): Remove.
3701
3702 * data/c.m4: Remove stray parenthesis.
3703
37042007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3705
3706 Remove quotes from variables names in %define directives and from
3707 qualifiers in %code directives, and restrict the characters that are
3708 allowed in them to M4-friendly ones. For %define, continue to support
3709 the quoted form as a deprecated feature. Discussed starting at
3710 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
3711 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
3712 %code.
3713 * doc/bison.texinfo (Prologue Alternatives): Update.
3714 (Decl Summary): In %defines entry, update mention of `%code requires'
3715 and `%code provides'.
3716 (C++ Location Values): Update %define uses.
3717 (Calc++ Parser Interface): Likewise.
3718 (Calc++ Parser): Likewise, and update `%code requires' uses.
3719 (Table of Symbols): Update %code documentation.
3720 * src/parse-gram.y (prologue_declaration): For %define variables, use
3721 `variable' instead of `STRING'.
3722 (grammar_declaration): For %code qualifiers, use `ID' instead of
3723 `STRING'.
3724 (variable): New nonterminal that takes an `ID' or a `STRING'.
3725 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
3726 and %define uses.
3727 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
3728 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
3729 (%define errors): Update %define uses.
3730
37312007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3732
3733 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
3734 instead of muscle_insert for %define values so that M4-special
3735 characters are replaced with digraphs.
3736 * tests/input.at (%define errors): Extend to check weird values.
3737
37382007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3739
3740 Instead of having skeletons declare all valid %define variables and
3741 %code qualifiers, provide macros that retrieve the associated values
3742 and build these lists automatically. Thus Bison will now warn when a
3743 variable or qualifier is not used by the skeleton in the current
3744 invocation regardless of whether it might sometimes be used by that
3745 skeleton in other invocations. Also, move all %define value macros to
3746 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
3747 form, which is replaced by %code.
3748 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
3749 (b4_check_user_names): ... this, and change the series of valid name
3750 arguments to a single list argument for names used in the skeleton
3751 similar to the existing list argument for names used in the grammar.
3752 Warn instead of complaining.
3753 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
3754 values and %code code, to format %code code properly, and to build
3755 lists of all %define variables and %code qualifiers used in the
3756 skeleton: b4_skeleton_percent_define_variables and
3757 b4_skeleton_percent_code_qualifiers.
3758 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
3759 Remove, and...
3760 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
3761 the skeleton names lists can finish building first. In place of
3762 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
3763 expect the lists b4_user_percent_define_variables and
3764 b4_user_percent_code_qualifiers.
3765 * data/c++.m4: Where setting default values for b4_parser_class_name,
3766 b4_location_type, b4_filename_type, b4_namespace, and
3767 b4_define_location_comparison, update their names to the
3768 b4_percent_define_ namespace.
3769 * data/glr.c: Don't use b4_check_percent_define_variables and
3770 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3771 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
3772 (b4_parser_class_name, b4_namespace): Define these using
3773 b4_get_percent_define for parser_class_name and namespace.
3774 * data/location.cc: Use b4_get_percent_define.
3775 * data/push.c: Don't use b4_check_percent_define_variables and
3776 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3777 * data/yacc.c: Likewise, and don't call m4_exit in
3778 b4_use_push_for_pull_if or m4_wrap code will never execute.
3779 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
3780 Rename to...
3781 (muscle_grow_user_name_list): ... this for consistency with the
3782 terminology used in bison.m4.
3783 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
3784 %define variable names, and rename muscle used_percent_define_variables
3785 to user_percent_define_variables.
3786 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
3787 user_percent_code_qualifiers.
3788 (content): Remove.
3789 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
3790 {CODE} form is no longer accepted.
3791 * tests/input.at (Reject bad %code qualifiers): Rename to...
3792 (Reject unused %code qualifiers): ... this, and update test output.
3793 (%define error): Update test output.
3794
37952007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
3796
3797 Check for unrecognized %define variables similar to checking for
3798 unrecognized %code qualifiers. Check for redefined %define variables.
3799 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
3800 generalizes...
3801 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
3802 (b4_check_percent_define_variables): New, also wraps it.
3803 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
3804 variables using b4_check_percent_define_variables.
3805 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
3806 all those exercised in the test suite and all those listed in the
3807 `Default values' section of c++.m4. Are there others?
3808 * data/push.c, data/yacc.c: Declare no valid %define variables.
3809 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
3810 similar to muscle_find, but it works even when the muscle stores a
3811 const value.
3812 (muscle_grow_used_name_list): New function for constructing the used
3813 name list muscles that b4_check_for_unrecognized_names requires.
3814 * src/parse-gram.y (prologue_declaration): Warn if a variable is
3815 %define'd more than once. Define the b4_used_percent_define_variables
3816 muscle with muscle_grow_used_name_list.
3817 (grammar_declaration): Abbreviate %code code with
3818 muscle_grow_used_name_list.
3819 * tests/input.at (%define errors): New.
3820
38212007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3822
3823 Provide warn_at, complain_at, and fatal_at function callbacks to the
3824 skeletons, and use this for %code qualifier complaints.
3825 * data/bison.m4 (b4_error_at): New, invoked by...
3826 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
3827 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
3828 @fatal_at(...@) directives.
3829 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
3830 qualifiers in b4_used_percent_code_qualifiers and to use
3831 b4_complain_at.
3832 * src/location.c, src/location.h (boundary_set_from_string): New global
3833 function.
3834 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
3835 function.
3836 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
3837 to b4_used_percent_code_qualifiers.
3838 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
3839 function.
3840 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
3841 (lineno): Rename to...
3842 (out_lineno): ... this so I don't misunderstand it again.
3843 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
3844 here; these newlines are in the input but not the output file.
3845 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
3846 (at_directive_perform): ... this new static function, and add handling
3847 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
3848 directives.
3849 * tests/input.at (Reject bad %code qualifiers): Update test output with
3850 locations and extend.
3851
3852 * tests/output.at (Output file name: [, Output file name: ]): Remove
3853 bogus comment about these tests failing.
3854
38552007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3856
3857 Clean up b4_check_percent_code_qualifiers a little.
3858 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
3859 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
3860 documentation and add examples.
3861 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
3862 qualifiers here.
3863
38642007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
3865
3866 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
3867 unreliable -- especially when they're hidden inside another macro.
3868 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
3869 data/c.m4: Remove m4_divert(-1).
3870 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3871 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
3872 m4_divert_push(0) and m4_divert_pop(0).
3873 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
3874 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
3875 pushed and popped by m4sugar, should be first on the stack.
3876
3877 Provide warn, complain, and fatal function callbacks to the skeletons.
3878 This provides more flexibility than m4_fatal, improves the error
3879 message format, and captures messages for translation. Discussed
3880 starting at
3881 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
3882 * data/bison.m4 (b4_error): New, invoked by...
3883 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
3884 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
3885 directives. Because these M4 macros might be called when the current
3886 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
3887 the previous removal of uses of m4_divert, which caused trouble.
3888 (b4_check_percent_code_qualifiers): Use b4_complain instead of
3889 m4_fatal to report unrecognized %code qualifiers.
3890 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
3891 push parser requests.
3892 * data/glr.c: Use b4_complain instead of m4_fatal to report
3893 non-deterministic push parser requests.
3894 Update @output usage to @output(...@) form.
3895 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
3896 report missing %defines. Update @output usage to @output(...@) form.
3897 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
3898 @output(...@) form.
3899 * src/main.c (main): Invoke skel_scanner_free.
3900 * src/scan-skel.h (skel_scanner_free): Prototype new function.
3901 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
3902 obstack_for_string from flex-scanner.h.
3903 (YY_DECL): Use to declare skel_lex static.
3904 (decode_at_digraphs): Remove; now handled in the new
3905 SC_AT_DIRECTIVE_ARG start condition.
3906 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
3907 functions.
3908 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
3909 at_directive_argv): New static globals.
3910 (INITIAL): Use fail_for_invalid_at.
3911 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
3912 recognize the start of a generalized `@directive(...@)' form and
3913 start...
3914 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
3915 directive args (using the new obstack_for_string), to decode the
3916 contained @ diagraphs, and to perform the directive. It recognizes
3917 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
3918 @output(...@).
3919 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
3920 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
3921 `@,'.
3922 (scan_skel): Initialize obstack_for_string on the first call.
3923 (skel_scanner_free): New function to free obstack_for_string.
3924 * tests/input.at (Reject bad %code qualifiers): Update test output.
3925
39262007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
3927
3928 Consolidate the 4 prologue alternative directives (%code, %requires,
3929 %provides, and %code-top) into a single %code directive with an
3930 optional qualifier field. Discussed at
3931 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
3932 * NEWS (2.3a+): Rewrite the existing entry for the prologue
3933 alternatives.
3934 * doc/bison.texinfo (Prologue Alternatives): Update.
3935 (Decl Summary): Update to %code "requires" and %code "provides".
3936 (Calc++ Parser): Update to %code "requires".
3937 (Table of Symbols): Remove entries for %requires, %provides, and
3938 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
3939 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
3940 are replaced by b4_percent_code_provides and b4_percent_code_requires,
3941 which are skeleton-specific.
3942 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
3943 declare what %code qualifiers it supports and to complain if any other
3944 qualifiers were used in the grammar.
3945 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
3946 and b4_user_code([b4_percent_code_provides]) in place of
3947 b4_user_requires and b4_user_provides.
3948 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
3949 Add b4_user_code([b4_percent_code_top]) and
3950 b4_user_code([b4_percent_code]).
3951 Invoke b4_check_percent_code_qualifiers.
3952 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3953 PERCENT_REQUIRES): Remove.
3954 (grammar_declaration): Remove RHS's for %code-top, %provides, and
3955 %requires. Rewrite the %code RHS as the unqualified form defining the
3956 muscle b4_percent_code. Add another RHS for the qualified %code form,
3957 which defines muscles of the form b4_percent_code_QUALIFIER and the
3958 b4_used_percent_code_qualifiers muscle.
3959 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
3960 PERCENT_REQUIRES): Remove.
3961 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
3962 %code "requires" and %code "provides".
3963 * tests/input.at (Reject bad %code qualifiers): New.
3964
39652007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
3966
3967 Use the new code_props interface for destructors and printers.
3968 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
3969 printer_location members, and change the type of the destructor and
3970 printer members to code_props.
3971 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
3972 symbol_printer_get, semantic_type_destructor_set,
3973 semantic_type_printer_set, default_tagged_destructor_set,
3974 default_tagless_destructor_set, default_tagged_printer_set,
3975 default_tagless_printer_set): Use code_props in arguments and return
3976 types in place of char const * and location.
3977 (symbol_destructor_location_get, symbol_printer_location_get): Remove
3978 since the locations are now contained in the return of
3979 symbol_destructor_get and symbol_printer_get.
3980 * src/output.c (symbol_destructors_output, symbol_printers_output):
3981 Replace with...
3982 (symbol_code_props_output): ... this to eliminate duplicate code.
3983 (output_skeleton): Update to use symbol_code_props_output.
3984 * src/reader.c (symbol_should_be_used): Update use of
3985 symbol_destructor_get.
3986 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3987 Update uses of the various _destructor_set and _printer_set functions.
3988 * src/symtab.c: (default_tagged_destructor_location,
3989 default_tagless_destructor_location, default_tagged_printer_location,
3990 default_tagless_printer_location): Remove since we...
3991 (default_tagged_destructor, default_tagless_destructor,
3992 default_tagged_printer, default_tagless_printer): ... change the type
3993 of these to code_props.
3994 (symbol_new, semantic_type_new, symbol_destructor_set,
3995 semantic_type_destructor_set, symbol_destructor_get,
3996 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
3997 symbol_check_alias_consistency, default_tagged_destructor_set,
3998 default_tagless_destructor_set, default_tagged_printer_set,
3999 default_tagless_printer_set): Update.
4000 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
4001 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
4002 code_props members.
4003 (symbol_print): Use SYMBOL_CODE_PRINT.
4004
40052007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
4006
4007 Use the new code_props interface for rule actions.
4008 * src/symlist.h (symbol_list): Replace action, action_location, and
4009 used members with a code_props action_props member.
4010 * src/reader.c (symbol_should_be_used, grammar_rule_check,
4011 grammar_midrule_action, grammar_current_rule_merge_set,
4012 grammar_current_rule_symbol_append, packgram): Update.
4013 * src/scan-code.h (translate_rule_action): Remove, no longer used.
4014 * src/scan-code.l (handle_action_dollar): Update.
4015 (translate_rule_action): Remove, no longer used.
4016 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
4017
40182007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4019
4020 Use the new code_props interface in parse-gram.y.
4021 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
4022 Update all uses of translate_* functions to use the new code_props
4023 interface and to use gram_scanner_last_string_free and
4024 code_scanner_last_string_free where possible.
4025 (grammar_declaration): symbol_list_destructor_set and
4026 symbol_list_printer_set now perform the translation, so don't do it
4027 here. Use gram_scanner_last_string_free where possible.
4028 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
4029 translate_code): Remove, no longer used.
4030 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
4031 symbol_list_printer_set): Perform code translation here rather than
4032 depending on the caller to do so.
4033
4034 * src/symlist.h (struct symbol_list): Correct some documentation typos.
4035 * src/scan-gram.h (gram_last_string): Remove declaration.
4036 * src/scan-gram.l (last_string): Declare it static.
4037
40382007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4039
4040 Encapsulate code properties and related functionality for the various
4041 destructors, printers, and actions into a code_props structure and
4042 interface. This patch merely implements code_props in scan-code.h and
4043 scan-code.l. Future patches will rewrite other modules to use it.
4044 Discussed starting at
4045 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
4046 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
4047 consistently initialize const structs that have an empty location
4048 field.
4049 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
4050 to ensure consistency.
4051 * src/scan-code.h (code_props): New structure.
4052 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
4053 function, macro, and const global variable for initializing a
4054 code_props with no code.
4055 (code_props_plain_init, code_props_symbol_action_init,
4056 code_props_rule_action_init, code_props_translate_code): The rest of
4057 the new code_props functional interface. Among other things, the init
4058 functions set the code_props kind field so that
4059 code_props_translate_code will know whether to behave like
4060 translate_symbol_action, translate_rule_action, or translate_code.
4061 These old translate functions must remain until all other modules are
4062 updated to use the new code_props interface.
4063 (code_scanner_last_string_free): New function similar to
4064 gram_scanner_last_string_free.
4065 (code_scanner_free): Add documentation.
4066 * src/scan-code.l: Implement the new interface.
4067 (code_lex): Make it static, add a code_props* argument, and remove the
4068 rule argument.
4069 (last_string): New static global similar to the one in scan-gram.l.
4070 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
4071 instead of rule.
4072 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
4073 code_props since Bison may one day use this information for destructors
4074 and printers.
4075 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
4076 (handle_action_dollar): Use symbol_list_n_get and set used flag
4077 directly since symbol_list_n_used_set is removed.
4078 (translate_action): Add a code_props* argument and remove the rule,
4079 action, and location arguments. Pass the code_props* on to code_lex.
4080 (translate_rule_action, translate_symbol_action, translate_code):
4081 Rewrite as wrappers around the new code_props interface.
4082 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
4083 it would eventually need to break the encapsulation of code_props.
4084
40852007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
4086
4087 * etc/.cvsignore: New.
4088
40892007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
4090
4091 Add maintainer-push-check to run maintainer-check using push parsing in
4092 place of pull parsing where available.
4093 * Makefile.am (maintainer-push-check): New.
4094 * data/bison.m4 (b4_use_push_for_pull_if): New.
4095 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
4096 appropriately based on their existing values.
4097 (yypush_parse): Don't print push-parser-specific diagnostics if push
4098 parsing is being used in place of pull parsing.
4099 * data/yacc.c: If push parsing should replace pull parsing, redirect to
4100 push.c.
4101 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
4102 variable, and insert b4_use_push_for_pull_flag into muscles.
4103 * tests/Makefile.am (maintainer-push-check): New.
4104
41052006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4106
4107 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
4108 (whether successful or failed) so that yypush_parse can be invoked
4109 again to start a new parse using the same yypstate.
4110 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
4111 check multiple yypull_parse invocations on the same yypstate. For pull
4112 mode, extend to check multiple yyparse invocations.
4113 (Exploding the Stack Size with Alloca): Extend to try with
4114 %push-pull-parser.
4115 (Exploding the Stack Size with Malloc): Likewise.
4116
4117 * tests/calc.at (Simple LALR Calculator): Don't specify
4118 %skeleton "push.c" since %push-pull-parser implies that now.
4119 * tests/headers.at (export YYLTYPE): Don't check for the push
4120 declarations. Otherwise, this test case can't be used to see if push
4121 mode can truly emulate pull mode.
4122 * tests/input.at (Torturing the Scanner): Likewise.
4123 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
4124 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
4125 AT_YACC_IF, which now includes the case of push mode since %skeleton
4126 need not be used for push mode. This will be more intuitive once
4127 push.c is renamed to yacc.c.
4128
41292006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4130
4131 For push mode, convert yyparse from a macro to a function, invoke yylex
4132 instead of passing a yylexp argument to yypull_parse, and don't
4133 generate yypull_parse or yyparse unless %push-pull-parser is declared.
4134 Discussed starting at
4135 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
4136 * data/bison.m4 (b4_pull_if): New.
4137 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
4138 * data/push.c: Improve M4 quoting a little.
4139 (b4_generate_macro_args, b4_parenthesize): Remove.
4140 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
4141 any time a pull parser is requested.
4142 Don't #define this as a wrapper around yypull_parse. Instead, when
4143 both push and pull are requested, make it a function that does that
4144 same thing.
4145 (yypull_parse): If there's a b4_prefix, #define this to
4146 b4_prefix[pull_parse] when both push and pull are requested.
4147 Don't define this as a function unless both push and pull are
4148 requested.
4149 Remove the yylexp argument and hard-code yylex invocation instead.
4150 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
4151 %push-parser.
4152 * src/getargs.c (pull_parser): New global initialized to true.
4153 * getargs.h (pull_parser): extern it.
4154 * src/output.c (prepare): Insert pull_flag muscle.
4155 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
4156 (prologue_declaration): Set both push_parser and pull_parser = true for
4157 %push-pull-parser. Set push_parser = true and pull_parser = false for
4158 %push-parser.
4159 * src/scan-gram.l: Don't accept %push_parser as an alternative to
4160 %push-parser since there's no backward-compatibility concern here.
4161 Scan %push-pull-parser.
4162 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
4163 instead of %push-parser.
4164 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
4165 prototype it in the module that calls yyparse.
4166 * tests/input.at (Torturing the Scanner): Likewise.
4167 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
4168
41692006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
4170
4171 Update etc/bench.pl. Optimize push mode a little (the yyn change
4172 deserves most of the credit).
4173 * Makefile.am (SUBDIRS): Add etc subdirectory.
4174 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
4175 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
4176 yytoken, yyval, and yyloc declarations to...
4177 (yyparse or yypush_parse): ... here to improve performance. For
4178 yypush_parse invocations after the first, be sure to assign yyn its old
4179 value again.
4180 (yypstate_new): Don't bother initializing the yyresult field since the
4181 initial value isn't used.
4182 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
4183 remove the #define that, in push mode, set it to yyps->NAME.
4184 * etc/Makefile.am: New.
4185 * etc/bench.pl: Remove and build it instead from...
4186 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
4187 "tests/bison" from the build directory by default rather than just
4188 invoking "bison" from $PATH.
4189 (calc_grammar): Update push parser code: don't declare yylval globally,
4190 don't define yyparse_wrapper, and don't #define yyparse.
4191 (bench_grammar): Update to check all working combinations of yacc.c,
4192 push.c, impure, pure, pull, and push.
4193
41942006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4195
4196 For push mode, add pull wrappers around yypush_parse.
4197 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
4198 (yypull_parse): New function wrapping yypush_parse.
4199 (yyparse): New #define wrapping yypull_parse.
4200 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
4201 is declared.
4202 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
4203 prototype yylex in the module that calls yyparse, and don't prototype
4204 yyparse there. Otherwise, the yyparse expansion won't compile.
4205 * tests/input.at (Torturing the Scanner): Likewise.
4206
42072006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4208
4209 Enable push parsers to operate in impure mode. Thus, %push-parser no
4210 longer implies %pure-parser. The point of this change is to move
4211 towards being able to test the push parser code by running the entire
4212 test suite as if %push-parser had been declared.
4213 * data/push.c (yypush_parse): For impure mode, remove the
4214 yypushed_char, yypushed_val, and yypushed_loc arguments.
4215 Instead, declare these as local variables initialized to the global
4216 yychar, yylval, and yylloc.
4217 For the first yypush_parse invocation only, restore the initial values
4218 of these global variables when it's time to read a token since they
4219 have been overwritten.
4220 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
4221 %push-parser.
4222 * tests/calc.at (Simple LALR(1) Calculator): Always declare
4223 %pure-parser along with %push-parser since this test case was designed
4224 for pure push parsers.
4225 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
4226 (AT_YACC_OR_PUSH_IF): New.
4227 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
4228 add a note that it's still wrong for some cases (as it has been for a
4229 while).
4230 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
4231 %push-parser no longer implies %pure-parser.
4232
42332006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4234
4235 Remove some unnecessary differences between the pull parser code and
4236 the push parser code. This patch enables yynerrs in push mode.
4237 * data/push.c: Reformat M4 a little.
4238 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
4239 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
4240 because push mode is on. Instead, if pure mode is on, move yynerrs
4241 to...
4242 (b4_declare_parser_state_variables): ... here.
4243 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
4244 to yyps->NAME so it can be used in yypush_parse.
4245 (yypush_parse): Don't omit uses of yynerrs in push mode.
4246
42472006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4248
4249 Fix bug such that the first pushed token's value and location are
4250 sometimes overwritten (sometimes by %initial-action) before being used.
4251 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
4252 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
4253 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
4254 more closely mimic the pull parser logic.
4255 Don't copy the pushed token to yychar, yylval, and yylloc until it's
4256 time to read a token, which is after any initialization of yylval and
4257 yylloc.
4258 (gottoken): Rename label to...
4259 (yyread_pushed_token): ... for clarity and to avoid infringing on the
4260 user namespace.
4261
42622006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4263
4264 Rearrange initialization of the parser state variables so that the
4265 skeleton doesn't have to have a copy for pull mode and another for push
4266 mode. This patch also fixes at least a bug such that yylloc was not
4267 initialized (with b4_location_initial_line and
4268 b4_location_initial_column) upon calling yypush_parse. However, that
4269 initialization now overwrites the first token's location;
4270 %initial-action assigning @$ already did the same thing, and both bugs
4271 will be fixed in a later patch.
4272 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
4273 (b4_declare_parser_state_variables): Remove initialization of yytoken,
4274 yyss, yyvs, yyls, and yystacksize.
4275 (yypstate_new): Remove initialization of some yypstate fields: yystate,
4276 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
4277 yylsp.
4278 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
4279 yyps->NAME so it can be used in yypush_parse.
4280 (yyparse or yypush_parse): For yypush_parse, don't print the
4281 "Starting parse" diagnostic for invocations after the first.
4282 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
4283 yypush_parse, only do it for the first invocation.
4284 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
4285 initialization to occur in yypush_parse but only on the first
4286 invocation.
4287
42882006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4289
4290 * data/push.c: Add CPP guards around push parser declarations in both
4291 the header and the code file.
4292 In the code file, move the push parser declarations to the same place
4293 they appear in the header file.
4294 Clean up the M4 some, especially the inconsistent underquoting in
4295 some b4_c_function_def and b4_c_function_decl uses.
4296
42972006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4298
4299 Encapsulate the push parser state variables into an M4 macro so the
4300 push skeleton doesn't have to list them again for pull mode's yyparse.
4301 For push mode, remove yypush_parse's local equivalents of these
4302 variables to eliminate unnecessary copying between the two sets at
4303 run-time. This patch also fixes at least a bug related to multiple
4304 %initial-action invocations in push mode.
4305 * data/push.c (b4_declare_parser_variables): Rename to...
4306 (b4_declare_scanner_communication_variables): ... this for clarity and
4307 update both uses.
4308 (b4_declare_yyparse_variables): Remove and move its contents to the one
4309 spot where it was invoked.
4310 (b4_declare_parser_state_variables): New macro containing the parser
4311 state variables required by push mode.
4312 (struct yypstate): Replace all fields but yynew with
4313 b4_declare_parser_state_variables.
4314 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
4315 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
4316 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
4317 (yyparse or yypush_parse): For yyparse in pull mode, replace local
4318 parser state variable declarations with
4319 b4_declare_parser_state_variables.
4320 Don't initialize parser state variables when calling yypush_parse since
4321 yypstate_new already does that.
4322 Invoke the user's initial action only upon the first yypush_parse
4323 invocation.
4324 Remove all code that copies between the local parser state variables
4325 and the yypstate.
4326
43272006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4328
4329 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
4330 prevent a name collision in a future patch where these names will
4331 sometimes be #define'd.
4332 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
4333 since it no longer has the same name as the existing argument.
4334 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
4335
43362006-12-19 Paolo Bonzini <bonzini@gnu.org>
4337 and Joel E. Denny <jdenny@ces.clemson.edu>
4338
4339 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4340 that the argument is case-insensitive, and there's no `=' here.
4341 For the %skeleton entry, mention that %language is better.
4342 (Bison Options): Likewise for --language and --skeleton. Move the
4343 --skeleton entry so that the `Tuning the parser' section is sorted
4344 alphabetically on long options.
4345 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
4346 %language directive in detail here; cross-reference the %language
4347 documentation instead.
4348 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
4349 `%require "2.3b"' so that the example is always up-to-date.
4350 (Table of Symbols): Add entries for %language and %skeleton.
4351 * examples/extexi (normalize): Instead of replacing every %require
4352 argument with the current Bison version, just substitute for
4353 `@value{VERSION}'. This guarantees that we're testing what actually
4354 appears in the documentation.
4355 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
4356 rather than `@VERSION@'.
4357
43582006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4359
4360 * NEWS: Reword the %language news a bit, and put it earlier.
4361
4362 * src/getargs.c (skeleton_arg): Last arg is now location const *.
4363 Rewrite to simplify the logic.
4364 (language_argmatch): Likewise.
4365 (program_name): We now own this var.
4366 * src/getargs.h (struct bison_language): Use char[] rather than
4367 const char *.
4368
4369 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
4370 Java is supported.
4371 * src/complain.c (program_name): Remove decl; no longer needed.
4372 * src/main.c (program_name): Remove; now belongs to getargs.
4373
43742006-12-18 Paolo Bonzini <bonzini@gnu.org>
4375
4376 * NEWS: Document %language.
4377
4378 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
4379
4380 * data/c-skel.m4, data/c++-skel.m4: New files.
4381 * data/glr.c: Complain on push parsers.
4382
4383 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
4384 over %skeleton.
4385 (Decl Summary): Document %language and %skeleton.
4386 (Command line): Document -L.
4387
4388 * examples/extexi: Rewrite %require directive.
4389 * examples/calc++/Makefile.am: Pass VERSION to extexi.
4390
4391 * src/files.c (compute_exts_from_gc): Look in language structure
4392 for .y extension.
4393 (compute_file_name_parts): Check whether .tab should be added.
4394 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
4395 (language, skeleton_arg, language_argmatch): New.
4396 (long_options): Add --language.
4397 (getargs): Use skeleton_arg, add -L/--language.
4398 * src/getargs.h: Include location.h.
4399 (struct bison_language, language, skeleton_arg, language_argmatch): New.
4400 * src/output.c (prepare): Pick default skeleton from struct language.
4401 Don't dispatch C skeletons here.
4402 * src/parse-gram.y (PERCENT_LANGUAGE): New.
4403 (prologue_declaration): Add "%language" rule, use skeleton_arg.
4404 * src/scan-gram.l ("%language"): New rule.
4405
4406 * tests/calc.at: Test %skeleton and %language.
4407 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
4408 (AT_GLR_IF): Look for %skeleton "glr.cc".
4409 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
4410 (AT_YACC_IF): Reject %language.
4411
44122006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4413
4414 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
4415 since it wasn't used; only the typedef name 'semantic_type' is needed.
4416 Also, omit trailing white space.
4417
4418 * bootstrap: Sync from coreutils.
4419 (gnulib_extra_files): Add build-aux/announce.gen.
4420 (slurp): Adjust .gitignore files like .cvsignore files.
4421 * build-aux/announce-gen: Remove from CVS, since bootstrap
4422 now creates this.
4423
44242006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
4425
4426 Make %push-parser imply %pure-parser. This fixes several bugs; see
4427 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
4428 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
4429 pure_parser = true.
4430 * data/push.c: Don't bother testing b4_push_if when deciding whether
4431 to expand b4_declare_parser_variables globally.
4432 (yypush_parse): Likewise in here.
4433
4434 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
4435 (yy_reduce_print): Reformat M4 for readability.
4436
44372006-12-15 Bob Rossi <bob@brasko.net>
4438 and Joel Denny <jdenny@ces.clemson.edu>
4439
4440 * data/push.c (yypstate): Add typedef, and update all uses of
4441 struct yypstate to just yypstate.
4442 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
4443
44442006-12-14 Bob Rossi <bob@brasko.net>
4445
4446 * data/push.c (yypush_parse): Declare prototype regardless of
4447 %locations option.
4448
44492006-12-14 Bob Rossi <bob@brasko.net>
4450
4451 * data/push.c (yyparse): Remove the prototype and the #define when in
4452 push-parser mode.
4453
44542006-12-13 Bob Rossi <bob@brasko.net>
4455
4456 * data/push.c (yypstate_init): Rename to...
4457 (yypstate_new): ... this and use b4_c_function_def.
4458 (yypstate_delete): New.
4459 (yypush_parse): Change parameters yynval and yynlloc to be const.
4460 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
4461 yypstate_delete functions.
4462
44632006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
4464
4465 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
4466 strange test case titles. Reported by Bob Rossi.
4467
44682006-12-13 Paul Eggert <eggert@cs.ucla.edu>
4469
4470 * TODO: Add pointer to Sylvain Schmitz's work on static detection
4471 of potential ambiguities in GLR grammers.
4472
44732006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
4474
4475 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
4476 `bison ', use m4_index instead of m4_substr since chopping up a string
4477 containing M4-special characters causes problems here.
4478
4479 Fix a couple of bugs related to special characters in user-specified
4480 file names, and make it easier for skeletons to compute output file
4481 names with the same file name prefix as Bison-computed output file
4482 names.
4483 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
4484 b4_parser_file_name and b4_spec_defines_file instead of
4485 @output_parser_name@ and @output_header_name@, which are now redundant.
4486 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
4487 b4_parser_file_name, b4_spec_defines_file, and the new
4488 @basename(FILENAME@) instead of @output_parser_name@ and
4489 @output_header_name@, which inappropriately escaped the file names as
4490 C string literals.
4491 * src/files.c (all_but_ext): Remove static qualifier.
4492 (compute_output_file_names): Move `free (all_but_ext)' to...
4493 (output_file_names_free): ... here since all_but_ext is needed later.
4494 * src/files.h (all_but_ext): Extern.
4495 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
4496 exactly what MUSCLE_INSERT_STRING used to do.
4497 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
4498 characters are escaped properly.
4499 * src/output.c (prepare): Define muscle file_name_all_but_ext as
4500 all_but_ext.
4501 For pkgdatadir muscle, maintain previous functionality by using
4502 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
4503 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
4504 digraphs would never be expanded. Hopefully no one has M4-special
4505 characters in his Bison installation path.
4506 * src/scan-skel.l: Don't parse @output_header_name@ and
4507 @output_parser_name@ anymore since they're now redundant.
4508 In @output, use decode_at_digraphs.
4509 Parse a new @basename command that invokes last_component.
4510 (decode_at_digraphs): New.
4511 (BASE_QPUTS): Remove unused.
4512 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
4513 (Output file name): New tests.
4514
45152006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
4516
4517 Warn about output files that are generated by the skeletons and that
4518 conflict with other output files.
4519 * data/glr.c: Don't generate the header file here when glr.cc does.
4520 * src/files.c (file_names, file_names_count): New static globals.
4521 (compute_output_file_names): Invoke output_file_name_check for files
4522 not generated by the skeletons and remove existing checks.
4523 (output_file_name_check): New function that warns about conflicting
4524 output file names.
4525 (output_file_names_free): Free file_names.
4526 * src/files.h (output_file_name_check): Declare.
4527 * src/scan-skel.l: Invoke output_file_name_check for files generated by
4528 the skeletons.
4529 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
4530 (Conflicting output files): New tests.
4531
45322006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4533
4534 * doc/bison.texinfo: Fix a couple of typos.
4535
45362006-12-08 Bob Rossi <bob@brasko.net>
4537
4538 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
4539 Rename to...
4540 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
4541 update all uses.
4542 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
4543 (yypush_parse): Rename yypvars argument to yyps and remove redundant
4544 local pv.
4545 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
4546 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
4547
45482006-12-07 Bob Rossi <bob@brasko.net>
4549 and Joel Denny <jdenny@ces.clemson.edu>
4550
4551 * data/push.c (yypvarsinit): Change return type from void* to struct
4552 yypvars*. No longer cast to void* on return.
4553 (struct yypvars): Remove yylen since it need not be remembered between
4554 yypushparse invocations.
4555 (yypushparse): Don't copy between yylen and pv->yylen.
4556
45572006-12-05 Bob Rossi <bob@brasko.net>
4558
4559 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
4560 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
4561 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
4562 (struct yypvars): Remove b4_declare_parser_variables.
4563 (yypvarsinit): Remove init code for removed variables.
4564 (global scope): Do not declare b4_declare_parser_variables if
4565 push or pure mode.
4566 (yypushparse): Add b4_declare_parser_variables.
4567 Init new local variables, and remove init code for removed
4568 yypvars variables.
4569 (yyparse): Delete.
4570 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
4571 and yyparse for other modes.
4572 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
4573 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
4574 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
4575 (AT_PURE_LEX_IF): True if pure or push parser.
4576
45772006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
4578
4579 Document Yacc prologue alternatives and default %destructor's and
4580 %printer's as experimental. Don't mention Java yet. Discussed at
4581 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
4582 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
4583 (2.3a): Annotate this entry to say the old forms of these features were
4584 also experimental.
4585 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
4586 Table of Symbols): Say they're experimental. Comment out any mention
4587 of Java (we'll want this back eventually).
4588
45892006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4590
4591 Support a file name argument to %defines. Deprecate `=' in
4592 %file-prefix, %name-prefix, and %output. Discussed at
4593 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
4594 * NEWS (2.3a+): Mention.
4595 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
4596 form of %defines, and remove `=' from entries for %file-prefix,
4597 %name-prefix, and %output.
4598 * src/parse-gram.y (prologue_declaration): Implement.
4599 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
4600 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
4601 all but one occurrence of %name-prefix.
4602 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
4603 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
4604 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
4605 occurrence of each of %file-prefix and %output. Add check for %defines
4606 with argument.
4607 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
4608 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
4609 Remove the `=' from %output.
4610
46112006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
4612
4613 Don't escape $ in test case titles since Autoconf 2.61 now does that
4614 correctly.
4615 * tests/actions.at (Default %printer and %destructor are not for error
4616 or $undefined): Here.
4617 (Default %printer and %destructor are not for $accept): Here.
4618 * tests/input.at (Invalid $n and @n): Here.
4619
46202006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
4621
4622 Rename <!> to <>. Discussed starting at
4623 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
4624 * NEWS (2.3a+): Update.
4625 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
4626 Update.
4627 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
4628 * src/scan-gram.l (INITIAL): Implement.
4629 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
4630 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
4631 comment.
4632 * tests/actions.at (Default tagless %printer and %destructor,
4633 Default tagged and per-type %printer and %destructor,
4634 Default %printer and %destructor are not for error or $undefined,
4635 Default %printer and %destructor are not for $accept,
4636 Default %printer and %destructor for mid-rule values): Update.
4637 * tests/input.at (Default %printer and %destructor redeclared,
4638 Unused values with default %destructor): Update.
4639
46402006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
4641
4642 Don't let %prec take a nonterminal.
4643 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
4644 token.
4645 * tests/input.at (%prec takes a token): New test checking that %prec
4646 won't take a nonterminal.
4647
46482006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4649
4650 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
4651 it was double-quoted.
4652 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
4653 grammar is maintained with Bison's highest standards.
4654 * src/getargs.c: Fix some typos in Doxygen comments.
4655
46562006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4657
4658 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
4659 later. Reported by Paul Eggert in
4660 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
4661 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
4662 * src/scan-code.l (translate_action): Don't bother invoking
4663 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
4664 (code_scanner_free): Instead of invoking
4665 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
4666 which frees more.
4667 * src/scan-gram.l (gram_scanner_free): Likewise.
4668 * src/scan-skel.l (scan_skel): Likewise.
4669
46702006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4671
4672 * src/files.c (tr): Change return type to void.
4673 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
4674 has been called previously for the same key.
4675 (muscle_find): Return storage instead of value so that
4676 --enable-gcc-warnings doesn't produce warnings that the return discards
4677 const. aver that the value and storage are the same since storage
4678 could potentially be NULL when value is not.
4679 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
4680 same as 0.
4681
46822006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4683
4684 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
4685 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
4686 us a slightly cleaner distribution, and also works.
4687 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
4688 gnulib changes.
4689
46902006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
4691 and Paul Eggert <eggert@cs.ucla.edu>
4692
4693 Don't let Bison leak memory except when it complains.
4694 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
4695 (spec_defines_file, dir_prefix): Now char *, not const char *,
4696 since they are freed.
4697 * src/files.c: Likewise.
4698 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
4699 Likewise.
4700 (tr): Now operates in-place. All uses changed.
4701 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
4702 values.
4703 (compute_file_name_parts, compute_output_file_names): Don't store
4704 read-only data in variables that will be freed.
4705 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
4706 src_extension, and header_extension.
4707 (output_file_names_free): New public function to free
4708 spec_verbose_file, spec_graph_file, spec_defines_file,
4709 parser_file_name, and dir_prefix.
4710 * src/getargs.c (getargs): Don't store read-only data in variables that
4711 will be freed.
4712 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
4713 (which previously existed but was unused), and quotearg_free.
4714 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
4715 * src/muscle_tab.c: Likewise.
4716 (muscle_entry): Make the value char const *,
4717 and add a new storage member that is char * and can be freed.
4718 (muscle_entry_free): New private function.
4719 (muscle_init): Use it instead of free.
4720 (muscle_insert, muscle_grow): Update and use new storage member.
4721 (muscle_code_grow): Free the string passed to muscle_grow
4722 since it's not needed anymore.
4723 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
4724 add a new `char *code' member.
4725 ("{...}"): Declare semantic type as code.
4726 * src/scan-code.h (translate_rule_action):
4727 (translate_symbol_action, translate_code, translate_action): Return
4728 `char const *' rather than `char *' since external code should not free
4729 these strings.
4730 * src/scan-code.l: Likewise.
4731 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
4732 which is "{...}" in the parser.
4733 * tests/Makefile.am (maintainer-check-valgrind): Set
4734 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
4735 Valgrind.
4736 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
4737 complain.
4738 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
4739 expecting a non-zero exit status sets --leak-check=summary and
4740 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
4741 this case, and we don't want to hear about it.
4742
47432006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4744
4745 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
4746 instead of from the template, to simplify configuration a bit.
4747 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
4748 and m4/wint_t.m4, as they are needed with the latest gnulib.
4749
47502006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4751
4752 Disable unset/unused mid-rule value warnings by default, and recognize
4753 --warnings=midrule-values to enable them. Discussed starting at
4754 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
4755 * NEWS (2.3a+): Mention.
4756 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
4757 warnings): Add entry for midrule-values subargument.
4758 * src/reader.c (symbol_should_be_used): Don't return true just because
4759 the value is a set/used mid-rule value unless
4760 --warnings=midrule-values was specified.
4761 * tests/input.at (Unused values, Unused values before symbol
4762 declarations): Run tests with and without --warnings=midrule-values.
4763
4764 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
4765 than LIST_FREE directly.
4766
47672006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4768
4769 Finish implementing --warnings=error, which should not be implied by
4770 --warnings=all (or by its synonyms -W and --warnings without
4771 subarguments).
4772 * src/complain.c (set_warning_issued): New function to report that
4773 warnings are being treated as errors and to record an error if so.
4774 Invoke...
4775 (warn_at, warn): ... here.
4776 * src/getargs.c (warnings_args, warnings_types): Reorder so that
4777 "error - warnings are errors" does not appear above "all - all of the
4778 above".
4779 (getargs): For -W and --warnings without subarguments, don't let
4780 FLAGS_ARGMATCH set warnings_error in warnings_flag.
4781 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
4782
47832006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4784
4785 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
4786 empty subargument list. For example: `bison --warnings= parser.y'.
4787
47882006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4789
4790 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
4791 the parser header file so that gcc doesn't warn.
4792
47932006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4794
4795 Split the default %destructor/%printer into two kinds: <*> and <!>.
4796 Discussed starting at
4797 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
4798 * NEWS (2.3a+): Mention.
4799 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
4800 previous change today related to mid-rules.
4801 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
4802 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
4803 (TYPE_TAG_ANY): Add as <*>.
4804 (TYPE_TAG_NONE): Add as <!>.
4805 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
4806 for <*> and <!>.
4807 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
4808 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
4809 * src/symlist.c (symbol_list_default_new): Split into tagged and
4810 tagless versions.
4811 (symbol_list_destructor_set, symbol_list_printer_set): Split
4812 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
4813 SYMLIST_DEFAULT_TAGLESS.
4814 * src/symlist.h: Update symbol_list_default*_new prototypes.
4815 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
4816 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
4817 * src/symtab.c (default_destructor, default_destructor_location,
4818 default_printer, default_printer_location): Split each into tagged and
4819 tagless versions.
4820 (symbol_destructor_get, symbol_destructor_location_get,
4821 symbol_printer_get, symbol_printer_location_get): Implement tagged
4822 default and tagless default cases.
4823 (default_destructor_set, default_printer_set): Split each into tagged
4824 and tagless versions.
4825 * src/symtab.h: Update prototypes.
4826 * tests/actions.at (Default %printer and %destructor): Rename to...
4827 (Default tagless %printer and %destructor): ... this, and extend.
4828 (Per-type %printer and %destructor): Rename to...
4829 (Default tagged and per-type %printer and %destructor): ... this, and
4830 extend.
4831 (Default %printer and %destructor for user-defined end token): Extend.
4832 (Default %printer and %destructor are not for error or $undefined):
4833 Update.
4834 (Default %printer and %destructor are not for $accept): Update.
4835 (Default %printer and %destructor for mid-rule values): Extend.
4836 * tests/input.at (Default %printer and %destructor redeclared): Extend.
4837 (Unused values with default %destructor): Extend.
4838
48392006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4840
4841 Don't apply the default %destructor/%printer to an unreferenced midrule
4842 value. Mentioned at
4843 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
4844 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
4845 like $@n instead of just @n so that the default %destructor/%printer
4846 logic doesn't see them as user-defined symbols.
4847 (symbol_is_dummy): Check for both forms of the name.
4848 * src/reader.c (packgram): Remove the `$' from each midrule symbol
4849 name for which the midrule value is referenced in any action.
4850 * tests/actions.at (Default %printer and %destructor for mid-rule
4851 values): New test.
4852 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
4853 for change to dummy symbol names.
4854
48552006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4856
4857 Warn about unset midrule $$ if the corresponding $n is used.
4858 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
4859 $n usage.
4860 (packgram): Before invoking grammar_rule_check on any rule, make sure
4861 all actions have already been scanned in order to set `used' flags.
4862 Otherwise, checking that a midrule's $$ is set will not always work
4863 properly because the midrule check must forward-reference the midrule's
4864 parent rule.
4865 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
4866 warning.
4867
48682006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4869
4870 More improvements to the documentation of the prologue alternatives:
4871 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
4872 Bison manual.
4873 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
4874 some text to clarify the relative importance of the new directives and
4875 to show how these directives may be viewed as code labels.
4876
48772006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
4878
4879 Similar to the recently removed %before-header, add %code-top as the
4880 alternative to the pre-prologue. Mentioned at
4881 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
4882 Also, let the prologue alternatives appear in the grammar section.
4883 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
4884 (prologue_declaration): Move the existing prologue alternatives to...
4885 (grammar_declaration): ... here and add %code-top.
4886 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
4887
4888 Clean up and extend documentation for the prologue alternatives.
4889 * NEWS (2.3a+): Describe prologue alternatives.
4890 * doc/bison.texinfo (Prologue): Move discussion of prologue
4891 alternatives to...
4892 (Prologue Alternatives): ... this new section, and extend it to discuss
4893 all 4 directives in detail.
4894 (Table of Symbols): Clean up discussion of prologue alternatives and
4895 add %code-top.
4896
48972006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4898
4899 DJGPP specific issues.
4900
4901 * djgpp/config.bat: config.hin has been moved to lib. Adjust
4902 config.bat accordingly.
4903 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
4904 * djgpp/config.site: Likewise.
4905
49062006-10-16 Paolo Bonzini <bonzini@gnu.org>
4907
4908 Replace %*-header with %provides, %requires, %code. See discussion at
4909 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
4910
4911 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
4912 (b4_user_start_header): Remove.
4913 * data/glr.c: Use new macros instead of b4_*start_header
4914 and b4_*end_header.
4915 * data/glr.cc: Likewise.
4916 * data/lalr1.cc: Likewise.
4917 * data/push.c: Likewise.
4918 * data/yacc.c: Likewise.
4919
4920 * doc/bison.texinfo: Remove %before-header, rename
4921 %{start,end,after}-header to %requires, %provides, %code.
4922
4923 * src/parse-gram.y: Likewise (also rename token names accordingly).
4924 * src/scan-gram.l: Likewise.
4925 * tests/actions.at: Likewise.
4926
49272006-10-14 Paul Eggert <eggert@cs.ucla.edu>
4928
4929 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
4930 Problem reported by Joel E. Denny.
4931
49322006-10-14 Jim Meyering <jim@meyering.net>
4933
4934 (Sync from coreutils.)
4935 Work also when the working directory (with e.g. coreutils sources)
4936 is version controlled with git, rather than CVS.
4937 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
4938 rather than CVS.
4939 In messages and comments, say e.g., "checked-out sources",
4940 rather than "CVS sources".
4941 (version_controlled_file): New function. Work for git as well as
4942 for CVS. Don't use grep's -q option.
4943 (slurp): Call it here, in place of CVS-specific code.
4944
49452006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
4946
4947 Fix testsuite for ./configure --enable-gcc-warnings:
4948 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
4949 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
4950 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
4951 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
4952 * test/regression.at (Diagnostic that expects two alternatives):
4953 Likewise.
4954
49552006-10-12 Paul Eggert <eggert@cs.ucla.edu>
4956
4957 * bootstrap.conf (gnulib_modules): Add config-h.
4958 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
4959 worry about HAVE_CONFIG_H.
4960 * lib/abitset.c: Likewise.
4961 * lib/bitset.c: Likewise.
4962 * lib/bitset_stats.c: Likewise.
4963 * lib/bitsetv-print.c: Likewise.
4964 * lib/bitsetv.c: Likewise.
4965 * lib/ebitset.c: Likewise.
4966 * lib/get-errno.c: Likewise.
4967 * lib/lbitset.c: Likewise.
4968 * lib/subpipe.c: Likewise.
4969 * lib/timevar.c: Likewise.
4970 * lib/vbitset.c: Likewise.
4971 * lib/bitset.c: Include "bitset.h" first, to test interface.
4972 * lib/bitset_stats.c: Include "bitset_stats.h" first.
4973 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
4974 * lib/bitsetv.c: Include "bitsetv.h" first.
4975 * lib/get-errno.c: Include "get-errno.h" first.
4976 * m4/.cvsignore: Add config-h.m4.
4977 * tests/actions.at (Default %printer and %destructor for ...):
4978 Adjust expected line numbers in output to reflect removal of #if
4979 HAVE_CONFIG_H lines.
4980 * tests/glr-regression.at (Missed %merge type warnings when ...):
4981 Likewise.
4982 * tests/regression.at (Braced code in declaration in rules section):
4983 Likewise.
4984 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
4985 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
4986 Include <config.h> unconditionally.
4987
4988 * bootstrap: Sync from coreutils, as follows:
4989
4990 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
4991
4992 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
4993 variable was sometimes used without being initialized. This
4994 messed up the installation of the INSTALL file in some cases.
4995
4996 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
4997
4998 * bootstrap (usage, main program, symlink_to_gnulib): Add option
4999 --copy. Inspired by a suggestion from Bruno Haible.
5000
5001 2006-10-03 Jim Meyering <jim@meyering.net>
5002
5003 * bootstrap: Undo last change to this file, since now gnulib-tool
5004 sticks with the automake default in generating dependencies.
5005
50062006-10-12 Paul Eggert <eggert@cs.ucla.edu>
5007
5008 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
5009 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
5010
5011 * doc/bison.1: Add copyright notice.
5012
5013 * data/glr.c: Don't include <stdarg.h>; not used.
5014
5015 * NEWS: The -g and --graph options now output graphs in Graphviz
5016 DOT format, not VCG format.
5017 * doc/bison.1: Likewise.
5018 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
5019 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
5020 of this change in
5021 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
5022 * TODO: Remove Graphviz entry.
5023 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
5024 remove vcg.c, vcg.h, vcg_defaults.h.
5025 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
5026 * src/graphviz.c, src/graphviz.h: New files.
5027 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
5028 * src/files.h: Make comment more generic.
5029 * src/main.c (main): Likewise.
5030 * src/print_graph.h: Likewise.
5031 * src/getargs.c (usage): Make usage description more generic.
5032 * src/print_graph.c: Include graphviz.h rather than vcg.h.
5033 (static_graph, fgraph): Remove. All uses changed to pass
5034 arguments instead of sharing a static var.
5035 (print_core, print_actions, print_state, print_graph):
5036 Output graphviz format rather than VCG format.
5037 * tests/.cvsignore: Remove *.vcg; add *.dot.
5038 * tests/output.at: Expect *.dot files, not *.vcg files.
5039
5040 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
5041 accommodates the 2006-10-08 change.
5042
50432006-10-11 Bob Rossi <bob@brasko.net>
5044
5045 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
5046 (b4_yyssa, b4_yyerror_range): New macros.
5047 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
5048 (yypvarsinit): Remove init of removed fields.
5049 (yypushparse): Remove use of removed fields; use new macros instead.
5050
50512006-10-11 Paul Eggert <eggert@cs.ucla.edu>
5052
5053 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
5054 in a push parser. Reindent slightly to match yacc.c better.
5055
50562006-10-11 Bob Rossi <bob@brasko.net>
5057
5058 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
5059 yymsg_alloc fields.
5060 (yypvarsinit, yypushparse): Remove init of removed fields.
5061 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
5062
50632006-10-09 Paul Eggert <eggert@cs.ucla.edu>
5064
5065 * THANKS: Add Paolo Bonzini and Bob Rossi.
5066
50672006-10-08 Paolo Bonzini <bonzini@gnu.org>
5068
5069 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
5070 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
5071 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
5072 b4_define_user_cde and uses): Remove.
5073 (b4_comment, b4_prefix, b4_sync_start): New.
5074 * data/bison.m4: New file, with most of the content removed from c.m4.
5075 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
5076 * src/output.c (output_skeleton): Pass bison.m4.
5077 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
5078 only if specified.
5079
50802006-10-05 Paul Eggert <eggert@cs.ucla.edu>
5081
5082 Fix test failure reported by Tom Lane in
5083 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
5084 and try to make such failures easier to catch in the future.
5085 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
5086 that's now the caller's responsibility.
5087 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
5088 Set yychar = YYEOF if it's negative.
5089 * tests/actions.at (yylex): Abort if asked to read past EOF.
5090 * tests/conflicts.at (yylex): Likewise.
5091 * tests/cxx-type.at (yylex): Likewise.
5092 * tests/glr-regression.at (yylex): Likewise.
5093 * tests/input.at (yylex): Likewise.
5094 * tests/regression.at (yylex): Likewise.
5095 * tests/torture.at (yylex): Likewise.
5096
50972006-10-01 Paul Eggert <eggert@cs.ucla.edu>
5098
5099 Fix problems with translating English-language diagnostics.
5100 * bootstrap: Fix bug introduced in recent bootstrap changes, with
5101 respect to bison-runtime pot generation. The YY_ stuff
5102 wasn't being captured.
5103 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
5104 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
5105 * runtime-po/POTFILES.in: Add data/push.c.
5106
51072006-09-29 Paul Eggert <eggert@cs.ucla.edu>
5108
5109 Merge bootstrap changes from coreutils.
5110
5111 2006-09-28 Jim Meyering <jim@meyering.net>
5112
5113 Automatically generated dependencies are important even
5114 when all of the sources in a directory come from gnulib.
5115 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
5116 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
5117
5118 2006-09-23 Jim Meyering <jim@meyering.net>
5119
5120 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
5121
5122 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5123
5124 * bootstrap: Add support for --force.
5125 (usage): New function. Describe usage less tersely.
5126 (CVS_only_file): New var.
5127
51282006-09-21 Paul Eggert <eggert@cs.ucla.edu>
5129
5130 * data/push.c (YYPUSH_MORE): Make it an enum instead.
5131 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
5132 Adjust white space and comments to match GNU style better.
5133
51342006-09-20 Bob Rossi <bob@brasko.net>
5135
5136 * data/push.c (yyresult_get): Remove function.
5137 (YYPUSH_MORE): Add #define.
5138 (yypushparse): Modify return value.
5139
51402006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5141
5142 * stamp-h.in: Remove; no longer needed.
5143 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
5144 Remove config.h, config.hin, intl (no longer created).
5145 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
5146 stamp-h1.
5147
5148 Sync bootstrap from coreutils, as follows:
5149
5150 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
5151
5152 * bootstrap (symlink_to_gnulib): New function.
5153 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
5154 to copies-of-gnulib.
5155 (cp_mark_as_generated, slurp, gnulib_files):
5156 Avoid making a copy if it's the same as the old version.
5157 (gnulib_files): Add support for this variable (used by Bison).
5158
51592006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5160
5161 * src/getargs.c (usage): Rework to use conventions similar to
5162 coreutils, to make translation a bit easier and the code a bit
5163 smaller. Problem reported by Tim Van Holder.
5164
51652006-09-15 Paul Eggert <eggert@cs.ucla.edu>
5166
5167 Use some of gnulib's new modules, taken from coreutils.
5168
5169 * bootstrap: Sync from coreutils, except add support for gnulib_files.
5170 * bootstrap.conf: New file.
5171 (gnulib_modules): Add configmake, inttypes, unistd.
5172 (XGETTEXT_OPTIONS): Add complain, complain_at,
5173 fatal, fatal_at, warn, warn_at, unexpected_end.
5174 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
5175 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
5176 (gl_EARLY): Add.
5177 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
5178 (gl_INIT): Add
5179 (GNULIB_AUTOCONF_SNIPPET): Remove.
5180 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
5181 the pickiest.
5182 * lib/.cvsignore: Add inttypes_.h.
5183 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
5184 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
5185 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
5186 no-longer-necessary initializations.
5187 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
5188 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
5189 use the unistd module.
5190 * src/system.h: Likewise.
5191 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
5192 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
5193 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
5194 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
5195 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
5196 * src/system.h: Include inttypes.h unconditionally, now that we
5197 use the inttypes module. Don't bother to include stdint.h, since
5198 inttypes.h now does that for us.
5199 (LOCALEDIR): Remove, now that we use the configmake module.
5200 * src/getargs.c: Include configmake.h.
5201 * src/main.c: Likewise.
5202 * src/output.c: Likewise.
5203 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
5204 not from $abs_top_builddir, since config.h moved.
5205
5206
5207 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
5208 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
5209
5210 * src/parse-gram.y (symbol_declaration): Don't put statements
5211 before declarations; it's not portable to C89.
5212 * src/scan-code.l (handle_action_at): Likewise.
5213
5214 * src/scan-code.l: Always initialize braces_level; the old code
5215 left it uninitialized and therefore had undefined behavior.
5216
5217 Don't attempt to redefine 'assert', since it runs afoul of
5218 systems where standard headers (mistakenly) include <assert.h>.
5219 Instead, define and use our own alternative, called 'aver'.
5220 * src/reader.c: Don't include assert.h, since we no longer
5221 use assert.
5222 * src/scan-code.l: Likewise.
5223 * src/system.h (assert): Remove, replacing with....
5224 (aver): New function, taking a bool arg. All uses changed.
5225 * src/tables.c (pack_vector): Ensure that aver arg is bool,
5226 not merely an integer.
5227
52282006-09-15 Bob Rossi <bob@brasko.net>
5229
5230 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
5231 * data/c.m4 (YYPUSH): New.
5232 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
5233 * src/getargs.c (push_parser): New var.
5234 * src/getargs.h (push_parser): New declaration.
5235 * src/output.c (prepare): Add macro insertion of `push_flag'.
5236 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
5237 (prologue_declaration): Parse %push-parser.
5238 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
5239 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
5240 list of removed lines from the traces observed.
5241 (AT_CHECK_CALC_LALR): Added push parser tests.
5242
52432006-09-13 Paul Eggert <eggert@cs.ucla.edu>
5244
5245 * NEWS: Version 2.3a.
5246 * configure.ac (AC_INIT): Likewise.
5247
5248 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
5249 "#define YYSTYPE int" that caused "make maintainer-check" to fail
5250 due to header ordering dependencies. I don't know why the #define
5251 was there.
5252
5253 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
5254 runtime cost when YYDEBUG is not defined, and so that some tests
5255 that used to fail now work. Problem and initial suggestion by
5256 Paolo Bonzini.
5257 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
5258 * data/glr.cc (b4_parser_class_name):
5259 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
5260 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
5261 (yydebug_) [YYDEBUG]: New member.
5262 (yycdebug_): Now defined only if YYDEBUG.
5263 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
5264 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
5265 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
5266 if YYYDEBUG.
5267 (debug_stream, set_debug_stream, debug_level, set_debug_level):
5268 Define only if YYDEBUG.
5269 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
5270 set_debug_level.
5271 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
5272 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
5273 AT_CHECK_CALC_GLR_CC that are working now.
5274
52752006-09-12 Paul Eggert <eggert@cs.ucla.edu>
5276
5277 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
5278 We don't need them in glr.cc, and glr.c defines them.
5279 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
5280 assumes that defining it to anything is the same as defining
5281 it to 1. Problem reported by Paolo Bonzini.
5282
52832006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
5284
5285 * data/c.m4 (b4_null, b4_case): Define.
5286 * src/output.c (prepare_symbols): Use b4_null.
5287 (user_actions_output): Use b4_case.
5288
52892006-09-11 Paul Eggert <eggert@cs.ucla.edu>
5290
5291 * data/glr.c (b4_shared_declarations): Put start-header first,
5292 before any #includes that we generate, so that feature-test
5293 macros work. Problem reported by Michael Deutschmann in
5294 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
5295 * data/lalr1.cc: Likewise.
5296 * doc/bison.texinfo (Prologue): Document that feature-test macros
5297 should be defined before any Bison declarations.
5298 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
5299 that depend on location.hh after, not before, Bison decls, since
5300 we now include location.hh after the first user prologue.
5301
5302 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
5303 Sander Brandenburg in
5304 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
5305 Also, fix minor white space and comment issues.
5306 (Prologue): Mention that it's better to define feature-test macros
5307 before Bison declarations. Problem reported by Michael Deutschmann.
5308
5309 * README-cvs: Fix typo: "&" should be "&&". Problem reported
5310 by Jim Meyering.
5311 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
5312 This adjusts to recent gnulib changes.
5313
53142006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5315
5316 Finish implementation of per-type %destructor/%printer. Discussed
5317 starting at
5318 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
5319 and
5320 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
5321 * NEWS (2.3+): Add a description of this feature to the default
5322 %destructor/%printer description.
5323 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
5324 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5325 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
5326 list node contains a semantic type.
5327 * src/symtab.c, src/symtab.h: Extend with a table that associates
5328 semantic types with their %destructor's and %printer's.
5329 (semantic_type_from_uniqstr, semantic_type_get,
5330 semantic_type_destructor_set, semantic_type_printer_set): New functions
5331 composing the public interface of that table.
5332 (symbol_destructor_get, symbol_destructor_location_get,
5333 symbol_printer_get, symbol_printer_location_get): If there's no
5334 per-symbol %destructor/%printer, look up the per-type before trying
5335 the default.
5336 * tests/actions.at (Per-type %printer and %destructor): New test case.
5337 * tests/input.at (Default %printer and %destructor redeclared):
5338 Extend to check that multiple occurrences of %symbol-default in a
5339 single %destructor/%printer declaration is an error.
5340 (Per-type %printer and %destructor redeclared, Unused values with
5341 per-type %destructor): New test cases.
5342
53432006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5344
5345 Require default %destructor/%printer to be declared using
5346 %symbol-default instead of an empty symbol list, and start working on
5347 new per-type %destructor/%printer. Discussed at
5348 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
5349 * NEWS (2.3+): Add %symbol-default to example.
5350 * bison.texinfo (Freeing Discarded Symbols): Likewise.
5351 (Table of Symbols): Add entry for %symbol-default.
5352 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
5353 (generic_symlist, generic_symlist_item): New nonterminals for creating
5354 a list in which each item is a symbol, semantic type, or
5355 %symbol-default.
5356 (grammar_declaration): Use generic_symlist in %destructor and %printer
5357 declarations instead of symbols.1 or an empty list.
5358 (symbol_declaration, precedence_declaration, symbols.1): Update actions
5359 for changes to symbol_list.
5360 * src/reader.c: Update for changes to symbol_list.
5361 * src/scan-code.l: Likewise.
5362 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
5363 * src/symlist.c, src/symlist.h: Extend such that a list node may
5364 represent a semantic type or a %symbol-default in addition to just an
5365 ordinary symbol. Add switched functions for setting %destructor's and
5366 %printer's.
5367 * tests/actions.at, tests/input.at: Add %symbol-default to all default
5368 %destructor/%printer declarations.
5369
53702006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
5371
5372 Whether the default %destructor/%printer applies to a particular symbol
5373 isn't a question of whether the user *declares* that symbol (in %token,
5374 for example). It's a question of whether the user by any means
5375 *defines* the symbol at all (by simply using a char token, for
5376 example). $end is defined by Bison whereas any other token with token
5377 number 0 is defined by the user. The error token is always defined by
5378 Bison regardless of whether the user declares it with %token, but we
5379 may one day let the user define error as a nonterminal instead.
5380 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
5381 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
5382 the meaning of "user-defined".
5383 * tests/actions.at (Default %printer and %destructor for user-declared
5384 end token): Rename to...
5385 (Default %printer and %destructor for user-defined end token): ...
5386 this.
5387
5388 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
5389 computation of whether to apply the default, don't maintain a list of
5390 every Bison-defined symbol. Instead, just check for a first character
5391 of '$', which a user symbol cannot have, and check for the error token.
5392
53932006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
5394
5395 Don't apply the default %destructor or %printer to the error token,
5396 $undefined, or $accept. This change fits the general rule that the
5397 default %destructor and %printer are only for user-declared symbols,
5398 and it solves several difficulties that are described in the new test
5399 cases listed below.
5400 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
5401 * tests/actions.at (Default %printer and %destructor are not for error
5402 or $undefined, Default %printer and %destructor are not for $accept):
5403 New test cases.
5404
54052006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
5406
5407 Allow %start after the first rule.
5408 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
5409 when parsing the first rule.
5410 (check_and_convert_grammar): Search for it here after all grammar
5411 declarations have been parsed. Skip midrules, which have dummy LHS
5412 nonterminals.
5413 * src/symtab.c (symbol_is_dummy): New function.
5414 * src/symtab.h (symbol_is_dummy): Declare it.
5415 * tests/input.at (%start after first rule): New test.
5416
54172006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5418
5419 Redo some of the previous commit: add back the ability to use
5420 non-aliased/undeclared string literals since it might be useful to
5421 those declaring %token-table.
5422 * src/reader.c (check_and_convert_grammar): Undo changes in previous
5423 commit: don't worry about complaints from symbols_pack.
5424 * src/symtab.c (symbol_new, symbol_class_set,
5425 symbol_check_alias_consistency): Undo changes in previous commit: count
5426 each string literal as a new symbol and token, assign it a symbol
5427 number, and don't complain about non-aliased string literals.
5428 (symbols_pack): Since symbol_make_alias still does not decrement symbol
5429 and token counts but does still set aliased tokens to the same number,
5430 symbol_pack_processor now leaves empty slots in the symbols array.
5431 Remove those slots.
5432 * tests/regression.at (Undeclared string literal): Remove test case
5433 added in previous commit since non-aliased string literals are allowed
5434 again.
5435 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
5436 remove unnecessary string literal declarations.
5437 * tests/sets.at (Firsts): Likewise.
5438
54392006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5440
5441 Don't allow an undeclared string literal, but allow a string literal to
5442 be used before its declaration.
5443 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
5444 symbols_pack complained.
5445 * src/symtab.c (symbol_new): Don't count a string literal as a new
5446 symbol.
5447 (symbol_class_set): Don't count a string literal as a new token, and
5448 don't assign it a symbol number since symbol_make_alias does that.
5449 (symbol_make_alias): It's not necessary to decrement the symbol and
5450 token counts anymore. Don't assume that an alias declaration occurs
5451 before any uses of the identifier or string, and thus don't assert that
5452 one of them has the highest symbol number so far.
5453 (symbol_check_alias_consistency): Complain if there's a string literal
5454 that wasn't declared as an alias.
5455 (symbols_pack): Bail if symbol_check_alias_consistency failed since
5456 symbol_pack asserts that every token has been assigned a symbol number
5457 although undeclared string literals have not.
5458 * tests/regression.at (String alias declared after use, Undeclared
5459 string literal): New test cases.
5460 (Characters Escapes, Web2c Actions): Declare string literals as
5461 aliases.
5462 * tests/sets.at (Firsts): Likewise.
5463
54642006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
5465
5466 In the grammar scanner, STRING_FINISH unclosed constructs and return
5467 them to the parser in order to improve error messages.
5468 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
5469 SC_BRACED_CODE, SC_PROLOGUE): Implement.
5470 * tests/input.at (Unclosed constructs): New test case.
5471 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
5472 seen.
5473
5474 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
5475 unused global.
5476
54772006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
5478
5479 Handle string aliases for character tokens correctly.
5480 * src/symtab.c (symbol_user_token_number_set): If the token has an
5481 alias, check and set its alias's user token number instead of its own,
5482 which is set to indicate the alias. Previously, every occurrence of
5483 the character token in the grammar overwrote that alias indicator with
5484 the character code.
5485 * tests/input.at (String aliases for character tokens): New test.
5486
54872006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
5488
5489 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
5490
54912006-08-11 Paul Eggert <eggert@cs.ucla.edu>
5492
5493 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
5494 to prevent failures when building on older platforms.
5495 Check for autopoint failure.
5496 Set XGETTEXT_OPTIONS to values that check for C format strings,
5497 so that translators are warned about them (this also helps
5498 prevent core dumps).
5499
5500 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
5501 function, since it simplifies our code a bit.
5502
5503 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
5504 rather than -W, so we don't get bogus warnings about sign comparisons.
5505 Add -Wpointer-arith, since that warning is useful (it reports code
5506 that does not conform to C89 and that some compilers reject).
5507 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
5508 since it's no longer needed.
5509
55102006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
5511
5512 Clean up scanners a bit.
5513 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
5514 definitions so gcc won't warn when obstack_for_string is unused.
5515 * src/scan-code.l: config.h and system.h are already #include'd by
5516 scan-code-c.c, so get rid of them here.
5517 * src/scan-gram.l: Likewise.
5518 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
5519 definitions rather than duplicating the rest of it.
5520 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
5521
55222006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
5523
5524 Suppress signed/unsigned comparison warnings for yycheck.
5525 * data/c.m4 (b4_safest_int_type): New macro.
5526 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
5527 a signed int type, cast it to b4_safest_int_type first.
5528 * data/yacc.c: Likewise.
5529 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
5530 also overwritten.
5531
55322006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
5533
5534 * doc/bison.texinfo: Fix some typos.
5535
55362006-08-02 Paul Eggert <eggert@cs.ucla.edu>
5537
5538 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
5539 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
5540
5541 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
5542 the latest gnulib does this a different way.
5543 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
5544 translation was patched, so stop omitting it.
5545
55462006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5547
5548 Enable declaration of default %printer/%destructor. Make the parser
5549 use these for all user-declared grammar symbols for which the user does
5550 not declare a specific %printer/%destructor. Thus, the parser uses it
5551 for token 0 if the user declares it but not if Bison generates it as
5552 $end. Discussed starting at
5553 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
5554 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
5555 and
5556 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
5557 * NEWS (2.3+): Mention.
5558 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
5559 declare a %destructor for a mid-rule's semantic value. It's just
5560 impossible to declare one specific to it.
5561 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
5562 code. Describe default %destructor form.
5563 * src/parse-gram.y (grammar_declaration): Parse default
5564 %printer/%destructor declarations.
5565 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
5566 and symbol_destructor_location_get rather than accessing the destructor
5567 and destructor_location members of struct symbol.
5568 (symbol_printers_output): Likewise but for %printer's.
5569 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
5570 again.
5571 * src/symtab.c (default_destructor, default_destructor_location,
5572 default_printer, default_printer_location): New static global
5573 variables to record the default %destructor and %printer.
5574 (symbol_destructor_get, symbol_destructor_location_get,
5575 symbol_printer_get, symbol_printer_location_get): New functions to
5576 compute the appropriate %destructor and %printer for a symbol.
5577 (default_destructor_set, default_printer_set): New functions to set the
5578 default %destructor and %printer.
5579 * src/symtab.h: Prototype all those new functions.
5580 * tests/actions.at (Default %printer and %destructor): New test to
5581 check that the right %printer and %destructor are called, that they're
5582 not called for $end, and that $$ and @$ work correctly.
5583 (Default %printer and %destructor for user-declared end token): New
5584 test to check that the default %printer and %destructor are called for
5585 a user-declared end token.
5586 * tests/input.at (Default %printer and %destructor redeclared, Unused
5587 values with default %destructor): New tests to check related grammar
5588 warnings and errors.
5589
55902006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5591
5592 Clean up handling of %destructor for the end token (token 0).
5593 Discussed starting at
5594 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
5595 and
5596 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
5597
5598 Make the skeletons consistent in how they pop the end token and invoke
5599 its %destructor.
5600 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
5601 state, which has token number 0, since this would invoke the
5602 %destructor for the end token.
5603 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
5604 until after shifting the end token, or else it won't be popped.
5605 * data/yacc.c (yyparse): Likewise.
5606
5607 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
5608 it's the end token. Upon termination, destroy an unshifted lookahead
5609 even when it's the end token.
5610 * data/lalr1.cc (yy::parser::parse): Likewise.
5611 * data/yacc.c (yyparse): Likewise.
5612
5613 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
5614 value warnings for the end token when the user gives the end token a
5615 %destructor.
5616
5617 * tests/actions.at (Printers and Destructors): Test all the above.
5618
56192006-07-24 Paul Eggert <eggert@cs.ucla.edu>
5620
5621 Update to latest gnulib and gettext versions.
5622 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
5623 Add fopen-safer.
5624 (gnulib_files): Add m4/warning.m4. Don't worry about files
5625 overwritten by autopoint.
5626 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
5627 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
5628 rejects them.
5629 Don't use autoreconf; instead, invoke autopoint etc. by hand,
5630 so that we can remove the intl files at a better time.
5631 (intl_files_to_remove): Remove aclocal.m4, since it gets
5632 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
5633 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
5634 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
5635 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
5636 Remove datarootdir hack; no longer needed.
5637 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
5638 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
5639 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
5640 strdup.h.
5641 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
5642 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
5643
56442006-07-20 Paul Eggert <eggert@cs.ucla.edu>
5645
5646 * bootstrap: Adjust to today's change to gnulib-tool by invoking
5647 it with --assume-autoconf='latest-stable'.
5648
56492006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
5650
5651 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
5652 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
5653 YYSTYPE' and `{'.
5654 * src/muscle_tab.h (muscle_grow): Replace the header comments with
5655 those from muscle_tab.c since the old ones are misleading.
5656
56572006-07-13 Akim Demaille <akim@epita.fr>
5658
5659 Support %define "KEY" {VALUE}.
5660 * src/scan-code.h, src/scan-code.l (translate_action)
5661 (translate_rule_action, translate_symbol_action, translate_code):
5662 Return char *, not const char *.
5663 * src/parse-gram.y (declaration): Rename as...
5664 (prologue_declaration): this.
5665 (string_content): Remove this nonterminal, use STRING.
5666 (braceless, content, content.opt): New nonterminal.
5667 Use them.
5668 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
5669 as value.
5670 * src/scan-gram.l (getargs.h): Don't include it.
5671
56722006-07-12 Paul Eggert <eggert@cs.ucla.edu>
5673
5674 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
5675 rather than a for-loop that declares a local bool variable. This
5676 should work around a compatibility problem with a Cray x1e C++
5677 compiler reported by Hung Nguyen in
5678 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
5679 The for-loop was introduced in the 2004-11-17 change but I don't
5680 know why it was needed.
5681
56822006-07-12 Akim Demaille <akim@epita.fr>
5683
5684 * data/c.m4: Comment changes.
5685
56862006-07-10 Akim Demaille <akim@lrde.epita.fr>
5687
5688 * src/complain.c (error_message, ERROR_MESSAGE): New.
5689 To factor...
5690 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
5691 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
5692
56932006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5694
5695 * NEWS: Instead of %union, you can define and use your own union type
5696 YYSTYPE if your grammar contains at least one <type> tag.
5697 Your YYSTYPE need not be a macro; it can be a typedef.
5698 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
5699 (Union Decl, Decl Summary): Document this.
5700 * data/glr.c (YYSTYPE): Implement this.
5701 * data/glr.cc (YYSTYPE): Likewise.
5702 * data/lalr1.cc (YYSTYPE): Likewise.
5703 * data/yacc.c (YYSTYPE): Likewise.
5704 * src/output.c (prepare): Output tag_seen_flag.
5705 * src/parse-gram.y (declaration, grammar_declaration):
5706 Use 'union_seen' rather than 'typed' to determine whether
5707 %union has been seen, since grammars can now be typed without
5708 %union.
5709 (symbol_declaration, type.opt, symbol_def):
5710 Keep track of whether a tag has been seen.
5711 * src/reader.c (union_seen, tag_seen): New vars.
5712 (typed): remove.
5713 * src/reader.h (union_seen, tag_seen, typed): Likewise.
5714 * src/scan-code.l (untyped_var_seen): New variable.
5715 (handle_action_dollar): Adjust to above changes.
5716 (handle_action_dollar, handle_action_at):
5717 Improve overflow checking for outlandish numbers.
5718 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
5719 avoid new diagnostics generated by above changes.
5720 * tests/regression.at (YYSTYPE typedef): Add test to check
5721 for type tags without %union.
5722
5723 * src/symlist.c (symbol_list_length): Return int, not unsigned
5724 int, since callers expect int. This may need to get revisited
5725 once we have proper integer overflow checking.
5726
5727 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
5728 object is now static.
5729
5730 * src/getargs.c (flags_argmatch): Return void, not int,
5731 to pacify ./configure --enable-gcc-warnings.
5732
5733 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
5734 since last_string is already defined to FLEX_PREFIX (last_string).
5735
57362006-07-09 Akim Demaille <akim@lrde.epita.fr>
5737
5738 Implement --warnings/-W.
5739 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
5740 replaced by...
5741 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
5742 Adjust callers.
5743 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
5744 (warnings_args, warnings_types): New.
5745 (getargs, short_options, long_options): Accept -W/--warnings.
5746 Sort the options by alphabetical order, upper case letter right
5747 before its lower case.
5748
57492006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5750
5751 Change %merge result type clash warnings to errors. Discussed at
5752 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
5753 * src/reader.c (record_merge_function_type): Use complain_at.
5754 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5755 declared later): Update test case results.
5756
57572006-07-09 Akim Demaille <akim@lrde.epita.fr>
5758
5759 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
5760 to be in alphabetical order.
5761 (trace_args): Spelling fixes.
5762
57632006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5764
5765 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
5766 so they don't collide with user-defined macros.
5767 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
5768 this was never guaranteed, and now that we're using gnulib stdint,
5769 which defines int_fast16_t to long int, the problem is exposed.
5770
57712006-07-08 Paul Eggert <eggert@cs.ucla.edu>
5772
5773 * data/c.m4 (b4_basename): Simplify a bit, since we don't
5774 need the full POSIX semantics (and weren't implementing them
5775 anyway).
5776
5777 Adjust to Autoconf 2.60 and today's gnulib.
5778 * bootstrap (gnulib_modules): Add stdint.
5779 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
5780 no longer copies it.
5781 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
5782 since stdint needs the former and wcwidth (which is now required
5783 by mbswidth) needs the latter.
5784 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
5785 work around a compatibility glitch between gettext 0.14.6 and
5786 Autoconf 2.60.
5787 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
5788 Do not check for uintptr_t, since new stdint module does the right
5789 thing.
5790 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
5791 Add stdint.h, stdint_.h, wcwidth.h.
5792 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
5793 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
5794 stdint.m4, wchar_t.m4, wcwidth.m4.
5795 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
5796 usual order for ../lib/*.h files.
5797 (file_name_split): Use last_component, not base_name, to adjust
5798 to gnulib changes.
5799 * src/parse-gram.h: Include <strverscmp.h> in the usual order
5800 for ../lib/*.h files.
5801 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
5802 Define unconditionally, since we now assume the stdint module.
5803 * src/scan-skel.l: Include <dirname.h>.
5804 (BASE_QPUTS): Use last_component, not base_name.
5805 * src/system.h: Include <unlocked-io.h> in the usual order
5806 for ../lib/*.h files. Include <stdint.h> unconditionally,
5807 since we now use the stdint module.
5808 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
5809 HAVE_UINTPTR_T, since we now use the stdint module.
5810 (base_name): Remove decl, since files now include <dirname.h>
5811 to get the decl.
5812
58132006-07-08 Akim Demaille <akim@lrde.epita.fr>
5814
5815 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
5816 New, default to 1.
5817 * data/yacc.c, data/glr.c, data/location.cc: Use them.
5818 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
5819 default.
5820 * tests/calc.at: Adjust.
5821
58222006-07-08 Akim Demaille <akim@lrde.epita.fr>
5823
5824 * data/c.m4 (b4_basename): New.
5825 (b4_syncline): Also output the location of its invocation (from
5826 the skeleton).
5827 (b4_user_action, b4_define_user_action, b4_user_actions)
5828 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
5829 (b4_user_stype): New.
5830 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
5831
58322006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5833
5834 In the grammar file, the first column is 1 not 0 on the first line as
5835 on every other line.
5836 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
5837 * tests/input.at (Torturing the Scanner): Update output.
5838
5839 * src/scan-gram.l (scanner_cursor): Declare it static.
5840
58412006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5842
5843 In warnings, say "previous declaration" rather than "first
5844 declaration".
5845 * src/symtab.c (redeclaration): Do that here.
5846 * src/reader.c (record_merge_function_type): In the case of a result
5847 type clash, report the previous declaration rather than the very first
5848 one in the grammar file.
5849 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5850 declared later): Add a third declaration to check this behavior.
5851 * tests/input.at (Incompatible Aliases): Update output.
5852
58532006-06-27 Akim Demaille <akim@epita.fr>
5854
5855 * doc/Doxyfile.in: New.
5856 * doc/Makefile.am: Use it.
5857 * src/lalr.h, src/symtab.h: Initial doxygenation.
5858
58592006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5860
5861 Don't miss %merge result type warnings just because the LHS types are
5862 declared after the %merge. This continues the effort of the previous
5863 patch.
5864 * src/reader.c (get_merge_function): Don't set the merger type yet.
5865 (record_merge_function_type): New function for setting the merger type
5866 and checking for clashes.
5867 (grammar_current_rule_merge_set): Set the location of the %merge for
5868 the current rule.
5869 (packgram): Invoke record_merge_function_type for each rule now that
5870 all symbol type declarations have been parsed.
5871 * src/reader.h (merger_list.type_declaration_location): New member
5872 storing the location of the first %merge from which the type for this
5873 merging function was derived.
5874 * src/symlist.h (symbol_list.merger_declaration_location): New member
5875 storing the location of a rule's %merge, if any.
5876 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5877 declared later): New test to catch the error fixed by the above patch.
5878
58792006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5880
5881 Get action warnings (grammar_rule_check) right even when symbol
5882 declarations appear after the rules. Discussed at
5883 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
5884 and
5885 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
5886 Don't mistake the type of $$ in a midrule to be that of its parent
5887 rule's $$.
5888 * src/reader.c (grammar_current_rule_end): Don't invoke
5889 grammar_rule_check yet since not all symbol declarations may have been
5890 parsed yet.
5891 (grammar_midrule_action): Likewise.
5892 Don't record whether the midrule's $$ has been used yet since actions
5893 haven't been translated yet.
5894 Record the midrule's parent rule and its RHS index within the parent
5895 rule.
5896 (grammar_current_rule_action_append): Don't translate the action yet
5897 since not all symbol declarations may have been parsed yet and, thus,
5898 warnings about types for $$, $n, @$, and @n can't be reported yet.
5899 (packgram): Translate the action and invoke grammar_rule_check now that
5900 all symbol declarations have been parsed.
5901 * src/scan-code.l (handle_action_dollar): Now that this is invoked
5902 after parsing the entire grammar file, the symbol list here in the case
5903 of a midrule is actually the midrule's empty RHS, so reference its
5904 parent rule's RHS where necessary.
5905 On the other hand, now that you can already know it's a midrule, you
5906 aren't forced to think $$ has the same type as its parent rule's $$.
5907 (handle_action_at): In the case of a midrule, reference the parent rule
5908 where necessary.
5909 * src/symlist.c (symbol_list_new): Initialize new midrule-related
5910 members.
5911 (symbol_list_length): Now that this is invoked after all rules have
5912 been parsed, a NULL symbol (rather than a NULL symbol list node)
5913 terminates a rule. symbol_list_print already does this correctly.
5914 * src/symlist.h (symbol_list.midrule_parent_rule,
5915 symbol_list.midrule_parent_rhs_index): New members so that midrules can
5916 remember their relationships with their parents.
5917 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
5918 fixed by the above patch.
5919 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
5920 implementing...
5921 (Unused values): ... this old test case and...
5922 (Unused values before symbol declarations): ... this new test case.
5923 This one is the same as `Unused values' except that all symbol
5924 declarations appear after the rules in order to catch the rest of the
5925 errors fixed by the above patch.
5926
59272006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5928
5929 More cleanup.
5930 * src/reader.c (current_rule): Declare it static since it's no longer
5931 used outside this file.
5932 (grammar_current_rule_action_append): Remove redundant arguments from
5933 translate_rule_action invocation.
5934 * src/reader.h (current_rule): Remove this unused extern.
5935 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
5936 * src/scan-code.l (translate_rule_action): Likewise.
5937
59382006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
5939
5940 Clean up yesterday's patch.
5941 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
5942 to...
5943 * src/reader.c (grammar_current_rule_action_append): ... here for
5944 consistency with grammar_current_rule_symbol_append.
5945 * tests/regression.at (Braced code in declaration in rules section):
5946 Make yyerror and yylex static as usual.
5947
59482006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
5949
5950 Fix bug that mistakes braced code in a declaration in the rules section
5951 to be a rule action. Mentioned at
5952 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
5953 * src/scan-gram.l: Move midrule action detection from the start of the
5954 scanning of any braced code to...
5955 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
5956 action. For readability, use $2 and @2 rather than the equivalent
5957 global variables.
5958 * tests/regression.at (Braced code in declaration in rules section):
5959 New test to catch the error fixed by the above patch.
5960
5961 Work on code readability some.
5962 * src/scan-code.l (current_rule): Get rid of this misleading and
5963 redundant declaration: it's actually extern'ed in reader.h.
5964 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
5965 translate_action): Add a rule argument and use it instead of the global
5966 current_rule.
5967 (translate_rule_action): This already receives current_rule through an
5968 argument, so pass it on to translate_action instead of assigning
5969 current_rule to current_rule.
5970 (translate_symbol_action, translate_code): Pass rule = NULL to
5971 translate_action.
5972
59732006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
5974
5975 Rename %before-definitions to %start-header and %after-definitions to
5976 %end-header. Don't use these declarations to separate pre-prologue
5977 blocks from post-prologue blocks. Add new order-independent
5978 declarations %before-header and %after-header as alternatives to the
5979 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
5980 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
5981 * NEWS (2.3+): Update for these changes.
5982 * data/glr.c (b4_before_definitions): Update to...
5983 (b4_start_header): ... this.
5984 (b4_after_definitions): Update to...
5985 (b4_end_header): ... this.
5986 * data/glr.cc: Likewise.
5987 * data/lalr1.cc: Likewise.
5988 * data/yacc.c: Likewise.
5989 * doc/bison.texinfo (The prologue): Update names, and replace remaining
5990 prologue blocks with %*-header declarations.
5991 (Calc++ Parser): Likewise.
5992 (Decl Summary): Update names.
5993 (Table of Symbols): Update description.
5994 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
5995 (PERCENT_END_HEADER): ... this.
5996 (PERCENT_BEFORE_DEFINITIONS): Update to...
5997 (PERCENT_START_HEADER): ... this.
5998 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
5999 (declaration): Update token names and m4 macro names.
6000 When parsing %end-header and %start-header, invoke translate_code
6001 before muscle_code_grow, and no longer set global booleans to remember
6002 whether these declarations have been seen.
6003 Parse new %after-header and %before-header.
6004 * src/reader.c (before_definitions, after_definitions): Remove.
6005 (prologue_augment): Accept a new bool argument to specify whether to
6006 augment the pre-prologue or post-prologue.
6007 * src/reader.h (before_definitions, after_definitions): Remove these
6008 extern's.
6009 (prologue_augment): Add new bool argument.
6010 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
6011 (PERCENT_END_HEADER): ... this.
6012 (PERCENT_BEFORE_DEFINITIONS): Update to...
6013 (PERCENT_START_HEADER): ... this.
6014 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
6015 * tests/actions.at (Printers and Destructors): Update names.
6016
60172006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
6018
6019 Add comparison operators for C++ location classes. Discussed at
6020 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
6021 * data/c++.m4 (b4_define_location_comparison): New boolean %define
6022 declaration indicating whether filename_type has an operator==. If
6023 filename_type is `std::string', it defaults to `1', `0' otherwise.
6024 * data/location.cc: Iff b4_define_location_comparison is `1', add
6025 operator== and operator!= for class position and for class location.
6026
6027 Some minor fixes.
6028 * src/scan-action.l: Remove unused file.
6029 * src/symtab.c (symbol_printer_set): Use printer_location not
6030 destructor_location.
6031 * src/symtab.h (struct symbol): Replace incorrect source comment for
6032 printer members.
6033 * tests/input.at (Incompatible Aliases): Update output with correct
6034 printer location.
6035
60362006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
6037
6038 Don't put the pre-prologue in the header file. For the yacc.c code
6039 file and the glr.c header and code files, move the pre-prologue before
6040 the token definitions. Add new %before-definitions and
6041 %after-definitions to declare code that will go in both the header file
6042 and code file. Discussed at
6043 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
6044 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
6045 and
6046 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
6047 * NEWS (2.3+): Describe these changes.
6048 * data/glr.c (b4_pre_prologue): Move from within to before...
6049 (b4_shared_declarations): ... this.
6050 Add new b4_before_definitions before b4_token_enums.
6051 Add new b4_after_definitions at the end.
6052 * data/glr.cc (b4_pre_prologue): Replace with...
6053 (b4_before_definitions): ... this in the header file.
6054 (b4_after_definitions): New near the end of the header file.
6055 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
6056 code file right before including the header file.
6057 (b4_before_definitions): New in the previous position of
6058 b4_pre_prologue in the header file.
6059 (b4_after_definitions): New near the end of the header file.
6060 * data/yacc.c: Clean up some m4 quoting especially in the header file.
6061 (b4_token_enums_defines): In the code file, move to right before
6062 YYSTYPE for consistency with the header file.
6063 (b4_before_definitions): New right before b4_token_enums_defines in
6064 both the header and code file.
6065 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
6066 header and code file.
6067 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
6068 of prologues for %union dependencies.
6069 (Decl Summary): In %defines description, mention the effect of
6070 %before-definitions and %after-definitions on the header file.
6071 (Calc++ Parser): Forward declare driver in a %before-definitions rather
6072 than in the pre-prologue so that make check succeeds.
6073 (Table of Symbols): Add entries for %before-definitions and
6074 %after-definitions.
6075 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
6076 %before-definitions.
6077 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
6078 (declaration): Parse those declarations and append to
6079 b4_before_definitions and b4_after_definitions, respectively.
6080 * src/reader.c (before_definitions, after_definitions): New bools to
6081 track whether those declarations have been seen.
6082 (prologue_augment): Add to the post-prologue if %union,
6083 %before-definitions, or %after-definitions has been seen.
6084 * src/reader.h (before_definitions, after_definitions): New extern's.
6085 * src/scan-gram.l: Scan the new declarations.
6086 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
6087 prologue block in a %before-definitions or a %after-definitions based
6088 on whether the %union is declared.
6089 * tests/regression.at (Early token definitions with --yacc, Early token
6090 definitions without --yacc): Move tests for token definitions into the
6091 post-prologue since token names are no longer defined in the
6092 pre-prologue.
6093
60942006-06-20 Akim Demaille <akim@epita.fr>
6095
6096 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
6097 (symbol_get): Use it.
6098 * src/parse-gram.y: Use it.
6099
61002006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
6101
6102 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
6103 build succeeds when configured with --enable-gcc-warnings.
6104
61052006-06-19 Paul Eggert <eggert@cs.ucla.edu>
6106
6107 * src/parse-gram.y (char_name): New function.
6108 (CHAR, STRING, string_content): For %printer, properly escape.
6109 (ID): Prefer fputs to fprintf.
6110 (id): Reindent to be consistent with other rules.
6111 Properly quote char.
6112
6113 The Translation Project changed its way of publishing translations
6114 to maintainers. I haven't received any responses to my request
6115 for supporting the old way, or for documenting the new way. I
6116 have modified 'bootstrap' to use screen scraping
6117 (in this case, HTML scraping). This is unreliable and inelegant,
6118 but I don't see any better way. Yuck.
6119 * bootstrap (TP_URL, WGET_COMMAND): New vars.
6120 (get_translations): New function, which uses HTML scraping to
6121 deduce locations of latest translations.
6122 Use this function to grab both bison and bison-runtime .po files.
6123 Don't bother priming the pump for the runtime-po domain any more,
6124 as it's now translated better than bison is.
6125
61262006-06-19 Akim Demaille <akim@epita.fr>
6127
6128 * src/scan-gram.l: No longer "parse" things after `%union' until
6129 `{'. Rather, return a single "%union" token.
6130 No longer make symbols: return strings, and leave the conversion
6131 to symbols to the parser.
6132 (SC_PRE_CODE, token_type): Remove.
6133 * src/parse-gram.y (%union): New field `character'.
6134 Sort tokens.
6135 (CHAR): New token.
6136 (ID, ID_COLON): Now that the scanner no longer makes them
6137 identifiers, adjust all uses to invoke symbol_get.
6138 (id_colon): New, wraps the conversion from string to symbol.
6139 (%union): Accept a possible union_name.
6140 (symbol): Now can be a char.
6141 * data/c.m4 (b4_union_name): Leave a default value.
6142 * data/glr.c, data/yacc.c: Use it.
6143
61442006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
6145
6146 For associating token numbers with token names for "yacc.c", don't use
6147 #define statements unless `--yacc' is specified; always use enum
6148 yytokentype. Most important discussions start at:
6149 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
6150 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
6151 and
6152 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
6153 * NEWS (2.3+): Mention.
6154 * data/c.m4 (b4_yacc_if): New.
6155 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
6156 token #define's.
6157 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
6158 on token name definitions.
6159 * src/getargs.c (usage): Capitalize `Yacc' in English.
6160 * src/output.c (prepare): Define b4_yacc_flag.
6161 * tests/regression.at (Early token definitions): Test that tokens names
6162 are defined before the pre-prologue not just before the post-prologue.
6163 Remove this test case and copy to...
6164 (Early token definitions with --yacc): ... this to test #define's.
6165 (Early token definitions without --yacc): ... and this to test enums.
6166
61672006-06-11 Paul Eggert <eggert@cs.ucla.edu>
6168
6169 * NEWS: Reword the post-2.3 change to not be so optimistic about
6170 removing the old "look-ahead" spelling.
6171 Update previous look-ahead/lookahead change reports.
6172 * REFERENCES: look-ahead -> lookahead (since that's
6173 what he actually wrote).
6174 * doc/refcard.tex: look ahead -> lookahead,
6175 look-ahead -> lookahead
6176
61772006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
6178
6179 For consistency, use `lookahead' instead of `look-ahead' or
6180 `look_ahead'. Discussed starting at
6181 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
6182 and then at
6183 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
6184 * NEWS: For the next release, note the change to `--report'.
6185 * TODO, doc/bison.1: Update English.
6186 * doc/bison.texinfo: Update English.
6187 (Understanding Your Parser, Bison Options): Document as
6188 `--report=lookahead' rather than `--report=look-ahead'.
6189 * src/conflicts.c: Update English in comments.
6190 (lookahead_set): Rename from look_ahead_set.
6191 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
6192 (resolve_sr_conflict): Rename local look_ahead_tokens to
6193 lookahead_tokens, and update other uses.
6194 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
6195 count_rr_conflicts, conflicts_free): Update uses.
6196 * src/getargs.c (report_args): Move "lookahead" before alternate
6197 spellings.
6198 (report_types): Update uses.
6199 (usage): For `--report' usage description, state `lookahead' spelling
6200 rather than `look-ahead'.
6201 * src/getargs.h (report.report_lookahead_tokens): Rename from
6202 report_look_ahead_tokens.
6203 * src/lalr.c: Update English in comments.
6204 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
6205 (state_lookahead_tokens_count): Rename from
6206 state_look_ahead_tokens_count.
6207 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6208 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
6209 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6210 Update other uses.
6211 Update English in output.
6212 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
6213 * src/print.c: Update English in comments.
6214 (lookahead_set): Rename from look_ahead_set.
6215 (print_reduction): Rename argument lookahead_token from
6216 look_ahead_token.
6217 (print_core, state_default_rule, print_reductions, print_results):
6218 Update uses.
6219 * src/print_graph.c: Update English in comments.
6220 (print_core): Update uses.
6221 * src/state.c: Update English in comments.
6222 (reductions_new): Update uses.
6223 (state_rule_lookahead_tokens_print): Rename from
6224 state_rule_look_ahead_tokens_print, and update other uses.
6225 * src/state.h: Update English in comments.
6226 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
6227 (state_rule_lookahead_tokens_print): Rename from
6228 state_rule_look_ahead_tokens_print.
6229 * src/tables.c: Update English in comments.
6230 (conflict_row, action_row): Update uses.
6231 * tests/glr-regression.at
6232 (Incorrect lookahead during deterministic GLR,
6233 Incorrect lookahead during nondeterministic GLR): Rename
6234 print_look_ahead to print_lookahead.
6235 * tests/torture.at: Update English in comments.
6236 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
6237 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
6238 (Many lookahead tokens): Update uses.
6239 * data/glr.c: Update English in comments.
6240 * lalr1.cc: Likewise.
6241 * yacc.c: Likewise.
6242 * src/conflicts.h: Likewise.
6243 * src/lalr.h: Likewise.
6244 * src/main.c: Likewise.
6245 * src/output.c: Likewise.
6246 * src/parse-gram.c: Likewise.
6247 * src/tables.h: Likewise.
6248 * tests/calc.at: Likewise.
6249
62502006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
6251
6252 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
6253
62542006-06-07 Paul Eggert <eggert@cs.ucla.edu>
6255
6256 * TODO: Add request from Nelson H. F. Beebe to be able to install
6257 Bison without installing the yacc script.
6258
62592006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6260
6261 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
6262 and yytext if they're already #define'd.
6263 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
6264 * src/scan-code-c.c: ... here.
6265 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
6266 <config.h>.
6267
62682006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6269
6270 Get Bison to build again when configured with --enable-gcc-warnings.
6271 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
6272 missing #include's.
6273 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
6274 loc argument as it shadows a global.
6275 * src/scan-gram.l: Remove stray comma that prevents boundary_set
6276 invocation.
6277
6278 * src/.cvsignore: Add scan-code.c.
6279
62802006-06-07 Akim Demaille <akim@epita.fr>
6281
6282 * src/scan-gram.l: Move the "add a trailing ; to actions" code
6283 to...
6284 * src/scan-code.l: here.
6285 * tests/input.at (Torturing the Scanner): Fix another location
6286 error.
6287
62882006-06-07 Akim Demaille <akim@epita.fr>
6289
6290 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
6291
62922006-06-06 Akim Demaille <akim@epita.fr>
6293
6294 Extract the parsing of user actions from the grammar scanner.
6295 As a consequence, the relation between the grammar scanner and
6296 parser is much simpler. We can also split "composite tokens" back
6297 into simple tokens.
6298 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
6299 * src/scan-gram.l (add_column_width, adjust_location): Move to and
6300 rename as...
6301 * src/location.h, src/location.c (add_column_width)
6302 (location_compute): these.
6303 Fix the column count: the initial column is 0.
6304 (location_print): Be robust to ending column being 0.
6305 * src/location.h (boundary_set): New.
6306 * src/main.c: Adjust to scanner_free being renamed as
6307 gram_scanner_free.
6308 * src/output.c: Include scan-code.h.
6309 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
6310 Use boundary_set.
6311 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
6312 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
6313 which is now, again, a separate token.
6314 Adjust all dependencies.
6315 Whereever actions with $ and @ are used, use translate_code.
6316 (action): Remove this nonterminal which is now useless.
6317 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
6318 (grammar_current_rule_action_append): Use translate_code.
6319 (packgram): Bound check ruleno, itemno, and rule_length.
6320 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
6321 (last_string, last_braced_code_loc, max_left_semantic_context)
6322 (scanner_initialize, scanner_free, scanner_last_string_free)
6323 (gram_out, gram_lineno, YY_DECL_): Move to...
6324 * src/scan-gram.h: this new file.
6325 (YY_DECL): Rename as...
6326 (GRAM_DECL): this.
6327 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
6328 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6329 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6330 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6331 Move these declarations, and...
6332 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
6333 these to...
6334 * src/flex-scanner.h: this new file.
6335 * src/scan-gram.l (rule_length, rule_length_overflow)
6336 (increment_rule_length): Remove.
6337 (last_braced_code_loc): Rename as...
6338 (gram_last_braced_code_loc): this.
6339 Adjust to the changes of the parser.
6340 Move all the handling of $ and @ into...
6341 * src/scan-code.l: here.
6342 * src/scan-gram.l (handle_dollar, handle_at): Remove.
6343 (handle_action_dollar, handle_action_at): Move to...
6344 * src/scan-code.l: here.
6345 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
6346 scan-code.h, scan-code-c.c, scan-gram.h.
6347 (EXTRA_bison_SOURCES): Add scan-code.l.
6348 (BUILT_SOURCES): Add scan-code.c.
6349 (yacc): Be robust to white spaces.
6350
6351 * tests/conflicts.at, tests/input.at, tests/reduce.at,
6352 * tests/regression.at: Adjust the column numbers.
6353 * tests/regression.at: Adjust the error message.
6354
63552006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6356
6357 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6358 Use Akim's wording from
6359 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
6360
63612006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6362
6363 Between Bison releases, manually append `+' to the previous Bison
6364 release number, and use that as a signal to automatically print the
6365 ChangeLog's CVS Id keyword from --version. Discussed starting at
6366 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
6367 * ChangeLog: Add Id header.
6368 * configure.ac (AC_INIT): Append `+' to `2.3'.
6369 * src/.cvsignore: Add revision.c.
6370 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
6371 (BUILT_SOURCES): Add revision.c.
6372 (revision.c): New target rule. This file defines a new global variable
6373 named revision. It initializes it with either the Id from ChangeLog
6374 or, if VERSION doesn't contain `+', with the empty string.
6375 * src/getargs.c (version): Print the value of revision.
6376 * src/revision.h: Extern revision.
6377
63782006-06-05 Paul Eggert <eggert@cs.ucla.edu>
6379
6380 * NEWS: Version 2.3.
6381 * configure.ac (AC_INIT): Likewise.
6382
63832006-05-30 Paul Eggert <eggert@cs.ucla.edu>
6384
6385 * data/glr.c (YYRECOVERING): Define to be a function-like macro
6386 with no arguments, not as an object-like macro. This is for
6387 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
6388 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
6389 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
6390 Document this.
6391
63922006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
6393
6394 * src/getargs.c (usage): Back out yesterday's modification of the
6395 --help output so that we don't have to wait for translation before
6396 releasing 2.3.
6397
63982006-05-29 Paul Eggert <eggert@cs.ucla.edu>
6399
6400 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
6401 Problem reported by Akim Demaille.
6402
64032006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6404
6405 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6406
64072006-05-26 Paul Eggert <eggert@cs.ucla.edu>
6408
6409 * data/yacc.c (yy_reduce_print): Omit trailing white space in
6410 generated source code. Problem reported by Frans Englich in
6411 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
6412
64132006-05-22 Paul Eggert <eggert@cs.ucla.edu>
6414
6415 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
6416 shell, not within 'make', so that 'make' by an ordinary builder
6417 (using GNU make) does not worry about configuring gzip. This also
6418 works around a bug reported independently by Keith Thompson and by
6419 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
6420 stderr rather than stdout, messing up the build logs.
6421
64222006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6423
6424 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
6425 to make sure that YYID will never be unused. This fixes a 'make
6426 maintainer-check' failure caused by the recent changes to the 'Trivial
6427 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
6428 not used.
6429 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
6430
64312006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6432
6433 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
6434 state before an empty RHS is always resolved here. Only the location
6435 of that state is guaranteed to be resolved, and that's enough. This
6436 fixes the remaining bug reported by Derek M. Jones in
6437 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6438 * tests/glr-regression.at (Uninitialized location when reporting
6439 ambiguity): Test the above case.
6440 Also, the embedded comments in this test case claim it checks the case
6441 of an empty RHS that has inherited the initial location. However, the
6442 corresponding LHS was already resolved, so yyresolveLocations didn't
6443 actually have reason to modify it. Fix this by forcing
6444 nondeterministic operation at the beginning of the parse.
6445
64462006-05-20 Paul Eggert <eggert@cs.ucla.edu>
6447
6448 * data/c.m4 (b4_yy_symbol_print_generate):
6449 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
6450 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
6451 of the bugs reported today by Derek M Jones in
6452 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6453 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
6454 defined to be a type name without parens or brackets.
6455 (Location Type): Similarly for YYLTYPE.
6456 * tests/regression.at (Trivial grammars): Put in a test for this
6457 bug that will be caught by 'make maintainer-check' (though not,
6458 alas, by 'make check' unless your compiler is picky).
6459
64602006-05-19 Paul Eggert <eggert@cs.ucla.edu>
6461
6462 * NEWS: Version 2.2.
6463 * configure.ac (AC_INIT): Likewise.
6464
64652006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
6466
6467 * data/glr.c (yyreportTree): Make room in yystates for the state
6468 preceding the RHS. This fixes the segmentation fault reported by Derek
6469 M. Jones in
6470 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
6471 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
6472 to the user. Reported for yyreportTree by Derek M. Jones later in the
6473 same thread.
6474 * THANKS: Add Derek M. Jones.
6475 Update my email address.
6476 Fix typo in Steve Murphy's name.
6477
64782006-05-14 Paul Eggert <eggert@cs.ucla.edu>
6479
6480 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
6481 checking against YYLAST that caused the parser to miss a potential
6482 alternative in its diagnostic.
6483 Problem reported by Maria Jose Moron Fernandez in
6484 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
6485 * data/lalr1.cc (yysyntax_error_): Likewise.
6486 * data/yacc.c (yysyntax_error): Likewise.
6487 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
6488 tokens, in case we run into an older C compiler.
6489 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
6490 Use them to check for the off-by-one error fixed above.
6491
6492 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
6493 YYSIZE_T, not size_t.
6494 * tests/regression.at (Trivial grammars): New test, to catch
6495 the error fixed by the above patch.
6496
64972006-05-14 Akim Demaille <akim@lrde.epita.fr>
6498
6499 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
6500 scheme.
6501 Reported by Steve Murphy.
6502
65032006-05-14 Akim Demaille <akim@lrde.epita.fr>
6504
6505 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
6506 * data/glr.cc: b4_location_flag is now b4_locations_flag.
6507
65082006-05-14 Akim Demaille <akim@lrde.epita.fr>
6509
6510 Implement --trace=m4.
6511 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
6512 * src/output.c (output_skeleton): When set, pass -dV to m4.
6513
6514 Factor the handling of flags in m4.
6515 * src/output.c (prepare): Rename the muscle names debug, defines,
6516 error_verbose to debug_flag, defines_flag, error_verbose_flag.
6517 * data/c.m4: Adjust.
6518 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
6519 Use b4_define_flag_if to define other b4_FLAG_if macros.
6520 (b4_location_if): As a consequence, rename as...
6521 (b4_locations_if): this, for consistency.
6522 Adjust all the skeletons.
6523
65242006-05-14 Akim Demaille <akim@lrde.epita.fr>
6525
6526 * etc/bench.pm: Shorten bench names.
6527
65282006-05-14 Akim Demaille <akim@lrde.epita.fr>
6529
6530 * src/output.h, src/output.c (error_verbose): Move to...
6531 * src/getargs.h, src/getargs.c: here.
6532 Sort the flags.
6533 Adjust dependencies.
6534
65352006-05-13 Paul Eggert <eggert@cs.ucla.edu>
6536
6537 * data/c.m4 (b4_copyright): Put the special exception for Bison
6538 skeletons here, so we don't have to put it in each skeleton. All
6539 uses changed. Suggested by Akim Demaille. Also, wrap the
6540 copyright notice, in case it is longer than 80 columns. Replace
6541 comma by newline after title.
6542
65432006-05-11 Paul Eggert <eggert@cs.ucla.edu>
6544
6545 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
6546 incompatibility, not a bug. Mention that it wasn't fixed as of
6547 flex 2.5.33.
6548
65492006-05-11 Akim Demaille <akim@lrde.epita.fr>
6550
6551 * examples/extexi: Enforce the precedence of concatenation over
6552 >>.
6553 Reported by Tommy Nordgren.
6554
65552006-05-11 Akim Demaille <akim@lrde.epita.fr>
6556
6557 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
6558 with the member "token".
6559 Reported by Martin Nylin.
6560
65612006-05-08 Paul Eggert <eggert@cs.ucla.edu>
6562
6563 * data/glr.c: Switch to Bison 2.2 special-exception language in
6564 the copyright notice. Use more-regular format for titles and
6565 copyright notices.
6566 * data/glr.cc: Likewise.
6567 * data/location.cc: Likewise.
6568 * data/yacc.cc: Likewise.
6569 * doc/bison.texinfo (Conditions): Document this.
6570 * NEWS: likewise. Upgrade version to 2.2.
6571
65722006-04-27 Akim Demaille <akim@lrde.epita.fr>
6573
6574 * data/glr.cc: Remove dead code.
6575
65762006-04-25 Paul Eggert <eggert@cs.ucla.edu>
6577
6578 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
6579 that variable and the line breaks the bootstrap. Problem reported
6580 by Juan M. Guerrero.
6581
65822006-04-24 Akim Demaille <akim@lrde.epita.fr>
6583
6584 * doc/bison.texinfo (Multiple start-symbols): New.
6585
65862006-04-24 Akim Demaille <akim@lrde.epita.fr>
6587
6588 * etc/README, etc/bench.pl: New.
6589
65902006-04-03 Akim Demaille <akim@lrde.epita.fr>
6591
6592 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
6593 rule.
6594 Reported by Mickael Labau.
6595 * tests/input.at (Torturing the Scanner): Test it.
6596
65972006-03-16 Paul Eggert <eggert@cs.ucla.edu>
6598
6599 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
6600 Problem reported by Bob Rossi.
6601
66022006-03-13 Paul Eggert <eggert@cs.ucla.edu>
6603
6604 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
6605 and didn't really work.
6606 For the index, use @ifnotinfo, not @iftex.
6607 Minor cleanups of spacing and terminology.
6608
66092006-03-12 Akim Demaille <akim@lrde.epita.fr>
6610
6611 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
6612 of AT_NAME_PREFIX when %name-prefix is not used.
6613
66142006-03-12 Akim Demaille <akim@lrde.epita.fr>
6615
6616 Apply --prefix to C++ skeletons too: they change the namespace.
6617 The test suite already exercize these cases.
6618 * data/c++.m4 (b4_namespace): New.
6619 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
6620 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
6621 * data/yacc.c, data/glr.c: Remove a useless `[]'.
6622 * doc/bison.texinfo: Document it.
6623 (Option Cross Key): Use @multitable in all formats. It looks
6624 nicer, even in TeX outputs.
6625 (Rules): Use the same code whatever the output type is.
6626 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
6627 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
6628 * tests/calc.at: Use it, instead of hard coding `yy'.
6629
66302006-03-10 Akim Demaille <akim@lrde.epita.fr>
6631
6632 * TODO: Remove dead items.
6633
66342006-03-10 Akim Demaille <akim@lrde.epita.fr>
6635
6636 * doc/FAQ: Remove, merged into...
6637 * doc/bison.texinfo (FAQ): this.
6638 * doc/Makefile.am (EXTRA_DIST): Adjust.
6639
66402006-03-10 Akim Demaille <akim@lrde.epita.fr>
6641
6642 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
6643 even if empty.
6644 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
6645 * doc/bison.texinfo (Calc++ Scanner): Use it.
6646
66472006-03-09 Paul Eggert <eggert@cs.ucla.edu>
6648
6649 Fix two nits reported by twlevo, plus one more that I discovered.
6650
6651 * src/assoc.h (assoc_to_string): Give a name to the arg, as
6652 this is the usual Bison style.
6653 * src/location.h (location_print): Likewise.
6654
6655 * src/reader.h (token_name): Likewise.
6656
66572006-03-08 Paul Eggert <eggert@cs.ucla.edu>
6658
6659 Fix some nits reported by twlevo.
6660 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
6661 and "POSIX". Use more-modern syntax for URLs. Mention C++
6662 and ask for Java. Don't hardwire OS version numbers. Add
6663 copyright notice.
6664 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
6665 * src/conflicts.c (solved_conflicts_obstack): Now static.
6666
66672006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
6668
6669 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
6670 page. Say "you can use it" not "you may use it" as on the web page;
6671 we're describing capabilities not granting permission.
6672
66732006-03-06 Paul Eggert <eggert@cs.ucla.edu>
6674
6675 * data/glr.c (yyresolveLocations): Rename local variables to avoid
6676 shadowing warnings. Use usual patter for iterating through RHS.
6677 * tests/glr-regression.at
6678 (Uninitialized location when reporting ambiguity):
6679 Modify yylex so that it uses its argument, rather than trying
6680 to rely on ARGSUSED (which doesn't work for gcc with warnings).
6681 const char -> char const.
6682
6683 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
6684 Don't use tabs inside commands; it messes up 'ps'.
6685 Problem reported by twlevo.
6686
66872006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
6688
6689 * tests/glr-regression.at (Uninitialized location when reporting
6690 ambiguity): New test case.
6691 * data/glr.c (yyresolveLocations): New function, which uses
6692 YYLLOC_DEFAULT.
6693 (yyresolveValue): Invoke yyresolveLocations before reporting an
6694 ambiguity.
6695 * doc/bison.texinfo (Default Action for Locations): Note
6696 YYLLOC_DEFAULT's usage for ambiguity locations.
6697 (GLR Semantic Actions): Cross-reference those notes.
6698
66992006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
6700
6701 * tests/glr-regression.at (Leaked semantic values when reporting
6702 ambiguity): Remove unnecessary union and type declarations.
6703 (Leaked lookahead after nondeterministic parse syntax error): New test
6704 case.
6705 * data/glr.c (yyparse): Check for zero stacks remaining before
6706 attempting to shift the lookahead so that you don't lose it.
6707
67082006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6709
6710 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
6711 * tests/glr-regression.at (Leaked semantic values when reporting
6712 ambiguity): New test case.
6713 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
6714 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
6715 now unnecessary yystackp parameter.
6716 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
6717 destructors can be called.
6718
6719 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
6720 in existing testcases.
6721
67222006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6723
6724 Don't leak semantic values for parent RHS when a user action cuts the
6725 parser, and clean up related code a bit.
6726 * tests/glr-regression.at (Leaked merged semantic value if user action
6727 cuts parse): Rename to...
6728 (Leaked semantic values if user action cuts parse): ... this. Add check
6729 for leaked parent RHS values.
6730 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
6731 between an unresolved state (non-empty chain of semantic options) and
6732 an incomplete one (signaled by an empty chain).
6733 (yyresolveStates): Document the interface. Move all manipulation of a
6734 successfully or unsuccessfully resolved yyGLRState to...
6735 (yyresolveValue): ... here so that yyresolveValue always leaves a
6736 yyGLRState with consistent data and thus is easier to understand.
6737 Remove the yyvalp and yylocp parameters since they are always just
6738 taken from the yys parameter. When reporting a discarded merged value
6739 in debugging output, note that it is incompletely merged. Document the
6740 interface.
6741 (yyresolveAction): If resolving any of the RHS states fails, destroy
6742 them all rather than leaking them. Thus, as long as user actions are
6743 written to clean up the RHS correctly, yyresolveAction always cleans up
6744 the RHS of a semantic option. Document the interface.
6745
67462006-02-27 Paul Eggert <eggert@cs.ucla.edu>
6747
6748 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
6749 led to a segmentation fault in GNU Pascal. Problem reported
6750 by Waldek Hebisch.
6751
67522006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
6753
6754 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
6755 mid-rule action inside a nonterminal symbol in order to declare a
6756 destructor for its semantic value.
6757
67582006-02-16 Paul Eggert <eggert@cs.ucla.edu>
6759
6760 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
6761 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
6762 __cplusplus && ! defined _STDLIB_H && !
6763 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
6764 defined free))]: Include <stdlib.h> rather than rolling our own
6765 declarations of malloc and free, to avoid problems with
6766 incompatible declarations (using 'throw') C++'s stdlib.h. This
6767 should fix Debian bug 340012
6768 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
6769 reported by Guillaume Melquiond.
6770
67712006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6772
6773 * NEWS: Clarify symbols versus types in unused-value warnings.
6774
6775 * configure.ac (AC_INIT): Bump version number.
6776
67772006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6778
6779 * NEWS: Version 2.1a.
6780 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
6781 since C99 requires this.
6782
67832006-02-11 Paul Eggert <eggert@cs.ucla.edu>
6784
6785 * m4/c-working.m4: New file.
6786 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
6787
67882006-02-10 Paul Eggert <eggert@cs.ucla.edu>
6789
6790 * Makefile.maint: Merge from coreutils.
6791
67922006-02-09 Paul Eggert <eggert@cs.ucla.edu>
6793
6794 More portability fixes for problems summarized by Nelson H. F. Beebe.
6795
6796 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
6797 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
6798 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
6799 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
6800 messes up because C++ code is compiled in 32-bit mode but linked
6801 in 64-bit mode.
6802
68032006-02-08 Paul Eggert <eggert@cs.ucla.edu>
6804
6805 More portability fixes for problems summarized by Nelson H. F. Beebe.
6806
6807 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
6808 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
6809
6810 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
6811 nodist_PROGRAMS, since we don't need to actually compile the
6812 example if we're just doing a plain 'make'. This avoids bothering
6813 the installer unnecessarily about problems due to weird C++
6814 compilers.
6815
68162006-02-06 Paul Eggert <eggert@cs.ucla.edu>
6817
6818 More portability fixes for problems summarized by Nelson H. F. Beebe.
6819
6820 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
6821 than #include "...", and compile with -I'.'. The old method was
6822 not portable, according to Posix and the C standard, and it does
6823 not work with Sun C 5.7, where previous #line directives affect
6824 the working directory used in later #include "..." directives.
6825
68262006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6827
6828 Various DJGGP specific issues in /djgpp
6829
68302006-02-02 Paul Eggert <eggert@cs.ucla.edu>
6831
6832 More portability fixes for problems summarized by Nelson H. F. Beebe.
6833
6834 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
6835 '#include <map>' works and that you can apply ++ to iterators.
6836
68372006-02-01 Paul Eggert <eggert@cs.ucla.edu>
6838
6839 Work around portability problems summarized by Nelson H. F. Beebe in
6840 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
6841
6842 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6843 that '#include <string>' works.
6844
6845 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
6846 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
6847 "warning: sorry: semantics of inline function static data `const
6848 unsigned char translate_table[262]' are wrong (you'll wind up with
6849 multiple copies)".
6850
6851 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
6852 or, xor to not_, and_, or_, and xor_, respectively. This works
6853 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
6854 random system header somewhere that includes the equivalent of
6855 <iso646.h>.
6856
6857 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
6858 -E" works; it apparently doesn't work with PathScale EKO Compiler
6859 Suite Version 2.0.
6860
68612006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
6862
6863 During deterministic GLR operation, user actions should be able to
6864 influence the parse by changing yychar. To make this easier to fix and
6865 to make glr.c easier to evolve in general, don't maintain yytoken in
6866 parallel with yychar; just compute yytoken when needed.
6867 * tests/glr-regression.at (Incorrect lookahead during deterministic
6868 GLR): Check that setting yychar in a user action has the intended
6869 effect.
6870 * data/glr.c (yyGLRStack): Remove yytokenp member.
6871 (yyclearin): Don't set *yytokenp.
6872 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
6873 yychar rather than *yytokenp to determine the current lookahead.
6874 Compute yytoken locally when needed.
6875 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
6876 point to.
6877
6878 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
6879 after `--report' documentation.
6880
68812006-01-30 Paul Eggert <eggert@cs.ucla.edu>
6882
6883 * src/parse-gram.y (grammar_declaration): Location of printer
6884 symbol is @1, not list->location. Bug reported by twlevo.
6885 * tests/input.at (Incompatible Aliases): Adjust to above change.
6886
68872006-01-29 Paul Eggert <eggert@cs.ucla.edu>
6888
6889 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
6890 all the test at once. This makes the output easier to read in the
6891 normal case.
6892
6893 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
6894 got from <http://bro-ids.org/download.html>. The bug is that
6895 when two actions appeared in succession, the second one was
6896 scanned before the first one was added to the grammar rule
6897 as a midrule action. Bison then output the incorrect warning
6898 "parse.y:905.17-906.36: warning: unused value: $3".
6899 * src/parse-gram.y (BRACED_CODE, action): These are no longer
6900 associated with a value.
6901 (rhs): Don't invoke grammar_current_rule_action_append.
6902 (action): Invoke it here instead.
6903 * src/reader.c (grammar_midrule_action): Now extern.
6904 (grammar_current_rule_action_append): Don't invoke
6905 grammar_midrule_action; that is now the scanner's job.
6906 * src/reader.h (last_string, last_braced_code_loc):
6907 (grammar_midrule_action): New decls.
6908 * src/scan-gram.l (last_string): Now extern, sigh.
6909 (last_braced_code_loc): New extern variable.
6910 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
6911 rule already has an action.
6912 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
6913 * tests/input.at (AT_CHECK_UNUSED_VALUES):
6914 Add some tests to check that the above changes fixed the bug.
6915
69162006-01-27 Paul Eggert <eggert@cs.ucla.edu>
6917
6918 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
6919 All used changed. Check whether the symbol has a destructor,
6920 not whether it is typed.
6921 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
6922 that the values are still reported as unused. All line numbers
6923 adjusted.
6924
69252006-01-23 Paul Eggert <eggert@cs.ucla.edu>
6926
6927 Work around a bug in bro 0.8, which underparenthesizes its
6928 definition of YYLLOC_DEFAULT.
6929 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
6930 their arguments.
6931 * data/lalr1.cc: Likewise.
6932 * data/yacc.cc: Likewise.
6933
69342006-01-22 Paul Eggert <eggert@cs.ucla.edu>
6935
6936 Work around a bug in Pike 7.0, and give the Pike folks a
6937 better way to override the usual int widths.
6938 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
6939 user can override the types.
6940 (short): #undef, to work around a bug in Pike 7.0.
6941 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
6942 (union yyalloc.yyss): Use yytype_int16 rather than short.
6943 All uses changed.
6944 (yysigned_char): Remove.
6945 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
6946 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
6947 * tests/regression.at (Web2c Actions): Adjust to above changes.
6948
6949 * src/reader.c (check_and_convert_grammar): New function.
6950 (reader): Close the input file even if something went wrong during
6951 parsing. Minor file descriptor leak reported by twlevo.
6952
6953 * src/assoc.c (assoc_to_string): Use a default: abort (); case
6954 to pacify gcc -Wswitch-default.
6955 * src/scan-gram.l (adjust_location): Use a default: break; case
6956 to pacify gcc -Wswitch-default.
6957 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
6958 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6959 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6960 Move these decls to scan-skel.l, since they don't need to be
6961 visible elsewhere.
6962 * src/scan-skel.l: Accept the above decls.
6963 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
6964 is used.
6965
69662006-01-21 Paul Eggert <eggert@cs.ucla.edu>
6967
6968 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
6969 since we don't want to insist on a version number at the start
6970 of the changelog every time.
6971 * Makefile.maint: Sync from coreutils a bit better.
6972 (sc_trailing_blank): Renamed from sc_trailing_space.
6973 All uses changed.
6974 (sc_no_if_have_config_h, sc_require_config_h):
6975 (sc_prohibit_assert_without_use): New rules.
6976 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
6977 (sc_dd_max_sym_length): Fix leading spaces in rule.
6978 (sc_system_h_headers): Prefix with @.
6979 (sc_useless_cpp_parens, m4-check): Output line numbers.
6980 (changelog-check): Allow version only in head.
6981 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
6982 satisfy new Makefile.maint rule.
6983 * data/glr.c: Likewise.
6984 * data/glr.cc: Likewise.
6985 * data/lalr1.cc: Likewise.
6986 * data/yacc.c: Likewise.
6987 * lib/ebitsetv.c: Likewise.
6988 * lib/lbitset.c: Likewise.
6989 * lib/subpipe.c: Likewise.
6990 * lib/timevar.c: Likewise.
6991 * src/system.h: Likewise.
6992 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
6993 * djgpp/Makefile.maint: Add copyright notice.
6994 * djgpp/README.in: Likewise.
6995 * djgpp/config.bat: Likewise.
6996 * djgpp/config.site: Likewise.
6997 * djgpp/config_h.sed: Likewise.
6998 * djgpp/djunpack.bat: Likewise.
6999 * djgpp/config.sed: Fix copyright notice to match standard format.
7000 * djgpp/subpipe.h: Likewise.
7001 * lib/bitsetv-print.c: Likewise.
7002 * lib/bitsetv.c: Likewise.
7003 * lib/subpipe.h: Likewise.
7004 * lib/timevar.c: Likewise.
7005 * lib/timevar.h: Likewise.
7006 * djgpp/subpipe.c: Use standard recipe for config.h.
7007 * lib/abitset.c: Likewise.
7008 * lib/bitset.c: Likewise.
7009 * lib/bitset_stats.c: Likewise.
7010 * lib/bitsetv-print.c: Likewise.
7011 * lib/bitsetv.c: Likewise.
7012 * lib/ebitsetv.c: Likewise.
7013 * lib/get-errno.c: Likewise.
7014 * lib/lbitset.c: Likewise.
7015 * lib/subpipe.c: Likewise.
7016 * lib/timevar.c: Likewise.
7017 * lib/vbitset.c: Likewise.
7018 * tests/local.at: Likewise.
7019 * src/scan-gram.l: Don't include verify.h, since system.h does
7020 that for us.
7021 * .x-sc_require_config_h: New file.
7022 * .x-sc_unmarked_diagnostics: New file.
7023
70242006-01-20 Paul Eggert <eggert@cs.ucla.edu>
7025
7026 Be a bit more systematic about using 'abort'.
7027 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
7028 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
7029 Put 'default: abort ();' before some other case, to satisfy older
7030 pedantic compilers.
7031 * lib/bitset_stats.c (bitset_stats_init): Likewise.
7032 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
7033 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
7034 * src/conflicts.c (resolve_sr_conflict): Likewise.
7035 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
7036 (get_decision_str, get_orientation_str, get_node_alignment_str):
7037 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
7038 (get_linestyle_str, get_arrowstyle_str): Likewise.
7039 * src/conflicts.c (resolve_sr_conflict):
7040 Use a default case rather than one for the one remaining enum
7041 value, to catch invalid enum values as well.
7042 * src/lalr.c (set_goto_map, map_goto):
7043 Prefer "assert (FOO);" to "if (!FOO) abort ();".
7044 * src/nullable.c (nullable_compute, token_definitions_output):
7045 Likewise.
7046 * src/reader.c (packgram, reader): Likewise.
7047 * src/state.c (transitions_to, state_new, state_reduction_find):
7048 Likewise.
7049 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
7050 (symbol_pack): Likewise.
7051 * src/tables.c (conflict_row, pack_vector): Likewise.
7052 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
7053 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
7054 * src/system.h: Don't include <assert.h>.
7055 (assert): New macro.
7056
7057 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
7058 (Destructor Decl, Parser Function, Pure Calling):
7059 Describe rules for braces inside C code more carefully.
7060
70612006-01-19 Paul Eggert <eggert@cs.ucla.edu>
7062
7063 Fix some porting glitches found by Nelson H. F. Beebe.
7064 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
7065 compilers that don't understand that abort () does not return.
7066 * src/state.c (transitions_to): Likewise.
7067 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
7068 that '#include <cstdlib>' works.
7069 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
7070 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
7071 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
7072 for the benefit of some pre-C99 compilers.
7073
7074 * bootstrap: Undo changes to gnulib files that autoreconf made.
7075
7076 Minor fixups to get 'make maintainer-check' to work.
7077 * configure.ac: Don't use -Wnested-externs, as it's incompatible
7078 with the new verify.h implementation.
7079 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
7080 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
7081 * data/yacc.c (YYUSE): Likewise.
7082 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
7083 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
7084 * src/parse-gram.y (declaration): Don't pass a string constant
7085 to a function that expects char *, since GCC might complain
7086 about the constant value.
7087 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
7088 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
7089 before #defining them.
7090 * tests/glr-regression.at
7091 (Incorrectly initialized location for empty right-hand side in GLR):
7092 In yyerror, use the msg arg.
7093 (Corrupted semantic options if user action cuts parse):
7094 (Incorrect lookahead during deterministic GLR):
7095 (Incorrect lookahead during nondeterministic GLR):
7096 Don't name a local var 'index'; it shadows string.h's 'index'.
7097
70982006-01-19 Akim Demaille <akim@epita.fr>
7099
7100 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
7101 location, not just parts of it.
7102
71032006-01-18 Paul Eggert <eggert@cs.ucla.edu>
7104
7105 * NEWS: Document the fact that multiple %unions are now allowed.
7106 * doc/bison.texinfo (Union Decl): Likewise.
7107 * TODO: This feature is now implemented, so remove it from
7108 the wishlist.
7109
7110 * Makefile.maint: Merge with coreutils Makefile.maint.
7111 (CVS_LIST): Use build-aux version if available.
7112 (VERSION_REGEXP): New macro.
7113 (syntax-check-rules): Add sc_no_if_have_config_h,
7114 sc_prohibit_assert_without_use, sc_require_config_h,
7115 sc_useless_cpp_parens.
7116 (sc_obsolete_symbols): Check for O_NDELAY.
7117 (sc_dd_max_sym_length): Track coreutils.
7118 (sc_unmarked_diagnostics): Look in all files, not just *.c.
7119 (sc_useless_cpp_parens): New rule.
7120 (news-date-check): Look for version or today's date.
7121 (changelog-check): Don't require version number near head.
7122 (copyright-check): Use current year instead of hardwiring 2005.
7123 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
7124 (announcement): Add --gpg-key-ID.
7125
7126 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
7127 with "file system".
7128
7129 Avoid undefined behavior that addressed just before the start of an
7130 array. Problem reported by twlevo.
7131 * src/reader.c (packgram): Prepend a new sentinel before ritem.
7132 * src/lalr.c (build_relations): Rely on new sentinel.
7133 * src/gram.c (gram_free): Adjust to new sentinel.
7134
71352006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
7136
7137 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
7138 yylookaheadNeeds. All uses updated.
7139 (yysplitStack): Rename local yynewLookaheadStatuses to
7140 yynewLookaheadNeeds.
7141 * data/glr-regression.at (Incorrect lookahead during nondeterministic
7142 GLR): In comments, change `lookahead status' to `lookahead need'.
7143
71442006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7145
7146 * data/glr.c (yysplitStack): A little stylistic rewrite.
7147
71482006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7149
7150 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
7151
71522006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
7153
7154 * doc/bison.texinfo: Fix some typos.
7155 (GLR Semantic Actions): New subsection discussing special
7156 considerations because GLR semantic actions might be deferred.
7157 (Actions): Mention look-ahead usage of yylval.
7158 (Actions and Locations): Mention look-ahead usage of yylloc.
7159 (Special Features for Use in Actions): Add YYEOF entry and mention it
7160 in the yychar entry.
7161 In the yychar entry, remove mention of the local yychar case (pure
7162 parser) since this is irrelevant information when writing semantic
7163 actions and since it's already discussed in `Table of Symbols' where
7164 yychar is otherwise described as an external variable.
7165 In the yychar entry, don't call it the `current' look-ahead since it
7166 isn't when semantic actions are deferred.
7167 In the yychar and yyclearin entries, add note about deferred semantic
7168 actions.
7169 Add yylloc and yylval entries discussing look-ahead usage.
7170 (Look-Ahead Tokens): When discussing yychar, don't call it the
7171 `current' look-ahead, and do mention yylval and yylloc.
7172 (Error Recovery): Cross-reference `Action Features' when mentioning
7173 yyclearin.
7174 (Table of Symbols): In the yychar entry, don't call it the `current'
7175 look-ahead.
7176 In the yylloc and yylval entries, mention look-ahead usage.
7177
71782006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7179
7180 * tests/glr-regression.at: Update copyright year to 2006.
7181
71822006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7183
7184 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
7185 use during nondeterministic operation to track which stacks have
7186 actually needed the current lookahead.
7187 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
7188 Allocate, deallocate, resize, and otherwise shuffle space for
7189 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
7190 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
7191 appropriately during nondeterministic operation.
7192 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
7193 members to store the current lookahead to be used by the deferred
7194 user action.
7195 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
7196 from which the RHS is taken. Set the lookahead members of the new
7197 yySemanticOption according to the lookahead status for stack yyk.
7198 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
7199 yyaddDeferredAction.
7200 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
7201 members of yySemanticOption before invoking yyuserAction, and then set
7202 them back to their current values afterward.
7203 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
7204 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
7205 * tests/glr-regression.at: Remove `.' from the ends of recent test case
7206 titles for consistency.
7207 (Leaked merged semantic value if user action cuts parse): In order to
7208 suppress lint warnings, use arguments in merge function, and assign
7209 char value < 128 in main.
7210 (Incorrect lookahead during deterministic GLR): New test case.
7211 (Incorrect lookahead during nondeterministic GLR): New test case.
7212
72132006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7214
7215 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
7216 !yyvaluep as signal that no semantic value is available to print.
7217 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
7218 to print a semantic value.
7219
72202006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7221
7222 * tests/glr-regression.at: For consistency with my newer test cases,
7223 don't thank myself.
7224
72252006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
7226
7227 * data/glr.c (yyresolveValue): When merging semantic options, if at
7228 least one user action succeeds but a later one cuts the parse, then
7229 destroy the semantic value before returning rather than leaking it.
7230 (yyresolveStates): If a user action cuts the parse and thus
7231 yyresolveValue fails, ignore the (unset) semantic value rather than
7232 corrupting the yyGLRState, and empty the semantic options list since
7233 the user actions should have called all necessary destructors.
7234 Simplify code with YYCHK.
7235 * tests/glr-regression.at (Corrupted semantic options if user action
7236 cuts parse): New test case.
7237 (Undesirable destructors if user action cuts parse): New test case.
7238 Before applying any of this patch, this test case never actually failed
7239 for me... but only because the corrupted semantic options usually
7240 masked this bug.
7241 (Leaked merged semantic value if user action cuts parse): New test
7242 case.
7243
72442006-01-05 Akim Demaille <akim@epita.fr>
7245
7246 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
7247
72482006-01-04 Paul Eggert <eggert@cs.ucla.edu>
7249
7250 * data/c.m4 (b4_c_modern): New macro, with a new provision for
7251 _MSC_VER. Problem reported by Cenzato Marco.
7252 (b4_c_function_def): Use it.
7253 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
7254 b4_c_modern.
7255 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
7256 than rolling our own.
7257
72582006-01-04 Akim Demaille <akim@epita.fr>
7259
7260 Also warn about non-used mid-rule values.
7261 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
7262 member.
7263 (symbol_list_new): Adjust.
7264 * src/reader.c (symbol_typed_p): New.
7265 (grammar_rule_check): Use it.
7266 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
7267 Check its rule.
7268 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
7269 Use it.
7270 * tests/actions.at (Exotic Dollars): Adjust.
7271
72722006-01-04 Akim Demaille <akim@epita.fr>
7273
7274 * src/reader.c (grammar_midrule_action): If $$ is set in a
7275 mid-rule, move the `used' bit to its lhs.
7276 * tests/input.at (Unused values): New.
7277 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
7278
72792006-01-03 Paul Eggert <eggert@cs.ucla.edu>
7280
7281 * doc/bison.texinfo (Bison Options): Say more accurately what
7282 --yacc does.
7283 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
7284 about declarations in the grammar when in Yacc mode, as POSIX does
7285 not require a diagnostic when the grammar uses extensions.
7286
7287 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
7288
7289 Warn about dubious constructions like "%token T T".
7290 Reported by twlevo.
7291 * src/symtab.h (struct symbol.declared): New member.
7292 * src/symtab.c (symbol_new): Initialize it to false.
7293 (symbol_class_set): New arg DECLARING, specifying whether
7294 this is a declaration that we want to warn about, if there
7295 is more than one of them. All uses changed.
7296
7297 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
7298 Allow multiple %union directives, whose contents concatenate.
7299 * src/parse-gram.y (grammar_declaration): Likewise.
7300 Use muscle_code_grow, so that we don't need stype_line any more.
7301 All uses changed.
7302
7303 * src/muscle_tab.c (muscle_grow): Fix comment.
7304
7305 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
7306 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
7307 Update copyright year to 2006.
7308
73092006-01-03 Akim Demaille <akim@epita.fr>
7310
7311 Have glr.cc pass (some of) the calc.at tests.
7312 * data/glr.cc (b4_parse_param_orig): New.
7313 (b4_parse_param): Improve its definition, and bound it more
7314 clearly in the skeleton.
7315 (b4_epilogue): Append, instead of prepending, in order to keep
7316 #line consistency.
7317 Simplify the generation of auxiliary functions: locations and
7318 purity are mandated.
7319 (b4_global_tokens_and_yystype): Honor it.
7320 * data/location.cc (c++.m4): Don't include it.
7321 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
7322 and AT_SKEL_CC_IF.
7323 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
7324 AT_LALR1_CC_IF.
7325 Be sure to initialize the first position's filename.
7326 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
7327 mandated anyway.
7328 (AT_CHECK_CALC_GLR_CC): New.
7329 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
7330
73312006-01-02 Akim Demaille <akim@epita.fr>
7332
7333 * src/output.c (output_skeleton): Don't hard wire the inclusion of
7334 c.m4.
7335 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
7336 * data/glr.cc: Do not include stack.hh.
7337
73382006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7339
7340 * data/glr.c: Reformat whitespace with tabs.
7341 (b4_lpure_formals): Remove this unused m4 macro.
7342 * tests/cxx-type.at: Reformat whitespace with tabs.
7343 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
7344 since it's a member. Rename type to isNterm for clarity.
7345
73462005-12-29 Akim <akim@sulaco.local>
7347
7348 Let glr.cc catch up with symbol_value_print.
7349 * data/glr.cc (b4_yysymprint_generate): Replace by...
7350 (b4_yy_symbol_print_generate): this.
7351 (yy_symbol_print, yy_symbol_value_print): Declare them.
7352
73532005-12-28 Paul Eggert <eggert@cs.ucla.edu>
7354
7355 * src/location.h (boundary): Note that a line or column equal
7356 to INT_MAX indicates an overflow.
7357 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
7358 (rule_length_overflow, increment_rule_length, add_column_width):
7359 New functions.
7360 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
7361 (<SC_BRACED_CODE>"}"):
7362 Use increment_rule_length rather than incrementing it by hand.
7363 (adjust_location, handle_syncline): Diagnose overflow.
7364 (handle_action_dollar, handle_action_at):
7365 Fix bug with monstrosities like $-2147483648.
7366 Remove now-unnecessary checks.
7367 (scan_integer): Verify assumptions and remove now-unnecessary checks.
7368 (convert_ucn_to_byte): Verify assumptions.
7369 (handle_syncline): New arg LOC. All callers changed.
7370 Don't store through a value derived from char const * pointer.
7371
7372 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
7373 GCC warnings.
7374
73752005-12-27 Paul Eggert <eggert@cs.ucla.edu>
7376
7377 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
7378 Remove unnecessary forward static decls.
7379
73802005-12-27 Akim Demaille <akim@epita.fr>
7381
7382 * src/reader.c (grammar_current_rule_check): Also check that $$
7383 is used.
7384 Take the rule to check as argument, hence rename as...
7385 (grammar_rule_check): this.
7386 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
7387 Rename as...
7388 (grammar_rule_begin, grammar_rule_end): these, for consistency.
7389 (grammar_midrule_action, grammar_symbol_append): Now static.
7390 * tests/torture.at (input): Don't rely on the default action
7391 being always performed.
7392 * tests/calc.at: "Set" $$ even when the action is "cut" with
7393 YYERROR or other.
7394 * tests/actions.at (Exotic Dollars): Instead of using unused
7395 values, check that the warning is issued.
7396
73972005-12-22 Paul Eggert <eggert@cs.ucla.edu>
7398
7399 * NEWS: Improve wording for unused-value warnings.
7400
74012005-12-22 Akim Demaille <akim@epita.fr>
7402
7403 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
7404 (b4_yysymprint_generate): Rename as...
7405 (b4_yy_symbol_print_generate): this.
7406 Generate yy_symbol_print instead of yysymprint.
7407 Generate also yy_symbol_value_print, and use it.
7408
74092005-12-22 Akim Demaille <akim@epita.fr>
7410
7411 * NEWS: Warn about unused values.
7412 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
7413 a `used' member.
7414 (symbol_list_n_get, symbol_list_n_used_set): New.
7415 (symbol_list_n_type_name_get): Use symbol_list_n_get.
7416 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
7417 * src/reader.c (grammar_current_rule_check): Check that values are
7418 used.
7419 * src/symtab.c (symbol_print): Accept 0.
7420 * tests/existing.at: Remove the type information.
7421 Empty the actions.
7422 Remove useless actions (beware of mid-rule actions: perl -000
7423 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
7424 * tests/actions.at (Exotic Dollars): Use unused values.
7425 * tests/calc.at: Likewise.
7426 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7427 Likewise.
7428
7429 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
7430 rule_useful_p.
7431
74322005-12-21 Paul Eggert <eggert@cs.ucla.edu>
7433
7434 Undo 2005-12-01 tentative license wording change. The wording is
7435 still being reviewed by the lawyers, and we don't want to wait for
7436 them before publishing a test release. For now, revert to the
7437 previous wording.
7438 * NEWS: Undo 2005-12-01 change.
7439 * data/glr.c: Revert to previous license wording.
7440 * data/glr.cc: Likewise.
7441 * data/lalr1.cc: Likewise.
7442 * data/location.cc: Likewise.
7443 * data/yacc.c: Likewise.
7444
7445 * NEWS: Reword %destructor vs YYABORT etc.
7446 * data/glr.c: Use American spacing, for consistency.
7447 * data/glr.cc: Likewise.
7448 * data/lalr1.cc: Likewise.
7449 * data/yacc.c: Likewise.
7450 * data/yacc.c: Reformat comments slightly.
7451 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
7452 for consistency. Fix some spelling errors and reword recently-included
7453 text slightly.
7454 * tests/cxx-type.at: Cast results of malloc, for C++.
7455
74562005-12-21 Joel E. Denny <address@hidden>
7457
7458 * tests/cxx-type.at: Construct a tree, count the parents of shared
7459 nodes, and free each node once and only once. Previously, the memory
7460 for semantic values was leaked instead.
7461
74622005-12-21 Joel E. Denny <address@hidden>
7463
7464 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
7465 (yylval, yylloc): If pure, #define to yystackp->yyval and
7466 yystackp->yyloc similar to yychar and yynerrs.
7467 (yyparse): If pure, remove local yylval and yylloc. Add local
7468 yystackp to accommodate pure definitions of yylval and yylloc.
7469 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
7470 yylvalp and yyllocp to &yylval and &yylloc.
7471 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
7472 namespace. Previously, nerrs and char were missing, but lval and lloc
7473 weren't necessary.
7474 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
7475 yylvalp and yyllocp parameters since, if pure, these are now always
7476 accessible through yystackp. If not pure, they are still accessible
7477 globally.
7478 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
7479 `if (YYID (N))' to pacify lint.
7480
74812005-12-21 Akim Demaille <akim@epita.fr>
7482
7483 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
7484 destroy the RHS symbols of a rule.
7485 * data/yacc.c (yylen): Initialize to 0.
7486 Keep its value to the number of items to possibly shift.
7487 In particular, a regular successful parse that ends on YYFINAL by
7488 a (internal) YYACCEPT must not have yylen != 0.
7489 (yyerrorlab, yyreturn): Pop the RHS.
7490 Reorder a bit to emphasize the `shifting' bits of code.
7491 (YYPOPSTACK): Now accept a number of items to pop.
7492 * data/lalr1.cc: Likewise.
7493 * data/glr.c: Formatting changes.
7494 Use goto instead of fall through.
7495 * doc/bison.texinfo (Destructor Decl): Complete.
7496
74972005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7498
7499 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7500 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
7501 * djgpp/config.bat: Replace every occurence of the file name
7502 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7503 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7504 * djgpp/config.sed: Replace every occurence of the file name
7505 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7506 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7507 * djgpp/djunpack.bat: DJGPP specific file.
7508 * djgpp/fnchange.lst: DJGPP specific file.
7509 * djgpp/README.in: Add new information about how to unpack the bison
7510 source on MSDOS and other systems which have 8.3 file name restrictions
7511 using djunpack.bat and fnchange.lst.
7512
75132005-12-12 Paul Eggert <eggert@cs.ucla.edu>
7514
7515 * bootstrap (build_cvs_prefix): Remove; unused.
7516 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
7517 when getting gnulib.
7518
75192005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
7520
7521 * data/glr.c: Reorder typedef declarations for structs to match order
7522 of struct declarations.
7523 Rename yystack everywhere to yystackp except in yyparse where it's not
7524 a pointer.
7525 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
7526 consistency.
7527 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
7528 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
7529 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
7530 lint.
7531
75322005-12-09 Paul Eggert <eggert@cs.ucla.edu>
7533
7534 * tests/sets.at (Accept): Fix typos in regular expression used to
7535 sed out the final state number.
7536
7537 Work around portability problem on Solaris 10: flex-generated
7538 files include <stdio.h> before <config.h>, which messes up
7539 because the latter defines __EXTENSIONS__. Address the problem
7540 by creating two new little files that include <config.h> first,
7541 then include the flex-generated files. Rewrite everyone else
7542 to include <config.h> first, as well.
7543 * lib/timevar.c: Always include "config.h".
7544 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
7545 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
7546 (EXTRA_bison_SOURCES): New macro.
7547 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
7548 * src/system.h: Don't include config.h.
7549 * src/LR0.c: Include <config.h> first.
7550 * src/assoc.c: Likewise.
7551 * src/closure.c: Likewise.
7552 * src/complain.c: Likewise.
7553 * src/conflicts.c: Likewise.
7554 * src/derives.c: Likewise.
7555 * src/files.c: Likewise.
7556 * src/getargs.c: Likewise.
7557 * src/gram.c: Likewise.
7558 * src/lalr.c: Likewise.
7559 * src/location.c: Likewise.
7560 * src/main.c: Likewise.
7561 * src/muscle_tab.c: Likewise.
7562 * src/nullable.c: Likewise.
7563 * src/output.c: Likewise.
7564 * src/parse-gram.y: Likewise.
7565 * src/print.c: Likewise.
7566 * src/print_graph.c: Likewise.
7567 * src/reader.c: Likewise.
7568 * src/reduce.c: Likewise.
7569 * src/relation.c: Likewise.
7570 * src/state.c: Likewise.
7571 * src/symlist.c: Likewise.
7572 * src/symtab.c: Likewise.
7573 * src/tables.c: Likewise.
7574 * src/uniqstr.c: Likewise.
7575 * src/vcg.c: Likewise.
7576
7577 * src/parse-gram.y: Fix minor problems uncovered by lint.
7578 (current_lhs, current_lhs_location): Now static.
7579 (current_assoc): Remove unused variable.
7580
7581 Cleanups so that Bison-generated parsers have less lint.
7582 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
7583 Prepend /*ARGSUSED*/, for lint's sake.
7584 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
7585 definition if 'lint' is defined.
7586 (YYID): New macro (or function, if lint).
7587 All uses of /*CONSTCOND*/0 replaced by YYID(0).
7588 * data/yacc.c: Likewise.
7589 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
7590 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
7591 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
7592 is C++ only.
7593 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
7594 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
7595 Use YYID(0) rather than 0, for lint.
7596 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
7597 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
7598
75992005-12-07 Paul Eggert <eggert@cs.ucla.edu>
7600
7601 * tests/glr-regression.at
7602 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
7603 Close memory leak reported by twlevo.
7604
76052005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
7606
7607 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
7608 all stacks.
7609 (yyparse): Iterate another stack in order to call user destructors.
7610 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7611 New test case.
7612 (Duplicated user destructor for lookahead): This test now is expected
7613 to succeed.
7614
76152005-12-01 Paul Eggert <eggert@cs.ucla.edu>
7616
7617 * NEWS: Document the following change.
7618 * data/yacc.c: Say "parser skeleton" rather than "file", since
7619 it's no longer just a file.
7620 * data/glr.c: Grant a special exception for C GLR parsers, that
7621 reads like the already-existing exception for C LALR(1) parsers.
7622 * data/glr.cc: Likewise.
7623 * data/lalr1.cc: Likewise.
7624 * data/location.cc: Likewise.
7625 * data/yacc.c: Reword the "written by" statement to clarify that
7626 it was the parser skeleton, not the entire output file.
7627 * data/glr.c: Written by Paul Hilfinger.
7628 * data/glr.cc: Written by Akim Demaille.
7629 * data/lalr1.cc: Likewise.
7630
76312005-11-18 Paul Eggert <eggert@cs.ucla.edu>
7632
7633 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
7634 Fix typos in previous change that broke 'make check'.
7635 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
7636 supported in C.
7637 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
7638 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
7639 We can revert this once things settle down.
7640
7641 * src/conflicts.c (conflicts_print): Don't print file name twice
7642 when %expect fails because there were no conflicts.
7643 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
7644 change.
7645 * tests/conflicts.at (%expect not enough, %expect too much):
7646 (%expect with reduce conflicts): Adjust to new behavior.
7647
76482005-11-18 Akim Demaille <akim@epita.fr>
7649
7650 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
7651 errors.
7652 * NEWS: Document this.
7653 * doc/bison.texinfo (Expect Decl): Likewise.
7654
76552005-11-16 Akim Demaille <akim@epita.fr>
7656
7657 Generalize the display of semantic values and locations in traces.
7658 * data/glr.c (yy_reduce_print): Fix indices (again).
7659 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
7660 literal integers.
7661 * data/lalr1.cc (yyreduce_print): Rename as...
7662 (yy_reduce_print): this.
7663 Display values and locations.
7664 * data/yacc.c (yy_reduce_print): Likewise.
7665 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
7666 (yysymprint): Move higher to be visible from yy_reduce_print).
7667 (yyparse): Adjust.
7668 * tests/calc.at: Adjust the expected length of the traces.
7669
76702005-11-14 Akim Demaille <akim@epita.fr>
7671
7672 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
7673 from 1 to N, while values and location start at 0.
7674 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
7675
76762005-11-14 Akim Demaille <akim@epita.fr>
7677
7678 * data/glr.c (yy_reduce_print): Fix the $ number.
7679
76802005-11-14 Akim Demaille <akim@epita.fr>
7681
7682 "Use" parse parameters.
7683 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
7684 * data/glr.c, data/glr.cc: Use them.
7685 * data/glr.c (YYUSE): Have a C++ definition that supports
7686 non-pointer types.
7687
76882005-11-14 Akim Demaille <akim@epita.fr>
7689
7690 * data/glr.c (yyexpandGLRStack): Declare only if defined.
7691
76922005-11-14 Akim Demaille <akim@epita.fr>
7693
7694 * data/glr.cc: New.
7695 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
7696
76972005-11-12 Akim Demaille <akim@epita.fr>
7698
7699 Let position and location be PODs.
7700 * data/location.cc (position::initialize, location::initialize): New.
7701 (position::position, location::location): Define only if
7702 b4_location_constructors is defined.
7703 * data/lalr1.cc (b4_location_constructors): Define it for backward
7704 compatibility.
7705 * doc/bison.texinfo (Initial Action Decl): Use initialize.
7706
77072005-11-12 Akim Demaille <akim@epita.fr>
7708
7709 * data/lalr1.cc: Move the body of the ctor and dtor into the
7710 parser file (instead of the header).
7711 Wrap the implementations in a "namespace yy".
7712
77132005-11-12 Akim Demaille <akim@epita.fr>
7714
7715 Have glr.c include its header file when created.
7716 * data/glr.c (b4_shared_declarations): New.
7717 Output them verbatim in the parser if !%defines, otherwise
7718 output then in the header file, and include it instead.
7719
77202005-11-11 Akim Demaille <akim@epita.fr>
7721
7722 * data/glr.c: Comment changes.
7723
77242005-11-11 Akim Demaille <akim@epita.fr>
7725
7726 When yydebug, report semantic and location values for reductions.
7727 * data/glr.c (yy_reduce_print): Report the semantic values and the
7728 locations.
7729 (YY_REDUCE_PRINT): Adjust.
7730 (yyglrReduce): Use them.
7731 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
7732 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
7733 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
7734 traces.
7735
77362005-11-10 Akim Demaille <akim@epita.fr>
7737
7738 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
7739 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
7740 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
7741
77422005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
7743
7744 * m4/cxx.m4, examples/Makefile.am: Don't build
7745 examples/calc++ if no C++ compiler is available. (trivial change)
7746
77472005-11-09 Akim Demaille <akim@epita.fr>
7748
7749 * src/scan-skel.l: Use a couple of asserts.
7750
77512005-11-03 Akim Demaille <akim@epita.fr>
7752
7753 In some (weird) cases, the final state number is incorrect.
7754 Reported by Alexandre Duret-Lutz.
7755 * src/LR0.c (state_list_append): Remove the computation of
7756 final_state.
7757 (save_reductions): Do it here.
7758 (get_state): Alpha conversion.
7759 (generate_states): Use a for loop.
7760 * src/gram.h (item_number_is_rule_number)
7761 (item_number_is_symbol_number): New.
7762 * src/state.c: Use assert.
7763 * src/system.h: Include assert.h.
7764 * tests/sets.at (Accept): New.
7765
77662005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7767
7768 * data/glr.c (yyfill): Adjust comment.
7769 (yyresolveAction): Initialize default location properly
7770 for empty right-hand sides.
7771 (yydoAction): Ditto.
7772 Add comment explaining apparently dead code.
7773 * tests/glr-regression.at
7774 (Incorrectly initialized location for empty right-hand side in GLR):
7775 New test.
7776
77772005-10-30 Paul Eggert <eggert@cs.ucla.edu>
7778
7779 * bootstrap (cleanup_gnulib): New function. Use it to clean up
7780 gnulib when interrupted. This fixes some race conditions and
7781 works around some portability problems (one noted by Paul
7782 Hilfinger).
7783
77842005-10-22 Akim <akim@epita.fr>
7785
7786 * Makefile.cfg: Adjust to config -> build-aux.
7787 Reported by twledo.
7788
77892005-10-21 Akim Demaille <akim@epita.fr>
7790
7791 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
7792 the %parse-params.
7793 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
7794 * data/yacc.c (b4_Pure_if): Rename as...
7795 (b4_yacc_pure_if): this.
7796 (YY_SYMBOL_PRINT, yyparse): Adjust.
7797 * doc/bison.texinfo: Formatting changes.
7798
77992005-10-21 Akim Demaille <akim@epita.fr>
7800
7801 Finish the transition config -> build-aux.
7802 * configure.ac, Makefile.am: Use build-aux.
7803 * config/prev-version, config/announce-gen, config/Makefile.am:
7804 Move to...
7805 * build-aux/prev-version, build-aux/announce-gen,
7806 * build-aux/Makefile.am: here.
7807
78082005-10-14 Akim Demaille <akim@epita.fr>
7809
7810 * examples/calc++/test: Use set -x only when VERBOSE.
7811
78122005-10-13 Paul Eggert <eggert@cs.ucla.edu>
7813
7814 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
7815 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
7816
78172005-10-13 Akim Demaille <akim@epita.fr>
7818
7819 * src/scan-skel.l: Output the base name parts of the parser and
7820 header file names.
7821 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7822 additional checks.
7823 Use this to exercise C++ outputs in subdirs.
7824 Reported by Oleg Smolsky.
7825
78262005-10-12 Paul Eggert <eggert@cs.ucla.edu>
7827
7828 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
7829 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
7830 Problem reported by John P. Hartmann.
7831 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
7832 already defined it.
7833
78342005-10-12 Akim Demaille <akim@epita.fr>
7835
7836 * src/parse-gram.y (version_check): Exit 63 to please missing
7837 (stands for "version mismatch).
7838 * tests/input.at, doc/bison.texinfo: Adjust.
7839
78402005-10-10 Paul Eggert <eggert@cs.ucla.edu>
7841
7842 Work around portability problems with Visual Age C compiler
7843 (xlc and xlC_r) reported by John P. Hartmann.
7844 * data/location.cc (initial_column, initial_line): Remove.
7845 All uses replaced by 0 and 1.
7846 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
7847 that xlc complains about.
7848 * src/scan-skel.l (skel_wrap): Likewise.
7849 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
7850 as __STDC__.
7851 * data/yacc.c (YYMODERN_C): New macro, which also looks at
7852 __STDC_VERSION__. Use it everywhere instead of looking at
7853 __STDC__ and __cplusplus.
7854
78552005-10-10 Akim Demaille <akim@epita.fr>
7856
7857 * examples/calc++/test: Be quiet unless VERBOSE.
7858
78592005-10-05 Paul Eggert <eggert@cs.ucla.edu>
7860
7861 * data/c.m4 (yydestruct, yysymprint):
7862 Use YYUSE instead of casting to void.
7863 * data/glr.c (YYUSE): New macro.
7864 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7865 Use it instead of rolling our own.
7866 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7867 (YYCHK1):
7868 Use /*CONSTCOND*/ to suppress lint warnings.
7869 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7870 (YY_STACK_PRINT): Use 'false' not '0'.
7871 (YYUSE): New macro.
7872 (yysymprint_, yydestruct_): Use it instead of rolling our own.
7873 * data/yacc.c (YYUSE): New macro.
7874 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
7875 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
7876 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
7877
7878
7879 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
7880 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
7881
78822005-10-04 Paul Eggert <eggert@cs.ucla.edu>
7883
7884 Undo the parts of the unlocked-I/O change that substituted
7885 putc or puts for printf. This might hurt performance a bit,
7886 but some people prefer the printf style.
7887 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
7888 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
7889 All uses replaced by YYFPRINTF and YYDPRINTF.
7890 * data/yacc.c: Likewise.
7891 * lib/bitset.c (bitset_print): Likewise.
7892 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
7893 putc and puts.
7894 * lib/lbitset.c (debug_lbitset): Likewise.
7895 * src/closure.c (print_firsts, print_fderives): Likewise.
7896 * src/gram.c (grammar_dump): Likewise.
7897 * src/lalr.c (look_ahead_tokens_print): Likewise.
7898 * src/output.c (escaped_output): Likewise.
7899 (user_actions_output): Break apart two printfs.
7900 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
7901 * src/reduce.c (reduce_print): Likewise.
7902 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7903 * src/system.h: Include unlocked-io.h rathe than stdio.h.
7904
7905 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7906 Use assignments rather than casts-to-void to suppress
7907 unused-variable warnings. This pacifies 'lint'.
7908 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
7909 unused-variable warnings.
7910
79112005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7912
7913 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7914
79152005-10-02 Paul Eggert <eggert@cs.ucla.edu>
7916
7917 Use unlocked I/O for a minor performance improvement on hosts like
7918 GNU/Linux and Solaris that support unlocked I/O. The basic idea
7919 is to use the gnlib unlocked-io module, and to prefer putc and
7920 puts to printf when either will work (since the latter doesn't
7921 come in an unlocked flavor).
7922 * bootstrap (gnulib_modules): Add unlocked-io.
7923 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
7924 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
7925 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
7926 and similarly for puts and putc and printf.
7927 * data/yacc.c: Likewise.
7928 * lib/bitset.c (bitset_print): Likewise.
7929 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
7930 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
7931 to printf.
7932 * lib/lbitset.c (debug_lbitset): Likewise.
7933 * src/closure.c (print_firsts, print_fderives): Likewise.
7934 * src/gram.c (grammar_dump): Likewise.
7935 * src/lalr.c (look_ahead_tokens_print): Likewise.
7936 * src/output.c (escaped_output): Likewise.
7937 (user_actions_output): Coalesce two printfs.
7938 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
7939 * src/reduce.c (reduce_print): Likewise.
7940 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7941 * src/system.h: Include unlocked-io.h rather than stdio.h.
7942
7943 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
7944 this confuses xgettext.
7945
79462005-10-02 Akim Demaille <akim@epita.fr>
7947
7948 * bootstrap (gnulib_modules): Add strverscmp.
7949 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
7950 * m4/.cvsignore: Add strverscmp.m4.
7951 * src/parse-gram.y (%require): New token, new rule.
7952 (version_check): New.
7953 * src/scan-gram.l (%require): Adjust.
7954 * tests/input.at (AT_REQUIRE): New.
7955 Use it.
7956 * doc/bison.texinfo (Require Decl): New.
7957 (Calc++ Parser): Use %require.
7958
79592005-10-02 Akim Demaille <akim@epita.fr>
7960
7961 * data/location.cc: New.
7962
79632005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
7964 Akim Demaille <akim@epita.fr>
7965
7966 Make sure -odir/foo.cc creates dir/location.hh etc.
7967 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
7968 (spec_file_prefix, spec_verbose_file, spec_graph_file)
7969 (spec_defines_file): Now const.
7970 (dir_prefix): New.
7971 (short_base_name): Remove.
7972 * src/files.c: Adjust.
7973 (dirname.h): Include.
7974 (base_name): Don't prototype it.
7975 (finput): Remove, duplicates gram_in.
7976 (full_base_name, short_base_name): Replace by...
7977 (all_but_ext, all_but_tab_ext): these.
7978 (compute_base_names): Rename as...
7979 (compute_file_name_parts): this.
7980 Update to compute the new variables, including dir_prefix.
7981 Adjust dependencies.
7982 * src/output.c (prepare): Output them.
7983 * src/reader.c: Adjust to use gram_in, not finput.
7984 * src/scan-skel.l (@dir_prefix@): New.
7985
79862005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7987
7988 * lib/subpipe.c: New function end_of_output_subpipe() added
7989 to allow support for non-posix systems. This is a no-op function
7990 for posix systems.
7991
7992 * lib/subpipe.h: New function end_of_output_subpipe() added
7993 to allow support for non-posix systems. This is a no-op function
7994 for posix systems.
7995
7996 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
7997 handle the lack of pipe/fork functionality on non-posix systems.
7998
7999 * djgpp/Makefile.maint: DJGPP specific file.
8000
8001 * djgpp/README.in: DJGPP specific file.
8002
8003 * djgpp/config.bat: DJGPP specific configuration file.
8004
8005 * djgpp/config.sed: DJGPP specific configuration file.
8006
8007 * djgpp/config.site: DJGPP specific configuration file.
8008
8009 * djgpp/config_h.sed: DJGPP specific configuration file.
8010
8011 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
8012
8013 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
8014
80152005-10-02 Akim Demaille <akim@epita.fr>
8016
8017 * data/location.cc: New, extract from...
8018 * data/lalr1.cc: here.
8019 (location.hh): Include it after the user prologue, in case the
8020 filename type is defined by the user.
8021 Forward declation location and position before the pre-prologue.
8022 (yyresult_): Rename as...
8023 (yyresult): this, it's a local variable, not an attribute.
8024 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
8025
80262005-10-01 Akim Demaille <akim@epita.fr>
8027
8028 * examples/extexi: Restore the #line generation.
8029
80302005-09-30 Akim Demaille <akim@epita.fr>,
8031 Alexandre Duret-Lutz <adl@gnu.org>
8032
8033 Move the token type and YYSTYPE in the parser class.
8034 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
8035 (parser::token): New, from the moved free definition of tokens.
8036 (parser::semantic_value): Now a full definition instead of an
8037 indirection to YYSTYPE.
8038 (b4_post_prologue): No longer included in the header file, but
8039 in the implementation file.
8040 * doc/bison.texi (C+ Language Interface): Update.
8041 * src/parse-gram.y: Support unary %define.
8042 * tests/actions.at: Define global_tokens_and_yystype for backward
8043 compatibility until we update the tests.
8044 * tests/calc.at: Idem.
8045 (first_line, first_column, last_line, last_column): Define for lalr1.cc
8046 to simplify the code.
8047
80482005-09-29 Paul Eggert <eggert@cs.ucla.edu>
8049
8050 Port to SunOS 4.1.4, which lacks strtoul and strerror.
8051 Ah, the good old days! Problem reported by Peter Klein.
8052 * bootstrap (gnulib_modules): Add strerror, strtoul.
8053 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
8054 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
8055
80562005-09-29 Akim Demaille <akim@epita.fr>
8057
8058 * data/c.m4 (b4_error_verbose_if): New.
8059 * data/lalr1.cc: Use it.
8060 (YYERROR_VERBOSE_IF): Remove.
8061 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
8062 parser members, replaced by...
8063 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
8064 local variables.
8065 (yysyntax_error_): Takes the state number as argument.
8066 (yyreduce_print_): Use the argument yyrule, not the former
8067 attribute yyn_.
8068
80692005-09-26 Paul Eggert <eggert@cs.ucla.edu>
8070
8071 * bootstrap (gnulib_modules): Add verify.
8072 * lib/.cvsignore: Add verify.h.
8073 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
8074 * src/system.h (verify): Remove.
8075 Include verify.h instead.
8076 * src/tables.c (tables_generate): Use new API for 'verify'.
8077
80782005-09-21 Paul Eggert <eggert@cs.ucla.edu>
8079
8080 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
8081 local variables whose names begin with 'yy'.
8082 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8083 Trivial changes from Joel E. Denny.
8084
8085 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
8086 it itself.
8087 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
8088 don't use alloca any more.
8089
8090 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
8091 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
8092 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
8093 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
8094 to match yacc.c, to test more hosts.
8095
80962005-09-20 Paul Eggert <eggert@cs.ucla.edu>
8097
8098 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
8099 doesn't affect behavior.
8100 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
8101 Solaris, AIX, MSC.
8102 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
8103 This works a bit better with glibc, if user code has already included
8104 stdlib.h.
8105 * doc/bison.texinfo (Bison Parser): Document that users can't
8106 arbitrarily use malloc and free for other purposes. Document
8107 that <alloca.h> and <malloc.h> might be included.
8108 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
8109 user must declare alloca.
8110
8111 * HACKING (release): Forwarn the Translation Project about
8112 stable releses.
8113
81142005-09-20 Akim Demaille <akim@epita.fr>
8115
8116 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
8117
81182005-09-19 Paul Eggert <eggert@cs.ucla.edu>
8119
8120 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
8121 (YYSTACK_ALLOC_MAXIMUM): Use it.
8122 (yysyntax_error): New function.
8123 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
8124 multiple syntax errors are reported, and alloca is being used.
8125 Instead, reallocate buffers twice as big each time, so that
8126 we waste at most half the allocated memory. Start with a small
8127 (128-byte) buffer that will suffice in most cases anyway.
8128 Use yysyntax_error to do most of the work.
8129
8130 * doc/bison.texinfo (Error Reporting, Table of Symbols):
8131 yynerrs is the number of errors reported, not the number of
8132 errors encountered.
8133
8134 * tests/glr-regression.at (Duplicated user destructor for lookahead):
8135 Mark it as expected to fail.
8136 Cast result of malloc; problem reported by twlevo@xs4all.nl.
8137 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
8138 Don't start user-code symbols with "yy", to avoid name space problems.
8139
81402005-09-19 Akim Demaille <akim@epita.fr>
8141
8142 Remove the traits, failed experiment.
8143 It never proved useful, and anyway because of the current
8144 definition, it was not possible to have several specialization of
8145 this traits, making it useless.
8146 * data/lalr1.cc (yy:traits): Remove.
8147 Inline its definitions in the parser class.
8148
81492005-09-19 Akim Demaille <akim@epita.fr>
8150
8151 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
8152 least Mac OSX with a /usr/local install of gettext.
8153
81542005-09-19 Akim Demaille <akim@epita.fr>
8155
8156 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
8157 and yytoken for similarity with the other skeletons.
8158
81592005-09-19 Akim Demaille <akim@epita.fr>
8160
8161 * NEWS, configure.ac: update version number to 2.1a.
8162
81632005-09-16 Paul Eggert <eggert@cs.ucla.edu>
8164
8165 * NEWS: Version 2.1.
8166
8167 * NEWS: Remove notice of yytname change, since it was never in an
8168 official release.
8169 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
8170 diagnostic.
8171 * src/output.c (prepare): Likewise.
8172 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
8173 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
8174 is not defined. This is an awful hack, but it's enough for now.
8175 All callers changed.
8176 * tests/glr-regression-at (make_value): Args are const pointers now,
8177 to avoid GCC warning.
8178 (Duplicated user destructor for lookahead): New test. Currently
8179 skipped. It fails on my host but I'm not sure it'll always fail.
8180
81812005-09-16 Akim Demaille <akim@epita.fr>
8182
8183 * src/symtab.h (struct symbol): Declare the printer and destructor
8184 as const, to avoid accidental calls to free.
8185 (symbol_destructor_set, symbol_printer_set): Adjust.
8186 * src/symtab.c: Adjust.
8187
81882005-09-16 Akim Demaille <akim@epita.fr>
8189
8190 * data/c.m4 (b4_token_enums): New.
8191 (b4_token_defines): Rename as...
8192 (b4_token_enums_defines): this.
8193 (b4_token_defines): New, output only the #defines.
8194 * data/yacc.c, data/glr.c: Adjust.
8195 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
8196 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
8197 as default values.
8198
81992005-09-16 Akim Demaille <akim@epita.fr>
8200
8201 * data/lalr1.cc (yylex_): Remove, inline its code.
8202 (yyreport_syntax_error_): Remove, replaced by...
8203 (yysyntax_error_): this which returns a string and leaves to the
8204 caller the call to the users' error function.
8205 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
8206 Move from members of the parser object...
8207 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
8208 to local variables of the parse function.
8209
82102005-09-16 Akim Demaille <akim@epita.fr>
8211
8212 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
8213 since it's in Bison's name space.
8214
82152005-09-15 Paul Eggert <eggert@cs.ucla.edu>
8216
8217 * data/glr.c (yyresolveValue): Add default case to pacify
8218 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
8219
8220 * NEWS: Document when yyparse started to return 2.
8221 * doc/bison.texinfo (Parser Function): Document when yyparse
8222 returns 2.
8223
8224 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
8225 (b4_filename_type): Renamed back from b4_file_name_type. All uses
8226 changed.
8227 (class position): file_name -> filename (reverting). All uses changed.
8228
82292005-09-14 Paul Eggert <eggert@cs.ucla.edu>
8230
8231 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
8232 do anything if $@ exists. This reverts part of the 2005-07-07
8233 patch.
8234
82352005-09-11 Paul Eggert <eggert@cs.ucla.edu>
8236
8237 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
8238 contains obsolete information and isn't worth distributing as a
8239 separate file anyway.
8240 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
8241 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
8242 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
8243 (yyparse): Abort if user code uses longjmp to throw an unexpected
8244 value.
8245
82462005-09-09 Paul Eggert <eggert@cs.ucla.edu>
8247
8248 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
8249 Suggested by twlevo@xs4all.nl.
8250
8251 * data/glr.c (YYCHK1): Do not assume YYE is in range.
8252 This avoids a diagnostic from gcc -Wswitch-enum.
8253 Problem reported by twlevo@xs4all.nl.
8254
8255 * doc/bison.texinfo: Don't use "filename", as per GNU coding
8256 standards. Use "file name" or "file" or "name", depending on
8257 the context.
8258 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
8259 not to hack/foo.tab.c.
8260 (Calc++ Top Level): 2nd arg of main is not const.
8261 * data/glr.c: b4_filename -> b4_file_name.
8262 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
8263 All uses changed.
8264 (class position): filename -> file_name. All uses changed.
8265 * data/yacc.c: b4_filename -> b4_file_name.
8266 * lib/bitset.h: filename -> file_name in local vars.
8267 * lib/bitset_stats.c: Likewise.
8268 * src/files.c: Likewise.
8269 * src/scan-skel.l ("@output ".*\n): Likewise.
8270 * src/files.c (file_name_split): Renamed from filename_split.
8271 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
8272
82732005-09-08 Paul Eggert <eggert@cs.ucla.edu>
8274
8275 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
8276 to accommodate latest gnulib.
8277
8278 * tests/glr-regression.at (Duplicate representation of merged trees):
8279 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
8280
8281 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
8282 needed.
8283
82842005-08-26 Paul Eggert <eggert@cs.ucla.edu>
8285
8286 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
8287 All uses changed. Invoke user destructor after an error during a
8288 split parse (trivial change from Joel E. Denny).
8289
8290 * tests/glr-regression.at
8291 (User destructor after an error during a split parse): New test case.
8292 Problem reported by Joel E. Denny in:
8293 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
8294
82952005-08-25 Paul Eggert <eggert@cs.ucla.edu>
8296
8297 * README-cvs: Give URLs for recommended tools.
8298 Mention Gzip version problem, and bootstrapping issues.
8299 Remove troubleshooting section, as it's somewhat obsolete.
8300
8301 * bootstrap (no_cache): New var, to accommodate different wget
8302 variants. Use it instead of '-C off'. Problem reported by
8303 twlevo@xs4all.nl.
8304
8305 * data/glr.c (yydestroyStackItem): New function.
8306 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
8307 debugging information. Problem reported by Joel E. Denny.
8308
83092005-08-25 Akim Demaille <akim@epita.fr>
8310
8311 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
8312
83132005-08-24 Paul Eggert <eggert@cs.ucla.edu>
8314
8315 * data/glr.c (yyrecoverSyntaxError, yyreturn):
8316 Don't invoke destructor on unresolved entries.
8317 * tests/glr-regression.at
8318 (User destructor for unresolved GLR semantic value): New test case.
8319 Problem reported by Joel E. Denny in:
8320 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
8321
83222005-08-21 Paul Eggert <eggert@cs.ucla.edu>
8323
8324 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
8325 Add strnlen.c.
8326 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
8327 lib-prefix.m4, po.m4.
8328
8329 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
8330 in yydestruct diagnostic, since it might not be an error.
8331 Problem reported by Joel Denny near end of
8332 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8333 * data/lalr1.cc (yyerturn): Likewise.
8334 * data/yacc.c (yyreturn): Likewise.
8335 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
8336
8337 * src/files.c: Remove obsolete FIXME comment.
8338
8339 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
8340 with the other templates, and to fix bogus run-on messages such
8341 as the one reported at the end of
8342 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8343 All callers changed to avoid the newline.
8344 (yyprocessOneStack): Output two lines rather than one, to accommodate
8345 the above change. This changes the debug output format slightly.
8346
8347 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
8348 reported by Joel E. Denny in
8349 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
8350 (trivial change).
8351 * tests/glr-regression.at (Duplicate representation of merged trees):
8352 New test, from Joel E. Denny in:
8353 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
8354 * THANKS: Add Joel E. Denny.
8355
8356 * configure.ac (AC_INIT): Bump to 2.0c.
8357
83582005-07-24 Paul Eggert <eggert@cs.ucla.edu>
8359
8360 * NEWS: Version 2.0b.
8361
8362 * Makefile.am (SUBDIRS): Put examples before tests, so that
8363 "make check" doesn't finish with "All 1 tests passed".
8364
8365 * tests/regression.at (Token definitions): Don't rely on
8366 AT_PARSER_CHECK for data that contains backslashes. It currently
8367 uses 'echo', and 'echo' isn't portable if its argument contains
8368 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
8369 that the byte '\0xff' is not printable in the C locale; it is,
8370 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
8371 not printable, so use '\0x81' to test.
8372
8373 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
8374 version of GCC, since the macro is used with non-GCC compilers.
8375
8376 Fix core dump reported by Pablo De Napoli in
8377 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
8378 * tests/regression.at (Invalid inputs with {}): New test.
8379 * src/parse-gram.y (token_name): Translate type before using
8380 it as an index.
8381
8382 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
8383 the user's name space. All uses changed to __attribute__
8384 ((__unused__)).
8385 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
8386 Add __attribute__ ((__noreturn__)).
8387
8388 * etc/clcommit: Remove. We weren't using it, and it failed
8389 "make maintainer-distcheck".
8390 * Makefile.maint: Merge from coreutils.
8391 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
8392 (syntax-check-rules): Change list of rules as described below.
8393 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
8394 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
8395 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
8396 (sc_trailing_space): New rules.
8397 (sc_xalloc_h_in_src): Remove.
8398 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
8399 (sc_space_tab, sc_error_exit_success, sc_changelog):
8400 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
8401 (makefile-check, po-check, author_mark_check):
8402 (makefile_path_separator_check, copyright-check):
8403 Use grep -n, to make it easier to find violations.
8404 Use CVS_LIST and CVS_LIST_EXCEPT.
8405 (header_regexp, h_re): Remove.
8406 (dd_c): New macro.
8407 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
8408 (my-distcheck): Use more-modern GCC flags.
8409 (signatures, %.asc): Remove.
8410 (rel-files, announcement): Remove signatures.
8411 Restore old updating code, even though we don't use it, so
8412 that we're the same as coreutils.
8413 (alpha, beta, major): Depend on news-date-check.
8414 Make the upload commands.
8415
8416 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
8417 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
8418 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
8419 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
8420 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
8421 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
8422 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
8423 * tests/sets.at: Likewise.
8424
8425 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
8426 we comment out the Autoconf version number.
8427 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
8428 it's error-prone and "make maintainer-distcheck" rejects it.
8429
8430 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
8431 Indent calls to "error" to pacify "make maintainer-distcheck",
8432 when the calls are not intended to be translated.
8433 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
8434
8435 * src/Makefile.am (DEFS): Use +=, to pacify
8436 "make maintainer-distcheck".
8437 (bison_SOURCES): Add scan-skel.h.
8438 (sc_tight_scope): New rule, from coreutils.
8439
8440 * src/files.c (src_extension, header_extension):
8441 Now static, not extern.
8442 * src/getargs.c (short_options): Likewise.
8443 * src/muscle_tab.c (muscle_table): Likewise.
8444 * src/parse-gram.y (current_class, current_type, current_prec):
8445 Likewise.
8446 * src/reader.c (grammar_end, previous_rule_end): Likewise.
8447 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
8448 * src/main.c (main): Cast bindtextdomain and textdomain calls to
8449 void, to avoid warning when NLS is disabled.
8450 * src/output.c: Include scan-skel.h.
8451 (scan_skel): Remove decl, since scan-skel.h does this.
8452 (output_skeleton):
8453 Indent calls to "error" to pacify "make maintainer-distcheck".
8454 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
8455 * src/reader.h (gram_end, gram_lineno): New decls to pacify
8456 "make maintainer-distcheck".
8457 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
8458 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
8459 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
8460 (skel_lex_destroy, scan_skel): Move these decls to...
8461 * src/scan-skel.h: New file.
8462 * src/uniqstr.c (uniqstr_assert):
8463 Indent calls to "error" to pacify "make maintainer-distcheck".
8464
8465 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
8466 not @VAR@.
8467
8468 * tests/torture.at: Revamp to avoid misuse of atoi that
8469 "make maintainer-distcheck" complained about.
8470
8471 * examples/extexi (message): Don't print a message more than once,
8472 and omit line-number decoration that makes Emacs compile think
8473 that informative messages are worth worrying about.
8474
84752005-07-22 Paul Eggert <eggert@cs.ucla.edu>
8476
8477 * configure.ac: Update version number.
8478
8479 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
8480 accidentally.
8481 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
8482 autogenerated by the maintainer.
8483 * examples/calc++/.cvsignore: Add *.yy.
8484
8485 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
8486 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8487 * lib/bitsetv.c (bitsetv_alloc): Likewise.
8488
8489 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
8490
8491 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
8492 from maintainer-distcheck about casting the argument of 'free'.
8493
8494 * NEWS: Mention recent yytname changes.
8495 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
8496
8497 * bootstrap: For translations that have not yet been upgraded to
8498 the new runtime-po domain, prime the pump by extracting the
8499 relevant strings from the obsolete translations. This code can be
8500 removed once the bison-runtime domain has been translated by each
8501 team.
8502
8503 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
8504 now that token names are already quoted.
8505
8506 Fix problem reported by Anthony Heading.
8507 * data/glr.c (YYTOKEN_TABLE): New macro.
8508 (yytname): Define if YYTOKEN_TABLE.
8509 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
8510 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
8511 (YYERROR_VERBOSE): Define the same way the other skeletons do.
8512 * src/output.c (prepare_symbols): Output token_table_flag.
8513
85142005-07-21 Paul Eggert <eggert@cs.ucla.edu>
8515
8516 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
8517 again if the first call fails.
8518
8519 * data/glr.c (yytnamerr): New function.
8520 (yyreportSyntaxError): Use it to dequote most string literals.
8521 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
8522 with other skeletons. All uses changed.
8523 (yytnameerr_): New function.
8524 (yyreport_syntax_error): Use it to dequote most string literals.
8525 * data/yacc.c (yytnamerr): New function.
8526 (yyerrlab): Use it to decode most string literals.
8527 * doc/bison.texinfo (Decl Summary, Calling Convention):
8528 Clarify quoting convention of yytname.
8529 * src/output.c (prepare_symbols): Quote all names. This undoes
8530 the 2005-04-17 change, which is now accomplished (mostly) via
8531 changes in the parsers as described above.
8532 * tests/regression.at (Token definitions, Web2c Actions):
8533 Undo most 2005-04-17 change here, too.
8534
85352005-07-20 Paul Eggert <eggert@cs.ucla.edu>
8536
8537 Fix more problems reported by twlevo@xs4all.nl.
8538 * tests/cxx-type.at: Don't pipe output of ./types through sed to
8539 remove trailing spaces. This loses the exit status of ./types,
8540 and isn't needed since ./types shouldn't be emitting trailing
8541 spaces.
8542 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
8543 as the stack isn't valid in that case.
8544
8545 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8546 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8547 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8548 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
8549 is used.
8550 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
8551 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8552 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8553 Likewise.
8554
8555 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
8556 overly-picky compilers that reject 'char *foo = "bar";'.
8557
8558 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
8559 to FILE * parameter, not to stderr. This fixes a typo introduced
8560 in the 2005-07-12 change.
8561
8562 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
8563 warnings from GCC 4.
8564
8565 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
8566 (yyglrShiftDefer, yysplitStack):
8567 Remove unused parameters b4_pure_formals. All uses changed.
8568 (yyglrShift): Remove unused parameters b4_user_formals.
8569 All uses changed.
8570 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
8571
85722005-07-18 Paul Eggert <eggert@cs.ucla.edu>
8573
8574 Destructor cleanups and regularization among the three skeletons.
8575 * NEWS: Document the behavior changes.
8576 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
8577 stack before failing, as the cleanup code will do it for us now.
8578 * data/lalr1.cc (yyerrlab): Likewise.
8579 * data/glr.c (yyparse): Pop everything off the stack before
8580 freeing it, so that destructors get called properly.
8581 * data/lalr1.cc (yyreturn): Likewise.
8582 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
8583 This is more consistent.
8584 * doc/bison.texinfo (Destructor Decl): Mention more reasons
8585 why destructors might be called. 1.875 -> 2.1.
8586 (Destructor Decl, Decl Summary, Table of Symbols):
8587 Some English-language cleanups for %destructor.
8588 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8589 Add output line for destructor of start symbol.
8590 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
8591 because of that same extra output line.
8592
8593 * NEWS: Document minor wording changes in diagnostics of
8594 Bison-generated parsers.
8595 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
8596 Remove unused formals. All uses changed.
8597 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
8598 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
8599 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
8600 Rename yyoverflowab to yyexhaustedlab.
8601 When memory exhaustion occurs during syntax-error reporting,
8602 report it separately rather than in a single diagnostic; this
8603 eases translation.
8604 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
8605 (Memory Exhausted): Renamed from Parser Stack Overflow.
8606 Revamp wording slightly to prefer "memory exhaustion".
8607 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
8608
8609 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
8610
8611 Add i18n support to the GLR skeleton. Partially fix the C++
8612 skeleton; a C++ expert needs to finish this. Remove debugging
8613 msgids; there's little point to having them translated, since they
8614 can be understood only by someone who can read the
8615 (English-language) source code.
8616
8617 Generate runtime-po/bison-runtime.pot automatically, so that we
8618 don't have to worry about garbage getting in that file. We'll
8619 make sure after the next official release that old msgids don't
8620 get lost. See
8621 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
8622
8623 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
8624 Now auto-generated.
8625 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
8626 Fix typos in explanations of the runtime file.
8627 * bootstrap: Change gettext keyword from YYI18N to YY_.
8628 Use standard Makefile.in.in in runtime-po, since we'll arrange
8629 for backward-compatible bison-runtime.po files in a different way.
8630 * data/glr.c (YY_): New macro, from yacc.c.
8631 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
8632 Translate messages intended for users.
8633 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
8634 the wording in the other skeletons. We don't know that the memory
8635 is virtual.
8636 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
8637 Use same method that yacc.c uses.
8638 Don't translate debugging messages.
8639 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
8640 it doesn't work (yet), and requires C++ expertise to fix.
8641 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
8642 Move defn to a more logical place, to be consistent with other
8643 skeletons.
8644 Don't translate debugging messages.
8645 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
8646 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
8647 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
8648 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
8649
8650 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
8651 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
8652 void, not int.
8653 * tests/glr-regression.at (Badly Collapsed GLR States):
8654 Likewise.
8655 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8656 yylex should return 0 at EOF rather than aborting.
8657
8658 Improve tests for stack overflow in GLR parser.
8659 Problem reported by twlevo@xs4all.nl.
8660 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
8661 All uses removed.
8662 (yyStackOverflow): Just longjmp, but with value 2 so that caller
8663 can handle the problem.
8664 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
8665 (yyparse): New local variable yyresult to record the result.
8666 Use result of setjmp to set it, rather than storing itinto
8667 struct.
8668 (yyDone): Remove label.
8669 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
8670 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
8671 if YYABORT is used).
8672 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
8673 yyparse status; put status > 1 into diagnostic.
8674 Check that status==2 works.
8675 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
8676 Use exit status 3 for failure to open (which shouldn't happen).
8677
86782005-07-17 Paul Eggert <eggert@cs.ucla.edu>
8679
8680 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
8681 1 on syntax error; just let yyparse do its thing.
8682 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
8683 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
8684 (Exploding the Stack Size with Alloca):
8685 (Exploding the Stack Size with Malloc):
8686 Expect exit status 2, not 1, since the parser is supposed to blow
8687 its stack. Problem reported by twlevo@xs4all.nl.
8688
8689 * data/glr.c (yyparse): Don't assume that the initial calls
8690 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
8691 Print a stack-overflow message and fail instead.
8692 Initialize the line-number information before creating the stack,
8693 so that the stack-overflow message can report line zero safely.
8694
86952005-07-14 Paul Eggert <eggert@cs.ucla.edu>
8696
8697 Fix problems reported by twlevo@xs4all.nl.
8698 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
8699 (yyuserMerge): Provide a default case if b4_mergers is empty.
8700 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
8701 * tests/glr-regression.at
8702 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8703 Add casts to pacify C++ compilers.
8704 * tests/glr-regression.at (Improper merging of GLR delayed action
8705 sets): Declare yylex before using it.
8706 * tests/Makefile.am (maintainer-check-g++): Fix a stray
8707 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
8708 test for valgrind; valgrind is independent of g++.
8709 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
8710 for compatibility with POSIX 1003.1-2001 (if running coreutils).
8711 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
8712 Use a destructor, so that we can expand the stack. Change
8713 YYSTYPE to char * so that we can free it. Cast result of malloc.
8714
87152005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8716
8717 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
8718 a valgrind failure. Problem reported by twlevo@xs4all.nl.
8719
87202005-07-13 Paul Eggert <eggert@cs.ucla.edu>
8721
8722 * PACKAGING: New file, suggested by Bruno Haible and taken from
8723 similar wording in gettext's PACKAGING file.
8724 * NEWS: Mention PACKAGING.
8725 * Makefile.am (EXTRA_DIST): Add PACKAGING.
8726
87272005-07-12 Paul Eggert <eggert@cs.ucla.edu>
8728
8729 * NEWS: Document recent i18n improvements.
8730 * bootstrap: Get runtime translations into runtime-po.
8731 Create runtime-po files automatically, if possible.
8732 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
8733 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
8734 does not infringe on the user's name space.
8735 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
8736 * doc/bison.texinfo (Internationalization): Revamp the English
8737 and Texinfo syntax a bit, to try to make it clearer.
8738 (Bison Options, Option Cross Key): Mention --print-localedir.
8739 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
8740 YYENABLE_NLS. Quote a bit more.
8741 * runtime-po/.cvsignore: New file.
8742 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
8743 * runtime-po/Rules-quot: Remove; now created by bootstrap.
8744 * runtime-po/quot.sed: Likewise.
8745 * runtime-po/boldquot.sed: Likewise.
8746 * runtime-po/en@quot.header: Likewise.
8747 * runtime-po/en@boldquot.header: Likewise.
8748 * runtime-po/insert-header.sin: Likewise.
8749 * runtime-po/remove-potcdate.sin: Likewise.
8750 * runtime-po/Makevars: Likewise.
8751 * runtime-po/LINGUAS: Likewise.
8752 * runtime-po/de.po: Likewise; we will rely on the translation project
8753 to maintain this, so "bootstrap" should get it.
8754 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
8755 its value.
8756 * src/main.c (main): Bind the bison-runtime domain, too.
8757
87582005-07-12 Bruno Haible <bruno@clisp.org>
8759
8760 * data/yacc.c: Include <libintl.h> when NLS is enabled.
8761 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
8762 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
8763 * runtime-po: New directory.
8764 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
8765 $(DOMAIN).pot-update rule, so that old messages are never dropped.
8766 * runtime-po/Rules-quot: New file, copied from po/.
8767 * runtime-po/quot.sed: Likewise.
8768 * runtime-po/boldquot.sed: Likewise.
8769 * runtime-po/en@quot.header: Likewise.
8770 * runtime-po/en@boldquot.header: Likewise.
8771 * runtime-po/insert-header.sin: Likewise.
8772 * runtime-po/remove-potcdate.sin: Likewise.
8773 * runtime-po/Makevars: New file.
8774 * runtime-po/POTFILES.in: New file.
8775 * runtime-po/LINGUAS: New file.
8776 * runtime-po/bison-runtime.pot: New file.
8777 * runtime-po/de.po: New file.
8778 * m4/bison.m4: New file.
8779 * Makefile.am (SUBDIRS): Add runtime-po.
8780 (aclocaldir, aclocal_DATA): New variables.
8781 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
8782 Define aclocaldir.
8783 * src/getargs.c (usage): Document --print-localedir option.
8784 (PRINT_LOCALEDIR_OPTION): New enum item.
8785 (long_options): Add --print-localedir option.
8786 (getargs): Handle --print-localedir option.
8787 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
8788 (Internationalization): New section.
8789
87902005-07-12 Akim Demaille <akim@epita.fr>
8791
8792 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
8793 for consistency with the rest of the code.
8794 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
8795 Add separators.
8796
87972005-07-12 Akim Demaille <akim@epita.fr>
8798
8799 * src/parse-gram.y: Use %printer instead of YYPRINT.
8800
88012005-07-12 Akim Demaille <akim@epita.fr>
8802
8803 * src/symtab.h, src/symtab.c (symbol_print): New.
8804 * src/symlist.h, src/symlist.c (symbol_list_print): New.
8805 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
8806
88072005-07-12 Akim Demaille <akim@epita.fr>
8808
8809 * data/glr.c (b4_syncline): Fix (swap) the definitions of
8810 b4_at_dollar and b4_dollar_dollar.
8811
88122005-07-11 Paul Eggert <eggert@cs.ucla.edu>
8813
8814 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
8815 and Pennello's paper.
8816
88172005-07-09 Paul Eggert <eggert@cs.ucla.edu>
8818
8819 * data/yacc.c (yyparse): Undo previous patch. Instead,
8820 set yylsp[0] and yyvsp[0] only if the initial action
8821 sets yylloc and yylval, respectively.
8822
8823 * data/yacc.c (yyparse): In the initial action, set
8824 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
8825 This avoids the use of undefined variables if the initial
8826 action does not set yylloc and/or yylval.
8827
88282005-07-07 Paul Eggert <eggert@cs.ucla.edu>
8829
8830 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
8831 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
8832 Remove from CVS. These files are automatically generated.
8833 * examples/extexi: Clarify that this file is now part of Bison,
8834 not GNU M4, and that it works with any POSIX-compatible Awk.
8835 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
8836 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
8837 so that we also get calc++-parser.yy. Geneate it.
8838 Use $(AWK), not gawk, since any conforming Awk will do.
8839 Put comment before action, since older 'make' can't handle comment
8840 in action.
8841 $(BUILT_SOURCES): List all built sources, not just some of them.
8842 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
8843 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
8844 $($(calc_sources_generated)): Remove unnecessary test for existence
8845 of target. (This had a shell syntax error anyway; a stray "x".)
8846 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
8847 calc++-parser.yy.
8848 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
8849
8850 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
8851 implied by the other modules.
8852
88532005-07-06 Akim Demaille <akim@epita.fr>
8854
8855 Bind examples/calc++ to the package.
8856 * examples/calc++/Makefile: Remove, replaced by...
8857 * examples/calc++/Makefile.am: ... this new file.
8858 * examples/calc++/test: Remove input.
8859 * examples/calc++/compile: Remove.
8860 * examples/Makefile.am: New.
8861 * configure.ac, Makefile.am: Adjust.
8862 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
8863
88642005-07-05 Paul Eggert <eggert@cs.ucla.edu>
8865
8866 * data/glr.c (yyFail): Drastically simplify; since the format argument
8867 never had any % directives, we can simply pass it to yyerror.
8868 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
8869 be modified later, as that is the usual style in glr.c.
8870 Problems reported by Paul Hilfinger.
8871
8872 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
8873 and size overflow errors.
8874 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
8875 in case the user prolog sets feature-test macros like _GNU_SOURCE.
8876 (YYSIZEMAX): New macro.
8877 (yystpcpy): New function, taken from yacc.c.
8878 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
8879 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
8880 so that we don't have to maintain their signatures.
8881 (yyFail): Check for buffer overflow, by using vsnprintf rather
8882 than vsprintf. Allocate a bigger buffer if possible.
8883 Report an error if buffer allocation fails.
8884 (yyStackOverflow): New function.
8885 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
8886 the initialization was successful. It might fail if storage was
8887 exhausted.
8888 (yyexpandGLRStack): Add more checks for storage allocation failure.
8889 Use yyStackOverflow to report failures.
8890 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
8891 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
8892 Don't assume stack number fits in int.
8893 (yysplitStack): Check for storage allocation failure.
8894 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
8895 can print diagnostics on storage allocation failure. All callers
8896 changed.
8897 (yyresolveValue): Use yybool for boolean.
8898 (yyreportSyntaxError): Check for size-calculation overflow.
8899 This code is taken from yacc.c.
8900 (yyparse): Check for storage allocation errors when allocating
8901 the initial stack.
8902
89032005-07-05 Akim Demaille <akim@epita.fr>
8904
8905 Extract calc++ from the documentation.
8906 * doc/bison.texinfo (Calc++): Add the extraction marks.
8907 * examples/extexi: New, from the aborted GNU Programming 2E.
8908 Separate the different paragraph of a file with empty lines.
8909 * examples/Makefile: Use it to extract the whole calc++ example.
8910
89112005-06-24 Akim Demaille <akim@epita.fr>
8912
8913 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
8914 class typedefs.
8915
89162005-06-22 Akim Demaille <akim@epita.fr>
8917
8918 * doc/bison.texinfo (C++ Language Interface): First stab.
8919 (C++ Parsers): Remove.
8920
89212005-06-22 Akim Demaille <akim@epita.fr>
8922
8923 * data/lalr1.cc (yylex_): Honor %lex-param.
8924
89252005-06-22 Akim Demaille <akim@epita.fr>
8926
8927 Start a set of simple examples.
8928 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
8929 * examples/calc++/calc++-driver.hh,
8930 * examples/calc++/calc++-parser.yy,
8931 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
8932 * examples/calc++/compile, examples/calc++/test: New.
8933
89342005-06-09 Paul Eggert <eggert@cs.ucla.edu>
8935
8936 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
8937 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
8938 which stems from the 2005-05-27 patch.
8939
89402005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8941
8942 * data/glr.c: Modify treatment of unused parameters to permit use
8943 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
8944
89452005-05-30 Paul Eggert <eggert@cs.ucla.edu>
8946
8947 Fix infringement on user name space reported by Janos Zoltan Szabo.
8948 * data/yacc.c (yyparse): strlen -> yystrlen.
8949
89502005-05-30 Akim Demaille <akim@epita.fr>
8951
8952 * data/lalr1.cc (_): New.
8953 Translate the various messages.
8954
89552005-05-27 Paul Eggert <eggert@cs.ucla.edu>
8956
8957 Fix infringement on user name space reported by Bruno Haible.
8958 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
8959 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
8960 the user's name space.
8961 (alloca): Include <stdlib.h> to get it, if it's not built in.
8962 (YYMALLOC, YYFREE): Define only if needed.
8963 (malloc, free): Declare, but only if needed, as this infringes on
8964 the user name space.
8965
89662005-05-25 Paul Eggert <eggert@cs.ucla.edu>
8967
8968 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
8969 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
8970 with %d format.
8971 * lib/ebitset.c (min, max): Undef before defining.
8972 * lib/vbitset.c (min, max): Likewise.
8973 * lib/subpipe.c (create_subpipe): Save local variables in case
8974 vfork clobbers them.
8975
89762005-05-24 Bruno Haible <bruno@clisp.org>
8977
8978 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
8979 error message syntax used by gcc-4.0.
8980
89812005-05-23 Paul Eggert <eggert@cs.ucla.edu>
8982
8983 * README: Mention m4 1.4.3. Remove obsolete advice about
8984 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
8985
8986 * bootstrap: Remove workaround for problem I encountered with
8987 gettext 0.14.1; it seems to be fixed now.
8988
89892005-05-22 Paul Eggert <eggert@cs.ucla.edu>
8990
8991 * NEWS: Version 2.0a.
8992
8993 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
8994 the previous change.
8995
8996 Various maintainer cleanups.
8997 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
8998 conftest*, for benefit of CVS commands run at the same time as
8999 "configure". Add build-aux, since "bootstrap" now creates it and
9000 its subfiles.
9001 * Makefile.cfg (move_if_change): Remove.
9002 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
9003 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
9004 (po_repo, do-po-update, po-update, wget_files, get-targets):
9005 (config.guess-url_prefix, config.sub-url_prefix):
9006 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
9007 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
9008 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
9009 Remove.
9010 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
9011 this is now the recommended name.
9012 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
9013 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
9014 ylwrap. These files now go into build-aux.
9015 * config/move-if-change: Remove.
9016 * config/prev-version.txt: Bump from 1.75 to 2.0.
9017
9018 * bootstrap: Add stdio-safer, unistd-safer modules.
9019 Remove m4/glibc2.m4 (introduced by latest gnulib, but
9020 we don't need it).
9021 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
9022 fopen-safer.c, stdio-safer.h, unistd-safer.h.
9023 * lib/subpipe.c: Include "unistd-safer.h".
9024 (create_subpipe): Make sure all the newly-created
9025 file descriptors are > 2, so that diagnostics don't
9026 get sent down them (which might cause Bison to hang, in theory).
9027 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
9028 * src/files.c (xfopen): Use fopen_safer, not fopen.
9029
9030 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
9031 yesterday's yacc.c fix.
9032
90332005-05-21 Paul Eggert <eggert@cs.ucla.edu>
9034
9035 * data/glr.c, data/lalr1.cc: Update copyright date.
9036
9037 Fix a destructor bug reported by Wolfgang Spraul in
9038 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
9039 * data/yacc.c (yyabortlab): Don't call destructor, and
9040 don't set yychar to EMPTY.
9041 (yyoverflowlab): Don't call destructor.
9042 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
9043 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
9044 since we no longer output the message "discarding lookahead token
9045 end of input ()".
9046
90472005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9048
9049 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
9050 fix a small glitch in debugging output.
9051 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
9052 after YY_SYMBOL_PRINT where needed.
9053
9054 (struct yyGLRState): Add some comments.
9055 (struct yySemanticOption): Add some comments.
9056 (union yyGLRStackItem): Add comment.
9057
9058 (yymergeOptionSets): Correct this to properly perform the union,
9059 avoiding infinite reported by Michael Rosien.
9060 Update comment.
9061
9062 * tests/glr-regression.at: Add test for GLR merging error reported
9063 by M. Rosien.
9064
90652005-05-13 Paul Eggert <eggert@cs.ucla.edu>
9066
9067 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
9068 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
9069 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
9070 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
9071 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
9072 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
9073 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
9074 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
9075 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
9076 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
9077 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
9078 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
9079 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
9080 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
9081 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
9082 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
9083 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
9084 src/derives.h, src/files.c, src/files.h, src/getargs.c,
9085 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
9086 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
9087 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
9088 src/output.h, src/parse-gram.c, src/parse-gram.h,
9089 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
9090 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
9091 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
9092 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
9093 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
9094 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
9095 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
9096 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
9097 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
9098 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
9099 tests/reduce.at, tests/regression.at, tests/sets.at,
9100 tests/synclines.at, tests/testsuite.at, tests/torture.at:
9101 Update FSF postal mail address.
9102
91032005-05-11 Paul Eggert <eggert@cs.ucla.edu>
9104
9105 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
9106 Problem reported by Ralf Menzel.
9107
91082005-05-01 Paul Eggert <eggert@cs.ucla.edu>
9109
9110 * tests/actions.at: Test that stack overflow invokes destructors.
9111 From Marcus Holland-Moritz.
9112 * data/yacc.c (yyerrlab): Move the code that destroys the stack
9113 from here....
9114 (yyreturn): to here. That way, destructors are called properly
9115 even if the stack overflows, or the user calls YYACCEPT or
9116 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
9117 (yyoverflowlab): Destroy the lookahead.
9118
91192005-04-24 Paul Eggert <eggert@cs.ucla.edu>
9120
9121 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
9122
91232005-04-17 Paul Eggert <eggert@cs.ucla.edu>
9124
9125 * NEWS: Bison-generated C parsers no longer quote literal strings
9126 associated with tokens.
9127 * src/output.c (prepare_symbols): Don't escape strings,
9128 since users don't want to see C escapes.
9129 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
9130 in diagnostics.
9131 * tests/input.at (Torturing the Scanner): Likewise.
9132 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
9133
91342005-04-16 Paul Eggert <eggert@cs.ucla.edu>
9135
9136 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
9137 the data size is known to be too small and we can't increase it.
9138 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
9139
91402005-04-15 Paul Eggert <eggert@cs.ucla.edu>
9141
9142 * src/parse-gram.y: Include quotearg.h.
9143 (string_as_id): Quote $1 before using it as a key, since the
9144 lexer no longer quotes it for us.
9145 (string_content): Don't strip quotes, since lexer no longer
9146 quotes it for us.
9147 * src/scan-gram.l: Include quotearg.h.
9148 ("\""): Omit quote.
9149 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
9150 a key, since the rest of the lexer doesn't quote it.
9151 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
9152 * tests/regression.at (Token definitions): Check for backslashes
9153 in token strings.
9154
9155 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
9156 (YYSIZE_T): Define to unsigned long int when using an older compiler.
9157 (yyparse): Revamp code to generate long syntax error message, to
9158 make it easier to translate, and to avoid problems with arithmetic
9159 overflow. Change "virtual memory" to "memory" in diagnostic, since
9160 we don't know whether the memory is virtual.
9161
91622005-04-13 Paul Eggert <eggert@cs.ucla.edu>
9163
9164 * NEWS: Bison-generated C parsers now use the _ macro to
9165 translate strings.
9166 * data/yacc.c (_) [!defined _]: New macro.
9167 All English strings wrapped inside this macro.
9168 * doc/bison.texinfo (Bison Parser): Document _.
9169 * po/POTFILES.in: Include src/parse-gram.c, since it now
9170 includes translateable strings that parse-gram.y doesn't.
9171
91722005-04-12 Paul Eggert <eggert@cs.ucla.edu>
9173
9174 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
9175 reverting the 2004-10-11 change to this function.
9176 (symbol_check_alias_consistency): Don't call symbol_type_set
9177 if the type name is already correct.
9178 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
9179
91802005-03-25 Paul Eggert <eggert@cs.ucla.edu>
9181
9182 * tests/regression.at (Token definitions): Don't use a token named
9183 c, as that generates a "#define c ..." that runs afoul of buggy
9184 stdlib.h that uses the identifier c as a member of struct
9185 drand48_data. Problem reported by Horst Wente.
9186
91872005-03-21 Paul Eggert <eggert@cs.ucla.edu>
9188
9189 * bootstrap: Change translation URL from
9190 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
9191 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
9192 redirection glitches. Problem reported by twlevo@xs4all.nl.
9193
91942005-03-20 Paul Eggert <eggert@cs.ucla.edu>
9195
9196 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
9197 after operands; POSIX says this isn't portable for the c99 command.
9198
91992005-03-18 Paul Eggert <eggert@cs.ucla.edu>
9200
9201 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
9202 immediately if a data overrun has occurred; this may help us track
9203 down what may be a spurious failure on MacOS.
9204
92052005-03-17 Paul Eggert <eggert@cs.ucla.edu>
9206
9207 Respond to problems reported by twlevo@xs4all.nl.
9208
9209 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
9210
9211 * src/vcg.h: Comment fix.
9212 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
9213 (G_CMAX): Change to -1 instead of INT_MAX.
9214
9215 * data/yacc.c (yyparse): Omit spaces before #line.
9216
92172005-03-15 Paul Eggert <eggert@cs.ucla.edu>
9218
9219 * src/tables.c (state_number_to_vector_number): Put it inside an
9220 "#if 0", since it's not currently used. Problem reported by
9221 Roland McGrath.
9222
92232005-03-06 Paul Eggert <eggert@cs.ucla.edu>
9224
9225 * src/output.c (escaped_output): Renamed from
9226 escaped_file_name_output, since we now use it for symbol tags as
9227 well. All uses changed.
9228 (symbol_destructors_output, symbol_printers_output):
9229 Escape symbol tags too.
9230 Problem reported by Matyas Forstner in
9231 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
9232
9233 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
9234 not needed.
9235 * src/output.c (user_actions_output, token_definitions_output,
9236 symbol_destructors_output, symbol_printers_output): Likewise.
9237 * src/reader.c (prologue_augment): Likewise.
9238 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
9239
9240 * src/vcg.c (output_edge): Don't quote linestyle arg.
9241 Problem reported by twlevo@xs4all.nl.
9242
92432005-02-28 Paul Eggert <eggert@cs.ucla.edu>
9244
9245 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
9246 example, reported by Derek M Jones. Also, make the example even
9247 more outrageous, to better illustrate how bad the problem is.
9248
92492005-02-24 Paul Eggert <eggert@cs.ucla.edu>
9250
9251 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
9252 putsym. Typo reported by Sebastian Piping.
9253
92542005-02-23 Paul Eggert <eggert@cs.ucla.edu>
9255
9256 * doc/bison.texinfo (Language and Grammar): some -> same
9257 (Epilogue): int he -> in the
9258 Typos reported by Sebastian Piping via Justin Pence.
9259
92602005-02-07 Paul Eggert <eggert@cs.ucla.edu>
9261
9262 * tests/glr-regression.at (Improper handling of embedded actions
9263 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
9264 embedded actions and $-N in GLR parsers", work around an Autoconf bug
9265 with dollar signs in test names.
9266 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
9267 for a similar reason.
9268
92692005-01-28 Paul Eggert <eggert@cs.ucla.edu>
9270
9271 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
9272 wants to redefine G_VIEW.
9273
92742005-01-27 Paul Eggert <eggert@cs.ucla.edu>
9275
9276 * src/vcg.c (get_view_str): Remove case for normal_view.
9277 Problem reported by twlevo@xs4all.nl.
9278
92792005-01-24 Paul Eggert <eggert@cs.ucla.edu>
9280
9281 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
9282 Problem reported by twlevo@xs4all.nl.
9283
9284 * doc/bison.texinfo: Change @dircategory from "GNU programming
9285 tools" to "Software development". Requested by Richard Stallman
9286 via Karl Berry.
9287
92882005-01-23 Paul Eggert <eggert@cs.ucla.edu>
9289
9290 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
9291 Problem reported by twlevo@xs4all.nl.
9292
92932005-01-21 Paul Eggert <eggert@cs.ucla.edu>
9294
9295 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
9296 keyword; it's not needed with modern compilers, and it doesn't
9297 affect correctness with older compilers. Suggested by
9298 twlevo@xs4all.nl.
9299
93002005-01-17 Paul Eggert <eggert@cs.ucla.edu>
9301
9302 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
9303 gcc -Wswitch-default.
9304 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9305 * data/yacc.c (yyparse): Likewise.
9306
93072005-01-12 Paul Eggert <eggert@cs.ucla.edu>
9308
9309 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
9310 already. Let config.h define any nonstandard values.
9311
93122005-01-10 Paul Eggert <eggert@cs.ucla.edu>
9313
9314 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
9315 for the benefit of slower hosts. Problem reported by
9316 Nelson H. F. Beebe.
9317
93182005-01-07 Paul Eggert <eggert@cs.ucla.edu>
9319
9320 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
9321 being defined and not used.
9322 * data/lalr1.cc (yyparse): Likewise.
9323 Use "if (false)" rather than "if (0)".
9324
93252005-01-05 Paul Eggert <eggert@cs.ucla.edu>
9326
9327 * TODO: Mention that we should allow NUL bytes in tokens.
9328
93292005-01-02 Paul Eggert <eggert@cs.ucla.edu>
9330
9331 * src/scan-skel.l (<<EOF>>): Don't close standard output.
9332 Problem reported by Hans Aberg.
9333
93342005-01-01 Paul Eggert <eggert@cs.ucla.edu>
9335
9336 * src/getargs.c (version): Happy new year; update overall
9337 program copyright date from 2004 to 2005.
9338
9339 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
9340 Problem reported by Hans Aberg.
9341 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
9342 (Output file names.): Add a test for the case when standard output
9343 is closed.
9344
93452004-12-26 Paul Eggert <eggert@cs.ucla.edu>
9346
9347 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
9348 to fix an oversight in the Bison 2.0 manual.
9349
93502004-12-25 Paul Eggert <eggert@cs.ucla.edu>
9351
9352 * NEWS: Version 2.0. Reformat the existing news items since
9353 1.875, so that related items are grouped together.
9354 * configure.ac (AC_INIT): Bump version to 2.0.
9355 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
9356
9357 * tests/torture.at (Exploding the Stack Size with Alloca): Set
9358 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
9359 otherwise, we're not testing alloca. Unfortunately there's no
9360 simple way to consult HAVE_ALLOCA here.
9361
9362 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
9363 for yymsg, too.
9364
9365 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
9366 hand. This avoids a warning about comparing int to size_t when
9367 GCC warnings are enabled.
9368
93692004-12-22 Paul Eggert <eggert@cs.ucla.edu>
9370
9371 * NEWS: Bison-generated parsers no longer default to using the
9372 alloca function (when available) to extend the parser stack, due
9373 to widespread problems in unchecked stack-overflow detection.
9374 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
9375 responsibility to set it to a positive value. This lets the user
9376 specify a value that is not a preprocessor constant.
9377 * data/yacc.c (YYMAXDEPTH): Likewise.
9378 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
9379 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
9380 to be a compile-time constant. However, explain the constraints on it.
9381 Also, explain the constraints on YYINITDEPTH.
9382 (Table of Symbols): Explain that alloca is no longer the default.
9383 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
9384 to 1.
9385
9386 * doc/bison.texinfo (Location Default Action): Mention that n must
9387 be zero when k is zero. Suggested by Frank Heckenbach.
9388
93892004-12-22 Akim Demaille <akim@epita.fr>
9390
9391 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
9392 (parser::state_type, parser::semantic_type, parser::location_type):
9393 Private, not public.
9394 (parser::parse): Return ints, not bool.
9395 Returning a bool introduces a problem: 0 corresponds to false, and
9396 it seems weird to return false on success. Returning true changes
9397 the conventions for yyparse.
9398 Alternatively we could return void and send an exception.
9399 There is no clear consensus (yet?).
9400 (state_stack, semantic_stack, location_stack): Rename as...
9401 (state_stack_type, semantic_stack_type, location_stack_type): these.
9402 Private, not public.
9403 * tests/c++.at: New.
9404 * tests/testsuite.at, tests/Makefile.am: Adjust.
9405
94062004-12-21 Akim Demaille <akim@epita.fr>
9407
9408 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
9409
94102004-12-21 Akim Demaille <akim@epita.fr>
9411
9412 Don't impose std::string for filenames.
9413
9414 * data/lalr1.cc (b4_filename_type): New.
9415 (position::filename): Use it.
9416 (parser.hh): Move the inclusion of stack.hh and location.hh below
9417 the user code, so that needed headers for the filename type can be
9418 included first.
9419 Forward declare them before the user code.
9420 * tests/Makefile.am (check-local, installcheck-local): Pass
9421 TESTSUITEFLAGS to the TESTSUITE.
9422
94232004-12-20 Akim Demaille <akim@epita.fr>
9424
9425 Use more STL like names: my_class instead of MyClass.
9426
9427 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
9428 (SemanticStack, SemanticType, StateStack, StateType)
9429 (TokenNumberType, Stack, Slice, Traits, Parser::location)
9430 (Parser::value): Rename as...
9431 (location_stack, location_type, rhs_number_type, semantic_stack)
9432 (semantic_type, state_stack, state_type, token_number_type, stack)
9433 (slice, traits, parser::yylloc, parser::yylval): these.
9434
9435 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
9436
94372004-12-19 Paul Eggert <eggert@cs.ucla.edu>
9438
9439 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
9440 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9441
94422004-12-17 Paul Eggert <eggert@cs.ucla.edu>
9443
9444 Remove uses of 'short int' and 'unsigned short int'. This raises
9445 some arbitrary limits. It uses more memory but nowadays that's
9446 not much of an issue.
9447
9448 This change does not affect the generated parsers; that's a different
9449 task, as some users will want to conserve memory there.
9450
9451 Ideally we should use size_t to represent all object counts, and
9452 something like ptrdiff_t to represent signed differences of object
9453 counts; but that will require more code-cleanup than I have the
9454 time to do right now.
9455
9456 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
9457 Use size_t, not int or short int, to count objects.
9458 * src/closure.c (nritemset, closure): Likewise.
9459 * src/closure.h (nritemset, closure): Likewise.
9460 * src/nullable.c (nullable_compute): Likewise.
9461 * src/print.c (print_core): Likewise.
9462 * src/print_graph.c (print_core): Likewise.
9463 * src/state.c (state_compare, state_hash): Likewise.
9464 * src/state.h (struct state): Likewise.
9465 * src/tables.c (default_goto, goto_actions): Likewise.
9466
9467 * src/gram.h (rule_number, rule): Use int, not short int.
9468 * src/output.c (prepare_rules): Likewise.
9469 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
9470 errs, reductions): Likewise.
9471 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
9472 Likewise.
9473 * src/tables.c (vector_number, tally, action_number,
9474 ACTION_NUMBER_MINIMUM): Likewise.
9475 * src/output.c (muscle_insert_short_int_table): Remove.
9476
94772004-12-17 Akim Demaille <akim@epita.fr>
9478
9479 * data/lalr1.cc: Extensive Doxygenation.
9480 (error_): Rename as...
9481 (error): this, since it is visible to the user.
9482 Adjust callers.
9483 (Parser::message): Now an automatic variable from...
9484 (Parser::yyreport_syntax_error_): here.
9485 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
9486 Parser::error.
9487 * tests/input.at: Escape $.
9488
94892004-12-16 Paul Eggert <eggert@cs.ucla.edu>
9490
9491 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
9492 Parenthesize rhs to avoid obscure problems with mistakes like
9493 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
9494 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9495 b4_rhs_location): Likewise.
9496 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9497 b4_rhs_location): Likewise.
9498
94992004-12-16 Akim Demaille <akim@epita.fr>
9500
9501 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
9502 yacc.c: be sure to stay within yycheck_.
9503 * tests/actions.at: Re-enable C++ tests.
9504
95052004-12-16 Akim Demaille <akim@epita.fr>
9506
9507 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
9508 real.
9509
95102004-12-16 Akim Demaille <akim@epita.fr>
9511
9512 Use #define to handle the %name-prefix.
9513
9514 * data/glr.c, data/yacc.c: Comment changes.
9515 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
9516 so that one can refer to yylex in the parser file, and have it
9517 renamed, as is the case with other skeletons.
9518
95192004-12-16 Akim Demaille <akim@epita.fr>
9520
9521 Move lalr1.cc internals into yy*.
9522
9523 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
9524 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
9525 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
9526 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
9527 (empty_, final_, terror_, errcode_, ntokens_)
9528 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
9529 (looka_, ilooka_, error_range_, nerrs_):
9530 Rename as...
9531 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
9532 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
9533 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
9534 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
9535 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
9536 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
9537 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
9538 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
9539 these.
9540
95412004-12-15 Paul Eggert <eggert@cs.ucla.edu>
9542
9543 Fix some problems reported by twlevo at xs4all.
9544 * src/symtab.c (symbol_new): Report an error if the input grammar
9545 contains too many symbols. This is better than calling abort() later.
9546 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
9547 (struct node, struct graph):
9548 Rename member expand to stretch. All uses changed.
9549 (struct graph): Remove member layoutalgorithm. All uses removed.
9550 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
9551 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
9552 All uses changed.
9553 (N_STRETCH): Rename from N_EXPAND. All uses changed.
9554
95552004-12-15 Akim Demaille <akim@epita.fr>
9556
9557 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
9558 Add more Doxygen comments.
9559 (symprint_, stack_print_, reduce_print_, destruct_, pop)
9560 (report_syntax_error_, translate_): Rename as...
9561 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
9562 (yypop_, yyreport_syntax_error_, yytranslate_): this.
9563
95642004-12-15 Akim Demaille <akim@epita.fr>
9565
9566 * data/lalr1.cc (lex_): Rename as...
9567 (yylex_): this.
9568 Move the trace here.
9569 Take the %name-prefix into account.
9570 Reported by Alexandre Duret-Lutz.
9571
95722004-12-15 Akim Demaille <akim@epita.fr>
9573
9574 Simplify the C++ parser constructor.
9575
9576 * data/lalr1.cc (debug_): Rename as...
9577 (yydebug_): so that the parser's internals are always in the yy*
9578 pseudo namespace.
9579 Adjust uses.
9580 (b4_parse_param_decl): Remove the leading comma as it is now only
9581 called as unique argument list.
9582 (Parser::Parser): Remove the constructor accepting a location and
9583 an initial debugging level.
9584 Remove from the other ctor the argument for the debugging level.
9585 (debug_level_type, debug_level, set_debug_level): New.
9586
9587 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
9588 constructor calls.
9589
95902004-12-15 Akim Demaille <akim@epita.fr>
9591
9592 Remove b4_root related material: failure experiment
9593 (which goal was to allow to derive from a class).
9594
9595 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
9596 definitions and uses.
9597
95982004-12-14 Paul Eggert <eggert@cs.ucla.edu>
9599
9600 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
9601 not 2, since it's not portable to subtract 1 from the start of an
9602 array. The new item 0 is never set or used. All uses changed.
9603
9604 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
9605 the default definition of YYLLOC_DEFAULT. Problem reported
9606 by Frank Heckenbach.
9607
96082004-12-12 Paul Eggert <eggert@cs.ucla.edu>
9609
9610 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
9611 the normal case and one for the error case. Just use the
9612 first one uniformly. Problem reported by Frank Heckenbach.
9613 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
9614 use exactly the same macro in both places.
9615 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
9616 so that the normal-case YYRHSLOC works for the error case too.
9617 All uses changed.
9618 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
9619 (YYLLOC_DEFAULT): Use the same macro as glr.c.
9620 * doc/bison.texinfo (Location Default Action): Don't claim that
9621 we have an array of locations. Use the same macro for both glr
9622 and lalr parsers. Mention YYRHSLOC. Mention what happens when
9623 the index is 0.
9624
96252004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9626
9627 * HACKING: Update email addresses to send announcements to.
9628
9629 * configure.ac (AC_INIT): Bump version to 1.875f.
9630
96312004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9632
9633 * NEWS: Version 1.875e.
9634 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
9635
9636 * src/scan-skel.l: Include "complain.h", for "fatal".
9637
9638 * src/relation.h (relation_print, relation_digraph):
9639 Relation sizes are of type relation_node, not size_t (this is
9640 merely a doc fix, since the two types are equivalent).
9641 (relation_transpose): Relation sizes are of type relation_node,
9642 not int.
9643 * src/relation.c: Likewise.
9644 (top, infinity): Now of type relation_node, not int.
9645 (traverse, relation_transpose): Use relation_node, not int.
9646
9647 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
9648 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
9649 (yyparse): Remove unused local introduced in 2004-10-25 patch.
9650
9651 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
9652 specifying whether the test should be skipped. Use it tp
9653 specify that the [%defines %skeleton "lalr1.cc"] tests currently
9654 fail on some hosts, and should be skipped.
9655
96562004-12-08 Paul Eggert <eggert@cs.ucla.edu>
9657
9658 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
9659 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
9660 unless otherwise specified below.
9661
9662 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
9663 to allocate kernel_base, kernel_items, kernel_size, since
9664 they needn't be initialized to 0.
9665 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
9666 * src/closure.c (new_closure): Likewise, for itemset.
9667 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
9668 * src/lalr.c (set_goto_map): Likewise, for temp_map.
9669 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
9670 (build_relations): Likewise for edge, states1, includes.
9671 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
9672 * src/reader.c (packgram): Likewise, for ritem, rules.
9673 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
9674 * src/relation.c (relation_digraph): Likewise for VERTICES.
9675 (relation_transpose): Likewise for new_R, end_R.
9676 * src/symtab.c (symbols_token_translations_init): Likewise for
9677 token_translations.
9678 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
9679 (token_actions): Likewise for yydefact, actrow, conflrow,
9680 conflict_list.
9681 (save_column): Likewise for froms[symno], tos[symno].
9682 (goto_actions): Likewise for state_count.
9683 (pack_table): Likewise for base, pos, check.
9684 (tables_generate): Likewise for width.
9685
9686 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
9687 for initial core. Just have a separate core, so we needn't worry
9688 about whether kernel_size and kernel_base are initialized.
9689
9690 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
9691 kernel_size, kernel_items): Remove unnecessary initialization.
9692 * src/conflicts.c (conflicts): Likewise.
9693 * src/derives.c (derives): Likewise.
9694 * src/muscle_tablc (muscle_insert): Likewise.
9695 * src/relation.c (relation_digraph): Likewise.
9696 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
9697 conflrow, conflict_table, conflict_list, table, check):
9698 Likewise.
9699
9700 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
9701 This is because all callers pass unsigned int.
9702 * src/closure.h (new_closure): Likewise.
9703
9704 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
9705 (build_relations): Initialize includes[i] in all cases.
9706 * src/reader.c (packgram): Always initialize rules[ruleno].prec
9707 and rules[ruleno].precsym. Initialize members in order.
9708 * src/relation.c (relation_transpose): Always initialize new_R[i]
9709 and end_R[i].
9710 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
9711
9712 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
9713 conflict_list[0] was always 0, but now it isn't initialized.
9714
9715 * src/table.c (table_grow): When conflict_table grew, the grown
9716 area wasn't cleared. Fix this.
9717
9718 * lib/.cvsignore: Add strdup.c, strdup.h.
9719 * m4/.cvsignore: Add strdup.m4.
9720
97212004-12-07 Paul Eggert <eggert@cs.ucla.edu>
9722
9723 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
9724 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
9725 GOTO_NUMBER_MAXIMUM, since we occasionally compute
9726 ngotos + 1 without checking for overflow.
9727 (build_relations): Use END_NODE, not -1, to denote end of edges.
9728 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
9729 build_relations): Use goto_number, not int, for goto numbers.
9730 * src/tables.c (save_column, default_goto): Likewise.
9731
97322004-11-23 Akim Demaille <akim@epita.fr>
9733
9734 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
9735 of #defining from yystype.
9736 Don't typedef yystype, C++ does not need it.
9737 This lets it possible to forward declare it as union.
9738
97392004-11-23 Paul Eggert <eggert@cs.ucla.edu>
9740
9741 * bootstrap (gnulib_modules): Add extensions.
9742 Problem reported by Jim Meyering.
9743
97442004-11-22 Paul Eggert <eggert@cs.ucla.edu>
9745
9746 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
9747 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
9748 src/system.h, src/tables.c: XFREE -> free, to accommodate
9749 recent change to gnulib xalloc.h.
9750 Problem reported by Jim Meyering.
9751
97522004-11-17 Akim Demaille <akim@epita.fr>
9753
9754 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
9755
97562004-11-17 Akim Demaille <akim@epita.fr>,
9757 Alexandre Duret-Lutz <adl@gnu.org>
9758
9759 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
9760 changes.
9761 (YYCDEBUG): Adjust.
9762 Use it instead of cdebug_.
9763 (Parser::debug_stream, Parser::set_debug_stream): New.
9764 (Parser::symprint_): Define cdebug_ for temporary backward
9765 compatibility.
9766 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
9767 debug_stream ().
9768
97692004-11-17 Akim Demaille <akim@epita.fr>
9770
9771 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
9772 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
9773 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
9774 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9775
97762004-10-27 Paul Eggert <eggert@cs.ucla.edu>
9777
9778 * data/glr.c (yyloc_default): Remove; not used.
9779 Problem reported by Frank Heckenbach.
9780
97812004-10-25 Akim Demaille <akim@epita.fr>
9782
9783 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
9784 Introduce another definition to address simple location arrays.
9785 (yyGLRStack): New member: yyerror_range.
9786 (yyrecoverSyntaxError, yyparse): Update it.
9787 (yyrecoverSyntaxError): Use it when shifting the error token to
9788 have an accurate range, equivalent to the one computed by both
9789 yacc.c and lalr1.cc.
9790 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
9791 that column numbers start at column 0, as per GNU Coding
9792 Standards, the others tests, and the doc.
9793 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
9794 Adjust to the above change (first column is 0).
9795 And adjust the location of the "<error>", now covering the whole
9796 line.
9797
97982004-10-22 Akim Demaille <akim@epita.fr>
9799 and Paul Eggert <eggert@cs.ucla.edu>
9800
9801 Remove some arbitrary limits on goto numbers and relations.
9802 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
9803 initial values, since they're never used.
9804 (set_goto_map): ngotos is now unsigned, so test for overflow
9805 by seeing whether it wraps around to zero.
9806 * src/lalr.h (goto_number): Now size_t, not short int.
9807 (GOTO_NUMBER_MAXIMUM): Remove.
9808 * src/relation.c (relation_print, traverse, relation_transpose):
9809 Check for END_NODE rather than looking at sign.
9810 * src/relation.h (END_NODE): New macro.
9811 (relation_node): Now size_t, not short int.
9812
98132004-10-22 Paul Eggert <eggert@cs.ucla.edu>
9814
9815 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
9816 keyword, not an identifier. Problem reported by Baron Schwartz in
9817 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
9818
98192004-10-11 Akim Demaille <akim@epita.fr>
9820
9821 * src/symtab.c (symbol_check_alias_consistency): Also check
9822 type names, destructors, and printers.
9823 Reported by Alexandre Duret-Lutz.
9824 Recode the handling of associativity and precedence in terms
9825 of symbol_precedence_set.
9826 Accept no redeclaration at all, not even equal to the previous
9827 value.
9828 (redeclaration): New.
9829 Use it to factor redeclaration complaints.
9830 (symbol_make_alias): Don't set the type of the alias, let
9831 symbol_check_alias_consistency do it as for other features.
9832 * src/symtab.h (symbol): Add new member prec_location, and
9833 type_location.
9834 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
9835 * tests/input.at (Incompatible Aliases): New.
9836
98372004-10-09 Paul Eggert <eggert@cs.ucla.edu>
9838
9839 .cvsignore fixes to accommodate gnulib changes,
9840 and the practice of naming build directories "_build".
9841 * .cvsignore: Add "_*". Sort.
9842 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
9843 * m4/.cvsignore: Add "*_gl.m4".
9844
98452004-10-06 Akim Demaille <akim@epita.fr>
9846
9847 * src/parse-gram.y (add_param): Fix the truncation of trailing
9848 spaces.
9849
98502004-10-05 Akim Demaille <akim@epita.fr>
9851
9852 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
9853 whether the reducion was empty or not. This leaves room to
9854 improve the use of YYLLOC_DEFAULT in such a case.
9855 lalr1.cc is still experimental, so changing this is acceptable.
9856 And finally, there are probably not many users who changed the
9857 handling of locations in GLR, so changing is admissible too.
9858
9859 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
9860 empty reduction, set @$ to an empty location ending the previously
9861 stacked symbol.
9862 Adjust uses to make sure the code is triggered on empty
9863 reductions.
9864 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
9865 expected output: empty reductions have empty locations.
9866
98672004-09-29 Akim Demaille <akim@epita.fr>
9868
9869 * data/lalr1.cc: Move towards a more standard C++ coding style
9870 for templates: Class < T > -> Class<T>.
9871
98722004-09-29 Akim Demaille <akim@epita.fr>
9873
9874 * data/lalr1.cc: Reinstall the former ctor, for sake of
9875 compatibility, but warn it will be removed.
9876 Move towards a more standard C++ coding style (i.e., type *var ->
9877 type* var).
9878
98792004-09-27 Paul Eggert <eggert@cs.ucla.edu>
9880
9881 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
9882 since it's less likely to work if NULs are involved in the future.
9883
98842004-09-27 Akim Demaille <akim@epita.fr>
9885
9886 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
9887
98882004-09-27 Akim Demaille <akim@epita.fr>
9889
9890 * data/lalr1.cc (b4_parse_param_decl_1): New.
9891 (b4_parse_param_decl): Use it to have different names between attribute
9892 and argument names.
9893 (b4_cc_constructor_call): Likewise.
9894
98952004-09-24 Akim Demaille <akim@epita.fr>
9896
9897 * src/parse-gram.y (add_param): Strip the leading and trailing
9898 blanks from a formal argument declaration.
9899 (YY_LOCATION_PRINT): New.
9900
99012004-09-24 Akim Demaille <akim@epita.fr>
9902
9903 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
9904 after the location.
9905
99062004-09-24 Akim Demaille <akim@epita.fr>
9907
9908 * doc/bison.texinfo (Table of Symbols): Sort.
9909
99102004-09-21 Akim Demaille <akim@epita.fr>
9911
9912 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
9913 the useless parentheses.
9914 Suggested by Paul Eggert.
9915
99162004-09-20 Akim Demaille <akim@epita.fr>
9917
9918 Let the initial-action act on the look-ahead, and use it for the
9919 "initial push" (corresponding to an hypothetical beginning-of-file).
9920 And let lalr1.cc honor %initial-action.
9921
9922 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
9923 example.
9924 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
9925 (Parser::Parser): Remove the ctor that used to initialize it.
9926 (Parser::parse): Like in the other skeletons, issue the "starting
9927 parse" message before any action.
9928 Honor %initial-action.
9929 Initialize the stacks with the lookahead.
9930 * data/yacc.c: Let $$ and @$ in %initial-action designate the
9931 look-ahead.
9932 Push them in the stacks.
9933 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
9934
99352004-09-20 Akim Demaille <akim@epita.fr>
9936
9937 * doc/bison.texinfo (Initial Action Decl): New.
9938
99392004-09-20 Akim Demaille <akim@epita.fr>
9940
9941 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
9942 clearer criterion to define it.
9943 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
9944 When reducing on an empty RHS, use the latest stacked location as
9945 location.
9946 yylloc is not always available.
9947 * data/glr.c: Likewise.
9948 Also, honor initial-actions.
9949
99502004-09-20 Akim Demaille <akim@epita.fr>
9951
9952 * data/yacc.c (YY_LOCATION_PRINT): New.
9953 Define when we know YYLTYPE's structure, i.e., when the default
9954 YYLLOC_DEFAULT is used.
9955 * data/c.m4 (b4_yysymprint_generate): Use it.
9956 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
9957 value of the result.
9958 (error_start_): Replace with...
9959 (error_range_): this location array.
9960 This allows to replace code relying on the implementation of
9961 locations by portable code.
9962 * data/yacc.c (yylerrsp): Replace with...
9963 (yyerror_range): this.
9964 Every time a token is popped, update yyerror_range[0], to have an
9965 accurate location for the error token.
9966 * data/glr.c (YY_LOCATION_PRINT): New.
9967 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
9968 deference a pointer.
9969 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
9970 report the location in %printers.
9971
9972 * src/scan-skel.l: Instead of abort, report error messages to ease
9973 understanding skeleton scanning failures.
9974
99752004-09-16 Akim Demaille <akim@epita.fr>
9976
9977 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
9978 (iterator, const_iterator): these, to be more in the C++ spirit.
9979 Also, return reverse iterators so that when displaying the stack
9980 we display its bottom first.
9981 (Parser::stack_print_, Parser::reduce_print_): Match the messages
9982 from yacc.c.
9983 We should probably use vector here though.
9984
99852004-09-16 Akim Demaille <akim@epita.fr>
9986
9987 Have more complete shift traces.
9988
9989 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
9990 to report Shifts instead of ad hoc YYDPRINTF invocations,
9991 including for the error token.
9992 * data/lalr1.cc (symprint_): Output the location.
9993 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
9994 output the location within the %printer.
9995 Activate GLR tests, at least to make sure they compile properly.
9996 They still don't pass though.
9997 * tests/calc.at: Adjust expect verbose output, since now "Entering
9998 state..." is on a different line than the "Shifting" message.
9999
100002004-09-08 Akim Demaille <akim@epita.fr>
10001
10002 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
10003 Bison directive from the Bison file to the invocation of this
10004 macro, so that these directives are passed to
10005 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
10006 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
10007 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
10008 the extra Bison directives instead of the whole series.
10009 Change the grammar so that there are recoverable errors, and
10010 unrecoverable errors. Now we can have the parser give up before
10011 consuming the whole input. As a result we now can observe that
10012 the lookahead is freed when needed.
10013 Change the parser source to parse argv[1] instead of a hard coded
10014 string.
10015 Simplify yylex, and give a value and location to EOF.
10016 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
10017 passed directives already coded in the file.
10018 Add some tests to check the location of "error".
10019 For some tests, the C++ parser is correct, and not yacc.c.
10020 For other tests, they provide different, but unsatisfying, values,
10021 so keep the C++ value so that at least one parser is "correct"
10022 according to the test suite.
10023 (Actions after errors): Remove, this is subsumed by the
10024 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
10025
100262004-09-06 Akim Demaille <akim@epita.fr>
10027
10028 * data/lalr1.cc: Adjust the indentation of the labels.
10029 (Parser::pop): New.
10030 Use it.
10031
100322004-09-06 Akim Demaille <akim@epita.fr>
10033
10034 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
10035 argument, an informative message.
10036 Call YY_SYMBOL_PRINT.
10037 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
10038 * data/lalr1.cc (destruct_): Likewise.
10039 In addition, no longer depend on b4_yysymprint_generate and
10040 b4_yydestruct_generate to generate these functions, do it "by
10041 hand".
10042
100432004-09-03 Akim Demaille <akim@epita.fr>
10044
10045 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
10046 invoked, yydestruct the lookahead.
10047 * tests/calc.at (Calculator $1): Update the expected lengths of
10048 traces: there is an added line for the discarded lookahead.
10049 * doc/bison.texinfo (Destructor Decl): Some rewording.
10050 Define "discarded" symbols.
10051
100522004-09-02 Akim Demaille <akim@epita.fr>
10053
10054 * data/lalr1.cc (translate_, destruct_): No reason to be static.
10055
100562004-09-02 Akim Demaille <akim@epita.fr>
10057
10058 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
10059 (YYDSYMPRINTF): Rename as...
10060 (YY_SYMBOL_PRINT): this.
10061 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
10062 two.
10063 Use it instead of direct symprint_ calls.
10064 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
10065 one.
10066
100672004-09-02 Akim Demaille <akim@epita.fr>
10068
10069 * data/lalr1.cc (b4_yysymprint_generate): New.
10070 (symprint_): New member function, defined when YYDEBUG.
10071 Use it consistently instead of token/nterm debugging output by
10072 hand.
10073 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
10074 %printer calls to use cdebug_ when using lalr1.cc.
10075
100762004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
10077
10078 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
10079 with #ifdef YYDEBUG.
10080
100812004-08-26 Akim Demaille <akim@epita.fr>
10082
10083 * doc/bison.texinfo (Implementing Loops): Rename as...
10084 (Implementing Gotos/Loops): this.
10085
100862004-08-13 Paul Eggert <eggert@cs.ucla.edu>
10087
10088 Adjust to latest gnulib.
10089 * bootstrap (gnulib_modules): Add xalloc-die.
10090 Set LC_ALL=C so that file names sort consistently.
10091 Prefer the gnulib copies of gettext.m4, glibc21.m4,
10092 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
10093 uintmax_t.m4, ulonglong.m4.
10094 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
10095 po.m4 since we are now using _gl.m4 instead.
10096
100972004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
10098
10099 * src/scan-action.l: Remove. Scanning of semantic actions is
10100 handled in scan-gram.l.
10101
101022004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
10103
10104 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
10105
10106 * src/location.h (struct): The file member is a uniqstr.
10107 (equal_boundaries): Use UNIQSTR_EQ for comparison.
10108
101092004-07-22 Paul Eggert <eggert@cs.ucla.edu>
10110
10111 Fix bug with non-%union parsers that have printers or destructors,
10112 which led to a Bison core dump. Reported by Peter Fales in
10113 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
10114
10115 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
10116 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
10117 not to our own type.
10118 * src/output.c (symbol_destructors_output, symbol_printers_output):
10119 Don't assume %union.
10120 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
10121 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
10122 UNION-FLAG. All callers changed.
10123 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
10124 Use type char, not unsigned int, when declaring an array of char;
10125 this lets us remove a cast.
10126 (Printers and Destructors): Add non-%union test cases.
10127
101282004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10129
10130 * doc/bison.texinfo: Minor editorial changes, mostly to the new
10131 GLR writeups. E.g., avoid frenchspacing and the future tense,
10132 change "lookahead" to "look-ahead", and change "wrt" to "with
10133 respect to".
10134
101352004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10136
10137 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
10138 New sections, split off from the GLR Parsers section. Put the new
10139 Simple GLR Parser near the start of the GLR section, for clarity.
10140 Rewrite connective text.
10141
101422004-06-21 Frank Heckenbach <frank@g-n-u.de>
10143
10144 * doc/bison.texinfo (Simple GLR Parsers): New section.
10145
101462004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10147
10148 * NEWS, TODO, doc/bison.texinfo:
10149 Use "look-ahead" instead of "lookahead", to be consistent.
10150 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
10151 while we're fixing "look-ahead".
10152 * src/conflicts.c (shift_set): Renamed from shiftset.
10153 (look_ahead_set): Renamed from lookaheadset.
10154 * src/print.c: Likewise.
10155 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
10156 name for "lookahead".
10157 (report_types, usage): Likewise.
10158 * src/getargs.h (report_look_ahead_tokens): Renamed from
10159 report_lookaheads.
10160 * src/lalr.c (compute_look_ahead_tokens): Renamed from
10161 compute_lookaheads.
10162 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
10163 (look_ahead_tokens_print): Renamed from lookaheads_print.
10164 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
10165 state_rule_lookaheads_print.
10166 * src/state.h: Likewise.
10167 (reductions.look_ahead_tokens): Renamed from lookaheads.
10168 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
10169 AT_DATA_LOOKAHEADS_GRAMMAR.
10170
101712004-06-03 Paul Eggert <eggert@cs.ucla.edu>
10172
10173 * README: Update location of patched M4 distribution.
10174
101752004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
10176
10177 Don't assume the C++ compiler takes the same arguments as the C compiler
10178 (trivial change).
10179 * configure.ac (O0CXXFLAGS): New var.
10180 * tests/atlocal.in (CXXFLAGS): Use it.
10181
101822004-05-29 Paul Eggert <eggert@cs.ucla.edu>
10183
10184 Fix some "make check" problems with C++ reported by
10185 Albert Chin-A-Young for Tru64 C++ in this thread:
10186 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
10187
10188 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
10189 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10190 Output to a .cc file for C++, not to a .c file.
10191 * tests/calc.at (AT_CHECK_CALC): Likewise.
10192 * tests/regression.at (AT_CHECK_DANCER): Likewise.
10193 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
10194
101952004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
10196
10197 * tests/calc.at, tests/actions.at: Workaround for SGI
10198 C++ compiler. (trivial change)
10199
102002004-05-27 Paul Eggert <eggert@cs.ucla.edu>
10201
10202 Spent a few hours checking out which prerequisite versions the
10203 current sources actually require. I went all the way back to
10204 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
10205 a seemingly endless set of combinations of versions more recent
10206 than that. The bottom line is that the current sources require
10207 fairly recent versions of the build tools, and it'll be some work
10208 to change this.
10209 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
10210 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
10211 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
10212 Add comments explaining why those particular versions are
10213 currently needed.
10214
10215 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
10216 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
10217 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
10218
10219 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
10220 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
10221
102222004-05-26 Paul Eggert <eggert@cs.ucla.edu>
10223
10224 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
10225 0.11.5. Suggested by Bruno Haible.
10226 * bootstrap: Remove gettext version checking.
10227
10228 * doc/bison.texinfo (Decl Summary): Also mention that %union
10229 can depend on prerequisite types. Problem reported by Tim
10230 Van Holder.
10231
102322004-05-25 Paul Eggert <eggert@cs.ucla.edu>
10233
10234 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
10235 * README-alpha: Don't tell people not to package this.
10236
10237 * bootstrap: Don't assume $(...) works; use `...` instead.
10238 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
10239 gettext better.
10240
10241 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
10242 put into the -d output file, and mention what to do if YYSTYPE is
10243 defined as a macro.
10244
102452004-05-24 Paul Eggert <eggert@cs.ucla.edu>
10246
10247 Undo change made earlier today: it caused autopoint to not bring
10248 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
10249 autopoint's.
10250
10251 * bootstrap: Check that gettext version matches what's in
10252 configure.ac. Warn users to ignore robots.txt ERROR 404.
10253 * bootstrap: Undo today's earlier change (logged below).
10254 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
10255
10256 The gettext version checking is causing more trouble than it's
10257 curing; remove it. Problem reported by Paul Hilfinger.
10258
10259 * bootstrap: Issue a warning that one can expect a message
10260 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
10261 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
10262
102632004-05-23 Paul Eggert <eggert@cs.ucla.edu>
10264
10265 Ensure that the C++ compiler used for testing actually works on a
10266 simple test program; if not, skip the C++-related tests. Problem
10267 reported by Vin Shelton in:
10268 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
10269
10270 * m4/cxx.m4: New file.
10271 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
10272 * tests/atlocal.in (BISON_CXX_WORKS): Add.
10273 * tests/local.at (AT_COMPILE_CXX): Use it.
10274
102752004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10276
10277 * data/glr.c (yylloc): Output this macro even if locations are not
10278 being generated, as the GLR parser needs it even in that case.
10279 Problem reported by Troy A. Johnson
10280 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
10281
10282 * configure.ac (AC_INIT): Update to 1.875e.
10283
102842004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10285
10286 * NEWS: Version 1.875d.
10287 * configure.ac (AC_INIT): Likewise.
10288 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
10289
10290 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
10291 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
10292 lalr1.cc runs afoul of the first, and the last two are no longer
10293 supported by GCC 3.4.0.
10294 * README: Mention GNU m4 1.4 or later; mention m4 patches.
10295 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
10296
102972004-05-06 Paul Eggert <eggert@cs.ucla.edu>
10298
10299 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
10300 unsigned int, for compatibility with latest gnulib hash module.
10301 * src/state.c (state_hash, state_hasher): Likewise.
10302 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
10303 * src/uniqstr.c (hash_uniqstr): Likewise.
10304
103052004-05-03 Paul Eggert <eggert@cs.ucla.edu>
10306
10307 * NEWS: Unescaped newlines are no longer allowed in char & strings.
10308
10309 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
10310 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
10311 character and string literals.
10312 (unexpected_end): New function.
10313 (unexpected_eof): Use it.
10314 (unexpected_newline): New function.
10315 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
10316 actions.
10317
10318 * NEWS: Document %expect-rr.
10319
10320 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
10321 Fix typo by replacing $1 with $option.
10322 Remove more 'intl'-related files.
10323 Don't DEFUN AM_INTL_SUBDIR twice.
10324
10325 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
10326 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
10327 strtoul.c.
10328 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
10329 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
10330 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
10331 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
10332 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
10333 * src/.cvsignore: Add *.output.
10334
10335 * src/parse-gram.y: Put copyright notice inside %{ %} so it
10336 gets copied to the output file.
10337
103382004-04-28 Paul Eggert <eggert@twinsun.com>
10339
10340 Get files from the gnulib and po repositories, instead of relying
10341 on them being in our CVS. Upgrade to latest versions of gnulib
10342 and Automake.
10343
10344 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
10345 * bootstrap: Bootstrap from gnulib and po repositories.
10346 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
10347 * README-cvs: Document these changes. Remove version numbers from
10348 mentions of build tools, since they change so often. Mention Flex.
10349
10350 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
10351 (gl_USE_SYSTEM_EXTENSIONS): Add.
10352 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
10353 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
10354 does this for us.
10355 (AC_ISC_POSIX): Remove; we no longer support this
10356 ancient OS, as it gets in the way of latest Autoconf & gnulib.
10357 (AC_HEADER_STDC): Remove: we now assume C89 or better.
10358 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
10359 Do not check for C89 headers, except for locale.h which is used
10360 by the Yacc library and must port to K&R hosts.
10361 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
10362 Do not check for C89 functions, except for setlocale which is
10363 used by the Yacc library.
10364 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
10365 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
10366 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
10367 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
10368 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
10369 AM_GNU_GETTEXT): Remove; now done by:
10370 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
10371 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
10372 for us.
10373
10374 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
10375 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
10376 Define to empty, as gnulib.mk will do the rest for us.
10377 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
10378 for us.
10379 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
10380 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
10381
10382 * src/files.c: Include gnulib's xstrndup.h.
10383
10384 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
10385 (REALLOC): Use xnrealloc, for likewise.
10386 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
10387 (strnlen, memrchr): Remove decls; functions no longer used.
10388 Include <stpcpy.h>.
10389
10390 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
10391 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10392 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
10393 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
10394 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
10395 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
10396 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
10397 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
10398 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
10399 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
10400 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
10401 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
10402 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
10403 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
10404 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
10405 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
10406 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
10407 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
10408 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
10409 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
10410 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
10411 Remove, as these files are now generated automatically
10412 by bootstrap or automake.
10413
10414 * po/ChangeLog: Remove: all but one entry was a duplicate
10415 of this file, and I moved that 2000-11-02 entry here.
10416
10417 * config/.cvsignore: Add Makefile, depcomp, install-sh.
10418 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
10419 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
10420 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
10421 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
10422 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
10423 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
10424 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
10425 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
10426 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
10427 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
10428 xstrndup.h.
10429 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
10430 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
10431 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
10432 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
10433 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
10434 * src/.cvsignore: Remove *_.c.
10435
10436
10437 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
10438 support it. (The latest stable gzip doesn't.)
10439
104402004-04-27 Paul Eggert <eggert@twinsun.com>
10441
10442 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
10443 case, as stos_ is now used by destructors due to the 2004-02-09
10444 change.
10445
10446 Remove more K&R C support.
10447 * lib/libiberty.y (PARAMS): Remove. All uses removed.
10448 * lib/subpipe.c (errno): Remove decl.
10449 Include <stdlib.h> unconditionally.
10450 (EXIT_FAILURE): Remove macro.
10451 * src/complain.c (vfprintf, strerror): Remove.
10452 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
10453 unconditionally.
10454 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
10455 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
10456 (strchr, strspn, memchr): Remove decls.
10457 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
10458 unconditionally. Do not declare perror.
10459 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
10460 unconditionally.
10461
10462 * src/complain.c (_): Remove useless defn, as system.h defines this.
10463
10464 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
10465 with latest obstack.h.
10466 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
10467 to procedure types, as obstack.h now does that for us.
10468 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
10469
10470 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
10471 so that this include file can stand alone.
10472 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
10473 does this now. Include subpipe.h first after config.h, to
10474 test whether it can stand alone.
10475
10476 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
10477 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
10478 unused declaration.
10479
10480 * tests/synclines.at (%union synch line): Put a dummy member in
10481 the union, because empty unions aren't allowed in C. Caught
10482 by GCC 3.4.0.
10483
104842004-04-13 Jim Meyering <jim@meyering.net>
10485
10486 * src/conflicts.c (conflicts_print): Correct format string typo:
10487 use `%%' to produce literal `%'. (trivial change)
10488
104892004-03-30 Paul Eggert <eggert@twinsun.com>
10490
10491 * src/getargs.c (version): Update copyright year to 2004.
10492
10493 * data/c.m4 (b4_int_type): Use 'short int' rather than
10494 'short', and similarly for 'long', 'unsigned', etc.
10495 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
10496 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
10497 yy_yypstack, yydumpstack): Likewise.
10498 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
10499 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
10500 Likewise.
10501 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
10502 yy_stack_print, yyparse): Likewise.
10503 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
10504 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
10505 * lib/bitset.c (bitset_print): Likewise.
10506 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
10507 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10508 * lib/bitsetv.c (bitsetv_dump): Likewise.
10509 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
10510 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
10511 Likewise.
10512 * src/LR0.c (allocate_itemsets): Likewise.
10513 * src/gram.h (rule_number, rule): Likewise.
10514 * src/lalr.h (goto_number): Likewise.
10515 * src/nullable.c (nullable_compute): Likewise.
10516 * src/output.c (prepare_rules): Likewise.
10517 * src/relation.c (relation_print, relation_digraph): Likewise.
10518 * src/relation.h (relation_node): Likewise.
10519 * src/state.h (state_number, transitions, errs, reductions,
10520 struct state): Likewise.
10521 * src/symtab.h (symbol_number, struct symbol): Likewise.
10522 * src/tables.c (vector_number, tally, action_number,
10523 default_goto, goto_actions): Likewise.
10524 * tests/existing.at (GNU Cim Grammar): Likewise.
10525 * tests/regression.at (Web2c Actions): Likewise.
10526
10527 * src/output.c (muscle_insert_short_int_table): Renamed from
10528 muscle_insert_short_table. All uses changed.
10529
105302004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10531
10532 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
10533 (declaration): Replace expected_conflicts with expected_sr_conflicts.
10534 Add %expect-rr rule.
10535
10536 * src/scan-gram.l: Recognize %expect-rr.
10537
10538 * src/conflicts.h (expected_sr_conflicts): Rename from
10539 expected_conflicts.
10540 (expected_rr_conflicts): Declare.
10541
10542 * src/conflicts.c (expected_sr_conflicts): Rename from
10543 expected_conflicts.
10544 (expected_rr_conflicts): Define.
10545 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
10546 for GLR parsers.
10547 Use expected_sr_conflicts in place of expected_conflicts.
10548 Warn if expected_rr_conflicts used in non-GLR parser.
10549
10550 * doc/bison.texinfo: Add documentation for %expect-rr.
10551
105522004-03-08 Paul Eggert <eggert@gnu.org>
10553
10554 Add support for hex token numbers. Suggested by Odd Arild Olsen in
10555 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
10556
10557 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
10558 in lalr1.cc.
10559 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
10560 * src/scan-gram.l (scan_integer): New function.
10561 ({int}): Use it.
10562 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
10563 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
10564 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
10565 Say "long int", not "long", for uniformity with GNU style.
10566
105672004-02-25 Paul Eggert <eggert@twinsun.com>
10568
10569 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
10570 compilers. This fixes a problem with Intel's C++ compiler being
10571 chatty, reported by Guido Trentalancia in
10572 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
10573
105742004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
10575
10576 Support %destructor and merge error locations in lalr1.cc.
10577
10578 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
10579 (Parser::stos_): Define unconditionally.
10580 (Parser::destruct_): New method. Generate its body with
10581 b4_yydestruct_generate.
10582 (Parser::error_start_): New attribute.
10583 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
10584 token which are discarded.
10585 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
10586 error_start_ when erroneous token are discarded.
10587 (Parser::parse) <yyerrlab1>: Compute the location of the error
10588 token so that it covers all the discarded tokens.
10589 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
10590 it can be called with `%skeleton "lalr1.cc"', and do that.
10591
105922004-02-02 Paul Eggert <eggert@twinsun.com>
10593
10594 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
10595 $(top_srcdir)/lib and ../lib. This fixes a bug reported
10596 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
10597 There's no need to mention top_builddir since Automake does that
10598 for us.
10599 (INCLUDES): Remove, as Automake says it's obsolescent.
10600 Contents migrated into AM_CPPFLAGS as described above.
10601 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
10602
106032004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10604
10605 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
10606 (yyreportSyntaxError): Handle case where lookahead token is
10607 YYEMPTY.
10608
106092004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10610
10611 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
10612 resulting parsers are compilable with C++.
10613
106142003-12-23 Paul Eggert <eggert@twinsun.com>
10615
10616 * config/depcomp, config/install-sh: Sync with Automake 1.8.
10617 * src/output.c (output_skeleton): Rename local var.
10618 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
10619 Bison tokens, as this runs afoul of the 2003-10-07 change that
10620 disallowed NUL bytes in character constants or string literals.
10621
10622 * tests/local.at: Require Autoconf 2.59's Autotest.
10623 * tests/testsuite.at: Don't include local.at, since we now assume
10624 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
10625 including it.
10626 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
10627 multiple inclusion warnings.
10628
106292003-12-02 Akim Demaille <akim@epita.fr>
10630
10631 * doc/bison.texinfo (How Can I Reset the Parser): More about start
10632 conditions.
10633 From Bruno Haible.
10634
106352003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
10636
10637 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
10638
106392003-10-07 Paul Eggert <eggert@twinsun.com>
10640
10641 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
10642 if testsuite doesn't exist.
10643
10644 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
10645 literals, unfortunately.
10646 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
10647 Complain about NUL bytes in character constants or string literals.
10648
106492003-10-05 Paul Eggert <eggert@twinsun.com>
10650
10651 * NEWS: Don't document %no-default-prec, as it's still
10652 too experimental.
10653 * doc/bison.texinfo: Document %no-default-prec only if
10654 the defaultprec flag is set. Normally it's not.
10655
106562003-10-04 Paul Eggert <eggert@twinsun.com>
10657
10658 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
10659 non-modifiable lvalue, instead of a modifiable one.
10660 * doc/bison.texinfo (Actions): Document that $$ can
10661 be assigned to. Do not claim that $$ and $N are
10662 array element references: user code should not rely on this.
10663
106642003-10-01 Paul Eggert <eggert@twinsun.com>
10665
10666 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
10667 (grammar_declaration): Use it.
10668 * src/scan-gram.l: New token %no-default-prec.
10669 * tests/conflicts.at: Revamp tests to use %no-default-prec.
10670 * NEWS, doc/bison.texinfo: Document the above.
10671
106722003-10-01 Akim Demaille <akim@epita.fr>
10673
10674 VCG no longer supports long_straight_phase.
10675
10676 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
10677 * src/print_graph.c (print_graph): Adjust.
10678
106792003-09-30 Frank Heckenbach <frank@g-n-u.de>
10680 and Paul Eggert <eggert@twinsun.com>
10681
10682 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
10683 Table of Symbols): Document %default-prec.
10684 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
10685 (grammar_declaration): Set default_prec on %default-prec.
10686 * src/scan-gram.l (%default-prec): New token.
10687 * src/reader.h (default_prec): New flag.
10688 * src/reader.c: Likewise.
10689 (packgram): Handle it.
10690 * tests/conflicts.at (%default-prec without %prec,
10691 %default-prec with %prec, %default-prec 1): New tests.
10692
106932003-09-30 Paul Eggert <eggert@twinsun.com>
10694
10695 * tests/testsuite.at: Include local.at, not input.at, fixing
10696 a typo in the 2003-08-25 patch.
10697
106982003-08-27 Akim Demaille <akim@epita.fr>
10699
10700 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
10701 GCC warnings.
10702
107032003-08-26 Akim Demaille <akim@epita.fr>
10704
10705 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
10706 "<\#" to avoid magic from Gnus when posting parts of this script.
10707
107082003-08-26 Akim Demaille <akim@epita.fr>
10709
10710 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
10711 (Parser::parse): here.
10712 Adjust: nerrs and errstatus is now replaced by...
10713 (Parser::nerrs_, Parser::errstatus_): New.
10714
107152003-08-25 Akim Demaille <akim@epita.fr>
10716
10717 * config/announce-gen, Makefile.cfg: New.
10718 * Makefile.am: Adjust.
10719 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
10720 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
10721
107222003-08-25 Akim Demaille <akim@epita.fr>
10723
10724 When reducing initial empty rules, Bison parser read an initial
10725 location that is not defined. This results in garbage, and that
10726 affects Bison's own parser. Therefore we need (i) to extend Bison
10727 to support a means to initialize this location, and (ii) to use
10728 this CVS Bison to fix CVS Bison's parser.
10729
10730 * src/reader.h, reader.c (epilogue_augment): Remove, replace
10731 with...
10732 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
10733 * src/parse-gram.y: Adjust.
10734 (%initial-action): New.
10735 (%error-verbose): Since we require CVS Bison, there is no reason
10736 not to use it.
10737 * src/scan-gram.l: Adjust.
10738 * src/Makefile.am (YACC): New, to make sure we use our own parser.
10739 * data/yacc.c (yyparse): Use b4_initial_action.
10740
107412003-08-25 Akim Demaille <akim@epita.fr>
10742
10743 * doc/bison.texinfo: Don't promote stdout for error messages.
10744
107452003-08-25 Akim Demaille <akim@epita.fr>
10746
10747 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
10748 From Alexandre Duret-Lutz.
10749
107502003-08-25 Akim Demaille <akim@epita.fr>
10751
10752 Version 1.875c.
10753
107542003-08-25 Akim Demaille <akim@epita.fr>
10755
10756 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
10757 Use them.
10758
107592003-08-25 Akim Demaille <akim@epita.fr>
10760
10761 * data/lalr1.cc (Parser::reduce_print_): New.
10762 Use it.
10763
107642003-08-25 Akim Demaille <akim@epita.fr>
10765
10766 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
10767 error recovery loops. This patch is based on
10768 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
10769 Also, augment the similarity between lalr1.cc and yacc.c.
10770 Note: the locations of error recovery rules are not correct yet.
10771
10772 * data/lalr1.cc: Comment changes to augment the similarity between
10773 lalr1.cc and yacc.c.
10774 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
10775 (yyerrlab1): Remove, but where it used to be (now the bottom part of
10776 yyerrlab), when hitting EOF, pop the whole stack here instead of
10777 merely falling thru the default error handling mechanism.
10778 (yyerrorlab): New label, with the old contents of YYERROR,
10779 plus the following change: pop the stack of rhs corresponding
10780 to the production that invoked YYERROR. That is how Yacc
10781 behaves (required by POSIX).
10782 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
10783 fail.
10784
107852003-08-25 Akim Demaille <akim@epita.fr>
10786
10787 Tune local.at so that people can "autom4te -l autotest calc.at -o
10788 calc" for instance, to extract a sub test suite.
10789
10790 * tests/testsuite.at: Move the initialization, Autotest version
10791 requirement, and AT_TESTED invocation into...
10792 * tests/local.at: here.
10793 * tests/testsuite.at: Include it for compatibility with Autoconf
10794 2.57.
10795 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
10796 be ignore.
10797
107982003-08-04 Paul Eggert <eggert@twinsun.com>
10799
10800 Rework code slightly to avoid gcc -Wtraditional warnings.
10801 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
10802 The returned value is now stored in *YY0. All callers changed.
10803 * src/output.c (merge_output): Adjust to the above change.
10804
108052003-07-26 Paul Eggert <eggert@twinsun.com>
10806
10807 * data/glr.c (YYASSERT): New macro.
10808 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
10809 yyresolveStates, yyprocessOneStack):
10810 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
10811 Derived from a suggestion by Frank Heckenbach.
10812
108132003-07-25 Paul Eggert <eggert@twinsun.com>
10814
10815 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
10816 for portability to K&R C (after ansi2knr, presumably). See
10817 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
10818 by Frank Heckenbach, though I have omitted the structure-initialization
10819 part of his glr-knr.diff patch since I recall that the Portable
10820 C Compiler didn't require that change.
10821
10822 Let the user specify how to allocate and free memory.
10823 Derived from a suggestion by Frank Heckenbach in
10824 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
10825 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
10826 All uses of free, malloc, realloc changed to use these macros,
10827 and unnecessary casts removed.
10828 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
10829
108302003-07-06 Matthias Mann <MatthiasMann@gmx.de>
10831
10832 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
10833 use s.empty() rather than s == "" to test for empty string; see
10834 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
10835 (trivial change)
10836
108372003-06-25 Akim Demaille <akim@epita.fr>
10838
10839 * config/depcomp, config/install-sh: Update from masters.
10840
108412003-06-20 Paul Eggert <eggert@twinsun.com>
10842
10843 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
10844 and return properly parenthesized result.
10845 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
10846 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10847 Remove unnecessary parentheses from uses.
10848 * doc/bison.texinfo (Location Default Action): Describe the
10849 conventions for parentheses.
10850
108512003-06-19 Paul Eggert <eggert@twinsun.com>
10852
10853 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
10854 yyreportTree): Do not assume that size_t is the same width as int,
10855 when printing sizes. Print sizes using an unsigned format.
10856 Problem reported by Frank Heckenbach in
10857 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
10858
10859 Port to Forte Developer 7 C compiler.
10860 * data/glr.c (struct YYLTYPE): If locations are not being used,
10861 declare a single dummy member, as empty structs do not conform
10862 to the C standard.
10863 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
10864 the Forte Developer 7 C compiler complains that end-of-loop
10865 code is not reached.
10866
108672003-06-17 Paul Eggert <eggert@twinsun.com>
10868
10869 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
10870 avoid warnings from picky compilers about redefinition of PARAMS.
10871
108722003-06-17 Paul Eggert <eggert@twinsun.com>
10873
10874 Version 1.875b.
10875
10876 * NEWS: Document 1.875b.
10877
10878 * lib/bbitset.h: Do not include config.h; that's the includer's job.
10879 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
10880 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
10881 Don't use 'index' in comments, as it's a builtin fn on some hosts.
10882 * lib/bitset_stats.c: Include gettext.h unconditionally, as
10883 per recent gettext manual's suggestion.
10884 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
10885 Use prototypes, not old-style definitions.
10886 * lib/lbitset.c (lbitset_unused_clear): Likewise.
10887 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
10888 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
10889 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
10890 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
10891 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
10892 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
10893 vbitset_or_and_cmp, vbitset_copy): Likewise.
10894
10895 * lib/libiberty.h: Do not include config.h; that's the includer's job.
10896 Do not include <stdlib.h>.
10897 (PARAMS): Define unconditionally for C89.
10898 (ATTRIBUTE_NORETURN): Remove.
10899 (ATTRIBUTE_UNUSED): Define unconditionally.
10900
10901 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
10902 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
10903 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
10904 * lib/vbitset.c, lib/vbitset.h: New files.
10905 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10906 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
10907 from libbitset.
10908
10909 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
10910 `How Can I Reset @code{yyparse}', since texinfo does not allow
10911 arbitrary @ in node names.
10912
10913 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
10914 shouldn't be needed according to the gettext 0.12.1 documentation
10915 but which seem to be needed anyway: codeset.m4 glibc21.m4
10916 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
10917 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
10918 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
10919
10920 * lib/.cvsignore: Add stdbool.h.
10921 * m4/.cvsignore: Add nls.m4, po.m4.
10922
10923 Upgrade to CVS gnulib.
10924 * stdbool_.h: File renamed from stdbool.h.in.
10925 * configure.ac (AM_STDBOOL_H): Invoke this instead of
10926 AC_HEADER_STDBOOL.
10927 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
10928 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
10929 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
10930 (MOSTLYCLEANFILES): New var.
10931 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
10932 (stdbool.h): New rule.
10933 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
10934 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
10935 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
10936 m4/quote.m4: Upgrade to today's gnulib.
10937
10938 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
10939 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
10940 the tests right now.
10941 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
10942 yyerror are declared before use; C99 requires this.
10943
109442003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10945
10946 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
10947 first.
10948 (yyrecoverSyntaxError): Correct the logic for setting and testing
10949 yyerrState.
10950 Correct comment on handling EOF.
10951 Allow states with only a default reduction, rather than failing
10952 (I can't quite reconstruct why these were not allowed before).
10953
10954 Fixes to avoid problem that $-N rules in GLR parsers can cause
10955 buffer overruns, corrupting state.
10956
10957 * src/output.c (prepare_rules): Output max_left_semantic_context
10958 definition.
10959 * src/reader.h (max_left_semantic_context): New variable declaration.
10960 * src/scan-gram.l (max_left_semantic_context): Define.
10961 (handle_action_dollar): Update max_left_semantic_context.
10962 * data/glr.c (YYMAXLEFT): New definition.
10963 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
10964 (yyresolveAction): Ditto.
10965
10966 Fixes to problems with location handling in GLR parsers reported by
10967 Frank Heckenbach (2003/06/05).
10968
10969 * data/glr.c (YYLTYPE): Make trivial if locations not used.
10970 (YYRHSLOC): Add parentheses, and define only if locations used.
10971 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
10972 locations not used.
10973 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
10974 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
10975
10976 * tests/cxx-type.at: Exercise location information; update tests
10977 to differentiate output with and without locations.
10978 Remove forward declarations of yylex and yyerror---caused errors
10979 because default YYLTYPE not yet defined.
10980 Change semantic actions to compute strings, rather than printing
10981 them directly (to test proper passing of semantics values). Change
10982 output to prefix notation and update test data and expected results.
10983 (yylex): Track locations.
10984 (stmtMerge): Return value rather than printing, and include arguments
10985 in value.
10986
109872003-06-03 Paul Eggert <eggert@twinsun.com>
10988
10989 Avoid warnings generated by GCC 2.95.4 when Bison is
10990 configured with --enable-gcc-warnings.
10991 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
10992 yy::]b4_parser_class_name[::translate_,
10993 yy::Stack::operator[] (unsigned),
10994 yy::Stack::operator[] (unsigned) const,
10995 yy::Slice::operator[] (unsigned),
10996 yy::Slice::operator[] (unsigned) const):
10997 Rename local vars to avoid warnings.
10998 * tests/glr-regression.at (Improper handling of embedded actions
10999 and $-N in GLR parsers): Remove unused local variable from yylex.
11000 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
11001 (void) as arg when not pure, since we now assume C89 when building
11002 Bison. Pacify GCC by using parameter.
11003
110042003-06-02 Paul Eggert <eggert@twinsun.com>
11005
11006 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
11007 yy::Location::lines, yy::Location::columns): Rename arguments
11008 to avoid shadowing; this removes a warning generated by GCC 3.3.
11009
110102003-06-01 Paul Eggert <eggert@twinsun.com>
11011
11012 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
11013 to g++, as GCC 3.3 complains if you do it.
11014 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
11015 everything that WARNING_CFLAGS has, except omit warnings
11016 not suitable for C++.
11017 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
11018 * tests/atlocal.in (CXXFLAGS): New var.
11019 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
11020
11021 Fix a GLR parser bug I reported in February; see
11022 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
11023 The problem was that GLR parsers did not conform to the C standard,
11024 because actions like { $1 = $2 + $3; } expanded to expressions
11025 that invoked YYFILL in separate subexpressions, and YYFILL assigned
11026 to a local variable. The C standard says that expressions
11027 like (var = f ()) + (var = f ()) have undefined behavior.
11028 Another problem was that GCC sometimes issues warnings that
11029 yyfill and its parameters are unused.
11030
11031 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
11032 as possibly unused.
11033 (yyfill): New function.
11034 (YYFILL): Use it.
11035 (yyuserAction): Change type of yynormal to bool, so that it matches
11036 the new yyfill signature. Mark it as possibly unused.
11037
11038
11039 Follow up on a bug I reported in February, where a Bison-generated
11040 parser can loop. Provide a test case and a fix for yacc.c. I
11041 don't have a fix for lalr1.cc or for glr.c, unfortunately.
11042 The original bug report is in:
11043 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
11044
11045 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
11046 macro's size was becoming unwieldy.
11047 (yyerrlab): Do not discard an empty lookahead symbol, as this
11048 might destroy garbage.
11049 (yyerrorlab): New label, with the old contents of YYERROR,
11050 plus the following change: pop the stack of rhs corresponding
11051 to the production that invoked YYERROR. That is how Yacc
11052 behaves, and POSIX requires this behavior.
11053 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
11054 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
11055 Define 'alarm' to do nothing if unistd.h is not available.
11056 Add a new rule "exp: '-' error;" to test the above change to
11057 data/yacc.c. Use 'alarm' to abort any test taking longer than
11058 10 seconds, as it's probably looping.
11059 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
11060 Also, the new yacc.c generates two fewer diagnostics for an
11061 existing test.
11062
110632003-05-24 Paul Eggert <eggert@twinsun.com>
11064
11065 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
11066 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
11067 This fixes a problem reported by John Bowman when the Compaq/HP
11068 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
11069 -ansi -Wall -gall).
11070 * data/yacc.c (union yyalloc): Likewise.
11071 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
11072
11073 Switch from 'int' to 'bool' where that makes sense.
11074
11075 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
11076 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
11077 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
11078 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
11079 Return or accept bool, not int. All callers changed.
11080 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
11081 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
11082 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
11083 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
11084 bitset_or_and_cmp_): Likewise.
11085 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
11086 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
11087 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
11088 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
11089 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
11090 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
11091 bitset_stats_or_and_cmp): Likewise.
11092 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
11093 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
11094 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
11095 ebitset_xor_cmp): Likewise.
11096 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
11097 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
11098 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
11099 lbitset_xor_cmp): Likewise.
11100 * lib/bbitset.h: Include <stdbool.h>.
11101 (struct bitset_vtable): The following members now return bool, not
11102 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
11103 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
11104 or_and_cmp).
11105 * src/conflicts.c (count_rr_conflicts): Likewise.
11106 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
11107 All uses changed.
11108 * lib/ebitset.c (ebitset_obstack_init): Likewise.
11109 * lib/lbitset.c (lbitset_obstack_init): Likewise.
11110 * src/getargs.c (debug_flag, defines_flag, locations_flag,
11111 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
11112 graph_flag): Likewise.
11113 * src/getargs.h (debug_flag, defines_flag, locations_flag,
11114 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
11115 graph_flag): Likewise.
11116 * src/output.c (error_verbose): Likewise.
11117 * src/output.h (error_verbose): Likewise.
11118 * src/reader.c (start_flag, typed): Likewise.
11119 * src/reader.h (typed): Likewise.
11120 * src/getargs.c (LOCATIONS_OPTION): New constant.
11121 (long_options, getargs): Use it.
11122 * src/lalr.c (build_relations): Use bool, not int.
11123 * src/nullable.c (nullable_compute): Likewise.
11124 * src/print.c (print_reductions): Likewise.
11125 * src/tables.c (action_row, pack_vector): Likewise.
11126 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
11127 * src/output.c (prepare): Use it.
11128 * src/output.c (token_definitions_output,
11129 symbol_destructors_output, symbol_destructors_output): Use string,
11130 not boolean integer, to keep track of whether to output separator.
11131 * src/print_graph.c (print_core): Likewise.
11132 * src/state.c (state_rule_lookaheads_print): Likewise.
11133
11134 * config/install-sh: Sync from automake 1.7.5.
11135
111362003-05-14 Paul Eggert <eggert@twinsun.com>
11137
11138 * src/parse-gram.y (rules_or_grammar_declaration): Require a
11139 semicolon after a grammar declaration, in the interest of possible
11140 future changes to the Bison input language.
11141 Do not allow a stray semicolon at the start of the grammar.
11142 (rhses.1): Allow one or more semicolons after any rule, including
11143 just before "|" as required by POSIX.
11144 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
11145 grammar.
11146
111472003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
11148
11149 %parse-param support for lalr1.cc.
11150
11151 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
11152 b4_cc_constructor_calls, b4_cc_constructor_call,
11153 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
11154 definitions.
11155 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
11156 parse-param arguments.
11157 (yy::b4_parser_class_name): Declare instance variables to
11158 hold parse-param arguments.
11159 * tests/calc.at: s/value/semantic_value/ because value clashes
11160 with a member of yy::b4_parser_class_name. Adjust C++ code
11161 to handle %parse-param. Enable %parse-param test in C++.
11162
111632003-05-12 Paul Eggert <eggert@twinsun.com>
11164
11165 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
11166 English a bit. Fix fclose typo. Change "const char" to "char
11167 const", and use ANSI C rather than K&R for "main". Suggest
11168 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
11169 and suggest yy_switch_to_buffer.
11170
111712003-05-05 Paul Eggert <eggert@twinsun.com>
11172
11173 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
11174 C89. This avoids a diagnostic on compilers that define __STDC__
11175 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
11176 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
11177
111782003-05-03 Paul Eggert <eggert@twinsun.com>
11179
11180 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
11181 Do not overrun array bounds.
11182 This should fix a bug reported today by Olatunji Oluwabukunmi in
11183 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
11184
111852003-04-29 Akim Demaille <akim@epita.fr>
11186
11187 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
11188 * src/getargs.c, src/getargs.h: here, as bool, not int.
11189 (nondeterministic_parser): New.
11190 * src/parse-gram.y, src/scan-gram.l: Support
11191 %nondeterministic-parser.
11192 * src/output.c (prepare): Use nondeterministic_parser instead
11193 of glr_parser where appropriate.
11194 * src/tables.c (conflict_row, action_row, save_row)
11195 (token_actions, token_actions, pack_vector): Ditto.
11196
111972003-04-29 Akim Demaille <akim@epita.fr>
11198
11199 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
11200
112012003-04-29 Akim Demaille <akim@epita.fr>
11202
11203 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
11204 with %pure-parser and %locations to exercise the patch from Yakov
11205 Markovitch below.
11206
112072003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
11208
11209 * data/yacc.c: (b4_lex_param): Corrected for the case where
11210 %lex-param is provided and %pure-parser isn't.
11211
112122003-04-27 Paul Eggert <eggert@twinsun.com>
11213
11214 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
11215 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
11216 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
11217 if it is not defined.
11218 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
11219
112202003-04-26 Paul Eggert <eggert@twinsun.com>
11221
11222 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
11223 Declare to be of type suitable for the ninf value itself, not of
11224 type suitable for the corresponding table, since the latter might
11225 be unsigned but the ninf value might be negative. This fixes a
11226 bug reported by Alexandre Duret-Lutz in
11227 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
11228
11229 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
11230 invokes it. We shouldn't invoke it twice because it will attempt
11231 to put error.o in the archive twice. This fixes a glitch reported
11232 by Martin Mokrejs in
11233 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
11234
112352003-04-21 Paul Eggert <eggert@twinsun.com>
11236
11237 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
11238 to gnulib.
11239
112402003-04-21 Yakov Markovitch <Markovitch@iso.ru>
11241
11242 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
11243 Fix obvious typo that results in uncompilable GLR parsers
11244 when both %pure-parser and %locations are used. (trivial change)
11245
112462003-04-17 Paul Eggert <eggert@twinsun.com>
11247
11248 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
11249 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
11250 Do not insert the expected token via unput, as this runs afoul
11251 of a POSIX-compatibility bug in flex 2.5.31.
11252 All uses changed to BEGIN the parent state,
11253 since we no longer insert the expected token via unput.
11254 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
11255 that is no longer emitted after the above change.
11256
11257 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
11258 the first one. This change is from Paul Hilfinger, and it fixes
11259 regression reported by Werner Lemberg in
11260 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
11261
11262 (resolve_sr_conflict): Don't invoke state_errs_set
11263 unless one or more tokens have been explicitly made errors.
11264 Otherwise, the above change causes Bison to abort.
11265
11266 * tests/existing.at (GNU pic Grammar): New test case, taken from
11267 Lemberg's email.
11268
112692003-03-31 Akim Demaille <akim@epita.fr>
11270
11271 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
11272
112732003-03-31 Akim Demaille <akim@epita.fr>
11274
11275 * src/output.c (prepare_symbols): Avoid trailing spaces in the
11276 output.
11277
112782003-03-31 Akim Demaille <akim@epita.fr>
11279
11280 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
11281 From Paul Hilfinger.
11282
112832003-03-29 Akim Demaille <akim@epita.fr>
11284
11285 * m4/error.m4: Do not put under dynamic conditions some code which
11286 expansion is under static control.
11287
112882003-03-29 Akim Demaille <akim@epita.fr>
11289
11290 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
11291
112922003-03-29 Akim Demaille <akim@epita.fr>
11293
11294 * doc/bison.texinfo (Strings are Destroyed): New.
11295
112962003-03-13 Paul Eggert <eggert@twinsun.com>
11297
11298 * .cvsignore: Add configure.lineno.
11299 * src/.cvsignore: Add yacc.
11300 * tests/.cvsignore: Add testsuite.log.
11301 * doc/fdl.texi: Sync with latest FSF version.
11302
113032003-03-12 Paul Eggert <eggert@twinsun.com>
11304
11305 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
11306 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
11307 cursor, instead of leaving it undefined. This fixes a bug
11308 reported by Tim Van Holder in
11309 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
11310 * tests/input.at (Torturing the Scanner): Test the scanner on
11311 an empty input file, which was Tim Van Holder's test case.
11312
11313 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
11314 <sys/resource.h> can be included, include sys/time.h and
11315 sys/times.h first, if available. This works around the SunOS
11316 4.1.4 porting bug reported by Bruce Becker in
11317 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
11318
11319 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
11320 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
11321 AC_HEADER_SYS_WAIT.
11322
11323 Merge changes from gnulib. This was prompted because the CVS
11324 snapshot didn't build on Solaris 7 due to strnlen problems.
11325
11326 These changes need to be merged back into gnulib:
11327 * lib/hash.c: Include <stdbool.h> unconditionally.
11328 * m4/onceonly.m4 (m4_quote): New macro.
11329 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
11330 Quote AC_FOREACH variable-expansions properly.
11331 The 2003-01-03 obstack.h change also needs merging.
11332 {end of changes requiring merging}
11333
11334 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11335 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
11336 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
11337 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
11338 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
11339 New files, imported from gnulib.
11340 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
11341 above.
11342
11343 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
11344 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
11345 gnulib sources.
11346
11347 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
11348 Add.
11349 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
11350 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
11351 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
11352 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
11353 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
11354 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
11355 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
11356 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
11357 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
11358 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
11359 (jm_PREREQ_ARGMATCH): Remove.
11360 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
11361 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
11362
11363 * src/system.h: Include <stdbool.h> unconditionally.
11364
11365 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
11366 assuming at least C89 in the bitset code for some time now.
11367
113682003-03-03 Akim Demaille <akim@epita.fr>
11369
11370 * ro.po: New.
11371
113722003-03-02 Akim Demaille <akim@epita.fr>
11373
11374 * doc/bison.texinfo (Table of Symbols): Reactivate the
11375 documentation for %lex-param, and %parse-param.
11376
113772003-03-02 Akim Demaille <akim@epita.fr>
11378
11379 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
11380 generate verbose error messages.
11381 Use the number of tokens as an upper bound in yytname, as it
11382 cannot be a non terminal.
11383
113842003-03-02 Akim Demaille <akim@epita.fr>
11385
11386 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
11387 message.
11388
113892003-03-02 Akim Demaille <akim@epita.fr>
11390
11391 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
11392 Use them to exercise yycheck overrun.
11393 Based on Andrew Suffield's grammar.
11394
113952003-03-02 Akim Demaille <akim@epita.fr>
11396
11397 Create tests/local.at for Bison generic testing macros.
11398
11399 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
11400 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
11401 This new file.
11402 * tests/calc.at (AT_CHECK_CALC): Adjust.
11403 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
11404 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
11405 * tests/local.at: here.
11406 (AT_COMPILE_CXX): Tags the tests using it as c++.
11407 Ignore the test if CXX is not functional.
11408
114092003-03-01 Paul Eggert <eggert@twinsun.com>
11410
11411 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
11412 not loc->end, since loc->end might contain garbage and this leads
11413 to undefined behavior on some platforms.
11414 (id_loc, token_start): Use (IF_LINTed) initial values that do not
11415 depend on *loc, so that the reader doesn't give the the false
11416 impression that *loc is initialized.
11417 (<INITIAL>"%%"): Do not bother setting code_start, since its value
11418 does not survive the return.
11419
114202003-03-01 Akim Demaille <akim@epita.fr>
11421
11422 * src/scan-gram.l (code_start): Always initialize it when entering
11423 into yylex, as SC_EPILOGUE is activated *before* the corresponding
11424 yylex invocation. An alternative would be making it static, but
11425 then it starts with the second %%'s beginning, instead of its end.
11426
114272003-02-28 Paul Eggert <eggert@twinsun.com>
11428
11429 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
11430 around a UnixWare 7.1.1 porting bug reported by John Hughes in
11431 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
11432
114332003-02-26 Paul Eggert <eggert@twinsun.com>
11434
11435 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
11436 Remove Sequent/Pyramid discussion (nobody uses them any more).
11437 Merge VMS and MS-DOS discussion; these ports may well be dead
11438 but let's keep mentioning them for now. Put <> around email
11439 addresses. Add copyright notice.
11440
114412003-02-24 Paul Eggert <eggert@twinsun.com>
11442
11443 * data/glr.c (yy_reduce_print): yylineno -> yylno,
11444 to avoid collision with flex use of yylineno.
11445 Problem reported by Bruce Lilly in
11446 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
11447 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11448 * data/yacc.c (yy_reduce_print): Likewise.
11449
11450 * config/depcomp: Sync with Automake 1.7.3.
11451
114522003-02-21 Akim Demaille <akim@epita.fr>
11453
11454 * data/lalr1.cc: Use temporary variables instead of casts to
11455 change integer types.
11456 Suggested by Paul Eggert.
11457
114582003-02-21 Akim Demaille <akim@epita.fr>
11459
11460 * doc/bison.texinfo: Use "location" consistently to refer to @n,
11461 to avoid confusions with lalr1.cc's notion of Position.
11462 Suggested by Paul Eggert.
11463
114642003-02-20 Akim Demaille <akim@epita.fr>
11465
11466 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
11467 before initial_columns.
11468 (location.hh): Use consistent variable names when defining the
11469 operator<<.
11470 Use "last" so that we subtract from Positions, not from unsigned.
11471
114722003-02-20 Akim Demaille <akim@epita.fr>
11473
11474 * data/lalr1.cc (position.hh): New subfile, including the extended
11475 and Doxygen'ed documentation of class Position.
11476 (location.hh): Use it.
11477 Document a` la Doxygen.
11478 With the help of Benoit Perrot.
11479
114802003-02-20 Akim Demaille <akim@epita.fr>
11481
11482 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
11483 AT_YACC_IF.
11484 Redefine AT_YYERROR_SEES_LOC_IF using it.
11485 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
11486 not defined.
11487 Don't use the location in yy::Parser::error_ and
11488 yy::Parser::print_ when not %locations.
11489 Activate more lalr1.cc tests.
11490
114912003-02-19 Akim Demaille <akim@epita.fr>
11492
11493 * data/lalr1.cc: When displaying a line number, be sure to make it
11494 an int.
11495
114962003-02-19 Akim Demaille <akim@epita.fr>
11497
11498 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
11499 Remove, useless.
11500 (YYABORT, YYACCEPT, YYERROR): New.
11501 * tests/calc.at: Renable the lalr1.cc test.
11502
115032003-02-19 Akim Demaille <akim@epita.fr>
11504
11505 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
11506 error recovery, mixing with/without pops and discarding of the
11507 lookahead.
11508 Exercise YYERROR.
11509 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
11510
115112003-02-17 Paul Eggert <eggert@twinsun.com>
11512
11513 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
11514 * tests/testsuite.at (AT_COMPILE): Use them.
11515 This fixes the testsuite problem reported by Robert Lentz in
11516 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
11517
115182003-02-12 Paul Eggert <eggert@twinsun.com>
11519
11520 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
11521 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
11522 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
11523 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
11524 Check for malloc failure, for consistency with yacc.c.
11525 (yytname_size): Remove, for consistency with yacc.c.
11526
11527 The bug still remains in data/lalr1.cc, as I didn't have time
11528 to fix it there.
11529
115302003-02-06 Akim Demaille <akim@epita.fr>
11531
11532 * configure.ac (GXX): Rename as...
11533 (CXX): this, to keep the original Autoconf semantics.
11534 Require 2.57.
11535 * data/lalr1.cc: Fix b4_copyright invocations.
11536 If YYDEBUG is not defined, don't depend upon name_ being defined.
11537 (location.hh): Include string and iostream.
11538 (Position::filename): New member.
11539 (Position::Position ()): New.
11540 (operator<< (Position)): New.
11541 (operator- (Position, int)): New.
11542 (Location::first, Location::last): Rename as...
11543 (Location::begin, Location::end): these, to mock the conventional
11544 iterator names.
11545 (operator<< (Location)): New.
11546 * tests/atlocal.in (CXX): New.
11547 * tests/testsuite.at (AT_COMPILE_CXX): New.
11548 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
11549 locations in a more synthetic way.
11550 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
11551 lalr1.cc is used.
11552 Adjust the C locations to match those from Emacs: first column is
11553 column 0.
11554 Change all the expected results.
11555 Conform to the GCS: simplify the locations when applicable.
11556 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
11557 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
11558 these CPP macros with the m4 macros new defined by...
11559 (AT_CHECK_PUSHDEFS): this, i.e.:
11560 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
11561 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
11562 New macros.
11563 (AT_CHECK_POPDEFS): Undefine them.
11564 (AT_CHECK_CALC_LALR1_CC): New.
11565 Use it for the first lalr1.cc test.
11566
115672003-02-04 Akim Demaille <akim@epita.fr>
11568
11569 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
11570 Location as is defined.
11571
115722003-02-04 Akim Demaille <akim@epita.fr>
11573
11574 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
11575 name_ being defined.
11576
115772003-02-03 Paul Eggert <eggert@twinsun.com>
11578
11579 * src/gram.h (start_symbol): Remove unused decl.
11580
11581 Use more-consistent naming conventions for local vars.
11582
11583 * src/derives.c (derives_compute): Change type of local var from
11584 int to rule_number.
11585 * src/gram.c (grammar_rules_partial_print): Likewise.
11586 * src/print.c (print_core): Likewise.
11587 * src/reduce.c (reduce_grammar_tables): Likewise.
11588
11589 * src/gram.c (grammar_dump): Change name of item_number *
11590 local var from r to rp.
11591 * src/nullable.c (nullable_compute): Likewise.
11592
11593 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
11594
11595 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
11596 for symbol or symbol_number var.
11597 * src/reader.c (grammar_start_symbol_set): Likewise.
11598 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
11599 Likewise.
11600 * src/state.c (transitions_to): Likewise.
11601 * src/state.h: Likewise.
11602 * src/tables.c (symbol_number_to_vector_number): Likewise.
11603
11604 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
11605 char * var.
11606
11607 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
11608 var.
11609
11610 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
11611 var.
11612
11613 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
11614 Use str, not s, for char * var. Use ch, not c, for character var.
11615 Use size for size var.
11616
11617 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
11618 char * var.
11619 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
11620 uniqstr var.
11621 * src/uniqstr.h: Likewise.
11622
11623 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
11624 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
11625 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
11626 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
11627 param to have same name as that of enum, so that we don't use
11628 "s" to stand for a non-state.
11629
116302003-02-02 Akim Demaille <akim@epita.fr>
11631
11632 * src/scan-skel.l: Scan more than one inert character per yylex
11633 invocation.
11634
116352003-02-01 Paul Eggert <eggert@twinsun.com>
11636
11637 Version 1.875a.
11638
11639 * po/LINGUAS: Add ms.
11640
116412003-01-30 Akim Demaille <akim@epita.fr>
11642
11643 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
11644
116452003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11646
11647 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
11648 of $1.
11649
11650 Changes in response to error report by S. Eken: GLR mode does not
11651 handle negative $ indices or $ indices in embedded rules correctly.
11652 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
11653
11654 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
11655 (b4_rhs_location): Ditto.
11656 (yyfill): New function to copy from stack tree into array
11657 incrementally.
11658 (yyuserAction): Modify to allow incremental move of semantic values
11659 to rhs array when in GLR mode.
11660 Define YYFILL to use in user-defined actions to fill semantic array
11661 as needed.
11662 Remove dummy use of yystack, as there is now a guaranteed use.
11663 (yydoAction): Modify to allow incremental move of semantic values
11664 to rhs array when in GLR mode.
11665 (yyresolveAction): Ditto.
11666 (yyglrShiftDefer): Update comment.
11667 (yyresolveStates): Use X == NULL for pointers, not !X.
11668 (yyglrReduce): Ditto.
11669 (yydoAction): Ditto
11670
11671 * tests/glr-regr1.at: Rename to ...
11672 * tests/glr-regression.at: Add new regression test for the problems
11673 described above (adapted from S. Eken).
11674 Update copyright notice.
11675 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
11676 * tests/Makefile.am: Ditto.
11677
116782003-01-28 Paul Eggert <eggert@twinsun.com>
11679
11680 * data/lalr1.cc: Do not use @output_header_name@ unless
11681 b4_defines_flag is set. This fixes two bugs reported by
11682 Tim Van Holder in
11683 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
11684 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
11685
116862003-01-21 Paul Eggert <eggert@twinsun.com>
11687
11688 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
11689 we don't need to worry about yyerrlab1 being reported as an
11690 "unused label" by non-GCC C compilers. The downside is that if
11691 locations are used then a couple of statements are duplicated each
11692 time YYERROR is invoked, but the upside is that the warnings
11693 should vanish.
11694 (yyerrlab1): Move code to YERROR.
11695 (yyerrlab2): Remove. Change uses back to yyerrlab1.
11696 This reverts some of the 2002-12-27 change.
11697
116982003-01-17 Paul Eggert <eggert@twinsun.com>
11699
11700 * src/output.c (symbol_printers_output): Fix typo that led
11701 to core dump. Problem reported by Antonio Rus in
11702 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
11703
117042003-01-13 Akim Demaille <akim@epita.fr>,
11705 Quoc Peyrot <chojin@lrde.epita.fr>,
11706 Robert Anisko <anisko_r@lrde.epita.fr>
11707
11708 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
11709 when the stacks contain one element, as the loop would otherwise
11710 free the last state, and then use the top state (the one we just
11711 popped). This means that the initial elements will not be freed
11712 explicitly, as is the case in yacc.c; it is not a problem, as
11713 these elements have fake values.
11714
117152003-01-11 Paul Eggert <eggert@twinsun.com>
11716
11717 * NEWS: %expect-violations are now just warnings, reverting
11718 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
11719 bootstrapping problem reported by Matthias Klose; see
11720 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
11721 * src/conflicts.c (conflicts_print): Likewise.
11722 * tests/conflicts.at (%expect not enough, %expect too much,
11723 %expect with reduce conflicts): Likewise.
11724 * doc/bison.texinfo (Expect Decl): Document this. Also mention
11725 that the warning is enabled if the number of conflicts changes
11726 (not necessarily increases).
11727
11728 * src/getargs.c (version): Update copyright year.
11729
117302003-01-09 Akim Demaille <akim@epita.fr>
11731
11732 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
11733
117342003-01-08 Paul Eggert <eggert@twinsun.com>
11735
11736 * Makefile.maint (WGETFLAGS):
11737 New macro, containing "-C off" to disable proxy caches.
11738 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
11739 (rel-check): Use $(WGET) instead of wget.
11740
117412003-01-06 Paul Eggert <eggert@twinsun.com>
11742
11743 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
11744 the GLR paper of Scott, Johnstone and Hussain.
11745
117462003-01-04 Paul Eggert <eggert@twinsun.com>
11747
11748 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
11749 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
11750 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
11751 (EXTRA_LIBRARIES): New var, for liby.a.
11752 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
11753 (EXTRA_SCRIPTS): New var, for yacc.
11754
11755 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
11756 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
11757 Problem reported by Nelson H. F. Beebe.
11758
117592003-01-03 Paul Eggert <eggert@twinsun.com>
11760
11761 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
11762 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
11763 when compiling Bison 1.875's `bitset bset = obstack_alloc
11764 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
11765
11766 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
11767 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
11768 grow to a huge size with typical invocation.
11769
11770 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
11771 Use the pattern recommended by Autoconf 2.57, except also protect
11772 against double-definition.
11773 * src/system.h: Likewise.
11774 Portability issues reported by Nelson H. F. Beebe.
11775
11776 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
11777 All uses changed. Provide a definition in both C and C++.
11778 (yytrue, yyfalse): Define even if defined (__cplusplus).
11779
11780 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
11781 Reported by Nelson H. F. Beebe.
11782
11783 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
11784
117852003-01-02 Paul Eggert <eggert@twinsun.com>
11786
11787 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
11788 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
11789 Bug reported by Nelson H. F. Beebe.
11790
117912003-01-01 Paul Eggert <eggert@twinsun.com>
11792
11793 * Version 1.875.
11794
117952002-12-30 Paul Eggert <eggert@twinsun.com>
11796
11797 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
11798 Moved here from...
11799 (<INITIAL>","): Here. This causes stray "," to be treated
11800 more uniformly.
11801
11802 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
11803 last brace in braced code when not in Yacc mode, for compatibility
11804 with Bison 1.35. This resurrects the 2001-12-15 patch to
11805 src/reader.c.
11806
11807 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
11808 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
11809
118102002-12-28 Paul Eggert <eggert@twinsun.com>
11811
11812 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
11813 that of SYM's type. This fixes Debian bug 168069, reported by
11814 Thomas Olsson.
11815
118162002-12-28 Paul Eggert <eggert@twinsun.com>
11817
11818 Version 1.75f.
11819
11820 Switch back to the Yacc style of conflict reports, undoing some
11821 of the 2002-07-30 change.
11822 * doc/bison.texinfo (Understanding): Use Yacc style for
11823 conflict reports. Also, use new way of locating rules.
11824 * src/conflicts.c (conflict_report):
11825 Renamed from conflict_report_yacc, removing the old
11826 'conflict_report'. Translate the entire conflict report at once,
11827 so that we don't assume that "," has the same interpretation in
11828 all languages.
11829 (conflicts_output): Use Yacc-style conflict report for each state,
11830 instead of our more-complicated style.
11831 (conflicts_print): Use Yacc-style conflict report, except print
11832 the input file name when not emulating Yacc.
11833 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
11834 Conflicted Reduction, %expect not enough, %expect too much,
11835 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
11836 * tests/existing.at (GNU Cim Grammar): Likewise.
11837 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
11838
11839 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
11840 fatal): Don't invoke fflush; it's not needed and it might even be
11841 harmful for stdout, as stdout might not be open.
11842 * src/reduce.c (reduce_print): Likewise.
11843
118442002-12-27 Paul Eggert <eggert@twinsun.com>
11845
11846 Fix a bug where error locations were not being recorded correctly.
11847 This problem was originally reported by Paul Hilfinger in
11848 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
11849
11850 * data/yacc.c (yyparse): New local var yylerrsp, to record the
11851 top of the location stack's error locations.
11852 (yyerrlab): Set it. When discarding a token, push its location
11853 onto yylerrsp so that we don't lose track of the error's end.
11854 (yyerrlab1): Now is only the target of YYERROR, so that we can
11855 properly record the location of the action that failed. For GCC
11856 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
11857 GCC warning about yyerrlab1 being unused if YYERROR is unused.
11858 (yyerrlab2): New label, which yyerrlab now falls through to.
11859 Compute the error's location by applying YYLLOC_DEFAULT to
11860 the locations of all the symbols that went into the error.
11861 * doc/bison.texinfo (Location Default Action): Mention that
11862 YYLLOC_DEFAULT is also invoked for syntax errors.
11863 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11864 Error locations include the locations of all the tokens that were
11865 discarded, not just the last token.
11866
118672002-12-26 Paul Eggert <eggert@twinsun.com>
11868
11869 * src/files.c: Include quote.h.
11870 (compute_output_file_names): Warn if we detect conflicting
11871 outputs to the same file. This should catch the misunderstanding
11872 exemplified by Debian Bug 165349, reported by Bruce Stephens..
11873
11874 * src/conflicts.c (conflicts_print): If the user specifies
11875 "%expect N", report an error if there are any reduce/reduce
11876 conflicts. This is what the manual says should happen.
11877 This fixes Debian bug 130890, reported by Anthony DeRobertis.
11878 * tests/conflicts.at (%expect with reduce conflicts): New test.
11879
11880 Don't use m4_include on relative file names, as it doesn't work as
11881 desired if there happens to be a file with that name under ".".
11882
11883 * m4sugar/version.m4: Remove; it was included but it wasn't used.
11884 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
11885 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
11886 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
11887 * src/output.c (output_skeleton): Use full path names when
11888 specifying a file to include; don't rely on include path, as
11889 it's unreliable when the working file contains a file with
11890 that name.
11891
118922002-12-25 Paul Eggert <eggert@twinsun.com>
11893
11894 Remove obsolete references to bison.simple and bison.hairy.
11895 Problem mentioned by Aubin Mahe in
11896 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
11897 * data/glr.c: Comment fix.
11898 * doc/bison.1: Remove references. Also, mention "yacc".
11899
11900 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
11901 with -g option.
11902
11903 * src/parse-gram.y (declaration): Use enum "report_states" rather
11904 than its numeric value 1.
11905
11906 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
11907 opening a new one. This fixes Debian bug 165349, reported by
11908 Bruce Stephens.
11909
119102002-12-24 Paul Eggert <eggert@twinsun.com>
11911
11912 Version 1.75e.
11913
11914 * Makefile.maint (cvs-update): Don't assume that the shell
11915 supports $(...), as Solaris sh doesn't.
11916
11917 * src/parse-gram.y (lloc_default): Remove test for empty
11918 nonterminals at the end, since it didn't change the result.
11919
119202002-12-24 Paul Eggert <eggert@twinsun.com>
11921
11922 If the user does not define YYSTYPE as a macro, Bison now declares it
11923 using typedef instead of defining it as a macro. POSIX requires this.
11924 For consistency, YYLTYPE is also declared instead of defined.
11925
11926 %union directives can now have a tag before the `{', e.g., the
11927 directive `%union foo {...}' now generates the C code
11928 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
11929 The default union tag is `YYSTYPE', for compatibility with Solaris 9
11930 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
11931 instead of `yyltype'.
11932
11933 `yystype' and `yyltype' are now obsolescent macros instead of being
11934 typedefs or tags; they are no longer documented and will be
11935 withdrawn in a future release.
11936
11937 * data/glr.c (b4_location_type): Remove.
11938 (YYSTYPE): Renamed from yystype.
11939 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
11940 (struct YYLTYPE): Renamed from struct yyltype.
11941 (YYLTYPE): Renamed from yyltype.
11942 (yyltype, yystype): New (and obsolescent) macros,
11943 for backward compatibility.
11944 * data/yacc.c: Likewise.
11945
11946 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
11947 does not specify a union tag. This is for compatibility with
11948 Solaris 9 yacc.
11949
11950 * src/parse-gram.y (add_param): 2nd arg is now char * not char
11951 const *, since it is now modified by stripping surrounding { }.
11952 (current_braced_code): Remove.
11953 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
11954 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
11955 trailing " {...}". Now of type <chars>.
11956 (grammar_declaration): Adjust to bundled tokens.
11957 (code_content): Remove; stripping is now done by add_param.
11958 (print_token_value): Print contents of bundled tokens.
11959 (token_name): New function.
11960
11961 * src/reader.h (braced_code, current_braced_code): Remove.
11962 (token_name): New decl.
11963
11964 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
11965 token_type, not braced_code code_kind. All uses changed.
11966 (SC_PRE_CODE): New state, for scanning after a keyword that
11967 has (or usually has) an immediately-following braced code.
11968 (token_type): New local var, to keep track of which token type
11969 to return when scanning braced code.
11970 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
11971 <INITIAL>"%parse-param", <INITIAL>"%printer",
11972 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
11973 instead of returning a token type immediately.
11974 (<INITIAL>"{"): Set token type.
11975 (<SC_BRACED_CODE>"}"): Use it.
11976 (handle_action_dollar, handle_action_at): Now returns bool
11977 indicating success. Fail if ! current_rule; this prevents a core dump.
11978 (handle_symbol_code_dollar, handle_symbol_code_at):
11979 Remove; merge body into caller.
11980 (handle_dollar, handle_at): Complain in invalid contexts.
11981
11982 * NEWS, doc/bison.texinfo: Document the above.
11983 * NEWS: Fix years and program names in copyright notice.
11984
119852002-12-17 Paul Eggert <eggert@twinsun.com>
11986
11987 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
11988 Reporting, Table of Symbols): Omit mentions of %lex-param and
11989 %parse-param from the documentation for now.
11990
119912002-12-15 Paul Eggert <eggert@twinsun.com>
11992
11993 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
11994 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
11995 lookahead symbol, and which sets yychar in parser actions) and it
11996 disagreed with the Bison documentation. Bug
11997 reported by Andrew Walrond.
11998
11999 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
12000 as the caller now does that.
12001 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
12002 (YYEMPTY): Parenthesize right hand side, since others use it.
12003 (yyparse): Don't assume that our generated code is the only code
12004 that sets yychar.
12005
120062002-12-13 Paul Eggert <eggert@twinsun.com>
12007
12008 Version 1.75d.
12009
12010 POSIX requires a "yacc" command.
12011 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
12012 (MOSTLYCLEANFILES): Add yacc.
12013 (yacc): New rule.
12014 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
12015 as an alias for bison y.
12016
12017 * po/LINGUAS: Add da.
12018
12019 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
12020 problem with latest <getopt.h>.
12021 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
12022
12023 * doc/fdl.texi: Upgrade to 1.2.
12024 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
12025 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
12026 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
12027 gnulib.
12028 * config/install-sh: Sync with autotools.
12029
12030 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
12031 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
12032 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
12033 locations are requested.
12034 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
12035 locations are requested.
12036
120372002-12-12 Paul Eggert <eggert@twinsun.com>
12038
12039 Remove unportable casts and storage allocation tricks.
12040 While we're at it, remove almost all casts, since they
12041 usually aren't needed and are a sign of trouble.
12042
12043 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
12044
12045 * src/derives.c (derives_compute): Do not subtract NTOKENS from
12046 the pointer DSET returned by malloc; this isn't portable.
12047 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
12048 Similarly for DERIVES.
12049 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
12050 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
12051 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
12052
12053 * src/derives.c (derives_compute): Do not bother invoking
12054 int_of_rule_number, since rule numbers are integers.
12055
12056 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
12057 rather than XMALLOC (char, N).
12058
12059 * src/files.c (filename_split): Rewrite to avoid cast.
12060
12061 * src/gram.h (symbol_number_as_item_number,
12062 item_number_as_symbol_number, rule_number_as_item_number,
12063 item_number_as_rule_number):
12064 Now inline functions rather than macros, to avoid casts.
12065 * src/state.h (state_number_as_int): Likewise.
12066 * src/tables.c (state_number_to_vector_number,
12067 symbol_number_to_vector_number): Likewise.
12068
12069 * src/gram.h (int_of_rule_number): Remove; no longer used.
12070
12071 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
12072 since the resulting storage is always stored into.
12073
12074 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
12075 where it's needed.
12076
12077 * src/muscle_tab.c (muscle_m4_output):
12078 Now inline. Return bool, not int.
12079 * src/state.c (state_compare): Likewise.
12080 * src/symtab.c (symbol_check_defined,
12081 symbol_check_alias_consistency, symbol_pack, symbol_translation,
12082 hash_compare_symbol, hash_symbol):
12083 Likewise.
12084 * src/uniqstr.c (uniqstr_print): Likewise.
12085 * src/muscle_tab.c (muscle_m4_output_processor):
12086 New function, to avoid casts.
12087 * src/state.c (state_comparator, stage_hasher): Likewise.
12088 * src/symtab.c (symbol_check_defined_processor,
12089 symbol_check_alias_consistency_processor, symbol_pack_processor,
12090 symbol_translation_processor, hash_symbol_comparator,
12091 hash_symbol_hasher): Likewise.
12092 * src/uniqstr.c (uniqstr_print_processor): Likewise.
12093 * src/muscle_tab.c (muscles_m4_output):
12094 Use new functions instead of casting old functions unportably.
12095 * src/state.c (state_hash_new): Likewise.
12096 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
12097 symbols_token_translations_init):
12098 Likewise.
12099 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
12100
12101 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
12102 var instead of casting to long, to avoid casts.
12103 (prepare_states): Use MALLOC rather than alloca, so that we don't
12104 have to worry about alloca.
12105 * src/state.c (state_hash_lookup): Likewise.
12106
12107 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
12108 local var instead of casting to unsigned char, to avoid casts.
12109
12110 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
12111 STATE_ALLOC): Remove.
12112 (transitions_new, errs_new, reductions_new, state_new): Use malloc
12113 rather than calloc, and use offsetof to avoid allocating slightly
12114 too much storage.
12115 (state_new): Initialize all members.
12116
12117 * src/state.c (state_hash): Use unsigned accumulator, not signed.
12118
12119 * src/symtab.c (symbol_free): Remove; unused.
12120 (symbol_get): Remove cast in lhs of assignment.
12121 (symbols_do): Now static. Accept generic arguments, not
12122 hashing-related ones.
12123
12124 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
12125 (symbol_processor): Remove.
12126 (symbols_do): Remove decl; now static.
12127
12128 * src/system.h (alloca): Remove; decl no longer needed.
12129 (<stddef.h>): Include, for offsetof.
12130 (<inttypes.>, <stdint.h>): Include if available.
12131 (uintptr_t): New type, if system lacks it.
12132 (CALLOC, MALLOC, REALLOC): New macros.
12133 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
12134 new macros.
12135
12136 * src/tables.c (table_size): Now int, to pacify GCC.
12137 (table_grow, table_ninf_remap): Use signed table size.
12138 (save_row): Don't bother initializing locals when not needed.
12139 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
12140 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
12141
12142 * src/vcg.h: Correct misspellings.
12143
12144 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
12145
12146
12147 * src/getargs.c (getargs): Don't assume EOF == -1.
12148
121492002-12-09 Paul Eggert <eggert@twinsun.com>
12150
12151 Change identifier spellings to avoid collisions with names
12152 that are reserved by POSIX.
12153
12154 Don't use names ending in _t, since POSIX reserves them.
12155 For consistency, remove _e and _s endings -- they're weren't
12156 needed to remove ambiguity. All uses changed.
12157 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
12158 turn was just renamed from struniq_t.
12159 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
12160 which in turn was just renamed from struniq_processor_t.
12161 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
12162 in turn was renamed from hash_compare_struniq_t.
12163 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
12164 (state_list): Renamed from state_list_t.
12165 * src/assoc.h (assoc): Renamed from assoc_t.
12166 * src/conflicts.c (enum conflict_resolution): Renamed from
12167 enum conflict_resolution_e.
12168 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
12169 (rule_list): Renamed from rule_list_t.
12170 * src/getargs.h (enum trace): Renamed from enum trace_e.
12171 (enum report): Renamed from enum report_e.
12172 * src/gram.h (item_number): Renamed from item_number_t.
12173 (rule_number): Renamed from rule_number_t.
12174 (struct rule_s): Remove the "rule_s" part; not used.
12175 (rule): Renamed from rule_t.
12176 (rule_filter): Renamed from rule_filter_t.
12177 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
12178 (goto_list): Renamed from goto_list_t.
12179 * src/lalr.h (goto_number): Renamed from goto_number_t.
12180 * src/location.h (location): Renamed from location_t.
12181 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
12182 and moved here from:
12183 * src/muscle_tab.h (muscle_entry_t): here.
12184 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
12185 (rule_list): Renamed from rule_list_t.
12186 * src/print_graph.c (static_graph): Renamed from graph.
12187 * src/reader.h (braced_code): Renamed from braced_code_t.
12188 Remove brace_code_e tag.
12189 * src/relation.h (relation_node): Renamed from relation_node_t.
12190 (relation_nodes): Renamed from relation_nodes_t.
12191 (relation): Renamed from relation_t.
12192 * src/state.h (state_number): Renamed from state_number_t.
12193 (struct state): Renamed from struct state_s.
12194 (state): Renamed from state_t.
12195 (transitions): Renamed from transitions_t. Unused (and
12196 misspelled) transtion_s tag removed.
12197 (errs): Renamed from errs_t. Unused errs_s tag removed.
12198 (reductions): Renamed from reductions_t. Unused tag
12199 reductions_s removed.
12200 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
12201 (struct symbol_list): Renamed from struct symbol_list_s.
12202 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
12203 (struct symbol): Renamed from struct symbol_s.
12204 (symbol): Renamed from symbol_t.
12205 * src/tables.c (vector_number): Renamed from vector_number_t.
12206 (action_number): Renamed from action_t.
12207 * src/tables.h (base_number): Renamed from base_t.
12208 * src/vcg.h (enum color): Renamed from enum color_e.
12209 (enum textmode): Renamed from enum textmode_e.
12210 (enum shape): Renamed from enum shape_e.
12211 (struct colorentry): Renamed from struct colorentry_s.
12212 (struct classname): Renamed from struct classname_s.
12213 (struct infoname): Renamed from struct infoname_s.
12214 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
12215 (enum decision): Renamed from enum decision_e.
12216 (enum orientation): Renamed from enum orientation_e.
12217 (enum alignment): Renamed from enum alignment_e.
12218 (enum arrow_mode): Renamed from enum arrow_mode_e.
12219 (enum crossing_type): Renamed from enum crossing_type_e.
12220 (enum view): Renamed from enum view_e.
12221 (struct node): Renamed from struct node_s.
12222 (node): Renamed from node_t.
12223 (enum linestyle): Renamed from enum linestyle_e.
12224 (enum arrowstyle): Renamed from enum arrowstyle_e.
12225 (struct edge): Renamed from struct edge.
12226 (edge): Renamed from edge_t.
12227 (struct graph): Renamed from struct graph_s.
12228 (graph): Renamed from graph_t.
12229 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
12230 Rename value_t -> value.
12231 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
12232 value_t_as_yystype -> value_as_yystype.
12233
12234 Don't include <errno.h> in the mainstream code, since it
12235 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
12236 * lib/get-errno.c, lib/get-errno.h: New files.
12237 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
12238 get-errno.c.
12239 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
12240 * src/output.c (output_skeleton): Likewise.
12241 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
12242 instead of errno.
12243 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
12244 Likewise.
12245 (handle_action_dollar, handle_action_at): Likewise.
12246 * src/system.h: Do not include <errno.h>.
12247 (TAB_EXT): Renamed from EXT_TAB.
12248 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
12249
12250 Avoid str[a-z]*, since <string.h> reserves that name space.
12251 Change all instances of "struniq" in names to "uniqstr", and
12252 likewise for "STRUNIQ" and "UNIQSTR".
12253 * src/uniqstr.c: Renamed from src/struniq.c.
12254 * src/uniqstr.h: Renamed from src/struniq.h.
12255 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
12256 * src/files.c (strsuffix): Remove; unused.
12257 (concat2): Renamed from stringappend. Now static.
12258 * src/files.h (strsuffix, stringappend): Remove; unused.
12259 * src/parse-gram.y (<chars>): Renamed from <string>.
12260 (<uniqstr>): Renamed from <struniq>.
12261 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
12262 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
12263 (struct graph_s.expand): Renamed from struct graph_s.stretch.
12264 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
12265 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
12266 (N_EXPAND): Renamed from N_STRETCH.
12267
12268 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
12269 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
12270 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
12271 Remove; unused.
12272 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
12273 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
12274 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
12275 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
12276 (BASE_MAXIMUM): Renamed from BASE_MAX.
12277 (BASE_MINIMUM): Renamed from BASE_MIN.
12278 (ACTION_MAX): Remove; unused.
12279 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
12280 Unnecessary casts removed from above defines.
12281
12282
12283 Fix misspelling in names.
12284 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
12285 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
12286 G_NODE_ALIGNEMENT.
12287
12288
12289 * lib/timevar.c (timevar_report): Renamed from time_report,
12290 for consistency with other names.
12291 * lib/timevar.h (timevar_report): New decl.
12292 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
12293
12294
12295 Sort include-file uses.
12296
12297 Reorder all include files under src to be in the order "system.h".
12298 then the ../lib include files in angle brackets (alphabetized),
12299 then the . include files in double-quotes (alphabetized). Fix
12300 dependency breakages encountered in this process, as follows:
12301 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
12302 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
12303 * src/state.h: Include "symtab.h".
12304
123052002-12-08 Paul Eggert <eggert@twinsun.com>
12306
12307 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
12308 since this causes problems when __file__ contains character
12309 sequences like "@" that are treated specially by src/scan-skel.l.
12310 Instead, just use the file's basename. This fixes the bug
12311 reported by Martin Mokrejs in
12312 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
12313
123142002-12-06 Paul Eggert <eggert@twinsun.com>
12315
12316 Add support for rules that do not have trailing semicolons, as
12317 POSIX requires. Improve the quality of locations in Bison
12318 diagnostics.
12319
12320 * src/location.c: Include <quotearg.h>.
12321 (empty_location): Now const.
12322 (location_print): New function. Follow the recommendation of the
12323 GNU Coding Standards for locations that span file boundaries.
12324 * src/location.h: Do not include <quotearg.h>; no longer needed.
12325 (boundary): New type.
12326 (location_t): Use it. This allows locations to span file boundaries.
12327 All member uses changed: file -> start.file or end.file (as needed),
12328 first_line -> start.line, first_column -> start.column,
12329 last_line -> end.line, last_column -> end.column.
12330 (equal_boundaries): New function.
12331 (LOCATION_RESET, LOCATION_STEP): Remove.
12332 (LOCATION_PRINT): Remove. All callers changed to use location_print.
12333 (empty_location): Now const.
12334 (location_print): New decl.
12335 * src/parse-gram.y (lloc_default): New function, which handles
12336 empty locations more accurately.
12337 (YYLLOC_DEFAULT): Use it.
12338 (%token COLON): Remove.
12339 (%token ID_COLON): New token.
12340 (rules): Use it.
12341 (declarations, rules): Remove trailing semicolon.
12342 (declaration, rules_or_grammar_declaration):
12343 Allow empty (";") declaration.
12344 (symbol_def): Remove empty actions; no longer needed.
12345 (rules_or_grammar_declaration): Remove trailing semicolon.
12346 (semi_colon.opt): Remove.
12347 * src/reader.h: Include location.h.
12348 (scanner_cursor): New decl.
12349 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
12350 rolling our own.
12351 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
12352 of *loc.
12353 (STEP): Remove. No longer needed, now that adjust_location does
12354 the work. All uses removed.
12355 (scanner_cursor): New var.
12356 (adjust_location): Renamed from extend_location. It now sets
12357 *loc and adjusts the scanner cursor. All uses changed.
12358 Don't bother testing for CR.
12359 (handle_syncline): Remove location arg; now updates scanner cursor.
12360 All callers changed.
12361 (unexpected_end_of_file): Now accepts start boundary of token or
12362 comment, not location. All callers changed. Update scanner cursor,
12363 not the location.
12364 (SC_AFTER_IDENTIFIER): New state.
12365 (context_state): Renamed from c_context. All uses changed.
12366 (id_loc, code_start, token_start): New local vars.
12367 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
12368 processing of Yacc white space and equivalents here.
12369 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
12370 instead of returning ID immediately, since we need to search for
12371 a subsequent colon.
12372 (<INITIAL>"'", "\""): Save token_start.
12373 (<INITIAL>"%{", "{", "%%"): Save code_start.
12374 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
12375 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
12376 BEGIN context_state at end, not INITIAL.
12377 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
12378 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
12379 Return correct token start.
12380 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
12381 the start of a character, string or multiline comment is found.
12382 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
12383 Reduction): Adjust reported locations to match the more-precise
12384 results now expected.
12385 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
12386 * tests/reduce.at (Useless Rules, Reduced Automaton,
12387 Underivable Rules): Likewise.
12388 * tests/regression.at (Invalid inputs): No longer `expecting ";"
12389 or "|"' now that so many other tokens are allowed by the new grammar.
12390
12391 * src/complain.h (current_file): Remove duplicate decl;
12392 current_file is now owned by files.h.
12393 * src/complain.c, src/scan-gram.l: Include files.h.
12394
123952002-12-06 Paul Eggert <eggert@twinsun.com>
12396
12397 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
12398 promotes to int; it might be unsigned int.
12399 * data/yacc.c (yy_reduce_print): Likewise.
12400
12401 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
12402 be #defined in the prologue, not in the Bison declarations.
12403 This fixes Debian Bug 102878, reported by Shaul Karl.
12404
124052002-12-02 Paul Eggert <eggert@twinsun.com>
12406
12407 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
12408 * lib/strtoul.c: New file, from gnulib.
12409 This fixes a porting bug reported by Peter Klein in
12410 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
12411
124122002-11-30 Paul Eggert <eggert@twinsun.com>
12413
12414 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
12415 and put only a forward declaration in the prologue. This is for
12416 consistency with the other scanner helper functions.
12417
12418 Type clashes now generate warnings, not errors, since it
12419 appears that POSIX may allow some grammars with type clashes.
12420 * src/reader.c (grammar_current_rule_check): Warn about
12421 type clashes instead of complaining.
12422 * tests/input.at (Type Clashes): Expect warnings, not complaints.
12423
12424 Add Yacc library, since POSIX requires it.
12425 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
12426 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
12427 * lib/main.c, lib/yyerror.c: New files.
12428
12429 gram_error can be static; it need not be extern.
12430 * src/reader.h (gram_error): Remove decl.
12431 * src/parse-gram.y (gram_error): Now static. Add static decl.
12432 (print_token_value): Omit parameter names from forward decl,
12433 for consistency.
12434
124352002-11-29 Paul Eggert <eggert@twinsun.com>
12436
12437 * doc/bison.texinfo: Emphasize that yylex and yyerror must
12438 be declared before being used. E.g., one should typically
12439 declare them in the prologue. Use GNU coding style in examples.
12440 Put "const" consistently after the type it modifies. Mention
12441 that C99 supports "inline". Mention that yyerror traditionally
12442 returns "int".
12443
12444 %parse-param and %lex-param now take just one argument, the
12445 declaration; the argument name is deduced from the declaration.
12446
12447 * doc/bison.texinfo (Parser Function, Pure Calling, Error
12448 Reporting, Table of Symbols): Document this.
12449 * src/parse-gram.y (add_param): New function.
12450 (COMMA): Remove.
12451 (declaration): Implement new rule for %parse-param and %lex-param.
12452 * src/scan-gram.l: "," now elicits a warning, rather than being
12453 a token; this is more compatible with byacc.
12454 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
12455
124562002-11-27 Paul Eggert <eggert@twinsun.com>
12457
12458 Rename identifiers to avoid real and potential collisions.
12459
12460 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
12461 to avoid collision with lex macro described by Bruce Lilly in
12462 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
12463 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12464 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
12465 * src/parse-gram.y (print_token_value): Renamed from yyprint.
12466 All uses changed.
12467 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
12468 The name "yycontrol" violates the name space rules, and this stuff
12469 wasn't being used anyway.
12470 (input): Remove action; this stuff wasn't being used.
12471 (gram_error): Rename local variable yylloc -> loc.
12472 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
12473 (YY_DECL): Don't use "yy" at start of local variables.
12474 All uses changed, e.g., yylloc -> loc.
12475 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
12476 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
12477 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
12478 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
12479
12480 * src/parse-gram.y (gram_error): loc is now const *.
12481 * src/reader.h (gram_error): Likewise.
12482
124832002-11-24 Paul Eggert <eggert@twinsun.com>
12484
12485 Version 1.75c.
12486
12487 * tests/actions.at (Actions after errors): Use an output format
12488 more similar to that of the Printers and Destructors test.
12489 Test the position of the ';' token too.
12490 (Printers and Destructors): Likewise.
12491 (Printers and Destructors: %glr-parser): Remove for now, to avoid
12492 unnecessarily alarming people when the test fails.
12493
12494 * data/yacc.c (yyerrlab1): Move this label down, so that the
12495 parser does not discard the lookahead token if the user code
12496 invokes YYERROR. This change is required for POSIX conformance.
12497
12498 * lib/error.c: Sync with gnulib.
12499
125002002-11-22 Paul Eggert <eggert@twinsun.com>
12501
12502 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
12503 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
12504 * lib/xmalloc.c: Likewise.
12505
125062002-11-20 Paul Eggert <eggert@twinsun.com>
12507
12508 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
12509
125102002-11-20 Paul Eggert <eggert@twinsun.com>
12511
12512 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
12513 should use `if (! x) abort ();' rather than `assert (x);', and
12514 anyway it's one less thing to worry about configuring.
12515
12516 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
12517 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
12518 and replace all instances of assert with abort.
12519 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
12520 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
12521
12522 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
12523 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
12524 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
12525 hash_find_entry, hash_rehash, hash_insert): Likewise.
12526 * src/conflicts.c (resolve_sr_conflict): Likewise.
12527 * src/lalr.c (set_goto_map, map_goto): Likewise.
12528 * src/nullable.c (nullable_compute): Likewise.
12529 * src/output.c (prepare_rules, token_definitions_output): Likewise.
12530 * src/reader.c (packgram, reader): Likewise.
12531 * src/state.c (state_new, state_free, state_transitions_set,
12532 state_reduction_find): Likewise.
12533 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
12534 symbol_pack): Likewise.
12535 * src/tables.c (conflict_row, pack_vector): Likewise.
12536 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12537 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12538 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
12539 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
12540
12541 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
12542 (ARGMATCH_CONSTRAINT): New macro.
12543 (ARGMATCH_ASSERT): Use it.
12544
12545 * src/system.h (verify): New macro.
12546 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
12547 rather than assert.
12548 * src/tables.c (tables_generate): Likewise.
12549
12550 * src/struniq.c (struniq_assert): Now returns void, and aborts
12551 if the assertion is false.
12552 (struniq_assert_p): Remove.
12553 * src/struniq.h: Likewise.
12554
125552002-11-18 Paul Eggert <eggert@twinsun.com>
12556
12557 * data/glr.c (yygetLRActions): Replace `yyindex' with
12558 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
12559 This fixes the regression with Sun ONE Studio 7 cc that I reported in
12560 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
12561
125622002-11-18 Akim Demaille <akim@epita.fr>
12563
12564 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
12565 space.
12566 From Tim Van Holder.
12567
125682002-11-17 Paul Eggert <eggert@twinsun.com>
12569
12570 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
12571 to "SyntaxError" for consistency with my 2002-11-15 change.
12572
12573 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
12574 not define to {}, since this breaks the common use of `YYDPRINTF
12575 ((...));' if a single statement is desired (e.g. before `else').
12576 Work around GCC warnings by surrounding corresponding calls with
12577 {} if needed.
12578 (yyhasResolvedValue): Remove unused function.
12579 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
12580 loop body.
12581 (yyreportSyntaxError): Renamed from yyreportParseError.
12582 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
12583 All uses changed.
12584 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
12585 extern when possible. Remove unused initializations.
12586
125872002-11-16 Akim Demaille <akim@epita.fr>
12588
12589 Augment the similarity between GLR and LALR traces.
12590
12591 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
12592 (YY_REDUCE_PRINT): New.
12593 (yyparse): Use them.
12594 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
12595 YYDPRINT here.
12596 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
12597 state reached after the reduction/recovery, since...
12598 (yyparse, yyprocessOneStack): Report the state we are entering in.
12599
126002002-11-16 Akim Demaille <akim@epita.fr>
12601
12602 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
12603 Add support for --trace=skeleton.
12604 * src/scan-skel.l: %option debug.
12605 Scan strings of non-@ or \n instead of character by character.
12606 (scan_skel): Handle trace_skeleton.
12607 (QPUTS): New.
12608 (@output_parser_name@, @output_header_name@): ``Restore'' their
12609 support (used to be M4 macros).
12610 * data/yacc.c: Quote larger chunks, a la glr.c.
12611 * data/lalr1.cc: Likewise.
12612 The header guards are no longer available, so use some other
12613 string than `YYLSP_NEEDED'.
12614
126152002-11-16 Akim Demaille <akim@epita.fr>
12616
12617 Make the ``Printers and Destructors'' test more verbose, taking
12618 `yacc.c''s behavior as (possibly wrong) reference.
12619
12620 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
12621 instead of fprint on stdout.
12622 Set and report the last_line of the symbols.
12623 Consistently display values and locations.
12624
126252002-11-16 Paul Eggert <eggert@twinsun.com>
12626
12627 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
12628
126292002-11-15 Paul Eggert <eggert@twinsun.com>
12630
12631 * tests/actions.at (Actions after errors): New test case.
12632
12633 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
12634 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
12635 tests/action.at, tests/calc.at, tests/conflicts.at,
12636 tests/cxx-type.at, tests/regression.at:
12637 "parse error" -> "syntax error" for POSIX compatibility.
12638 "parsing stack overflow..." -> "parser stack overflow" so
12639 that code matches Bison documentation.
12640
126412002-11-15 Akim Demaille <akim@epita.fr>
12642
12643 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
12644 take two BRACED_CODE, not two string_content.
12645 Free the scanner's obstack when we are done.
12646 (code_content): New.
12647 * tests/calc.at: Adjust.
12648 * doc/bison.texinfo: Adjust.
12649 Also, make sure to include the `,' for these declarations.
12650
126512002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
12652
12653 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
12654 definition; avoids potential autoreconf problems.
12655
126562002-11-15 Akim Demaille <akim@epita.fr>
12657
12658 Always check the value returned by yyparse.
12659
12660 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
12661 returned by yyparse.
12662 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
12663 Adjust calls.
12664 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
12665 returned by yyparse.
12666
126672002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12668
12669 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
12670 on input.at test.
12671
126722002-11-14 Paul Eggert <eggert@twinsun.com>
12673
12674 * src/output.c (output_skeleton): Call xfopen instead of
12675 duplicating xfopen's body.
12676
12677 Fix bugs reported by Nelson H. F. Beebe in
12678 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
12679
12680 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
12681 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
12682 Group compiler. Instead, use "$CC -E bar.c". Include the .h
12683 file twice in the grammar, as an extra check.
12684
12685 * tests/input.at (Torturing the Scanner): Surround the
12686 backslash-newline tests with "#if 0", to make it less likely that
12687 we'll run into compiler bugs. Bring back solitary \ inside
12688 comment, but add a closing comment to work around HP C bug. Don't
12689 test backslash-newline in C character constant.
12690
126912002-11-14 Akim Demaille <akim@epita.fr>
12692
12693 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
12694 status of the compiler.
12695 Calling `exit 1' is no longer needed.
12696 Reported by Nelson H. F. Beebe.
12697
126982002-11-14 Akim Demaille <akim@epita.fr>
12699
12700 * tests/atlocal.in (CPPFLAGS): We have config.h.
12701 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
12702 New.
12703 * tests/actions.at, tests/calc.at, tests/conflicts.at,
12704 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
12705 * tests/regression.at, tests/torture.at: Use them for all the
12706 grammars that are to be compiled.
12707 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
12708 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
12709 * doc/bison.texinfo (GLR Parsers): Document `inline'.
12710
127112002-11-14 Akim Demaille <akim@epita.fr>
12712
12713 * doc/bison.texinfo: Various formatting changes (alignments in
12714 samples, additional @group/@end group, GCS in samples.
12715 Use @deffn instead of simple @table to define the directives,
12716 macros, variables etc.
12717
127182002-11-13 Paul Eggert <eggert@twinsun.com>
12719
12720 Fix some bugs reported by Albert Chin-A-Young in
12721 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
12722
12723 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
12724 -o c"; the HP C compiler chatters during compilation.
12725 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
12726 * tests/headers.at (export YYLTYPE): Likewise.
12727
12728 * tests/input.at (Torturing the Scanner): Remove lines containing
12729 solitary backslashes, as they tickle a bug in the HP C compiler.
12730
12731 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
12732 comments, since they're not portable. Use GNU coding style.
12733
127342002-11-13 Akim Demaille <akim@epita.fr>
12735
12736 * data/yacc.c: Leave bigger chunks of quoted text.
12737 (YYDSYMPRINTF): New.
12738 Use it to report symbol activities.
12739 * data/glr.c (YYDSYMPRINTF): New.
12740 Use it.
12741
127422002-11-12 Paul Eggert <eggert@twinsun.com>
12743
12744 Version 1.75b.
12745
12746 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
12747 (yyglrReduce): Return yyok, not 0.
12748 This should avoid the enumerated-type warnings reported
12749 by Nelson H. F. Beebe in
12750 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
12751
12752 * lib/bbitset.h (BITSET_INLINE): Remove.
12753 * lib/bitset.h [! BITSET_INLINE]: Remove.
12754 (bitset_set, bitset_reset, bitset_test): Rename local vars
12755 to avoid shadowing warnings by GCC.
12756
12757 * data/glr.c (inline): Remove #define. It's the user's
12758 responsibility to #define it away, just like 'const'.
12759 This fixes one of the bugs reported by Nelson H. F. Beebe in
12760 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
12761
12762 * Makefile.maint (po-check): Scan .l and .y files instead of the
12763 .c and the .h files that they generate. This fixes the bug
12764 reported by Tim Van Holder in:
12765 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
12766 Look for N_ as well as for _. Try to avoid matching #define for
12767 N_ and _.
12768 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
12769 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
12770 * src/scan-gram.l: Revamp regular expressions so that " and '
12771 do not confuse xgettext.
12772
12773 * src/struniq.h (struniq_new): Do not declare the return type
12774 to be 'const'; this violates the C standard.
12775 * src/struniq.c (struniq_new): Likewise.
12776
127772002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
12778
12779 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
12780 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
12781 linker.
12782
127832002-11-12 Akim Demaille <akim@epita.fr>
12784
12785 * Makefile.maint: Sync with Autoconf:
12786 (local_updates): New.
12787
127882002-11-12 Akim Demaille <akim@epita.fr>
12789
12790 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
12791
127922002-11-12 Akim Demaille <akim@epita.fr>
12793
12794 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
12795 locations.
12796
127972002-11-12 Akim Demaille <akim@epita.fr>
12798
12799 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
12800 not yyvalue.
12801
128022002-11-12 Akim Demaille <akim@epita.fr>
12803
12804 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
12805 Use it to test the GLR parser.
12806
128072002-11-12 Akim Demaille <akim@epita.fr>
12808
12809 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
12810 defines it.
12811 * data/glr.c (yystos): New.
12812 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
12813 (YYDSYMPRINT): New.
12814 (yyval): Don't define it, it is handled via M4.
12815 (yyrecoverParseError): Free verbosely the discarded symbols.
12816 * data/yacc.c (yysymprint): Remove, rather...
12817 (b4_yysymprint_generate): invoke.
12818 * data/c.m4 (b4_yysymprint_generate): New.
12819 Accept pointers as arguments, as opposed to the version from
12820 yacc.c.
12821 (b4_yydestruct_generate): Likewise.
12822 * tests/cations.at (Printers and Destructors): Use Bison directives
12823 instead of CPP macros.
12824 Don't rely on internal details.
12825
128262002-11-12 Akim Demaille <akim@epita.fr>
12827
12828 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
12829 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
12830 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
12831 it against YYEMPTY and so forth), work on yytoken (i.e., set
12832 it to YYEMPTY etc.).
12833 (yydestruct): Replace with a b4_yydestruct_generate invocation.
12834 (b4_symbol_actions): Remove.
12835 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
12836 for 0, end-of-input.
12837
128382002-11-12 Akim Demaille <akim@epita.fr>
12839
12840 * doc/bison.texinfo (Destructor Decl): New.
12841
128422002-11-12 Akim Demaille <akim@epita.fr>
12843
12844 * src/tables.c (tables_generate): Use free for pointers that
12845 cannot be NULL, not XFREE.
12846 (pack_vector): Use assert, not fatal, for bound violations.
12847 * src/state.c (state_new): Likewise.
12848 * src/reader.c (reader): Likewise.
12849 * src/lalr.c (set_goto_map): Likewise.
12850 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
12851 the file name.
12852
128532002-11-12 Akim Demaille <akim@epita.fr>
12854
12855 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
12856 Restore.
12857 * src/scan-gram.l (last_string): Is global to the file, not to
12858 yylex.
12859 * src/parse-gram.y (input): Don't append the epilogue here,
12860 (epilogue.opt): do it here, and free the scanner's obstack.
12861 * src/reader.c (epilogue_set): Rename as...
12862 (epilogue_augment): this.
12863 * data/c.m4 (b4_epilogue): Defaults to empty.
12864
128652002-11-12 Akim Demaille <akim@epita.fr>
12866
12867 * src/getargs.c (long_options): Remove duplicates.
12868 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
12869 Remove.
12870 * doc/bison.rnh: Remove.
12871 * doc/bison.texinfo (VMS Invocation): Remove.
12872
128732002-11-12 Akim Demaille <akim@epita.fr>
12874
12875 * src/struniq.h, src/struniq.c (struniq_t): Is const.
12876 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
12877
12878 Use struniq for symbols.
12879
12880 * src/symtab.h (symbol_t): The tag member is a struniq.
12881 (symbol_type_set): Adjust.
12882 * src/symtab.c (symbol_new): Takes a struniq.
12883 (symbol_free): Don't free the tag member.
12884 (hash_compare_symbol_t, hash_symbol_t): Rename as...
12885 (hash_compare_symbol, hash_symbol): these.
12886 Use the fact that tags as struniqs.
12887 (symbol_get): Use struniq_new.
12888 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
12889 Returns a strniq.
12890 * src/reader.h (merger_list, grammar_currentmerge_set): The name
12891 and type members are struniqs.
12892 * src/reader.c (get_merge_function)
12893 (grammar_current_rule_merge_set): Adjust.
12894 (TYPE, current_type): Are struniq.
12895
12896 Use struniq for file names.
12897
12898 * src/files.h, src/files.c (infile): Split into...
12899 (grammar_file, current_file): these.
12900 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
12901 * src/reduce.c (reduce_print): Likewise.
12902 * src/getargs.c (getargs): Likewise.
12903 * src/complain.h, src/complain.c: Likewise.
12904 * src/main.c (main): Call struniqs_new early enough to use it for
12905 file names.
12906 Don't free the input file name.
12907
129082002-11-12 Akim Demaille <akim@epita.fr>
12909
12910 * src/symtab.c (symbol_free): Remove dead deactivated code:
12911 type_name are properly removed.
12912 Don't use XFREE to free items that cannot be NULL.
12913 * src/struniq.h, src/struniq.c: New.
12914 * src/main.c (main): Initialize/free struniqs.
12915 * src/parse-gram.y (%union): Add astruniq member.
12916 (yyprint): Adjust.
12917 * src/scan-gram.l (<{tag}>): Return a struniq.
12918 Free the obstack bit that used to store it.
12919 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
12920
129212002-11-11 Paul Eggert <eggert@twinsun.com>
12922
12923 Revamp to fix many (but not all) of the C- and M4-related quoting
12924 problems. Among other things, this fixes the Bison bug reported
12925 by Jan Hubicka when processing the Bash grammar; see:
12926 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
12927
12928 Use new @ escapes consistently. Represent brackets with @{ and @}
12929 rather than @<:@ and @:>@, since this works a bit better with dumb
12930 editors like vi. Represent @ with @@, since @ is now consistently
12931 an escape. Use @oline@ and @ofile@ rather than __oline__ and
12932 __ofile__, to avoid unexpected expansions. Similarly, use @output
12933 rather than #output.
12934
12935 * data/c.m4 (b4_copyright): Omit file name from comment, since
12936 the file name could contain "*/".
12937 (b4_synclines_flag): Don't quote the 2nd argument; it should already
12938 be quoted. All uses changed.
12939
12940 * data/glr.c: Use new @ escapes consistently.
12941 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
12942 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
12943 Remove, since they couldn't handle arbitrary characters in file
12944 names.
12945 * data/lalr1.cc: Likewise.
12946 * data/yacc.c: Likewise.
12947
12948 * src/files.c (output_infix): Remove; all uses removed.
12949 * src/files.h: Likewise.
12950
12951 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
12952 mishandled funny characters in file names, and anyway it isn't
12953 needed any more.
12954 * data/yacc.c: Likewise.
12955 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
12956
12957 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
12958 * data/yacc.c: Likewise.
12959
12960 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
12961 strings now.
12962 (muscle_init): Quote filename as a C string.
12963 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
12964 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
12965 * src/output.c (escaped_file_name_output): New function.
12966 (prepare_symbols): Quote tokens for M4.
12967 (prepare): Don't insert output_infix, output_prefix,
12968 output_parser_name, output_header_name; this is now down by scan-skel.
12969 Insert skeleton as a C string.
12970
12971 * src/output.c (user_actions_output, symbol_destructors_output,
12972 symbol_printers_output): Quote filenames for C and M4.
12973 * src/reader.c (prologue_augment, epilogue_set): Likewise.
12974
12975 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
12976 escapes other than \\ and \'; this simplifies the code.
12977 (<SC_STRING>): Likewise, for \\ and \".
12978 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
12979 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
12980 Use new escapes @{ and @} for [ and ].
12981
12982 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
12983 them with auto vars.
12984 Switch to new escape scheme, where @ is the escape character uniformly.
12985 Abort if a stray escape character is found. Avoid unbounded input
12986 buffer when parsing non-escaped text.
12987
12988 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
12989 __oline__, #output, $@, and @{ do not have unintended meanings.
12990
129912002-11-09 Paul Eggert <eggert@twinsun.com>
12992
12993 Fix the test failure due to GCC warnings described in
12994 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
12995 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
12996 evaluate to 0 if it's impossible for NINF to be in the respective
12997 table.
12998 (yygetLRActions, yyrecoverParseError): Use them.
12999
13000 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
13001 counted in the token inserted at end of file. Now takes
13002 location_t *, not location_t, so that the location can be
13003 adjusted. All uses changed.
13004
13005 * tests/regression.at (Invalid inputs): Adjust wording in
13006 diagnostic to match the new behavior.
13007
13008 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
13009 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
13010 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
13011 abort ();'. This reduces the runtime of the "Many lookaheads"
13012 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
13013 GCC 3.2.
13014
130152002-11-07 Paul Eggert <eggert@twinsun.com>
13016
13017 * src/parse-gram.y (CHARACTER): Remove unused token.
13018 All uses removed.
13019
13020 * src/scan-gram.l: Remove stack option. We no longer use the
13021 stack, since the stack was never deeper than 1; instead, use the
13022 new auto var c_context to record the stacked value.
13023
13024 Remove nounput option. At an unexpected end of file, we now unput
13025 the minimal input necessary to end cleanly; this simplifies the
13026 code.
13027
13028 Avoid unbounded token sizes where this is easy.
13029
13030 (unexpected_end_of_file): New function.
13031 Use it to systematize the error message on unexpected EOF.
13032 (last-string): Now auto, not static.
13033 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
13034 (scanner_last_string_free): Remove; not used.
13035 (percent_percent_count): Move decl to just before use.
13036 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
13037 not the (never otherwised-used) CHARACTER.
13038
130392002-11-07 Akim Demaille <akim@epita.fr>
13040
13041 Let yyerror always receive the msg as last argument, so that
13042 yyerror can be variadic.
13043
13044 * data/yacc.c (b4_yyerror_args): New.
13045 Use it when calling yyerror.
13046 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
13047 Use it when calling yyerror.
13048 * doc/bison.texinfo (Error Reporting): Adjust.
13049 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
13050 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
13051
130522002-11-06 Akim Demaille <akim@epita.fr>
13053
13054 #line should have quoted strings.
13055 Ideally, this should be done by m4_quotearg.
13056
13057 * src/scan-skel.l: Include quotearg.h.
13058 Quote __ofile__.
13059 * src/output.c (symbol_printers_output)
13060 (symbol_destructors_output): Quote the file name.
13061
130622002-11-06 Akim Demaille <akim@epita.fr>
13063
13064 * tests/regression.at (Invalid inputs): Adjust to the recent
13065 messages.
13066
130672002-11-06 Akim Demaille <akim@epita.fr>
13068
13069 Restore --no-lines.
13070 Reported by Jim Kent.
13071
13072 * data/c.m4 (b4_syncline): New.
13073 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
13074 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
13075 * src/output.c (user_actions_output): Likewise.
13076 (prepare): Define 'b4_synclines_flag'.
13077 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
13078
130792002-11-06 Akim Demaille <akim@epita.fr>
13080
13081 * src/main.c (main): Free `infile'.
13082 * src/scan-gram.l (handle_syncline): New.
13083 Recognize `#line'.
13084 * src/output.c (user_actions_output, symbol_destructors_output)
13085 (symbol_printers_output): Use the location's file name, not
13086 infile.
13087 * src/reader.c (prologue_augment, epilogue_set): Likewise.
13088
130892002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13090
13091 * src/tables.c (matching_state): Don't allow states to match if
13092 either has GLR conflict entries.
13093
130942002-11-05 Paul Eggert <eggert@twinsun.com>
13095
13096 * src/scan-gram.l: Use more accurate diagnostics, e.g.
13097 "integer out of range" rather than "invalid value".
13098 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
13099 accordingly.
13100
13101 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
13102 Also, remove one static variable in the scanner.
13103
13104 * src/scan-gram.l (braces_level): Now auto, not static.
13105 Initialize to zero if the compiler is being picky.
13106 (INITIAL): Clear braces_level instead of incrementing it.
13107 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
13108 as POSIX 1003.1-2001 requires.
13109 * src/system.h (IF_LINT): New macro, taken from coreutils.
13110 * configure.ac: Define "lint" if --enable-gcc-warnings.
13111
131122002-11-05 Akim Demaille <akim@epita.fr>
13113
13114 * src/scan-gram.l: When it starts with `%', complain about the
13115 whole directive, not just that `invalid character: %'.
13116
131172002-11-04 Akim Demaille <akim@epita.fr>
13118
13119 * Makefile.maint: Update from Autoconf.
13120 (update, cvs-update, po-update, do-po-update): New.
13121
131222002-11-04 Akim Demaille <akim@epita.fr>
13123
13124 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
13125 and yyerror.
13126 Have yyerror `use' its arguments.
13127 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
13128 returns true when location & yacc & pure & parse-param.
13129 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
13130
131312002-11-04 Akim Demaille <akim@epita.fr>
13132
13133 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
13134 clashes.
13135 * src/scan-gram.l: Use [\'] instead of ['] to pacify
13136 font-lock-mode.
13137 Use complain_at.
13138 Use quote, not quote_n since LOCATION_PRINT no longer uses the
13139 slot 0.
13140
131412002-11-03 Paul Eggert <eggert@twinsun.com>
13142
13143 * src/reader.c (get_merge_function, grammar_current_rule_check):
13144 Use consistent diagnostics for reporting type name clashes.
13145 Quote the types with <>, for consistency with Yacc.
13146 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
13147
131482002-11-03 Akim Demaille <akim@epita.fr>
13149
13150 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
13151 New.
13152 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
13153 (b4_parse_param): Remove.
13154 Use b4_identification.
13155 Propagate b4_pure_args where needed to pass them to yyerror.
13156 * data/glr.m4 (b4_parse_param): Remove.
13157 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
13158 (b4_lpure_formals): New.
13159 Use b4_identification.
13160 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
13161 b4_user_formals and b4_user_args.
13162 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
13163 (yyreportAmbiguity): When using a pure parser, also need
13164 the location, and the parse-params.
13165 Adjust callers.
13166 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
13167 When using a pure parser, also need the parse-params.
13168 Adjust callers.
13169 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
13170 (%pure-parser + %parse-param) LALR and GLR parsers.
13171 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
13172 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
13173 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
13174 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
13175 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
13176 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
13177 * doc/bison.texinfo: Untabify the whole file.
13178 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
13179 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
13180 (Error Reporting): Adjust to these new directives.
13181 Document %error-verbose, deprecate YYERROR_VERBOSE.
13182
131832002-11-03 Akim Demaille <akim@epita.fr>
13184
13185 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
13186 AT_CHECK_CALC_GLR invocations to use % directives, instead of
13187 command line options.
13188 * tests/cxx-type.at: Formatting changes.
13189
131902002-11-03 Paul Eggert <eggert@twinsun.com>
13191
13192 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
13193 to count columns correctly, and to check for invalid inputs.
13194
13195 Use mbsnwidth to count columns correctly. Account for tabs, too.
13196 Include mbswidth.h.
13197 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
13198 (extend_location): New function.
13199 (YY_LINES): Remove.
13200
13201 Handle CRLF in C code rather than in Lex code.
13202 (YY_INPUT): New macro.
13203 (no_cr_read): New function.
13204
13205 Scan UCNs, even though we don't fully handle them yet.
13206 (convert_ucn_to_byte): New function.
13207
13208 Handle backslash-newline correctly in C code.
13209 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
13210 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
13211 all uses changed.
13212 (tag, splice): New EREs. Do not allow NUL or newline in tags.
13213 Use {splice} wherever C allows backslash-newline.
13214 YY_STEP after space, newline, vertical-tab.
13215 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
13216
13217 (letter, id): Don't assume ASCII; e.g., spell out a-z.
13218
13219 ({int}, handle_action_dollar, handle_action_at): Check for integer
13220 overflow.
13221
13222 (YY_STEP): Omit trailing semicolon, so that it's more like C.
13223
13224 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
13225 as well as \000. Check for UCHAR_MAX, not 255.
13226 Allow \x with an arbitrary positive number of digits, as in C.
13227 Check for overflow here.
13228 Allow \? and UCNs, for compatibility with C.
13229
13230 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
13231 with quote slot used by complain_at.
13232
13233 * tests/input.at: Add tests for backslash-newline, m4 quotes
13234 in symbols, long literals, and funny escapes in strings.
13235
13236 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
13237 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
13238 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
13239 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
13240 * m4/mbswidth.m4: New file, from GNU coreutils.
13241
13242 * doc/bison.texinfo (Grammar Outline): Document // comments.
13243 (Symbols): Document that trigraphs have no special meaning in Bison,
13244 nor is backslash-newline allowed.
13245 (Actions): Document that trigraphs have no special meaning.
13246
13247 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
13248 no longer used.
13249
132502002-11-02 Paul Eggert <eggert@twinsun.com>
13251
13252 * src/reader.c: Don't include quote.h; not needed.
13253 (get_merge_function): Reword warning to be consistent with
13254 type clash diagnostic in grammar_current_rule_check.
13255
13256 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
13257 bug in trigraph handling.
13258
13259 * src/output.c (prepare_symbols): When printing token names,
13260 escape "[" as "@<:@" and likewise for "]".
13261
13262 * src/system.h (errno): Remove declaration, as we are now
13263 assuming C89 or better, and C89 guarantees errno.
13264
132652002-10-30 Paul Eggert <eggert@twinsun.com>
13266
13267 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
13268 Check for close failures.
13269 * src/files.h (xfclose): Return void, not int, since it always
13270 returned zero.
13271 * src/files.c (xfclose): Likewise. Report I/O error if ferror
13272 indicates one.
13273 * src/output.c (output_skeleton): Use xfclose rather than fclose
13274 and ferror. xfclose now checks ferror.
13275
13276 * data/glr.c (YYLEFTMOST_STATE): Remove.
13277 (yyreportTree): Use a stack-based leftmost state. This avoids
13278 our continuing battles with bogus warnings about initializers.
13279
132802002-10-30 Akim Demaille <akim@epita.fr>
13281
13282 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
13283 #if.
13284
132852002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13286
13287 * tests/glr-regr1.at: New test for reported regressions.
13288 * tests/testsuite.at: Add glr-regr1.at test.
13289 * tests/Makefile.am: Add glr-regr1.at test.
13290
132912002-10-24 Paul Eggert <eggert@twinsun.com>
13292
13293 Version 1.75a.
13294
13295 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
13296 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
13297 we use malloc. Don't assume 'A' through 'Z' are contiguous.
13298 Don't assume strdup exists; POSIX says its an XSI extension.
13299 Check for buffer overflow on input.
13300
133012002-10-24 Akim Demaille <akim@epita.fr>
13302
13303 * src/output.c (output_skeleton): Don't disable M4sugar comments
13304 too soon: it results in comments being expanded.
13305 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
13306 first output.
13307
133082002-10-24 Akim Demaille <akim@epita.fr>
13309
13310 * data/yacc.c (m4_int_type): New.
13311 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
13312 char' as only yacc.c wants K&R portability.
13313 * data/glr.c (yysigned_char): Remove.
13314 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
13315 Reported by Quoc Peyrot.
13316
133172002-10-23 Paul Eggert <eggert@twinsun.com>
13318
13319 * src/main.c (main): With --trace=time, report times even if a
13320 non-fatal error occurs. Formerly, the times were reported in some
13321 such cases but not in others.
13322 * src/reader.c (reader): Just return if a complaint has been issued,
13323 instead of exiting, so that 'main' can report times.
13324
133252002-10-22 Akim Demaille <akim@epita.fr>
13326
13327 * src/system.h: Include sys/types.
13328 Reported by Bert Deknuydt.
13329
133302002-10-23 Paul Eggert <eggert@twinsun.com>
13331
13332 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
13333 Suggested by Art Haas.
13334
133352002-10-22 Paul Eggert <eggert@twinsun.com>
13336
13337 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
13338 decl; not needed any more.
13339 * src/main.c (main): Use return to exit, undoing yesterday's change.
13340 The last OS that we could find where this wouldn't work is
13341 SunOS 3.5, and that's too old to worry about now.
13342
13343 * data/glr.c (struct yyltype): Define members even when not
13344 doing locations. This is more consistent with yacc.c, and it
13345 works around the following bug reports:
13346 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
13347 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
13348
13349 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
13350 @acronym consistently. Standardize on "Yacc" instead of "YACC",
13351 "Algol" instead of "ALGOL". Give a bit more history about BNF.
13352
133532002-10-22 Akim Demaille <akim@epita.fr>
13354
13355 * data/README: New.
13356
133572002-10-21 Paul Eggert <eggert@twinsun.com>
13358
13359 Be consistent about 'bool'; the old code used an enum in one
13360 module and an int in another, and this violates the C standard.
13361 * m4/stdbool.m4: New file, from coreutils 4.5.3.
13362 * configure.ac (AC_HEADER_STDBOOL): Add.
13363 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
13364 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
13365 * src/symtab.c (hash_compare_symbol_t): Likewise.
13366 * src/system.h (bool, false, true): Use a definition consistent
13367 with ../lib/hash.c. All uses changed.
13368
13369 * src/complain.c (warning_issued): Renamed from warn_message_count,
13370 so that we needn't worry about integer overflow (!).
13371 Now of type bool. All uses changed.
13372 (complaint_issued): Renamed from complain_message_count; likewise.
13373
13374 * src/main.c (main): Use exit to exit with failure.
13375
13376 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
13377 rather than 1 and 0.
13378 * src/main.c (main): Likewise.
13379 * src/getargs.c (getargs): Likewise.
13380 * src/reader.c (reader): Likewise.
13381
13382 * src/getarg.c (getargs): Remove duplicate code for
13383 "Try `bison --help'".
13384
13385 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
13386 What was that "2" for?
13387
13388 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
13389 * src/getargs.c (usage): Likewise.
13390
13391 * src/getargs.c (getargs): When there are too few operands, report
13392 the last one. When there are too many, report the first extra
13393 one. This is how diffutils does it.
13394
133952002-10-20 Paul Eggert <eggert@twinsun.com>
13396
13397 Remove K&R vestiges.
13398 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
13399 * src/complain.c (VA_START): Remove. Assume prototypes.
13400 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
13401 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
13402 fatal): Assume prototypes.
13403 * src/complain.h: Assume prototypes.
13404 * src/system.h (PARAMS): Remove.
13405 Include <limits.h> unconditionally, since it's guaranteeed even
13406 for a freestanding C89 compiler.
13407 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
13408 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
13409
134102002-10-20 Akim Demaille <akim@epita.fr>
13411
13412 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
13413 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
13414 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
13415 (yyresolveStates, yyresolveAction, yyresolveStack)
13416 (yyprocessOneStack): Use them.
13417 (yy_reduce_print): New.
13418 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
13419
134202002-10-20 Akim Demaille <akim@epita.fr>
13421
13422 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
13423 arguments and output `void'.
13424 (b4_c_function): Rename as...
13425 (b4_c_function_def): this.
13426 (b4_c_function_decl, b4_c_ansi_function_def)
13427 (b4_c_ansi_function_decl): New.
13428 Change the interpretation of the arguments: before `int, foo', now
13429 `int foo, foo'.
13430 * data/yacc.c (yyparse): Prototype and define thanks to these.
13431 Adjust b4_c_function_def uses.
13432 * data/glr.c (yyparse): Likewise, but ANSI only.
13433
134342002-10-20 Akim Demaille <akim@epita.fr>
13435
13436 * src/output.c (prepare): Move the definition of `tokens_number',
13437 `nterms_number', `undef_token_number', `user_token_number_max'
13438 to...
13439 (prepare_tokens): Here.
13440 (prepare_tokens): Rename as...
13441 (prepare_symbols): this.
13442 (prepare): Move the definition of `rules_number' to...
13443 (prepare_rules): here.
13444 (prepare): Move the definition of `last', `final_state_number',
13445 `states_number' to...
13446 (prepare_states): here.
13447 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
13448
134492002-10-20 Akim Demaille <akim@epita.fr>
13450
13451 * src/tables.h, src/tables.c, src/output.c: Comment changes.
13452
134532002-10-20 Akim Demaille <akim@epita.fr>
13454
13455 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
13456 * data/c.m4: here.
13457
134582002-10-20 Akim Demaille <akim@epita.fr>
13459
13460 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
13461 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
13462 `pair'.
13463 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
13464 `name' to...
13465 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
13466 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
13467 These.
13468
134692002-10-19 Paul Eggert <eggert@twinsun.com>
13470
13471 Do not create a temporary file, as that involves security and
13472 cleanup headaches. Instead, use a pair of pipes.
13473 Derived from a suggestion by Florian Krohm.
13474 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
13475 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
13476 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
13477 (BISON_PREREQ_SUBPIPE): Add.
13478 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
13479 Add subpipe.h, subpipe.c.
13480 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
13481 * po/POTFILES.in: Add lib/subpipe.c.
13482 * src/output.c: Include "subpipe.h".
13483 (m4_invoke): Remove decl.
13484 (scan_skel): New decl.
13485 (output_skeleton): Use pipe rather than temporary file for m4 input.
13486 Check that m4sugar.m4 is readable, to avoid deadlock.
13487 Check for pipe I/O error.
13488 * src/scan-skel.l (readpipe): Remove decl.
13489 (scan_skel): New function, to be used in place of m4_invoke.
13490 Read from stream rather than file.
13491
13492 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
13493 float, as this generates a warning on Solaris 8 + GCC 3.2 with
13494 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
13495 this generates a more-accurate value anyway.
13496
13497 * lib/timevar.c (timervar_accumulate): Rename locals to
13498 avoid confusion with similarly-named more-global.
13499 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
13500
13501 * src/output.c (prepare): Use xstrdup to convert char const *
13502 to char *, to avoid GCC warning.
13503
135042002-10-19 Akim Demaille <akim@epita.fr>
13505
13506 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
13507 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
13508 Use them to have `calc.y' ready for %pure-parser.
13509 * data/yacc.c (YYLEX): Pass a yylex return type to
13510 b4_c_function_call.
13511
135122002-10-19 Akim Demaille <akim@epita.fr>
13513
13514 Prototype support of %lex-param and %parse-param.
13515
13516 * src/parse-gram.y: Add the definition of the %lex-param and
13517 %parse-param tokens, plus their rules.
13518 Drop the `_' version of %glr-parser.
13519 Add the "," token.
13520 * src/scan-gram.l (INITIAL): Scan them.
13521 * src/muscle_tab.c: Comment changes.
13522 (muscle_insert, muscle_find): Rename `pair' as `probe'.
13523 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
13524 (muscle_entry_s): The `value' member is no longer const.
13525 Adjust all dependencies.
13526 * src/muscle_tab.c (muscle_init): Adjust: use
13527 MUSCLE_INSERT_STRING.
13528 Initialize the obstack earlier.
13529 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
13530 (muscle_pair_list_grow): New.
13531 * data/c.m4 (b4_c_function_call, b4_c_args): New.
13532 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
13533 * tests/calc.at: Use %locations, not --locations.
13534 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
13535
135362002-10-19 Akim Demaille <akim@epita.fr>
13537
13538 * src/getargs.c (usage): Take status as argument and exit
13539 accordingly.
13540 Report the traditional `Try ... --help' message when status != 0.
13541 (usage, version): Don't take a FILE * as arg, it is pointless.
13542 (getargs): When there is an incorrect number of arguments, make it
13543 an error, and report it GNUlically thanks to `usage ()'.
13544
135452002-10-18 Paul Eggert <eggert@twinsun.com>
13546
13547 * data/glr.c (yyreportParseError): Don't assume that sprintf
13548 yields the length of the printed string, as this is not true
13549 on SunOS 4.1.4. Reported by Peter Klein.
13550
13551 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
13552 * tests/conflicts.at (%nonassoc and eof): Likewise.
13553 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
13554
135552002-10-17 Akim Demaille <akim@epita.fr>
13556
13557 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
13558 * src/getargs.c (trace_types, trace_args): Adjust.
13559 * src/reader.c (grammar_current_rule_prec_set)
13560 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
13561 Standardize error messages.
13562 And s/@prec/%prec/!
13563 (reader): Use trace_flag to enable scanner/parser debugging,
13564 instead of an adhoc scheme.
13565 * src/scan-gram.l: Remove trailing debugging code.
13566
135672002-10-16 Paul Eggert <eggert@twinsun.com>
13568
13569 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
13570 MUSCLE_TAB_H.
13571
13572 * NEWS: Officially drop support for building Bison with K&R C,
13573 since it didn't work anyway and it's not worth worrying about.
13574 * Makefile.maint (wget_files): Remove ansi2knr.c.
13575 (ansi2knr.c-url_prefix): Remove.
13576 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
13577 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13578 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13579
135802002-10-15 Paul Eggert <eggert@twinsun.com>
13581
13582 Stop using the "enum_" trick for K&R-style function definitions;
13583 it confused me, and I was the author! Instead, assume that people
13584 who want to use K&R C compilers (when using these modules in GCC,
13585 perhaps?) will run ansi2knr.
13586
13587 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
13588 All uses of "enum_" changed to "enum ".
13589 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13590 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13591
13592 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
13593 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
13594 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
13595 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
13596 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
13597 abitset_not, abitset_ones, abitset_or, abitset_or_and,
13598 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
13599 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
13600 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
13601 Use function prototypes; this removes the need for declaring
13602 static functions simply to provide their prototypes.
13603 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
13604 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
13605 bitset_count_, bitset_create, bitset_dump, bitset_first,
13606 bitset_free, bitset_init, bitset_last, bitset_next,
13607 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
13608 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
13609 bitset_print, bitset_release_memory, bitset_toggle_,
13610 bitset_type_choose, bitset_type_get, bitset_type_name_get,
13611 debug_bitset): Likewise.
13612 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
13613 * lib/bitset_stats.c (bitset_log_histogram_print,
13614 bitset_percent_histogram_print, bitset_stats_and,
13615 bitset_stats_and_cmp, bitset_stats_and_or,
13616 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
13617 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
13618 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
13619 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
13620 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
13621 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
13622 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
13623 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
13624 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
13625 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
13626 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
13627 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
13628 bitset_stats_zero): Likewise.
13629 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13630 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13631 bitsetv_dump, debug_bitsetv): Likewise.
13632 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
13633 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
13634 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
13635 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
13636 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
13637 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
13638 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
13639 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
13640 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
13641 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
13642 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
13643 Likewise.
13644 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
13645 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
13646 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
13647 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
13648 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
13649 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
13650 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
13651 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
13652 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
13653 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
13654 lbitset_xor_cmp, lbitset_zero): Likewise.
13655
136562002-10-14 Akim Demaille <akim@epita.fr>
13657
13658 Version 1.75.
13659
136602002-10-14 Akim Demaille <akim@epita.fr>
13661
13662 * tests/Makefile.am (maintainer-check-posix): New.
13663
136642002-10-14 Akim Demaille <akim@epita.fr>
13665
13666 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
13667 member.
13668
136692002-10-14 Akim Demaille <akim@epita.fr>
13670
13671 * src/tables.c (table_ninf_remap): base -> tab.
13672 Reported by Matt Rosing.
13673
136742002-10-14 Paul Eggert <eggert@twinsun.com>
13675
13676 * tests/action.at, tests/calc.at, tests/conflicts.at,
13677 tests/cxx-type.at, tests/headers.at, tests/input.at,
13678 tests/regression.at, tests/synclines.at, tests/torture.at:
13679 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
13680 so that the tests still work even if POSIXLY_CORRECT is set.
13681 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
13682
13683 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
13684 for portability to K&R hosts. Fix typo: signed char is guaranteed
13685 only to 127, not to 128.
13686 * data/glr.c (yysigned_char): New type.
13687 * data/yacc.c (yysigned_char): Likewise.
13688 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
13689
136902002-10-13 Paul Eggert <eggert@twinsun.com>
13691
13692 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
13693 true due to limited range of data type" warning from GCC.
13694
13695 * data/c.m4 (b4_token_defines): Protect against double-inclusion
13696 by wrapping enum yytokentype's definition inside #ifndef
13697 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
13698
136992002-10-13 Akim Demaille <akim@epita.fr>
13700
13701 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
13702 Un yy- yyrhs to avoid the name clash with the global YYRHS.
13703
137042002-10-13 Akim Demaille <akim@epita.fr>
13705
13706 * Makefile.maint: Update from Autoconf 2.54.
13707 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
13708
137092002-10-13 Akim Demaille <akim@epita.fr>
13710
13711 * src/print.c (print_state): Separate the list of solved conflicts
13712 from the other items.
13713 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
13714
137152002-10-13 Akim Demaille <akim@epita.fr>
13716
13717 Let nondeterministic skeletons be usable with deterministic
13718 tables.
13719
13720 With the patch, GAWK compiled by GCC without -O2 passes its test
13721 suite using a GLR parser driven by LALR tables. It fails with -O2
13722 because `struct stat' gives two different answers on my machine:
13723 88 (definition of an auto var) and later 96 (memset on this var).
13724 Hence the stack is badly corrumpted. The headers inclusion is to
13725 blame: if I move the awk.h inclusion before GLR's system header
13726 inclusion, the two struct stat have the same size.
13727
13728 * src/tables.c (pack_table): Always create conflict_table.
13729 (token_actions): Always create conflict_list.
13730 * data/glr.c (YYFLAG): Remove, unused.
13731
137322002-10-13 Akim Demaille <akim@epita.fr>
13733
13734 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
13735 (O0FLAGS): New.
13736 (VALGRIND, GXX): New.
13737 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
13738 * tests/bison.in: Run $PREBISON a pre-command.
13739 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
13740 (maintainer-check-g++): New.
13741 * Makefile.am (maintainer-check): New.
13742
137432002-10-13 Akim Demaille <akim@epita.fr>
13744
13745 * data/glr.c: Formatting changes.
13746 Tweak some trace messages to match yacc.c's.
13747
137482002-10-13 Akim Demaille <akim@epita.fr>
13749
13750 GLR parsers sometimes raise parse errors instead of performing the
13751 default reduction.
13752 Reported by Charles-Henry de Boysson.
13753
13754 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
13755 check the length of the traces when %glr.
13756 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
13757 GLR's traces.
13758 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
13759 Test GLR parsers.
13760 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
13761 (yyltype): Remove the yy prefix from the member names.
13762 (yytable): Complete its comment.
13763 (yygetLRActions): Map error action number from YYTABLE from
13764 YYTABLE_NINF to 0.
13765 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
13766 (which was a bug: it should have been YYTABEL_NINF, and yet it was
13767 not satisfying as we could compare an YYACTION computed from
13768 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
13769 only value for error actions.
13770 (yyreportParseError): In verbose parse error messages, don't issue
13771 `error' in the list of expected tokens.
13772 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
13773 next action to perform to match glr.c's decoding.
13774 (yytable): Complete its comment.
13775
137762002-10-13 Paul Eggert <eggert@twinsun.com>
13777
13778 Fix problem reported by Henrik Grubbstroem in
13779 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
13780 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
13781 because the Bison parser reads the second action before reducing
13782 the first one.
13783 * src/scan-gram.l (rule_length): New static var.
13784 Use it to keep track of the rule length in the scanner, since
13785 we can't expect the parser to be in lock-step sync with the scanner.
13786 (handle_action_dollar, handle_action_at): Use this var.
13787 * tests/actions.at (Exotic Dollars): Test for the problem.
13788
137892002-10-12 Paul Eggert <eggert@twinsun.com>
13790
13791 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
13792 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
13793 Include <sys/time.h> when checking for clock_t and struct tms.
13794 Use same include order as source.
13795 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
13796 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
13797
13798 * lib/timevar.c: Update copyright date and clarify comments.
13799 (get_time) [IN_GCC]: Keep the GCC version for reference.
13800
13801 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
13802 GCC version as of today, then merge Bison's changes.
13803 Change "GCC" to "Bison" in copyright notice. timevar.def's
13804 author is Akim, so change that too.
13805
13806 * src/reader.c (grammar_current_rule_check):
13807 Don't worry about the default action if $$ is untyped.
13808 Prevents bogus warnings reported by Jim Gifford in
13809 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
13810
13811 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
13812 * data/glr.c, data/lalr1.cc, data/yacc.c:
13813 Output token definitions before the first part of user declarations.
13814 Fixes compatibility problem reported by Jim Gifford for kbd in
13815 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
13816
138172002-10-11 Paul Eggert <eggert@twinsun.com>
13818
13819 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
13820 (yyparse): here. This undoes some of the 2002-07-25 change.
13821 Compatibility problem reported by Ralf S. Engelschall with
13822 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
13823
138242002-10-11 Akim Demaille <akim@epita.fr>
13825
13826 * tests/regression.at Characters Escapes): New.
13827 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
13828 characters.
13829 Reported by Jan Nieuwenhuizen.
13830
138312002-10-11 Akim Demaille <akim@epita.fr>
13832
13833 * po/id.po: New.
13834
138352002-10-10 Paul Eggert <eggert@twinsun.com>
13836
13837 Portability fixes for bitsets; this also avoids several GCC
13838 warnings.
13839
13840 * lib/abitset.c: Include <stddef.h>, for offsetof.
13841 * lib/lbitset.c: Likewise.
13842
13843 * lib/abitset.c (abitset_bytes): Return a size that is aligned
13844 properly for vectors of objects. Do not assume that adding a
13845 header size to a multiple of a word size yields a value that is
13846 properly aligned for the whole union.
13847 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13848
13849 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
13850 unique names for structures.
13851 * lib/ebitset.c (ebitset_bytes): Likewise.
13852 * lib/lbitset.c (lbitset_bytes): Likewise.
13853
13854 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
13855 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
13856 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
13857 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
13858 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
13859 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
13860 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
13861 to improve the type-checking that GCC can do.
13862 * lib/bitset.c (bitset_op4_cmp): Likewise.
13863 * lib/bitset_stats.c (bitset_stats_count,
13864 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
13865 bitset_stats_copy, bitset_stats_disjoint_p,
13866 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
13867 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
13868 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
13869 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
13870 bitset_stats_and_or_cmp, bitset_stats_andn_or,
13871 bitset_stats_andn_or_cmp, bitset_stats_or_and,
13872 bitset_stats_or_and_cmp): Likewise.
13873 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
13874 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
13875 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
13876 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
13877
13878 * lib/abitset.h: Include bitset.h, not bbitset.h.
13879 * lib/ebitset.h: Likewise.
13880 * lib/lbitset.h: Likewise.
13881
13882 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
13883 All instances of parameters of type enum bitset_opts are now of
13884 type enum_bitset_opts, to conform to the C Standard, and similarly
13885 for enum_bitset_type.
13886 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13887 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13888
13889 Do not use "struct bitset_struct" to mean different things in
13890 different modules. Not only is this confusing, it violates
13891 the C Standard, which requires that structure types in different
13892 modules must be compatible if one is to be passed to the other.
13893 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
13894 All instances of "struct bitset_struct *" replaced with "bitset".
13895 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
13896 (union bitset_union, struct abitset_struct, struct ebitset_struct,
13897 struct lbitset_struct, struct bitset_stats_struct): New types.
13898 All uses of struct bitset_struct changed to union bitset_union,
13899 etc.
13900 * lib/abitset.c (struct abitset_struct, abitset,
13901 struct bitset_struct): Remove.
13902 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
13903 struct bitset_struct): Remove.
13904 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
13905 bitset_struct): Remove.
13906 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
13907 Likewise.
13908
13909 Do not call a function of type T using a call that assumes the
13910 function is of a different type U. Standard C requires that a
13911 function must be called with a type that is compatible with its
13912 definition.
13913 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13914 New decls.
13915 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13916 New functions.
13917 * lib/ebitset.c (PFV): Remove.
13918 * lib/lbitset.c (PFV): Likewise.
13919 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
13920 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
13921 decls.
13922 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
13923 (ebitset_vtable): Use them.
13924 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
13925 lbitset_xor): New functions.
13926 (lbitset_vtable): Use them.
13927
13928 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
13929 Declare.
13930
13931 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
13932 GCC warning.
13933 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
13934 Use offsetof, for simplicity.
13935
139362002-10-06 Paul Eggert <eggert@twinsun.com>
13937
13938 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
13939 the same width as int. This reapplies a hunk of the 2002-08-12 patch
13940 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
13941 which was inadvertently undone by the 2002-09-30 patch.
13942 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
13943 the same width as int.
13944
139452002-10-04 Paul Eggert <eggert@twinsun.com>
13946
13947 Version 1.50.
13948
13949 * configure.ac (AC_INIT), NEWS: Increment version number.
13950
13951 * doc/bison.texinfo: Minor spelling, grammar, and white space
13952 fixes.
13953 (Symbols): Mention that any negative value returned from yylex
13954 signifies end-of-input. Warn about negative chars. Mention
13955 the portable Standard C character set.
13956
13957 The GNU coding standard says CFLAGS and YFLAGS are reserved
13958 for the installer to set.
13959 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
13960 * src/Makefile.am (AM_CFLAGS): Likewise.
13961 (AM_YFLAGS): Renamed from YFLAGS.
13962
13963 Fix some MAX and MIN problems.
13964 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
13965 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
13966 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
13967 * src/reader.c (reader): Use it.
13968
13969 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
13970 POSIX 1003.1-2001 has removed fgrep.
13971
139722002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
13973
13974 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
13975 interpreted as signed.
13976 * lib/ebitset.c (ebitset_list): Fix bug.
13977
139782002-10-01 Paul Eggert <eggert@twinsun.com>
13979
13980 More fixes for 64-bit hosts and large bitsets.
13981
13982 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
13983 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
13984 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
13985 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
13986 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
13987 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
13988 bitset_count_): Likewise.
13989 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
13990 bitset_first, bitset_last): Likewise.
13991 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
13992 bitset_stats_list_reverse, bitset_stats_size,
13993 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
13994 Likewise.
13995 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13996 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13997 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13998 bitsetv_reflexive_transitive_closure): Likewise.
13999 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
14000 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
14001 Likewise.
14002 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
14003 Likewise.
14004
14005 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
14006 Use size_t, not unsigned int, to count bytes.
14007 * lib/abitset.h (abitset_bytes): Likewise.
14008 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
14009 Likewise.
14010 * lib/bitset.h (bitset_bytes): Likewise.
14011 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
14012 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
14013 * lib/bitsetv.c (bitsetv_alloc): Likewise.
14014 * lib/ebitset.c (ebitset_bytes): Likewise.
14015 * lib/ebitset.h (ebitset_bytes): Likewise.
14016 * lib/lbitset.c (lbitset_bytes): Likewise.
14017 * lib/lbitset.h (lbitset_bytes): Likewise.
14018
14019 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
14020 abitset_subset_p, abitset_disjoint_p, abitset_and,
14021 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
14022 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
14023 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
14024 abitset_or_and, abitset_or_and_cmp):
14025 Use bitset_windex instead of unsigned int.
14026 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
14027 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
14028 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
14029 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
14030 Likewise.
14031 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
14032
14033 * lib/bitset.c (bitset_print):
14034 Use proper printf formats for widths of integer types.
14035 * lib/bitset_stats.c (bitset_percent_histogram_print,
14036 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
14037 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14038 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
14039 * lib/lbitset.c (lbitset_bytes): Likewise.
14040
14041 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
14042 BITSET_SIZE_MAX): New macros.
14043 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
14044 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
14045 to BITSET_WINDEX_MAX.
14046
14047 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
14048 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
14049 since we now return the bitset_bindex type (not int).
14050
14051 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
14052 when computing sizes.
14053 * lib/ebitset.c (ebitset_elts_grow): Likewise.
14054
14055 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
14056 and avoid cast to unsigned.
14057
140582002-09-30 Akim Demaille <akim@epita.fr>
14059
14060 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
14061 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
14062 Updates from Michael Hayes.
14063
140642002-09-30 Art Haas <ahaas@neosoft.com>
14065
14066 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
14067 invocations.
14068 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
14069 defined.
14070
140712002-09-27 Akim Demaille <akim@epita.fr>
14072
14073 Version 1.49c.
14074
140752002-09-27 Akim Demaille <akim@epita.fr>
14076
14077 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
14078 (Because of AC_LIBSOURCE).
14079
140802002-09-27 Akim Demaille <akim@epita.fr>
14081
14082 Playing with Autoscan.
14083
14084 * configure.ac: Remove the old LIBOBJ tweaks.
14085 (AC_REPLACE_FUNCS): Add strrchr and strtol.
14086 * lib/strrchr.c: New.
14087 * lib/strtol.c: New, from the Coreutils 4.5.1.
14088
140892002-09-27 Akim Demaille <akim@epita.fr>
14090
14091 Playing with Autoscan.
14092
14093 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
14094 * lib/Makefile.am (libbison_a_SOURCES): No longer include
14095 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
14096 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
14097 Coreutils 4.5.1.
14098
140992002-09-24 Akim Demaille <akim@epita.fr>
14100
14101 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
14102 (Frequently Asked Questions, Parser Stack Overflow): New.
14103
141042002-09-13 Akim Demaille <akim@epita.fr>
14105
14106 Playing with autoscan.
14107
14108 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
14109 * src/files.c (skeleton_find): Remove, unused.
14110 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
14111 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
14112
141132002-09-13 Akim Demaille <akim@epita.fr>
14114
14115 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
14116 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
14117
141182002-09-13 Akim Demaille <akim@epita.fr>
14119
14120 * configure.ac: Require 2.54.
14121 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
14122 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
14123 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
14124 Remove, provided by Autoconf macros.
14125
141262002-09-12 Akim Demaille <akim@epita.fr>
14127
14128 * m4/prereq.m4: Update, from Coreutils 4.5.1.
14129
141302002-09-12 Akim Demaille <akim@epita.fr>
14131
14132 * m4/prereq.m4: Update, from Fileutils 4.1.5.
14133 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
14134 Reported by Martin Mokrejs.
14135
141362002-09-10 Akim Demaille <akim@epita.fr>
14137
14138 * src/parse-gram.y: Associate a human readable string to each
14139 token type.
14140 * tests/regression.at (Invalid inputs): Adjust.
14141
141422002-09-10 Gary V. Vaughan <gary@gnu.org>
14143
14144 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
14145 with an Autoconf-2.5x style configure.ac.
14146
141472002-09-06 Paul Eggert <eggert@twinsun.com>
14148
14149 * doc/bison.texinfo (Conditions): Make explicit that the GPL
14150 exception applies only to yacc.c. This is a modification of a
14151 patch originally suggested by Akim Demaille.
14152
141532002-09-06 Akim Demaille <akim@epita.fr>
14154
14155 * data/c.m4 (b4_copyright): Move the GPL exception comment from
14156 here to...
14157 * data/yacc.c: here.
14158
14159 * data/lalr1.cc (struct yyltype): Don't define it, since we use
14160 LocationType.
14161 (b4_ltype): Default to yy::Location from location.hh.
14162
141632002-09-04 Jim Meyering <jim@meyering.net>
14164
14165 * data/yacc.c: Guard the declaration of yytoknum also with
14166 `#ifdef YYPRINT', so it is declared only when used.
14167
141682002-09-04 Akim Demaille <akim@epita.fr>
14169
14170 * configure.in: Rename as...
14171 * configure.ac: this.
14172 Bump to 1.49c.
14173
141742002-09-04 Akim Demaille <akim@epita.fr>
14175
14176 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
14177 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
14178 translate maintainer only messages.
14179
141802002-08-12 Paul Eggert <eggert@twinsun.com>
14181
14182 Version 1.49b.
14183
14184 * Makefile.am (SUBDIRS): Remove intl.
14185 (DISTCLEANFILES): Remove.
14186 * NEWS: Mention that GNU M4 is now required. Clarify what is
14187 meant by "larger grammars". Mention the pt_BR translation.
14188 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
14189 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
14190 Bump version from 0.11.2 to 0.11.5.
14191 (BISON_PREREQ_STAGE): Remove.
14192 (AM_GNU_GETTEXT): Use external gettext.
14193 (AC_OUTPUT): Remove intl/Makefile.
14194
14195 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
14196
14197 * data/glr.c: Include string.h, for strlen.
14198 (yyreportParseError): Use size_t for yysize.
14199 (yy_yypstack): No longer nested inside yypstates, as nested
14200 functions are not portable. Do not assume size_t is the
14201 same width as int.
14202 (yypstates): Do not assume that ptrdiff_t is the same width
14203 as int, and similarly for yyposn and YYINDEX.
14204
14205 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
14206
14207 * lib/Makefile.am (INCLUDES): Do not include from the intl
14208 directory, which has been removed.
14209 * src/Makefile.am (INCLUDES): Likewise.
14210
14211 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
14212 (bitsets_sources, additional_bitsets_sources, timevars_sources):
14213 New vars.
14214
14215 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
14216 * tests/Makefile.am (EXTRA_DIST): Likewise.
14217
14218 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
14219 Do not assume that bitset_windex is the same width as unsigned.
14220
14221 * lib/abitset.c (abitset_unused_clear): Do not assume that
14222 bitset_word is the same width as int.
14223 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
14224 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
14225 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
14226 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
14227 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
14228
14229 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
14230 portability to one's complement hosts!).
14231 * lib/ebitset.c (ebitset_op1): Likewise.
14232 * lib/lbitset.c (lbitset_op1): Likewise.
14233
14234 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
14235 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
14236 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
14237 Sync with fileutils.
14238 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
14239 lib/gettext.h: Sync with diffutils.
14240
14241 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
14242 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
14243
14244 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
14245 PROTOTYPES to check for prototypes, and "defined __STDC__" to
14246 check for void *.
14247
14248 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
14249 size_t; the old version tried to do this but casted improperly.
14250 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
14251 (bitset_test): Now returns int, not unsigned long.
14252
14253 * lib/bitset_stats.c: Include "gettext.h".
14254 (_): New macro.
14255 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
14256 name locals "index", as it generates unnecessary warnings on some
14257 hosts that have an "index" function.
14258
14259 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
14260 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
14261 they need translation.
14262 * src/LR0.c (state_list_append, new_itemsets, get_state,
14263 append_states, generate_states): Likewise.
14264 * src/assoc.c (assoc_to_string): Likewise.
14265 * src/closure.c (print_closure, set_firsts, closure): Likewise.
14266 * src/gram.c (grammar_dump): Likewise.
14267 * src/injections.c (injections_compute): Likewise.
14268 * src/lalr.c (lookaheads_print): Likewise.
14269 * src/relation.c (relation_transpose): Likewise.
14270 * src/scan-gram.l: Likewise.
14271 * src/tables.c (table_grow, pack_vector): Likewise.
14272
14273 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
14274 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
14275 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
14276 * m4/mbstate_t.m4: Sync with fileutils.
14277 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
14278
14279 * po/LINGUAS: Add pt_BR.
14280 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
14281 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
14282 lib/timevar.c.
14283 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
14284 manual recommends.
14285 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
14286
14287 * src/complain.c (strerror_r): Remove decl; not needed.
14288 (strerror): Use same pattern as ../lib/error.c.
14289
14290 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
14291
14292 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
14293
14294 * src/main.c (main): Cast result of bindtextdomain and textdomain
14295 to void, to avoid a GCC warning when --disable-nls is in effect.
14296
14297 * src/scan-gram.l: Use strings rather than escapes when possible,
14298 to minimize the number of warnings from xgettext.
14299 (handle_action_dollar, handle_action_at): Don't use isdigit,
14300 as it mishandles negative chars and it may not work as expected
14301 outside the C locale.
14302
14303 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
14304 this is a GCC extension and is not portable to other compilers.
14305
14306 * src/system.h (alloca): Use same pattern as ../lib/error.c.
14307 Do not include <ctype.h>; no longer needed.
14308 Do not include <malloc.h>; no longer needed (and generates
14309 warnings on OpenBSD 3.0).
14310
14311 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
14312 it's not portable.
14313
14314 * tests/regression.at: Do not use 'cc -c input.c -o input';
14315 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
14316
14317 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
14318 exit status as failure, not just exit status 1. Sun C exits
14319 with status 2 sometimes.
14320
14321 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
14322 Use it for the two large tests.
14323
143242002-08-02 Akim Demaille <akim@epita.fr>
14325
14326 * src/conflicts.c (conflicts_output): Don't output rules never
14327 reduced here, since anyway that computation doesn't work.
14328 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
14329 (rule_useless_p, rule_never_reduced_p): New.
14330 (grammar_rules_partial_print): Use a filter instead of a range.
14331 Display the title only if needed.
14332 (grammar_rules_print): Adjust.
14333 (grammar_rules_never_reduced_report): New.
14334 * src/tables.c (action_row): Move the computation of rules never
14335 reduced to...
14336 (token_actions): here.
14337 * src/main.c (main): Make the parser before making the report, so
14338 that rules never reduced are computed.
14339 Call grammar_rules_never_reduced_report.
14340 * src/print.c (print_results): Report rules never reduced.
14341 * tests/conflicts.at, tests/reduce.at: Adjust.
14342
143432002-08-01 Akim Demaille <akim@epita.fr>
14344
14345 Instead of attaching lookaheads and duplicating the rules being
14346 reduced by a state, attach the lookaheads to the reductions.
14347
14348 * src/state.h (state_t): Remove the `lookaheads',
14349 `lookaheads_rule' member.
14350 (reductions_t): Add a `lookaheads' member.
14351 Use a regular array for the `rules'.
14352 * src/state.c (reductions_new): Initialize the lookaheads member
14353 to 0.
14354 (state_rule_lookaheads_print): Adjust.
14355 * src/state.h, src/state.c (state_reductions_find): New.
14356 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
14357 (count_rr_conflicts): Adjust.
14358 * src/lalr.c (LArule): Remove.
14359 (add_lookback_edge): Adjust.
14360 (state_lookaheads_count): New.
14361 (states_lookaheads_initialize): Merge into...
14362 (initialize_LA): this.
14363 (lalr_free): Adjust.
14364 * src/main.c (main): Don't free nullable and derives too early: it
14365 is used by --verbose.
14366 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
14367
143682002-08-01 Akim Demaille <akim@epita.fr>
14369
14370 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
14371 `rule_number_t**'.
14372 (set_derives, free_derives): Rename as...
14373 (derives_compute, derives_free): this.
14374 Adjust all dependencies.
14375 * src/nullable.c (set_nullable, free_nullable): Rename as...
14376 (nullable_compute, nullable_free): these.
14377 (rule_list_t): Store rule_t *, not rule_number_t.
14378 * src/state.c (state_rule_lookaheads_print): Directly compare rule
14379 pointers, instead of their numbers.
14380 * src/main.c (main): Call nullable_free, and derives_free earlier,
14381 as they were lo longer used.
14382
143832002-08-01 Akim Demaille <akim@epita.fr>
14384
14385 * lib/timevar.c (get_time): Include children time.
14386 * src/lalr.h (LA, LArule): Don't export them: used with the
14387 state_t.
14388 * src/lalr.c (LA, LArule): Static.
14389 * src/lalr.h, src/lalr.c (lalr_free): New.
14390 * src/main.c (main): Call it.
14391 * src/tables.c (pack_vector): Check whether loc is >= to the
14392 table_size, not >.
14393 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
14394 (tables_generate): do it, since that's also it which allocates
14395 them.
14396 Don't free LA and LArule, main does.
14397
143982002-07-31 Akim Demaille <akim@epita.fr>
14399
14400 Separate parser tables computation and output.
14401
14402 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
14403 (conflict_list, conflict_list_cnt, table, check, table_ninf)
14404 (yydefgoto, yydefact, high): Move to...
14405 * src/tables.h, src/tables.c: here.
14406 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14407 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14408 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
14409 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
14410 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
14411 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
14412 (action_row, save_row, token_actions, save_column, default_goto)
14413 (goto_actions, sort_actions, matching_state, pack_vector)
14414 (table_ninf_remap, pack_table, prepare_actions): Move to...
14415 * src/tables.c: here.
14416 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
14417 * src/output.c (token_actions, output_base, output_conflicts)
14418 (output_check): Merge into...
14419 (prepare_actions): this.
14420 (actions_output): Rename as...
14421 (user_actions_output): this.
14422 * src/main.c (main): Call tables_generate and tables_free.
14423
144242002-07-31 Akim Demaille <akim@epita.fr>
14425
14426 Steal GCC's --time-report support.
14427
14428 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
14429 stolen/adjusted from GCC.
14430 * m4/stage.m4: Remove time related checks.
14431 * m4/timevar.m4: New.
14432 * configure.in: Adjust.
14433 * src/system.h: Adjust to using timevar.h.
14434 * src/getargs.h, src/getargs.c: Support trace_time for
14435 --trace=time.
14436 * src/main.c (stage): Remove.
14437 (main): Replace `stage' invocations with timevar calls.
14438 * src/output.c: Insert pertinent timevar calls.
14439
144402002-07-31 Akim Demaille <akim@epita.fr>
14441
14442 Let --trace have arguments.
14443
14444 * src/getargs.h (enum trace_e): New.
14445 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
14446 (long_options, short_options): --trace/-T takes an optional
14447 argument.
14448 Change all the uses of trace_flag to reflect the new flags.
14449 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
14450
14451 Strengthen `stage' portability.
14452
14453 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
14454 * configure.in: Use it.
14455 Don't check for malloc.h and sys/times.h.
14456 * src/system.h: Include them when appropriate.
14457 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
14458 times and struct tms are available.
14459
144602002-07-30 Akim Demaille <akim@epita.fr>
14461
14462 In verbose parse error message, don't report `error' as an
14463 expected token.
14464 * tests/actions.at (Printers and Destructors): Adjust.
14465 * tests/calc.at (Calculator $1): Adjust.
14466 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
14467 error message, do not report the parser accepts the error token in
14468 that state.
14469
144702002-07-30 Akim Demaille <akim@epita.fr>
14471
14472 Normalize conflict related messages.
14473
14474 * src/complain.h, src/complain.c (warn, complain): New.
14475 * src/conflicts.c (conflicts_print): Use them.
14476 (conflict_report_yacc): New, extracted from...
14477 (conflicts_print): here.
14478 * tests/conflicts.at, tests/existing.at: Adjust.
14479
144802002-07-30 Akim Demaille <akim@epita.fr>
14481
14482 Report rules which are never reduced by the parser: those hidden
14483 by conflicts.
14484
14485 * src/LR0.c (save_reductions): Don't make the final state too
14486 different: save its reduction (accept) instead of having a state
14487 without any action (no shift or goto, no reduce).
14488 Note: the final state is now a ``regular'' state, i.e., the
14489 parsers now contain `reduce 0' as default reduction.
14490 Nevertheless, since they decide to `accept' when yystate =
14491 final_state, they still will not reduce rule 0.
14492 * src/print.c (print_actions, print_reduction): Adjust.
14493 * src/output.c (action_row): Track reduced rules.
14494 (token_actions): Report rules never reduced.
14495 * tests/conflicts.at, tests/regression.at: Adjust.
14496
144972002-07-30 Akim Demaille <akim@epita.fr>
14498
14499 `stage' was accidently included in a previous patch.
14500 Initiate its autoconfiscation.
14501
14502 * configure.in: Look for malloc.h and sys/times.h.
14503 * src/main.c (stage): Adjust.
14504 Report only when trace_flag.
14505
145062002-07-29 Akim Demaille <akim@epita.fr>
14507
14508 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
14509 state_number_t.
14510 (errs_t): symbol_t*, not symbol_number_t.
14511 (reductions_t): rule_t*, not rule_number_t.
14512 (FOR_EACH_SHIFT): New.
14513 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
14514 * src/print.c, src/print_graph.c: Adjust.
14515
145162002-07-29 Akim Demaille <akim@epita.fr>
14517
14518 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
14519
14520 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
14521 (endtoken, accept): these.
14522 * src/reader.c (reader): Set endtoken's default tag to "$end".
14523 Set undeftoken's tag to "$undefined" instead of "$undefined.".
14524 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
14525 Adjust.
14526
145272002-07-29 Akim Demaille <akim@epita.fr>
14528
14529 * src/reduce.c (reduce_grammar): When the language is empty,
14530 complain about the start symbol, not the axiom.
14531 Use its location.
14532 * tests/reduce.at (Empty Language): New.
14533
145342002-07-26 Akim Demaille <akim@epita.fr>
14535
14536 * src/reader.h, src/reader.c (gram_error): ... can't get
14537 yycontrol without making too strong assumptions on the parser
14538 itself.
14539 * src/output.c (prepare_tokens): Use the real 0th value of
14540 token_translations instead of `0'.
14541 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
14542 visible here.
14543 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
14544 for the time being: %locations ought to provide it to yyerror.
14545
145462002-07-25 Akim Demaille <akim@epita.fr>
14547
14548 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
14549 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
14550 * tests/regression.at (Web2c Actions): Adjust.
14551
145522002-07-25 Akim Demaille <akim@epita.fr>
14553
14554 Stop storing rules from 1 to nrules + 1.
14555
14556 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
14557 * src/nullable.c, src/output.c, src/print.c, src/reader.c
14558 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
14559 Iterate from 0 to nrules.
14560 Use rule_number_as_item_number and item_number_as_rule_number.
14561 Adjust to `derive' now containing possibly 0.
14562 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
14563 Handle the `- 1' part in rule numbers from/to item numbers.
14564 * src/conflicts.c (log_resolution): Fix the message which reversed
14565 shift and reduce.
14566 * src/output.c (action_row): Initialize default_rule to -1.
14567 (token_actions): Adjust.
14568 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
14569 expected output.
14570 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
14571
145722002-07-25 Akim Demaille <akim@epita.fr>
14573
14574 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
14575 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
14576 (b4_c_knr_arg_decl): New.
14577 * data/yacc.c: Use it to define yysymprint, yydestruct, and
14578 yyreport_parse_error.
14579
145802002-07-25 Akim Demaille <akim@epita.fr>
14581
14582 * data/yacc.c (yyreport_parse_error): New, extracted from...
14583 (yyparse): here.
14584 (yydestruct, yysymprint): Move above yyparse.
14585 Be K&R compliant.
14586
145872002-07-25 Akim Demaille <akim@epita.fr>
14588
14589 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
14590 replace...
14591 (b4_sint_type, b4_uint_type): these.
14592 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
14593 * tests/regression.at (Web2c Actions): Adjust.
14594
145952002-07-25 Akim Demaille <akim@epita.fr>
14596
14597 * src/gram.h (TIEM_NUMBER_MAX): New.
14598 (item_number_of_rule_number, rule_number_of_item_number): Rename
14599 as...
14600 (rule_number_as_item_number, item_number_as_rule_number): these.
14601 Adjust dependencies.
14602 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14603 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14604 (symbol_number_to_vector_number): New.
14605 (order): Of vector_number_t* type.
14606 (base_t, BASE_MAX, BASE_MIN): New.
14607 (froms, tos, width, pos, check): Of base_t type.
14608 (action_number_t, ACTION_MIN, ACTION_MAX): New.
14609 (actrow): Of action_number_t type.
14610 (conflrow): Of unsigned int type.
14611 (table_ninf, base_ninf): New.
14612 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
14613 (muscle_insert_int_table, muscle_insert_base_table)
14614 (muscle_insert_rule_number_table): New.
14615 (prepare_tokens): Output `toknum' as int_table.
14616 (action_row): Returns a rule_number_t.
14617 Use ACTION_MIN, not SHRT_MIN.
14618 (token_actions): yydefact is rule_number_t*.
14619 (table_ninf_remap): New.
14620 (pack_table): Use it for `base' and `table'.
14621 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
14622 replaced with...
14623 (YYPACT_NINF, YYTABLE_NINF): these.
14624 (yypact, yytable): Compute their types instead of hard-coded
14625 `short'.
14626 * tests/regression.at (Web2c Actions): Adjust.
14627
146282002-07-19 Akim Demaille <akim@epita.fr>
14629
14630 * src/scan-gram.l (id): Can start with an underscore.
14631
146322002-07-16 Akim Demaille <akim@epita.fr>
14633
14634 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
14635 Adjust all former `associativity' dependencies.
14636 * src/symtab.c (symbol_new): Default associativity is `undef', not
14637 `right'.
14638 (symbol_check_alias_consistence): Adjust.
14639
146402002-07-09 Akim Demaille <akim@epita.fr>
14641
14642 * doc/bison.texinfo: Properly set the ``header'' part.
14643 Use @dircategory ``GNU programming tools'' as per Texinfo's
14644 documentation.
14645 Use @copying.
14646
146472002-07-09 Akim Demaille <akim@epita.fr>
14648
14649 * lib/quotearg.h: Protect against multiple inclusions.
14650 * src/location.h (location_t): Add a `file' member.
14651 (LOCATION_RESET, LOCATION_PRINT): Adjust.
14652 * src/complain.c (warn_at, complain_at, fatal_at): Drop
14653 `error_one_per_line' support.
14654
146552002-07-09 Akim Demaille <akim@epita.fr>
14656
14657 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
14658 * src/reader.c (lineno): Remove.
14659 Adjust all dependencies.
14660 (get_merge_function): Take a location and use complain_at.
14661 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
14662 * tests/regression.at (Invalid inputs, Mixing %token styles):
14663 Adjust.
14664
146652002-07-09 Akim Demaille <akim@epita.fr>
14666
14667 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
14668 recovery rule, and forbid extensions when --yacc.
14669 (gram_error): Use complain_at.
14670 * src/reader.c (reader): Exit if there were parse errors.
14671
146722002-07-09 Akim Demaille <akim@epita.fr>
14673
14674 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
14675 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
14676 Reported by R Blake <blakers@mac.com>.
14677
146782002-07-09 Akim Demaille <akim@epita.fr>
14679
14680 * data/yacc.c: Output the copyright notive in the header.
14681
146822002-07-03 Akim Demaille <akim@epita.fr>
14683
14684 * src/output.c (froms, tos): Are state_number_t.
14685 (save_column): sp, sp1, and sp2 are state_number_t.
14686 (prepare): Rename `final' as `final_state_number', `nnts' as
14687 `nterms_number', `nrules' as `rules_number', `nstates' as
14688 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
14689 unused.
14690 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
14691 * data/lalr1.cc (nsym_): Remove, unused.
14692
146932002-07-03 Akim Demaille <akim@epita.fr>
14694
14695 * src/lalr.h, src/lalr.c (goto_number_t): New.
14696 * src/lalr.c (goto_list_t): New.
14697 Propagate them.
14698 * src/nullable.c (rule_list_t): New.
14699 Propagate.
14700 * src/types.h: Remove.
14701
147022002-07-03 Akim Demaille <akim@epita.fr>
14703
14704 * src/closure.c (print_fderives): Use rule_rhs_print.
14705 * src/derives.c (print_derives): Use rule_rhs_print.
14706 (rule_list_t): New, replaces `shorts'.
14707 (set_derives): Add comments.
14708 * tests/sets.at (Nullable, Firsts): Adjust.
14709
147102002-07-03 Akim Demaille <akim@epita.fr>
14711
14712 * src/output.c (prepare_actions): Free `tally' and `width'.
14713 (prepare_actions): Allocate and free `order'.
14714 * src/symtab.c (symbols_free): Free `symbols'.
14715 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
14716 * src/output.c (m4_invoke): Move to...
14717 * src/scan-skel.l: here.
14718 (<<EOF>>): Close yyout, and free its name.
14719
147202002-07-03 Akim Demaille <akim@epita.fr>
14721
14722 Fix some memory leaks, and fix a bug: state 0 was examined twice.
14723
14724 * src/LR0.c (new_state): Merge into...
14725 (state_list_append): this.
14726 (new_states): Merge into...
14727 (generate_states): here.
14728 (set_states): Don't ensure a proper `errs' state member here, do it...
14729 * src/conflicts.c (conflicts_solve): here.
14730 * src/state.h, src/state.c: Comment changes.
14731 (state_t): Rename member `shifts' as `transitions'.
14732 Adjust all dependencies.
14733 (errs_new): For consistency, also take the values as argument.
14734 (errs_dup): Remove.
14735 (state_errs_set): New.
14736 (state_reductions_set, state_transitions_set): Assert that no
14737 previous value was assigned.
14738 (state_free): New.
14739 (states_free): Use it.
14740 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
14741 temporary storage: use `errs' and `nerrs' as elsewhere.
14742 (set_conflicts): Allocate and free this `errs'.
14743
147442002-07-02 Akim Demaille <akim@epita.fr>
14745
14746 * lib/libiberty.h: New.
14747 * lib: Update the bitset implementation from upstream.
14748 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
14749 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
14750 * src/main.c: Adjust bitset stats calls.
14751
147522002-07-01 Paul Eggert <eggert@twinsun.com>
14753
14754 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
14755 char, so that negative chars don't collide with $.
14756
147572002-06-30 Akim Demaille <akim@epita.fr>
14758
14759 Have the GLR tests be `warning' checked, and fix the warnings.
14760
14761 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
14762 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
14763 (yyremoveDeletes): `yyi' and `yyj' are size_t.
14764 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
14765 (yyaddDeferredAction): static.
14766 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
14767 (yyreportParseError): yyprefix is const.
14768 yytokenp is used only when verbose.
14769 (yy__GNUC__): Replace with __GNUC__.
14770 (yypdumpstack): yyi is size_t.
14771 (yypreference): Un-yy local variables and arguments, to avoid
14772 clashes with `yyr1'. Anyway, we are not in the user name space.
14773 (yytname_size): be an int, as is compared with ints.
14774 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
14775 Use them.
14776 * tests/cxx-gram.at: Use quotation to protect $1.
14777 Use AT_COMPILE to enable warnings hunts.
14778 Prototype yylex and yyerror.
14779 `Use' argc.
14780 Include `string.h', not `strings.h'.
14781 Produce and prototype stmtMerge only when used.
14782 yylex takes a location.
14783
147842002-06-30 Akim Demaille <akim@epita.fr>
14785
14786 We spend a lot of time in quotearg, in particular when --verbose.
14787
14788 * src/symtab.c (symbol_get): Store a quoted version of the key.
14789 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
14790 Adjust all callers.
14791
147922002-06-30 Akim Demaille <akim@epita.fr>
14793
14794 * src/state.h (reductions_t): Rename member `nreds' as num.
14795 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
14796 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
14797
147982002-06-30 Akim Demaille <akim@epita.fr>
14799
14800 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
14801 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
14802 (shifts_to): Rename as...
14803 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
14804 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
14805 (TRANSITION_IS_DISABLED, transitions_to): these.
14806
148072002-06-30 Akim Demaille <akim@epita.fr>
14808
14809 * src/print.c (print_shifts, print_gotos): Merge into...
14810 (print_transitions): this.
14811 (print_transitions, print_errs, print_reductions): Align the
14812 lookaheads columns.
14813 (print_core, print_transitions, print_errs, print_state,
14814 print_grammar): Output empty lines separator before, not after.
14815 (state_default_rule_compute): Rename as...
14816 (state_default_rule): this.
14817 * tests/conflicts.at (Defaulted Conflicted Reduction),
14818 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
14819 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
14820
148212002-06-30 Akim Demaille <akim@epita.fr>
14822
14823 Display items as we display rules.
14824
14825 * src/gram.h, src/gram.c (rule_lhs_print): New.
14826 * src/gram.c (grammar_rules_partial_print): Use it.
14827 * src/print.c (print_core): Likewise.
14828 * tests/conflicts.at (Defaulted Conflicted Reduction),
14829 (Unresolved SR Conflicts): Adjust.
14830 (Unresolved SR Conflicts): Adjust and rename as...
14831 (Resolved SR Conflicts): this, as was meant.
14832 * tests/regression.at (Web2c Report): Adjust.
14833
148342002-06-30 Akim Demaille <akim@epita.fr>
14835
14836 * src/print.c (state_default_rule_compute): New, extracted from...
14837 (print_reductions): here.
14838 Pessimize, but clarify the code.
14839 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
14840
148412002-06-30 Akim Demaille <akim@epita.fr>
14842
14843 * src/output.c (action_row): Let default_rule be always a rule
14844 number.
14845
148462002-06-30 Akim Demaille <akim@epita.fr>
14847
14848 * src/closure.c (print_firsts, print_fderives, closure):
14849 Use BITSET_EXECUTE.
14850 * src/lalr.c (lookaheads_print): Likewise.
14851 * src/state.c (state_rule_lookaheads_print): Likewise.
14852 * src/print_graph.c (print_core): Likewise.
14853 * src/print.c (print_reductions): Likewise.
14854 * src/output.c (action_row): Likewise.
14855 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
14856
148572002-06-30 Akim Demaille <akim@epita.fr>
14858
14859 * src/print_graph.c: Use report_flag.
14860
148612002-06-30 Akim Demaille <akim@epita.fr>
14862
14863 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
14864 to...
14865 * src/relation.h, src/relation.c (traverse, relation_digraph)
14866 (relation_print, relation_transpose): New.
14867
148682002-06-30 Akim Demaille <akim@epita.fr>
14869
14870 * src/state.h, src/state.c (shifts_to): New.
14871 * src/lalr.c (build_relations): Use it.
14872
148732002-06-30 Akim Demaille <akim@epita.fr>
14874
14875 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
14876 (item_number_of_rule_number, rule_number_of_item_number): New.
14877 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
14878 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14879 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
14880 Propagate their use.
14881 Much remains to be done, in particular wrt `shorts' from types.h.
14882
148832002-06-30 Akim Demaille <akim@epita.fr>
14884
14885 * src/symtab.c (symbol_new): Initialize the `printer' member.
14886
148872002-06-30 Akim Demaille <akim@epita.fr>
14888
14889 * src/LR0.c (save_reductions): Remove, replaced by...
14890 * src/state.h, src/state.c (state_reductions_set): New.
14891 (reductions, errs): Rename as...
14892 (reductions_t, errs_t): these.
14893 Adjust all dependencies.
14894
148952002-06-30 Akim Demaille <akim@epita.fr>
14896
14897 * src/LR0.c (state_list_t, state_list_append): New.
14898 (first_state, last_state): Now symbol_list_t.
14899 (this_state): Remove.
14900 (new_itemsets, append_states, save_reductions): Take a state_t as
14901 argument.
14902 (set_states, generate_states): Adjust.
14903 (save_shifts): Remove, replaced by...
14904 * src/state.h, src/state.c (state_shifts_set): New.
14905 (shifts): Rename as...
14906 (shifts_t): this.
14907 Adjust all dependencies.
14908 * src/state.h (state_t): Remove the `next' member.
14909
149102002-06-30 Akim Demaille <akim@epita.fr>
14911
14912 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
14913 escaped in slot 0.
14914
149152002-06-30 Akim Demaille <akim@epita.fr>
14916
14917 Use hash.h for the state hash table.
14918
14919 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
14920 (allocate_storage): Use state_hash_new.
14921 (free_storage): Use state_hash_free.
14922 (new_state, get_state): Adjust.
14923 * src/lalr.h, src/lalr.c (states): Move to...
14924 * src/states.h (state_t): Remove the `link' member, no longer
14925 used.
14926 * src/states.h, src/states.c: here.
14927 (state_hash_new, state_hash_free, state_hash_lookup)
14928 (state_hash_insert, states_free): New.
14929 * src/states.c (state_table, state_compare, state_hash): New.
14930 * src/output.c (output_actions): Do not free states now, since we
14931 still need to know the final_state number in `prepare', called
14932 afterwards. Do it...
14933 * src/main.c (main): here: call states_free after `output'.
14934
149352002-06-30 Akim Demaille <akim@epita.fr>
14936
14937 * src/state.h, src/state.c (state_new): New, extracted from...
14938 * src/LR0.c (new_state): here.
14939 * src/state.h (STATE_ALLOC): Move to...
14940 * src/state.c: here.
14941 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
14942 * src/state.h, src/state.c: here.
14943
149442002-06-30 Akim Demaille <akim@epita.fr>
14945
14946 * src/reader.c (gensym): Rename as...
14947 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
14948 (getsym): Rename as...
14949 (symbol_get): this.
14950
149512002-06-30 Akim Demaille <akim@epita.fr>
14952
14953 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
14954 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
14955 * src/output.c, src/print.c, src/print_graph.c: Propagate.
14956 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
14957
149582002-06-30 Akim Demaille <akim@epita.fr>
14959
14960 Make the test suite pass with warnings checked.
14961
14962 * tests/actions.at (Printers and Destructors): Improve.
14963 Avoid unsigned vs. signed issues.
14964 * tests/calc.at: Don't exercise the scanner here, do it...
14965 * tests/input.at (Torturing the Scanner): here.
14966
149672002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14968
14969 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
14970 reorganize first lines parallel to yacc.c.
14971
149722002-06-28 Akim Demaille <akim@epita.fr>
14973
14974 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
14975 (b4_token_enum, b4_token_defines): New, factored from...
14976 * data/lalr1.cc, data/yacc.c, glr.c: here.
14977
149782002-06-28 Akim Demaille <akim@epita.fr>
14979
14980 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
14981 unused variables.
14982 * src/output.c (merger_output): static.
14983
149842002-06-28 Akim Demaille <akim@epita.fr>
14985
14986 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
14987 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
14988 pacify GCC.
14989 * src/output.c (save_row): Initialize all the variables to pacify GCC.
14990
149912002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14992
14993 Accumulated changelog for new GLR parsing features.
14994
14995 * src/conflicts.c (count_total_conflicts): Change name to
14996 conflicts_total_count.
14997 * src/conflicts.h: Ditto.
14998 * src/output.c (token_actions): Use the new name.
14999 (output_conflicts): Change conflp => conflict_list_heads, and
15000 confl => conflict_list for better readability.
15001 * data/glr.c: Use the new names.
15002 * NEWS: Add self to GLR announcement.
15003
15004 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
15005
15006 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
15007 Akim Demaille.
15008
15009 * data/bison.glr: Change name to glr.c
15010 * data/glr.c: Renamed from bison.glr.
15011 * data/Makefile.am: Add glr.c
15012
15013 * src/getargs.c:
15014
15015 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
15016 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
15017
15018 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15019
15020 * data/bison.glr: Be sure to restore the
15021 current #line when returning to the skeleton contents after having
15022 exposed the input file's #line.
15023
15024 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15025
15026 * data/bison.glr: Bring up to date with changes to bison.simple.
15027
15028 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15029
15030 * data/bison.glr: Correct definitions that use b4_prefix.
15031 Various reformatting.
15032 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
15033 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
15034 yytokenp argument; now part of stack.
15035 (yychar): Define to behave as documented.
15036 (yyclearin): Ditto.
15037
15038 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15039
15040 * src/reader.h: Add declaration for free_merger_functions.
15041
15042 * src/reader.c (merge_functions): New variable.
15043 (get_merge_function): New function.
15044 (free_merger_functions): New function.
15045 (readgram): Check for %prec that is not followed by a symbol.
15046 Handle %dprec and %merge declarations.
15047 (packgram): Initialize dprec and merger fields in rules array.
15048
15049 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
15050 conflict_list_cnt, conflict_list_free): New variables.
15051 (table_grow): Also grow conflict_table.
15052 (prepare_rules): Output dprec and merger tables.
15053 (conflict_row): New function.
15054 (action_row): Output conflict lists for GLR parser. Don't use
15055 default reduction in conflicted states for GLR parser so that there
15056 are spaces for the conflict lists.
15057 (save_row): Also save conflict information.
15058 (token_actions): Allocate conflict list.
15059 (merger_output): New function.
15060 (pack_vector): Pack conflict table, too.
15061 (output_conflicts): New function to output yyconflp and yyconfl.
15062 (output_check): Allocate conflict_tos.
15063 (output_actions): Output conflict tables, also.
15064 (output_skeleton): Output b4_mergers definition.
15065 (prepare): Output b4_max_rhs_length definition.
15066 Use 'bison.glr' as default skeleton for GLR parsers.
15067
15068 * src/gram.c (glr_parser): New flag.
15069 (grammar_free): Call free_merger_functions.
15070
15071 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
15072 all pairs of conflicting reductions, rather than just all tokens
15073 causing conflicts. Needed to size conflict tables.
15074 (conflicts_output): Modify call to count_rr_conflicts for new
15075 interface.
15076 (conflicts_print): Ditto.
15077 (count_total_conflicts): New function.
15078
15079 * src/reader.h (merger_list): New type.
15080 (merge_functions): New variable.
15081
15082 * src/lex.h (tok_dprec, tok_merge): New token types.
15083
15084 * src/gram.h (rule_s): Add dprec and merger fields.
15085 (glr_parser): New flag.
15086
15087 * src/conflicts.h (count_total_conflicts): New function.
15088
15089 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
15090
15091 * doc/bison.texinfo (Generalized LR Parsing): New section.
15092 (GLR Parsers): New section.
15093 (Language and Grammar): Mention GLR parsing.
15094 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
15095 Correct typo ("tge" -> "the").
15096
15097 * data/bison.glr: New skeleton for GLR parsing.
15098
15099 * tests/cxx-gram.at: New tests for GLR parsing.
15100
15101 * tests/testsuite.at: Include cxx-gram.at.
15102
15103 * tests/Makefile.am: Add cxx-gram.at.
15104
15105 * src/parse-gram.y:
15106
15107 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
15108
15109 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
15110
151112002-06-27 Akim Demaille <akim@epita.fr>
15112
15113 * src/options.h, src/options.c: Remove.
15114 * src/getargs.c (short_options, long_options): New.
15115
151162002-06-27 Akim Demaille <akim@epita.fr>
15117
15118 * data/bison.simple, data/bison.c++: Rename as...
15119 * data/yacc.c, data/lalr1.cc: these.
15120 * doc/bison.texinfo (Environment Variables): Remove.
15121
151222002-06-25 Raja R Harinath <harinath@cs.umn.edu>
15123
15124 * src/getargs.c (report_argmatch): Initialize strtok().
15125
151262002-06-20 Akim Demaille <akim@epita.fr>
15127
15128 * data/bison.simple (b4_symbol_actions): New, replaces...
15129 (b4_symbol_destructor, b4_symbol_printer): these.
15130 (yysymprint): Be sure to call YYPRINT only for tokens, and using
15131 user token numbers.
15132
151332002-06-20 Akim Demaille <akim@epita.fr>
15134
15135 * data/bison.simple (yydestructor): Rename as...
15136 (yydestruct): this.
15137
151382002-06-20 Akim Demaille <akim@epita.fr>
15139
15140 * src/symtab.h, src/symtab.c (symbol_type_set)
15141 (symbol_destructor_set, symbol_precedence_set): The location is
15142 the last argument.
15143 Adjust all callers.
15144
151452002-06-20 Akim Demaille <akim@epita.fr>
15146
15147 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
15148 internals.
15149 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
15150 Takes a location.
15151 * src/symtab.h, src/symtab.c (symbol_class_set)
15152 (symbol_user_token_number_set): Likewise.
15153 Adjust all callers.
15154 Promote complain_at.
15155 * tests/input.at (Type Clashes): Adjust.
15156
151572002-06-20 Akim Demaille <akim@epita.fr>
15158
15159 * data/bison.simple (YYLEX): Fix the declaration when
15160 %pure-parser.
15161
151622002-06-20 Akim Demaille <akim@epita.fr>
15163
15164 * data/bison.simple (yysymprint): Don't print the token number,
15165 just its name.
15166 * tests/actions.at (Destructors): Rename as...
15167 (Printers and Destructors): this.
15168 Also exercise %printer.
15169
151702002-06-20 Akim Demaille <akim@epita.fr>
15171
15172 * data/bison.simple (YYDSYMPRINT): New.
15173 Use it to remove many of the #if YYDEBUG/if (yydebug).
15174
151752002-06-20 Akim Demaille <akim@epita.fr>
15176
15177 * src/symtab.h, src/symtab.c (symbol_t): printer and
15178 printer_location are new members.
15179 (symbol_printer_set): New.
15180 * src/parse-gram.y (PERCENT_PRINTER): New token.
15181 Handle its associated rule.
15182 * src/scan-gram.l: Adjust.
15183 (handle_destructor_at, handle_destructor_dollar): Rename as...
15184 (handle_symbol_code_at, handle_symbol_code_dollar): these.
15185 * src/output.c (symbol_printers_output): New.
15186 (output_skeleton): Call it.
15187 * data/bison.simple (yysymprint): New. Cannot be named yyprint
15188 since there are already many grammar files with a user `yyprint'.
15189 Replace the calls to YYPRINT to calls to yysymprint.
15190 * tests/calc.at: Adjust.
15191 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
15192 taking advantage of parser very internal details (stack size!).
15193
151942002-06-20 Akim Demaille <akim@epita.fr>
15195
15196 * src/scan-gram.l: Complete the scanner with the missing patterns
15197 to pacify Flex.
15198 Use `quote' and `symbol_tag_get' where appropriate.
15199
152002002-06-19 Akim Demaille <akim@epita.fr>
15201
15202 * tests/actions.at (Destructors): Augment to test locations.
15203 * data/bison.simple (yydestructor): Pass it the current location
15204 if locations are enabled.
15205 Prototype only when __STDC__ or C++.
15206 Change the argument names to move into the yy name space: there is
15207 user code here.
15208
152092002-06-19 Akim Demaille <akim@epita.fr>
15210
15211 * data/bison.simple (b4_pure_if): New.
15212 Use it instead of #ifdef YYPURE.
15213
152142002-06-19 Akim Demaille <akim@epita.fr>
15215
15216 * data/bison.simple (b4_location_if): New.
15217 Use it instead of #ifdef YYLSP_NEEDED.
15218
152192002-06-19 Akim Demaille <akim@epita.fr>
15220
15221 Prepare @$ in %destructor, but currently don't bind it in the
15222 skeleton, as %location use is not cleaned up yet.
15223
15224 * src/scan-gram.l (handle_dollar, handle_destructor_at)
15225 (handle_action_at): New.
15226 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
15227 a braced_code_t and a location as additional arguments.
15228 (handle_destructor_dollar): Instead of requiring `b4_eval', just
15229 unquote one when outputting `b4_dollar_dollar'.
15230 Adjust callers.
15231 * data/bison.simple (b4_eval): Remove.
15232 (b4_symbol_destructor): Adjust.
15233 * tests/input.at (Invalid @n): Adjust.
15234
152352002-06-19 Zack Weinberg <zack@codesourcery.com>
15236
15237 * doc/bison.texinfo: Document ability to have multiple
15238 prologue sections.
15239
152402002-06-18 Akim Demaille <akim@epita.fr>
15241
15242 * src/files.c (compute_base_names): When computing the output file
15243 names from the input file name, strip the directory part.
15244
152452002-06-18 Akim Demaille <akim@epita.fr>
15246
15247 * data/bison.simple.new: Comment changes.
15248 Reported by Andreas Schwab.
15249
152502002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
15251
15252 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
15253 there are no `label `yyoverflowlab' defined but not used' warnings
15254 when yyoverflow is defined.
15255
152562002-06-18 Akim Demaille <akim@epita.fr>
15257
15258 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
15259 new member.
15260 (symbol_destructor_set): Adjust.
15261 * src/output.c (symbol_destructors_output): Output the destructor
15262 locations.
15263 Output the symbol name.
15264 * data/bison.simple (b4_symbol_destructor): Adjust.
15265
152662002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
15267 and Akim Demaille <akim@epita.fr>
15268
15269 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
15270 what's left on the stack when the error recovery hits EOF.
15271 * tests/actions.at (Destructors): Complete to exercise this case.
15272
152732002-06-17 Akim Demaille <akim@epita.fr>
15274
15275 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
15276 arguments is really empty, not only equal to `[]'.
15277 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
15278 member.
15279 (symbol_destructor_set): New.
15280 * src/output.c (symbol_destructors_output): New.
15281 * src/reader.h (brace_code_t, current_braced_code): New.
15282 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
15283 (handle_dollar): Rename as...
15284 (handle_action_dollar): this.
15285 (handle_destructor_dollar): New.
15286 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
15287 (grammar_declaration): Use it.
15288 * data/bison.simple (yystos): Is always defined.
15289 (yydestructor): New.
15290 * tests/actions.at (Destructors): New.
15291 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
15292
152932002-06-17 Akim Demaille <akim@epita.fr>
15294
15295 * src/symlist.h, src/symlist.c (symbol_list_length): New.
15296 * src/scan-gram.l (handle_dollar, handle_at): Compute the
15297 rule_length only when needed.
15298 * src/output.c (actions_output, token_definitions_output): Output
15299 the full M4 block.
15300 * src/symtab.c: Don't access directly to the symbol tag, use
15301 symbol_tag_get.
15302 * src/parse-gram.y: Use symbol_list_free.
15303
153042002-06-17 Akim Demaille <akim@epita.fr>
15305
15306 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
15307 (symbol_list_prepend, get_type_name): Move to...
15308 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
15309 (symbol_list_prepend, symbol_list_n_type_name_get): here.
15310 Adjust all callers.
15311 (symbol_list_free): New.
15312 * src/scan-gram.l (handle_dollar): Takes a location.
15313 * tests/input.at (Invalid $n): Adjust.
15314
153152002-06-17 Akim Demaille <akim@epita.fr>
15316
15317 * src/reader.h, src/reader.c (symbol_list_new): Export it.
15318 (symbol_list_prepend): New.
15319 * src/parse-gram.y (%union): `list' is a new member.
15320 (symbols.1): New, replaces...
15321 (terms_to_prec.1, nterms_to_type.1): these.
15322 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
15323 Take a location as additional argument.
15324 Adjust all callers.
15325
153262002-06-15 Akim Demaille <akim@epita.fr>
15327
15328 * src/parse-gram.y: Move %token in the declaration section so that
15329 we don't depend upon CVS Bison.
15330
153312002-06-15 Akim Demaille <akim@epita.fr>
15332
15333 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
15334 * src/print.c (print_core): Use it.
15335
153362002-06-15 Akim Demaille <akim@epita.fr>
15337
15338 * src/conflicts.c (log_resolution): Accept the rule involved in
15339 the sr conflicts instead of the lookahead number that points to
15340 that rule.
15341 (flush_reduce): Accept the current lookahead vector as argument,
15342 instead of the index in LA.
15343 (resolve_sr_conflict): Accept the current number of lookahead
15344 bitset to consider for the STATE, instead of the index in LA.
15345 (set_conflicts): Adjust.
15346 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
15347
153482002-06-15 Akim Demaille <akim@epita.fr>
15349
15350 * src/state.h (state_t): Replace the `lookaheadsp' member, a
15351 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
15352 Adjust all dependencies.
15353 * src/lalr.c (initialize_lookaheads): Split into...
15354 (states_lookaheads_count, states_lookaheads_initialize): these.
15355 (lalr): Adjust.
15356
153572002-06-15 Akim Demaille <akim@epita.fr>
15358
15359 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
15360 out of...
15361 (grammar_rules_print): here.
15362 * src/reduce.c (reduce_output): Use it.
15363 * tests/reduce.at (Useless Rules, Reduced Automaton)
15364 (Underivable Rules): Adjust.
15365
153662002-06-15 Akim Demaille <akim@epita.fr>
15367
15368 Copy BYacc's nice way to report the grammar.
15369
15370 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
15371 New.
15372 Don't print the rules' location, it is confusing and useless.
15373 (rule_print): Use grammar_rhs_print.
15374 * src/print.c (print_grammar): Use grammar_rules_print.
15375
153762002-06-15 Akim Demaille <akim@epita.fr>
15377
15378 Complete and rationalize `useless thing' warnings.
15379
15380 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
15381 (symbol_tag_print): New.
15382 Use them everywhere in place of accessing directly the tag member.
15383 * src/gram.h, src/gram.c (rule_print): New.
15384 Use it where a rule used to be printed `by hand'.
15385 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
15386 (reduce_grammar_tables): Report the useless rules.
15387 (reduce_print): Useless things are a warning, not an error.
15388 Report it as such.
15389 * tests/reduce.at (Useless Nonterminals, Useless Rules):
15390 (Reduced Automaton, Underivable Rules): Adjust.
15391 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
15392 * tests/conflicts.at (Unresolved SR Conflicts)
15393 (Solved SR Conflicts): Adjust.
15394
153952002-06-15 Akim Demaille <akim@epita.fr>
15396
15397 Let symbols have a location.
15398
15399 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
15400 (getsym): Adjust.
15401 Adjust all callers.
15402 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
15403 Use location_t, not int.
15404 * src/symtab.c (symbol_check_defined): Take advantage of the
15405 location.
15406 * tests/regression.at (Invalid inputs): Adjust.
15407
154082002-06-15 Akim Demaille <akim@epita.fr>
15409
15410 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
15411 (input): Don't try to initialize yylloc here, do it in the
15412 scanner.
15413 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
15414 * src/gram.h (rule_t): Change line and action_line into location
15415 and action_location, of location_t type.
15416 Adjust all dependencies.
15417 * src/location.h, src/location.c (empty_location): New.
15418 * src/reader.h, src/reader.c (grammar_start_symbol_set)
15419 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
15420 (grammar_current_rule_symbol_append)
15421 (grammar_current_rule_action_append): Expect a location as argument.
15422 * src/reader.c (grammar_midrule_action): Adjust to attach an
15423 action's location as dummy symbol location.
15424 * src/symtab.h, src/symtab.c (startsymbol_location): New.
15425 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
15426 the line numbers.
15427
154282002-06-14 Akim Demaille <akim@epita.fr>
15429
15430 Grammar declarations may be found in the grammar section.
15431
15432 * src/parse-gram.y (rules_or_grammar_declaration): New.
15433 (declarations): Each declaration may end with a semicolon, not
15434 just...
15435 (grammar_declaration): `"%union"'.
15436 (grammar): Branch to rules_or_grammar_declaration.
15437
154382002-06-14 Akim Demaille <akim@epita.fr>
15439
15440 * src/main.c (main): Invoke scanner_free.
15441
154422002-06-14 Akim Demaille <akim@epita.fr>
15443
15444 * src/output.c (m4_invoke): Extracted from...
15445 (output_skeleton): here.
15446 Free tempfile.
15447
154482002-06-14 Akim Demaille <akim@epita.fr>
15449
15450 * src/parse-gram.y (directives, directive, gram)
15451 (grammar_directives, precedence_directives, precedence_directive):
15452 Rename as...
15453 (declarations, declaration, grammar, grammar_declaration)
15454 (precedence_declaration, precedence_declarator): these.
15455 (symbol_declaration): New.
15456
154572002-06-14 Akim Demaille <akim@epita.fr>
15458
15459 * src/files.c (action_obstack): Remove, unused.
15460 (output_obstack): Remove it, and all its dependencies, as it is no
15461 longer needed.
15462 * src/reader.c (epilogue_set): Build the epilogue in the
15463 muscle_obstack.
15464 * src/output.h, src/output.c (muscle_obstack): Move to...
15465 * src/muscle_tab.h, src/muscle_tab.h: here.
15466 (muscle_init): Initialize muscle_obstack.
15467 (muscle_free): New.
15468 * src/main.c (main): Call it.
15469
154702002-06-14 Akim Demaille <akim@epita.fr>
15471
15472 * src/location.h: New, extracted from...
15473 * src/reader.h: here.
15474 * src/Makefile.am (noinst_HEADERS): Merge into
15475 (bison_SOURCES): this.
15476 Add location.h.
15477 * src/parse-gram.y: Use location_t instead of Bison's.
15478 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
15479 Use location_t instead of ints.
15480
154812002-06-14 Akim Demaille <akim@epita.fr>
15482
15483 * data/bison.simple, data/bison.c++: Be sure to restore the
15484 current #line when returning to the skeleton contents after having
15485 exposed the input file's #line.
15486
154872002-06-12 Akim Demaille <akim@epita.fr>
15488
15489 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
15490 eager.
15491 * tests/actions.at (Exotic Dollars): New.
15492
154932002-06-12 Akim Demaille <akim@epita.fr>
15494
15495 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
15496 ['"/] too eagerly.
15497 * tests/input.at (Torturing the Scanner): New.
15498
154992002-06-11 Akim Demaille <akim@epita.fr>
15500
15501 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
15502 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
15503 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
15504 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
15505 * src/reader.c (reader): Use it.
15506
155072002-06-11 Akim Demaille <akim@epita.fr>
15508
15509 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
15510 Adjust all callers.
15511 (scanner_last_string_free): New.
15512
155132002-06-11 Akim Demaille <akim@epita.fr>
15514
15515 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
15516 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
15517 (last_string, YY_OBS_FREE): New.
15518 Use them when returning an ID.
15519
155202002-06-11 Akim Demaille <akim@epita.fr>
15521
15522 Have Bison grammars parsed by a Bison grammar.
15523
15524 * src/reader.c, src/reader.h (prologue_augment): New.
15525 * src/reader.c (copy_definition): Remove.
15526
15527 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
15528 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
15529 (grammar_current_rule_prec_set, grammar_current_rule_check)
15530 (grammar_current_rule_symbol_append)
15531 (grammar_current_rule_action_append): Export.
15532 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
15533 (symbol_list_action_append): Remove.
15534 Hook the routines from reader.
15535 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
15536 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
15537
15538 * src/reader.c (read_declarations): Remove, unused.
15539
15540 * src/parse-gram.y: Handle the epilogue.
15541 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
15542 (grammar_start_symbol_set): this.
15543 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
15544 * src/reader.c (readgram): Remove, unused.
15545 (reader): Adjust to insert eoftoken and axiom where appropriate.
15546
15547 * src/reader.c (copy_dollar): Replace with...
15548 * src/scan-gram.h (handle_dollar): this.
15549 * src/parse-gram.y: Remove `%thong'.
15550
15551 * src/reader.c (copy_at): Replace with...
15552 * src/scan-gram.h (handle_at): this.
15553
15554 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
15555 New.
15556
15557 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
15558 time being.
15559
15560 * src/reader.h, src/reader.c (grammar_rule_end): New.
15561
15562 * src/parse.y (current_type, current_class): New.
15563 Implement `%nterm', `%token' support.
15564 Merge `%term' into `%token'.
15565 (string_as_id): New.
15566 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
15567 type name.
15568
15569 * src/parse-gram.y: Be sure to handle properly the beginning of
15570 rules.
15571
15572 * src/parse-gram.y: Handle %type.
15573 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
15574
15575 * src/parse-gram.y: More directives support.
15576 * src/options.c: No longer handle source directives.
15577
15578 * src/parse-gram.y: Fix %output.
15579
15580 * src/parse-gram.y: Handle %union.
15581 Use the prologue locations.
15582 * src/reader.c (parse_union_decl): Remove.
15583
15584 * src/reader.h, src/reader.c (epilogue_set): New.
15585 * src/parse-gram.y: Use it.
15586
15587 * data/bison.simple, data/bison.c++: b4_stype is now either not
15588 defined, then default to int, or to the contents of %union,
15589 without `union' itself.
15590 Adjust.
15591 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
15592
15593 * src/output.c (actions_output): Don't output braces, as they are
15594 already handled by the scanner.
15595
15596 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
15597 characters to themselves.
15598
15599 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
15600 that the epilogue has a proper #line.
15601
15602 * src/parse-gram.y: Handle precedence/associativity.
15603
15604 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
15605 a terminal.
15606 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
15607 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
15608 at all to define terminals that cannot be emitted.
15609
15610 * src/scan-gram.l: Escape M4 characters.
15611
15612 * src/scan-gram.l: Working properly with escapes in user
15613 strings/characters.
15614
15615 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
15616 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
15617 grammar.
15618 Use more modest sizes, as for the time being the parser does not
15619 release memory, and therefore the process swallows a huge amount
15620 of memory.
15621
15622 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
15623 stricter %token grammar.
15624
15625 * src/symtab.h (associativity): Add `undef_assoc'.
15626 (symbol_precedence_set): Do nothing when passed an undef_assoc.
15627 * src/symtab.c (symbol_check_alias_consistence): Adjust.
15628
15629 * tests/regression.at (Invalid %directive): Remove, as it is now
15630 meaningless.
15631 (Invalid inputs): Adjust to the new error messages.
15632 (Token definitions): The new grammar doesn't allow too many
15633 eccentricities.
15634
15635 * src/lex.h, src/lex.c: Remove.
15636 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
15637 (copy_character, copy_string2, copy_string, copy_identifier)
15638 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
15639 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
15640 (parse_action): Remove.
15641 * po/POTFILES.in: Adjust.
15642
156432002-06-11 Akim Demaille <akim@epita.fr>
15644
15645 * src/reader.c (parse_action): Don't store directly into the
15646 rule's action member: return the action as a string.
15647 Don't require `rule_length' as an argument: compute it.
15648 (grammar_current_rule_symbol_append)
15649 (grammar_current_rule_action_append): New, eved out from
15650 (readgram): here.
15651 Remove `action_flag', `rulelength', unused now.
15652
156532002-06-11 Akim Demaille <akim@epita.fr>
15654
15655 * src/reader.c (grammar_current_rule_prec_set).
15656 (grammar_current_rule_check): New, eved out from...
15657 (readgram): here.
15658 Remove `xaction', `first_rhs': useless.
15659 * tests/input.at (Type clashes): New.
15660 * tests/existing.at (GNU Cim Grammar): Adjust.
15661
156622002-06-11 Akim Demaille <akim@epita.fr>
15663
15664 * src/reader.c (grammar_midrule_action): New, Eved out from
15665 (readgram): here.
15666
156672002-06-11 Akim Demaille <akim@epita.fr>
15668
15669 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
15670 New.
15671 (readgram): Use them as replacement of inlined code, crule and
15672 crule1.
15673
156742002-06-11 Akim Demaille <akim@epita.fr>
15675
15676 * src/reader.c (grammar_end, grammar_symbol_append): New.
15677 (readgram): Use them.
15678 Make the use of `p' as local as possible.
15679
156802002-06-10 Akim Demaille <akim@epita.fr>
15681
15682 GCJ's parser requires the tokens to be defined before the prologue.
15683
15684 * data/bison.simple: Output the token definition before the user's
15685 prologue.
15686 * tests/regression.at (Braces parsing, Duplicate string)
15687 (Mixing %token styles): Check the output from bison.
15688 (Early token definitions): New.
15689
156902002-06-10 Akim Demaille <akim@epita.fr>
15691
15692 * src/symtab.c (symbol_user_token_number_set): Don't complain when
15693 assigning twice the same user number to a token, so that we can
15694 use it in...
15695 * src/lex.c (lex): here.
15696 Also use `symbol_class_set' instead of hand written code.
15697 * src/reader.c (parse_assoc_decl): Likewise.
15698
156992002-06-10 Akim Demaille <akim@epita.fr>
15700
15701 * src/symtab.c, src/symtab.c (symbol_class_set)
15702 (symbol_user_token_number_set): New.
15703 * src/reader.c (parse_token_decl): Use them.
15704 Use a switch instead of ifs.
15705 Use a single argument.
15706
157072002-06-10 Akim Demaille <akim@epita.fr>
15708
15709 Remove `%thong' support as it is undocumented, unused, duplicates
15710 `%token's job, and creates useless e-mail traffic with people who
15711 want to know what it is, why it is undocumented, unused, and
15712 duplicates `%token's job.
15713
15714 * src/reader.c (parse_thong_decl): Remove.
15715 * src/options.c (option_table): Remove "thong".
15716 * src/lex.h (tok_thong): Remove.
15717
157182002-06-10 Akim Demaille <akim@epita.fr>
15719
15720 * src/symtab.c, src/symtab.c (symbol_type_set)
15721 (symbol_precedence_set): New.
15722 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
15723 (value_components_used): Remove, unused.
15724
157252002-06-09 Akim Demaille <akim@epita.fr>
15726
15727 Move symbols handling code out of the reader.
15728
15729 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
15730 (axiom): Move to...
15731 * src/symtab.h, src/symtab.c: here.
15732
15733 * src/gram.c (start_symbol): Remove: use startsymbol->number.
15734 * src/reader.c (startval): Rename as...
15735 * src/symtab.h, src/symtab.c (startsymbol): this.
15736 * src/reader.c: Adjust.
15737
15738 * src/reader.c (symbol_check_defined, symbol_make_alias)
15739 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
15740 (token_translations_init)
15741 Move to...
15742 * src/symtab.c: here.
15743 * src/reader.c (packsymbols): Move to...
15744 * src/symtab.h, src/symtab.c (symbols_pack): here.
15745 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
15746 argument.
15747
157482002-06-03 Akim Demaille <akim@epita.fr>
15749
15750 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
15751 then statements.
15752
157532002-06-03 Akim Demaille <akim@epita.fr>
15754
15755 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
15756 structs with non literals.
15757 * src/scan-skel.l: never-interactive.
15758 * src/conflicts.c (enum conflict_resolution_e): No trailing
15759 comma.
15760 * src/getargs.c (usage): Split long literal strings.
15761 Reported by Hans Aberg.
15762
157632002-05-28 Akim Demaille <akim@epita.fr>
15764
15765 * data/bison.c++: Use C++ ostreams.
15766 (cdebug_): New member.
15767
157682002-05-28 Akim Demaille <akim@epita.fr>
15769
15770 * src/output.c (output_skeleton): Be sure to allocate enough room
15771 for `/' _and_ for `\0' in full_skeleton.
15772
157732002-05-28 Akim Demaille <akim@epita.fr>
15774
15775 * data/bison.c++: Catch up with bison.simple:
15776 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15777 and Paul Eggert <eggert@twinsun.com>: `error' handing.
15778 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
15779 and popping traces.
15780
157812002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15782
15783 * src/output.c (output_skeleton): Put an explicit path in front of
15784 the skeleton file name, rather than relying on the -I directory,
15785 to partially alleviate effects of having a skeleton file lying around
15786 in the current directory.
15787
157882002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15789
15790 * src/conflicts.c (log_resolution): Correct typo:
15791 obstack_printf should be obstack_fgrow1.
15792
157932002-05-26 Akim Demaille <akim@epita.fr>
15794
15795 * src/state.h (state_t): `solved_conflicts' is a new member.
15796 * src/LR0.c (new_state): Set it to 0.
15797 * src/conflicts.h, src/conflicts.c (print_conflicts)
15798 (free_conflicts, solve_conflicts): Rename as...
15799 (conflicts_print, conflicts_free, conflicts_solve): these.
15800 Adjust callers.
15801 * src/conflicts.c (enum conflict_resolution_e)
15802 (solved_conflicts_obstack): New, used by...
15803 (log_resolution): this.
15804 Adjust to attach the conflict resolution to each state.
15805 Complete the description with the precedence/associativity
15806 information.
15807 (resolve_sr_conflict): Adjust.
15808 * src/print.c (print_state): Output its solved_conflicts.
15809 * tests/conflicts.at (Unresolved SR Conflicts)
15810 (Solved SR Conflicts): Exercise --report=all.
15811
158122002-05-26 Akim Demaille <akim@epita.fr>
15813
15814 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15815 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
15816 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
15817 (token_number_t, item_number_as_token_number)
15818 (token_number_as_item_number, muscle_insert_token_number_table):
15819 Rename as...
15820 (symbol_number_t, item_number_as_symbol_number)
15821 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
15822 these, since it is more appropriate.
15823
158242002-05-26 Akim Demaille <akim@epita.fr>
15825
15826 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
15827 `Error:' lines.
15828 * data/bison.simple (yystos) [YYDEBUG]: New.
15829 (yyparse) [YYDEBUG]: Display the symbols which are popped during
15830 error recovery.
15831 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
15832
158332002-05-25 Akim Demaille <akim@epita.fr>
15834
15835 * doc/bison.texinfo (Debugging): Split into...
15836 (Tracing): this new section, its former contents, and...
15837 (Understanding): this new section.
15838 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
15839 by...
15840 (report_flag): this.
15841 Adjust all dependencies.
15842 (report_args, report_types, report_argmatch): New.
15843 (usage, getargs): Report/support -r, --report.
15844 * src/options.h
15845 (struct option_table_struct): Rename as..,
15846 (struct option_table_s): this.
15847 Rename the `set_flag' member to `flag' to match with getopt_long's
15848 struct.
15849 * src/options.c (option_table): Split verbose into an entry for
15850 %verbose, and another for --verbose.
15851 Support --report/-r, so remove -r from the obsolete --raw.
15852 * src/print.c: Attach full item sets and lookaheads reports to
15853 report_flag instead of trace_flag.
15854 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
15855
158562002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15857 and Paul Eggert <eggert@twinsun.com>
15858
15859 * data/bison.simple (yyparse): Correct error handling to conform to
15860 POSIX and yacc. Specifically, after syntax error is discovered,
15861 do not reduce further before shifting the error token.
15862 Clean up the code a bit by removing the labels yyerrdefault,
15863 yyerrhandle, yyerrpop.
15864 * NEWS: Document the above.
15865
158662002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15867
15868 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
15869 type; it isn't always big enough, since it doesn't necessarily
15870 include non-terminals.
15871 (yytranslate): Expand definition of yy_token_number_type, so that
15872 the latter can be removed.
15873 (yy_token_number_type): Remove, only one use.
15874 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
15875 don't use TokenNumberType as element type.
15876
15877 * tests/regression.at: Modify expected output to agree with change
15878 to yyr1 and yytranslate.
15879
158802002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
15881
15882 * src/reader.c (parse_action): Use copy_character instead of
15883 obstack_1grow.
15884
158852002-05-13 Akim Demaille <akim@epita.fr>
15886
15887 * tests/regression.at (Token definitions): Prototype yylex and
15888 yyerror.
15889
158902002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15891
15892 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
15893 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
15894 32-bit arithmetic.
15895 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
15896
158972002-05-07 Akim Demaille <akim@epita.fr>
15898
15899 * tests/synclines.at: Be sure to prototype yylex and yyerror to
15900 avoid GCC warnings.
15901
159022002-05-07 Akim Demaille <akim@epita.fr>
15903
15904 Kill GCC warnings.
15905
15906 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
15907 over the RHS of each rule.
15908 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
15909 * src/state.h (state_t): Member `nitems' is unsigned short.
15910 * src/LR0.c (get_state): Adjust.
15911 * src/reader.c (packgram): Likewise.
15912 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
15913 `Type'.
15914 (muscle_insert_int_table): Remove, unused.
15915 (prepare_rules): Remove `max'.
15916
159172002-05-06 Akim Demaille <akim@epita.fr>
15918
15919 * src/closure.c (print_firsts): Display of the symbol tags.
15920 (bitmatrix_print): Move to...
15921 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
15922 here.
15923 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
15924
159252002-05-06 Akim Demaille <akim@epita.fr>
15926
15927 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
15928 hash_do_for_each.
15929
159302002-05-06 Akim Demaille <akim@epita.fr>
15931
15932 * src/LR0.c (new_state, get_state): Instead of using the global
15933 `kernel_size' and `kernel_base', have two new arguments:
15934 `core_size' and `core'.
15935 Adjust callers.
15936
159372002-05-06 Akim Demaille <akim@epita.fr>
15938
15939 * src/reader.c (packgram): No longer end `ritem' with a 0
15940 sentinel: it is not used.
15941
159422002-05-05 Akim Demaille <akim@epita.fr>
15943
15944 New experimental feature: display the lookaheads in the report and
15945 graph.
15946
15947 * src/print (print_core): When --trace-flag, display the rules
15948 lookaheads.
15949 * src/print_graph.c (print_core): Likewise.
15950 Swap the arguments.
15951 Adjust caller.
15952
159532002-05-05 Akim Demaille <akim@epita.fr>
15954
15955 * tests/torture.at (Many lookaheads): New test.
15956
159572002-05-05 Akim Demaille <akim@epita.fr>
15958
15959 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
15960 (GENERATE_MUSCLE_INSERT_TABLE): this.
15961 (output_int_table, output_unsigned_int_table, output_short_table)
15962 (output_token_number_table, output_item_number_table): Replace with...
15963 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
15964 (muscle_insert_short_table, muscle_insert_token_number_table)
15965 (muscle_insert_item_number_table): these.
15966 Adjust all callers.
15967 (prepare_tokens): Don't free `translations', since...
15968 * src/reader.h, src/reader.c (grammar_free): do it.
15969 Move to...
15970 * src/gram.h, src/gram.c (grammar_free): here.
15971 * data/bison.simple, data/bison.c++: b4_token_number_max is now
15972 b4_translate_max.
15973
159742002-05-05 Akim Demaille <akim@epita.fr>
15975
15976 * src/output.c (output_unsigned_int_table): New.
15977 (prepare_rules): `i' is unsigned.
15978 `prhs', `rline', `r2' are unsigned int.
15979 Rename muscle `rhs_number_max' as `rhs_max'.
15980 Output muscles `prhs_max', `rline_max', and `r2_max'.
15981 Free rline and r1.
15982 * data/bison.simple, data/bison.c++: Adjust to use these muscles
15983 to compute types instead of constant types.
15984 * tests/regression.at (Web2c Actions): Adjust.
15985
159862002-05-04 Akim Demaille <akim@epita.fr>
15987
15988 * src/symtab.h (SALIAS, SUNDEF): Rename as...
15989 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
15990 Adjust dependencies.
15991 * src/output.c (token_definitions_output): Be sure not to output a
15992 `#define 'a'' when fed with `%token 'a' "a"'.
15993 * tests/regression.at (Token definitions): New.
15994
159952002-05-03 Paul Eggert <eggert@twinsun.com>
15996
15997 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
15998 for K&R C.
15999
160002002-05-03 gettextize <bug-gnu-gettext@gnu.org>
16001
16002 * Makefile.am (SUBDIRS): Remove intl.
16003 (EXTRA_DIST): Add config/config.rpath.
16004
160052002-05-03 Akim Demaille <akim@epita.fr>
16006
16007 * data/bison.simple (m4_if): Don't output empty enums.
16008 And actually, output valid enum definitions :(.
16009
160102002-05-03 Akim Demaille <akim@epita.fr>
16011
16012 * configure.bat: Remove, completely obsolete.
16013 * Makefile.am (EXTRA_DIST): Adjust.
16014 Don't distribute config.rpath...
16015 * config/Makefile.am (EXTRA_DIST): Do it.
16016
160172002-05-03 Akim Demaille <akim@epita.fr>
16018
16019 * configure.in (GETTEXT_VERSION): New.
16020 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
16021
160222002-05-03 Akim Demaille <akim@epita.fr>
16023
16024 * data/bison.simple (b4_token_enum): New.
16025 (b4_token_defines): Use it to output tokens both as #define and
16026 enums.
16027 Suggested by Paul Eggert.
16028 * src/output.c (token_definitions_output): Don't output spurious
16029 white spaces.
16030
160312002-05-03 Akim Demaille <akim@epita.fr>
16032
16033 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16034
160352002-05-02 Robert Anisko <robert@lrde.epita.fr>
16036
16037 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
16038 Update the stack class, give a try to deque as the default container.
16039
160402002-05-02 Akim Demaille <akim@epita.fr>
16041
16042 * data/bison.simple (yyparse): Do not implement @$ = @1.
16043 (YYLLOC_DEFAULT): Adjust to do it.
16044 * doc/bison.texinfo (Location Default Action): Fix.
16045
160462002-05-02 Akim Demaille <akim@epita.fr>
16047
16048 * src/reader.c (parse_braces): Merge into...
16049 (parse_action): this.
16050
160512002-05-02 Akim Demaille <akim@epita.fr>
16052
16053 * configure.in (ALL_LINGUAS): Remove.
16054 * po/LINGUAS, hr.po: New.
16055
160562002-05-02 Akim Demaille <akim@epita.fr>
16057
16058 Remove the so called hairy (semantic) parsers.
16059
16060 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
16061 * src/gram.h, src/gram.c (semantic_parser): Remove.
16062 (rule_t): Remove the guard and guard_line members.
16063 * src/lex.h (token_t): remove tok_guard.
16064 * src/options.c (option_table): Remove %guard and %semantic_parser
16065 support.
16066 * src/output.c, src/output.h (guards_output): Remove.
16067 (prepare): Adjust.
16068 (token_definitions_output): Don't output the `T'
16069 tokens (???).
16070 (output_skeleton): Don't output the guards.
16071 * src/files.c, src/files.c (attrsfile): Remove.
16072 * src/reader.c (symbol_list): Remove the guard and guard_line
16073 members.
16074 Adjust dependencies.
16075 (parse_guard): Remove.
16076 * data/bison.hairy: Remove.
16077 * doc/bison.texinfo (Environment Variables): Remove occurrences of
16078 BISON_HAIRY.
16079
160802002-05-02 Akim Demaille <akim@epita.fr>
16081
16082 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
16083 (parse_guard): Rename the formal argument `stack_offset' as
16084 `rule_length', which is more readable.
16085 Adjust callers.
16086 (copy_at, copy_dollar): Instead of outputting the hard coded
16087 values of $$, $n and so forth, output invocation to b4_lhs_value,
16088 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
16089 Note: this patch partially drops `semantic-parser' support: it
16090 always does `rule_length - n', where semantic parsers ought to
16091 always use `-n'.
16092 * data/bison.simple, data/bison.c++ (b4_lhs_value)
16093 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
16094
160952002-05-02 Akim Demaille <akim@epita.fr>
16096
16097 * configure.in (AC_INIT): Bump to 1.49b.
16098 (AM_INIT_AUTOMAKE): Short invocation.
16099
161002002-05-02 Akim Demaille <akim@epita.fr>
16101
16102 Version 1.49a.
16103
161042002-05-01 Akim Demaille <akim@epita.fr>
16105
16106 * src/skeleton.h: Remove.
16107
161082002-05-01 Akim Demaille <akim@epita.fr>
16109
16110 * src/skeleton.h: Fix the #endif.
16111 Reported by Magnus Fromreide.
16112
161132002-04-26 Paul Eggert <eggert@twinsun.com>
16114
16115 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
16116 Define if we define YYSTYPE and YYLTYPE, respectively.
16117 (YYCOPY): Fix [] quoting problem in the non-GCC case.
16118
161192002-04-25 Robert Anisko <robert@lrde.epita.fr>
16120
16121 * src/scan-skel.l: Postprocess quadrigraphs.
16122
16123 * src/reader.c (copy_character): New function, used to output
16124 single characters while replacing `[' and `]' with quadrigraphs, to
16125 avoid troubles with M4 quotes.
16126 (copy_comment): Output characters with copy_character.
16127 (read_additionnal_code): Likewise.
16128 (copy_string2): Likewise.
16129 (copy_definition): Likewise.
16130
16131 * tests/calc.at: Exercise M4 quoting.
16132
161332002-04-25 Akim Demaille <akim@epita.fr>
16134
16135 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
16136 between `!' and the command.
16137 Reported by Paul Eggert.
16138
161392002-04-24 Robert Anisko <robert@lrde.epita.fr>
16140
16141 * tests/calc.at: Exercise prologue splitting.
16142
16143 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
16144 `b4_post_prologue' instead of `b4_prologue'.
16145
16146 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
16147 muscles.
16148 (output): Free pre_prologue_obstack and post_prologue_obstack.
16149 * src/files.h, src/files.c (attrs_obstack): Remove.
16150 (pre_prologue_obstack, post_prologue_obstack): New.
16151 * src/reader.c (copy_definition): Add a parameter to specify the
16152 obstack to fill, instead of using attrs_obstack unconditionally.
16153 (read_declarations): Pass pre_prologue_obstack to copy_definition if
16154 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
16155
161562002-04-23 Paul Eggert <eggert@twinsun.com>
16157
16158 * data/bison.simple: Remove unnecessary commentary and white
16159 space differences from 1_29-branch.
16160 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
16161
16162 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
16163 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
16164 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
16165 constructors or destructors.
16166
16167 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
16168
161692002-04-23 Akim Demaille <akim@epita.fr>
16170
16171 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
16172 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
16173 location with columns.
16174 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
16175 All reported by Paul Eggert.
16176
161772002-04-22 Akim Demaille <akim@epita.fr>
16178
16179 * src/reduce.c (dump_grammar): Move to...
16180 * src/gram.h, src/gram.c (grammar_dump): here.
16181 Be sure to separate long item numbers.
16182 Don't read the members of a rule's prec if its nil.
16183
161842002-04-22 Akim Demaille <akim@epita.fr>
16185
16186 * src/output.c (table_size, table_grow): New.
16187 (MAXTABLE): Remove, replace uses with table_size.
16188 (pack_vector): Instead of dying when the table is too big, grow it.
16189
161902002-04-22 Akim Demaille <akim@epita.fr>
16191
16192 * data/bison.simple (yyr1): Its type is that of a token number.
16193 * data/bison.c++ (r1_): Likewise.
16194 * tests/regression.at (Web2c Actions): Adjust.
16195
161962002-04-22 Akim Demaille <akim@epita.fr>
16197
16198 * src/reader.c (token_translations_init): 256 is now the default
16199 value for the error token, i.e., it will be assigned another
16200 number if the user assigned 256 to one of her tokens.
16201 (reader): Don't force 256 to error.
16202 * doc/bison.texinfo (Symbols): Adjust.
16203 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
16204 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
16205 etc. instead of 10, 20, 30 (which was used to `jump' over error
16206 (256) and undefined (2)).
16207
162082002-04-22 Akim Demaille <akim@epita.fr>
16209
16210 Propagate more token_number_t.
16211
16212 * src/gram.h (token_number_as_item_number)
16213 (item_number_as_token_number): New.
16214 * src/output.c (GENERATE_OUTPUT_TABLE): New.
16215 Use it to create output_item_number_table and
16216 output_token_number_table.
16217 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16218 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
16219 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
16220 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
16221
162222002-04-22 Akim Demaille <akim@epita.fr>
16223
16224 * src/output.h, src/output.c (get_lines_number): Remove.
16225
162262002-04-19 Akim Demaille <akim@epita.fr>
16227
16228 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
16229 as Lex/Flex'.
16230 (Debugging): More details about enabling the debugging features.
16231 (Table of Symbols): Describe $$, $n, @$, and @n.
16232 Suggested by Tim Josling.
16233
162342002-04-19 Akim Demaille <akim@epita.fr>
16235
16236 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
16237
162382002-04-10 Akim Demaille <akim@epita.fr>
16239
16240 * src/system.h: Rely on HAVE_LIMITS_H.
16241 Suggested by Paul Eggert.
16242
162432002-04-09 Akim Demaille <akim@epita.fr>
16244
16245 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
16246 full stderr, and strip it according to the bison options, instead
16247 of composing the error message from different bits.
16248 This makes it easier to check for several error messages.
16249 Adjust all the invocations.
16250 Add an invocation exercising the error token.
16251 Add an invocation demonstrating a stupid error message.
16252 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
16253 Adjust the tests.
16254 Error message are for stderr, not stdout.
16255
162562002-04-09 Akim Demaille <akim@epita.fr>
16257
16258 * src/gram.h, src/gram.c (error_token_number): Remove, use
16259 errtoken->number.
16260 * src/reader.c (reader): Don't specify the user token number (2)
16261 for $undefined, as it uselessly prevents using it.
16262 * src/gram.h (token_number_t): Move to...
16263 * src/symtab.h: here.
16264 (state_t.number): Is a token_number_t.
16265 * src/print.c, src/reader.c: Use undeftoken->number instead of
16266 hard coded 2.
16267 (Even though this 2 is not the same as above: the number of the
16268 undeftoken remains being 2, it is its user token number which
16269 might not be 2).
16270 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
16271 `user_token_number_max'.
16272 Output `undef_token_number'.
16273 * data/bison.simple, data/bison.c++: Use them.
16274 Be sure to map invalid yylex return values to
16275 `undef_token_number'. This saves us from gratuitous SEGV.
16276
16277 * tests/conflicts.at (Solved SR Conflicts)
16278 (Unresolved SR Conflicts): Adjust.
16279 * tests/regression.at (Web2c Actions): Adjust.
16280
162812002-04-08 Akim Demaille <akim@epita.fr>
16282
16283 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
16284 Adding #line.
16285 Remove the duplicate `typedefs'.
16286 (RhsNumberType): Fix the declaration and various other typos.
16287 Use __ofile__.
16288 * data/bison.simple: Use __ofile__.
16289 * src/scan-skel.l: Handle __ofile__.
16290
162912002-04-08 Akim Demaille <akim@epita.fr>
16292
16293 * src/gram.h (item_number_t): New, the type of item numbers in
16294 RITEM. Note that it must be able to code symbol numbers as
16295 positive number, and the negation of rule numbers as negative
16296 numbers.
16297 Adjust all dependencies (pretty many).
16298 * src/reduce.c (rule): Remove this `short *' pointer: use
16299 item_number_t.
16300 * src/system.h (MINSHORT, MAXSHORT): Remove.
16301 Include `limits.h'.
16302 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
16303 (shortcpy): Remove.
16304 (MAXTABLE): Move to...
16305 * src/output.c (MAXTABLE): here.
16306 (prepare_rules): Use output_int_table to output rhs.
16307 * data/bison.simple, data/bison.c++: Adjust.
16308 * tests/torture.at (Big triangle): Move the limit from 254 to
16309 500.
16310 * tests/regression.at (Web2c Actions): Ajust.
16311
16312 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
16313 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
16314 passes, but produces negative #line number, once fixed, GCC is
16315 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
16316 C), it passes.
16317 * src/state.h (state_h): Code input lines on ints, not shorts.
16318
163192002-04-08 Akim Demaille <akim@epita.fr>
16320
16321 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
16322 and then the grammar.
16323
163242002-04-08 Akim Demaille <akim@epita.fr>
16325
16326 * src/system.h: No longer using strndup.
16327
163282002-04-07 Akim Demaille <akim@epita.fr>
16329
16330 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
16331 * src/output.c (output_table_data): Return the longest number.
16332 (prepare_tokens): Output `token_number_max').
16333 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
16334 New.
16335 Use them to define yy_token_number_type/TokenNumberType.
16336 Use this type for yytranslate.
16337 * tests/torture.at (Big triangle): Push the limit from 124 to
16338 253.
16339 * tests/regression.at (Web2c Actions): Adjust.
16340
163412002-04-07 Akim Demaille <akim@epita.fr>
16342
16343 * tests/torture.at (Big triangle): New.
16344 (GNU AWK Grammar, GNU Cim Grammar): Move to...
16345 * tests/existing.at: here.
16346
163472002-04-07 Akim Demaille <akim@epita.fr>
16348
16349 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
16350 nritems.
16351 Adjust dependencies.
16352
163532002-04-07 Akim Demaille <akim@epita.fr>
16354
16355 * src/reader.c: Normalize increments to prefix form.
16356
163572002-04-07 Akim Demaille <akim@epita.fr>
16358
16359 * src/reader.c, symtab.c: Remove debugging code.
16360
163612002-04-07 Akim Demaille <akim@epita.fr>
16362
16363 Rename all the `bucket's as `symbol_t'.
16364
16365 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
16366 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
16367 * src/symtab.c, src/symtab.h (bucket): Rename as...
16368 (symbol_t): this.
16369 (symbol_list_new, bucket_check_defined, bucket_make_alias)
16370 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
16371 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16372 (buckets_new, buckets_free, buckets_do): Rename as...
16373 (symbol_list_new, symbol_check_defined, symbol_make_alias)
16374 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16375 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
16376 (symbols_new, symbols_free, symbols_do): these.
16377
163782002-04-07 Akim Demaille <akim@epita.fr>
16379
16380 Use lib/hash for the symbol table.
16381
16382 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
16383 EOF.
16384 * src/lex.c (lex): Set the `number' member of new terminals.
16385 * src/reader.c (bucket_check_defined, bucket_make_alias)
16386 (bucket_check_alias_consistence, bucket_translation): New.
16387 (reader, grammar_free, readgram, token_translations_init)
16388 (packsymbols): Adjust.
16389 (reader): Number the predefined tokens.
16390 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
16391 for predefined tokens.
16392 * src/symtab.h (bucket): Remove all the hash table related
16393 members.
16394 * src/symtab.c (symtab): Replace by...
16395 (bucket_table): this.
16396 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16397 (buckets_new, buckets_do): New.
16398
163992002-04-07 Akim Demaille <akim@epita.fr>
16400
16401 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
16402 (start_symbol, max_user_token_number, semantic_parser)
16403 (error_token_number): Initialize.
16404 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
16405 Initialize.
16406 (reader): Don't.
16407 (errtoken, eoftoken, undeftoken, axiom): Extern.
16408
164092002-04-07 Akim Demaille <akim@epita.fr>
16410
16411 * src/gram.h (rule_s): prec and precsym are now pointers
16412 to the bucket giving the priority/associativity.
16413 Member `associativity' removed: useless.
16414 * src/reduce.c, src/conflicts.c: Adjust.
16415
164162002-04-07 Akim Demaille <akim@epita.fr>
16417
16418 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
16419 Properly escape the symbols' TAG when outputting them.
16420
164212002-04-07 Akim Demaille <akim@epita.fr>
16422
16423 * src/lalr.h (LA): Is a bitsetv, not bitset*.
16424
164252002-04-07 Akim Demaille <akim@epita.fr>
16426
16427 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
16428 (LArule): this, which is an array to rule_t*.
16429 * src/print.c, src/conflicts.c: Adjust.
16430
164312002-04-07 Akim Demaille <akim@epita.fr>
16432
16433 * src/gram.h (rule_t): Rename `number' as `user_number'.
16434 `number' is a new member.
16435 Adjust dependencies.
16436 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
16437
164382002-04-07 Akim Demaille <akim@epita.fr>
16439
16440 As a result of the previous patch, it is no longer needed
16441 to reorder ritem itself.
16442
16443 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
16444
164452002-04-07 Akim Demaille <akim@epita.fr>
16446
16447 Be sure never to walk through RITEMS, but use only data related to
16448 the rules themselves. RITEMS should be banished.
16449
16450 * src/output.c (output_token_translations): Rename as...
16451 (prepare_tokens): this.
16452 In addition to `translate', prepare the muscles `tname' and
16453 `toknum', which were handled by...
16454 (output_rule_data): this.
16455 Remove, and move the remainder of its outputs into...
16456 (prepare_rules): this new routines, which also merges content from
16457 (output_gram): this.
16458 (prepare_rules): Be sure never to walk through RITEMS.
16459 (output_stos): Rename as...
16460 (prepare_stos): this.
16461 (output): Always invoke prepare_states, after all, just don't use it
16462 in the output if you don't need it.
16463
164642002-04-07 Akim Demaille <akim@epita.fr>
16465
16466 * src/LR0.c (new_state): Display `nstates' as the name of the
16467 newly created state.
16468 Adjust to initialize first_state and last_state if needed.
16469 Be sure to distinguish the initial from the final state.
16470 (new_states): Create the itemset of the initial state, and use
16471 new_state.
16472 * src/closure.c (closure): Now that the initial state has its
16473 items properly set, there is no need for a special case when
16474 creating `ruleset'.
16475
16476 As a result, now the rule 0, reducing to $axiom, is visible in the
16477 outputs. Adjust the test suite.
16478
16479 * tests/conflicts.at (Solved SR Conflicts)
16480 (Unresolved SR Conflicts): Adjust.
16481 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
16482 * tests/conflicts.at (S/R in initial): New.
16483
164842002-04-07 Akim Demaille <akim@epita.fr>
16485
16486 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
16487 the RHS of the rules.
16488 * src/output.c (output_gram): Likewise.
16489
164902002-04-07 Akim Demaille <akim@epita.fr>
16491
16492 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
16493 bucket.
16494 Adjust all dependencies.
16495 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
16496 `number' of the buckets too.
16497 * src/gram.h: Include `symtab.h'.
16498 (associativity): Move to...
16499 * src/symtab.h: here.
16500 No longer include `gram.h'.
16501
165022002-04-07 Akim Demaille <akim@epita.fr>
16503
16504 * src/gram.h, src/gram.c (rules_rhs_length): New.
16505 (ritem_longest_rhs): Use it.
16506 * src/gram.h (rule_t): `number' is a new member.
16507 * src/reader.c (packgram): Set it.
16508 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
16509 the end of `rules', and count them out of `nrules'.
16510 (reduce_output, dump_grammar): Adjust.
16511 * src/print.c (print_grammar): It is no longer needed to check for
16512 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
16513 * tests/reduce.at (Reduced Automaton): New test.
16514
165152002-04-07 Akim Demaille <akim@epita.fr>
16516
16517 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
16518 lacking `+ 1' to nrules, Bison reported as useless a token if it
16519 was used solely to set the precedence of the last rule...
16520
165212002-04-07 Akim Demaille <akim@epita.fr>
16522
16523 * data/bison.c++, data/bison.simple: Don't output the current file
16524 name in #line, to avoid useless diffs between two identical
16525 outputs under different names.
16526
165272002-04-07 Akim Demaille <akim@epita.fr>
16528
16529 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
16530 Normalize loops to using `< nrules + 1', not `<= nrules'.
16531
165322002-04-07 Akim Demaille <akim@epita.fr>
16533
16534 * TODO: Update.
16535
165362002-04-07 Akim Demaille <akim@epita.fr>
16537
16538 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
16539 bucket.value as bucket.number.
16540
165412002-04-07 Akim Demaille <akim@epita.fr>
16542
16543 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
16544 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16545 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
16546 RHS, instead of being an index in RITEMS.
16547
165482002-04-04 Paul Eggert <eggert@twinsun.com>
16549
16550 * doc/bison.texinfo: Update copyright date.
16551 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
16552 (Symbols): Warn about running Bison in one character set,
16553 but compiling and/or running in an incompatible one.
16554 Warn about character code 256, too.
16555
165562002-04-03 Paul Eggert <eggert@twinsun.com>
16557
16558 * src/bison.data (YYSTACK_ALLOC): Depend on whether
16559 YYERROR_VERBOSE is nonzero, not whether it is defined.
16560
16561 Merge changes from bison-1_29-branch.
16562
165632002-03-20 Paul Eggert <eggert@twinsun.com>
16564
16565 Merge fixes from Debian bison_1.34-1.diff.
16566
16567 * configure.in (AC_PREREQ): 2.53.
16568
165692002-03-20 Akim Demaille <akim@epita.fr>
16570
16571 * src/conflicts.c (log_resolution): Argument `resolution' is const.
16572
165732002-03-19 Paul Eggert <eggert@twinsun.com>
16574
16575 * src/bison.simple (YYCOPY): New macro.
16576 (YYSTACK_RELOCATE): Use it.
16577 Remove Type arg; no longer needed. All callers changed.
16578 (yymemcpy): Remove; no longer needed.
16579
16580 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
16581 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16582
165832002-03-19 Akim Demaille <akim@epita.fr>
16584
16585 Test and fix the #line outputs.
16586
16587 * tests/atlocal.at (GCC): New.
16588 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
16589 (Prologue synch line, %union synch line, Postprologue synch line)
16590 (Action synch line, Epilogue synch line): New tests.
16591 * src/reader.c (parse_union_decl): Define the muscle stype_line.
16592 * data/bison.simple, data/bison.c++: Use it.
16593
165942002-03-19 Akim Demaille <akim@epita.fr>
16595
16596 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
16597 (Solved SR Conflicts, %expect not enough, %expect right)
16598 (%expect too much): Move to...
16599 * tests/conflicts.at: this new file.
16600
166012002-03-19 Akim Demaille <akim@epita.fr>
16602
16603 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16604 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
16605 that we can move to enums for instance.
16606 * src/output.c (token_definitions_output): Output a list of
16607 `token-name, token-number' instead of the #define.
16608 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
16609
166102002-03-14 Akim Demaille <akim@epita.fr>
16611
16612 Use Gettext 0.11.1.
16613
166142002-03-09 Robert Anisko <robert@lrde.epita.fr>
16615
16616 * data/bison.c++: Make the user able to add members to the generated
16617 parser by subclassing.
16618
166192002-03-05 Robert Anisko <robert@lrde.epita.fr>
16620
16621 * src/reader.c (read_additionnal_code): `c' should be an integer, not
16622 a character.
16623 Reported by Nicolas Tisserand and Nicolas Burrus.
16624
166252002-03-04 Robert Anisko <robert@lrde.epita.fr>
16626
16627 * src/reader.c: Warn about lacking semi-colons, do not complain.
16628
166292002-03-04 Robert Anisko <robert@lrde.epita.fr>
16630
16631 * data/bison.c++: Remove a debug line.
16632
166332002-03-04 Robert Anisko <robert@lrde.epita.fr>
16634
16635 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
16636 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
16637 provide a default implementation.
16638
166392002-03-04 Akim Demaille <akim@epita.fr>
16640
16641 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
16642 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
16643 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
16644 * tests/semantic.at (Parsing Guards): Similarly.
16645 * src/reader.at (readgram): Complain if the last rule is not ended
16646 with a semi-colon.
16647
166482002-03-04 Akim Demaille <akim@epita.fr>
16649
16650 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
16651 * src/closure.c: here.
16652 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
16653 RTC.
16654 * src/warshall.h, src/warshall.c: Remove.
16655 * tests/sets.at (Broken Closure): Adjust.
16656
166572002-03-04 Akim Demaille <akim@epita.fr>
16658
16659 * src/output.c (output_skeleton): tempdir is const.
16660 bytes_read is unused.
16661
166622002-03-04 Akim Demaille <akim@epita.fr>
16663
16664 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16665 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
16666 Update.
16667 From Michael Hayes.
16668
166692002-03-04 Akim Demaille <akim@epita.fr>
16670
16671 * src/closure.c (closure): `r' is unused.
16672
166732002-03-04 Akim Demaille <akim@epita.fr>
16674
16675 * tests/sets.at (Broken Closure): Add the ending `;'.
16676 * src/reader.at (readgram): Complain if a rule is not ended with a
16677 semi-colon.
16678
166792002-03-04 Akim Demaille <akim@epita.fr>
16680
16681 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
16682 (count_sr_conflicts): Use bitset_count.
16683 * src/reduce.c (inaccessable_symbols): Ditto.
16684 (bits_size): Remove.
16685 * src/warshall.h, src/warshall.c: Convert to bitsetv.
16686
166872002-03-04 Akim Demaille <akim@epita.fr>
16688
16689 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
16690 * src/reduce.c: Remove the `bitset_zero's following the
16691 `bitset_create's, as now it is performed by the latter.
16692
166932002-03-04 Akim Demaille <akim@epita.fr>
16694
16695 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
16696 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
16697 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
16698 latest sources from Michael.
16699
167002002-03-04 Akim Demaille <akim@epita.fr>
16701
16702 * src/output.c (output): Don't free the grammar.
16703 * src/reader.c (grammar_free): New.
16704 * src/main.c (main): Call it and don't free symtab here.
16705
167062002-03-04 Akim Demaille <akim@epita.fr>
16707
16708 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
16709 before returning.
16710 Reported by Benoit Perrot.
16711
167122002-03-04 Akim Demaille <akim@epita.fr>
16713
16714 Use bitset operations when possible, not loops over bits.
16715
16716 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
16717 bitset_or.
16718 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
16719 * src/reduce.c (useless_nonterminals): Formatting changes.
16720 * src/warshall.c (TC): Use bitset_or.
16721
167222002-03-04 Akim Demaille <akim@epita.fr>
16723
16724 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
16725 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
16726 Ditto.
16727
167282002-03-04 Akim Demaille <akim@epita.fr>
16729
16730 * src/lalr.c (F): Now a bitset*.
16731 Adjust all dependencies.
16732
167332002-03-04 Akim Demaille <akim@epita.fr>
16734
16735 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
16736 Adjust all dependencies.
16737
167382002-03-04 Akim Demaille <akim@epita.fr>
16739
16740 * src/L0.c, src/LR0.h (nstates): Be size_t.
16741 Adjust comparisons (signed vs unsigned).
16742 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
16743 bitset*.
16744 Adjust all dependencies.
16745
167462002-03-04 Akim Demaille <akim@epita.fr>
16747
16748 * src/closure.c (firsts): Now, also a bitset.
16749 Adjust all dependencies.
16750 (varsetsize): Remove, now unused.
16751 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
16752
167532002-03-04 Akim Demaille <akim@epita.fr>
16754
16755 * src/print.c: Convert to use bitset.h, not hand coded iterations
16756 over ints.
16757
167582002-03-04 Akim Demaille <akim@epita.fr>
16759
16760 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
16761
167622002-03-04 Akim Demaille <akim@epita.fr>
16763
16764 * src/closure.c (ruleset): Be a bitset.
16765 (rulesetsize): Remove.
16766
167672002-03-04 Akim Demaille <akim@epita.fr>
16768
16769 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16770 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
16771 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
16772 * src/closure.c (fderives): Be an array of bitsets.
16773
167742002-02-28 Robert Anisko <robert@lrde.epita.fr>
16775
16776 * data/bison.c++: Merge the two generated headers. Insert a copyright
16777 notice in each output file.
16778
167792002-02-28 Akim Demaille <akim@epita.fr>
16780
16781 * data/bison.c++: Copy the prologue of bison.simple to fetch
16782 useful M4 definitions, such as b4_header_guard.
16783
167842002-02-25 Akim Demaille <akim@epita.fr>
16785
16786 * src/getargs.c (version): Give the name of the authors, and use a
16787 translator friendly scheme for the bgr
16788 copyright notice.
16789
167902002-02-25 Akim Demaille <akim@epita.fr>
16791
16792 * src/output.c (header_output): Remove, now handled completely via
16793 M4.
16794
167952002-02-25 Akim Demaille <akim@epita.fr>
16796
16797 * m4/m4.m4: New, from CVS Autoconf.
16798 * configure.in: Invoke it.
16799 * src/output.c (output_skeleton): Use its result instead of the
16800 hard coded name.
16801
168022002-02-25 Akim Demaille <akim@epita.fr>
16803
16804 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
16805 Fileutils 4.1.5.
16806 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
16807 * src/output.c (output_skeleton): Use mkstemp to create a real
16808 temporary file.
16809 Move the filling of `skeleton' and its muscle to...
16810 (prepare): here.
16811 (output): Move the definition of the prologue muscle to...
16812 (prepare): here.
16813 * src/system.h (DEFAULT_TMPDIR): New.
16814
168152002-02-14 Paul Eggert <eggert@twinsun.com>
16816
16817 Remove the support for C++ namespace cleanliness; it was
16818 causing more problems than it was curing, since it didn't work
16819 properly on some nonstandard C++ compilers. This can wait
16820 for a proper C++ parser.
16821
16822 * NEWS: Document this.
16823 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
16824 of C++, as it's treated like C now.
16825 * src/bison.simple (YYSTD): Remove.
16826 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
16827 Treat C++ just like Standard C instead of trying to support
16828 namespace cleanliness.
16829
168302002-02-14 Akim Demaille <akim@epita.fr>
16831
16832 * tests/regression.at (else): Adjust to Andreas' change.
16833
168342002-02-14 Akim Demaille <akim@epita.fr>
16835
16836 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
16837
168382002-02-13 Andreas Schwab <schwab@suse.de>
16839
16840 * src/output.c (output_rule_data): Don't output NULL, it might
16841 not be defined yet.
16842
168432002-02-11 Robert Anisko <robert@lrde.epita.fr>
16844
16845 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
16846 (Copyright notice): Update.
16847
168482002-02-11 Akim Demaille <akim@epita.fr>
16849
16850 * tests/regression.at (%nonassoc and eof): Don't include
16851 nonportable headers.
16852
168532002-02-08 Robert Anisko <robert@lrde.epita.fr>
16854
16855 * data/bison.c++: Correct error recovery. Make the user able to
16856 initialize the starting location.
16857
168582002-02-07 Akim Demaille <akim@epita.fr>
16859
16860 * tests/input.at: New.
16861
168622002-02-07 Robert Anisko <robert@lrde.epita.fr>
16863
16864 * data/bison.c++: Replace some direct m4 expansions by constants. Be
16865 more consistent when naming methods and variables. Put preprocessor
16866 directives around tables only needed for debugging.
16867
168682002-02-07 Robert Anisko <robert@lrde.epita.fr>
16869
16870 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
16871 C++ parsers.
16872 (yy::b4_name::parse): Use print_.
16873
168742002-02-07 Robert Anisko <robert@lrde.epita.fr>
16875
16876 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
16877
168782002-02-07 Robert Anisko <robert@lrde.epita.fr>
16879
16880 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
16881 C++ parsers.
16882 (yy::b4_name::parse): Build verbose error messages, and use error_.
16883
168842002-02-06 Robert Anisko <robert@lrde.epita.fr>
16885
16886 * data/bison.c++: Fix m4 quoting in comments.
16887
168882002-02-06 Robert Anisko <robert@lrde.epita.fr>
16889
16890 * data/bison.c++: Adjust the parser code. Fix some muscles that were
16891 not expanded by m4.
16892
168932002-02-05 Akim Demaille <akim@epita.fr>
16894
16895 * data/bison.c++: Adjust to the M4 back end.
16896 More is certainly needed.
16897
168982002-02-05 Akim Demaille <akim@epita.fr>
16899
16900 Give a try to M4 as a back end.
16901
16902 * lib/readpipe.c: New, from wdiff.
16903 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
16904 BISON_HAIRY.
16905 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
16906 specific values. Now it is m4 that performs the lookup.
16907 * src/parse-skel.y: Remove.
16908 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
16909 * src/output.c (actions_output, guards_output)
16910 (token_definitions_output): No longer keeps track of the output
16911 line number, hence remove the second argument.
16912 (guards_output): Check against the guard member of a rule, not the
16913 action member.
16914 Adjust callers.
16915 (output_skeleton): Don't look for the skeleton location, let m4 do
16916 that.
16917 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
16918 file will be used.
16919 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
16920 (prepare): Given that for the time being changesyntax is not
16921 usable in M4, rename the muscles using `-' to `_'.
16922 Define `defines_flag', `output_parser_name' and `output_header_name'.
16923 * src/output.h (actions_output, guards_output)
16924 (token_definitions_output): Adjust prototypes.
16925 * src/scan-skel.l: Instead of scanning the skeletons, it now
16926 processes the output of m4: `__oline__' and `#output'.
16927 * data/bison.simple: Adjust to be used by M4(sugar).
16928 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
16929 to date.
16930 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
16931 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
16932 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
16933 shamelessly stolen from CVS Autoconf.
16934
169352002-02-05 Akim Demaille <akim@epita.fr>
16936
16937 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
16938 * configure.in: Check for the declarations of free and malloc.
16939 * src/muscle_tab.c: Adjust.
16940
169412002-02-05 Akim Demaille <akim@epita.fr>
16942
16943 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
16944 which have no values.
16945
169462002-02-05 Akim Demaille <akim@epita.fr>
16947
16948 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
16949 * data/: here.
16950
169512002-01-29 Paul Eggert <eggert@twinsun.com>
16952
16953 * src/bison.simple (YYSIZE_T): Do not define merely because
16954 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
16955 On some platforms, <alloca.h> does not declare YYSTD (size_t).
16956
169572002-01-27 Akim Demaille <akim@epita.fr>
16958
16959 Fix `%nonassoc and eof'.
16960
16961 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
16962 which were not properly copied! Replace
16963 memcpy (res->errs, src->errs, src->nerrs);
16964 with
16965 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
16966 !!!
16967 * tests/regression.at (%nonassoc and eof): Adjust to newest
16968 Autotest: `.' is not in the PATH.
16969
169702002-01-27 Akim Demaille <akim@epita.fr>
16971
16972 * tests/sets.at (AT_EXTRACT_SETS): New.
16973 (Nullable): Use it.
16974 (Firsts): New.
16975
169762002-01-26 Akim Demaille <akim@epita.fr>
16977
16978 * tests/actions.at, tests/calc.at, tests/headers.at,
16979 * tests/torture.at: Adjust to the newest Autotest which no longer
16980 forces `.' in the PATH.
16981
169822002-01-25 Akim Demaille <akim@epita.fr>
16983
16984 * tests/regression.at (%nonassoc and eof): New.
16985 Suggested by Robert Anisko.
16986
169872002-01-24 Akim Demaille <akim@epita.fr>
16988
16989 Bison dumps core when trying to complain about broken input files.
16990 Reported by Cris van Pelt.
16991
16992 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
16993 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
16994 into...
16995 (Invalid inputs): Strengthen: exercise parse_percent_token.
16996
169972002-01-24 Robert Anisko <robert.anisko@epita.fr>
16998
16999 * src/Makefile.am: Add bison.c++.
17000 * src/bison.c++: New skeleton.
17001
170022002-01-21 Paolo Bonzini <bonzini@gnu.org>
17003
17004 * po/it.po: New.
17005
170062002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
17007
17008 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
17009
170102002-01-20 Marc Autret <marc@gnu.org>
17011
17012 * src/files.c (compute_output_file_names): Fix
17013
170142002-01-20 Marc Autret <marc@gnu.org>
17015
17016 * tests/output.at: New test.
17017 * src/files.c (compute_base_names): Don't map extensions when
17018 the YACC flag is set, use defaults.
17019 Reported by Evgeny Stambulchik.
17020
170212002-01-20 Marc Autret <marc@gnu.org>
17022
17023 * src/system.h: Need to define __attribute__ away for non-GCC
17024 compilers as well (i.e., the vendor C compiler).
17025 Suggested by Albert Chin-A-Young.
17026
170272002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
17028
17029 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
17030 canonical definition.
17031 * src/system.h: Use the canonical definition for PARAMS (avoids
17032 a conflict with the macro from lib/hash.h).
17033
170342002-01-11 Akim Demaille <akim@epita.fr>
17035
17036 * configure.in: Use AC_FUNC_STRNLEN.
17037 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
17038
170392002-01-09 Akim Demaille <akim@epita.fr>
17040
17041 * src/files.c, src/files.h (output_infix): New.
17042 (tab_extension): Remove.
17043 (compute_base_names): Compute the former, drop the latter.
17044 * src/output.c (prepare): Insert the muscles `output-infix', and
17045 `output-suffix'.
17046 * src/parse-skel.y (string, string.1): New.
17047 (section.header): Use it.
17048 (section.yacc): Remove.
17049 (prefix): Remove too.
17050 * src/scan-skel.l: Adjust.
17051 * src/bison.simple, src/bison.hairy: Adjust.
17052
170532002-01-09 Akim Demaille <akim@epita.fr>
17054
17055 * configure.in (WERROR_CFLAGS): Compute it.
17056 * src/Makefile.am (CFLAGS): Pass it.
17057 * tests/atlocal.in (CFLAGS): Idem.
17058 * src/files.c: Fix a few warnings.
17059 (get_extension_index): Remove, unused.
17060
170612002-01-08 Akim Demaille <akim@epita.fr>
17062
17063 * src/getargs.c (AS_FILE_NAME): New.
17064 (getargs): Use it to convert DOSish file names.
17065 * src/files.c (base_name): Rename as full_base_name to avoid
17066 clashes with `base_name ()'.
17067 (filename_split): New.
17068 (compute_base_names): N-th rewrite, using filename_split.
17069
170702002-01-08 Akim Demaille <akim@epita.fr>
17071
17072 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
17073 New, stolen from the Fileutils 4.1.
17074 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
17075 * configure.in: Check for the presence of memrchr, and of its
17076 prototype.
17077
170782002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
17079
17080 * lib/hash.h (__P): Added definition for this macro.
17081 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
17082 BUILT_SOURCES, to ensure they are generated first.
17083 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
17084 %error-verbose to allow bootstrapping with bison 1.30x.
17085
170862002-01-06 Akim Demaille <akim@epita.fr>
17087
17088 * src/reader.c (parse_braces): Don't fetch the next char, the
17089 convention is to fetch on entry.
17090 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
17091 'switch' without a following semicolon.
17092 * tests/regression.at (braces parsing): New.
17093
170942002-01-06 Akim Demaille <akim@epita.fr>
17095
17096 Bison is dead wrong in its RR conflict reports.
17097
17098 * tests/torture.at (GNU Cim Grammar): New.
17099 * src/conflicts.c (count_rr_conflicts): Fix.
17100
171012002-01-06 Akim Demaille <akim@epita.fr>
17102
17103 Creating package.m4 from configure.ac causes too many problems.
17104
17105 * tests/Makefile.am (package.m4): Create it by hand,
17106 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
17107
171082002-01-06 Akim Demaille <akim@epita.fr>
17109
17110 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
17111 skeleton.h.
17112
171132002-01-04 Paul Eggert <eggert@twinsun.com>
17114
17115 * doc/bison.texinfo (Debugging):
17116 Remove YYSTDERR; it's no longer defined or used.
17117 Also, s/cstdio.h/cstdio/.
17118
171192002-01-03 Akim Demaille <akim@epita.fr>
17120
17121 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
17122
171232002-01-03 Akim Demaille <akim@epita.fr>
17124
17125 * src/parse-skel.y (process_skeleton): Don't bind the parser's
17126 tracing code to --trace, wait for a better --trace option, with
17127 args.
17128
171292002-01-03 Akim Demaille <akim@epita.fr>
17130
17131 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
17132 The ISO C++ standard is extremely clear about it: stderr is
17133 considered a macro, not a regular symbol (see table 94 `Header
17134 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
17135 Therefore std:: does not apply to it. It still does with fprintf.
17136 Also, s/cstdio.h/cstdio/.
17137
171382002-01-03 Akim Demaille <akim@epita.fr>
17139
17140 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
17141 for non system headers.
17142
171432002-01-02 Akim Demaille <akim@epita.fr>
17144
17145 Equip the skeleton chain with location tracking, runtime trace,
17146 pure parser and scanner.
17147
17148 * src/parse-skel.y: Request a pure parser, locations, and prefix
17149 renaming.
17150 (%union): Having several members with the same type does not help
17151 type mismatches, simplify.
17152 (YYPRINT, yyprint): New.
17153 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
17154 (skel_error): this.
17155 Handle locations.
17156 * src/scan-skel.l: Adjust to these changes.
17157 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
17158 (LOCATION_PRINT, skel_control_t): New.
17159
171602001-12-30 Akim Demaille <akim@epita.fr>
17161
17162 * src/parse-skel.y: Get rid of the shift/reduce conflict:
17163 replace `gb' with BLANKS.
17164 * src/scan-skel.l: Adjust.
17165
171662001-12-30 Akim Demaille <akim@epita.fr>
17167
17168 * src/system.h: We don't need nor want bcopy.
17169 Throw away MS-DOS crap: we don't need getpid.
17170 * configure.in: We don't need strndup. It was even causing
17171 problems: because Flex includes the headers *before* us,
17172 _GNU_SOURCE is not defined by config.h, and therefore strndup was
17173 not visible.
17174 * lib/xstrndup.c: New.
17175 * src/scan-skel.l: Use it.
17176 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
17177 * src/parse-skel.y: Use %directives instead of #defines.
17178
171792001-12-30 Akim Demaille <akim@epita.fr>
17180
17181 * src/skeleton.h: New.
17182 * src/output.c (output_parser, output_master_parser): Remove, dead
17183 code.
17184 * src/output.h (get_lines_number, actions_output, guards_output)
17185 (token_definitions_output): Prototype them.
17186 * src/parse-skel.y: Add the license notice.
17187 Include output.h and skeleton.h.
17188 (process_skeleton): Returns void, and takes a single parameter.
17189 * src/scan-skel.l: Add the license notice.
17190 Include skeleton.h.
17191 Don't use %option yylineno: it seems that then Flex imagines
17192 REJECT has been used, and therefore it won't reallocate its
17193 buffers (which makes no other sense to me than a bug). It results
17194 in warnings for `unused: yy_flex_realloc'.
17195
171962001-12-30 Robert Anisko <robert.anisko@epita.fr>
17197
17198 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17199 (MUSCLE_INSERT_PREFIX): ...to there.
17200 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17201 (MUSCLE_INSERT_PREFIX): Move from here...
17202
17203 * src/bison.hairy: Add a section directive. Put braces around muscle
17204 names. This parser skeleton is still broken, but Bison should not
17205 choke on a bad muscle 'syntax'.
17206 * src/bison.simple: Add a section directive. Put braces around muscle
17207 names.
17208
17209 * src/files.h (strsuffix, stringappend): Add declarations.
17210 (tab_extension): Add declaration.
17211 (short_base_name): Add declaration.
17212
17213 * src/files.c (strsuffix, stringappend): No longer static. These
17214 functions are used in the skeleton parser.
17215 (tab_extension): New.
17216 (compute_base_names): Use the computations done in this function
17217 to guess if the generated parsers should have '.tab' in their
17218 names.
17219 (short_base_name): No longer static.
17220
17221 * src/output.c (output_skeleton): New.
17222 (output): Disable call to output_master_parser, and give a try to
17223 a new skeleton handling system.
17224 (guards_output, actions_output): No longer static.
17225 (token_definitions_output, get_lines_number): No longer static.
17226
17227 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
17228
17229 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
17230 parse-skel.y.
17231
17232 * src/parse-skel.y: New file.
17233 * src/scan-skel.l: New file.
17234
172352001-12-29 Akim Demaille <akim@epita.fr>
17236
17237 %name-prefix is broken.
17238
17239 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
17240 Adjust all dependencies.
17241 * tests/headers.at (export YYLTYPE): Strengthen this test: use
17242 %name-prefix.
17243
17244 Renaming yylval but not yylloc is not consistent. Now we do.
17245
17246 * src/bison.simple: Prefix yylloc if used.
17247 * doc/bison.texinfo (Decl Summary): Document that.
17248
172492001-12-29 Akim Demaille <akim@epita.fr>
17250
17251 * doc/bison.texinfo: Promote `%long-directive' over
17252 `%long_directive'.
17253 Remove all references to fixed-output-files, yacc is enough.
17254
172552001-12-29 Akim Demaille <akim@epita.fr>
17256
17257 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
17258 user prologue. These are defaults.
17259 * tests/actions.at (Mid-rule actions): Make sure the user can
17260 define YYDEBUG and YYERROR_VERBOSE.
17261
172622001-12-29 Akim Demaille <akim@epita.fr>
17263
17264 * src/output.c (header_output): Don't forget to export YYLTYPE and
17265 yylloc.
17266 * tests/headers.at (export YYLTYPE): New, make sure it does.
17267 * tests/regression.at (%union and --defines, Invalid CPP headers):
17268 Move to...
17269 * tests/headers.at: here.
17270
172712001-12-29 Akim Demaille <akim@epita.fr>
17272
17273 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
17274
172752001-12-29 Akim Demaille <akim@epita.fr>
17276
17277 * tests/actions.at (Mid-rule actions): Output on a single line
17278 instead of several.
17279
172802001-12-29 Akim Demaille <akim@epita.fr>
17281
17282 * doc/bison.texinfo: Formatting changes.
17283
172842001-12-29 Akim Demaille <akim@epita.fr>
17285
17286 Don't store the token defs in a muscle, just be ready to output it
17287 on command. Now possible via `symbols'. Fixes a memory leak.
17288
17289 * src/output.c (token_definitions_output): New.
17290 (output_parser, header_output): Use it.
17291 * src/reader.c (symbols_save): Remove.
17292
172932001-12-29 Akim Demaille <akim@epita.fr>
17294
17295 * src/bison.simple: Do not provide a default for YYSTYPE and
17296 YYLTYPE before the user's prologue. Otherwise it's hardly... a
17297 default.
17298
172992001-12-29 Akim Demaille <akim@epita.fr>
17300
17301 Mid-rule actions are simply... ignored!
17302
17303 * src/reader.c (readgram): Be sure to attach mid-rule actions to
17304 the empty-rule associated to the dummy symbol, not to the host
17305 rule.
17306 * tests/actions.at (Mid-rule actions): New.
17307
173082001-12-29 Akim Demaille <akim@epita.fr>
17309
17310 Memory leak.
17311
17312 * src/reader.c (reader): Free grammar.
17313
173142001-12-29 Akim Demaille <akim@epita.fr>
17315
17316 Memory leak.
17317
17318 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
17319 since it allocates it for each state, although only one is needed.
17320 (allocate_storage): Do it here.
17321
173222001-12-29 Akim Demaille <akim@epita.fr>
17323
17324 * src/options.h, src/options.c (create_long_option_table): Rename
17325 as...
17326 (long_option_table_new): this, with a clearer prototype.
17327 (percent_table): Remove, unused,
17328 * src/getargs.c (getargs): Adjust.
17329
173302001-12-29 Akim Demaille <akim@epita.fr>
17331
17332 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
17333 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
17334 as states.
17335
173362001-12-29 Akim Demaille <akim@epita.fr>
17337
17338 * src/lalr.c (build_relations): Rename `states' as `states1'.
17339 Sorry, I don't understand exactly what it is, no better name...
17340
173412001-12-29 Akim Demaille <akim@epita.fr>
17342
17343 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
17344 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
17345 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
17346 as rules.
17347
173482001-12-29 Akim Demaille <akim@epita.fr>
17349
17350 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
17351 ago.
17352
173532001-12-29 Akim Demaille <akim@epita.fr>
17354
17355 * src/reader.c, src/reader.h (user_toknums): Remove.
17356 Adjust all users to use symbols[i]->user_token_number.
17357
173582001-12-29 Akim Demaille <akim@epita.fr>
17359
17360 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
17361 Adjust all users to use symbols[i]->prec or ->assoc.
17362
173632001-12-29 Akim Demaille <akim@epita.fr>
17364
17365 * src/reader.c, src/reader.h (tags): Remove.
17366 Adjust all users to use symbols[i]->tag.
17367
173682001-12-29 Akim Demaille <akim@epita.fr>
17369
17370 * src/gram.h, src/gram.c (symbols): New, similar to state_table
17371 and rule_table.
17372 * src/reader.c (packsymbols): Fill this table.
17373 Drop sprec.
17374 * src/conflicts.c (resolve_sr_conflict): Adjust.
17375 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
17376 single table.
17377 Use symbols[i]->tag instead of tags[i].
17378
173792001-12-29 Akim Demaille <akim@epita.fr>
17380
17381 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
17382 In addition, put a comment in there, to replace...
17383 * tests/regression.at (%union and C comments): Remove.
17384
173852001-12-29 Akim Demaille <akim@epita.fr>
17386
17387 * tests/regression.at (Web2c Actions): Blindly move the actual
17388 output as expected output. The contents *seem* right to me, but I
17389 can't pretend reading perfectly parser tables... Nonetheless, all
17390 the other tests pass correctly, the table look OK, even though the
17391 presence of `$axiom' is to be noted: AFAICS it is useless (but
17392 harmless).
17393
173942001-12-29 Akim Demaille <akim@epita.fr>
17395
17396 * src/reader.c (readgram): Don't add the rule 0 if there were no
17397 rules read. In other words, add it _after_ having performed
17398 grammar sanity checks.
17399 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
17400
174012001-12-29 Akim Demaille <akim@epita.fr>
17402
17403 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
17404 visible, and some states have now a different number.
17405
174062001-12-29 Akim Demaille <akim@epita.fr>
17407
17408 * src/reader.c (readgram): Bind the initial rule's lineno to that
17409 of the first rule.
17410 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
17411 (Solved SR Conflicts): Adjust rule 0's line number.
17412
174132001-12-29 Akim Demaille <akim@epita.fr>
17414
17415 Fix the `GAWK Grammar' failure.
17416
17417 * src/LR0.c (final_state): Initialize to -1 so that we do compute
17418 the reductions of the first state which was mistakenly confused
17419 with the final state because precisely final_state was initialized
17420 to 0.
17421 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
17422 now noticed by Bison.
17423 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
17424 have a reduction on $default.
17425
174262001-12-29 Akim Demaille <akim@epita.fr>
17427
17428 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
17429 rule line numbers.
17430 * src/closure.c (print_closure): Likewise.
17431 * src/derives.c (print_derives): Likewise.
17432 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
17433 now.
17434
174352001-12-29 Akim Demaille <akim@epita.fr>
17436
17437 * src/lalr.c (lookaheads_print): New.
17438 (lalr): Call it when --trace-flag.
17439 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
17440 are dumped.
17441
174422001-12-29 Akim Demaille <akim@epita.fr>
17443
17444 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
17445 when walking through ritem, even via rule->rhs.
17446 * src/reduce.c (dump_grammar, useful_production, reduce_output)
17447 (useful_production, useless_nonterminals): Likewise.
17448 (reduce_grammar_tables): Likewise, plus update nritems.
17449 * src/nullable.c (set_nullable): Likewise.
17450 * src/lalr.c (build_relations): Likewise.
17451 * tests/sets.at (Nullable): Adjust.
17452 Fortunately, now, the $axiom is no longer nullable.
17453
174542001-12-29 Akim Demaille <akim@epita.fr>
17455
17456 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
17457 the 0-sentinel.
17458 * src/gram.c (ritem_longest_rhs): Likewise.
17459 * src/reduce.c (nonterminals_reduce): Likewise.
17460 * src/print_graph.c (print_graph): Likewise.
17461 * src/output.c (output_rule_data): Likewise.
17462 * src/nullable.c (set_nullable): Likewise.
17463
174642001-12-29 Akim Demaille <akim@epita.fr>
17465
17466 * src/output.c: Comment changes.
17467
174682001-12-27 Paul Eggert <eggert@twinsun.com>
17469
17470 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
17471 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
17472 Sparc, as they were causing more porting problems than the
17473 (minor) performance improvement was worth.
17474
17475 Also, catch up with 1.31's YYSTD.
17476
174772001-12-27 Akim Demaille <akim@epita.fr>
17478
17479 * src/output.c (output_gram): Rely on nritems, not the
17480 0-sentinel. See below.
17481 Use -1 as separator, not 0.
17482 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
17483 Rely on -1 as separator in yyrhs, instead of 0.
17484 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
17485 twice `Now at end of input', therefore there are two lines less to
17486 expect.
17487
174882001-12-27 Akim Demaille <akim@epita.fr>
17489
17490 * tests/regression.at (Unresolved SR Conflicts):
17491 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
17492 below.
17493
174942001-12-27 Akim Demaille <akim@epita.fr>
17495
17496 * src/LR0.c (new_state): Recognize the final state by the fact it
17497 is reached by eoftoken.
17498 (insert_start_shifting_state, insert_eof_shifting_state)
17499 (insert_accepting_state, augment_automaton): Remove, since now
17500 these states are automatically computed from the initial state.
17501 (generate_states): Adjust.
17502 * src/print.c: When reporting a rule number to the user, substract
17503 1, so that the axiom rule is rule 0, and the first user rule is 1.
17504 * src/reduce.c: Likewise.
17505 * src/print_graph.c (print_core): For the time being, just as for
17506 the report, depend upon --trace-flags to dump the full set of
17507 items.
17508 * src/reader.c (readgram): Once the grammar read, insert the rule
17509 0: `$axiom: START-SYMBOL $'.
17510 * tests/set.at: Adjust: rule 0 is now displayed, and since the
17511 number of the states has changed (the final state is no longer
17512 necessarily the last), catch up.
17513
175142001-12-27 Akim Demaille <akim@epita.fr>
17515
17516 Try to make the use of the eoftoken valid. Given that its value
17517 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
17518 is used instead of > 0 where appropriate, (ii), depend upon nritems
17519 instead of the 0-sentinel.
17520
17521 * src/gram.h, src/gram.c (nritems): New.
17522 Expected to be duplication of nitems, but for the time being...
17523 * src/reader.c (packgram): Assert nritems and nitems are equal.
17524 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
17525 * src/closure.c (print_closure, print_fderives): Likewise.
17526 * src/gram.c (ritem_print): Likewise.
17527 * src/print.c (print_core, print_grammar): Likewise.
17528 * src/print_graph.c: Likewise.
17529
175302001-12-27 Akim Demaille <akim@epita.fr>
17531
17532 * src/main.c (main): If there are complains after grammar
17533 reductions, then output the report anyway if requested, then die.
17534 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
17535 * src/reader.c (eoftoken): New.
17536 (parse_token_decl): If the token being defined has value `0', it
17537 is the eoftoken.
17538 (packsymbols): No longer hack `tags' to insert `$' by hand.
17539 Be sure to preserve the value of the eoftoken.
17540 (reader): Make sure eoftoken is defined.
17541 Initialize nsyms to 0: now eoftoken is created just like the others.
17542 * src/print.c (print_grammar): Don't special case the eof token.
17543 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
17544 lie anyway, albeit pleasant.
17545 * tests/calc.at: Exercise error messages with eoftoken.
17546 Change the grammar so that empty input is invalid.
17547 Adjust expectations.
17548 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
17549
175502001-12-27 Akim Demaille <akim@epita.fr>
17551
17552 * configure.in: Check the protos of strchr ans strspn.
17553 Replace strchr if needed.
17554 * src/system.h: Provide the protos of strchr, strspn and memchr if
17555 missing.
17556 * lib/strchr.c: New.
17557 * src/reader.c (symbols_save): Use strchr.
17558
175592001-12-27 Akim Demaille <akim@epita.fr>
17560
17561 * src/print.c, src/print_graph.c (escape): New.
17562 Use it to quote the TAGS outputs.
17563 * src/print_graph.c (print_state): Now errors are in red, and
17564 reductions in green.
17565 Prefer high to wide: output the state number on a line of its own.
17566
175672001-12-27 Akim Demaille <akim@epita.fr>
17568
17569 * src/state.h, src/state.c (reductions_new): New.
17570 * src/LR0.c (set_state_table): Let all the states have a
17571 `reductions', even if reduced to 0.
17572 (save_reductions): Adjust.
17573 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
17574 * src/print.c (print_reductions, print_actions): Adjust.
17575 * src/output.c (action_row): Adjust.
17576
175772001-12-27 Akim Demaille <akim@epita.fr>
17578
17579 * src/state.h, src/state.c (errs_new, errs_dup): New.
17580 * src/LR0.c (set_state_table): Let all the states have an errs,
17581 even if reduced to 0.
17582 * src/print.c (print_errs, print_reductions): Adjust.
17583 * src/output.c (output_actions, action_row): Adjust.
17584 * src/conflicts.c (resolve_sr_conflict): Adjust.
17585
175862001-12-27 Akim Demaille <akim@epita.fr>
17587
17588 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
17589
175902001-12-27 Akim Demaille <akim@epita.fr>
17591
17592 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
17593 * src/print.c: here.
17594 (lookaheadset, shiftset): New, used as additional storage by
17595 print_reductions.
17596 (print_results): Adjust.
17597 (print_shifts, print_gotos, print_errs): New, extracted from...
17598 (print_actions): here.
17599 * src/print_graph.c (print_actions): Remove dead code.
17600
176012001-12-27 Akim Demaille <akim@epita.fr>
17602
17603 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
17604 `$n' and `@n'.
17605
176062001-12-27 Akim Demaille <akim@epita.fr>
17607
17608 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
17609 (build_relations): Adjust.
17610
176112001-12-27 Akim Demaille <akim@epita.fr>
17612
17613 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
17614 duplication.
17615
176162001-12-27 Akim Demaille <akim@epita.fr>
17617
17618 * src/reader.c (packgram): Catch nitems overflows.
17619
176202001-12-27 Akim Demaille <akim@epita.fr>
17621
17622 * src/files.c, src/files.h (guard_obstack): Remove.
17623 * src/output.c (output): Adjust.
17624 * src/reader.c (parse_braces): New, factoring...
17625 (copy_action, copy_guard): these two which are renamed as...
17626 (parse_action, parse_guard): these.
17627 As a voluntary consequence, using braces around guards is now
17628 mandatory.
17629
176302001-12-27 Akim Demaille <akim@epita.fr>
17631
17632 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
17633 * src/reader.c (symbol_list): `guard' and `guard_line' are new
17634 members.
17635 (symbol_list_new): Adjust.
17636 (copy_action): action_line is the first line, not the last.
17637 (copy_guard): Just as for actions, store the `action' only, not
17638 the switch/case/break flesh.
17639 Don't parse the user action that might follow the guard, let...
17640 (readgram): do it, i.e., now, there can be an action after a
17641 guard.
17642 In other words the guard is just explicitly optional.
17643 (packgram): Adjust.
17644 * src/output.c (guards_output): New.
17645 (output_parser): Call it when needed.
17646 (output): Also free the guard and attrs obstacks.
17647 * src/files.c, src/files.h (obstack_save): Remove.
17648 (output_files): Remove.
17649 As a result, if one needs the former `.act' file, using an
17650 appropriate skeleton which requires actions and guards is now
17651 required.
17652 * src/main.c (main): Adjust.
17653 * tests/semantic.at: New.
17654 * tests/regression.at: Use `input.y' as input file name.
17655 Avoid 8+3 problems by requiring input.c when the test needs the
17656 parser.
17657
176582001-12-27 Akim Demaille <akim@epita.fr>
17659
17660 * src/reader.c (symbol_list_new): Be sure to initialize all the
17661 fields.
17662
176632001-12-27 Akim Demaille <akim@epita.fr>
17664
17665 All the hacks using a final pseudo state are now useless.
17666
17667 * src/LR0.c (set_state_table): state_table holds exactly nstates.
17668 * src/lalr.c (nLA): New.
17669 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
17670 instead of lookaheadsp from the pseudo state (nstate + 1).
17671
176722001-12-27 Akim Demaille <akim@epita.fr>
17673
17674 * src/output.c (action_row, token_actions): Use a state_t instead
17675 of a integer, and nlookaheads instead of the following state's
17676 lookaheadsp.
17677
176782001-12-27 Akim Demaille <akim@epita.fr>
17679
17680 * src/conflicts.c (log_resolution, flush_shift)
17681 (resolve_sr_conflict, set_conflicts, solve_conflicts)
17682 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
17683 (conflicts_print, print_reductions): Use a state_t instead of an
17684 integer when referring to a state.
17685 As much as possible, depend upon nlookaheads, instead of the
17686 `lookaheadsp' member of the following state (since lookaheads of
17687 successive states are successive, the difference between state n + 1
17688 and n served as the number of lookaheads for state n).
17689 * src/lalr.c (add_lookback_edge): Likewise.
17690 * src/print.c (print_core, print_actions, print_state)
17691 (print_results): Likewise.
17692 * src/print_graph.c (print_core, print_actions, print_state)
17693 (print_graph): Likewise.
17694 * src/conflicts.h: Adjust.
17695
176962001-12-27 Akim Demaille <akim@epita.fr>
17697
17698 * src/bison.hairy: Formatting/comment changes.
17699 ANSIfy.
17700 Remove `register' indications.
17701 Add plenty of `static'.
17702
177032001-12-27 Akim Demaille <akim@epita.fr>
17704
17705 * src/output.c (prepare): Drop the muscle `ntbase' which
17706 duplicates ntokens.
17707 * src/bison.simple: Formatting/comment changes.
17708 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
17709 is an undocumented synonym.
17710
177112001-12-22 Akim Demaille <akim@epita.fr>
17712
17713 * src/output.c (output_table_data): Change the prototype to use
17714 `int' for array ranges: some invocations do pass an int, not a
17715 short.
17716 Reported by Wayne Green.
17717
177182001-12-22 Akim Demaille <akim@epita.fr>
17719
17720 Some actions of web2c.y are improperly triggered.
17721 Reported by Mike Castle.
17722
17723 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
17724 * tests/regression.at (Web2c): Rename as...
17725 (Web2c Report): this.
17726 (Web2c Actions): New.
17727
177282001-12-22 Akim Demaille <akim@epita.fr>
17729
17730 Reductions in web2c.y are improperly reported.
17731 Reported by Mike Castle.
17732
17733 * src/conflicts.c (print_reductions): Fix.
17734 * tests/regression.at (Web2c): New.
17735
177362001-12-18 Akim Demaille <akim@epita.fr>
17737
17738 Some host fail on `assert (!"foo")', which expands to
17739 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
17740 Reported by Nelson Beebee.
17741
17742 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
17743 `#define it_succeeded 0' and `assert (it_succeeded)'.
17744
177452001-12-17 Marc Autret <autret_m@epita.fr>
17746
17747 * src/bison.simple: Don't hard code the skeleton line and filename.
17748 * src/output.c (output_parser): Rename 'line' as 'output_line'.
17749 New line counter 'skeleton_line' (skeleton-line muscle).
17750
177512001-12-17 Paul Eggert <eggert@twinsun.com>
17752
17753 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
17754 YYDEBUG must be defined to a nonzero value.
17755
17756 * src/bison.simple (yytname): Do not assume that the user defines
17757 YYDEBUG to a properly parenthesized expression.
17758
177592001-12-17 Akim Demaille <akim@epita.fr>
17760
17761 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
17762 nlookaheads is a new member.
17763 Adjust all users.
17764 * src/lalr.h (nlookaheads): Remove this orphan declaration.
17765 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
17766 state.
17767
177682001-12-17 Akim Demaille <akim@epita.fr>
17769
17770 * src/files.h, src/files.c (open_files, close_files): Remove.
17771 * src/main.c (main): Don't open/close files, nor invoke lex_free,
17772 let...
17773 * src/reader.c (reader): Do it.
17774
177752001-12-17 Akim Demaille <akim@epita.fr>
17776
17777 * src/conflicts.c (print_reductions): Formatting changes.
17778
177792001-12-17 Akim Demaille <akim@epita.fr>
17780
17781 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
17782 (flush_reduce): New.
17783 (resolve_sr_conflict): Adjust.
17784
177852001-12-17 Akim Demaille <akim@epita.fr>
17786
17787 * src/output.c (output_obstack): Be static and rename as...
17788 (format_obstack): this, to avoid any confusion with files.c's
17789 output_obstack.
17790 * src/reader.h (muscle_obstack): Move to...
17791 * src/output.h: here, since it's defined in output.c.
17792
177932001-12-17 Akim Demaille <akim@epita.fr>
17794
17795 * src/output.c (action_row, save_column, default_goto)
17796 (sort_actions, matching_state, pack_vector): Better variable
17797 locality.
17798
177992001-12-17 Akim Demaille <akim@epita.fr>
17800
17801 * src/output.c: Various formatting changes.
17802
178032001-12-17 Akim Demaille <akim@epita.fr>
17804
17805 * src/files.c (output_files): Free the output_obstack.
17806 * src/main.c (main): Call print and print_graph conditionally.
17807 * src/print.c (print): Work unconditionally.
17808 * src/print_graph.c (print_graph): Work unconditionally.
17809 * src/conflicts.c (log_resolution): Output only if verbose_flag.
17810
178112001-12-16 Marc Autret <autret_m@epita.fr>
17812
17813 * src/output.c (actions_output): Fix. When we use %no-lines,
17814 there is one less line per action.
17815
178162001-12-16 Marc Autret <autret_m@epita.fr>
17817
17818 * src/bison.simple: Remove a useless #line directive.
17819 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
17820 * src/output.c (get_lines_number): New.
17821 (output_parser): Adjust, now takes care about the lines of a
17822 output muscles.
17823 Fix line numbering.
17824 (actions_output): Computes the number of lines taken by actions.
17825 (output_master_parser): Insert new skeleton which is the name of
17826 the output parser file name.
17827
178282001-12-15 Marc Autret <autret_m@epita.fr>
17829
17830 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
17831
178322001-12-15 Marc Autret <autret_m@epita.fr>
17833
17834 * src/output.c (output_gram): Keep track of the hairy one.
17835
178362001-12-15 Akim Demaille <akim@epita.fr>
17837
17838 Make `make distcheck' work.
17839
17840 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
17841 system.h which uses libgettext.h.
17842
178432001-12-15 Akim Demaille <akim@epita.fr>
17844
17845 * src/nullable.c (set_nullable): Useless rules must be skipped,
17846 otherwise, since we range over their symbols, we might look at a
17847 nonterminal which no longer ``exists'', i.e., it is not counted in
17848 `nvars', hence we overflow our arrays.
17849
178502001-12-15 Akim Demaille <akim@epita.fr>
17851
17852 The header can also be produced directly, without any obstack!
17853 Yahoo!
17854
17855 * src/files.c, src/files.h (defines_obstack): Remove.
17856 (compute_header_macro): Global.
17857 (defines_obstack_save): Remove.
17858 * src/reader.c (parse_union_decl): No longer output to
17859 defines_obstack: its content can be found in the `stype' muscle
17860 anyway.
17861 (output_token_translations): Merge into...
17862 (symbols_output): this.
17863 Rename as...
17864 (symbols_save): this.
17865 (reader): Adjust.
17866 * src/output.c (header_output): New.
17867 (output): Call it.
17868
178692001-12-15 Akim Demaille <akim@epita.fr>
17870
17871 * src/reader.c (parse_union_decl): Instead of handling two obstack
17872 simultaneously, use one to define the `stype' muscle, and use the
17873 value of the latter to fill defines_obstack.
17874 (copy_comment): Remove.
17875 (copy_comment2): Work for a single obstack.
17876 Rename as...
17877 (copy_comment): this.
17878
178792001-12-15 Akim Demaille <akim@epita.fr>
17880
17881 * src/lex.c, src/lex.h (xgetc): No longer static.
17882 * src/reader.c (parse_union_decl): Revamp.
17883
178842001-12-15 Akim Demaille <akim@epita.fr>
17885
17886 Still making progress in separating Bison into (i) input, (ii)
17887 process, (iii) output: now we can directly output the parser file
17888 without using table_obstack at all.
17889
17890 * src/files.c, src/files.h (table_obstack): Bye bye.
17891 (parser_file_name): New.
17892 * src/files.c (compute_output_file_names): Compute it.
17893 * src/output.c (actions_output, output_parser)
17894 (output_master_parser): To a file instead of an obstack.
17895
178962001-12-15 Akim Demaille <akim@epita.fr>
17897
17898 Attach actions to rules, instead of pre-outputting them to
17899 actions_obstack.
17900
17901 * src/gram.h (rule_t): action and action_line are new members.
17902 * src/reader.c (symbol_list): Likewise.
17903 (copy_action): Save the actions within the rule.
17904 (packgram): Save them in rule_table.
17905 * src/output.c (actions_output): New.
17906 (output_parser): Use it on `%%actions'.
17907 (output_rule_data): Don't free rule_table.
17908 (output): Do it.
17909 (prepare): Don't save the `action' muscle.
17910 * src/bison.simple: s/%%action/%%actions/.
17911
179122001-12-15 Akim Demaille <akim@epita.fr>
17913
17914 * src/reader.c (copy_action): When --yacc, don't append a `;'
17915 to the user action: let it fail if lacking.
17916 Suggested by Arnold Robbins and Tom Tromey.
17917
179182001-12-14 Akim Demaille <akim@epita.fr>
17919
17920 * src/lex.c (literalchar): Simply return the char you decoded, non
17921 longer mess around with obstacks and int pointers.
17922 Adjust all callers.
17923
179242001-12-14 Akim Demaille <akim@epita.fr>
17925
17926 * src/lex.c (literalchar): Don't escape the special characters,
17927 just decode them, and keep them as char (before, eol was output as
17928 the 2 char string `\n' etc.).
17929 * src/output.c (output_rule_data): Use quotearg to output the
17930 token strings.
17931
179322001-12-13 Paul Eggert <eggert@twinsun.com>
17933
17934 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
17935 Do not infringe on the global user namespace when using C++.
17936 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
17937 All uses of `fprintf' and `stderr' changed.
17938
17939 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
17940
179412001-12-13 Akim Demaille <akim@epita.fr>
17942
17943 The computation of nullable is broken: it doesn't handle empty
17944 RHS's properly.
17945
17946 * tests/torture.at (GNU AWK Grammar): New.
17947 * tests/sets.at (Nullable): New.
17948 * src/nullable.c (set_nullable): Instead of blindly looping over
17949 `ritems', loop over the rules, and then over their rhs's.
17950
17951 Work around Autotest bugs.
17952
17953 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
17954 frame, because Autotest understand lines starting with a `+' as
17955 traces from the shell. Then, they are not processed properly.
17956 Admittedly an Autotest bug, but we don't have time to wait for
17957 Autotest to catch up.
17958 * tests/regression.at (Broken Closure): Adjust to the new table
17959 frames.
17960 Move to...
17961 * tests/sets.at: here.
17962
179632001-12-13 Akim Demaille <akim@epita.fr>
17964
17965 * src/closure.c (closure): Use nrules instead of playing tricks
17966 with BITS_PER_WORD.
17967
179682001-12-13 Akim Demaille <akim@epita.fr>
17969
17970 * src/print.c (print_actions): Output the handling of `$' as the
17971 traces do: shifting the token EOF. Before EOF was treated as a
17972 nonterminal.
17973 * tests/regression.at: Adjust some tests.
17974 * src/print_graph.c (print_core): Complete the set of items via
17975 closure. The next-to-final and final states are still unsatisfying,
17976 but that's to be addressed elsewhere.
17977 No longer output the rule numbers, but do output the state number.
17978 A single loop for the shifts + gotos is enough, but picked a
17979 distinct color for each.
17980 (print_graph): Initialize and finalize closure.
17981
179822001-12-13 Akim Demaille <akim@epita.fr>
17983
17984 * src/reader.c (readgram): Remove dead code, an strip useless
17985 braces.
17986 (get_type): Remove, unused.
17987
179882001-12-12 Akim Demaille <akim@epita.fr>
17989
17990 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
17991 on that of lib/error.c.
17992
179932001-12-12 Akim Demaille <akim@epita.fr>
17994
17995 Some hosts don't like `/' in includes.
17996
17997 * src/system.h: Include libgettext.h without qualifying the path.
17998 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
17999 $(top_srcdir).
18000
180012001-12-11 Marc Autret <autret_m@epita.fr>
18002
18003 * src/output.c (output_parser): Remove useless muscle.
18004
180052001-12-11 Marc Autret <autret_m@epita.fr>
18006
18007 * src/bison.simple: Remove #line just before %%epilogue. It
18008 is now handled in ...
18009 * src/reader.c (read_additionnal_code): Add the output of a
18010 #line for the epilogue.
18011
180122001-12-10 Marc Autret <autret_m@epita.fr>
18013
18014 * src/reader.c (copy_definition): Re-use CPP-outed code which
18015 replace precedent remove.
18016 * src/bison.simple: Remove #line before %%prologue because
18017 %%input-line is wrong at this time.
18018
180192001-12-10 Marc Autret <autret_m@epita.fr>
18020
18021 * src/reader.c (symbols_output): Clean up.
18022 * src/output.c (output_gram, output): Clean up.
18023
180242001-12-10 Akim Demaille <akim@epita.fr>
18025
18026 * src/lalr.c (initialize_lookaheads): New. Extracted from...
18027 * src/LR0.c (set_state_table): here.
18028 * src/lalr.c (lalr): Call it.
18029
180302001-12-10 Akim Demaille <akim@epita.fr>
18031
18032 * src/state.h (shifts): Remove the `number' member: shifts are
18033 attached to state, hence no longer need to be labelled with a
18034 state number.
18035
180362001-12-10 Akim Demaille <akim@epita.fr>
18037
18038 Now that states have a complete set of members, the linked list of
18039 shifts is useless: just fill directly the state's shifts member.
18040
18041 * src/state.h (shifts): Remove the `next' member.
18042 * src/LR0.c (first_state, last_state): Remove.
18043 Adjust the callers.
18044 (augment_automaton): Don't look for the shifts that must be added
18045 a shift on EOF: it is those of the state we looked for! But now,
18046 since shifts are attached, it is no longer needed to looking
18047 merely by its id: its number.
18048
180492001-12-10 Akim Demaille <akim@epita.fr>
18050
18051 * src/LR0.c (augment_automaton): Better variable locality.
18052 Remove an impossible branch: if there is a state corresponding to
18053 the start symbol being shifted, then there is shift for the start
18054 symbol from the initial state.
18055
180562001-12-10 Akim Demaille <akim@epita.fr>
18057
18058 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
18059 only when appropriate: when insert_start_shifting_state' is not
18060 invoked.
18061 * tests/regression.at (Rule Line Numbers): Adjust.
18062
180632001-12-10 Akim Demaille <akim@epita.fr>
18064
18065 * src/LR0.c (augment_automaton): Now that all states have shifts,
18066 merge the two cases addition shifts to the initial state.
18067
180682001-12-10 Akim Demaille <akim@epita.fr>
18069
18070 * src/lalr.c (set_state_table): Move to...
18071 * src/LR0.c: here.
18072 * src/lalr.c (lalr): Don't call it...
18073 * src/LR0.c (generate_states): do it.
18074 * src/LR0.h (first_state): Remove, only the table is used.
18075
180762001-12-10 Akim Demaille <akim@epita.fr>
18077
18078 * src/LR0.h (first_shift, first_reduction): Remove.
18079 * src/lalr.c: Don't use first_shift: find shifts through the
18080 states.
18081
180822001-12-10 Akim Demaille <akim@epita.fr>
18083
18084 * src/LR0.c: Attach shifts to states as soon as they are
18085 computed.
18086 * src/lalr.c (set_state_table): Instead of assigning shifts to
18087 state, just assert that the mapping was properly done.
18088
180892001-12-10 Akim Demaille <akim@epita.fr>
18090
18091 * src/LR0.c (insert_start_shift): Rename as...
18092 (insert_start_shifting_state): this.
18093 (insert_eof_shifting_state, insert_accepting_state): New.
18094 (augment_automaton): Adjust.
18095 Better locality of the variables.
18096 When looking if the start_symbol is shifted from the initial
18097 state, using `while (... symbol != start_symbol ...)' sounds
18098 better than `while (... symbol < start_symbol ...)': If fail
18099 to see how the order between symbols could be relevant!
18100
181012001-12-10 Akim Demaille <akim@epita.fr>
18102
18103 * src/getargs.h: Don't declare `spec_name_prefix' and
18104 `spec_file_prefix', declared by src/files.h.
18105 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
18106 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
18107 * src/output.c (prepare): Adjust.
18108 * src/reader.c (symbols_output): Likewise.
18109 * src/vmsgetargs.c: Vaguely adjust, but who cares?
18110
181112001-12-10 Akim Demaille <akim@epita.fr>
18112
18113 * src/muscle_tab.c (muscle_init): NULL is a better default than
18114 `"0"'.
18115
181162001-12-10 Akim Demaille <akim@epita.fr>
18117
18118 * src/reader.c (reader): Calling symbols_output once is enough.
18119
181202001-12-10 Akim Demaille <akim@epita.fr>
18121
18122 Now that states have a complete set of members, the linked list of
18123 reductions is useless: just fill directly the state's reductions
18124 member.
18125
18126 * src/state.h (struct reductions): Remove member `number' and
18127 `next'.
18128 * src/LR0.c (first_reduction, last_reduction): Remove.
18129 (save_reductions): Don't link the new reductions, store them in
18130 this_state.
18131 * src/lalr.c (set_state_table): No need to attach reductions to
18132 states, it's already done.
18133 * src/output.c (output_actions): No longer free the shifts, then
18134 the reductions, then the states: free all the states and their
18135 members.
18136
181372001-12-10 Akim Demaille <akim@epita.fr>
18138
18139 * src/options.c (OPTN, DRTV, BOTH): New.
18140 (option_table): Use them.
18141
18142 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
18143 the job of system.h.
18144 * src/options.c: Don't include stdio.h and xalloc.h for the same
18145 reasons.
18146
181472001-12-10 Akim Demaille <akim@epita.fr>
18148
18149 * src/output.c (output, prepare): Make sure the values of the
18150 muscles `action' and `prologue' are 0-terminated.
18151
181522001-12-10 Akim Demaille <akim@epita.fr>
18153
18154 Clean up GCC warnings.
18155
18156 * src/reader.c (copy_action): `buf' is not used.
18157 (parse_skel_decl): Be static.
18158 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
18159 * src/options.h (create_long_option_table): Have a real prototype.
18160 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
18161 (hash_delete_at): Return const void *.
18162 Adjust casts to preserve the const.
18163
181642001-12-10 Akim Demaille <akim@epita.fr>
18165
18166 * configure.in: Require 2.52g.
18167 M4 is not needed, but AUTOM4TE is.
18168 * m4/m4.m4: Remove.
18169 * tests/Makefile.am: Adjust.
18170
181712001-12-10 Akim Demaille <akim@epita.fr>
18172
18173 One structure for states is enough, even though theoretically
18174 there are LR(0) states and LALR(1) states.
18175
18176 * src/lalr.h (state_t): Remove.
18177 (state_table): Be state_t **, not state_t *.
18178 * src/state.h (core, CORE_ALLOC): Rename as...
18179 (state_t, STATE_ALLOC): this.
18180 Add the LALR(1) members: shifts, reductions, errs.
18181 * src/LR0.c (state_table): Rename as...
18182 (state_hash): this, to avoid name clashes with the global
18183 `state_table'.
18184 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
18185 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
18186
181872001-12-10 Akim Demaille <akim@epita.fr>
18188
18189 Bison dumps core on bash.y.
18190 Reported by Pascal Bart.
18191
18192 * src/warshall.c (bitmatrix_print): New.
18193 (TC): Use it.
18194 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
18195 j must be the outer loop.
18196 * tests/regression.at (Broken Closure): New.
18197
181982001-12-05 Akim Demaille <akim@epita.fr>
18199
18200 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
18201 its argument.
18202 Reported by Peter Hamorsky.
18203
182042001-12-05 Akim Demaille <akim@epita.fr>
18205
18206 * src/conflicts.c (err_table): Remove.
18207 (resolve_sr_conflict): Adjust.
18208 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
18209 Rename as...
18210 (state_t.reductions, state_t.shifts): this.
18211
182122001-12-05 Akim Demaille <akim@epita.fr>
18213
18214 * src/reduce.c (reduce_grammar_tables): No longer disable the
18215 removal of useless rules via CPP but via `if (0)', so that the
18216 compiler still check the code is valid.
18217 For instance, it should have noticed `rline' no longer exists: use
18218 the `line' member of rule_t.
18219 * src/gram.c (dummy, rline): Remove, unused.
18220
182212001-12-05 Akim Demaille <akim@epita.fr>
18222
18223 * src/output.c (pack_vector): Use assert, not berror.
18224 * src/main.c (berror): Remove, unused.
18225
182262001-12-05 Akim Demaille <akim@epita.fr>
18227
18228 New experimental feature: if --verbose --trace output all the
18229 items of a state, not only its kernel.
18230
18231 * src/print.c (print_core): If `trace_flag', then invoke closure
18232 before outputting the items of the state (print_core is no longer
18233 a correct name them).
18234 (print_results): Invoke new_closure/free_closure if needed.
18235
182362001-12-05 Akim Demaille <akim@epita.fr>
18237
18238 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
18239 * src/closure.c, src/closure.h (itemsetsize): Rename as...
18240 (nitemset): for consistency with the rest of the project.
18241
182422001-12-05 Akim Demaille <akim@epita.fr>
18243
18244 * src/closure.c (print_closure): Improve.
18245 (closure): Use it for printing input and output.
18246
182472001-12-05 Akim Demaille <akim@epita.fr>
18248
18249 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
18250 indexed by nonterminals.
18251
182522001-12-05 Akim Demaille <akim@epita.fr>
18253
18254 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
18255 what it was!).
18256 * src/warshall.h: Remove accidental duplication of the content.
18257
182582001-12-05 Akim Demaille <akim@epita.fr>
18259
18260 * src/closure.c (set_fderives): De-obfuscate.
18261
182622001-12-05 Akim Demaille <akim@epita.fr>
18263
18264 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
18265
182662001-12-05 Akim Demaille <akim@epita.fr>
18267
18268 * src/closure.c (set_firsts): De-obfuscate.
18269
182702001-12-05 Akim Demaille <akim@epita.fr>
18271
18272 * src/output.c (action_row): De-obfuscate
18273 using the good o' techniques: arrays not pointers, variable
18274 locality, BITISSET, RESETBIT etc.
18275
182762001-12-05 Akim Demaille <akim@epita.fr>
18277
18278 Pessimize the code to simplify it: from now on, all the states
18279 have a valid SHIFTS, which NSHIFTS is possibly 0.
18280
18281 * src/LR0.c (shifts_new): Be global and move to..
18282 * src/state.c, src/state.h: here.
18283 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
18284 * src/print_graph: Adjust.
18285
182862001-12-05 Akim Demaille <akim@epita.fr>
18287
18288 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
18289 * src/conflicts.c: Use it.
18290 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
18291 incorrectly ``simplified''.
18292
182932001-12-05 Akim Demaille <akim@epita.fr>
18294
18295 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
18296 using the good o' techniques: arrays not pointers, variable
18297 locality, BITISSET, RESETBIT etc.
18298
182992001-12-05 Akim Demaille <akim@epita.fr>
18300
18301 * src/state.h (SHIFT_SYMBOL): New.
18302 * src/conflicts.c: Use it to deobfuscate.
18303
183042001-12-05 Akim Demaille <akim@epita.fr>
18305
18306 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
18307 (print_reductions): De-obfuscate using the good o' techniques:
18308 arrays not pointers, variable locality, BITISSET.
18309
183102001-12-05 Akim Demaille <akim@epita.fr>
18311
18312 * src/conflicts.c (print_reductions): Arrays, not pointers.
18313 Use BITISSET.
18314
183152001-12-05 Akim Demaille <akim@epita.fr>
18316
18317 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18318
183192001-12-05 Akim Demaille <akim@epita.fr>
18320
18321 * src/conflicts.c (print_reductions): Improve variable locality.
18322
183232001-12-05 Akim Demaille <akim@epita.fr>
18324
18325 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18326
183272001-12-05 Akim Demaille <akim@epita.fr>
18328
18329 * src/conflicts.c (print_reductions): Improve variable locality.
18330
183312001-12-05 Akim Demaille <akim@epita.fr>
18332
18333 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
18334 * src/lalr.c: Use them.
18335
183362001-12-05 Akim Demaille <akim@epita.fr>
18337
18338 * src/LR0.c (augment_automaton): Formatting changes.
18339 Better variable locality.
18340
183412001-12-05 Akim Demaille <akim@epita.fr>
18342
18343 * src/lalr.c (matrix_print): New.
18344 (transpose): Use it.
18345 Use arrays instead of pointers.
18346
183472001-12-05 Akim Demaille <akim@epita.fr>
18348
18349 * src/lalr.c (maxrhs): Move to...
18350 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
18351 * src/lalr.c (build_relations): Adjust.
18352
183532001-12-05 Akim Demaille <akim@epita.fr>
18354
18355 * src/lalr.c (transpose): Free the memory allocated to the
18356 argument, as it is replaced by the results by the unique caller.
18357 (build_relations): Merely invoke transpose: it handles the memory
18358 deallocation.
18359 Improve variable locality.
18360 Avoid variables used as mere abbreviations.
18361 (compute_lookaheads): Use arrays instead of pointers.
18362
183632001-12-05 Akim Demaille <akim@epita.fr>
18364
18365 * src/lalr.c (initialize_F): Improve variable locality.
18366 Avoid variables used as mere abbreviations.
18367
183682001-12-05 Akim Demaille <akim@epita.fr>
18369
18370 * src/derives.c (print_derives): Display the ruleno.
18371 * src/lalr.c (initialize_F, transpose): Better variable locality
18372 to improve readability.
18373 Avoid variables used as mere abbreviations.
18374
183752001-12-05 Akim Demaille <akim@epita.fr>
18376
18377 * src/lalr.c (traverse): Use arrays instead of pointers.
18378
183792001-12-05 Akim Demaille <akim@epita.fr>
18380
18381 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
18382 the handling of squeue.
18383 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18384
183852001-12-05 Akim Demaille <akim@epita.fr>
18386
18387 Because useless nonterminals are now kept alive (instead of being
18388 `destroyed'), we now sometimes examine them, and store information
18389 related to them. Hence we need to know their number, and adjust
18390 memory allocations.
18391
18392 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
18393 static.
18394 * src/LR0.c (allocate_itemsets): The memory allocated to
18395 `symbol_count' was used for two different purpose: once to count
18396 the number of occurrences of each symbol, and later reassigned to
18397 `shift_symbol', containing the symbol that can be shifted from a
18398 given state.
18399 Deobfuscate, i.e., allocate, use and free `symbol_count' here
18400 only, and...
18401 (new_itemsets): Allocate `shift_symbol' here.
18402 (allocate_itemsets): symbol_count includes useless nonterminals.
18403 Make room for them.
18404 (free_storage): Use `free', not `XFREE', for pointers that cannot
18405 be null.
18406
184072001-12-05 Akim Demaille <akim@epita.fr>
18408
18409 * src/nullable.c (set_nullable): Deobfuscate the handling of
18410 ritem.
18411 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18412
184132001-12-05 Akim Demaille <akim@epita.fr>
18414
18415 * src/gram.c, src/gram.h (ritem_print): New.
18416 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
18417 (This useless function was defined only to work around VMS linkers
18418 that can't handle compilation units with variables only).
18419 * src/reduce.c (dump_grammar): Use it to trace the construction of
18420 ritem.
18421
184222001-12-04 Paul Eggert <eggert@twinsun.com>
18423
18424 * src/bison.simple (union yyalloc): Change member names
18425 to be the same as the stack names.
18426 (yyparse): yyptr is now union yyalloc *, not char *.
18427 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
18428 and may generate better code on some machines.
18429 (yystpcpy): Use prototype if __STDC__ is defined, not just
18430 if __cplusplus is defined.
18431
184322001-11-30 Akim Demaille <akim@epita.fr>
18433
18434 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
18435 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
18436 Gettext doesn't compile cleanly, and dies with -Werror.
18437 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
18438 Include WARNING_CFLAGS here.
18439 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
18440 before being defined.
18441
184422001-11-27 Paul Eggert <eggert@twinsun.com>
18443
18444 * lib/quotearg.h (quotearg_n, quotearg_n_style):
18445 First arg is int, not unsigned.
18446 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
18447 (SIZE_MAX, UINT_MAX): New macros.
18448 (quotearg_n_options): Abort if N is negative.
18449 Avoid overflow check on hosts where size_t is 64 bits and int
18450 is 32 bits, as overflow is impossible there.
18451 Fix off-by-one typo that caused unnecessary reallocation.
18452
184532001-11-29 Paul Eggert <eggert@twinsun.com>
18454
18455 Name space cleanup in generated parser.
18456
18457 * doc/bison.texinfo (Bison Parser): Discuss system headers
18458 and their effect on the user name space.
18459
18460 * src/bison.simple:
18461 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
18462 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
18463 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
18464
18465 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
18466 on user names when possible.
18467
18468 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
18469 Simplify test for whather <alloca.h> exists.
18470
18471 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
18472
18473 (<stdio.h>): Include if YYDEBUG.
18474
18475 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
18476 ! defined (yyoverflow) && ! defined (yymemcpy).
18477
18478 (yymemcpy, yyparse): Rename local variables as needed so that
18479 they all begin with 'yy'.
18480
18481 (yystrlen, yystpcpy): New functions.
18482
18483 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
18484 All uses changed.
18485
18486 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
18487 instead of relying on string.h functions. Use YYSTACK_ALLOC
18488 and YYSTACK_FREE instead of malloc and free.
18489
184902001-11-30 Akim Demaille <akim@epita.fr>
18491
18492 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
18493 before their first uses.
18494 (YYBISON, YYPURE): Move to the top of the output.
18495
184962001-11-30 Akim Demaille <akim@epita.fr>
18497
18498 * tests/reduce.at (Useless Nonterminals): Fix.
18499
185002001-11-30 Akim Demaille <akim@epita.fr>
18501
18502 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
18503 if body instead of `;' to pacify GCC's warnings.
18504
185052001-11-30 Akim Demaille <akim@epita.fr>
18506
18507 Instead of mapping the LHS of unused rules to -1, keep the LHS
18508 valid, but flag the rules as invalid.
18509
18510 * src/gram.h (rule_t): `useful' is a new member.
18511 * src/print.c (print_grammar): Adjust.
18512 * src/derives.c (set_derives): Likewise.
18513 * src/reader.c (packgram, reduce_output): Likewise.
18514 * src/reduce.c (reduce_grammar_tables): Likewise.
18515 * tests/reduce.at (Underivable Rules, Useless Rules): New.
18516
185172001-11-30 Akim Demaille <akim@epita.fr>
18518
18519 * src/reduce.c (reduce_output): Formatting changes.
18520 * src/print.c (print_results, print_grammar): Likewise.
18521 * tests/regression.at (Rule Line Numbers)
18522 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
18523
185242001-11-30 Akim Demaille <akim@epita.fr>
18525
18526 * src/reduce.c (nonterminals_reduce): Instead of throwing away
18527 useless nonterminals, move them at the end of the symbol arrays.
18528 (reduce_output): Adjust.
18529 * tests/reduce.at (Useless Nonterminals): Adjust.
18530
185312001-11-30 Akim Demaille <akim@epita.fr>
18532
18533 * src/reduce.c: Various comment/formatting changes.
18534 (nonterminals_reduce): New, extracted from...
18535 (reduce_grammar_tables): here.
18536 (reduce_grammar): Call nonterminals_reduce.
18537
185382001-11-29 Paul Eggert <eggert@twinsun.com>
18539
18540 * src/bison.simple (YYSTACK_REALLOC): Remove.
18541 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
18542 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
18543 New macros.
18544 (union yyalloc): New type.
18545 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
18546 an arbitrary restriction on hosts where size_t is wider than int.
18547
18548 (yyparse): Don't dump core if alloca or malloc fails; instead, report
18549 a parser stack overflow. Allocate just one block of memory for all
18550 three stacks, instead of allocating three blocks; this typically is
18551 faster and reduces fragmentation.
18552
18553 Do not limit the number of items in the stack to a value that fits
18554 in 'int', as this is an arbitrary limit on hosts with 64-bit
18555 size_t and 32-bit int.
18556
185572001-11-29 Marc Autret <autret_m@epita.fr>
18558
18559 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
18560 of defining YYERROR_VERBOSE.
18561 [AT_DATA]: $4 is now out of C declarations in the prologue.
18562
185632001-11-28 Marc Autret <autret_m@epita.fr>
18564
18565 * src/reader.c (parse_dquoted_param): New.
18566 (parse_skel_decl): Use it.
18567 * src/lex.h: Add its prototype.
18568 * src/lex.c (literalchar): Become not static.
18569
185702001-11-28 Marc Autret <autret_m@epita.fr>
18571
18572 * src/output.h: And put its extern declaration here.
18573 * src/output.c (error_verbose): Define here.
18574 (prepare): Echo name modification.
18575 * src/getargs.h: Clean its extern declaration.
18576 * src/getargs.c (error_verbose_flag): Remove.
18577 (getargs): Remove case 'e'.
18578 * src/options.c (option_table): 'error-verbose' is now seen as simple
18579 percent option.
18580 Include output.h.
18581
18582 * src/reader.c (read_declarations): Remove case tok_include.
18583 (parse_include_decl): Remove.
18584 * src/lex.h (token_t): Remove tok_include.
18585 * src/options.c (option_table): 'include' is now a simple command line
18586 option.
18587
185882001-11-28 Marc Autret <autret_m@epita.fr>
18589
18590 * src/bison.simple: Adjust muscle names.
18591 * src/muscle_tab.c (muscle_init): Also rename the muscles.
18592 * src/output.c (prepare): s/_/-/ for the muscles names.
18593 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
18594
185952001-11-28 Marc Autret <autret_m@epita.fr>
18596
18597 * src/bison.simple: Fix debug.
18598 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
18599
186002001-11-28 Akim Demaille <akim@epita.fr>
18601
18602 * src/LR0.c (shifts_new): New.
18603 (save_shifts, insert_start_shift, augment_automaton): Use it.
18604
186052001-11-28 Akim Demaille <akim@epita.fr>
18606
18607 * src/closure.c (closure): `b' and `ruleno' denote the same value:
18608 keep ruleno only.
18609
186102001-11-28 Akim Demaille <akim@epita.fr>
18611
18612 * src/closure.c (closure): Instead of looping over word in array
18613 then bits in words, loop over bits in array.
18614
186152001-11-28 Akim Demaille <akim@epita.fr>
18616
18617 * src/closure.c (closure): No longer optimize the special case
18618 where all the bits of `ruleset[r]' are set to 0, to make the code
18619 clearer.
18620
186212001-11-28 Akim Demaille <akim@epita.fr>
18622
18623 * src/closure.c (closure): `r' and `c' are new variables, used to
18624 de-obfuscate accesses to RULESET and CORE.
18625
186262001-11-28 Akim Demaille <akim@epita.fr>
18627
18628 * src/reduce.c (reduce_print): Use ngettext.
18629 (dump_grammar): Improve the trace accuracy.
18630
186312001-11-28 Akim Demaille <akim@epita.fr>
18632
18633 * src/reduce.c (dump_grammar): Don't translate trace messages.
18634
186352001-11-28 Akim Demaille <akim@epita.fr>
18636
18637 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
18638 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
18639 as all tags are free'ed afterwards.
18640 From Enrico Scholz.
18641
186422001-11-27 Paul Eggert <eggert@twinsun.com>
18643
18644 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
18645 use alloca when we didn't want to, and vice versa.
18646
186472001-11-27 Marc Autret <autret_m@epita.fr>
18648
18649 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
18650 initialization.
18651 * src/output.c (prepare): Remove its update.
18652
186532001-11-27 Marc Autret <autret_m@epita.fr>
18654
18655 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
18656 Use %error-verbose.
18657
186582001-11-27 Marc Autret <autret_m@epita.fr>
18659
18660 * src/bison.simple: Remove YYERROR_VERBOSE using.
18661 Use %%error_verbose.
18662 (yyparse): Likewise.
18663 * src/output.c (prepare): Give its final value.
18664 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
18665 * src/getargs.h: Add its extern declaration.
18666 * src/getargs.c (error_verbose_flag): New int.
18667 (getargs): Update to catch new case.
18668 * src/options.c (option_table): 'error-verbose' is a new option.
18669 (shortopts): Update.
18670
186712001-11-27 Akim Demaille <akim@epita.fr>
18672
18673 * src/system.h: Use intl/libgettext.h.
18674 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
18675
186762001-11-27 Akim Demaille <akim@epita.fr>
18677
18678 * tests/torture.at (Exploding the Stack Size with Malloc):
18679 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
18680
186812001-11-27 Akim Demaille <akim@epita.fr>
18682
18683 * src/files.c: Include error.h.
18684 Reported by Hans Aberg.
18685
186862001-11-26 Marc Autret <autret_m@epita.fr>
18687
18688 * src/reader.c (parse_include_decl): New, not yet implemented.
18689 (read_declarations): Add case tok_include.
18690 * src/getargs.h (include): Add its extern definition.
18691 * src/getargs.c (include): New const char *.
18692 (getargs): Add case '-I'.
18693 * src/options.c (option_table): Add include as command line and
18694 percent option.
18695 * src/lex.h (token_t): Add tok_include.
18696
186972001-11-26 Akim Demaille <akim@epita.fr>
18698
18699 * src/reader.c (readgram): Make sure rules for mid-rule actions
18700 have a lineno equal to that of their host rule.
18701 Reported by Hans Aberg.
18702 * tests/regression.at (Rule Line Numbers): New.
18703
187042001-11-26 Akim Demaille <akim@epita.fr>
18705
18706 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
18707 size_ts.
18708
187092001-11-26 Akim Demaille <akim@epita.fr>
18710
18711 * src/complain.c, src/complain.h (error): Remove, provided by
18712 lib/error.[ch].
18713
187142001-11-26 Akim Demaille <akim@epita.fr>
18715
18716 * src/reader.c (read_declarations): Don't abort on tok_illegal,
18717 issue an error message.
18718 * tests/regression.at (Invalid %directive): New.
18719 Reported by Hans Aberg.
18720
187212001-11-26 Akim Demaille <akim@epita.fr>
18722
18723 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
18724 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18725
187262001-11-26 Akim Demaille <akim@epita.fr>
18727
18728 * src/conflicts.c (conflicts_print): Don't complain at all when
18729 there are no reduce/reduce conflicts, and as many shift/reduce
18730 conflicts as expected.
18731 * tests/regression.at (%expect right): Adjust.
18732
187332001-11-23 Akim Demaille <akim@epita.fr>
18734
18735 * lib/alloca.c: Update, from fileutils.
18736
187372001-11-23 Akim Demaille <akim@epita.fr>
18738
18739 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
18740
187412001-11-23 Akim Demaille <akim@epita.fr>
18742
18743 * src/system.h: Include alloca.h.
18744 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
18745
187462001-11-23 Akim Demaille <akim@epita.fr>
18747
18748 * src/print_graph.c (print_actions): Remove `rule', unused.
18749 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
18750 pacify GCC's signed < unsigned warnings.
18751 * src/closure.c (itemsetsize): Likewise.
18752 * src/reader.c (symbol_list_new): Static.
18753
187542001-11-23 Akim Demaille <akim@epita.fr>
18755
18756 Attaching lineno to buckets is stupid, since only one copy of each
18757 symbol is kept, only the line of the first occurrence is kept too.
18758
18759 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
18760 * src/reader.c (rline_allocated): Remove, unused.
18761 (symbol_list): Have a `line' member.
18762 (symbol_list_new): New.
18763 (readgram): Use it.
18764 * src/print.c (print_grammar): Output the rule line numbers.
18765 * tests/regression.at (Solved SR Conflicts)
18766 (Unresolved SR Conflicts): Adjust.
18767 Reported by Hans Aberg.
18768
187692001-11-22 Marc Autret <autret_m@epita.fr>
18770
18771 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
18772
187732001-11-22 Marc Autret <autret_m@epita.fr>
18774
18775 * src/muscle_tab.c (muscle_init): Remove initialization of
18776 skeleton muscle.
18777 * src/output.c (output_master_parser): Do it here.
18778
187792001-11-20 Akim Demaille <akim@epita.fr>
18780
18781 * po/sv.po: New.
18782 * configure.in (ALL_LINGUAS): Adjust.
18783 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
18784 longer contains strings to translate.
18785
187862001-11-19 Akim Demaille <akim@epita.fr>
18787
18788 * src/conflicts.c (conflicts_print): Add a missing \n.
18789
187902001-11-19 Akim Demaille <akim@epita.fr>
18791
18792 * src/nullable.c (nullable_print): New.
18793 (set_nullable): Call it when tracing.
18794 Better locality of variables.
18795
187962001-11-19 Akim Demaille <akim@epita.fr>
18797
18798 * src/print.c (print_actions): Better locality of variables.
18799
188002001-11-19 Akim Demaille <akim@epita.fr>
18801
18802 * src/derives.c (print_derives): Fix and enrich.
18803 * src/closure.c (print_fderives): Likewise.
18804
188052001-11-19 Akim Demaille <akim@epita.fr>
18806
18807 * src/closure.c (itemsetend): Remove, replaced with...
18808 (itemsetsize): new.
18809
188102001-11-19 Akim Demaille <akim@epita.fr>
18811
18812 * src/LR0.c (kernel_end): Remove, replaced with...
18813 (kernel_size): new.
18814
188152001-11-19 Akim Demaille <akim@epita.fr>
18816
18817 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
18818 to clarify.
18819
188202001-11-19 Akim Demaille <akim@epita.fr>
18821
18822 * src/closure.c (closure): Use arrays instead of pointers to clarify.
18823
188242001-11-19 Akim Demaille <akim@epita.fr>
18825
18826 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
18827 trace messages.
18828 * src/LR0.c: Likewise.
18829 (allocate_itemsets): Use arrays instead of pointers to clarify.
18830
188312001-11-19 Akim Demaille <akim@epita.fr>
18832
18833 * src/getargs.c (statistics_flag): Replace with...
18834 (trace_flag): New.
18835 (longopts): Accept --trace instead of --statistics.
18836 * src/getargs.h, src/options.c: Adjust.
18837 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
18838 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
18839
188402001-11-19 Akim Demaille <akim@epita.fr>
18841
18842 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
18843 pointers to clarify the code.
18844 (save_reductions, save_shifts): Factor common parts of alternatives.
18845
188462001-11-19 Akim Demaille <akim@epita.fr>
18847
18848 * src/LR0.c (new_state, get_state): Complete TRACE code.
18849 * src/closure.c: Include `reader.h' to get `tags', needed by the
18850 trace code.
18851 Rename the conditional DEBUG as TRACE.
18852 Output consistently TRACEs to stderr, not stdout.
18853 * src/derives.c: Likewise.
18854 * src/reduce.c: (inaccessable_symbols): Using if is better style
18855 than goto.
18856 Use `#if TRACE' instead of `#if 0' for tracing code.
18857
188582001-11-19 Akim Demaille <akim@epita.fr>
18859
18860 * src/system.h (LIST_FREE, shortcpy): New.
18861 * src/LR0.c: Use them.
18862 * src/output.c (free_itemsets, free_reductions, free_shifts):
18863 Remove, replaced by LIST_FREE.
18864
188652001-11-19 Akim Demaille <akim@epita.fr>
18866
18867 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
18868 (REDUCTIONS_ALLOC): New.
18869 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
18870 allocation.
18871
188722001-11-19 Akim Demaille <akim@epita.fr>
18873
18874 * src/LR0.c (new_state): Complete trace code.
18875 * src/nullable.c (set_nullable): Don't translate traces.
18876
188772001-11-19 Akim Demaille <akim@epita.fr>
18878
18879 * src/print_graph.c (print_core): Better locality of variables.
18880 * src/print.c (print_core): Likewise.
18881
188822001-11-19 Akim Demaille <akim@epita.fr>
18883
18884 * src/vcg.c: You do the output, so you are responsible of the
18885 handling of VCG syntax, in particular: use quotearg.
18886 * src/print_graph.c: Don't.
18887 (print_actions): Don't output the actions as part of the nodes,
18888 since that's the job of the edges.
18889 (print_state): Don't output by hand: fill the node description,
18890 and ask for its output.
18891
188922001-11-19 Akim Demaille <akim@epita.fr>
18893
18894 * src/bison.simple (yyparse): When verbosely reporting an error,
18895 no longer put additional quotes around token names.
18896 * tests/calc.at: Adjust.
18897
188982001-11-19 Akim Demaille <akim@epita.fr>
18899
18900 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
18901 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
18902 * src/output.c: Adjust.
18903
189042001-11-19 Akim Demaille <akim@epita.fr>
18905
18906 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
18907 (rule_t): this.
18908 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
18909
189102001-11-19 Akim Demaille <akim@epita.fr>
18911
18912 * src/gram.h (rule_t): New.
18913 (rule_table): New.
18914 (rrhs, rlhs): Remove, part of state_t.
18915 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
18916 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
18917 * src/reader.c, src/reduce.c: Adjust.
18918
189192001-11-19 Akim Demaille <akim@epita.fr>
18920
18921 * src/reader.c (symbols_output): New, extracted from...
18922 (packsymbols): Here.
18923 (reader): Call it.
18924
189252001-11-19 Akim Demaille <akim@epita.fr>
18926
18927 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
18928 (maxrhs): this new function.
18929
189302001-11-19 Akim Demaille <akim@epita.fr>
18931
18932 * src/lalr.c (F): New macro to access the variable F.
18933 Adjust.
18934
189352001-11-19 Akim Demaille <akim@epita.fr>
18936
18937 * src/lalr.h (LA): New macro to access the variable LA.
18938 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18939 * src/lalr.c: Adjust.
18940
189412001-11-19 Akim Demaille <akim@epita.fr>
18942
18943 * src/lalr.c (initialize_LA): Only initialize LA. Let...
18944 (set_state_table): handle the `lookaheads' members.
18945
189462001-11-19 Akim Demaille <akim@epita.fr>
18947
18948 * src/lalr.h (lookaheads): Removed array, whose contents is now
18949 a member of...
18950 (state_t): this structure.
18951 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18952 Adjust.
18953
189542001-11-19 Akim Demaille <akim@epita.fr>
18955
18956 * src/lalr.h (consistent): Removed array, whose contents is now
18957 a member of...
18958 (state_t): this structure.
18959 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18960 Adjust.
18961
189622001-11-19 Akim Demaille <akim@epita.fr>
18963
18964 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
18965 contents are now members of...
18966 (state_t): this structure.
18967 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18968 Adjust.
18969
189702001-11-19 Akim Demaille <akim@epita.fr>
18971
18972 * src/lalr.h (state_t): New.
18973 (state_table): Be a state_t * instead of a core **.
18974 (accessing_symbol): Remove, part of state_t.
18975 * src/lalr.c: Adjust.
18976 (set_accessing_symbol): Merge into...
18977 (set_state_table): this.
18978 * src/print_graph.c, src/conflicts.c: Adjust.
18979
189802001-11-14 Akim Demaille <akim@epita.fr>
18981
18982 * tests/calc.at, tests/output.at, tests/regression.at,
18983 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
18984 now the tests are run in private dirs, therefore AC_CLEANUP and
18985 family can be simplified to 0-ary.
18986 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
18987 use abs. path to find config.h.
18988 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
18989 stderr, there can be way too much random noise.
18990 Instead pass -Werror to GCC and rely on the exit status.
18991 Reported by Wolfram Wagner.
18992
189932001-11-14 Akim Demaille <akim@epita.fr>
18994
18995 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
18996 defined only if yyoverflow is defined, to avoid `warning: unused
18997 variable `yyvs1''.
18998 Reported by The Test Suite.
18999
190002001-11-14 Akim Demaille <akim@epita.fr>
19001
19002 * src/print.c: Include reduce.h.
19003 Reported by Hans Aberg.
19004
190052001-11-14 Akim Demaille <akim@epita.fr>
19006
19007 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
19008 Revert a previous patch: these are really const.
19009 * src/conflicts.c (conflict_report): Additional useless pair of
19010 braces to pacify GCC's warnings for `if () if () {} else {}'.
19011 * src/lex.c (parse_percent_token): Replace equal_offset with
19012 arg_offset.
19013 arg is const.
19014 Be sure to strdup `arg' when used, since there is no reason for
19015 token_buffer not to change.
19016
190172001-11-14 Akim Demaille <akim@epita.fr>
19018
19019 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
19020 definition.
19021 * src/main.c (main): Use them.
19022 Suggested by Hans Aberg.
19023
190242001-11-12 Akim Demaille <akim@epita.fr>
19025
19026 * src/system.h (ngettext): Now that we use ngettext, be sure to
19027 provide a default definition when NLS are not used.
19028
190292001-11-12 Akim Demaille <akim@epita.fr>
19030
19031 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
19032 Use @kbd to denote user input.
19033 (Language and Grammar): ANSIfy the example.
19034 Adjust its layout for info/notinfo.
19035 (Location Tracking Calc): Output error messages to stderr.
19036 Output locations in a more GNUtically correct way.
19037 Fix a couple of Englishos.
19038 Adjust @group/@end group pairs.
19039
190402001-11-12 Akim Demaille <akim@epita.fr>
19041
19042 %expect was not functioning at all.
19043
19044 * src/conflicts.c (expected_conflicts): Set to -1.
19045 (conflict_report): Use ngettext.
19046 (conflicts_print): Check %expect and make its violation an error.
19047 * doc/bison.texinfo (Expect Decl): Adjust.
19048 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
19049 * tests/regression.at (%expect not enough, %expect right)
19050 (%expect too much): New.
19051
190522001-11-12 Akim Demaille <akim@epita.fr>
19053
19054 * tests/regression.at (Conflicts): Rename as...
19055 (Unresolved SR Conflicts): this.
19056 (Solved SR Conflicts): New.
19057
190582001-11-12 Akim Demaille <akim@epita.fr>
19059
19060 * src/reduce.c (print_results): Rename as...
19061 (reduce_output): This.
19062 Output to OUT, passed as argument, instead of output_obstack.
19063 (dump_grammar): Likewise.
19064 (reduce_free): New.
19065 Also free V1.
19066 (reduce_grammar): No longer call reduce_output, since...
19067 * src/print.c (print_results): do it.
19068 * src/main.c (main): Call reduce_free;
19069
190702001-11-12 Akim Demaille <akim@epita.fr>
19071
19072 * src/conflicts.c (print_reductions): Accept OUT as argument.
19073 Output to it, not to output_obstack.
19074 * src/print.c (print_actions): Adjust.
19075
190762001-11-12 Akim Demaille <akim@epita.fr>
19077
19078 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
19079 the result instead of using...
19080 (src_total, rrc_total, src_count, rrc_count): Remove.
19081 (any_conflicts): Remove.
19082 (print_conflicts): Split into...
19083 (conflicts_print, conflicts_output): New.
19084 * src/conflicts.h: Adjust.
19085 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
19086 * src/print.c (print_grammar): Issue `\n' between two rules.
19087 * tests/regression.at (Conflicts): New.
19088 Reported by Tom Lane.
19089
190902001-11-12 Akim Demaille <akim@epita.fr>
19091
19092 * tests/regression.at (Invalid input): Remove, duplicate with
19093 ``Invalid input: 1''.
19094
190952001-11-12 Akim Demaille <akim@epita.fr>
19096
19097 * tests/torture.at (AT_DATA_STACK_TORTURE)
19098 (Exploding the Stack Size with Alloca)
19099 (Exploding the Stack Size with Malloc): New.
19100
191012001-11-12 Akim Demaille <akim@epita.fr>
19102
19103 * src/bison.simple (YYSTACK_REALLOC): New.
19104 (yyparse) [!yyoverflow]: Use it and free the old stack.
19105 Reported by Per Allansson.
19106
191072001-11-12 Pascal Bart <pascal.bart@epita.fr>
19108
19109 * src/bison.simple: Define type yystype instead of YYSTYPE, and
19110 define CPP macro, which substitute YYSTYPE by yystype.
19111 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
19112 with yyltype/YYLTYPE. This allows inclusion of the generated
19113 header within the parser if the compiler, such as GGC, accepts
19114 multiple equivalent #defines.
19115 From Akim.
19116
191172001-11-05 Akim Demaille <akim@epita.fr>
19118
19119 * src/reader.c (symbols_output): New, extracted from...
19120 (packsymbols): here.
19121 (reader): Adjust.
19122
191232001-11-05 Akim Demaille <akim@epita.fr>
19124
19125 * src/lex.c (parse_percent_token): s/quotearg/quote/.
19126
191272001-11-05 Akim Demaille <akim@epita.fr>
19128
19129 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
19130 pattern.
19131
191322001-11-05 Akim Demaille <akim@epita.fr>
19133
19134 * src/options.h (struct option_table_struct): set_flags is void*.
19135 * src/options.c (longopts): Support `--output' and `%output'.
19136 (usage): Adjust.
19137 * src/lex.h (tok_setopt): Remove, replaced with...
19138 (tok_intopt, tok_stropt): these new guys.
19139 * src/lex.c (getopt.h): Not needed.
19140 (token_buffer, unlexed_token_buffer): Not const.
19141 (percent_table): Promote `-' over `_' in directive names.
19142 Active `%name-prefix', `file-prefix', and `output'.
19143 (parse_percent_token): Accept possible arguments to directives.
19144 Promote `-' over `_' in directive names.
19145
191462001-11-04 Akim Demaille <akim@epita.fr>
19147
19148 * doc/bison.texinfo (Decl Summary): Split the list into
19149 `directives for grammars' and `directives for bison'.
19150 Sort'em.
19151 Add description of `%name-prefix', `file-prefix', and `output'.
19152 Promote `-' over `_' in directive names.
19153 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
19154 Simplify the description of `--name-prefix'.
19155 Promote `-' over `_' in directive names.
19156 Promote `--output' over `--output-file'.
19157 Fix the description of `--defines'.
19158 * tests/output.at: Exercise %file-prefix and %output.
19159
191602001-11-02 Akim Demaille <akim@epita.fr>
19161
19162 * doc/refcard.tex: Update.
19163
191642001-11-02 Akim Demaille <akim@epita.fr>
19165
19166 * src/symtab.h (SUNDEF): New.
19167 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
19168 stand for `uninitialized', instead of 0.
19169 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
19170 * src/lex.c (lex): Adjust.
19171
19172 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
19173 Number it 0.
19174 Let yylex return it instead of a plain 0.
19175 Reported by Dick Streefland.
19176
191772001-11-02 Akim Demaille <akim@epita.fr>
19178
19179 * tests/regression.at (Mixing %token styles): New test.
19180
191812001-11-02 Akim Demaille <akim@epita.fr>
19182
19183 * src/reader.c (parse_thong_decl): Formatting changes.
19184 (token_translations_init): New, extracted from...
19185 (packsymbols): Here.
19186 Adjust.
19187
191882001-11-01 Akim Demaille <akim@epita.fr>
19189
19190 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
19191 Check that `9foo.y' produces correct cpp guards.
19192 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
19193 guards.
19194 Reported by Wwp.
19195
191962001-11-01 Akim Demaille <akim@epita.fr>
19197
19198 * tests/regression.at (Invalid input: 2): New.
19199 * src/lex.c (unlexed_token_buffer): New.
19200 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
19201 too.
19202 Reported by Wwp.
19203
192042001-11-01 Akim Demaille <akim@epita.fr>
19205
19206 * tests/calc.at: Catch up with 1.30.
19207 * configure.in: Bump to 1.49a.
19208 Adjust to newer Autotest.
19209
192102001-10-19 Pascal Bart <pascal.bart@epita.fr>
19211
19212 * src/conflicts.c: Move global variables rrc_total and src_total ...
19213 (print_conflicts): here.
19214 * src/output.c (output): Free global variable user_toknums.
19215 * src/lex.c (token_obstack): Become static.
19216
192172001-10-18 Akim Demaille <akim@epita.fr>
19218
19219 * tests/atlocal.in (GCC): Add.
19220 * tests/calc.at: s/m4_match/m4_bmatch/.
19221 s/m4_patsubst/m4_bpatsubst/.
19222 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
19223 * configure.in: AC_SUBST(GCC).
19224
192252001-10-14 Marc Autret <autret_m@epita.fr>
19226
19227 * src/options.c (create_long_option_table): Fix.
19228
192292001-10-10 Akim Demaille <akim@epita.fr>
19230
19231 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
19232
192332001-10-04 Akim Demaille <akim@epita.fr>
19234
19235 * src/reader.c (parse_union_decl): Push the caracters in
19236 union_obstack, not attrs_obstack.
19237
192382001-10-04 Akim Demaille <akim@epita.fr>
19239
19240 Merge in the branch 1.29.
19241
19242 * src/reader.c (packsymbols): Use a temporary obstack for
19243 `%%tokendef', since output_stack is already used elsewhere.
19244
19245 2001-10-02 Akim Demaille <akim@epita.fr>
19246
19247 Bump 1.29d.
19248
19249 2001-10-02 Akim Demaille <akim@epita.fr>
19250
19251 Version 1.29c.
19252
19253 2001-10-02 Akim Demaille <akim@epita.fr>
19254
19255 * tests/regression.at (Invalid CPP headers): New.
19256 From Alexander Belopolsky.
19257 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
19258
19259 2001-10-02 Akim Demaille <akim@epita.fr>
19260
19261 * tests/regression.at (Invalid input): New.
19262 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
19263 Reported by Shura.
19264
19265 2001-10-02 Akim Demaille <akim@epita.fr>
19266
19267 * tests/calc.at: Now that --debug works, the tests must be adjusted.
19268
19269 2001-10-02 Akim Demaille <akim@epita.fr>
19270
19271 * src/output.c (output_parser): Assert `skeleton'.
19272 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
19273 systems.
19274 From Shura.
19275
19276 2001-10-01 Marc Autret <autret_m@epita.fr>
19277
19278 * src/lex.h: Echo modifications.
19279 * src/lex.c (unlex): Parameter is now token_t.
19280 From Hans Aberg.
19281
19282 2001-10-01 Marc Autret <autret_m@epita.fr>
19283
19284 * src/main.c: Include lex.h.
19285 From Hans Aberg.
19286
19287 2001-09-29 Akim Demaille <akim@epita.fr>
19288
19289 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
19290
19291 2001-09-28 Akim Demaille <akim@epita.fr>
19292
19293 * tests/testsuite.at: Update to newer Autotest.
19294 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
19295
19296 2001-09-27 Akim Demaille <akim@epita.fr>
19297
19298 Position independent wrapper.
19299
19300 * tests/bison: Remove.
19301 * tests/bison.in: New.
19302 * configure.in: Adjust.
19303
19304 2001-09-27 Paul Eggert <eggert@twinsun.com>
19305
19306 Port quotearg fixes from tar 1.13.24.
19307
19308 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
19309 tm to be declared.
19310 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
19311 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
19312
19313 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
19314 * m4/mbrtowc.m4: New file.
19315 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
19316 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
19317
19318 2001-09-27 Akim Demaille <akim@epita.fr>
19319
19320 Bump to 1.29c.
19321
19322 2001-09-27 Akim Demaille <akim@epita.fr>
19323
19324 Version 1.29b.
19325
19326 2001-09-25 Akim Demaille <akim@epita.fr>
19327
19328 * src/system.h: Include `xalloc.h'.
19329 Remove it from the C files.
19330 * src/files.c (output_files): Free the obstacks.
19331 * src/lex.c (init_lex): Rename as...
19332 (lex_init): this.
19333 (lex_free): New.
19334 * src/main.c (main): Use it.
19335
19336 2001-09-24 Marc Autret <autret_m@epita.fr>
19337
19338 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
19339 to output informations in fout (FILE*).
19340 (open_graph, close_graph): Likewise.
19341 (output_graph, output_edge, output_node): Likewise.
19342 * src/vcg.h: Update function prototypes.
19343 * src/print_graph.c (print_graph): Open output graph file.
19344 (print_actions): Adjust.
19345 * src/files.h: Remove extern declaration.
19346 * src/files.c: Remove graph_obstack declaration.
19347 (open_files): Remove graph_obstack initialization.
19348 (output_files): Remove graph_obstack saving.
19349
19350 2001-09-24 Marc Autret <autret_m@epita.fr>
19351
19352 * src/files.c (compute_output_file_names): Fix.
19353
19354 2001-09-24 Marc Autret <autret_m@epita.fr>,
19355 Akim Demaille <akim@epita.fr>
19356
19357 * src/reader.c (reader): Remove call to free_symtab ().
19358 * src/main.c (main): Call it here.
19359 Include symtab.h.
19360 * src/conflicts.c (initialize_conflicts): Rename as...
19361 (solve_conflicts): this.
19362 * src/print.c (print_core, print_actions, print_state)
19363 (print_grammar): Dump to a file instead a `output_obstack'.
19364 (print_results): Dump `output_obstack', and then proceed with the
19365 FILE *.
19366 * src/files.c (compute_output_file_names, close_files): New.
19367 (output_files): Adjust.
19368 * src/main.c (main): Adjust.
19369
19370 2001-09-23 Marc Autret <autret_m@epita.fr>
19371
19372 * src/files.c (compute_header_macro): Computes header macro name
19373 from spec_defines_file when given.
19374
19375 2001-09-23 Marc Autret <autret_m@epita.fr>
19376
19377 * src/files.c (output_files): Add default extensions.
19378
19379 2001-09-22 Akim Demaille <akim@epita.fr>
19380
19381 * src/conflicts.c (finalize_conflicts): Rename as...
19382 (free_conflicts): this.
19383
19384 2001-09-22 Akim Demaille <akim@epita.fr>
19385
19386 * src/gram.c (gram_free): Rename back as...
19387 (dummy): this.
19388 (output_token_translations): Free `token_translations'.
19389 * src/symtab.c (free_symtab): Free the tag field.
19390
19391 2001-09-22 Akim Demaille <akim@epita.fr>
19392
19393 Remove `translations' as it is always set to true.
19394
19395 * src/gram.h: Adjust.
19396 * src/reader.c (packsymbols, parse_token_decl): Adjust
19397 * src/print.c (print_grammar): Adjust.
19398 * src/output.c (output_token_translations): Adjust.
19399 * src/lex.c (lex): Adjust.
19400 * src/gram.c: Be sure the set pointers to NULL.
19401 (dummy): Rename as...
19402 (gram_free): this.
19403
19404 2001-09-22 Akim Demaille <akim@epita.fr>
19405
19406 * configure.in: Invoke AM_LIB_DMALLOC.
19407 * src/system.h: Use dmalloc.
19408 * src/LR0.c: Be sure to have pointers initialized to NULL.
19409 (allocate_itemsets): Allocate kernel_items only if needed.
19410
19411 2001-09-22 Akim Demaille <akim@epita.fr>
19412
19413 * configure.in: Bump to 1.29b.
19414 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
19415 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
19416 need xmalloc.c in calc.y.
19417 From Pascal Bart.
19418
19419 2001-09-21 Akim Demaille <akim@epita.fr>
19420
19421 Version 1.29a.
19422 * Makefile.maint, config/config.guess, config/config.sub,
19423 * config/missing: Update from masters.
19424 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
19425 upon package.m4.
19426 * configure.in (ALL_LINGUAS): Add `tr'.
19427
19428 2001-09-21 Akim Demaille <akim@epita.fr>
19429
19430 * tests/Makefile.am (package.m4): Move to...
19431 ($(srcdir)/$(TESTSUITE)): here.
19432
19433 2001-09-20 Akim Demaille <akim@epita.fr>
19434
19435 * src/complain.c: No longer try to be standalone: use system.h.
19436 Don't assume __STDC__ is defined to 1. Just test if it is defined.
19437 * src/complain.h: Likewise.
19438 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
19439 Remove the unused variable `n'.
19440 From Albert Chin-A-Young.
19441
19442 2001-09-18 Marc Autret <autret_m@epita.fr>
19443
19444 * doc/bison.1: Update.
19445 * doc/bison.texinfo (Bison Options): Update --defines and --graph
19446 descriptions.
19447 (Option Cross Key): Update.
19448 Add --graph.
19449
19450 2001-09-18 Marc Autret <autret_m@epita.fr>
19451
19452 * tests/regression.at: New test (comment in %union).
19453
19454 2001-09-18 Marc Autret <autret_m@epita.fr>
19455
19456 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
19457 do that.
19458 Reported by Keith Browne.
19459
19460 2001-09-18 Marc Autret <autret_m@epita.fr>
19461
19462 * tests/output.at: Add tests for --defines and --graph.
19463
19464 2001-09-18 Marc Autret <autret_m@epita.fr>
19465
19466 * tests/output.at: Removes tests of %{header,src}_extension features.
19467
19468 2001-09-18 Akim Demaille <akim@epita.fr>
19469
19470 * tests/Makefile.am (package.m4): New.
19471 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
19472 (_AT_CHECK_CALC_ERROR): Likewise.
19473 Factor the `, ' part of verbose error messages.
19474
19475 2001-09-18 Marc Autret <autret_m@epita.fr>
19476
19477 * src/getargs.c (longopts): Declare --defines and --graph as options
19478 with optional arguments.
19479 * src/files.h: Add extern declarations.
19480 * src/files.c (spec_graph_file, spec_defines_file): New.
19481 (output_files): Update.
19482 Remove CPP-outed code.
19483
19484 2001-09-18 Marc Autret <autret_m@epita.fr>
19485
19486 Turn off %{source,header}_extension feature.
19487
19488 * src/files.c (compute_exts_from_gf): Update.
19489 (compute_exts_from_src): Update.
19490 (output_files): CPP-out useless code.
19491 * src/files.h: Remove {header,source}_extension extern declarations.
19492 * src/reader.c (parse_dquoted_param): CPP-out.
19493 (parse_header_extension_decl): Remove.
19494 (parse_source_extension_decl): Remove.
19495 (read_declarations): Remove cases tok_{hdrext,srcext}.
19496 * src/lex.c (percent_table): Remove {header,source}_extension entries.
19497 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
19498
19499 2001-09-10 Akim Demaille <akim@epita.fr>
19500
19501 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
19502 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
19503 (AT_CHECK_OUTPUT): this.
19504 Merely check ls' exit status, its output is useless.
19505
19506 2001-09-10 Akim Demaille <akim@epita.fr>
19507
19508 * tests/calc.at: Use m4_match.
19509 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
19510
19511 2001-09-10 Marc Autret <autret_m@epita.fr>,
19512 Akim Demaille <akim@epita.fr>
19513
19514 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
19515 enum color_e.
19516 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
19517 to `normal'.
19518 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
19519 * src/lex.h: Adjust prototype.
19520 (token_t): Add `tok_undef'.
19521 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
19522 (parse_percent_token): Now returns token_t.
19523 Add default statement in switch.
19524 (lex): Separate `c' as an input variable, from the token_t result
19525 part.
19526 (unlexed): Is a token_t.
19527
19528 2001-09-10 Akim Demaille <akim@epita.fr>
19529
19530 * configure.in: Bump to 1.29a.
19531
19532 2001-09-07 Akim Demaille <akim@epita.fr>
19533
19534 Version 1.29.
19535
19536 2001-08-30 Akim Demaille <akim@epita.fr>
19537
19538 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
19539 * m4/atconfig.m4: Remove.
19540 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
19541 * tests/bison: New.
19542 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
19543 m4_if, m4_patsubst, and m4_regexp.
19544 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
19545 `input' file instead of echo.
19546
19547 2001-08-29 Akim Demaille <akim@epita.fr>
19548
19549 Bump to 1.28e.
19550
19551 2001-08-29 Akim Demaille <akim@epita.fr>
19552
19553 Version 1.28d.
19554
19555 2001-08-29 Paul Eggert <eggert@twinsun.com>
19556
19557 * src/bison.simple (yyparse): Don't take the address of an
19558 item before the start of an array, as that doesn't conform to
19559 the C Standard.
19560
19561 2001-08-29 Robert Anisko <anisko_r@epita.fr>
19562
19563 * doc/bison.texinfo (Location Tracking Calc): New node.
19564
19565 2001-08-29 Paul Eggert <eggert@twinsun.com>
19566
19567 * src/output.c (output): Do not define const, as this now
19568 causes more problems than it cures.
19569
19570 2001-08-29 Akim Demaille <akim@epita.fr>
19571
19572 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
19573 the nodes.
19574 Be sure to tag the `detailmenu'.
19575
19576 2001-08-29 Akim Demaille <akim@epita.fr>
19577
19578 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
19579 download in a tmp dir.
19580
19581 2001-08-28 Marc Autret <autret_m@epita.fr>
19582
19583 * config/depcomp: New file.
19584
19585 2001-08-28 Marc Autret <autret_m@epita.fr>
19586
19587 * doc/bison.1 (mandoc): Adjust.
19588 From Juan Manuel Guerrero.
19589
19590 2001-08-28 Marc Autret <autret_m@epita.fr>
19591
19592 * src/print_graph.c (print_state): Fix.
19593
19594 2001-08-27 Marc Autret <autret_m@epita.fr>
19595
19596 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
19597 char * members.
19598 Echo modifications to the functions prototypes.
19599 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
19600
19601 2001-08-27 Marc Autret <autret_m@epita.fr>
19602
19603 * src/vcg.c: Include `xalloc.h'.
19604 (add_colorentry): New.
19605 (add_classname): New.
19606 (add_infoname): New.
19607 * src/vcg.h: Add new prototypes.
19608
19609 2001-08-27 Akim Demaille <akim@epita.fr>
19610
19611 * Makefile.maint: Sync. again with CVS Autoconf.
19612
19613 2001-08-27 Akim Demaille <akim@epita.fr>
19614
19615 * Makefile.maint: Formatting changes.
19616 (po-update, cvs-update, update): New targets.
19617 (AMTAR): Remove.
19618
19619 2001-08-27 Akim Demaille <akim@epita.fr>
19620
19621 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19622 * Makefile.maint: Sync. with CVS Autoconf.
19623
19624 2001-08-27 Marc Autret <autret_m@epita.fr>
19625
19626 * src/vcg.h (struct infoname_s): New.
19627 (struct colorentry_s): New.
19628 (graph_s): New fields {vertical,horizontal}_order in structure.
19629 Add `infoname' field.
19630 Add `colorentry' field;
19631 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
19632 (G_HORIZONTAL_ORDER): New.
19633 (G_INFONAME): New.
19634 (G_COLORENTRY): New.
19635 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
19636 Add output of `infoname'.
19637 Add output of `colorentry'.
19638
19639 2001-08-27 Marc Autret <autret_m@epita.fr>
19640
19641 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
19642 This one shadowed a global parameter.
19643
19644 2001-08-24 Marc Autret <autret_m@epita.fr>
19645
19646 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
19647 instead of `unsigned'.
19648 (print_state): Do not call obstack_object_size () in obstack_grow ()
19649 to avoid macro variables shadowing.
19650
19651 2001-08-23 Marc Autret <autret_m@epita.fr>
19652
19653 * src/lex.c (percent_table): Typo: s/naem/name/.
19654 Add graph option.
19655 Normalize new options declarations.
19656
19657 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
19658
19659 * tests/suite.at: Exercise %header_extension and %source_extension.
19660
19661 2001-08-16 Marc Autret <autret_m@epita.fr>
19662
19663 * src/reader.c (parse_dquoted_param): New.
19664 (parse_header_extension_decl): Use it.
19665 (parse_source_extension_decl): Likewise.
19666
19667 2001-08-16 Marc Autret <autret_m@epita.fr>
19668
19669 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
19670 (get_xxxx_str): Use assert () instead of complain ().
19671 Remove return invokations in default cases.
19672 (get_decision_str): Modify default behaviour. Remove second argument.
19673 Echo modifications on calls.
19674 (output_graph): Fix.
19675
19676 2001-08-16 Marc Autret <autret_m@epita.fr>
19677
19678 * src/getargs.c (usage): Update with ``-g, --graph''.
19679
19680 2001-08-16 Marc Autret <autret_m@epita.fr>
19681
19682 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
19683 (Option Cross Key): Likewise.
19684 * doc/bison.1: Update.
19685
196862001-09-25 Pascal Bart <pascal.bart@epita.fr>
19687
19688 * src/output.c (output_master_parser): Don't finish action_obstack.
19689 (output_parser): Don't care about the muscle action, here.
19690 (prepare): Copy the action_obstack in the action muscle.
19691 (output): Free action_obstack.
19692
196932001-09-23 Pascal Bart <pascal.bart@epita.fr>
19694
19695 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
19696 will contain `%union' declaration.
19697 (parse_union_decl): Delete #line directive output.
19698 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
19699 informations about %union.
19700 (parse_union_decl): Copy the union_obstack in the muscle stype.
19701 * src/bison.simple: Add new #line directive.
19702 Add typdef %%stype YYSTYPE.
19703
197042001-09-23 Pascal Bart <pascal.bart@epita.fr>
19705
19706 * src/bison.simple: Add new `#line' directive.
19707
197082001-09-22 Pascal Bart <pascal.bart@epita.fr>
19709
19710 * src/bison.simple: New `#line' directive.
19711 * src/output.c (output_parser): Support new dynamic muscle input_line.
19712
197132001-09-22 Marc Autret <autret_m@epita.fr>
19714
19715 * src/output.c (output_master_parser): New.
19716 (output_parser): Be more re-entrant.
19717
197182001-09-21 Marc Autret <autret_m@epita.fr>
19719
19720 * src/reader.c (copy_definition, parse_union_decl): Update and use
19721 `linef' muscle.
19722 (copy_action): Likewise.
19723 Use obstack_1grow ().
19724 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
19725
197262001-09-21 Marc Autret <autret_m@epita.fr>
19727
19728 * src/options.c (option_table): Adjust.
19729 * src/lex.c (parse_percent_token): Fix.
19730
197312001-09-20 Pascal Bart <pascal.bart@epita.fr>
19732
19733 * src/options.c (symtab.h): Include it, need by lex.h.
19734
197352001-09-20 Pascal Bart <pascal.bart@epita.fr>
19736
19737 * src/lex.c (parse_percent_token): Change type of variable `tx', which
19738 is now an option_table_struct*.
19739 (option_strcmp): New function option_strcmp.
19740 (parse_percent_token): Call option_strcmp.
19741 * src/getargs.c (xalloc.h, options.h): Include it.
19742 (getargs): Call create_long_option_table.
19743 (getargs): Free longopts at the end of the function.
19744 (shortopts): Move in options.c.
19745 * src/options.c (create_long_option_table): New function. Convert
19746 information from option_table to option structure.
19747 * src/reader.c (options.h): Include it.
19748
19749 * src/Makefile.am: Adjust.
19750 * src/options.c (option_table): Create from longopts and percent_table.
19751 * src/getargs.c (longopts): Delete.
19752 * src/lex.c (struct percent_table_struct): Delete.
19753 (percent_table): Delete.
19754 (options.h): Include it.
19755 * src/options.c: Create.
19756 * src/options.h: Create.
19757 Declare enum opt_access_e.
19758 Define struct option_table_struct.
19759
197602001-09-20 Marc Autret <autret_m@epita.fr>
19761
19762 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
19763 sections of Bison.
19764
197652001-09-19 Pascal Bart <pascal.bart@epita.fr>
19766
19767 * src/bison.simple: s/%%filename/%%skeleton.
19768 * src/muscle_tab.c (getargs.h): Include it.
19769 (muscle_init): Insert new muscle skeleton.
19770
197712001-09-18 Pascal Bart <pascal.bart@epita.fr>
19772
19773 * src/output.c (output_parser): Delete unused variable actions_dumped.
19774
197752001-09-07 Pascal Bart <pascal.bart@epita.fr>
19776
19777 * src/output.c (output): Delete call to reader_output_yylsp.
19778 * src/reader.c (reader): Likewise.
19779 * src/reader.h: Delete declaration of reader_output_yylsp.
19780
197812001-09-02 Marc Autret <autret_m@epita.fr>
19782
19783 * src/reader.c: Include muscle_tab.h.
19784 (parse_union_decl): Update.
19785 (parse_macro_decl): Rename parse_muscle_decl.
19786 Update to use renamed functions and variable.
19787 (read_declarations, copy_action, read_additionnal_code, : Updated
19788 with correct variables and functions names.
19789 (packsymbols, reader): Likewise.
19790
19791 * src/reader.h (muscle_obstack): Extern declaration update.
19792
19793 * src/output.c: Include muscle_tab.h
19794 In all functions using macro_insert, change by using muscle_insert ().
19795 (macro_obstack): Rename muscle_obstack.
19796 Echo modifications in the whole file.
19797 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
19798 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
19799 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
19800
19801 * src/muscle_tab.h: Update double inclusion macros.
19802 (macro_entry_s): Rename muscle_entry_s.
19803 Update prototypes.
19804
19805 * src/muscle_tab.c: Include muscle_tab.h.
19806 Rename macro_tabble to muscle_table.
19807 (mhash1, mhash2, mcmp): Use muscle_entry.
19808 (macro_init): Rename muscle_init. Update.
19809 (macro_insert): Rename muscle_insert. Update.
19810 (macro_find): Rename muscle_find. Update.
19811
19812 * src/main.c: Include muscle_tab.h.
19813 (main): Call muscle_init ().
19814 * src/Makefile.am (bison_SOURCES): Echo modifications.
19815
198162001-09-02 Marc Autret <autret_m@epita.fr>
19817
19818 Now the files macro_tab.[ch] are named muscle_tab.[ch].
19819
19820 * src/muscle_tab.c, src/muscle_tab.h: Add files.
19821
198222001-09-02 Marc Autret <autret_m@epita.fr>
19823
19824 * src/macrotab.c, src/macrotab.h: Remove.
19825
198262001-09-01 Pascal Bart <pascal.bart@epita.fr>
19827
19828 * src/reader.c (copy_guard): Use muscle to specify the `#line'
19829 filename.
19830
198312001-09-01 Marc Autret <autret_m@epita.fr>
19832
19833 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
19834 to an explicit value to activate the feature. We do it here.
19835
198362001-08-31 Pascal Bart <pascal.bart@epita.fr>
19837
19838 * src/output.c (prepare): Delete the `filename' muscule insertion.
19839 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
19840 (parse_union_decl): Likewise.
19841 * src/macrotab.c (macro_init): Initialize filename by infile.
19842
198432001-08-31 Marc Autret <autret_m@epita.fr>
19844
19845 * src/bison.simple (YYLSP_NEEDED): New definition.
19846 * src/output.c (prepare): Add macro insertion of `locations_flag'
19847
198482001-08-31 Pascal Bart <pascal.bart@epita.fr>
19849
19850 * src/output.c (prepare): Delete insertion of previous muscles,
19851 and insert the `prefix' muscles.
19852 * src/macrotab.c (macro_init): Likewise.
19853 (macro_init): Initialization prefix directive by `yy'.
19854 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
19855 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
19856 yylval, yydebug, yyerror, yynerrs and yyparse.
19857 New directive `#define' to substitute yydebug, ... with option
19858 name_prefix.
19859
198602001-08-31 Pascal Bart <pascal.bart@epita.fr>
19861
19862 * src/main.c (main): Standardize.
19863 * src/output.c (output_table_data, output_parser): Likewise.
19864 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
19865
198662001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
19867
19868 * src/reader.c (read_additionnal_code): Rename %%user_code to
19869 %%epilogue.
19870 * src/output.c (output): Rename %%declarations to %%prologue.
19871 * src/bison.simple: Echo modifications.
19872
198732001-08-31 Marc Autret <autret_m@epita.fr>
19874
19875 * src/reader.c (readgram): CleanUp.
19876 (output_token_defines): Likewise.
19877 (packsymbols): Likewise.
19878 (reader): Likewise.
19879 * src/output.c (output): CPP-out useless code.
19880
198812001-08-31 Pascal Bart <pascal.bart@epita.fr>
19882
19883 * src/reader.c (reader): Delete obsolete call to function
19884 output_trailers and output_headers.
19885 * src/output.h: Remove obsolete functions prototypes of output_headers
19886 and output_trailers.
19887
198882001-08-30 Pascal Bart <pascal.bart@epita.fr>
19889
19890 * src/main.c: Include macrotab.h.
19891 * src/macrotab.h (macro_entry_s): Constify fields.
19892 Adjust functions prototypes.
19893 * src/macrotab.c (macro_insert): Constify key and value.
19894 (macro_find): Constify key.
19895 (macro_insert): Include 'xalloc.h'
19896 (macro_insert): Use XMALLOC.
19897 (macro_find): Constify return value.
19898 * src/output.c (output_table_data): Rename table to table_data.
19899 (output_parser): Constify macro_key, macro_value.
19900
199012001-08-30 Marc Autret <autret_m@epita.fr>
19902
19903 * src/reader.c (parse_skel_decl): New.
19904 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
19905 * src/lex.h (token_t): New token `tok_skel'.
19906 * src/lex.c (percent_table): Add skeleton option entry.
19907 Standardize.
19908
199092001-08-29 Marc Autret <autret_m@epita.fr>
19910
19911 * src/bison.simple: Add %%user_code directive at the end.
19912 * src/reader.c (read_additionnal_code): New.
19913 (reader): Use it.
19914 * src/output.c (output_program): Remove.
19915 (output): Update.
19916
199172001-08-28 Marc Autret <autret_m@epita.fr>
19918
19919 * src/output.c (output_actions): Clean up.
19920 (output_gram): CPP-out useless code.
19921 * src/reader.c (reader): Clean up, CPP-out useless code.
19922
199232001-08-28 Pascal Bart <pascal.bart@epita.fr>
19924
19925 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
19926 directive.
19927 * src/bison.simple: Add `%%definitions'.
19928
199292001-08-28 Marc Autret <autret_m@epita.fr>
19930
19931 * config/depcomp: New file.
19932
199332001-08-27 Paul Eggert <eggert@twinsun.com>
19934
19935 * src/bison.simple (yyparse): Don't take the address of an
19936 item before the start of an array, as that doesn't conform to
19937 the C Standard.
19938
199392001-08-27 Robert Anisko <robert.anisko@epita.fr>
19940
19941 * src/output.c (output): Remove the initialization of the macro
19942 obstack. It was done too late here.
19943
19944 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
19945 completely wrong.
19946 (reader): Initialize the macro obstack here, since we need it to grow
19947 '%define' directives.
19948
19949 * src/reader.h: Declare the macro obstack as extern.
19950
199512001-08-27 Robert Anisko <robert.anisko@epita.fr>
19952
19953 * src/output.c (output_parser): Fix. Store single '%' characters in
19954 the output obstack instead of throwing them away.
19955
199562001-08-27 Akim Demaille <akim@epita.fr>
19957
19958 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19959
199602001-08-25 Robert Anisko <robert.anisko@epita.fr>
19961
19962 * lib/Makefile.am: Adjust.
19963
199642001-08-25 Robert Anisko <robert.anisko@epita.fr>
19965
19966 * src/bison.simple: Update and add '%%' directives.
19967
199682001-08-25 Robert Anisko <robert.anisko@epita.fr>
19969
19970 * src/reader.c (reader): Remove calls to 'output_headers' and
19971 'output_trailers'. Remove some C output.
19972 (readgram): Disable a piece of code that was writing a default
19973 definition for 'YYSTYPE'.
19974 (reader_output_yylsp): Remove.
19975 (packsymbols): Output token defintions to a macro.
19976 (copy_definition): Disable C output.
19977
19978 * src/reader.c (parse_macro_decl): New function used to parse macro
19979 declarations.
19980 (copy_string2): Put the body of copy_string into this new function.
19981 Add a parameter to let the caller choose whether he wants to copy the
19982 string delimiters or not.
19983 (copy_string): Be a simple call to copy_string2 with the last argument
19984 bound to true.
19985 (read_declarations): Add case for macro definition.
19986 (copy_identifier): New.
19987 (parse_macro_decl): Read macro identifiers using copy_identifier
19988 rather than lex.
19989
199902001-08-25 Robert Anisko <robert.anisko@epita.fr>
19991
19992 * src/output.c (prepare): Add prefixed names.
19993 (output_parser): Output semantic actions.
19994 (output_parser): Fix bug on '%%line' directives.
19995
19996 * src/output.c (output_headers): Remove. The C code printed by this
19997 function should now be in the skeletons.
19998 (output_trailers): Remove.
19999 (output): Disable call to 'reader_output_yylsp'.
20000 (output_rule_data): Do not output tables to the table obstack.
20001
20002 * src/output.c: Remove some C dedicated output.
20003 Improve the use of macro and output obstacks.
20004 (output_defines): Remove.
20005
20006 * src/output.c (output_token_translations): Associate 'translate'
20007 table with a macro. No output to the table obstack.
20008 (output_gram): Same for 'rhs' and 'prhs'.
20009 (output_stos): Same for 'stos'.
20010 (output_rule_data): Same for 'r1' and 'r2'.
20011 (token_actions): Same for 'defact'.
20012 (goto_actions): Same for 'defgoto'.
20013 (output_base): Same for 'pact' and 'pgoto'.
20014 (output_table): Same for 'table'.
20015 (output_check): Same for 'check'.
20016
20017 * src/output.c (output_table_data): New function.
20018 (output_short_table): Remove.
20019 (output_short_or_char_table): Remove.
20020
20021 * src/output.c (output_parser): Replace most of the skeleton copy code
20022 with something new. Skeletons are now processed character by character
20023 rather than line by line, and Bison looks for '%%' macros. This is the
20024 first step in making Bison's output process (a lot) more flexible.
20025 (output_parser): Use the macro table.
20026
200272001-08-25 Robert Anisko <robert.anisko@epita.fr>
20028
20029 * src/main.c (main): Initialize the macro table.
20030
200312001-08-25 Robert Anisko <robert.anisko@epita.fr>
20032
20033 * src/lex.c (percent_table): Add tok_define.
20034 * src/lex.h: Add tok_define.
20035
200362001-08-25 Robert Anisko <robert.anisko@epita.fr>
20037
20038 * src/macrotab.c: New file.
20039 * src/macrotab.h: New file.
20040 * src/Makefile.am: Update.
20041
200422001-08-25 Robert Anisko <robert.anisko@epita.fr>
20043
20044 * lib/hash.c: New file.
20045 * lib/hash.h: New file.
20046 * lib/Makefile.am: Update.
20047
200482001-08-15 Akim Demaille <akim@epita.fr>
20049
20050 Version 1.28c.
20051
200522001-08-15 Marc Autret <autret_m@epita.fr>
20053
20054 * src/reader.c (readgram): Indent output macro YYSTYPE.
20055 (packsymbols): Likewise.
20056 (output_token_defines): Likewise.
20057 * src/files.c: Standardize.
20058 (compute_header_macro): New.
20059 (defines_obstack_save): New. Use compute_header_macro.
20060 (output_files): Update. Use defines_obstack_save.
20061
200622001-08-15 Akim Demaille <akim@epita.fr>
20063
20064 * doc/bison.texinfo (Table of Symbols): Document
20065 YYSTACK_USE_ALLOCA.
20066
200672001-08-15 Akim Demaille <akim@epita.fr>
20068
20069 * missing: Update from CVS Automake.
20070 * config/config.guess, config/config.sub, config/texinfo.tex:
20071 Update from gnu.org.
20072
200732001-08-15 Akim Demaille <akim@epita.fr>
20074
20075 * Makefile.maint: Sync with CVS Autoconf.
20076
200772001-08-14 Pascal Bart <pascal.bart@epita.fr>
20078
20079 * doc/bison.texinfo: Include GNU Free Documentation License from
20080 `fdl.texi'.
20081 * doc/fdl.texi: Add to package.
20082
200832001-08-14 Marc Autret <autret_m@epita.fr>
20084
20085 Turn on %{source,header}_extension features.
20086
20087 * src/lex.c (percent_table): Un-CPP out header_extension and
20088 source_extension.
20089 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
20090 (compute_exts_from_src): Remove conditions. It restores priorities
20091 between options.
20092
200932001-08-14 Marc Autret <autret_m@epita.fr>
20094
20095 * src/files.c (compute_base_names): Add extensions computing when
20096 `--file-prefix' used.
20097 Standardize function calls.
20098
200992001-08-13 Marc Autret <autret_m@epita.fr>
20100
20101 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
20102 defining it (defined but null disables alloca).
20103
201042001-08-13 Marc Autret <autret_m@epita.fr>
20105
20106 * src/bison.simple (_yy_memcpy): CPP reformat.
20107
201082001-08-13 Pascal Bart <pascal.bart@epita.fr>
20109
20110 * tests/atconfig.in (CPPFLAGS): Fix.
20111
201122001-08-10 Pascal Bart <pascal.bart@epita.fr>
20113
20114 * doc/bison.texinfo: Include GNU General Public License from
20115 `gpl.texi'.
20116 * doc/gpl.texi: Add to package.
20117
201182001-08-10 Marc Autret <autret_m@epita.fr>
20119
20120 * src/print_graph.h: Fix.
20121 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
20122
201232001-08-10 Akim Demaille <akim@epita.fr>
20124
20125 * src/system.h: Provide default declarations for stpcpy, strndup,
20126 and strnlen.
20127
201282001-08-10 Robert Anisko <anisko_r@epita.fr>
20129
20130 * doc/bison.texinfo (Locations): Update @$ stuff.
20131
201322001-08-09 Robert Anisko <anisko_r@epita.fr>
20133
20134 * src/bison.simple (YYLLOC_DEFAULT): Update.
20135 (yyparse): Adjust.
20136
201372001-08-08 Marc Autret <autret_m@epita.fr>
20138
20139 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
20140 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
20141 Reported by Fabrice Bauzac.
20142
201432001-08-08 Marc Autret <autret_m@epita.fr>
20144
20145 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
20146 * src/vcg.c (output_node): Fix.
20147 * src/vcg.h: Cleanup.
20148 * src/print_graph.c: Add comments.
20149 (node_output_size): New global variable. Simplify the formatting of
20150 the VCG graph output.
20151 (print_actions): Unused code is now used. It notifies the final state
20152 and no action states in the VCG graph. It also give the reduce actions.
20153 The `shift and goto' edges are red and the `go to state' edges are
20154 blue.
20155 Get the current node name and node_obstack by argument.
20156 (node_obstack): New variable.
20157 (print_state): Manage node_obstack.
20158 (print_core): Use node_obstack given by argument.
20159 A node is not only computed here but in print_actions also.
20160 (print_graph): CPP out useless code instead of commenting it.
20161
201622001-08-07 Pascal Bart <pascal.bart@epita.fr>
20163
20164 * tests/atconfig.in (CPPFLAGS): Fix.
20165
201662001-08-07 Akim Demaille <akim@epita.fr>
20167
20168 * src/print_graph.c (quote): New.
20169 (print_core): Use it.
20170
201712001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
20172
20173 * src/vcg.c (complain.h): Include it.
20174 Unepitaize `return' invocations.
20175 [NDEBUG] (main): Remove.
20176 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
20177 * src/files.c (open_files): Initialize graph_obstack.
20178 * src/print_graph.c (print_actions): CPP out useless code.
20179 (print_core): Don't output the last `\n' in labels.
20180 Use `quote'.
20181 * src/files.c (output_files): Output the VCG file.
20182 * src/main.c (main): Invoke print_graph ();
20183
201842001-08-06 Marc Autret <autret_m@epita.fr>
20185
20186 Automaton VCG graph output.
20187 Using option ``-g'' or long option ``--graph'', you can generate
20188 a gram_filename.vcg file containing a VCG description of the LALR (1)
20189 automaton of your grammar.
20190
20191 * src/main.c: Call to print_graph() function.
20192 * src/getargs.h: Update.
20193 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
20194 (graph_flag): New flag.
20195 (longopts): Update.
20196 (getargs): Add case `g'.
20197 * src/files.c (graph_obstack): New obstack struct.
20198 (open_files): Initialize new obstack.
20199 (output_files): Saves graph_obstack if required.
20200 * src/files.h (graph_obstack): New extern declaration.
20201 * src/Makefile.am: Add new source files.
20202
202032001-08-06 Marc Autret <autret_m@epita.fr>
20204
20205 * src/print_graph.c, src/print_graph.h (graph): New.
20206 * src/vcg.h: New file.
20207 * src/vcg.c: New file, VCG graph handling.
20208
202092001-08-06 Marc Autret <autret_m@epita.fr>
20210
20211 Add of %source_extension and %header_extension which specify
20212 the source or/and the header output file extension.
20213
20214 * src/files.c (compute_base_names): Remove initialisation of
20215 src_extension and header_extension.
20216 (compute_exts_from_gf): Update.
20217 (compute_exts_from_src): Update.
20218 (output_files): Update.
20219 * src/reader.c (parse_header_extension_decl): New.
20220 (parse_source_extension_decl): New.
20221 (read_declarations): New case statements for the new tokens.
20222 * src/lex.c (percent_table): Add entries for %source_extension
20223 and %header_extension.
20224 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
20225
202262001-08-06 Marc Autret <autret_m@epita.fr>
20227
20228 * configure.in: Bump to 1.28c.
20229 * doc/bison.texinfo: Texinfo thingies.
20230
202312001-08-04 Pascal Bart <pascal.bart@epita.fr>
20232
20233 * tests/atconfig.in (CPPFLAGS): Add.
20234 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
20235
202362001-08-03 Akim Demaille <akim@epita.fr>
20237
20238 Version 1.28b.
20239
202402001-08-03 Akim Demaille <akim@epita.fr>
20241
20242 * tests/Makefile.am (check-local): Ship testsuite.
20243 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
20244 Include `string.h'.
20245
202462001-08-03 Akim Demaille <akim@epita.fr>
20247
20248 * configure.in: Try using -Wformat when compiling.
20249
202502001-08-03 Akim Demaille <akim@epita.fr>
20251
20252 * configure.in: Bump to 1.28b.
20253
202542001-08-03 Akim Demaille <akim@epita.fr>
20255
20256 * src/complain.c: Adjust strerror_r portability issues.
20257
202582001-08-03 Akim Demaille <akim@epita.fr>
20259
20260 Version 1.28a.
20261
202622001-08-03 Akim Demaille <akim@epita.fr>
20263
20264 * src/getargs.c, src/getarg.h (skeleton)): Constify.
20265 * src/lex.c (literalchar): Avoid name clashes on `buf'.
20266 * src/getargs.c: Include complain.h.
20267 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
20268 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
20269
202702001-08-03 Akim Demaille <akim@epita.fr>
20271
20272 * src/reader.c (readgram): Display hidden chars in error messages.
20273
202742001-08-03 Akim Demaille <akim@epita.fr>
20275
20276 Update to gettext 0.10.39.
20277
202782001-08-03 Akim Demaille <akim@epita.fr>
20279
20280 * lib/strspn.c: New.
20281
202822001-08-01 Marc Autret <autret_m@epita.fr>
20283
20284 * doc/bison.texinfo: Update.
20285 * doc/bison.1 (mandoc): Update.
20286 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
20287 * src/files.c: Support output files extensions computing.
20288 (src_extension): New static variable.
20289 (header_extension): New static variable.
20290 (tr): New function.
20291 (get_extension_index): New function, gets the index of an extension
20292 filename in a string.
20293 (compute_exts_from_gf): New function, computes extensions from the
20294 grammar file extension.
20295 (compute_exts_from_src): New functions, computes extensions from the
20296 C source file extension, file given by ``-o'' option.
20297 (compute_base_names): Update.
20298 (output_files): Update.
20299
203002001-08-01 Robert Anisko <anisko_r@epita.fr>
20301
20302 * doc/bison.texi: Document @$.
20303 (Locations): New section.
20304
203052001-07-18 Akim Demaille <akim@epita.fr>
20306
20307 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
20308 * config/prev-version.txt, config/move-if-change: New.
20309 * Makefile.am: Adjust.
20310
203112001-07-08 Pascal Bart <pascal.bart@epita.fr>
20312
20313 * src/bison.simple (yyparse): Suppress warning `comparaison
20314 between signed and unsigned'.
20315
203162001-07-05 Pascal Bart <pascal.bart@epita.fr>
20317
20318 * src/getargs.h (raw_flag): Remove.
20319 * src/getargs.c: Die on `-r'/`--raw'.
20320 * src/lex.c (parse_percent_token): Die on `%raw'.
20321 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
20322 * tests/calc.at: Suppress test with option `--raw'.
20323
203242001-07-14 Akim Demaille <akim@epita.fr>
20325
20326 * config/: New.
20327 * configure.in: Require Autoconf 2.50.
20328 Update to gettext 0.10.38.
20329
203302001-03-16 Akim Demaille <akim@epita.fr>
20331
20332 * doc/bison.texinfo: ANSIfy the examples.
20333
203342001-03-16 Akim Demaille <akim@epita.fr>
20335
20336 * getargs.c (skeleton): New variable.
20337 (longopts): --skeleton is a new option.
20338 (shortopts, getargs): -S is a new option.
20339 * getargs.h: Declare skeleton.
20340 * output.c (output_parser): Use it.
20341
203422001-03-16 Akim Demaille <akim@epita.fr>
20343
20344 * m4/strerror_r.m4: New.
20345 * m4/error.m4: Run AC_FUNC_STRERROR_R.
20346 * lib/error.h, lib/error.c: Update.
20347
203482001-03-16 Akim Demaille <akim@epita.fr>
20349
20350 * src/getargs.c (longopts): Clean up.
20351
203522001-02-21 Akim Demaille <akim@epita.fr>
20353
20354 * src/reader.c (gensym): `gensym_count' is your own.
20355 Use a static buf to create the symbol name, as token_buffer is no
20356 longer a buffer.
20357
203582001-02-08 Akim Demaille <akim@epita.fr>
20359
20360 * src/conflicts.c (conflict_report): Be sure not to append to res
20361 between two calls, which could happen if both first sprintf were
20362 skipped, but not the first cp += strlen.
20363
203642001-02-08 Akim Demaille <akim@epita.fr>
20365
20366 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
20367 New, from fileutils 4.0.37.
20368 * configure.in: Require Autoconf 2.49c. I took some time before
20369 making this decision. This is the only way out for portability
20370 issues in Bison, it would mean way too much duplicate effort to
20371 import in Bison features implemented in 2.49c since 2.13.
20372 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
20373
203742001-02-02 Akim Demaille <akim@epita.fr>
20375
20376 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
20377 * lib/xalloc.h, lib/xmalloc.c: Update.
20378
203792001-01-19 Akim Demaille <akim@epita.fr>
20380
20381 Get rid of the ad hoc handling of token_buffer in the scanner: use
20382 the obstacks.
20383
20384 * src/lex.c (token_obstack): New.
20385 (init_lex): Initialize it. No longer call...
20386 (grow_token_buffer): this. Remove it.
20387 Adjust all the places which used it to use the obstack.
20388
203892001-01-19 Akim Demaille <akim@epita.fr>
20390
20391 * src/lex.h: Rename all the tokens:
20392 s/\bENDFILE\b/tok_eof/g;
20393 s/\bIDENTIFIER\b/tok_identifier/g;
20394 etc.
20395 Let them be enums, not #define, to ease debugging.
20396 Adjust all the code.
20397
203982001-01-18 Akim Demaille <akim@epita.fr>
20399
20400 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
20401 * src/lex.c (maxtoken, grow_token_buffer): Static.
20402
204032001-01-18 Akim Demaille <akim@epita.fr>
20404
20405 Since we now use obstacks, more % directives can be enabled.
20406
20407 * src/lex.c (percent_table): Also accept `%yacc',
20408 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
20409 `%debug'.
20410 Handle the actions for `%semantic_parser' and `%pure_parser' here,
20411 instead of returning a token.
20412 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
20413 * src/reader.c (read_declarations): Adjust.
20414 * src/files.c (open_files): Don't call `compute_base_names', don't
20415 compute `attrsfile' since they depend upon data which might be
20416 *in* the input file now.
20417 (output_files): Do it here.
20418 * src/output.c (output_headers): Document the fact that this patch
20419 introduces a guaranteed SEGV for semantic parsers.
20420 * doc/bison.texinfo: Document them.
20421 * tests/suite.at: Exercise these %options.
20422
204232000-12-20 Akim Demaille <akim@epita.fr>
20424
20425 Also handle the output file (--verbose) with obstacks.
20426
20427 * files.c (foutput): Remove.
20428 (output_obstack): New.
20429 Adjust all dependencies.
20430 * src/conflicts.c: Return a string.
20431 * src/system.h (obstack_grow_string): Rename as...
20432 (obstack_sgrow): this. Be ready to work with non literals.
20433 (obstack_fgrow4): New.
20434
204352000-12-20 Akim Demaille <akim@epita.fr>
20436
20437 * src/files.c (open_files): Fix the computation of short_base_name
20438 in the case of `-o foo.tab.c'.
20439
204402000-12-20 Akim Demaille <akim@epita.fr>
20441
20442 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
20443 (copy_dollar): Now that everything uses obstacks, get rid of the
20444 FILE * parameters.
20445
204462000-12-20 Akim Demaille <akim@epita.fr>
20447
20448 * src/files.c (open_files): Actually the `.output' file is based
20449 on the short_base_name, not base_name.
20450 * tests/suite.at (Checking output file names): Adjust.
20451
204522000-12-20 Akim Demaille <akim@epita.fr>
20453
20454 * src/bison.s1: Remove, we now use directly...
20455 * src/bison.simple: this.
20456 * src/Makefile.am: Use pkgdata instead of data.
20457
204582000-12-20 Akim Demaille <akim@epita.fr>
20459
20460 * src/files.c (guard_obstack): New.
20461 (open_files): Initialize it.
20462 (output_files): Dump it...
20463 * src/files.h: Export it.
20464 * src/reader.c (copy_guard): Use it.
20465
204662000-12-19 Akim Demaille <akim@epita.fr>
20467
20468 * src/files.c (outfile, defsfile, actfile): Removed as global
20469 vars.
20470 (open_files): Don't compute them.
20471 (output_files): Adjust.
20472 (base_name, short_base_name): Be global.
20473 Adjust dependencies.
20474
204752000-12-19 Akim Demaille <akim@epita.fr>
20476
20477 * src/files.c (strsuffix): New.
20478 (stringappend): Be just like strcat but allocate.
20479 (base_names): Eve out from open_files.
20480 Try to simplify the rather hairy computation of base_name and
20481 short_base_name.
20482 (open_files): Use it.
20483 * tests/suite.at (Checking output file names): New test.
20484
204852000-12-19 Akim Demaille <akim@epita.fr>
20486
20487 * src/system.h (obstack_grow_literal_string): Rename as...
20488 (obstack_grow_string): this.
20489 * src/output.c (output_parser): Recognize `%% actions' instead of
20490 `$'.
20491 * src/bison.s1: s/$/%% actions/.
20492 * src/bison.hairy: Likewise.
20493
204942000-12-19 Akim Demaille <akim@epita.fr>
20495
20496 * src/output.c (output_parser): Compute the `#line' lines when
20497 there are.
20498 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
20499 Suggested by Hans Aberg.
20500
205012000-12-19 Akim Demaille <akim@epita.fr>
20502
20503 Let the handling of the skeleton files be local to the procedures
20504 that use it.
20505
20506 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
20507 longer static.
20508 (fparser, open_extra_files): Remove.
20509 (open_files, output_files): Don't take care of fparser.
20510 * src/files.h: Adjust.
20511 * src/output.c (output_parser): Open and close the file to the
20512 skeleton.
20513 * src/reader.c (read_declarations): When %semantic_parser, open
20514 fguard.
20515
205162000-12-19 Akim Demaille <akim@epita.fr>
20517
20518 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
20519 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
20520
205212000-12-19 Akim Demaille <akim@epita.fr>
20522
20523 * src/files.c (open_files): Yipee! We no longer need all the code
20524 looking for `/tmp' since we have no tmp file.
20525
205262000-12-19 Akim Demaille <akim@epita.fr>
20527
20528 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
20529 New macros.
20530 * src/files.c (open_files): Less dependency on MSDOS etc.
20531
205322000-12-14 Akim Demaille <akim@epita.fr>
20533
20534 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
20535 Provide a default definition.
20536 Use it when executing the default @ action.
20537 * src/reader.c (reader_output_yylsp): No longer include
20538 `timestamp' and `text' in the default YYLTYPE.
20539
205402000-12-12 Akim Demaille <akim@epita.fr>
20541
20542 * src/reader.c (copy_definition, parse_union_decl, copy_action)
20543 (copy_guard): Quote the file names.
20544 Reported by Laurent Mascherpa.
20545
205462000-12-12 Akim Demaille <akim@epita.fr>
20547
20548 * src/output.c (output_headers, output_program, output): Be sure
20549 to escape special characters when outputting filenames.
20550 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
20551 (output_headers): Don't depend on them, Use ACTSTR.
20552
205532000-11-17 Akim Demaille <akim@epita.fr>
20554
20555 * lib/obstack.h: Formatting changes.
20556 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
20557 prevents type checking.
20558 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
20559 cast the value to (void *): assigning a `foo *' to a `void *'
20560 variable is valid.
20561 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
20562 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
20563 append characters.
20564
205652000-11-17 Akim Demaille <akim@epita.fr>
20566
20567 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
20568 as...
20569 (suite.m4, regression.m4, calc.m4): these.
20570 * tests/atgeneral.m4: Update from CVS Autoconf.
20571
205722000-11-17 Akim Demaille <akim@epita.fr>
20573
20574 * tests/regression.m4 (%union and --defines): New test,
20575 demonstrating a current bug in the obstack implementation.
20576
205772000-11-17 Akim Demaille <akim@epita.fr>
20578
20579 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
20580 macros.
20581 Use them to declare the variables which are global or local to
20582 `yyparse'.
20583
205842000-11-17 Akim Demaille <akim@epita.fr>
20585
20586 * acconfig.h: Remove, no longer used.
20587
205882000-11-07 Akim Demaille <akim@epita.fr>
20589
20590 * src: s/Copyright (C)/Copyright/g.
20591
205922000-11-07 Akim Demaille <akim@epita.fr>
20593
20594 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
20595 defining.
20596 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
20597
205982000-11-07 Akim Demaille <akim@epita.fr>
20599
20600 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
20601 Merge in a single CPP if/else.
20602
206032000-11-07 Akim Demaille <akim@epita.fr>
20604
20605 * src/output.c (output): Remove useless variables.
20606 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
20607 argument `data' for consistency with the prototypes.
20608 Qualify it `const'.
20609 (obstack_copy, obstack_copy0): Rename the second argument as
20610 `address' for consistency. Qualify it `const'.
20611 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
20612 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
20613 `const' their input argument (`data' or `address').
20614 Adjust the corresponding macros to include `const' in casts.
20615
206162000-11-03 Akim Demaille <akim@epita.fr>
20617
20618 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
20619 s/PFILE1/BISON_HAIRY/.
20620 Adjust dependencies.
20621
206222000-11-03 Akim Demaille <akim@epita.fr>
20623
20624 For some reason, this was not applied.
20625
20626 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20627 `unlink': it's no longer used.
20628
206292000-11-03 Akim Demaille <akim@epita.fr>
20630
20631 * src/files.c (skeleton_find): New function, eved out of...
20632 (open_files, open_extra_files): here.
20633
206342000-11-03 Akim Demaille <akim@epita.fr>
20635
20636 Don't use `atexit'.
20637
20638 * src/files.c (obstack_save): New function.
20639 (done): Rename as...
20640 (output_files): this.
20641 Use `obstack_save'.
20642 * src/main.c (main): Don't use `atexit' to register `done', since
20643 it no longer has to remove tmp files, just call `output_files'
20644 when there are no errors.
20645
206462000-11-02 Akim Demaille <akim@epita.fr>
20647
20648 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20649 `unlink': it's no longer used.
20650 * src/files.h: Formatting changes.
20651
206522000-11-02 Akim Demaille <akim@epita.fr>
20653
20654 Remove the last uses of mktemp and unlink/delete.
20655
20656 * src/files.c (fdefines, ftable): Removed.
20657 (defines_ostack, table_obstack): New.
20658 Adjust dependencies of the former into uses of the latter.
20659 * src/output.c (output_short_or_char_table, output_short_table):
20660 Convert to using obstacks.
20661 * src/reader.c (copy_comment2): Accept one FILE * and two
20662 obstacks.
20663 (output_token_defines, reader_output_yylsp): Use obstacks.
20664 * src/system.h (obstack_fgrow3): New.
20665 * po/POTFILES.in: Adjust.
20666
206672000-11-01 Akim Demaille <akim@epita.fr>
20668
20669 Change each use of `fattrs' into a use of `attrs_obstack'.
20670
20671 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
20672 * src/files.c (fattrs): Remove.
20673 (attrs_obstack): New.
20674 Adjust all dependencies.
20675 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
20676
206772000-11-01 Akim Demaille <akim@epita.fr>
20678
20679 Introduce obstacks.
20680 Change each use of `faction' into a use of `action_obstack'.
20681
20682 * lib/obstack.h, lib/obstack.c: New files.
20683 * src/files.c (faction): Remove.
20684 (action_obstack): New.
20685 Adjust all dependencies.
20686
206872000-10-20 Akim Demaille <akim@epita.fr>
20688
20689 * lib/quote.h (PARAMS): New macro. Use it.
20690
206912000-10-16 Akim Demaille <akim@epita.fr>
20692
20693 * src/output.c (output_short_or_char_table): New function.
20694 (output_short_table, output_token_translations): Use it.
20695 (goto_actions): Use output_short_table.
20696
206972000-10-16 Akim Demaille <akim@epita.fr>
20698
20699 * src/symtab.c (bucket_new): New function.
20700 (getsym): Use it.
20701
20702 * src/output.c (output_short_table): New argument to display the
20703 comment associated with the table.
20704 Adjust dependencies.
20705 (output_gram): Use it.
20706 (output_rule_data): Nicer output layout for YYTNAME.
20707
207082000-10-16 Akim Demaille <akim@epita.fr>
20709
20710 * src/lex.c (read_typename): New function.
20711 (lex): Use it.
20712 * src/reader.c (copy_dollar): Likewise.
20713
207142000-10-16 Akim Demaille <akim@epita.fr>
20715
20716 * src/reader.c (copy_comment2): Expect the input stream to be on
20717 the `/' which is suspected to open a comment, instead of being
20718 called after `//' or `/*' was read.
20719 (copy_comment, copy_definition, parse_union_decl, copy_action)
20720 (copy_guard): Adjust.
20721
207222000-10-16 Akim Demaille <akim@epita.fr>
20723
20724 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
20725 `read_signed_integer'.
20726
207272000-10-16 Akim Demaille <akim@epita.fr>
20728
20729 * src/reader.c (copy_dollar): New function.
20730 (copy_guard, copy_action): Use it.
20731
207322000-10-16 Akim Demaille <akim@epita.fr>
20733
20734 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
20735 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
20736 New files, from Fileutils 4.0.27.
20737 * src/main.c (printable_version): Remove.
20738 * src/lex.c, src/reader.c: Use `quote'.
20739
207402000-10-04 Akim Demaille <akim@epita.fr>
20741
20742 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
20743
207442000-10-04 Akim Demaille <akim@epita.fr>
20745
20746 * doc/bison.texinfo: Various typos spotted by Neil Booth.
20747
207482000-10-04 Akim Demaille <akim@epita.fr>
20749
20750 When a literal string is used to define two different tokens,
20751 `bison -v' segfaults.
20752 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
20753
20754 * tests/regression.m4: New file.
20755 Include the core of the sample provided by Piotr Gackiewicz.
20756 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
20757 properly.
20758
207592000-10-04 Akim Demaille <akim@epita.fr>
20760
20761 * src/reader.c (parse_expect_decl): Keep `count' within the size
20762 of `buffer'.
20763 From Neil Booth.
20764
207652000-10-02 Paul Eggert <eggert@twinsun.com>
20766
20767 * bison.s1 (yyparse): Assign the default value
20768 unconditionally, to avoid a GCC warning and make the parser a
20769 tad smaller.
20770
207712000-10-02 Akim Demaille <akim@epita.fr>
20772
20773 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
20774 options.
20775
207762000-10-02 Akim Demaille <akim@epita.fr>
20777
20778 * src/derives.c, src/print.c, src/reduce.c: To ease the
20779 translation, move some `\n' out of the translated strings.
20780
207812000-10-02 Akim Demaille <akim@epita.fr>
20782
20783 The location tracking mechanism is precious for parse error
20784 messages. Nevertheless, it is enabled only when `@n' is used in
20785 the grammar, which is a different issue (you can use it in error
20786 message, but not in the grammar per se). Therefore, there should
20787 be another means to enable it.
20788
20789 * src/getargs.c (getargs): Support `--locations'.
20790 (usage): Report it.
20791 * src/getargs.h (locationsflag): Export it.
20792 * src/lex.c (percent_table): Support `%locations'.
20793 * src/reader.c (yylsp_needed): Remove this variable, now replaced
20794 with `locationsflag'.
20795 * doc/bison.texinfo: Document `--locations' and `%locations'.
20796 Sort the options.
20797 * tests/calc.m4: Test it.
20798
20799 For regularity of the names, replace each
20800 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
20801 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
20802 In addition replace each `flag' with `_flag'.
20803
208042000-10-02 Akim Demaille <akim@epita.fr>
20805
20806 Also test parse error messages, including with YYERROR_VERBOSE.
20807
20808 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
20809 associative).
20810 Use it to check the computations.
20811 Use it to check `nonassoc' is honored.
20812 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
20813 `--yyerror-verbose'.
20814 (_AT_CHECK_CALC): Adjust to this option.
20815 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
20816
208172000-10-02 Akim Demaille <akim@epita.fr>
20818
20819 Test also `--verbose', `--defines' and `--name-prefix'. Testing
20820 the latter demonstrates a flaw in the handling of non debugging
20821 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
20822 was used in order to simplify:
20823
20824 #if YYDEBUG
20825 if (yydebug)
20826 {
20827 ...
20828 }
20829 #endif
20830
20831 into
20832
20833 if (yydebug)
20834 {
20835 ...
20836 }
20837
20838 unfortunately this leads to a CPP conflict when
20839 `--name-prefix=foo' is used since it produces `#define yydebug
20840 foodebug'.
20841
20842 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
20843 (YYDPRINTF): New macro.
20844 Spread its use.
20845 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
20846 the bison options.
20847 Also test `--verbose', `--defines' and `--name-prefix'.
20848
208492000-10-02 Akim Demaille <akim@epita.fr>
20850
20851 Improve the readability of the produced parsers.
20852
20853 * src/bison.s1: Formatting changes.
20854 Improve the comment related to the `$' mark.
20855 (yydefault): Don't fall through to `yyresume': `goto' there.
20856 * src/output.c (output_parser): When the `$' is met, skip the end
20857 of its line.
20858 New variable, `number_of_dollar_signs', to check there's exactly
20859 one `$' in the parser skeleton.
20860
208612000-10-02 Akim Demaille <akim@epita.fr>
20862
20863 * lib/xstrdup.c: New file, from the fileutils.
20864 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
20865 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
20866 instead of strlen + xmalloc + strcpy.
20867 * src/symtab.c (copys): Remove, use xstrdup instead.
20868
208692000-10-02 Akim Demaille <akim@epita.fr>
20870
20871 * src/gram.h (associativity): New enum type which replaces the
20872 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
20873 `right_assoc', `left_assoc' and `non_assoc'.
20874 Adjust all dependencies.
20875 * src/reader.c: Formatting changes.
20876 (LTYPESTR): Don't define it, use it as a literal in
20877 `reader_output_yylsp'.
20878 * src/symtab.h (symbol_class): New enum type which replaces the
20879 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
20880 `sunknown', `stoken and `snterm'.
20881
208822000-10-02 Akim Demaille <akim@epita.fr>
20883
20884 * src/getargs.c (fixed_outfiles): Rename as...
20885 (yaccflag): for consistency and accuracy.
20886 Adjust dependencies.
20887
208882000-10-02 Akim Demaille <akim@epita.fr>
20889
20890 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
20891 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
20892 difficult and introduced a lot of core dump. It turns out that
20893 Bison used an implementation of `xmalloc' based on `calloc', and
20894 at various places it does depend upon the initialization to 0. I
20895 have not tried to isolate the pertinent places, and all the former
20896 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
20897 someone should address this issue.
20898
20899 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
20900 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
20901 files.
20902 Adjust dependencies.
20903 * src/warshall.h: New file.
20904 Propagate.
20905
209062000-10-02 Akim Demaille <akim@epita.fr>
20907
20908 Various anti-`extern in *.c' changes.
20909
20910 * src/system.h: Include `assert.h'.
20911
209122000-10-02 Akim Demaille <akim@epita.fr>
20913
20914 * src/state.h (nstates, final_state, first_state, first_shift)
20915 (first_reduction): Move their exportation from here...
20916 * src/LR0.h: to here.
20917 Adjust dependencies.
20918 * src/getargs.c (statisticsflag): New variable.
20919 Add support for `--statistics'.
20920 Adjust dependencies.
20921
20922 Remove a lot of now useless `extern' statements in most files.
20923
209242000-10-02 Akim Demaille <akim@epita.fr>
20925
20926 * src/LR0.h: New file.
20927 Propagate its use.
20928
209292000-10-02 Akim Demaille <akim@epita.fr>
20930
20931 * src/print.h: New file.
20932 Propagate its use.
20933 * src/print.c: Formatting and ordering changes.
20934 (verbose, terse): Replace with...
20935 (print_results): this new function.
20936 Adjust dependencies.
20937
209382000-10-02 Akim Demaille <akim@epita.fr>
20939
20940 * src/conflicts.c (conflict_report): New function.
20941 (conflict_log, verbose_conflict_log): Replace with...
20942 (print_conflicts): this function.
20943 Adjust dependencies.
20944 * src/conflicts.h: New file.
20945 Propagate its inclusion.
20946
209472000-10-02 Akim Demaille <akim@epita.fr>
20948
20949 * src/nullable.h: New file.
20950 Propagate its inclusion.
20951 * src/nullable.c: Formatting changes.
20952
209532000-10-02 Akim Demaille <akim@epita.fr>
20954
20955 * src/reduce.h: New file.
20956 Propagate its inclusion.
20957 * src/reduce.c: Topological sort and other formatting changes.
20958 (bool, TRUE, FALSE): Move their definition to...
20959 * src/system.h: here.
20960
209612000-10-02 Akim Demaille <akim@epita.fr>
20962
20963 * src/files.c: Formatting changes.
20964 (tryopen, tryclose, openfiles): Rename as...
20965 (xfopen, xfclose, open_files): this.
20966 (stringappend): static.
20967 * src/files.h: Complete the list of exported symbols.
20968 Propagate its use.
20969
209702000-10-02 Akim Demaille <akim@epita.fr>
20971
20972 * src/reader.h: New file.
20973 Propagate its use instead of tedious list of `extern' and
20974 prototypes.
20975 * src/reader.c: Formatting changes, topological sort,
20976 s/register//.
20977
209782000-10-02 Akim Demaille <akim@epita.fr>
20979
20980 * src/lex.h: Prototype `lex.c' exported functions.
20981 * src/reader.c: Adjust.
20982 * src/lex.c: Formatting changes.
20983 (safegetc): Rename as...
20984 (xgetc): this.
20985
209862000-10-02 Akim Demaille <akim@epita.fr>
20987
20988 * src/lalr.h: New file.
20989 Propagate its inclusion instead of prototypes and `extern'.
20990 * src/lalr.c: Formatting changes, topological sorting etc.
20991
209922000-10-02 Akim Demaille <akim@epita.fr>
20993
20994 * src/output.c (token_actions): Introduce a temporary array,
20995 YYDEFACT, that makes it possible for this function to use
20996 output_short_table.
20997
209982000-10-02 Akim Demaille <akim@epita.fr>
20999
21000 `user_toknums' is output as a `short[]' in `output.c', while it is
21001 defined as a `int[]' in `reader.c'. For consistency with the
21002 other output tables, `user_toknums' is now defined as a table of
21003 shorts.
21004
21005 * src/reader.c (user_toknums): Be a short table instead of an int
21006 table.
21007 Adjust dependencies.
21008
21009 Factor the short table outputs.
21010
21011 * src/output.c (output_short_table): New function.
21012 * src/output.c (output_gram, output_stos, output_rule_data)
21013 (output_base, output_table, output_check): Use it.
21014
210152000-10-02 Akim Demaille <akim@epita.fr>
21016
21017 * src/output.c (output): Topological sort of the functions, in
21018 order to get rid of the `static' prototypes.
21019 No longer use `register'.
21020 * src/output.h: New file.
21021 Propagate its inclusion in files explicitly prototyping functions
21022 from output.c.
21023
210242000-09-21 Akim Demaille <akim@epita.fr>
21025
21026 * src/atgeneral.m4: Update from Autoconf.
21027
210282000-09-21 Akim Demaille <akim@epita.fr>
21029
21030 * src/closure.h: New file.
21031 * src/closure.c: Formatting changes, topological sort over the
21032 functions, use of closure.h.
21033 (initialize_closure, finalize_closure): Rename as...
21034 (new_closure, free_closure): these. Adjust dependencies.
21035 * src/LR0.c: Formatting changes, topological sort, use of
21036 cloture.h.
21037 (initialize_states): Rename as...
21038 (new_states): this.
21039 * src/Makefile.am (noinst_HEADERS): Adjust.
21040
210412000-09-20 Akim Demaille <akim@epita.fr>
21042
21043 * src/acconfig.h: Don't protect config.h against multiple
21044 inclusion.
21045 Don't define PARAMS.
21046 * src/system.h: Define PARAMS.
21047 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
21048 purpose of config.h. system.h must not try to fix wrong
21049 definitions in config.h.
21050
210512000-09-20 Akim Demaille <akim@epita.fr>
21052
21053 * src/derives.h: New file.
21054 * src/main.c, src/derives.h: Use it.
21055 Formatting changes.
21056 * src/Makefile.am (noinst_HEADERS): Adjust.
21057
210582000-09-20 Akim Demaille <akim@epita.fr>
21059
21060 * tests/atgeneral.m4: Update from Autoconf.
21061 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
21062 (AT_CHECK_CALC): New macros.
21063 Use these macros to test bison with options `', `--raw',
21064 `--debug', `--yacc', `--yacc --debug'.
21065
210662000-09-19 Akim Demaille <akim@epita.fr>
21067
21068 * src/output.c: Formatting changes.
21069 * src/machine.h: Remove, leaving its contents in...
21070 * src/system.h: here.
21071 Include stdio.h.
21072 Adjust all dependencies on stdio.h and machine.h.
21073 * src/getargs.h: New file.
21074 Let all `extern' declarations about getargs.c be replaced with
21075 inclusion of `getargs.h'.
21076 * src/Makefile.am (noinst_HEADERS): Adjust.
21077
21078 * tests/calc.m4 (yyin): Be initialized in main, not on the global
21079 scope.
21080 (yyerror): Returns void, not int.
21081 * doc/bison.texinfo: Formatting changes.
21082
210832000-09-19 Akim Demaille <akim@epita.fr>
21084
21085 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
21086 portable.
21087
210882000-09-18 Akim Demaille <akim@epita.fr>
21089
21090 * configure.in: Append WARNING_CFLAGS to CFLAGS.
21091 * src/Makefile.am (INCLUDES): Don't.
21092 Be ready to fetch headers in lib/.
21093
210942000-09-18 Akim Demaille <akim@epita.fr>
21095
21096 * doc/bison.texinfo: Update the copyright.
21097 ANSIfy and GNUify the examples.
21098 Remove the old menu.
21099
211002000-09-18 Akim Demaille <akim@epita.fr>
21101
21102 First set of tests: use the `calc' example from the documentation.
21103
21104 * src/bison.s1 (yyparse): Condition the code using `yytname' which
21105 is defined only when YYDEBUG is.
21106 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
21107 * src/files.c (tryopen, tryclose): Formatting changes.
21108 Move to the top and be static.
21109 * src/reader.c (read_signed_integer): Likewise.
21110 * tests/calc.m4: New file.
21111 * Makefile.am, suite.m4: Adjust.
21112 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
21113
211142000-09-18 Akim Demaille <akim@epita.fr>
21115
21116 Add support for an Autotest test suite for Bison.
21117
21118 * m4/m4.m4, m4/atconfig.m4: New files.
21119 * m4/Makefile.am (EXTRA_DIST): Adjust.
21120 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
21121 files.
21122 * src/getargs.c: Display a more standard --version message.
21123 * src/reader.c (reader): Formatting changes.
21124 No longer depend upon VERSION_STRING.
21125 * configure.in: No longer use `dnl'.
21126 Set up the test suite and the new directory `tests/.
21127 (VERSION_STRING): Remove.
21128
211292000-04-14 Akim Demaille <akim@epita.fr>
21130
21131 * src/reader.c (copy_comment2): New function, same as former
21132 `copy_comment', but outputs into two FILE *.
21133 (copy_comment): Use it.
21134 (parse_union_decl): Use it.
21135 (get_type, parse_start_decl): Use the same `invalid' message.
21136 (parse_start_decl, parse_union_decl): Use the same `multiple'
21137 message.
21138 (parse_union_decl, copy_guard, copy_action): Use the same
21139 `unmatched' message.
21140 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
21141
211422000-03-31 Akim Demaille <akim@epita.fr>
21143
21144 * src/files.c (tryopen, tryclose): Move to the top.
21145 Be static.
21146
211472000-03-31 Akim Demaille <akim@epita.fr>
21148
21149 * src/main.c (main): Don't call `done', exit does it.
21150
211512000-03-31 Akim Demaille <akim@epita.fr>
21152
21153 * allocate.c: s/return (foo)/return foo/.
21154 * lalr.c: Likewise.
21155 * LR0.c: Likewise.
21156 * output.c: Likewise.
21157 * reader.c: Likewise.
21158 * symtab.c: Likewise.
21159 * vmsgetargs.c: Likewise.
21160
211612000-03-31 Akim Demaille <akim@epita.fr>
21162
21163 Clean up the error reporting functions.
21164
21165 * src/report.c: New file.
21166 * src/report.h: Likewise.
21167 * src/Makefile.am: Adjust.
21168 * m4/error.m4: New file.
21169 * m4/Makefile.am: Adjust.
21170 * configure.in (jm_PREREQ_ERROR): Call it.
21171 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
21172 Remove.
21173 (fatal, fatals): Remove. All callers use complain.c::fatal.
21174 (warn, warni, warns, warnss, warnss): Remove. All callers use
21175 complain.c::complain.
21176 (toomany): Remove, use fatal instead.
21177 * src/files.c (done): No argument, use complain_message_count.
21178 * src/main.c (main): Register `done' to `atexit'.
21179
21180 * src/getargs.c (usage): More `fputs', less `fprintf'.
21181
211822000-03-28 Akim Demaille <akim@epita.fr>
21183
21184 * lib/: New directory.
21185 * Makefile.am (SUBDIRS): Adjust.
21186 * configure.in: Adjust.
21187 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
21188 useless.
21189 * src/alloca.c: Moved to lib/.
21190 * src/getopt.c: Likewise.
21191 * src/getopt1.c: Likewise.
21192 * src/getopt.h: Likewise.
21193 * src/ansi2knr.c: Likewise.
21194 * src/ansi2knr.1: Likewise.
21195 * src/Makefile.am: Adjust.
21196 * lib/Makefile.am: New file.
21197
211982000-03-28 Akim Demaille <akim@epita.fr>
21199
21200 * src/getargs.c (usage): Refresh the help message.
21201
212022000-03-17 Akim Demaille <akim@epita.fr>
21203
21204 * src/getopt1.c: Updated from textutils 2.0e
21205 * src/getopt.c: Likewise.
21206 * src/getopt.h: Likewise.
21207
212082000-03-17 Akim Demaille <akim@epita.fr>
21209
21210 * src/Makefile.am (bison.simple): Fix the awk program: quote only
21211 the file name, not the whole `#line LINE FILE'.
21212
212132000-03-17 Akim Demaille <akim@epita.fr>
21214
21215 On syntax errors, report the token on which we choked.
21216
21217 * src/bison.s1 (yyparse): In the label yyerrlab, when
21218 YYERROR_VERBOSE, add yychar in msg.
21219
212202000-03-17 Akim Demaille <akim@epita.fr>
21221
21222 * src/reader.c (copy_at): New function.
21223 (copy_guard): Use it.
21224 (copy_action): Use it.
21225
212262000-03-17 Akim Demaille <akim@epita.fr>
21227
21228 Be kind to translators, save some useless translations.
21229
21230 * src/main.c (banner): New function.
21231 (fatal_banner): Use it.
21232 (warn_banner): Use it.
21233
212342000-03-17 Akim Demaille <akim@epita.fr>
21235
21236 * src/reader.c (copy_definition): Use copy_string and
21237 copy_comment. Removed now unused `match', `ended',
21238 `cplus_comment'.
21239 (copy_comment, copy_string): Moved, to be visible from
21240 copy_definition.
21241
212422000-03-17 Akim Demaille <akim@epita.fr>
21243
21244 * src/reader.c (copy_string): Declare `static inline'. No
21245 problems with inline, since it is checked by configure.
21246 (copy_comment): Likewise.
21247
212482000-03-17 Akim Demaille <akim@epita.fr>
21249
21250 * src/reader.c (packsymbols): Formatting changes.
21251
212522000-03-17 Akim Demaille <akim@epita.fr>
21253
21254 * src/reader.c (copy_comment): New function, factored out from:
21255 (copy_action): Use it. Removed now unused `match', `ended',
21256 `cplus_comment'.
21257 (copy_guard): Likewise.
21258
212592000-03-17 Akim Demaille <akim@epita.fr>
21260
21261 * src/reader.c (copy_string): New function, factored out from:
21262 (copy_action): Use it.
21263 (copy_guard): Likewise.
21264
212652000-03-17 Akim Demaille <akim@epita.fr>
21266
21267 Change the handling of @s so that they behave exactly like $s.
21268 There is now a pseudo variable @$ (readble and writable), location
21269 of the lhs of the rule (by default ranging from the location of
21270 the first symbol of the rhs, to the location of the last symbol,
21271 or, if the rhs is empty, YYLLOC).
21272
21273 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
21274 yyval.
21275 (yyparse): When providing a default semantic action, provide a
21276 default location action.
21277 (after the $): No longer change `*YYLSP', just stack YYLOC the
21278 same way you stack YYVAL.
21279 * src/reader.c (read_declarations): Use warns.
21280 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
21281 (copy_action, case '@'): Likewise.
21282 Use a standard error message, to save useless work from
21283 translators.
21284
212852000-03-17 Akim Demaille <akim@epita.fr>
21286
21287 * src/bison.s1: Formatting and cosmetics changes.
21288 * src/reader.c: Likewise.
21289 Update the Copyright notice.
21290
212912000-03-17 Akim Demaille <akim@epita.fr>
21292
21293 * src/bison.s1 (#line): All set to `#line' only, since the
21294 Makefile now handles them.
21295
212962000-03-16 Akim Demaille <akim@epita.fr>
21297
21298 * src/output.c (output_rule_data): Output the documentation of
21299 some of the tables.
21300 (Copyright notice): Update.
21301 Formatting changes.
21302
213032000-03-16 Akim Demaille <akim@epita.fr>
21304
21305 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
21306 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
21307 One `#if YYDEBUG' remains, since it uses variables which are
21308 defined only if `YYDEBUG != 0'.
21309
213102000-03-16 Akim Demaille <akim@epita.fr>
21311
21312 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
21313 and related variables so that the similarities are highlighted.
21314
213152000-03-16 Akim Demaille <akim@epita.fr>
21316
21317 * src/bison.s1: Properly indent CPP directives.
21318
213192000-03-16 Akim Demaille <akim@epita.fr>
21320
21321 * src/bison.s1: Properly indent the `alloca' CPP section.
21322
213232000-03-16 Akim Demaille <akim@epita.fr>
21324
21325 Do not hard code values of directories in `configure.in'.
21326 Update the `configure' tool chain.
21327
21328 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
21329 src/makefile.am.
21330 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
21331 (AC_OUTPUT): Add m4/Makefile.
21332 Bump to bison 1.28a, 1.29 has never been released.
21333 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
21334 handled via src/Makefile.am.
21335 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
21336 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
21337 autoheader.
21338 * Makefile.am (SUBDIRS): Add m4.
21339 (ACLOCAL_AM_FLAGS): New variable.
21340 (AUTOMAKE_OPTIONS): Add check-news.
21341 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
21342 the proper line number and file name.
21343 (DEFS): Propagate the location of bison library files and of the
21344 locale files.
21345 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
21346 builddir.
21347 * acinclude.m4: Remove, replaced by the directory m4.
21348 * m4/Makefile.am (EXTRA_DIST): New variable.
21349 * m4/gettext.m4: New file, from the fileutils.
21350 * m4/lcmessage.m4: Likewise
21351 * m4/progtest.m4: Likewise.
21352 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
21353
213542000-03-10 Akim Demaille <akim@epita.fr>
21355
21356 * src/closure.c:
21357 Formatting changes of various comments.
21358 Respect the GNU coding standards at various places.
21359 Don't use `_()' when no translation is needed.
21360
213611999-12-13 Jesse Thilo <jthilo@gnu.org>
21362
21363 * src/files.c:
21364 OS/2 honors TMPDIR environment variable.
21365
213661999-12-13 Jesse Thilo <jthilo@gnu.org>
21367
21368 * doc/bison.texinfo: Tweaked spelling and grammar.
21369 Updated ISBN.
21370 Removed reference to price of printed copy.
21371 Mention BISON_SIMPLE and BISON_HAIRY.
21372
213731999-12-13 Jesse Thilo <jthilo@gnu.org>
21374
21375 * configure.in, NEWS:
21376 Bison 1.29 released.
21377
213781999-10-27 Jesse Thilo <jthilo@gnu.org>
21379
21380 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
21381 Added reference card.
21382
213831999-07-26 Jesse Thilo <jthilo@gnu.org>
21384
21385 * po/ru.po: Added Russian translation.
21386
213871999-07-26 Jesse Thilo <jthilo@gnu.org>
21388
21389 * configure.in: Added Russian translation.
21390
213911999-07-06 Jesse Thilo <jthilo@gnu.org>
21392
21393 * configure.in, NEWS, README:
21394 Released version 1.28.
21395
213961999-06-14 Jesse Thilo <jthilo@gnu.org>
21397
21398 * src/system.h:
21399 Squashed redefinition warning on some systems.
21400
21401 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
21402 Have configure build version string instead of relying on ANSI string
21403 concatentation.
21404
214051999-06-14 Jesse Thilo <jthilo@gnu.org>
21406
21407 * po/POTFILES.in: Got rid of version.c.
21408
214091999-06-14 Jesse Thilo <jthilo@gnu.org>
21410
21411 * acconfig.h, configure.in:
21412 Have configure build version string instead of relying on ANSI string
21413 concatentation.
21414
214151999-06-08 Jesse Thilo <jthilo@gnu.org>
21416
21417 * doc/bison.1:
21418 Dropped mention of `+' for long-named options.
21419
214201999-05-30 Jesse Thilo <jthilo@gnu.org>
21421
21422 * src/files.c: Added <unistd.h> for unlink().
21423
21424 * src/Makefile.am, src/system.h:
21425 I18n fixes.
21426
214271999-05-30 Jesse Thilo <jthilo@gnu.org>
21428
21429 * README: Added a FAQ list.
21430
21431 * configure.in, acconfig.h:
21432 I18n fixes.
21433
214341999-05-30 Jesse Thilo <jthilo@gnu.org>
21435
21436 * doc/FAQ, doc/Makefile.am:
21437 Added a FAQ list.
21438
214391999-05-19 Jesse Thilo <jthilo@gnu.org>
21440
21441 * src/alloc.h, src/symtab.h, src/version.c:
21442 Protected inclusion of "config.h" with HAVE_CONFIG_H.
21443
214441999-04-18 Jesse Thilo <jthilo@gnu.org>
21445
21446 * src/.cvsignore, src/Makefile.am:
21447 Reorganized: sources in `src', documentation in `doc'.
21448
21449 * src/lex.c (literalchar):
21450 fixed the code for escaping double quotes (thanks
21451 Jonathan Czisny.)
21452
214531999-04-18 Jesse Thilo <jthilo@gnu.org>
21454
21455 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
21456 Adjusted paths to reflect directory reorganization.
21457
214581999-04-18 Jesse Thilo <jthilo@gnu.org>
21459
21460 * doc/.cvsignore, doc/Makefile.am:
21461 Reorganized: sources in `src', documentation in `doc'.
21462
214631999-04-18 Jesse Thilo <jthilo@gnu.org>
21464
21465 * configure.in:
21466 Updated AC_INIT file to reflect directory reorganization.
21467
21468 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
21469 Reorganized: sources in `src', documentation in `doc'.
21470
214711999-04-13 Jesse Thilo <jthilo@gnu.org>
21472
21473 * src/allocate.c:
21474 Don't declare calloc() and realloc() if not necessary.
21475
214761999-04-13 Jesse Thilo <jthilo@gnu.org>
21477
21478 * configure.in, acconfig.h, acinclude.m4:
21479 Don't declare calloc() and realloc() if not necessary.
21480
214811999-03-23 Jesse Thilo <jthilo@gnu.org>
21482
21483 * po/.cvsignore: Added i18n support.
21484
214851999-03-23 Jesse Thilo <jthilo@gnu.org>
21486
21487 * acconfig.h, configure.in, Makefile.am:
21488 Added i18n support.
21489
214901999-03-22 Jesse Thilo <jthilo@gnu.org>
21491
21492 * src/bison.s1: Fixed #line numbers.
21493
214941999-03-15 Jesse Thilo <jthilo@gnu.org>
21495
21496 * po/es.po, po/fr.po, po/nl.po, po/de.po:
21497 Added PO files from Translation Project.
21498
214991999-03-03 Jesse Thilo <jthilo@gnu.org>
21500
21501 * Makefile.am:
21502 Added support for non-ANSI compilers (ansi2knr).
21503
215041999-02-16 Jesse Thilo <jthilo@gnu.org>
21505
21506 * configure.in: Bumped version number to 1.27.
21507
21508 * Makefile.am:
21509 Added `bison.simple' to list of files removed by `make distclean'.
21510
215111999-02-12 Jesse Thilo <jthilo@gnu.org>
21512
21513 * src/files.c, src/files.h:
21514 Defined locations of parser files in config.h instead of Makefile.
21515
215161999-02-12 Jesse Thilo <jthilo@gnu.org>
21517
21518 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
21519 Defined locations of parser files in config.h instead of Makefile.
21520
215211999-02-09 Jesse Thilo <jthilo@gnu.org>
21522
21523 * Makefile.am:
21524 Removed inappropriate use of $< macro.
21525
215261999-02-05 Jesse Thilo <jthilo@gnu.org>
21527
21528 * po/Makefile.in.in, po/POTFILES.in:
21529 Add `po' directory skeleton.
21530
215311999-01-27 Jesse Thilo <jthilo@gnu.org>
21532
21533 * README: Document help-bison list.
21534
21535 * configure.in: Add check for mkstemp().
21536
215371999-01-20 Jesse Thilo <jthilo@gnu.org>
21538
21539 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
21540 Hush a few compiler warnings.
21541
21542 * src/files.c:
21543 Add tryclose(), which verifies that fclose was successful.
21544 Hush a couple of compiler warnings.
21545
215461999-01-20 Jesse Thilo <jthilo@gnu.org>
21547
21548 * Makefile.am, OChangeLog:
21549 ChangeLog is now automatically generated. Include the old version as
21550 OChangeLog.
21551
215521999-01-14 Jesse Thilo <jthilo@gnu.org>
21553
21554 * 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:
21555 Update FSF address.
21556
215571999-01-14 Jesse Thilo <jthilo@gnu.org>
21558
21559 * doc/bison.texinfo: Fix formatting glitch.
21560
21561 * doc/bison.texinfo: Update FSF address.
21562
215631999-01-14 Jesse Thilo <jthilo@gnu.org>
21564
21565 * acconfig.h: Update FSF address.
21566
215671999-01-08 Jesse Thilo <jthilo@gnu.org>
21568
21569 * src/system.h:
21570 Don't define PACKAGE here, since config.h defines it.
21571
215721998-12-30 Jesse Thilo <jthilo@gnu.org>
21573
21574 * src/reader.c: Update copyright date.
21575
21576 * src/main.c:
21577 Ditch sprintf to statically-sized buffers in fatal/warn functions in
21578 favor of output directly to stderr (avoids buffer overruns).
21579
21580 * src/reader.c: Some checks for premature EOF.
21581
21582 * 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:
21583 Use prototypes if the compiler understands them.
21584
21585 * src/files.c: Honor TMPDIR on Unix hosts.
21586 Use prototypes if the compiler understands them.
21587
21588 * src/reader.c:
21589 Fix a couple of buffer overrun bugs.
21590 Use prototypes if the compiler understands them.
21591
21592 * src/system.h: Include unistd.h and ctype.h.
21593 Use #ifdef instead of #if for NLS symbols.
21594
215951998-12-30 Jesse Thilo <jthilo@gnu.org>
21596
21597 * doc/bison.texinfo:
21598 Delete comment "consider using @set for edition number, etc..." since
21599 we now are doing so.
21600
216011998-12-30 Jesse Thilo <jthilo@gnu.org>
21602
21603 * configure.in:
21604 Use prototypes if the compiler understands them.
21605
21606 * NEWS: Document 1.26 highlights.
21607
21608 * Makefile.am: Require Automake 1.3 or later.
21609
21610 * acconfig.h:
21611 Use prototypes if the compiler understands them.
21612
216131998-12-29 Jesse Thilo <jthilo@gnu.org>
21614
21615 * src/version.c:
21616 Use VERSION symbol from automake for version number.
21617
216181998-12-29 Jesse Thilo <jthilo@gnu.org>
21619
21620 * acconfig.h, configure.in, version.cin:
21621 Use VERSION symbol from automake for version number.
21622
216231998-11-28 Jesse Thilo <jthilo@gnu.org>
21624
21625 * Makefile.am:
21626 Distribute original version of simple parser (bison.s1), not built
21627 version (bison.simple).
21628
216291998-11-28 Jesse Thilo <jthilo@gnu.org>
21630
21631 * doc/bison.texinfo: Add info dir entry.
21632
21633 * doc/bison.texinfo:
21634 Let automake put version number into documentation.
21635
216361998-11-26 Jesse Thilo <jthilo@gnu.org>
21637
21638 * src/bison.cld, src/build.com, src/vmshlp.mar:
21639 Add non-RCS files from /gd/gnu/bison.
21640
216411998-11-26 Jesse Thilo <jthilo@gnu.org>
21642
21643 * doc/bison.1:
21644 Document the BISON_HAIRY and BISON_SIMPLE variables.
21645
216461998-11-25 Jesse Thilo <jthilo@gnu.org>
21647
21648 * src/version.c: Build version.c automatically.
21649
21650 * src/reader.c:
21651 Fix token numbering (used to start at 258, not 257).
21652
21653 * src/system.h: Include config.h.
21654
21655 * src/getargs.c: Update bug report address.
21656
21657 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
21658 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
21659
216601998-11-25 Jesse Thilo <jthilo@gnu.org>
21661
21662 * Makefile.am:
21663 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21664
21665 * configure.in, version.cin:
21666 Build version.c automatically.
21667
21668 * AUTHORS: Add AUTHORS file.
21669
21670 * README: Update bug report address.
21671
21672 * bison.simple:
21673 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21674
21675 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
21676 Add automake stuff.
21677
216781998-11-25 Jesse Thilo <jthilo@gnu.org>
21679
21680 * doc/bison.texinfo: Clean up some formatting.
21681
216821998-05-05 Richard Stallman <rms@gnu.org>
21683
21684 * doc/bison.texinfo:
21685 Explain better why to make a pure parser.
21686
216871998-01-05 Richard Stallman <rms@gnu.org>
21688
21689 * src/files.c (openfiles):
21690 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
21691 find a temporary directory, if possible. Do not unlink files while
21692 they are open.
21693
216941997-08-25 Richard Stallman <rms@gnu.org>
21695
21696 * src/reader.c (stack_offset;):
21697 Change some warni to warns.
21698
21699 * src/lex.c (literalchar): Use warns, not warni.
21700
217011997-06-28 Richard Stallman <rms@gnu.org>
21702
21703 * src/bison.s1: Add a Bison version comment.
21704
21705 * src/main.c (fatal, warn, berror):
21706 Use program_name.
21707
217081997-06-28 Richard Stallman <rms@gnu.org>
21709
21710 * Makefile.in (bison_version): New variable.
21711 (dist): Use that variable.
21712 (bison.s1): Substitute the Bison version into bison.simple.
21713
21714 * bison.simple: Add a Bison version comment.
21715
217161997-06-18 Richard Stallman <rms@gnu.org>
21717
21718 * src/main.c (fatal, warn, berror):
21719 Make error messages standard.
21720 (toomany): Improve error message text.
21721
21722 * 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:
21723 new.h renamed to alloc.h.
21724
217251997-06-18 Richard Stallman <rms@gnu.org>
21726
21727 * Makefile.in: new.h renamed to alloc.h.
21728
217291997-05-24 Richard Stallman <rms@gnu.org>
21730
21731 * src/lex.c (literalchar):
21732 Fix the code for escaping \, " and '.
21733
21734 (lex): Avoid trouble when there are many chars
21735 to discard in a char literal with just several chars in it.
21736
217371997-05-17 Richard Stallman <rms@gnu.org>
21738
21739 * src/bison.s1:
21740 Use malloc, if using alloca is troublesome.
21741 (YYSTACK_USE_ALLOCA): New flag macro.
21742 Define it for some systems and compilers.
21743 (YYSTACK_ALLOC): New macro.
21744 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21745 If it was malloc'd, free it.
21746
217471997-05-17 Richard Stallman <rms@gnu.org>
21748
21749 * bison.simple:
21750 Use malloc, if using alloca is troublesome.
21751 (YYSTACK_USE_ALLOCA): New flag macro.
21752 Define it for some systems and compilers.
21753 (YYSTACK_ALLOC): New macro.
21754 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21755 If it was malloc'd, free it.
21756
217571997-04-23 Richard Stallman <rms@gnu.org>
21758
21759 * src/bison.s1:
21760 (alloca) [__hpux]: Always define as __builtin_alloca.
21761
217621997-04-23 Richard Stallman <rms@gnu.org>
21763
21764 * bison.simple:
21765 (alloca) [__hpux]: Always define as __builtin_alloca.
21766
217671997-04-22 Richard Stallman <rms@gnu.org>
21768
21769 * src/bison.s1:
21770 [__hpux]: Include alloca.h (right for HPUX 10)
21771 instead of declaring alloca (right for HPUX 9).
21772
21773 * src/bison.s1 (__yy_memcpy):
21774 Declare arg `count' as unsigned int.
21775 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21776
217771997-04-22 Richard Stallman <rms@gnu.org>
21778
21779 * bison.simple:
21780 [__hpux]: Include alloca.h (right for HPUX 10)
21781 instead of declaring alloca (right for HPUX 9).
21782
21783 * bison.simple (__yy_memcpy):
21784 Declare arg `count' as unsigned int.
21785 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21786
217871997-01-03 Richard Stallman <rms@gnu.org>
21788
21789 * src/allocate.c: [__STDC__ or _MSC_VER]:
21790 Declare calloc and realloc to return void *.
21791
217921997-01-02 Richard Stallman <rms@gnu.org>
21793
21794 * src/system.h:
21795 [_MSC_VER]: Include stdlib.h and process.h.
21796 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
21797
21798 * src/main.c (main): Return FAILURE as a value.
21799 (printable_version): Declare arg as int, not char.
21800
218011997-01-02 Richard Stallman <rms@gnu.org>
21802
21803 * Makefile.in (dist):
21804 Explicitly check for symlinks, and copy them.
21805
218061996-12-19 Richard Stallman <rms@gnu.org>
21807
21808 * src/files.c:
21809 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
21810
218111996-12-18 Paul Eggert <eggert@gnu.org>
21812
21813 * src/bison.s1 (yyparse):
21814 If __GNUC__ and YYPARSE_PARAM are both defined,
21815 declare yyparse to have a void * argument.
21816
218171996-12-18 Paul Eggert <eggert@gnu.org>
21818
21819 * bison.simple (yyparse):
21820 If __GNUC__ and YYPARSE_PARAM are both defined,
21821 declare yyparse to have a void * argument.
21822
218231996-12-17 Richard Stallman <rms@gnu.org>
21824
21825 * src/reduce.c (nbits): Add some casts.
21826
218271996-08-12 Richard Stallman <rms@gnu.org>
21828
21829 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
21830
218311996-08-12 Richard Stallman <rms@gnu.org>
21832
21833 * bison.simple: Test _MSDOS as well as _MSDOS_.
21834
218351996-07-31 Richard Stallman <rms@gnu.org>
21836
21837 * src/bison.s1:
21838 [__sun && __i386]: Include alloca.h.
21839
218401996-07-31 Richard Stallman <rms@gnu.org>
21841
21842 * bison.simple:
21843 [__sun && __i386]: Include alloca.h.
21844
218451996-07-30 Richard Stallman <rms@gnu.org>
21846
21847 * src/bison.s1: Comment change.
21848
21849 * src/bison.s1: Test _MSDOS_, not MSDOS.
21850
218511996-07-30 Richard Stallman <rms@gnu.org>
21852
21853 * bison.simple: Comment change.
21854
21855 * bison.simple: Test _MSDOS_, not MSDOS.
21856
218571996-06-01 Richard Stallman <rms@gnu.org>
21858
21859 * 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:
21860 Insert `_' macro around many string constants.
21861
21862 * src/main.c:
21863 Insert `_' macro around many string constants.
21864
21865 (main): Call setlocale, bindtextdomain and textdomain.
21866
21867 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
21868 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
21869 [ENABLE_NLS]: Include libintl.h.
21870 [ENABLE_NLS] (gettext): Define.
21871 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
21872 (N_, PACKAGE, LOCALEDIR): New macros.
21873
218741996-06-01 Richard Stallman <rms@gnu.org>
21875
21876 * POTFILES.in: New file.
21877
21878 * Makefile.in (allocate.o):
21879 Define target explicitly.
21880
21881 * Makefile.in (CFLAGS): Set to @CFLAGS@.
21882 (LDFLAGS): Set to @LDFLAGS@.
21883 (configure): Run autoconf only if preceding `cd' succeeds.
21884 (bison.s1): Redirect output to temporary file then move the
21885 temporary to the target, rather than redirecting directly to bison.s1.
21886 (clean): Remove config.status and config.log.
21887 (distclean): Don't remove config.status here.
21888
218891996-05-12 Richard Stallman <rms@gnu.org>
21890
21891 * src/bison.s1:
21892 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21893
218941996-05-12 Richard Stallman <rms@gnu.org>
21895
21896 * bison.simple:
21897 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21898
218991996-05-11 Richard Stallman <rms@gnu.org>
21900
21901 * src/bison.s1 (__yy_memcpy):
21902 Really reorder the args, as was supposedly done on Feb 14 1995.
21903 (yyparse): Calls changed accordingly.
21904
219051996-05-11 Richard Stallman <rms@gnu.org>
21906
21907 * Makefile.in (dist): Don't use $(srcdir).
21908
21909 * bison.simple (__yy_memcpy):
21910 Really reorder the args, as was supposedly done on Feb 14 1995.
21911 (yyparse): Calls changed accordingly.
21912
219131996-01-27 Richard Stallman <rms@gnu.org>
21914
21915 * src/output.c (output_rule_data):
21916 Test YYERROR_VERBOSE in the conditional
21917 around the definition of ttyname.
21918
219191995-12-29 Richard Stallman <rms@gnu.org>
21920
21921 * src/bison.s1:
21922 Fix line numbers in #line commands.
21923
219241995-12-29 Richard Stallman <rms@gnu.org>
21925
21926 * bison.simple:
21927 Fix line numbers in #line commands.
21928
219291995-12-27 Richard Stallman <rms@gnu.org>
21930
21931 * src/bison.s1 (YYPARSE_PARAM_DECL):
21932 In C++, make it always null.
21933 (YYPARSE_PARAM_ARG): New macro.
21934 (yyparse): Use YYPARSE_PARAM_ARG.
21935
219361995-12-27 Richard Stallman <rms@gnu.org>
21937
21938 * bison.simple (YYPARSE_PARAM_DECL):
21939 In C++, make it always null.
21940 (YYPARSE_PARAM_ARG): New macro.
21941 (yyparse): Use YYPARSE_PARAM_ARG.
21942
219431995-11-29 Richard Stallman <rms@gnu.org>
21944
21945 * doc/bison.texinfo:
21946 Describe literal string tokens, %raw, %no_lines, %token_table.
21947
219481995-11-29 Daniel Hagerty <hag@gnu.org>
21949
21950 * doc/bison.texinfo: Fixed update date
21951
219521995-10-16 Richard Stallman <rms@gnu.org>
21953
21954 * src/version.c: Version 1.25.
21955
219561995-10-16 Richard Stallman <rms@gnu.org>
21957
21958 * NEWS: *** empty log message ***
21959
219601995-10-16 Richard Stallman <rms@gnu.org>
21961
21962 * doc/bison.1, doc/bison.rnh:
21963 Add new options.
21964
219651995-10-15 Richard Stallman <rms@gnu.org>
21966
21967 * src/vmsgetargs.c, src/getargs.c:
21968 Added -n, -k, and -raw switches.
21969 (noparserflag, toknumflag, rawtoknumflag): New variables.
21970
21971 * src/symtab.h (SALIAS):
21972 New #define for adding aliases to %token.
21973 (struct bucket): Added `alias' field.
21974
21975 * src/reduce.c (reduce_grammar):
21976 Revise error message.
21977 (print_notices): Remove final `.' from error message.
21978
21979 * src/reader.c (reader_output_yylsp):
21980 New function.
21981 (readgram): Use `#if 0' around code that accepted %command
21982 inside grammar rules: The documentation doesn't allow it,
21983 and it will fail since the %command processors scan for the next %.
21984 (parse_token_decl): Extended the %token
21985 declaration to allow a multi-character symbol as an alias.
21986 (parse_thong_decl): New function.
21987 (read_declarations): Added %thong declarations.
21988 (read_declarations): Handle NOOP to deal with allowing
21989 % declarations as another means to specify the flags.
21990 (readgram): Allow %prec prior to semantics embedded in a rule.
21991 (skip_to_char, read_declarations, copy_definition)
21992 (parse_token_decl, parse_start_decl, parse_type_decl)
21993 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
21994 (get_type_name, copy_guard, copy_action, readgram)
21995 (get_type, packsymbols): Revised most error messages.
21996 Changed `fatal' to `warnxxx' to avoid aborting for error.
21997 Revised and use multiple warnxxx functions to avoid using VARARGS1.
21998 (read_declarations): Improve the error message for
21999 an invalid character. Do not abort.
22000 (read_declarations, copy_guard, copy_action): Use
22001 printable_version to avoid unprintable characters in printed output.
22002 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
22003 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
22004 Allow the type of a non-terminal can be given
22005 more than once, as long as all specifications give the same type.
22006
22007 * src/output.c:
22008 (output_headers, output_trailers, output, output_gram)
22009 (output_rule_data): Implement noparserflag variable.
22010 Implement toknumflag variable.
22011 (output): Call reader_output_yylsp to output LTYPESTR.
22012
22013 * src/main.c (main):
22014 If reader sees an error, don't process the grammar.
22015 (fatals): Updated to not use VARARGS1.
22016 (printable_version, int_to_string, warn, warni, warns, warnss)
22017 (warnsss): New error reporting functions. Avoid abort for error.
22018
22019 * src/lex.h:
22020 Added THONG and NOOP for alias processing.
22021 Added SETOPT for the new code that allows setting options with %flags.
22022
22023 * src/lex.c:
22024 Include getopt.h. Add some extern decls.
22025 (safegetc): New function to deal with EOF gracefully.
22026 (literalchar); new function to deal with reading \ escapes.
22027 (lex): Use literalchar.
22028 (lex): Implemented "..." tokens.
22029 (literalchar, lex, parse_percent_token): Made tokenbuffer
22030 always contain the token. This includes growing the token
22031 buffer while reading an integer.
22032 (parse_percent_token): Replaced if-else statement with percent_table.
22033 (parse_percent_token): Added % declarations as another
22034 way to specify the flags -n, -l, and -r. Also added hooks for
22035 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
22036 major changes to files.c.
22037 (lex) Retain in the incoming stream a character following
22038 an incorrect '/'.
22039 (skip_white_space, lex): Revised most error messages
22040 and changed fatal to warn to avoid aborting.
22041 (percent_table): Added %thong declarations.
22042
22043 * src/gram.h: Comment changes.
22044
22045 * src/files.c (openfiles, open_extra_files, done):
22046 Add faction flag
22047 and actfile file. Handle noparserflag. Both for -n switch.
22048
22049 * src/conflicts.c (resolve_sr_conflict):
22050 Remove use of alloca.
22051
220521995-06-01 Jim Meyering <meyering@gnu.org>
22053
22054 * doc/bison.texinfo: *** empty log message ***
22055
220561995-05-06 Richard Stallman <rms@gnu.org>
22057
22058 * src/bison.s1: Comment change.
22059
220601995-05-06 Richard Stallman <rms@gnu.org>
22061
22062 * bison.simple: Comment change.
22063
220641995-05-03 Richard Stallman <rms@gnu.org>
22065
22066 * src/version.c: Version now 1.24.
22067
22068 * src/bison.s1: Change distribution terms.
22069
22070 * src/version.c: Version now 1.23.
22071
220721995-05-03 Richard Stallman <rms@gnu.org>
22073
22074 * doc/bison.texinfo:
22075 Rewrite "Conditions for Using Bison".
22076 Update version to 1.24.
22077
220781995-05-03 Richard Stallman <rms@gnu.org>
22079
22080 * bison.simple: Change distribution terms.
22081
220821995-02-23 Richard Stallman <rms@gnu.org>
22083
22084 * src/files.c: Test __VMS_POSIX as well as VMS.
22085
220861995-02-14 Jim Meyering <meyering@gnu.org>
22087
22088 * src/bison.s1 (__yy_memcpy):
22089 Renamed from __yy_bcopy to avoid
22090 confusion. Reverse FROM and TO arguments to be consistent with
22091 those of memcpy.
22092
220931995-02-14 Jim Meyering <meyering@gnu.org>
22094
22095 * bison.simple (__yy_memcpy):
22096 Renamed from __yy_bcopy to avoid
22097 confusion. Reverse FROM and TO arguments to be consistent with
22098 those of memcpy.
22099
221001994-11-10 David J. MacKenzie <djm@gnu.org>
22101
22102 * NEWS: reformat
22103
22104 * NEWS: New file.
22105
22106 * Makefile.in (DISTFILES): Include NEWS.
22107
22108 * Makefile.in (DISTFILES):
22109 Include install-sh, not install.sh.
22110
22111 * configure.in: Update to Autoconf v2 macro names.
22112
221131994-10-05 David J. MacKenzie <djm@gnu.org>
22114
22115 * Makefile.in: fix typo
22116
22117 * Makefile.in (prefix, exec_prefix):
22118 Let configure set them.
22119
221201994-09-28 David J. MacKenzie <djm@gnu.org>
22121
22122 * Makefile.in: Set datadir to $(prefix)/share.
22123
221241994-09-15 Richard Stallman <rms@gnu.org>
22125
22126 * src/bison.s1:
22127 Update copyright notice and GPL version.
22128
221291994-09-15 Richard Stallman <rms@gnu.org>
22130
22131 * bison.simple:
22132 Update copyright notice and GPL version.
22133
221341994-07-12 Richard Stallman <rms@gnu.org>
22135
22136 * src/reduce.c, src/reader.c:
22137 entered into RCS
22138
221391994-05-05 David J. MacKenzie <djm@gnu.org>
22140
22141 * Makefile.in: entered into RCS
22142
221431994-03-26 Richard Stallman <rms@gnu.org>
22144
22145 * src/bison.s1: entered into RCS
22146
221471994-03-26 Richard Stallman <rms@gnu.org>
22148
22149 * bison.simple: entered into RCS
22150
221511994-03-25 Richard Stallman <rms@gnu.org>
22152
22153 * src/main.c: entered into RCS
22154
221551994-03-24 Richard Stallman <rms@gnu.org>
22156
22157 * src/conflicts.c: entered into RCS
22158
221591994-01-02 Richard Stallman <rms@gnu.org>
22160
22161 * Makefile.in: *** empty log message ***
22162
221631993-11-21 Richard Stallman <rms@gnu.org>
22164
22165 * src/bison.s1: *** empty log message ***
22166
221671993-11-21 Richard Stallman <rms@gnu.org>
22168
22169 * doc/bison.texinfo: entered into RCS
22170
22171 * doc/bison.texinfo: *** empty log message ***
22172
221731993-11-21 Richard Stallman <rms@gnu.org>
22174
22175 * bison.simple: *** empty log message ***
22176
221771993-10-25 David J. MacKenzie <djm@gnu.org>
22178
22179 * doc/bison.texinfo: *** empty log message ***
22180
221811993-10-19 Richard Stallman <rms@gnu.org>
22182
22183 * src/bison.s1: *** empty log message ***
22184
221851993-10-19 Richard Stallman <rms@gnu.org>
22186
22187 * bison.simple: *** empty log message ***
22188
221891993-10-14 Richard Stallman <rms@gnu.org>
22190
22191 * src/bison.s1: *** empty log message ***
22192
221931993-10-14 Richard Stallman <rms@gnu.org>
22194
22195 * bison.simple: *** empty log message ***
22196
221971993-09-14 David J. MacKenzie <djm@gnu.org>
22198
22199 * doc/bison.texinfo: *** empty log message ***
22200
222011993-09-13 Noah Friedman <friedman@gnu.org>
22202
22203 * Makefile.in: *** empty log message ***
22204
222051993-09-10 Richard Stallman <rms@gnu.org>
22206
22207 * src/conflicts.c: *** empty log message ***
22208
22209 * src/system.h: entered into RCS
22210
222111993-09-10 Richard Stallman <rms@gnu.org>
22212
22213 * doc/bison.1: entered into RCS
22214
222151993-09-06 Noah Friedman <friedman@gnu.org>
22216
22217 * src/version.c: entered into RCS
22218
222191993-09-06 Noah Friedman <friedman@gnu.org>
22220
22221 * Makefile.in: *** empty log message ***
22222
222231993-07-30 David J. MacKenzie <djm@gnu.org>
22224
22225 * Makefile.in: *** empty log message ***
22226
222271993-07-24 Richard Stallman <rms@gnu.org>
22228
22229 * src/bison.s1: *** empty log message ***
22230
222311993-07-24 Richard Stallman <rms@gnu.org>
22232
22233 * bison.simple: *** empty log message ***
22234
222351993-07-08 David J. MacKenzie <djm@gnu.org>
22236
22237 * Makefile.in: *** empty log message ***
22238
222391993-07-04 Richard Stallman <rms@gnu.org>
22240
22241 * src/bison.s1: *** empty log message ***
22242
222431993-07-04 Richard Stallman <rms@gnu.org>
22244
22245 * bison.simple: *** empty log message ***
22246
222471993-06-26 David J. MacKenzie <djm@gnu.org>
22248
22249 * src/getargs.c: entered into RCS
22250
222511993-06-26 David J. MacKenzie <djm@gnu.org>
22252
22253 * doc/bison.texinfo: *** empty log message ***
22254
22255 * doc/bison.1: New file.
22256
222571993-06-25 Richard Stallman <rms@gnu.org>
22258
22259 * src/getargs.c: New file.
22260
222611993-06-16 Richard Stallman <rms@gnu.org>
22262
22263 * src/bison.s1: *** empty log message ***
22264
222651993-06-16 Richard Stallman <rms@gnu.org>
22266
22267 * bison.simple: *** empty log message ***
22268
222691993-06-03 Richard Stallman <rms@gnu.org>
22270
22271 * src/bison.s1: New file.
22272
222731993-06-03 Richard Stallman <rms@gnu.org>
22274
22275 * doc/bison.texinfo: *** empty log message ***
22276
222771993-06-03 Richard Stallman <rms@gnu.org>
22278
22279 * bison.simple: New file.
22280
222811993-05-19 Richard Stallman <rms@gnu.org>
22282
22283 * doc/bison.texinfo: New file.
22284
222851993-05-07 Noah Friedman <friedman@gnu.org>
22286
22287 * Makefile.in: *** empty log message ***
22288
222891993-04-28 Noah Friedman <friedman@gnu.org>
22290
22291 * src/reader.c: *** empty log message ***
22292
222931993-04-23 Noah Friedman <friedman@gnu.org>
22294
22295 * src/alloc.h: entered into RCS
22296
222971993-04-20 David J. MacKenzie <djm@gnu.org>
22298
22299 * src/version.c: *** empty log message ***
22300
22301 * src/files.c, src/allocate.c:
22302 entered into RCS
22303
22304 * src/reader.c: *** empty log message ***
22305
22306 * src/lex.c: entered into RCS
22307
22308 * src/conflicts.c: New file.
22309
22310 * src/symtab.c: entered into RCS
22311
22312 * src/alloc.h: New file.
22313
22314 * src/LR0.c: entered into RCS
22315
223161993-04-18 Noah Friedman <friedman@gnu.org>
22317
22318 * src/reader.c: New file.
22319
22320 * src/version.c: *** empty log message ***
22321
223221993-04-18 Noah Friedman <friedman@gnu.org>
22323
22324 * Makefile.in: *** empty log message ***
22325
223261993-04-17 Noah Friedman <friedman@gnu.org>
22327
22328 * Makefile.in: *** empty log message ***
22329
223301993-04-15 Richard Stallman <rms@gnu.org>
22331
22332 * src/main.c, src/files.c:
22333 New file.
22334
223351993-04-15 Noah Friedman <friedman@gnu.org>
22336
22337 * configure.in: entered into RCS
22338
22339 * configure.in: *** empty log message ***
22340
22341 * configure.in: New file.
22342
223431993-04-14 Richard Stallman <rms@gnu.org>
22344
22345 * Makefile.in: New file.
22346
223471993-04-13 Richard Stallman <rms@gnu.org>
22348
22349 * src/version.c: New file.
22350
223511993-03-25 Richard Stallman <rms@gnu.org>
22352
22353 * src/output.c: entered into RCS
22354
223551992-09-25 Richard Stallman <rms@gnu.org>
22356
22357 * configure.bat: entered into RCS
22358
223591992-06-22 Richard Stallman <rms@gnu.org>
22360
22361 * src/vmsgetargs.c: entered into RCS
22362
223631992-06-22 Richard Stallman <rms@gnu.org>
22364
22365 * doc/bison.rnh: entered into RCS
22366
223671992-04-20 David J. MacKenzie <djm@gnu.org>
22368
22369 * README: entered into RCS
22370
223711992-01-22 Richard Stallman <rms@gnu.org>
22372
22373 * src/machine.h: entered into RCS
22374
223751991-12-21 Richard Stallman <rms@gnu.org>
22376
22377 * src/lalr.c, src/closure.c:
22378 entered into RCS
22379
223801991-12-20 Richard Stallman <rms@gnu.org>
22381
22382 * src/state.h: entered into RCS
22383
223841991-12-18 Richard Stallman <rms@gnu.org>
22385
22386 * src/print.c, src/nullable.c, src/derives.c:
22387 entered into RCS
22388
223891991-11-03 David J. MacKenzie <djm@gnu.org>
22390
22391 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
22392 entered into RCS
22393
223941988-09-09 Richard Stallman <rms@gnu.org>
22395
22396 * src/bison.hairy: entered into RCS
22397
223981987-12-16 Richard Stallman <rms@gnu.org>
22399
22400 * REFERENCES: entered into RCS
22401
22402
22403 -----
22404
22405 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
22406 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
22407 2007, 2008, 2009 Free Software Foundation, Inc.
22408
22409 Copying and distribution of this file, with or without
22410 modification, are permitted provided the copyright notice and this
22411 notice are preserved.