]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
tests: don't abuse AT_BISON_CHECK.
[bison.git] / ChangeLog
... / ...
CommitLineData
12009-09-27 Joel E. Denny <jdenny@clemson.edu>
2
3 tests: don't abuse AT_BISON_CHECK.
4 * tests/regression.at (parse-gram.y: LALR = IELR): Move
5 additional shell commands outside of AT_BISON_CHECK.
6
72009-09-26 Joel E. Denny <jdenny@clemson.edu>
8
9 tests: check that parse-gram.y's IELR and LALR are identical.
10 * tests/atlocal.in (abs_top_srcdir): New shell variable.
11 * tests/regression.at (parse-gram.y: LALR = IELR): New test
12 group.
13
142009-09-16 Akim Demaille <demaille@gostai.com>
15
16 doc: comment changes.
17 * doc/bison.texinfo: Comment changes.
18
192009-09-16 Akim Demaille <demaille@gostai.com>
20
21 doc: spell checking.
22 * doc/bison.texinfo: here.
23
242009-09-19 Alex Rozenman <rozenman@gmail.com>
25
26 Keep sub-messages aligned. Fix strings for translation.
27 * src/location.h: (location_print): Add return value.
28 * src/location.c: (location_print): Return number of printed
29 characters.
30 * src/complain.h: Two new functions (complain_at_indent,
31 warn_at_indent).
32 * src/complain.cpp: Implement the alignment mechanism. Add new
33 static variable (indent_ptr). Use and update it (error_message,
34 complain_at_indent, warn_at_indent).
35 * src/scan-code.l: Fix strings for translations. Use new *_indent
36 functions (parse_ref, show_sub_messages).
37 * tests/named-ref.at: Adjust testcases.
38 * NEWS (2.5): Add an announcement about named references.
39
402009-09-13 Joel E. Denny <jdenny@clemson.edu>
41
42 tests: clean up push.at test group titles.
43 * tests/push.at: Remove "Push Parsing: " from test group titles
44 because these are already under the banner "Push Parsing Tests".
45
462009-09-12 Alex Rozenman <rozenman@gmail.com>
47
48 Provide an additional sub-message for clarity.
49 Add "symbol not found in production" error message when
50 an "invalid reference" is detected in named references
51 resolution.
52 * src/scan-code.l: Update "invalid reference" case.
53 * tests/named-ref.at: Adjust test-cases.
54
552009-09-10 Joel E. Denny <jdenny@clemson.edu>
56
57 Clean up yacc.c a little.
58 * data/yacc.c: Clean up M4 for readability, and make output
59 whitespace more consistent. For the main parse function
60 comment, instead of saying "yyparse or yypush_parse", say either
61 "yyparse" or "yypush_parse" depending on which it actually is.
62
632009-09-03 Joel E. Denny <jdenny@clemson.edu>
64
65 Complain about unused %define variables and %code qualifiers.
66 * NEWS (2.5): Document.
67 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
68 * doc/bison.texinfo (Decl Summary): Document complaint, and
69 improve %define documentation a little otherwise.
70 * tests/input.at (Reject unused %code qualifiers): Update.
71 (%define errors): Update.
72 (%define, --define, --force-define): Update.
73 (%define backward compatibility): Update.
74 (Unused %define api.pure): Update.
75 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
76
772009-09-03 Joel E. Denny <jdenny@clemson.edu>
78
79 Use aver not assert.
80 * src/output.c: Don't include assert.h.
81 (output_skeleton): Use aver not assert.
82 * src/system.h (aver): In documentation of why, add links to
83 Paul Eggert's explanations in the mailing lists.
84
852009-09-05 Alex Rozenman <rozenman@gmail.com>
86
87 Use "Unresolved reference" error message when no symbols were found
88 in a symbolic reference resolution. Remove .expr and -expr from
89 the shown reference when the reference is unresolved.
90 * src/scan-code.l: Change the error message, adjust location columns,
91 rename variable "exact_mode" to "explicit_bracketing".
92 * tests/named-ref.at: Adjust existing tests and add a new one.
93
942009-09-03 Akim Demaille <demaille@gostai.com>
95
96 * NEWS (2.4.2): Add "Internationalization" item.
97
982009-09-03 Akim Demaille <demaille@gostai.com>
99
100 bootstrap: fix/improve find_tool.
101 * bootstrap (find_tool): Improve error messages.
102 Fix typo about find_tool_names.
103
1042009-08-29 Joel E. Denny <jdenny@clemson.edu>
105
106 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
107 See
108 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
109 * src/scan-code.h (code_props_rule_action_init): Rename
110 named_ref arg to name so it doesn't shadow named_ref type. This
111 makes it consistent with the function definition in scan-code.l
112 anyway.
113
1142009-08-28 Joel E. Denny <jdenny@clemson.edu>
115
116 %define: accept unquoted values.
117 * NEWS (2.5): Group all %define changes together, and document
118 this one. Remove quotes in IELR and canonical LR entry.
119 * doc/bison.texinfo: Remove quotes in most examples throughout.
120 (Decl Summary): Update %define documentation.
121 (Table of Symbols): Likewise.
122 * src/ielr.c (LrType): Update documentation.
123 * src/parse-gram.y (content.opt): Add production for ID.
124 * tests/calc.at: Remove quotes in most tests.
125 * tests/existing.at: Likewise.
126 * tests/input.at: Likewise.
127 * tests/local.at: Likewise.
128 * tests/push.at: Likewise.
129 * tests/reduce.at: Likewise.
130 * tests/torture.at: Likewise.
131
1322009-08-28 Joel E. Denny <jdenny@clemson.edu>
133
134 %define lr.type: make values lowercase IDs.
135 That is, "LALR" => "lalr", "IELR" => "ielr", and
136 "canonical LR" => "canonical-lr".
137 * NEWS (2.5): Update documentation.
138 * doc/bison.texinfo (Decl Summary): Likewise.
139 * src/ielr.c (ielr): Use new values.
140 * src/ielr.h (ielr): Update documentation.
141 * src/reader.c (prepare_percent_define_front_end_variables): Use
142 and validate new values.
143 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
144 grammars.
145 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
146
1472009-08-27 Eric Blake <ebb9@byu.net>
148
149 scan-gram: avoid portability trap with ctype usage.
150 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
151 Avoid compiler warning.
152
1532009-08-27 Joel E. Denny <jdenny@clemson.edu>
154
155 tests: use perl for printing special sequences to files.
156 And skip tests if perl is not available. This is better than
157 playing tricks with shell portability. Suggested by Akim
158 Demaille.
159 * tests/input.at (Bad character literals): Use it here for
160 omitting final newlines.
161 (Bad escapes in literals): Use it here for special characters.
162
1632009-08-26 Joel E. Denny <jdenny@clemson.edu>
164
165 tests: show a use of %define lr.default-reductions "consistent"
166 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
167 prevents the omission of expected tokens for %error-verbose.
168
1692009-08-26 Akim Demaille <demaille@gostai.com>
170
171 tests: portability fix.
172 * tests/input.at (Bad escapes in literals): Don't expect "echo
173 '\0'" to output \ then 0.
174
1752009-08-26 Joel E. Denny <jdenny@clemson.edu>
176
177 Actually handle the yytable zero value correctly this time.
178 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Don't
179 mention zero values in the YYTABLE comments.
180 * data/glr.c (yytable_value_is_error): Don't check for zero
181 value.
182 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
183 * data/yacc.c (yytable_value_is_error): Likewise.
184 * data/lalr1.java (yy_table_value_is_error_): Likewise.
185 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
186 * src/tables.h: In header comments, explain why it's useless to
187 check for a zero value in yytable.
188
1892009-08-25 Joel E. Denny <jdenny@clemson.edu>
190
191 More fixes related to last two patches.
192 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
193 defined.
194 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Fix
195 yytable comments: zero indicates syntax error not default
196 action.
197 * data/glr.c (yyis_pact_ninf): Rename to...
198 (yypact_value_is_default): ... this.
199 (yyisDefaultedState): Update for rename.
200 (yyis_table_ninf): Rename to...
201 (yytable_value_is_error): ... this, and check for value zero
202 besides just YYTABLE_NINF.
203 (yygetLRActions): Check for default value from yypact. It
204 appears that this check is always performed before this function
205 is invoked, and so adding the check here is probably redundant.
206 However, the code may evolve after this subtlety is forgotten.
207 Also, update for rename to yytable_value_is_error. Because that
208 macro now checks for zero, a different but equivalent branch of
209 the if-then-else here is evaluated.
210 (yyreportSyntaxError): Update for rename to
211 yytable_value_is_error. The zero condition was mishandled
212 before.
213 (yyrecoverSyntaxError): Update for renames. No behavioral
214 changes.
215 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
216 New function.
217 (yy_table_value_is_error_): New function.
218 (parse): Use new functions where possible. No behavioral
219 changes.
220 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
221 The zero condition was mishandled before.
222 * data/yacc.c (yyis_pact_ninf): Rename to...
223 (yypact_value_is_default): ... this.
224 (yyis_table_ninf): Rename to...
225 (yytable_value_is_error): ... this, and check for value zero
226 besides just YYTABLE_NINF.
227 (yysyntax_error): Update for rename to yytable_value_is_error.
228 The zero condition was mishandled before.
229 (yyparse): Update for renames. No behavioral changes.
230 * src/tables.h: Improve comments about yypact, yytable, etc.
231 more. Most importantly, say yytable value of zero means syntax
232 error not default action.
233
2342009-08-25 Joel E. Denny <jdenny@clemson.edu>
235
236 Fix %error-verbose for conflicts resolved by %nonassoc.
237 * NEWS (2.5): Document.
238 * data/glr.c (yyreportSyntaxError): Fix this by checking
239 yyis_table_ninf.
240 * data/yacc.c (yysyntax_error): Likewise.
241 * data/lalr1.cc (yysyntax_error_): Fix this by checking
242 yytable_ninf_.
243 * data/lalr1.java (yysyntax_error): Likewise.
244 * tests/conflicts.at (%nonassoc and eof): Update expected output
245 and remove FIXME.
246
2472009-08-25 Joel E. Denny <jdenny@clemson.edu>
248
249 Some code and documentation improvements.
250 * data/c.m4 (b4_table_value_equals): New macro to capture
251 some repeated code.
252 * data/glr.c (yyis_pact_ninf): Use it here.
253 (yyis_table_ninf): Likewise.
254 (yyreportSyntaxError): Improve internal comments.
255 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
256 Use it everywhere possible.
257 (yyis_table_ninf): Likewise.
258 (yysyntax_error): Improve internal comments.
259 * data/lalr1.cc (yysyntax_error_): Likewise.
260 * data/lalr1.java (yysyntax_error): Likewise.
261 * src/tables.h: Improve comments about yypact, yytable, etc.
262
2632009-08-21 Joel E. Denny <jdenny@clemson.edu>
264
265 Use locale when quoting.
266 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
267 quote rather than implementing quoting here.
268
2692009-08-20 Eric Blake <ebb9@byu.net>
270
271 Make previous patch more robust.
272 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
273 argmatch.h.
274 (output_skeleton): Use it.
275 Suggested by Akim Demaille.
276
277 Import latest m4/m4.m4.
278 * submodules/autoconf: Update to autoconf 2.64.
279 * configure.ac (M4_GNU_OPTION): New define.
280 * src/output.c (output_skeleton): Use it to resolve FIXME.
281 * NEWS: Mention this.
282
2832009-08-19 Joel E. Denny <jdenny@clemson.edu>
284
285 Fix complaints about escape sequences.
286 Discussed starting at
287 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
288 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
289 For a \0 and similar escape sequences meaning the null
290 character, report an invalid escape sequence instead of an
291 invalid null character because the latter does not actually
292 appear in the user's input.
293 In all escape sequence complaints, don't escape the initial
294 backslash, and don't quote when the sequence appears at the end
295 of the complaint line unless there's whitespace that quotearg
296 won't escape.
297 Consistently say "invalid" not "unrecognized".
298 Consistently prefer "empty character literal" over "extra
299 characters in character literal" warning for invalid escape
300 sequences; that is, consistently discard those sequences.
301 * tests/input.at (Bad escapes in literals): New.
302
3032009-08-19 Akim Demaille <demaille@gostai.com>
304
305 doc: fixes.
306 * doc/bison.texinfo: Fix minor Texinfo errors.
307
3082009-08-19 Akim Demaille <demaille@gostai.com>
309
310 doc: %initial-action to initialize yylloc.
311 Reported by Bill Allombert.
312 * doc/bison.texinfo: Set fill-column to 76.
313 (Location Type): Document the use of %initial-action to initialize
314 yylloc.
315
3162009-08-18 Joel E. Denny <jdenny@clemson.edu>
317
318 maint: update for gnulib's recent update-copyright changes
319 * gnulib: Update.
320 * .x-update-copyright (COPYING): Add as it's no longer implied
321 when .x-update-copyright is present.
322 * cfg.mk (update-copyright-local): Remove, now ignored.
323 (update-copyright): Declare update-b4-copyright as a dependency.
324
3252009-08-17 Akim Demaille <demaille@gostai.com>
326
327 build: require gettext 0.17.
328
329 Suggested by Bruno Haible.
330 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
331 * configure.ac: require gettext 0.17 to ensure compatibility with
332 gnulib.
333
3342009-08-17 Akim Demaille <demaille@gostai.com>
335
336 build: lower gettext requirements.
337
338 Bison was uselessly requiring the formatstring macros from
339 gettext, which resulted in mo files not being installed on systems
340 that perfectly supported Bison mo files. Lower the requirement.
341 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
342
343 * configure.ac: Require need-ngettext instead of
344 need-formatstring-macros.
345 Reported by Martin Jabocs.
346 Suggested by Bruno Haible.
347 * INSTALL: Restructure.
348 (Internationalization): New.
349
3502009-08-14 Joel E. Denny <jdenny@clemson.edu>
351
352 maint: fix use of copyright year intervals.
353 * gnulib: Update.
354 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
355 as now recommended in gnulib/NEWS.
356 * build-aux/update-b4-copyright: Fix.
357 * cfg.mk (update-copyright-env): Configure update-copyright.
358
3592009-08-13 Joel E. Denny <jdenny@clemson.edu>
360
361 Make it easier to write deterministic tests.
362 Continues Akim's work from his 2009-06-10 commits.
363 * src/reader.c (check_and_convert_grammar): Don't add any
364 symbols after the first symbols_do invocation.
365 * src/symtab.c (symbols_sorted): New static global.
366 (user_token_number_redeclaration): Update comments.
367 (symbol_from_uniqstr): If a new symbol is being created, assert
368 that symbols_sorted hasn't been allocated yet.
369 (symbols_free): Free symbols_sorted.
370 (symbols_cmp, symbols_cmp_qsort): New functions.
371 (symbols_do): Sort symbol_table into symbols_sorted on first
372 invocation.
373 * tests/input.at (Numbered tokens): Recombine tests now that the
374 output should be deterministic across multiple numbers.
375
3762009-08-12 Akim Demaille <demaille@gostai.com>
377
378 distcheck: fix.
379
380 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
381
3822009-08-10 Joel E. Denny <jdenny@clemson.edu>
383
384 * tests/Makefile.am (TESTSUITE_AT): Add named-refs.at.
385
3862009-08-10 Joel E. Denny <jdenny@clemson.edu>
387
388 Miscellaneous code readability improvements.
389
390 * src/reader.c (reader): Move %define front-end variable
391 defaults and checking into...
392 (prepare_percent_define_front_end_variables): ... this new
393 function.
394
395 * src/scan-gram.l (INITIAL): For consistency with string
396 literals, don't store open quote on character literal. It's
397 discarded before returning anyway.
398 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
399 Make length test more readable, and make the character stored
400 for an empty literal more obvious while consistent with the
401 previous behavior.
402
403 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
404 USER_NUMBER_HAS_STRING_ALIAS throughout.
405 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
406 that is repeated in symtab.h. Improve argument names to make it
407 clear which side of the symbol-string alias pair is which.
408 (symbol_check_alias_consistency): Improve local variable names
409 for the same purpose.
410 * src/symtab.h (struct symbol): Make comments about aliases
411 clearer.
412 (symbol_make_alias): Improve comments and argument name.
413 * src/output.c (token_definitions_output): Update for rename to
414 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
415
4162009-08-08 Alex Rozenman <rozenman@gmail.com>
417
418 Convert "misleading reference" messages to warnings.
419 * src/scan-code.l: New function 'show_sub_messages', more
420 factoring.
421 * tests/named-ref.at: Adjust tests.
422
4232009-08-06 Joel E. Denny <jdenny@clemson.edu>
424
425 maint: run "make update-copyright"
426
4272009-08-06 Joel E. Denny <jdenny@clemson.edu>
428
429 maint: make update-b4-copyright easier to use
430 * build-aux/update-b4-copyright: In warnings, report line
431 numbers rather than character positions.
432 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
433 that update-copyright runs it.
434 * gnulib: Update.
435
4362009-08-05 Joel E. Denny <jdenny@clemson.edu>
437
438 maint: clean up update-b4-copyright code
439 * build-aux/update-b4-copyright: Do not accept 2-digit
440 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
441 Don't accept a `[' in a b4_copyright argument.
442 Format code more consistently.
443 Don't assume b4*copyright never occurs.
444
4452009-08-04 Joel E. Denny <jdenny@clemson.edu>
446
447 maint: automate b4_copyright updates.
448 * Makefile.am (update-b4-copyright): New target rule.
449 * build-aux/Makefile.am (EXTRA_DIST): Add update-b4-copyright.
450 * build-aux/update-b4-copyright: New.
451 * data/yacc.c: Remove stray characters around b4_copyright
452 invocations.
453
4542009-08-04 Joel E. Denny <jdenny@clemson.edu>
455
456 maint: automate annual package-wide copyright-year update.
457 * .x-update-copyright: New.
458 * Makefile.am (EXTRA_DIST): Remove maint.mk.
459 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
460 update-copyright. Remove gnumakefile, which is implied by
461 maintainer-makefile.
462 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
463 * gnulib: Update.
464 * maint.mk: Remove, now copied from gnulib.
465 * examples/extexi: Add missing "(C)" in copyright statement so
466 update-copyright can recognize it.
467 * src/LR0.h: Likewise.
468 * src/print.h: Likewise.
469 * src/print_graph.h: Likewise.
470 * src/gram.c: Add missing comma in copyright statement.
471 * src/gram.h: Likewise.
472
4732009-08-04 Joel E. Denny <jdenny@clemson.edu>
474
475 Fix "make distcheck".
476 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
477 of just calc.stamp.
478
4792009-08-01 Joel E. Denny <jdenny@clemson.edu>
480
481 Pacify "gcc -Wunused" for the input function from Flex.
482 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
483 and later.
484 * src/scan-code.l: Add "%option noinput", which I cannot find in
485 the Flex manual, but which Flex has supported since at least as
486 far back as 2.5.4. However, if any of our developers still use
487 Flex 2.5.4, they'll need to stop configuring with
488 --enable-gcc-warnings because "%option noinput" didn't work
489 correctly until Flex 2.5.6.
490 * src/scan-gram.l: Likewise.
491 * src/scan-skel.l: Likewise.
492
4932009-07-31 Alex Rozenman <rozenman@gmail.com>
494
495 Fix --enable-gcc-warnings problems.
496 * src/reader.c: Adjust variable names.
497 * src/scan-code.l: Fix prototypes and adjust names.
498 * src/named-ref.c: Remove redundant "if".
499
5002009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
501
502 Fix a --enable-gcc-warnings problem.
503 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
504 variable.
505
5062009-07-24 Alex Rozenman <rozenman@gmail.com>
507
508 Fix some memory leaks.
509 * src/named-ref.c: Add a pointer check (named_ref_free).
510 * src/scan-code.l: New function (variant_table_free). Called in
511 code_scanner_free.
512 * src/symlist.c: Call to named_ref_free (symbol_list_free).
513
5142009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
515
516 Warn about character literals not of length one.
517 * NEWS (2.5): Document.
518 * src/scan-gram.l (INITIAL): Remove comment that we don't check
519 the length.
520 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
521 * tests/input.at (Bad character literals): New test group.
522
5232009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
524
525 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
526
5272009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
528
529 Some M4 cleanup in the testsuite.
530 Suggested by Eric Blake at
531 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
532 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
533 complicate the code by distinguishing between a missing value
534 and an empty string value for an optional argument. This fix is
535 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
536 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
537 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
538 arguments are not needed because of the following changes.
539 Fix stale comments.
540 Bison developers should use GNU M4 and should not use
541 POSIXLY_CORRECT when building the test suite, so do not
542 complicate the code by avoiding $10 and above.
543 Do not quote an empty string value for an optional argument, and
544 do not distinguish between a missing value and an empty string
545 value.
546
5472009-07-21 Joel E. Denny <jdenny@ces.clemson.edu>
548
549 * m4/m4.m4: Make it a sym link to submodules/autoconf/m4/m4.m4.
550
5512009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
552
553 Revert unnecessary column realignment in --help output.
554 Reported by Akim Demaille at
555 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
556 * src/getargs.c (usage): Here.
557
5582009-07-04 Alex Rozenman <rozenman@gmail.com>
559
560 Alphabetical order in src/Makefile.am.
561 * src/Makefile.am: Adjust.
562
5632009-07-04 Alex Rozenman <rozenman@gmail.com>
564
565 Style changes and factoring.
566 * src/named-ref.h: Add comments.
567 * src/parse-gram.y: Readability and style changes.
568 * src/reader.c: Factoring: assign_named_ref function.
569 * src/scan-code.l: Factoring and style changes. Rename
570 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
571 Use "unsigned" type for variant index. Improve readablity.
572 * src/scan-gram.l: Change error messages and add comments.
573 * src/symlist.h: symbol_list_null: New function decl.
574 * src/symlist.c: symbol_list_null: Implement here.
575 * tests/named-refs.at: Adjust for new error messages.
576
5772009-06-29 Eric Blake <ebb9@byu.net>
578
579 scan-code: avoid compiler warnings
580 * src/scan-code.l (parse_named_ref): Use correct specifiers.
581
5822009-06-29 Akim Demaille <demaille@gostai.com>
583
584 build: avoid concurrent extraction of calc++.
585 * examples/calc++/Makefile.am (calc.stamp): New.
586 Depend on it to create the sources of calc++ so that concurrent
587 builds don't launch several "extexi" in parallel.
588 Not only this is inefficient, this also builds incorrect sources
589 with several extractions mixed together.
590
5912009-06-27 Alex Rozenman <rozenman@gmail.com>
592
593 Implement support for named symbol references.
594 * src/parse-gram.y: Add new syntax (named_ref.opt).
595 * src/reader.c: Store named refs in symbol lists.
596 * src/reader.h: New argument for symbol_append and
597 action_append functions.
598 * src/scan-code.h: Add new field (named_ref) into
599 code_props data structure. Keeps named ref of midrule
600 actions.
601 * src/scan-code.l: Support for named refs in semantic
602 action code. New function 'parse_named_ref'.
603 * src/scan-gram.l: Support bracketed id.
604 * src/symlist.c: Store named refs in symbol lists.
605 * src/symlist.h: New field in symbol list: named_ref.
606 * src/named-ref.h: New file, a struct for named_ref.
607 * src/named-ref.cp: New file, named_ref_new function.
608 * src/local.mk: Add two new files.
609 * tests/testsuite.at: Include new test group:
610 * tests/named-refs.at: this new file.
611
6122009-06-25 Akim Demaille <demaille@gostai.com>
613
614 hash: check insertion for memory exhaustion.
615 * src/uniqstr.c (uniqstr_new): New.
616
6172009-06-11 Akim Demaille <demaille@gostai.com>
618
619 style changes.
620 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
621 * src/print-xml.c: Style changes.
622 * tests/conflicts.at: Comment changes.
623
6242009-06-11 Akim Demaille <demaille@gostai.com>
625
626 xml: beware of user strings used to give a %prec to rules.
627 * tests/conflicts.at (%prec with user strings): New.
628 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
629 XML output.
630
6312009-06-11 Akim Demaille <demaille@gostai.com>
632
633 hash: check insertion for memory exhaustion.
634 * src/muscle-tab.c (muscle_insert, muscle_grow)
635 * src/state.c (state_hash_insert): Check the return value of
636 hash_insert.
637
6382009-06-10 Akim Demaille <demaille@gostai.com>
639
640 deterministic test suite.
641 Some consistency checks on symbols are performed after all the
642 symbols were read, by an iteration over the symbol table. This
643 traversal is nondeterministic, which can be a problem for test
644 cases.
645 Avoid this.
646 Addresses another form of nondeterminism reported by Joel E. Denny.
647 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
648
649 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
650 test in two.
651 Use different file names for the three tests to make the
652 maintenance easier.
653
6542009-06-10 Akim Demaille <demaille@gostai.com>
655
656 deterministic user-token-number redeclaration errors.
657 Address nondeterminism reported by Joel E. Denny.
658 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
659
660 * src/uniqstr.h: Comment changes.
661 * src/location.h (boundary_cmp, location_cmp): New.
662 * src/symtab.c (user_token_number_redeclaration): New.
663 (symbol_translation): Use it.
664 * tests/input.at (Numbered tokens): Adjust the expected output.
665
6662009-05-25 Akim Demaille <demaille@gostai.com>
667
668 gnulib: update.
669 * gnulib: Update to latest.
670 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
671 * m4/.gitignore: Regen.
672 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
673 Call xalloc_die on hash_insert failures.
674 Requested by the new __warn_unused_result__ attribute of
675 hash_insert.
676
6772009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
678
679 Convert multiple variable definition warnings to complaints.
680 * NEWS (2.5): Add a new entry for that change.
681 * doc/bison.texinfo (Decl Summary): Update %define entry.
682 (Bison Options): Update -D/--define/-F/--force-define entry.
683 * src/muscle_tab.c (muscle_percent_define_insert): Implement.
684 * src/muscle_tab.h (muscle_percent_define_insert): Update
685 comments.
686 * tests/input.at (`%define errors'): Update.
687 (`%define, --define, --force-define'): Update.
688
6892009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
690
691 -F/--force-define and relative %define/-D/--define priorities.
692 * NEWS (2.5): Add documentation to -D/--define entry.
693 * build-aux/cross-options.pl: Hard-code association of
694 --force-define with %define.
695 * doc/bison.texinfo (Decl Summary): In %define entry,
696 cross-reference command-line options.
697 (Bison Options): Add documentation to -D/--define entry.
698 (Option Cross Key): Widen column for --force-define row.
699 * src/getargs.c (usage): Document -F/--force-define. Realign
700 options in output.
701 (short_options, long_options, getargs): Parse -F/--force-define,
702 and update muscle_percent_define_insert invocation.
703 * src/muscle_tab.h (muscle_percent_define_how): New enum type.
704 (muscle_percent_define_insert): Add argument with that type.
705 * src/muscle_tab.c (muscle_percent_define_insert): Implement
706 -F/--force-define behavior and priorities.
707 * src/parse-gram.y (prologue_declaration): Update
708 muscle_percent_define_insert invocations.
709 * tests/input.at (`%define, --define'): Rename to...
710 (`%define, --define, --force-define'): ... this and extend.
711
7122009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
713
714 Update some comments to make sense for -D.
715 * data/bison.m4 (b4_check_user_names): In header comments, say
716 "user occurrence" instead of "grammar occurrence".
717 * src/muscle_tab.h (muscle_percent_define_insert): Likewise.
718 (muscle_percent_code_grow): Likewise just for consistency.
719
7202009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
721
722 * data/c++.m4: Update copyright year.
723
7242009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
725
726 * data/c++.m4 (b4_namespace_close): Simplify slightly.
727
7282009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
729
730 Handle a trailing `:' in a user-supplied C++ namespace better.
731 * data/c++.m4 (b4_namespace_close): Don't let it be printed
732 among the closing braces here. This fix might make the
733 generated code easier to debug, but otherwise it should be
734 insignificant because a trailing `:' is a C++ error already.
735
7362009-05-19 Akim Demaille <demaille@gostai.com>
737
738 remove useless variable.
739 * src/getargs.c (skeleton_arg): Remove now useless variable.
740 Should help the compiler see that this printf-like call is sane.
741
7422009-05-11 Akim Demaille <demaille@gostai.com>
743
744 doc: use C++ headers.
745 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
746 headers.
747
7482009-05-05 Akim Demaille <demaille@gostai.com>
749
750 fix hexadecimal token number support.
751 * src/scan-gram.l: Catch incorrect ids after hexadecimal numbers.
752
7532009-05-05 Akim Demaille <demaille@gostai.com>
754
755 tests: check token numbers.
756 * tests/input.at (Numbered tokens): New.
757
7582009-05-04 Akim Demaille <demaille@gostai.com>
759
760 bison: catch bad symbol names.
761 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
762 * tests/input.at: Adjust.
763
7642009-05-04 Akim Demaille <demaille@gostai.com>
765
766 space changes.
767 * src/scan-gram.l: Untabify to be robust to zealous editors.
768
7692009-05-04 Akim Demaille <demaille@gostai.com>
770
771 identifiers: dashes are letters.
772 Dashes can now start identifiers (symbols and directives).
773
774 * src/scan-gram.l ({letter}): Add dash.
775 ({id}): Remove it.
776 * tests/input.at (Symbols): Adjust.
777 Remove stray comment.
778 * tests/regression.at (Invalid inputs): Adjust error message.
779 * doc/bison.texinfo (Symbols): Update.
780
7812009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
782
783 Declare %code to be a permanent feature.
784 * NEWS (2.4.2): Here.
785 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
786 experimental.
787 (Decl Summary): Likewise.
788
7892009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
790
791 Convert underscores to dashes in some %define variable names.
792 For now, just api.push-pull and lr.keep-unreachable-states.
793 Maintain old names for backward compatibility.
794 * NEWS (2.5): Document.
795 * data/c.m4 (b4_identification): Update comment.
796 * data/yacc.c: Update access.
797 * doc/bison.texinfo: Update.
798 * etc/bench.pl.in (bench_grammar): Update use.
799 * src/files.c (tr): Move to...
800 * src/getargs.c, src/getargs.h (tr): ... here because I can't
801 think of a better place to expose it. My logic is that, for all
802 uses of tr so far, command-line arguments can be involved, and
803 getargs.h is already included.
804 * src/main.c (main): Update access.
805 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
806 variable names to new variable names before assigning value.
807 * src/reader.c (reader): Update setting default.
808 * tests/calc.at: Update uses.
809 * tests/conflicts.at (Unreachable States After Conflict
810 Resolution): Update use.
811 * tests/input.at (%define enum variables): Update use.
812 (%define backward compatibility): New test group.
813 * tests/push.at: Update uses.
814 * tests/reduce.at: Update uses.
815 * tests/torture.at: Update uses.
816
8172009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
818
819 Set all front-end %define defaults in one place.
820 * src/main.c (main): Move lr.keep_unreachable_states default...
821 * src/reader.c (reader): ... to here.
822
8232009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
824
825 Rename lr.default_reductions to lr.default-reductions.
826 * NEWS (2.5): Here.
827 * doc/bison.texinfo: Here.
828 * src/lalr.c (initialize_LA): Here.
829 * src/print.c (print_reductions): Here.
830 * src/reader.c (reader): Here.
831 * src/tables.c (action_row): Here.
832 * tests/input.at (%define enum variables): Here.
833 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
834
8352009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
836
837 Pacify ./configure --enable-gcc-warnings.
838 * tests/input.at (Symbols): Prototype yyerror and yylex.
839
8402009-04-21 Akim Demaille <demaille@gostai.com>
841
842 tests: check the use of dashes and periods in symbols.
843 * tests/input.at (Symbol): New test group.
844
8452009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
846
847 Document how `%define "var" "value"' is not M4-friendly.
848 * src/parse-gram.y (variable): In comments here.
849
8502009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
851
852 Add copyright updates missed during previous cherry pick.
853 * src/output.c: Here.
854 * src/parse-gram.y: Here.
855 * src/scan-gram.l: Here.
856
8572009-04-20 Akim Demaille <demaille@gostai.com>
858
859 variables: accept dashes.
860 * src/scan-gram.l ({id}): Also accept dashes after the initial
861 letter.
862 ({directive}): Use {id}.
863 * src/parse-gram.y: Comment and formatting changes.
864 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
865 symbols.
866 * src/complain.h, src/complain.c (yacc_at): New.
867 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
868 symbol names.
869 * src/output.c (token_definitions_output): Do not #define token
870 names with dashes.
871
8722009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
873
874 Clean up recent patches a little.
875 Reported by Akim Demaille.
876 * doc/bison.texinfo (Understanding): Fix typos.
877 * src/print.c (print_reductions): Don't use negated variable.
878
8792009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
880
881 List accepted values for a %define enum variable with an invalid value.
882 Suggested by Akim Demaille at
883 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
884 * data/bison.m4 (_b4_percent_define_check_values): Implement.
885 * src/muscle_tab.c (muscle_percent_define_check_values): Implement.
886 * tests/input.at (%define lr.default_reductions invalid values): Merge
887 into...
888 (%define enum variables): ... here, and update output.
889
8902009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
891
892 Rename "default rule" to "default reduction".
893 This includes changing variable names in code, changing
894 comments, and renaming %define lr.default_rules to %define
895 lr.default_reductions.
896 * NEWS (2.5): Update IELR documentation.
897 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c:
898 Adjust YYDEFACT and yydefact_ documentation.
899 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
900 and lr.type documentation. Make some other wording
901 improvements.
902 (Glossary): Adjust cross-references and Default Reduction
903 definition.
904 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
905 Remove a confusing comment pointed out by Akim Demaille.
906 (initialize_LA): Adjust code.
907 * src/print-xml.c (print_reductions): Adjust code.
908 * src/print.c (print_reductions): Adjust code.
909 * src/reader.c (reader): Adjust code.
910 * src/tables.c (action_row): Adjust code.
911 (token_actions): Adjust code.
912 * src/tables.h: Adjust YYDEFACT documentation.
913 * tests/input.at (%define lr.default_rules invalid values):
914 Rename test group to...
915 (%define lr.default_reductions invalid values): ... this, and
916 update grammar file and expected output.
917 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
918 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
919
9202009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
921
922 Document %define lr.type and lr.default_rules.
923 * NEWS (2.5): Add an entry.
924 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
925 besides just LALR(1) and GLR(1).
926 * doc/bison.texinfo (Introduction): Likewise.
927 (Language and Grammar): Bison is no longer limited to LALR(1)
928 restrictions.
929 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
930 when trying to distinguish from GLR. Talk about LR(1) grammars
931 rather than LALR(1) grammars.
932 (Decl Summary): In %define api.push_pull entry, say it applies
933 to deterministic parsers in C rather than LALR(1) parsers in C.
934 Add lr.default_rules entry.
935 Add lr.type entry.
936 (Mystery Conflicts): Bison is no longer limited to LALR(1)
937 restrictions.
938 (Generalized LR Parsing): Same changes as for the previous GLR
939 section.
940 (Memory Management): Say deterministic rather than LALR(1).
941 (Understanding): Correct some bison output.
942 Index discussion of "accepting state".
943 Say deterministic rather than LALR(1).
944 (Bison Options): In --yacc entry, say deterministic rather than
945 LALR(1).
946 In --report, --graph, and --xml entries, just don't mention
947 LALR(1).
948 (C++ Parsers): Say deterministic rather than LALR(1).
949 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
950 (Glossary): Add Accepting State, Consistent State, Default Rule,
951 and IELR(1) definitions.
952 In Generalized LR (GLR) definition, make same changes as in
953 previous GLR sections.
954 In LALR(1) definition, say Bison uses LALR(1) by default rather
955 than implying Bison is limited to LALR(1).
956 (LocalWords): Add IELR.
957
9582009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
959
960 Finish implementing %define lr.type.
961 Its value can be "LALR", "IELR", or "canonical LR".
962 * lib/timevar.def (TV_IELR_PHASE1): New var.
963 (TV_IELR_PHASE2): New var.
964 (TV_IELR_PHASE3): New var.
965 (TV_IELR_PHASE4): New var.
966 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
967 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
968 Sbitset.h, ielr.h, and ielr.c.
969 * src/getargs.h, src/getargs.c (enum trace, trace_args,
970 trace_types): Add trace_ielr.
971 * src/lalr.h, src/lalr.c (ngotos): Export it.
972 (F): Rename to...
973 (goto_follows): ... this, update all uses, and export it.
974 (set_goto_map): Export it.
975 (map_goto): Export it.
976 (compute_lookahead_tokens): Don't free goto_follows yet. Now
977 handled in ielr.
978 (initialize_LA): Export it. Move lookback allocation to...
979 (lalr): ... here because, for canonical LR, initialize_LA must
980 be invoked but lookback and much of the rest of LALR isn't
981 needed.
982 * main.c (main): Instead of lalr, invoke ielr, which invokes
983 lalr.
984 * src/reader.c (reader): Default lr.type to "LALR".
985 Default lr.default_rules to "accepting" if lr.type is "canonical
986 LR". Leave the default as "all" otherwise.
987 Check for a valid lr.type value.
988 * src/state.h, src/state.c (struct state_list): Add state_list
989 member.
990 (state_new): Initialize state_list member to NULL.
991 (state_new_isocore): New function, exported.
992 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
993 exercises all values of lr.type.
994 (GNU AWK Grammar): Rename test group to...
995 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
996 AT_TEST_EXISTING_GRAMMAR.
997 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
998 (GNU pic Grammar): Rename test group to...
999 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
1000 AT_TEST_EXISTING_GRAMMAR.
1001 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
1002 all values of lr.type.
1003 (Single State Split): New test groups using AT_TEST_LR_TYPE.
1004 (Lane Split): Likewise.
1005 (Complex Lane Split): Likewise.
1006 (Split During Added Lookahead Propagation): Likewise.
1007
10082009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1009
1010 Add new files for IELR and canonical LR implementation.
1011 * src/AnnotationList.c: New.
1012 * src/AnnotationList.h: New.
1013 * src/InadequacyList.c: New.
1014 * src/InadequacyList.h: New.
1015 * src/Sbitset.c: New.
1016 * src/Sbitset.h: New.
1017 * src/ielr.c: New.
1018 * src/ielr.h: New.
1019
10202009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1021
1022 Implement %define lr.default_rules.
1023 Its value describes the states that are permitted to contain
1024 default rules: "all", "consistent", or "accepting".
1025 * src/reader.c (reader): Default lr.default_rules to "all".
1026 Check for a valid lr.default_rules value.
1027 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
1028 is "accepting", then only mark the accepting state as
1029 consistent.
1030 (initialize_LA): Tell state_lookahead_tokens_count whether
1031 lr.default_rules is "accepting".
1032 * src/tables.c (action_row): If lr.default_rules is not "all",
1033 then disable default rules in inconsistent states.
1034 * src/print.c (print_reductions): Use this opportunity to
1035 perform some assertions about whether lr.default_rules was
1036 obeyed correctly.
1037 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
1038 helps with checking the parser tables for a grammar.
1039 * tests/input.at (%define lr.default_rules invalid values): New
1040 test group.
1041 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
1042 AT_TEST_TABLES_AND_PARSE.
1043 (`no %define lr.default_rules'): New test group generated by
1044 AT_TEST_LR_DEFAULT_RULES.
1045 (`%define lr.default_rules "all"'): Likewise.
1046 (`%define lr.default_rules "consistent"'): Likewise.
1047 (`%define lr.default_rules "accepting"'): Likewise.
1048
10492009-04-20 Akim Demaille <demaille@gostai.com>
1050
1051 Consistently refer to Yacc, not YACC.
1052 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
1053
10542009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
1055
1056 Pacify make maintainer-check-posix.
1057 * tests/input.at (%define, --define): Move bison command-line
1058 options before grammar file name.
1059
10602009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1061
1062 Document semicolon warnings.
1063 * NEWS (2.5): Here.
1064
10652008-12-08 Akim Demaille <demaille@gostai.com>
1066
1067 Fix portability issue in the test suite.
1068 * tests/local.at (AT_MATCHES_CHECK): New.
1069 Based on Perl instead of Sed. Sed has too many portability
1070 pitfalls, not ever Sed is GNU Sed.
1071 * tests/actions.at (Fix user actions without a trailing semicolon):
1072 Use it.
1073
10742008-12-07 Di-an Jan <dianj@freeshell.org>
1075
1076 Implement the FIXME that ends an user action with a semicolon
1077 if it seems necessary.
1078 * src/scan-code.l (flex rules section): Flag cpp directive from
1079 any `#' to the first unescaped end-of-line. Semicolon is not
1080 needed after `;', `{', '}', or cpp directives and is needed after
1081 any other token (whitespaces and comments have no effect).
1082 * tests/actions.at (Fix user actions without a trailing semicolon):
1083 New test.
1084 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
1085 to make user actions complete statements.
1086 Adjust column numbers in error messages.
1087 * tests/regression.at (Fix user actions without a trailing semicolon):
1088 Remove. Covered by new test.
1089
10902009-04-14 Akim Demaille <demaille@gostai.com>
1091
1092 doc: minor fixes.
1093 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
1094 (Table of Symbols): Remove duplicate entry for %debug.
1095
10962009-04-10 Eric Blake <ebb9@byu.net>
1097
1098 submodules: update to latest
1099 * submodules/autoconf: Use latest upstream Autoconf.
1100
11012009-04-06 Eric Blake <ebb9@byu.net>
1102
1103 Work around autoconf 2.63b bug in testsuite.
1104 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
1105 autoconf bug related to # in test.
1106
11072009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1108
1109 * NEWS (2.5): Describe new -D/--define feature.
1110
11112008-11-10 Akim Demaille <demaille@gostai.com>
1112
1113 --trace=muscles
1114 * src/getargs.h, src/getargs.c (trace_muscle): New.
1115 (trace_types, trace_args): Support it.
1116 * src/output.c (output_skeleton): Use it.
1117
11182008-11-10 Akim Demaille <demaille@gostai.com>
1119
1120 muscles_output.
1121 * src/output.c (muscles_output): New, extracted from...
1122 (output_skeleton): here.
1123 Adjust.
1124
11252008-11-21 Akim Demaille <demaille@gostai.com>
1126
1127 Display the changes in cross-options.texi.
1128 * build-aux/cross-options.pl ($sep): New, to separate items.
1129 * doc/Makefile.am ($(srcdir)/cross-options.texi): Use diff to display
1130 the changes.
1131
11322008-11-20 Di-an Jan <dianj@freeshell.org>
1133
1134 Improves options in the manual.
1135 * doc/bison.texinfo (-g, -x): Add space before argument.
1136 (Option Cross Key): Implement FIXME: listing directives also.
1137 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
1138 (Short Option): Special case -d. Put arguments inside @option.
1139 (Bison Directive): Add column, automatically extracted from
1140 src/scan-gram.l (actual name passed as the first argument)
1141 with special case for %define.
1142 * doc/Makefile.am (doc/cross-options.texi): Pass src/scan-gram.l
1143 to build-aux/cross-options.pl.
1144 * src/getargs.c (usage): Document limitations of cross-options.pl.
1145 * src/scan-gram.l: Likewise.
1146
11472009-02-25 Akim Demaille <demaille@gostai.com>
1148
1149 Copyright years.
1150 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
1151
11522008-12-08 Akim Demaille <demaille@gostai.com>
1153
1154 Install autoconf as a submodule to get m4sugar.
1155 * .gitmodules: Add submodules/autoconf.
1156 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
1157 submodules/autoconf.
1158
11592008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1160
1161 Simplify last patch slightly.
1162 * src/getargs.c (getargs): Here.
1163
11642008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1165
1166 Fix last warning from --enable-gcc-warnings.
1167 * src/getargs.c (getargs): Don't assign const address to non-const
1168 pointer.
1169
11702008-11-17 Di-an Jan <dianj@freeshell.org>
1171
1172 Handle --enable-gcc-warnings.
1173 * src/getargs.c (command_line_location): Set parameters to void.
1174
11752008-11-11 Akim Demaille <demaille@gostai.com>
1176
1177 AT_FULL_COMPILE.
1178 * tests/actions.at, tests/regression.at: Use it.
1179
11802008-11-07 Akim Demaille <demaille@gostai.com>
1181
1182 Pass command line location to skeleton_arg and language_argmatch.
1183 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
1184 The location argument is now mandatory.
1185 Adjust all dependencies.
1186 (getargs): Use command_line_location.
1187
11882008-11-07 Akim Demaille <demaille@gostai.com>
1189
1190 -D, --define.
1191 * src/getargs.c (usage): Document -D.
1192 Fix help string for --locations.
1193 (command_line_location): New.
1194 (short_options, long_options, getargs): Support -D, --define.
1195 (getargs): Move -d support at the right place.
1196 * doc/bison.texinfo (Bison Options): Update.
1197 * tests/input.at (%define, --define): New.
1198
11992008-11-07 Akim Demaille <demaille@gostai.com>
1200
1201 Initialize the muscle table before parsing the command line.
1202 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
1203 (getargs): Define file_name.
1204 * src/main.c (main): Initialize muscle_tab before calling
1205 getargs.
1206 * src/muscle_tab.c (muscle_init): No longer define file_name, as
1207 its value is not available yet.
1208
12092008-11-09 Akim Demaille <demaille@gostai.com>
1210
1211 Require the generation of parse-gram.output.
1212 * src/Makefile.am (YACC): Pass --report=all.
1213
12142009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1215
1216 * NEWS (2.5): New stub.
1217
12182009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1219
1220 Fix options documentation.
1221 * build-aux/cross-options.pl: As in --help output, write optional
1222 arguments as [=ARG] not =[ARG].
1223 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
1224
12252008-11-07 Akim Demaille <demaille@gostai.com>
1226
1227 Fix --help.
1228 * src/getargs.c (usage): Fix help string for -W.
1229
12302008-11-07 Akim Demaille <demaille@gostai.com>
1231
1232 Handle more general types of option arguments.
1233 * build-aux/cross-options.pl: The argument ends at the first
1234 space, not the first non-symbol character.
1235 Use @var for each word appearing the argument description.
1236
12372009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1238
1239 Remove spurious initial empty lines.
1240 * data/location.cc: End the @output lines with an @.
1241
12422008-11-04 Akim Demaille <demaille@gostai.com>
1243
1244 Remove spurious initial empty lines.
1245 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1246 * data/yacc.c: End the @output lines with an @.
1247
12482009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1249
1250 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
1251 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
1252 requirements for a correct m4 are stricter.
1253 * m4/m4.m4: Replace with Autoconf 2.63's m4/m4.m4.
1254 * configure.ac: Update to use AC_PROG_GNU_M4.
1255 Reported by Eric Blake.
1256
12572009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1258
1259 Help with updating web manual.
1260 * HACKING: Incorporate instructions from gnulib/doc/README.
1261 * bootstrap.conf (gnulib_modules): Add gendocs.
1262
12632009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1264
1265 Fix strange %define locations for default values.
1266 Reported by Akim Demaille at
1267 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
1268 and discussed again starting at
1269 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
1270 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
1271 because location information is bogus.
1272 Use angle brackets to delimit fake file name because square brackets
1273 look like underexpanded m4. Choose a better fake file name.
1274 Use negative line numbers.
1275 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
1276 * src/location.c (location_print): If line for a boundary is negative,
1277 only print that boundary's file name.
1278 * src/location.h: Document that.
1279 * tests/skeletons.at (%define Boolean variables: invalid skeleton
1280 defaults): Update output.
1281
12822008-11-07 Akim Demaille <demaille@gostai.com>
1283
1284 Locations without columns for command line arguments.
1285 * src/location.c (location_print): Don't display negative columns.
1286 * src/location.h: Document this.
1287
12882009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
1289
1290 Add reminder about uploading public key to keys.gnupg.net.
1291 * HACKING (Release Procedure): Here.
1292
12932009-03-31 Akim Demaille <demaille@gostai.com>
1294
1295 bootstrap: --help to stdout.
1296 * bootstrap (usage): Don't send --help to stderr.
1297 Use a here doc instead of a long string.
1298
12992009-03-31 Akim Demaille <demaille@gostai.com>
1300
1301 bootstrap: README-hacking no longer exists
1302 * bootstrap (checkout_only_file): Set to HACKING.
1303
13042009-03-26 Akim Demaille <demaille@gostai.com>
1305
1306 doc: merge HACKING and README-hacking.
1307 Two files is confusing.
1308 Reported by Alexandre Duret-Lutz.
1309
1310 * README-hacking: Merge into...
1311 * HACKING (Working from the repository): here.
1312
13132009-03-26 Akim Demaille <demaille@gostai.com>
1314
1315 doc: update README-hacking.
1316 * README-hacking: We now use git and git submodules.
1317 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
1318
13192009-03-26 Akim Demaille <demaille@gostai.com>
1320
1321 lalr1.cc: avoid GCC 4.3 warnings.
1322 GCC 4.3 now warns about "a || b && c" and asks for explicit
1323 parentheses.
1324 Reported by Alexandre Duret-Lutz.
1325 * data/location.cc: Update copyright years.
1326 (Position::operator==): Use parens to make precedence explicit.
1327 Compare lines and columns first, as they are more likely to be
1328 different, and they are faster to compare.
1329
13302009-03-26 Akim Demaille <demaille@gostai.com>
1331
1332 gnulib: update.
1333 * gnulib: Update to latest.
1334 * lib/Makefile.am (AM_CPPFLAGS): It is now defined by gnulib, so
1335 use +=.
1336
13372009-01-08 Akim Demaille <demaille@gostai.com>
1338
1339 Fix grep portability issues.
1340 Grep on Solaris does not support -q.
1341 Reported by Summum Bonum.
1342
1343 * NEWS: Add a stub for 2.4.2.
1344 * THANKS: Add Summum Bonum.
1345 * tests/atlocal.in (EGREP): New.
1346 (CC, CXX, XSLTPROC): Make it possible to override them via
1347 envvars.
1348 * tests/java.at: Use $EGREP instead of egrep.
1349 Use AT_CHECK's ignore instead of grep's -q.
1350
13512008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1352
1353 Version 2.4.1.
1354 * NEWS: Set version and date.
1355 * lib/Makefile.am: Update copyright year.
1356 * tests/atlocal.in: Update copyright year.
1357
13582008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1359
1360 Semicolon feature removal is not about future language support.
1361 * NEWS: The semicolon feature is no longer active for newer languages,
1362 so don't claim that it causes trouble for them.
1363
13642008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1365
1366 * gnulib: Update submodule to HEAD.
1367
13682008-12-09 Akim Demaille <demaille@gostai.com>
1369
1370 Update data/README.
1371 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
1372
13732008-12-05 Eric Blake <ebb9@byu.net>
1374
1375 Build testsuite with newer autoconf.
1376 * tests/output.at (m4_expand): Don't override in newer autoconf,
1377 where the underlying implementation changed.
1378 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
1379 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
1380 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
1381 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
1382 since some of them contain unbalanced ')'.
1383
13842008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
1385
1386 * NEWS: Clarify a little.
1387
13882008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
1389
1390 * NEWS: Update for recent changes.
1391
13922008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1393
1394 Fix unexpanded macros in GLR defines file.
1395 Reported by Csaba Raduly at
1396 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
1397 * THANKS (Csaba Raduly): Add.
1398 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
1399 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
1400 lexer in a separate module that includes the defines file.
1401 (AT_CHECK_CALC): Use AT_FULL_COMPILE and request compilation of lexer
1402 source.
1403 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
1404 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
1405 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
1406 (AT_DATA_SOURCE_PROLOGUE): New.
1407 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
1408 (AT_DATA_SOURCE): New.
1409 (AT_FULL_COMPILE): New, copied from master branch and extended to
1410 support an additional source file.
1411
14122008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1413
1414 Don't let maintainer-*-check targets force a version update.
1415 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
1416 handled.
1417
14182008-11-17 Di-an Jan <dianj@freeshell.org>
1419
1420 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
1421 Align menus. Adjust word wrapping. Use node names for menu names.
1422 (Examples): Don't abbreviate node names.
1423 (LocalWords): Remove abbreviations.
1424 (Copying): Make description a sentence.
1425 (Java Action Features): Remove period to match the rest of menu.
1426
14272008-11-11 Paolo Bonzini <bonzini@gnu.org>
1428
1429 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
1430 * configure.ac: Adjust usage.
1431 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1432 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1433 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
1434
14352008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1436
1437 Don't add a semicolon to actions for %skeleton or %language.
1438 It breaks Java test cases as reported by Akim Demaille.
1439 * src/scan-code.l: Implement.
1440
14412008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1442
1443 Clean up %skeleton and %language priority implementation.
1444 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
1445 remove static qualifier because others will soon need to see it.
1446 (language_prio): Likewise.
1447 (getargs): Use command_line_prio rather than 0.
1448 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
1449 enum fields.
1450 (skeleton_prio): Extern it.
1451 (language_prio): Extern it.
1452 * src/parse-gram.y: Use grammar_prio rather than 1.
1453
14542008-11-04 Akim Demaille <demaille@gostai.com>
1455
1456 * NEWS: Mention the trailing semicolon in action.
1457
14582008-11-04 Akim Demaille <demaille@gostai.com>
1459
1460 Reformat NEWS.
1461 * NEWS: Use more outline-mode markup.
1462 Suggested by Jim Meyering.
1463
14642008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
1465
1466 Fix user actions without a trailing semicolon.
1467 Reported by Sergei Steshenko at
1468 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
1469 * THANKS (Sergei Steshenko): Add.
1470 * src/scan-code.l (SC_RULE_ACTION): Fix it.
1471 * tests/regression.at (Fix user actions without a trailing semicolon):
1472 New test case.
1473
14742008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1475
1476 Initiate further development.
1477 * NEWS: Create an empty section for new entries.
1478 * gnulib: Update submodule to HEAD.
1479
14802008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1481
1482 * NEWS: Version 2.4.
1483
14842008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1485
1486 Prepare for next release.
1487 * NEWS: Briefly mention changes since 2.3b.
1488 * README: Say GNU m4 1.4.6, which we've been requiring in release
1489 announcements already, not 1.4.3, which breaks the build.
1490
14912008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1492
1493 Say %language is experimental.
1494 We're thinking of extending it's effect on output file naming. See the
1495 thread at
1496 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
1497 * NEWS: Say it's experimental.
1498 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
1499 recommend it over %skeleton for now.
1500 (Bison Options): Likewise.
1501 (C++ Bison Interface): Use %skeleton not %language.
1502 (Calc++ Parser): Use %skeleton not %language.
1503 * src/getargs.c (usage): Say it's experimental.
1504
15052008-11-01 Di-an Jan <dianj@freeshell.org>
1506 Paolo Bonzini <bonzini@gnu.org>
1507
1508 Support all Java parser class modifiers.
1509 * data/java.m4 (b4_percent_define_get3): New.
1510 (b4_final_if, b4_strictfp_if): New.
1511 * data/lalr1.java (final, strictfp, extends, implements): Support.
1512 * doc/bison.texinfo (final, strictfp, extends, implements): Add
1513 documentation.
1514 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
1515 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
1516 (AT_CHECK_JAVA_GREP): New.
1517 (Java parser class modifiers): New test.
1518 (Java parser class extends and implements): New test.
1519
1520 Model exception propagation better with throws and lex_throws.
1521 * data/java.m4 (b4_list2): New.
1522 (throws): Change default.
1523 * data/lalr1.java (yyaction): Add throws.
1524 (parse): Add lex_throws in addition to throws.
1525 * doc/bison.texinfo (throws, lex_throws): Add documentation.
1526 * tests/java.at (Java throws specifications): New test.
1527
1528 Improve documentation for Java parsers.
1529 * doc/bison.texinfo (Java Parsers): Add subsections.
1530 Don't quote first argument of %define.
1531 (Java Bison Interface): Document output files. Move documentation
1532 of parser class and merge into Java Parser Interface. Document
1533 features that error out. Document directives with no effect.
1534 Move note about Javadoc higher.
1535 (Java Semantic Values): Explicitly mention stype.
1536 Document that generic types cannot be used.
1537 (Java Location Values): Use @deftypeivar. Document constructors.
1538 Correct return value for toString.
1539 (Java Parser Interface): List undocumented constants/fields.
1540 Move documentation of fields added by %parse-param closer to list
1541 of members. Document that token names are added as fields.
1542 Document constructors accurately. Remove error method.
1543 (Java Scanner Interface): Move note on %pure-parser to Java Bison
1544 Interface. Describe %code lexer and yylex accutately.
1545 Remove documentation that does not match the code.
1546 (Java Action Features): New.
1547 (Java Differences): Add reference. Add item on semantic values.
1548 Add note about @{ ... @}. Clarify %% epilogue placement.
1549 (Java Declarations Summary): New.
1550
1551 Fix Java skeleton.
1552 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
1553 (b4_remove_comma): Quote test argument.
1554 (b4_identification): Remove "bison" field.
1555 * tests/java.at (Java parser class and package names): New test.
1556 (Java %parse-param and %lex-param): New test.
1557 (Java stype, position_class and location_class): New test.
1558
15592008-10-31 Di-an Jan <dianj@freeshell.org>
1560
1561 * data/lalr1.jave: Update copyright years.
1562 (YYParser): Correct name of "generated from" file in Javadoc:
1563 use b4_file_name instead of @ofile@.
1564 (Location constructor): Correct Javadoc parameter name.
1565 (yylloc): Add missing opening m4 quote after b4_location_if.
1566 This removes a stray [ in the Javadoc of Lexer.getStartPos.
1567 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
1568 (YYParser constructor): Correct Javadoc parameter name.
1569
15702008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
1571
1572 Always put auxiliary code files in the same dir as other output files.
1573 * src/files.c (compute_file_name_parts): When the user specifies
1574 --output but not --file-prefix, extract the directory prefix from the
1575 file prefix not from the grammar file name. This affects the location
1576 of files like location.hh generated by the C++ skeleton. The includes
1577 in the other output files require this fix.
1578 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
1579 for expected output files.
1580 (Output files): Add a test for the above.
1581
15822008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
1583
1584 * gnulib: Update submodule to HEAD.
1585
15862008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1587
1588 Update copyright year.
1589 * src/files.c: Here.
1590
15912008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
1592
1593 Don't overwrite the input file.
1594 * src/files.c (output_file_name_check): Fatal error if using input file
1595 for output.
1596 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
1597 argument.
1598 (Conflicting output files): Add test.
1599
16002008-10-28 Akim Demaille <demaille@gostai.com>
1601
1602 Space changes.
1603 * data/lalr1.cc: Formatting changes.
1604
16052008-10-28 Akim Demaille <demaille@gostai.com>
1606
1607 Don't define debugging functions when !YYDEBUG.
1608 * data/lalr1.cc (debug_stream, set_debug_stream)
1609 (debug_level_type, debug_level, set_debug_level): Don't
1610 declare them when YYDEBUG is not defined.
1611 The implementation are already YYDEBUG-aware.
1612
16132008-10-28 Akim Demaille <demaille@gostai.com>
1614
1615 Prefer "continue" for empty loop bodies.
1616 * etc/bench.pl.in: Use "continue" instead of {}.
1617
16182008-10-28 Akim Demaille <demaille@gostai.com>
1619
1620 Space and comments changes.
1621 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
1622 * data/c.m4, data/lalr1.cc: Space changes.
1623
16242008-10-28 Akim Demaille <demaille@gostai.com>
1625
1626 Make gnulib a submodule.
1627 * gnulib: New.
1628 * .gitmodules (gnulib): New.
1629
16302008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1631
1632 Fix yyerror_range for user-defined location type in C++. Reported by
1633 Georg Sauthoff at
1634 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
1635 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
1636 * THANKS (Georg Sauthoff): Add.
1637
16382008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1639
1640 Update several administrative files mainly to facilitate releasing.
1641 * HACKING (Administrivia): Make the git-merge-changelog notes more
1642 helpful.
1643 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
1644 (Release Procedure): Update for git and add numerous details that were
1645 previously missing.
1646 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
1647 * maint.mk (announcement): Don't list bison as a bootstrap tool so
1648 that announcements don't claim we bootstrapped with whatever bison
1649 happened to be in PATH. Add flex as a bootstrap tool.
1650 * Makefile.maint: Remove, previously replaced by maint.mk.
1651 * Makefile.cfg: Remove, and migrate settings to...
1652 * cfg.mk: ... here for the sake of `make announcement'.
1653 * bootstrap.conf (gnulib_modules): Add announce-gen.
1654 * README: Say GNU Bison instead of just Bison. Suggested by Karl
1655 Berry.
1656
16572008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
1658
1659 Small but important bugfixes for the Java skeleton.
1660 * data/lalr1.java (yyerror): Change Location to b4_location_type.
1661 (yy_symbol_print): Call toString on yyvaluep.
1662
16632008-08-29 Akim Demaille <demaille@gostai.com>
1664
1665 Clarify UPDATED use.
1666 * doc/bison.texinfo: It refers to the last edition of this file,
1667 not to the release date of Bison.
1668 Reported by Joel E. Denny.
1669
16702008-08-29 Akim Demaille <demaille@gostai.com>
1671
1672 * README: Update FAQ pointer.
1673 Reported by Joel E. Denny.
1674
16752008-08-27 Eric Blake <ebb9@byu.net>
1676
1677 Resync m4sugar from autoconf.
1678 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
1679 (m4_init): Adjust to latest m4.git changes.
1680 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
1681 effects.
1682 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
1683 (_m4_list_cmp): Reduce side effects.
1684
16852008-08-27 Akim Demaille <demaille@gostai.com>
1686
1687 Check yyerrok in calc.at.
1688 * tests/calc.at (calc.y): Use yyerrok on "( error )".
1689 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
1690 expected.
1691
16922008-08-27 Akim Demaille <demaille@gostai.com>
1693
1694 Support yyerrok in lalr1.cc.
1695 YYBACKUP is still to import back into lalr1.cc.
1696 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
1697
16982008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1699
1700 For maintainer-check*, don't recompile for a $(VERSION) update.
1701 * cfg.mk: New file.
1702 (_is-dist-target): Override the one in GNUmakefile.
1703 * Makefile.am (EXTRA_DIST): Add cfg.mk.
1704
17052008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
1706
1707 Update for recent change to gnulib.
1708 * src/parse-gram.y: Don't include strverscmp.h. It comes from
1709 string.h now.
1710
17112008-08-15 Eric Blake <ebb9@byu.net>
1712
1713 Remaining m4sugar merge from autoconf.
1714 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
1715 * data/m4sugar/foreach.m4: New file, copied from autoconf.
1716 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
1717 * src/output.c (output_skeleton): Tell m4 how to find it.
1718
1719 Partial m4sugar merge from autoconf: m4_map.
1720 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
1721 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
1722 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
1723 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
1724 for empty list.
1725 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
1726 Likewise.
1727 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
1728 declares it.
1729
17302008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
1731
1732 Keep .version and PACKAGE_VERSION in sync.
1733 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
1734 dependency, and add comments justifying this in more detail. Discussed
1735 starting at
1736 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
1737
17382008-08-06 Eric Blake <ebb9@byu.net>
1739
1740 Partial m4sugar merge from autoconf: m4_shiftn.
1741 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
1742 (m4_shift2, m4_shift3): New macros.
1743 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
1744 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
1745 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
1746 * data/java.m4 (b4_remove_comma): Likewise.
1747
1748 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
1749 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
1750 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
1751 (m4_init): Consolidate wrapped text into single m4_wrap.
1752 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
1753 in wrapped text.
1754
17552008-08-05 Eric Blake <ebb9@byu.net>
1756
1757 Partial m4sugar merge from autoconf: builtins, version.m4.
1758 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
1759 (m4_prepend): Remove, as it is unused and inherently quadratic,
1760 whereas m4_append is linear in newer m4.
1761 (m4_mkstemp): New builtin.
1762 (m4_symbols): Make rename conditional.
1763 (m4_version_prereq): Ensure fatal error if used in bison, which
1764 intentionally lacks version.m4.
1765
1766 Fix comments in m4sugar.
1767 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
1768
17692008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1770
1771 Update for recent .gitignore fix in Gnulib.
1772 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
1773 anchored .gitignore entries.
1774
17752008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
1776
1777 Set gnu or gnits strictness.
1778 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
1779 development and gnits strictness for releases. Based on Eric Blake's
1780 suggestion at
1781 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
1782
17832008-07-31 Paolo Bonzini <bonzini@gnu.org>
1784
1785 * NEWS: Clarify documentation of %language.
1786
17872008-07-31 Paolo Bonzini <bonzini@gnu.org>
1788
1789 Support usage of git-merge-changelog.
1790 * .gitattributes: New.
1791 * HACKING: Document usage of git-merge-changelog.
1792 * bootstrap: Install git-merge-changelog entries in .git/config
1793 if appropriate.
1794
17952008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1796
1797 Remove remaining dependence on CVS Id keyword.
1798 * ChangeLog: For the sake of people still using CVS, don't use dollars
1799 when mentioning Id.
1800 * data/xslt/bison.xsl: Remove Id from header comments, where it was
1801 unusual anyway.
1802 * data/xslt/xml2dot.xsl: Likewise.
1803 * data/xslt/xml2text.xsl: Likewise.
1804 * data/xslt/xml2xhtml.xsl: Likewise.
1805 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
1806 * doc/Makefile.am (neutralize): Remove, no longer needed.
1807 (.x.1): Don't use neutralize.
1808 (edit): Don't substitute for ID.
1809 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
1810
18112008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1812
1813 Fix dependence on computed configure variables.
1814 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
1815 $(top_srcdir)/configure.ac so that changes to computed variables, such
1816 as PACKAGE_VERSION, are seen.
1817 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
1818
18192008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
1820
1821 Update copyright dates for recent changes.
1822 * Makefile.am: Here.
1823 * src/Makefile.am: Here.
1824 * src/reduce.c: Here.
1825 * tests/reduce.at: Here.
1826
18272008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
1828
1829 Use git-version-gen for version names between releases.
1830 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
1831 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
1832 * .prev-version: New.
1833 * .version.in: Remove.
1834 * ChangeLog: Remove the Id previously used for capturing the CVS
1835 revision.
1836 * GNUmakefile: Remove, now copied from Gnulib.
1837 * Makefile.am: Add code suggested by comments in
1838 build-aux/git-version-gen.
1839 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
1840 .prev-version, and .version.
1841 * NEWS (2.3b+): Rename to...
1842 (?.?): ... this because we're dropping the "+" version naming scheme,
1843 but, in general, we still can't be sure of our next release name.
1844 * bootstrap: Add a quick hack to remove from .gitignore the
1845 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
1846 entry. This should really be fixed in gnulib instead.
1847 * bootstrap.conf (gnulib_modules): Add gnumakefile.
1848 * configure.ac (AC_INIT): Set version name by invoking
1849 build-aux/git-version-gen.
1850 (AC_CONFIG_FILES): Remove .version, now generated by
1851 build-aux/git-version-gen.
1852 * maint.mk: New, copied from coreutils.
1853 * doc/.cvsignore (bison.1): Add.
1854 * doc/.gitignore (/bison.1): Add.
1855 * doc/bison.1: Remove, generated.
1856 * src/.cvsignore (revision.c): Remove.
1857 * src/.gitignore (/revision.c): Remove.
1858 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
1859 (BUILT_SOURCES): Remove revision.c.
1860 (revision.c): Remove.
1861 * src/getargs.c (version): Don't print revision after the VERSION.
1862 * src/revision.h: Remove.
1863
18642008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1865
1866 Fix untranslatable composition of sentences. Reported by Goran
1867 Uddeborg at
1868 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
1869 * THANKS (Goran Uddeborg): Add.
1870 * src/reduce.c (reduce_print): Report the number of nonterminals and
1871 rules useless in the grammar in separate sentences.
1872 * tests/reduce.at (Useless Rules): Update output.
1873 (Reduced Automaton): Likewise.
1874 (Underivable Rules): Likewise.
1875 (Empty Language): Likewise.
1876
18772008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1878
1879 Fix some .gitignore and .cvsignore problems.
1880 * bootstrap (insert_sorted_if_absent): Replace all uses with...
1881 (insert_vc_ignore): ... this new function, which prepends `/' to all
1882 .gitignore entries before passing them to insert_sorted_if_absent.
1883 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
1884 .cvsignore files are maintained even though Bison developers run
1885 bootstrap while using Git.
1886 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
1887 unneeded by Bison.
1888 (gnulib): Add.
1889 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
1890 unneeded. Reported by Eric Blake.
1891 * lib/.gitignore (/*~): Add.
1892 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
1893 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
1894 Blake.
1895 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
1896
18972008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1898
1899 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
1900 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
1901 * bootstrap.conf (gnulib_modules): Add unsetenv.
1902 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
1903 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
1904 (/setenv.m4): Add.
1905 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
1906 the first argument because it may become position-dependent, and unset
1907 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
1908 Add comments explaining these issues in more detail.
1909
19102008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
1911
1912 Add .gitignore everywhere based on .cvsignore.
1913 * .gitignore: New.
1914 * build-aux/.gitignore: New.
1915 * data/.gitignore: New.
1916 * doc/.gitignore: New.
1917 * etc/.gitignore: New.
1918 * examples/.gitignore: New.
1919 * examples/calc++/.gitignore: New.
1920 * lib/.gitignore: New.
1921 * m4/.gitignore: New.
1922 * po/.gitignore: New.
1923 * runtime-po/.gitignore: New.
1924 * src/.gitignore: New.
1925 * tests/.gitignore: New.
1926
19272008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1928
1929 * NEWS (2.3b+): New section, empty for now.
1930 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
1931
19322008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1933
1934 * NEWS (2.3b): Update release date since there has been a delay in
1935 getting the announcements and tarballs out.
1936
19372008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1938
1939 * NEWS: Version 2.3b.
1940 * configure.ac (AC_INIT): Likewise.
1941 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
1942
19432008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
1944
1945 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
1946 been doing it for years.
1947 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
1948 (Release Procedure): Add FIXME about make alpha being unmaintained.
1949
19502008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
1951
1952 * data/yacc.c: Reformat m4 a little for readability.
1953 * src/lalr.c (build_relations): Correct comment.
1954
19552008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1956
1957 DJGPP specific issue.
1958 * djgpp/config.sed: Fixes required to run configure scripts generated
1959 by autoconf 2.62.
1960
19612008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1962
1963 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
1964 coordinator@translationproject.org.
1965
19662008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1967
1968 * THANKS: Add Eric Blake.
1969
19702008-04-23 Eric Blake <ebb9@byu.net>
1971
1972 Revert prior patch, by working around autoconf regression.
1973 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
1974 ("Output file name: ("): Uncomment test.
1975 ("Output file name: )"): Likewise.
1976 Based on an idea from Noah Misch.
1977
19782008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1979
1980 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
1981 2.61. Reported by Juan Manuel Guerrero at
1982 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
1983 * tests/output.at ("Output file name: ("): Comment out test case for
1984 now.
1985 ("Output file name: )"): Likewise.
1986
19872008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1988
1989 * GNUmakefile: Update git-version-gen invocation so make dist
1990 succeeds.
1991
19922008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1993
1994 Update to the current gnulib CVS repository, and fix trigraph handling
1995 in Bison.
1996 * bootstrap: Update gnulib CVS repository URL.
1997 (symlink_to_dir): Encapsulate the code that guarantees the destination
1998 directory exists into...
1999 (check_dst_dir): ... this new function, and...
2000 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
2001 fail when copying files into lib/uniwidth/.
2002 * src/output.c (prepare_symbols): When writing yytname muscles, where
2003 symbol names will be encoded in C-string literals, tell quotearg to
2004 escape trigraphs. This used to be the default in gnulib.
2005 * tests/regression.at (Token definitions): Because of the change in
2006 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
2007 escapes trigraphs in symbol names. Thus, yytname no longer has
2008 trigraphs unnecessarily doubly escaped. Update test case output.
2009 Extend test case to be sure Bison's own error messages will no longer
2010 have trigraphs in symbol names unnecessarily escaped once.
2011
20122008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2013
2014 Fix make dist infinite loop reported by Juan Manuel Guerrero at
2015 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
2016 * .cvsignore: Add .version.
2017 * .version.in: New.
2018 * bootstrap.conf (gnulib_modules): Add git-version-gen.
2019 * configure.ac (AC_CONFIG_FILES): Add .version.
2020 * build-aux/.cvsignore: Add git-version-gen.
2021
20222008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2023
2024 * NEWS (2.3a+): Mention that -g now takes an argument.
2025 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
2026 consistency. Update the -g and -x entries now that they take
2027 arguments. Use brackets to indicate optional arguments.
2028 * src/getargs.c (usage): Explain the relationship between arguments of
2029 long and short options more completely. Document --defines and -d
2030 separately since the former takes an argument but, for POSIX Yacc, the
2031 latter does not.
2032 (short_options): Let -W take an optional argument like --warnings.
2033 (getargs): Sort cases.
2034
20352008-02-28 Akim Demaille <demaille@gostai.com>
2036
2037 * doc/bison.texinfo: Fix a few typos.
2038
20392008-02-28 Akim Demaille <akim@epita.fr>
2040
2041 * doc/bison.texinfo (Bison Options): Document -W.
2042 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
2043
20442008-02-28 Akim Demaille <akim@epita.fr>
2045
2046 * src/getargs.c (short_options): Split and sort for readability.
2047 -g and -x take optional arguments, just like their long options.
2048 * build-aux/cross-options.pl: Use /x to make the regexp easier to
2049 understand.
2050 Fix the handling of $opt which resulted in all the argument to be
2051 considered as optional.
2052
20532008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
2054
2055 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
2056 say its interface is experimental.
2057 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
2058 Java.
2059 (Bison Options): In the -L and --language entry, mention Java.
2060 (Java Bison Interface): Say the interface is experimental.
2061 * src/getargs.c (usage): Mention -L and --language.
2062
2063 * NEWS (2.3a+): Say the push parsing interface is experimental.
2064 * doc/bison.texinfo (Push Decl): Likewise.
2065 (Decl Summary): Likewise in the "%define api.push_pull" entry.
2066 (Push Parser Function): Likewise.
2067 (Pull Parser Function): Likewise.
2068 (Parser Create Function): Likewise.
2069 (Parser Delete Function): Likewise.
2070 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
2071 yypull_parse, and yypush_parse entries.
2072
2073 * NEWS (2.3a+): Mention XML support, and say the schema is
2074 experimental.
2075 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
2076 * src/getargs.c (usage): Say the XML schema is experimental.
2077
2078 * NEWS (2.3a+): Say option instead of flag.
2079
20802008-02-21 Wojciech Polak <polak@gnu.org>
2081
2082 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
2083 text.
2084
20852008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
2086
2087 Fix impure push parser compile error reported by Bob Rossi at
2088 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
2089 * data/yacc.c: Clean up whitespace in the output a little.
2090 (yypstate_allocated): Define for impure push parsers regardless of
2091 whether the pull interface is also requested.
2092 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
2093 check impure push parsers without the pull interface.
2094
2095 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
2096 yyerror takes arguments specified by %parse-param while yypstate_new
2097 does not.
2098 * doc/bison.texinfo (Parser Create Function): Document that
2099 yypstate_new returns 0 for multiple impure parser instances.
2100 * tests/push.at (Push Parsing: Multiple impure instances): Update
2101 expected stderr output.
2102
21032008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
2104
2105 * runtime-po/POTFILES.in (push.c): Remove.
2106
21072008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
2108
2109 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
2110 * data/push.c: Rename to...
2111 * data/yacc.c: ... this, overwriting it.
2112 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
2113 `%push-pull-parser' -> `%define api.push_pull "both"'.
2114 Remove old yacc.c tests, and update push.c tests to yacc.c.
2115
21162008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
2117
2118 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
2119 `"%code top" blocks' instead of `%code "top" blocks'.
2120 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
2121 Clean up whitespace in the output a little.
2122
21232008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
2124
2125 Fix documentation problems reported by Tim Josling at
2126 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
2127 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
2128 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
2129 integers. Explain the effect of literal string aliases on error
2130 messages. Copy token 0 documentation from the C++ skeleton
2131 documentation.
2132
21332008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
2134
2135 Accept a token number in a %left, %right, or %nonassoc for POSIX
2136 conformance. Reported by Tim Josling at
2137 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
2138 * NEWS (2.3a+): Mention.
2139 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
2140 and code numbers are treated by precedence declarations.
2141 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
2142 of symbols.1.
2143 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
2144 of symbol.
2145 (symbol.prec): New, just like symbol but allows INT.
2146 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
2147 longer holds.
2148 * tests/regression.at (Token number in precedence declaration): New
2149 test case.
2150
21512008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2152
2153 DJGPP specific issues.
2154 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
2155 be changed. Copyright timestamp adjusted.
2156 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
2157 be changed. Copyright timestamp adjusted.
2158 * djgpp/config.site: Copyright timestamp adjusted.
2159 * djgpp/config_h.sed: Copyright timestamp adjusted.
2160 * djgpp/djunpack.bat: Copyright timestamp adjusted.
2161 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
2162 filename translation list.
2163 * djgpp/subpipe.c (init_subpipe): Check the environment variables
2164 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
2165 files shall be created. Before trying to use the temp dir where the
2166 environment variable points to check that the dir really exists. If
2167 not default to the cwd as temp dir. Copyright timestamp adjusted.
2168 * djgpp/subpipe.h: Copyright timestamp adjusted.
2169 * djgpp/testsuite.sed: Copyright timestamp adjusted.
2170
21712008-01-30 Paul Eggert <eggert@cs.ucla.edu>
2172
2173 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
2174
21752008-01-09 Paul Eggert <eggert@cs.ucla.edu>
2176
2177 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
2178 Problem reported by Claudio Saavedra in
2179 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
2180
21812008-01-05 Wojciech Polak <polak@gnu.org>
2182
2183 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
2184 document's title with the input grammar file name.
2185
21862007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
2187
2188 Automate regression testing of the XML/XSLT implementation. Discussed
2189 starting at
2190 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
2191 * configure.ac (XSLTPROC): New substitution.
2192 * Makefile.am (maintainer-xml-check): New phony target invoking...
2193 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
2194 invoking make maintainer-check with BISON_TEST_XML=1.
2195 * tests/atlocal.in (XSLTPROC): New.
2196 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
2197 not to report reachable memory when Bison is expected to have a
2198 non-zero exit status and (2) to compare XML/XSLT output with --graph
2199 and --report=all output for every working grammar when
2200 BISON_TEST_XML=1.
2201 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
2202 (AT_BISON_CHECK_XML): New.
2203 (AT_QUELL_VALGRIND): New.
2204 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
2205 (AT_CHECK): ... don't redefine this since this was the old way to
2206 quell Valgrind.
2207 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
2208 AT_BISON_CHECK invocations.
2209 * tests/c++.at: Likewise.
2210 * tests/calc.at: Likewise.
2211 * tests/conflicts.at: Likewise.
2212 * tests/cxx-type.at: Likewise.
2213 * tests/existing.at: Likewise.
2214 * tests/glr-regression.at: Likewise.
2215 * tests/headers.at: Likewise.
2216 * tests/input.at: Likewise.
2217 * tests/java.at: Likewise.
2218 * tests/output.at: Likewise.
2219 * tests/push.at: Likewise.
2220 * tests/reduce.at: Likewise.
2221 * tests/regression.at: Likewise.
2222 * tests/sets.at: Likewise.
2223 * tests/skeletons.at: Likewise.
2224 * tests/synclines.at: Likewise.
2225 * tests/torture.at: Likewise.
2226 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
2227 tends to hang xsltproc.
2228 (Big horizontal): Likewise.
2229
22302007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2231
2232 In XML output, remove redundant class attribute on symbol element.
2233 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
2234 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
2235 look up a symbol to determine whether it's a nonterminal or terminal.
2236 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
2237 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
2238
2239 Add prec/assoc information to XML output.
2240 * src/gram.c (grammar_rules_print_xml): For each rule that has a
2241 %prec, add a percent_prec attribute.
2242 * src/print-xml.c (print_grammar): For each terminal that has a
2243 precedence or associativity, add a prec or assoc attribute.
2244 (xml_indent): New.
2245 (xml_puts): Use xml_indent.
2246 (xml_printf): Use xml_indent.
2247 * src/print-xml.h (xml_indent): Prototype.
2248
2249 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
2250 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
2251
22522007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2253
2254 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
2255 (bison:ruleByNumber): ... this for clarity.
2256 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
2257 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
2258 (xsl:template match="reduction"): Update.
2259 (xsl:template match="item"): Update.
2260 (xsl:template match="reduction"): Update.
2261
2262 In the XML output, don't print the list of rules where symbols appear.
2263 Compute it in XSLT instead. Discussed at
2264 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
2265 * data/xslt/bison.xsl (bison:ruleByLhs): New.
2266 (bison:ruleByRhs): New.
2267 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
2268 bison:ruleByRhs.
2269 (xsl:template match="terminal/rule"): Remove.
2270 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2271 bison:ruleByRhs.
2272 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2273 Remove.
2274 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
2275 bison:ruleByRhs and mode="number-link" for rule template.
2276 (xsl:template match="terminal/rule"): Remove.
2277 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2278 bison:ruleByRhs and mode="number-link" for rule template.
2279 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2280 Rewrite as...
2281 (xsl:template match="rule" mode="number-link"): ... this.
2282 * src/print-xml.c (print_grammar): Don't print the list of rules.
2283
22842007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2285
2286 Don't let --report affect XML output; always print all information.
2287 Discussed at
2288 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
2289 * src/conflicts.c (log_resolution): Implement.
2290 * src/print-xml.c (print_core): Implement.
2291 (print_state): Implement.
2292 (print_xml): Implement.
2293
2294 * NEWS (2.3a+): Fix quotes.
2295 * src/parse-gram.y (prologue_declaration): For consistency with -v,
2296 don't let %verbose clear the list specified by --report.
2297
22982007-11-26 Akim Demaille <akim@epita.fr>
2299
2300 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
2301
23022007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
2303
2304 In the XML output, list useless and unused symbols and rules with the
2305 useful ones and add a "usefulness" attribute. Discussed starting at
2306 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
2307 * src/gram.c (grammar_rules_partial_print_xml): Remove.
2308 (grammar_rules_print_xml): Print all rules instead of just those
2309 useful in the grammar, and add a "usefulness" attribute.
2310 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
2311 * src/print-xml.c (print_rules_useless_in_parser): Remove.
2312 (print_grammar): Print all nonterminals instead of just useful ones,
2313 and add a "usefulness" attribute to nonterminals and terminals.
2314 (print_xml): Don't print a separate "reductions" or
2315 "rules-useless-in-parser" element.
2316 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
2317 (reduce_xml): Remove.
2318 (reduce_token_unused_in_grammar): New.
2319 (reduce_nonterminal_useless_in_grammar): New.
2320 * src/reduce.h (reduce_xml): Remove prototype.
2321 (reduce_token_unused_in_grammar): Add prototype.
2322 (reduce_nonterminal_useless_in_grammar): Add prototype.
2323 * data/xslt/xml2text.xsl: Update for XML changes.
2324 * data/xslt/xml2xhtml.xsl: Update for XML changes.
2325 * tests/reduce.at (Useless Terminals): Update output.
2326 (Useless Rules): Update output.
2327 (Reduced Automaton): Update output.
2328
2329 Say "Terminals unused in grammar" instead of "Unused terminals".
2330 * NEWS (2.3a+): Update.
2331 * doc/bison.texinfo (Understanding): Update example output.
2332 * src/reduce.c (reduce_output): Implement.
2333 * data/xslt/xml2text.xsl: Implement.
2334 * data/xslt/xml2xhtml.xsl: Implement.
2335
23362007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2337
2338 Accept --report-file=FILE to override the default `.output' filename.
2339 * NEWS (2.3a+): Mention.
2340 * doc/bison.texinfo (Bison Options): Add an entry.
2341 * src/files.c (compute_output_file_names): Don't override
2342 spec_verbose_file if already set.
2343 * src/getargs.c (usage): Document --report-file.
2344 (REPORT_FILE_OPTION): New anonymous enum member.
2345 (long_options): Add entry for it.
2346 (getargs): Add case for it setting spec_verbose_file.
2347
2348 * build-aux/cross-options.pl: Don't record a short option just because
2349 there's an arg.
2350 * doc/.cvsignore: Add yacc.1.
2351
23522007-11-14 Akim Demaille <akim@epita.fr>
2353
2354 * doc/yacc.1.in: New.
2355 * configure.ac, doc/Makefile.am: Adjust.
2356 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
2357 config.h symbol.
2358 Use AC_SUBST for assignments too.
2359 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
2360
23612007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2362
2363 * src/gram.c: Remove comments that duplicate comments in gram.h.
2364
2365 When reporting useless rules and nonterminals, say "useless in grammar"
2366 instead of "useless", and say "useless in parser" instead of "never
2367 reduced". Discussed starting at
2368 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
2369 * NEWS (2.3a+): Mention this change.
2370 * data/xslt/xml2text.xsl: Update output text and expected input XML
2371 element names to match changes below.
2372 * data/xslt/xml2xhtml.xsl: Likewise.
2373 (xsl:template match="bison-xml-report"): Add missing entry in Table of
2374 Contents: "Rules useless in parser due to conflicts".
2375 * doc/bison.texinfo (Decl Summary): Reword a little.
2376 (Understanding): Update example output for changes below.
2377 * src/gram.c: (rule_useful_p): Rename to...
2378 (rule_useful_in_grammar_p): ... this.
2379 (rule_useless_p): Rename to...
2380 (rule_useless_in_grammar_p): ... this.
2381 (rule_never_reduced_p): Rename to...
2382 (rule_useless_in_parser_p): ... this.
2383 (grammar_rules_print): Update for renames.
2384 (grammar_rules_print_xml): Update for renames.
2385 (grammar_rules_never_reduced_report): Rename to...
2386 (grammar_rules_useless_report): ... this since it is used for either
2387 kind of useless rule.
2388 * src/gram.h: Reword comments and update function names in prototypes.
2389 * src/main.c (main): Say "rule useless in parser due to conflicts".
2390 * src/print-xml.c (print_rules_never_reduced): Rename to...
2391 (print_rules_useless_in_parser): ... this, and rename output XML
2392 element "rules-never-reduced" to "rules-useless-in-parser".
2393 (print_xml): Update for rename.
2394 * src/print.c (print_results): Say "Rules useless in parser due to
2395 conflicts".
2396 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
2397 (nonterminals_reduce): Say "nonterminal useless in grammar".
2398 (reduce_output): Say "Nonterminals useless in grammar".
2399 Say "Rules useless in grammar".
2400 (reduce_xml): Rename output XML element "useless" to
2401 "useless-in-grammar".
2402 (reduce_print): Don't report the count of grammatically useless rules
2403 as "rules never reduced" just because %yacc is specified.
2404 In the correct report of this count, say nonterminal(s) and rule(s)
2405 "useless in grammar".
2406 * tests/conflicts.at (S/R in initial): Update expected output.
2407 (Defaulted Conflicted Reduction): Likewise.
2408 (Unreachable States After Conflict Resolution): Likewise.
2409 * tests/existing.at (GNU pic Grammar): Likewise.
2410 * tests/reduce.at (Useless Nonterminals): Likewise.
2411 (Useless Rules): Likewise.
2412 (Reduced Automaton): Likewise.
2413 (Underivable Rules): Likewise.
2414 (Empty Language): Likewise.
2415
24162007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2417
2418 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
2419 here document and before the EOF so that BSD's implementation of Bourne
2420 shell doesn't parse the delimiter as part of the here document.
2421 * doc/.cvsignore: Add cross-options.texi.
2422 * src/getargs.c (usage): Add a blank line after the warning categories.
2423
24242007-11-08 Paolo Bonzini <bonzini@gnu.org>
2425
2426 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
2427
24282007-11-05 Akim Demaille <akim@epita.fr>
2429
2430 Remove Id: from bison.1.
2431 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
2432 (perl -0777 -pi -e 's/\.PP\nId): New.
2433 (.x.1): Use it to ignore the version control revision.
2434
24352007-11-05 Akim Demaille <demaille@gostai.com>
2436
2437 * build-aux/Makefile.am: Ship cross-options.pl.
2438 * doc/Makefile.am: Always refer to cross-options.texi with
2439 $(srcdir).
2440 (MAINTAINERCLEANFILES): Add it.
2441
24422007-11-04 Akim Demaille <demaille@gostai.com>
2443
2444 Generate the long/short option cross-table.
2445 * build-aux/cross-options.pl: New.
2446 * doc/Makefile.am (cross-options.texi): New.
2447 * doc/bison.texinfo: Use it.
2448
24492007-11-04 Akim Demaille <demaille@gostai.com>
2450
2451 Generate bison.1 using help2man.
2452 * doc/common.x, doc/bison.x: New.
2453 * doc/Makefile.am (bison.1, .x.1): New.
2454 The code is taken from autoconf-2.61/man/Makefile.am.
2455 * configure.ac: Look for help2man.
2456
24572007-11-04 Akim Demaille <demaille@gostai.com>
2458
2459 Complete --help.
2460 * src/getargs.c (usage): Document -W, make it clear that -d,
2461 -g and -x have optional arguments.
2462
24632007-11-04 Akim Demaille <demaille@gostai.com>
2464
2465 Find sha1sum when named gsha1sum.
2466 * bootstrap (find_tool): New.
2467 ($SHA1SUM): New.
2468
24692007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2470
2471 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
2472 at
2473 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
2474 * NEWS (2.3a+): Mention.
2475 * data/bison.m4 (b4_pure_if): Don't define it here.
2476 * data/c.m4 (b4_identification): Depend on individual skeletons to
2477 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
2478 values of the %define variables api.pure or api.push_pull. Define
2479 YYPURE, YYPUSH, and YYPULL accordingly.
2480 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
2481 glr.cc has already defined b4_pure_flag.
2482 * data/push.c: Define b4_pure_if based on `%define api.pure'.
2483 Remove YYPUSH and YYPULL since they're back in b4_identification again.
2484 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
2485 * doc/bison.texinfo (Pure Decl): Update.
2486 (Push Decl): Update.
2487 (Decl Summary): Add api.pure to %define entry.
2488 In %pure-parser entry, say it's deprecated and reference %define.
2489 (Pure Calling): Update.
2490 (Error Reporting): Update.
2491 (C++ Scanner Interface): Update.
2492 (How Can I Reset the Parser): Update.
2493 (Table of Symbols): In %pure-parser entry, say it's deprecated and
2494 reference %define.
2495 * src/getargs.c (pure_parser): Remove global variable.
2496 * src/getargs.h (pure_parser): Remove extern.
2497 * src/output.c (prepare): Don't define pure_flag muscle.
2498 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
2499 wrapper around `%define api.pure'.
2500 * tests/calc.at (Simple LALR Calculator): Update.
2501 (Simple GLR Calculator): Update.
2502 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
2503 Update.
2504 (GLR: Resolve ambiguity, pure, locations): Update.
2505 (GLR: Merge conflicting parses, pure, no locations): Update.
2506 (GLR: Merge conflicting parses, pure, locations): Update.
2507 * tests/glr-regression.at (Uninitialized location when reporting
2508 ambiguity): Update
2509 * tests/input.at (Unused %define api.pure): New test case.
2510 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
2511 AT_PURE_IF and AT_PURE_AND_LOC_IF.
2512 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2513
25142007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2515
2516 %define push_pull -> %define api.push_pull. Discussed starting at
2517 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
2518 * data/push.c: Expect the new name.
2519 * data/yacc.c: Likewise.
2520 * doc/bison.texinfo (Push Decl): Update.
2521 (Decl Summary): Update %define entry.
2522 (Push Parser Function): Update.
2523 (Pull Parser Function): Update.
2524 (Parser Create Function): Update.
2525 (Parser Delete Function): Update.
2526 * tests/calc.at (Simple LALR Calculator): Update.
2527 * tests/input.at (%define enum variables): Update.
2528 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2529 (Push Parsing: Multiple impure instances): Update.
2530 (Push Parsing: Unsupported Skeletons): Update.
2531 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
2532 (Exploding the Stack Size with Malloc): Update.
2533
2534 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
2535 other entries some.
2536
25372007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
2538
2539 For the XML output's terminal element, rename @number to @token-number,
2540 and add @symbol-number. In the nonterminal element, rename @number to
2541 @symbol-number. Discussed starting at
2542 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
2543 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
2544 renames.
2545 (xsl:template match="nonterminal"): Likewise.
2546 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
2547 (xsl:template match="nonterminal"): Likewise.
2548 * src/print-xml.c (print_grammar): Implement.
2549
25502007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2551
2552 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
2553 2007-10-11 change, the child elements here are items not rules.
2554 (xsl:template match="item"): New.
2555 (xsl:template match="rule"): Update for new reduced itemset.
2556 (xsl:template match="point"): Remove.
2557 (xsl:template match="empty"): For consistency with --graph, don't
2558 output "/* empty */".
2559 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
2560 line-wrap, don't pass a negative value as first-line-length since this
2561 won't work with the following changes.
2562 (xsl:template name="line-wrap"): Simplify slightly.
2563 (xsl:template name="ws-search"): Eliminate recursion.
2564 * src/print_graph.c (print_core): Don't print a reduction's lookahead
2565 set next to an item whose dot is not at the end of the RHS even if it
2566 happens to be associated with the same rule.
2567
25682007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2569
2570 Add %define lr.keep_unreachable_states.
2571 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
2572 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
2573 * src/main.c (main): Implement it.
2574 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2575 Extend to test it, and fix a typo.
2576
25772007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2578
2579 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
2580 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
2581 the example .output text.
2582 * tests/regression.at (Extra lookahead sets in report): Improve wording
2583 of comments.
2584
25852007-10-17 Wojciech Polak <polak@gnu.org>
2586
2587 * src/print-xml.c (print_grammar): Renamed
2588 <terminal> and <nonterminal> attributes:
2589 "type" to "number" and "symbol" to "name".
2590 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
2591 Use new attribute names.
2592 (xsl:template match="nonterminal"): Likewise.
2593 * data/xslt/xml2xhtml.xsl: Likewise.
2594
25952007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
2596
2597 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
2598 (Option Cross Key): Likewise.
2599
2600 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
2601 next to an item whose dot is not at the end of the RHS even if it
2602 happens to be associated with the same rule.
2603 * src/print.c (print_core): Likewise.
2604 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
2605 (Resolved SR Conflicts): Update output.
2606 * tests/regression.at (Extra lookahead sets in report): New test case.
2607
26082007-10-11 Wojciech Polak <polak@gnu.org>
2609
2610 * src/print-xml.c (print_core): Remove item set
2611 redundancy.
2612 * data/xslt/bison.xsl (bison:ruleNumber): New key.
2613 Improve processing time. Suggested by Joel E. Denny.
2614 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
2615 Write xsl:param "required" attribute as comment.
2616 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
2617 (xsl:template match="rule"): Support new reduced itemset.
2618 (xsl:template match="point"): Remove.
2619 * data/xslt/xml2xhtml.xsl: Likewise.
2620
26212007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2622
2623 * src/getargs.c (version): Update copyright year.
2624
26252007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2626
2627 Make xml2dot.xsl and --graph produce the same output.
2628 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
2629 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
2630 escaped later.
2631 (xsl:template name="output-node"): Use the new escape template instead
2632 of the string-replace template directly.
2633 (xsl:template name="output-edge"): Likewise.
2634 (xsl:template name="escape"): New, escapes backslashes and newlines in
2635 addition to quotation marks.
2636 * src/graphviz.c (start_graph, output_node, output_edge): Add
2637 whitespace to output for legibility.
2638
2639 Make xml2text.xsl and --report produce the same output, and remove the
2640 XML "conflicts" element since a conflict summary is easily extracted
2641 from the automaton.
2642 * data/xslt/bison.xsl: New.
2643 (xsl:template match="state" mode="bison:count-conflicts): New.
2644 * data/xslt/xml2text.xsl: Import bison.xsl.
2645 (xsl:template match="bison-xml-report"): Instead of styling the
2646 "conflicts" element, style the "automaton" element with mode
2647 "conflicts". Unlike the former, the latter lists S/R and R/R
2648 conflicts for a state on the same line.
2649 (xsl:template match="conflicts"): Remove.
2650 (xsl:template match="conflict"): Remove.
2651 (xsl:template match="terminal"): Line-wrap the list of rules in which
2652 the terminal is used.
2653 (xsl:template match="nonterminal"): Likewise for nonterminals.
2654 (xsl:template match="automaton" mode="conflicts"): New.
2655 (xsl:template match="state" mode="conflicts"): New.
2656 (xsl:template name="line-wrap"): New.
2657 (xsl:template name="ws-search"): New.
2658 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
2659 (xsl:template match="bison-xml-report"): Instead of styling the
2660 "conflicts" element, style the "automaton" element with mode
2661 "conflicts."
2662 (xsl:template match="conflicts"): Remove.
2663 (xsl:template match="conflict"): Remove.
2664 (xsl:template match="automaton" mode="conflicts"): New.
2665 (xsl:template match="state" mode="conflicts): New.
2666 * src/conflicts.c (conflicts_output_xml): Remove.
2667 * src/conflicts.h (conflicts_output_xml): Remove prototype.
2668 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
2669 * src/print.c (print_grammar): Consistently wrap at the 66th column so
2670 the corresponding XSLT is easier. Also, never wrap between a word and
2671 the comma that follows it.
2672
26732007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2674
2675 Improve C++ namespace support. Discussed starting at
2676 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
2677 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
2678 b4_namespace_close): New macros that interpret the %define variable
2679 "namespace" so its value can contain "::" to indicate nested
2680 namespaces.
2681 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
2682 the above macros.
2683 * data/lalr1.cc (b4_namespace): Likewise.
2684 * data/location.cc (b4_namespace): Likewise.
2685 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
2686 inside a new table in the general %define entry. Document `%define
2687 namespace' there as well. Point the %name-prefix entry to it since it
2688 explains it more completely in the case of C++.
2689 (C++ Bison Interface): Mention `%define namespace' instead of
2690 %name-prefix.
2691 (Table of Symbols): Remove the `%define push_pull' entry. The %define
2692 entry suffices.
2693 * tests/c++.at (Relative namespace references): New test case.
2694 (Absolute namespace references): New test case.
2695 (Syntactically invalid namespace references): New test case.
2696 * tests/input.at (C++ namespace reference errors): New test case.
2697
26982007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2699
2700 Add syncline support and location accessor to internal %define
2701 interfaces.
2702 * data/bison.m4 (b4_percent_define_get_loc): New.
2703 (b4_percent_define_get_syncline): New.
2704 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
2705 (b4_percent_define_default): Record defining location as line 1 rather
2706 than 0 for the sake of synchronizing #line's, and define
2707 b4_percent_define_syncline(VARIABLE).
2708 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
2709 * src/muscle_tab.c (muscle_syncline_grow): New.
2710 (muscle_code_grow): Use muscle_syncline_grow.
2711 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
2712 define b4_percent_define_syncline(VARIABLE).
2713 (muscle_percent_define_get_loc): New.
2714 (muscle_percent_define_get_syncline): New.
2715 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
2716 remove some unused variables.
2717 (muscle_percent_define_default): Record defining location as line 1
2718 rather than 0 for the sake of synchronizing #line's, and define
2719 b4_percent_define_syncline(VARIABLE).
2720 (muscle_percent_define_check_values): Use
2721 muscle_percent_define_get_loc.
2722 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
2723 (muscle_percent_define_get_syncline): Prototype.
2724 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2725 defaults): Update output for location change.
2726 (Complaining during macro argument expansion): Extend to test
2727 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
2728
27292007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
2730
2731 Fix some error-reporting macro bugs.
2732 * data/bison.m4 (b4_cat): New.
2733 (b4_error, b4_error_at): Use b4_cat to send error directives directly
2734 to stdout so they don't become arguments to other macros. Update
2735 comments and add examples.
2736 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
2737 add examples.
2738 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
2739 after printing the error directive so that M4 doesn't report subsequent
2740 problems that are induced by this problem.
2741 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
2742 instead of just in them. Recognize @\n in both places. Both expand to
2743 the empty string. Needed by b4_cat.
2744 * tests/skeletons.at (Complaining during macro argument expansion):
2745 New test case.
2746 (Fatal errors make M4 exit immediately): New test case.
2747
27482007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
2749
2750 Implement --print-datadir.
2751 * src/getargs.c (usage): Mention.
2752 (PRINT_DATADIR_OPTION): New anonymous enum member.
2753 (long_options): Add entry for it.
2754 (getargs): Add case for it calling compute_pkgdatadir.
2755 * src/output.c (output_skeleton): Encapsulate data directory
2756 computation from here...
2757 (prepare): ... and from here...
2758 (compute_pkgdatadir): ... into this new function.
2759 * src/output.h (compute_pkgdatadir): Prototype.
2760
27612007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
2762
2763 * src/print-xml.c (escape_bufs): New static global variable
2764 replacing...
2765 (xml_escape_n): ... the static local variable buf here.
2766 (print_xml): Free memory for escape_bufs.
2767 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
2768
27692007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
2770
2771 Replace `%push-parser' and `%push-pull-parser' with
2772 `%define push_pull "push"' and `%define push_pull "both"'.
2773 `%define push_pull "pull"' is the default.
2774 * doc/bison.texinfo (Push Decl, Push Parser Function,
2775 Pull Parser Function, Parser Create Function, Parser Delete Function):
2776 Update declarations.
2777 (Decl Summary, Table of Symbols): Replace %push-parser and
2778 %push-pull-parser entries with a %define push_pull entry.
2779 * data/bison.m4 (b4_percent_define_check_values): New macro.
2780 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
2781 definitions...
2782 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
2783 definitions...
2784 * data/push.c: ... to here and compute them from the value of the
2785 %define variable push_pull.
2786 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
2787 parsing requests here...
2788 * data/yacc.c: ... hack this to switch to push.c any time
2789 b4_use_push_pull_flag or the %define variable push_pull is set. This
2790 will go away when we mv push.c yacc.c.
2791 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
2792 push parsing is not supported since unused %define variables are
2793 reported anyway.
2794 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
2795 * src/muscle_tab.h (muscle_percent_define_check_values): Update
2796 comments for consistency with b4_percent_define_check_values.
2797 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
2798 muscles.
2799 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
2800 Remove.
2801 (prologue_declaration): Remove %push-parser and %push-pull-parser
2802 rules.
2803 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
2804 * tests/calc.at: Update declarations.
2805 * tests/input.at (%define enum variables): New test case.
2806 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
2807 declaration.
2808 (Push Parsing: Multiple impure instances): Update declaration.
2809 (Push Parsing: Unsupported Skeletons): New test case.
2810 * tests/torture.at (Exploding the Stack Size with Alloca): Update
2811 declaration.
2812 (Exploding the Stack Size with Malloc): Update declaration.
2813
28142007-09-24 Wojciech Polak <polak@gnu.org>
2815
2816 Add XSLT transformations.
2817
2818 * data/xslt/xml2dot.xsl: Transform XML into DOT.
2819 * data/xslt/xml2text.xsl: Transform XML into plain text.
2820 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
2821 * data/Makefile.am (xsltdir): New variable.
2822 (dist_xslt_DATA): Add xslt/*.xsl files.
2823
28242007-09-23 Paul Eggert <eggert@cs.ucla.edu>
2825
2826 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
2827 Problem reported by Wojciech Polak.
2828 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
2829 (xml_printf): Undo change I made on 21 September; that is,
2830 indent 2 spaces, not 1.
2831
28322007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
2833
2834 Pacify ./configure --enable-gcc-warnings.
2835 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
2836 `char const *' instead of `char *'.
2837 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
2838 local variable `sep'.
2839
28402007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2841
2842 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
2843 elsewhere.
2844 * src/print-xml.c: Prefer "const" after types; that's more consistent.
2845 (xml_printf): Indent just 1 space for level.
2846 (e_char, xlate_char): Remove.
2847 (xml_escape_string): Rewrite to avoid undefined behavior (used
2848 storage that was freed from the stack).
2849 (xml_escape_n): Don't bother checking for subscript error.
2850
28512007-09-21 Wojciech Polak <polak@gnu.org>
2852
2853 Add Bison XML Automaton Report.
2854
2855 Add support for an -x option to generate an XML report.
2856 It is not documented yet.
2857 * src/print-xml.c: New file.
2858 * src/print-xml.h: Likewise.
2859 * lib/timevar.def (TV_XML): New var.
2860 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
2861 * src/conflicts.c: Include print-xml.h.
2862 (solved_conflicts_xml_obstack): New var.
2863 (log_resolution, conflicts_solve, conflicts_free):
2864 Add support for XML report.
2865 (conflicts_output_val): New function.
2866 * src/conflicts.h (conflicts_output_val): New decl.
2867 * src/files.c (spec_xml_file): New var.
2868 (compute_output_file_names, output_file_names_free): Add XML support.
2869 * src/files.h (spec_xml_file): New decl.
2870 * src/getargs.c (xml_flag): New var.
2871 (usage, short_options, long_options, getargs): Add XML support.
2872 * src/getargs.h (xml_flag): New decl.
2873 * src/gram.c: Include print-xml.h.
2874 (rule_lhs_print_xml, rule_rhs_print_xml):
2875 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
2876 New functions.
2877 * src/gram.h: Declare external ones.
2878 * src/main.c: Include print-xml.h.
2879 (main): Add XML support.
2880 * src/reduce.c: Include print-xml.h.
2881 (reduce_xml): New function.
2882 * src/reduce.h: Declare it.
2883 * src/state.c: Include print-xml.h.
2884 (state_new): Add XML support.
2885 (state_rule_lookahead_tokens_print_xml): New function.
2886 * src/state.h: Declare it.
2887 (struct state): New member solved_conflicts_xml.
2888 * src/symtab.c (symbol_class_get_string): New function.
2889 * src/symtab.h: Declare it.
2890
28912007-09-21 Paul Eggert <eggert@cs.ucla.edu>
2892
2893 * GNUmakefile: Switch to coreutils's version.
2894 * bootstrap: Likewise.
2895 * Makefile.cfg: Adjust to new GNUmakefile.
2896 * README-hacking: Likewise.
2897
2898 Import from gnulib:
2899
2900 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
2901 Bruno Haible <bruno@clisp.org>
2902
2903 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
2904 and is a script that invokes bison. Tighten the code. Add comments.
2905
29062007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
2907
2908 Spell "boolean" as "Boolean". Reported by Akim Demaille.
2909 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
2910 * doc/bison.texinfo (Decl Summary): Fix.
2911 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
2912 * tests/input.at (Boolean %define variables): Update output.
2913 * tests/skeletons.at (%define boolean variables: invalid skeleton
2914 defaults): Rename to...
2915 (%define Boolean variables: invalid skeleton defaults): ... this and
2916 update output.
2917
29182007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
2919
2920 In impure push mode, don't allow more than one yypstate to be allocated
2921 since multiple impure parsers would corrupt yynerrs.
2922 * data/push.c (yypstate_allocated): New static global variable
2923 initialized to 0.
2924 (yypull_parse): If yypstate_new returns 0, don't report it as memory
2925 exhaustion if yypstate_allocated is 1, but still return 2.
2926 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
2927 already 1. Otherwise, set it to 1.
2928 (yypstate_delete): Set it to 0.
2929 * tests/push.at (Push Parsing: Multiple impure instances): New test
2930 case.
2931
29322007-08-17 Bob Rossi <bob@brasko.net>
2933
2934 * doc/bison.texinfo (Push Decl): Document the push parser.
2935 (Table of Symbols): Ditto.
2936 (Pure Decl): Ditto.
2937 (Decl Summary): Ditto.
2938 (Multiple Parsers, Push Parser Function, Pull Parser Function,
2939 Parser Create Function, Parser Delete Function):
2940 Add new push parser symbols.
2941 (Table of Symbols): Document push-parser, push-pull-parser,
2942 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
2943
29442007-08-15 Paul Eggert <eggert@cs.ucla.edu>
2945
2946 Update to GPLv3.
2947 * doc/gpl-3.0.texi: New file.
2948 * doc/gpl.texi: Remove.
2949 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
2950 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
2951 * README-hacking, TODO, bootstrap, bootstrap.conf:
2952 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
2953 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
2954 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
2955 * data/lalr1.cc, data/lalr1.java, data/location.cc:
2956 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
2957 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
2958 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
2959 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
2960 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
2961 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
2962 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
2963 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
2964 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
2965 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
2966 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
2967 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
2968 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
2969 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
2970 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
2971 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
2972 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
2973 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
2974 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
2975 * src/complain.c, src/complain.h, src/conflicts.c:
2976 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
2977 * src/files.h, src/flex-scanner.h, src/getargs.c:
2978 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
2979 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
2980 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
2981 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
2982 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
2983 * src/print.c, src/print.h, src/print_graph.c:
2984 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
2985 * src/reduce.h, src/relation.c, src/relation.h:
2986 * src/revision.h, src/scan-code.h, src/scan-code.l:
2987 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
2988 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
2989 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
2990 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
2991 * tests/Makefile.am, tests/actions.at, tests/c++.at:
2992 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
2993 * tests/existing.at, tests/glr-regression.at:
2994 * tests/headers.at, tests/input.at, tests/java.at:
2995 * tests/local.at, tests/output.at, tests/push.at:
2996 * tests/reduce.at, tests/regression.at, tests/sets.at:
2997 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
2998 * tests/torture.at:
2999 Update to GPLv3.
3000
30012007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3002
3003 Get rid of broken %no-parser, -n, and --no-parser implementation and
3004 documentation.
3005 * TODO: Don't mention them.
3006 * doc/bison.1: Likewise.
3007 * doc/bison.texinfo (Decl Summary): Likewise.
3008 (Bison Options): Likewise.
3009 (Option Cross Key): Likewise.
3010 * src/getargs.c (no_parser_flag): Remove global variable.
3011 (usage): Don't print description of -n and --no-parser.
3012 (long_options): Remove --no-parser entry here.
3013 (getargs): Remove -n case in the switch here.
3014 * src/getargs.h (no_parser_flag): Remove extern.
3015 * tests/regression.at (Web2c Actions): Remove comment that mentions
3016 --no-parser.
3017
30182007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3019
3020 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
3021 name user variables starting with `yy'. Just pass NULL instead of a
3022 dummy local &yylval to yypush_parse.
3023 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
3024 starting with `yy'.
3025
30262007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
3027
3028 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
3029 true since it's then always used regardless of whether yyoverflow is
3030 defined. Reported by Christian Burger at
3031 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
3032 * THANKS: Add Christian Burger.
3033
3034 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3035 node names: say "Decl Summary" not "Bison Declaration Summary".
3036
30372007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
3038
3039 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
3040 determine whether this function has already complained about an invalid
3041 value for a %define boolean variable, don't check whether Bison has
3042 ever examined the value. As written, the check was a tautology.
3043 Instead, record and check for this complaint using a separate muscle.
3044
30452007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3046
3047 Fix push parsing memory leak reported by Brandon Lucia at
3048 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
3049 * THANKS: Add Brandon Lucia.
3050 * data/push.c (yypstate_delete): Free the stack if it was reallocated
3051 but the parse never completed and thus freed it.
3052 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
3053 * tests/testsuite.at: Include push.at.
3054 * test/push.at: New.
3055 (Push Parsing: Memory Leak for Early Deletion): New test case.
3056
30572007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
3058
3059 Improve handling of multiple S/R conflicts in the same state and of S/R
3060 conflicts involving multiple reductions.
3061 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
3062 set for a state here or Bison will abort if it is reassigned on a
3063 later conflicted reduction in the same state.
3064 Similarly, don't finalize and assign the solved conflicts report here
3065 or it will be lost if it is reassigned on a later conflicted reduction
3066 in the same state.
3067 (set_conflicts): Instead, assign them both here after all S/R conflicts
3068 in the state have been fully examined.
3069 * src/print.c (shift_set): Rename to...
3070 (no_reduce_set): ... this.
3071 (print_reductions): Update for rename, and add %nonassoc error action
3072 tokens to no_reduce_set so that, when printing the first remaining
3073 reduction on an error action token, the reduction is enclosed in
3074 brackets.
3075 (print_results): Update for rename.
3076 * tests/conflicts.at (Solved conflicts report for multiple reductions
3077 in a state): New test case.
3078 (%nonassoc error actions for multiple reductions in a state): New test
3079 case.
3080
3081 * src/main.c (main): Don't depend on C99 features.
3082
30832007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3084
3085 * build-aux/.cvsignore: Add compile.
3086 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
3087 uniwidth.
3088
30892007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
3090
3091 * bootstrap (slurp): Create target directories that don't exist.
3092 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
3093
30942007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3095
3096 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
3097 than item number.
3098 * closure.c (closure): Likewise.
3099 * state.h (reductions): Comment sorting of rules.
3100 (state): Comment sorting of items.
3101
31022007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
3103
3104 Fix C++ test cases after recent Gnulib changes. Discussed starting at
3105 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
3106 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
3107 definition in order to avoid Gnulib headers since we don't use config.h
3108 here.
3109 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
3110 rather than AT_DATA so that config.h is included.
3111
31122007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
3113
3114 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
3115 instead of fprintf. Guard these functions with #if YYDEBUG instead of
3116 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
3117 and so that YYFPRINTF is guaranteed to be defined here.
3118
31192007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
3120
3121 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
3122 with...
3123 (muscle_percent_define_check_values): ... this more helpful function.
3124 Again, it's not used yet, but it will be.
3125 * src/muscle_tab.h: Likewise.
3126
3127 Improve some comments in parser table construction.
3128 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
3129 (generate_states): Don't mention ruleset, which is internal to closure.
3130 * src/closure.c (closure): Explain sorting of core and itemset, which
3131 is required for this function to behave correctly.
3132 * src/closure.h (closure): Mention sorting.
3133
31342007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
3135
3136 * src/lalr.c (state_lookahead_tokens_count): For code readability,
3137 move the check for disabled transitions to an aver since conflict
3138 resolution hasn't happened yet.
3139
3140 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
3141 labels a state as inconsistent just because it has error transitions.
3142 The original form of this check appeared in revision 1.1 of lalr.c,
3143 which was committed on 1991-12-21. Now (at least), changing the
3144 consistency label on such a state appears to have no useful effect in
3145 any of the places it is examined, which I enumerate below. The key
3146 point to understanding each item in this enumeration is that a state
3147 with an error transition is labelled consistent in the first place only
3148 if it has no rules, so the check cannot matter for states that have
3149 rules. (1) Labelling a state as inconsistent will cause set_conflicts
3150 to try to identify its conflicts, and a state must have *rules* to have
3151 conflicts. (2) Labelling a state as inconsistent will affect how
3152 action_row sets the default *rule* for the state. (3) Labelling a
3153 state as inconsistent will cause build_relations to add lookback edges
3154 to *rules* in that state.
3155 * src/state.h (struct state): Word the comment for member consistent
3156 more carefully.
3157
31582007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3159
3160 Don't depend on C99 features.
3161 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
3162 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
3163 * src/reader.c (check_and_convert_grammar): Fix for-loop.
3164 * src/state.c (state_mark_reachable_states): Fix for-loop.
3165 (state_remove_unreachable_states): Fix for-loop.
3166
3167 Don't widen struct state with member reachable just to temporarily
3168 record reachability. Instead, use a local bitset.
3169 * src/state.h (struct state): Remove member.
3170 * src/state.c (state_new): Don't initialize it.
3171 (state_mark_reachable_states): Rename to...
3172 (state_record_reachable_states): ... this, and use bitset.
3173 (state_remove_unreachable_states): Use bitset.
3174
31752007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
3176
3177 * src/Makefile.am (yacc): Quote target action commands properly so
3178 that the yacc script isn't corrupt. Reported by Hans Aberg at
3179 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
3180
3181 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
3182 the case of pure parsers. Reported by Frans Englich at
3183 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
3184 * THANKS: Add Frans Englich.
3185
3186 * NEWS (2.3a+): In the %code entry, reference section `Bison
3187 Declaration Summary' from the manual now since the %code summary has
3188 moved there.
3189 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
3190 in the rules section must be terminated by semicolons.
3191
31922007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
3193
3194 Extend the front-end API for %define variables to more completely
3195 mirror the back-end. This will be useful in the future.
3196 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
3197 Update comments to mention the new front-end counterparts of these
3198 macros.
3199 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
3200 for muscle_string_decode and muscle_location_decode.
3201 (muscle_string_decode): New static function.
3202 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
3203 (muscle_percent_define_get, muscle_percent_define_ifdef): New
3204 functions.
3205 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
3206 muscle_percent_define_get to mimic the b4_percent_define_flag_if
3207 implementation more closely.
3208 (muscle_percent_define_invalid_value): New function.
3209 * src/muscle_tab.h (muscle_percent_define_get,
3210 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
3211 Prototype.
3212
32132007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3214
3215 * NEWS (2.3a+): Mention yesterday's state-removal change.
3216 (2.3a): Remove the %language entry, which was added after 2.3a.
3217 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
3218 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
3219 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
3220 tests/existing.at: Update copyright date.
3221
32222007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3223
3224 If conflict resolution makes states unreachable, remove those states,
3225 report rules that are then unused, and don't report conflicts in those
3226 states.
3227 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
3228 New global function.
3229 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
3230 function.
3231 * src/main.c (main): After conflict resolution, remove the unreachable
3232 states and update all data structures that reference states by number.
3233 * src/state.c (state_new): Initialize each state's reachable member to
3234 false.
3235 (state_mark_reachable_states): New static function.
3236 (state_remove_unreachable_states): New global function.
3237 * src/state.h (struct state): Add member bool reachable.
3238 (state_remove_unreachable_states): Prototype.
3239 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3240 New test case.
3241 * tests/existing.at (GNU pic Grammar): Update test case output now that
3242 an unused rule is discovered.
3243
32442007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3245
3246 Minor code cleanup in parser table construction.
3247 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
3248 (new_itemsets, save_reductions): Update for rename to nitemset.
3249 * src/closure.c (nritemset): Rename to...
3250 (nitemset): ... this since the "r" appears to meaningless and isn't
3251 used in the comments.
3252 (closure): Update for rename.
3253 * src/closure.h (nritemset): Update extern to...
3254 (nitemset): ... this.
3255 * src/lalr.c (LA): Fix a typo in comments.
3256 * src/print.c (print_core): Update for rename to nitemset.
3257 * src/print_graph.c (print_graph): Likewise.
3258 * src/state.h: Fix some typos in header comments.
3259
32602007-04-04 Paul Eggert <eggert@cs.ucla.edu>
3261
3262 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
3263 still sticks to ASCII. Sorry!
3264
3265 * README-hacking: New file, taken mostly from coreutils, with changes
3266 for Bison. Contains much of the contents of:
3267 * README-cvs: Remove.
3268 * bootstrap: Sync from gnulib.
3269 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
3270 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
3271
32722007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
3273
3274 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
3275 Setzer.
3276 (Java Differences): Fix some typos.
3277 * THANKS: Add Sebastian Setzer.
3278
32792007-03-07 Paolo Bonzini <bonzini@gnu.org>
3280
3281 * data/java.m4 (b4_single_class_if): Remove.
3282 (b4_abstract_if): Look at "%define abstract".
3283 (b4_lexer_if): New.
3284 (b4_union_name): Rename...
3285 (b4_yystype): ... to this. Map to "%define stype".
3286 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
3287 b4_maybe_throws): Fix quoting.
3288 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
3289 * data/lalr1.java (Lexer interface): Always define.
3290 (Lexer interface within parser class): Remove.
3291 (YYLexer class): New, used when "%code lexer" is present.
3292 (constructor): When "%code lexer" is used, pass %lex-param
3293 to the lexer constructor.
3294 (yylex, yyparse): Remove %lex-param from method invocations
3295 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
3296
3297 * doc/bison.texinfo (Java Bison Interface): Mention "%define
3298 abstract". Rename "%define union_name" to "%define stype".
3299 Rename method names according to previous patch.
3300 (Java Scanner Interface): Describe "%code lexer" instead of
3301 "%pure-parser" and "%define single_class".
3302 (Java Differences): Mention "%code lexer".
3303
3304 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
3305 Include scanner here, using macros from tests/local.at.
3306 (AT_DATA_CALC_Y): Remove final argument.
3307 (_AT_CHECK_JAVA_CALC): Likewise.
3308 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
3309 of %locations and %error-verbose.
3310 (main): Test with and without %lex-param.
3311 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
3312 (AT_BISON_OPTION_POPDEFS): Pop it.
3313
33142007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3315
3316 DJGPP spefic issue. Inhibit the use of disallowed characters for
3317 file name genertion on Win98, WinXP, etc. These are |<>":?*\
3318 and concern testsuite case 46.
3319 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
3320 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
3321 * djgpp/config.bat: Inhibit the use of disallowed characters.
3322
33232007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3324
3325 Miscellaneous %define and %code cleanup.
3326 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
3327 values are interpreted.
3328 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
3329 documentation a little more.
3330 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
3331 muscle_percent_define_insert, muscle_percent_code_grow): New
3332 functions/macros.
3333 * src/muscle_tab.h (muscle_percent_define_insert,
3334 muscle_percent_code_grow): Prototype.
3335 * src/parse-gram.y (prologue_declaration): Use
3336 muscle_percent_define_insert and muscle_percent_code_grow when parsing
3337 %define and %code directives.
3338
3339 Make it easy to share %define boolean variables between the front-end
3340 and back-end. Though not used yet, this will be useful in the future.
3341 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
3342 Bison uses of names rather than just skeleton uses of names.
3343 (b4_percent_define_get, b4_percent_define_ifdef): Rename
3344 b4_percent_define_skeleton_variables(VARIABLE) to
3345 b4_percent_define_bison_variables(VARIABLE).
3346 (b4_percent_code_get, b4_percent_code_ifdef): Rename
3347 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
3348 b4_percent_code_bison_qualifiers(QUALIFIER).
3349 (b4_check_user_names_wrap): Update for renames.
3350 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
3351 muscle_percent_define_default): New functions mimicking
3352 b4_percent_define_flag_if and b4_percent_define_default.
3353
3354 For %define variables, report locations for invalid values and
3355 redefinitions.
3356 * data/bison.m4 (b4_percent_define_flag_if): Read
3357 b4_percent_define_loc(VARIABLE) to report the location of an invalid
3358 value for VARIABLE.
3359 (b4_percent_define_default): Save a special location in
3360 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
3361 must later be reported as invalid.
3362 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
3363 functions.
3364 (muscle_percent_define_insert): Record the location of VARIABLE in
3365 muscle percent_define_loc(VARIABLE), and use it to report the previous
3366 location for a redefinition.
3367 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
3368 (muscle_percent_define_default): Update like b4_percent_define_default.
3369 (muscle_grow_user_name_list): Rename to...
3370 (muscle_user_name_list_grow): ... this for consistency and use
3371 muscle_location_grow.
3372 * src/muscle_tab.h (muscle_location_grow): Prototype.
3373 * tests/input.at (%define errors): Update expected output.
3374 * tests/skeletons.at (%define boolean variables: invalid skeleton
3375 defaults): New test case.
3376
33772007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
3378
3379 * src/print.c (lookahead_set, state_default_rule): Remove.
3380 (print_reductions): Replace state_default_rule invocation with
3381 equivalent use of yydefact, which was computed in token_actions in
3382 tables.c.
3383 (print_results): Don't allocate lookahead_set.
3384
33852007-02-27 Paolo Bonzini <bonzini@gnu.org>
3386
3387 * data/lalr1.java: Prefix all private members with yy.
3388
33892007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
3390
3391 Use YYFPRINTF instead of fprintf where appropriate. Reported by
3392 Sebastien Fricker at
3393 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
3394 * THANKS: Add Sebastien Fricker.
3395 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
3396 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
3397 accept a variable number of arguments.
3398
33992007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3400
3401 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
3402
34032007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3404
3405 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
3406 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
3407 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
3408
34092007-02-11 Paul Eggert <eggert@cs.ucla.edu>
3410
3411 Undo my 2007-02-07 change, switching back to the c-strcase module
3412 introduced in the 2007-02-03 change. Bruno Haible reported that
3413 the 2007-02-07 change would be dangerous in Turkish if we add a
3414 language whose name contains "i", since "i" is not lowercase "I"
3415 in Turkish.
3416 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
3417 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
3418 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
3419 * m4/.cvsignore: Remove strcase.m4.
3420 * src/getargs.c: Revert 2007-02-07 change, as follows.
3421 Include c-strcase.h.
3422 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
3423
34242007-02-11 Bruno Haible <bruno@clisp.org>
3425
3426 Enable the Java related testsuite tests when the only Java compiler
3427 found is a gcj < 4.3. Discussed at
3428 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
3429 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
3430
34312007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
3432
3433 * data/Makefile.am: Update copyright date.
3434 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
3435 yypstate_new returns NULL.
3436 (yypstate_new): Return NULL if malloc does.
3437 * src/reader.c (packgram): Move translation of rule actions from the
3438 beginning of packgram to...
3439 (check_and_convert_grammar): ... here right before packgram is invoked
3440 so it's easier to write more complete comments, and remove redundant
3441 code.
3442
34432007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
3444
3445 As in semantic actions, make @$ in %initial-action, %destructor, and
3446 %printer imply %locations.
3447 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
3448 scanning @$.
3449 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
3450 (@$ in %initial-action implies %locations,
3451 @$ in %destructor implies %locations,
3452 @$ in %printer implies %locations): ... these new test cases.
3453
34542007-02-07 Paul Eggert <eggert@cs.ucla.edu>
3455
3456 Undo most of the 2007-02-03 change, switching to the strcase module
3457 now that gnulib strcase has been fixed.
3458 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
3459 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
3460 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
3461 * m4/.cvsignore: Add strcase.m4.
3462 * src/getargs.c: Revert 2007-02-03 change, as follows.
3463 Don't include c-strcase.h.
3464 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
3465 strcasecmp has "unspecified behavior" outside the POSIX locale,
3466 but it works fine in practice if at least one argument is ASCII,
3467 as is the case in Bison.
3468
34692007-02-07 Paolo Bonzini <bonzini@gnu.org>
3470
3471 * tests/java.at: Skip tests if only one of javac/java is present.
3472 Reported by Joel E. Denny.
3473 * tests/atlocal.in: Adjust copyright years.
3474
34752007-02-05 Paolo Bonzini <bonzini@gnu.org>
3476
3477 * data/lalr1.java (Stack): Work around old verifiers that disallow
3478 access to the private fields of an inner class, from the outer class.
3479 We can make Stack's fields public because user code doesn't have access
3480 to the instance of Stack used by parse(). Reported by Paul Eggert.
3481
34822007-02-03 Paul Eggert <eggert@cs.ucla.edu>
3483
3484 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
3485 the right spot for these files?
3486 * bootstrap.conf (gnulib_modules): Add c-strcase.
3487 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
3488 c-strncasecmp.c.
3489 * src/getargs.c: Include c-strcase.h.
3490 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
3491 to avoid unspecified behavior.
3492
34932007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
3494
3495 * doc/bison.texinfo (Decl Summary): Correct typo.
3496
34972007-01-30 Paolo Bonzini <bonzini@gnu.org>
3498
3499 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
3500 Complain if the value does not match empty, "true" or "false".
3501 * data/c++.m4: Adjust default definitions of %define variables.
3502 * data/java.m4: Adjust default definitions of %define variables.
3503 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
3504 to above behavior.
3505 * tests/input.at (Boolean %define variables): Test new behavior.
3506
35072007-01-29 Paolo Bonzini <bonzini@gnu.org>
3508
3509 * NEWS: Mention java.
3510 * TODO: Remove things that are done.
3511 * bootstrap.conf: Add javacomp-script and javaexec-script.
3512 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
3513
3514 * data/Makefile.am: Add new files.
3515 * data/java-skel.m4: New.
3516 * data/java.m4: New.
3517 * data/lalr1.java: New.
3518
3519 * doc/bison.texinfo: Put "A Complete C++ Example" under
3520 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
3521 under Other Languages.
3522
3523 * src/getargs.c (valid_languages): Add Java.
3524 * src/getargs.h (struct bison_language): Update size of string fields.
3525
3526 * tests/Makefile.am: Add java.at.
3527 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
3528 * tests/java.at: New.
3529 * tests/testsuite.at: Include it.
3530
35312007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
3532
3533 Clean up.
3534 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
3535 at_directive_argv arguments so these no longer have to be global
3536 variables. Also, update the implementation for the following changes.
3537 (fail_for_at_directive_too_many_args,
3538 fail_for_at_directive_too_few_args): Add at_directive_name argument.
3539 (at_directive_name): Remove as at_directive_argv[0] will be used for
3540 this now.
3541 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
3542 for the directive name.
3543 (at_directive_argc, at_directive_argv): Make these local within
3544 skel_lex instead of global.
3545 (INITIAL): Update directive start action for above changes.
3546 (SC_AT_DIRECTIVE_ARG): Rename to...
3547 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
3548 (SC_AT_DIRECTIVE_SKIP_WS): Update.
3549 (scan_skel): Move yylex_destroy to...
3550 (skel_scanner_free): ... here.
3551 * tests/skeletons.at (installed skeleton file name): Rename to...
3552 (installed skeleton file names): ... this.
3553
35542007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
3555
3556 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3557 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
3558 Summary" not "Directives".
3559 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
3560 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
3561 since the former is now the more complete one.
3562 (Prologue Alternatives): Likewise and do the same for %defines.
3563 (Table of Symbols): Add summary of %code, add summary of %define, and
3564 move full %code documentation to...
3565 (Decl Summary): ... here for consistency with other entries in these
3566 sections.
3567 Move %define entry in order to keep this list alphabetized.
3568 Reword %define entry a little to put less emphasis on the skeleton
3569 concept, which most users shouldn't have to think about.
3570
35712007-01-26 Paul Eggert <eggert@cs.ucla.edu>
3572
3573 Adjust to recent gnulib changes.
3574 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
3575 Add string.h, string_.h, unistd_.h, wchar_.h.
3576 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
3577 * src/system.h: Don't include <stpcpy.h>; this is now done by
3578 <string.h>.
3579
35802007-01-23 Paolo Bonzini <bonzini@gnu.org>
3581
3582 Simplify implementation of unqualified %code, implement macros for
3583 uniform treatment of boolean %define flags. Document %define.
3584 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
3585 b4_percent_code_ifdef): New.
3586 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
3587 * data/c++.m4: Define default value for global_tokens_and_yystype.
3588 * data/glr.cc: Likewise.
3589 * data/location.cc: Use b4_percent_define_flag_if.
3590
3591 * doc/bison.texinfo (Decl Summary): Document %define.
3592
3593 * src/parse-gram.y (Unqualified %code): Change muscle name to
3594 b4_percent_code().
3595 (content.opt): Default to empty.
3596
35972007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3598
3599 Implement support for relative and absolute skeleton file names.
3600 Discussed starting at
3601 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
3602 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
3603 (Bison Options): Document in --skeleton entry.
3604 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
3605 full_skeleton can't necessarily hold all of pkgdatadir.
3606 If the specified skeleton file name contains a `/', don't prepend
3607 pkgdatadir.
3608 * src/parse-gram.y (prologue_declaration): If the specified skeleton
3609 file name contains a `/', prepend the grammar file directory.
3610 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
3611 * skeletons.at: New file.
3612 (relative skeleton file names): New test case.
3613 (installed skeleton file names): New test case.
3614 * tests/testsuite.at: Include skeletons.at.
3615
3616 * bootstrap: Update copyright to 2007.
3617
36182007-01-17 Paolo Bonzini <bonzini@gnu.org>
3619
3620 * bootstrap: Remove occurrences of .#bootmp from the files.
3621
36222007-01-17 Akim Demaille <akim@epita.fr>
3623
3624 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
3625 nonterminals.
3626 Use per-type %printer.
3627
36282007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3629
3630 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
3631 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3632 djgpp/config.site, src/files.c, src/files.h, src/main.c,
3633 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
3634 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
3635 tests/glr-regression.at, tests/input.at, tests/local.at,
3636 tests/output.at, tests/torture.at: Update copyright to 2007.
3637
36382007-01-16 Akim Demaille <akim@epita.fr>
3639
3640 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
3641 error code.
3642 (Calc++ Scanner): Exit with failure if we can't open the input
3643 file.
3644 Accept "-" standing for stdin.
3645 (Calc++ Top Level): Print the result only if the parsing was
3646 successful.
3647
36482007-01-16 Akim Demaille <akim@epita.fr>
3649
3650 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
3651
36522007-01-15 Paolo Bonzini <bonzini@gnu.org>
3653 and Joel E. Denny <jdenny@ces.clemson.edu>
3654
3655 Clean up %define and %code implementation in M4 some. Most
3656 importantly, rename all related macros to be in the b4_percent_define
3657 and b4_percent_code namespaces. Also, complete support for `.' in
3658 %define variable names and %code qualifiers.
3659 * data/bison.m4 (b4_check_user_names): Check for special
3660 "SKELETON-NAMESPACE(name)" macros instead of using two nested
3661 m4_foreach loops.
3662 (b4_get_percent_define, b4_get_percent_code): Rename to...
3663 (b4_percent_define_get, b4_percent_code_get): ... these.
3664 Extend documentation with examples.
3665 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
3666 b4_percent_define_skeleton_variables and
3667 b4_percent_code_skeleton_qualifiers.
3668 Expect any value for the %define variable `foo' to be stored in the
3669 macro named `b4_percent_define(foo)'; expect any %code blocks for the
3670 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
3671 expect any unqualified %code blocks to be stored in a macro named
3672 `b4_percent_code_unqualified'.
3673 Use m4_indir so that %define variable names and %code qualifiers can
3674 contain `.', which is allowed by the grammar parser.
3675 (b4_percent_define_default): New macro to set a default value for a
3676 %define variable.
3677 (m4_wrap): Update wrapped code, and fix some underquoting.
3678 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
3679 Expect grammar uses of %define variables and %code qualifiers to be
3680 defined in b4_percent_define_user_variables and
3681 b4_percent_code_user_qualifiers.
3682 * data/c++.m4: Use b4_percent_define_default rather than
3683 m4_define_default. Fix some underquoting. Skeleton usage of %define
3684 variable define_location_comparison now implies skeleton usage of
3685 %define variable filename_type.
3686 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3687 data/push.c, data/yacc.c: Update macro names.
3688 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
3689 muscle names.
3690
36912007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3692
3693 DJGPP specific issues.
3694
3695 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
3696 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
3697
36982007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3699
3700 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
3701 run parsers in all tests so that Valgrind is invoked during
3702 maintainer-check-valgrind.
3703 (Duplicate representation of merged trees): Free all semantic values.
3704 (Duplicated user destructor for lookahead): Likewise.
3705
37062007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3707
3708 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
3709 command-line prefix.
3710 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
3711 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
3712 miss Valgrind messages.
3713 (Exploding the Stack Size with Malloc): Likewise.
3714
37152007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
3716
3717 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
3718 locals. Reported by Juan Manuel Guerrero at
3719 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
3720 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
3721 Fix some indentation also.
3722 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
3723 explaining this issue.
3724
37252007-01-09 Paolo Bonzini <bonzini@gnu.org>
3726 and Joel E. Denny <jdenny@ces.clemson.edu>
3727
3728 Simplify union and prologue handling, and escape union and lex/parse
3729 params with digraphs.
3730 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
3731 values to the empty string since these are no longer guaranteed
3732 initialized by the front-end.
3733 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
3734 braces around b4_user_stype since this is no longer done by the
3735 front-end.
3736 * src/files.c, src/files.h (pre_prologue_obstack,
3737 post_prologue_obstack): Remove.
3738 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
3739 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
3740 with digraphs. This fixes lex params and parse params.
3741 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
3742 * src/output.c (prepare): Remove muscle insertion of the prologues.
3743 (output): Remove freeing of pre_prologue_obstack and
3744 post_prologue_obstack.
3745 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
3746 than prologue_augment for prologue parsing so you don't need prologue
3747 obstacks.
3748 (grammar_declaration): For %union RHS, use `braceless' instead of
3749 "{...}" so that braces are already stripped and code is escaped with
3750 digraphs.
3751 * src/reader.c (prologue_augment): Remove.
3752 (reader): Remove initialization of pre_prologue_obstack and
3753 post_prologue_obstack.
3754 * src/reader.h (prologue_augment): Remove.
3755
3756 * data/c.m4: Remove stray parenthesis.
3757
37582007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3759
3760 Remove quotes from variables names in %define directives and from
3761 qualifiers in %code directives, and restrict the characters that are
3762 allowed in them to M4-friendly ones. For %define, continue to support
3763 the quoted form as a deprecated feature. Discussed starting at
3764 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
3765 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
3766 %code.
3767 * doc/bison.texinfo (Prologue Alternatives): Update.
3768 (Decl Summary): In %defines entry, update mention of `%code requires'
3769 and `%code provides'.
3770 (C++ Location Values): Update %define uses.
3771 (Calc++ Parser Interface): Likewise.
3772 (Calc++ Parser): Likewise, and update `%code requires' uses.
3773 (Table of Symbols): Update %code documentation.
3774 * src/parse-gram.y (prologue_declaration): For %define variables, use
3775 `variable' instead of `STRING'.
3776 (grammar_declaration): For %code qualifiers, use `ID' instead of
3777 `STRING'.
3778 (variable): New nonterminal that takes an `ID' or a `STRING'.
3779 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
3780 and %define uses.
3781 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
3782 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
3783 (%define errors): Update %define uses.
3784
37852007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3786
3787 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
3788 instead of muscle_insert for %define values so that M4-special
3789 characters are replaced with digraphs.
3790 * tests/input.at (%define errors): Extend to check weird values.
3791
37922007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3793
3794 Instead of having skeletons declare all valid %define variables and
3795 %code qualifiers, provide macros that retrieve the associated values
3796 and build these lists automatically. Thus Bison will now warn when a
3797 variable or qualifier is not used by the skeleton in the current
3798 invocation regardless of whether it might sometimes be used by that
3799 skeleton in other invocations. Also, move all %define value macros to
3800 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
3801 form, which is replaced by %code.
3802 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
3803 (b4_check_user_names): ... this, and change the series of valid name
3804 arguments to a single list argument for names used in the skeleton
3805 similar to the existing list argument for names used in the grammar.
3806 Warn instead of complaining.
3807 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
3808 values and %code code, to format %code code properly, and to build
3809 lists of all %define variables and %code qualifiers used in the
3810 skeleton: b4_skeleton_percent_define_variables and
3811 b4_skeleton_percent_code_qualifiers.
3812 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
3813 Remove, and...
3814 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
3815 the skeleton names lists can finish building first. In place of
3816 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
3817 expect the lists b4_user_percent_define_variables and
3818 b4_user_percent_code_qualifiers.
3819 * data/c++.m4: Where setting default values for b4_parser_class_name,
3820 b4_location_type, b4_filename_type, b4_namespace, and
3821 b4_define_location_comparison, update their names to the
3822 b4_percent_define_ namespace.
3823 * data/glr.c: Don't use b4_check_percent_define_variables and
3824 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3825 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
3826 (b4_parser_class_name, b4_namespace): Define these using
3827 b4_get_percent_define for parser_class_name and namespace.
3828 * data/location.cc: Use b4_get_percent_define.
3829 * data/push.c: Don't use b4_check_percent_define_variables and
3830 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
3831 * data/yacc.c: Likewise, and don't call m4_exit in
3832 b4_use_push_for_pull_if or m4_wrap code will never execute.
3833 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
3834 Rename to...
3835 (muscle_grow_user_name_list): ... this for consistency with the
3836 terminology used in bison.m4.
3837 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
3838 %define variable names, and rename muscle used_percent_define_variables
3839 to user_percent_define_variables.
3840 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
3841 user_percent_code_qualifiers.
3842 (content): Remove.
3843 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
3844 {CODE} form is no longer accepted.
3845 * tests/input.at (Reject bad %code qualifiers): Rename to...
3846 (Reject unused %code qualifiers): ... this, and update test output.
3847 (%define error): Update test output.
3848
38492007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
3850
3851 Check for unrecognized %define variables similar to checking for
3852 unrecognized %code qualifiers. Check for redefined %define variables.
3853 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
3854 generalizes...
3855 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
3856 (b4_check_percent_define_variables): New, also wraps it.
3857 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
3858 variables using b4_check_percent_define_variables.
3859 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
3860 all those exercised in the test suite and all those listed in the
3861 `Default values' section of c++.m4. Are there others?
3862 * data/push.c, data/yacc.c: Declare no valid %define variables.
3863 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
3864 similar to muscle_find, but it works even when the muscle stores a
3865 const value.
3866 (muscle_grow_used_name_list): New function for constructing the used
3867 name list muscles that b4_check_for_unrecognized_names requires.
3868 * src/parse-gram.y (prologue_declaration): Warn if a variable is
3869 %define'd more than once. Define the b4_used_percent_define_variables
3870 muscle with muscle_grow_used_name_list.
3871 (grammar_declaration): Abbreviate %code code with
3872 muscle_grow_used_name_list.
3873 * tests/input.at (%define errors): New.
3874
38752007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3876
3877 Provide warn_at, complain_at, and fatal_at function callbacks to the
3878 skeletons, and use this for %code qualifier complaints.
3879 * data/bison.m4 (b4_error_at): New, invoked by...
3880 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
3881 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
3882 @fatal_at(...@) directives.
3883 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
3884 qualifiers in b4_used_percent_code_qualifiers and to use
3885 b4_complain_at.
3886 * src/location.c, src/location.h (boundary_set_from_string): New global
3887 function.
3888 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
3889 function.
3890 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
3891 to b4_used_percent_code_qualifiers.
3892 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
3893 function.
3894 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
3895 (lineno): Rename to...
3896 (out_lineno): ... this so I don't misunderstand it again.
3897 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
3898 here; these newlines are in the input but not the output file.
3899 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
3900 (at_directive_perform): ... this new static function, and add handling
3901 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
3902 directives.
3903 * tests/input.at (Reject bad %code qualifiers): Update test output with
3904 locations and extend.
3905
3906 * tests/output.at (Output file name: [, Output file name: ]): Remove
3907 bogus comment about these tests failing.
3908
39092007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3910
3911 Clean up b4_check_percent_code_qualifiers a little.
3912 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
3913 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
3914 documentation and add examples.
3915 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
3916 qualifiers here.
3917
39182007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
3919
3920 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
3921 unreliable -- especially when they're hidden inside another macro.
3922 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
3923 data/c.m4: Remove m4_divert(-1).
3924 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3925 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
3926 m4_divert_push(0) and m4_divert_pop(0).
3927 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
3928 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
3929 pushed and popped by m4sugar, should be first on the stack.
3930
3931 Provide warn, complain, and fatal function callbacks to the skeletons.
3932 This provides more flexibility than m4_fatal, improves the error
3933 message format, and captures messages for translation. Discussed
3934 starting at
3935 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
3936 * data/bison.m4 (b4_error): New, invoked by...
3937 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
3938 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
3939 directives. Because these M4 macros might be called when the current
3940 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
3941 the previous removal of uses of m4_divert, which caused trouble.
3942 (b4_check_percent_code_qualifiers): Use b4_complain instead of
3943 m4_fatal to report unrecognized %code qualifiers.
3944 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
3945 push parser requests.
3946 * data/glr.c: Use b4_complain instead of m4_fatal to report
3947 non-deterministic push parser requests.
3948 Update @output usage to @output(...@) form.
3949 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
3950 report missing %defines. Update @output usage to @output(...@) form.
3951 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
3952 @output(...@) form.
3953 * src/main.c (main): Invoke skel_scanner_free.
3954 * src/scan-skel.h (skel_scanner_free): Prototype new function.
3955 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
3956 obstack_for_string from flex-scanner.h.
3957 (YY_DECL): Use to declare skel_lex static.
3958 (decode_at_digraphs): Remove; now handled in the new
3959 SC_AT_DIRECTIVE_ARG start condition.
3960 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
3961 functions.
3962 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
3963 at_directive_argv): New static globals.
3964 (INITIAL): Use fail_for_invalid_at.
3965 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
3966 recognize the start of a generalized `@directive(...@)' form and
3967 start...
3968 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
3969 directive args (using the new obstack_for_string), to decode the
3970 contained @ diagraphs, and to perform the directive. It recognizes
3971 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
3972 @output(...@).
3973 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
3974 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
3975 `@,'.
3976 (scan_skel): Initialize obstack_for_string on the first call.
3977 (skel_scanner_free): New function to free obstack_for_string.
3978 * tests/input.at (Reject bad %code qualifiers): Update test output.
3979
39802007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
3981
3982 Consolidate the 4 prologue alternative directives (%code, %requires,
3983 %provides, and %code-top) into a single %code directive with an
3984 optional qualifier field. Discussed at
3985 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
3986 * NEWS (2.3a+): Rewrite the existing entry for the prologue
3987 alternatives.
3988 * doc/bison.texinfo (Prologue Alternatives): Update.
3989 (Decl Summary): Update to %code "requires" and %code "provides".
3990 (Calc++ Parser): Update to %code "requires".
3991 (Table of Symbols): Remove entries for %requires, %provides, and
3992 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
3993 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
3994 are replaced by b4_percent_code_provides and b4_percent_code_requires,
3995 which are skeleton-specific.
3996 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
3997 declare what %code qualifiers it supports and to complain if any other
3998 qualifiers were used in the grammar.
3999 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
4000 and b4_user_code([b4_percent_code_provides]) in place of
4001 b4_user_requires and b4_user_provides.
4002 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
4003 Add b4_user_code([b4_percent_code_top]) and
4004 b4_user_code([b4_percent_code]).
4005 Invoke b4_check_percent_code_qualifiers.
4006 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4007 PERCENT_REQUIRES): Remove.
4008 (grammar_declaration): Remove RHS's for %code-top, %provides, and
4009 %requires. Rewrite the %code RHS as the unqualified form defining the
4010 muscle b4_percent_code. Add another RHS for the qualified %code form,
4011 which defines muscles of the form b4_percent_code_QUALIFIER and the
4012 b4_used_percent_code_qualifiers muscle.
4013 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4014 PERCENT_REQUIRES): Remove.
4015 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
4016 %code "requires" and %code "provides".
4017 * tests/input.at (Reject bad %code qualifiers): New.
4018
40192007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
4020
4021 Use the new code_props interface for destructors and printers.
4022 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
4023 printer_location members, and change the type of the destructor and
4024 printer members to code_props.
4025 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
4026 symbol_printer_get, semantic_type_destructor_set,
4027 semantic_type_printer_set, default_tagged_destructor_set,
4028 default_tagless_destructor_set, default_tagged_printer_set,
4029 default_tagless_printer_set): Use code_props in arguments and return
4030 types in place of char const * and location.
4031 (symbol_destructor_location_get, symbol_printer_location_get): Remove
4032 since the locations are now contained in the return of
4033 symbol_destructor_get and symbol_printer_get.
4034 * src/output.c (symbol_destructors_output, symbol_printers_output):
4035 Replace with...
4036 (symbol_code_props_output): ... this to eliminate duplicate code.
4037 (output_skeleton): Update to use symbol_code_props_output.
4038 * src/reader.c (symbol_should_be_used): Update use of
4039 symbol_destructor_get.
4040 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
4041 Update uses of the various _destructor_set and _printer_set functions.
4042 * src/symtab.c: (default_tagged_destructor_location,
4043 default_tagless_destructor_location, default_tagged_printer_location,
4044 default_tagless_printer_location): Remove since we...
4045 (default_tagged_destructor, default_tagless_destructor,
4046 default_tagged_printer, default_tagless_printer): ... change the type
4047 of these to code_props.
4048 (symbol_new, semantic_type_new, symbol_destructor_set,
4049 semantic_type_destructor_set, symbol_destructor_get,
4050 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
4051 symbol_check_alias_consistency, default_tagged_destructor_set,
4052 default_tagless_destructor_set, default_tagged_printer_set,
4053 default_tagless_printer_set): Update.
4054 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
4055 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
4056 code_props members.
4057 (symbol_print): Use SYMBOL_CODE_PRINT.
4058
40592007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
4060
4061 Use the new code_props interface for rule actions.
4062 * src/symlist.h (symbol_list): Replace action, action_location, and
4063 used members with a code_props action_props member.
4064 * src/reader.c (symbol_should_be_used, grammar_rule_check,
4065 grammar_midrule_action, grammar_current_rule_merge_set,
4066 grammar_current_rule_symbol_append, packgram): Update.
4067 * src/scan-code.h (translate_rule_action): Remove, no longer used.
4068 * src/scan-code.l (handle_action_dollar): Update.
4069 (translate_rule_action): Remove, no longer used.
4070 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
4071
40722007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4073
4074 Use the new code_props interface in parse-gram.y.
4075 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
4076 Update all uses of translate_* functions to use the new code_props
4077 interface and to use gram_scanner_last_string_free and
4078 code_scanner_last_string_free where possible.
4079 (grammar_declaration): symbol_list_destructor_set and
4080 symbol_list_printer_set now perform the translation, so don't do it
4081 here. Use gram_scanner_last_string_free where possible.
4082 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
4083 translate_code): Remove, no longer used.
4084 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
4085 symbol_list_printer_set): Perform code translation here rather than
4086 depending on the caller to do so.
4087
4088 * src/symlist.h (struct symbol_list): Correct some documentation typos.
4089 * src/scan-gram.h (gram_last_string): Remove declaration.
4090 * src/scan-gram.l (last_string): Declare it static.
4091
40922007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4093
4094 Encapsulate code properties and related functionality for the various
4095 destructors, printers, and actions into a code_props structure and
4096 interface. This patch merely implements code_props in scan-code.h and
4097 scan-code.l. Future patches will rewrite other modules to use it.
4098 Discussed starting at
4099 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
4100 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
4101 consistently initialize const structs that have an empty location
4102 field.
4103 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
4104 to ensure consistency.
4105 * src/scan-code.h (code_props): New structure.
4106 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
4107 function, macro, and const global variable for initializing a
4108 code_props with no code.
4109 (code_props_plain_init, code_props_symbol_action_init,
4110 code_props_rule_action_init, code_props_translate_code): The rest of
4111 the new code_props functional interface. Among other things, the init
4112 functions set the code_props kind field so that
4113 code_props_translate_code will know whether to behave like
4114 translate_symbol_action, translate_rule_action, or translate_code.
4115 These old translate functions must remain until all other modules are
4116 updated to use the new code_props interface.
4117 (code_scanner_last_string_free): New function similar to
4118 gram_scanner_last_string_free.
4119 (code_scanner_free): Add documentation.
4120 * src/scan-code.l: Implement the new interface.
4121 (code_lex): Make it static, add a code_props* argument, and remove the
4122 rule argument.
4123 (last_string): New static global similar to the one in scan-gram.l.
4124 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
4125 instead of rule.
4126 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
4127 code_props since Bison may one day use this information for destructors
4128 and printers.
4129 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
4130 (handle_action_dollar): Use symbol_list_n_get and set used flag
4131 directly since symbol_list_n_used_set is removed.
4132 (translate_action): Add a code_props* argument and remove the rule,
4133 action, and location arguments. Pass the code_props* on to code_lex.
4134 (translate_rule_action, translate_symbol_action, translate_code):
4135 Rewrite as wrappers around the new code_props interface.
4136 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
4137 it would eventually need to break the encapsulation of code_props.
4138
41392007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
4140
4141 * etc/.cvsignore: New.
4142
41432007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
4144
4145 Add maintainer-push-check to run maintainer-check using push parsing in
4146 place of pull parsing where available.
4147 * Makefile.am (maintainer-push-check): New.
4148 * data/bison.m4 (b4_use_push_for_pull_if): New.
4149 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
4150 appropriately based on their existing values.
4151 (yypush_parse): Don't print push-parser-specific diagnostics if push
4152 parsing is being used in place of pull parsing.
4153 * data/yacc.c: If push parsing should replace pull parsing, redirect to
4154 push.c.
4155 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
4156 variable, and insert b4_use_push_for_pull_flag into muscles.
4157 * tests/Makefile.am (maintainer-push-check): New.
4158
41592006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4160
4161 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
4162 (whether successful or failed) so that yypush_parse can be invoked
4163 again to start a new parse using the same yypstate.
4164 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
4165 check multiple yypull_parse invocations on the same yypstate. For pull
4166 mode, extend to check multiple yyparse invocations.
4167 (Exploding the Stack Size with Alloca): Extend to try with
4168 %push-pull-parser.
4169 (Exploding the Stack Size with Malloc): Likewise.
4170
4171 * tests/calc.at (Simple LALR Calculator): Don't specify
4172 %skeleton "push.c" since %push-pull-parser implies that now.
4173 * tests/headers.at (export YYLTYPE): Don't check for the push
4174 declarations. Otherwise, this test case can't be used to see if push
4175 mode can truly emulate pull mode.
4176 * tests/input.at (Torturing the Scanner): Likewise.
4177 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
4178 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
4179 AT_YACC_IF, which now includes the case of push mode since %skeleton
4180 need not be used for push mode. This will be more intuitive once
4181 push.c is renamed to yacc.c.
4182
41832006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4184
4185 For push mode, convert yyparse from a macro to a function, invoke yylex
4186 instead of passing a yylexp argument to yypull_parse, and don't
4187 generate yypull_parse or yyparse unless %push-pull-parser is declared.
4188 Discussed starting at
4189 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
4190 * data/bison.m4 (b4_pull_if): New.
4191 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
4192 * data/push.c: Improve M4 quoting a little.
4193 (b4_generate_macro_args, b4_parenthesize): Remove.
4194 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
4195 any time a pull parser is requested.
4196 Don't #define this as a wrapper around yypull_parse. Instead, when
4197 both push and pull are requested, make it a function that does that
4198 same thing.
4199 (yypull_parse): If there's a b4_prefix, #define this to
4200 b4_prefix[pull_parse] when both push and pull are requested.
4201 Don't define this as a function unless both push and pull are
4202 requested.
4203 Remove the yylexp argument and hard-code yylex invocation instead.
4204 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
4205 %push-parser.
4206 * src/getargs.c (pull_parser): New global initialized to true.
4207 * getargs.h (pull_parser): extern it.
4208 * src/output.c (prepare): Insert pull_flag muscle.
4209 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
4210 (prologue_declaration): Set both push_parser and pull_parser = true for
4211 %push-pull-parser. Set push_parser = true and pull_parser = false for
4212 %push-parser.
4213 * src/scan-gram.l: Don't accept %push_parser as an alternative to
4214 %push-parser since there's no backward-compatibility concern here.
4215 Scan %push-pull-parser.
4216 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
4217 instead of %push-parser.
4218 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
4219 prototype it in the module that calls yyparse.
4220 * tests/input.at (Torturing the Scanner): Likewise.
4221 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
4222
42232006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
4224
4225 Update etc/bench.pl. Optimize push mode a little (the yyn change
4226 deserves most of the credit).
4227 * Makefile.am (SUBDIRS): Add etc subdirectory.
4228 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
4229 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
4230 yytoken, yyval, and yyloc declarations to...
4231 (yyparse or yypush_parse): ... here to improve performance. For
4232 yypush_parse invocations after the first, be sure to assign yyn its old
4233 value again.
4234 (yypstate_new): Don't bother initializing the yyresult field since the
4235 initial value isn't used.
4236 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
4237 remove the #define that, in push mode, set it to yyps->NAME.
4238 * etc/Makefile.am: New.
4239 * etc/bench.pl: Remove and build it instead from...
4240 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
4241 "tests/bison" from the build directory by default rather than just
4242 invoking "bison" from $PATH.
4243 (calc_grammar): Update push parser code: don't declare yylval globally,
4244 don't define yyparse_wrapper, and don't #define yyparse.
4245 (bench_grammar): Update to check all working combinations of yacc.c,
4246 push.c, impure, pure, pull, and push.
4247
42482006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4249
4250 For push mode, add pull wrappers around yypush_parse.
4251 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
4252 (yypull_parse): New function wrapping yypush_parse.
4253 (yyparse): New #define wrapping yypull_parse.
4254 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
4255 is declared.
4256 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
4257 prototype yylex in the module that calls yyparse, and don't prototype
4258 yyparse there. Otherwise, the yyparse expansion won't compile.
4259 * tests/input.at (Torturing the Scanner): Likewise.
4260
42612006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4262
4263 Enable push parsers to operate in impure mode. Thus, %push-parser no
4264 longer implies %pure-parser. The point of this change is to move
4265 towards being able to test the push parser code by running the entire
4266 test suite as if %push-parser had been declared.
4267 * data/push.c (yypush_parse): For impure mode, remove the
4268 yypushed_char, yypushed_val, and yypushed_loc arguments.
4269 Instead, declare these as local variables initialized to the global
4270 yychar, yylval, and yylloc.
4271 For the first yypush_parse invocation only, restore the initial values
4272 of these global variables when it's time to read a token since they
4273 have been overwritten.
4274 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
4275 %push-parser.
4276 * tests/calc.at (Simple LALR(1) Calculator): Always declare
4277 %pure-parser along with %push-parser since this test case was designed
4278 for pure push parsers.
4279 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
4280 (AT_YACC_OR_PUSH_IF): New.
4281 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
4282 add a note that it's still wrong for some cases (as it has been for a
4283 while).
4284 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
4285 %push-parser no longer implies %pure-parser.
4286
42872006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4288
4289 Remove some unnecessary differences between the pull parser code and
4290 the push parser code. This patch enables yynerrs in push mode.
4291 * data/push.c: Reformat M4 a little.
4292 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
4293 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
4294 because push mode is on. Instead, if pure mode is on, move yynerrs
4295 to...
4296 (b4_declare_parser_state_variables): ... here.
4297 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
4298 to yyps->NAME so it can be used in yypush_parse.
4299 (yypush_parse): Don't omit uses of yynerrs in push mode.
4300
43012006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4302
4303 Fix bug such that the first pushed token's value and location are
4304 sometimes overwritten (sometimes by %initial-action) before being used.
4305 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
4306 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
4307 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
4308 more closely mimic the pull parser logic.
4309 Don't copy the pushed token to yychar, yylval, and yylloc until it's
4310 time to read a token, which is after any initialization of yylval and
4311 yylloc.
4312 (gottoken): Rename label to...
4313 (yyread_pushed_token): ... for clarity and to avoid infringing on the
4314 user namespace.
4315
43162006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4317
4318 Rearrange initialization of the parser state variables so that the
4319 skeleton doesn't have to have a copy for pull mode and another for push
4320 mode. This patch also fixes at least a bug such that yylloc was not
4321 initialized (with b4_location_initial_line and
4322 b4_location_initial_column) upon calling yypush_parse. However, that
4323 initialization now overwrites the first token's location;
4324 %initial-action assigning @$ already did the same thing, and both bugs
4325 will be fixed in a later patch.
4326 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
4327 (b4_declare_parser_state_variables): Remove initialization of yytoken,
4328 yyss, yyvs, yyls, and yystacksize.
4329 (yypstate_new): Remove initialization of some yypstate fields: yystate,
4330 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
4331 yylsp.
4332 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
4333 yyps->NAME so it can be used in yypush_parse.
4334 (yyparse or yypush_parse): For yypush_parse, don't print the
4335 "Starting parse" diagnostic for invocations after the first.
4336 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
4337 yypush_parse, only do it for the first invocation.
4338 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
4339 initialization to occur in yypush_parse but only on the first
4340 invocation.
4341
43422006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4343
4344 * data/push.c: Add CPP guards around push parser declarations in both
4345 the header and the code file.
4346 In the code file, move the push parser declarations to the same place
4347 they appear in the header file.
4348 Clean up the M4 some, especially the inconsistent underquoting in
4349 some b4_c_function_def and b4_c_function_decl uses.
4350
43512006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4352
4353 Encapsulate the push parser state variables into an M4 macro so the
4354 push skeleton doesn't have to list them again for pull mode's yyparse.
4355 For push mode, remove yypush_parse's local equivalents of these
4356 variables to eliminate unnecessary copying between the two sets at
4357 run-time. This patch also fixes at least a bug related to multiple
4358 %initial-action invocations in push mode.
4359 * data/push.c (b4_declare_parser_variables): Rename to...
4360 (b4_declare_scanner_communication_variables): ... this for clarity and
4361 update both uses.
4362 (b4_declare_yyparse_variables): Remove and move its contents to the one
4363 spot where it was invoked.
4364 (b4_declare_parser_state_variables): New macro containing the parser
4365 state variables required by push mode.
4366 (struct yypstate): Replace all fields but yynew with
4367 b4_declare_parser_state_variables.
4368 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
4369 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
4370 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
4371 (yyparse or yypush_parse): For yyparse in pull mode, replace local
4372 parser state variable declarations with
4373 b4_declare_parser_state_variables.
4374 Don't initialize parser state variables when calling yypush_parse since
4375 yypstate_new already does that.
4376 Invoke the user's initial action only upon the first yypush_parse
4377 invocation.
4378 Remove all code that copies between the local parser state variables
4379 and the yypstate.
4380
43812006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4382
4383 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
4384 prevent a name collision in a future patch where these names will
4385 sometimes be #define'd.
4386 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
4387 since it no longer has the same name as the existing argument.
4388 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
4389
43902006-12-19 Paolo Bonzini <bonzini@gnu.org>
4391 and Joel E. Denny <jdenny@ces.clemson.edu>
4392
4393 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4394 that the argument is case-insensitive, and there's no `=' here.
4395 For the %skeleton entry, mention that %language is better.
4396 (Bison Options): Likewise for --language and --skeleton. Move the
4397 --skeleton entry so that the `Tuning the parser' section is sorted
4398 alphabetically on long options.
4399 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
4400 %language directive in detail here; cross-reference the %language
4401 documentation instead.
4402 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
4403 `%require "2.3b"' so that the example is always up-to-date.
4404 (Table of Symbols): Add entries for %language and %skeleton.
4405 * examples/extexi (normalize): Instead of replacing every %require
4406 argument with the current Bison version, just substitute for
4407 `@value{VERSION}'. This guarantees that we're testing what actually
4408 appears in the documentation.
4409 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
4410 rather than `@VERSION@'.
4411
44122006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4413
4414 * NEWS: Reword the %language news a bit, and put it earlier.
4415
4416 * src/getargs.c (skeleton_arg): Last arg is now location const *.
4417 Rewrite to simplify the logic.
4418 (language_argmatch): Likewise.
4419 (program_name): We now own this var.
4420 * src/getargs.h (struct bison_language): Use char[] rather than
4421 const char *.
4422
4423 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
4424 Java is supported.
4425 * src/complain.c (program_name): Remove decl; no longer needed.
4426 * src/main.c (program_name): Remove; now belongs to getargs.
4427
44282006-12-18 Paolo Bonzini <bonzini@gnu.org>
4429
4430 * NEWS: Document %language.
4431
4432 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
4433
4434 * data/c-skel.m4, data/c++-skel.m4: New files.
4435 * data/glr.c: Complain on push parsers.
4436
4437 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
4438 over %skeleton.
4439 (Decl Summary): Document %language and %skeleton.
4440 (Command line): Document -L.
4441
4442 * examples/extexi: Rewrite %require directive.
4443 * examples/calc++/Makefile.am: Pass VERSION to extexi.
4444
4445 * src/files.c (compute_exts_from_gc): Look in language structure
4446 for .y extension.
4447 (compute_file_name_parts): Check whether .tab should be added.
4448 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
4449 (language, skeleton_arg, language_argmatch): New.
4450 (long_options): Add --language.
4451 (getargs): Use skeleton_arg, add -L/--language.
4452 * src/getargs.h: Include location.h.
4453 (struct bison_language, language, skeleton_arg, language_argmatch): New.
4454 * src/output.c (prepare): Pick default skeleton from struct language.
4455 Don't dispatch C skeletons here.
4456 * src/parse-gram.y (PERCENT_LANGUAGE): New.
4457 (prologue_declaration): Add "%language" rule, use skeleton_arg.
4458 * src/scan-gram.l ("%language"): New rule.
4459
4460 * tests/calc.at: Test %skeleton and %language.
4461 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
4462 (AT_GLR_IF): Look for %skeleton "glr.cc".
4463 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
4464 (AT_YACC_IF): Reject %language.
4465
44662006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4467
4468 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
4469 since it wasn't used; only the typedef name 'semantic_type' is needed.
4470 Also, omit trailing white space.
4471
4472 * bootstrap: Sync from coreutils.
4473 (gnulib_extra_files): Add build-aux/announce.gen.
4474 (slurp): Adjust .gitignore files like .cvsignore files.
4475 * build-aux/announce-gen: Remove from CVS, since bootstrap
4476 now creates this.
4477
44782006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
4479
4480 Make %push-parser imply %pure-parser. This fixes several bugs; see
4481 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
4482 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
4483 pure_parser = true.
4484 * data/push.c: Don't bother testing b4_push_if when deciding whether
4485 to expand b4_declare_parser_variables globally.
4486 (yypush_parse): Likewise in here.
4487
4488 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
4489 (yy_reduce_print): Reformat M4 for readability.
4490
44912006-12-15 Bob Rossi <bob@brasko.net>
4492 and Joel Denny <jdenny@ces.clemson.edu>
4493
4494 * data/push.c (yypstate): Add typedef, and update all uses of
4495 struct yypstate to just yypstate.
4496 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
4497
44982006-12-14 Bob Rossi <bob@brasko.net>
4499
4500 * data/push.c (yypush_parse): Declare prototype regardless of
4501 %locations option.
4502
45032006-12-14 Bob Rossi <bob@brasko.net>
4504
4505 * data/push.c (yyparse): Remove the prototype and the #define when in
4506 push-parser mode.
4507
45082006-12-13 Bob Rossi <bob@brasko.net>
4509
4510 * data/push.c (yypstate_init): Rename to...
4511 (yypstate_new): ... this and use b4_c_function_def.
4512 (yypstate_delete): New.
4513 (yypush_parse): Change parameters yynval and yynlloc to be const.
4514 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
4515 yypstate_delete functions.
4516
45172006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
4518
4519 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
4520 strange test case titles. Reported by Bob Rossi.
4521
45222006-12-13 Paul Eggert <eggert@cs.ucla.edu>
4523
4524 * TODO: Add pointer to Sylvain Schmitz's work on static detection
4525 of potential ambiguities in GLR grammers.
4526
45272006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
4528
4529 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
4530 `bison ', use m4_index instead of m4_substr since chopping up a string
4531 containing M4-special characters causes problems here.
4532
4533 Fix a couple of bugs related to special characters in user-specified
4534 file names, and make it easier for skeletons to compute output file
4535 names with the same file name prefix as Bison-computed output file
4536 names.
4537 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
4538 b4_parser_file_name and b4_spec_defines_file instead of
4539 @output_parser_name@ and @output_header_name@, which are now redundant.
4540 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
4541 b4_parser_file_name, b4_spec_defines_file, and the new
4542 @basename(FILENAME@) instead of @output_parser_name@ and
4543 @output_header_name@, which inappropriately escaped the file names as
4544 C string literals.
4545 * src/files.c (all_but_ext): Remove static qualifier.
4546 (compute_output_file_names): Move `free (all_but_ext)' to...
4547 (output_file_names_free): ... here since all_but_ext is needed later.
4548 * src/files.h (all_but_ext): Extern.
4549 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
4550 exactly what MUSCLE_INSERT_STRING used to do.
4551 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
4552 characters are escaped properly.
4553 * src/output.c (prepare): Define muscle file_name_all_but_ext as
4554 all_but_ext.
4555 For pkgdatadir muscle, maintain previous functionality by using
4556 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
4557 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
4558 digraphs would never be expanded. Hopefully no one has M4-special
4559 characters in his Bison installation path.
4560 * src/scan-skel.l: Don't parse @output_header_name@ and
4561 @output_parser_name@ anymore since they're now redundant.
4562 In @output, use decode_at_digraphs.
4563 Parse a new @basename command that invokes last_component.
4564 (decode_at_digraphs): New.
4565 (BASE_QPUTS): Remove unused.
4566 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
4567 (Output file name): New tests.
4568
45692006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
4570
4571 Warn about output files that are generated by the skeletons and that
4572 conflict with other output files.
4573 * data/glr.c: Don't generate the header file here when glr.cc does.
4574 * src/files.c (file_names, file_names_count): New static globals.
4575 (compute_output_file_names): Invoke output_file_name_check for files
4576 not generated by the skeletons and remove existing checks.
4577 (output_file_name_check): New function that warns about conflicting
4578 output file names.
4579 (output_file_names_free): Free file_names.
4580 * src/files.h (output_file_name_check): Declare.
4581 * src/scan-skel.l: Invoke output_file_name_check for files generated by
4582 the skeletons.
4583 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
4584 (Conflicting output files): New tests.
4585
45862006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4587
4588 * doc/bison.texinfo: Fix a couple of typos.
4589
45902006-12-08 Bob Rossi <bob@brasko.net>
4591
4592 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
4593 Rename to...
4594 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
4595 update all uses.
4596 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
4597 (yypush_parse): Rename yypvars argument to yyps and remove redundant
4598 local pv.
4599 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
4600 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
4601
46022006-12-07 Bob Rossi <bob@brasko.net>
4603 and Joel Denny <jdenny@ces.clemson.edu>
4604
4605 * data/push.c (yypvarsinit): Change return type from void* to struct
4606 yypvars*. No longer cast to void* on return.
4607 (struct yypvars): Remove yylen since it need not be remembered between
4608 yypushparse invocations.
4609 (yypushparse): Don't copy between yylen and pv->yylen.
4610
46112006-12-05 Bob Rossi <bob@brasko.net>
4612
4613 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
4614 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
4615 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
4616 (struct yypvars): Remove b4_declare_parser_variables.
4617 (yypvarsinit): Remove init code for removed variables.
4618 (global scope): Do not declare b4_declare_parser_variables if
4619 push or pure mode.
4620 (yypushparse): Add b4_declare_parser_variables.
4621 Init new local variables, and remove init code for removed
4622 yypvars variables.
4623 (yyparse): Delete.
4624 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
4625 and yyparse for other modes.
4626 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
4627 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
4628 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
4629 (AT_PURE_LEX_IF): True if pure or push parser.
4630
46312006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
4632
4633 Document Yacc prologue alternatives and default %destructor's and
4634 %printer's as experimental. Don't mention Java yet. Discussed at
4635 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
4636 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
4637 (2.3a): Annotate this entry to say the old forms of these features were
4638 also experimental.
4639 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
4640 Table of Symbols): Say they're experimental. Comment out any mention
4641 of Java (we'll want this back eventually).
4642
46432006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4644
4645 Support a file name argument to %defines. Deprecate `=' in
4646 %file-prefix, %name-prefix, and %output. Discussed at
4647 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
4648 * NEWS (2.3a+): Mention.
4649 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
4650 form of %defines, and remove `=' from entries for %file-prefix,
4651 %name-prefix, and %output.
4652 * src/parse-gram.y (prologue_declaration): Implement.
4653 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
4654 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
4655 all but one occurrence of %name-prefix.
4656 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
4657 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
4658 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
4659 occurrence of each of %file-prefix and %output. Add check for %defines
4660 with argument.
4661 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
4662 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
4663 Remove the `=' from %output.
4664
46652006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
4666
4667 Don't escape $ in test case titles since Autoconf 2.61 now does that
4668 correctly.
4669 * tests/actions.at (Default %printer and %destructor are not for error
4670 or $undefined): Here.
4671 (Default %printer and %destructor are not for $accept): Here.
4672 * tests/input.at (Invalid $n and @n): Here.
4673
46742006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
4675
4676 Rename <!> to <>. Discussed starting at
4677 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
4678 * NEWS (2.3a+): Update.
4679 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
4680 Update.
4681 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
4682 * src/scan-gram.l (INITIAL): Implement.
4683 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
4684 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
4685 comment.
4686 * tests/actions.at (Default tagless %printer and %destructor,
4687 Default tagged and per-type %printer and %destructor,
4688 Default %printer and %destructor are not for error or $undefined,
4689 Default %printer and %destructor are not for $accept,
4690 Default %printer and %destructor for mid-rule values): Update.
4691 * tests/input.at (Default %printer and %destructor redeclared,
4692 Unused values with default %destructor): Update.
4693
46942006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
4695
4696 Don't let %prec take a nonterminal.
4697 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
4698 token.
4699 * tests/input.at (%prec takes a token): New test checking that %prec
4700 won't take a nonterminal.
4701
47022006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4703
4704 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
4705 it was double-quoted.
4706 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
4707 grammar is maintained with Bison's highest standards.
4708 * src/getargs.c: Fix some typos in Doxygen comments.
4709
47102006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4711
4712 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
4713 later. Reported by Paul Eggert in
4714 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
4715 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
4716 * src/scan-code.l (translate_action): Don't bother invoking
4717 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
4718 (code_scanner_free): Instead of invoking
4719 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
4720 which frees more.
4721 * src/scan-gram.l (gram_scanner_free): Likewise.
4722 * src/scan-skel.l (scan_skel): Likewise.
4723
47242006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4725
4726 * src/files.c (tr): Change return type to void.
4727 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
4728 has been called previously for the same key.
4729 (muscle_find): Return storage instead of value so that
4730 --enable-gcc-warnings doesn't produce warnings that the return discards
4731 const. aver that the value and storage are the same since storage
4732 could potentially be NULL when value is not.
4733 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
4734 same as 0.
4735
47362006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4737
4738 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
4739 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
4740 us a slightly cleaner distribution, and also works.
4741 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
4742 gnulib changes.
4743
47442006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
4745 and Paul Eggert <eggert@cs.ucla.edu>
4746
4747 Don't let Bison leak memory except when it complains.
4748 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
4749 (spec_defines_file, dir_prefix): Now char *, not const char *,
4750 since they are freed.
4751 * src/files.c: Likewise.
4752 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
4753 Likewise.
4754 (tr): Now operates in-place. All uses changed.
4755 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
4756 values.
4757 (compute_file_name_parts, compute_output_file_names): Don't store
4758 read-only data in variables that will be freed.
4759 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
4760 src_extension, and header_extension.
4761 (output_file_names_free): New public function to free
4762 spec_verbose_file, spec_graph_file, spec_defines_file,
4763 parser_file_name, and dir_prefix.
4764 * src/getargs.c (getargs): Don't store read-only data in variables that
4765 will be freed.
4766 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
4767 (which previously existed but was unused), and quotearg_free.
4768 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
4769 * src/muscle_tab.c: Likewise.
4770 (muscle_entry): Make the value char const *,
4771 and add a new storage member that is char * and can be freed.
4772 (muscle_entry_free): New private function.
4773 (muscle_init): Use it instead of free.
4774 (muscle_insert, muscle_grow): Update and use new storage member.
4775 (muscle_code_grow): Free the string passed to muscle_grow
4776 since it's not needed anymore.
4777 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
4778 add a new `char *code' member.
4779 ("{...}"): Declare semantic type as code.
4780 * src/scan-code.h (translate_rule_action):
4781 (translate_symbol_action, translate_code, translate_action): Return
4782 `char const *' rather than `char *' since external code should not free
4783 these strings.
4784 * src/scan-code.l: Likewise.
4785 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
4786 which is "{...}" in the parser.
4787 * tests/Makefile.am (maintainer-check-valgrind): Set
4788 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
4789 Valgrind.
4790 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
4791 complain.
4792 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
4793 expecting a non-zero exit status sets --leak-check=summary and
4794 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
4795 this case, and we don't want to hear about it.
4796
47972006-11-08 Paul Eggert <eggert@cs.ucla.edu>
4798
4799 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
4800 instead of from the template, to simplify configuration a bit.
4801 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
4802 and m4/wint_t.m4, as they are needed with the latest gnulib.
4803
48042006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4805
4806 Disable unset/unused mid-rule value warnings by default, and recognize
4807 --warnings=midrule-values to enable them. Discussed starting at
4808 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
4809 * NEWS (2.3a+): Mention.
4810 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
4811 warnings): Add entry for midrule-values subargument.
4812 * src/reader.c (symbol_should_be_used): Don't return true just because
4813 the value is a set/used mid-rule value unless
4814 --warnings=midrule-values was specified.
4815 * tests/input.at (Unused values, Unused values before symbol
4816 declarations): Run tests with and without --warnings=midrule-values.
4817
4818 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
4819 than LIST_FREE directly.
4820
48212006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4822
4823 Finish implementing --warnings=error, which should not be implied by
4824 --warnings=all (or by its synonyms -W and --warnings without
4825 subarguments).
4826 * src/complain.c (set_warning_issued): New function to report that
4827 warnings are being treated as errors and to record an error if so.
4828 Invoke...
4829 (warn_at, warn): ... here.
4830 * src/getargs.c (warnings_args, warnings_types): Reorder so that
4831 "error - warnings are errors" does not appear above "all - all of the
4832 above".
4833 (getargs): For -W and --warnings without subarguments, don't let
4834 FLAGS_ARGMATCH set warnings_error in warnings_flag.
4835 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
4836
48372006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
4838
4839 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
4840 empty subargument list. For example: `bison --warnings= parser.y'.
4841
48422006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4843
4844 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
4845 the parser header file so that gcc doesn't warn.
4846
48472006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4848
4849 Split the default %destructor/%printer into two kinds: <*> and <!>.
4850 Discussed starting at
4851 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
4852 * NEWS (2.3a+): Mention.
4853 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
4854 previous change today related to mid-rules.
4855 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
4856 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
4857 (TYPE_TAG_ANY): Add as <*>.
4858 (TYPE_TAG_NONE): Add as <!>.
4859 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
4860 for <*> and <!>.
4861 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
4862 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
4863 * src/symlist.c (symbol_list_default_new): Split into tagged and
4864 tagless versions.
4865 (symbol_list_destructor_set, symbol_list_printer_set): Split
4866 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
4867 SYMLIST_DEFAULT_TAGLESS.
4868 * src/symlist.h: Update symbol_list_default*_new prototypes.
4869 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
4870 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
4871 * src/symtab.c (default_destructor, default_destructor_location,
4872 default_printer, default_printer_location): Split each into tagged and
4873 tagless versions.
4874 (symbol_destructor_get, symbol_destructor_location_get,
4875 symbol_printer_get, symbol_printer_location_get): Implement tagged
4876 default and tagless default cases.
4877 (default_destructor_set, default_printer_set): Split each into tagged
4878 and tagless versions.
4879 * src/symtab.h: Update prototypes.
4880 * tests/actions.at (Default %printer and %destructor): Rename to...
4881 (Default tagless %printer and %destructor): ... this, and extend.
4882 (Per-type %printer and %destructor): Rename to...
4883 (Default tagged and per-type %printer and %destructor): ... this, and
4884 extend.
4885 (Default %printer and %destructor for user-defined end token): Extend.
4886 (Default %printer and %destructor are not for error or $undefined):
4887 Update.
4888 (Default %printer and %destructor are not for $accept): Update.
4889 (Default %printer and %destructor for mid-rule values): Extend.
4890 * tests/input.at (Default %printer and %destructor redeclared): Extend.
4891 (Unused values with default %destructor): Extend.
4892
48932006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4894
4895 Don't apply the default %destructor/%printer to an unreferenced midrule
4896 value. Mentioned at
4897 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
4898 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
4899 like $@n instead of just @n so that the default %destructor/%printer
4900 logic doesn't see them as user-defined symbols.
4901 (symbol_is_dummy): Check for both forms of the name.
4902 * src/reader.c (packgram): Remove the `$' from each midrule symbol
4903 name for which the midrule value is referenced in any action.
4904 * tests/actions.at (Default %printer and %destructor for mid-rule
4905 values): New test.
4906 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
4907 for change to dummy symbol names.
4908
49092006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4910
4911 Warn about unset midrule $$ if the corresponding $n is used.
4912 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
4913 $n usage.
4914 (packgram): Before invoking grammar_rule_check on any rule, make sure
4915 all actions have already been scanned in order to set `used' flags.
4916 Otherwise, checking that a midrule's $$ is set will not always work
4917 properly because the midrule check must forward-reference the midrule's
4918 parent rule.
4919 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
4920 warning.
4921
49222006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
4923
4924 More improvements to the documentation of the prologue alternatives:
4925 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
4926 Bison manual.
4927 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
4928 some text to clarify the relative importance of the new directives and
4929 to show how these directives may be viewed as code labels.
4930
49312006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
4932
4933 Similar to the recently removed %before-header, add %code-top as the
4934 alternative to the pre-prologue. Mentioned at
4935 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
4936 Also, let the prologue alternatives appear in the grammar section.
4937 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
4938 (prologue_declaration): Move the existing prologue alternatives to...
4939 (grammar_declaration): ... here and add %code-top.
4940 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
4941
4942 Clean up and extend documentation for the prologue alternatives.
4943 * NEWS (2.3a+): Describe prologue alternatives.
4944 * doc/bison.texinfo (Prologue): Move discussion of prologue
4945 alternatives to...
4946 (Prologue Alternatives): ... this new section, and extend it to discuss
4947 all 4 directives in detail.
4948 (Table of Symbols): Clean up discussion of prologue alternatives and
4949 add %code-top.
4950
49512006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4952
4953 DJGPP specific issues.
4954
4955 * djgpp/config.bat: config.hin has been moved to lib. Adjust
4956 config.bat accordingly.
4957 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
4958 * djgpp/config.site: Likewise.
4959
49602006-10-16 Paolo Bonzini <bonzini@gnu.org>
4961
4962 Replace %*-header with %provides, %requires, %code. See discussion at
4963 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
4964
4965 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
4966 (b4_user_start_header): Remove.
4967 * data/glr.c: Use new macros instead of b4_*start_header
4968 and b4_*end_header.
4969 * data/glr.cc: Likewise.
4970 * data/lalr1.cc: Likewise.
4971 * data/push.c: Likewise.
4972 * data/yacc.c: Likewise.
4973
4974 * doc/bison.texinfo: Remove %before-header, rename
4975 %{start,end,after}-header to %requires, %provides, %code.
4976
4977 * src/parse-gram.y: Likewise (also rename token names accordingly).
4978 * src/scan-gram.l: Likewise.
4979 * tests/actions.at: Likewise.
4980
49812006-10-14 Paul Eggert <eggert@cs.ucla.edu>
4982
4983 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
4984 Problem reported by Joel E. Denny.
4985
49862006-10-14 Jim Meyering <jim@meyering.net>
4987
4988 (Sync from coreutils.)
4989 Work also when the working directory (with e.g. coreutils sources)
4990 is version controlled with git, rather than CVS.
4991 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
4992 rather than CVS.
4993 In messages and comments, say e.g., "checked-out sources",
4994 rather than "CVS sources".
4995 (version_controlled_file): New function. Work for git as well as
4996 for CVS. Don't use grep's -q option.
4997 (slurp): Call it here, in place of CVS-specific code.
4998
49992006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
5000
5001 Fix testsuite for ./configure --enable-gcc-warnings:
5002 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
5003 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
5004 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
5005 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
5006 * test/regression.at (Diagnostic that expects two alternatives):
5007 Likewise.
5008
50092006-10-12 Paul Eggert <eggert@cs.ucla.edu>
5010
5011 * bootstrap.conf (gnulib_modules): Add config-h.
5012 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
5013 worry about HAVE_CONFIG_H.
5014 * lib/abitset.c: Likewise.
5015 * lib/bitset.c: Likewise.
5016 * lib/bitset_stats.c: Likewise.
5017 * lib/bitsetv-print.c: Likewise.
5018 * lib/bitsetv.c: Likewise.
5019 * lib/ebitset.c: Likewise.
5020 * lib/get-errno.c: Likewise.
5021 * lib/lbitset.c: Likewise.
5022 * lib/subpipe.c: Likewise.
5023 * lib/timevar.c: Likewise.
5024 * lib/vbitset.c: Likewise.
5025 * lib/bitset.c: Include "bitset.h" first, to test interface.
5026 * lib/bitset_stats.c: Include "bitset_stats.h" first.
5027 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
5028 * lib/bitsetv.c: Include "bitsetv.h" first.
5029 * lib/get-errno.c: Include "get-errno.h" first.
5030 * m4/.cvsignore: Add config-h.m4.
5031 * tests/actions.at (Default %printer and %destructor for ...):
5032 Adjust expected line numbers in output to reflect removal of #if
5033 HAVE_CONFIG_H lines.
5034 * tests/glr-regression.at (Missed %merge type warnings when ...):
5035 Likewise.
5036 * tests/regression.at (Braced code in declaration in rules section):
5037 Likewise.
5038 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
5039 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
5040 Include <config.h> unconditionally.
5041
5042 * bootstrap: Sync from coreutils, as follows:
5043
5044 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
5045
5046 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
5047 variable was sometimes used without being initialized. This
5048 messed up the installation of the INSTALL file in some cases.
5049
5050 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
5051
5052 * bootstrap (usage, main program, symlink_to_gnulib): Add option
5053 --copy. Inspired by a suggestion from Bruno Haible.
5054
5055 2006-10-03 Jim Meyering <jim@meyering.net>
5056
5057 * bootstrap: Undo last change to this file, since now gnulib-tool
5058 sticks with the automake default in generating dependencies.
5059
50602006-10-12 Paul Eggert <eggert@cs.ucla.edu>
5061
5062 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
5063 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
5064
5065 * doc/bison.1: Add copyright notice.
5066
5067 * data/glr.c: Don't include <stdarg.h>; not used.
5068
5069 * NEWS: The -g and --graph options now output graphs in Graphviz
5070 DOT format, not VCG format.
5071 * doc/bison.1: Likewise.
5072 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
5073 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
5074 of this change in
5075 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
5076 * TODO: Remove Graphviz entry.
5077 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
5078 remove vcg.c, vcg.h, vcg_defaults.h.
5079 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
5080 * src/graphviz.c, src/graphviz.h: New files.
5081 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
5082 * src/files.h: Make comment more generic.
5083 * src/main.c (main): Likewise.
5084 * src/print_graph.h: Likewise.
5085 * src/getargs.c (usage): Make usage description more generic.
5086 * src/print_graph.c: Include graphviz.h rather than vcg.h.
5087 (static_graph, fgraph): Remove. All uses changed to pass
5088 arguments instead of sharing a static var.
5089 (print_core, print_actions, print_state, print_graph):
5090 Output graphviz format rather than VCG format.
5091 * tests/.cvsignore: Remove *.vcg; add *.dot.
5092 * tests/output.at: Expect *.dot files, not *.vcg files.
5093
5094 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
5095 accommodates the 2006-10-08 change.
5096
50972006-10-11 Bob Rossi <bob@brasko.net>
5098
5099 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
5100 (b4_yyssa, b4_yyerror_range): New macros.
5101 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
5102 (yypvarsinit): Remove init of removed fields.
5103 (yypushparse): Remove use of removed fields; use new macros instead.
5104
51052006-10-11 Paul Eggert <eggert@cs.ucla.edu>
5106
5107 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
5108 in a push parser. Reindent slightly to match yacc.c better.
5109
51102006-10-11 Bob Rossi <bob@brasko.net>
5111
5112 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
5113 yymsg_alloc fields.
5114 (yypvarsinit, yypushparse): Remove init of removed fields.
5115 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
5116
51172006-10-09 Paul Eggert <eggert@cs.ucla.edu>
5118
5119 * THANKS: Add Paolo Bonzini and Bob Rossi.
5120
51212006-10-08 Paolo Bonzini <bonzini@gnu.org>
5122
5123 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
5124 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
5125 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
5126 b4_define_user_cde and uses): Remove.
5127 (b4_comment, b4_prefix, b4_sync_start): New.
5128 * data/bison.m4: New file, with most of the content removed from c.m4.
5129 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
5130 * src/output.c (output_skeleton): Pass bison.m4.
5131 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
5132 only if specified.
5133
51342006-10-05 Paul Eggert <eggert@cs.ucla.edu>
5135
5136 Fix test failure reported by Tom Lane in
5137 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
5138 and try to make such failures easier to catch in the future.
5139 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
5140 that's now the caller's responsibility.
5141 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
5142 Set yychar = YYEOF if it's negative.
5143 * tests/actions.at (yylex): Abort if asked to read past EOF.
5144 * tests/conflicts.at (yylex): Likewise.
5145 * tests/cxx-type.at (yylex): Likewise.
5146 * tests/glr-regression.at (yylex): Likewise.
5147 * tests/input.at (yylex): Likewise.
5148 * tests/regression.at (yylex): Likewise.
5149 * tests/torture.at (yylex): Likewise.
5150
51512006-10-01 Paul Eggert <eggert@cs.ucla.edu>
5152
5153 Fix problems with translating English-language diagnostics.
5154 * bootstrap: Fix bug introduced in recent bootstrap changes, with
5155 respect to bison-runtime pot generation. The YY_ stuff
5156 wasn't being captured.
5157 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
5158 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
5159 * runtime-po/POTFILES.in: Add data/push.c.
5160
51612006-09-29 Paul Eggert <eggert@cs.ucla.edu>
5162
5163 Merge bootstrap changes from coreutils.
5164
5165 2006-09-28 Jim Meyering <jim@meyering.net>
5166
5167 Automatically generated dependencies are important even
5168 when all of the sources in a directory come from gnulib.
5169 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
5170 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
5171
5172 2006-09-23 Jim Meyering <jim@meyering.net>
5173
5174 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
5175
5176 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5177
5178 * bootstrap: Add support for --force.
5179 (usage): New function. Describe usage less tersely.
5180 (CVS_only_file): New var.
5181
51822006-09-21 Paul Eggert <eggert@cs.ucla.edu>
5183
5184 * data/push.c (YYPUSH_MORE): Make it an enum instead.
5185 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
5186 Adjust white space and comments to match GNU style better.
5187
51882006-09-20 Bob Rossi <bob@brasko.net>
5189
5190 * data/push.c (yyresult_get): Remove function.
5191 (YYPUSH_MORE): Add #define.
5192 (yypushparse): Modify return value.
5193
51942006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5195
5196 * stamp-h.in: Remove; no longer needed.
5197 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
5198 Remove config.h, config.hin, intl (no longer created).
5199 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
5200 stamp-h1.
5201
5202 Sync bootstrap from coreutils, as follows:
5203
5204 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
5205
5206 * bootstrap (symlink_to_gnulib): New function.
5207 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
5208 to copies-of-gnulib.
5209 (cp_mark_as_generated, slurp, gnulib_files):
5210 Avoid making a copy if it's the same as the old version.
5211 (gnulib_files): Add support for this variable (used by Bison).
5212
52132006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5214
5215 * src/getargs.c (usage): Rework to use conventions similar to
5216 coreutils, to make translation a bit easier and the code a bit
5217 smaller. Problem reported by Tim Van Holder.
5218
52192006-09-15 Paul Eggert <eggert@cs.ucla.edu>
5220
5221 Use some of gnulib's new modules, taken from coreutils.
5222
5223 * bootstrap: Sync from coreutils, except add support for gnulib_files.
5224 * bootstrap.conf: New file.
5225 (gnulib_modules): Add configmake, inttypes, unistd.
5226 (XGETTEXT_OPTIONS): Add complain, complain_at,
5227 fatal, fatal_at, warn, warn_at, unexpected_end.
5228 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
5229 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
5230 (gl_EARLY): Add.
5231 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
5232 (gl_INIT): Add
5233 (GNULIB_AUTOCONF_SNIPPET): Remove.
5234 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
5235 the pickiest.
5236 * lib/.cvsignore: Add inttypes_.h.
5237 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
5238 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
5239 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
5240 no-longer-necessary initializations.
5241 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
5242 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
5243 use the unistd module.
5244 * src/system.h: Likewise.
5245 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
5246 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
5247 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
5248 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
5249 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
5250 * src/system.h: Include inttypes.h unconditionally, now that we
5251 use the inttypes module. Don't bother to include stdint.h, since
5252 inttypes.h now does that for us.
5253 (LOCALEDIR): Remove, now that we use the configmake module.
5254 * src/getargs.c: Include configmake.h.
5255 * src/main.c: Likewise.
5256 * src/output.c: Likewise.
5257 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
5258 not from $abs_top_builddir, since config.h moved.
5259
5260
5261 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
5262 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
5263
5264 * src/parse-gram.y (symbol_declaration): Don't put statements
5265 before declarations; it's not portable to C89.
5266 * src/scan-code.l (handle_action_at): Likewise.
5267
5268 * src/scan-code.l: Always initialize braces_level; the old code
5269 left it uninitialized and therefore had undefined behavior.
5270
5271 Don't attempt to redefine 'assert', since it runs afoul of
5272 systems where standard headers (mistakenly) include <assert.h>.
5273 Instead, define and use our own alternative, called 'aver'.
5274 * src/reader.c: Don't include assert.h, since we no longer
5275 use assert.
5276 * src/scan-code.l: Likewise.
5277 * src/system.h (assert): Remove, replacing with....
5278 (aver): New function, taking a bool arg. All uses changed.
5279 * src/tables.c (pack_vector): Ensure that aver arg is bool,
5280 not merely an integer.
5281
52822006-09-15 Bob Rossi <bob@brasko.net>
5283
5284 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
5285 * data/c.m4 (YYPUSH): New.
5286 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
5287 * src/getargs.c (push_parser): New var.
5288 * src/getargs.h (push_parser): New declaration.
5289 * src/output.c (prepare): Add macro insertion of `push_flag'.
5290 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
5291 (prologue_declaration): Parse %push-parser.
5292 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
5293 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
5294 list of removed lines from the traces observed.
5295 (AT_CHECK_CALC_LALR): Added push parser tests.
5296
52972006-09-13 Paul Eggert <eggert@cs.ucla.edu>
5298
5299 * NEWS: Version 2.3a.
5300 * configure.ac (AC_INIT): Likewise.
5301
5302 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
5303 "#define YYSTYPE int" that caused "make maintainer-check" to fail
5304 due to header ordering dependencies. I don't know why the #define
5305 was there.
5306
5307 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
5308 runtime cost when YYDEBUG is not defined, and so that some tests
5309 that used to fail now work. Problem and initial suggestion by
5310 Paolo Bonzini.
5311 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
5312 * data/glr.cc (b4_parser_class_name):
5313 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
5314 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
5315 (yydebug_) [YYDEBUG]: New member.
5316 (yycdebug_): Now defined only if YYDEBUG.
5317 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
5318 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
5319 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
5320 if YYYDEBUG.
5321 (debug_stream, set_debug_stream, debug_level, set_debug_level):
5322 Define only if YYDEBUG.
5323 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
5324 set_debug_level.
5325 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
5326 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
5327 AT_CHECK_CALC_GLR_CC that are working now.
5328
53292006-09-12 Paul Eggert <eggert@cs.ucla.edu>
5330
5331 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
5332 We don't need them in glr.cc, and glr.c defines them.
5333 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
5334 assumes that defining it to anything is the same as defining
5335 it to 1. Problem reported by Paolo Bonzini.
5336
53372006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
5338
5339 * data/c.m4 (b4_null, b4_case): Define.
5340 * src/output.c (prepare_symbols): Use b4_null.
5341 (user_actions_output): Use b4_case.
5342
53432006-09-11 Paul Eggert <eggert@cs.ucla.edu>
5344
5345 * data/glr.c (b4_shared_declarations): Put start-header first,
5346 before any #includes that we generate, so that feature-test
5347 macros work. Problem reported by Michael Deutschmann in
5348 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
5349 * data/lalr1.cc: Likewise.
5350 * doc/bison.texinfo (Prologue): Document that feature-test macros
5351 should be defined before any Bison declarations.
5352 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
5353 that depend on location.hh after, not before, Bison decls, since
5354 we now include location.hh after the first user prologue.
5355
5356 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
5357 Sander Brandenburg in
5358 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
5359 Also, fix minor white space and comment issues.
5360 (Prologue): Mention that it's better to define feature-test macros
5361 before Bison declarations. Problem reported by Michael Deutschmann.
5362
5363 * README-cvs: Fix typo: "&" should be "&&". Problem reported
5364 by Jim Meyering.
5365 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
5366 This adjusts to recent gnulib changes.
5367
53682006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5369
5370 Finish implementation of per-type %destructor/%printer. Discussed
5371 starting at
5372 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
5373 and
5374 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
5375 * NEWS (2.3+): Add a description of this feature to the default
5376 %destructor/%printer description.
5377 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
5378 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5379 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
5380 list node contains a semantic type.
5381 * src/symtab.c, src/symtab.h: Extend with a table that associates
5382 semantic types with their %destructor's and %printer's.
5383 (semantic_type_from_uniqstr, semantic_type_get,
5384 semantic_type_destructor_set, semantic_type_printer_set): New functions
5385 composing the public interface of that table.
5386 (symbol_destructor_get, symbol_destructor_location_get,
5387 symbol_printer_get, symbol_printer_location_get): If there's no
5388 per-symbol %destructor/%printer, look up the per-type before trying
5389 the default.
5390 * tests/actions.at (Per-type %printer and %destructor): New test case.
5391 * tests/input.at (Default %printer and %destructor redeclared):
5392 Extend to check that multiple occurrences of %symbol-default in a
5393 single %destructor/%printer declaration is an error.
5394 (Per-type %printer and %destructor redeclared, Unused values with
5395 per-type %destructor): New test cases.
5396
53972006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5398
5399 Require default %destructor/%printer to be declared using
5400 %symbol-default instead of an empty symbol list, and start working on
5401 new per-type %destructor/%printer. Discussed at
5402 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
5403 * NEWS (2.3+): Add %symbol-default to example.
5404 * bison.texinfo (Freeing Discarded Symbols): Likewise.
5405 (Table of Symbols): Add entry for %symbol-default.
5406 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
5407 (generic_symlist, generic_symlist_item): New nonterminals for creating
5408 a list in which each item is a symbol, semantic type, or
5409 %symbol-default.
5410 (grammar_declaration): Use generic_symlist in %destructor and %printer
5411 declarations instead of symbols.1 or an empty list.
5412 (symbol_declaration, precedence_declaration, symbols.1): Update actions
5413 for changes to symbol_list.
5414 * src/reader.c: Update for changes to symbol_list.
5415 * src/scan-code.l: Likewise.
5416 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
5417 * src/symlist.c, src/symlist.h: Extend such that a list node may
5418 represent a semantic type or a %symbol-default in addition to just an
5419 ordinary symbol. Add switched functions for setting %destructor's and
5420 %printer's.
5421 * tests/actions.at, tests/input.at: Add %symbol-default to all default
5422 %destructor/%printer declarations.
5423
54242006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
5425
5426 Whether the default %destructor/%printer applies to a particular symbol
5427 isn't a question of whether the user *declares* that symbol (in %token,
5428 for example). It's a question of whether the user by any means
5429 *defines* the symbol at all (by simply using a char token, for
5430 example). $end is defined by Bison whereas any other token with token
5431 number 0 is defined by the user. The error token is always defined by
5432 Bison regardless of whether the user declares it with %token, but we
5433 may one day let the user define error as a nonterminal instead.
5434 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
5435 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
5436 the meaning of "user-defined".
5437 * tests/actions.at (Default %printer and %destructor for user-declared
5438 end token): Rename to...
5439 (Default %printer and %destructor for user-defined end token): ...
5440 this.
5441
5442 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
5443 computation of whether to apply the default, don't maintain a list of
5444 every Bison-defined symbol. Instead, just check for a first character
5445 of '$', which a user symbol cannot have, and check for the error token.
5446
54472006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
5448
5449 Don't apply the default %destructor or %printer to the error token,
5450 $undefined, or $accept. This change fits the general rule that the
5451 default %destructor and %printer are only for user-declared symbols,
5452 and it solves several difficulties that are described in the new test
5453 cases listed below.
5454 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
5455 * tests/actions.at (Default %printer and %destructor are not for error
5456 or $undefined, Default %printer and %destructor are not for $accept):
5457 New test cases.
5458
54592006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
5460
5461 Allow %start after the first rule.
5462 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
5463 when parsing the first rule.
5464 (check_and_convert_grammar): Search for it here after all grammar
5465 declarations have been parsed. Skip midrules, which have dummy LHS
5466 nonterminals.
5467 * src/symtab.c (symbol_is_dummy): New function.
5468 * src/symtab.h (symbol_is_dummy): Declare it.
5469 * tests/input.at (%start after first rule): New test.
5470
54712006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5472
5473 Redo some of the previous commit: add back the ability to use
5474 non-aliased/undeclared string literals since it might be useful to
5475 those declaring %token-table.
5476 * src/reader.c (check_and_convert_grammar): Undo changes in previous
5477 commit: don't worry about complaints from symbols_pack.
5478 * src/symtab.c (symbol_new, symbol_class_set,
5479 symbol_check_alias_consistency): Undo changes in previous commit: count
5480 each string literal as a new symbol and token, assign it a symbol
5481 number, and don't complain about non-aliased string literals.
5482 (symbols_pack): Since symbol_make_alias still does not decrement symbol
5483 and token counts but does still set aliased tokens to the same number,
5484 symbol_pack_processor now leaves empty slots in the symbols array.
5485 Remove those slots.
5486 * tests/regression.at (Undeclared string literal): Remove test case
5487 added in previous commit since non-aliased string literals are allowed
5488 again.
5489 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
5490 remove unnecessary string literal declarations.
5491 * tests/sets.at (Firsts): Likewise.
5492
54932006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5494
5495 Don't allow an undeclared string literal, but allow a string literal to
5496 be used before its declaration.
5497 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
5498 symbols_pack complained.
5499 * src/symtab.c (symbol_new): Don't count a string literal as a new
5500 symbol.
5501 (symbol_class_set): Don't count a string literal as a new token, and
5502 don't assign it a symbol number since symbol_make_alias does that.
5503 (symbol_make_alias): It's not necessary to decrement the symbol and
5504 token counts anymore. Don't assume that an alias declaration occurs
5505 before any uses of the identifier or string, and thus don't assert that
5506 one of them has the highest symbol number so far.
5507 (symbol_check_alias_consistency): Complain if there's a string literal
5508 that wasn't declared as an alias.
5509 (symbols_pack): Bail if symbol_check_alias_consistency failed since
5510 symbol_pack asserts that every token has been assigned a symbol number
5511 although undeclared string literals have not.
5512 * tests/regression.at (String alias declared after use, Undeclared
5513 string literal): New test cases.
5514 (Characters Escapes, Web2c Actions): Declare string literals as
5515 aliases.
5516 * tests/sets.at (Firsts): Likewise.
5517
55182006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
5519
5520 In the grammar scanner, STRING_FINISH unclosed constructs and return
5521 them to the parser in order to improve error messages.
5522 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
5523 SC_BRACED_CODE, SC_PROLOGUE): Implement.
5524 * tests/input.at (Unclosed constructs): New test case.
5525 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
5526 seen.
5527
5528 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
5529 unused global.
5530
55312006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
5532
5533 Handle string aliases for character tokens correctly.
5534 * src/symtab.c (symbol_user_token_number_set): If the token has an
5535 alias, check and set its alias's user token number instead of its own,
5536 which is set to indicate the alias. Previously, every occurrence of
5537 the character token in the grammar overwrote that alias indicator with
5538 the character code.
5539 * tests/input.at (String aliases for character tokens): New test.
5540
55412006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
5542
5543 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
5544
55452006-08-11 Paul Eggert <eggert@cs.ucla.edu>
5546
5547 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
5548 to prevent failures when building on older platforms.
5549 Check for autopoint failure.
5550 Set XGETTEXT_OPTIONS to values that check for C format strings,
5551 so that translators are warned about them (this also helps
5552 prevent core dumps).
5553
5554 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
5555 function, since it simplifies our code a bit.
5556
5557 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
5558 rather than -W, so we don't get bogus warnings about sign comparisons.
5559 Add -Wpointer-arith, since that warning is useful (it reports code
5560 that does not conform to C89 and that some compilers reject).
5561 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
5562 since it's no longer needed.
5563
55642006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
5565
5566 Clean up scanners a bit.
5567 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
5568 definitions so gcc won't warn when obstack_for_string is unused.
5569 * src/scan-code.l: config.h and system.h are already #include'd by
5570 scan-code-c.c, so get rid of them here.
5571 * src/scan-gram.l: Likewise.
5572 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
5573 definitions rather than duplicating the rest of it.
5574 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
5575
55762006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
5577
5578 Suppress signed/unsigned comparison warnings for yycheck.
5579 * data/c.m4 (b4_safest_int_type): New macro.
5580 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
5581 a signed int type, cast it to b4_safest_int_type first.
5582 * data/yacc.c: Likewise.
5583 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
5584 also overwritten.
5585
55862006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
5587
5588 * doc/bison.texinfo: Fix some typos.
5589
55902006-08-02 Paul Eggert <eggert@cs.ucla.edu>
5591
5592 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
5593 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
5594
5595 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
5596 the latest gnulib does this a different way.
5597 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
5598 translation was patched, so stop omitting it.
5599
56002006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5601
5602 Enable declaration of default %printer/%destructor. Make the parser
5603 use these for all user-declared grammar symbols for which the user does
5604 not declare a specific %printer/%destructor. Thus, the parser uses it
5605 for token 0 if the user declares it but not if Bison generates it as
5606 $end. Discussed starting at
5607 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
5608 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
5609 and
5610 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
5611 * NEWS (2.3+): Mention.
5612 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
5613 declare a %destructor for a mid-rule's semantic value. It's just
5614 impossible to declare one specific to it.
5615 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
5616 code. Describe default %destructor form.
5617 * src/parse-gram.y (grammar_declaration): Parse default
5618 %printer/%destructor declarations.
5619 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
5620 and symbol_destructor_location_get rather than accessing the destructor
5621 and destructor_location members of struct symbol.
5622 (symbol_printers_output): Likewise but for %printer's.
5623 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
5624 again.
5625 * src/symtab.c (default_destructor, default_destructor_location,
5626 default_printer, default_printer_location): New static global
5627 variables to record the default %destructor and %printer.
5628 (symbol_destructor_get, symbol_destructor_location_get,
5629 symbol_printer_get, symbol_printer_location_get): New functions to
5630 compute the appropriate %destructor and %printer for a symbol.
5631 (default_destructor_set, default_printer_set): New functions to set the
5632 default %destructor and %printer.
5633 * src/symtab.h: Prototype all those new functions.
5634 * tests/actions.at (Default %printer and %destructor): New test to
5635 check that the right %printer and %destructor are called, that they're
5636 not called for $end, and that $$ and @$ work correctly.
5637 (Default %printer and %destructor for user-declared end token): New
5638 test to check that the default %printer and %destructor are called for
5639 a user-declared end token.
5640 * tests/input.at (Default %printer and %destructor redeclared, Unused
5641 values with default %destructor): New tests to check related grammar
5642 warnings and errors.
5643
56442006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5645
5646 Clean up handling of %destructor for the end token (token 0).
5647 Discussed starting at
5648 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
5649 and
5650 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
5651
5652 Make the skeletons consistent in how they pop the end token and invoke
5653 its %destructor.
5654 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
5655 state, which has token number 0, since this would invoke the
5656 %destructor for the end token.
5657 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
5658 until after shifting the end token, or else it won't be popped.
5659 * data/yacc.c (yyparse): Likewise.
5660
5661 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
5662 it's the end token. Upon termination, destroy an unshifted lookahead
5663 even when it's the end token.
5664 * data/lalr1.cc (yy::parser::parse): Likewise.
5665 * data/yacc.c (yyparse): Likewise.
5666
5667 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
5668 value warnings for the end token when the user gives the end token a
5669 %destructor.
5670
5671 * tests/actions.at (Printers and Destructors): Test all the above.
5672
56732006-07-24 Paul Eggert <eggert@cs.ucla.edu>
5674
5675 Update to latest gnulib and gettext versions.
5676 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
5677 Add fopen-safer.
5678 (gnulib_files): Add m4/warning.m4. Don't worry about files
5679 overwritten by autopoint.
5680 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
5681 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
5682 rejects them.
5683 Don't use autoreconf; instead, invoke autopoint etc. by hand,
5684 so that we can remove the intl files at a better time.
5685 (intl_files_to_remove): Remove aclocal.m4, since it gets
5686 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
5687 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
5688 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
5689 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
5690 Remove datarootdir hack; no longer needed.
5691 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
5692 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
5693 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
5694 strdup.h.
5695 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
5696 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
5697
56982006-07-20 Paul Eggert <eggert@cs.ucla.edu>
5699
5700 * bootstrap: Adjust to today's change to gnulib-tool by invoking
5701 it with --assume-autoconf='latest-stable'.
5702
57032006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
5704
5705 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
5706 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
5707 YYSTYPE' and `{'.
5708 * src/muscle_tab.h (muscle_grow): Replace the header comments with
5709 those from muscle_tab.c since the old ones are misleading.
5710
57112006-07-13 Akim Demaille <akim@epita.fr>
5712
5713 Support %define "KEY" {VALUE}.
5714 * src/scan-code.h, src/scan-code.l (translate_action)
5715 (translate_rule_action, translate_symbol_action, translate_code):
5716 Return char *, not const char *.
5717 * src/parse-gram.y (declaration): Rename as...
5718 (prologue_declaration): this.
5719 (string_content): Remove this nonterminal, use STRING.
5720 (braceless, content, content.opt): New nonterminal.
5721 Use them.
5722 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
5723 as value.
5724 * src/scan-gram.l (getargs.h): Don't include it.
5725
57262006-07-12 Paul Eggert <eggert@cs.ucla.edu>
5727
5728 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
5729 rather than a for-loop that declares a local bool variable. This
5730 should work around a compatibility problem with a Cray x1e C++
5731 compiler reported by Hung Nguyen in
5732 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
5733 The for-loop was introduced in the 2004-11-17 change but I don't
5734 know why it was needed.
5735
57362006-07-12 Akim Demaille <akim@epita.fr>
5737
5738 * data/c.m4: Comment changes.
5739
57402006-07-10 Akim Demaille <akim@lrde.epita.fr>
5741
5742 * src/complain.c (error_message, ERROR_MESSAGE): New.
5743 To factor...
5744 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
5745 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
5746
57472006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5748
5749 * NEWS: Instead of %union, you can define and use your own union type
5750 YYSTYPE if your grammar contains at least one <type> tag.
5751 Your YYSTYPE need not be a macro; it can be a typedef.
5752 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
5753 (Union Decl, Decl Summary): Document this.
5754 * data/glr.c (YYSTYPE): Implement this.
5755 * data/glr.cc (YYSTYPE): Likewise.
5756 * data/lalr1.cc (YYSTYPE): Likewise.
5757 * data/yacc.c (YYSTYPE): Likewise.
5758 * src/output.c (prepare): Output tag_seen_flag.
5759 * src/parse-gram.y (declaration, grammar_declaration):
5760 Use 'union_seen' rather than 'typed' to determine whether
5761 %union has been seen, since grammars can now be typed without
5762 %union.
5763 (symbol_declaration, type.opt, symbol_def):
5764 Keep track of whether a tag has been seen.
5765 * src/reader.c (union_seen, tag_seen): New vars.
5766 (typed): remove.
5767 * src/reader.h (union_seen, tag_seen, typed): Likewise.
5768 * src/scan-code.l (untyped_var_seen): New variable.
5769 (handle_action_dollar): Adjust to above changes.
5770 (handle_action_dollar, handle_action_at):
5771 Improve overflow checking for outlandish numbers.
5772 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
5773 avoid new diagnostics generated by above changes.
5774 * tests/regression.at (YYSTYPE typedef): Add test to check
5775 for type tags without %union.
5776
5777 * src/symlist.c (symbol_list_length): Return int, not unsigned
5778 int, since callers expect int. This may need to get revisited
5779 once we have proper integer overflow checking.
5780
5781 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
5782 object is now static.
5783
5784 * src/getargs.c (flags_argmatch): Return void, not int,
5785 to pacify ./configure --enable-gcc-warnings.
5786
5787 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
5788 since last_string is already defined to FLEX_PREFIX (last_string).
5789
57902006-07-09 Akim Demaille <akim@lrde.epita.fr>
5791
5792 Implement --warnings/-W.
5793 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
5794 replaced by...
5795 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
5796 Adjust callers.
5797 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
5798 (warnings_args, warnings_types): New.
5799 (getargs, short_options, long_options): Accept -W/--warnings.
5800 Sort the options by alphabetical order, upper case letter right
5801 before its lower case.
5802
58032006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5804
5805 Change %merge result type clash warnings to errors. Discussed at
5806 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
5807 * src/reader.c (record_merge_function_type): Use complain_at.
5808 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5809 declared later): Update test case results.
5810
58112006-07-09 Akim Demaille <akim@lrde.epita.fr>
5812
5813 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
5814 to be in alphabetical order.
5815 (trace_args): Spelling fixes.
5816
58172006-07-09 Paul Eggert <eggert@cs.ucla.edu>
5818
5819 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
5820 so they don't collide with user-defined macros.
5821 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
5822 this was never guaranteed, and now that we're using gnulib stdint,
5823 which defines int_fast16_t to long int, the problem is exposed.
5824
58252006-07-08 Paul Eggert <eggert@cs.ucla.edu>
5826
5827 * data/c.m4 (b4_basename): Simplify a bit, since we don't
5828 need the full POSIX semantics (and weren't implementing them
5829 anyway).
5830
5831 Adjust to Autoconf 2.60 and today's gnulib.
5832 * bootstrap (gnulib_modules): Add stdint.
5833 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
5834 no longer copies it.
5835 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
5836 since stdint needs the former and wcwidth (which is now required
5837 by mbswidth) needs the latter.
5838 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
5839 work around a compatibility glitch between gettext 0.14.6 and
5840 Autoconf 2.60.
5841 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
5842 Do not check for uintptr_t, since new stdint module does the right
5843 thing.
5844 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
5845 Add stdint.h, stdint_.h, wcwidth.h.
5846 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
5847 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
5848 stdint.m4, wchar_t.m4, wcwidth.m4.
5849 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
5850 usual order for ../lib/*.h files.
5851 (file_name_split): Use last_component, not base_name, to adjust
5852 to gnulib changes.
5853 * src/parse-gram.h: Include <strverscmp.h> in the usual order
5854 for ../lib/*.h files.
5855 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
5856 Define unconditionally, since we now assume the stdint module.
5857 * src/scan-skel.l: Include <dirname.h>.
5858 (BASE_QPUTS): Use last_component, not base_name.
5859 * src/system.h: Include <unlocked-io.h> in the usual order
5860 for ../lib/*.h files. Include <stdint.h> unconditionally,
5861 since we now use the stdint module.
5862 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
5863 HAVE_UINTPTR_T, since we now use the stdint module.
5864 (base_name): Remove decl, since files now include <dirname.h>
5865 to get the decl.
5866
58672006-07-08 Akim Demaille <akim@lrde.epita.fr>
5868
5869 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
5870 New, default to 1.
5871 * data/yacc.c, data/glr.c, data/location.cc: Use them.
5872 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
5873 default.
5874 * tests/calc.at: Adjust.
5875
58762006-07-08 Akim Demaille <akim@lrde.epita.fr>
5877
5878 * data/c.m4 (b4_basename): New.
5879 (b4_syncline): Also output the location of its invocation (from
5880 the skeleton).
5881 (b4_user_action, b4_define_user_action, b4_user_actions)
5882 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
5883 (b4_user_stype): New.
5884 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
5885
58862006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5887
5888 In the grammar file, the first column is 1 not 0 on the first line as
5889 on every other line.
5890 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
5891 * tests/input.at (Torturing the Scanner): Update output.
5892
5893 * src/scan-gram.l (scanner_cursor): Declare it static.
5894
58952006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
5896
5897 In warnings, say "previous declaration" rather than "first
5898 declaration".
5899 * src/symtab.c (redeclaration): Do that here.
5900 * src/reader.c (record_merge_function_type): In the case of a result
5901 type clash, report the previous declaration rather than the very first
5902 one in the grammar file.
5903 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5904 declared later): Add a third declaration to check this behavior.
5905 * tests/input.at (Incompatible Aliases): Update output.
5906
59072006-06-27 Akim Demaille <akim@epita.fr>
5908
5909 * doc/Doxyfile.in: New.
5910 * doc/Makefile.am: Use it.
5911 * src/lalr.h, src/symtab.h: Initial doxygenation.
5912
59132006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5914
5915 Don't miss %merge result type warnings just because the LHS types are
5916 declared after the %merge. This continues the effort of the previous
5917 patch.
5918 * src/reader.c (get_merge_function): Don't set the merger type yet.
5919 (record_merge_function_type): New function for setting the merger type
5920 and checking for clashes.
5921 (grammar_current_rule_merge_set): Set the location of the %merge for
5922 the current rule.
5923 (packgram): Invoke record_merge_function_type for each rule now that
5924 all symbol type declarations have been parsed.
5925 * src/reader.h (merger_list.type_declaration_location): New member
5926 storing the location of the first %merge from which the type for this
5927 merging function was derived.
5928 * src/symlist.h (symbol_list.merger_declaration_location): New member
5929 storing the location of a rule's %merge, if any.
5930 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
5931 declared later): New test to catch the error fixed by the above patch.
5932
59332006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5934
5935 Get action warnings (grammar_rule_check) right even when symbol
5936 declarations appear after the rules. Discussed at
5937 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
5938 and
5939 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
5940 Don't mistake the type of $$ in a midrule to be that of its parent
5941 rule's $$.
5942 * src/reader.c (grammar_current_rule_end): Don't invoke
5943 grammar_rule_check yet since not all symbol declarations may have been
5944 parsed yet.
5945 (grammar_midrule_action): Likewise.
5946 Don't record whether the midrule's $$ has been used yet since actions
5947 haven't been translated yet.
5948 Record the midrule's parent rule and its RHS index within the parent
5949 rule.
5950 (grammar_current_rule_action_append): Don't translate the action yet
5951 since not all symbol declarations may have been parsed yet and, thus,
5952 warnings about types for $$, $n, @$, and @n can't be reported yet.
5953 (packgram): Translate the action and invoke grammar_rule_check now that
5954 all symbol declarations have been parsed.
5955 * src/scan-code.l (handle_action_dollar): Now that this is invoked
5956 after parsing the entire grammar file, the symbol list here in the case
5957 of a midrule is actually the midrule's empty RHS, so reference its
5958 parent rule's RHS where necessary.
5959 On the other hand, now that you can already know it's a midrule, you
5960 aren't forced to think $$ has the same type as its parent rule's $$.
5961 (handle_action_at): In the case of a midrule, reference the parent rule
5962 where necessary.
5963 * src/symlist.c (symbol_list_new): Initialize new midrule-related
5964 members.
5965 (symbol_list_length): Now that this is invoked after all rules have
5966 been parsed, a NULL symbol (rather than a NULL symbol list node)
5967 terminates a rule. symbol_list_print already does this correctly.
5968 * src/symlist.h (symbol_list.midrule_parent_rule,
5969 symbol_list.midrule_parent_rhs_index): New members so that midrules can
5970 remember their relationships with their parents.
5971 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
5972 fixed by the above patch.
5973 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
5974 implementing...
5975 (Unused values): ... this old test case and...
5976 (Unused values before symbol declarations): ... this new test case.
5977 This one is the same as `Unused values' except that all symbol
5978 declarations appear after the rules in order to catch the rest of the
5979 errors fixed by the above patch.
5980
59812006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
5982
5983 More cleanup.
5984 * src/reader.c (current_rule): Declare it static since it's no longer
5985 used outside this file.
5986 (grammar_current_rule_action_append): Remove redundant arguments from
5987 translate_rule_action invocation.
5988 * src/reader.h (current_rule): Remove this unused extern.
5989 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
5990 * src/scan-code.l (translate_rule_action): Likewise.
5991
59922006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
5993
5994 Clean up yesterday's patch.
5995 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
5996 to...
5997 * src/reader.c (grammar_current_rule_action_append): ... here for
5998 consistency with grammar_current_rule_symbol_append.
5999 * tests/regression.at (Braced code in declaration in rules section):
6000 Make yyerror and yylex static as usual.
6001
60022006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
6003
6004 Fix bug that mistakes braced code in a declaration in the rules section
6005 to be a rule action. Mentioned at
6006 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
6007 * src/scan-gram.l: Move midrule action detection from the start of the
6008 scanning of any braced code to...
6009 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
6010 action. For readability, use $2 and @2 rather than the equivalent
6011 global variables.
6012 * tests/regression.at (Braced code in declaration in rules section):
6013 New test to catch the error fixed by the above patch.
6014
6015 Work on code readability some.
6016 * src/scan-code.l (current_rule): Get rid of this misleading and
6017 redundant declaration: it's actually extern'ed in reader.h.
6018 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
6019 translate_action): Add a rule argument and use it instead of the global
6020 current_rule.
6021 (translate_rule_action): This already receives current_rule through an
6022 argument, so pass it on to translate_action instead of assigning
6023 current_rule to current_rule.
6024 (translate_symbol_action, translate_code): Pass rule = NULL to
6025 translate_action.
6026
60272006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
6028
6029 Rename %before-definitions to %start-header and %after-definitions to
6030 %end-header. Don't use these declarations to separate pre-prologue
6031 blocks from post-prologue blocks. Add new order-independent
6032 declarations %before-header and %after-header as alternatives to the
6033 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
6034 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
6035 * NEWS (2.3+): Update for these changes.
6036 * data/glr.c (b4_before_definitions): Update to...
6037 (b4_start_header): ... this.
6038 (b4_after_definitions): Update to...
6039 (b4_end_header): ... this.
6040 * data/glr.cc: Likewise.
6041 * data/lalr1.cc: Likewise.
6042 * data/yacc.c: Likewise.
6043 * doc/bison.texinfo (The prologue): Update names, and replace remaining
6044 prologue blocks with %*-header declarations.
6045 (Calc++ Parser): Likewise.
6046 (Decl Summary): Update names.
6047 (Table of Symbols): Update description.
6048 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
6049 (PERCENT_END_HEADER): ... this.
6050 (PERCENT_BEFORE_DEFINITIONS): Update to...
6051 (PERCENT_START_HEADER): ... this.
6052 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
6053 (declaration): Update token names and m4 macro names.
6054 When parsing %end-header and %start-header, invoke translate_code
6055 before muscle_code_grow, and no longer set global booleans to remember
6056 whether these declarations have been seen.
6057 Parse new %after-header and %before-header.
6058 * src/reader.c (before_definitions, after_definitions): Remove.
6059 (prologue_augment): Accept a new bool argument to specify whether to
6060 augment the pre-prologue or post-prologue.
6061 * src/reader.h (before_definitions, after_definitions): Remove these
6062 extern's.
6063 (prologue_augment): Add new bool argument.
6064 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
6065 (PERCENT_END_HEADER): ... this.
6066 (PERCENT_BEFORE_DEFINITIONS): Update to...
6067 (PERCENT_START_HEADER): ... this.
6068 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
6069 * tests/actions.at (Printers and Destructors): Update names.
6070
60712006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
6072
6073 Add comparison operators for C++ location classes. Discussed at
6074 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
6075 * data/c++.m4 (b4_define_location_comparison): New boolean %define
6076 declaration indicating whether filename_type has an operator==. If
6077 filename_type is `std::string', it defaults to `1', `0' otherwise.
6078 * data/location.cc: Iff b4_define_location_comparison is `1', add
6079 operator== and operator!= for class position and for class location.
6080
6081 Some minor fixes.
6082 * src/scan-action.l: Remove unused file.
6083 * src/symtab.c (symbol_printer_set): Use printer_location not
6084 destructor_location.
6085 * src/symtab.h (struct symbol): Replace incorrect source comment for
6086 printer members.
6087 * tests/input.at (Incompatible Aliases): Update output with correct
6088 printer location.
6089
60902006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
6091
6092 Don't put the pre-prologue in the header file. For the yacc.c code
6093 file and the glr.c header and code files, move the pre-prologue before
6094 the token definitions. Add new %before-definitions and
6095 %after-definitions to declare code that will go in both the header file
6096 and code file. Discussed at
6097 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
6098 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
6099 and
6100 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
6101 * NEWS (2.3+): Describe these changes.
6102 * data/glr.c (b4_pre_prologue): Move from within to before...
6103 (b4_shared_declarations): ... this.
6104 Add new b4_before_definitions before b4_token_enums.
6105 Add new b4_after_definitions at the end.
6106 * data/glr.cc (b4_pre_prologue): Replace with...
6107 (b4_before_definitions): ... this in the header file.
6108 (b4_after_definitions): New near the end of the header file.
6109 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
6110 code file right before including the header file.
6111 (b4_before_definitions): New in the previous position of
6112 b4_pre_prologue in the header file.
6113 (b4_after_definitions): New near the end of the header file.
6114 * data/yacc.c: Clean up some m4 quoting especially in the header file.
6115 (b4_token_enums_defines): In the code file, move to right before
6116 YYSTYPE for consistency with the header file.
6117 (b4_before_definitions): New right before b4_token_enums_defines in
6118 both the header and code file.
6119 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
6120 header and code file.
6121 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
6122 of prologues for %union dependencies.
6123 (Decl Summary): In %defines description, mention the effect of
6124 %before-definitions and %after-definitions on the header file.
6125 (Calc++ Parser): Forward declare driver in a %before-definitions rather
6126 than in the pre-prologue so that make check succeeds.
6127 (Table of Symbols): Add entries for %before-definitions and
6128 %after-definitions.
6129 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
6130 %before-definitions.
6131 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
6132 (declaration): Parse those declarations and append to
6133 b4_before_definitions and b4_after_definitions, respectively.
6134 * src/reader.c (before_definitions, after_definitions): New bools to
6135 track whether those declarations have been seen.
6136 (prologue_augment): Add to the post-prologue if %union,
6137 %before-definitions, or %after-definitions has been seen.
6138 * src/reader.h (before_definitions, after_definitions): New extern's.
6139 * src/scan-gram.l: Scan the new declarations.
6140 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
6141 prologue block in a %before-definitions or a %after-definitions based
6142 on whether the %union is declared.
6143 * tests/regression.at (Early token definitions with --yacc, Early token
6144 definitions without --yacc): Move tests for token definitions into the
6145 post-prologue since token names are no longer defined in the
6146 pre-prologue.
6147
61482006-06-20 Akim Demaille <akim@epita.fr>
6149
6150 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
6151 (symbol_get): Use it.
6152 * src/parse-gram.y: Use it.
6153
61542006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
6155
6156 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
6157 build succeeds when configured with --enable-gcc-warnings.
6158
61592006-06-19 Paul Eggert <eggert@cs.ucla.edu>
6160
6161 * src/parse-gram.y (char_name): New function.
6162 (CHAR, STRING, string_content): For %printer, properly escape.
6163 (ID): Prefer fputs to fprintf.
6164 (id): Reindent to be consistent with other rules.
6165 Properly quote char.
6166
6167 The Translation Project changed its way of publishing translations
6168 to maintainers. I haven't received any responses to my request
6169 for supporting the old way, or for documenting the new way. I
6170 have modified 'bootstrap' to use screen scraping
6171 (in this case, HTML scraping). This is unreliable and inelegant,
6172 but I don't see any better way. Yuck.
6173 * bootstrap (TP_URL, WGET_COMMAND): New vars.
6174 (get_translations): New function, which uses HTML scraping to
6175 deduce locations of latest translations.
6176 Use this function to grab both bison and bison-runtime .po files.
6177 Don't bother priming the pump for the runtime-po domain any more,
6178 as it's now translated better than bison is.
6179
61802006-06-19 Akim Demaille <akim@epita.fr>
6181
6182 * src/scan-gram.l: No longer "parse" things after `%union' until
6183 `{'. Rather, return a single "%union" token.
6184 No longer make symbols: return strings, and leave the conversion
6185 to symbols to the parser.
6186 (SC_PRE_CODE, token_type): Remove.
6187 * src/parse-gram.y (%union): New field `character'.
6188 Sort tokens.
6189 (CHAR): New token.
6190 (ID, ID_COLON): Now that the scanner no longer makes them
6191 identifiers, adjust all uses to invoke symbol_get.
6192 (id_colon): New, wraps the conversion from string to symbol.
6193 (%union): Accept a possible union_name.
6194 (symbol): Now can be a char.
6195 * data/c.m4 (b4_union_name): Leave a default value.
6196 * data/glr.c, data/yacc.c: Use it.
6197
61982006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
6199
6200 For associating token numbers with token names for "yacc.c", don't use
6201 #define statements unless `--yacc' is specified; always use enum
6202 yytokentype. Most important discussions start at:
6203 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
6204 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
6205 and
6206 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
6207 * NEWS (2.3+): Mention.
6208 * data/c.m4 (b4_yacc_if): New.
6209 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
6210 token #define's.
6211 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
6212 on token name definitions.
6213 * src/getargs.c (usage): Capitalize `Yacc' in English.
6214 * src/output.c (prepare): Define b4_yacc_flag.
6215 * tests/regression.at (Early token definitions): Test that tokens names
6216 are defined before the pre-prologue not just before the post-prologue.
6217 Remove this test case and copy to...
6218 (Early token definitions with --yacc): ... this to test #define's.
6219 (Early token definitions without --yacc): ... and this to test enums.
6220
62212006-06-11 Paul Eggert <eggert@cs.ucla.edu>
6222
6223 * NEWS: Reword the post-2.3 change to not be so optimistic about
6224 removing the old "look-ahead" spelling.
6225 Update previous look-ahead/lookahead change reports.
6226 * REFERENCES: look-ahead -> lookahead (since that's
6227 what he actually wrote).
6228 * doc/refcard.tex: look ahead -> lookahead,
6229 look-ahead -> lookahead
6230
62312006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
6232
6233 For consistency, use `lookahead' instead of `look-ahead' or
6234 `look_ahead'. Discussed starting at
6235 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
6236 and then at
6237 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
6238 * NEWS: For the next release, note the change to `--report'.
6239 * TODO, doc/bison.1: Update English.
6240 * doc/bison.texinfo: Update English.
6241 (Understanding Your Parser, Bison Options): Document as
6242 `--report=lookahead' rather than `--report=look-ahead'.
6243 * src/conflicts.c: Update English in comments.
6244 (lookahead_set): Rename from look_ahead_set.
6245 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
6246 (resolve_sr_conflict): Rename local look_ahead_tokens to
6247 lookahead_tokens, and update other uses.
6248 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
6249 count_rr_conflicts, conflicts_free): Update uses.
6250 * src/getargs.c (report_args): Move "lookahead" before alternate
6251 spellings.
6252 (report_types): Update uses.
6253 (usage): For `--report' usage description, state `lookahead' spelling
6254 rather than `look-ahead'.
6255 * src/getargs.h (report.report_lookahead_tokens): Rename from
6256 report_look_ahead_tokens.
6257 * src/lalr.c: Update English in comments.
6258 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
6259 (state_lookahead_tokens_count): Rename from
6260 state_look_ahead_tokens_count.
6261 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6262 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
6263 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6264 Update other uses.
6265 Update English in output.
6266 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
6267 * src/print.c: Update English in comments.
6268 (lookahead_set): Rename from look_ahead_set.
6269 (print_reduction): Rename argument lookahead_token from
6270 look_ahead_token.
6271 (print_core, state_default_rule, print_reductions, print_results):
6272 Update uses.
6273 * src/print_graph.c: Update English in comments.
6274 (print_core): Update uses.
6275 * src/state.c: Update English in comments.
6276 (reductions_new): Update uses.
6277 (state_rule_lookahead_tokens_print): Rename from
6278 state_rule_look_ahead_tokens_print, and update other uses.
6279 * src/state.h: Update English in comments.
6280 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
6281 (state_rule_lookahead_tokens_print): Rename from
6282 state_rule_look_ahead_tokens_print.
6283 * src/tables.c: Update English in comments.
6284 (conflict_row, action_row): Update uses.
6285 * tests/glr-regression.at
6286 (Incorrect lookahead during deterministic GLR,
6287 Incorrect lookahead during nondeterministic GLR): Rename
6288 print_look_ahead to print_lookahead.
6289 * tests/torture.at: Update English in comments.
6290 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
6291 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
6292 (Many lookahead tokens): Update uses.
6293 * data/glr.c: Update English in comments.
6294 * lalr1.cc: Likewise.
6295 * yacc.c: Likewise.
6296 * src/conflicts.h: Likewise.
6297 * src/lalr.h: Likewise.
6298 * src/main.c: Likewise.
6299 * src/output.c: Likewise.
6300 * src/parse-gram.c: Likewise.
6301 * src/tables.h: Likewise.
6302 * tests/calc.at: Likewise.
6303
63042006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
6305
6306 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
6307
63082006-06-07 Paul Eggert <eggert@cs.ucla.edu>
6309
6310 * TODO: Add request from Nelson H. F. Beebe to be able to install
6311 Bison without installing the yacc script.
6312
63132006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6314
6315 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
6316 and yytext if they're already #define'd.
6317 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
6318 * src/scan-code-c.c: ... here.
6319 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
6320 <config.h>.
6321
63222006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6323
6324 Get Bison to build again when configured with --enable-gcc-warnings.
6325 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
6326 missing #include's.
6327 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
6328 loc argument as it shadows a global.
6329 * src/scan-gram.l: Remove stray comma that prevents boundary_set
6330 invocation.
6331
6332 * src/.cvsignore: Add scan-code.c.
6333
63342006-06-07 Akim Demaille <akim@epita.fr>
6335
6336 * src/scan-gram.l: Move the "add a trailing ; to actions" code
6337 to...
6338 * src/scan-code.l: here.
6339 * tests/input.at (Torturing the Scanner): Fix another location
6340 error.
6341
63422006-06-07 Akim Demaille <akim@epita.fr>
6343
6344 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
6345
63462006-06-06 Akim Demaille <akim@epita.fr>
6347
6348 Extract the parsing of user actions from the grammar scanner.
6349 As a consequence, the relation between the grammar scanner and
6350 parser is much simpler. We can also split "composite tokens" back
6351 into simple tokens.
6352 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
6353 * src/scan-gram.l (add_column_width, adjust_location): Move to and
6354 rename as...
6355 * src/location.h, src/location.c (add_column_width)
6356 (location_compute): these.
6357 Fix the column count: the initial column is 0.
6358 (location_print): Be robust to ending column being 0.
6359 * src/location.h (boundary_set): New.
6360 * src/main.c: Adjust to scanner_free being renamed as
6361 gram_scanner_free.
6362 * src/output.c: Include scan-code.h.
6363 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
6364 Use boundary_set.
6365 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
6366 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
6367 which is now, again, a separate token.
6368 Adjust all dependencies.
6369 Whereever actions with $ and @ are used, use translate_code.
6370 (action): Remove this nonterminal which is now useless.
6371 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
6372 (grammar_current_rule_action_append): Use translate_code.
6373 (packgram): Bound check ruleno, itemno, and rule_length.
6374 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
6375 (last_string, last_braced_code_loc, max_left_semantic_context)
6376 (scanner_initialize, scanner_free, scanner_last_string_free)
6377 (gram_out, gram_lineno, YY_DECL_): Move to...
6378 * src/scan-gram.h: this new file.
6379 (YY_DECL): Rename as...
6380 (GRAM_DECL): this.
6381 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
6382 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6383 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6384 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6385 Move these declarations, and...
6386 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
6387 these to...
6388 * src/flex-scanner.h: this new file.
6389 * src/scan-gram.l (rule_length, rule_length_overflow)
6390 (increment_rule_length): Remove.
6391 (last_braced_code_loc): Rename as...
6392 (gram_last_braced_code_loc): this.
6393 Adjust to the changes of the parser.
6394 Move all the handling of $ and @ into...
6395 * src/scan-code.l: here.
6396 * src/scan-gram.l (handle_dollar, handle_at): Remove.
6397 (handle_action_dollar, handle_action_at): Move to...
6398 * src/scan-code.l: here.
6399 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
6400 scan-code.h, scan-code-c.c, scan-gram.h.
6401 (EXTRA_bison_SOURCES): Add scan-code.l.
6402 (BUILT_SOURCES): Add scan-code.c.
6403 (yacc): Be robust to white spaces.
6404
6405 * tests/conflicts.at, tests/input.at, tests/reduce.at,
6406 * tests/regression.at: Adjust the column numbers.
6407 * tests/regression.at: Adjust the error message.
6408
64092006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6410
6411 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6412 Use Akim's wording from
6413 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
6414
64152006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6416
6417 Between Bison releases, manually append `+' to the previous Bison
6418 release number, and use that as a signal to automatically print the
6419 ChangeLog's CVS Id keyword from --version. Discussed starting at
6420 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
6421 * ChangeLog: Add Id header.
6422 * configure.ac (AC_INIT): Append `+' to `2.3'.
6423 * src/.cvsignore: Add revision.c.
6424 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
6425 (BUILT_SOURCES): Add revision.c.
6426 (revision.c): New target rule. This file defines a new global variable
6427 named revision. It initializes it with either the Id from ChangeLog
6428 or, if VERSION doesn't contain `+', with the empty string.
6429 * src/getargs.c (version): Print the value of revision.
6430 * src/revision.h: Extern revision.
6431
64322006-06-05 Paul Eggert <eggert@cs.ucla.edu>
6433
6434 * NEWS: Version 2.3.
6435 * configure.ac (AC_INIT): Likewise.
6436
64372006-05-30 Paul Eggert <eggert@cs.ucla.edu>
6438
6439 * data/glr.c (YYRECOVERING): Define to be a function-like macro
6440 with no arguments, not as an object-like macro. This is for
6441 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
6442 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
6443 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
6444 Document this.
6445
64462006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
6447
6448 * src/getargs.c (usage): Back out yesterday's modification of the
6449 --help output so that we don't have to wait for translation before
6450 releasing 2.3.
6451
64522006-05-29 Paul Eggert <eggert@cs.ucla.edu>
6453
6454 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
6455 Problem reported by Akim Demaille.
6456
64572006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6458
6459 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6460
64612006-05-26 Paul Eggert <eggert@cs.ucla.edu>
6462
6463 * data/yacc.c (yy_reduce_print): Omit trailing white space in
6464 generated source code. Problem reported by Frans Englich in
6465 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
6466
64672006-05-22 Paul Eggert <eggert@cs.ucla.edu>
6468
6469 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
6470 shell, not within 'make', so that 'make' by an ordinary builder
6471 (using GNU make) does not worry about configuring gzip. This also
6472 works around a bug reported independently by Keith Thompson and by
6473 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
6474 stderr rather than stdout, messing up the build logs.
6475
64762006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6477
6478 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
6479 to make sure that YYID will never be unused. This fixes a 'make
6480 maintainer-check' failure caused by the recent changes to the 'Trivial
6481 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
6482 not used.
6483 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
6484
64852006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6486
6487 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
6488 state before an empty RHS is always resolved here. Only the location
6489 of that state is guaranteed to be resolved, and that's enough. This
6490 fixes the remaining bug reported by Derek M. Jones in
6491 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6492 * tests/glr-regression.at (Uninitialized location when reporting
6493 ambiguity): Test the above case.
6494 Also, the embedded comments in this test case claim it checks the case
6495 of an empty RHS that has inherited the initial location. However, the
6496 corresponding LHS was already resolved, so yyresolveLocations didn't
6497 actually have reason to modify it. Fix this by forcing
6498 nondeterministic operation at the beginning of the parse.
6499
65002006-05-20 Paul Eggert <eggert@cs.ucla.edu>
6501
6502 * data/c.m4 (b4_yy_symbol_print_generate):
6503 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
6504 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
6505 of the bugs reported today by Derek M Jones in
6506 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6507 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
6508 defined to be a type name without parens or brackets.
6509 (Location Type): Similarly for YYLTYPE.
6510 * tests/regression.at (Trivial grammars): Put in a test for this
6511 bug that will be caught by 'make maintainer-check' (though not,
6512 alas, by 'make check' unless your compiler is picky).
6513
65142006-05-19 Paul Eggert <eggert@cs.ucla.edu>
6515
6516 * NEWS: Version 2.2.
6517 * configure.ac (AC_INIT): Likewise.
6518
65192006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
6520
6521 * data/glr.c (yyreportTree): Make room in yystates for the state
6522 preceding the RHS. This fixes the segmentation fault reported by Derek
6523 M. Jones in
6524 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
6525 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
6526 to the user. Reported for yyreportTree by Derek M. Jones later in the
6527 same thread.
6528 * THANKS: Add Derek M. Jones.
6529 Update my email address.
6530 Fix typo in Steve Murphy's name.
6531
65322006-05-14 Paul Eggert <eggert@cs.ucla.edu>
6533
6534 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
6535 checking against YYLAST that caused the parser to miss a potential
6536 alternative in its diagnostic.
6537 Problem reported by Maria Jose Moron Fernandez in
6538 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
6539 * data/lalr1.cc (yysyntax_error_): Likewise.
6540 * data/yacc.c (yysyntax_error): Likewise.
6541 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
6542 tokens, in case we run into an older C compiler.
6543 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
6544 Use them to check for the off-by-one error fixed above.
6545
6546 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
6547 YYSIZE_T, not size_t.
6548 * tests/regression.at (Trivial grammars): New test, to catch
6549 the error fixed by the above patch.
6550
65512006-05-14 Akim Demaille <akim@lrde.epita.fr>
6552
6553 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
6554 scheme.
6555 Reported by Steve Murphy.
6556
65572006-05-14 Akim Demaille <akim@lrde.epita.fr>
6558
6559 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
6560 * data/glr.cc: b4_location_flag is now b4_locations_flag.
6561
65622006-05-14 Akim Demaille <akim@lrde.epita.fr>
6563
6564 Implement --trace=m4.
6565 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
6566 * src/output.c (output_skeleton): When set, pass -dV to m4.
6567
6568 Factor the handling of flags in m4.
6569 * src/output.c (prepare): Rename the muscle names debug, defines,
6570 error_verbose to debug_flag, defines_flag, error_verbose_flag.
6571 * data/c.m4: Adjust.
6572 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
6573 Use b4_define_flag_if to define other b4_FLAG_if macros.
6574 (b4_location_if): As a consequence, rename as...
6575 (b4_locations_if): this, for consistency.
6576 Adjust all the skeletons.
6577
65782006-05-14 Akim Demaille <akim@lrde.epita.fr>
6579
6580 * etc/bench.pm: Shorten bench names.
6581
65822006-05-14 Akim Demaille <akim@lrde.epita.fr>
6583
6584 * src/output.h, src/output.c (error_verbose): Move to...
6585 * src/getargs.h, src/getargs.c: here.
6586 Sort the flags.
6587 Adjust dependencies.
6588
65892006-05-13 Paul Eggert <eggert@cs.ucla.edu>
6590
6591 * data/c.m4 (b4_copyright): Put the special exception for Bison
6592 skeletons here, so we don't have to put it in each skeleton. All
6593 uses changed. Suggested by Akim Demaille. Also, wrap the
6594 copyright notice, in case it is longer than 80 columns. Replace
6595 comma by newline after title.
6596
65972006-05-11 Paul Eggert <eggert@cs.ucla.edu>
6598
6599 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
6600 incompatibility, not a bug. Mention that it wasn't fixed as of
6601 flex 2.5.33.
6602
66032006-05-11 Akim Demaille <akim@lrde.epita.fr>
6604
6605 * examples/extexi: Enforce the precedence of concatenation over
6606 >>.
6607 Reported by Tommy Nordgren.
6608
66092006-05-11 Akim Demaille <akim@lrde.epita.fr>
6610
6611 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
6612 with the member "token".
6613 Reported by Martin Nylin.
6614
66152006-05-08 Paul Eggert <eggert@cs.ucla.edu>
6616
6617 * data/glr.c: Switch to Bison 2.2 special-exception language in
6618 the copyright notice. Use more-regular format for titles and
6619 copyright notices.
6620 * data/glr.cc: Likewise.
6621 * data/location.cc: Likewise.
6622 * data/yacc.cc: Likewise.
6623 * doc/bison.texinfo (Conditions): Document this.
6624 * NEWS: likewise. Upgrade version to 2.2.
6625
66262006-04-27 Akim Demaille <akim@lrde.epita.fr>
6627
6628 * data/glr.cc: Remove dead code.
6629
66302006-04-25 Paul Eggert <eggert@cs.ucla.edu>
6631
6632 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
6633 that variable and the line breaks the bootstrap. Problem reported
6634 by Juan M. Guerrero.
6635
66362006-04-24 Akim Demaille <akim@lrde.epita.fr>
6637
6638 * doc/bison.texinfo (Multiple start-symbols): New.
6639
66402006-04-24 Akim Demaille <akim@lrde.epita.fr>
6641
6642 * etc/README, etc/bench.pl: New.
6643
66442006-04-03 Akim Demaille <akim@lrde.epita.fr>
6645
6646 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
6647 rule.
6648 Reported by Mickael Labau.
6649 * tests/input.at (Torturing the Scanner): Test it.
6650
66512006-03-16 Paul Eggert <eggert@cs.ucla.edu>
6652
6653 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
6654 Problem reported by Bob Rossi.
6655
66562006-03-13 Paul Eggert <eggert@cs.ucla.edu>
6657
6658 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
6659 and didn't really work.
6660 For the index, use @ifnotinfo, not @iftex.
6661 Minor cleanups of spacing and terminology.
6662
66632006-03-12 Akim Demaille <akim@lrde.epita.fr>
6664
6665 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
6666 of AT_NAME_PREFIX when %name-prefix is not used.
6667
66682006-03-12 Akim Demaille <akim@lrde.epita.fr>
6669
6670 Apply --prefix to C++ skeletons too: they change the namespace.
6671 The test suite already exercize these cases.
6672 * data/c++.m4 (b4_namespace): New.
6673 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
6674 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
6675 * data/yacc.c, data/glr.c: Remove a useless `[]'.
6676 * doc/bison.texinfo: Document it.
6677 (Option Cross Key): Use @multitable in all formats. It looks
6678 nicer, even in TeX outputs.
6679 (Rules): Use the same code whatever the output type is.
6680 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
6681 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
6682 * tests/calc.at: Use it, instead of hard coding `yy'.
6683
66842006-03-10 Akim Demaille <akim@lrde.epita.fr>
6685
6686 * TODO: Remove dead items.
6687
66882006-03-10 Akim Demaille <akim@lrde.epita.fr>
6689
6690 * doc/FAQ: Remove, merged into...
6691 * doc/bison.texinfo (FAQ): this.
6692 * doc/Makefile.am (EXTRA_DIST): Adjust.
6693
66942006-03-10 Akim Demaille <akim@lrde.epita.fr>
6695
6696 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
6697 even if empty.
6698 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
6699 * doc/bison.texinfo (Calc++ Scanner): Use it.
6700
67012006-03-09 Paul Eggert <eggert@cs.ucla.edu>
6702
6703 Fix two nits reported by twlevo, plus one more that I discovered.
6704
6705 * src/assoc.h (assoc_to_string): Give a name to the arg, as
6706 this is the usual Bison style.
6707 * src/location.h (location_print): Likewise.
6708
6709 * src/reader.h (token_name): Likewise.
6710
67112006-03-08 Paul Eggert <eggert@cs.ucla.edu>
6712
6713 Fix some nits reported by twlevo.
6714 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
6715 and "POSIX". Use more-modern syntax for URLs. Mention C++
6716 and ask for Java. Don't hardwire OS version numbers. Add
6717 copyright notice.
6718 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
6719 * src/conflicts.c (solved_conflicts_obstack): Now static.
6720
67212006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
6722
6723 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
6724 page. Say "you can use it" not "you may use it" as on the web page;
6725 we're describing capabilities not granting permission.
6726
67272006-03-06 Paul Eggert <eggert@cs.ucla.edu>
6728
6729 * data/glr.c (yyresolveLocations): Rename local variables to avoid
6730 shadowing warnings. Use usual patter for iterating through RHS.
6731 * tests/glr-regression.at
6732 (Uninitialized location when reporting ambiguity):
6733 Modify yylex so that it uses its argument, rather than trying
6734 to rely on ARGSUSED (which doesn't work for gcc with warnings).
6735 const char -> char const.
6736
6737 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
6738 Don't use tabs inside commands; it messes up 'ps'.
6739 Problem reported by twlevo.
6740
67412006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
6742
6743 * tests/glr-regression.at (Uninitialized location when reporting
6744 ambiguity): New test case.
6745 * data/glr.c (yyresolveLocations): New function, which uses
6746 YYLLOC_DEFAULT.
6747 (yyresolveValue): Invoke yyresolveLocations before reporting an
6748 ambiguity.
6749 * doc/bison.texinfo (Default Action for Locations): Note
6750 YYLLOC_DEFAULT's usage for ambiguity locations.
6751 (GLR Semantic Actions): Cross-reference those notes.
6752
67532006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
6754
6755 * tests/glr-regression.at (Leaked semantic values when reporting
6756 ambiguity): Remove unnecessary union and type declarations.
6757 (Leaked lookahead after nondeterministic parse syntax error): New test
6758 case.
6759 * data/glr.c (yyparse): Check for zero stacks remaining before
6760 attempting to shift the lookahead so that you don't lose it.
6761
67622006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6763
6764 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
6765 * tests/glr-regression.at (Leaked semantic values when reporting
6766 ambiguity): New test case.
6767 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
6768 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
6769 now unnecessary yystackp parameter.
6770 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
6771 destructors can be called.
6772
6773 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
6774 in existing testcases.
6775
67762006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6777
6778 Don't leak semantic values for parent RHS when a user action cuts the
6779 parser, and clean up related code a bit.
6780 * tests/glr-regression.at (Leaked merged semantic value if user action
6781 cuts parse): Rename to...
6782 (Leaked semantic values if user action cuts parse): ... this. Add check
6783 for leaked parent RHS values.
6784 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
6785 between an unresolved state (non-empty chain of semantic options) and
6786 an incomplete one (signaled by an empty chain).
6787 (yyresolveStates): Document the interface. Move all manipulation of a
6788 successfully or unsuccessfully resolved yyGLRState to...
6789 (yyresolveValue): ... here so that yyresolveValue always leaves a
6790 yyGLRState with consistent data and thus is easier to understand.
6791 Remove the yyvalp and yylocp parameters since they are always just
6792 taken from the yys parameter. When reporting a discarded merged value
6793 in debugging output, note that it is incompletely merged. Document the
6794 interface.
6795 (yyresolveAction): If resolving any of the RHS states fails, destroy
6796 them all rather than leaking them. Thus, as long as user actions are
6797 written to clean up the RHS correctly, yyresolveAction always cleans up
6798 the RHS of a semantic option. Document the interface.
6799
68002006-02-27 Paul Eggert <eggert@cs.ucla.edu>
6801
6802 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
6803 led to a segmentation fault in GNU Pascal. Problem reported
6804 by Waldek Hebisch.
6805
68062006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
6807
6808 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
6809 mid-rule action inside a nonterminal symbol in order to declare a
6810 destructor for its semantic value.
6811
68122006-02-16 Paul Eggert <eggert@cs.ucla.edu>
6813
6814 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
6815 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
6816 __cplusplus && ! defined _STDLIB_H && !
6817 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
6818 defined free))]: Include <stdlib.h> rather than rolling our own
6819 declarations of malloc and free, to avoid problems with
6820 incompatible declarations (using 'throw') C++'s stdlib.h. This
6821 should fix Debian bug 340012
6822 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
6823 reported by Guillaume Melquiond.
6824
68252006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6826
6827 * NEWS: Clarify symbols versus types in unused-value warnings.
6828
6829 * configure.ac (AC_INIT): Bump version number.
6830
68312006-02-13 Paul Eggert <eggert@cs.ucla.edu>
6832
6833 * NEWS: Version 2.1a.
6834 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
6835 since C99 requires this.
6836
68372006-02-11 Paul Eggert <eggert@cs.ucla.edu>
6838
6839 * m4/c-working.m4: New file.
6840 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
6841
68422006-02-10 Paul Eggert <eggert@cs.ucla.edu>
6843
6844 * Makefile.maint: Merge from coreutils.
6845
68462006-02-09 Paul Eggert <eggert@cs.ucla.edu>
6847
6848 More portability fixes for problems summarized by Nelson H. F. Beebe.
6849
6850 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
6851 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
6852 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
6853 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
6854 messes up because C++ code is compiled in 32-bit mode but linked
6855 in 64-bit mode.
6856
68572006-02-08 Paul Eggert <eggert@cs.ucla.edu>
6858
6859 More portability fixes for problems summarized by Nelson H. F. Beebe.
6860
6861 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
6862 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
6863
6864 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
6865 nodist_PROGRAMS, since we don't need to actually compile the
6866 example if we're just doing a plain 'make'. This avoids bothering
6867 the installer unnecessarily about problems due to weird C++
6868 compilers.
6869
68702006-02-06 Paul Eggert <eggert@cs.ucla.edu>
6871
6872 More portability fixes for problems summarized by Nelson H. F. Beebe.
6873
6874 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
6875 than #include "...", and compile with -I'.'. The old method was
6876 not portable, according to Posix and the C standard, and it does
6877 not work with Sun C 5.7, where previous #line directives affect
6878 the working directory used in later #include "..." directives.
6879
68802006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6881
6882 Various DJGGP specific issues in /djgpp
6883
68842006-02-02 Paul Eggert <eggert@cs.ucla.edu>
6885
6886 More portability fixes for problems summarized by Nelson H. F. Beebe.
6887
6888 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
6889 '#include <map>' works and that you can apply ++ to iterators.
6890
68912006-02-01 Paul Eggert <eggert@cs.ucla.edu>
6892
6893 Work around portability problems summarized by Nelson H. F. Beebe in
6894 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
6895
6896 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
6897 that '#include <string>' works.
6898
6899 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
6900 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
6901 "warning: sorry: semantics of inline function static data `const
6902 unsigned char translate_table[262]' are wrong (you'll wind up with
6903 multiple copies)".
6904
6905 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
6906 or, xor to not_, and_, or_, and xor_, respectively. This works
6907 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
6908 random system header somewhere that includes the equivalent of
6909 <iso646.h>.
6910
6911 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
6912 -E" works; it apparently doesn't work with PathScale EKO Compiler
6913 Suite Version 2.0.
6914
69152006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
6916
6917 During deterministic GLR operation, user actions should be able to
6918 influence the parse by changing yychar. To make this easier to fix and
6919 to make glr.c easier to evolve in general, don't maintain yytoken in
6920 parallel with yychar; just compute yytoken when needed.
6921 * tests/glr-regression.at (Incorrect lookahead during deterministic
6922 GLR): Check that setting yychar in a user action has the intended
6923 effect.
6924 * data/glr.c (yyGLRStack): Remove yytokenp member.
6925 (yyclearin): Don't set *yytokenp.
6926 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
6927 yychar rather than *yytokenp to determine the current lookahead.
6928 Compute yytoken locally when needed.
6929 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
6930 point to.
6931
6932 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
6933 after `--report' documentation.
6934
69352006-01-30 Paul Eggert <eggert@cs.ucla.edu>
6936
6937 * src/parse-gram.y (grammar_declaration): Location of printer
6938 symbol is @1, not list->location. Bug reported by twlevo.
6939 * tests/input.at (Incompatible Aliases): Adjust to above change.
6940
69412006-01-29 Paul Eggert <eggert@cs.ucla.edu>
6942
6943 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
6944 all the test at once. This makes the output easier to read in the
6945 normal case.
6946
6947 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
6948 got from <http://bro-ids.org/download.html>. The bug is that
6949 when two actions appeared in succession, the second one was
6950 scanned before the first one was added to the grammar rule
6951 as a midrule action. Bison then output the incorrect warning
6952 "parse.y:905.17-906.36: warning: unused value: $3".
6953 * src/parse-gram.y (BRACED_CODE, action): These are no longer
6954 associated with a value.
6955 (rhs): Don't invoke grammar_current_rule_action_append.
6956 (action): Invoke it here instead.
6957 * src/reader.c (grammar_midrule_action): Now extern.
6958 (grammar_current_rule_action_append): Don't invoke
6959 grammar_midrule_action; that is now the scanner's job.
6960 * src/reader.h (last_string, last_braced_code_loc):
6961 (grammar_midrule_action): New decls.
6962 * src/scan-gram.l (last_string): Now extern, sigh.
6963 (last_braced_code_loc): New extern variable.
6964 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
6965 rule already has an action.
6966 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
6967 * tests/input.at (AT_CHECK_UNUSED_VALUES):
6968 Add some tests to check that the above changes fixed the bug.
6969
69702006-01-27 Paul Eggert <eggert@cs.ucla.edu>
6971
6972 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
6973 All used changed. Check whether the symbol has a destructor,
6974 not whether it is typed.
6975 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
6976 that the values are still reported as unused. All line numbers
6977 adjusted.
6978
69792006-01-23 Paul Eggert <eggert@cs.ucla.edu>
6980
6981 Work around a bug in bro 0.8, which underparenthesizes its
6982 definition of YYLLOC_DEFAULT.
6983 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
6984 their arguments.
6985 * data/lalr1.cc: Likewise.
6986 * data/yacc.cc: Likewise.
6987
69882006-01-22 Paul Eggert <eggert@cs.ucla.edu>
6989
6990 Work around a bug in Pike 7.0, and give the Pike folks a
6991 better way to override the usual int widths.
6992 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
6993 user can override the types.
6994 (short): #undef, to work around a bug in Pike 7.0.
6995 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
6996 (union yyalloc.yyss): Use yytype_int16 rather than short.
6997 All uses changed.
6998 (yysigned_char): Remove.
6999 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
7000 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
7001 * tests/regression.at (Web2c Actions): Adjust to above changes.
7002
7003 * src/reader.c (check_and_convert_grammar): New function.
7004 (reader): Close the input file even if something went wrong during
7005 parsing. Minor file descriptor leak reported by twlevo.
7006
7007 * src/assoc.c (assoc_to_string): Use a default: abort (); case
7008 to pacify gcc -Wswitch-default.
7009 * src/scan-gram.l (adjust_location): Use a default: break; case
7010 to pacify gcc -Wswitch-default.
7011 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
7012 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
7013 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
7014 Move these decls to scan-skel.l, since they don't need to be
7015 visible elsewhere.
7016 * src/scan-skel.l: Accept the above decls.
7017 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
7018 is used.
7019
70202006-01-21 Paul Eggert <eggert@cs.ucla.edu>
7021
7022 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
7023 since we don't want to insist on a version number at the start
7024 of the changelog every time.
7025 * Makefile.maint: Sync from coreutils a bit better.
7026 (sc_trailing_blank): Renamed from sc_trailing_space.
7027 All uses changed.
7028 (sc_no_if_have_config_h, sc_require_config_h):
7029 (sc_prohibit_assert_without_use): New rules.
7030 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
7031 (sc_dd_max_sym_length): Fix leading spaces in rule.
7032 (sc_system_h_headers): Prefix with @.
7033 (sc_useless_cpp_parens, m4-check): Output line numbers.
7034 (changelog-check): Allow version only in head.
7035 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
7036 satisfy new Makefile.maint rule.
7037 * data/glr.c: Likewise.
7038 * data/glr.cc: Likewise.
7039 * data/lalr1.cc: Likewise.
7040 * data/yacc.c: Likewise.
7041 * lib/ebitsetv.c: Likewise.
7042 * lib/lbitset.c: Likewise.
7043 * lib/subpipe.c: Likewise.
7044 * lib/timevar.c: Likewise.
7045 * src/system.h: Likewise.
7046 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
7047 * djgpp/Makefile.maint: Add copyright notice.
7048 * djgpp/README.in: Likewise.
7049 * djgpp/config.bat: Likewise.
7050 * djgpp/config.site: Likewise.
7051 * djgpp/config_h.sed: Likewise.
7052 * djgpp/djunpack.bat: Likewise.
7053 * djgpp/config.sed: Fix copyright notice to match standard format.
7054 * djgpp/subpipe.h: Likewise.
7055 * lib/bitsetv-print.c: Likewise.
7056 * lib/bitsetv.c: Likewise.
7057 * lib/subpipe.h: Likewise.
7058 * lib/timevar.c: Likewise.
7059 * lib/timevar.h: Likewise.
7060 * djgpp/subpipe.c: Use standard recipe for config.h.
7061 * lib/abitset.c: Likewise.
7062 * lib/bitset.c: Likewise.
7063 * lib/bitset_stats.c: Likewise.
7064 * lib/bitsetv-print.c: Likewise.
7065 * lib/bitsetv.c: Likewise.
7066 * lib/ebitsetv.c: Likewise.
7067 * lib/get-errno.c: Likewise.
7068 * lib/lbitset.c: Likewise.
7069 * lib/subpipe.c: Likewise.
7070 * lib/timevar.c: Likewise.
7071 * lib/vbitset.c: Likewise.
7072 * tests/local.at: Likewise.
7073 * src/scan-gram.l: Don't include verify.h, since system.h does
7074 that for us.
7075 * .x-sc_require_config_h: New file.
7076 * .x-sc_unmarked_diagnostics: New file.
7077
70782006-01-20 Paul Eggert <eggert@cs.ucla.edu>
7079
7080 Be a bit more systematic about using 'abort'.
7081 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
7082 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
7083 Put 'default: abort ();' before some other case, to satisfy older
7084 pedantic compilers.
7085 * lib/bitset_stats.c (bitset_stats_init): Likewise.
7086 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
7087 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
7088 * src/conflicts.c (resolve_sr_conflict): Likewise.
7089 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
7090 (get_decision_str, get_orientation_str, get_node_alignment_str):
7091 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
7092 (get_linestyle_str, get_arrowstyle_str): Likewise.
7093 * src/conflicts.c (resolve_sr_conflict):
7094 Use a default case rather than one for the one remaining enum
7095 value, to catch invalid enum values as well.
7096 * src/lalr.c (set_goto_map, map_goto):
7097 Prefer "assert (FOO);" to "if (!FOO) abort ();".
7098 * src/nullable.c (nullable_compute, token_definitions_output):
7099 Likewise.
7100 * src/reader.c (packgram, reader): Likewise.
7101 * src/state.c (transitions_to, state_new, state_reduction_find):
7102 Likewise.
7103 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
7104 (symbol_pack): Likewise.
7105 * src/tables.c (conflict_row, pack_vector): Likewise.
7106 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
7107 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
7108 * src/system.h: Don't include <assert.h>.
7109 (assert): New macro.
7110
7111 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
7112 (Destructor Decl, Parser Function, Pure Calling):
7113 Describe rules for braces inside C code more carefully.
7114
71152006-01-19 Paul Eggert <eggert@cs.ucla.edu>
7116
7117 Fix some porting glitches found by Nelson H. F. Beebe.
7118 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
7119 compilers that don't understand that abort () does not return.
7120 * src/state.c (transitions_to): Likewise.
7121 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
7122 that '#include <cstdlib>' works.
7123 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
7124 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
7125 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
7126 for the benefit of some pre-C99 compilers.
7127
7128 * bootstrap: Undo changes to gnulib files that autoreconf made.
7129
7130 Minor fixups to get 'make maintainer-check' to work.
7131 * configure.ac: Don't use -Wnested-externs, as it's incompatible
7132 with the new verify.h implementation.
7133 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
7134 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
7135 * data/yacc.c (YYUSE): Likewise.
7136 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
7137 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
7138 * src/parse-gram.y (declaration): Don't pass a string constant
7139 to a function that expects char *, since GCC might complain
7140 about the constant value.
7141 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
7142 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
7143 before #defining them.
7144 * tests/glr-regression.at
7145 (Incorrectly initialized location for empty right-hand side in GLR):
7146 In yyerror, use the msg arg.
7147 (Corrupted semantic options if user action cuts parse):
7148 (Incorrect lookahead during deterministic GLR):
7149 (Incorrect lookahead during nondeterministic GLR):
7150 Don't name a local var 'index'; it shadows string.h's 'index'.
7151
71522006-01-19 Akim Demaille <akim@epita.fr>
7153
7154 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
7155 location, not just parts of it.
7156
71572006-01-18 Paul Eggert <eggert@cs.ucla.edu>
7158
7159 * NEWS: Document the fact that multiple %unions are now allowed.
7160 * doc/bison.texinfo (Union Decl): Likewise.
7161 * TODO: This feature is now implemented, so remove it from
7162 the wishlist.
7163
7164 * Makefile.maint: Merge with coreutils Makefile.maint.
7165 (CVS_LIST): Use build-aux version if available.
7166 (VERSION_REGEXP): New macro.
7167 (syntax-check-rules): Add sc_no_if_have_config_h,
7168 sc_prohibit_assert_without_use, sc_require_config_h,
7169 sc_useless_cpp_parens.
7170 (sc_obsolete_symbols): Check for O_NDELAY.
7171 (sc_dd_max_sym_length): Track coreutils.
7172 (sc_unmarked_diagnostics): Look in all files, not just *.c.
7173 (sc_useless_cpp_parens): New rule.
7174 (news-date-check): Look for version or today's date.
7175 (changelog-check): Don't require version number near head.
7176 (copyright-check): Use current year instead of hardwiring 2005.
7177 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
7178 (announcement): Add --gpg-key-ID.
7179
7180 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
7181 with "file system".
7182
7183 Avoid undefined behavior that addressed just before the start of an
7184 array. Problem reported by twlevo.
7185 * src/reader.c (packgram): Prepend a new sentinel before ritem.
7186 * src/lalr.c (build_relations): Rely on new sentinel.
7187 * src/gram.c (gram_free): Adjust to new sentinel.
7188
71892006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
7190
7191 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
7192 yylookaheadNeeds. All uses updated.
7193 (yysplitStack): Rename local yynewLookaheadStatuses to
7194 yynewLookaheadNeeds.
7195 * data/glr-regression.at (Incorrect lookahead during nondeterministic
7196 GLR): In comments, change `lookahead status' to `lookahead need'.
7197
71982006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7199
7200 * data/glr.c (yysplitStack): A little stylistic rewrite.
7201
72022006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7203
7204 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
7205
72062006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
7207
7208 * doc/bison.texinfo: Fix some typos.
7209 (GLR Semantic Actions): New subsection discussing special
7210 considerations because GLR semantic actions might be deferred.
7211 (Actions): Mention look-ahead usage of yylval.
7212 (Actions and Locations): Mention look-ahead usage of yylloc.
7213 (Special Features for Use in Actions): Add YYEOF entry and mention it
7214 in the yychar entry.
7215 In the yychar entry, remove mention of the local yychar case (pure
7216 parser) since this is irrelevant information when writing semantic
7217 actions and since it's already discussed in `Table of Symbols' where
7218 yychar is otherwise described as an external variable.
7219 In the yychar entry, don't call it the `current' look-ahead since it
7220 isn't when semantic actions are deferred.
7221 In the yychar and yyclearin entries, add note about deferred semantic
7222 actions.
7223 Add yylloc and yylval entries discussing look-ahead usage.
7224 (Look-Ahead Tokens): When discussing yychar, don't call it the
7225 `current' look-ahead, and do mention yylval and yylloc.
7226 (Error Recovery): Cross-reference `Action Features' when mentioning
7227 yyclearin.
7228 (Table of Symbols): In the yychar entry, don't call it the `current'
7229 look-ahead.
7230 In the yylloc and yylval entries, mention look-ahead usage.
7231
72322006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
7233
7234 * tests/glr-regression.at: Update copyright year to 2006.
7235
72362006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7237
7238 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
7239 use during nondeterministic operation to track which stacks have
7240 actually needed the current lookahead.
7241 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
7242 Allocate, deallocate, resize, and otherwise shuffle space for
7243 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
7244 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
7245 appropriately during nondeterministic operation.
7246 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
7247 members to store the current lookahead to be used by the deferred
7248 user action.
7249 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
7250 from which the RHS is taken. Set the lookahead members of the new
7251 yySemanticOption according to the lookahead status for stack yyk.
7252 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
7253 yyaddDeferredAction.
7254 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
7255 members of yySemanticOption before invoking yyuserAction, and then set
7256 them back to their current values afterward.
7257 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
7258 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
7259 * tests/glr-regression.at: Remove `.' from the ends of recent test case
7260 titles for consistency.
7261 (Leaked merged semantic value if user action cuts parse): In order to
7262 suppress lint warnings, use arguments in merge function, and assign
7263 char value < 128 in main.
7264 (Incorrect lookahead during deterministic GLR): New test case.
7265 (Incorrect lookahead during nondeterministic GLR): New test case.
7266
72672006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7268
7269 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
7270 !yyvaluep as signal that no semantic value is available to print.
7271 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
7272 to print a semantic value.
7273
72742006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7275
7276 * tests/glr-regression.at: For consistency with my newer test cases,
7277 don't thank myself.
7278
72792006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
7280
7281 * data/glr.c (yyresolveValue): When merging semantic options, if at
7282 least one user action succeeds but a later one cuts the parse, then
7283 destroy the semantic value before returning rather than leaking it.
7284 (yyresolveStates): If a user action cuts the parse and thus
7285 yyresolveValue fails, ignore the (unset) semantic value rather than
7286 corrupting the yyGLRState, and empty the semantic options list since
7287 the user actions should have called all necessary destructors.
7288 Simplify code with YYCHK.
7289 * tests/glr-regression.at (Corrupted semantic options if user action
7290 cuts parse): New test case.
7291 (Undesirable destructors if user action cuts parse): New test case.
7292 Before applying any of this patch, this test case never actually failed
7293 for me... but only because the corrupted semantic options usually
7294 masked this bug.
7295 (Leaked merged semantic value if user action cuts parse): New test
7296 case.
7297
72982006-01-05 Akim Demaille <akim@epita.fr>
7299
7300 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
7301
73022006-01-04 Paul Eggert <eggert@cs.ucla.edu>
7303
7304 * data/c.m4 (b4_c_modern): New macro, with a new provision for
7305 _MSC_VER. Problem reported by Cenzato Marco.
7306 (b4_c_function_def): Use it.
7307 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
7308 b4_c_modern.
7309 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
7310 than rolling our own.
7311
73122006-01-04 Akim Demaille <akim@epita.fr>
7313
7314 Also warn about non-used mid-rule values.
7315 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
7316 member.
7317 (symbol_list_new): Adjust.
7318 * src/reader.c (symbol_typed_p): New.
7319 (grammar_rule_check): Use it.
7320 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
7321 Check its rule.
7322 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
7323 Use it.
7324 * tests/actions.at (Exotic Dollars): Adjust.
7325
73262006-01-04 Akim Demaille <akim@epita.fr>
7327
7328 * src/reader.c (grammar_midrule_action): If $$ is set in a
7329 mid-rule, move the `used' bit to its lhs.
7330 * tests/input.at (Unused values): New.
7331 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
7332
73332006-01-03 Paul Eggert <eggert@cs.ucla.edu>
7334
7335 * doc/bison.texinfo (Bison Options): Say more accurately what
7336 --yacc does.
7337 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
7338 about declarations in the grammar when in Yacc mode, as POSIX does
7339 not require a diagnostic when the grammar uses extensions.
7340
7341 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
7342
7343 Warn about dubious constructions like "%token T T".
7344 Reported by twlevo.
7345 * src/symtab.h (struct symbol.declared): New member.
7346 * src/symtab.c (symbol_new): Initialize it to false.
7347 (symbol_class_set): New arg DECLARING, specifying whether
7348 this is a declaration that we want to warn about, if there
7349 is more than one of them. All uses changed.
7350
7351 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
7352 Allow multiple %union directives, whose contents concatenate.
7353 * src/parse-gram.y (grammar_declaration): Likewise.
7354 Use muscle_code_grow, so that we don't need stype_line any more.
7355 All uses changed.
7356
7357 * src/muscle_tab.c (muscle_grow): Fix comment.
7358
7359 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
7360 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
7361 Update copyright year to 2006.
7362
73632006-01-03 Akim Demaille <akim@epita.fr>
7364
7365 Have glr.cc pass (some of) the calc.at tests.
7366 * data/glr.cc (b4_parse_param_orig): New.
7367 (b4_parse_param): Improve its definition, and bound it more
7368 clearly in the skeleton.
7369 (b4_epilogue): Append, instead of prepending, in order to keep
7370 #line consistency.
7371 Simplify the generation of auxiliary functions: locations and
7372 purity are mandated.
7373 (b4_global_tokens_and_yystype): Honor it.
7374 * data/location.cc (c++.m4): Don't include it.
7375 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
7376 and AT_SKEL_CC_IF.
7377 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
7378 AT_LALR1_CC_IF.
7379 Be sure to initialize the first position's filename.
7380 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
7381 mandated anyway.
7382 (AT_CHECK_CALC_GLR_CC): New.
7383 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
7384
73852006-01-02 Akim Demaille <akim@epita.fr>
7386
7387 * src/output.c (output_skeleton): Don't hard wire the inclusion of
7388 c.m4.
7389 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
7390 * data/glr.cc: Do not include stack.hh.
7391
73922006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7393
7394 * data/glr.c: Reformat whitespace with tabs.
7395 (b4_lpure_formals): Remove this unused m4 macro.
7396 * tests/cxx-type.at: Reformat whitespace with tabs.
7397 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
7398 since it's a member. Rename type to isNterm for clarity.
7399
74002005-12-29 Akim <akim@sulaco.local>
7401
7402 Let glr.cc catch up with symbol_value_print.
7403 * data/glr.cc (b4_yysymprint_generate): Replace by...
7404 (b4_yy_symbol_print_generate): this.
7405 (yy_symbol_print, yy_symbol_value_print): Declare them.
7406
74072005-12-28 Paul Eggert <eggert@cs.ucla.edu>
7408
7409 * src/location.h (boundary): Note that a line or column equal
7410 to INT_MAX indicates an overflow.
7411 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
7412 (rule_length_overflow, increment_rule_length, add_column_width):
7413 New functions.
7414 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
7415 (<SC_BRACED_CODE>"}"):
7416 Use increment_rule_length rather than incrementing it by hand.
7417 (adjust_location, handle_syncline): Diagnose overflow.
7418 (handle_action_dollar, handle_action_at):
7419 Fix bug with monstrosities like $-2147483648.
7420 Remove now-unnecessary checks.
7421 (scan_integer): Verify assumptions and remove now-unnecessary checks.
7422 (convert_ucn_to_byte): Verify assumptions.
7423 (handle_syncline): New arg LOC. All callers changed.
7424 Don't store through a value derived from char const * pointer.
7425
7426 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
7427 GCC warnings.
7428
74292005-12-27 Paul Eggert <eggert@cs.ucla.edu>
7430
7431 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
7432 Remove unnecessary forward static decls.
7433
74342005-12-27 Akim Demaille <akim@epita.fr>
7435
7436 * src/reader.c (grammar_current_rule_check): Also check that $$
7437 is used.
7438 Take the rule to check as argument, hence rename as...
7439 (grammar_rule_check): this.
7440 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
7441 Rename as...
7442 (grammar_rule_begin, grammar_rule_end): these, for consistency.
7443 (grammar_midrule_action, grammar_symbol_append): Now static.
7444 * tests/torture.at (input): Don't rely on the default action
7445 being always performed.
7446 * tests/calc.at: "Set" $$ even when the action is "cut" with
7447 YYERROR or other.
7448 * tests/actions.at (Exotic Dollars): Instead of using unused
7449 values, check that the warning is issued.
7450
74512005-12-22 Paul Eggert <eggert@cs.ucla.edu>
7452
7453 * NEWS: Improve wording for unused-value warnings.
7454
74552005-12-22 Akim Demaille <akim@epita.fr>
7456
7457 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
7458 (b4_yysymprint_generate): Rename as...
7459 (b4_yy_symbol_print_generate): this.
7460 Generate yy_symbol_print instead of yysymprint.
7461 Generate also yy_symbol_value_print, and use it.
7462
74632005-12-22 Akim Demaille <akim@epita.fr>
7464
7465 * NEWS: Warn about unused values.
7466 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
7467 a `used' member.
7468 (symbol_list_n_get, symbol_list_n_used_set): New.
7469 (symbol_list_n_type_name_get): Use symbol_list_n_get.
7470 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
7471 * src/reader.c (grammar_current_rule_check): Check that values are
7472 used.
7473 * src/symtab.c (symbol_print): Accept 0.
7474 * tests/existing.at: Remove the type information.
7475 Empty the actions.
7476 Remove useless actions (beware of mid-rule actions: perl -000
7477 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
7478 * tests/actions.at (Exotic Dollars): Use unused values.
7479 * tests/calc.at: Likewise.
7480 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7481 Likewise.
7482
7483 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
7484 rule_useful_p.
7485
74862005-12-21 Paul Eggert <eggert@cs.ucla.edu>
7487
7488 Undo 2005-12-01 tentative license wording change. The wording is
7489 still being reviewed by the lawyers, and we don't want to wait for
7490 them before publishing a test release. For now, revert to the
7491 previous wording.
7492 * NEWS: Undo 2005-12-01 change.
7493 * data/glr.c: Revert to previous license wording.
7494 * data/glr.cc: Likewise.
7495 * data/lalr1.cc: Likewise.
7496 * data/location.cc: Likewise.
7497 * data/yacc.c: Likewise.
7498
7499 * NEWS: Reword %destructor vs YYABORT etc.
7500 * data/glr.c: Use American spacing, for consistency.
7501 * data/glr.cc: Likewise.
7502 * data/lalr1.cc: Likewise.
7503 * data/yacc.c: Likewise.
7504 * data/yacc.c: Reformat comments slightly.
7505 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
7506 for consistency. Fix some spelling errors and reword recently-included
7507 text slightly.
7508 * tests/cxx-type.at: Cast results of malloc, for C++.
7509
75102005-12-21 Joel E. Denny <address@hidden>
7511
7512 * tests/cxx-type.at: Construct a tree, count the parents of shared
7513 nodes, and free each node once and only once. Previously, the memory
7514 for semantic values was leaked instead.
7515
75162005-12-21 Joel E. Denny <address@hidden>
7517
7518 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
7519 (yylval, yylloc): If pure, #define to yystackp->yyval and
7520 yystackp->yyloc similar to yychar and yynerrs.
7521 (yyparse): If pure, remove local yylval and yylloc. Add local
7522 yystackp to accommodate pure definitions of yylval and yylloc.
7523 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
7524 yylvalp and yyllocp to &yylval and &yylloc.
7525 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
7526 namespace. Previously, nerrs and char were missing, but lval and lloc
7527 weren't necessary.
7528 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
7529 yylvalp and yyllocp parameters since, if pure, these are now always
7530 accessible through yystackp. If not pure, they are still accessible
7531 globally.
7532 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
7533 `if (YYID (N))' to pacify lint.
7534
75352005-12-21 Akim Demaille <akim@epita.fr>
7536
7537 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
7538 destroy the RHS symbols of a rule.
7539 * data/yacc.c (yylen): Initialize to 0.
7540 Keep its value to the number of items to possibly shift.
7541 In particular, a regular successful parse that ends on YYFINAL by
7542 a (internal) YYACCEPT must not have yylen != 0.
7543 (yyerrorlab, yyreturn): Pop the RHS.
7544 Reorder a bit to emphasize the `shifting' bits of code.
7545 (YYPOPSTACK): Now accept a number of items to pop.
7546 * data/lalr1.cc: Likewise.
7547 * data/glr.c: Formatting changes.
7548 Use goto instead of fall through.
7549 * doc/bison.texinfo (Destructor Decl): Complete.
7550
75512005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7552
7553 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7554 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
7555 * djgpp/config.bat: Replace every occurence of the file name
7556 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7557 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7558 * djgpp/config.sed: Replace every occurence of the file name
7559 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7560 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7561 * djgpp/djunpack.bat: DJGPP specific file.
7562 * djgpp/fnchange.lst: DJGPP specific file.
7563 * djgpp/README.in: Add new information about how to unpack the bison
7564 source on MSDOS and other systems which have 8.3 file name restrictions
7565 using djunpack.bat and fnchange.lst.
7566
75672005-12-12 Paul Eggert <eggert@cs.ucla.edu>
7568
7569 * bootstrap (build_cvs_prefix): Remove; unused.
7570 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
7571 when getting gnulib.
7572
75732005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
7574
7575 * data/glr.c: Reorder typedef declarations for structs to match order
7576 of struct declarations.
7577 Rename yystack everywhere to yystackp except in yyparse where it's not
7578 a pointer.
7579 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
7580 consistency.
7581 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
7582 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
7583 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
7584 lint.
7585
75862005-12-09 Paul Eggert <eggert@cs.ucla.edu>
7587
7588 * tests/sets.at (Accept): Fix typos in regular expression used to
7589 sed out the final state number.
7590
7591 Work around portability problem on Solaris 10: flex-generated
7592 files include <stdio.h> before <config.h>, which messes up
7593 because the latter defines __EXTENSIONS__. Address the problem
7594 by creating two new little files that include <config.h> first,
7595 then include the flex-generated files. Rewrite everyone else
7596 to include <config.h> first, as well.
7597 * lib/timevar.c: Always include "config.h".
7598 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
7599 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
7600 (EXTRA_bison_SOURCES): New macro.
7601 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
7602 * src/system.h: Don't include config.h.
7603 * src/LR0.c: Include <config.h> first.
7604 * src/assoc.c: Likewise.
7605 * src/closure.c: Likewise.
7606 * src/complain.c: Likewise.
7607 * src/conflicts.c: Likewise.
7608 * src/derives.c: Likewise.
7609 * src/files.c: Likewise.
7610 * src/getargs.c: Likewise.
7611 * src/gram.c: Likewise.
7612 * src/lalr.c: Likewise.
7613 * src/location.c: Likewise.
7614 * src/main.c: Likewise.
7615 * src/muscle_tab.c: Likewise.
7616 * src/nullable.c: Likewise.
7617 * src/output.c: Likewise.
7618 * src/parse-gram.y: Likewise.
7619 * src/print.c: Likewise.
7620 * src/print_graph.c: Likewise.
7621 * src/reader.c: Likewise.
7622 * src/reduce.c: Likewise.
7623 * src/relation.c: Likewise.
7624 * src/state.c: Likewise.
7625 * src/symlist.c: Likewise.
7626 * src/symtab.c: Likewise.
7627 * src/tables.c: Likewise.
7628 * src/uniqstr.c: Likewise.
7629 * src/vcg.c: Likewise.
7630
7631 * src/parse-gram.y: Fix minor problems uncovered by lint.
7632 (current_lhs, current_lhs_location): Now static.
7633 (current_assoc): Remove unused variable.
7634
7635 Cleanups so that Bison-generated parsers have less lint.
7636 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
7637 Prepend /*ARGSUSED*/, for lint's sake.
7638 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
7639 definition if 'lint' is defined.
7640 (YYID): New macro (or function, if lint).
7641 All uses of /*CONSTCOND*/0 replaced by YYID(0).
7642 * data/yacc.c: Likewise.
7643 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
7644 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
7645 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
7646 is C++ only.
7647 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
7648 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
7649 Use YYID(0) rather than 0, for lint.
7650 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
7651 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
7652
76532005-12-07 Paul Eggert <eggert@cs.ucla.edu>
7654
7655 * tests/glr-regression.at
7656 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
7657 Close memory leak reported by twlevo.
7658
76592005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
7660
7661 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
7662 all stacks.
7663 (yyparse): Iterate another stack in order to call user destructors.
7664 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7665 New test case.
7666 (Duplicated user destructor for lookahead): This test now is expected
7667 to succeed.
7668
76692005-12-01 Paul Eggert <eggert@cs.ucla.edu>
7670
7671 * NEWS: Document the following change.
7672 * data/yacc.c: Say "parser skeleton" rather than "file", since
7673 it's no longer just a file.
7674 * data/glr.c: Grant a special exception for C GLR parsers, that
7675 reads like the already-existing exception for C LALR(1) parsers.
7676 * data/glr.cc: Likewise.
7677 * data/lalr1.cc: Likewise.
7678 * data/location.cc: Likewise.
7679 * data/yacc.c: Reword the "written by" statement to clarify that
7680 it was the parser skeleton, not the entire output file.
7681 * data/glr.c: Written by Paul Hilfinger.
7682 * data/glr.cc: Written by Akim Demaille.
7683 * data/lalr1.cc: Likewise.
7684
76852005-11-18 Paul Eggert <eggert@cs.ucla.edu>
7686
7687 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
7688 Fix typos in previous change that broke 'make check'.
7689 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
7690 supported in C.
7691 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
7692 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
7693 We can revert this once things settle down.
7694
7695 * src/conflicts.c (conflicts_print): Don't print file name twice
7696 when %expect fails because there were no conflicts.
7697 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
7698 change.
7699 * tests/conflicts.at (%expect not enough, %expect too much):
7700 (%expect with reduce conflicts): Adjust to new behavior.
7701
77022005-11-18 Akim Demaille <akim@epita.fr>
7703
7704 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
7705 errors.
7706 * NEWS: Document this.
7707 * doc/bison.texinfo (Expect Decl): Likewise.
7708
77092005-11-16 Akim Demaille <akim@epita.fr>
7710
7711 Generalize the display of semantic values and locations in traces.
7712 * data/glr.c (yy_reduce_print): Fix indices (again).
7713 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
7714 literal integers.
7715 * data/lalr1.cc (yyreduce_print): Rename as...
7716 (yy_reduce_print): this.
7717 Display values and locations.
7718 * data/yacc.c (yy_reduce_print): Likewise.
7719 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
7720 (yysymprint): Move higher to be visible from yy_reduce_print).
7721 (yyparse): Adjust.
7722 * tests/calc.at: Adjust the expected length of the traces.
7723
77242005-11-14 Akim Demaille <akim@epita.fr>
7725
7726 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
7727 from 1 to N, while values and location start at 0.
7728 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
7729
77302005-11-14 Akim Demaille <akim@epita.fr>
7731
7732 * data/glr.c (yy_reduce_print): Fix the $ number.
7733
77342005-11-14 Akim Demaille <akim@epita.fr>
7735
7736 "Use" parse parameters.
7737 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
7738 * data/glr.c, data/glr.cc: Use them.
7739 * data/glr.c (YYUSE): Have a C++ definition that supports
7740 non-pointer types.
7741
77422005-11-14 Akim Demaille <akim@epita.fr>
7743
7744 * data/glr.c (yyexpandGLRStack): Declare only if defined.
7745
77462005-11-14 Akim Demaille <akim@epita.fr>
7747
7748 * data/glr.cc: New.
7749 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
7750
77512005-11-12 Akim Demaille <akim@epita.fr>
7752
7753 Let position and location be PODs.
7754 * data/location.cc (position::initialize, location::initialize): New.
7755 (position::position, location::location): Define only if
7756 b4_location_constructors is defined.
7757 * data/lalr1.cc (b4_location_constructors): Define it for backward
7758 compatibility.
7759 * doc/bison.texinfo (Initial Action Decl): Use initialize.
7760
77612005-11-12 Akim Demaille <akim@epita.fr>
7762
7763 * data/lalr1.cc: Move the body of the ctor and dtor into the
7764 parser file (instead of the header).
7765 Wrap the implementations in a "namespace yy".
7766
77672005-11-12 Akim Demaille <akim@epita.fr>
7768
7769 Have glr.c include its header file when created.
7770 * data/glr.c (b4_shared_declarations): New.
7771 Output them verbatim in the parser if !%defines, otherwise
7772 output then in the header file, and include it instead.
7773
77742005-11-11 Akim Demaille <akim@epita.fr>
7775
7776 * data/glr.c: Comment changes.
7777
77782005-11-11 Akim Demaille <akim@epita.fr>
7779
7780 When yydebug, report semantic and location values for reductions.
7781 * data/glr.c (yy_reduce_print): Report the semantic values and the
7782 locations.
7783 (YY_REDUCE_PRINT): Adjust.
7784 (yyglrReduce): Use them.
7785 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
7786 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
7787 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
7788 traces.
7789
77902005-11-10 Akim Demaille <akim@epita.fr>
7791
7792 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
7793 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
7794 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
7795
77962005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
7797
7798 * m4/cxx.m4, examples/Makefile.am: Don't build
7799 examples/calc++ if no C++ compiler is available. (trivial change)
7800
78012005-11-09 Akim Demaille <akim@epita.fr>
7802
7803 * src/scan-skel.l: Use a couple of asserts.
7804
78052005-11-03 Akim Demaille <akim@epita.fr>
7806
7807 In some (weird) cases, the final state number is incorrect.
7808 Reported by Alexandre Duret-Lutz.
7809 * src/LR0.c (state_list_append): Remove the computation of
7810 final_state.
7811 (save_reductions): Do it here.
7812 (get_state): Alpha conversion.
7813 (generate_states): Use a for loop.
7814 * src/gram.h (item_number_is_rule_number)
7815 (item_number_is_symbol_number): New.
7816 * src/state.c: Use assert.
7817 * src/system.h: Include assert.h.
7818 * tests/sets.at (Accept): New.
7819
78202005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7821
7822 * data/glr.c (yyfill): Adjust comment.
7823 (yyresolveAction): Initialize default location properly
7824 for empty right-hand sides.
7825 (yydoAction): Ditto.
7826 Add comment explaining apparently dead code.
7827 * tests/glr-regression.at
7828 (Incorrectly initialized location for empty right-hand side in GLR):
7829 New test.
7830
78312005-10-30 Paul Eggert <eggert@cs.ucla.edu>
7832
7833 * bootstrap (cleanup_gnulib): New function. Use it to clean up
7834 gnulib when interrupted. This fixes some race conditions and
7835 works around some portability problems (one noted by Paul
7836 Hilfinger).
7837
78382005-10-22 Akim <akim@epita.fr>
7839
7840 * Makefile.cfg: Adjust to config -> build-aux.
7841 Reported by twledo.
7842
78432005-10-21 Akim Demaille <akim@epita.fr>
7844
7845 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
7846 the %parse-params.
7847 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
7848 * data/yacc.c (b4_Pure_if): Rename as...
7849 (b4_yacc_pure_if): this.
7850 (YY_SYMBOL_PRINT, yyparse): Adjust.
7851 * doc/bison.texinfo: Formatting changes.
7852
78532005-10-21 Akim Demaille <akim@epita.fr>
7854
7855 Finish the transition config -> build-aux.
7856 * configure.ac, Makefile.am: Use build-aux.
7857 * config/prev-version, config/announce-gen, config/Makefile.am:
7858 Move to...
7859 * build-aux/prev-version, build-aux/announce-gen,
7860 * build-aux/Makefile.am: here.
7861
78622005-10-14 Akim Demaille <akim@epita.fr>
7863
7864 * examples/calc++/test: Use set -x only when VERBOSE.
7865
78662005-10-13 Paul Eggert <eggert@cs.ucla.edu>
7867
7868 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
7869 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
7870
78712005-10-13 Akim Demaille <akim@epita.fr>
7872
7873 * src/scan-skel.l: Output the base name parts of the parser and
7874 header file names.
7875 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7876 additional checks.
7877 Use this to exercise C++ outputs in subdirs.
7878 Reported by Oleg Smolsky.
7879
78802005-10-12 Paul Eggert <eggert@cs.ucla.edu>
7881
7882 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
7883 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
7884 Problem reported by John P. Hartmann.
7885 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
7886 already defined it.
7887
78882005-10-12 Akim Demaille <akim@epita.fr>
7889
7890 * src/parse-gram.y (version_check): Exit 63 to please missing
7891 (stands for "version mismatch).
7892 * tests/input.at, doc/bison.texinfo: Adjust.
7893
78942005-10-10 Paul Eggert <eggert@cs.ucla.edu>
7895
7896 Work around portability problems with Visual Age C compiler
7897 (xlc and xlC_r) reported by John P. Hartmann.
7898 * data/location.cc (initial_column, initial_line): Remove.
7899 All uses replaced by 0 and 1.
7900 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
7901 that xlc complains about.
7902 * src/scan-skel.l (skel_wrap): Likewise.
7903 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
7904 as __STDC__.
7905 * data/yacc.c (YYMODERN_C): New macro, which also looks at
7906 __STDC_VERSION__. Use it everywhere instead of looking at
7907 __STDC__ and __cplusplus.
7908
79092005-10-10 Akim Demaille <akim@epita.fr>
7910
7911 * examples/calc++/test: Be quiet unless VERBOSE.
7912
79132005-10-05 Paul Eggert <eggert@cs.ucla.edu>
7914
7915 * data/c.m4 (yydestruct, yysymprint):
7916 Use YYUSE instead of casting to void.
7917 * data/glr.c (YYUSE): New macro.
7918 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7919 Use it instead of rolling our own.
7920 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7921 (YYCHK1):
7922 Use /*CONSTCOND*/ to suppress lint warnings.
7923 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
7924 (YY_STACK_PRINT): Use 'false' not '0'.
7925 (YYUSE): New macro.
7926 (yysymprint_, yydestruct_): Use it instead of rolling our own.
7927 * data/yacc.c (YYUSE): New macro.
7928 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
7929 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
7930 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
7931
7932
7933 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
7934 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
7935
79362005-10-04 Paul Eggert <eggert@cs.ucla.edu>
7937
7938 Undo the parts of the unlocked-I/O change that substituted
7939 putc or puts for printf. This might hurt performance a bit,
7940 but some people prefer the printf style.
7941 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
7942 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
7943 All uses replaced by YYFPRINTF and YYDPRINTF.
7944 * data/yacc.c: Likewise.
7945 * lib/bitset.c (bitset_print): Likewise.
7946 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
7947 putc and puts.
7948 * lib/lbitset.c (debug_lbitset): Likewise.
7949 * src/closure.c (print_firsts, print_fderives): Likewise.
7950 * src/gram.c (grammar_dump): Likewise.
7951 * src/lalr.c (look_ahead_tokens_print): Likewise.
7952 * src/output.c (escaped_output): Likewise.
7953 (user_actions_output): Break apart two printfs.
7954 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
7955 * src/reduce.c (reduce_print): Likewise.
7956 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7957 * src/system.h: Include unlocked-io.h rathe than stdio.h.
7958
7959 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
7960 Use assignments rather than casts-to-void to suppress
7961 unused-variable warnings. This pacifies 'lint'.
7962 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
7963 unused-variable warnings.
7964
79652005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7966
7967 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7968
79692005-10-02 Paul Eggert <eggert@cs.ucla.edu>
7970
7971 Use unlocked I/O for a minor performance improvement on hosts like
7972 GNU/Linux and Solaris that support unlocked I/O. The basic idea
7973 is to use the gnlib unlocked-io module, and to prefer putc and
7974 puts to printf when either will work (since the latter doesn't
7975 come in an unlocked flavor).
7976 * bootstrap (gnulib_modules): Add unlocked-io.
7977 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
7978 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
7979 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
7980 and similarly for puts and putc and printf.
7981 * data/yacc.c: Likewise.
7982 * lib/bitset.c (bitset_print): Likewise.
7983 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
7984 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
7985 to printf.
7986 * lib/lbitset.c (debug_lbitset): Likewise.
7987 * src/closure.c (print_firsts, print_fderives): Likewise.
7988 * src/gram.c (grammar_dump): Likewise.
7989 * src/lalr.c (look_ahead_tokens_print): Likewise.
7990 * src/output.c (escaped_output): Likewise.
7991 (user_actions_output): Coalesce two printfs.
7992 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
7993 * src/reduce.c (reduce_print): Likewise.
7994 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
7995 * src/system.h: Include unlocked-io.h rather than stdio.h.
7996
7997 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
7998 this confuses xgettext.
7999
80002005-10-02 Akim Demaille <akim@epita.fr>
8001
8002 * bootstrap (gnulib_modules): Add strverscmp.
8003 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
8004 * m4/.cvsignore: Add strverscmp.m4.
8005 * src/parse-gram.y (%require): New token, new rule.
8006 (version_check): New.
8007 * src/scan-gram.l (%require): Adjust.
8008 * tests/input.at (AT_REQUIRE): New.
8009 Use it.
8010 * doc/bison.texinfo (Require Decl): New.
8011 (Calc++ Parser): Use %require.
8012
80132005-10-02 Akim Demaille <akim@epita.fr>
8014
8015 * data/location.cc: New.
8016
80172005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
8018 Akim Demaille <akim@epita.fr>
8019
8020 Make sure -odir/foo.cc creates dir/location.hh etc.
8021 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
8022 (spec_file_prefix, spec_verbose_file, spec_graph_file)
8023 (spec_defines_file): Now const.
8024 (dir_prefix): New.
8025 (short_base_name): Remove.
8026 * src/files.c: Adjust.
8027 (dirname.h): Include.
8028 (base_name): Don't prototype it.
8029 (finput): Remove, duplicates gram_in.
8030 (full_base_name, short_base_name): Replace by...
8031 (all_but_ext, all_but_tab_ext): these.
8032 (compute_base_names): Rename as...
8033 (compute_file_name_parts): this.
8034 Update to compute the new variables, including dir_prefix.
8035 Adjust dependencies.
8036 * src/output.c (prepare): Output them.
8037 * src/reader.c: Adjust to use gram_in, not finput.
8038 * src/scan-skel.l (@dir_prefix@): New.
8039
80402005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8041
8042 * lib/subpipe.c: New function end_of_output_subpipe() added
8043 to allow support for non-posix systems. This is a no-op function
8044 for posix systems.
8045
8046 * lib/subpipe.h: New function end_of_output_subpipe() added
8047 to allow support for non-posix systems. This is a no-op function
8048 for posix systems.
8049
8050 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
8051 handle the lack of pipe/fork functionality on non-posix systems.
8052
8053 * djgpp/Makefile.maint: DJGPP specific file.
8054
8055 * djgpp/README.in: DJGPP specific file.
8056
8057 * djgpp/config.bat: DJGPP specific configuration file.
8058
8059 * djgpp/config.sed: DJGPP specific configuration file.
8060
8061 * djgpp/config.site: DJGPP specific configuration file.
8062
8063 * djgpp/config_h.sed: DJGPP specific configuration file.
8064
8065 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
8066
8067 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
8068
80692005-10-02 Akim Demaille <akim@epita.fr>
8070
8071 * data/location.cc: New, extract from...
8072 * data/lalr1.cc: here.
8073 (location.hh): Include it after the user prologue, in case the
8074 filename type is defined by the user.
8075 Forward declation location and position before the pre-prologue.
8076 (yyresult_): Rename as...
8077 (yyresult): this, it's a local variable, not an attribute.
8078 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
8079
80802005-10-01 Akim Demaille <akim@epita.fr>
8081
8082 * examples/extexi: Restore the #line generation.
8083
80842005-09-30 Akim Demaille <akim@epita.fr>,
8085 Alexandre Duret-Lutz <adl@gnu.org>
8086
8087 Move the token type and YYSTYPE in the parser class.
8088 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
8089 (parser::token): New, from the moved free definition of tokens.
8090 (parser::semantic_value): Now a full definition instead of an
8091 indirection to YYSTYPE.
8092 (b4_post_prologue): No longer included in the header file, but
8093 in the implementation file.
8094 * doc/bison.texi (C+ Language Interface): Update.
8095 * src/parse-gram.y: Support unary %define.
8096 * tests/actions.at: Define global_tokens_and_yystype for backward
8097 compatibility until we update the tests.
8098 * tests/calc.at: Idem.
8099 (first_line, first_column, last_line, last_column): Define for lalr1.cc
8100 to simplify the code.
8101
81022005-09-29 Paul Eggert <eggert@cs.ucla.edu>
8103
8104 Port to SunOS 4.1.4, which lacks strtoul and strerror.
8105 Ah, the good old days! Problem reported by Peter Klein.
8106 * bootstrap (gnulib_modules): Add strerror, strtoul.
8107 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
8108 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
8109
81102005-09-29 Akim Demaille <akim@epita.fr>
8111
8112 * data/c.m4 (b4_error_verbose_if): New.
8113 * data/lalr1.cc: Use it.
8114 (YYERROR_VERBOSE_IF): Remove.
8115 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
8116 parser members, replaced by...
8117 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
8118 local variables.
8119 (yysyntax_error_): Takes the state number as argument.
8120 (yyreduce_print_): Use the argument yyrule, not the former
8121 attribute yyn_.
8122
81232005-09-26 Paul Eggert <eggert@cs.ucla.edu>
8124
8125 * bootstrap (gnulib_modules): Add verify.
8126 * lib/.cvsignore: Add verify.h.
8127 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
8128 * src/system.h (verify): Remove.
8129 Include verify.h instead.
8130 * src/tables.c (tables_generate): Use new API for 'verify'.
8131
81322005-09-21 Paul Eggert <eggert@cs.ucla.edu>
8133
8134 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
8135 local variables whose names begin with 'yy'.
8136 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8137 Trivial changes from Joel E. Denny.
8138
8139 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
8140 it itself.
8141 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
8142 don't use alloca any more.
8143
8144 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
8145 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
8146 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
8147 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
8148 to match yacc.c, to test more hosts.
8149
81502005-09-20 Paul Eggert <eggert@cs.ucla.edu>
8151
8152 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
8153 doesn't affect behavior.
8154 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
8155 Solaris, AIX, MSC.
8156 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
8157 This works a bit better with glibc, if user code has already included
8158 stdlib.h.
8159 * doc/bison.texinfo (Bison Parser): Document that users can't
8160 arbitrarily use malloc and free for other purposes. Document
8161 that <alloca.h> and <malloc.h> might be included.
8162 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
8163 user must declare alloca.
8164
8165 * HACKING (release): Forwarn the Translation Project about
8166 stable releses.
8167
81682005-09-20 Akim Demaille <akim@epita.fr>
8169
8170 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
8171
81722005-09-19 Paul Eggert <eggert@cs.ucla.edu>
8173
8174 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
8175 (YYSTACK_ALLOC_MAXIMUM): Use it.
8176 (yysyntax_error): New function.
8177 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
8178 multiple syntax errors are reported, and alloca is being used.
8179 Instead, reallocate buffers twice as big each time, so that
8180 we waste at most half the allocated memory. Start with a small
8181 (128-byte) buffer that will suffice in most cases anyway.
8182 Use yysyntax_error to do most of the work.
8183
8184 * doc/bison.texinfo (Error Reporting, Table of Symbols):
8185 yynerrs is the number of errors reported, not the number of
8186 errors encountered.
8187
8188 * tests/glr-regression.at (Duplicated user destructor for lookahead):
8189 Mark it as expected to fail.
8190 Cast result of malloc; problem reported by twlevo@xs4all.nl.
8191 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
8192 Don't start user-code symbols with "yy", to avoid name space problems.
8193
81942005-09-19 Akim Demaille <akim@epita.fr>
8195
8196 Remove the traits, failed experiment.
8197 It never proved useful, and anyway because of the current
8198 definition, it was not possible to have several specialization of
8199 this traits, making it useless.
8200 * data/lalr1.cc (yy:traits): Remove.
8201 Inline its definitions in the parser class.
8202
82032005-09-19 Akim Demaille <akim@epita.fr>
8204
8205 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
8206 least Mac OSX with a /usr/local install of gettext.
8207
82082005-09-19 Akim Demaille <akim@epita.fr>
8209
8210 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
8211 and yytoken for similarity with the other skeletons.
8212
82132005-09-19 Akim Demaille <akim@epita.fr>
8214
8215 * NEWS, configure.ac: update version number to 2.1a.
8216
82172005-09-16 Paul Eggert <eggert@cs.ucla.edu>
8218
8219 * NEWS: Version 2.1.
8220
8221 * NEWS: Remove notice of yytname change, since it was never in an
8222 official release.
8223 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
8224 diagnostic.
8225 * src/output.c (prepare): Likewise.
8226 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
8227 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
8228 is not defined. This is an awful hack, but it's enough for now.
8229 All callers changed.
8230 * tests/glr-regression-at (make_value): Args are const pointers now,
8231 to avoid GCC warning.
8232 (Duplicated user destructor for lookahead): New test. Currently
8233 skipped. It fails on my host but I'm not sure it'll always fail.
8234
82352005-09-16 Akim Demaille <akim@epita.fr>
8236
8237 * src/symtab.h (struct symbol): Declare the printer and destructor
8238 as const, to avoid accidental calls to free.
8239 (symbol_destructor_set, symbol_printer_set): Adjust.
8240 * src/symtab.c: Adjust.
8241
82422005-09-16 Akim Demaille <akim@epita.fr>
8243
8244 * data/c.m4 (b4_token_enums): New.
8245 (b4_token_defines): Rename as...
8246 (b4_token_enums_defines): this.
8247 (b4_token_defines): New, output only the #defines.
8248 * data/yacc.c, data/glr.c: Adjust.
8249 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
8250 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
8251 as default values.
8252
82532005-09-16 Akim Demaille <akim@epita.fr>
8254
8255 * data/lalr1.cc (yylex_): Remove, inline its code.
8256 (yyreport_syntax_error_): Remove, replaced by...
8257 (yysyntax_error_): this which returns a string and leaves to the
8258 caller the call to the users' error function.
8259 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
8260 Move from members of the parser object...
8261 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
8262 to local variables of the parse function.
8263
82642005-09-16 Akim Demaille <akim@epita.fr>
8265
8266 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
8267 since it's in Bison's name space.
8268
82692005-09-15 Paul Eggert <eggert@cs.ucla.edu>
8270
8271 * data/glr.c (yyresolveValue): Add default case to pacify
8272 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
8273
8274 * NEWS: Document when yyparse started to return 2.
8275 * doc/bison.texinfo (Parser Function): Document when yyparse
8276 returns 2.
8277
8278 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
8279 (b4_filename_type): Renamed back from b4_file_name_type. All uses
8280 changed.
8281 (class position): file_name -> filename (reverting). All uses changed.
8282
82832005-09-14 Paul Eggert <eggert@cs.ucla.edu>
8284
8285 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
8286 do anything if $@ exists. This reverts part of the 2005-07-07
8287 patch.
8288
82892005-09-11 Paul Eggert <eggert@cs.ucla.edu>
8290
8291 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
8292 contains obsolete information and isn't worth distributing as a
8293 separate file anyway.
8294 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
8295 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
8296 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
8297 (yyparse): Abort if user code uses longjmp to throw an unexpected
8298 value.
8299
83002005-09-09 Paul Eggert <eggert@cs.ucla.edu>
8301
8302 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
8303 Suggested by twlevo@xs4all.nl.
8304
8305 * data/glr.c (YYCHK1): Do not assume YYE is in range.
8306 This avoids a diagnostic from gcc -Wswitch-enum.
8307 Problem reported by twlevo@xs4all.nl.
8308
8309 * doc/bison.texinfo: Don't use "filename", as per GNU coding
8310 standards. Use "file name" or "file" or "name", depending on
8311 the context.
8312 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
8313 not to hack/foo.tab.c.
8314 (Calc++ Top Level): 2nd arg of main is not const.
8315 * data/glr.c: b4_filename -> b4_file_name.
8316 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
8317 All uses changed.
8318 (class position): filename -> file_name. All uses changed.
8319 * data/yacc.c: b4_filename -> b4_file_name.
8320 * lib/bitset.h: filename -> file_name in local vars.
8321 * lib/bitset_stats.c: Likewise.
8322 * src/files.c: Likewise.
8323 * src/scan-skel.l ("@output ".*\n): Likewise.
8324 * src/files.c (file_name_split): Renamed from filename_split.
8325 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
8326
83272005-09-08 Paul Eggert <eggert@cs.ucla.edu>
8328
8329 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
8330 to accommodate latest gnulib.
8331
8332 * tests/glr-regression.at (Duplicate representation of merged trees):
8333 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
8334
8335 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
8336 needed.
8337
83382005-08-26 Paul Eggert <eggert@cs.ucla.edu>
8339
8340 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
8341 All uses changed. Invoke user destructor after an error during a
8342 split parse (trivial change from Joel E. Denny).
8343
8344 * tests/glr-regression.at
8345 (User destructor after an error during a split parse): New test case.
8346 Problem reported by Joel E. Denny in:
8347 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
8348
83492005-08-25 Paul Eggert <eggert@cs.ucla.edu>
8350
8351 * README-cvs: Give URLs for recommended tools.
8352 Mention Gzip version problem, and bootstrapping issues.
8353 Remove troubleshooting section, as it's somewhat obsolete.
8354
8355 * bootstrap (no_cache): New var, to accommodate different wget
8356 variants. Use it instead of '-C off'. Problem reported by
8357 twlevo@xs4all.nl.
8358
8359 * data/glr.c (yydestroyStackItem): New function.
8360 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
8361 debugging information. Problem reported by Joel E. Denny.
8362
83632005-08-25 Akim Demaille <akim@epita.fr>
8364
8365 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
8366
83672005-08-24 Paul Eggert <eggert@cs.ucla.edu>
8368
8369 * data/glr.c (yyrecoverSyntaxError, yyreturn):
8370 Don't invoke destructor on unresolved entries.
8371 * tests/glr-regression.at
8372 (User destructor for unresolved GLR semantic value): New test case.
8373 Problem reported by Joel E. Denny in:
8374 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
8375
83762005-08-21 Paul Eggert <eggert@cs.ucla.edu>
8377
8378 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
8379 Add strnlen.c.
8380 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
8381 lib-prefix.m4, po.m4.
8382
8383 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
8384 in yydestruct diagnostic, since it might not be an error.
8385 Problem reported by Joel Denny near end of
8386 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8387 * data/lalr1.cc (yyerturn): Likewise.
8388 * data/yacc.c (yyreturn): Likewise.
8389 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
8390
8391 * src/files.c: Remove obsolete FIXME comment.
8392
8393 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
8394 with the other templates, and to fix bogus run-on messages such
8395 as the one reported at the end of
8396 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8397 All callers changed to avoid the newline.
8398 (yyprocessOneStack): Output two lines rather than one, to accommodate
8399 the above change. This changes the debug output format slightly.
8400
8401 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
8402 reported by Joel E. Denny in
8403 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
8404 (trivial change).
8405 * tests/glr-regression.at (Duplicate representation of merged trees):
8406 New test, from Joel E. Denny in:
8407 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
8408 * THANKS: Add Joel E. Denny.
8409
8410 * configure.ac (AC_INIT): Bump to 2.0c.
8411
84122005-07-24 Paul Eggert <eggert@cs.ucla.edu>
8413
8414 * NEWS: Version 2.0b.
8415
8416 * Makefile.am (SUBDIRS): Put examples before tests, so that
8417 "make check" doesn't finish with "All 1 tests passed".
8418
8419 * tests/regression.at (Token definitions): Don't rely on
8420 AT_PARSER_CHECK for data that contains backslashes. It currently
8421 uses 'echo', and 'echo' isn't portable if its argument contains
8422 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
8423 that the byte '\0xff' is not printable in the C locale; it is,
8424 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
8425 not printable, so use '\0x81' to test.
8426
8427 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
8428 version of GCC, since the macro is used with non-GCC compilers.
8429
8430 Fix core dump reported by Pablo De Napoli in
8431 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
8432 * tests/regression.at (Invalid inputs with {}): New test.
8433 * src/parse-gram.y (token_name): Translate type before using
8434 it as an index.
8435
8436 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
8437 the user's name space. All uses changed to __attribute__
8438 ((__unused__)).
8439 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
8440 Add __attribute__ ((__noreturn__)).
8441
8442 * etc/clcommit: Remove. We weren't using it, and it failed
8443 "make maintainer-distcheck".
8444 * Makefile.maint: Merge from coreutils.
8445 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
8446 (syntax-check-rules): Change list of rules as described below.
8447 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
8448 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
8449 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
8450 (sc_trailing_space): New rules.
8451 (sc_xalloc_h_in_src): Remove.
8452 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
8453 (sc_space_tab, sc_error_exit_success, sc_changelog):
8454 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
8455 (makefile-check, po-check, author_mark_check):
8456 (makefile_path_separator_check, copyright-check):
8457 Use grep -n, to make it easier to find violations.
8458 Use CVS_LIST and CVS_LIST_EXCEPT.
8459 (header_regexp, h_re): Remove.
8460 (dd_c): New macro.
8461 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
8462 (my-distcheck): Use more-modern GCC flags.
8463 (signatures, %.asc): Remove.
8464 (rel-files, announcement): Remove signatures.
8465 Restore old updating code, even though we don't use it, so
8466 that we're the same as coreutils.
8467 (alpha, beta, major): Depend on news-date-check.
8468 Make the upload commands.
8469
8470 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
8471 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
8472 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
8473 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
8474 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
8475 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
8476 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
8477 * tests/sets.at: Likewise.
8478
8479 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
8480 we comment out the Autoconf version number.
8481 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
8482 it's error-prone and "make maintainer-distcheck" rejects it.
8483
8484 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
8485 Indent calls to "error" to pacify "make maintainer-distcheck",
8486 when the calls are not intended to be translated.
8487 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
8488
8489 * src/Makefile.am (DEFS): Use +=, to pacify
8490 "make maintainer-distcheck".
8491 (bison_SOURCES): Add scan-skel.h.
8492 (sc_tight_scope): New rule, from coreutils.
8493
8494 * src/files.c (src_extension, header_extension):
8495 Now static, not extern.
8496 * src/getargs.c (short_options): Likewise.
8497 * src/muscle_tab.c (muscle_table): Likewise.
8498 * src/parse-gram.y (current_class, current_type, current_prec):
8499 Likewise.
8500 * src/reader.c (grammar_end, previous_rule_end): Likewise.
8501 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
8502 * src/main.c (main): Cast bindtextdomain and textdomain calls to
8503 void, to avoid warning when NLS is disabled.
8504 * src/output.c: Include scan-skel.h.
8505 (scan_skel): Remove decl, since scan-skel.h does this.
8506 (output_skeleton):
8507 Indent calls to "error" to pacify "make maintainer-distcheck".
8508 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
8509 * src/reader.h (gram_end, gram_lineno): New decls to pacify
8510 "make maintainer-distcheck".
8511 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
8512 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
8513 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
8514 (skel_lex_destroy, scan_skel): Move these decls to...
8515 * src/scan-skel.h: New file.
8516 * src/uniqstr.c (uniqstr_assert):
8517 Indent calls to "error" to pacify "make maintainer-distcheck".
8518
8519 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
8520 not @VAR@.
8521
8522 * tests/torture.at: Revamp to avoid misuse of atoi that
8523 "make maintainer-distcheck" complained about.
8524
8525 * examples/extexi (message): Don't print a message more than once,
8526 and omit line-number decoration that makes Emacs compile think
8527 that informative messages are worth worrying about.
8528
85292005-07-22 Paul Eggert <eggert@cs.ucla.edu>
8530
8531 * configure.ac: Update version number.
8532
8533 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
8534 accidentally.
8535 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
8536 autogenerated by the maintainer.
8537 * examples/calc++/.cvsignore: Add *.yy.
8538
8539 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
8540 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8541 * lib/bitsetv.c (bitsetv_alloc): Likewise.
8542
8543 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
8544
8545 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
8546 from maintainer-distcheck about casting the argument of 'free'.
8547
8548 * NEWS: Mention recent yytname changes.
8549 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
8550
8551 * bootstrap: For translations that have not yet been upgraded to
8552 the new runtime-po domain, prime the pump by extracting the
8553 relevant strings from the obsolete translations. This code can be
8554 removed once the bison-runtime domain has been translated by each
8555 team.
8556
8557 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
8558 now that token names are already quoted.
8559
8560 Fix problem reported by Anthony Heading.
8561 * data/glr.c (YYTOKEN_TABLE): New macro.
8562 (yytname): Define if YYTOKEN_TABLE.
8563 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
8564 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
8565 (YYERROR_VERBOSE): Define the same way the other skeletons do.
8566 * src/output.c (prepare_symbols): Output token_table_flag.
8567
85682005-07-21 Paul Eggert <eggert@cs.ucla.edu>
8569
8570 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
8571 again if the first call fails.
8572
8573 * data/glr.c (yytnamerr): New function.
8574 (yyreportSyntaxError): Use it to dequote most string literals.
8575 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
8576 with other skeletons. All uses changed.
8577 (yytnameerr_): New function.
8578 (yyreport_syntax_error): Use it to dequote most string literals.
8579 * data/yacc.c (yytnamerr): New function.
8580 (yyerrlab): Use it to decode most string literals.
8581 * doc/bison.texinfo (Decl Summary, Calling Convention):
8582 Clarify quoting convention of yytname.
8583 * src/output.c (prepare_symbols): Quote all names. This undoes
8584 the 2005-04-17 change, which is now accomplished (mostly) via
8585 changes in the parsers as described above.
8586 * tests/regression.at (Token definitions, Web2c Actions):
8587 Undo most 2005-04-17 change here, too.
8588
85892005-07-20 Paul Eggert <eggert@cs.ucla.edu>
8590
8591 Fix more problems reported by twlevo@xs4all.nl.
8592 * tests/cxx-type.at: Don't pipe output of ./types through sed to
8593 remove trailing spaces. This loses the exit status of ./types,
8594 and isn't needed since ./types shouldn't be emitting trailing
8595 spaces.
8596 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
8597 as the stack isn't valid in that case.
8598
8599 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8600 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8601 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8602 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
8603 is used.
8604 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
8605 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8606 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8607 Likewise.
8608
8609 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
8610 overly-picky compilers that reject 'char *foo = "bar";'.
8611
8612 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
8613 to FILE * parameter, not to stderr. This fixes a typo introduced
8614 in the 2005-07-12 change.
8615
8616 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
8617 warnings from GCC 4.
8618
8619 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
8620 (yyglrShiftDefer, yysplitStack):
8621 Remove unused parameters b4_pure_formals. All uses changed.
8622 (yyglrShift): Remove unused parameters b4_user_formals.
8623 All uses changed.
8624 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
8625
86262005-07-18 Paul Eggert <eggert@cs.ucla.edu>
8627
8628 Destructor cleanups and regularization among the three skeletons.
8629 * NEWS: Document the behavior changes.
8630 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
8631 stack before failing, as the cleanup code will do it for us now.
8632 * data/lalr1.cc (yyerrlab): Likewise.
8633 * data/glr.c (yyparse): Pop everything off the stack before
8634 freeing it, so that destructors get called properly.
8635 * data/lalr1.cc (yyreturn): Likewise.
8636 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
8637 This is more consistent.
8638 * doc/bison.texinfo (Destructor Decl): Mention more reasons
8639 why destructors might be called. 1.875 -> 2.1.
8640 (Destructor Decl, Decl Summary, Table of Symbols):
8641 Some English-language cleanups for %destructor.
8642 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8643 Add output line for destructor of start symbol.
8644 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
8645 because of that same extra output line.
8646
8647 * NEWS: Document minor wording changes in diagnostics of
8648 Bison-generated parsers.
8649 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
8650 Remove unused formals. All uses changed.
8651 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
8652 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
8653 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
8654 Rename yyoverflowab to yyexhaustedlab.
8655 When memory exhaustion occurs during syntax-error reporting,
8656 report it separately rather than in a single diagnostic; this
8657 eases translation.
8658 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
8659 (Memory Exhausted): Renamed from Parser Stack Overflow.
8660 Revamp wording slightly to prefer "memory exhaustion".
8661 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
8662
8663 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
8664
8665 Add i18n support to the GLR skeleton. Partially fix the C++
8666 skeleton; a C++ expert needs to finish this. Remove debugging
8667 msgids; there's little point to having them translated, since they
8668 can be understood only by someone who can read the
8669 (English-language) source code.
8670
8671 Generate runtime-po/bison-runtime.pot automatically, so that we
8672 don't have to worry about garbage getting in that file. We'll
8673 make sure after the next official release that old msgids don't
8674 get lost. See
8675 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
8676
8677 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
8678 Now auto-generated.
8679 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
8680 Fix typos in explanations of the runtime file.
8681 * bootstrap: Change gettext keyword from YYI18N to YY_.
8682 Use standard Makefile.in.in in runtime-po, since we'll arrange
8683 for backward-compatible bison-runtime.po files in a different way.
8684 * data/glr.c (YY_): New macro, from yacc.c.
8685 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
8686 Translate messages intended for users.
8687 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
8688 the wording in the other skeletons. We don't know that the memory
8689 is virtual.
8690 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
8691 Use same method that yacc.c uses.
8692 Don't translate debugging messages.
8693 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
8694 it doesn't work (yet), and requires C++ expertise to fix.
8695 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
8696 Move defn to a more logical place, to be consistent with other
8697 skeletons.
8698 Don't translate debugging messages.
8699 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
8700 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
8701 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
8702 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
8703
8704 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
8705 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
8706 void, not int.
8707 * tests/glr-regression.at (Badly Collapsed GLR States):
8708 Likewise.
8709 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8710 yylex should return 0 at EOF rather than aborting.
8711
8712 Improve tests for stack overflow in GLR parser.
8713 Problem reported by twlevo@xs4all.nl.
8714 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
8715 All uses removed.
8716 (yyStackOverflow): Just longjmp, but with value 2 so that caller
8717 can handle the problem.
8718 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
8719 (yyparse): New local variable yyresult to record the result.
8720 Use result of setjmp to set it, rather than storing itinto
8721 struct.
8722 (yyDone): Remove label.
8723 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
8724 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
8725 if YYABORT is used).
8726 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
8727 yyparse status; put status > 1 into diagnostic.
8728 Check that status==2 works.
8729 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
8730 Use exit status 3 for failure to open (which shouldn't happen).
8731
87322005-07-17 Paul Eggert <eggert@cs.ucla.edu>
8733
8734 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
8735 1 on syntax error; just let yyparse do its thing.
8736 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
8737 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
8738 (Exploding the Stack Size with Alloca):
8739 (Exploding the Stack Size with Malloc):
8740 Expect exit status 2, not 1, since the parser is supposed to blow
8741 its stack. Problem reported by twlevo@xs4all.nl.
8742
8743 * data/glr.c (yyparse): Don't assume that the initial calls
8744 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
8745 Print a stack-overflow message and fail instead.
8746 Initialize the line-number information before creating the stack,
8747 so that the stack-overflow message can report line zero safely.
8748
87492005-07-14 Paul Eggert <eggert@cs.ucla.edu>
8750
8751 Fix problems reported by twlevo@xs4all.nl.
8752 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
8753 (yyuserMerge): Provide a default case if b4_mergers is empty.
8754 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
8755 * tests/glr-regression.at
8756 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
8757 Add casts to pacify C++ compilers.
8758 * tests/glr-regression.at (Improper merging of GLR delayed action
8759 sets): Declare yylex before using it.
8760 * tests/Makefile.am (maintainer-check-g++): Fix a stray
8761 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
8762 test for valgrind; valgrind is independent of g++.
8763 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
8764 for compatibility with POSIX 1003.1-2001 (if running coreutils).
8765 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
8766 Use a destructor, so that we can expand the stack. Change
8767 YYSTYPE to char * so that we can free it. Cast result of malloc.
8768
87692005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8770
8771 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
8772 a valgrind failure. Problem reported by twlevo@xs4all.nl.
8773
87742005-07-13 Paul Eggert <eggert@cs.ucla.edu>
8775
8776 * PACKAGING: New file, suggested by Bruno Haible and taken from
8777 similar wording in gettext's PACKAGING file.
8778 * NEWS: Mention PACKAGING.
8779 * Makefile.am (EXTRA_DIST): Add PACKAGING.
8780
87812005-07-12 Paul Eggert <eggert@cs.ucla.edu>
8782
8783 * NEWS: Document recent i18n improvements.
8784 * bootstrap: Get runtime translations into runtime-po.
8785 Create runtime-po files automatically, if possible.
8786 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
8787 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
8788 does not infringe on the user's name space.
8789 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
8790 * doc/bison.texinfo (Internationalization): Revamp the English
8791 and Texinfo syntax a bit, to try to make it clearer.
8792 (Bison Options, Option Cross Key): Mention --print-localedir.
8793 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
8794 YYENABLE_NLS. Quote a bit more.
8795 * runtime-po/.cvsignore: New file.
8796 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
8797 * runtime-po/Rules-quot: Remove; now created by bootstrap.
8798 * runtime-po/quot.sed: Likewise.
8799 * runtime-po/boldquot.sed: Likewise.
8800 * runtime-po/en@quot.header: Likewise.
8801 * runtime-po/en@boldquot.header: Likewise.
8802 * runtime-po/insert-header.sin: Likewise.
8803 * runtime-po/remove-potcdate.sin: Likewise.
8804 * runtime-po/Makevars: Likewise.
8805 * runtime-po/LINGUAS: Likewise.
8806 * runtime-po/de.po: Likewise; we will rely on the translation project
8807 to maintain this, so "bootstrap" should get it.
8808 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
8809 its value.
8810 * src/main.c (main): Bind the bison-runtime domain, too.
8811
88122005-07-12 Bruno Haible <bruno@clisp.org>
8813
8814 * data/yacc.c: Include <libintl.h> when NLS is enabled.
8815 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
8816 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
8817 * runtime-po: New directory.
8818 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
8819 $(DOMAIN).pot-update rule, so that old messages are never dropped.
8820 * runtime-po/Rules-quot: New file, copied from po/.
8821 * runtime-po/quot.sed: Likewise.
8822 * runtime-po/boldquot.sed: Likewise.
8823 * runtime-po/en@quot.header: Likewise.
8824 * runtime-po/en@boldquot.header: Likewise.
8825 * runtime-po/insert-header.sin: Likewise.
8826 * runtime-po/remove-potcdate.sin: Likewise.
8827 * runtime-po/Makevars: New file.
8828 * runtime-po/POTFILES.in: New file.
8829 * runtime-po/LINGUAS: New file.
8830 * runtime-po/bison-runtime.pot: New file.
8831 * runtime-po/de.po: New file.
8832 * m4/bison.m4: New file.
8833 * Makefile.am (SUBDIRS): Add runtime-po.
8834 (aclocaldir, aclocal_DATA): New variables.
8835 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
8836 Define aclocaldir.
8837 * src/getargs.c (usage): Document --print-localedir option.
8838 (PRINT_LOCALEDIR_OPTION): New enum item.
8839 (long_options): Add --print-localedir option.
8840 (getargs): Handle --print-localedir option.
8841 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
8842 (Internationalization): New section.
8843
88442005-07-12 Akim Demaille <akim@epita.fr>
8845
8846 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
8847 for consistency with the rest of the code.
8848 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
8849 Add separators.
8850
88512005-07-12 Akim Demaille <akim@epita.fr>
8852
8853 * src/parse-gram.y: Use %printer instead of YYPRINT.
8854
88552005-07-12 Akim Demaille <akim@epita.fr>
8856
8857 * src/symtab.h, src/symtab.c (symbol_print): New.
8858 * src/symlist.h, src/symlist.c (symbol_list_print): New.
8859 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
8860
88612005-07-12 Akim Demaille <akim@epita.fr>
8862
8863 * data/glr.c (b4_syncline): Fix (swap) the definitions of
8864 b4_at_dollar and b4_dollar_dollar.
8865
88662005-07-11 Paul Eggert <eggert@cs.ucla.edu>
8867
8868 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
8869 and Pennello's paper.
8870
88712005-07-09 Paul Eggert <eggert@cs.ucla.edu>
8872
8873 * data/yacc.c (yyparse): Undo previous patch. Instead,
8874 set yylsp[0] and yyvsp[0] only if the initial action
8875 sets yylloc and yylval, respectively.
8876
8877 * data/yacc.c (yyparse): In the initial action, set
8878 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
8879 This avoids the use of undefined variables if the initial
8880 action does not set yylloc and/or yylval.
8881
88822005-07-07 Paul Eggert <eggert@cs.ucla.edu>
8883
8884 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
8885 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
8886 Remove from CVS. These files are automatically generated.
8887 * examples/extexi: Clarify that this file is now part of Bison,
8888 not GNU M4, and that it works with any POSIX-compatible Awk.
8889 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
8890 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
8891 so that we also get calc++-parser.yy. Geneate it.
8892 Use $(AWK), not gawk, since any conforming Awk will do.
8893 Put comment before action, since older 'make' can't handle comment
8894 in action.
8895 $(BUILT_SOURCES): List all built sources, not just some of them.
8896 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
8897 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
8898 $($(calc_sources_generated)): Remove unnecessary test for existence
8899 of target. (This had a shell syntax error anyway; a stray "x".)
8900 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
8901 calc++-parser.yy.
8902 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
8903
8904 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
8905 implied by the other modules.
8906
89072005-07-06 Akim Demaille <akim@epita.fr>
8908
8909 Bind examples/calc++ to the package.
8910 * examples/calc++/Makefile: Remove, replaced by...
8911 * examples/calc++/Makefile.am: ... this new file.
8912 * examples/calc++/test: Remove input.
8913 * examples/calc++/compile: Remove.
8914 * examples/Makefile.am: New.
8915 * configure.ac, Makefile.am: Adjust.
8916 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
8917
89182005-07-05 Paul Eggert <eggert@cs.ucla.edu>
8919
8920 * data/glr.c (yyFail): Drastically simplify; since the format argument
8921 never had any % directives, we can simply pass it to yyerror.
8922 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
8923 be modified later, as that is the usual style in glr.c.
8924 Problems reported by Paul Hilfinger.
8925
8926 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
8927 and size overflow errors.
8928 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
8929 in case the user prolog sets feature-test macros like _GNU_SOURCE.
8930 (YYSIZEMAX): New macro.
8931 (yystpcpy): New function, taken from yacc.c.
8932 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
8933 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
8934 so that we don't have to maintain their signatures.
8935 (yyFail): Check for buffer overflow, by using vsnprintf rather
8936 than vsprintf. Allocate a bigger buffer if possible.
8937 Report an error if buffer allocation fails.
8938 (yyStackOverflow): New function.
8939 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
8940 the initialization was successful. It might fail if storage was
8941 exhausted.
8942 (yyexpandGLRStack): Add more checks for storage allocation failure.
8943 Use yyStackOverflow to report failures.
8944 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
8945 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
8946 Don't assume stack number fits in int.
8947 (yysplitStack): Check for storage allocation failure.
8948 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
8949 can print diagnostics on storage allocation failure. All callers
8950 changed.
8951 (yyresolveValue): Use yybool for boolean.
8952 (yyreportSyntaxError): Check for size-calculation overflow.
8953 This code is taken from yacc.c.
8954 (yyparse): Check for storage allocation errors when allocating
8955 the initial stack.
8956
89572005-07-05 Akim Demaille <akim@epita.fr>
8958
8959 Extract calc++ from the documentation.
8960 * doc/bison.texinfo (Calc++): Add the extraction marks.
8961 * examples/extexi: New, from the aborted GNU Programming 2E.
8962 Separate the different paragraph of a file with empty lines.
8963 * examples/Makefile: Use it to extract the whole calc++ example.
8964
89652005-06-24 Akim Demaille <akim@epita.fr>
8966
8967 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
8968 class typedefs.
8969
89702005-06-22 Akim Demaille <akim@epita.fr>
8971
8972 * doc/bison.texinfo (C++ Language Interface): First stab.
8973 (C++ Parsers): Remove.
8974
89752005-06-22 Akim Demaille <akim@epita.fr>
8976
8977 * data/lalr1.cc (yylex_): Honor %lex-param.
8978
89792005-06-22 Akim Demaille <akim@epita.fr>
8980
8981 Start a set of simple examples.
8982 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
8983 * examples/calc++/calc++-driver.hh,
8984 * examples/calc++/calc++-parser.yy,
8985 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
8986 * examples/calc++/compile, examples/calc++/test: New.
8987
89882005-06-09 Paul Eggert <eggert@cs.ucla.edu>
8989
8990 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
8991 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
8992 which stems from the 2005-05-27 patch.
8993
89942005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8995
8996 * data/glr.c: Modify treatment of unused parameters to permit use
8997 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
8998
89992005-05-30 Paul Eggert <eggert@cs.ucla.edu>
9000
9001 Fix infringement on user name space reported by Janos Zoltan Szabo.
9002 * data/yacc.c (yyparse): strlen -> yystrlen.
9003
90042005-05-30 Akim Demaille <akim@epita.fr>
9005
9006 * data/lalr1.cc (_): New.
9007 Translate the various messages.
9008
90092005-05-27 Paul Eggert <eggert@cs.ucla.edu>
9010
9011 Fix infringement on user name space reported by Bruno Haible.
9012 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
9013 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
9014 the user's name space.
9015 (alloca): Include <stdlib.h> to get it, if it's not built in.
9016 (YYMALLOC, YYFREE): Define only if needed.
9017 (malloc, free): Declare, but only if needed, as this infringes on
9018 the user name space.
9019
90202005-05-25 Paul Eggert <eggert@cs.ucla.edu>
9021
9022 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
9023 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
9024 with %d format.
9025 * lib/ebitset.c (min, max): Undef before defining.
9026 * lib/vbitset.c (min, max): Likewise.
9027 * lib/subpipe.c (create_subpipe): Save local variables in case
9028 vfork clobbers them.
9029
90302005-05-24 Bruno Haible <bruno@clisp.org>
9031
9032 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
9033 error message syntax used by gcc-4.0.
9034
90352005-05-23 Paul Eggert <eggert@cs.ucla.edu>
9036
9037 * README: Mention m4 1.4.3. Remove obsolete advice about
9038 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
9039
9040 * bootstrap: Remove workaround for problem I encountered with
9041 gettext 0.14.1; it seems to be fixed now.
9042
90432005-05-22 Paul Eggert <eggert@cs.ucla.edu>
9044
9045 * NEWS: Version 2.0a.
9046
9047 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
9048 the previous change.
9049
9050 Various maintainer cleanups.
9051 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
9052 conftest*, for benefit of CVS commands run at the same time as
9053 "configure". Add build-aux, since "bootstrap" now creates it and
9054 its subfiles.
9055 * Makefile.cfg (move_if_change): Remove.
9056 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
9057 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
9058 (po_repo, do-po-update, po-update, wget_files, get-targets):
9059 (config.guess-url_prefix, config.sub-url_prefix):
9060 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
9061 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
9062 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
9063 Remove.
9064 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
9065 this is now the recommended name.
9066 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
9067 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
9068 ylwrap. These files now go into build-aux.
9069 * config/move-if-change: Remove.
9070 * config/prev-version.txt: Bump from 1.75 to 2.0.
9071
9072 * bootstrap: Add stdio-safer, unistd-safer modules.
9073 Remove m4/glibc2.m4 (introduced by latest gnulib, but
9074 we don't need it).
9075 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
9076 fopen-safer.c, stdio-safer.h, unistd-safer.h.
9077 * lib/subpipe.c: Include "unistd-safer.h".
9078 (create_subpipe): Make sure all the newly-created
9079 file descriptors are > 2, so that diagnostics don't
9080 get sent down them (which might cause Bison to hang, in theory).
9081 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
9082 * src/files.c (xfopen): Use fopen_safer, not fopen.
9083
9084 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
9085 yesterday's yacc.c fix.
9086
90872005-05-21 Paul Eggert <eggert@cs.ucla.edu>
9088
9089 * data/glr.c, data/lalr1.cc: Update copyright date.
9090
9091 Fix a destructor bug reported by Wolfgang Spraul in
9092 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
9093 * data/yacc.c (yyabortlab): Don't call destructor, and
9094 don't set yychar to EMPTY.
9095 (yyoverflowlab): Don't call destructor.
9096 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
9097 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
9098 since we no longer output the message "discarding lookahead token
9099 end of input ()".
9100
91012005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9102
9103 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
9104 fix a small glitch in debugging output.
9105 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
9106 after YY_SYMBOL_PRINT where needed.
9107
9108 (struct yyGLRState): Add some comments.
9109 (struct yySemanticOption): Add some comments.
9110 (union yyGLRStackItem): Add comment.
9111
9112 (yymergeOptionSets): Correct this to properly perform the union,
9113 avoiding infinite reported by Michael Rosien.
9114 Update comment.
9115
9116 * tests/glr-regression.at: Add test for GLR merging error reported
9117 by M. Rosien.
9118
91192005-05-13 Paul Eggert <eggert@cs.ucla.edu>
9120
9121 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
9122 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
9123 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
9124 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
9125 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
9126 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
9127 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
9128 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
9129 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
9130 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
9131 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
9132 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
9133 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
9134 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
9135 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
9136 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
9137 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
9138 src/derives.h, src/files.c, src/files.h, src/getargs.c,
9139 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
9140 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
9141 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
9142 src/output.h, src/parse-gram.c, src/parse-gram.h,
9143 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
9144 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
9145 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
9146 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
9147 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
9148 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
9149 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
9150 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
9151 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
9152 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
9153 tests/reduce.at, tests/regression.at, tests/sets.at,
9154 tests/synclines.at, tests/testsuite.at, tests/torture.at:
9155 Update FSF postal mail address.
9156
91572005-05-11 Paul Eggert <eggert@cs.ucla.edu>
9158
9159 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
9160 Problem reported by Ralf Menzel.
9161
91622005-05-01 Paul Eggert <eggert@cs.ucla.edu>
9163
9164 * tests/actions.at: Test that stack overflow invokes destructors.
9165 From Marcus Holland-Moritz.
9166 * data/yacc.c (yyerrlab): Move the code that destroys the stack
9167 from here....
9168 (yyreturn): to here. That way, destructors are called properly
9169 even if the stack overflows, or the user calls YYACCEPT or
9170 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
9171 (yyoverflowlab): Destroy the lookahead.
9172
91732005-04-24 Paul Eggert <eggert@cs.ucla.edu>
9174
9175 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
9176
91772005-04-17 Paul Eggert <eggert@cs.ucla.edu>
9178
9179 * NEWS: Bison-generated C parsers no longer quote literal strings
9180 associated with tokens.
9181 * src/output.c (prepare_symbols): Don't escape strings,
9182 since users don't want to see C escapes.
9183 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
9184 in diagnostics.
9185 * tests/input.at (Torturing the Scanner): Likewise.
9186 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
9187
91882005-04-16 Paul Eggert <eggert@cs.ucla.edu>
9189
9190 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
9191 the data size is known to be too small and we can't increase it.
9192 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
9193
91942005-04-15 Paul Eggert <eggert@cs.ucla.edu>
9195
9196 * src/parse-gram.y: Include quotearg.h.
9197 (string_as_id): Quote $1 before using it as a key, since the
9198 lexer no longer quotes it for us.
9199 (string_content): Don't strip quotes, since lexer no longer
9200 quotes it for us.
9201 * src/scan-gram.l: Include quotearg.h.
9202 ("\""): Omit quote.
9203 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
9204 a key, since the rest of the lexer doesn't quote it.
9205 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
9206 * tests/regression.at (Token definitions): Check for backslashes
9207 in token strings.
9208
9209 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
9210 (YYSIZE_T): Define to unsigned long int when using an older compiler.
9211 (yyparse): Revamp code to generate long syntax error message, to
9212 make it easier to translate, and to avoid problems with arithmetic
9213 overflow. Change "virtual memory" to "memory" in diagnostic, since
9214 we don't know whether the memory is virtual.
9215
92162005-04-13 Paul Eggert <eggert@cs.ucla.edu>
9217
9218 * NEWS: Bison-generated C parsers now use the _ macro to
9219 translate strings.
9220 * data/yacc.c (_) [!defined _]: New macro.
9221 All English strings wrapped inside this macro.
9222 * doc/bison.texinfo (Bison Parser): Document _.
9223 * po/POTFILES.in: Include src/parse-gram.c, since it now
9224 includes translateable strings that parse-gram.y doesn't.
9225
92262005-04-12 Paul Eggert <eggert@cs.ucla.edu>
9227
9228 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
9229 reverting the 2004-10-11 change to this function.
9230 (symbol_check_alias_consistency): Don't call symbol_type_set
9231 if the type name is already correct.
9232 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
9233
92342005-03-25 Paul Eggert <eggert@cs.ucla.edu>
9235
9236 * tests/regression.at (Token definitions): Don't use a token named
9237 c, as that generates a "#define c ..." that runs afoul of buggy
9238 stdlib.h that uses the identifier c as a member of struct
9239 drand48_data. Problem reported by Horst Wente.
9240
92412005-03-21 Paul Eggert <eggert@cs.ucla.edu>
9242
9243 * bootstrap: Change translation URL from
9244 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
9245 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
9246 redirection glitches. Problem reported by twlevo@xs4all.nl.
9247
92482005-03-20 Paul Eggert <eggert@cs.ucla.edu>
9249
9250 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
9251 after operands; POSIX says this isn't portable for the c99 command.
9252
92532005-03-18 Paul Eggert <eggert@cs.ucla.edu>
9254
9255 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
9256 immediately if a data overrun has occurred; this may help us track
9257 down what may be a spurious failure on MacOS.
9258
92592005-03-17 Paul Eggert <eggert@cs.ucla.edu>
9260
9261 Respond to problems reported by twlevo@xs4all.nl.
9262
9263 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
9264
9265 * src/vcg.h: Comment fix.
9266 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
9267 (G_CMAX): Change to -1 instead of INT_MAX.
9268
9269 * data/yacc.c (yyparse): Omit spaces before #line.
9270
92712005-03-15 Paul Eggert <eggert@cs.ucla.edu>
9272
9273 * src/tables.c (state_number_to_vector_number): Put it inside an
9274 "#if 0", since it's not currently used. Problem reported by
9275 Roland McGrath.
9276
92772005-03-06 Paul Eggert <eggert@cs.ucla.edu>
9278
9279 * src/output.c (escaped_output): Renamed from
9280 escaped_file_name_output, since we now use it for symbol tags as
9281 well. All uses changed.
9282 (symbol_destructors_output, symbol_printers_output):
9283 Escape symbol tags too.
9284 Problem reported by Matyas Forstner in
9285 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
9286
9287 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
9288 not needed.
9289 * src/output.c (user_actions_output, token_definitions_output,
9290 symbol_destructors_output, symbol_printers_output): Likewise.
9291 * src/reader.c (prologue_augment): Likewise.
9292 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
9293
9294 * src/vcg.c (output_edge): Don't quote linestyle arg.
9295 Problem reported by twlevo@xs4all.nl.
9296
92972005-02-28 Paul Eggert <eggert@cs.ucla.edu>
9298
9299 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
9300 example, reported by Derek M Jones. Also, make the example even
9301 more outrageous, to better illustrate how bad the problem is.
9302
93032005-02-24 Paul Eggert <eggert@cs.ucla.edu>
9304
9305 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
9306 putsym. Typo reported by Sebastian Piping.
9307
93082005-02-23 Paul Eggert <eggert@cs.ucla.edu>
9309
9310 * doc/bison.texinfo (Language and Grammar): some -> same
9311 (Epilogue): int he -> in the
9312 Typos reported by Sebastian Piping via Justin Pence.
9313
93142005-02-07 Paul Eggert <eggert@cs.ucla.edu>
9315
9316 * tests/glr-regression.at (Improper handling of embedded actions
9317 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
9318 embedded actions and $-N in GLR parsers", work around an Autoconf bug
9319 with dollar signs in test names.
9320 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
9321 for a similar reason.
9322
93232005-01-28 Paul Eggert <eggert@cs.ucla.edu>
9324
9325 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
9326 wants to redefine G_VIEW.
9327
93282005-01-27 Paul Eggert <eggert@cs.ucla.edu>
9329
9330 * src/vcg.c (get_view_str): Remove case for normal_view.
9331 Problem reported by twlevo@xs4all.nl.
9332
93332005-01-24 Paul Eggert <eggert@cs.ucla.edu>
9334
9335 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
9336 Problem reported by twlevo@xs4all.nl.
9337
9338 * doc/bison.texinfo: Change @dircategory from "GNU programming
9339 tools" to "Software development". Requested by Richard Stallman
9340 via Karl Berry.
9341
93422005-01-23 Paul Eggert <eggert@cs.ucla.edu>
9343
9344 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
9345 Problem reported by twlevo@xs4all.nl.
9346
93472005-01-21 Paul Eggert <eggert@cs.ucla.edu>
9348
9349 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
9350 keyword; it's not needed with modern compilers, and it doesn't
9351 affect correctness with older compilers. Suggested by
9352 twlevo@xs4all.nl.
9353
93542005-01-17 Paul Eggert <eggert@cs.ucla.edu>
9355
9356 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
9357 gcc -Wswitch-default.
9358 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9359 * data/yacc.c (yyparse): Likewise.
9360
93612005-01-12 Paul Eggert <eggert@cs.ucla.edu>
9362
9363 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
9364 already. Let config.h define any nonstandard values.
9365
93662005-01-10 Paul Eggert <eggert@cs.ucla.edu>
9367
9368 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
9369 for the benefit of slower hosts. Problem reported by
9370 Nelson H. F. Beebe.
9371
93722005-01-07 Paul Eggert <eggert@cs.ucla.edu>
9373
9374 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
9375 being defined and not used.
9376 * data/lalr1.cc (yyparse): Likewise.
9377 Use "if (false)" rather than "if (0)".
9378
93792005-01-05 Paul Eggert <eggert@cs.ucla.edu>
9380
9381 * TODO: Mention that we should allow NUL bytes in tokens.
9382
93832005-01-02 Paul Eggert <eggert@cs.ucla.edu>
9384
9385 * src/scan-skel.l (<<EOF>>): Don't close standard output.
9386 Problem reported by Hans Aberg.
9387
93882005-01-01 Paul Eggert <eggert@cs.ucla.edu>
9389
9390 * src/getargs.c (version): Happy new year; update overall
9391 program copyright date from 2004 to 2005.
9392
9393 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
9394 Problem reported by Hans Aberg.
9395 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
9396 (Output file names.): Add a test for the case when standard output
9397 is closed.
9398
93992004-12-26 Paul Eggert <eggert@cs.ucla.edu>
9400
9401 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
9402 to fix an oversight in the Bison 2.0 manual.
9403
94042004-12-25 Paul Eggert <eggert@cs.ucla.edu>
9405
9406 * NEWS: Version 2.0. Reformat the existing news items since
9407 1.875, so that related items are grouped together.
9408 * configure.ac (AC_INIT): Bump version to 2.0.
9409 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
9410
9411 * tests/torture.at (Exploding the Stack Size with Alloca): Set
9412 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
9413 otherwise, we're not testing alloca. Unfortunately there's no
9414 simple way to consult HAVE_ALLOCA here.
9415
9416 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
9417 for yymsg, too.
9418
9419 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
9420 hand. This avoids a warning about comparing int to size_t when
9421 GCC warnings are enabled.
9422
94232004-12-22 Paul Eggert <eggert@cs.ucla.edu>
9424
9425 * NEWS: Bison-generated parsers no longer default to using the
9426 alloca function (when available) to extend the parser stack, due
9427 to widespread problems in unchecked stack-overflow detection.
9428 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
9429 responsibility to set it to a positive value. This lets the user
9430 specify a value that is not a preprocessor constant.
9431 * data/yacc.c (YYMAXDEPTH): Likewise.
9432 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
9433 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
9434 to be a compile-time constant. However, explain the constraints on it.
9435 Also, explain the constraints on YYINITDEPTH.
9436 (Table of Symbols): Explain that alloca is no longer the default.
9437 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
9438 to 1.
9439
9440 * doc/bison.texinfo (Location Default Action): Mention that n must
9441 be zero when k is zero. Suggested by Frank Heckenbach.
9442
94432004-12-22 Akim Demaille <akim@epita.fr>
9444
9445 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
9446 (parser::state_type, parser::semantic_type, parser::location_type):
9447 Private, not public.
9448 (parser::parse): Return ints, not bool.
9449 Returning a bool introduces a problem: 0 corresponds to false, and
9450 it seems weird to return false on success. Returning true changes
9451 the conventions for yyparse.
9452 Alternatively we could return void and send an exception.
9453 There is no clear consensus (yet?).
9454 (state_stack, semantic_stack, location_stack): Rename as...
9455 (state_stack_type, semantic_stack_type, location_stack_type): these.
9456 Private, not public.
9457 * tests/c++.at: New.
9458 * tests/testsuite.at, tests/Makefile.am: Adjust.
9459
94602004-12-21 Akim Demaille <akim@epita.fr>
9461
9462 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
9463
94642004-12-21 Akim Demaille <akim@epita.fr>
9465
9466 Don't impose std::string for filenames.
9467
9468 * data/lalr1.cc (b4_filename_type): New.
9469 (position::filename): Use it.
9470 (parser.hh): Move the inclusion of stack.hh and location.hh below
9471 the user code, so that needed headers for the filename type can be
9472 included first.
9473 Forward declare them before the user code.
9474 * tests/Makefile.am (check-local, installcheck-local): Pass
9475 TESTSUITEFLAGS to the TESTSUITE.
9476
94772004-12-20 Akim Demaille <akim@epita.fr>
9478
9479 Use more STL like names: my_class instead of MyClass.
9480
9481 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
9482 (SemanticStack, SemanticType, StateStack, StateType)
9483 (TokenNumberType, Stack, Slice, Traits, Parser::location)
9484 (Parser::value): Rename as...
9485 (location_stack, location_type, rhs_number_type, semantic_stack)
9486 (semantic_type, state_stack, state_type, token_number_type, stack)
9487 (slice, traits, parser::yylloc, parser::yylval): these.
9488
9489 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
9490
94912004-12-19 Paul Eggert <eggert@cs.ucla.edu>
9492
9493 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
9494 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9495
94962004-12-17 Paul Eggert <eggert@cs.ucla.edu>
9497
9498 Remove uses of 'short int' and 'unsigned short int'. This raises
9499 some arbitrary limits. It uses more memory but nowadays that's
9500 not much of an issue.
9501
9502 This change does not affect the generated parsers; that's a different
9503 task, as some users will want to conserve memory there.
9504
9505 Ideally we should use size_t to represent all object counts, and
9506 something like ptrdiff_t to represent signed differences of object
9507 counts; but that will require more code-cleanup than I have the
9508 time to do right now.
9509
9510 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
9511 Use size_t, not int or short int, to count objects.
9512 * src/closure.c (nritemset, closure): Likewise.
9513 * src/closure.h (nritemset, closure): Likewise.
9514 * src/nullable.c (nullable_compute): Likewise.
9515 * src/print.c (print_core): Likewise.
9516 * src/print_graph.c (print_core): Likewise.
9517 * src/state.c (state_compare, state_hash): Likewise.
9518 * src/state.h (struct state): Likewise.
9519 * src/tables.c (default_goto, goto_actions): Likewise.
9520
9521 * src/gram.h (rule_number, rule): Use int, not short int.
9522 * src/output.c (prepare_rules): Likewise.
9523 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
9524 errs, reductions): Likewise.
9525 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
9526 Likewise.
9527 * src/tables.c (vector_number, tally, action_number,
9528 ACTION_NUMBER_MINIMUM): Likewise.
9529 * src/output.c (muscle_insert_short_int_table): Remove.
9530
95312004-12-17 Akim Demaille <akim@epita.fr>
9532
9533 * data/lalr1.cc: Extensive Doxygenation.
9534 (error_): Rename as...
9535 (error): this, since it is visible to the user.
9536 Adjust callers.
9537 (Parser::message): Now an automatic variable from...
9538 (Parser::yyreport_syntax_error_): here.
9539 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
9540 Parser::error.
9541 * tests/input.at: Escape $.
9542
95432004-12-16 Paul Eggert <eggert@cs.ucla.edu>
9544
9545 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
9546 Parenthesize rhs to avoid obscure problems with mistakes like
9547 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
9548 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9549 b4_rhs_location): Likewise.
9550 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9551 b4_rhs_location): Likewise.
9552
95532004-12-16 Akim Demaille <akim@epita.fr>
9554
9555 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
9556 yacc.c: be sure to stay within yycheck_.
9557 * tests/actions.at: Re-enable C++ tests.
9558
95592004-12-16 Akim Demaille <akim@epita.fr>
9560
9561 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
9562 real.
9563
95642004-12-16 Akim Demaille <akim@epita.fr>
9565
9566 Use #define to handle the %name-prefix.
9567
9568 * data/glr.c, data/yacc.c: Comment changes.
9569 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
9570 so that one can refer to yylex in the parser file, and have it
9571 renamed, as is the case with other skeletons.
9572
95732004-12-16 Akim Demaille <akim@epita.fr>
9574
9575 Move lalr1.cc internals into yy*.
9576
9577 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
9578 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
9579 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
9580 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
9581 (empty_, final_, terror_, errcode_, ntokens_)
9582 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
9583 (looka_, ilooka_, error_range_, nerrs_):
9584 Rename as...
9585 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
9586 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
9587 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
9588 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
9589 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
9590 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
9591 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
9592 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
9593 these.
9594
95952004-12-15 Paul Eggert <eggert@cs.ucla.edu>
9596
9597 Fix some problems reported by twlevo at xs4all.
9598 * src/symtab.c (symbol_new): Report an error if the input grammar
9599 contains too many symbols. This is better than calling abort() later.
9600 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
9601 (struct node, struct graph):
9602 Rename member expand to stretch. All uses changed.
9603 (struct graph): Remove member layoutalgorithm. All uses removed.
9604 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
9605 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
9606 All uses changed.
9607 (N_STRETCH): Rename from N_EXPAND. All uses changed.
9608
96092004-12-15 Akim Demaille <akim@epita.fr>
9610
9611 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
9612 Add more Doxygen comments.
9613 (symprint_, stack_print_, reduce_print_, destruct_, pop)
9614 (report_syntax_error_, translate_): Rename as...
9615 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
9616 (yypop_, yyreport_syntax_error_, yytranslate_): this.
9617
96182004-12-15 Akim Demaille <akim@epita.fr>
9619
9620 * data/lalr1.cc (lex_): Rename as...
9621 (yylex_): this.
9622 Move the trace here.
9623 Take the %name-prefix into account.
9624 Reported by Alexandre Duret-Lutz.
9625
96262004-12-15 Akim Demaille <akim@epita.fr>
9627
9628 Simplify the C++ parser constructor.
9629
9630 * data/lalr1.cc (debug_): Rename as...
9631 (yydebug_): so that the parser's internals are always in the yy*
9632 pseudo namespace.
9633 Adjust uses.
9634 (b4_parse_param_decl): Remove the leading comma as it is now only
9635 called as unique argument list.
9636 (Parser::Parser): Remove the constructor accepting a location and
9637 an initial debugging level.
9638 Remove from the other ctor the argument for the debugging level.
9639 (debug_level_type, debug_level, set_debug_level): New.
9640
9641 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
9642 constructor calls.
9643
96442004-12-15 Akim Demaille <akim@epita.fr>
9645
9646 Remove b4_root related material: failure experiment
9647 (which goal was to allow to derive from a class).
9648
9649 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
9650 definitions and uses.
9651
96522004-12-14 Paul Eggert <eggert@cs.ucla.edu>
9653
9654 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
9655 not 2, since it's not portable to subtract 1 from the start of an
9656 array. The new item 0 is never set or used. All uses changed.
9657
9658 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
9659 the default definition of YYLLOC_DEFAULT. Problem reported
9660 by Frank Heckenbach.
9661
96622004-12-12 Paul Eggert <eggert@cs.ucla.edu>
9663
9664 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
9665 the normal case and one for the error case. Just use the
9666 first one uniformly. Problem reported by Frank Heckenbach.
9667 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
9668 use exactly the same macro in both places.
9669 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
9670 so that the normal-case YYRHSLOC works for the error case too.
9671 All uses changed.
9672 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
9673 (YYLLOC_DEFAULT): Use the same macro as glr.c.
9674 * doc/bison.texinfo (Location Default Action): Don't claim that
9675 we have an array of locations. Use the same macro for both glr
9676 and lalr parsers. Mention YYRHSLOC. Mention what happens when
9677 the index is 0.
9678
96792004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9680
9681 * HACKING: Update email addresses to send announcements to.
9682
9683 * configure.ac (AC_INIT): Bump version to 1.875f.
9684
96852004-12-10 Paul Eggert <eggert@cs.ucla.edu>
9686
9687 * NEWS: Version 1.875e.
9688 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
9689
9690 * src/scan-skel.l: Include "complain.h", for "fatal".
9691
9692 * src/relation.h (relation_print, relation_digraph):
9693 Relation sizes are of type relation_node, not size_t (this is
9694 merely a doc fix, since the two types are equivalent).
9695 (relation_transpose): Relation sizes are of type relation_node,
9696 not int.
9697 * src/relation.c: Likewise.
9698 (top, infinity): Now of type relation_node, not int.
9699 (traverse, relation_transpose): Use relation_node, not int.
9700
9701 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
9702 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
9703 (yyparse): Remove unused local introduced in 2004-10-25 patch.
9704
9705 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
9706 specifying whether the test should be skipped. Use it tp
9707 specify that the [%defines %skeleton "lalr1.cc"] tests currently
9708 fail on some hosts, and should be skipped.
9709
97102004-12-08 Paul Eggert <eggert@cs.ucla.edu>
9711
9712 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
9713 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
9714 unless otherwise specified below.
9715
9716 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
9717 to allocate kernel_base, kernel_items, kernel_size, since
9718 they needn't be initialized to 0.
9719 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
9720 * src/closure.c (new_closure): Likewise, for itemset.
9721 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
9722 * src/lalr.c (set_goto_map): Likewise, for temp_map.
9723 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
9724 (build_relations): Likewise for edge, states1, includes.
9725 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
9726 * src/reader.c (packgram): Likewise, for ritem, rules.
9727 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
9728 * src/relation.c (relation_digraph): Likewise for VERTICES.
9729 (relation_transpose): Likewise for new_R, end_R.
9730 * src/symtab.c (symbols_token_translations_init): Likewise for
9731 token_translations.
9732 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
9733 (token_actions): Likewise for yydefact, actrow, conflrow,
9734 conflict_list.
9735 (save_column): Likewise for froms[symno], tos[symno].
9736 (goto_actions): Likewise for state_count.
9737 (pack_table): Likewise for base, pos, check.
9738 (tables_generate): Likewise for width.
9739
9740 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
9741 for initial core. Just have a separate core, so we needn't worry
9742 about whether kernel_size and kernel_base are initialized.
9743
9744 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
9745 kernel_size, kernel_items): Remove unnecessary initialization.
9746 * src/conflicts.c (conflicts): Likewise.
9747 * src/derives.c (derives): Likewise.
9748 * src/muscle_tablc (muscle_insert): Likewise.
9749 * src/relation.c (relation_digraph): Likewise.
9750 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
9751 conflrow, conflict_table, conflict_list, table, check):
9752 Likewise.
9753
9754 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
9755 This is because all callers pass unsigned int.
9756 * src/closure.h (new_closure): Likewise.
9757
9758 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
9759 (build_relations): Initialize includes[i] in all cases.
9760 * src/reader.c (packgram): Always initialize rules[ruleno].prec
9761 and rules[ruleno].precsym. Initialize members in order.
9762 * src/relation.c (relation_transpose): Always initialize new_R[i]
9763 and end_R[i].
9764 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
9765
9766 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
9767 conflict_list[0] was always 0, but now it isn't initialized.
9768
9769 * src/table.c (table_grow): When conflict_table grew, the grown
9770 area wasn't cleared. Fix this.
9771
9772 * lib/.cvsignore: Add strdup.c, strdup.h.
9773 * m4/.cvsignore: Add strdup.m4.
9774
97752004-12-07 Paul Eggert <eggert@cs.ucla.edu>
9776
9777 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
9778 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
9779 GOTO_NUMBER_MAXIMUM, since we occasionally compute
9780 ngotos + 1 without checking for overflow.
9781 (build_relations): Use END_NODE, not -1, to denote end of edges.
9782 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
9783 build_relations): Use goto_number, not int, for goto numbers.
9784 * src/tables.c (save_column, default_goto): Likewise.
9785
97862004-11-23 Akim Demaille <akim@epita.fr>
9787
9788 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
9789 of #defining from yystype.
9790 Don't typedef yystype, C++ does not need it.
9791 This lets it possible to forward declare it as union.
9792
97932004-11-23 Paul Eggert <eggert@cs.ucla.edu>
9794
9795 * bootstrap (gnulib_modules): Add extensions.
9796 Problem reported by Jim Meyering.
9797
97982004-11-22 Paul Eggert <eggert@cs.ucla.edu>
9799
9800 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
9801 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
9802 src/system.h, src/tables.c: XFREE -> free, to accommodate
9803 recent change to gnulib xalloc.h.
9804 Problem reported by Jim Meyering.
9805
98062004-11-17 Akim Demaille <akim@epita.fr>
9807
9808 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
9809
98102004-11-17 Akim Demaille <akim@epita.fr>,
9811 Alexandre Duret-Lutz <adl@gnu.org>
9812
9813 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
9814 changes.
9815 (YYCDEBUG): Adjust.
9816 Use it instead of cdebug_.
9817 (Parser::debug_stream, Parser::set_debug_stream): New.
9818 (Parser::symprint_): Define cdebug_ for temporary backward
9819 compatibility.
9820 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
9821 debug_stream ().
9822
98232004-11-17 Akim Demaille <akim@epita.fr>
9824
9825 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
9826 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
9827 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
9828 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9829
98302004-10-27 Paul Eggert <eggert@cs.ucla.edu>
9831
9832 * data/glr.c (yyloc_default): Remove; not used.
9833 Problem reported by Frank Heckenbach.
9834
98352004-10-25 Akim Demaille <akim@epita.fr>
9836
9837 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
9838 Introduce another definition to address simple location arrays.
9839 (yyGLRStack): New member: yyerror_range.
9840 (yyrecoverSyntaxError, yyparse): Update it.
9841 (yyrecoverSyntaxError): Use it when shifting the error token to
9842 have an accurate range, equivalent to the one computed by both
9843 yacc.c and lalr1.cc.
9844 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
9845 that column numbers start at column 0, as per GNU Coding
9846 Standards, the others tests, and the doc.
9847 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
9848 Adjust to the above change (first column is 0).
9849 And adjust the location of the "<error>", now covering the whole
9850 line.
9851
98522004-10-22 Akim Demaille <akim@epita.fr>
9853 and Paul Eggert <eggert@cs.ucla.edu>
9854
9855 Remove some arbitrary limits on goto numbers and relations.
9856 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
9857 initial values, since they're never used.
9858 (set_goto_map): ngotos is now unsigned, so test for overflow
9859 by seeing whether it wraps around to zero.
9860 * src/lalr.h (goto_number): Now size_t, not short int.
9861 (GOTO_NUMBER_MAXIMUM): Remove.
9862 * src/relation.c (relation_print, traverse, relation_transpose):
9863 Check for END_NODE rather than looking at sign.
9864 * src/relation.h (END_NODE): New macro.
9865 (relation_node): Now size_t, not short int.
9866
98672004-10-22 Paul Eggert <eggert@cs.ucla.edu>
9868
9869 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
9870 keyword, not an identifier. Problem reported by Baron Schwartz in
9871 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
9872
98732004-10-11 Akim Demaille <akim@epita.fr>
9874
9875 * src/symtab.c (symbol_check_alias_consistency): Also check
9876 type names, destructors, and printers.
9877 Reported by Alexandre Duret-Lutz.
9878 Recode the handling of associativity and precedence in terms
9879 of symbol_precedence_set.
9880 Accept no redeclaration at all, not even equal to the previous
9881 value.
9882 (redeclaration): New.
9883 Use it to factor redeclaration complaints.
9884 (symbol_make_alias): Don't set the type of the alias, let
9885 symbol_check_alias_consistency do it as for other features.
9886 * src/symtab.h (symbol): Add new member prec_location, and
9887 type_location.
9888 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
9889 * tests/input.at (Incompatible Aliases): New.
9890
98912004-10-09 Paul Eggert <eggert@cs.ucla.edu>
9892
9893 .cvsignore fixes to accommodate gnulib changes,
9894 and the practice of naming build directories "_build".
9895 * .cvsignore: Add "_*". Sort.
9896 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
9897 * m4/.cvsignore: Add "*_gl.m4".
9898
98992004-10-06 Akim Demaille <akim@epita.fr>
9900
9901 * src/parse-gram.y (add_param): Fix the truncation of trailing
9902 spaces.
9903
99042004-10-05 Akim Demaille <akim@epita.fr>
9905
9906 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
9907 whether the reducion was empty or not. This leaves room to
9908 improve the use of YYLLOC_DEFAULT in such a case.
9909 lalr1.cc is still experimental, so changing this is acceptable.
9910 And finally, there are probably not many users who changed the
9911 handling of locations in GLR, so changing is admissible too.
9912
9913 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
9914 empty reduction, set @$ to an empty location ending the previously
9915 stacked symbol.
9916 Adjust uses to make sure the code is triggered on empty
9917 reductions.
9918 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
9919 expected output: empty reductions have empty locations.
9920
99212004-09-29 Akim Demaille <akim@epita.fr>
9922
9923 * data/lalr1.cc: Move towards a more standard C++ coding style
9924 for templates: Class < T > -> Class<T>.
9925
99262004-09-29 Akim Demaille <akim@epita.fr>
9927
9928 * data/lalr1.cc: Reinstall the former ctor, for sake of
9929 compatibility, but warn it will be removed.
9930 Move towards a more standard C++ coding style (i.e., type *var ->
9931 type* var).
9932
99332004-09-27 Paul Eggert <eggert@cs.ucla.edu>
9934
9935 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
9936 since it's less likely to work if NULs are involved in the future.
9937
99382004-09-27 Akim Demaille <akim@epita.fr>
9939
9940 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
9941
99422004-09-27 Akim Demaille <akim@epita.fr>
9943
9944 * data/lalr1.cc (b4_parse_param_decl_1): New.
9945 (b4_parse_param_decl): Use it to have different names between attribute
9946 and argument names.
9947 (b4_cc_constructor_call): Likewise.
9948
99492004-09-24 Akim Demaille <akim@epita.fr>
9950
9951 * src/parse-gram.y (add_param): Strip the leading and trailing
9952 blanks from a formal argument declaration.
9953 (YY_LOCATION_PRINT): New.
9954
99552004-09-24 Akim Demaille <akim@epita.fr>
9956
9957 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
9958 after the location.
9959
99602004-09-24 Akim Demaille <akim@epita.fr>
9961
9962 * doc/bison.texinfo (Table of Symbols): Sort.
9963
99642004-09-21 Akim Demaille <akim@epita.fr>
9965
9966 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
9967 the useless parentheses.
9968 Suggested by Paul Eggert.
9969
99702004-09-20 Akim Demaille <akim@epita.fr>
9971
9972 Let the initial-action act on the look-ahead, and use it for the
9973 "initial push" (corresponding to an hypothetical beginning-of-file).
9974 And let lalr1.cc honor %initial-action.
9975
9976 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
9977 example.
9978 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
9979 (Parser::Parser): Remove the ctor that used to initialize it.
9980 (Parser::parse): Like in the other skeletons, issue the "starting
9981 parse" message before any action.
9982 Honor %initial-action.
9983 Initialize the stacks with the lookahead.
9984 * data/yacc.c: Let $$ and @$ in %initial-action designate the
9985 look-ahead.
9986 Push them in the stacks.
9987 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
9988
99892004-09-20 Akim Demaille <akim@epita.fr>
9990
9991 * doc/bison.texinfo (Initial Action Decl): New.
9992
99932004-09-20 Akim Demaille <akim@epita.fr>
9994
9995 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
9996 clearer criterion to define it.
9997 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
9998 When reducing on an empty RHS, use the latest stacked location as
9999 location.
10000 yylloc is not always available.
10001 * data/glr.c: Likewise.
10002 Also, honor initial-actions.
10003
100042004-09-20 Akim Demaille <akim@epita.fr>
10005
10006 * data/yacc.c (YY_LOCATION_PRINT): New.
10007 Define when we know YYLTYPE's structure, i.e., when the default
10008 YYLLOC_DEFAULT is used.
10009 * data/c.m4 (b4_yysymprint_generate): Use it.
10010 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
10011 value of the result.
10012 (error_start_): Replace with...
10013 (error_range_): this location array.
10014 This allows to replace code relying on the implementation of
10015 locations by portable code.
10016 * data/yacc.c (yylerrsp): Replace with...
10017 (yyerror_range): this.
10018 Every time a token is popped, update yyerror_range[0], to have an
10019 accurate location for the error token.
10020 * data/glr.c (YY_LOCATION_PRINT): New.
10021 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
10022 deference a pointer.
10023 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
10024 report the location in %printers.
10025
10026 * src/scan-skel.l: Instead of abort, report error messages to ease
10027 understanding skeleton scanning failures.
10028
100292004-09-16 Akim Demaille <akim@epita.fr>
10030
10031 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
10032 (iterator, const_iterator): these, to be more in the C++ spirit.
10033 Also, return reverse iterators so that when displaying the stack
10034 we display its bottom first.
10035 (Parser::stack_print_, Parser::reduce_print_): Match the messages
10036 from yacc.c.
10037 We should probably use vector here though.
10038
100392004-09-16 Akim Demaille <akim@epita.fr>
10040
10041 Have more complete shift traces.
10042
10043 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
10044 to report Shifts instead of ad hoc YYDPRINTF invocations,
10045 including for the error token.
10046 * data/lalr1.cc (symprint_): Output the location.
10047 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
10048 output the location within the %printer.
10049 Activate GLR tests, at least to make sure they compile properly.
10050 They still don't pass though.
10051 * tests/calc.at: Adjust expect verbose output, since now "Entering
10052 state..." is on a different line than the "Shifting" message.
10053
100542004-09-08 Akim Demaille <akim@epita.fr>
10055
10056 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
10057 Bison directive from the Bison file to the invocation of this
10058 macro, so that these directives are passed to
10059 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
10060 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
10061 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
10062 the extra Bison directives instead of the whole series.
10063 Change the grammar so that there are recoverable errors, and
10064 unrecoverable errors. Now we can have the parser give up before
10065 consuming the whole input. As a result we now can observe that
10066 the lookahead is freed when needed.
10067 Change the parser source to parse argv[1] instead of a hard coded
10068 string.
10069 Simplify yylex, and give a value and location to EOF.
10070 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
10071 passed directives already coded in the file.
10072 Add some tests to check the location of "error".
10073 For some tests, the C++ parser is correct, and not yacc.c.
10074 For other tests, they provide different, but unsatisfying, values,
10075 so keep the C++ value so that at least one parser is "correct"
10076 according to the test suite.
10077 (Actions after errors): Remove, this is subsumed by the
10078 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
10079
100802004-09-06 Akim Demaille <akim@epita.fr>
10081
10082 * data/lalr1.cc: Adjust the indentation of the labels.
10083 (Parser::pop): New.
10084 Use it.
10085
100862004-09-06 Akim Demaille <akim@epita.fr>
10087
10088 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
10089 argument, an informative message.
10090 Call YY_SYMBOL_PRINT.
10091 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
10092 * data/lalr1.cc (destruct_): Likewise.
10093 In addition, no longer depend on b4_yysymprint_generate and
10094 b4_yydestruct_generate to generate these functions, do it "by
10095 hand".
10096
100972004-09-03 Akim Demaille <akim@epita.fr>
10098
10099 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
10100 invoked, yydestruct the lookahead.
10101 * tests/calc.at (Calculator $1): Update the expected lengths of
10102 traces: there is an added line for the discarded lookahead.
10103 * doc/bison.texinfo (Destructor Decl): Some rewording.
10104 Define "discarded" symbols.
10105
101062004-09-02 Akim Demaille <akim@epita.fr>
10107
10108 * data/lalr1.cc (translate_, destruct_): No reason to be static.
10109
101102004-09-02 Akim Demaille <akim@epita.fr>
10111
10112 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
10113 (YYDSYMPRINTF): Rename as...
10114 (YY_SYMBOL_PRINT): this.
10115 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
10116 two.
10117 Use it instead of direct symprint_ calls.
10118 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
10119 one.
10120
101212004-09-02 Akim Demaille <akim@epita.fr>
10122
10123 * data/lalr1.cc (b4_yysymprint_generate): New.
10124 (symprint_): New member function, defined when YYDEBUG.
10125 Use it consistently instead of token/nterm debugging output by
10126 hand.
10127 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
10128 %printer calls to use cdebug_ when using lalr1.cc.
10129
101302004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
10131
10132 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
10133 with #ifdef YYDEBUG.
10134
101352004-08-26 Akim Demaille <akim@epita.fr>
10136
10137 * doc/bison.texinfo (Implementing Loops): Rename as...
10138 (Implementing Gotos/Loops): this.
10139
101402004-08-13 Paul Eggert <eggert@cs.ucla.edu>
10141
10142 Adjust to latest gnulib.
10143 * bootstrap (gnulib_modules): Add xalloc-die.
10144 Set LC_ALL=C so that file names sort consistently.
10145 Prefer the gnulib copies of gettext.m4, glibc21.m4,
10146 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
10147 uintmax_t.m4, ulonglong.m4.
10148 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
10149 po.m4 since we are now using _gl.m4 instead.
10150
101512004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
10152
10153 * src/scan-action.l: Remove. Scanning of semantic actions is
10154 handled in scan-gram.l.
10155
101562004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
10157
10158 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
10159
10160 * src/location.h (struct): The file member is a uniqstr.
10161 (equal_boundaries): Use UNIQSTR_EQ for comparison.
10162
101632004-07-22 Paul Eggert <eggert@cs.ucla.edu>
10164
10165 Fix bug with non-%union parsers that have printers or destructors,
10166 which led to a Bison core dump. Reported by Peter Fales in
10167 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
10168
10169 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
10170 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
10171 not to our own type.
10172 * src/output.c (symbol_destructors_output, symbol_printers_output):
10173 Don't assume %union.
10174 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
10175 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
10176 UNION-FLAG. All callers changed.
10177 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
10178 Use type char, not unsigned int, when declaring an array of char;
10179 this lets us remove a cast.
10180 (Printers and Destructors): Add non-%union test cases.
10181
101822004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10183
10184 * doc/bison.texinfo: Minor editorial changes, mostly to the new
10185 GLR writeups. E.g., avoid frenchspacing and the future tense,
10186 change "lookahead" to "look-ahead", and change "wrt" to "with
10187 respect to".
10188
101892004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10190
10191 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
10192 New sections, split off from the GLR Parsers section. Put the new
10193 Simple GLR Parser near the start of the GLR section, for clarity.
10194 Rewrite connective text.
10195
101962004-06-21 Frank Heckenbach <frank@g-n-u.de>
10197
10198 * doc/bison.texinfo (Simple GLR Parsers): New section.
10199
102002004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10201
10202 * NEWS, TODO, doc/bison.texinfo:
10203 Use "look-ahead" instead of "lookahead", to be consistent.
10204 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
10205 while we're fixing "look-ahead".
10206 * src/conflicts.c (shift_set): Renamed from shiftset.
10207 (look_ahead_set): Renamed from lookaheadset.
10208 * src/print.c: Likewise.
10209 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
10210 name for "lookahead".
10211 (report_types, usage): Likewise.
10212 * src/getargs.h (report_look_ahead_tokens): Renamed from
10213 report_lookaheads.
10214 * src/lalr.c (compute_look_ahead_tokens): Renamed from
10215 compute_lookaheads.
10216 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
10217 (look_ahead_tokens_print): Renamed from lookaheads_print.
10218 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
10219 state_rule_lookaheads_print.
10220 * src/state.h: Likewise.
10221 (reductions.look_ahead_tokens): Renamed from lookaheads.
10222 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
10223 AT_DATA_LOOKAHEADS_GRAMMAR.
10224
102252004-06-03 Paul Eggert <eggert@cs.ucla.edu>
10226
10227 * README: Update location of patched M4 distribution.
10228
102292004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
10230
10231 Don't assume the C++ compiler takes the same arguments as the C compiler
10232 (trivial change).
10233 * configure.ac (O0CXXFLAGS): New var.
10234 * tests/atlocal.in (CXXFLAGS): Use it.
10235
102362004-05-29 Paul Eggert <eggert@cs.ucla.edu>
10237
10238 Fix some "make check" problems with C++ reported by
10239 Albert Chin-A-Young for Tru64 C++ in this thread:
10240 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
10241
10242 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
10243 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10244 Output to a .cc file for C++, not to a .c file.
10245 * tests/calc.at (AT_CHECK_CALC): Likewise.
10246 * tests/regression.at (AT_CHECK_DANCER): Likewise.
10247 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
10248
102492004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
10250
10251 * tests/calc.at, tests/actions.at: Workaround for SGI
10252 C++ compiler. (trivial change)
10253
102542004-05-27 Paul Eggert <eggert@cs.ucla.edu>
10255
10256 Spent a few hours checking out which prerequisite versions the
10257 current sources actually require. I went all the way back to
10258 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
10259 a seemingly endless set of combinations of versions more recent
10260 than that. The bottom line is that the current sources require
10261 fairly recent versions of the build tools, and it'll be some work
10262 to change this.
10263 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
10264 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
10265 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
10266 Add comments explaining why those particular versions are
10267 currently needed.
10268
10269 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
10270 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
10271 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
10272
10273 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
10274 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
10275
102762004-05-26 Paul Eggert <eggert@cs.ucla.edu>
10277
10278 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
10279 0.11.5. Suggested by Bruno Haible.
10280 * bootstrap: Remove gettext version checking.
10281
10282 * doc/bison.texinfo (Decl Summary): Also mention that %union
10283 can depend on prerequisite types. Problem reported by Tim
10284 Van Holder.
10285
102862004-05-25 Paul Eggert <eggert@cs.ucla.edu>
10287
10288 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
10289 * README-alpha: Don't tell people not to package this.
10290
10291 * bootstrap: Don't assume $(...) works; use `...` instead.
10292 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
10293 gettext better.
10294
10295 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
10296 put into the -d output file, and mention what to do if YYSTYPE is
10297 defined as a macro.
10298
102992004-05-24 Paul Eggert <eggert@cs.ucla.edu>
10300
10301 Undo change made earlier today: it caused autopoint to not bring
10302 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
10303 autopoint's.
10304
10305 * bootstrap: Check that gettext version matches what's in
10306 configure.ac. Warn users to ignore robots.txt ERROR 404.
10307 * bootstrap: Undo today's earlier change (logged below).
10308 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
10309
10310 The gettext version checking is causing more trouble than it's
10311 curing; remove it. Problem reported by Paul Hilfinger.
10312
10313 * bootstrap: Issue a warning that one can expect a message
10314 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
10315 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
10316
103172004-05-23 Paul Eggert <eggert@cs.ucla.edu>
10318
10319 Ensure that the C++ compiler used for testing actually works on a
10320 simple test program; if not, skip the C++-related tests. Problem
10321 reported by Vin Shelton in:
10322 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
10323
10324 * m4/cxx.m4: New file.
10325 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
10326 * tests/atlocal.in (BISON_CXX_WORKS): Add.
10327 * tests/local.at (AT_COMPILE_CXX): Use it.
10328
103292004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10330
10331 * data/glr.c (yylloc): Output this macro even if locations are not
10332 being generated, as the GLR parser needs it even in that case.
10333 Problem reported by Troy A. Johnson
10334 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
10335
10336 * configure.ac (AC_INIT): Update to 1.875e.
10337
103382004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10339
10340 * NEWS: Version 1.875d.
10341 * configure.ac (AC_INIT): Likewise.
10342 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
10343
10344 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
10345 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
10346 lalr1.cc runs afoul of the first, and the last two are no longer
10347 supported by GCC 3.4.0.
10348 * README: Mention GNU m4 1.4 or later; mention m4 patches.
10349 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
10350
103512004-05-06 Paul Eggert <eggert@cs.ucla.edu>
10352
10353 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
10354 unsigned int, for compatibility with latest gnulib hash module.
10355 * src/state.c (state_hash, state_hasher): Likewise.
10356 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
10357 * src/uniqstr.c (hash_uniqstr): Likewise.
10358
103592004-05-03 Paul Eggert <eggert@cs.ucla.edu>
10360
10361 * NEWS: Unescaped newlines are no longer allowed in char & strings.
10362
10363 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
10364 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
10365 character and string literals.
10366 (unexpected_end): New function.
10367 (unexpected_eof): Use it.
10368 (unexpected_newline): New function.
10369 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
10370 actions.
10371
10372 * NEWS: Document %expect-rr.
10373
10374 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
10375 Fix typo by replacing $1 with $option.
10376 Remove more 'intl'-related files.
10377 Don't DEFUN AM_INTL_SUBDIR twice.
10378
10379 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
10380 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
10381 strtoul.c.
10382 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
10383 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
10384 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
10385 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
10386 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
10387 * src/.cvsignore: Add *.output.
10388
10389 * src/parse-gram.y: Put copyright notice inside %{ %} so it
10390 gets copied to the output file.
10391
103922004-04-28 Paul Eggert <eggert@twinsun.com>
10393
10394 Get files from the gnulib and po repositories, instead of relying
10395 on them being in our CVS. Upgrade to latest versions of gnulib
10396 and Automake.
10397
10398 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
10399 * bootstrap: Bootstrap from gnulib and po repositories.
10400 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
10401 * README-cvs: Document these changes. Remove version numbers from
10402 mentions of build tools, since they change so often. Mention Flex.
10403
10404 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
10405 (gl_USE_SYSTEM_EXTENSIONS): Add.
10406 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
10407 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
10408 does this for us.
10409 (AC_ISC_POSIX): Remove; we no longer support this
10410 ancient OS, as it gets in the way of latest Autoconf & gnulib.
10411 (AC_HEADER_STDC): Remove: we now assume C89 or better.
10412 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
10413 Do not check for C89 headers, except for locale.h which is used
10414 by the Yacc library and must port to K&R hosts.
10415 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
10416 Do not check for C89 functions, except for setlocale which is
10417 used by the Yacc library.
10418 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
10419 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
10420 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
10421 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
10422 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
10423 AM_GNU_GETTEXT): Remove; now done by:
10424 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
10425 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
10426 for us.
10427
10428 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
10429 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
10430 Define to empty, as gnulib.mk will do the rest for us.
10431 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
10432 for us.
10433 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
10434 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
10435
10436 * src/files.c: Include gnulib's xstrndup.h.
10437
10438 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
10439 (REALLOC): Use xnrealloc, for likewise.
10440 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
10441 (strnlen, memrchr): Remove decls; functions no longer used.
10442 Include <stpcpy.h>.
10443
10444 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
10445 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10446 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
10447 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
10448 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
10449 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
10450 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
10451 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
10452 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
10453 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
10454 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
10455 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
10456 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
10457 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
10458 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
10459 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
10460 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
10461 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
10462 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
10463 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
10464 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
10465 Remove, as these files are now generated automatically
10466 by bootstrap or automake.
10467
10468 * po/ChangeLog: Remove: all but one entry was a duplicate
10469 of this file, and I moved that 2000-11-02 entry here.
10470
10471 * config/.cvsignore: Add Makefile, depcomp, install-sh.
10472 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
10473 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
10474 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
10475 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
10476 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
10477 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
10478 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
10479 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
10480 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
10481 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
10482 xstrndup.h.
10483 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
10484 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
10485 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
10486 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
10487 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
10488 * src/.cvsignore: Remove *_.c.
10489
10490
10491 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
10492 support it. (The latest stable gzip doesn't.)
10493
104942004-04-27 Paul Eggert <eggert@twinsun.com>
10495
10496 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
10497 case, as stos_ is now used by destructors due to the 2004-02-09
10498 change.
10499
10500 Remove more K&R C support.
10501 * lib/libiberty.y (PARAMS): Remove. All uses removed.
10502 * lib/subpipe.c (errno): Remove decl.
10503 Include <stdlib.h> unconditionally.
10504 (EXIT_FAILURE): Remove macro.
10505 * src/complain.c (vfprintf, strerror): Remove.
10506 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
10507 unconditionally.
10508 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
10509 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
10510 (strchr, strspn, memchr): Remove decls.
10511 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
10512 unconditionally. Do not declare perror.
10513 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
10514 unconditionally.
10515
10516 * src/complain.c (_): Remove useless defn, as system.h defines this.
10517
10518 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
10519 with latest obstack.h.
10520 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
10521 to procedure types, as obstack.h now does that for us.
10522 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
10523
10524 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
10525 so that this include file can stand alone.
10526 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
10527 does this now. Include subpipe.h first after config.h, to
10528 test whether it can stand alone.
10529
10530 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
10531 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
10532 unused declaration.
10533
10534 * tests/synclines.at (%union synch line): Put a dummy member in
10535 the union, because empty unions aren't allowed in C. Caught
10536 by GCC 3.4.0.
10537
105382004-04-13 Jim Meyering <jim@meyering.net>
10539
10540 * src/conflicts.c (conflicts_print): Correct format string typo:
10541 use `%%' to produce literal `%'. (trivial change)
10542
105432004-03-30 Paul Eggert <eggert@twinsun.com>
10544
10545 * src/getargs.c (version): Update copyright year to 2004.
10546
10547 * data/c.m4 (b4_int_type): Use 'short int' rather than
10548 'short', and similarly for 'long', 'unsigned', etc.
10549 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
10550 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
10551 yy_yypstack, yydumpstack): Likewise.
10552 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
10553 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
10554 Likewise.
10555 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
10556 yy_stack_print, yyparse): Likewise.
10557 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
10558 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
10559 * lib/bitset.c (bitset_print): Likewise.
10560 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
10561 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10562 * lib/bitsetv.c (bitsetv_dump): Likewise.
10563 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
10564 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
10565 Likewise.
10566 * src/LR0.c (allocate_itemsets): Likewise.
10567 * src/gram.h (rule_number, rule): Likewise.
10568 * src/lalr.h (goto_number): Likewise.
10569 * src/nullable.c (nullable_compute): Likewise.
10570 * src/output.c (prepare_rules): Likewise.
10571 * src/relation.c (relation_print, relation_digraph): Likewise.
10572 * src/relation.h (relation_node): Likewise.
10573 * src/state.h (state_number, transitions, errs, reductions,
10574 struct state): Likewise.
10575 * src/symtab.h (symbol_number, struct symbol): Likewise.
10576 * src/tables.c (vector_number, tally, action_number,
10577 default_goto, goto_actions): Likewise.
10578 * tests/existing.at (GNU Cim Grammar): Likewise.
10579 * tests/regression.at (Web2c Actions): Likewise.
10580
10581 * src/output.c (muscle_insert_short_int_table): Renamed from
10582 muscle_insert_short_table. All uses changed.
10583
105842004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10585
10586 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
10587 (declaration): Replace expected_conflicts with expected_sr_conflicts.
10588 Add %expect-rr rule.
10589
10590 * src/scan-gram.l: Recognize %expect-rr.
10591
10592 * src/conflicts.h (expected_sr_conflicts): Rename from
10593 expected_conflicts.
10594 (expected_rr_conflicts): Declare.
10595
10596 * src/conflicts.c (expected_sr_conflicts): Rename from
10597 expected_conflicts.
10598 (expected_rr_conflicts): Define.
10599 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
10600 for GLR parsers.
10601 Use expected_sr_conflicts in place of expected_conflicts.
10602 Warn if expected_rr_conflicts used in non-GLR parser.
10603
10604 * doc/bison.texinfo: Add documentation for %expect-rr.
10605
106062004-03-08 Paul Eggert <eggert@gnu.org>
10607
10608 Add support for hex token numbers. Suggested by Odd Arild Olsen in
10609 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
10610
10611 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
10612 in lalr1.cc.
10613 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
10614 * src/scan-gram.l (scan_integer): New function.
10615 ({int}): Use it.
10616 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
10617 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
10618 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
10619 Say "long int", not "long", for uniformity with GNU style.
10620
106212004-02-25 Paul Eggert <eggert@twinsun.com>
10622
10623 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
10624 compilers. This fixes a problem with Intel's C++ compiler being
10625 chatty, reported by Guido Trentalancia in
10626 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
10627
106282004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
10629
10630 Support %destructor and merge error locations in lalr1.cc.
10631
10632 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
10633 (Parser::stos_): Define unconditionally.
10634 (Parser::destruct_): New method. Generate its body with
10635 b4_yydestruct_generate.
10636 (Parser::error_start_): New attribute.
10637 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
10638 token which are discarded.
10639 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
10640 error_start_ when erroneous token are discarded.
10641 (Parser::parse) <yyerrlab1>: Compute the location of the error
10642 token so that it covers all the discarded tokens.
10643 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
10644 it can be called with `%skeleton "lalr1.cc"', and do that.
10645
106462004-02-02 Paul Eggert <eggert@twinsun.com>
10647
10648 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
10649 $(top_srcdir)/lib and ../lib. This fixes a bug reported
10650 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
10651 There's no need to mention top_builddir since Automake does that
10652 for us.
10653 (INCLUDES): Remove, as Automake says it's obsolescent.
10654 Contents migrated into AM_CPPFLAGS as described above.
10655 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
10656
106572004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10658
10659 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
10660 (yyreportSyntaxError): Handle case where lookahead token is
10661 YYEMPTY.
10662
106632004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10664
10665 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
10666 resulting parsers are compilable with C++.
10667
106682003-12-23 Paul Eggert <eggert@twinsun.com>
10669
10670 * config/depcomp, config/install-sh: Sync with Automake 1.8.
10671 * src/output.c (output_skeleton): Rename local var.
10672 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
10673 Bison tokens, as this runs afoul of the 2003-10-07 change that
10674 disallowed NUL bytes in character constants or string literals.
10675
10676 * tests/local.at: Require Autoconf 2.59's Autotest.
10677 * tests/testsuite.at: Don't include local.at, since we now assume
10678 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
10679 including it.
10680 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
10681 multiple inclusion warnings.
10682
106832003-12-02 Akim Demaille <akim@epita.fr>
10684
10685 * doc/bison.texinfo (How Can I Reset the Parser): More about start
10686 conditions.
10687 From Bruno Haible.
10688
106892003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
10690
10691 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
10692
106932003-10-07 Paul Eggert <eggert@twinsun.com>
10694
10695 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
10696 if testsuite doesn't exist.
10697
10698 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
10699 literals, unfortunately.
10700 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
10701 Complain about NUL bytes in character constants or string literals.
10702
107032003-10-05 Paul Eggert <eggert@twinsun.com>
10704
10705 * NEWS: Don't document %no-default-prec, as it's still
10706 too experimental.
10707 * doc/bison.texinfo: Document %no-default-prec only if
10708 the defaultprec flag is set. Normally it's not.
10709
107102003-10-04 Paul Eggert <eggert@twinsun.com>
10711
10712 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
10713 non-modifiable lvalue, instead of a modifiable one.
10714 * doc/bison.texinfo (Actions): Document that $$ can
10715 be assigned to. Do not claim that $$ and $N are
10716 array element references: user code should not rely on this.
10717
107182003-10-01 Paul Eggert <eggert@twinsun.com>
10719
10720 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
10721 (grammar_declaration): Use it.
10722 * src/scan-gram.l: New token %no-default-prec.
10723 * tests/conflicts.at: Revamp tests to use %no-default-prec.
10724 * NEWS, doc/bison.texinfo: Document the above.
10725
107262003-10-01 Akim Demaille <akim@epita.fr>
10727
10728 VCG no longer supports long_straight_phase.
10729
10730 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
10731 * src/print_graph.c (print_graph): Adjust.
10732
107332003-09-30 Frank Heckenbach <frank@g-n-u.de>
10734 and Paul Eggert <eggert@twinsun.com>
10735
10736 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
10737 Table of Symbols): Document %default-prec.
10738 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
10739 (grammar_declaration): Set default_prec on %default-prec.
10740 * src/scan-gram.l (%default-prec): New token.
10741 * src/reader.h (default_prec): New flag.
10742 * src/reader.c: Likewise.
10743 (packgram): Handle it.
10744 * tests/conflicts.at (%default-prec without %prec,
10745 %default-prec with %prec, %default-prec 1): New tests.
10746
107472003-09-30 Paul Eggert <eggert@twinsun.com>
10748
10749 * tests/testsuite.at: Include local.at, not input.at, fixing
10750 a typo in the 2003-08-25 patch.
10751
107522003-08-27 Akim Demaille <akim@epita.fr>
10753
10754 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
10755 GCC warnings.
10756
107572003-08-26 Akim Demaille <akim@epita.fr>
10758
10759 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
10760 "<\#" to avoid magic from Gnus when posting parts of this script.
10761
107622003-08-26 Akim Demaille <akim@epita.fr>
10763
10764 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
10765 (Parser::parse): here.
10766 Adjust: nerrs and errstatus is now replaced by...
10767 (Parser::nerrs_, Parser::errstatus_): New.
10768
107692003-08-25 Akim Demaille <akim@epita.fr>
10770
10771 * config/announce-gen, Makefile.cfg: New.
10772 * Makefile.am: Adjust.
10773 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
10774 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
10775
107762003-08-25 Akim Demaille <akim@epita.fr>
10777
10778 When reducing initial empty rules, Bison parser read an initial
10779 location that is not defined. This results in garbage, and that
10780 affects Bison's own parser. Therefore we need (i) to extend Bison
10781 to support a means to initialize this location, and (ii) to use
10782 this CVS Bison to fix CVS Bison's parser.
10783
10784 * src/reader.h, reader.c (epilogue_augment): Remove, replace
10785 with...
10786 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
10787 * src/parse-gram.y: Adjust.
10788 (%initial-action): New.
10789 (%error-verbose): Since we require CVS Bison, there is no reason
10790 not to use it.
10791 * src/scan-gram.l: Adjust.
10792 * src/Makefile.am (YACC): New, to make sure we use our own parser.
10793 * data/yacc.c (yyparse): Use b4_initial_action.
10794
107952003-08-25 Akim Demaille <akim@epita.fr>
10796
10797 * doc/bison.texinfo: Don't promote stdout for error messages.
10798
107992003-08-25 Akim Demaille <akim@epita.fr>
10800
10801 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
10802 From Alexandre Duret-Lutz.
10803
108042003-08-25 Akim Demaille <akim@epita.fr>
10805
10806 Version 1.875c.
10807
108082003-08-25 Akim Demaille <akim@epita.fr>
10809
10810 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
10811 Use them.
10812
108132003-08-25 Akim Demaille <akim@epita.fr>
10814
10815 * data/lalr1.cc (Parser::reduce_print_): New.
10816 Use it.
10817
108182003-08-25 Akim Demaille <akim@epita.fr>
10819
10820 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
10821 error recovery loops. This patch is based on
10822 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
10823 Also, augment the similarity between lalr1.cc and yacc.c.
10824 Note: the locations of error recovery rules are not correct yet.
10825
10826 * data/lalr1.cc: Comment changes to augment the similarity between
10827 lalr1.cc and yacc.c.
10828 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
10829 (yyerrlab1): Remove, but where it used to be (now the bottom part of
10830 yyerrlab), when hitting EOF, pop the whole stack here instead of
10831 merely falling thru the default error handling mechanism.
10832 (yyerrorlab): New label, with the old contents of YYERROR,
10833 plus the following change: pop the stack of rhs corresponding
10834 to the production that invoked YYERROR. That is how Yacc
10835 behaves (required by POSIX).
10836 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
10837 fail.
10838
108392003-08-25 Akim Demaille <akim@epita.fr>
10840
10841 Tune local.at so that people can "autom4te -l autotest calc.at -o
10842 calc" for instance, to extract a sub test suite.
10843
10844 * tests/testsuite.at: Move the initialization, Autotest version
10845 requirement, and AT_TESTED invocation into...
10846 * tests/local.at: here.
10847 * tests/testsuite.at: Include it for compatibility with Autoconf
10848 2.57.
10849 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
10850 be ignore.
10851
108522003-08-04 Paul Eggert <eggert@twinsun.com>
10853
10854 Rework code slightly to avoid gcc -Wtraditional warnings.
10855 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
10856 The returned value is now stored in *YY0. All callers changed.
10857 * src/output.c (merge_output): Adjust to the above change.
10858
108592003-07-26 Paul Eggert <eggert@twinsun.com>
10860
10861 * data/glr.c (YYASSERT): New macro.
10862 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
10863 yyresolveStates, yyprocessOneStack):
10864 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
10865 Derived from a suggestion by Frank Heckenbach.
10866
108672003-07-25 Paul Eggert <eggert@twinsun.com>
10868
10869 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
10870 for portability to K&R C (after ansi2knr, presumably). See
10871 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
10872 by Frank Heckenbach, though I have omitted the structure-initialization
10873 part of his glr-knr.diff patch since I recall that the Portable
10874 C Compiler didn't require that change.
10875
10876 Let the user specify how to allocate and free memory.
10877 Derived from a suggestion by Frank Heckenbach in
10878 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
10879 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
10880 All uses of free, malloc, realloc changed to use these macros,
10881 and unnecessary casts removed.
10882 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
10883
108842003-07-06 Matthias Mann <MatthiasMann@gmx.de>
10885
10886 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
10887 use s.empty() rather than s == "" to test for empty string; see
10888 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
10889 (trivial change)
10890
108912003-06-25 Akim Demaille <akim@epita.fr>
10892
10893 * config/depcomp, config/install-sh: Update from masters.
10894
108952003-06-20 Paul Eggert <eggert@twinsun.com>
10896
10897 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
10898 and return properly parenthesized result.
10899 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
10900 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
10901 Remove unnecessary parentheses from uses.
10902 * doc/bison.texinfo (Location Default Action): Describe the
10903 conventions for parentheses.
10904
109052003-06-19 Paul Eggert <eggert@twinsun.com>
10906
10907 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
10908 yyreportTree): Do not assume that size_t is the same width as int,
10909 when printing sizes. Print sizes using an unsigned format.
10910 Problem reported by Frank Heckenbach in
10911 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
10912
10913 Port to Forte Developer 7 C compiler.
10914 * data/glr.c (struct YYLTYPE): If locations are not being used,
10915 declare a single dummy member, as empty structs do not conform
10916 to the C standard.
10917 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
10918 the Forte Developer 7 C compiler complains that end-of-loop
10919 code is not reached.
10920
109212003-06-17 Paul Eggert <eggert@twinsun.com>
10922
10923 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
10924 avoid warnings from picky compilers about redefinition of PARAMS.
10925
109262003-06-17 Paul Eggert <eggert@twinsun.com>
10927
10928 Version 1.875b.
10929
10930 * NEWS: Document 1.875b.
10931
10932 * lib/bbitset.h: Do not include config.h; that's the includer's job.
10933 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
10934 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
10935 Don't use 'index' in comments, as it's a builtin fn on some hosts.
10936 * lib/bitset_stats.c: Include gettext.h unconditionally, as
10937 per recent gettext manual's suggestion.
10938 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
10939 Use prototypes, not old-style definitions.
10940 * lib/lbitset.c (lbitset_unused_clear): Likewise.
10941 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
10942 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
10943 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
10944 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
10945 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
10946 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
10947 vbitset_or_and_cmp, vbitset_copy): Likewise.
10948
10949 * lib/libiberty.h: Do not include config.h; that's the includer's job.
10950 Do not include <stdlib.h>.
10951 (PARAMS): Define unconditionally for C89.
10952 (ATTRIBUTE_NORETURN): Remove.
10953 (ATTRIBUTE_UNUSED): Define unconditionally.
10954
10955 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
10956 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
10957 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
10958 * lib/vbitset.c, lib/vbitset.h: New files.
10959 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10960 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
10961 from libbitset.
10962
10963 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
10964 `How Can I Reset @code{yyparse}', since texinfo does not allow
10965 arbitrary @ in node names.
10966
10967 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
10968 shouldn't be needed according to the gettext 0.12.1 documentation
10969 but which seem to be needed anyway: codeset.m4 glibc21.m4
10970 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
10971 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
10972 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
10973
10974 * lib/.cvsignore: Add stdbool.h.
10975 * m4/.cvsignore: Add nls.m4, po.m4.
10976
10977 Upgrade to CVS gnulib.
10978 * stdbool_.h: File renamed from stdbool.h.in.
10979 * configure.ac (AM_STDBOOL_H): Invoke this instead of
10980 AC_HEADER_STDBOOL.
10981 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
10982 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
10983 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
10984 (MOSTLYCLEANFILES): New var.
10985 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
10986 (stdbool.h): New rule.
10987 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
10988 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
10989 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
10990 m4/quote.m4: Upgrade to today's gnulib.
10991
10992 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
10993 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
10994 the tests right now.
10995 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
10996 yyerror are declared before use; C99 requires this.
10997
109982003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10999
11000 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
11001 first.
11002 (yyrecoverSyntaxError): Correct the logic for setting and testing
11003 yyerrState.
11004 Correct comment on handling EOF.
11005 Allow states with only a default reduction, rather than failing
11006 (I can't quite reconstruct why these were not allowed before).
11007
11008 Fixes to avoid problem that $-N rules in GLR parsers can cause
11009 buffer overruns, corrupting state.
11010
11011 * src/output.c (prepare_rules): Output max_left_semantic_context
11012 definition.
11013 * src/reader.h (max_left_semantic_context): New variable declaration.
11014 * src/scan-gram.l (max_left_semantic_context): Define.
11015 (handle_action_dollar): Update max_left_semantic_context.
11016 * data/glr.c (YYMAXLEFT): New definition.
11017 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
11018 (yyresolveAction): Ditto.
11019
11020 Fixes to problems with location handling in GLR parsers reported by
11021 Frank Heckenbach (2003/06/05).
11022
11023 * data/glr.c (YYLTYPE): Make trivial if locations not used.
11024 (YYRHSLOC): Add parentheses, and define only if locations used.
11025 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
11026 locations not used.
11027 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
11028 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
11029
11030 * tests/cxx-type.at: Exercise location information; update tests
11031 to differentiate output with and without locations.
11032 Remove forward declarations of yylex and yyerror---caused errors
11033 because default YYLTYPE not yet defined.
11034 Change semantic actions to compute strings, rather than printing
11035 them directly (to test proper passing of semantics values). Change
11036 output to prefix notation and update test data and expected results.
11037 (yylex): Track locations.
11038 (stmtMerge): Return value rather than printing, and include arguments
11039 in value.
11040
110412003-06-03 Paul Eggert <eggert@twinsun.com>
11042
11043 Avoid warnings generated by GCC 2.95.4 when Bison is
11044 configured with --enable-gcc-warnings.
11045 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
11046 yy::]b4_parser_class_name[::translate_,
11047 yy::Stack::operator[] (unsigned),
11048 yy::Stack::operator[] (unsigned) const,
11049 yy::Slice::operator[] (unsigned),
11050 yy::Slice::operator[] (unsigned) const):
11051 Rename local vars to avoid warnings.
11052 * tests/glr-regression.at (Improper handling of embedded actions
11053 and $-N in GLR parsers): Remove unused local variable from yylex.
11054 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
11055 (void) as arg when not pure, since we now assume C89 when building
11056 Bison. Pacify GCC by using parameter.
11057
110582003-06-02 Paul Eggert <eggert@twinsun.com>
11059
11060 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
11061 yy::Location::lines, yy::Location::columns): Rename arguments
11062 to avoid shadowing; this removes a warning generated by GCC 3.3.
11063
110642003-06-01 Paul Eggert <eggert@twinsun.com>
11065
11066 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
11067 to g++, as GCC 3.3 complains if you do it.
11068 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
11069 everything that WARNING_CFLAGS has, except omit warnings
11070 not suitable for C++.
11071 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
11072 * tests/atlocal.in (CXXFLAGS): New var.
11073 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
11074
11075 Fix a GLR parser bug I reported in February; see
11076 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
11077 The problem was that GLR parsers did not conform to the C standard,
11078 because actions like { $1 = $2 + $3; } expanded to expressions
11079 that invoked YYFILL in separate subexpressions, and YYFILL assigned
11080 to a local variable. The C standard says that expressions
11081 like (var = f ()) + (var = f ()) have undefined behavior.
11082 Another problem was that GCC sometimes issues warnings that
11083 yyfill and its parameters are unused.
11084
11085 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
11086 as possibly unused.
11087 (yyfill): New function.
11088 (YYFILL): Use it.
11089 (yyuserAction): Change type of yynormal to bool, so that it matches
11090 the new yyfill signature. Mark it as possibly unused.
11091
11092
11093 Follow up on a bug I reported in February, where a Bison-generated
11094 parser can loop. Provide a test case and a fix for yacc.c. I
11095 don't have a fix for lalr1.cc or for glr.c, unfortunately.
11096 The original bug report is in:
11097 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
11098
11099 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
11100 macro's size was becoming unwieldy.
11101 (yyerrlab): Do not discard an empty lookahead symbol, as this
11102 might destroy garbage.
11103 (yyerrorlab): New label, with the old contents of YYERROR,
11104 plus the following change: pop the stack of rhs corresponding
11105 to the production that invoked YYERROR. That is how Yacc
11106 behaves, and POSIX requires this behavior.
11107 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
11108 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
11109 Define 'alarm' to do nothing if unistd.h is not available.
11110 Add a new rule "exp: '-' error;" to test the above change to
11111 data/yacc.c. Use 'alarm' to abort any test taking longer than
11112 10 seconds, as it's probably looping.
11113 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
11114 Also, the new yacc.c generates two fewer diagnostics for an
11115 existing test.
11116
111172003-05-24 Paul Eggert <eggert@twinsun.com>
11118
11119 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
11120 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
11121 This fixes a problem reported by John Bowman when the Compaq/HP
11122 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
11123 -ansi -Wall -gall).
11124 * data/yacc.c (union yyalloc): Likewise.
11125 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
11126
11127 Switch from 'int' to 'bool' where that makes sense.
11128
11129 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
11130 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
11131 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
11132 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
11133 Return or accept bool, not int. All callers changed.
11134 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
11135 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
11136 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
11137 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
11138 bitset_or_and_cmp_): Likewise.
11139 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
11140 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
11141 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
11142 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
11143 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
11144 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
11145 bitset_stats_or_and_cmp): Likewise.
11146 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
11147 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
11148 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
11149 ebitset_xor_cmp): Likewise.
11150 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
11151 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
11152 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
11153 lbitset_xor_cmp): Likewise.
11154 * lib/bbitset.h: Include <stdbool.h>.
11155 (struct bitset_vtable): The following members now return bool, not
11156 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
11157 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
11158 or_and_cmp).
11159 * src/conflicts.c (count_rr_conflicts): Likewise.
11160 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
11161 All uses changed.
11162 * lib/ebitset.c (ebitset_obstack_init): Likewise.
11163 * lib/lbitset.c (lbitset_obstack_init): Likewise.
11164 * src/getargs.c (debug_flag, defines_flag, locations_flag,
11165 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
11166 graph_flag): Likewise.
11167 * src/getargs.h (debug_flag, defines_flag, locations_flag,
11168 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
11169 graph_flag): Likewise.
11170 * src/output.c (error_verbose): Likewise.
11171 * src/output.h (error_verbose): Likewise.
11172 * src/reader.c (start_flag, typed): Likewise.
11173 * src/reader.h (typed): Likewise.
11174 * src/getargs.c (LOCATIONS_OPTION): New constant.
11175 (long_options, getargs): Use it.
11176 * src/lalr.c (build_relations): Use bool, not int.
11177 * src/nullable.c (nullable_compute): Likewise.
11178 * src/print.c (print_reductions): Likewise.
11179 * src/tables.c (action_row, pack_vector): Likewise.
11180 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
11181 * src/output.c (prepare): Use it.
11182 * src/output.c (token_definitions_output,
11183 symbol_destructors_output, symbol_destructors_output): Use string,
11184 not boolean integer, to keep track of whether to output separator.
11185 * src/print_graph.c (print_core): Likewise.
11186 * src/state.c (state_rule_lookaheads_print): Likewise.
11187
11188 * config/install-sh: Sync from automake 1.7.5.
11189
111902003-05-14 Paul Eggert <eggert@twinsun.com>
11191
11192 * src/parse-gram.y (rules_or_grammar_declaration): Require a
11193 semicolon after a grammar declaration, in the interest of possible
11194 future changes to the Bison input language.
11195 Do not allow a stray semicolon at the start of the grammar.
11196 (rhses.1): Allow one or more semicolons after any rule, including
11197 just before "|" as required by POSIX.
11198 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
11199 grammar.
11200
112012003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
11202
11203 %parse-param support for lalr1.cc.
11204
11205 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
11206 b4_cc_constructor_calls, b4_cc_constructor_call,
11207 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
11208 definitions.
11209 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
11210 parse-param arguments.
11211 (yy::b4_parser_class_name): Declare instance variables to
11212 hold parse-param arguments.
11213 * tests/calc.at: s/value/semantic_value/ because value clashes
11214 with a member of yy::b4_parser_class_name. Adjust C++ code
11215 to handle %parse-param. Enable %parse-param test in C++.
11216
112172003-05-12 Paul Eggert <eggert@twinsun.com>
11218
11219 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
11220 English a bit. Fix fclose typo. Change "const char" to "char
11221 const", and use ANSI C rather than K&R for "main". Suggest
11222 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
11223 and suggest yy_switch_to_buffer.
11224
112252003-05-05 Paul Eggert <eggert@twinsun.com>
11226
11227 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
11228 C89. This avoids a diagnostic on compilers that define __STDC__
11229 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
11230 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
11231
112322003-05-03 Paul Eggert <eggert@twinsun.com>
11233
11234 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
11235 Do not overrun array bounds.
11236 This should fix a bug reported today by Olatunji Oluwabukunmi in
11237 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
11238
112392003-04-29 Akim Demaille <akim@epita.fr>
11240
11241 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
11242 * src/getargs.c, src/getargs.h: here, as bool, not int.
11243 (nondeterministic_parser): New.
11244 * src/parse-gram.y, src/scan-gram.l: Support
11245 %nondeterministic-parser.
11246 * src/output.c (prepare): Use nondeterministic_parser instead
11247 of glr_parser where appropriate.
11248 * src/tables.c (conflict_row, action_row, save_row)
11249 (token_actions, token_actions, pack_vector): Ditto.
11250
112512003-04-29 Akim Demaille <akim@epita.fr>
11252
11253 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
11254
112552003-04-29 Akim Demaille <akim@epita.fr>
11256
11257 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
11258 with %pure-parser and %locations to exercise the patch from Yakov
11259 Markovitch below.
11260
112612003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
11262
11263 * data/yacc.c: (b4_lex_param): Corrected for the case where
11264 %lex-param is provided and %pure-parser isn't.
11265
112662003-04-27 Paul Eggert <eggert@twinsun.com>
11267
11268 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
11269 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
11270 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
11271 if it is not defined.
11272 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
11273
112742003-04-26 Paul Eggert <eggert@twinsun.com>
11275
11276 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
11277 Declare to be of type suitable for the ninf value itself, not of
11278 type suitable for the corresponding table, since the latter might
11279 be unsigned but the ninf value might be negative. This fixes a
11280 bug reported by Alexandre Duret-Lutz in
11281 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
11282
11283 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
11284 invokes it. We shouldn't invoke it twice because it will attempt
11285 to put error.o in the archive twice. This fixes a glitch reported
11286 by Martin Mokrejs in
11287 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
11288
112892003-04-21 Paul Eggert <eggert@twinsun.com>
11290
11291 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
11292 to gnulib.
11293
112942003-04-21 Yakov Markovitch <Markovitch@iso.ru>
11295
11296 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
11297 Fix obvious typo that results in uncompilable GLR parsers
11298 when both %pure-parser and %locations are used. (trivial change)
11299
113002003-04-17 Paul Eggert <eggert@twinsun.com>
11301
11302 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
11303 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
11304 Do not insert the expected token via unput, as this runs afoul
11305 of a POSIX-compatibility bug in flex 2.5.31.
11306 All uses changed to BEGIN the parent state,
11307 since we no longer insert the expected token via unput.
11308 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
11309 that is no longer emitted after the above change.
11310
11311 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
11312 the first one. This change is from Paul Hilfinger, and it fixes
11313 regression reported by Werner Lemberg in
11314 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
11315
11316 (resolve_sr_conflict): Don't invoke state_errs_set
11317 unless one or more tokens have been explicitly made errors.
11318 Otherwise, the above change causes Bison to abort.
11319
11320 * tests/existing.at (GNU pic Grammar): New test case, taken from
11321 Lemberg's email.
11322
113232003-03-31 Akim Demaille <akim@epita.fr>
11324
11325 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
11326
113272003-03-31 Akim Demaille <akim@epita.fr>
11328
11329 * src/output.c (prepare_symbols): Avoid trailing spaces in the
11330 output.
11331
113322003-03-31 Akim Demaille <akim@epita.fr>
11333
11334 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
11335 From Paul Hilfinger.
11336
113372003-03-29 Akim Demaille <akim@epita.fr>
11338
11339 * m4/error.m4: Do not put under dynamic conditions some code which
11340 expansion is under static control.
11341
113422003-03-29 Akim Demaille <akim@epita.fr>
11343
11344 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
11345
113462003-03-29 Akim Demaille <akim@epita.fr>
11347
11348 * doc/bison.texinfo (Strings are Destroyed): New.
11349
113502003-03-13 Paul Eggert <eggert@twinsun.com>
11351
11352 * .cvsignore: Add configure.lineno.
11353 * src/.cvsignore: Add yacc.
11354 * tests/.cvsignore: Add testsuite.log.
11355 * doc/fdl.texi: Sync with latest FSF version.
11356
113572003-03-12 Paul Eggert <eggert@twinsun.com>
11358
11359 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
11360 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
11361 cursor, instead of leaving it undefined. This fixes a bug
11362 reported by Tim Van Holder in
11363 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
11364 * tests/input.at (Torturing the Scanner): Test the scanner on
11365 an empty input file, which was Tim Van Holder's test case.
11366
11367 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
11368 <sys/resource.h> can be included, include sys/time.h and
11369 sys/times.h first, if available. This works around the SunOS
11370 4.1.4 porting bug reported by Bruce Becker in
11371 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
11372
11373 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
11374 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
11375 AC_HEADER_SYS_WAIT.
11376
11377 Merge changes from gnulib. This was prompted because the CVS
11378 snapshot didn't build on Solaris 7 due to strnlen problems.
11379
11380 These changes need to be merged back into gnulib:
11381 * lib/hash.c: Include <stdbool.h> unconditionally.
11382 * m4/onceonly.m4 (m4_quote): New macro.
11383 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
11384 Quote AC_FOREACH variable-expansions properly.
11385 The 2003-01-03 obstack.h change also needs merging.
11386 {end of changes requiring merging}
11387
11388 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11389 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
11390 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
11391 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
11392 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
11393 New files, imported from gnulib.
11394 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
11395 above.
11396
11397 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
11398 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
11399 gnulib sources.
11400
11401 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
11402 Add.
11403 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
11404 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
11405 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
11406 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
11407 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
11408 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
11409 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
11410 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
11411 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
11412 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
11413 (jm_PREREQ_ARGMATCH): Remove.
11414 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
11415 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
11416
11417 * src/system.h: Include <stdbool.h> unconditionally.
11418
11419 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
11420 assuming at least C89 in the bitset code for some time now.
11421
114222003-03-03 Akim Demaille <akim@epita.fr>
11423
11424 * ro.po: New.
11425
114262003-03-02 Akim Demaille <akim@epita.fr>
11427
11428 * doc/bison.texinfo (Table of Symbols): Reactivate the
11429 documentation for %lex-param, and %parse-param.
11430
114312003-03-02 Akim Demaille <akim@epita.fr>
11432
11433 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
11434 generate verbose error messages.
11435 Use the number of tokens as an upper bound in yytname, as it
11436 cannot be a non terminal.
11437
114382003-03-02 Akim Demaille <akim@epita.fr>
11439
11440 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
11441 message.
11442
114432003-03-02 Akim Demaille <akim@epita.fr>
11444
11445 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
11446 Use them to exercise yycheck overrun.
11447 Based on Andrew Suffield's grammar.
11448
114492003-03-02 Akim Demaille <akim@epita.fr>
11450
11451 Create tests/local.at for Bison generic testing macros.
11452
11453 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
11454 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
11455 This new file.
11456 * tests/calc.at (AT_CHECK_CALC): Adjust.
11457 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
11458 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
11459 * tests/local.at: here.
11460 (AT_COMPILE_CXX): Tags the tests using it as c++.
11461 Ignore the test if CXX is not functional.
11462
114632003-03-01 Paul Eggert <eggert@twinsun.com>
11464
11465 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
11466 not loc->end, since loc->end might contain garbage and this leads
11467 to undefined behavior on some platforms.
11468 (id_loc, token_start): Use (IF_LINTed) initial values that do not
11469 depend on *loc, so that the reader doesn't give the the false
11470 impression that *loc is initialized.
11471 (<INITIAL>"%%"): Do not bother setting code_start, since its value
11472 does not survive the return.
11473
114742003-03-01 Akim Demaille <akim@epita.fr>
11475
11476 * src/scan-gram.l (code_start): Always initialize it when entering
11477 into yylex, as SC_EPILOGUE is activated *before* the corresponding
11478 yylex invocation. An alternative would be making it static, but
11479 then it starts with the second %%'s beginning, instead of its end.
11480
114812003-02-28 Paul Eggert <eggert@twinsun.com>
11482
11483 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
11484 around a UnixWare 7.1.1 porting bug reported by John Hughes in
11485 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
11486
114872003-02-26 Paul Eggert <eggert@twinsun.com>
11488
11489 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
11490 Remove Sequent/Pyramid discussion (nobody uses them any more).
11491 Merge VMS and MS-DOS discussion; these ports may well be dead
11492 but let's keep mentioning them for now. Put <> around email
11493 addresses. Add copyright notice.
11494
114952003-02-24 Paul Eggert <eggert@twinsun.com>
11496
11497 * data/glr.c (yy_reduce_print): yylineno -> yylno,
11498 to avoid collision with flex use of yylineno.
11499 Problem reported by Bruce Lilly in
11500 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
11501 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11502 * data/yacc.c (yy_reduce_print): Likewise.
11503
11504 * config/depcomp: Sync with Automake 1.7.3.
11505
115062003-02-21 Akim Demaille <akim@epita.fr>
11507
11508 * data/lalr1.cc: Use temporary variables instead of casts to
11509 change integer types.
11510 Suggested by Paul Eggert.
11511
115122003-02-21 Akim Demaille <akim@epita.fr>
11513
11514 * doc/bison.texinfo: Use "location" consistently to refer to @n,
11515 to avoid confusions with lalr1.cc's notion of Position.
11516 Suggested by Paul Eggert.
11517
115182003-02-20 Akim Demaille <akim@epita.fr>
11519
11520 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
11521 before initial_columns.
11522 (location.hh): Use consistent variable names when defining the
11523 operator<<.
11524 Use "last" so that we subtract from Positions, not from unsigned.
11525
115262003-02-20 Akim Demaille <akim@epita.fr>
11527
11528 * data/lalr1.cc (position.hh): New subfile, including the extended
11529 and Doxygen'ed documentation of class Position.
11530 (location.hh): Use it.
11531 Document a` la Doxygen.
11532 With the help of Benoit Perrot.
11533
115342003-02-20 Akim Demaille <akim@epita.fr>
11535
11536 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
11537 AT_YACC_IF.
11538 Redefine AT_YYERROR_SEES_LOC_IF using it.
11539 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
11540 not defined.
11541 Don't use the location in yy::Parser::error_ and
11542 yy::Parser::print_ when not %locations.
11543 Activate more lalr1.cc tests.
11544
115452003-02-19 Akim Demaille <akim@epita.fr>
11546
11547 * data/lalr1.cc: When displaying a line number, be sure to make it
11548 an int.
11549
115502003-02-19 Akim Demaille <akim@epita.fr>
11551
11552 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
11553 Remove, useless.
11554 (YYABORT, YYACCEPT, YYERROR): New.
11555 * tests/calc.at: Renable the lalr1.cc test.
11556
115572003-02-19 Akim Demaille <akim@epita.fr>
11558
11559 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
11560 error recovery, mixing with/without pops and discarding of the
11561 lookahead.
11562 Exercise YYERROR.
11563 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
11564
115652003-02-17 Paul Eggert <eggert@twinsun.com>
11566
11567 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
11568 * tests/testsuite.at (AT_COMPILE): Use them.
11569 This fixes the testsuite problem reported by Robert Lentz in
11570 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
11571
115722003-02-12 Paul Eggert <eggert@twinsun.com>
11573
11574 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
11575 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
11576 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
11577 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
11578 Check for malloc failure, for consistency with yacc.c.
11579 (yytname_size): Remove, for consistency with yacc.c.
11580
11581 The bug still remains in data/lalr1.cc, as I didn't have time
11582 to fix it there.
11583
115842003-02-06 Akim Demaille <akim@epita.fr>
11585
11586 * configure.ac (GXX): Rename as...
11587 (CXX): this, to keep the original Autoconf semantics.
11588 Require 2.57.
11589 * data/lalr1.cc: Fix b4_copyright invocations.
11590 If YYDEBUG is not defined, don't depend upon name_ being defined.
11591 (location.hh): Include string and iostream.
11592 (Position::filename): New member.
11593 (Position::Position ()): New.
11594 (operator<< (Position)): New.
11595 (operator- (Position, int)): New.
11596 (Location::first, Location::last): Rename as...
11597 (Location::begin, Location::end): these, to mock the conventional
11598 iterator names.
11599 (operator<< (Location)): New.
11600 * tests/atlocal.in (CXX): New.
11601 * tests/testsuite.at (AT_COMPILE_CXX): New.
11602 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
11603 locations in a more synthetic way.
11604 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
11605 lalr1.cc is used.
11606 Adjust the C locations to match those from Emacs: first column is
11607 column 0.
11608 Change all the expected results.
11609 Conform to the GCS: simplify the locations when applicable.
11610 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
11611 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
11612 these CPP macros with the m4 macros new defined by...
11613 (AT_CHECK_PUSHDEFS): this, i.e.:
11614 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
11615 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
11616 New macros.
11617 (AT_CHECK_POPDEFS): Undefine them.
11618 (AT_CHECK_CALC_LALR1_CC): New.
11619 Use it for the first lalr1.cc test.
11620
116212003-02-04 Akim Demaille <akim@epita.fr>
11622
11623 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
11624 Location as is defined.
11625
116262003-02-04 Akim Demaille <akim@epita.fr>
11627
11628 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
11629 name_ being defined.
11630
116312003-02-03 Paul Eggert <eggert@twinsun.com>
11632
11633 * src/gram.h (start_symbol): Remove unused decl.
11634
11635 Use more-consistent naming conventions for local vars.
11636
11637 * src/derives.c (derives_compute): Change type of local var from
11638 int to rule_number.
11639 * src/gram.c (grammar_rules_partial_print): Likewise.
11640 * src/print.c (print_core): Likewise.
11641 * src/reduce.c (reduce_grammar_tables): Likewise.
11642
11643 * src/gram.c (grammar_dump): Change name of item_number *
11644 local var from r to rp.
11645 * src/nullable.c (nullable_compute): Likewise.
11646
11647 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
11648
11649 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
11650 for symbol or symbol_number var.
11651 * src/reader.c (grammar_start_symbol_set): Likewise.
11652 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
11653 Likewise.
11654 * src/state.c (transitions_to): Likewise.
11655 * src/state.h: Likewise.
11656 * src/tables.c (symbol_number_to_vector_number): Likewise.
11657
11658 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
11659 char * var.
11660
11661 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
11662 var.
11663
11664 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
11665 var.
11666
11667 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
11668 Use str, not s, for char * var. Use ch, not c, for character var.
11669 Use size for size var.
11670
11671 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
11672 char * var.
11673 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
11674 uniqstr var.
11675 * src/uniqstr.h: Likewise.
11676
11677 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
11678 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
11679 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
11680 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
11681 param to have same name as that of enum, so that we don't use
11682 "s" to stand for a non-state.
11683
116842003-02-02 Akim Demaille <akim@epita.fr>
11685
11686 * src/scan-skel.l: Scan more than one inert character per yylex
11687 invocation.
11688
116892003-02-01 Paul Eggert <eggert@twinsun.com>
11690
11691 Version 1.875a.
11692
11693 * po/LINGUAS: Add ms.
11694
116952003-01-30 Akim Demaille <akim@epita.fr>
11696
11697 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
11698
116992003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11700
11701 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
11702 of $1.
11703
11704 Changes in response to error report by S. Eken: GLR mode does not
11705 handle negative $ indices or $ indices in embedded rules correctly.
11706 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
11707
11708 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
11709 (b4_rhs_location): Ditto.
11710 (yyfill): New function to copy from stack tree into array
11711 incrementally.
11712 (yyuserAction): Modify to allow incremental move of semantic values
11713 to rhs array when in GLR mode.
11714 Define YYFILL to use in user-defined actions to fill semantic array
11715 as needed.
11716 Remove dummy use of yystack, as there is now a guaranteed use.
11717 (yydoAction): Modify to allow incremental move of semantic values
11718 to rhs array when in GLR mode.
11719 (yyresolveAction): Ditto.
11720 (yyglrShiftDefer): Update comment.
11721 (yyresolveStates): Use X == NULL for pointers, not !X.
11722 (yyglrReduce): Ditto.
11723 (yydoAction): Ditto
11724
11725 * tests/glr-regr1.at: Rename to ...
11726 * tests/glr-regression.at: Add new regression test for the problems
11727 described above (adapted from S. Eken).
11728 Update copyright notice.
11729 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
11730 * tests/Makefile.am: Ditto.
11731
117322003-01-28 Paul Eggert <eggert@twinsun.com>
11733
11734 * data/lalr1.cc: Do not use @output_header_name@ unless
11735 b4_defines_flag is set. This fixes two bugs reported by
11736 Tim Van Holder in
11737 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
11738 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
11739
117402003-01-21 Paul Eggert <eggert@twinsun.com>
11741
11742 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
11743 we don't need to worry about yyerrlab1 being reported as an
11744 "unused label" by non-GCC C compilers. The downside is that if
11745 locations are used then a couple of statements are duplicated each
11746 time YYERROR is invoked, but the upside is that the warnings
11747 should vanish.
11748 (yyerrlab1): Move code to YERROR.
11749 (yyerrlab2): Remove. Change uses back to yyerrlab1.
11750 This reverts some of the 2002-12-27 change.
11751
117522003-01-17 Paul Eggert <eggert@twinsun.com>
11753
11754 * src/output.c (symbol_printers_output): Fix typo that led
11755 to core dump. Problem reported by Antonio Rus in
11756 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
11757
117582003-01-13 Akim Demaille <akim@epita.fr>,
11759 Quoc Peyrot <chojin@lrde.epita.fr>,
11760 Robert Anisko <anisko_r@lrde.epita.fr>
11761
11762 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
11763 when the stacks contain one element, as the loop would otherwise
11764 free the last state, and then use the top state (the one we just
11765 popped). This means that the initial elements will not be freed
11766 explicitly, as is the case in yacc.c; it is not a problem, as
11767 these elements have fake values.
11768
117692003-01-11 Paul Eggert <eggert@twinsun.com>
11770
11771 * NEWS: %expect-violations are now just warnings, reverting
11772 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
11773 bootstrapping problem reported by Matthias Klose; see
11774 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
11775 * src/conflicts.c (conflicts_print): Likewise.
11776 * tests/conflicts.at (%expect not enough, %expect too much,
11777 %expect with reduce conflicts): Likewise.
11778 * doc/bison.texinfo (Expect Decl): Document this. Also mention
11779 that the warning is enabled if the number of conflicts changes
11780 (not necessarily increases).
11781
11782 * src/getargs.c (version): Update copyright year.
11783
117842003-01-09 Akim Demaille <akim@epita.fr>
11785
11786 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
11787
117882003-01-08 Paul Eggert <eggert@twinsun.com>
11789
11790 * Makefile.maint (WGETFLAGS):
11791 New macro, containing "-C off" to disable proxy caches.
11792 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
11793 (rel-check): Use $(WGET) instead of wget.
11794
117952003-01-06 Paul Eggert <eggert@twinsun.com>
11796
11797 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
11798 the GLR paper of Scott, Johnstone and Hussain.
11799
118002003-01-04 Paul Eggert <eggert@twinsun.com>
11801
11802 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
11803 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
11804 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
11805 (EXTRA_LIBRARIES): New var, for liby.a.
11806 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
11807 (EXTRA_SCRIPTS): New var, for yacc.
11808
11809 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
11810 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
11811 Problem reported by Nelson H. F. Beebe.
11812
118132003-01-03 Paul Eggert <eggert@twinsun.com>
11814
11815 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
11816 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
11817 when compiling Bison 1.875's `bitset bset = obstack_alloc
11818 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
11819
11820 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
11821 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
11822 grow to a huge size with typical invocation.
11823
11824 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
11825 Use the pattern recommended by Autoconf 2.57, except also protect
11826 against double-definition.
11827 * src/system.h: Likewise.
11828 Portability issues reported by Nelson H. F. Beebe.
11829
11830 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
11831 All uses changed. Provide a definition in both C and C++.
11832 (yytrue, yyfalse): Define even if defined (__cplusplus).
11833
11834 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
11835 Reported by Nelson H. F. Beebe.
11836
11837 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
11838
118392003-01-02 Paul Eggert <eggert@twinsun.com>
11840
11841 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
11842 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
11843 Bug reported by Nelson H. F. Beebe.
11844
118452003-01-01 Paul Eggert <eggert@twinsun.com>
11846
11847 * Version 1.875.
11848
118492002-12-30 Paul Eggert <eggert@twinsun.com>
11850
11851 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
11852 Moved here from...
11853 (<INITIAL>","): Here. This causes stray "," to be treated
11854 more uniformly.
11855
11856 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
11857 last brace in braced code when not in Yacc mode, for compatibility
11858 with Bison 1.35. This resurrects the 2001-12-15 patch to
11859 src/reader.c.
11860
11861 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
11862 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
11863
118642002-12-28 Paul Eggert <eggert@twinsun.com>
11865
11866 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
11867 that of SYM's type. This fixes Debian bug 168069, reported by
11868 Thomas Olsson.
11869
118702002-12-28 Paul Eggert <eggert@twinsun.com>
11871
11872 Version 1.75f.
11873
11874 Switch back to the Yacc style of conflict reports, undoing some
11875 of the 2002-07-30 change.
11876 * doc/bison.texinfo (Understanding): Use Yacc style for
11877 conflict reports. Also, use new way of locating rules.
11878 * src/conflicts.c (conflict_report):
11879 Renamed from conflict_report_yacc, removing the old
11880 'conflict_report'. Translate the entire conflict report at once,
11881 so that we don't assume that "," has the same interpretation in
11882 all languages.
11883 (conflicts_output): Use Yacc-style conflict report for each state,
11884 instead of our more-complicated style.
11885 (conflicts_print): Use Yacc-style conflict report, except print
11886 the input file name when not emulating Yacc.
11887 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
11888 Conflicted Reduction, %expect not enough, %expect too much,
11889 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
11890 * tests/existing.at (GNU Cim Grammar): Likewise.
11891 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
11892
11893 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
11894 fatal): Don't invoke fflush; it's not needed and it might even be
11895 harmful for stdout, as stdout might not be open.
11896 * src/reduce.c (reduce_print): Likewise.
11897
118982002-12-27 Paul Eggert <eggert@twinsun.com>
11899
11900 Fix a bug where error locations were not being recorded correctly.
11901 This problem was originally reported by Paul Hilfinger in
11902 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
11903
11904 * data/yacc.c (yyparse): New local var yylerrsp, to record the
11905 top of the location stack's error locations.
11906 (yyerrlab): Set it. When discarding a token, push its location
11907 onto yylerrsp so that we don't lose track of the error's end.
11908 (yyerrlab1): Now is only the target of YYERROR, so that we can
11909 properly record the location of the action that failed. For GCC
11910 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
11911 GCC warning about yyerrlab1 being unused if YYERROR is unused.
11912 (yyerrlab2): New label, which yyerrlab now falls through to.
11913 Compute the error's location by applying YYLLOC_DEFAULT to
11914 the locations of all the symbols that went into the error.
11915 * doc/bison.texinfo (Location Default Action): Mention that
11916 YYLLOC_DEFAULT is also invoked for syntax errors.
11917 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11918 Error locations include the locations of all the tokens that were
11919 discarded, not just the last token.
11920
119212002-12-26 Paul Eggert <eggert@twinsun.com>
11922
11923 * src/files.c: Include quote.h.
11924 (compute_output_file_names): Warn if we detect conflicting
11925 outputs to the same file. This should catch the misunderstanding
11926 exemplified by Debian Bug 165349, reported by Bruce Stephens..
11927
11928 * src/conflicts.c (conflicts_print): If the user specifies
11929 "%expect N", report an error if there are any reduce/reduce
11930 conflicts. This is what the manual says should happen.
11931 This fixes Debian bug 130890, reported by Anthony DeRobertis.
11932 * tests/conflicts.at (%expect with reduce conflicts): New test.
11933
11934 Don't use m4_include on relative file names, as it doesn't work as
11935 desired if there happens to be a file with that name under ".".
11936
11937 * m4sugar/version.m4: Remove; it was included but it wasn't used.
11938 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
11939 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
11940 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
11941 * src/output.c (output_skeleton): Use full path names when
11942 specifying a file to include; don't rely on include path, as
11943 it's unreliable when the working file contains a file with
11944 that name.
11945
119462002-12-25 Paul Eggert <eggert@twinsun.com>
11947
11948 Remove obsolete references to bison.simple and bison.hairy.
11949 Problem mentioned by Aubin Mahe in
11950 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
11951 * data/glr.c: Comment fix.
11952 * doc/bison.1: Remove references. Also, mention "yacc".
11953
11954 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
11955 with -g option.
11956
11957 * src/parse-gram.y (declaration): Use enum "report_states" rather
11958 than its numeric value 1.
11959
11960 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
11961 opening a new one. This fixes Debian bug 165349, reported by
11962 Bruce Stephens.
11963
119642002-12-24 Paul Eggert <eggert@twinsun.com>
11965
11966 Version 1.75e.
11967
11968 * Makefile.maint (cvs-update): Don't assume that the shell
11969 supports $(...), as Solaris sh doesn't.
11970
11971 * src/parse-gram.y (lloc_default): Remove test for empty
11972 nonterminals at the end, since it didn't change the result.
11973
119742002-12-24 Paul Eggert <eggert@twinsun.com>
11975
11976 If the user does not define YYSTYPE as a macro, Bison now declares it
11977 using typedef instead of defining it as a macro. POSIX requires this.
11978 For consistency, YYLTYPE is also declared instead of defined.
11979
11980 %union directives can now have a tag before the `{', e.g., the
11981 directive `%union foo {...}' now generates the C code
11982 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
11983 The default union tag is `YYSTYPE', for compatibility with Solaris 9
11984 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
11985 instead of `yyltype'.
11986
11987 `yystype' and `yyltype' are now obsolescent macros instead of being
11988 typedefs or tags; they are no longer documented and will be
11989 withdrawn in a future release.
11990
11991 * data/glr.c (b4_location_type): Remove.
11992 (YYSTYPE): Renamed from yystype.
11993 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
11994 (struct YYLTYPE): Renamed from struct yyltype.
11995 (YYLTYPE): Renamed from yyltype.
11996 (yyltype, yystype): New (and obsolescent) macros,
11997 for backward compatibility.
11998 * data/yacc.c: Likewise.
11999
12000 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
12001 does not specify a union tag. This is for compatibility with
12002 Solaris 9 yacc.
12003
12004 * src/parse-gram.y (add_param): 2nd arg is now char * not char
12005 const *, since it is now modified by stripping surrounding { }.
12006 (current_braced_code): Remove.
12007 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
12008 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
12009 trailing " {...}". Now of type <chars>.
12010 (grammar_declaration): Adjust to bundled tokens.
12011 (code_content): Remove; stripping is now done by add_param.
12012 (print_token_value): Print contents of bundled tokens.
12013 (token_name): New function.
12014
12015 * src/reader.h (braced_code, current_braced_code): Remove.
12016 (token_name): New decl.
12017
12018 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
12019 token_type, not braced_code code_kind. All uses changed.
12020 (SC_PRE_CODE): New state, for scanning after a keyword that
12021 has (or usually has) an immediately-following braced code.
12022 (token_type): New local var, to keep track of which token type
12023 to return when scanning braced code.
12024 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
12025 <INITIAL>"%parse-param", <INITIAL>"%printer",
12026 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
12027 instead of returning a token type immediately.
12028 (<INITIAL>"{"): Set token type.
12029 (<SC_BRACED_CODE>"}"): Use it.
12030 (handle_action_dollar, handle_action_at): Now returns bool
12031 indicating success. Fail if ! current_rule; this prevents a core dump.
12032 (handle_symbol_code_dollar, handle_symbol_code_at):
12033 Remove; merge body into caller.
12034 (handle_dollar, handle_at): Complain in invalid contexts.
12035
12036 * NEWS, doc/bison.texinfo: Document the above.
12037 * NEWS: Fix years and program names in copyright notice.
12038
120392002-12-17 Paul Eggert <eggert@twinsun.com>
12040
12041 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
12042 Reporting, Table of Symbols): Omit mentions of %lex-param and
12043 %parse-param from the documentation for now.
12044
120452002-12-15 Paul Eggert <eggert@twinsun.com>
12046
12047 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
12048 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
12049 lookahead symbol, and which sets yychar in parser actions) and it
12050 disagreed with the Bison documentation. Bug
12051 reported by Andrew Walrond.
12052
12053 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
12054 as the caller now does that.
12055 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
12056 (YYEMPTY): Parenthesize right hand side, since others use it.
12057 (yyparse): Don't assume that our generated code is the only code
12058 that sets yychar.
12059
120602002-12-13 Paul Eggert <eggert@twinsun.com>
12061
12062 Version 1.75d.
12063
12064 POSIX requires a "yacc" command.
12065 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
12066 (MOSTLYCLEANFILES): Add yacc.
12067 (yacc): New rule.
12068 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
12069 as an alias for bison y.
12070
12071 * po/LINGUAS: Add da.
12072
12073 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
12074 problem with latest <getopt.h>.
12075 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
12076
12077 * doc/fdl.texi: Upgrade to 1.2.
12078 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
12079 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
12080 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
12081 gnulib.
12082 * config/install-sh: Sync with autotools.
12083
12084 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
12085 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
12086 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
12087 locations are requested.
12088 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
12089 locations are requested.
12090
120912002-12-12 Paul Eggert <eggert@twinsun.com>
12092
12093 Remove unportable casts and storage allocation tricks.
12094 While we're at it, remove almost all casts, since they
12095 usually aren't needed and are a sign of trouble.
12096
12097 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
12098
12099 * src/derives.c (derives_compute): Do not subtract NTOKENS from
12100 the pointer DSET returned by malloc; this isn't portable.
12101 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
12102 Similarly for DERIVES.
12103 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
12104 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
12105 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
12106
12107 * src/derives.c (derives_compute): Do not bother invoking
12108 int_of_rule_number, since rule numbers are integers.
12109
12110 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
12111 rather than XMALLOC (char, N).
12112
12113 * src/files.c (filename_split): Rewrite to avoid cast.
12114
12115 * src/gram.h (symbol_number_as_item_number,
12116 item_number_as_symbol_number, rule_number_as_item_number,
12117 item_number_as_rule_number):
12118 Now inline functions rather than macros, to avoid casts.
12119 * src/state.h (state_number_as_int): Likewise.
12120 * src/tables.c (state_number_to_vector_number,
12121 symbol_number_to_vector_number): Likewise.
12122
12123 * src/gram.h (int_of_rule_number): Remove; no longer used.
12124
12125 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
12126 since the resulting storage is always stored into.
12127
12128 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
12129 where it's needed.
12130
12131 * src/muscle_tab.c (muscle_m4_output):
12132 Now inline. Return bool, not int.
12133 * src/state.c (state_compare): Likewise.
12134 * src/symtab.c (symbol_check_defined,
12135 symbol_check_alias_consistency, symbol_pack, symbol_translation,
12136 hash_compare_symbol, hash_symbol):
12137 Likewise.
12138 * src/uniqstr.c (uniqstr_print): Likewise.
12139 * src/muscle_tab.c (muscle_m4_output_processor):
12140 New function, to avoid casts.
12141 * src/state.c (state_comparator, stage_hasher): Likewise.
12142 * src/symtab.c (symbol_check_defined_processor,
12143 symbol_check_alias_consistency_processor, symbol_pack_processor,
12144 symbol_translation_processor, hash_symbol_comparator,
12145 hash_symbol_hasher): Likewise.
12146 * src/uniqstr.c (uniqstr_print_processor): Likewise.
12147 * src/muscle_tab.c (muscles_m4_output):
12148 Use new functions instead of casting old functions unportably.
12149 * src/state.c (state_hash_new): Likewise.
12150 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
12151 symbols_token_translations_init):
12152 Likewise.
12153 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
12154
12155 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
12156 var instead of casting to long, to avoid casts.
12157 (prepare_states): Use MALLOC rather than alloca, so that we don't
12158 have to worry about alloca.
12159 * src/state.c (state_hash_lookup): Likewise.
12160
12161 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
12162 local var instead of casting to unsigned char, to avoid casts.
12163
12164 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
12165 STATE_ALLOC): Remove.
12166 (transitions_new, errs_new, reductions_new, state_new): Use malloc
12167 rather than calloc, and use offsetof to avoid allocating slightly
12168 too much storage.
12169 (state_new): Initialize all members.
12170
12171 * src/state.c (state_hash): Use unsigned accumulator, not signed.
12172
12173 * src/symtab.c (symbol_free): Remove; unused.
12174 (symbol_get): Remove cast in lhs of assignment.
12175 (symbols_do): Now static. Accept generic arguments, not
12176 hashing-related ones.
12177
12178 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
12179 (symbol_processor): Remove.
12180 (symbols_do): Remove decl; now static.
12181
12182 * src/system.h (alloca): Remove; decl no longer needed.
12183 (<stddef.h>): Include, for offsetof.
12184 (<inttypes.>, <stdint.h>): Include if available.
12185 (uintptr_t): New type, if system lacks it.
12186 (CALLOC, MALLOC, REALLOC): New macros.
12187 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
12188 new macros.
12189
12190 * src/tables.c (table_size): Now int, to pacify GCC.
12191 (table_grow, table_ninf_remap): Use signed table size.
12192 (save_row): Don't bother initializing locals when not needed.
12193 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
12194 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
12195
12196 * src/vcg.h: Correct misspellings.
12197
12198 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
12199
12200
12201 * src/getargs.c (getargs): Don't assume EOF == -1.
12202
122032002-12-09 Paul Eggert <eggert@twinsun.com>
12204
12205 Change identifier spellings to avoid collisions with names
12206 that are reserved by POSIX.
12207
12208 Don't use names ending in _t, since POSIX reserves them.
12209 For consistency, remove _e and _s endings -- they're weren't
12210 needed to remove ambiguity. All uses changed.
12211 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
12212 turn was just renamed from struniq_t.
12213 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
12214 which in turn was just renamed from struniq_processor_t.
12215 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
12216 in turn was renamed from hash_compare_struniq_t.
12217 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
12218 (state_list): Renamed from state_list_t.
12219 * src/assoc.h (assoc): Renamed from assoc_t.
12220 * src/conflicts.c (enum conflict_resolution): Renamed from
12221 enum conflict_resolution_e.
12222 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
12223 (rule_list): Renamed from rule_list_t.
12224 * src/getargs.h (enum trace): Renamed from enum trace_e.
12225 (enum report): Renamed from enum report_e.
12226 * src/gram.h (item_number): Renamed from item_number_t.
12227 (rule_number): Renamed from rule_number_t.
12228 (struct rule_s): Remove the "rule_s" part; not used.
12229 (rule): Renamed from rule_t.
12230 (rule_filter): Renamed from rule_filter_t.
12231 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
12232 (goto_list): Renamed from goto_list_t.
12233 * src/lalr.h (goto_number): Renamed from goto_number_t.
12234 * src/location.h (location): Renamed from location_t.
12235 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
12236 and moved here from:
12237 * src/muscle_tab.h (muscle_entry_t): here.
12238 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
12239 (rule_list): Renamed from rule_list_t.
12240 * src/print_graph.c (static_graph): Renamed from graph.
12241 * src/reader.h (braced_code): Renamed from braced_code_t.
12242 Remove brace_code_e tag.
12243 * src/relation.h (relation_node): Renamed from relation_node_t.
12244 (relation_nodes): Renamed from relation_nodes_t.
12245 (relation): Renamed from relation_t.
12246 * src/state.h (state_number): Renamed from state_number_t.
12247 (struct state): Renamed from struct state_s.
12248 (state): Renamed from state_t.
12249 (transitions): Renamed from transitions_t. Unused (and
12250 misspelled) transtion_s tag removed.
12251 (errs): Renamed from errs_t. Unused errs_s tag removed.
12252 (reductions): Renamed from reductions_t. Unused tag
12253 reductions_s removed.
12254 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
12255 (struct symbol_list): Renamed from struct symbol_list_s.
12256 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
12257 (struct symbol): Renamed from struct symbol_s.
12258 (symbol): Renamed from symbol_t.
12259 * src/tables.c (vector_number): Renamed from vector_number_t.
12260 (action_number): Renamed from action_t.
12261 * src/tables.h (base_number): Renamed from base_t.
12262 * src/vcg.h (enum color): Renamed from enum color_e.
12263 (enum textmode): Renamed from enum textmode_e.
12264 (enum shape): Renamed from enum shape_e.
12265 (struct colorentry): Renamed from struct colorentry_s.
12266 (struct classname): Renamed from struct classname_s.
12267 (struct infoname): Renamed from struct infoname_s.
12268 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
12269 (enum decision): Renamed from enum decision_e.
12270 (enum orientation): Renamed from enum orientation_e.
12271 (enum alignment): Renamed from enum alignment_e.
12272 (enum arrow_mode): Renamed from enum arrow_mode_e.
12273 (enum crossing_type): Renamed from enum crossing_type_e.
12274 (enum view): Renamed from enum view_e.
12275 (struct node): Renamed from struct node_s.
12276 (node): Renamed from node_t.
12277 (enum linestyle): Renamed from enum linestyle_e.
12278 (enum arrowstyle): Renamed from enum arrowstyle_e.
12279 (struct edge): Renamed from struct edge.
12280 (edge): Renamed from edge_t.
12281 (struct graph): Renamed from struct graph_s.
12282 (graph): Renamed from graph_t.
12283 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
12284 Rename value_t -> value.
12285 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
12286 value_t_as_yystype -> value_as_yystype.
12287
12288 Don't include <errno.h> in the mainstream code, since it
12289 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
12290 * lib/get-errno.c, lib/get-errno.h: New files.
12291 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
12292 get-errno.c.
12293 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
12294 * src/output.c (output_skeleton): Likewise.
12295 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
12296 instead of errno.
12297 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
12298 Likewise.
12299 (handle_action_dollar, handle_action_at): Likewise.
12300 * src/system.h: Do not include <errno.h>.
12301 (TAB_EXT): Renamed from EXT_TAB.
12302 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
12303
12304 Avoid str[a-z]*, since <string.h> reserves that name space.
12305 Change all instances of "struniq" in names to "uniqstr", and
12306 likewise for "STRUNIQ" and "UNIQSTR".
12307 * src/uniqstr.c: Renamed from src/struniq.c.
12308 * src/uniqstr.h: Renamed from src/struniq.h.
12309 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
12310 * src/files.c (strsuffix): Remove; unused.
12311 (concat2): Renamed from stringappend. Now static.
12312 * src/files.h (strsuffix, stringappend): Remove; unused.
12313 * src/parse-gram.y (<chars>): Renamed from <string>.
12314 (<uniqstr>): Renamed from <struniq>.
12315 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
12316 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
12317 (struct graph_s.expand): Renamed from struct graph_s.stretch.
12318 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
12319 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
12320 (N_EXPAND): Renamed from N_STRETCH.
12321
12322 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
12323 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
12324 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
12325 Remove; unused.
12326 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
12327 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
12328 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
12329 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
12330 (BASE_MAXIMUM): Renamed from BASE_MAX.
12331 (BASE_MINIMUM): Renamed from BASE_MIN.
12332 (ACTION_MAX): Remove; unused.
12333 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
12334 Unnecessary casts removed from above defines.
12335
12336
12337 Fix misspelling in names.
12338 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
12339 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
12340 G_NODE_ALIGNEMENT.
12341
12342
12343 * lib/timevar.c (timevar_report): Renamed from time_report,
12344 for consistency with other names.
12345 * lib/timevar.h (timevar_report): New decl.
12346 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
12347
12348
12349 Sort include-file uses.
12350
12351 Reorder all include files under src to be in the order "system.h".
12352 then the ../lib include files in angle brackets (alphabetized),
12353 then the . include files in double-quotes (alphabetized). Fix
12354 dependency breakages encountered in this process, as follows:
12355 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
12356 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
12357 * src/state.h: Include "symtab.h".
12358
123592002-12-08 Paul Eggert <eggert@twinsun.com>
12360
12361 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
12362 since this causes problems when __file__ contains character
12363 sequences like "@" that are treated specially by src/scan-skel.l.
12364 Instead, just use the file's basename. This fixes the bug
12365 reported by Martin Mokrejs in
12366 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
12367
123682002-12-06 Paul Eggert <eggert@twinsun.com>
12369
12370 Add support for rules that do not have trailing semicolons, as
12371 POSIX requires. Improve the quality of locations in Bison
12372 diagnostics.
12373
12374 * src/location.c: Include <quotearg.h>.
12375 (empty_location): Now const.
12376 (location_print): New function. Follow the recommendation of the
12377 GNU Coding Standards for locations that span file boundaries.
12378 * src/location.h: Do not include <quotearg.h>; no longer needed.
12379 (boundary): New type.
12380 (location_t): Use it. This allows locations to span file boundaries.
12381 All member uses changed: file -> start.file or end.file (as needed),
12382 first_line -> start.line, first_column -> start.column,
12383 last_line -> end.line, last_column -> end.column.
12384 (equal_boundaries): New function.
12385 (LOCATION_RESET, LOCATION_STEP): Remove.
12386 (LOCATION_PRINT): Remove. All callers changed to use location_print.
12387 (empty_location): Now const.
12388 (location_print): New decl.
12389 * src/parse-gram.y (lloc_default): New function, which handles
12390 empty locations more accurately.
12391 (YYLLOC_DEFAULT): Use it.
12392 (%token COLON): Remove.
12393 (%token ID_COLON): New token.
12394 (rules): Use it.
12395 (declarations, rules): Remove trailing semicolon.
12396 (declaration, rules_or_grammar_declaration):
12397 Allow empty (";") declaration.
12398 (symbol_def): Remove empty actions; no longer needed.
12399 (rules_or_grammar_declaration): Remove trailing semicolon.
12400 (semi_colon.opt): Remove.
12401 * src/reader.h: Include location.h.
12402 (scanner_cursor): New decl.
12403 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
12404 rolling our own.
12405 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
12406 of *loc.
12407 (STEP): Remove. No longer needed, now that adjust_location does
12408 the work. All uses removed.
12409 (scanner_cursor): New var.
12410 (adjust_location): Renamed from extend_location. It now sets
12411 *loc and adjusts the scanner cursor. All uses changed.
12412 Don't bother testing for CR.
12413 (handle_syncline): Remove location arg; now updates scanner cursor.
12414 All callers changed.
12415 (unexpected_end_of_file): Now accepts start boundary of token or
12416 comment, not location. All callers changed. Update scanner cursor,
12417 not the location.
12418 (SC_AFTER_IDENTIFIER): New state.
12419 (context_state): Renamed from c_context. All uses changed.
12420 (id_loc, code_start, token_start): New local vars.
12421 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
12422 processing of Yacc white space and equivalents here.
12423 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
12424 instead of returning ID immediately, since we need to search for
12425 a subsequent colon.
12426 (<INITIAL>"'", "\""): Save token_start.
12427 (<INITIAL>"%{", "{", "%%"): Save code_start.
12428 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
12429 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
12430 BEGIN context_state at end, not INITIAL.
12431 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
12432 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
12433 Return correct token start.
12434 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
12435 the start of a character, string or multiline comment is found.
12436 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
12437 Reduction): Adjust reported locations to match the more-precise
12438 results now expected.
12439 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
12440 * tests/reduce.at (Useless Rules, Reduced Automaton,
12441 Underivable Rules): Likewise.
12442 * tests/regression.at (Invalid inputs): No longer `expecting ";"
12443 or "|"' now that so many other tokens are allowed by the new grammar.
12444
12445 * src/complain.h (current_file): Remove duplicate decl;
12446 current_file is now owned by files.h.
12447 * src/complain.c, src/scan-gram.l: Include files.h.
12448
124492002-12-06 Paul Eggert <eggert@twinsun.com>
12450
12451 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
12452 promotes to int; it might be unsigned int.
12453 * data/yacc.c (yy_reduce_print): Likewise.
12454
12455 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
12456 be #defined in the prologue, not in the Bison declarations.
12457 This fixes Debian Bug 102878, reported by Shaul Karl.
12458
124592002-12-02 Paul Eggert <eggert@twinsun.com>
12460
12461 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
12462 * lib/strtoul.c: New file, from gnulib.
12463 This fixes a porting bug reported by Peter Klein in
12464 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
12465
124662002-11-30 Paul Eggert <eggert@twinsun.com>
12467
12468 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
12469 and put only a forward declaration in the prologue. This is for
12470 consistency with the other scanner helper functions.
12471
12472 Type clashes now generate warnings, not errors, since it
12473 appears that POSIX may allow some grammars with type clashes.
12474 * src/reader.c (grammar_current_rule_check): Warn about
12475 type clashes instead of complaining.
12476 * tests/input.at (Type Clashes): Expect warnings, not complaints.
12477
12478 Add Yacc library, since POSIX requires it.
12479 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
12480 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
12481 * lib/main.c, lib/yyerror.c: New files.
12482
12483 gram_error can be static; it need not be extern.
12484 * src/reader.h (gram_error): Remove decl.
12485 * src/parse-gram.y (gram_error): Now static. Add static decl.
12486 (print_token_value): Omit parameter names from forward decl,
12487 for consistency.
12488
124892002-11-29 Paul Eggert <eggert@twinsun.com>
12490
12491 * doc/bison.texinfo: Emphasize that yylex and yyerror must
12492 be declared before being used. E.g., one should typically
12493 declare them in the prologue. Use GNU coding style in examples.
12494 Put "const" consistently after the type it modifies. Mention
12495 that C99 supports "inline". Mention that yyerror traditionally
12496 returns "int".
12497
12498 %parse-param and %lex-param now take just one argument, the
12499 declaration; the argument name is deduced from the declaration.
12500
12501 * doc/bison.texinfo (Parser Function, Pure Calling, Error
12502 Reporting, Table of Symbols): Document this.
12503 * src/parse-gram.y (add_param): New function.
12504 (COMMA): Remove.
12505 (declaration): Implement new rule for %parse-param and %lex-param.
12506 * src/scan-gram.l: "," now elicits a warning, rather than being
12507 a token; this is more compatible with byacc.
12508 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
12509
125102002-11-27 Paul Eggert <eggert@twinsun.com>
12511
12512 Rename identifiers to avoid real and potential collisions.
12513
12514 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
12515 to avoid collision with lex macro described by Bruce Lilly in
12516 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
12517 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12518 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
12519 * src/parse-gram.y (print_token_value): Renamed from yyprint.
12520 All uses changed.
12521 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
12522 The name "yycontrol" violates the name space rules, and this stuff
12523 wasn't being used anyway.
12524 (input): Remove action; this stuff wasn't being used.
12525 (gram_error): Rename local variable yylloc -> loc.
12526 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
12527 (YY_DECL): Don't use "yy" at start of local variables.
12528 All uses changed, e.g., yylloc -> loc.
12529 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
12530 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
12531 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
12532 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
12533
12534 * src/parse-gram.y (gram_error): loc is now const *.
12535 * src/reader.h (gram_error): Likewise.
12536
125372002-11-24 Paul Eggert <eggert@twinsun.com>
12538
12539 Version 1.75c.
12540
12541 * tests/actions.at (Actions after errors): Use an output format
12542 more similar to that of the Printers and Destructors test.
12543 Test the position of the ';' token too.
12544 (Printers and Destructors): Likewise.
12545 (Printers and Destructors: %glr-parser): Remove for now, to avoid
12546 unnecessarily alarming people when the test fails.
12547
12548 * data/yacc.c (yyerrlab1): Move this label down, so that the
12549 parser does not discard the lookahead token if the user code
12550 invokes YYERROR. This change is required for POSIX conformance.
12551
12552 * lib/error.c: Sync with gnulib.
12553
125542002-11-22 Paul Eggert <eggert@twinsun.com>
12555
12556 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
12557 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
12558 * lib/xmalloc.c: Likewise.
12559
125602002-11-20 Paul Eggert <eggert@twinsun.com>
12561
12562 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
12563
125642002-11-20 Paul Eggert <eggert@twinsun.com>
12565
12566 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
12567 should use `if (! x) abort ();' rather than `assert (x);', and
12568 anyway it's one less thing to worry about configuring.
12569
12570 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
12571 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
12572 and replace all instances of assert with abort.
12573 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
12574 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
12575
12576 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
12577 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
12578 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
12579 hash_find_entry, hash_rehash, hash_insert): Likewise.
12580 * src/conflicts.c (resolve_sr_conflict): Likewise.
12581 * src/lalr.c (set_goto_map, map_goto): Likewise.
12582 * src/nullable.c (nullable_compute): Likewise.
12583 * src/output.c (prepare_rules, token_definitions_output): Likewise.
12584 * src/reader.c (packgram, reader): Likewise.
12585 * src/state.c (state_new, state_free, state_transitions_set,
12586 state_reduction_find): Likewise.
12587 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
12588 symbol_pack): Likewise.
12589 * src/tables.c (conflict_row, pack_vector): Likewise.
12590 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12591 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12592 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
12593 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
12594
12595 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
12596 (ARGMATCH_CONSTRAINT): New macro.
12597 (ARGMATCH_ASSERT): Use it.
12598
12599 * src/system.h (verify): New macro.
12600 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
12601 rather than assert.
12602 * src/tables.c (tables_generate): Likewise.
12603
12604 * src/struniq.c (struniq_assert): Now returns void, and aborts
12605 if the assertion is false.
12606 (struniq_assert_p): Remove.
12607 * src/struniq.h: Likewise.
12608
126092002-11-18 Paul Eggert <eggert@twinsun.com>
12610
12611 * data/glr.c (yygetLRActions): Replace `yyindex' with
12612 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
12613 This fixes the regression with Sun ONE Studio 7 cc that I reported in
12614 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
12615
126162002-11-18 Akim Demaille <akim@epita.fr>
12617
12618 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
12619 space.
12620 From Tim Van Holder.
12621
126222002-11-17 Paul Eggert <eggert@twinsun.com>
12623
12624 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
12625 to "SyntaxError" for consistency with my 2002-11-15 change.
12626
12627 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
12628 not define to {}, since this breaks the common use of `YYDPRINTF
12629 ((...));' if a single statement is desired (e.g. before `else').
12630 Work around GCC warnings by surrounding corresponding calls with
12631 {} if needed.
12632 (yyhasResolvedValue): Remove unused function.
12633 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
12634 loop body.
12635 (yyreportSyntaxError): Renamed from yyreportParseError.
12636 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
12637 All uses changed.
12638 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
12639 extern when possible. Remove unused initializations.
12640
126412002-11-16 Akim Demaille <akim@epita.fr>
12642
12643 Augment the similarity between GLR and LALR traces.
12644
12645 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
12646 (YY_REDUCE_PRINT): New.
12647 (yyparse): Use them.
12648 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
12649 YYDPRINT here.
12650 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
12651 state reached after the reduction/recovery, since...
12652 (yyparse, yyprocessOneStack): Report the state we are entering in.
12653
126542002-11-16 Akim Demaille <akim@epita.fr>
12655
12656 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
12657 Add support for --trace=skeleton.
12658 * src/scan-skel.l: %option debug.
12659 Scan strings of non-@ or \n instead of character by character.
12660 (scan_skel): Handle trace_skeleton.
12661 (QPUTS): New.
12662 (@output_parser_name@, @output_header_name@): ``Restore'' their
12663 support (used to be M4 macros).
12664 * data/yacc.c: Quote larger chunks, a la glr.c.
12665 * data/lalr1.cc: Likewise.
12666 The header guards are no longer available, so use some other
12667 string than `YYLSP_NEEDED'.
12668
126692002-11-16 Akim Demaille <akim@epita.fr>
12670
12671 Make the ``Printers and Destructors'' test more verbose, taking
12672 `yacc.c''s behavior as (possibly wrong) reference.
12673
12674 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
12675 instead of fprint on stdout.
12676 Set and report the last_line of the symbols.
12677 Consistently display values and locations.
12678
126792002-11-16 Paul Eggert <eggert@twinsun.com>
12680
12681 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
12682
126832002-11-15 Paul Eggert <eggert@twinsun.com>
12684
12685 * tests/actions.at (Actions after errors): New test case.
12686
12687 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
12688 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
12689 tests/action.at, tests/calc.at, tests/conflicts.at,
12690 tests/cxx-type.at, tests/regression.at:
12691 "parse error" -> "syntax error" for POSIX compatibility.
12692 "parsing stack overflow..." -> "parser stack overflow" so
12693 that code matches Bison documentation.
12694
126952002-11-15 Akim Demaille <akim@epita.fr>
12696
12697 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
12698 take two BRACED_CODE, not two string_content.
12699 Free the scanner's obstack when we are done.
12700 (code_content): New.
12701 * tests/calc.at: Adjust.
12702 * doc/bison.texinfo: Adjust.
12703 Also, make sure to include the `,' for these declarations.
12704
127052002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
12706
12707 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
12708 definition; avoids potential autoreconf problems.
12709
127102002-11-15 Akim Demaille <akim@epita.fr>
12711
12712 Always check the value returned by yyparse.
12713
12714 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
12715 returned by yyparse.
12716 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
12717 Adjust calls.
12718 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
12719 returned by yyparse.
12720
127212002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12722
12723 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
12724 on input.at test.
12725
127262002-11-14 Paul Eggert <eggert@twinsun.com>
12727
12728 * src/output.c (output_skeleton): Call xfopen instead of
12729 duplicating xfopen's body.
12730
12731 Fix bugs reported by Nelson H. F. Beebe in
12732 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
12733
12734 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
12735 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
12736 Group compiler. Instead, use "$CC -E bar.c". Include the .h
12737 file twice in the grammar, as an extra check.
12738
12739 * tests/input.at (Torturing the Scanner): Surround the
12740 backslash-newline tests with "#if 0", to make it less likely that
12741 we'll run into compiler bugs. Bring back solitary \ inside
12742 comment, but add a closing comment to work around HP C bug. Don't
12743 test backslash-newline in C character constant.
12744
127452002-11-14 Akim Demaille <akim@epita.fr>
12746
12747 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
12748 status of the compiler.
12749 Calling `exit 1' is no longer needed.
12750 Reported by Nelson H. F. Beebe.
12751
127522002-11-14 Akim Demaille <akim@epita.fr>
12753
12754 * tests/atlocal.in (CPPFLAGS): We have config.h.
12755 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
12756 New.
12757 * tests/actions.at, tests/calc.at, tests/conflicts.at,
12758 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
12759 * tests/regression.at, tests/torture.at: Use them for all the
12760 grammars that are to be compiled.
12761 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
12762 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
12763 * doc/bison.texinfo (GLR Parsers): Document `inline'.
12764
127652002-11-14 Akim Demaille <akim@epita.fr>
12766
12767 * doc/bison.texinfo: Various formatting changes (alignments in
12768 samples, additional @group/@end group, GCS in samples.
12769 Use @deffn instead of simple @table to define the directives,
12770 macros, variables etc.
12771
127722002-11-13 Paul Eggert <eggert@twinsun.com>
12773
12774 Fix some bugs reported by Albert Chin-A-Young in
12775 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
12776
12777 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
12778 -o c"; the HP C compiler chatters during compilation.
12779 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
12780 * tests/headers.at (export YYLTYPE): Likewise.
12781
12782 * tests/input.at (Torturing the Scanner): Remove lines containing
12783 solitary backslashes, as they tickle a bug in the HP C compiler.
12784
12785 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
12786 comments, since they're not portable. Use GNU coding style.
12787
127882002-11-13 Akim Demaille <akim@epita.fr>
12789
12790 * data/yacc.c: Leave bigger chunks of quoted text.
12791 (YYDSYMPRINTF): New.
12792 Use it to report symbol activities.
12793 * data/glr.c (YYDSYMPRINTF): New.
12794 Use it.
12795
127962002-11-12 Paul Eggert <eggert@twinsun.com>
12797
12798 Version 1.75b.
12799
12800 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
12801 (yyglrReduce): Return yyok, not 0.
12802 This should avoid the enumerated-type warnings reported
12803 by Nelson H. F. Beebe in
12804 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
12805
12806 * lib/bbitset.h (BITSET_INLINE): Remove.
12807 * lib/bitset.h [! BITSET_INLINE]: Remove.
12808 (bitset_set, bitset_reset, bitset_test): Rename local vars
12809 to avoid shadowing warnings by GCC.
12810
12811 * data/glr.c (inline): Remove #define. It's the user's
12812 responsibility to #define it away, just like 'const'.
12813 This fixes one of the bugs reported by Nelson H. F. Beebe in
12814 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
12815
12816 * Makefile.maint (po-check): Scan .l and .y files instead of the
12817 .c and the .h files that they generate. This fixes the bug
12818 reported by Tim Van Holder in:
12819 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
12820 Look for N_ as well as for _. Try to avoid matching #define for
12821 N_ and _.
12822 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
12823 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
12824 * src/scan-gram.l: Revamp regular expressions so that " and '
12825 do not confuse xgettext.
12826
12827 * src/struniq.h (struniq_new): Do not declare the return type
12828 to be 'const'; this violates the C standard.
12829 * src/struniq.c (struniq_new): Likewise.
12830
128312002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
12832
12833 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
12834 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
12835 linker.
12836
128372002-11-12 Akim Demaille <akim@epita.fr>
12838
12839 * Makefile.maint: Sync with Autoconf:
12840 (local_updates): New.
12841
128422002-11-12 Akim Demaille <akim@epita.fr>
12843
12844 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
12845
128462002-11-12 Akim Demaille <akim@epita.fr>
12847
12848 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
12849 locations.
12850
128512002-11-12 Akim Demaille <akim@epita.fr>
12852
12853 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
12854 not yyvalue.
12855
128562002-11-12 Akim Demaille <akim@epita.fr>
12857
12858 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
12859 Use it to test the GLR parser.
12860
128612002-11-12 Akim Demaille <akim@epita.fr>
12862
12863 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
12864 defines it.
12865 * data/glr.c (yystos): New.
12866 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
12867 (YYDSYMPRINT): New.
12868 (yyval): Don't define it, it is handled via M4.
12869 (yyrecoverParseError): Free verbosely the discarded symbols.
12870 * data/yacc.c (yysymprint): Remove, rather...
12871 (b4_yysymprint_generate): invoke.
12872 * data/c.m4 (b4_yysymprint_generate): New.
12873 Accept pointers as arguments, as opposed to the version from
12874 yacc.c.
12875 (b4_yydestruct_generate): Likewise.
12876 * tests/cations.at (Printers and Destructors): Use Bison directives
12877 instead of CPP macros.
12878 Don't rely on internal details.
12879
128802002-11-12 Akim Demaille <akim@epita.fr>
12881
12882 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
12883 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
12884 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
12885 it against YYEMPTY and so forth), work on yytoken (i.e., set
12886 it to YYEMPTY etc.).
12887 (yydestruct): Replace with a b4_yydestruct_generate invocation.
12888 (b4_symbol_actions): Remove.
12889 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
12890 for 0, end-of-input.
12891
128922002-11-12 Akim Demaille <akim@epita.fr>
12893
12894 * doc/bison.texinfo (Destructor Decl): New.
12895
128962002-11-12 Akim Demaille <akim@epita.fr>
12897
12898 * src/tables.c (tables_generate): Use free for pointers that
12899 cannot be NULL, not XFREE.
12900 (pack_vector): Use assert, not fatal, for bound violations.
12901 * src/state.c (state_new): Likewise.
12902 * src/reader.c (reader): Likewise.
12903 * src/lalr.c (set_goto_map): Likewise.
12904 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
12905 the file name.
12906
129072002-11-12 Akim Demaille <akim@epita.fr>
12908
12909 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
12910 Restore.
12911 * src/scan-gram.l (last_string): Is global to the file, not to
12912 yylex.
12913 * src/parse-gram.y (input): Don't append the epilogue here,
12914 (epilogue.opt): do it here, and free the scanner's obstack.
12915 * src/reader.c (epilogue_set): Rename as...
12916 (epilogue_augment): this.
12917 * data/c.m4 (b4_epilogue): Defaults to empty.
12918
129192002-11-12 Akim Demaille <akim@epita.fr>
12920
12921 * src/getargs.c (long_options): Remove duplicates.
12922 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
12923 Remove.
12924 * doc/bison.rnh: Remove.
12925 * doc/bison.texinfo (VMS Invocation): Remove.
12926
129272002-11-12 Akim Demaille <akim@epita.fr>
12928
12929 * src/struniq.h, src/struniq.c (struniq_t): Is const.
12930 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
12931
12932 Use struniq for symbols.
12933
12934 * src/symtab.h (symbol_t): The tag member is a struniq.
12935 (symbol_type_set): Adjust.
12936 * src/symtab.c (symbol_new): Takes a struniq.
12937 (symbol_free): Don't free the tag member.
12938 (hash_compare_symbol_t, hash_symbol_t): Rename as...
12939 (hash_compare_symbol, hash_symbol): these.
12940 Use the fact that tags as struniqs.
12941 (symbol_get): Use struniq_new.
12942 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
12943 Returns a strniq.
12944 * src/reader.h (merger_list, grammar_currentmerge_set): The name
12945 and type members are struniqs.
12946 * src/reader.c (get_merge_function)
12947 (grammar_current_rule_merge_set): Adjust.
12948 (TYPE, current_type): Are struniq.
12949
12950 Use struniq for file names.
12951
12952 * src/files.h, src/files.c (infile): Split into...
12953 (grammar_file, current_file): these.
12954 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
12955 * src/reduce.c (reduce_print): Likewise.
12956 * src/getargs.c (getargs): Likewise.
12957 * src/complain.h, src/complain.c: Likewise.
12958 * src/main.c (main): Call struniqs_new early enough to use it for
12959 file names.
12960 Don't free the input file name.
12961
129622002-11-12 Akim Demaille <akim@epita.fr>
12963
12964 * src/symtab.c (symbol_free): Remove dead deactivated code:
12965 type_name are properly removed.
12966 Don't use XFREE to free items that cannot be NULL.
12967 * src/struniq.h, src/struniq.c: New.
12968 * src/main.c (main): Initialize/free struniqs.
12969 * src/parse-gram.y (%union): Add astruniq member.
12970 (yyprint): Adjust.
12971 * src/scan-gram.l (<{tag}>): Return a struniq.
12972 Free the obstack bit that used to store it.
12973 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
12974
129752002-11-11 Paul Eggert <eggert@twinsun.com>
12976
12977 Revamp to fix many (but not all) of the C- and M4-related quoting
12978 problems. Among other things, this fixes the Bison bug reported
12979 by Jan Hubicka when processing the Bash grammar; see:
12980 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
12981
12982 Use new @ escapes consistently. Represent brackets with @{ and @}
12983 rather than @<:@ and @:>@, since this works a bit better with dumb
12984 editors like vi. Represent @ with @@, since @ is now consistently
12985 an escape. Use @oline@ and @ofile@ rather than __oline__ and
12986 __ofile__, to avoid unexpected expansions. Similarly, use @output
12987 rather than #output.
12988
12989 * data/c.m4 (b4_copyright): Omit file name from comment, since
12990 the file name could contain "*/".
12991 (b4_synclines_flag): Don't quote the 2nd argument; it should already
12992 be quoted. All uses changed.
12993
12994 * data/glr.c: Use new @ escapes consistently.
12995 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
12996 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
12997 Remove, since they couldn't handle arbitrary characters in file
12998 names.
12999 * data/lalr1.cc: Likewise.
13000 * data/yacc.c: Likewise.
13001
13002 * src/files.c (output_infix): Remove; all uses removed.
13003 * src/files.h: Likewise.
13004
13005 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
13006 mishandled funny characters in file names, and anyway it isn't
13007 needed any more.
13008 * data/yacc.c: Likewise.
13009 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
13010
13011 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
13012 * data/yacc.c: Likewise.
13013
13014 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
13015 strings now.
13016 (muscle_init): Quote filename as a C string.
13017 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
13018 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
13019 * src/output.c (escaped_file_name_output): New function.
13020 (prepare_symbols): Quote tokens for M4.
13021 (prepare): Don't insert output_infix, output_prefix,
13022 output_parser_name, output_header_name; this is now down by scan-skel.
13023 Insert skeleton as a C string.
13024
13025 * src/output.c (user_actions_output, symbol_destructors_output,
13026 symbol_printers_output): Quote filenames for C and M4.
13027 * src/reader.c (prologue_augment, epilogue_set): Likewise.
13028
13029 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
13030 escapes other than \\ and \'; this simplifies the code.
13031 (<SC_STRING>): Likewise, for \\ and \".
13032 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
13033 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
13034 Use new escapes @{ and @} for [ and ].
13035
13036 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
13037 them with auto vars.
13038 Switch to new escape scheme, where @ is the escape character uniformly.
13039 Abort if a stray escape character is found. Avoid unbounded input
13040 buffer when parsing non-escaped text.
13041
13042 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
13043 __oline__, #output, $@, and @{ do not have unintended meanings.
13044
130452002-11-09 Paul Eggert <eggert@twinsun.com>
13046
13047 Fix the test failure due to GCC warnings described in
13048 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
13049 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
13050 evaluate to 0 if it's impossible for NINF to be in the respective
13051 table.
13052 (yygetLRActions, yyrecoverParseError): Use them.
13053
13054 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
13055 counted in the token inserted at end of file. Now takes
13056 location_t *, not location_t, so that the location can be
13057 adjusted. All uses changed.
13058
13059 * tests/regression.at (Invalid inputs): Adjust wording in
13060 diagnostic to match the new behavior.
13061
13062 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
13063 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
13064 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
13065 abort ();'. This reduces the runtime of the "Many lookaheads"
13066 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
13067 GCC 3.2.
13068
130692002-11-07 Paul Eggert <eggert@twinsun.com>
13070
13071 * src/parse-gram.y (CHARACTER): Remove unused token.
13072 All uses removed.
13073
13074 * src/scan-gram.l: Remove stack option. We no longer use the
13075 stack, since the stack was never deeper than 1; instead, use the
13076 new auto var c_context to record the stacked value.
13077
13078 Remove nounput option. At an unexpected end of file, we now unput
13079 the minimal input necessary to end cleanly; this simplifies the
13080 code.
13081
13082 Avoid unbounded token sizes where this is easy.
13083
13084 (unexpected_end_of_file): New function.
13085 Use it to systematize the error message on unexpected EOF.
13086 (last-string): Now auto, not static.
13087 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
13088 (scanner_last_string_free): Remove; not used.
13089 (percent_percent_count): Move decl to just before use.
13090 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
13091 not the (never otherwised-used) CHARACTER.
13092
130932002-11-07 Akim Demaille <akim@epita.fr>
13094
13095 Let yyerror always receive the msg as last argument, so that
13096 yyerror can be variadic.
13097
13098 * data/yacc.c (b4_yyerror_args): New.
13099 Use it when calling yyerror.
13100 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
13101 Use it when calling yyerror.
13102 * doc/bison.texinfo (Error Reporting): Adjust.
13103 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
13104 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
13105
131062002-11-06 Akim Demaille <akim@epita.fr>
13107
13108 #line should have quoted strings.
13109 Ideally, this should be done by m4_quotearg.
13110
13111 * src/scan-skel.l: Include quotearg.h.
13112 Quote __ofile__.
13113 * src/output.c (symbol_printers_output)
13114 (symbol_destructors_output): Quote the file name.
13115
131162002-11-06 Akim Demaille <akim@epita.fr>
13117
13118 * tests/regression.at (Invalid inputs): Adjust to the recent
13119 messages.
13120
131212002-11-06 Akim Demaille <akim@epita.fr>
13122
13123 Restore --no-lines.
13124 Reported by Jim Kent.
13125
13126 * data/c.m4 (b4_syncline): New.
13127 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
13128 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
13129 * src/output.c (user_actions_output): Likewise.
13130 (prepare): Define 'b4_synclines_flag'.
13131 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
13132
131332002-11-06 Akim Demaille <akim@epita.fr>
13134
13135 * src/main.c (main): Free `infile'.
13136 * src/scan-gram.l (handle_syncline): New.
13137 Recognize `#line'.
13138 * src/output.c (user_actions_output, symbol_destructors_output)
13139 (symbol_printers_output): Use the location's file name, not
13140 infile.
13141 * src/reader.c (prologue_augment, epilogue_set): Likewise.
13142
131432002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13144
13145 * src/tables.c (matching_state): Don't allow states to match if
13146 either has GLR conflict entries.
13147
131482002-11-05 Paul Eggert <eggert@twinsun.com>
13149
13150 * src/scan-gram.l: Use more accurate diagnostics, e.g.
13151 "integer out of range" rather than "invalid value".
13152 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
13153 accordingly.
13154
13155 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
13156 Also, remove one static variable in the scanner.
13157
13158 * src/scan-gram.l (braces_level): Now auto, not static.
13159 Initialize to zero if the compiler is being picky.
13160 (INITIAL): Clear braces_level instead of incrementing it.
13161 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
13162 as POSIX 1003.1-2001 requires.
13163 * src/system.h (IF_LINT): New macro, taken from coreutils.
13164 * configure.ac: Define "lint" if --enable-gcc-warnings.
13165
131662002-11-05 Akim Demaille <akim@epita.fr>
13167
13168 * src/scan-gram.l: When it starts with `%', complain about the
13169 whole directive, not just that `invalid character: %'.
13170
131712002-11-04 Akim Demaille <akim@epita.fr>
13172
13173 * Makefile.maint: Update from Autoconf.
13174 (update, cvs-update, po-update, do-po-update): New.
13175
131762002-11-04 Akim Demaille <akim@epita.fr>
13177
13178 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
13179 and yyerror.
13180 Have yyerror `use' its arguments.
13181 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
13182 returns true when location & yacc & pure & parse-param.
13183 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
13184
131852002-11-04 Akim Demaille <akim@epita.fr>
13186
13187 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
13188 clashes.
13189 * src/scan-gram.l: Use [\'] instead of ['] to pacify
13190 font-lock-mode.
13191 Use complain_at.
13192 Use quote, not quote_n since LOCATION_PRINT no longer uses the
13193 slot 0.
13194
131952002-11-03 Paul Eggert <eggert@twinsun.com>
13196
13197 * src/reader.c (get_merge_function, grammar_current_rule_check):
13198 Use consistent diagnostics for reporting type name clashes.
13199 Quote the types with <>, for consistency with Yacc.
13200 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
13201
132022002-11-03 Akim Demaille <akim@epita.fr>
13203
13204 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
13205 New.
13206 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
13207 (b4_parse_param): Remove.
13208 Use b4_identification.
13209 Propagate b4_pure_args where needed to pass them to yyerror.
13210 * data/glr.m4 (b4_parse_param): Remove.
13211 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
13212 (b4_lpure_formals): New.
13213 Use b4_identification.
13214 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
13215 b4_user_formals and b4_user_args.
13216 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
13217 (yyreportAmbiguity): When using a pure parser, also need
13218 the location, and the parse-params.
13219 Adjust callers.
13220 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
13221 When using a pure parser, also need the parse-params.
13222 Adjust callers.
13223 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
13224 (%pure-parser + %parse-param) LALR and GLR parsers.
13225 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
13226 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
13227 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
13228 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
13229 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
13230 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
13231 * doc/bison.texinfo: Untabify the whole file.
13232 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
13233 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
13234 (Error Reporting): Adjust to these new directives.
13235 Document %error-verbose, deprecate YYERROR_VERBOSE.
13236
132372002-11-03 Akim Demaille <akim@epita.fr>
13238
13239 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
13240 AT_CHECK_CALC_GLR invocations to use % directives, instead of
13241 command line options.
13242 * tests/cxx-type.at: Formatting changes.
13243
132442002-11-03 Paul Eggert <eggert@twinsun.com>
13245
13246 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
13247 to count columns correctly, and to check for invalid inputs.
13248
13249 Use mbsnwidth to count columns correctly. Account for tabs, too.
13250 Include mbswidth.h.
13251 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
13252 (extend_location): New function.
13253 (YY_LINES): Remove.
13254
13255 Handle CRLF in C code rather than in Lex code.
13256 (YY_INPUT): New macro.
13257 (no_cr_read): New function.
13258
13259 Scan UCNs, even though we don't fully handle them yet.
13260 (convert_ucn_to_byte): New function.
13261
13262 Handle backslash-newline correctly in C code.
13263 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
13264 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
13265 all uses changed.
13266 (tag, splice): New EREs. Do not allow NUL or newline in tags.
13267 Use {splice} wherever C allows backslash-newline.
13268 YY_STEP after space, newline, vertical-tab.
13269 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
13270
13271 (letter, id): Don't assume ASCII; e.g., spell out a-z.
13272
13273 ({int}, handle_action_dollar, handle_action_at): Check for integer
13274 overflow.
13275
13276 (YY_STEP): Omit trailing semicolon, so that it's more like C.
13277
13278 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
13279 as well as \000. Check for UCHAR_MAX, not 255.
13280 Allow \x with an arbitrary positive number of digits, as in C.
13281 Check for overflow here.
13282 Allow \? and UCNs, for compatibility with C.
13283
13284 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
13285 with quote slot used by complain_at.
13286
13287 * tests/input.at: Add tests for backslash-newline, m4 quotes
13288 in symbols, long literals, and funny escapes in strings.
13289
13290 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
13291 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
13292 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
13293 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
13294 * m4/mbswidth.m4: New file, from GNU coreutils.
13295
13296 * doc/bison.texinfo (Grammar Outline): Document // comments.
13297 (Symbols): Document that trigraphs have no special meaning in Bison,
13298 nor is backslash-newline allowed.
13299 (Actions): Document that trigraphs have no special meaning.
13300
13301 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
13302 no longer used.
13303
133042002-11-02 Paul Eggert <eggert@twinsun.com>
13305
13306 * src/reader.c: Don't include quote.h; not needed.
13307 (get_merge_function): Reword warning to be consistent with
13308 type clash diagnostic in grammar_current_rule_check.
13309
13310 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
13311 bug in trigraph handling.
13312
13313 * src/output.c (prepare_symbols): When printing token names,
13314 escape "[" as "@<:@" and likewise for "]".
13315
13316 * src/system.h (errno): Remove declaration, as we are now
13317 assuming C89 or better, and C89 guarantees errno.
13318
133192002-10-30 Paul Eggert <eggert@twinsun.com>
13320
13321 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
13322 Check for close failures.
13323 * src/files.h (xfclose): Return void, not int, since it always
13324 returned zero.
13325 * src/files.c (xfclose): Likewise. Report I/O error if ferror
13326 indicates one.
13327 * src/output.c (output_skeleton): Use xfclose rather than fclose
13328 and ferror. xfclose now checks ferror.
13329
13330 * data/glr.c (YYLEFTMOST_STATE): Remove.
13331 (yyreportTree): Use a stack-based leftmost state. This avoids
13332 our continuing battles with bogus warnings about initializers.
13333
133342002-10-30 Akim Demaille <akim@epita.fr>
13335
13336 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
13337 #if.
13338
133392002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13340
13341 * tests/glr-regr1.at: New test for reported regressions.
13342 * tests/testsuite.at: Add glr-regr1.at test.
13343 * tests/Makefile.am: Add glr-regr1.at test.
13344
133452002-10-24 Paul Eggert <eggert@twinsun.com>
13346
13347 Version 1.75a.
13348
13349 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
13350 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
13351 we use malloc. Don't assume 'A' through 'Z' are contiguous.
13352 Don't assume strdup exists; POSIX says its an XSI extension.
13353 Check for buffer overflow on input.
13354
133552002-10-24 Akim Demaille <akim@epita.fr>
13356
13357 * src/output.c (output_skeleton): Don't disable M4sugar comments
13358 too soon: it results in comments being expanded.
13359 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
13360 first output.
13361
133622002-10-24 Akim Demaille <akim@epita.fr>
13363
13364 * data/yacc.c (m4_int_type): New.
13365 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
13366 char' as only yacc.c wants K&R portability.
13367 * data/glr.c (yysigned_char): Remove.
13368 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
13369 Reported by Quoc Peyrot.
13370
133712002-10-23 Paul Eggert <eggert@twinsun.com>
13372
13373 * src/main.c (main): With --trace=time, report times even if a
13374 non-fatal error occurs. Formerly, the times were reported in some
13375 such cases but not in others.
13376 * src/reader.c (reader): Just return if a complaint has been issued,
13377 instead of exiting, so that 'main' can report times.
13378
133792002-10-22 Akim Demaille <akim@epita.fr>
13380
13381 * src/system.h: Include sys/types.
13382 Reported by Bert Deknuydt.
13383
133842002-10-23 Paul Eggert <eggert@twinsun.com>
13385
13386 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
13387 Suggested by Art Haas.
13388
133892002-10-22 Paul Eggert <eggert@twinsun.com>
13390
13391 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
13392 decl; not needed any more.
13393 * src/main.c (main): Use return to exit, undoing yesterday's change.
13394 The last OS that we could find where this wouldn't work is
13395 SunOS 3.5, and that's too old to worry about now.
13396
13397 * data/glr.c (struct yyltype): Define members even when not
13398 doing locations. This is more consistent with yacc.c, and it
13399 works around the following bug reports:
13400 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
13401 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
13402
13403 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
13404 @acronym consistently. Standardize on "Yacc" instead of "YACC",
13405 "Algol" instead of "ALGOL". Give a bit more history about BNF.
13406
134072002-10-22 Akim Demaille <akim@epita.fr>
13408
13409 * data/README: New.
13410
134112002-10-21 Paul Eggert <eggert@twinsun.com>
13412
13413 Be consistent about 'bool'; the old code used an enum in one
13414 module and an int in another, and this violates the C standard.
13415 * m4/stdbool.m4: New file, from coreutils 4.5.3.
13416 * configure.ac (AC_HEADER_STDBOOL): Add.
13417 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
13418 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
13419 * src/symtab.c (hash_compare_symbol_t): Likewise.
13420 * src/system.h (bool, false, true): Use a definition consistent
13421 with ../lib/hash.c. All uses changed.
13422
13423 * src/complain.c (warning_issued): Renamed from warn_message_count,
13424 so that we needn't worry about integer overflow (!).
13425 Now of type bool. All uses changed.
13426 (complaint_issued): Renamed from complain_message_count; likewise.
13427
13428 * src/main.c (main): Use exit to exit with failure.
13429
13430 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
13431 rather than 1 and 0.
13432 * src/main.c (main): Likewise.
13433 * src/getargs.c (getargs): Likewise.
13434 * src/reader.c (reader): Likewise.
13435
13436 * src/getarg.c (getargs): Remove duplicate code for
13437 "Try `bison --help'".
13438
13439 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
13440 What was that "2" for?
13441
13442 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
13443 * src/getargs.c (usage): Likewise.
13444
13445 * src/getargs.c (getargs): When there are too few operands, report
13446 the last one. When there are too many, report the first extra
13447 one. This is how diffutils does it.
13448
134492002-10-20 Paul Eggert <eggert@twinsun.com>
13450
13451 Remove K&R vestiges.
13452 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
13453 * src/complain.c (VA_START): Remove. Assume prototypes.
13454 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
13455 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
13456 fatal): Assume prototypes.
13457 * src/complain.h: Assume prototypes.
13458 * src/system.h (PARAMS): Remove.
13459 Include <limits.h> unconditionally, since it's guaranteeed even
13460 for a freestanding C89 compiler.
13461 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
13462 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
13463
134642002-10-20 Akim Demaille <akim@epita.fr>
13465
13466 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
13467 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
13468 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
13469 (yyresolveStates, yyresolveAction, yyresolveStack)
13470 (yyprocessOneStack): Use them.
13471 (yy_reduce_print): New.
13472 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
13473
134742002-10-20 Akim Demaille <akim@epita.fr>
13475
13476 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
13477 arguments and output `void'.
13478 (b4_c_function): Rename as...
13479 (b4_c_function_def): this.
13480 (b4_c_function_decl, b4_c_ansi_function_def)
13481 (b4_c_ansi_function_decl): New.
13482 Change the interpretation of the arguments: before `int, foo', now
13483 `int foo, foo'.
13484 * data/yacc.c (yyparse): Prototype and define thanks to these.
13485 Adjust b4_c_function_def uses.
13486 * data/glr.c (yyparse): Likewise, but ANSI only.
13487
134882002-10-20 Akim Demaille <akim@epita.fr>
13489
13490 * src/output.c (prepare): Move the definition of `tokens_number',
13491 `nterms_number', `undef_token_number', `user_token_number_max'
13492 to...
13493 (prepare_tokens): Here.
13494 (prepare_tokens): Rename as...
13495 (prepare_symbols): this.
13496 (prepare): Move the definition of `rules_number' to...
13497 (prepare_rules): here.
13498 (prepare): Move the definition of `last', `final_state_number',
13499 `states_number' to...
13500 (prepare_states): here.
13501 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
13502
135032002-10-20 Akim Demaille <akim@epita.fr>
13504
13505 * src/tables.h, src/tables.c, src/output.c: Comment changes.
13506
135072002-10-20 Akim Demaille <akim@epita.fr>
13508
13509 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
13510 * data/c.m4: here.
13511
135122002-10-20 Akim Demaille <akim@epita.fr>
13513
13514 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
13515 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
13516 `pair'.
13517 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
13518 `name' to...
13519 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
13520 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
13521 These.
13522
135232002-10-19 Paul Eggert <eggert@twinsun.com>
13524
13525 Do not create a temporary file, as that involves security and
13526 cleanup headaches. Instead, use a pair of pipes.
13527 Derived from a suggestion by Florian Krohm.
13528 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
13529 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
13530 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
13531 (BISON_PREREQ_SUBPIPE): Add.
13532 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
13533 Add subpipe.h, subpipe.c.
13534 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
13535 * po/POTFILES.in: Add lib/subpipe.c.
13536 * src/output.c: Include "subpipe.h".
13537 (m4_invoke): Remove decl.
13538 (scan_skel): New decl.
13539 (output_skeleton): Use pipe rather than temporary file for m4 input.
13540 Check that m4sugar.m4 is readable, to avoid deadlock.
13541 Check for pipe I/O error.
13542 * src/scan-skel.l (readpipe): Remove decl.
13543 (scan_skel): New function, to be used in place of m4_invoke.
13544 Read from stream rather than file.
13545
13546 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
13547 float, as this generates a warning on Solaris 8 + GCC 3.2 with
13548 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
13549 this generates a more-accurate value anyway.
13550
13551 * lib/timevar.c (timervar_accumulate): Rename locals to
13552 avoid confusion with similarly-named more-global.
13553 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
13554
13555 * src/output.c (prepare): Use xstrdup to convert char const *
13556 to char *, to avoid GCC warning.
13557
135582002-10-19 Akim Demaille <akim@epita.fr>
13559
13560 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
13561 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
13562 Use them to have `calc.y' ready for %pure-parser.
13563 * data/yacc.c (YYLEX): Pass a yylex return type to
13564 b4_c_function_call.
13565
135662002-10-19 Akim Demaille <akim@epita.fr>
13567
13568 Prototype support of %lex-param and %parse-param.
13569
13570 * src/parse-gram.y: Add the definition of the %lex-param and
13571 %parse-param tokens, plus their rules.
13572 Drop the `_' version of %glr-parser.
13573 Add the "," token.
13574 * src/scan-gram.l (INITIAL): Scan them.
13575 * src/muscle_tab.c: Comment changes.
13576 (muscle_insert, muscle_find): Rename `pair' as `probe'.
13577 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
13578 (muscle_entry_s): The `value' member is no longer const.
13579 Adjust all dependencies.
13580 * src/muscle_tab.c (muscle_init): Adjust: use
13581 MUSCLE_INSERT_STRING.
13582 Initialize the obstack earlier.
13583 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
13584 (muscle_pair_list_grow): New.
13585 * data/c.m4 (b4_c_function_call, b4_c_args): New.
13586 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
13587 * tests/calc.at: Use %locations, not --locations.
13588 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
13589
135902002-10-19 Akim Demaille <akim@epita.fr>
13591
13592 * src/getargs.c (usage): Take status as argument and exit
13593 accordingly.
13594 Report the traditional `Try ... --help' message when status != 0.
13595 (usage, version): Don't take a FILE * as arg, it is pointless.
13596 (getargs): When there is an incorrect number of arguments, make it
13597 an error, and report it GNUlically thanks to `usage ()'.
13598
135992002-10-18 Paul Eggert <eggert@twinsun.com>
13600
13601 * data/glr.c (yyreportParseError): Don't assume that sprintf
13602 yields the length of the printed string, as this is not true
13603 on SunOS 4.1.4. Reported by Peter Klein.
13604
13605 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
13606 * tests/conflicts.at (%nonassoc and eof): Likewise.
13607 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
13608
136092002-10-17 Akim Demaille <akim@epita.fr>
13610
13611 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
13612 * src/getargs.c (trace_types, trace_args): Adjust.
13613 * src/reader.c (grammar_current_rule_prec_set)
13614 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
13615 Standardize error messages.
13616 And s/@prec/%prec/!
13617 (reader): Use trace_flag to enable scanner/parser debugging,
13618 instead of an adhoc scheme.
13619 * src/scan-gram.l: Remove trailing debugging code.
13620
136212002-10-16 Paul Eggert <eggert@twinsun.com>
13622
13623 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
13624 MUSCLE_TAB_H.
13625
13626 * NEWS: Officially drop support for building Bison with K&R C,
13627 since it didn't work anyway and it's not worth worrying about.
13628 * Makefile.maint (wget_files): Remove ansi2knr.c.
13629 (ansi2knr.c-url_prefix): Remove.
13630 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
13631 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13632 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13633
136342002-10-15 Paul Eggert <eggert@twinsun.com>
13635
13636 Stop using the "enum_" trick for K&R-style function definitions;
13637 it confused me, and I was the author! Instead, assume that people
13638 who want to use K&R C compilers (when using these modules in GCC,
13639 perhaps?) will run ansi2knr.
13640
13641 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
13642 All uses of "enum_" changed to "enum ".
13643 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13644 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13645
13646 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
13647 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
13648 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
13649 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
13650 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
13651 abitset_not, abitset_ones, abitset_or, abitset_or_and,
13652 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
13653 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
13654 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
13655 Use function prototypes; this removes the need for declaring
13656 static functions simply to provide their prototypes.
13657 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
13658 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
13659 bitset_count_, bitset_create, bitset_dump, bitset_first,
13660 bitset_free, bitset_init, bitset_last, bitset_next,
13661 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
13662 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
13663 bitset_print, bitset_release_memory, bitset_toggle_,
13664 bitset_type_choose, bitset_type_get, bitset_type_name_get,
13665 debug_bitset): Likewise.
13666 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
13667 * lib/bitset_stats.c (bitset_log_histogram_print,
13668 bitset_percent_histogram_print, bitset_stats_and,
13669 bitset_stats_and_cmp, bitset_stats_and_or,
13670 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
13671 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
13672 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
13673 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
13674 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
13675 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
13676 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
13677 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
13678 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
13679 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
13680 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
13681 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
13682 bitset_stats_zero): Likewise.
13683 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
13684 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
13685 bitsetv_dump, debug_bitsetv): Likewise.
13686 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
13687 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
13688 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
13689 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
13690 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
13691 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
13692 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
13693 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
13694 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
13695 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
13696 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
13697 Likewise.
13698 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
13699 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
13700 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
13701 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
13702 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
13703 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
13704 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
13705 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
13706 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
13707 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
13708 lbitset_xor_cmp, lbitset_zero): Likewise.
13709
137102002-10-14 Akim Demaille <akim@epita.fr>
13711
13712 Version 1.75.
13713
137142002-10-14 Akim Demaille <akim@epita.fr>
13715
13716 * tests/Makefile.am (maintainer-check-posix): New.
13717
137182002-10-14 Akim Demaille <akim@epita.fr>
13719
13720 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
13721 member.
13722
137232002-10-14 Akim Demaille <akim@epita.fr>
13724
13725 * src/tables.c (table_ninf_remap): base -> tab.
13726 Reported by Matt Rosing.
13727
137282002-10-14 Paul Eggert <eggert@twinsun.com>
13729
13730 * tests/action.at, tests/calc.at, tests/conflicts.at,
13731 tests/cxx-type.at, tests/headers.at, tests/input.at,
13732 tests/regression.at, tests/synclines.at, tests/torture.at:
13733 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
13734 so that the tests still work even if POSIXLY_CORRECT is set.
13735 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
13736
13737 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
13738 for portability to K&R hosts. Fix typo: signed char is guaranteed
13739 only to 127, not to 128.
13740 * data/glr.c (yysigned_char): New type.
13741 * data/yacc.c (yysigned_char): Likewise.
13742 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
13743
137442002-10-13 Paul Eggert <eggert@twinsun.com>
13745
13746 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
13747 true due to limited range of data type" warning from GCC.
13748
13749 * data/c.m4 (b4_token_defines): Protect against double-inclusion
13750 by wrapping enum yytokentype's definition inside #ifndef
13751 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
13752
137532002-10-13 Akim Demaille <akim@epita.fr>
13754
13755 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
13756 Un yy- yyrhs to avoid the name clash with the global YYRHS.
13757
137582002-10-13 Akim Demaille <akim@epita.fr>
13759
13760 * Makefile.maint: Update from Autoconf 2.54.
13761 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
13762
137632002-10-13 Akim Demaille <akim@epita.fr>
13764
13765 * src/print.c (print_state): Separate the list of solved conflicts
13766 from the other items.
13767 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
13768
137692002-10-13 Akim Demaille <akim@epita.fr>
13770
13771 Let nondeterministic skeletons be usable with deterministic
13772 tables.
13773
13774 With the patch, GAWK compiled by GCC without -O2 passes its test
13775 suite using a GLR parser driven by LALR tables. It fails with -O2
13776 because `struct stat' gives two different answers on my machine:
13777 88 (definition of an auto var) and later 96 (memset on this var).
13778 Hence the stack is badly corrumpted. The headers inclusion is to
13779 blame: if I move the awk.h inclusion before GLR's system header
13780 inclusion, the two struct stat have the same size.
13781
13782 * src/tables.c (pack_table): Always create conflict_table.
13783 (token_actions): Always create conflict_list.
13784 * data/glr.c (YYFLAG): Remove, unused.
13785
137862002-10-13 Akim Demaille <akim@epita.fr>
13787
13788 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
13789 (O0FLAGS): New.
13790 (VALGRIND, GXX): New.
13791 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
13792 * tests/bison.in: Run $PREBISON a pre-command.
13793 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
13794 (maintainer-check-g++): New.
13795 * Makefile.am (maintainer-check): New.
13796
137972002-10-13 Akim Demaille <akim@epita.fr>
13798
13799 * data/glr.c: Formatting changes.
13800 Tweak some trace messages to match yacc.c's.
13801
138022002-10-13 Akim Demaille <akim@epita.fr>
13803
13804 GLR parsers sometimes raise parse errors instead of performing the
13805 default reduction.
13806 Reported by Charles-Henry de Boysson.
13807
13808 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
13809 check the length of the traces when %glr.
13810 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
13811 GLR's traces.
13812 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
13813 Test GLR parsers.
13814 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
13815 (yyltype): Remove the yy prefix from the member names.
13816 (yytable): Complete its comment.
13817 (yygetLRActions): Map error action number from YYTABLE from
13818 YYTABLE_NINF to 0.
13819 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
13820 (which was a bug: it should have been YYTABEL_NINF, and yet it was
13821 not satisfying as we could compare an YYACTION computed from
13822 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
13823 only value for error actions.
13824 (yyreportParseError): In verbose parse error messages, don't issue
13825 `error' in the list of expected tokens.
13826 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
13827 next action to perform to match glr.c's decoding.
13828 (yytable): Complete its comment.
13829
138302002-10-13 Paul Eggert <eggert@twinsun.com>
13831
13832 Fix problem reported by Henrik Grubbstroem in
13833 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
13834 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
13835 because the Bison parser reads the second action before reducing
13836 the first one.
13837 * src/scan-gram.l (rule_length): New static var.
13838 Use it to keep track of the rule length in the scanner, since
13839 we can't expect the parser to be in lock-step sync with the scanner.
13840 (handle_action_dollar, handle_action_at): Use this var.
13841 * tests/actions.at (Exotic Dollars): Test for the problem.
13842
138432002-10-12 Paul Eggert <eggert@twinsun.com>
13844
13845 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
13846 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
13847 Include <sys/time.h> when checking for clock_t and struct tms.
13848 Use same include order as source.
13849 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
13850 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
13851
13852 * lib/timevar.c: Update copyright date and clarify comments.
13853 (get_time) [IN_GCC]: Keep the GCC version for reference.
13854
13855 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
13856 GCC version as of today, then merge Bison's changes.
13857 Change "GCC" to "Bison" in copyright notice. timevar.def's
13858 author is Akim, so change that too.
13859
13860 * src/reader.c (grammar_current_rule_check):
13861 Don't worry about the default action if $$ is untyped.
13862 Prevents bogus warnings reported by Jim Gifford in
13863 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
13864
13865 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
13866 * data/glr.c, data/lalr1.cc, data/yacc.c:
13867 Output token definitions before the first part of user declarations.
13868 Fixes compatibility problem reported by Jim Gifford for kbd in
13869 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
13870
138712002-10-11 Paul Eggert <eggert@twinsun.com>
13872
13873 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
13874 (yyparse): here. This undoes some of the 2002-07-25 change.
13875 Compatibility problem reported by Ralf S. Engelschall with
13876 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
13877
138782002-10-11 Akim Demaille <akim@epita.fr>
13879
13880 * tests/regression.at Characters Escapes): New.
13881 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
13882 characters.
13883 Reported by Jan Nieuwenhuizen.
13884
138852002-10-11 Akim Demaille <akim@epita.fr>
13886
13887 * po/id.po: New.
13888
138892002-10-10 Paul Eggert <eggert@twinsun.com>
13890
13891 Portability fixes for bitsets; this also avoids several GCC
13892 warnings.
13893
13894 * lib/abitset.c: Include <stddef.h>, for offsetof.
13895 * lib/lbitset.c: Likewise.
13896
13897 * lib/abitset.c (abitset_bytes): Return a size that is aligned
13898 properly for vectors of objects. Do not assume that adding a
13899 header size to a multiple of a word size yields a value that is
13900 properly aligned for the whole union.
13901 * lib/bitsetv.c (bitsetv_alloc): Likewise.
13902
13903 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
13904 unique names for structures.
13905 * lib/ebitset.c (ebitset_bytes): Likewise.
13906 * lib/lbitset.c (lbitset_bytes): Likewise.
13907
13908 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
13909 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
13910 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
13911 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
13912 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
13913 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
13914 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
13915 to improve the type-checking that GCC can do.
13916 * lib/bitset.c (bitset_op4_cmp): Likewise.
13917 * lib/bitset_stats.c (bitset_stats_count,
13918 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
13919 bitset_stats_copy, bitset_stats_disjoint_p,
13920 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
13921 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
13922 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
13923 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
13924 bitset_stats_and_or_cmp, bitset_stats_andn_or,
13925 bitset_stats_andn_or_cmp, bitset_stats_or_and,
13926 bitset_stats_or_and_cmp): Likewise.
13927 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
13928 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
13929 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
13930 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
13931
13932 * lib/abitset.h: Include bitset.h, not bbitset.h.
13933 * lib/ebitset.h: Likewise.
13934 * lib/lbitset.h: Likewise.
13935
13936 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
13937 All instances of parameters of type enum bitset_opts are now of
13938 type enum_bitset_opts, to conform to the C Standard, and similarly
13939 for enum_bitset_type.
13940 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13941 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
13942
13943 Do not use "struct bitset_struct" to mean different things in
13944 different modules. Not only is this confusing, it violates
13945 the C Standard, which requires that structure types in different
13946 modules must be compatible if one is to be passed to the other.
13947 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
13948 All instances of "struct bitset_struct *" replaced with "bitset".
13949 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
13950 (union bitset_union, struct abitset_struct, struct ebitset_struct,
13951 struct lbitset_struct, struct bitset_stats_struct): New types.
13952 All uses of struct bitset_struct changed to union bitset_union,
13953 etc.
13954 * lib/abitset.c (struct abitset_struct, abitset,
13955 struct bitset_struct): Remove.
13956 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
13957 struct bitset_struct): Remove.
13958 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
13959 bitset_struct): Remove.
13960 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
13961 Likewise.
13962
13963 Do not call a function of type T using a call that assumes the
13964 function is of a different type U. Standard C requires that a
13965 function must be called with a type that is compatible with its
13966 definition.
13967 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13968 New decls.
13969 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
13970 New functions.
13971 * lib/ebitset.c (PFV): Remove.
13972 * lib/lbitset.c (PFV): Likewise.
13973 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
13974 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
13975 decls.
13976 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
13977 (ebitset_vtable): Use them.
13978 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
13979 lbitset_xor): New functions.
13980 (lbitset_vtable): Use them.
13981
13982 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
13983 Declare.
13984
13985 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
13986 GCC warning.
13987 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
13988 Use offsetof, for simplicity.
13989
139902002-10-06 Paul Eggert <eggert@twinsun.com>
13991
13992 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
13993 the same width as int. This reapplies a hunk of the 2002-08-12 patch
13994 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
13995 which was inadvertently undone by the 2002-09-30 patch.
13996 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
13997 the same width as int.
13998
139992002-10-04 Paul Eggert <eggert@twinsun.com>
14000
14001 Version 1.50.
14002
14003 * configure.ac (AC_INIT), NEWS: Increment version number.
14004
14005 * doc/bison.texinfo: Minor spelling, grammar, and white space
14006 fixes.
14007 (Symbols): Mention that any negative value returned from yylex
14008 signifies end-of-input. Warn about negative chars. Mention
14009 the portable Standard C character set.
14010
14011 The GNU coding standard says CFLAGS and YFLAGS are reserved
14012 for the installer to set.
14013 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
14014 * src/Makefile.am (AM_CFLAGS): Likewise.
14015 (AM_YFLAGS): Renamed from YFLAGS.
14016
14017 Fix some MAX and MIN problems.
14018 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
14019 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
14020 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
14021 * src/reader.c (reader): Use it.
14022
14023 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
14024 POSIX 1003.1-2001 has removed fgrep.
14025
140262002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
14027
14028 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
14029 interpreted as signed.
14030 * lib/ebitset.c (ebitset_list): Fix bug.
14031
140322002-10-01 Paul Eggert <eggert@twinsun.com>
14033
14034 More fixes for 64-bit hosts and large bitsets.
14035
14036 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
14037 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
14038 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
14039 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
14040 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
14041 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
14042 bitset_count_): Likewise.
14043 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
14044 bitset_first, bitset_last): Likewise.
14045 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
14046 bitset_stats_list_reverse, bitset_stats_size,
14047 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
14048 Likewise.
14049 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14050 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
14051 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
14052 bitsetv_reflexive_transitive_closure): Likewise.
14053 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
14054 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
14055 Likewise.
14056 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
14057 Likewise.
14058
14059 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
14060 Use size_t, not unsigned int, to count bytes.
14061 * lib/abitset.h (abitset_bytes): Likewise.
14062 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
14063 Likewise.
14064 * lib/bitset.h (bitset_bytes): Likewise.
14065 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
14066 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
14067 * lib/bitsetv.c (bitsetv_alloc): Likewise.
14068 * lib/ebitset.c (ebitset_bytes): Likewise.
14069 * lib/ebitset.h (ebitset_bytes): Likewise.
14070 * lib/lbitset.c (lbitset_bytes): Likewise.
14071 * lib/lbitset.h (lbitset_bytes): Likewise.
14072
14073 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
14074 abitset_subset_p, abitset_disjoint_p, abitset_and,
14075 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
14076 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
14077 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
14078 abitset_or_and, abitset_or_and_cmp):
14079 Use bitset_windex instead of unsigned int.
14080 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
14081 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
14082 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
14083 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
14084 Likewise.
14085 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
14086
14087 * lib/bitset.c (bitset_print):
14088 Use proper printf formats for widths of integer types.
14089 * lib/bitset_stats.c (bitset_percent_histogram_print,
14090 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
14091 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14092 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
14093 * lib/lbitset.c (lbitset_bytes): Likewise.
14094
14095 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
14096 BITSET_SIZE_MAX): New macros.
14097 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
14098 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
14099 to BITSET_WINDEX_MAX.
14100
14101 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
14102 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
14103 since we now return the bitset_bindex type (not int).
14104
14105 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
14106 when computing sizes.
14107 * lib/ebitset.c (ebitset_elts_grow): Likewise.
14108
14109 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
14110 and avoid cast to unsigned.
14111
141122002-09-30 Akim Demaille <akim@epita.fr>
14113
14114 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
14115 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
14116 Updates from Michael Hayes.
14117
141182002-09-30 Art Haas <ahaas@neosoft.com>
14119
14120 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
14121 invocations.
14122 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
14123 defined.
14124
141252002-09-27 Akim Demaille <akim@epita.fr>
14126
14127 Version 1.49c.
14128
141292002-09-27 Akim Demaille <akim@epita.fr>
14130
14131 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
14132 (Because of AC_LIBSOURCE).
14133
141342002-09-27 Akim Demaille <akim@epita.fr>
14135
14136 Playing with Autoscan.
14137
14138 * configure.ac: Remove the old LIBOBJ tweaks.
14139 (AC_REPLACE_FUNCS): Add strrchr and strtol.
14140 * lib/strrchr.c: New.
14141 * lib/strtol.c: New, from the Coreutils 4.5.1.
14142
141432002-09-27 Akim Demaille <akim@epita.fr>
14144
14145 Playing with Autoscan.
14146
14147 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
14148 * lib/Makefile.am (libbison_a_SOURCES): No longer include
14149 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
14150 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
14151 Coreutils 4.5.1.
14152
141532002-09-24 Akim Demaille <akim@epita.fr>
14154
14155 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
14156 (Frequently Asked Questions, Parser Stack Overflow): New.
14157
141582002-09-13 Akim Demaille <akim@epita.fr>
14159
14160 Playing with autoscan.
14161
14162 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
14163 * src/files.c (skeleton_find): Remove, unused.
14164 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
14165 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
14166
141672002-09-13 Akim Demaille <akim@epita.fr>
14168
14169 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
14170 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
14171
141722002-09-13 Akim Demaille <akim@epita.fr>
14173
14174 * configure.ac: Require 2.54.
14175 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
14176 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
14177 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
14178 Remove, provided by Autoconf macros.
14179
141802002-09-12 Akim Demaille <akim@epita.fr>
14181
14182 * m4/prereq.m4: Update, from Coreutils 4.5.1.
14183
141842002-09-12 Akim Demaille <akim@epita.fr>
14185
14186 * m4/prereq.m4: Update, from Fileutils 4.1.5.
14187 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
14188 Reported by Martin Mokrejs.
14189
141902002-09-10 Akim Demaille <akim@epita.fr>
14191
14192 * src/parse-gram.y: Associate a human readable string to each
14193 token type.
14194 * tests/regression.at (Invalid inputs): Adjust.
14195
141962002-09-10 Gary V. Vaughan <gary@gnu.org>
14197
14198 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
14199 with an Autoconf-2.5x style configure.ac.
14200
142012002-09-06 Paul Eggert <eggert@twinsun.com>
14202
14203 * doc/bison.texinfo (Conditions): Make explicit that the GPL
14204 exception applies only to yacc.c. This is a modification of a
14205 patch originally suggested by Akim Demaille.
14206
142072002-09-06 Akim Demaille <akim@epita.fr>
14208
14209 * data/c.m4 (b4_copyright): Move the GPL exception comment from
14210 here to...
14211 * data/yacc.c: here.
14212
14213 * data/lalr1.cc (struct yyltype): Don't define it, since we use
14214 LocationType.
14215 (b4_ltype): Default to yy::Location from location.hh.
14216
142172002-09-04 Jim Meyering <jim@meyering.net>
14218
14219 * data/yacc.c: Guard the declaration of yytoknum also with
14220 `#ifdef YYPRINT', so it is declared only when used.
14221
142222002-09-04 Akim Demaille <akim@epita.fr>
14223
14224 * configure.in: Rename as...
14225 * configure.ac: this.
14226 Bump to 1.49c.
14227
142282002-09-04 Akim Demaille <akim@epita.fr>
14229
14230 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
14231 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
14232 translate maintainer only messages.
14233
142342002-08-12 Paul Eggert <eggert@twinsun.com>
14235
14236 Version 1.49b.
14237
14238 * Makefile.am (SUBDIRS): Remove intl.
14239 (DISTCLEANFILES): Remove.
14240 * NEWS: Mention that GNU M4 is now required. Clarify what is
14241 meant by "larger grammars". Mention the pt_BR translation.
14242 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
14243 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
14244 Bump version from 0.11.2 to 0.11.5.
14245 (BISON_PREREQ_STAGE): Remove.
14246 (AM_GNU_GETTEXT): Use external gettext.
14247 (AC_OUTPUT): Remove intl/Makefile.
14248
14249 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
14250
14251 * data/glr.c: Include string.h, for strlen.
14252 (yyreportParseError): Use size_t for yysize.
14253 (yy_yypstack): No longer nested inside yypstates, as nested
14254 functions are not portable. Do not assume size_t is the
14255 same width as int.
14256 (yypstates): Do not assume that ptrdiff_t is the same width
14257 as int, and similarly for yyposn and YYINDEX.
14258
14259 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
14260
14261 * lib/Makefile.am (INCLUDES): Do not include from the intl
14262 directory, which has been removed.
14263 * src/Makefile.am (INCLUDES): Likewise.
14264
14265 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
14266 (bitsets_sources, additional_bitsets_sources, timevars_sources):
14267 New vars.
14268
14269 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
14270 * tests/Makefile.am (EXTRA_DIST): Likewise.
14271
14272 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
14273 Do not assume that bitset_windex is the same width as unsigned.
14274
14275 * lib/abitset.c (abitset_unused_clear): Do not assume that
14276 bitset_word is the same width as int.
14277 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
14278 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
14279 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
14280 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
14281 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
14282
14283 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
14284 portability to one's complement hosts!).
14285 * lib/ebitset.c (ebitset_op1): Likewise.
14286 * lib/lbitset.c (lbitset_op1): Likewise.
14287
14288 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
14289 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
14290 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
14291 Sync with fileutils.
14292 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
14293 lib/gettext.h: Sync with diffutils.
14294
14295 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
14296 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
14297
14298 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
14299 PROTOTYPES to check for prototypes, and "defined __STDC__" to
14300 check for void *.
14301
14302 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
14303 size_t; the old version tried to do this but casted improperly.
14304 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
14305 (bitset_test): Now returns int, not unsigned long.
14306
14307 * lib/bitset_stats.c: Include "gettext.h".
14308 (_): New macro.
14309 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
14310 name locals "index", as it generates unnecessary warnings on some
14311 hosts that have an "index" function.
14312
14313 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
14314 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
14315 they need translation.
14316 * src/LR0.c (state_list_append, new_itemsets, get_state,
14317 append_states, generate_states): Likewise.
14318 * src/assoc.c (assoc_to_string): Likewise.
14319 * src/closure.c (print_closure, set_firsts, closure): Likewise.
14320 * src/gram.c (grammar_dump): Likewise.
14321 * src/injections.c (injections_compute): Likewise.
14322 * src/lalr.c (lookaheads_print): Likewise.
14323 * src/relation.c (relation_transpose): Likewise.
14324 * src/scan-gram.l: Likewise.
14325 * src/tables.c (table_grow, pack_vector): Likewise.
14326
14327 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
14328 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
14329 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
14330 * m4/mbstate_t.m4: Sync with fileutils.
14331 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
14332
14333 * po/LINGUAS: Add pt_BR.
14334 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
14335 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
14336 lib/timevar.c.
14337 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
14338 manual recommends.
14339 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
14340
14341 * src/complain.c (strerror_r): Remove decl; not needed.
14342 (strerror): Use same pattern as ../lib/error.c.
14343
14344 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
14345
14346 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
14347
14348 * src/main.c (main): Cast result of bindtextdomain and textdomain
14349 to void, to avoid a GCC warning when --disable-nls is in effect.
14350
14351 * src/scan-gram.l: Use strings rather than escapes when possible,
14352 to minimize the number of warnings from xgettext.
14353 (handle_action_dollar, handle_action_at): Don't use isdigit,
14354 as it mishandles negative chars and it may not work as expected
14355 outside the C locale.
14356
14357 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
14358 this is a GCC extension and is not portable to other compilers.
14359
14360 * src/system.h (alloca): Use same pattern as ../lib/error.c.
14361 Do not include <ctype.h>; no longer needed.
14362 Do not include <malloc.h>; no longer needed (and generates
14363 warnings on OpenBSD 3.0).
14364
14365 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
14366 it's not portable.
14367
14368 * tests/regression.at: Do not use 'cc -c input.c -o input';
14369 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
14370
14371 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
14372 exit status as failure, not just exit status 1. Sun C exits
14373 with status 2 sometimes.
14374
14375 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
14376 Use it for the two large tests.
14377
143782002-08-02 Akim Demaille <akim@epita.fr>
14379
14380 * src/conflicts.c (conflicts_output): Don't output rules never
14381 reduced here, since anyway that computation doesn't work.
14382 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
14383 (rule_useless_p, rule_never_reduced_p): New.
14384 (grammar_rules_partial_print): Use a filter instead of a range.
14385 Display the title only if needed.
14386 (grammar_rules_print): Adjust.
14387 (grammar_rules_never_reduced_report): New.
14388 * src/tables.c (action_row): Move the computation of rules never
14389 reduced to...
14390 (token_actions): here.
14391 * src/main.c (main): Make the parser before making the report, so
14392 that rules never reduced are computed.
14393 Call grammar_rules_never_reduced_report.
14394 * src/print.c (print_results): Report rules never reduced.
14395 * tests/conflicts.at, tests/reduce.at: Adjust.
14396
143972002-08-01 Akim Demaille <akim@epita.fr>
14398
14399 Instead of attaching lookaheads and duplicating the rules being
14400 reduced by a state, attach the lookaheads to the reductions.
14401
14402 * src/state.h (state_t): Remove the `lookaheads',
14403 `lookaheads_rule' member.
14404 (reductions_t): Add a `lookaheads' member.
14405 Use a regular array for the `rules'.
14406 * src/state.c (reductions_new): Initialize the lookaheads member
14407 to 0.
14408 (state_rule_lookaheads_print): Adjust.
14409 * src/state.h, src/state.c (state_reductions_find): New.
14410 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
14411 (count_rr_conflicts): Adjust.
14412 * src/lalr.c (LArule): Remove.
14413 (add_lookback_edge): Adjust.
14414 (state_lookaheads_count): New.
14415 (states_lookaheads_initialize): Merge into...
14416 (initialize_LA): this.
14417 (lalr_free): Adjust.
14418 * src/main.c (main): Don't free nullable and derives too early: it
14419 is used by --verbose.
14420 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
14421
144222002-08-01 Akim Demaille <akim@epita.fr>
14423
14424 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
14425 `rule_number_t**'.
14426 (set_derives, free_derives): Rename as...
14427 (derives_compute, derives_free): this.
14428 Adjust all dependencies.
14429 * src/nullable.c (set_nullable, free_nullable): Rename as...
14430 (nullable_compute, nullable_free): these.
14431 (rule_list_t): Store rule_t *, not rule_number_t.
14432 * src/state.c (state_rule_lookaheads_print): Directly compare rule
14433 pointers, instead of their numbers.
14434 * src/main.c (main): Call nullable_free, and derives_free earlier,
14435 as they were lo longer used.
14436
144372002-08-01 Akim Demaille <akim@epita.fr>
14438
14439 * lib/timevar.c (get_time): Include children time.
14440 * src/lalr.h (LA, LArule): Don't export them: used with the
14441 state_t.
14442 * src/lalr.c (LA, LArule): Static.
14443 * src/lalr.h, src/lalr.c (lalr_free): New.
14444 * src/main.c (main): Call it.
14445 * src/tables.c (pack_vector): Check whether loc is >= to the
14446 table_size, not >.
14447 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
14448 (tables_generate): do it, since that's also it which allocates
14449 them.
14450 Don't free LA and LArule, main does.
14451
144522002-07-31 Akim Demaille <akim@epita.fr>
14453
14454 Separate parser tables computation and output.
14455
14456 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
14457 (conflict_list, conflict_list_cnt, table, check, table_ninf)
14458 (yydefgoto, yydefact, high): Move to...
14459 * src/tables.h, src/tables.c: here.
14460 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14461 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14462 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
14463 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
14464 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
14465 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
14466 (action_row, save_row, token_actions, save_column, default_goto)
14467 (goto_actions, sort_actions, matching_state, pack_vector)
14468 (table_ninf_remap, pack_table, prepare_actions): Move to...
14469 * src/tables.c: here.
14470 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
14471 * src/output.c (token_actions, output_base, output_conflicts)
14472 (output_check): Merge into...
14473 (prepare_actions): this.
14474 (actions_output): Rename as...
14475 (user_actions_output): this.
14476 * src/main.c (main): Call tables_generate and tables_free.
14477
144782002-07-31 Akim Demaille <akim@epita.fr>
14479
14480 Steal GCC's --time-report support.
14481
14482 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
14483 stolen/adjusted from GCC.
14484 * m4/stage.m4: Remove time related checks.
14485 * m4/timevar.m4: New.
14486 * configure.in: Adjust.
14487 * src/system.h: Adjust to using timevar.h.
14488 * src/getargs.h, src/getargs.c: Support trace_time for
14489 --trace=time.
14490 * src/main.c (stage): Remove.
14491 (main): Replace `stage' invocations with timevar calls.
14492 * src/output.c: Insert pertinent timevar calls.
14493
144942002-07-31 Akim Demaille <akim@epita.fr>
14495
14496 Let --trace have arguments.
14497
14498 * src/getargs.h (enum trace_e): New.
14499 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
14500 (long_options, short_options): --trace/-T takes an optional
14501 argument.
14502 Change all the uses of trace_flag to reflect the new flags.
14503 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
14504
14505 Strengthen `stage' portability.
14506
14507 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
14508 * configure.in: Use it.
14509 Don't check for malloc.h and sys/times.h.
14510 * src/system.h: Include them when appropriate.
14511 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
14512 times and struct tms are available.
14513
145142002-07-30 Akim Demaille <akim@epita.fr>
14515
14516 In verbose parse error message, don't report `error' as an
14517 expected token.
14518 * tests/actions.at (Printers and Destructors): Adjust.
14519 * tests/calc.at (Calculator $1): Adjust.
14520 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
14521 error message, do not report the parser accepts the error token in
14522 that state.
14523
145242002-07-30 Akim Demaille <akim@epita.fr>
14525
14526 Normalize conflict related messages.
14527
14528 * src/complain.h, src/complain.c (warn, complain): New.
14529 * src/conflicts.c (conflicts_print): Use them.
14530 (conflict_report_yacc): New, extracted from...
14531 (conflicts_print): here.
14532 * tests/conflicts.at, tests/existing.at: Adjust.
14533
145342002-07-30 Akim Demaille <akim@epita.fr>
14535
14536 Report rules which are never reduced by the parser: those hidden
14537 by conflicts.
14538
14539 * src/LR0.c (save_reductions): Don't make the final state too
14540 different: save its reduction (accept) instead of having a state
14541 without any action (no shift or goto, no reduce).
14542 Note: the final state is now a ``regular'' state, i.e., the
14543 parsers now contain `reduce 0' as default reduction.
14544 Nevertheless, since they decide to `accept' when yystate =
14545 final_state, they still will not reduce rule 0.
14546 * src/print.c (print_actions, print_reduction): Adjust.
14547 * src/output.c (action_row): Track reduced rules.
14548 (token_actions): Report rules never reduced.
14549 * tests/conflicts.at, tests/regression.at: Adjust.
14550
145512002-07-30 Akim Demaille <akim@epita.fr>
14552
14553 `stage' was accidently included in a previous patch.
14554 Initiate its autoconfiscation.
14555
14556 * configure.in: Look for malloc.h and sys/times.h.
14557 * src/main.c (stage): Adjust.
14558 Report only when trace_flag.
14559
145602002-07-29 Akim Demaille <akim@epita.fr>
14561
14562 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
14563 state_number_t.
14564 (errs_t): symbol_t*, not symbol_number_t.
14565 (reductions_t): rule_t*, not rule_number_t.
14566 (FOR_EACH_SHIFT): New.
14567 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
14568 * src/print.c, src/print_graph.c: Adjust.
14569
145702002-07-29 Akim Demaille <akim@epita.fr>
14571
14572 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
14573
14574 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
14575 (endtoken, accept): these.
14576 * src/reader.c (reader): Set endtoken's default tag to "$end".
14577 Set undeftoken's tag to "$undefined" instead of "$undefined.".
14578 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
14579 Adjust.
14580
145812002-07-29 Akim Demaille <akim@epita.fr>
14582
14583 * src/reduce.c (reduce_grammar): When the language is empty,
14584 complain about the start symbol, not the axiom.
14585 Use its location.
14586 * tests/reduce.at (Empty Language): New.
14587
145882002-07-26 Akim Demaille <akim@epita.fr>
14589
14590 * src/reader.h, src/reader.c (gram_error): ... can't get
14591 yycontrol without making too strong assumptions on the parser
14592 itself.
14593 * src/output.c (prepare_tokens): Use the real 0th value of
14594 token_translations instead of `0'.
14595 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
14596 visible here.
14597 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
14598 for the time being: %locations ought to provide it to yyerror.
14599
146002002-07-25 Akim Demaille <akim@epita.fr>
14601
14602 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
14603 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
14604 * tests/regression.at (Web2c Actions): Adjust.
14605
146062002-07-25 Akim Demaille <akim@epita.fr>
14607
14608 Stop storing rules from 1 to nrules + 1.
14609
14610 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
14611 * src/nullable.c, src/output.c, src/print.c, src/reader.c
14612 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
14613 Iterate from 0 to nrules.
14614 Use rule_number_as_item_number and item_number_as_rule_number.
14615 Adjust to `derive' now containing possibly 0.
14616 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
14617 Handle the `- 1' part in rule numbers from/to item numbers.
14618 * src/conflicts.c (log_resolution): Fix the message which reversed
14619 shift and reduce.
14620 * src/output.c (action_row): Initialize default_rule to -1.
14621 (token_actions): Adjust.
14622 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
14623 expected output.
14624 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
14625
146262002-07-25 Akim Demaille <akim@epita.fr>
14627
14628 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
14629 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
14630 (b4_c_knr_arg_decl): New.
14631 * data/yacc.c: Use it to define yysymprint, yydestruct, and
14632 yyreport_parse_error.
14633
146342002-07-25 Akim Demaille <akim@epita.fr>
14635
14636 * data/yacc.c (yyreport_parse_error): New, extracted from...
14637 (yyparse): here.
14638 (yydestruct, yysymprint): Move above yyparse.
14639 Be K&R compliant.
14640
146412002-07-25 Akim Demaille <akim@epita.fr>
14642
14643 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
14644 replace...
14645 (b4_sint_type, b4_uint_type): these.
14646 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
14647 * tests/regression.at (Web2c Actions): Adjust.
14648
146492002-07-25 Akim Demaille <akim@epita.fr>
14650
14651 * src/gram.h (TIEM_NUMBER_MAX): New.
14652 (item_number_of_rule_number, rule_number_of_item_number): Rename
14653 as...
14654 (rule_number_as_item_number, item_number_as_rule_number): these.
14655 Adjust dependencies.
14656 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14657 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14658 (symbol_number_to_vector_number): New.
14659 (order): Of vector_number_t* type.
14660 (base_t, BASE_MAX, BASE_MIN): New.
14661 (froms, tos, width, pos, check): Of base_t type.
14662 (action_number_t, ACTION_MIN, ACTION_MAX): New.
14663 (actrow): Of action_number_t type.
14664 (conflrow): Of unsigned int type.
14665 (table_ninf, base_ninf): New.
14666 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
14667 (muscle_insert_int_table, muscle_insert_base_table)
14668 (muscle_insert_rule_number_table): New.
14669 (prepare_tokens): Output `toknum' as int_table.
14670 (action_row): Returns a rule_number_t.
14671 Use ACTION_MIN, not SHRT_MIN.
14672 (token_actions): yydefact is rule_number_t*.
14673 (table_ninf_remap): New.
14674 (pack_table): Use it for `base' and `table'.
14675 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
14676 replaced with...
14677 (YYPACT_NINF, YYTABLE_NINF): these.
14678 (yypact, yytable): Compute their types instead of hard-coded
14679 `short'.
14680 * tests/regression.at (Web2c Actions): Adjust.
14681
146822002-07-19 Akim Demaille <akim@epita.fr>
14683
14684 * src/scan-gram.l (id): Can start with an underscore.
14685
146862002-07-16 Akim Demaille <akim@epita.fr>
14687
14688 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
14689 Adjust all former `associativity' dependencies.
14690 * src/symtab.c (symbol_new): Default associativity is `undef', not
14691 `right'.
14692 (symbol_check_alias_consistence): Adjust.
14693
146942002-07-09 Akim Demaille <akim@epita.fr>
14695
14696 * doc/bison.texinfo: Properly set the ``header'' part.
14697 Use @dircategory ``GNU programming tools'' as per Texinfo's
14698 documentation.
14699 Use @copying.
14700
147012002-07-09 Akim Demaille <akim@epita.fr>
14702
14703 * lib/quotearg.h: Protect against multiple inclusions.
14704 * src/location.h (location_t): Add a `file' member.
14705 (LOCATION_RESET, LOCATION_PRINT): Adjust.
14706 * src/complain.c (warn_at, complain_at, fatal_at): Drop
14707 `error_one_per_line' support.
14708
147092002-07-09 Akim Demaille <akim@epita.fr>
14710
14711 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
14712 * src/reader.c (lineno): Remove.
14713 Adjust all dependencies.
14714 (get_merge_function): Take a location and use complain_at.
14715 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
14716 * tests/regression.at (Invalid inputs, Mixing %token styles):
14717 Adjust.
14718
147192002-07-09 Akim Demaille <akim@epita.fr>
14720
14721 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
14722 recovery rule, and forbid extensions when --yacc.
14723 (gram_error): Use complain_at.
14724 * src/reader.c (reader): Exit if there were parse errors.
14725
147262002-07-09 Akim Demaille <akim@epita.fr>
14727
14728 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
14729 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
14730 Reported by R Blake <blakers@mac.com>.
14731
147322002-07-09 Akim Demaille <akim@epita.fr>
14733
14734 * data/yacc.c: Output the copyright notive in the header.
14735
147362002-07-03 Akim Demaille <akim@epita.fr>
14737
14738 * src/output.c (froms, tos): Are state_number_t.
14739 (save_column): sp, sp1, and sp2 are state_number_t.
14740 (prepare): Rename `final' as `final_state_number', `nnts' as
14741 `nterms_number', `nrules' as `rules_number', `nstates' as
14742 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
14743 unused.
14744 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
14745 * data/lalr1.cc (nsym_): Remove, unused.
14746
147472002-07-03 Akim Demaille <akim@epita.fr>
14748
14749 * src/lalr.h, src/lalr.c (goto_number_t): New.
14750 * src/lalr.c (goto_list_t): New.
14751 Propagate them.
14752 * src/nullable.c (rule_list_t): New.
14753 Propagate.
14754 * src/types.h: Remove.
14755
147562002-07-03 Akim Demaille <akim@epita.fr>
14757
14758 * src/closure.c (print_fderives): Use rule_rhs_print.
14759 * src/derives.c (print_derives): Use rule_rhs_print.
14760 (rule_list_t): New, replaces `shorts'.
14761 (set_derives): Add comments.
14762 * tests/sets.at (Nullable, Firsts): Adjust.
14763
147642002-07-03 Akim Demaille <akim@epita.fr>
14765
14766 * src/output.c (prepare_actions): Free `tally' and `width'.
14767 (prepare_actions): Allocate and free `order'.
14768 * src/symtab.c (symbols_free): Free `symbols'.
14769 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
14770 * src/output.c (m4_invoke): Move to...
14771 * src/scan-skel.l: here.
14772 (<<EOF>>): Close yyout, and free its name.
14773
147742002-07-03 Akim Demaille <akim@epita.fr>
14775
14776 Fix some memory leaks, and fix a bug: state 0 was examined twice.
14777
14778 * src/LR0.c (new_state): Merge into...
14779 (state_list_append): this.
14780 (new_states): Merge into...
14781 (generate_states): here.
14782 (set_states): Don't ensure a proper `errs' state member here, do it...
14783 * src/conflicts.c (conflicts_solve): here.
14784 * src/state.h, src/state.c: Comment changes.
14785 (state_t): Rename member `shifts' as `transitions'.
14786 Adjust all dependencies.
14787 (errs_new): For consistency, also take the values as argument.
14788 (errs_dup): Remove.
14789 (state_errs_set): New.
14790 (state_reductions_set, state_transitions_set): Assert that no
14791 previous value was assigned.
14792 (state_free): New.
14793 (states_free): Use it.
14794 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
14795 temporary storage: use `errs' and `nerrs' as elsewhere.
14796 (set_conflicts): Allocate and free this `errs'.
14797
147982002-07-02 Akim Demaille <akim@epita.fr>
14799
14800 * lib/libiberty.h: New.
14801 * lib: Update the bitset implementation from upstream.
14802 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
14803 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
14804 * src/main.c: Adjust bitset stats calls.
14805
148062002-07-01 Paul Eggert <eggert@twinsun.com>
14807
14808 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
14809 char, so that negative chars don't collide with $.
14810
148112002-06-30 Akim Demaille <akim@epita.fr>
14812
14813 Have the GLR tests be `warning' checked, and fix the warnings.
14814
14815 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
14816 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
14817 (yyremoveDeletes): `yyi' and `yyj' are size_t.
14818 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
14819 (yyaddDeferredAction): static.
14820 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
14821 (yyreportParseError): yyprefix is const.
14822 yytokenp is used only when verbose.
14823 (yy__GNUC__): Replace with __GNUC__.
14824 (yypdumpstack): yyi is size_t.
14825 (yypreference): Un-yy local variables and arguments, to avoid
14826 clashes with `yyr1'. Anyway, we are not in the user name space.
14827 (yytname_size): be an int, as is compared with ints.
14828 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
14829 Use them.
14830 * tests/cxx-gram.at: Use quotation to protect $1.
14831 Use AT_COMPILE to enable warnings hunts.
14832 Prototype yylex and yyerror.
14833 `Use' argc.
14834 Include `string.h', not `strings.h'.
14835 Produce and prototype stmtMerge only when used.
14836 yylex takes a location.
14837
148382002-06-30 Akim Demaille <akim@epita.fr>
14839
14840 We spend a lot of time in quotearg, in particular when --verbose.
14841
14842 * src/symtab.c (symbol_get): Store a quoted version of the key.
14843 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
14844 Adjust all callers.
14845
148462002-06-30 Akim Demaille <akim@epita.fr>
14847
14848 * src/state.h (reductions_t): Rename member `nreds' as num.
14849 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
14850 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
14851
148522002-06-30 Akim Demaille <akim@epita.fr>
14853
14854 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
14855 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
14856 (shifts_to): Rename as...
14857 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
14858 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
14859 (TRANSITION_IS_DISABLED, transitions_to): these.
14860
148612002-06-30 Akim Demaille <akim@epita.fr>
14862
14863 * src/print.c (print_shifts, print_gotos): Merge into...
14864 (print_transitions): this.
14865 (print_transitions, print_errs, print_reductions): Align the
14866 lookaheads columns.
14867 (print_core, print_transitions, print_errs, print_state,
14868 print_grammar): Output empty lines separator before, not after.
14869 (state_default_rule_compute): Rename as...
14870 (state_default_rule): this.
14871 * tests/conflicts.at (Defaulted Conflicted Reduction),
14872 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
14873 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
14874
148752002-06-30 Akim Demaille <akim@epita.fr>
14876
14877 Display items as we display rules.
14878
14879 * src/gram.h, src/gram.c (rule_lhs_print): New.
14880 * src/gram.c (grammar_rules_partial_print): Use it.
14881 * src/print.c (print_core): Likewise.
14882 * tests/conflicts.at (Defaulted Conflicted Reduction),
14883 (Unresolved SR Conflicts): Adjust.
14884 (Unresolved SR Conflicts): Adjust and rename as...
14885 (Resolved SR Conflicts): this, as was meant.
14886 * tests/regression.at (Web2c Report): Adjust.
14887
148882002-06-30 Akim Demaille <akim@epita.fr>
14889
14890 * src/print.c (state_default_rule_compute): New, extracted from...
14891 (print_reductions): here.
14892 Pessimize, but clarify the code.
14893 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
14894
148952002-06-30 Akim Demaille <akim@epita.fr>
14896
14897 * src/output.c (action_row): Let default_rule be always a rule
14898 number.
14899
149002002-06-30 Akim Demaille <akim@epita.fr>
14901
14902 * src/closure.c (print_firsts, print_fderives, closure):
14903 Use BITSET_EXECUTE.
14904 * src/lalr.c (lookaheads_print): Likewise.
14905 * src/state.c (state_rule_lookaheads_print): Likewise.
14906 * src/print_graph.c (print_core): Likewise.
14907 * src/print.c (print_reductions): Likewise.
14908 * src/output.c (action_row): Likewise.
14909 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
14910
149112002-06-30 Akim Demaille <akim@epita.fr>
14912
14913 * src/print_graph.c: Use report_flag.
14914
149152002-06-30 Akim Demaille <akim@epita.fr>
14916
14917 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
14918 to...
14919 * src/relation.h, src/relation.c (traverse, relation_digraph)
14920 (relation_print, relation_transpose): New.
14921
149222002-06-30 Akim Demaille <akim@epita.fr>
14923
14924 * src/state.h, src/state.c (shifts_to): New.
14925 * src/lalr.c (build_relations): Use it.
14926
149272002-06-30 Akim Demaille <akim@epita.fr>
14928
14929 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
14930 (item_number_of_rule_number, rule_number_of_item_number): New.
14931 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
14932 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14933 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
14934 Propagate their use.
14935 Much remains to be done, in particular wrt `shorts' from types.h.
14936
149372002-06-30 Akim Demaille <akim@epita.fr>
14938
14939 * src/symtab.c (symbol_new): Initialize the `printer' member.
14940
149412002-06-30 Akim Demaille <akim@epita.fr>
14942
14943 * src/LR0.c (save_reductions): Remove, replaced by...
14944 * src/state.h, src/state.c (state_reductions_set): New.
14945 (reductions, errs): Rename as...
14946 (reductions_t, errs_t): these.
14947 Adjust all dependencies.
14948
149492002-06-30 Akim Demaille <akim@epita.fr>
14950
14951 * src/LR0.c (state_list_t, state_list_append): New.
14952 (first_state, last_state): Now symbol_list_t.
14953 (this_state): Remove.
14954 (new_itemsets, append_states, save_reductions): Take a state_t as
14955 argument.
14956 (set_states, generate_states): Adjust.
14957 (save_shifts): Remove, replaced by...
14958 * src/state.h, src/state.c (state_shifts_set): New.
14959 (shifts): Rename as...
14960 (shifts_t): this.
14961 Adjust all dependencies.
14962 * src/state.h (state_t): Remove the `next' member.
14963
149642002-06-30 Akim Demaille <akim@epita.fr>
14965
14966 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
14967 escaped in slot 0.
14968
149692002-06-30 Akim Demaille <akim@epita.fr>
14970
14971 Use hash.h for the state hash table.
14972
14973 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
14974 (allocate_storage): Use state_hash_new.
14975 (free_storage): Use state_hash_free.
14976 (new_state, get_state): Adjust.
14977 * src/lalr.h, src/lalr.c (states): Move to...
14978 * src/states.h (state_t): Remove the `link' member, no longer
14979 used.
14980 * src/states.h, src/states.c: here.
14981 (state_hash_new, state_hash_free, state_hash_lookup)
14982 (state_hash_insert, states_free): New.
14983 * src/states.c (state_table, state_compare, state_hash): New.
14984 * src/output.c (output_actions): Do not free states now, since we
14985 still need to know the final_state number in `prepare', called
14986 afterwards. Do it...
14987 * src/main.c (main): here: call states_free after `output'.
14988
149892002-06-30 Akim Demaille <akim@epita.fr>
14990
14991 * src/state.h, src/state.c (state_new): New, extracted from...
14992 * src/LR0.c (new_state): here.
14993 * src/state.h (STATE_ALLOC): Move to...
14994 * src/state.c: here.
14995 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
14996 * src/state.h, src/state.c: here.
14997
149982002-06-30 Akim Demaille <akim@epita.fr>
14999
15000 * src/reader.c (gensym): Rename as...
15001 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
15002 (getsym): Rename as...
15003 (symbol_get): this.
15004
150052002-06-30 Akim Demaille <akim@epita.fr>
15006
15007 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
15008 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
15009 * src/output.c, src/print.c, src/print_graph.c: Propagate.
15010 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
15011
150122002-06-30 Akim Demaille <akim@epita.fr>
15013
15014 Make the test suite pass with warnings checked.
15015
15016 * tests/actions.at (Printers and Destructors): Improve.
15017 Avoid unsigned vs. signed issues.
15018 * tests/calc.at: Don't exercise the scanner here, do it...
15019 * tests/input.at (Torturing the Scanner): here.
15020
150212002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15022
15023 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
15024 reorganize first lines parallel to yacc.c.
15025
150262002-06-28 Akim Demaille <akim@epita.fr>
15027
15028 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
15029 (b4_token_enum, b4_token_defines): New, factored from...
15030 * data/lalr1.cc, data/yacc.c, glr.c: here.
15031
150322002-06-28 Akim Demaille <akim@epita.fr>
15033
15034 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
15035 unused variables.
15036 * src/output.c (merger_output): static.
15037
150382002-06-28 Akim Demaille <akim@epita.fr>
15039
15040 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
15041 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
15042 pacify GCC.
15043 * src/output.c (save_row): Initialize all the variables to pacify GCC.
15044
150452002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15046
15047 Accumulated changelog for new GLR parsing features.
15048
15049 * src/conflicts.c (count_total_conflicts): Change name to
15050 conflicts_total_count.
15051 * src/conflicts.h: Ditto.
15052 * src/output.c (token_actions): Use the new name.
15053 (output_conflicts): Change conflp => conflict_list_heads, and
15054 confl => conflict_list for better readability.
15055 * data/glr.c: Use the new names.
15056 * NEWS: Add self to GLR announcement.
15057
15058 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
15059
15060 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
15061 Akim Demaille.
15062
15063 * data/bison.glr: Change name to glr.c
15064 * data/glr.c: Renamed from bison.glr.
15065 * data/Makefile.am: Add glr.c
15066
15067 * src/getargs.c:
15068
15069 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
15070 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
15071
15072 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15073
15074 * data/bison.glr: Be sure to restore the
15075 current #line when returning to the skeleton contents after having
15076 exposed the input file's #line.
15077
15078 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15079
15080 * data/bison.glr: Bring up to date with changes to bison.simple.
15081
15082 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15083
15084 * data/bison.glr: Correct definitions that use b4_prefix.
15085 Various reformatting.
15086 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
15087 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
15088 yytokenp argument; now part of stack.
15089 (yychar): Define to behave as documented.
15090 (yyclearin): Ditto.
15091
15092 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15093
15094 * src/reader.h: Add declaration for free_merger_functions.
15095
15096 * src/reader.c (merge_functions): New variable.
15097 (get_merge_function): New function.
15098 (free_merger_functions): New function.
15099 (readgram): Check for %prec that is not followed by a symbol.
15100 Handle %dprec and %merge declarations.
15101 (packgram): Initialize dprec and merger fields in rules array.
15102
15103 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
15104 conflict_list_cnt, conflict_list_free): New variables.
15105 (table_grow): Also grow conflict_table.
15106 (prepare_rules): Output dprec and merger tables.
15107 (conflict_row): New function.
15108 (action_row): Output conflict lists for GLR parser. Don't use
15109 default reduction in conflicted states for GLR parser so that there
15110 are spaces for the conflict lists.
15111 (save_row): Also save conflict information.
15112 (token_actions): Allocate conflict list.
15113 (merger_output): New function.
15114 (pack_vector): Pack conflict table, too.
15115 (output_conflicts): New function to output yyconflp and yyconfl.
15116 (output_check): Allocate conflict_tos.
15117 (output_actions): Output conflict tables, also.
15118 (output_skeleton): Output b4_mergers definition.
15119 (prepare): Output b4_max_rhs_length definition.
15120 Use 'bison.glr' as default skeleton for GLR parsers.
15121
15122 * src/gram.c (glr_parser): New flag.
15123 (grammar_free): Call free_merger_functions.
15124
15125 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
15126 all pairs of conflicting reductions, rather than just all tokens
15127 causing conflicts. Needed to size conflict tables.
15128 (conflicts_output): Modify call to count_rr_conflicts for new
15129 interface.
15130 (conflicts_print): Ditto.
15131 (count_total_conflicts): New function.
15132
15133 * src/reader.h (merger_list): New type.
15134 (merge_functions): New variable.
15135
15136 * src/lex.h (tok_dprec, tok_merge): New token types.
15137
15138 * src/gram.h (rule_s): Add dprec and merger fields.
15139 (glr_parser): New flag.
15140
15141 * src/conflicts.h (count_total_conflicts): New function.
15142
15143 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
15144
15145 * doc/bison.texinfo (Generalized LR Parsing): New section.
15146 (GLR Parsers): New section.
15147 (Language and Grammar): Mention GLR parsing.
15148 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
15149 Correct typo ("tge" -> "the").
15150
15151 * data/bison.glr: New skeleton for GLR parsing.
15152
15153 * tests/cxx-gram.at: New tests for GLR parsing.
15154
15155 * tests/testsuite.at: Include cxx-gram.at.
15156
15157 * tests/Makefile.am: Add cxx-gram.at.
15158
15159 * src/parse-gram.y:
15160
15161 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
15162
15163 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
15164
151652002-06-27 Akim Demaille <akim@epita.fr>
15166
15167 * src/options.h, src/options.c: Remove.
15168 * src/getargs.c (short_options, long_options): New.
15169
151702002-06-27 Akim Demaille <akim@epita.fr>
15171
15172 * data/bison.simple, data/bison.c++: Rename as...
15173 * data/yacc.c, data/lalr1.cc: these.
15174 * doc/bison.texinfo (Environment Variables): Remove.
15175
151762002-06-25 Raja R Harinath <harinath@cs.umn.edu>
15177
15178 * src/getargs.c (report_argmatch): Initialize strtok().
15179
151802002-06-20 Akim Demaille <akim@epita.fr>
15181
15182 * data/bison.simple (b4_symbol_actions): New, replaces...
15183 (b4_symbol_destructor, b4_symbol_printer): these.
15184 (yysymprint): Be sure to call YYPRINT only for tokens, and using
15185 user token numbers.
15186
151872002-06-20 Akim Demaille <akim@epita.fr>
15188
15189 * data/bison.simple (yydestructor): Rename as...
15190 (yydestruct): this.
15191
151922002-06-20 Akim Demaille <akim@epita.fr>
15193
15194 * src/symtab.h, src/symtab.c (symbol_type_set)
15195 (symbol_destructor_set, symbol_precedence_set): The location is
15196 the last argument.
15197 Adjust all callers.
15198
151992002-06-20 Akim Demaille <akim@epita.fr>
15200
15201 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
15202 internals.
15203 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
15204 Takes a location.
15205 * src/symtab.h, src/symtab.c (symbol_class_set)
15206 (symbol_user_token_number_set): Likewise.
15207 Adjust all callers.
15208 Promote complain_at.
15209 * tests/input.at (Type Clashes): Adjust.
15210
152112002-06-20 Akim Demaille <akim@epita.fr>
15212
15213 * data/bison.simple (YYLEX): Fix the declaration when
15214 %pure-parser.
15215
152162002-06-20 Akim Demaille <akim@epita.fr>
15217
15218 * data/bison.simple (yysymprint): Don't print the token number,
15219 just its name.
15220 * tests/actions.at (Destructors): Rename as...
15221 (Printers and Destructors): this.
15222 Also exercise %printer.
15223
152242002-06-20 Akim Demaille <akim@epita.fr>
15225
15226 * data/bison.simple (YYDSYMPRINT): New.
15227 Use it to remove many of the #if YYDEBUG/if (yydebug).
15228
152292002-06-20 Akim Demaille <akim@epita.fr>
15230
15231 * src/symtab.h, src/symtab.c (symbol_t): printer and
15232 printer_location are new members.
15233 (symbol_printer_set): New.
15234 * src/parse-gram.y (PERCENT_PRINTER): New token.
15235 Handle its associated rule.
15236 * src/scan-gram.l: Adjust.
15237 (handle_destructor_at, handle_destructor_dollar): Rename as...
15238 (handle_symbol_code_at, handle_symbol_code_dollar): these.
15239 * src/output.c (symbol_printers_output): New.
15240 (output_skeleton): Call it.
15241 * data/bison.simple (yysymprint): New. Cannot be named yyprint
15242 since there are already many grammar files with a user `yyprint'.
15243 Replace the calls to YYPRINT to calls to yysymprint.
15244 * tests/calc.at: Adjust.
15245 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
15246 taking advantage of parser very internal details (stack size!).
15247
152482002-06-20 Akim Demaille <akim@epita.fr>
15249
15250 * src/scan-gram.l: Complete the scanner with the missing patterns
15251 to pacify Flex.
15252 Use `quote' and `symbol_tag_get' where appropriate.
15253
152542002-06-19 Akim Demaille <akim@epita.fr>
15255
15256 * tests/actions.at (Destructors): Augment to test locations.
15257 * data/bison.simple (yydestructor): Pass it the current location
15258 if locations are enabled.
15259 Prototype only when __STDC__ or C++.
15260 Change the argument names to move into the yy name space: there is
15261 user code here.
15262
152632002-06-19 Akim Demaille <akim@epita.fr>
15264
15265 * data/bison.simple (b4_pure_if): New.
15266 Use it instead of #ifdef YYPURE.
15267
152682002-06-19 Akim Demaille <akim@epita.fr>
15269
15270 * data/bison.simple (b4_location_if): New.
15271 Use it instead of #ifdef YYLSP_NEEDED.
15272
152732002-06-19 Akim Demaille <akim@epita.fr>
15274
15275 Prepare @$ in %destructor, but currently don't bind it in the
15276 skeleton, as %location use is not cleaned up yet.
15277
15278 * src/scan-gram.l (handle_dollar, handle_destructor_at)
15279 (handle_action_at): New.
15280 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
15281 a braced_code_t and a location as additional arguments.
15282 (handle_destructor_dollar): Instead of requiring `b4_eval', just
15283 unquote one when outputting `b4_dollar_dollar'.
15284 Adjust callers.
15285 * data/bison.simple (b4_eval): Remove.
15286 (b4_symbol_destructor): Adjust.
15287 * tests/input.at (Invalid @n): Adjust.
15288
152892002-06-19 Zack Weinberg <zack@codesourcery.com>
15290
15291 * doc/bison.texinfo: Document ability to have multiple
15292 prologue sections.
15293
152942002-06-18 Akim Demaille <akim@epita.fr>
15295
15296 * src/files.c (compute_base_names): When computing the output file
15297 names from the input file name, strip the directory part.
15298
152992002-06-18 Akim Demaille <akim@epita.fr>
15300
15301 * data/bison.simple.new: Comment changes.
15302 Reported by Andreas Schwab.
15303
153042002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
15305
15306 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
15307 there are no `label `yyoverflowlab' defined but not used' warnings
15308 when yyoverflow is defined.
15309
153102002-06-18 Akim Demaille <akim@epita.fr>
15311
15312 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
15313 new member.
15314 (symbol_destructor_set): Adjust.
15315 * src/output.c (symbol_destructors_output): Output the destructor
15316 locations.
15317 Output the symbol name.
15318 * data/bison.simple (b4_symbol_destructor): Adjust.
15319
153202002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
15321 and Akim Demaille <akim@epita.fr>
15322
15323 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
15324 what's left on the stack when the error recovery hits EOF.
15325 * tests/actions.at (Destructors): Complete to exercise this case.
15326
153272002-06-17 Akim Demaille <akim@epita.fr>
15328
15329 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
15330 arguments is really empty, not only equal to `[]'.
15331 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
15332 member.
15333 (symbol_destructor_set): New.
15334 * src/output.c (symbol_destructors_output): New.
15335 * src/reader.h (brace_code_t, current_braced_code): New.
15336 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
15337 (handle_dollar): Rename as...
15338 (handle_action_dollar): this.
15339 (handle_destructor_dollar): New.
15340 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
15341 (grammar_declaration): Use it.
15342 * data/bison.simple (yystos): Is always defined.
15343 (yydestructor): New.
15344 * tests/actions.at (Destructors): New.
15345 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
15346
153472002-06-17 Akim Demaille <akim@epita.fr>
15348
15349 * src/symlist.h, src/symlist.c (symbol_list_length): New.
15350 * src/scan-gram.l (handle_dollar, handle_at): Compute the
15351 rule_length only when needed.
15352 * src/output.c (actions_output, token_definitions_output): Output
15353 the full M4 block.
15354 * src/symtab.c: Don't access directly to the symbol tag, use
15355 symbol_tag_get.
15356 * src/parse-gram.y: Use symbol_list_free.
15357
153582002-06-17 Akim Demaille <akim@epita.fr>
15359
15360 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
15361 (symbol_list_prepend, get_type_name): Move to...
15362 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
15363 (symbol_list_prepend, symbol_list_n_type_name_get): here.
15364 Adjust all callers.
15365 (symbol_list_free): New.
15366 * src/scan-gram.l (handle_dollar): Takes a location.
15367 * tests/input.at (Invalid $n): Adjust.
15368
153692002-06-17 Akim Demaille <akim@epita.fr>
15370
15371 * src/reader.h, src/reader.c (symbol_list_new): Export it.
15372 (symbol_list_prepend): New.
15373 * src/parse-gram.y (%union): `list' is a new member.
15374 (symbols.1): New, replaces...
15375 (terms_to_prec.1, nterms_to_type.1): these.
15376 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
15377 Take a location as additional argument.
15378 Adjust all callers.
15379
153802002-06-15 Akim Demaille <akim@epita.fr>
15381
15382 * src/parse-gram.y: Move %token in the declaration section so that
15383 we don't depend upon CVS Bison.
15384
153852002-06-15 Akim Demaille <akim@epita.fr>
15386
15387 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
15388 * src/print.c (print_core): Use it.
15389
153902002-06-15 Akim Demaille <akim@epita.fr>
15391
15392 * src/conflicts.c (log_resolution): Accept the rule involved in
15393 the sr conflicts instead of the lookahead number that points to
15394 that rule.
15395 (flush_reduce): Accept the current lookahead vector as argument,
15396 instead of the index in LA.
15397 (resolve_sr_conflict): Accept the current number of lookahead
15398 bitset to consider for the STATE, instead of the index in LA.
15399 (set_conflicts): Adjust.
15400 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
15401
154022002-06-15 Akim Demaille <akim@epita.fr>
15403
15404 * src/state.h (state_t): Replace the `lookaheadsp' member, a
15405 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
15406 Adjust all dependencies.
15407 * src/lalr.c (initialize_lookaheads): Split into...
15408 (states_lookaheads_count, states_lookaheads_initialize): these.
15409 (lalr): Adjust.
15410
154112002-06-15 Akim Demaille <akim@epita.fr>
15412
15413 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
15414 out of...
15415 (grammar_rules_print): here.
15416 * src/reduce.c (reduce_output): Use it.
15417 * tests/reduce.at (Useless Rules, Reduced Automaton)
15418 (Underivable Rules): Adjust.
15419
154202002-06-15 Akim Demaille <akim@epita.fr>
15421
15422 Copy BYacc's nice way to report the grammar.
15423
15424 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
15425 New.
15426 Don't print the rules' location, it is confusing and useless.
15427 (rule_print): Use grammar_rhs_print.
15428 * src/print.c (print_grammar): Use grammar_rules_print.
15429
154302002-06-15 Akim Demaille <akim@epita.fr>
15431
15432 Complete and rationalize `useless thing' warnings.
15433
15434 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
15435 (symbol_tag_print): New.
15436 Use them everywhere in place of accessing directly the tag member.
15437 * src/gram.h, src/gram.c (rule_print): New.
15438 Use it where a rule used to be printed `by hand'.
15439 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
15440 (reduce_grammar_tables): Report the useless rules.
15441 (reduce_print): Useless things are a warning, not an error.
15442 Report it as such.
15443 * tests/reduce.at (Useless Nonterminals, Useless Rules):
15444 (Reduced Automaton, Underivable Rules): Adjust.
15445 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
15446 * tests/conflicts.at (Unresolved SR Conflicts)
15447 (Solved SR Conflicts): Adjust.
15448
154492002-06-15 Akim Demaille <akim@epita.fr>
15450
15451 Let symbols have a location.
15452
15453 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
15454 (getsym): Adjust.
15455 Adjust all callers.
15456 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
15457 Use location_t, not int.
15458 * src/symtab.c (symbol_check_defined): Take advantage of the
15459 location.
15460 * tests/regression.at (Invalid inputs): Adjust.
15461
154622002-06-15 Akim Demaille <akim@epita.fr>
15463
15464 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
15465 (input): Don't try to initialize yylloc here, do it in the
15466 scanner.
15467 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
15468 * src/gram.h (rule_t): Change line and action_line into location
15469 and action_location, of location_t type.
15470 Adjust all dependencies.
15471 * src/location.h, src/location.c (empty_location): New.
15472 * src/reader.h, src/reader.c (grammar_start_symbol_set)
15473 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
15474 (grammar_current_rule_symbol_append)
15475 (grammar_current_rule_action_append): Expect a location as argument.
15476 * src/reader.c (grammar_midrule_action): Adjust to attach an
15477 action's location as dummy symbol location.
15478 * src/symtab.h, src/symtab.c (startsymbol_location): New.
15479 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
15480 the line numbers.
15481
154822002-06-14 Akim Demaille <akim@epita.fr>
15483
15484 Grammar declarations may be found in the grammar section.
15485
15486 * src/parse-gram.y (rules_or_grammar_declaration): New.
15487 (declarations): Each declaration may end with a semicolon, not
15488 just...
15489 (grammar_declaration): `"%union"'.
15490 (grammar): Branch to rules_or_grammar_declaration.
15491
154922002-06-14 Akim Demaille <akim@epita.fr>
15493
15494 * src/main.c (main): Invoke scanner_free.
15495
154962002-06-14 Akim Demaille <akim@epita.fr>
15497
15498 * src/output.c (m4_invoke): Extracted from...
15499 (output_skeleton): here.
15500 Free tempfile.
15501
155022002-06-14 Akim Demaille <akim@epita.fr>
15503
15504 * src/parse-gram.y (directives, directive, gram)
15505 (grammar_directives, precedence_directives, precedence_directive):
15506 Rename as...
15507 (declarations, declaration, grammar, grammar_declaration)
15508 (precedence_declaration, precedence_declarator): these.
15509 (symbol_declaration): New.
15510
155112002-06-14 Akim Demaille <akim@epita.fr>
15512
15513 * src/files.c (action_obstack): Remove, unused.
15514 (output_obstack): Remove it, and all its dependencies, as it is no
15515 longer needed.
15516 * src/reader.c (epilogue_set): Build the epilogue in the
15517 muscle_obstack.
15518 * src/output.h, src/output.c (muscle_obstack): Move to...
15519 * src/muscle_tab.h, src/muscle_tab.h: here.
15520 (muscle_init): Initialize muscle_obstack.
15521 (muscle_free): New.
15522 * src/main.c (main): Call it.
15523
155242002-06-14 Akim Demaille <akim@epita.fr>
15525
15526 * src/location.h: New, extracted from...
15527 * src/reader.h: here.
15528 * src/Makefile.am (noinst_HEADERS): Merge into
15529 (bison_SOURCES): this.
15530 Add location.h.
15531 * src/parse-gram.y: Use location_t instead of Bison's.
15532 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
15533 Use location_t instead of ints.
15534
155352002-06-14 Akim Demaille <akim@epita.fr>
15536
15537 * data/bison.simple, data/bison.c++: Be sure to restore the
15538 current #line when returning to the skeleton contents after having
15539 exposed the input file's #line.
15540
155412002-06-12 Akim Demaille <akim@epita.fr>
15542
15543 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
15544 eager.
15545 * tests/actions.at (Exotic Dollars): New.
15546
155472002-06-12 Akim Demaille <akim@epita.fr>
15548
15549 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
15550 ['"/] too eagerly.
15551 * tests/input.at (Torturing the Scanner): New.
15552
155532002-06-11 Akim Demaille <akim@epita.fr>
15554
15555 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
15556 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
15557 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
15558 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
15559 * src/reader.c (reader): Use it.
15560
155612002-06-11 Akim Demaille <akim@epita.fr>
15562
15563 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
15564 Adjust all callers.
15565 (scanner_last_string_free): New.
15566
155672002-06-11 Akim Demaille <akim@epita.fr>
15568
15569 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
15570 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
15571 (last_string, YY_OBS_FREE): New.
15572 Use them when returning an ID.
15573
155742002-06-11 Akim Demaille <akim@epita.fr>
15575
15576 Have Bison grammars parsed by a Bison grammar.
15577
15578 * src/reader.c, src/reader.h (prologue_augment): New.
15579 * src/reader.c (copy_definition): Remove.
15580
15581 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
15582 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
15583 (grammar_current_rule_prec_set, grammar_current_rule_check)
15584 (grammar_current_rule_symbol_append)
15585 (grammar_current_rule_action_append): Export.
15586 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
15587 (symbol_list_action_append): Remove.
15588 Hook the routines from reader.
15589 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
15590 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
15591
15592 * src/reader.c (read_declarations): Remove, unused.
15593
15594 * src/parse-gram.y: Handle the epilogue.
15595 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
15596 (grammar_start_symbol_set): this.
15597 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
15598 * src/reader.c (readgram): Remove, unused.
15599 (reader): Adjust to insert eoftoken and axiom where appropriate.
15600
15601 * src/reader.c (copy_dollar): Replace with...
15602 * src/scan-gram.h (handle_dollar): this.
15603 * src/parse-gram.y: Remove `%thong'.
15604
15605 * src/reader.c (copy_at): Replace with...
15606 * src/scan-gram.h (handle_at): this.
15607
15608 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
15609 New.
15610
15611 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
15612 time being.
15613
15614 * src/reader.h, src/reader.c (grammar_rule_end): New.
15615
15616 * src/parse.y (current_type, current_class): New.
15617 Implement `%nterm', `%token' support.
15618 Merge `%term' into `%token'.
15619 (string_as_id): New.
15620 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
15621 type name.
15622
15623 * src/parse-gram.y: Be sure to handle properly the beginning of
15624 rules.
15625
15626 * src/parse-gram.y: Handle %type.
15627 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
15628
15629 * src/parse-gram.y: More directives support.
15630 * src/options.c: No longer handle source directives.
15631
15632 * src/parse-gram.y: Fix %output.
15633
15634 * src/parse-gram.y: Handle %union.
15635 Use the prologue locations.
15636 * src/reader.c (parse_union_decl): Remove.
15637
15638 * src/reader.h, src/reader.c (epilogue_set): New.
15639 * src/parse-gram.y: Use it.
15640
15641 * data/bison.simple, data/bison.c++: b4_stype is now either not
15642 defined, then default to int, or to the contents of %union,
15643 without `union' itself.
15644 Adjust.
15645 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
15646
15647 * src/output.c (actions_output): Don't output braces, as they are
15648 already handled by the scanner.
15649
15650 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
15651 characters to themselves.
15652
15653 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
15654 that the epilogue has a proper #line.
15655
15656 * src/parse-gram.y: Handle precedence/associativity.
15657
15658 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
15659 a terminal.
15660 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
15661 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
15662 at all to define terminals that cannot be emitted.
15663
15664 * src/scan-gram.l: Escape M4 characters.
15665
15666 * src/scan-gram.l: Working properly with escapes in user
15667 strings/characters.
15668
15669 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
15670 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
15671 grammar.
15672 Use more modest sizes, as for the time being the parser does not
15673 release memory, and therefore the process swallows a huge amount
15674 of memory.
15675
15676 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
15677 stricter %token grammar.
15678
15679 * src/symtab.h (associativity): Add `undef_assoc'.
15680 (symbol_precedence_set): Do nothing when passed an undef_assoc.
15681 * src/symtab.c (symbol_check_alias_consistence): Adjust.
15682
15683 * tests/regression.at (Invalid %directive): Remove, as it is now
15684 meaningless.
15685 (Invalid inputs): Adjust to the new error messages.
15686 (Token definitions): The new grammar doesn't allow too many
15687 eccentricities.
15688
15689 * src/lex.h, src/lex.c: Remove.
15690 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
15691 (copy_character, copy_string2, copy_string, copy_identifier)
15692 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
15693 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
15694 (parse_action): Remove.
15695 * po/POTFILES.in: Adjust.
15696
156972002-06-11 Akim Demaille <akim@epita.fr>
15698
15699 * src/reader.c (parse_action): Don't store directly into the
15700 rule's action member: return the action as a string.
15701 Don't require `rule_length' as an argument: compute it.
15702 (grammar_current_rule_symbol_append)
15703 (grammar_current_rule_action_append): New, eved out from
15704 (readgram): here.
15705 Remove `action_flag', `rulelength', unused now.
15706
157072002-06-11 Akim Demaille <akim@epita.fr>
15708
15709 * src/reader.c (grammar_current_rule_prec_set).
15710 (grammar_current_rule_check): New, eved out from...
15711 (readgram): here.
15712 Remove `xaction', `first_rhs': useless.
15713 * tests/input.at (Type clashes): New.
15714 * tests/existing.at (GNU Cim Grammar): Adjust.
15715
157162002-06-11 Akim Demaille <akim@epita.fr>
15717
15718 * src/reader.c (grammar_midrule_action): New, Eved out from
15719 (readgram): here.
15720
157212002-06-11 Akim Demaille <akim@epita.fr>
15722
15723 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
15724 New.
15725 (readgram): Use them as replacement of inlined code, crule and
15726 crule1.
15727
157282002-06-11 Akim Demaille <akim@epita.fr>
15729
15730 * src/reader.c (grammar_end, grammar_symbol_append): New.
15731 (readgram): Use them.
15732 Make the use of `p' as local as possible.
15733
157342002-06-10 Akim Demaille <akim@epita.fr>
15735
15736 GCJ's parser requires the tokens to be defined before the prologue.
15737
15738 * data/bison.simple: Output the token definition before the user's
15739 prologue.
15740 * tests/regression.at (Braces parsing, Duplicate string)
15741 (Mixing %token styles): Check the output from bison.
15742 (Early token definitions): New.
15743
157442002-06-10 Akim Demaille <akim@epita.fr>
15745
15746 * src/symtab.c (symbol_user_token_number_set): Don't complain when
15747 assigning twice the same user number to a token, so that we can
15748 use it in...
15749 * src/lex.c (lex): here.
15750 Also use `symbol_class_set' instead of hand written code.
15751 * src/reader.c (parse_assoc_decl): Likewise.
15752
157532002-06-10 Akim Demaille <akim@epita.fr>
15754
15755 * src/symtab.c, src/symtab.c (symbol_class_set)
15756 (symbol_user_token_number_set): New.
15757 * src/reader.c (parse_token_decl): Use them.
15758 Use a switch instead of ifs.
15759 Use a single argument.
15760
157612002-06-10 Akim Demaille <akim@epita.fr>
15762
15763 Remove `%thong' support as it is undocumented, unused, duplicates
15764 `%token's job, and creates useless e-mail traffic with people who
15765 want to know what it is, why it is undocumented, unused, and
15766 duplicates `%token's job.
15767
15768 * src/reader.c (parse_thong_decl): Remove.
15769 * src/options.c (option_table): Remove "thong".
15770 * src/lex.h (tok_thong): Remove.
15771
157722002-06-10 Akim Demaille <akim@epita.fr>
15773
15774 * src/symtab.c, src/symtab.c (symbol_type_set)
15775 (symbol_precedence_set): New.
15776 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
15777 (value_components_used): Remove, unused.
15778
157792002-06-09 Akim Demaille <akim@epita.fr>
15780
15781 Move symbols handling code out of the reader.
15782
15783 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
15784 (axiom): Move to...
15785 * src/symtab.h, src/symtab.c: here.
15786
15787 * src/gram.c (start_symbol): Remove: use startsymbol->number.
15788 * src/reader.c (startval): Rename as...
15789 * src/symtab.h, src/symtab.c (startsymbol): this.
15790 * src/reader.c: Adjust.
15791
15792 * src/reader.c (symbol_check_defined, symbol_make_alias)
15793 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
15794 (token_translations_init)
15795 Move to...
15796 * src/symtab.c: here.
15797 * src/reader.c (packsymbols): Move to...
15798 * src/symtab.h, src/symtab.c (symbols_pack): here.
15799 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
15800 argument.
15801
158022002-06-03 Akim Demaille <akim@epita.fr>
15803
15804 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
15805 then statements.
15806
158072002-06-03 Akim Demaille <akim@epita.fr>
15808
15809 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
15810 structs with non literals.
15811 * src/scan-skel.l: never-interactive.
15812 * src/conflicts.c (enum conflict_resolution_e): No trailing
15813 comma.
15814 * src/getargs.c (usage): Split long literal strings.
15815 Reported by Hans Aberg.
15816
158172002-05-28 Akim Demaille <akim@epita.fr>
15818
15819 * data/bison.c++: Use C++ ostreams.
15820 (cdebug_): New member.
15821
158222002-05-28 Akim Demaille <akim@epita.fr>
15823
15824 * src/output.c (output_skeleton): Be sure to allocate enough room
15825 for `/' _and_ for `\0' in full_skeleton.
15826
158272002-05-28 Akim Demaille <akim@epita.fr>
15828
15829 * data/bison.c++: Catch up with bison.simple:
15830 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15831 and Paul Eggert <eggert@twinsun.com>: `error' handing.
15832 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
15833 and popping traces.
15834
158352002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15836
15837 * src/output.c (output_skeleton): Put an explicit path in front of
15838 the skeleton file name, rather than relying on the -I directory,
15839 to partially alleviate effects of having a skeleton file lying around
15840 in the current directory.
15841
158422002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15843
15844 * src/conflicts.c (log_resolution): Correct typo:
15845 obstack_printf should be obstack_fgrow1.
15846
158472002-05-26 Akim Demaille <akim@epita.fr>
15848
15849 * src/state.h (state_t): `solved_conflicts' is a new member.
15850 * src/LR0.c (new_state): Set it to 0.
15851 * src/conflicts.h, src/conflicts.c (print_conflicts)
15852 (free_conflicts, solve_conflicts): Rename as...
15853 (conflicts_print, conflicts_free, conflicts_solve): these.
15854 Adjust callers.
15855 * src/conflicts.c (enum conflict_resolution_e)
15856 (solved_conflicts_obstack): New, used by...
15857 (log_resolution): this.
15858 Adjust to attach the conflict resolution to each state.
15859 Complete the description with the precedence/associativity
15860 information.
15861 (resolve_sr_conflict): Adjust.
15862 * src/print.c (print_state): Output its solved_conflicts.
15863 * tests/conflicts.at (Unresolved SR Conflicts)
15864 (Solved SR Conflicts): Exercise --report=all.
15865
158662002-05-26 Akim Demaille <akim@epita.fr>
15867
15868 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
15869 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
15870 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
15871 (token_number_t, item_number_as_token_number)
15872 (token_number_as_item_number, muscle_insert_token_number_table):
15873 Rename as...
15874 (symbol_number_t, item_number_as_symbol_number)
15875 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
15876 these, since it is more appropriate.
15877
158782002-05-26 Akim Demaille <akim@epita.fr>
15879
15880 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
15881 `Error:' lines.
15882 * data/bison.simple (yystos) [YYDEBUG]: New.
15883 (yyparse) [YYDEBUG]: Display the symbols which are popped during
15884 error recovery.
15885 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
15886
158872002-05-25 Akim Demaille <akim@epita.fr>
15888
15889 * doc/bison.texinfo (Debugging): Split into...
15890 (Tracing): this new section, its former contents, and...
15891 (Understanding): this new section.
15892 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
15893 by...
15894 (report_flag): this.
15895 Adjust all dependencies.
15896 (report_args, report_types, report_argmatch): New.
15897 (usage, getargs): Report/support -r, --report.
15898 * src/options.h
15899 (struct option_table_struct): Rename as..,
15900 (struct option_table_s): this.
15901 Rename the `set_flag' member to `flag' to match with getopt_long's
15902 struct.
15903 * src/options.c (option_table): Split verbose into an entry for
15904 %verbose, and another for --verbose.
15905 Support --report/-r, so remove -r from the obsolete --raw.
15906 * src/print.c: Attach full item sets and lookaheads reports to
15907 report_flag instead of trace_flag.
15908 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
15909
159102002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15911 and Paul Eggert <eggert@twinsun.com>
15912
15913 * data/bison.simple (yyparse): Correct error handling to conform to
15914 POSIX and yacc. Specifically, after syntax error is discovered,
15915 do not reduce further before shifting the error token.
15916 Clean up the code a bit by removing the labels yyerrdefault,
15917 yyerrhandle, yyerrpop.
15918 * NEWS: Document the above.
15919
159202002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15921
15922 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
15923 type; it isn't always big enough, since it doesn't necessarily
15924 include non-terminals.
15925 (yytranslate): Expand definition of yy_token_number_type, so that
15926 the latter can be removed.
15927 (yy_token_number_type): Remove, only one use.
15928 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
15929 don't use TokenNumberType as element type.
15930
15931 * tests/regression.at: Modify expected output to agree with change
15932 to yyr1 and yytranslate.
15933
159342002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
15935
15936 * src/reader.c (parse_action): Use copy_character instead of
15937 obstack_1grow.
15938
159392002-05-13 Akim Demaille <akim@epita.fr>
15940
15941 * tests/regression.at (Token definitions): Prototype yylex and
15942 yyerror.
15943
159442002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15945
15946 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
15947 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
15948 32-bit arithmetic.
15949 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
15950
159512002-05-07 Akim Demaille <akim@epita.fr>
15952
15953 * tests/synclines.at: Be sure to prototype yylex and yyerror to
15954 avoid GCC warnings.
15955
159562002-05-07 Akim Demaille <akim@epita.fr>
15957
15958 Kill GCC warnings.
15959
15960 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
15961 over the RHS of each rule.
15962 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
15963 * src/state.h (state_t): Member `nitems' is unsigned short.
15964 * src/LR0.c (get_state): Adjust.
15965 * src/reader.c (packgram): Likewise.
15966 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
15967 `Type'.
15968 (muscle_insert_int_table): Remove, unused.
15969 (prepare_rules): Remove `max'.
15970
159712002-05-06 Akim Demaille <akim@epita.fr>
15972
15973 * src/closure.c (print_firsts): Display of the symbol tags.
15974 (bitmatrix_print): Move to...
15975 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
15976 here.
15977 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
15978
159792002-05-06 Akim Demaille <akim@epita.fr>
15980
15981 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
15982 hash_do_for_each.
15983
159842002-05-06 Akim Demaille <akim@epita.fr>
15985
15986 * src/LR0.c (new_state, get_state): Instead of using the global
15987 `kernel_size' and `kernel_base', have two new arguments:
15988 `core_size' and `core'.
15989 Adjust callers.
15990
159912002-05-06 Akim Demaille <akim@epita.fr>
15992
15993 * src/reader.c (packgram): No longer end `ritem' with a 0
15994 sentinel: it is not used.
15995
159962002-05-05 Akim Demaille <akim@epita.fr>
15997
15998 New experimental feature: display the lookaheads in the report and
15999 graph.
16000
16001 * src/print (print_core): When --trace-flag, display the rules
16002 lookaheads.
16003 * src/print_graph.c (print_core): Likewise.
16004 Swap the arguments.
16005 Adjust caller.
16006
160072002-05-05 Akim Demaille <akim@epita.fr>
16008
16009 * tests/torture.at (Many lookaheads): New test.
16010
160112002-05-05 Akim Demaille <akim@epita.fr>
16012
16013 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
16014 (GENERATE_MUSCLE_INSERT_TABLE): this.
16015 (output_int_table, output_unsigned_int_table, output_short_table)
16016 (output_token_number_table, output_item_number_table): Replace with...
16017 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
16018 (muscle_insert_short_table, muscle_insert_token_number_table)
16019 (muscle_insert_item_number_table): these.
16020 Adjust all callers.
16021 (prepare_tokens): Don't free `translations', since...
16022 * src/reader.h, src/reader.c (grammar_free): do it.
16023 Move to...
16024 * src/gram.h, src/gram.c (grammar_free): here.
16025 * data/bison.simple, data/bison.c++: b4_token_number_max is now
16026 b4_translate_max.
16027
160282002-05-05 Akim Demaille <akim@epita.fr>
16029
16030 * src/output.c (output_unsigned_int_table): New.
16031 (prepare_rules): `i' is unsigned.
16032 `prhs', `rline', `r2' are unsigned int.
16033 Rename muscle `rhs_number_max' as `rhs_max'.
16034 Output muscles `prhs_max', `rline_max', and `r2_max'.
16035 Free rline and r1.
16036 * data/bison.simple, data/bison.c++: Adjust to use these muscles
16037 to compute types instead of constant types.
16038 * tests/regression.at (Web2c Actions): Adjust.
16039
160402002-05-04 Akim Demaille <akim@epita.fr>
16041
16042 * src/symtab.h (SALIAS, SUNDEF): Rename as...
16043 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
16044 Adjust dependencies.
16045 * src/output.c (token_definitions_output): Be sure not to output a
16046 `#define 'a'' when fed with `%token 'a' "a"'.
16047 * tests/regression.at (Token definitions): New.
16048
160492002-05-03 Paul Eggert <eggert@twinsun.com>
16050
16051 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
16052 for K&R C.
16053
160542002-05-03 gettextize <bug-gnu-gettext@gnu.org>
16055
16056 * Makefile.am (SUBDIRS): Remove intl.
16057 (EXTRA_DIST): Add config/config.rpath.
16058
160592002-05-03 Akim Demaille <akim@epita.fr>
16060
16061 * data/bison.simple (m4_if): Don't output empty enums.
16062 And actually, output valid enum definitions :(.
16063
160642002-05-03 Akim Demaille <akim@epita.fr>
16065
16066 * configure.bat: Remove, completely obsolete.
16067 * Makefile.am (EXTRA_DIST): Adjust.
16068 Don't distribute config.rpath...
16069 * config/Makefile.am (EXTRA_DIST): Do it.
16070
160712002-05-03 Akim Demaille <akim@epita.fr>
16072
16073 * configure.in (GETTEXT_VERSION): New.
16074 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
16075
160762002-05-03 Akim Demaille <akim@epita.fr>
16077
16078 * data/bison.simple (b4_token_enum): New.
16079 (b4_token_defines): Use it to output tokens both as #define and
16080 enums.
16081 Suggested by Paul Eggert.
16082 * src/output.c (token_definitions_output): Don't output spurious
16083 white spaces.
16084
160852002-05-03 Akim Demaille <akim@epita.fr>
16086
16087 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16088
160892002-05-02 Robert Anisko <robert@lrde.epita.fr>
16090
16091 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
16092 Update the stack class, give a try to deque as the default container.
16093
160942002-05-02 Akim Demaille <akim@epita.fr>
16095
16096 * data/bison.simple (yyparse): Do not implement @$ = @1.
16097 (YYLLOC_DEFAULT): Adjust to do it.
16098 * doc/bison.texinfo (Location Default Action): Fix.
16099
161002002-05-02 Akim Demaille <akim@epita.fr>
16101
16102 * src/reader.c (parse_braces): Merge into...
16103 (parse_action): this.
16104
161052002-05-02 Akim Demaille <akim@epita.fr>
16106
16107 * configure.in (ALL_LINGUAS): Remove.
16108 * po/LINGUAS, hr.po: New.
16109
161102002-05-02 Akim Demaille <akim@epita.fr>
16111
16112 Remove the so called hairy (semantic) parsers.
16113
16114 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
16115 * src/gram.h, src/gram.c (semantic_parser): Remove.
16116 (rule_t): Remove the guard and guard_line members.
16117 * src/lex.h (token_t): remove tok_guard.
16118 * src/options.c (option_table): Remove %guard and %semantic_parser
16119 support.
16120 * src/output.c, src/output.h (guards_output): Remove.
16121 (prepare): Adjust.
16122 (token_definitions_output): Don't output the `T'
16123 tokens (???).
16124 (output_skeleton): Don't output the guards.
16125 * src/files.c, src/files.c (attrsfile): Remove.
16126 * src/reader.c (symbol_list): Remove the guard and guard_line
16127 members.
16128 Adjust dependencies.
16129 (parse_guard): Remove.
16130 * data/bison.hairy: Remove.
16131 * doc/bison.texinfo (Environment Variables): Remove occurrences of
16132 BISON_HAIRY.
16133
161342002-05-02 Akim Demaille <akim@epita.fr>
16135
16136 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
16137 (parse_guard): Rename the formal argument `stack_offset' as
16138 `rule_length', which is more readable.
16139 Adjust callers.
16140 (copy_at, copy_dollar): Instead of outputting the hard coded
16141 values of $$, $n and so forth, output invocation to b4_lhs_value,
16142 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
16143 Note: this patch partially drops `semantic-parser' support: it
16144 always does `rule_length - n', where semantic parsers ought to
16145 always use `-n'.
16146 * data/bison.simple, data/bison.c++ (b4_lhs_value)
16147 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
16148
161492002-05-02 Akim Demaille <akim@epita.fr>
16150
16151 * configure.in (AC_INIT): Bump to 1.49b.
16152 (AM_INIT_AUTOMAKE): Short invocation.
16153
161542002-05-02 Akim Demaille <akim@epita.fr>
16155
16156 Version 1.49a.
16157
161582002-05-01 Akim Demaille <akim@epita.fr>
16159
16160 * src/skeleton.h: Remove.
16161
161622002-05-01 Akim Demaille <akim@epita.fr>
16163
16164 * src/skeleton.h: Fix the #endif.
16165 Reported by Magnus Fromreide.
16166
161672002-04-26 Paul Eggert <eggert@twinsun.com>
16168
16169 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
16170 Define if we define YYSTYPE and YYLTYPE, respectively.
16171 (YYCOPY): Fix [] quoting problem in the non-GCC case.
16172
161732002-04-25 Robert Anisko <robert@lrde.epita.fr>
16174
16175 * src/scan-skel.l: Postprocess quadrigraphs.
16176
16177 * src/reader.c (copy_character): New function, used to output
16178 single characters while replacing `[' and `]' with quadrigraphs, to
16179 avoid troubles with M4 quotes.
16180 (copy_comment): Output characters with copy_character.
16181 (read_additionnal_code): Likewise.
16182 (copy_string2): Likewise.
16183 (copy_definition): Likewise.
16184
16185 * tests/calc.at: Exercise M4 quoting.
16186
161872002-04-25 Akim Demaille <akim@epita.fr>
16188
16189 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
16190 between `!' and the command.
16191 Reported by Paul Eggert.
16192
161932002-04-24 Robert Anisko <robert@lrde.epita.fr>
16194
16195 * tests/calc.at: Exercise prologue splitting.
16196
16197 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
16198 `b4_post_prologue' instead of `b4_prologue'.
16199
16200 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
16201 muscles.
16202 (output): Free pre_prologue_obstack and post_prologue_obstack.
16203 * src/files.h, src/files.c (attrs_obstack): Remove.
16204 (pre_prologue_obstack, post_prologue_obstack): New.
16205 * src/reader.c (copy_definition): Add a parameter to specify the
16206 obstack to fill, instead of using attrs_obstack unconditionally.
16207 (read_declarations): Pass pre_prologue_obstack to copy_definition if
16208 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
16209
162102002-04-23 Paul Eggert <eggert@twinsun.com>
16211
16212 * data/bison.simple: Remove unnecessary commentary and white
16213 space differences from 1_29-branch.
16214 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
16215
16216 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
16217 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
16218 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
16219 constructors or destructors.
16220
16221 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
16222
162232002-04-23 Akim Demaille <akim@epita.fr>
16224
16225 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
16226 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
16227 location with columns.
16228 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
16229 All reported by Paul Eggert.
16230
162312002-04-22 Akim Demaille <akim@epita.fr>
16232
16233 * src/reduce.c (dump_grammar): Move to...
16234 * src/gram.h, src/gram.c (grammar_dump): here.
16235 Be sure to separate long item numbers.
16236 Don't read the members of a rule's prec if its nil.
16237
162382002-04-22 Akim Demaille <akim@epita.fr>
16239
16240 * src/output.c (table_size, table_grow): New.
16241 (MAXTABLE): Remove, replace uses with table_size.
16242 (pack_vector): Instead of dying when the table is too big, grow it.
16243
162442002-04-22 Akim Demaille <akim@epita.fr>
16245
16246 * data/bison.simple (yyr1): Its type is that of a token number.
16247 * data/bison.c++ (r1_): Likewise.
16248 * tests/regression.at (Web2c Actions): Adjust.
16249
162502002-04-22 Akim Demaille <akim@epita.fr>
16251
16252 * src/reader.c (token_translations_init): 256 is now the default
16253 value for the error token, i.e., it will be assigned another
16254 number if the user assigned 256 to one of her tokens.
16255 (reader): Don't force 256 to error.
16256 * doc/bison.texinfo (Symbols): Adjust.
16257 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
16258 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
16259 etc. instead of 10, 20, 30 (which was used to `jump' over error
16260 (256) and undefined (2)).
16261
162622002-04-22 Akim Demaille <akim@epita.fr>
16263
16264 Propagate more token_number_t.
16265
16266 * src/gram.h (token_number_as_item_number)
16267 (item_number_as_token_number): New.
16268 * src/output.c (GENERATE_OUTPUT_TABLE): New.
16269 Use it to create output_item_number_table and
16270 output_token_number_table.
16271 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16272 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
16273 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
16274 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
16275
162762002-04-22 Akim Demaille <akim@epita.fr>
16277
16278 * src/output.h, src/output.c (get_lines_number): Remove.
16279
162802002-04-19 Akim Demaille <akim@epita.fr>
16281
16282 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
16283 as Lex/Flex'.
16284 (Debugging): More details about enabling the debugging features.
16285 (Table of Symbols): Describe $$, $n, @$, and @n.
16286 Suggested by Tim Josling.
16287
162882002-04-19 Akim Demaille <akim@epita.fr>
16289
16290 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
16291
162922002-04-10 Akim Demaille <akim@epita.fr>
16293
16294 * src/system.h: Rely on HAVE_LIMITS_H.
16295 Suggested by Paul Eggert.
16296
162972002-04-09 Akim Demaille <akim@epita.fr>
16298
16299 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
16300 full stderr, and strip it according to the bison options, instead
16301 of composing the error message from different bits.
16302 This makes it easier to check for several error messages.
16303 Adjust all the invocations.
16304 Add an invocation exercising the error token.
16305 Add an invocation demonstrating a stupid error message.
16306 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
16307 Adjust the tests.
16308 Error message are for stderr, not stdout.
16309
163102002-04-09 Akim Demaille <akim@epita.fr>
16311
16312 * src/gram.h, src/gram.c (error_token_number): Remove, use
16313 errtoken->number.
16314 * src/reader.c (reader): Don't specify the user token number (2)
16315 for $undefined, as it uselessly prevents using it.
16316 * src/gram.h (token_number_t): Move to...
16317 * src/symtab.h: here.
16318 (state_t.number): Is a token_number_t.
16319 * src/print.c, src/reader.c: Use undeftoken->number instead of
16320 hard coded 2.
16321 (Even though this 2 is not the same as above: the number of the
16322 undeftoken remains being 2, it is its user token number which
16323 might not be 2).
16324 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
16325 `user_token_number_max'.
16326 Output `undef_token_number'.
16327 * data/bison.simple, data/bison.c++: Use them.
16328 Be sure to map invalid yylex return values to
16329 `undef_token_number'. This saves us from gratuitous SEGV.
16330
16331 * tests/conflicts.at (Solved SR Conflicts)
16332 (Unresolved SR Conflicts): Adjust.
16333 * tests/regression.at (Web2c Actions): Adjust.
16334
163352002-04-08 Akim Demaille <akim@epita.fr>
16336
16337 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
16338 Adding #line.
16339 Remove the duplicate `typedefs'.
16340 (RhsNumberType): Fix the declaration and various other typos.
16341 Use __ofile__.
16342 * data/bison.simple: Use __ofile__.
16343 * src/scan-skel.l: Handle __ofile__.
16344
163452002-04-08 Akim Demaille <akim@epita.fr>
16346
16347 * src/gram.h (item_number_t): New, the type of item numbers in
16348 RITEM. Note that it must be able to code symbol numbers as
16349 positive number, and the negation of rule numbers as negative
16350 numbers.
16351 Adjust all dependencies (pretty many).
16352 * src/reduce.c (rule): Remove this `short *' pointer: use
16353 item_number_t.
16354 * src/system.h (MINSHORT, MAXSHORT): Remove.
16355 Include `limits.h'.
16356 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
16357 (shortcpy): Remove.
16358 (MAXTABLE): Move to...
16359 * src/output.c (MAXTABLE): here.
16360 (prepare_rules): Use output_int_table to output rhs.
16361 * data/bison.simple, data/bison.c++: Adjust.
16362 * tests/torture.at (Big triangle): Move the limit from 254 to
16363 500.
16364 * tests/regression.at (Web2c Actions): Ajust.
16365
16366 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
16367 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
16368 passes, but produces negative #line number, once fixed, GCC is
16369 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
16370 C), it passes.
16371 * src/state.h (state_h): Code input lines on ints, not shorts.
16372
163732002-04-08 Akim Demaille <akim@epita.fr>
16374
16375 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
16376 and then the grammar.
16377
163782002-04-08 Akim Demaille <akim@epita.fr>
16379
16380 * src/system.h: No longer using strndup.
16381
163822002-04-07 Akim Demaille <akim@epita.fr>
16383
16384 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
16385 * src/output.c (output_table_data): Return the longest number.
16386 (prepare_tokens): Output `token_number_max').
16387 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
16388 New.
16389 Use them to define yy_token_number_type/TokenNumberType.
16390 Use this type for yytranslate.
16391 * tests/torture.at (Big triangle): Push the limit from 124 to
16392 253.
16393 * tests/regression.at (Web2c Actions): Adjust.
16394
163952002-04-07 Akim Demaille <akim@epita.fr>
16396
16397 * tests/torture.at (Big triangle): New.
16398 (GNU AWK Grammar, GNU Cim Grammar): Move to...
16399 * tests/existing.at: here.
16400
164012002-04-07 Akim Demaille <akim@epita.fr>
16402
16403 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
16404 nritems.
16405 Adjust dependencies.
16406
164072002-04-07 Akim Demaille <akim@epita.fr>
16408
16409 * src/reader.c: Normalize increments to prefix form.
16410
164112002-04-07 Akim Demaille <akim@epita.fr>
16412
16413 * src/reader.c, symtab.c: Remove debugging code.
16414
164152002-04-07 Akim Demaille <akim@epita.fr>
16416
16417 Rename all the `bucket's as `symbol_t'.
16418
16419 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
16420 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
16421 * src/symtab.c, src/symtab.h (bucket): Rename as...
16422 (symbol_t): this.
16423 (symbol_list_new, bucket_check_defined, bucket_make_alias)
16424 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
16425 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16426 (buckets_new, buckets_free, buckets_do): Rename as...
16427 (symbol_list_new, symbol_check_defined, symbol_make_alias)
16428 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16429 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
16430 (symbols_new, symbols_free, symbols_do): these.
16431
164322002-04-07 Akim Demaille <akim@epita.fr>
16433
16434 Use lib/hash for the symbol table.
16435
16436 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
16437 EOF.
16438 * src/lex.c (lex): Set the `number' member of new terminals.
16439 * src/reader.c (bucket_check_defined, bucket_make_alias)
16440 (bucket_check_alias_consistence, bucket_translation): New.
16441 (reader, grammar_free, readgram, token_translations_init)
16442 (packsymbols): Adjust.
16443 (reader): Number the predefined tokens.
16444 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
16445 for predefined tokens.
16446 * src/symtab.h (bucket): Remove all the hash table related
16447 members.
16448 * src/symtab.c (symtab): Replace by...
16449 (bucket_table): this.
16450 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16451 (buckets_new, buckets_do): New.
16452
164532002-04-07 Akim Demaille <akim@epita.fr>
16454
16455 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
16456 (start_symbol, max_user_token_number, semantic_parser)
16457 (error_token_number): Initialize.
16458 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
16459 Initialize.
16460 (reader): Don't.
16461 (errtoken, eoftoken, undeftoken, axiom): Extern.
16462
164632002-04-07 Akim Demaille <akim@epita.fr>
16464
16465 * src/gram.h (rule_s): prec and precsym are now pointers
16466 to the bucket giving the priority/associativity.
16467 Member `associativity' removed: useless.
16468 * src/reduce.c, src/conflicts.c: Adjust.
16469
164702002-04-07 Akim Demaille <akim@epita.fr>
16471
16472 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
16473 Properly escape the symbols' TAG when outputting them.
16474
164752002-04-07 Akim Demaille <akim@epita.fr>
16476
16477 * src/lalr.h (LA): Is a bitsetv, not bitset*.
16478
164792002-04-07 Akim Demaille <akim@epita.fr>
16480
16481 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
16482 (LArule): this, which is an array to rule_t*.
16483 * src/print.c, src/conflicts.c: Adjust.
16484
164852002-04-07 Akim Demaille <akim@epita.fr>
16486
16487 * src/gram.h (rule_t): Rename `number' as `user_number'.
16488 `number' is a new member.
16489 Adjust dependencies.
16490 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
16491
164922002-04-07 Akim Demaille <akim@epita.fr>
16493
16494 As a result of the previous patch, it is no longer needed
16495 to reorder ritem itself.
16496
16497 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
16498
164992002-04-07 Akim Demaille <akim@epita.fr>
16500
16501 Be sure never to walk through RITEMS, but use only data related to
16502 the rules themselves. RITEMS should be banished.
16503
16504 * src/output.c (output_token_translations): Rename as...
16505 (prepare_tokens): this.
16506 In addition to `translate', prepare the muscles `tname' and
16507 `toknum', which were handled by...
16508 (output_rule_data): this.
16509 Remove, and move the remainder of its outputs into...
16510 (prepare_rules): this new routines, which also merges content from
16511 (output_gram): this.
16512 (prepare_rules): Be sure never to walk through RITEMS.
16513 (output_stos): Rename as...
16514 (prepare_stos): this.
16515 (output): Always invoke prepare_states, after all, just don't use it
16516 in the output if you don't need it.
16517
165182002-04-07 Akim Demaille <akim@epita.fr>
16519
16520 * src/LR0.c (new_state): Display `nstates' as the name of the
16521 newly created state.
16522 Adjust to initialize first_state and last_state if needed.
16523 Be sure to distinguish the initial from the final state.
16524 (new_states): Create the itemset of the initial state, and use
16525 new_state.
16526 * src/closure.c (closure): Now that the initial state has its
16527 items properly set, there is no need for a special case when
16528 creating `ruleset'.
16529
16530 As a result, now the rule 0, reducing to $axiom, is visible in the
16531 outputs. Adjust the test suite.
16532
16533 * tests/conflicts.at (Solved SR Conflicts)
16534 (Unresolved SR Conflicts): Adjust.
16535 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
16536 * tests/conflicts.at (S/R in initial): New.
16537
165382002-04-07 Akim Demaille <akim@epita.fr>
16539
16540 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
16541 the RHS of the rules.
16542 * src/output.c (output_gram): Likewise.
16543
165442002-04-07 Akim Demaille <akim@epita.fr>
16545
16546 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
16547 bucket.
16548 Adjust all dependencies.
16549 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
16550 `number' of the buckets too.
16551 * src/gram.h: Include `symtab.h'.
16552 (associativity): Move to...
16553 * src/symtab.h: here.
16554 No longer include `gram.h'.
16555
165562002-04-07 Akim Demaille <akim@epita.fr>
16557
16558 * src/gram.h, src/gram.c (rules_rhs_length): New.
16559 (ritem_longest_rhs): Use it.
16560 * src/gram.h (rule_t): `number' is a new member.
16561 * src/reader.c (packgram): Set it.
16562 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
16563 the end of `rules', and count them out of `nrules'.
16564 (reduce_output, dump_grammar): Adjust.
16565 * src/print.c (print_grammar): It is no longer needed to check for
16566 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
16567 * tests/reduce.at (Reduced Automaton): New test.
16568
165692002-04-07 Akim Demaille <akim@epita.fr>
16570
16571 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
16572 lacking `+ 1' to nrules, Bison reported as useless a token if it
16573 was used solely to set the precedence of the last rule...
16574
165752002-04-07 Akim Demaille <akim@epita.fr>
16576
16577 * data/bison.c++, data/bison.simple: Don't output the current file
16578 name in #line, to avoid useless diffs between two identical
16579 outputs under different names.
16580
165812002-04-07 Akim Demaille <akim@epita.fr>
16582
16583 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
16584 Normalize loops to using `< nrules + 1', not `<= nrules'.
16585
165862002-04-07 Akim Demaille <akim@epita.fr>
16587
16588 * TODO: Update.
16589
165902002-04-07 Akim Demaille <akim@epita.fr>
16591
16592 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
16593 bucket.value as bucket.number.
16594
165952002-04-07 Akim Demaille <akim@epita.fr>
16596
16597 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
16598 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16599 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
16600 RHS, instead of being an index in RITEMS.
16601
166022002-04-04 Paul Eggert <eggert@twinsun.com>
16603
16604 * doc/bison.texinfo: Update copyright date.
16605 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
16606 (Symbols): Warn about running Bison in one character set,
16607 but compiling and/or running in an incompatible one.
16608 Warn about character code 256, too.
16609
166102002-04-03 Paul Eggert <eggert@twinsun.com>
16611
16612 * src/bison.data (YYSTACK_ALLOC): Depend on whether
16613 YYERROR_VERBOSE is nonzero, not whether it is defined.
16614
16615 Merge changes from bison-1_29-branch.
16616
166172002-03-20 Paul Eggert <eggert@twinsun.com>
16618
16619 Merge fixes from Debian bison_1.34-1.diff.
16620
16621 * configure.in (AC_PREREQ): 2.53.
16622
166232002-03-20 Akim Demaille <akim@epita.fr>
16624
16625 * src/conflicts.c (log_resolution): Argument `resolution' is const.
16626
166272002-03-19 Paul Eggert <eggert@twinsun.com>
16628
16629 * src/bison.simple (YYCOPY): New macro.
16630 (YYSTACK_RELOCATE): Use it.
16631 Remove Type arg; no longer needed. All callers changed.
16632 (yymemcpy): Remove; no longer needed.
16633
16634 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
16635 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16636
166372002-03-19 Akim Demaille <akim@epita.fr>
16638
16639 Test and fix the #line outputs.
16640
16641 * tests/atlocal.at (GCC): New.
16642 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
16643 (Prologue synch line, %union synch line, Postprologue synch line)
16644 (Action synch line, Epilogue synch line): New tests.
16645 * src/reader.c (parse_union_decl): Define the muscle stype_line.
16646 * data/bison.simple, data/bison.c++: Use it.
16647
166482002-03-19 Akim Demaille <akim@epita.fr>
16649
16650 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
16651 (Solved SR Conflicts, %expect not enough, %expect right)
16652 (%expect too much): Move to...
16653 * tests/conflicts.at: this new file.
16654
166552002-03-19 Akim Demaille <akim@epita.fr>
16656
16657 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16658 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
16659 that we can move to enums for instance.
16660 * src/output.c (token_definitions_output): Output a list of
16661 `token-name, token-number' instead of the #define.
16662 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
16663
166642002-03-14 Akim Demaille <akim@epita.fr>
16665
16666 Use Gettext 0.11.1.
16667
166682002-03-09 Robert Anisko <robert@lrde.epita.fr>
16669
16670 * data/bison.c++: Make the user able to add members to the generated
16671 parser by subclassing.
16672
166732002-03-05 Robert Anisko <robert@lrde.epita.fr>
16674
16675 * src/reader.c (read_additionnal_code): `c' should be an integer, not
16676 a character.
16677 Reported by Nicolas Tisserand and Nicolas Burrus.
16678
166792002-03-04 Robert Anisko <robert@lrde.epita.fr>
16680
16681 * src/reader.c: Warn about lacking semi-colons, do not complain.
16682
166832002-03-04 Robert Anisko <robert@lrde.epita.fr>
16684
16685 * data/bison.c++: Remove a debug line.
16686
166872002-03-04 Robert Anisko <robert@lrde.epita.fr>
16688
16689 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
16690 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
16691 provide a default implementation.
16692
166932002-03-04 Akim Demaille <akim@epita.fr>
16694
16695 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
16696 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
16697 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
16698 * tests/semantic.at (Parsing Guards): Similarly.
16699 * src/reader.at (readgram): Complain if the last rule is not ended
16700 with a semi-colon.
16701
167022002-03-04 Akim Demaille <akim@epita.fr>
16703
16704 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
16705 * src/closure.c: here.
16706 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
16707 RTC.
16708 * src/warshall.h, src/warshall.c: Remove.
16709 * tests/sets.at (Broken Closure): Adjust.
16710
167112002-03-04 Akim Demaille <akim@epita.fr>
16712
16713 * src/output.c (output_skeleton): tempdir is const.
16714 bytes_read is unused.
16715
167162002-03-04 Akim Demaille <akim@epita.fr>
16717
16718 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16719 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
16720 Update.
16721 From Michael Hayes.
16722
167232002-03-04 Akim Demaille <akim@epita.fr>
16724
16725 * src/closure.c (closure): `r' is unused.
16726
167272002-03-04 Akim Demaille <akim@epita.fr>
16728
16729 * tests/sets.at (Broken Closure): Add the ending `;'.
16730 * src/reader.at (readgram): Complain if a rule is not ended with a
16731 semi-colon.
16732
167332002-03-04 Akim Demaille <akim@epita.fr>
16734
16735 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
16736 (count_sr_conflicts): Use bitset_count.
16737 * src/reduce.c (inaccessable_symbols): Ditto.
16738 (bits_size): Remove.
16739 * src/warshall.h, src/warshall.c: Convert to bitsetv.
16740
167412002-03-04 Akim Demaille <akim@epita.fr>
16742
16743 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
16744 * src/reduce.c: Remove the `bitset_zero's following the
16745 `bitset_create's, as now it is performed by the latter.
16746
167472002-03-04 Akim Demaille <akim@epita.fr>
16748
16749 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
16750 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
16751 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
16752 latest sources from Michael.
16753
167542002-03-04 Akim Demaille <akim@epita.fr>
16755
16756 * src/output.c (output): Don't free the grammar.
16757 * src/reader.c (grammar_free): New.
16758 * src/main.c (main): Call it and don't free symtab here.
16759
167602002-03-04 Akim Demaille <akim@epita.fr>
16761
16762 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
16763 before returning.
16764 Reported by Benoit Perrot.
16765
167662002-03-04 Akim Demaille <akim@epita.fr>
16767
16768 Use bitset operations when possible, not loops over bits.
16769
16770 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
16771 bitset_or.
16772 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
16773 * src/reduce.c (useless_nonterminals): Formatting changes.
16774 * src/warshall.c (TC): Use bitset_or.
16775
167762002-03-04 Akim Demaille <akim@epita.fr>
16777
16778 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
16779 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
16780 Ditto.
16781
167822002-03-04 Akim Demaille <akim@epita.fr>
16783
16784 * src/lalr.c (F): Now a bitset*.
16785 Adjust all dependencies.
16786
167872002-03-04 Akim Demaille <akim@epita.fr>
16788
16789 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
16790 Adjust all dependencies.
16791
167922002-03-04 Akim Demaille <akim@epita.fr>
16793
16794 * src/L0.c, src/LR0.h (nstates): Be size_t.
16795 Adjust comparisons (signed vs unsigned).
16796 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
16797 bitset*.
16798 Adjust all dependencies.
16799
168002002-03-04 Akim Demaille <akim@epita.fr>
16801
16802 * src/closure.c (firsts): Now, also a bitset.
16803 Adjust all dependencies.
16804 (varsetsize): Remove, now unused.
16805 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
16806
168072002-03-04 Akim Demaille <akim@epita.fr>
16808
16809 * src/print.c: Convert to use bitset.h, not hand coded iterations
16810 over ints.
16811
168122002-03-04 Akim Demaille <akim@epita.fr>
16813
16814 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
16815
168162002-03-04 Akim Demaille <akim@epita.fr>
16817
16818 * src/closure.c (ruleset): Be a bitset.
16819 (rulesetsize): Remove.
16820
168212002-03-04 Akim Demaille <akim@epita.fr>
16822
16823 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
16824 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
16825 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
16826 * src/closure.c (fderives): Be an array of bitsets.
16827
168282002-02-28 Robert Anisko <robert@lrde.epita.fr>
16829
16830 * data/bison.c++: Merge the two generated headers. Insert a copyright
16831 notice in each output file.
16832
168332002-02-28 Akim Demaille <akim@epita.fr>
16834
16835 * data/bison.c++: Copy the prologue of bison.simple to fetch
16836 useful M4 definitions, such as b4_header_guard.
16837
168382002-02-25 Akim Demaille <akim@epita.fr>
16839
16840 * src/getargs.c (version): Give the name of the authors, and use a
16841 translator friendly scheme for the bgr
16842 copyright notice.
16843
168442002-02-25 Akim Demaille <akim@epita.fr>
16845
16846 * src/output.c (header_output): Remove, now handled completely via
16847 M4.
16848
168492002-02-25 Akim Demaille <akim@epita.fr>
16850
16851 * m4/m4.m4: New, from CVS Autoconf.
16852 * configure.in: Invoke it.
16853 * src/output.c (output_skeleton): Use its result instead of the
16854 hard coded name.
16855
168562002-02-25 Akim Demaille <akim@epita.fr>
16857
16858 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
16859 Fileutils 4.1.5.
16860 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
16861 * src/output.c (output_skeleton): Use mkstemp to create a real
16862 temporary file.
16863 Move the filling of `skeleton' and its muscle to...
16864 (prepare): here.
16865 (output): Move the definition of the prologue muscle to...
16866 (prepare): here.
16867 * src/system.h (DEFAULT_TMPDIR): New.
16868
168692002-02-14 Paul Eggert <eggert@twinsun.com>
16870
16871 Remove the support for C++ namespace cleanliness; it was
16872 causing more problems than it was curing, since it didn't work
16873 properly on some nonstandard C++ compilers. This can wait
16874 for a proper C++ parser.
16875
16876 * NEWS: Document this.
16877 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
16878 of C++, as it's treated like C now.
16879 * src/bison.simple (YYSTD): Remove.
16880 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
16881 Treat C++ just like Standard C instead of trying to support
16882 namespace cleanliness.
16883
168842002-02-14 Akim Demaille <akim@epita.fr>
16885
16886 * tests/regression.at (else): Adjust to Andreas' change.
16887
168882002-02-14 Akim Demaille <akim@epita.fr>
16889
16890 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
16891
168922002-02-13 Andreas Schwab <schwab@suse.de>
16893
16894 * src/output.c (output_rule_data): Don't output NULL, it might
16895 not be defined yet.
16896
168972002-02-11 Robert Anisko <robert@lrde.epita.fr>
16898
16899 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
16900 (Copyright notice): Update.
16901
169022002-02-11 Akim Demaille <akim@epita.fr>
16903
16904 * tests/regression.at (%nonassoc and eof): Don't include
16905 nonportable headers.
16906
169072002-02-08 Robert Anisko <robert@lrde.epita.fr>
16908
16909 * data/bison.c++: Correct error recovery. Make the user able to
16910 initialize the starting location.
16911
169122002-02-07 Akim Demaille <akim@epita.fr>
16913
16914 * tests/input.at: New.
16915
169162002-02-07 Robert Anisko <robert@lrde.epita.fr>
16917
16918 * data/bison.c++: Replace some direct m4 expansions by constants. Be
16919 more consistent when naming methods and variables. Put preprocessor
16920 directives around tables only needed for debugging.
16921
169222002-02-07 Robert Anisko <robert@lrde.epita.fr>
16923
16924 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
16925 C++ parsers.
16926 (yy::b4_name::parse): Use print_.
16927
169282002-02-07 Robert Anisko <robert@lrde.epita.fr>
16929
16930 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
16931
169322002-02-07 Robert Anisko <robert@lrde.epita.fr>
16933
16934 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
16935 C++ parsers.
16936 (yy::b4_name::parse): Build verbose error messages, and use error_.
16937
169382002-02-06 Robert Anisko <robert@lrde.epita.fr>
16939
16940 * data/bison.c++: Fix m4 quoting in comments.
16941
169422002-02-06 Robert Anisko <robert@lrde.epita.fr>
16943
16944 * data/bison.c++: Adjust the parser code. Fix some muscles that were
16945 not expanded by m4.
16946
169472002-02-05 Akim Demaille <akim@epita.fr>
16948
16949 * data/bison.c++: Adjust to the M4 back end.
16950 More is certainly needed.
16951
169522002-02-05 Akim Demaille <akim@epita.fr>
16953
16954 Give a try to M4 as a back end.
16955
16956 * lib/readpipe.c: New, from wdiff.
16957 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
16958 BISON_HAIRY.
16959 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
16960 specific values. Now it is m4 that performs the lookup.
16961 * src/parse-skel.y: Remove.
16962 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
16963 * src/output.c (actions_output, guards_output)
16964 (token_definitions_output): No longer keeps track of the output
16965 line number, hence remove the second argument.
16966 (guards_output): Check against the guard member of a rule, not the
16967 action member.
16968 Adjust callers.
16969 (output_skeleton): Don't look for the skeleton location, let m4 do
16970 that.
16971 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
16972 file will be used.
16973 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
16974 (prepare): Given that for the time being changesyntax is not
16975 usable in M4, rename the muscles using `-' to `_'.
16976 Define `defines_flag', `output_parser_name' and `output_header_name'.
16977 * src/output.h (actions_output, guards_output)
16978 (token_definitions_output): Adjust prototypes.
16979 * src/scan-skel.l: Instead of scanning the skeletons, it now
16980 processes the output of m4: `__oline__' and `#output'.
16981 * data/bison.simple: Adjust to be used by M4(sugar).
16982 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
16983 to date.
16984 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
16985 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
16986 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
16987 shamelessly stolen from CVS Autoconf.
16988
169892002-02-05 Akim Demaille <akim@epita.fr>
16990
16991 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
16992 * configure.in: Check for the declarations of free and malloc.
16993 * src/muscle_tab.c: Adjust.
16994
169952002-02-05 Akim Demaille <akim@epita.fr>
16996
16997 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
16998 which have no values.
16999
170002002-02-05 Akim Demaille <akim@epita.fr>
17001
17002 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
17003 * data/: here.
17004
170052002-01-29 Paul Eggert <eggert@twinsun.com>
17006
17007 * src/bison.simple (YYSIZE_T): Do not define merely because
17008 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
17009 On some platforms, <alloca.h> does not declare YYSTD (size_t).
17010
170112002-01-27 Akim Demaille <akim@epita.fr>
17012
17013 Fix `%nonassoc and eof'.
17014
17015 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
17016 which were not properly copied! Replace
17017 memcpy (res->errs, src->errs, src->nerrs);
17018 with
17019 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
17020 !!!
17021 * tests/regression.at (%nonassoc and eof): Adjust to newest
17022 Autotest: `.' is not in the PATH.
17023
170242002-01-27 Akim Demaille <akim@epita.fr>
17025
17026 * tests/sets.at (AT_EXTRACT_SETS): New.
17027 (Nullable): Use it.
17028 (Firsts): New.
17029
170302002-01-26 Akim Demaille <akim@epita.fr>
17031
17032 * tests/actions.at, tests/calc.at, tests/headers.at,
17033 * tests/torture.at: Adjust to the newest Autotest which no longer
17034 forces `.' in the PATH.
17035
170362002-01-25 Akim Demaille <akim@epita.fr>
17037
17038 * tests/regression.at (%nonassoc and eof): New.
17039 Suggested by Robert Anisko.
17040
170412002-01-24 Akim Demaille <akim@epita.fr>
17042
17043 Bison dumps core when trying to complain about broken input files.
17044 Reported by Cris van Pelt.
17045
17046 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
17047 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
17048 into...
17049 (Invalid inputs): Strengthen: exercise parse_percent_token.
17050
170512002-01-24 Robert Anisko <robert.anisko@epita.fr>
17052
17053 * src/Makefile.am: Add bison.c++.
17054 * src/bison.c++: New skeleton.
17055
170562002-01-21 Paolo Bonzini <bonzini@gnu.org>
17057
17058 * po/it.po: New.
17059
170602002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
17061
17062 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
17063
170642002-01-20 Marc Autret <marc@gnu.org>
17065
17066 * src/files.c (compute_output_file_names): Fix
17067
170682002-01-20 Marc Autret <marc@gnu.org>
17069
17070 * tests/output.at: New test.
17071 * src/files.c (compute_base_names): Don't map extensions when
17072 the YACC flag is set, use defaults.
17073 Reported by Evgeny Stambulchik.
17074
170752002-01-20 Marc Autret <marc@gnu.org>
17076
17077 * src/system.h: Need to define __attribute__ away for non-GCC
17078 compilers as well (i.e., the vendor C compiler).
17079 Suggested by Albert Chin-A-Young.
17080
170812002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
17082
17083 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
17084 canonical definition.
17085 * src/system.h: Use the canonical definition for PARAMS (avoids
17086 a conflict with the macro from lib/hash.h).
17087
170882002-01-11 Akim Demaille <akim@epita.fr>
17089
17090 * configure.in: Use AC_FUNC_STRNLEN.
17091 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
17092
170932002-01-09 Akim Demaille <akim@epita.fr>
17094
17095 * src/files.c, src/files.h (output_infix): New.
17096 (tab_extension): Remove.
17097 (compute_base_names): Compute the former, drop the latter.
17098 * src/output.c (prepare): Insert the muscles `output-infix', and
17099 `output-suffix'.
17100 * src/parse-skel.y (string, string.1): New.
17101 (section.header): Use it.
17102 (section.yacc): Remove.
17103 (prefix): Remove too.
17104 * src/scan-skel.l: Adjust.
17105 * src/bison.simple, src/bison.hairy: Adjust.
17106
171072002-01-09 Akim Demaille <akim@epita.fr>
17108
17109 * configure.in (WERROR_CFLAGS): Compute it.
17110 * src/Makefile.am (CFLAGS): Pass it.
17111 * tests/atlocal.in (CFLAGS): Idem.
17112 * src/files.c: Fix a few warnings.
17113 (get_extension_index): Remove, unused.
17114
171152002-01-08 Akim Demaille <akim@epita.fr>
17116
17117 * src/getargs.c (AS_FILE_NAME): New.
17118 (getargs): Use it to convert DOSish file names.
17119 * src/files.c (base_name): Rename as full_base_name to avoid
17120 clashes with `base_name ()'.
17121 (filename_split): New.
17122 (compute_base_names): N-th rewrite, using filename_split.
17123
171242002-01-08 Akim Demaille <akim@epita.fr>
17125
17126 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
17127 New, stolen from the Fileutils 4.1.
17128 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
17129 * configure.in: Check for the presence of memrchr, and of its
17130 prototype.
17131
171322002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
17133
17134 * lib/hash.h (__P): Added definition for this macro.
17135 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
17136 BUILT_SOURCES, to ensure they are generated first.
17137 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
17138 %error-verbose to allow bootstrapping with bison 1.30x.
17139
171402002-01-06 Akim Demaille <akim@epita.fr>
17141
17142 * src/reader.c (parse_braces): Don't fetch the next char, the
17143 convention is to fetch on entry.
17144 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
17145 'switch' without a following semicolon.
17146 * tests/regression.at (braces parsing): New.
17147
171482002-01-06 Akim Demaille <akim@epita.fr>
17149
17150 Bison is dead wrong in its RR conflict reports.
17151
17152 * tests/torture.at (GNU Cim Grammar): New.
17153 * src/conflicts.c (count_rr_conflicts): Fix.
17154
171552002-01-06 Akim Demaille <akim@epita.fr>
17156
17157 Creating package.m4 from configure.ac causes too many problems.
17158
17159 * tests/Makefile.am (package.m4): Create it by hand,
17160 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
17161
171622002-01-06 Akim Demaille <akim@epita.fr>
17163
17164 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
17165 skeleton.h.
17166
171672002-01-04 Paul Eggert <eggert@twinsun.com>
17168
17169 * doc/bison.texinfo (Debugging):
17170 Remove YYSTDERR; it's no longer defined or used.
17171 Also, s/cstdio.h/cstdio/.
17172
171732002-01-03 Akim Demaille <akim@epita.fr>
17174
17175 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
17176
171772002-01-03 Akim Demaille <akim@epita.fr>
17178
17179 * src/parse-skel.y (process_skeleton): Don't bind the parser's
17180 tracing code to --trace, wait for a better --trace option, with
17181 args.
17182
171832002-01-03 Akim Demaille <akim@epita.fr>
17184
17185 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
17186 The ISO C++ standard is extremely clear about it: stderr is
17187 considered a macro, not a regular symbol (see table 94 `Header
17188 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
17189 Therefore std:: does not apply to it. It still does with fprintf.
17190 Also, s/cstdio.h/cstdio/.
17191
171922002-01-03 Akim Demaille <akim@epita.fr>
17193
17194 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
17195 for non system headers.
17196
171972002-01-02 Akim Demaille <akim@epita.fr>
17198
17199 Equip the skeleton chain with location tracking, runtime trace,
17200 pure parser and scanner.
17201
17202 * src/parse-skel.y: Request a pure parser, locations, and prefix
17203 renaming.
17204 (%union): Having several members with the same type does not help
17205 type mismatches, simplify.
17206 (YYPRINT, yyprint): New.
17207 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
17208 (skel_error): this.
17209 Handle locations.
17210 * src/scan-skel.l: Adjust to these changes.
17211 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
17212 (LOCATION_PRINT, skel_control_t): New.
17213
172142001-12-30 Akim Demaille <akim@epita.fr>
17215
17216 * src/parse-skel.y: Get rid of the shift/reduce conflict:
17217 replace `gb' with BLANKS.
17218 * src/scan-skel.l: Adjust.
17219
172202001-12-30 Akim Demaille <akim@epita.fr>
17221
17222 * src/system.h: We don't need nor want bcopy.
17223 Throw away MS-DOS crap: we don't need getpid.
17224 * configure.in: We don't need strndup. It was even causing
17225 problems: because Flex includes the headers *before* us,
17226 _GNU_SOURCE is not defined by config.h, and therefore strndup was
17227 not visible.
17228 * lib/xstrndup.c: New.
17229 * src/scan-skel.l: Use it.
17230 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
17231 * src/parse-skel.y: Use %directives instead of #defines.
17232
172332001-12-30 Akim Demaille <akim@epita.fr>
17234
17235 * src/skeleton.h: New.
17236 * src/output.c (output_parser, output_master_parser): Remove, dead
17237 code.
17238 * src/output.h (get_lines_number, actions_output, guards_output)
17239 (token_definitions_output): Prototype them.
17240 * src/parse-skel.y: Add the license notice.
17241 Include output.h and skeleton.h.
17242 (process_skeleton): Returns void, and takes a single parameter.
17243 * src/scan-skel.l: Add the license notice.
17244 Include skeleton.h.
17245 Don't use %option yylineno: it seems that then Flex imagines
17246 REJECT has been used, and therefore it won't reallocate its
17247 buffers (which makes no other sense to me than a bug). It results
17248 in warnings for `unused: yy_flex_realloc'.
17249
172502001-12-30 Robert Anisko <robert.anisko@epita.fr>
17251
17252 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17253 (MUSCLE_INSERT_PREFIX): ...to there.
17254 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17255 (MUSCLE_INSERT_PREFIX): Move from here...
17256
17257 * src/bison.hairy: Add a section directive. Put braces around muscle
17258 names. This parser skeleton is still broken, but Bison should not
17259 choke on a bad muscle 'syntax'.
17260 * src/bison.simple: Add a section directive. Put braces around muscle
17261 names.
17262
17263 * src/files.h (strsuffix, stringappend): Add declarations.
17264 (tab_extension): Add declaration.
17265 (short_base_name): Add declaration.
17266
17267 * src/files.c (strsuffix, stringappend): No longer static. These
17268 functions are used in the skeleton parser.
17269 (tab_extension): New.
17270 (compute_base_names): Use the computations done in this function
17271 to guess if the generated parsers should have '.tab' in their
17272 names.
17273 (short_base_name): No longer static.
17274
17275 * src/output.c (output_skeleton): New.
17276 (output): Disable call to output_master_parser, and give a try to
17277 a new skeleton handling system.
17278 (guards_output, actions_output): No longer static.
17279 (token_definitions_output, get_lines_number): No longer static.
17280
17281 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
17282
17283 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
17284 parse-skel.y.
17285
17286 * src/parse-skel.y: New file.
17287 * src/scan-skel.l: New file.
17288
172892001-12-29 Akim Demaille <akim@epita.fr>
17290
17291 %name-prefix is broken.
17292
17293 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
17294 Adjust all dependencies.
17295 * tests/headers.at (export YYLTYPE): Strengthen this test: use
17296 %name-prefix.
17297
17298 Renaming yylval but not yylloc is not consistent. Now we do.
17299
17300 * src/bison.simple: Prefix yylloc if used.
17301 * doc/bison.texinfo (Decl Summary): Document that.
17302
173032001-12-29 Akim Demaille <akim@epita.fr>
17304
17305 * doc/bison.texinfo: Promote `%long-directive' over
17306 `%long_directive'.
17307 Remove all references to fixed-output-files, yacc is enough.
17308
173092001-12-29 Akim Demaille <akim@epita.fr>
17310
17311 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
17312 user prologue. These are defaults.
17313 * tests/actions.at (Mid-rule actions): Make sure the user can
17314 define YYDEBUG and YYERROR_VERBOSE.
17315
173162001-12-29 Akim Demaille <akim@epita.fr>
17317
17318 * src/output.c (header_output): Don't forget to export YYLTYPE and
17319 yylloc.
17320 * tests/headers.at (export YYLTYPE): New, make sure it does.
17321 * tests/regression.at (%union and --defines, Invalid CPP headers):
17322 Move to...
17323 * tests/headers.at: here.
17324
173252001-12-29 Akim Demaille <akim@epita.fr>
17326
17327 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
17328
173292001-12-29 Akim Demaille <akim@epita.fr>
17330
17331 * tests/actions.at (Mid-rule actions): Output on a single line
17332 instead of several.
17333
173342001-12-29 Akim Demaille <akim@epita.fr>
17335
17336 * doc/bison.texinfo: Formatting changes.
17337
173382001-12-29 Akim Demaille <akim@epita.fr>
17339
17340 Don't store the token defs in a muscle, just be ready to output it
17341 on command. Now possible via `symbols'. Fixes a memory leak.
17342
17343 * src/output.c (token_definitions_output): New.
17344 (output_parser, header_output): Use it.
17345 * src/reader.c (symbols_save): Remove.
17346
173472001-12-29 Akim Demaille <akim@epita.fr>
17348
17349 * src/bison.simple: Do not provide a default for YYSTYPE and
17350 YYLTYPE before the user's prologue. Otherwise it's hardly... a
17351 default.
17352
173532001-12-29 Akim Demaille <akim@epita.fr>
17354
17355 Mid-rule actions are simply... ignored!
17356
17357 * src/reader.c (readgram): Be sure to attach mid-rule actions to
17358 the empty-rule associated to the dummy symbol, not to the host
17359 rule.
17360 * tests/actions.at (Mid-rule actions): New.
17361
173622001-12-29 Akim Demaille <akim@epita.fr>
17363
17364 Memory leak.
17365
17366 * src/reader.c (reader): Free grammar.
17367
173682001-12-29 Akim Demaille <akim@epita.fr>
17369
17370 Memory leak.
17371
17372 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
17373 since it allocates it for each state, although only one is needed.
17374 (allocate_storage): Do it here.
17375
173762001-12-29 Akim Demaille <akim@epita.fr>
17377
17378 * src/options.h, src/options.c (create_long_option_table): Rename
17379 as...
17380 (long_option_table_new): this, with a clearer prototype.
17381 (percent_table): Remove, unused,
17382 * src/getargs.c (getargs): Adjust.
17383
173842001-12-29 Akim Demaille <akim@epita.fr>
17385
17386 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
17387 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
17388 as states.
17389
173902001-12-29 Akim Demaille <akim@epita.fr>
17391
17392 * src/lalr.c (build_relations): Rename `states' as `states1'.
17393 Sorry, I don't understand exactly what it is, no better name...
17394
173952001-12-29 Akim Demaille <akim@epita.fr>
17396
17397 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
17398 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
17399 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
17400 as rules.
17401
174022001-12-29 Akim Demaille <akim@epita.fr>
17403
17404 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
17405 ago.
17406
174072001-12-29 Akim Demaille <akim@epita.fr>
17408
17409 * src/reader.c, src/reader.h (user_toknums): Remove.
17410 Adjust all users to use symbols[i]->user_token_number.
17411
174122001-12-29 Akim Demaille <akim@epita.fr>
17413
17414 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
17415 Adjust all users to use symbols[i]->prec or ->assoc.
17416
174172001-12-29 Akim Demaille <akim@epita.fr>
17418
17419 * src/reader.c, src/reader.h (tags): Remove.
17420 Adjust all users to use symbols[i]->tag.
17421
174222001-12-29 Akim Demaille <akim@epita.fr>
17423
17424 * src/gram.h, src/gram.c (symbols): New, similar to state_table
17425 and rule_table.
17426 * src/reader.c (packsymbols): Fill this table.
17427 Drop sprec.
17428 * src/conflicts.c (resolve_sr_conflict): Adjust.
17429 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
17430 single table.
17431 Use symbols[i]->tag instead of tags[i].
17432
174332001-12-29 Akim Demaille <akim@epita.fr>
17434
17435 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
17436 In addition, put a comment in there, to replace...
17437 * tests/regression.at (%union and C comments): Remove.
17438
174392001-12-29 Akim Demaille <akim@epita.fr>
17440
17441 * tests/regression.at (Web2c Actions): Blindly move the actual
17442 output as expected output. The contents *seem* right to me, but I
17443 can't pretend reading perfectly parser tables... Nonetheless, all
17444 the other tests pass correctly, the table look OK, even though the
17445 presence of `$axiom' is to be noted: AFAICS it is useless (but
17446 harmless).
17447
174482001-12-29 Akim Demaille <akim@epita.fr>
17449
17450 * src/reader.c (readgram): Don't add the rule 0 if there were no
17451 rules read. In other words, add it _after_ having performed
17452 grammar sanity checks.
17453 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
17454
174552001-12-29 Akim Demaille <akim@epita.fr>
17456
17457 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
17458 visible, and some states have now a different number.
17459
174602001-12-29 Akim Demaille <akim@epita.fr>
17461
17462 * src/reader.c (readgram): Bind the initial rule's lineno to that
17463 of the first rule.
17464 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
17465 (Solved SR Conflicts): Adjust rule 0's line number.
17466
174672001-12-29 Akim Demaille <akim@epita.fr>
17468
17469 Fix the `GAWK Grammar' failure.
17470
17471 * src/LR0.c (final_state): Initialize to -1 so that we do compute
17472 the reductions of the first state which was mistakenly confused
17473 with the final state because precisely final_state was initialized
17474 to 0.
17475 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
17476 now noticed by Bison.
17477 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
17478 have a reduction on $default.
17479
174802001-12-29 Akim Demaille <akim@epita.fr>
17481
17482 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
17483 rule line numbers.
17484 * src/closure.c (print_closure): Likewise.
17485 * src/derives.c (print_derives): Likewise.
17486 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
17487 now.
17488
174892001-12-29 Akim Demaille <akim@epita.fr>
17490
17491 * src/lalr.c (lookaheads_print): New.
17492 (lalr): Call it when --trace-flag.
17493 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
17494 are dumped.
17495
174962001-12-29 Akim Demaille <akim@epita.fr>
17497
17498 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
17499 when walking through ritem, even via rule->rhs.
17500 * src/reduce.c (dump_grammar, useful_production, reduce_output)
17501 (useful_production, useless_nonterminals): Likewise.
17502 (reduce_grammar_tables): Likewise, plus update nritems.
17503 * src/nullable.c (set_nullable): Likewise.
17504 * src/lalr.c (build_relations): Likewise.
17505 * tests/sets.at (Nullable): Adjust.
17506 Fortunately, now, the $axiom is no longer nullable.
17507
175082001-12-29 Akim Demaille <akim@epita.fr>
17509
17510 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
17511 the 0-sentinel.
17512 * src/gram.c (ritem_longest_rhs): Likewise.
17513 * src/reduce.c (nonterminals_reduce): Likewise.
17514 * src/print_graph.c (print_graph): Likewise.
17515 * src/output.c (output_rule_data): Likewise.
17516 * src/nullable.c (set_nullable): Likewise.
17517
175182001-12-29 Akim Demaille <akim@epita.fr>
17519
17520 * src/output.c: Comment changes.
17521
175222001-12-27 Paul Eggert <eggert@twinsun.com>
17523
17524 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
17525 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
17526 Sparc, as they were causing more porting problems than the
17527 (minor) performance improvement was worth.
17528
17529 Also, catch up with 1.31's YYSTD.
17530
175312001-12-27 Akim Demaille <akim@epita.fr>
17532
17533 * src/output.c (output_gram): Rely on nritems, not the
17534 0-sentinel. See below.
17535 Use -1 as separator, not 0.
17536 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
17537 Rely on -1 as separator in yyrhs, instead of 0.
17538 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
17539 twice `Now at end of input', therefore there are two lines less to
17540 expect.
17541
175422001-12-27 Akim Demaille <akim@epita.fr>
17543
17544 * tests/regression.at (Unresolved SR Conflicts):
17545 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
17546 below.
17547
175482001-12-27 Akim Demaille <akim@epita.fr>
17549
17550 * src/LR0.c (new_state): Recognize the final state by the fact it
17551 is reached by eoftoken.
17552 (insert_start_shifting_state, insert_eof_shifting_state)
17553 (insert_accepting_state, augment_automaton): Remove, since now
17554 these states are automatically computed from the initial state.
17555 (generate_states): Adjust.
17556 * src/print.c: When reporting a rule number to the user, substract
17557 1, so that the axiom rule is rule 0, and the first user rule is 1.
17558 * src/reduce.c: Likewise.
17559 * src/print_graph.c (print_core): For the time being, just as for
17560 the report, depend upon --trace-flags to dump the full set of
17561 items.
17562 * src/reader.c (readgram): Once the grammar read, insert the rule
17563 0: `$axiom: START-SYMBOL $'.
17564 * tests/set.at: Adjust: rule 0 is now displayed, and since the
17565 number of the states has changed (the final state is no longer
17566 necessarily the last), catch up.
17567
175682001-12-27 Akim Demaille <akim@epita.fr>
17569
17570 Try to make the use of the eoftoken valid. Given that its value
17571 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
17572 is used instead of > 0 where appropriate, (ii), depend upon nritems
17573 instead of the 0-sentinel.
17574
17575 * src/gram.h, src/gram.c (nritems): New.
17576 Expected to be duplication of nitems, but for the time being...
17577 * src/reader.c (packgram): Assert nritems and nitems are equal.
17578 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
17579 * src/closure.c (print_closure, print_fderives): Likewise.
17580 * src/gram.c (ritem_print): Likewise.
17581 * src/print.c (print_core, print_grammar): Likewise.
17582 * src/print_graph.c: Likewise.
17583
175842001-12-27 Akim Demaille <akim@epita.fr>
17585
17586 * src/main.c (main): If there are complains after grammar
17587 reductions, then output the report anyway if requested, then die.
17588 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
17589 * src/reader.c (eoftoken): New.
17590 (parse_token_decl): If the token being defined has value `0', it
17591 is the eoftoken.
17592 (packsymbols): No longer hack `tags' to insert `$' by hand.
17593 Be sure to preserve the value of the eoftoken.
17594 (reader): Make sure eoftoken is defined.
17595 Initialize nsyms to 0: now eoftoken is created just like the others.
17596 * src/print.c (print_grammar): Don't special case the eof token.
17597 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
17598 lie anyway, albeit pleasant.
17599 * tests/calc.at: Exercise error messages with eoftoken.
17600 Change the grammar so that empty input is invalid.
17601 Adjust expectations.
17602 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
17603
176042001-12-27 Akim Demaille <akim@epita.fr>
17605
17606 * configure.in: Check the protos of strchr ans strspn.
17607 Replace strchr if needed.
17608 * src/system.h: Provide the protos of strchr, strspn and memchr if
17609 missing.
17610 * lib/strchr.c: New.
17611 * src/reader.c (symbols_save): Use strchr.
17612
176132001-12-27 Akim Demaille <akim@epita.fr>
17614
17615 * src/print.c, src/print_graph.c (escape): New.
17616 Use it to quote the TAGS outputs.
17617 * src/print_graph.c (print_state): Now errors are in red, and
17618 reductions in green.
17619 Prefer high to wide: output the state number on a line of its own.
17620
176212001-12-27 Akim Demaille <akim@epita.fr>
17622
17623 * src/state.h, src/state.c (reductions_new): New.
17624 * src/LR0.c (set_state_table): Let all the states have a
17625 `reductions', even if reduced to 0.
17626 (save_reductions): Adjust.
17627 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
17628 * src/print.c (print_reductions, print_actions): Adjust.
17629 * src/output.c (action_row): Adjust.
17630
176312001-12-27 Akim Demaille <akim@epita.fr>
17632
17633 * src/state.h, src/state.c (errs_new, errs_dup): New.
17634 * src/LR0.c (set_state_table): Let all the states have an errs,
17635 even if reduced to 0.
17636 * src/print.c (print_errs, print_reductions): Adjust.
17637 * src/output.c (output_actions, action_row): Adjust.
17638 * src/conflicts.c (resolve_sr_conflict): Adjust.
17639
176402001-12-27 Akim Demaille <akim@epita.fr>
17641
17642 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
17643
176442001-12-27 Akim Demaille <akim@epita.fr>
17645
17646 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
17647 * src/print.c: here.
17648 (lookaheadset, shiftset): New, used as additional storage by
17649 print_reductions.
17650 (print_results): Adjust.
17651 (print_shifts, print_gotos, print_errs): New, extracted from...
17652 (print_actions): here.
17653 * src/print_graph.c (print_actions): Remove dead code.
17654
176552001-12-27 Akim Demaille <akim@epita.fr>
17656
17657 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
17658 `$n' and `@n'.
17659
176602001-12-27 Akim Demaille <akim@epita.fr>
17661
17662 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
17663 (build_relations): Adjust.
17664
176652001-12-27 Akim Demaille <akim@epita.fr>
17666
17667 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
17668 duplication.
17669
176702001-12-27 Akim Demaille <akim@epita.fr>
17671
17672 * src/reader.c (packgram): Catch nitems overflows.
17673
176742001-12-27 Akim Demaille <akim@epita.fr>
17675
17676 * src/files.c, src/files.h (guard_obstack): Remove.
17677 * src/output.c (output): Adjust.
17678 * src/reader.c (parse_braces): New, factoring...
17679 (copy_action, copy_guard): these two which are renamed as...
17680 (parse_action, parse_guard): these.
17681 As a voluntary consequence, using braces around guards is now
17682 mandatory.
17683
176842001-12-27 Akim Demaille <akim@epita.fr>
17685
17686 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
17687 * src/reader.c (symbol_list): `guard' and `guard_line' are new
17688 members.
17689 (symbol_list_new): Adjust.
17690 (copy_action): action_line is the first line, not the last.
17691 (copy_guard): Just as for actions, store the `action' only, not
17692 the switch/case/break flesh.
17693 Don't parse the user action that might follow the guard, let...
17694 (readgram): do it, i.e., now, there can be an action after a
17695 guard.
17696 In other words the guard is just explicitly optional.
17697 (packgram): Adjust.
17698 * src/output.c (guards_output): New.
17699 (output_parser): Call it when needed.
17700 (output): Also free the guard and attrs obstacks.
17701 * src/files.c, src/files.h (obstack_save): Remove.
17702 (output_files): Remove.
17703 As a result, if one needs the former `.act' file, using an
17704 appropriate skeleton which requires actions and guards is now
17705 required.
17706 * src/main.c (main): Adjust.
17707 * tests/semantic.at: New.
17708 * tests/regression.at: Use `input.y' as input file name.
17709 Avoid 8+3 problems by requiring input.c when the test needs the
17710 parser.
17711
177122001-12-27 Akim Demaille <akim@epita.fr>
17713
17714 * src/reader.c (symbol_list_new): Be sure to initialize all the
17715 fields.
17716
177172001-12-27 Akim Demaille <akim@epita.fr>
17718
17719 All the hacks using a final pseudo state are now useless.
17720
17721 * src/LR0.c (set_state_table): state_table holds exactly nstates.
17722 * src/lalr.c (nLA): New.
17723 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
17724 instead of lookaheadsp from the pseudo state (nstate + 1).
17725
177262001-12-27 Akim Demaille <akim@epita.fr>
17727
17728 * src/output.c (action_row, token_actions): Use a state_t instead
17729 of a integer, and nlookaheads instead of the following state's
17730 lookaheadsp.
17731
177322001-12-27 Akim Demaille <akim@epita.fr>
17733
17734 * src/conflicts.c (log_resolution, flush_shift)
17735 (resolve_sr_conflict, set_conflicts, solve_conflicts)
17736 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
17737 (conflicts_print, print_reductions): Use a state_t instead of an
17738 integer when referring to a state.
17739 As much as possible, depend upon nlookaheads, instead of the
17740 `lookaheadsp' member of the following state (since lookaheads of
17741 successive states are successive, the difference between state n + 1
17742 and n served as the number of lookaheads for state n).
17743 * src/lalr.c (add_lookback_edge): Likewise.
17744 * src/print.c (print_core, print_actions, print_state)
17745 (print_results): Likewise.
17746 * src/print_graph.c (print_core, print_actions, print_state)
17747 (print_graph): Likewise.
17748 * src/conflicts.h: Adjust.
17749
177502001-12-27 Akim Demaille <akim@epita.fr>
17751
17752 * src/bison.hairy: Formatting/comment changes.
17753 ANSIfy.
17754 Remove `register' indications.
17755 Add plenty of `static'.
17756
177572001-12-27 Akim Demaille <akim@epita.fr>
17758
17759 * src/output.c (prepare): Drop the muscle `ntbase' which
17760 duplicates ntokens.
17761 * src/bison.simple: Formatting/comment changes.
17762 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
17763 is an undocumented synonym.
17764
177652001-12-22 Akim Demaille <akim@epita.fr>
17766
17767 * src/output.c (output_table_data): Change the prototype to use
17768 `int' for array ranges: some invocations do pass an int, not a
17769 short.
17770 Reported by Wayne Green.
17771
177722001-12-22 Akim Demaille <akim@epita.fr>
17773
17774 Some actions of web2c.y are improperly triggered.
17775 Reported by Mike Castle.
17776
17777 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
17778 * tests/regression.at (Web2c): Rename as...
17779 (Web2c Report): this.
17780 (Web2c Actions): New.
17781
177822001-12-22 Akim Demaille <akim@epita.fr>
17783
17784 Reductions in web2c.y are improperly reported.
17785 Reported by Mike Castle.
17786
17787 * src/conflicts.c (print_reductions): Fix.
17788 * tests/regression.at (Web2c): New.
17789
177902001-12-18 Akim Demaille <akim@epita.fr>
17791
17792 Some host fail on `assert (!"foo")', which expands to
17793 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
17794 Reported by Nelson Beebee.
17795
17796 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
17797 `#define it_succeeded 0' and `assert (it_succeeded)'.
17798
177992001-12-17 Marc Autret <autret_m@epita.fr>
17800
17801 * src/bison.simple: Don't hard code the skeleton line and filename.
17802 * src/output.c (output_parser): Rename 'line' as 'output_line'.
17803 New line counter 'skeleton_line' (skeleton-line muscle).
17804
178052001-12-17 Paul Eggert <eggert@twinsun.com>
17806
17807 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
17808 YYDEBUG must be defined to a nonzero value.
17809
17810 * src/bison.simple (yytname): Do not assume that the user defines
17811 YYDEBUG to a properly parenthesized expression.
17812
178132001-12-17 Akim Demaille <akim@epita.fr>
17814
17815 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
17816 nlookaheads is a new member.
17817 Adjust all users.
17818 * src/lalr.h (nlookaheads): Remove this orphan declaration.
17819 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
17820 state.
17821
178222001-12-17 Akim Demaille <akim@epita.fr>
17823
17824 * src/files.h, src/files.c (open_files, close_files): Remove.
17825 * src/main.c (main): Don't open/close files, nor invoke lex_free,
17826 let...
17827 * src/reader.c (reader): Do it.
17828
178292001-12-17 Akim Demaille <akim@epita.fr>
17830
17831 * src/conflicts.c (print_reductions): Formatting changes.
17832
178332001-12-17 Akim Demaille <akim@epita.fr>
17834
17835 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
17836 (flush_reduce): New.
17837 (resolve_sr_conflict): Adjust.
17838
178392001-12-17 Akim Demaille <akim@epita.fr>
17840
17841 * src/output.c (output_obstack): Be static and rename as...
17842 (format_obstack): this, to avoid any confusion with files.c's
17843 output_obstack.
17844 * src/reader.h (muscle_obstack): Move to...
17845 * src/output.h: here, since it's defined in output.c.
17846
178472001-12-17 Akim Demaille <akim@epita.fr>
17848
17849 * src/output.c (action_row, save_column, default_goto)
17850 (sort_actions, matching_state, pack_vector): Better variable
17851 locality.
17852
178532001-12-17 Akim Demaille <akim@epita.fr>
17854
17855 * src/output.c: Various formatting changes.
17856
178572001-12-17 Akim Demaille <akim@epita.fr>
17858
17859 * src/files.c (output_files): Free the output_obstack.
17860 * src/main.c (main): Call print and print_graph conditionally.
17861 * src/print.c (print): Work unconditionally.
17862 * src/print_graph.c (print_graph): Work unconditionally.
17863 * src/conflicts.c (log_resolution): Output only if verbose_flag.
17864
178652001-12-16 Marc Autret <autret_m@epita.fr>
17866
17867 * src/output.c (actions_output): Fix. When we use %no-lines,
17868 there is one less line per action.
17869
178702001-12-16 Marc Autret <autret_m@epita.fr>
17871
17872 * src/bison.simple: Remove a useless #line directive.
17873 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
17874 * src/output.c (get_lines_number): New.
17875 (output_parser): Adjust, now takes care about the lines of a
17876 output muscles.
17877 Fix line numbering.
17878 (actions_output): Computes the number of lines taken by actions.
17879 (output_master_parser): Insert new skeleton which is the name of
17880 the output parser file name.
17881
178822001-12-15 Marc Autret <autret_m@epita.fr>
17883
17884 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
17885
178862001-12-15 Marc Autret <autret_m@epita.fr>
17887
17888 * src/output.c (output_gram): Keep track of the hairy one.
17889
178902001-12-15 Akim Demaille <akim@epita.fr>
17891
17892 Make `make distcheck' work.
17893
17894 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
17895 system.h which uses libgettext.h.
17896
178972001-12-15 Akim Demaille <akim@epita.fr>
17898
17899 * src/nullable.c (set_nullable): Useless rules must be skipped,
17900 otherwise, since we range over their symbols, we might look at a
17901 nonterminal which no longer ``exists'', i.e., it is not counted in
17902 `nvars', hence we overflow our arrays.
17903
179042001-12-15 Akim Demaille <akim@epita.fr>
17905
17906 The header can also be produced directly, without any obstack!
17907 Yahoo!
17908
17909 * src/files.c, src/files.h (defines_obstack): Remove.
17910 (compute_header_macro): Global.
17911 (defines_obstack_save): Remove.
17912 * src/reader.c (parse_union_decl): No longer output to
17913 defines_obstack: its content can be found in the `stype' muscle
17914 anyway.
17915 (output_token_translations): Merge into...
17916 (symbols_output): this.
17917 Rename as...
17918 (symbols_save): this.
17919 (reader): Adjust.
17920 * src/output.c (header_output): New.
17921 (output): Call it.
17922
179232001-12-15 Akim Demaille <akim@epita.fr>
17924
17925 * src/reader.c (parse_union_decl): Instead of handling two obstack
17926 simultaneously, use one to define the `stype' muscle, and use the
17927 value of the latter to fill defines_obstack.
17928 (copy_comment): Remove.
17929 (copy_comment2): Work for a single obstack.
17930 Rename as...
17931 (copy_comment): this.
17932
179332001-12-15 Akim Demaille <akim@epita.fr>
17934
17935 * src/lex.c, src/lex.h (xgetc): No longer static.
17936 * src/reader.c (parse_union_decl): Revamp.
17937
179382001-12-15 Akim Demaille <akim@epita.fr>
17939
17940 Still making progress in separating Bison into (i) input, (ii)
17941 process, (iii) output: now we can directly output the parser file
17942 without using table_obstack at all.
17943
17944 * src/files.c, src/files.h (table_obstack): Bye bye.
17945 (parser_file_name): New.
17946 * src/files.c (compute_output_file_names): Compute it.
17947 * src/output.c (actions_output, output_parser)
17948 (output_master_parser): To a file instead of an obstack.
17949
179502001-12-15 Akim Demaille <akim@epita.fr>
17951
17952 Attach actions to rules, instead of pre-outputting them to
17953 actions_obstack.
17954
17955 * src/gram.h (rule_t): action and action_line are new members.
17956 * src/reader.c (symbol_list): Likewise.
17957 (copy_action): Save the actions within the rule.
17958 (packgram): Save them in rule_table.
17959 * src/output.c (actions_output): New.
17960 (output_parser): Use it on `%%actions'.
17961 (output_rule_data): Don't free rule_table.
17962 (output): Do it.
17963 (prepare): Don't save the `action' muscle.
17964 * src/bison.simple: s/%%action/%%actions/.
17965
179662001-12-15 Akim Demaille <akim@epita.fr>
17967
17968 * src/reader.c (copy_action): When --yacc, don't append a `;'
17969 to the user action: let it fail if lacking.
17970 Suggested by Arnold Robbins and Tom Tromey.
17971
179722001-12-14 Akim Demaille <akim@epita.fr>
17973
17974 * src/lex.c (literalchar): Simply return the char you decoded, non
17975 longer mess around with obstacks and int pointers.
17976 Adjust all callers.
17977
179782001-12-14 Akim Demaille <akim@epita.fr>
17979
17980 * src/lex.c (literalchar): Don't escape the special characters,
17981 just decode them, and keep them as char (before, eol was output as
17982 the 2 char string `\n' etc.).
17983 * src/output.c (output_rule_data): Use quotearg to output the
17984 token strings.
17985
179862001-12-13 Paul Eggert <eggert@twinsun.com>
17987
17988 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
17989 Do not infringe on the global user namespace when using C++.
17990 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
17991 All uses of `fprintf' and `stderr' changed.
17992
17993 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
17994
179952001-12-13 Akim Demaille <akim@epita.fr>
17996
17997 The computation of nullable is broken: it doesn't handle empty
17998 RHS's properly.
17999
18000 * tests/torture.at (GNU AWK Grammar): New.
18001 * tests/sets.at (Nullable): New.
18002 * src/nullable.c (set_nullable): Instead of blindly looping over
18003 `ritems', loop over the rules, and then over their rhs's.
18004
18005 Work around Autotest bugs.
18006
18007 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
18008 frame, because Autotest understand lines starting with a `+' as
18009 traces from the shell. Then, they are not processed properly.
18010 Admittedly an Autotest bug, but we don't have time to wait for
18011 Autotest to catch up.
18012 * tests/regression.at (Broken Closure): Adjust to the new table
18013 frames.
18014 Move to...
18015 * tests/sets.at: here.
18016
180172001-12-13 Akim Demaille <akim@epita.fr>
18018
18019 * src/closure.c (closure): Use nrules instead of playing tricks
18020 with BITS_PER_WORD.
18021
180222001-12-13 Akim Demaille <akim@epita.fr>
18023
18024 * src/print.c (print_actions): Output the handling of `$' as the
18025 traces do: shifting the token EOF. Before EOF was treated as a
18026 nonterminal.
18027 * tests/regression.at: Adjust some tests.
18028 * src/print_graph.c (print_core): Complete the set of items via
18029 closure. The next-to-final and final states are still unsatisfying,
18030 but that's to be addressed elsewhere.
18031 No longer output the rule numbers, but do output the state number.
18032 A single loop for the shifts + gotos is enough, but picked a
18033 distinct color for each.
18034 (print_graph): Initialize and finalize closure.
18035
180362001-12-13 Akim Demaille <akim@epita.fr>
18037
18038 * src/reader.c (readgram): Remove dead code, an strip useless
18039 braces.
18040 (get_type): Remove, unused.
18041
180422001-12-12 Akim Demaille <akim@epita.fr>
18043
18044 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
18045 on that of lib/error.c.
18046
180472001-12-12 Akim Demaille <akim@epita.fr>
18048
18049 Some hosts don't like `/' in includes.
18050
18051 * src/system.h: Include libgettext.h without qualifying the path.
18052 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
18053 $(top_srcdir).
18054
180552001-12-11 Marc Autret <autret_m@epita.fr>
18056
18057 * src/output.c (output_parser): Remove useless muscle.
18058
180592001-12-11 Marc Autret <autret_m@epita.fr>
18060
18061 * src/bison.simple: Remove #line just before %%epilogue. It
18062 is now handled in ...
18063 * src/reader.c (read_additionnal_code): Add the output of a
18064 #line for the epilogue.
18065
180662001-12-10 Marc Autret <autret_m@epita.fr>
18067
18068 * src/reader.c (copy_definition): Re-use CPP-outed code which
18069 replace precedent remove.
18070 * src/bison.simple: Remove #line before %%prologue because
18071 %%input-line is wrong at this time.
18072
180732001-12-10 Marc Autret <autret_m@epita.fr>
18074
18075 * src/reader.c (symbols_output): Clean up.
18076 * src/output.c (output_gram, output): Clean up.
18077
180782001-12-10 Akim Demaille <akim@epita.fr>
18079
18080 * src/lalr.c (initialize_lookaheads): New. Extracted from...
18081 * src/LR0.c (set_state_table): here.
18082 * src/lalr.c (lalr): Call it.
18083
180842001-12-10 Akim Demaille <akim@epita.fr>
18085
18086 * src/state.h (shifts): Remove the `number' member: shifts are
18087 attached to state, hence no longer need to be labelled with a
18088 state number.
18089
180902001-12-10 Akim Demaille <akim@epita.fr>
18091
18092 Now that states have a complete set of members, the linked list of
18093 shifts is useless: just fill directly the state's shifts member.
18094
18095 * src/state.h (shifts): Remove the `next' member.
18096 * src/LR0.c (first_state, last_state): Remove.
18097 Adjust the callers.
18098 (augment_automaton): Don't look for the shifts that must be added
18099 a shift on EOF: it is those of the state we looked for! But now,
18100 since shifts are attached, it is no longer needed to looking
18101 merely by its id: its number.
18102
181032001-12-10 Akim Demaille <akim@epita.fr>
18104
18105 * src/LR0.c (augment_automaton): Better variable locality.
18106 Remove an impossible branch: if there is a state corresponding to
18107 the start symbol being shifted, then there is shift for the start
18108 symbol from the initial state.
18109
181102001-12-10 Akim Demaille <akim@epita.fr>
18111
18112 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
18113 only when appropriate: when insert_start_shifting_state' is not
18114 invoked.
18115 * tests/regression.at (Rule Line Numbers): Adjust.
18116
181172001-12-10 Akim Demaille <akim@epita.fr>
18118
18119 * src/LR0.c (augment_automaton): Now that all states have shifts,
18120 merge the two cases addition shifts to the initial state.
18121
181222001-12-10 Akim Demaille <akim@epita.fr>
18123
18124 * src/lalr.c (set_state_table): Move to...
18125 * src/LR0.c: here.
18126 * src/lalr.c (lalr): Don't call it...
18127 * src/LR0.c (generate_states): do it.
18128 * src/LR0.h (first_state): Remove, only the table is used.
18129
181302001-12-10 Akim Demaille <akim@epita.fr>
18131
18132 * src/LR0.h (first_shift, first_reduction): Remove.
18133 * src/lalr.c: Don't use first_shift: find shifts through the
18134 states.
18135
181362001-12-10 Akim Demaille <akim@epita.fr>
18137
18138 * src/LR0.c: Attach shifts to states as soon as they are
18139 computed.
18140 * src/lalr.c (set_state_table): Instead of assigning shifts to
18141 state, just assert that the mapping was properly done.
18142
181432001-12-10 Akim Demaille <akim@epita.fr>
18144
18145 * src/LR0.c (insert_start_shift): Rename as...
18146 (insert_start_shifting_state): this.
18147 (insert_eof_shifting_state, insert_accepting_state): New.
18148 (augment_automaton): Adjust.
18149 Better locality of the variables.
18150 When looking if the start_symbol is shifted from the initial
18151 state, using `while (... symbol != start_symbol ...)' sounds
18152 better than `while (... symbol < start_symbol ...)': If fail
18153 to see how the order between symbols could be relevant!
18154
181552001-12-10 Akim Demaille <akim@epita.fr>
18156
18157 * src/getargs.h: Don't declare `spec_name_prefix' and
18158 `spec_file_prefix', declared by src/files.h.
18159 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
18160 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
18161 * src/output.c (prepare): Adjust.
18162 * src/reader.c (symbols_output): Likewise.
18163 * src/vmsgetargs.c: Vaguely adjust, but who cares?
18164
181652001-12-10 Akim Demaille <akim@epita.fr>
18166
18167 * src/muscle_tab.c (muscle_init): NULL is a better default than
18168 `"0"'.
18169
181702001-12-10 Akim Demaille <akim@epita.fr>
18171
18172 * src/reader.c (reader): Calling symbols_output once is enough.
18173
181742001-12-10 Akim Demaille <akim@epita.fr>
18175
18176 Now that states have a complete set of members, the linked list of
18177 reductions is useless: just fill directly the state's reductions
18178 member.
18179
18180 * src/state.h (struct reductions): Remove member `number' and
18181 `next'.
18182 * src/LR0.c (first_reduction, last_reduction): Remove.
18183 (save_reductions): Don't link the new reductions, store them in
18184 this_state.
18185 * src/lalr.c (set_state_table): No need to attach reductions to
18186 states, it's already done.
18187 * src/output.c (output_actions): No longer free the shifts, then
18188 the reductions, then the states: free all the states and their
18189 members.
18190
181912001-12-10 Akim Demaille <akim@epita.fr>
18192
18193 * src/options.c (OPTN, DRTV, BOTH): New.
18194 (option_table): Use them.
18195
18196 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
18197 the job of system.h.
18198 * src/options.c: Don't include stdio.h and xalloc.h for the same
18199 reasons.
18200
182012001-12-10 Akim Demaille <akim@epita.fr>
18202
18203 * src/output.c (output, prepare): Make sure the values of the
18204 muscles `action' and `prologue' are 0-terminated.
18205
182062001-12-10 Akim Demaille <akim@epita.fr>
18207
18208 Clean up GCC warnings.
18209
18210 * src/reader.c (copy_action): `buf' is not used.
18211 (parse_skel_decl): Be static.
18212 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
18213 * src/options.h (create_long_option_table): Have a real prototype.
18214 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
18215 (hash_delete_at): Return const void *.
18216 Adjust casts to preserve the const.
18217
182182001-12-10 Akim Demaille <akim@epita.fr>
18219
18220 * configure.in: Require 2.52g.
18221 M4 is not needed, but AUTOM4TE is.
18222 * m4/m4.m4: Remove.
18223 * tests/Makefile.am: Adjust.
18224
182252001-12-10 Akim Demaille <akim@epita.fr>
18226
18227 One structure for states is enough, even though theoretically
18228 there are LR(0) states and LALR(1) states.
18229
18230 * src/lalr.h (state_t): Remove.
18231 (state_table): Be state_t **, not state_t *.
18232 * src/state.h (core, CORE_ALLOC): Rename as...
18233 (state_t, STATE_ALLOC): this.
18234 Add the LALR(1) members: shifts, reductions, errs.
18235 * src/LR0.c (state_table): Rename as...
18236 (state_hash): this, to avoid name clashes with the global
18237 `state_table'.
18238 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
18239 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
18240
182412001-12-10 Akim Demaille <akim@epita.fr>
18242
18243 Bison dumps core on bash.y.
18244 Reported by Pascal Bart.
18245
18246 * src/warshall.c (bitmatrix_print): New.
18247 (TC): Use it.
18248 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
18249 j must be the outer loop.
18250 * tests/regression.at (Broken Closure): New.
18251
182522001-12-05 Akim Demaille <akim@epita.fr>
18253
18254 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
18255 its argument.
18256 Reported by Peter Hamorsky.
18257
182582001-12-05 Akim Demaille <akim@epita.fr>
18259
18260 * src/conflicts.c (err_table): Remove.
18261 (resolve_sr_conflict): Adjust.
18262 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
18263 Rename as...
18264 (state_t.reductions, state_t.shifts): this.
18265
182662001-12-05 Akim Demaille <akim@epita.fr>
18267
18268 * src/reduce.c (reduce_grammar_tables): No longer disable the
18269 removal of useless rules via CPP but via `if (0)', so that the
18270 compiler still check the code is valid.
18271 For instance, it should have noticed `rline' no longer exists: use
18272 the `line' member of rule_t.
18273 * src/gram.c (dummy, rline): Remove, unused.
18274
182752001-12-05 Akim Demaille <akim@epita.fr>
18276
18277 * src/output.c (pack_vector): Use assert, not berror.
18278 * src/main.c (berror): Remove, unused.
18279
182802001-12-05 Akim Demaille <akim@epita.fr>
18281
18282 New experimental feature: if --verbose --trace output all the
18283 items of a state, not only its kernel.
18284
18285 * src/print.c (print_core): If `trace_flag', then invoke closure
18286 before outputting the items of the state (print_core is no longer
18287 a correct name them).
18288 (print_results): Invoke new_closure/free_closure if needed.
18289
182902001-12-05 Akim Demaille <akim@epita.fr>
18291
18292 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
18293 * src/closure.c, src/closure.h (itemsetsize): Rename as...
18294 (nitemset): for consistency with the rest of the project.
18295
182962001-12-05 Akim Demaille <akim@epita.fr>
18297
18298 * src/closure.c (print_closure): Improve.
18299 (closure): Use it for printing input and output.
18300
183012001-12-05 Akim Demaille <akim@epita.fr>
18302
18303 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
18304 indexed by nonterminals.
18305
183062001-12-05 Akim Demaille <akim@epita.fr>
18307
18308 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
18309 what it was!).
18310 * src/warshall.h: Remove accidental duplication of the content.
18311
183122001-12-05 Akim Demaille <akim@epita.fr>
18313
18314 * src/closure.c (set_fderives): De-obfuscate.
18315
183162001-12-05 Akim Demaille <akim@epita.fr>
18317
18318 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
18319
183202001-12-05 Akim Demaille <akim@epita.fr>
18321
18322 * src/closure.c (set_firsts): De-obfuscate.
18323
183242001-12-05 Akim Demaille <akim@epita.fr>
18325
18326 * src/output.c (action_row): De-obfuscate
18327 using the good o' techniques: arrays not pointers, variable
18328 locality, BITISSET, RESETBIT etc.
18329
183302001-12-05 Akim Demaille <akim@epita.fr>
18331
18332 Pessimize the code to simplify it: from now on, all the states
18333 have a valid SHIFTS, which NSHIFTS is possibly 0.
18334
18335 * src/LR0.c (shifts_new): Be global and move to..
18336 * src/state.c, src/state.h: here.
18337 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
18338 * src/print_graph: Adjust.
18339
183402001-12-05 Akim Demaille <akim@epita.fr>
18341
18342 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
18343 * src/conflicts.c: Use it.
18344 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
18345 incorrectly ``simplified''.
18346
183472001-12-05 Akim Demaille <akim@epita.fr>
18348
18349 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
18350 using the good o' techniques: arrays not pointers, variable
18351 locality, BITISSET, RESETBIT etc.
18352
183532001-12-05 Akim Demaille <akim@epita.fr>
18354
18355 * src/state.h (SHIFT_SYMBOL): New.
18356 * src/conflicts.c: Use it to deobfuscate.
18357
183582001-12-05 Akim Demaille <akim@epita.fr>
18359
18360 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
18361 (print_reductions): De-obfuscate using the good o' techniques:
18362 arrays not pointers, variable locality, BITISSET.
18363
183642001-12-05 Akim Demaille <akim@epita.fr>
18365
18366 * src/conflicts.c (print_reductions): Arrays, not pointers.
18367 Use BITISSET.
18368
183692001-12-05 Akim Demaille <akim@epita.fr>
18370
18371 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18372
183732001-12-05 Akim Demaille <akim@epita.fr>
18374
18375 * src/conflicts.c (print_reductions): Improve variable locality.
18376
183772001-12-05 Akim Demaille <akim@epita.fr>
18378
18379 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18380
183812001-12-05 Akim Demaille <akim@epita.fr>
18382
18383 * src/conflicts.c (print_reductions): Improve variable locality.
18384
183852001-12-05 Akim Demaille <akim@epita.fr>
18386
18387 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
18388 * src/lalr.c: Use them.
18389
183902001-12-05 Akim Demaille <akim@epita.fr>
18391
18392 * src/LR0.c (augment_automaton): Formatting changes.
18393 Better variable locality.
18394
183952001-12-05 Akim Demaille <akim@epita.fr>
18396
18397 * src/lalr.c (matrix_print): New.
18398 (transpose): Use it.
18399 Use arrays instead of pointers.
18400
184012001-12-05 Akim Demaille <akim@epita.fr>
18402
18403 * src/lalr.c (maxrhs): Move to...
18404 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
18405 * src/lalr.c (build_relations): Adjust.
18406
184072001-12-05 Akim Demaille <akim@epita.fr>
18408
18409 * src/lalr.c (transpose): Free the memory allocated to the
18410 argument, as it is replaced by the results by the unique caller.
18411 (build_relations): Merely invoke transpose: it handles the memory
18412 deallocation.
18413 Improve variable locality.
18414 Avoid variables used as mere abbreviations.
18415 (compute_lookaheads): Use arrays instead of pointers.
18416
184172001-12-05 Akim Demaille <akim@epita.fr>
18418
18419 * src/lalr.c (initialize_F): Improve variable locality.
18420 Avoid variables used as mere abbreviations.
18421
184222001-12-05 Akim Demaille <akim@epita.fr>
18423
18424 * src/derives.c (print_derives): Display the ruleno.
18425 * src/lalr.c (initialize_F, transpose): Better variable locality
18426 to improve readability.
18427 Avoid variables used as mere abbreviations.
18428
184292001-12-05 Akim Demaille <akim@epita.fr>
18430
18431 * src/lalr.c (traverse): Use arrays instead of pointers.
18432
184332001-12-05 Akim Demaille <akim@epita.fr>
18434
18435 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
18436 the handling of squeue.
18437 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18438
184392001-12-05 Akim Demaille <akim@epita.fr>
18440
18441 Because useless nonterminals are now kept alive (instead of being
18442 `destroyed'), we now sometimes examine them, and store information
18443 related to them. Hence we need to know their number, and adjust
18444 memory allocations.
18445
18446 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
18447 static.
18448 * src/LR0.c (allocate_itemsets): The memory allocated to
18449 `symbol_count' was used for two different purpose: once to count
18450 the number of occurrences of each symbol, and later reassigned to
18451 `shift_symbol', containing the symbol that can be shifted from a
18452 given state.
18453 Deobfuscate, i.e., allocate, use and free `symbol_count' here
18454 only, and...
18455 (new_itemsets): Allocate `shift_symbol' here.
18456 (allocate_itemsets): symbol_count includes useless nonterminals.
18457 Make room for them.
18458 (free_storage): Use `free', not `XFREE', for pointers that cannot
18459 be null.
18460
184612001-12-05 Akim Demaille <akim@epita.fr>
18462
18463 * src/nullable.c (set_nullable): Deobfuscate the handling of
18464 ritem.
18465 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18466
184672001-12-05 Akim Demaille <akim@epita.fr>
18468
18469 * src/gram.c, src/gram.h (ritem_print): New.
18470 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
18471 (This useless function was defined only to work around VMS linkers
18472 that can't handle compilation units with variables only).
18473 * src/reduce.c (dump_grammar): Use it to trace the construction of
18474 ritem.
18475
184762001-12-04 Paul Eggert <eggert@twinsun.com>
18477
18478 * src/bison.simple (union yyalloc): Change member names
18479 to be the same as the stack names.
18480 (yyparse): yyptr is now union yyalloc *, not char *.
18481 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
18482 and may generate better code on some machines.
18483 (yystpcpy): Use prototype if __STDC__ is defined, not just
18484 if __cplusplus is defined.
18485
184862001-11-30 Akim Demaille <akim@epita.fr>
18487
18488 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
18489 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
18490 Gettext doesn't compile cleanly, and dies with -Werror.
18491 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
18492 Include WARNING_CFLAGS here.
18493 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
18494 before being defined.
18495
184962001-11-27 Paul Eggert <eggert@twinsun.com>
18497
18498 * lib/quotearg.h (quotearg_n, quotearg_n_style):
18499 First arg is int, not unsigned.
18500 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
18501 (SIZE_MAX, UINT_MAX): New macros.
18502 (quotearg_n_options): Abort if N is negative.
18503 Avoid overflow check on hosts where size_t is 64 bits and int
18504 is 32 bits, as overflow is impossible there.
18505 Fix off-by-one typo that caused unnecessary reallocation.
18506
185072001-11-29 Paul Eggert <eggert@twinsun.com>
18508
18509 Name space cleanup in generated parser.
18510
18511 * doc/bison.texinfo (Bison Parser): Discuss system headers
18512 and their effect on the user name space.
18513
18514 * src/bison.simple:
18515 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
18516 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
18517 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
18518
18519 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
18520 on user names when possible.
18521
18522 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
18523 Simplify test for whather <alloca.h> exists.
18524
18525 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
18526
18527 (<stdio.h>): Include if YYDEBUG.
18528
18529 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
18530 ! defined (yyoverflow) && ! defined (yymemcpy).
18531
18532 (yymemcpy, yyparse): Rename local variables as needed so that
18533 they all begin with 'yy'.
18534
18535 (yystrlen, yystpcpy): New functions.
18536
18537 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
18538 All uses changed.
18539
18540 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
18541 instead of relying on string.h functions. Use YYSTACK_ALLOC
18542 and YYSTACK_FREE instead of malloc and free.
18543
185442001-11-30 Akim Demaille <akim@epita.fr>
18545
18546 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
18547 before their first uses.
18548 (YYBISON, YYPURE): Move to the top of the output.
18549
185502001-11-30 Akim Demaille <akim@epita.fr>
18551
18552 * tests/reduce.at (Useless Nonterminals): Fix.
18553
185542001-11-30 Akim Demaille <akim@epita.fr>
18555
18556 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
18557 if body instead of `;' to pacify GCC's warnings.
18558
185592001-11-30 Akim Demaille <akim@epita.fr>
18560
18561 Instead of mapping the LHS of unused rules to -1, keep the LHS
18562 valid, but flag the rules as invalid.
18563
18564 * src/gram.h (rule_t): `useful' is a new member.
18565 * src/print.c (print_grammar): Adjust.
18566 * src/derives.c (set_derives): Likewise.
18567 * src/reader.c (packgram, reduce_output): Likewise.
18568 * src/reduce.c (reduce_grammar_tables): Likewise.
18569 * tests/reduce.at (Underivable Rules, Useless Rules): New.
18570
185712001-11-30 Akim Demaille <akim@epita.fr>
18572
18573 * src/reduce.c (reduce_output): Formatting changes.
18574 * src/print.c (print_results, print_grammar): Likewise.
18575 * tests/regression.at (Rule Line Numbers)
18576 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
18577
185782001-11-30 Akim Demaille <akim@epita.fr>
18579
18580 * src/reduce.c (nonterminals_reduce): Instead of throwing away
18581 useless nonterminals, move them at the end of the symbol arrays.
18582 (reduce_output): Adjust.
18583 * tests/reduce.at (Useless Nonterminals): Adjust.
18584
185852001-11-30 Akim Demaille <akim@epita.fr>
18586
18587 * src/reduce.c: Various comment/formatting changes.
18588 (nonterminals_reduce): New, extracted from...
18589 (reduce_grammar_tables): here.
18590 (reduce_grammar): Call nonterminals_reduce.
18591
185922001-11-29 Paul Eggert <eggert@twinsun.com>
18593
18594 * src/bison.simple (YYSTACK_REALLOC): Remove.
18595 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
18596 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
18597 New macros.
18598 (union yyalloc): New type.
18599 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
18600 an arbitrary restriction on hosts where size_t is wider than int.
18601
18602 (yyparse): Don't dump core if alloca or malloc fails; instead, report
18603 a parser stack overflow. Allocate just one block of memory for all
18604 three stacks, instead of allocating three blocks; this typically is
18605 faster and reduces fragmentation.
18606
18607 Do not limit the number of items in the stack to a value that fits
18608 in 'int', as this is an arbitrary limit on hosts with 64-bit
18609 size_t and 32-bit int.
18610
186112001-11-29 Marc Autret <autret_m@epita.fr>
18612
18613 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
18614 of defining YYERROR_VERBOSE.
18615 [AT_DATA]: $4 is now out of C declarations in the prologue.
18616
186172001-11-28 Marc Autret <autret_m@epita.fr>
18618
18619 * src/reader.c (parse_dquoted_param): New.
18620 (parse_skel_decl): Use it.
18621 * src/lex.h: Add its prototype.
18622 * src/lex.c (literalchar): Become not static.
18623
186242001-11-28 Marc Autret <autret_m@epita.fr>
18625
18626 * src/output.h: And put its extern declaration here.
18627 * src/output.c (error_verbose): Define here.
18628 (prepare): Echo name modification.
18629 * src/getargs.h: Clean its extern declaration.
18630 * src/getargs.c (error_verbose_flag): Remove.
18631 (getargs): Remove case 'e'.
18632 * src/options.c (option_table): 'error-verbose' is now seen as simple
18633 percent option.
18634 Include output.h.
18635
18636 * src/reader.c (read_declarations): Remove case tok_include.
18637 (parse_include_decl): Remove.
18638 * src/lex.h (token_t): Remove tok_include.
18639 * src/options.c (option_table): 'include' is now a simple command line
18640 option.
18641
186422001-11-28 Marc Autret <autret_m@epita.fr>
18643
18644 * src/bison.simple: Adjust muscle names.
18645 * src/muscle_tab.c (muscle_init): Also rename the muscles.
18646 * src/output.c (prepare): s/_/-/ for the muscles names.
18647 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
18648
186492001-11-28 Marc Autret <autret_m@epita.fr>
18650
18651 * src/bison.simple: Fix debug.
18652 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
18653
186542001-11-28 Akim Demaille <akim@epita.fr>
18655
18656 * src/LR0.c (shifts_new): New.
18657 (save_shifts, insert_start_shift, augment_automaton): Use it.
18658
186592001-11-28 Akim Demaille <akim@epita.fr>
18660
18661 * src/closure.c (closure): `b' and `ruleno' denote the same value:
18662 keep ruleno only.
18663
186642001-11-28 Akim Demaille <akim@epita.fr>
18665
18666 * src/closure.c (closure): Instead of looping over word in array
18667 then bits in words, loop over bits in array.
18668
186692001-11-28 Akim Demaille <akim@epita.fr>
18670
18671 * src/closure.c (closure): No longer optimize the special case
18672 where all the bits of `ruleset[r]' are set to 0, to make the code
18673 clearer.
18674
186752001-11-28 Akim Demaille <akim@epita.fr>
18676
18677 * src/closure.c (closure): `r' and `c' are new variables, used to
18678 de-obfuscate accesses to RULESET and CORE.
18679
186802001-11-28 Akim Demaille <akim@epita.fr>
18681
18682 * src/reduce.c (reduce_print): Use ngettext.
18683 (dump_grammar): Improve the trace accuracy.
18684
186852001-11-28 Akim Demaille <akim@epita.fr>
18686
18687 * src/reduce.c (dump_grammar): Don't translate trace messages.
18688
186892001-11-28 Akim Demaille <akim@epita.fr>
18690
18691 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
18692 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
18693 as all tags are free'ed afterwards.
18694 From Enrico Scholz.
18695
186962001-11-27 Paul Eggert <eggert@twinsun.com>
18697
18698 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
18699 use alloca when we didn't want to, and vice versa.
18700
187012001-11-27 Marc Autret <autret_m@epita.fr>
18702
18703 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
18704 initialization.
18705 * src/output.c (prepare): Remove its update.
18706
187072001-11-27 Marc Autret <autret_m@epita.fr>
18708
18709 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
18710 Use %error-verbose.
18711
187122001-11-27 Marc Autret <autret_m@epita.fr>
18713
18714 * src/bison.simple: Remove YYERROR_VERBOSE using.
18715 Use %%error_verbose.
18716 (yyparse): Likewise.
18717 * src/output.c (prepare): Give its final value.
18718 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
18719 * src/getargs.h: Add its extern declaration.
18720 * src/getargs.c (error_verbose_flag): New int.
18721 (getargs): Update to catch new case.
18722 * src/options.c (option_table): 'error-verbose' is a new option.
18723 (shortopts): Update.
18724
187252001-11-27 Akim Demaille <akim@epita.fr>
18726
18727 * src/system.h: Use intl/libgettext.h.
18728 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
18729
187302001-11-27 Akim Demaille <akim@epita.fr>
18731
18732 * tests/torture.at (Exploding the Stack Size with Malloc):
18733 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
18734
187352001-11-27 Akim Demaille <akim@epita.fr>
18736
18737 * src/files.c: Include error.h.
18738 Reported by Hans Aberg.
18739
187402001-11-26 Marc Autret <autret_m@epita.fr>
18741
18742 * src/reader.c (parse_include_decl): New, not yet implemented.
18743 (read_declarations): Add case tok_include.
18744 * src/getargs.h (include): Add its extern definition.
18745 * src/getargs.c (include): New const char *.
18746 (getargs): Add case '-I'.
18747 * src/options.c (option_table): Add include as command line and
18748 percent option.
18749 * src/lex.h (token_t): Add tok_include.
18750
187512001-11-26 Akim Demaille <akim@epita.fr>
18752
18753 * src/reader.c (readgram): Make sure rules for mid-rule actions
18754 have a lineno equal to that of their host rule.
18755 Reported by Hans Aberg.
18756 * tests/regression.at (Rule Line Numbers): New.
18757
187582001-11-26 Akim Demaille <akim@epita.fr>
18759
18760 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
18761 size_ts.
18762
187632001-11-26 Akim Demaille <akim@epita.fr>
18764
18765 * src/complain.c, src/complain.h (error): Remove, provided by
18766 lib/error.[ch].
18767
187682001-11-26 Akim Demaille <akim@epita.fr>
18769
18770 * src/reader.c (read_declarations): Don't abort on tok_illegal,
18771 issue an error message.
18772 * tests/regression.at (Invalid %directive): New.
18773 Reported by Hans Aberg.
18774
187752001-11-26 Akim Demaille <akim@epita.fr>
18776
18777 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
18778 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18779
187802001-11-26 Akim Demaille <akim@epita.fr>
18781
18782 * src/conflicts.c (conflicts_print): Don't complain at all when
18783 there are no reduce/reduce conflicts, and as many shift/reduce
18784 conflicts as expected.
18785 * tests/regression.at (%expect right): Adjust.
18786
187872001-11-23 Akim Demaille <akim@epita.fr>
18788
18789 * lib/alloca.c: Update, from fileutils.
18790
187912001-11-23 Akim Demaille <akim@epita.fr>
18792
18793 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
18794
187952001-11-23 Akim Demaille <akim@epita.fr>
18796
18797 * src/system.h: Include alloca.h.
18798 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
18799
188002001-11-23 Akim Demaille <akim@epita.fr>
18801
18802 * src/print_graph.c (print_actions): Remove `rule', unused.
18803 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
18804 pacify GCC's signed < unsigned warnings.
18805 * src/closure.c (itemsetsize): Likewise.
18806 * src/reader.c (symbol_list_new): Static.
18807
188082001-11-23 Akim Demaille <akim@epita.fr>
18809
18810 Attaching lineno to buckets is stupid, since only one copy of each
18811 symbol is kept, only the line of the first occurrence is kept too.
18812
18813 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
18814 * src/reader.c (rline_allocated): Remove, unused.
18815 (symbol_list): Have a `line' member.
18816 (symbol_list_new): New.
18817 (readgram): Use it.
18818 * src/print.c (print_grammar): Output the rule line numbers.
18819 * tests/regression.at (Solved SR Conflicts)
18820 (Unresolved SR Conflicts): Adjust.
18821 Reported by Hans Aberg.
18822
188232001-11-22 Marc Autret <autret_m@epita.fr>
18824
18825 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
18826
188272001-11-22 Marc Autret <autret_m@epita.fr>
18828
18829 * src/muscle_tab.c (muscle_init): Remove initialization of
18830 skeleton muscle.
18831 * src/output.c (output_master_parser): Do it here.
18832
188332001-11-20 Akim Demaille <akim@epita.fr>
18834
18835 * po/sv.po: New.
18836 * configure.in (ALL_LINGUAS): Adjust.
18837 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
18838 longer contains strings to translate.
18839
188402001-11-19 Akim Demaille <akim@epita.fr>
18841
18842 * src/conflicts.c (conflicts_print): Add a missing \n.
18843
188442001-11-19 Akim Demaille <akim@epita.fr>
18845
18846 * src/nullable.c (nullable_print): New.
18847 (set_nullable): Call it when tracing.
18848 Better locality of variables.
18849
188502001-11-19 Akim Demaille <akim@epita.fr>
18851
18852 * src/print.c (print_actions): Better locality of variables.
18853
188542001-11-19 Akim Demaille <akim@epita.fr>
18855
18856 * src/derives.c (print_derives): Fix and enrich.
18857 * src/closure.c (print_fderives): Likewise.
18858
188592001-11-19 Akim Demaille <akim@epita.fr>
18860
18861 * src/closure.c (itemsetend): Remove, replaced with...
18862 (itemsetsize): new.
18863
188642001-11-19 Akim Demaille <akim@epita.fr>
18865
18866 * src/LR0.c (kernel_end): Remove, replaced with...
18867 (kernel_size): new.
18868
188692001-11-19 Akim Demaille <akim@epita.fr>
18870
18871 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
18872 to clarify.
18873
188742001-11-19 Akim Demaille <akim@epita.fr>
18875
18876 * src/closure.c (closure): Use arrays instead of pointers to clarify.
18877
188782001-11-19 Akim Demaille <akim@epita.fr>
18879
18880 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
18881 trace messages.
18882 * src/LR0.c: Likewise.
18883 (allocate_itemsets): Use arrays instead of pointers to clarify.
18884
188852001-11-19 Akim Demaille <akim@epita.fr>
18886
18887 * src/getargs.c (statistics_flag): Replace with...
18888 (trace_flag): New.
18889 (longopts): Accept --trace instead of --statistics.
18890 * src/getargs.h, src/options.c: Adjust.
18891 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
18892 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
18893
188942001-11-19 Akim Demaille <akim@epita.fr>
18895
18896 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
18897 pointers to clarify the code.
18898 (save_reductions, save_shifts): Factor common parts of alternatives.
18899
189002001-11-19 Akim Demaille <akim@epita.fr>
18901
18902 * src/LR0.c (new_state, get_state): Complete TRACE code.
18903 * src/closure.c: Include `reader.h' to get `tags', needed by the
18904 trace code.
18905 Rename the conditional DEBUG as TRACE.
18906 Output consistently TRACEs to stderr, not stdout.
18907 * src/derives.c: Likewise.
18908 * src/reduce.c: (inaccessable_symbols): Using if is better style
18909 than goto.
18910 Use `#if TRACE' instead of `#if 0' for tracing code.
18911
189122001-11-19 Akim Demaille <akim@epita.fr>
18913
18914 * src/system.h (LIST_FREE, shortcpy): New.
18915 * src/LR0.c: Use them.
18916 * src/output.c (free_itemsets, free_reductions, free_shifts):
18917 Remove, replaced by LIST_FREE.
18918
189192001-11-19 Akim Demaille <akim@epita.fr>
18920
18921 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
18922 (REDUCTIONS_ALLOC): New.
18923 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
18924 allocation.
18925
189262001-11-19 Akim Demaille <akim@epita.fr>
18927
18928 * src/LR0.c (new_state): Complete trace code.
18929 * src/nullable.c (set_nullable): Don't translate traces.
18930
189312001-11-19 Akim Demaille <akim@epita.fr>
18932
18933 * src/print_graph.c (print_core): Better locality of variables.
18934 * src/print.c (print_core): Likewise.
18935
189362001-11-19 Akim Demaille <akim@epita.fr>
18937
18938 * src/vcg.c: You do the output, so you are responsible of the
18939 handling of VCG syntax, in particular: use quotearg.
18940 * src/print_graph.c: Don't.
18941 (print_actions): Don't output the actions as part of the nodes,
18942 since that's the job of the edges.
18943 (print_state): Don't output by hand: fill the node description,
18944 and ask for its output.
18945
189462001-11-19 Akim Demaille <akim@epita.fr>
18947
18948 * src/bison.simple (yyparse): When verbosely reporting an error,
18949 no longer put additional quotes around token names.
18950 * tests/calc.at: Adjust.
18951
189522001-11-19 Akim Demaille <akim@epita.fr>
18953
18954 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
18955 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
18956 * src/output.c: Adjust.
18957
189582001-11-19 Akim Demaille <akim@epita.fr>
18959
18960 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
18961 (rule_t): this.
18962 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
18963
189642001-11-19 Akim Demaille <akim@epita.fr>
18965
18966 * src/gram.h (rule_t): New.
18967 (rule_table): New.
18968 (rrhs, rlhs): Remove, part of state_t.
18969 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
18970 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
18971 * src/reader.c, src/reduce.c: Adjust.
18972
189732001-11-19 Akim Demaille <akim@epita.fr>
18974
18975 * src/reader.c (symbols_output): New, extracted from...
18976 (packsymbols): Here.
18977 (reader): Call it.
18978
189792001-11-19 Akim Demaille <akim@epita.fr>
18980
18981 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
18982 (maxrhs): this new function.
18983
189842001-11-19 Akim Demaille <akim@epita.fr>
18985
18986 * src/lalr.c (F): New macro to access the variable F.
18987 Adjust.
18988
189892001-11-19 Akim Demaille <akim@epita.fr>
18990
18991 * src/lalr.h (LA): New macro to access the variable LA.
18992 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
18993 * src/lalr.c: Adjust.
18994
189952001-11-19 Akim Demaille <akim@epita.fr>
18996
18997 * src/lalr.c (initialize_LA): Only initialize LA. Let...
18998 (set_state_table): handle the `lookaheads' members.
18999
190002001-11-19 Akim Demaille <akim@epita.fr>
19001
19002 * src/lalr.h (lookaheads): Removed array, whose contents is now
19003 a member of...
19004 (state_t): this structure.
19005 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19006 Adjust.
19007
190082001-11-19 Akim Demaille <akim@epita.fr>
19009
19010 * src/lalr.h (consistent): Removed array, whose contents is now
19011 a member of...
19012 (state_t): this structure.
19013 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19014 Adjust.
19015
190162001-11-19 Akim Demaille <akim@epita.fr>
19017
19018 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
19019 contents are now members of...
19020 (state_t): this structure.
19021 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19022 Adjust.
19023
190242001-11-19 Akim Demaille <akim@epita.fr>
19025
19026 * src/lalr.h (state_t): New.
19027 (state_table): Be a state_t * instead of a core **.
19028 (accessing_symbol): Remove, part of state_t.
19029 * src/lalr.c: Adjust.
19030 (set_accessing_symbol): Merge into...
19031 (set_state_table): this.
19032 * src/print_graph.c, src/conflicts.c: Adjust.
19033
190342001-11-14 Akim Demaille <akim@epita.fr>
19035
19036 * tests/calc.at, tests/output.at, tests/regression.at,
19037 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
19038 now the tests are run in private dirs, therefore AC_CLEANUP and
19039 family can be simplified to 0-ary.
19040 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
19041 use abs. path to find config.h.
19042 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
19043 stderr, there can be way too much random noise.
19044 Instead pass -Werror to GCC and rely on the exit status.
19045 Reported by Wolfram Wagner.
19046
190472001-11-14 Akim Demaille <akim@epita.fr>
19048
19049 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
19050 defined only if yyoverflow is defined, to avoid `warning: unused
19051 variable `yyvs1''.
19052 Reported by The Test Suite.
19053
190542001-11-14 Akim Demaille <akim@epita.fr>
19055
19056 * src/print.c: Include reduce.h.
19057 Reported by Hans Aberg.
19058
190592001-11-14 Akim Demaille <akim@epita.fr>
19060
19061 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
19062 Revert a previous patch: these are really const.
19063 * src/conflicts.c (conflict_report): Additional useless pair of
19064 braces to pacify GCC's warnings for `if () if () {} else {}'.
19065 * src/lex.c (parse_percent_token): Replace equal_offset with
19066 arg_offset.
19067 arg is const.
19068 Be sure to strdup `arg' when used, since there is no reason for
19069 token_buffer not to change.
19070
190712001-11-14 Akim Demaille <akim@epita.fr>
19072
19073 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
19074 definition.
19075 * src/main.c (main): Use them.
19076 Suggested by Hans Aberg.
19077
190782001-11-12 Akim Demaille <akim@epita.fr>
19079
19080 * src/system.h (ngettext): Now that we use ngettext, be sure to
19081 provide a default definition when NLS are not used.
19082
190832001-11-12 Akim Demaille <akim@epita.fr>
19084
19085 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
19086 Use @kbd to denote user input.
19087 (Language and Grammar): ANSIfy the example.
19088 Adjust its layout for info/notinfo.
19089 (Location Tracking Calc): Output error messages to stderr.
19090 Output locations in a more GNUtically correct way.
19091 Fix a couple of Englishos.
19092 Adjust @group/@end group pairs.
19093
190942001-11-12 Akim Demaille <akim@epita.fr>
19095
19096 %expect was not functioning at all.
19097
19098 * src/conflicts.c (expected_conflicts): Set to -1.
19099 (conflict_report): Use ngettext.
19100 (conflicts_print): Check %expect and make its violation an error.
19101 * doc/bison.texinfo (Expect Decl): Adjust.
19102 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
19103 * tests/regression.at (%expect not enough, %expect right)
19104 (%expect too much): New.
19105
191062001-11-12 Akim Demaille <akim@epita.fr>
19107
19108 * tests/regression.at (Conflicts): Rename as...
19109 (Unresolved SR Conflicts): this.
19110 (Solved SR Conflicts): New.
19111
191122001-11-12 Akim Demaille <akim@epita.fr>
19113
19114 * src/reduce.c (print_results): Rename as...
19115 (reduce_output): This.
19116 Output to OUT, passed as argument, instead of output_obstack.
19117 (dump_grammar): Likewise.
19118 (reduce_free): New.
19119 Also free V1.
19120 (reduce_grammar): No longer call reduce_output, since...
19121 * src/print.c (print_results): do it.
19122 * src/main.c (main): Call reduce_free;
19123
191242001-11-12 Akim Demaille <akim@epita.fr>
19125
19126 * src/conflicts.c (print_reductions): Accept OUT as argument.
19127 Output to it, not to output_obstack.
19128 * src/print.c (print_actions): Adjust.
19129
191302001-11-12 Akim Demaille <akim@epita.fr>
19131
19132 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
19133 the result instead of using...
19134 (src_total, rrc_total, src_count, rrc_count): Remove.
19135 (any_conflicts): Remove.
19136 (print_conflicts): Split into...
19137 (conflicts_print, conflicts_output): New.
19138 * src/conflicts.h: Adjust.
19139 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
19140 * src/print.c (print_grammar): Issue `\n' between two rules.
19141 * tests/regression.at (Conflicts): New.
19142 Reported by Tom Lane.
19143
191442001-11-12 Akim Demaille <akim@epita.fr>
19145
19146 * tests/regression.at (Invalid input): Remove, duplicate with
19147 ``Invalid input: 1''.
19148
191492001-11-12 Akim Demaille <akim@epita.fr>
19150
19151 * tests/torture.at (AT_DATA_STACK_TORTURE)
19152 (Exploding the Stack Size with Alloca)
19153 (Exploding the Stack Size with Malloc): New.
19154
191552001-11-12 Akim Demaille <akim@epita.fr>
19156
19157 * src/bison.simple (YYSTACK_REALLOC): New.
19158 (yyparse) [!yyoverflow]: Use it and free the old stack.
19159 Reported by Per Allansson.
19160
191612001-11-12 Pascal Bart <pascal.bart@epita.fr>
19162
19163 * src/bison.simple: Define type yystype instead of YYSTYPE, and
19164 define CPP macro, which substitute YYSTYPE by yystype.
19165 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
19166 with yyltype/YYLTYPE. This allows inclusion of the generated
19167 header within the parser if the compiler, such as GGC, accepts
19168 multiple equivalent #defines.
19169 From Akim.
19170
191712001-11-05 Akim Demaille <akim@epita.fr>
19172
19173 * src/reader.c (symbols_output): New, extracted from...
19174 (packsymbols): here.
19175 (reader): Adjust.
19176
191772001-11-05 Akim Demaille <akim@epita.fr>
19178
19179 * src/lex.c (parse_percent_token): s/quotearg/quote/.
19180
191812001-11-05 Akim Demaille <akim@epita.fr>
19182
19183 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
19184 pattern.
19185
191862001-11-05 Akim Demaille <akim@epita.fr>
19187
19188 * src/options.h (struct option_table_struct): set_flags is void*.
19189 * src/options.c (longopts): Support `--output' and `%output'.
19190 (usage): Adjust.
19191 * src/lex.h (tok_setopt): Remove, replaced with...
19192 (tok_intopt, tok_stropt): these new guys.
19193 * src/lex.c (getopt.h): Not needed.
19194 (token_buffer, unlexed_token_buffer): Not const.
19195 (percent_table): Promote `-' over `_' in directive names.
19196 Active `%name-prefix', `file-prefix', and `output'.
19197 (parse_percent_token): Accept possible arguments to directives.
19198 Promote `-' over `_' in directive names.
19199
192002001-11-04 Akim Demaille <akim@epita.fr>
19201
19202 * doc/bison.texinfo (Decl Summary): Split the list into
19203 `directives for grammars' and `directives for bison'.
19204 Sort'em.
19205 Add description of `%name-prefix', `file-prefix', and `output'.
19206 Promote `-' over `_' in directive names.
19207 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
19208 Simplify the description of `--name-prefix'.
19209 Promote `-' over `_' in directive names.
19210 Promote `--output' over `--output-file'.
19211 Fix the description of `--defines'.
19212 * tests/output.at: Exercise %file-prefix and %output.
19213
192142001-11-02 Akim Demaille <akim@epita.fr>
19215
19216 * doc/refcard.tex: Update.
19217
192182001-11-02 Akim Demaille <akim@epita.fr>
19219
19220 * src/symtab.h (SUNDEF): New.
19221 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
19222 stand for `uninitialized', instead of 0.
19223 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
19224 * src/lex.c (lex): Adjust.
19225
19226 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
19227 Number it 0.
19228 Let yylex return it instead of a plain 0.
19229 Reported by Dick Streefland.
19230
192312001-11-02 Akim Demaille <akim@epita.fr>
19232
19233 * tests/regression.at (Mixing %token styles): New test.
19234
192352001-11-02 Akim Demaille <akim@epita.fr>
19236
19237 * src/reader.c (parse_thong_decl): Formatting changes.
19238 (token_translations_init): New, extracted from...
19239 (packsymbols): Here.
19240 Adjust.
19241
192422001-11-01 Akim Demaille <akim@epita.fr>
19243
19244 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
19245 Check that `9foo.y' produces correct cpp guards.
19246 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
19247 guards.
19248 Reported by Wwp.
19249
192502001-11-01 Akim Demaille <akim@epita.fr>
19251
19252 * tests/regression.at (Invalid input: 2): New.
19253 * src/lex.c (unlexed_token_buffer): New.
19254 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
19255 too.
19256 Reported by Wwp.
19257
192582001-11-01 Akim Demaille <akim@epita.fr>
19259
19260 * tests/calc.at: Catch up with 1.30.
19261 * configure.in: Bump to 1.49a.
19262 Adjust to newer Autotest.
19263
192642001-10-19 Pascal Bart <pascal.bart@epita.fr>
19265
19266 * src/conflicts.c: Move global variables rrc_total and src_total ...
19267 (print_conflicts): here.
19268 * src/output.c (output): Free global variable user_toknums.
19269 * src/lex.c (token_obstack): Become static.
19270
192712001-10-18 Akim Demaille <akim@epita.fr>
19272
19273 * tests/atlocal.in (GCC): Add.
19274 * tests/calc.at: s/m4_match/m4_bmatch/.
19275 s/m4_patsubst/m4_bpatsubst/.
19276 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
19277 * configure.in: AC_SUBST(GCC).
19278
192792001-10-14 Marc Autret <autret_m@epita.fr>
19280
19281 * src/options.c (create_long_option_table): Fix.
19282
192832001-10-10 Akim Demaille <akim@epita.fr>
19284
19285 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
19286
192872001-10-04 Akim Demaille <akim@epita.fr>
19288
19289 * src/reader.c (parse_union_decl): Push the caracters in
19290 union_obstack, not attrs_obstack.
19291
192922001-10-04 Akim Demaille <akim@epita.fr>
19293
19294 Merge in the branch 1.29.
19295
19296 * src/reader.c (packsymbols): Use a temporary obstack for
19297 `%%tokendef', since output_stack is already used elsewhere.
19298
19299 2001-10-02 Akim Demaille <akim@epita.fr>
19300
19301 Bump 1.29d.
19302
19303 2001-10-02 Akim Demaille <akim@epita.fr>
19304
19305 Version 1.29c.
19306
19307 2001-10-02 Akim Demaille <akim@epita.fr>
19308
19309 * tests/regression.at (Invalid CPP headers): New.
19310 From Alexander Belopolsky.
19311 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
19312
19313 2001-10-02 Akim Demaille <akim@epita.fr>
19314
19315 * tests/regression.at (Invalid input): New.
19316 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
19317 Reported by Shura.
19318
19319 2001-10-02 Akim Demaille <akim@epita.fr>
19320
19321 * tests/calc.at: Now that --debug works, the tests must be adjusted.
19322
19323 2001-10-02 Akim Demaille <akim@epita.fr>
19324
19325 * src/output.c (output_parser): Assert `skeleton'.
19326 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
19327 systems.
19328 From Shura.
19329
19330 2001-10-01 Marc Autret <autret_m@epita.fr>
19331
19332 * src/lex.h: Echo modifications.
19333 * src/lex.c (unlex): Parameter is now token_t.
19334 From Hans Aberg.
19335
19336 2001-10-01 Marc Autret <autret_m@epita.fr>
19337
19338 * src/main.c: Include lex.h.
19339 From Hans Aberg.
19340
19341 2001-09-29 Akim Demaille <akim@epita.fr>
19342
19343 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
19344
19345 2001-09-28 Akim Demaille <akim@epita.fr>
19346
19347 * tests/testsuite.at: Update to newer Autotest.
19348 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
19349
19350 2001-09-27 Akim Demaille <akim@epita.fr>
19351
19352 Position independent wrapper.
19353
19354 * tests/bison: Remove.
19355 * tests/bison.in: New.
19356 * configure.in: Adjust.
19357
19358 2001-09-27 Paul Eggert <eggert@twinsun.com>
19359
19360 Port quotearg fixes from tar 1.13.24.
19361
19362 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
19363 tm to be declared.
19364 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
19365 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
19366
19367 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
19368 * m4/mbrtowc.m4: New file.
19369 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
19370 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
19371
19372 2001-09-27 Akim Demaille <akim@epita.fr>
19373
19374 Bump to 1.29c.
19375
19376 2001-09-27 Akim Demaille <akim@epita.fr>
19377
19378 Version 1.29b.
19379
19380 2001-09-25 Akim Demaille <akim@epita.fr>
19381
19382 * src/system.h: Include `xalloc.h'.
19383 Remove it from the C files.
19384 * src/files.c (output_files): Free the obstacks.
19385 * src/lex.c (init_lex): Rename as...
19386 (lex_init): this.
19387 (lex_free): New.
19388 * src/main.c (main): Use it.
19389
19390 2001-09-24 Marc Autret <autret_m@epita.fr>
19391
19392 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
19393 to output informations in fout (FILE*).
19394 (open_graph, close_graph): Likewise.
19395 (output_graph, output_edge, output_node): Likewise.
19396 * src/vcg.h: Update function prototypes.
19397 * src/print_graph.c (print_graph): Open output graph file.
19398 (print_actions): Adjust.
19399 * src/files.h: Remove extern declaration.
19400 * src/files.c: Remove graph_obstack declaration.
19401 (open_files): Remove graph_obstack initialization.
19402 (output_files): Remove graph_obstack saving.
19403
19404 2001-09-24 Marc Autret <autret_m@epita.fr>
19405
19406 * src/files.c (compute_output_file_names): Fix.
19407
19408 2001-09-24 Marc Autret <autret_m@epita.fr>,
19409 Akim Demaille <akim@epita.fr>
19410
19411 * src/reader.c (reader): Remove call to free_symtab ().
19412 * src/main.c (main): Call it here.
19413 Include symtab.h.
19414 * src/conflicts.c (initialize_conflicts): Rename as...
19415 (solve_conflicts): this.
19416 * src/print.c (print_core, print_actions, print_state)
19417 (print_grammar): Dump to a file instead a `output_obstack'.
19418 (print_results): Dump `output_obstack', and then proceed with the
19419 FILE *.
19420 * src/files.c (compute_output_file_names, close_files): New.
19421 (output_files): Adjust.
19422 * src/main.c (main): Adjust.
19423
19424 2001-09-23 Marc Autret <autret_m@epita.fr>
19425
19426 * src/files.c (compute_header_macro): Computes header macro name
19427 from spec_defines_file when given.
19428
19429 2001-09-23 Marc Autret <autret_m@epita.fr>
19430
19431 * src/files.c (output_files): Add default extensions.
19432
19433 2001-09-22 Akim Demaille <akim@epita.fr>
19434
19435 * src/conflicts.c (finalize_conflicts): Rename as...
19436 (free_conflicts): this.
19437
19438 2001-09-22 Akim Demaille <akim@epita.fr>
19439
19440 * src/gram.c (gram_free): Rename back as...
19441 (dummy): this.
19442 (output_token_translations): Free `token_translations'.
19443 * src/symtab.c (free_symtab): Free the tag field.
19444
19445 2001-09-22 Akim Demaille <akim@epita.fr>
19446
19447 Remove `translations' as it is always set to true.
19448
19449 * src/gram.h: Adjust.
19450 * src/reader.c (packsymbols, parse_token_decl): Adjust
19451 * src/print.c (print_grammar): Adjust.
19452 * src/output.c (output_token_translations): Adjust.
19453 * src/lex.c (lex): Adjust.
19454 * src/gram.c: Be sure the set pointers to NULL.
19455 (dummy): Rename as...
19456 (gram_free): this.
19457
19458 2001-09-22 Akim Demaille <akim@epita.fr>
19459
19460 * configure.in: Invoke AM_LIB_DMALLOC.
19461 * src/system.h: Use dmalloc.
19462 * src/LR0.c: Be sure to have pointers initialized to NULL.
19463 (allocate_itemsets): Allocate kernel_items only if needed.
19464
19465 2001-09-22 Akim Demaille <akim@epita.fr>
19466
19467 * configure.in: Bump to 1.29b.
19468 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
19469 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
19470 need xmalloc.c in calc.y.
19471 From Pascal Bart.
19472
19473 2001-09-21 Akim Demaille <akim@epita.fr>
19474
19475 Version 1.29a.
19476 * Makefile.maint, config/config.guess, config/config.sub,
19477 * config/missing: Update from masters.
19478 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
19479 upon package.m4.
19480 * configure.in (ALL_LINGUAS): Add `tr'.
19481
19482 2001-09-21 Akim Demaille <akim@epita.fr>
19483
19484 * tests/Makefile.am (package.m4): Move to...
19485 ($(srcdir)/$(TESTSUITE)): here.
19486
19487 2001-09-20 Akim Demaille <akim@epita.fr>
19488
19489 * src/complain.c: No longer try to be standalone: use system.h.
19490 Don't assume __STDC__ is defined to 1. Just test if it is defined.
19491 * src/complain.h: Likewise.
19492 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
19493 Remove the unused variable `n'.
19494 From Albert Chin-A-Young.
19495
19496 2001-09-18 Marc Autret <autret_m@epita.fr>
19497
19498 * doc/bison.1: Update.
19499 * doc/bison.texinfo (Bison Options): Update --defines and --graph
19500 descriptions.
19501 (Option Cross Key): Update.
19502 Add --graph.
19503
19504 2001-09-18 Marc Autret <autret_m@epita.fr>
19505
19506 * tests/regression.at: New test (comment in %union).
19507
19508 2001-09-18 Marc Autret <autret_m@epita.fr>
19509
19510 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
19511 do that.
19512 Reported by Keith Browne.
19513
19514 2001-09-18 Marc Autret <autret_m@epita.fr>
19515
19516 * tests/output.at: Add tests for --defines and --graph.
19517
19518 2001-09-18 Marc Autret <autret_m@epita.fr>
19519
19520 * tests/output.at: Removes tests of %{header,src}_extension features.
19521
19522 2001-09-18 Akim Demaille <akim@epita.fr>
19523
19524 * tests/Makefile.am (package.m4): New.
19525 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
19526 (_AT_CHECK_CALC_ERROR): Likewise.
19527 Factor the `, ' part of verbose error messages.
19528
19529 2001-09-18 Marc Autret <autret_m@epita.fr>
19530
19531 * src/getargs.c (longopts): Declare --defines and --graph as options
19532 with optional arguments.
19533 * src/files.h: Add extern declarations.
19534 * src/files.c (spec_graph_file, spec_defines_file): New.
19535 (output_files): Update.
19536 Remove CPP-outed code.
19537
19538 2001-09-18 Marc Autret <autret_m@epita.fr>
19539
19540 Turn off %{source,header}_extension feature.
19541
19542 * src/files.c (compute_exts_from_gf): Update.
19543 (compute_exts_from_src): Update.
19544 (output_files): CPP-out useless code.
19545 * src/files.h: Remove {header,source}_extension extern declarations.
19546 * src/reader.c (parse_dquoted_param): CPP-out.
19547 (parse_header_extension_decl): Remove.
19548 (parse_source_extension_decl): Remove.
19549 (read_declarations): Remove cases tok_{hdrext,srcext}.
19550 * src/lex.c (percent_table): Remove {header,source}_extension entries.
19551 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
19552
19553 2001-09-10 Akim Demaille <akim@epita.fr>
19554
19555 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
19556 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
19557 (AT_CHECK_OUTPUT): this.
19558 Merely check ls' exit status, its output is useless.
19559
19560 2001-09-10 Akim Demaille <akim@epita.fr>
19561
19562 * tests/calc.at: Use m4_match.
19563 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
19564
19565 2001-09-10 Marc Autret <autret_m@epita.fr>,
19566 Akim Demaille <akim@epita.fr>
19567
19568 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
19569 enum color_e.
19570 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
19571 to `normal'.
19572 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
19573 * src/lex.h: Adjust prototype.
19574 (token_t): Add `tok_undef'.
19575 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
19576 (parse_percent_token): Now returns token_t.
19577 Add default statement in switch.
19578 (lex): Separate `c' as an input variable, from the token_t result
19579 part.
19580 (unlexed): Is a token_t.
19581
19582 2001-09-10 Akim Demaille <akim@epita.fr>
19583
19584 * configure.in: Bump to 1.29a.
19585
19586 2001-09-07 Akim Demaille <akim@epita.fr>
19587
19588 Version 1.29.
19589
19590 2001-08-30 Akim Demaille <akim@epita.fr>
19591
19592 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
19593 * m4/atconfig.m4: Remove.
19594 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
19595 * tests/bison: New.
19596 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
19597 m4_if, m4_patsubst, and m4_regexp.
19598 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
19599 `input' file instead of echo.
19600
19601 2001-08-29 Akim Demaille <akim@epita.fr>
19602
19603 Bump to 1.28e.
19604
19605 2001-08-29 Akim Demaille <akim@epita.fr>
19606
19607 Version 1.28d.
19608
19609 2001-08-29 Paul Eggert <eggert@twinsun.com>
19610
19611 * src/bison.simple (yyparse): Don't take the address of an
19612 item before the start of an array, as that doesn't conform to
19613 the C Standard.
19614
19615 2001-08-29 Robert Anisko <anisko_r@epita.fr>
19616
19617 * doc/bison.texinfo (Location Tracking Calc): New node.
19618
19619 2001-08-29 Paul Eggert <eggert@twinsun.com>
19620
19621 * src/output.c (output): Do not define const, as this now
19622 causes more problems than it cures.
19623
19624 2001-08-29 Akim Demaille <akim@epita.fr>
19625
19626 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
19627 the nodes.
19628 Be sure to tag the `detailmenu'.
19629
19630 2001-08-29 Akim Demaille <akim@epita.fr>
19631
19632 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
19633 download in a tmp dir.
19634
19635 2001-08-28 Marc Autret <autret_m@epita.fr>
19636
19637 * config/depcomp: New file.
19638
19639 2001-08-28 Marc Autret <autret_m@epita.fr>
19640
19641 * doc/bison.1 (mandoc): Adjust.
19642 From Juan Manuel Guerrero.
19643
19644 2001-08-28 Marc Autret <autret_m@epita.fr>
19645
19646 * src/print_graph.c (print_state): Fix.
19647
19648 2001-08-27 Marc Autret <autret_m@epita.fr>
19649
19650 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
19651 char * members.
19652 Echo modifications to the functions prototypes.
19653 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
19654
19655 2001-08-27 Marc Autret <autret_m@epita.fr>
19656
19657 * src/vcg.c: Include `xalloc.h'.
19658 (add_colorentry): New.
19659 (add_classname): New.
19660 (add_infoname): New.
19661 * src/vcg.h: Add new prototypes.
19662
19663 2001-08-27 Akim Demaille <akim@epita.fr>
19664
19665 * Makefile.maint: Sync. again with CVS Autoconf.
19666
19667 2001-08-27 Akim Demaille <akim@epita.fr>
19668
19669 * Makefile.maint: Formatting changes.
19670 (po-update, cvs-update, update): New targets.
19671 (AMTAR): Remove.
19672
19673 2001-08-27 Akim Demaille <akim@epita.fr>
19674
19675 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19676 * Makefile.maint: Sync. with CVS Autoconf.
19677
19678 2001-08-27 Marc Autret <autret_m@epita.fr>
19679
19680 * src/vcg.h (struct infoname_s): New.
19681 (struct colorentry_s): New.
19682 (graph_s): New fields {vertical,horizontal}_order in structure.
19683 Add `infoname' field.
19684 Add `colorentry' field;
19685 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
19686 (G_HORIZONTAL_ORDER): New.
19687 (G_INFONAME): New.
19688 (G_COLORENTRY): New.
19689 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
19690 Add output of `infoname'.
19691 Add output of `colorentry'.
19692
19693 2001-08-27 Marc Autret <autret_m@epita.fr>
19694
19695 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
19696 This one shadowed a global parameter.
19697
19698 2001-08-24 Marc Autret <autret_m@epita.fr>
19699
19700 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
19701 instead of `unsigned'.
19702 (print_state): Do not call obstack_object_size () in obstack_grow ()
19703 to avoid macro variables shadowing.
19704
19705 2001-08-23 Marc Autret <autret_m@epita.fr>
19706
19707 * src/lex.c (percent_table): Typo: s/naem/name/.
19708 Add graph option.
19709 Normalize new options declarations.
19710
19711 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
19712
19713 * tests/suite.at: Exercise %header_extension and %source_extension.
19714
19715 2001-08-16 Marc Autret <autret_m@epita.fr>
19716
19717 * src/reader.c (parse_dquoted_param): New.
19718 (parse_header_extension_decl): Use it.
19719 (parse_source_extension_decl): Likewise.
19720
19721 2001-08-16 Marc Autret <autret_m@epita.fr>
19722
19723 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
19724 (get_xxxx_str): Use assert () instead of complain ().
19725 Remove return invokations in default cases.
19726 (get_decision_str): Modify default behaviour. Remove second argument.
19727 Echo modifications on calls.
19728 (output_graph): Fix.
19729
19730 2001-08-16 Marc Autret <autret_m@epita.fr>
19731
19732 * src/getargs.c (usage): Update with ``-g, --graph''.
19733
19734 2001-08-16 Marc Autret <autret_m@epita.fr>
19735
19736 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
19737 (Option Cross Key): Likewise.
19738 * doc/bison.1: Update.
19739
197402001-09-25 Pascal Bart <pascal.bart@epita.fr>
19741
19742 * src/output.c (output_master_parser): Don't finish action_obstack.
19743 (output_parser): Don't care about the muscle action, here.
19744 (prepare): Copy the action_obstack in the action muscle.
19745 (output): Free action_obstack.
19746
197472001-09-23 Pascal Bart <pascal.bart@epita.fr>
19748
19749 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
19750 will contain `%union' declaration.
19751 (parse_union_decl): Delete #line directive output.
19752 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
19753 informations about %union.
19754 (parse_union_decl): Copy the union_obstack in the muscle stype.
19755 * src/bison.simple: Add new #line directive.
19756 Add typdef %%stype YYSTYPE.
19757
197582001-09-23 Pascal Bart <pascal.bart@epita.fr>
19759
19760 * src/bison.simple: Add new `#line' directive.
19761
197622001-09-22 Pascal Bart <pascal.bart@epita.fr>
19763
19764 * src/bison.simple: New `#line' directive.
19765 * src/output.c (output_parser): Support new dynamic muscle input_line.
19766
197672001-09-22 Marc Autret <autret_m@epita.fr>
19768
19769 * src/output.c (output_master_parser): New.
19770 (output_parser): Be more re-entrant.
19771
197722001-09-21 Marc Autret <autret_m@epita.fr>
19773
19774 * src/reader.c (copy_definition, parse_union_decl): Update and use
19775 `linef' muscle.
19776 (copy_action): Likewise.
19777 Use obstack_1grow ().
19778 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
19779
197802001-09-21 Marc Autret <autret_m@epita.fr>
19781
19782 * src/options.c (option_table): Adjust.
19783 * src/lex.c (parse_percent_token): Fix.
19784
197852001-09-20 Pascal Bart <pascal.bart@epita.fr>
19786
19787 * src/options.c (symtab.h): Include it, need by lex.h.
19788
197892001-09-20 Pascal Bart <pascal.bart@epita.fr>
19790
19791 * src/lex.c (parse_percent_token): Change type of variable `tx', which
19792 is now an option_table_struct*.
19793 (option_strcmp): New function option_strcmp.
19794 (parse_percent_token): Call option_strcmp.
19795 * src/getargs.c (xalloc.h, options.h): Include it.
19796 (getargs): Call create_long_option_table.
19797 (getargs): Free longopts at the end of the function.
19798 (shortopts): Move in options.c.
19799 * src/options.c (create_long_option_table): New function. Convert
19800 information from option_table to option structure.
19801 * src/reader.c (options.h): Include it.
19802
19803 * src/Makefile.am: Adjust.
19804 * src/options.c (option_table): Create from longopts and percent_table.
19805 * src/getargs.c (longopts): Delete.
19806 * src/lex.c (struct percent_table_struct): Delete.
19807 (percent_table): Delete.
19808 (options.h): Include it.
19809 * src/options.c: Create.
19810 * src/options.h: Create.
19811 Declare enum opt_access_e.
19812 Define struct option_table_struct.
19813
198142001-09-20 Marc Autret <autret_m@epita.fr>
19815
19816 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
19817 sections of Bison.
19818
198192001-09-19 Pascal Bart <pascal.bart@epita.fr>
19820
19821 * src/bison.simple: s/%%filename/%%skeleton.
19822 * src/muscle_tab.c (getargs.h): Include it.
19823 (muscle_init): Insert new muscle skeleton.
19824
198252001-09-18 Pascal Bart <pascal.bart@epita.fr>
19826
19827 * src/output.c (output_parser): Delete unused variable actions_dumped.
19828
198292001-09-07 Pascal Bart <pascal.bart@epita.fr>
19830
19831 * src/output.c (output): Delete call to reader_output_yylsp.
19832 * src/reader.c (reader): Likewise.
19833 * src/reader.h: Delete declaration of reader_output_yylsp.
19834
198352001-09-02 Marc Autret <autret_m@epita.fr>
19836
19837 * src/reader.c: Include muscle_tab.h.
19838 (parse_union_decl): Update.
19839 (parse_macro_decl): Rename parse_muscle_decl.
19840 Update to use renamed functions and variable.
19841 (read_declarations, copy_action, read_additionnal_code, : Updated
19842 with correct variables and functions names.
19843 (packsymbols, reader): Likewise.
19844
19845 * src/reader.h (muscle_obstack): Extern declaration update.
19846
19847 * src/output.c: Include muscle_tab.h
19848 In all functions using macro_insert, change by using muscle_insert ().
19849 (macro_obstack): Rename muscle_obstack.
19850 Echo modifications in the whole file.
19851 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
19852 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
19853 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
19854
19855 * src/muscle_tab.h: Update double inclusion macros.
19856 (macro_entry_s): Rename muscle_entry_s.
19857 Update prototypes.
19858
19859 * src/muscle_tab.c: Include muscle_tab.h.
19860 Rename macro_tabble to muscle_table.
19861 (mhash1, mhash2, mcmp): Use muscle_entry.
19862 (macro_init): Rename muscle_init. Update.
19863 (macro_insert): Rename muscle_insert. Update.
19864 (macro_find): Rename muscle_find. Update.
19865
19866 * src/main.c: Include muscle_tab.h.
19867 (main): Call muscle_init ().
19868 * src/Makefile.am (bison_SOURCES): Echo modifications.
19869
198702001-09-02 Marc Autret <autret_m@epita.fr>
19871
19872 Now the files macro_tab.[ch] are named muscle_tab.[ch].
19873
19874 * src/muscle_tab.c, src/muscle_tab.h: Add files.
19875
198762001-09-02 Marc Autret <autret_m@epita.fr>
19877
19878 * src/macrotab.c, src/macrotab.h: Remove.
19879
198802001-09-01 Pascal Bart <pascal.bart@epita.fr>
19881
19882 * src/reader.c (copy_guard): Use muscle to specify the `#line'
19883 filename.
19884
198852001-09-01 Marc Autret <autret_m@epita.fr>
19886
19887 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
19888 to an explicit value to activate the feature. We do it here.
19889
198902001-08-31 Pascal Bart <pascal.bart@epita.fr>
19891
19892 * src/output.c (prepare): Delete the `filename' muscule insertion.
19893 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
19894 (parse_union_decl): Likewise.
19895 * src/macrotab.c (macro_init): Initialize filename by infile.
19896
198972001-08-31 Marc Autret <autret_m@epita.fr>
19898
19899 * src/bison.simple (YYLSP_NEEDED): New definition.
19900 * src/output.c (prepare): Add macro insertion of `locations_flag'
19901
199022001-08-31 Pascal Bart <pascal.bart@epita.fr>
19903
19904 * src/output.c (prepare): Delete insertion of previous muscles,
19905 and insert the `prefix' muscles.
19906 * src/macrotab.c (macro_init): Likewise.
19907 (macro_init): Initialization prefix directive by `yy'.
19908 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
19909 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
19910 yylval, yydebug, yyerror, yynerrs and yyparse.
19911 New directive `#define' to substitute yydebug, ... with option
19912 name_prefix.
19913
199142001-08-31 Pascal Bart <pascal.bart@epita.fr>
19915
19916 * src/main.c (main): Standardize.
19917 * src/output.c (output_table_data, output_parser): Likewise.
19918 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
19919
199202001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
19921
19922 * src/reader.c (read_additionnal_code): Rename %%user_code to
19923 %%epilogue.
19924 * src/output.c (output): Rename %%declarations to %%prologue.
19925 * src/bison.simple: Echo modifications.
19926
199272001-08-31 Marc Autret <autret_m@epita.fr>
19928
19929 * src/reader.c (readgram): CleanUp.
19930 (output_token_defines): Likewise.
19931 (packsymbols): Likewise.
19932 (reader): Likewise.
19933 * src/output.c (output): CPP-out useless code.
19934
199352001-08-31 Pascal Bart <pascal.bart@epita.fr>
19936
19937 * src/reader.c (reader): Delete obsolete call to function
19938 output_trailers and output_headers.
19939 * src/output.h: Remove obsolete functions prototypes of output_headers
19940 and output_trailers.
19941
199422001-08-30 Pascal Bart <pascal.bart@epita.fr>
19943
19944 * src/main.c: Include macrotab.h.
19945 * src/macrotab.h (macro_entry_s): Constify fields.
19946 Adjust functions prototypes.
19947 * src/macrotab.c (macro_insert): Constify key and value.
19948 (macro_find): Constify key.
19949 (macro_insert): Include 'xalloc.h'
19950 (macro_insert): Use XMALLOC.
19951 (macro_find): Constify return value.
19952 * src/output.c (output_table_data): Rename table to table_data.
19953 (output_parser): Constify macro_key, macro_value.
19954
199552001-08-30 Marc Autret <autret_m@epita.fr>
19956
19957 * src/reader.c (parse_skel_decl): New.
19958 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
19959 * src/lex.h (token_t): New token `tok_skel'.
19960 * src/lex.c (percent_table): Add skeleton option entry.
19961 Standardize.
19962
199632001-08-29 Marc Autret <autret_m@epita.fr>
19964
19965 * src/bison.simple: Add %%user_code directive at the end.
19966 * src/reader.c (read_additionnal_code): New.
19967 (reader): Use it.
19968 * src/output.c (output_program): Remove.
19969 (output): Update.
19970
199712001-08-28 Marc Autret <autret_m@epita.fr>
19972
19973 * src/output.c (output_actions): Clean up.
19974 (output_gram): CPP-out useless code.
19975 * src/reader.c (reader): Clean up, CPP-out useless code.
19976
199772001-08-28 Pascal Bart <pascal.bart@epita.fr>
19978
19979 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
19980 directive.
19981 * src/bison.simple: Add `%%definitions'.
19982
199832001-08-28 Marc Autret <autret_m@epita.fr>
19984
19985 * config/depcomp: New file.
19986
199872001-08-27 Paul Eggert <eggert@twinsun.com>
19988
19989 * src/bison.simple (yyparse): Don't take the address of an
19990 item before the start of an array, as that doesn't conform to
19991 the C Standard.
19992
199932001-08-27 Robert Anisko <robert.anisko@epita.fr>
19994
19995 * src/output.c (output): Remove the initialization of the macro
19996 obstack. It was done too late here.
19997
19998 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
19999 completely wrong.
20000 (reader): Initialize the macro obstack here, since we need it to grow
20001 '%define' directives.
20002
20003 * src/reader.h: Declare the macro obstack as extern.
20004
200052001-08-27 Robert Anisko <robert.anisko@epita.fr>
20006
20007 * src/output.c (output_parser): Fix. Store single '%' characters in
20008 the output obstack instead of throwing them away.
20009
200102001-08-27 Akim Demaille <akim@epita.fr>
20011
20012 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
20013
200142001-08-25 Robert Anisko <robert.anisko@epita.fr>
20015
20016 * lib/Makefile.am: Adjust.
20017
200182001-08-25 Robert Anisko <robert.anisko@epita.fr>
20019
20020 * src/bison.simple: Update and add '%%' directives.
20021
200222001-08-25 Robert Anisko <robert.anisko@epita.fr>
20023
20024 * src/reader.c (reader): Remove calls to 'output_headers' and
20025 'output_trailers'. Remove some C output.
20026 (readgram): Disable a piece of code that was writing a default
20027 definition for 'YYSTYPE'.
20028 (reader_output_yylsp): Remove.
20029 (packsymbols): Output token defintions to a macro.
20030 (copy_definition): Disable C output.
20031
20032 * src/reader.c (parse_macro_decl): New function used to parse macro
20033 declarations.
20034 (copy_string2): Put the body of copy_string into this new function.
20035 Add a parameter to let the caller choose whether he wants to copy the
20036 string delimiters or not.
20037 (copy_string): Be a simple call to copy_string2 with the last argument
20038 bound to true.
20039 (read_declarations): Add case for macro definition.
20040 (copy_identifier): New.
20041 (parse_macro_decl): Read macro identifiers using copy_identifier
20042 rather than lex.
20043
200442001-08-25 Robert Anisko <robert.anisko@epita.fr>
20045
20046 * src/output.c (prepare): Add prefixed names.
20047 (output_parser): Output semantic actions.
20048 (output_parser): Fix bug on '%%line' directives.
20049
20050 * src/output.c (output_headers): Remove. The C code printed by this
20051 function should now be in the skeletons.
20052 (output_trailers): Remove.
20053 (output): Disable call to 'reader_output_yylsp'.
20054 (output_rule_data): Do not output tables to the table obstack.
20055
20056 * src/output.c: Remove some C dedicated output.
20057 Improve the use of macro and output obstacks.
20058 (output_defines): Remove.
20059
20060 * src/output.c (output_token_translations): Associate 'translate'
20061 table with a macro. No output to the table obstack.
20062 (output_gram): Same for 'rhs' and 'prhs'.
20063 (output_stos): Same for 'stos'.
20064 (output_rule_data): Same for 'r1' and 'r2'.
20065 (token_actions): Same for 'defact'.
20066 (goto_actions): Same for 'defgoto'.
20067 (output_base): Same for 'pact' and 'pgoto'.
20068 (output_table): Same for 'table'.
20069 (output_check): Same for 'check'.
20070
20071 * src/output.c (output_table_data): New function.
20072 (output_short_table): Remove.
20073 (output_short_or_char_table): Remove.
20074
20075 * src/output.c (output_parser): Replace most of the skeleton copy code
20076 with something new. Skeletons are now processed character by character
20077 rather than line by line, and Bison looks for '%%' macros. This is the
20078 first step in making Bison's output process (a lot) more flexible.
20079 (output_parser): Use the macro table.
20080
200812001-08-25 Robert Anisko <robert.anisko@epita.fr>
20082
20083 * src/main.c (main): Initialize the macro table.
20084
200852001-08-25 Robert Anisko <robert.anisko@epita.fr>
20086
20087 * src/lex.c (percent_table): Add tok_define.
20088 * src/lex.h: Add tok_define.
20089
200902001-08-25 Robert Anisko <robert.anisko@epita.fr>
20091
20092 * src/macrotab.c: New file.
20093 * src/macrotab.h: New file.
20094 * src/Makefile.am: Update.
20095
200962001-08-25 Robert Anisko <robert.anisko@epita.fr>
20097
20098 * lib/hash.c: New file.
20099 * lib/hash.h: New file.
20100 * lib/Makefile.am: Update.
20101
201022001-08-15 Akim Demaille <akim@epita.fr>
20103
20104 Version 1.28c.
20105
201062001-08-15 Marc Autret <autret_m@epita.fr>
20107
20108 * src/reader.c (readgram): Indent output macro YYSTYPE.
20109 (packsymbols): Likewise.
20110 (output_token_defines): Likewise.
20111 * src/files.c: Standardize.
20112 (compute_header_macro): New.
20113 (defines_obstack_save): New. Use compute_header_macro.
20114 (output_files): Update. Use defines_obstack_save.
20115
201162001-08-15 Akim Demaille <akim@epita.fr>
20117
20118 * doc/bison.texinfo (Table of Symbols): Document
20119 YYSTACK_USE_ALLOCA.
20120
201212001-08-15 Akim Demaille <akim@epita.fr>
20122
20123 * missing: Update from CVS Automake.
20124 * config/config.guess, config/config.sub, config/texinfo.tex:
20125 Update from gnu.org.
20126
201272001-08-15 Akim Demaille <akim@epita.fr>
20128
20129 * Makefile.maint: Sync with CVS Autoconf.
20130
201312001-08-14 Pascal Bart <pascal.bart@epita.fr>
20132
20133 * doc/bison.texinfo: Include GNU Free Documentation License from
20134 `fdl.texi'.
20135 * doc/fdl.texi: Add to package.
20136
201372001-08-14 Marc Autret <autret_m@epita.fr>
20138
20139 Turn on %{source,header}_extension features.
20140
20141 * src/lex.c (percent_table): Un-CPP out header_extension and
20142 source_extension.
20143 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
20144 (compute_exts_from_src): Remove conditions. It restores priorities
20145 between options.
20146
201472001-08-14 Marc Autret <autret_m@epita.fr>
20148
20149 * src/files.c (compute_base_names): Add extensions computing when
20150 `--file-prefix' used.
20151 Standardize function calls.
20152
201532001-08-13 Marc Autret <autret_m@epita.fr>
20154
20155 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
20156 defining it (defined but null disables alloca).
20157
201582001-08-13 Marc Autret <autret_m@epita.fr>
20159
20160 * src/bison.simple (_yy_memcpy): CPP reformat.
20161
201622001-08-13 Pascal Bart <pascal.bart@epita.fr>
20163
20164 * tests/atconfig.in (CPPFLAGS): Fix.
20165
201662001-08-10 Pascal Bart <pascal.bart@epita.fr>
20167
20168 * doc/bison.texinfo: Include GNU General Public License from
20169 `gpl.texi'.
20170 * doc/gpl.texi: Add to package.
20171
201722001-08-10 Marc Autret <autret_m@epita.fr>
20173
20174 * src/print_graph.h: Fix.
20175 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
20176
201772001-08-10 Akim Demaille <akim@epita.fr>
20178
20179 * src/system.h: Provide default declarations for stpcpy, strndup,
20180 and strnlen.
20181
201822001-08-10 Robert Anisko <anisko_r@epita.fr>
20183
20184 * doc/bison.texinfo (Locations): Update @$ stuff.
20185
201862001-08-09 Robert Anisko <anisko_r@epita.fr>
20187
20188 * src/bison.simple (YYLLOC_DEFAULT): Update.
20189 (yyparse): Adjust.
20190
201912001-08-08 Marc Autret <autret_m@epita.fr>
20192
20193 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
20194 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
20195 Reported by Fabrice Bauzac.
20196
201972001-08-08 Marc Autret <autret_m@epita.fr>
20198
20199 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
20200 * src/vcg.c (output_node): Fix.
20201 * src/vcg.h: Cleanup.
20202 * src/print_graph.c: Add comments.
20203 (node_output_size): New global variable. Simplify the formatting of
20204 the VCG graph output.
20205 (print_actions): Unused code is now used. It notifies the final state
20206 and no action states in the VCG graph. It also give the reduce actions.
20207 The `shift and goto' edges are red and the `go to state' edges are
20208 blue.
20209 Get the current node name and node_obstack by argument.
20210 (node_obstack): New variable.
20211 (print_state): Manage node_obstack.
20212 (print_core): Use node_obstack given by argument.
20213 A node is not only computed here but in print_actions also.
20214 (print_graph): CPP out useless code instead of commenting it.
20215
202162001-08-07 Pascal Bart <pascal.bart@epita.fr>
20217
20218 * tests/atconfig.in (CPPFLAGS): Fix.
20219
202202001-08-07 Akim Demaille <akim@epita.fr>
20221
20222 * src/print_graph.c (quote): New.
20223 (print_core): Use it.
20224
202252001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
20226
20227 * src/vcg.c (complain.h): Include it.
20228 Unepitaize `return' invocations.
20229 [NDEBUG] (main): Remove.
20230 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
20231 * src/files.c (open_files): Initialize graph_obstack.
20232 * src/print_graph.c (print_actions): CPP out useless code.
20233 (print_core): Don't output the last `\n' in labels.
20234 Use `quote'.
20235 * src/files.c (output_files): Output the VCG file.
20236 * src/main.c (main): Invoke print_graph ();
20237
202382001-08-06 Marc Autret <autret_m@epita.fr>
20239
20240 Automaton VCG graph output.
20241 Using option ``-g'' or long option ``--graph'', you can generate
20242 a gram_filename.vcg file containing a VCG description of the LALR (1)
20243 automaton of your grammar.
20244
20245 * src/main.c: Call to print_graph() function.
20246 * src/getargs.h: Update.
20247 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
20248 (graph_flag): New flag.
20249 (longopts): Update.
20250 (getargs): Add case `g'.
20251 * src/files.c (graph_obstack): New obstack struct.
20252 (open_files): Initialize new obstack.
20253 (output_files): Saves graph_obstack if required.
20254 * src/files.h (graph_obstack): New extern declaration.
20255 * src/Makefile.am: Add new source files.
20256
202572001-08-06 Marc Autret <autret_m@epita.fr>
20258
20259 * src/print_graph.c, src/print_graph.h (graph): New.
20260 * src/vcg.h: New file.
20261 * src/vcg.c: New file, VCG graph handling.
20262
202632001-08-06 Marc Autret <autret_m@epita.fr>
20264
20265 Add of %source_extension and %header_extension which specify
20266 the source or/and the header output file extension.
20267
20268 * src/files.c (compute_base_names): Remove initialisation of
20269 src_extension and header_extension.
20270 (compute_exts_from_gf): Update.
20271 (compute_exts_from_src): Update.
20272 (output_files): Update.
20273 * src/reader.c (parse_header_extension_decl): New.
20274 (parse_source_extension_decl): New.
20275 (read_declarations): New case statements for the new tokens.
20276 * src/lex.c (percent_table): Add entries for %source_extension
20277 and %header_extension.
20278 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
20279
202802001-08-06 Marc Autret <autret_m@epita.fr>
20281
20282 * configure.in: Bump to 1.28c.
20283 * doc/bison.texinfo: Texinfo thingies.
20284
202852001-08-04 Pascal Bart <pascal.bart@epita.fr>
20286
20287 * tests/atconfig.in (CPPFLAGS): Add.
20288 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
20289
202902001-08-03 Akim Demaille <akim@epita.fr>
20291
20292 Version 1.28b.
20293
202942001-08-03 Akim Demaille <akim@epita.fr>
20295
20296 * tests/Makefile.am (check-local): Ship testsuite.
20297 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
20298 Include `string.h'.
20299
203002001-08-03 Akim Demaille <akim@epita.fr>
20301
20302 * configure.in: Try using -Wformat when compiling.
20303
203042001-08-03 Akim Demaille <akim@epita.fr>
20305
20306 * configure.in: Bump to 1.28b.
20307
203082001-08-03 Akim Demaille <akim@epita.fr>
20309
20310 * src/complain.c: Adjust strerror_r portability issues.
20311
203122001-08-03 Akim Demaille <akim@epita.fr>
20313
20314 Version 1.28a.
20315
203162001-08-03 Akim Demaille <akim@epita.fr>
20317
20318 * src/getargs.c, src/getarg.h (skeleton)): Constify.
20319 * src/lex.c (literalchar): Avoid name clashes on `buf'.
20320 * src/getargs.c: Include complain.h.
20321 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
20322 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
20323
203242001-08-03 Akim Demaille <akim@epita.fr>
20325
20326 * src/reader.c (readgram): Display hidden chars in error messages.
20327
203282001-08-03 Akim Demaille <akim@epita.fr>
20329
20330 Update to gettext 0.10.39.
20331
203322001-08-03 Akim Demaille <akim@epita.fr>
20333
20334 * lib/strspn.c: New.
20335
203362001-08-01 Marc Autret <autret_m@epita.fr>
20337
20338 * doc/bison.texinfo: Update.
20339 * doc/bison.1 (mandoc): Update.
20340 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
20341 * src/files.c: Support output files extensions computing.
20342 (src_extension): New static variable.
20343 (header_extension): New static variable.
20344 (tr): New function.
20345 (get_extension_index): New function, gets the index of an extension
20346 filename in a string.
20347 (compute_exts_from_gf): New function, computes extensions from the
20348 grammar file extension.
20349 (compute_exts_from_src): New functions, computes extensions from the
20350 C source file extension, file given by ``-o'' option.
20351 (compute_base_names): Update.
20352 (output_files): Update.
20353
203542001-08-01 Robert Anisko <anisko_r@epita.fr>
20355
20356 * doc/bison.texi: Document @$.
20357 (Locations): New section.
20358
203592001-07-18 Akim Demaille <akim@epita.fr>
20360
20361 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
20362 * config/prev-version.txt, config/move-if-change: New.
20363 * Makefile.am: Adjust.
20364
203652001-07-08 Pascal Bart <pascal.bart@epita.fr>
20366
20367 * src/bison.simple (yyparse): Suppress warning `comparaison
20368 between signed and unsigned'.
20369
203702001-07-05 Pascal Bart <pascal.bart@epita.fr>
20371
20372 * src/getargs.h (raw_flag): Remove.
20373 * src/getargs.c: Die on `-r'/`--raw'.
20374 * src/lex.c (parse_percent_token): Die on `%raw'.
20375 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
20376 * tests/calc.at: Suppress test with option `--raw'.
20377
203782001-07-14 Akim Demaille <akim@epita.fr>
20379
20380 * config/: New.
20381 * configure.in: Require Autoconf 2.50.
20382 Update to gettext 0.10.38.
20383
203842001-03-16 Akim Demaille <akim@epita.fr>
20385
20386 * doc/bison.texinfo: ANSIfy the examples.
20387
203882001-03-16 Akim Demaille <akim@epita.fr>
20389
20390 * getargs.c (skeleton): New variable.
20391 (longopts): --skeleton is a new option.
20392 (shortopts, getargs): -S is a new option.
20393 * getargs.h: Declare skeleton.
20394 * output.c (output_parser): Use it.
20395
203962001-03-16 Akim Demaille <akim@epita.fr>
20397
20398 * m4/strerror_r.m4: New.
20399 * m4/error.m4: Run AC_FUNC_STRERROR_R.
20400 * lib/error.h, lib/error.c: Update.
20401
204022001-03-16 Akim Demaille <akim@epita.fr>
20403
20404 * src/getargs.c (longopts): Clean up.
20405
204062001-02-21 Akim Demaille <akim@epita.fr>
20407
20408 * src/reader.c (gensym): `gensym_count' is your own.
20409 Use a static buf to create the symbol name, as token_buffer is no
20410 longer a buffer.
20411
204122001-02-08 Akim Demaille <akim@epita.fr>
20413
20414 * src/conflicts.c (conflict_report): Be sure not to append to res
20415 between two calls, which could happen if both first sprintf were
20416 skipped, but not the first cp += strlen.
20417
204182001-02-08 Akim Demaille <akim@epita.fr>
20419
20420 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
20421 New, from fileutils 4.0.37.
20422 * configure.in: Require Autoconf 2.49c. I took some time before
20423 making this decision. This is the only way out for portability
20424 issues in Bison, it would mean way too much duplicate effort to
20425 import in Bison features implemented in 2.49c since 2.13.
20426 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
20427
204282001-02-02 Akim Demaille <akim@epita.fr>
20429
20430 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
20431 * lib/xalloc.h, lib/xmalloc.c: Update.
20432
204332001-01-19 Akim Demaille <akim@epita.fr>
20434
20435 Get rid of the ad hoc handling of token_buffer in the scanner: use
20436 the obstacks.
20437
20438 * src/lex.c (token_obstack): New.
20439 (init_lex): Initialize it. No longer call...
20440 (grow_token_buffer): this. Remove it.
20441 Adjust all the places which used it to use the obstack.
20442
204432001-01-19 Akim Demaille <akim@epita.fr>
20444
20445 * src/lex.h: Rename all the tokens:
20446 s/\bENDFILE\b/tok_eof/g;
20447 s/\bIDENTIFIER\b/tok_identifier/g;
20448 etc.
20449 Let them be enums, not #define, to ease debugging.
20450 Adjust all the code.
20451
204522001-01-18 Akim Demaille <akim@epita.fr>
20453
20454 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
20455 * src/lex.c (maxtoken, grow_token_buffer): Static.
20456
204572001-01-18 Akim Demaille <akim@epita.fr>
20458
20459 Since we now use obstacks, more % directives can be enabled.
20460
20461 * src/lex.c (percent_table): Also accept `%yacc',
20462 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
20463 `%debug'.
20464 Handle the actions for `%semantic_parser' and `%pure_parser' here,
20465 instead of returning a token.
20466 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
20467 * src/reader.c (read_declarations): Adjust.
20468 * src/files.c (open_files): Don't call `compute_base_names', don't
20469 compute `attrsfile' since they depend upon data which might be
20470 *in* the input file now.
20471 (output_files): Do it here.
20472 * src/output.c (output_headers): Document the fact that this patch
20473 introduces a guaranteed SEGV for semantic parsers.
20474 * doc/bison.texinfo: Document them.
20475 * tests/suite.at: Exercise these %options.
20476
204772000-12-20 Akim Demaille <akim@epita.fr>
20478
20479 Also handle the output file (--verbose) with obstacks.
20480
20481 * files.c (foutput): Remove.
20482 (output_obstack): New.
20483 Adjust all dependencies.
20484 * src/conflicts.c: Return a string.
20485 * src/system.h (obstack_grow_string): Rename as...
20486 (obstack_sgrow): this. Be ready to work with non literals.
20487 (obstack_fgrow4): New.
20488
204892000-12-20 Akim Demaille <akim@epita.fr>
20490
20491 * src/files.c (open_files): Fix the computation of short_base_name
20492 in the case of `-o foo.tab.c'.
20493
204942000-12-20 Akim Demaille <akim@epita.fr>
20495
20496 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
20497 (copy_dollar): Now that everything uses obstacks, get rid of the
20498 FILE * parameters.
20499
205002000-12-20 Akim Demaille <akim@epita.fr>
20501
20502 * src/files.c (open_files): Actually the `.output' file is based
20503 on the short_base_name, not base_name.
20504 * tests/suite.at (Checking output file names): Adjust.
20505
205062000-12-20 Akim Demaille <akim@epita.fr>
20507
20508 * src/bison.s1: Remove, we now use directly...
20509 * src/bison.simple: this.
20510 * src/Makefile.am: Use pkgdata instead of data.
20511
205122000-12-20 Akim Demaille <akim@epita.fr>
20513
20514 * src/files.c (guard_obstack): New.
20515 (open_files): Initialize it.
20516 (output_files): Dump it...
20517 * src/files.h: Export it.
20518 * src/reader.c (copy_guard): Use it.
20519
205202000-12-19 Akim Demaille <akim@epita.fr>
20521
20522 * src/files.c (outfile, defsfile, actfile): Removed as global
20523 vars.
20524 (open_files): Don't compute them.
20525 (output_files): Adjust.
20526 (base_name, short_base_name): Be global.
20527 Adjust dependencies.
20528
205292000-12-19 Akim Demaille <akim@epita.fr>
20530
20531 * src/files.c (strsuffix): New.
20532 (stringappend): Be just like strcat but allocate.
20533 (base_names): Eve out from open_files.
20534 Try to simplify the rather hairy computation of base_name and
20535 short_base_name.
20536 (open_files): Use it.
20537 * tests/suite.at (Checking output file names): New test.
20538
205392000-12-19 Akim Demaille <akim@epita.fr>
20540
20541 * src/system.h (obstack_grow_literal_string): Rename as...
20542 (obstack_grow_string): this.
20543 * src/output.c (output_parser): Recognize `%% actions' instead of
20544 `$'.
20545 * src/bison.s1: s/$/%% actions/.
20546 * src/bison.hairy: Likewise.
20547
205482000-12-19 Akim Demaille <akim@epita.fr>
20549
20550 * src/output.c (output_parser): Compute the `#line' lines when
20551 there are.
20552 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
20553 Suggested by Hans Aberg.
20554
205552000-12-19 Akim Demaille <akim@epita.fr>
20556
20557 Let the handling of the skeleton files be local to the procedures
20558 that use it.
20559
20560 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
20561 longer static.
20562 (fparser, open_extra_files): Remove.
20563 (open_files, output_files): Don't take care of fparser.
20564 * src/files.h: Adjust.
20565 * src/output.c (output_parser): Open and close the file to the
20566 skeleton.
20567 * src/reader.c (read_declarations): When %semantic_parser, open
20568 fguard.
20569
205702000-12-19 Akim Demaille <akim@epita.fr>
20571
20572 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
20573 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
20574
205752000-12-19 Akim Demaille <akim@epita.fr>
20576
20577 * src/files.c (open_files): Yipee! We no longer need all the code
20578 looking for `/tmp' since we have no tmp file.
20579
205802000-12-19 Akim Demaille <akim@epita.fr>
20581
20582 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
20583 New macros.
20584 * src/files.c (open_files): Less dependency on MSDOS etc.
20585
205862000-12-14 Akim Demaille <akim@epita.fr>
20587
20588 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
20589 Provide a default definition.
20590 Use it when executing the default @ action.
20591 * src/reader.c (reader_output_yylsp): No longer include
20592 `timestamp' and `text' in the default YYLTYPE.
20593
205942000-12-12 Akim Demaille <akim@epita.fr>
20595
20596 * src/reader.c (copy_definition, parse_union_decl, copy_action)
20597 (copy_guard): Quote the file names.
20598 Reported by Laurent Mascherpa.
20599
206002000-12-12 Akim Demaille <akim@epita.fr>
20601
20602 * src/output.c (output_headers, output_program, output): Be sure
20603 to escape special characters when outputting filenames.
20604 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
20605 (output_headers): Don't depend on them, Use ACTSTR.
20606
206072000-11-17 Akim Demaille <akim@epita.fr>
20608
20609 * lib/obstack.h: Formatting changes.
20610 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
20611 prevents type checking.
20612 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
20613 cast the value to (void *): assigning a `foo *' to a `void *'
20614 variable is valid.
20615 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
20616 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
20617 append characters.
20618
206192000-11-17 Akim Demaille <akim@epita.fr>
20620
20621 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
20622 as...
20623 (suite.m4, regression.m4, calc.m4): these.
20624 * tests/atgeneral.m4: Update from CVS Autoconf.
20625
206262000-11-17 Akim Demaille <akim@epita.fr>
20627
20628 * tests/regression.m4 (%union and --defines): New test,
20629 demonstrating a current bug in the obstack implementation.
20630
206312000-11-17 Akim Demaille <akim@epita.fr>
20632
20633 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
20634 macros.
20635 Use them to declare the variables which are global or local to
20636 `yyparse'.
20637
206382000-11-17 Akim Demaille <akim@epita.fr>
20639
20640 * acconfig.h: Remove, no longer used.
20641
206422000-11-07 Akim Demaille <akim@epita.fr>
20643
20644 * src: s/Copyright (C)/Copyright/g.
20645
206462000-11-07 Akim Demaille <akim@epita.fr>
20647
20648 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
20649 defining.
20650 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
20651
206522000-11-07 Akim Demaille <akim@epita.fr>
20653
20654 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
20655 Merge in a single CPP if/else.
20656
206572000-11-07 Akim Demaille <akim@epita.fr>
20658
20659 * src/output.c (output): Remove useless variables.
20660 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
20661 argument `data' for consistency with the prototypes.
20662 Qualify it `const'.
20663 (obstack_copy, obstack_copy0): Rename the second argument as
20664 `address' for consistency. Qualify it `const'.
20665 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
20666 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
20667 `const' their input argument (`data' or `address').
20668 Adjust the corresponding macros to include `const' in casts.
20669
206702000-11-03 Akim Demaille <akim@epita.fr>
20671
20672 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
20673 s/PFILE1/BISON_HAIRY/.
20674 Adjust dependencies.
20675
206762000-11-03 Akim Demaille <akim@epita.fr>
20677
20678 For some reason, this was not applied.
20679
20680 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20681 `unlink': it's no longer used.
20682
206832000-11-03 Akim Demaille <akim@epita.fr>
20684
20685 * src/files.c (skeleton_find): New function, eved out of...
20686 (open_files, open_extra_files): here.
20687
206882000-11-03 Akim Demaille <akim@epita.fr>
20689
20690 Don't use `atexit'.
20691
20692 * src/files.c (obstack_save): New function.
20693 (done): Rename as...
20694 (output_files): this.
20695 Use `obstack_save'.
20696 * src/main.c (main): Don't use `atexit' to register `done', since
20697 it no longer has to remove tmp files, just call `output_files'
20698 when there are no errors.
20699
207002000-11-02 Akim Demaille <akim@epita.fr>
20701
20702 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
20703 `unlink': it's no longer used.
20704 * src/files.h: Formatting changes.
20705
207062000-11-02 Akim Demaille <akim@epita.fr>
20707
20708 Remove the last uses of mktemp and unlink/delete.
20709
20710 * src/files.c (fdefines, ftable): Removed.
20711 (defines_ostack, table_obstack): New.
20712 Adjust dependencies of the former into uses of the latter.
20713 * src/output.c (output_short_or_char_table, output_short_table):
20714 Convert to using obstacks.
20715 * src/reader.c (copy_comment2): Accept one FILE * and two
20716 obstacks.
20717 (output_token_defines, reader_output_yylsp): Use obstacks.
20718 * src/system.h (obstack_fgrow3): New.
20719 * po/POTFILES.in: Adjust.
20720
207212000-11-01 Akim Demaille <akim@epita.fr>
20722
20723 Change each use of `fattrs' into a use of `attrs_obstack'.
20724
20725 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
20726 * src/files.c (fattrs): Remove.
20727 (attrs_obstack): New.
20728 Adjust all dependencies.
20729 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
20730
207312000-11-01 Akim Demaille <akim@epita.fr>
20732
20733 Introduce obstacks.
20734 Change each use of `faction' into a use of `action_obstack'.
20735
20736 * lib/obstack.h, lib/obstack.c: New files.
20737 * src/files.c (faction): Remove.
20738 (action_obstack): New.
20739 Adjust all dependencies.
20740
207412000-10-20 Akim Demaille <akim@epita.fr>
20742
20743 * lib/quote.h (PARAMS): New macro. Use it.
20744
207452000-10-16 Akim Demaille <akim@epita.fr>
20746
20747 * src/output.c (output_short_or_char_table): New function.
20748 (output_short_table, output_token_translations): Use it.
20749 (goto_actions): Use output_short_table.
20750
207512000-10-16 Akim Demaille <akim@epita.fr>
20752
20753 * src/symtab.c (bucket_new): New function.
20754 (getsym): Use it.
20755
20756 * src/output.c (output_short_table): New argument to display the
20757 comment associated with the table.
20758 Adjust dependencies.
20759 (output_gram): Use it.
20760 (output_rule_data): Nicer output layout for YYTNAME.
20761
207622000-10-16 Akim Demaille <akim@epita.fr>
20763
20764 * src/lex.c (read_typename): New function.
20765 (lex): Use it.
20766 * src/reader.c (copy_dollar): Likewise.
20767
207682000-10-16 Akim Demaille <akim@epita.fr>
20769
20770 * src/reader.c (copy_comment2): Expect the input stream to be on
20771 the `/' which is suspected to open a comment, instead of being
20772 called after `//' or `/*' was read.
20773 (copy_comment, copy_definition, parse_union_decl, copy_action)
20774 (copy_guard): Adjust.
20775
207762000-10-16 Akim Demaille <akim@epita.fr>
20777
20778 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
20779 `read_signed_integer'.
20780
207812000-10-16 Akim Demaille <akim@epita.fr>
20782
20783 * src/reader.c (copy_dollar): New function.
20784 (copy_guard, copy_action): Use it.
20785
207862000-10-16 Akim Demaille <akim@epita.fr>
20787
20788 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
20789 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
20790 New files, from Fileutils 4.0.27.
20791 * src/main.c (printable_version): Remove.
20792 * src/lex.c, src/reader.c: Use `quote'.
20793
207942000-10-04 Akim Demaille <akim@epita.fr>
20795
20796 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
20797
207982000-10-04 Akim Demaille <akim@epita.fr>
20799
20800 * doc/bison.texinfo: Various typos spotted by Neil Booth.
20801
208022000-10-04 Akim Demaille <akim@epita.fr>
20803
20804 When a literal string is used to define two different tokens,
20805 `bison -v' segfaults.
20806 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
20807
20808 * tests/regression.m4: New file.
20809 Include the core of the sample provided by Piotr Gackiewicz.
20810 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
20811 properly.
20812
208132000-10-04 Akim Demaille <akim@epita.fr>
20814
20815 * src/reader.c (parse_expect_decl): Keep `count' within the size
20816 of `buffer'.
20817 From Neil Booth.
20818
208192000-10-02 Paul Eggert <eggert@twinsun.com>
20820
20821 * bison.s1 (yyparse): Assign the default value
20822 unconditionally, to avoid a GCC warning and make the parser a
20823 tad smaller.
20824
208252000-10-02 Akim Demaille <akim@epita.fr>
20826
20827 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
20828 options.
20829
208302000-10-02 Akim Demaille <akim@epita.fr>
20831
20832 * src/derives.c, src/print.c, src/reduce.c: To ease the
20833 translation, move some `\n' out of the translated strings.
20834
208352000-10-02 Akim Demaille <akim@epita.fr>
20836
20837 The location tracking mechanism is precious for parse error
20838 messages. Nevertheless, it is enabled only when `@n' is used in
20839 the grammar, which is a different issue (you can use it in error
20840 message, but not in the grammar per se). Therefore, there should
20841 be another means to enable it.
20842
20843 * src/getargs.c (getargs): Support `--locations'.
20844 (usage): Report it.
20845 * src/getargs.h (locationsflag): Export it.
20846 * src/lex.c (percent_table): Support `%locations'.
20847 * src/reader.c (yylsp_needed): Remove this variable, now replaced
20848 with `locationsflag'.
20849 * doc/bison.texinfo: Document `--locations' and `%locations'.
20850 Sort the options.
20851 * tests/calc.m4: Test it.
20852
20853 For regularity of the names, replace each
20854 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
20855 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
20856 In addition replace each `flag' with `_flag'.
20857
208582000-10-02 Akim Demaille <akim@epita.fr>
20859
20860 Also test parse error messages, including with YYERROR_VERBOSE.
20861
20862 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
20863 associative).
20864 Use it to check the computations.
20865 Use it to check `nonassoc' is honored.
20866 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
20867 `--yyerror-verbose'.
20868 (_AT_CHECK_CALC): Adjust to this option.
20869 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
20870
208712000-10-02 Akim Demaille <akim@epita.fr>
20872
20873 Test also `--verbose', `--defines' and `--name-prefix'. Testing
20874 the latter demonstrates a flaw in the handling of non debugging
20875 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
20876 was used in order to simplify:
20877
20878 #if YYDEBUG
20879 if (yydebug)
20880 {
20881 ...
20882 }
20883 #endif
20884
20885 into
20886
20887 if (yydebug)
20888 {
20889 ...
20890 }
20891
20892 unfortunately this leads to a CPP conflict when
20893 `--name-prefix=foo' is used since it produces `#define yydebug
20894 foodebug'.
20895
20896 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
20897 (YYDPRINTF): New macro.
20898 Spread its use.
20899 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
20900 the bison options.
20901 Also test `--verbose', `--defines' and `--name-prefix'.
20902
209032000-10-02 Akim Demaille <akim@epita.fr>
20904
20905 Improve the readability of the produced parsers.
20906
20907 * src/bison.s1: Formatting changes.
20908 Improve the comment related to the `$' mark.
20909 (yydefault): Don't fall through to `yyresume': `goto' there.
20910 * src/output.c (output_parser): When the `$' is met, skip the end
20911 of its line.
20912 New variable, `number_of_dollar_signs', to check there's exactly
20913 one `$' in the parser skeleton.
20914
209152000-10-02 Akim Demaille <akim@epita.fr>
20916
20917 * lib/xstrdup.c: New file, from the fileutils.
20918 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
20919 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
20920 instead of strlen + xmalloc + strcpy.
20921 * src/symtab.c (copys): Remove, use xstrdup instead.
20922
209232000-10-02 Akim Demaille <akim@epita.fr>
20924
20925 * src/gram.h (associativity): New enum type which replaces the
20926 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
20927 `right_assoc', `left_assoc' and `non_assoc'.
20928 Adjust all dependencies.
20929 * src/reader.c: Formatting changes.
20930 (LTYPESTR): Don't define it, use it as a literal in
20931 `reader_output_yylsp'.
20932 * src/symtab.h (symbol_class): New enum type which replaces the
20933 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
20934 `sunknown', `stoken and `snterm'.
20935
209362000-10-02 Akim Demaille <akim@epita.fr>
20937
20938 * src/getargs.c (fixed_outfiles): Rename as...
20939 (yaccflag): for consistency and accuracy.
20940 Adjust dependencies.
20941
209422000-10-02 Akim Demaille <akim@epita.fr>
20943
20944 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
20945 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
20946 difficult and introduced a lot of core dump. It turns out that
20947 Bison used an implementation of `xmalloc' based on `calloc', and
20948 at various places it does depend upon the initialization to 0. I
20949 have not tried to isolate the pertinent places, and all the former
20950 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
20951 someone should address this issue.
20952
20953 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
20954 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
20955 files.
20956 Adjust dependencies.
20957 * src/warshall.h: New file.
20958 Propagate.
20959
209602000-10-02 Akim Demaille <akim@epita.fr>
20961
20962 Various anti-`extern in *.c' changes.
20963
20964 * src/system.h: Include `assert.h'.
20965
209662000-10-02 Akim Demaille <akim@epita.fr>
20967
20968 * src/state.h (nstates, final_state, first_state, first_shift)
20969 (first_reduction): Move their exportation from here...
20970 * src/LR0.h: to here.
20971 Adjust dependencies.
20972 * src/getargs.c (statisticsflag): New variable.
20973 Add support for `--statistics'.
20974 Adjust dependencies.
20975
20976 Remove a lot of now useless `extern' statements in most files.
20977
209782000-10-02 Akim Demaille <akim@epita.fr>
20979
20980 * src/LR0.h: New file.
20981 Propagate its use.
20982
209832000-10-02 Akim Demaille <akim@epita.fr>
20984
20985 * src/print.h: New file.
20986 Propagate its use.
20987 * src/print.c: Formatting and ordering changes.
20988 (verbose, terse): Replace with...
20989 (print_results): this new function.
20990 Adjust dependencies.
20991
209922000-10-02 Akim Demaille <akim@epita.fr>
20993
20994 * src/conflicts.c (conflict_report): New function.
20995 (conflict_log, verbose_conflict_log): Replace with...
20996 (print_conflicts): this function.
20997 Adjust dependencies.
20998 * src/conflicts.h: New file.
20999 Propagate its inclusion.
21000
210012000-10-02 Akim Demaille <akim@epita.fr>
21002
21003 * src/nullable.h: New file.
21004 Propagate its inclusion.
21005 * src/nullable.c: Formatting changes.
21006
210072000-10-02 Akim Demaille <akim@epita.fr>
21008
21009 * src/reduce.h: New file.
21010 Propagate its inclusion.
21011 * src/reduce.c: Topological sort and other formatting changes.
21012 (bool, TRUE, FALSE): Move their definition to...
21013 * src/system.h: here.
21014
210152000-10-02 Akim Demaille <akim@epita.fr>
21016
21017 * src/files.c: Formatting changes.
21018 (tryopen, tryclose, openfiles): Rename as...
21019 (xfopen, xfclose, open_files): this.
21020 (stringappend): static.
21021 * src/files.h: Complete the list of exported symbols.
21022 Propagate its use.
21023
210242000-10-02 Akim Demaille <akim@epita.fr>
21025
21026 * src/reader.h: New file.
21027 Propagate its use instead of tedious list of `extern' and
21028 prototypes.
21029 * src/reader.c: Formatting changes, topological sort,
21030 s/register//.
21031
210322000-10-02 Akim Demaille <akim@epita.fr>
21033
21034 * src/lex.h: Prototype `lex.c' exported functions.
21035 * src/reader.c: Adjust.
21036 * src/lex.c: Formatting changes.
21037 (safegetc): Rename as...
21038 (xgetc): this.
21039
210402000-10-02 Akim Demaille <akim@epita.fr>
21041
21042 * src/lalr.h: New file.
21043 Propagate its inclusion instead of prototypes and `extern'.
21044 * src/lalr.c: Formatting changes, topological sorting etc.
21045
210462000-10-02 Akim Demaille <akim@epita.fr>
21047
21048 * src/output.c (token_actions): Introduce a temporary array,
21049 YYDEFACT, that makes it possible for this function to use
21050 output_short_table.
21051
210522000-10-02 Akim Demaille <akim@epita.fr>
21053
21054 `user_toknums' is output as a `short[]' in `output.c', while it is
21055 defined as a `int[]' in `reader.c'. For consistency with the
21056 other output tables, `user_toknums' is now defined as a table of
21057 shorts.
21058
21059 * src/reader.c (user_toknums): Be a short table instead of an int
21060 table.
21061 Adjust dependencies.
21062
21063 Factor the short table outputs.
21064
21065 * src/output.c (output_short_table): New function.
21066 * src/output.c (output_gram, output_stos, output_rule_data)
21067 (output_base, output_table, output_check): Use it.
21068
210692000-10-02 Akim Demaille <akim@epita.fr>
21070
21071 * src/output.c (output): Topological sort of the functions, in
21072 order to get rid of the `static' prototypes.
21073 No longer use `register'.
21074 * src/output.h: New file.
21075 Propagate its inclusion in files explicitly prototyping functions
21076 from output.c.
21077
210782000-09-21 Akim Demaille <akim@epita.fr>
21079
21080 * src/atgeneral.m4: Update from Autoconf.
21081
210822000-09-21 Akim Demaille <akim@epita.fr>
21083
21084 * src/closure.h: New file.
21085 * src/closure.c: Formatting changes, topological sort over the
21086 functions, use of closure.h.
21087 (initialize_closure, finalize_closure): Rename as...
21088 (new_closure, free_closure): these. Adjust dependencies.
21089 * src/LR0.c: Formatting changes, topological sort, use of
21090 cloture.h.
21091 (initialize_states): Rename as...
21092 (new_states): this.
21093 * src/Makefile.am (noinst_HEADERS): Adjust.
21094
210952000-09-20 Akim Demaille <akim@epita.fr>
21096
21097 * src/acconfig.h: Don't protect config.h against multiple
21098 inclusion.
21099 Don't define PARAMS.
21100 * src/system.h: Define PARAMS.
21101 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
21102 purpose of config.h. system.h must not try to fix wrong
21103 definitions in config.h.
21104
211052000-09-20 Akim Demaille <akim@epita.fr>
21106
21107 * src/derives.h: New file.
21108 * src/main.c, src/derives.h: Use it.
21109 Formatting changes.
21110 * src/Makefile.am (noinst_HEADERS): Adjust.
21111
211122000-09-20 Akim Demaille <akim@epita.fr>
21113
21114 * tests/atgeneral.m4: Update from Autoconf.
21115 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
21116 (AT_CHECK_CALC): New macros.
21117 Use these macros to test bison with options `', `--raw',
21118 `--debug', `--yacc', `--yacc --debug'.
21119
211202000-09-19 Akim Demaille <akim@epita.fr>
21121
21122 * src/output.c: Formatting changes.
21123 * src/machine.h: Remove, leaving its contents in...
21124 * src/system.h: here.
21125 Include stdio.h.
21126 Adjust all dependencies on stdio.h and machine.h.
21127 * src/getargs.h: New file.
21128 Let all `extern' declarations about getargs.c be replaced with
21129 inclusion of `getargs.h'.
21130 * src/Makefile.am (noinst_HEADERS): Adjust.
21131
21132 * tests/calc.m4 (yyin): Be initialized in main, not on the global
21133 scope.
21134 (yyerror): Returns void, not int.
21135 * doc/bison.texinfo: Formatting changes.
21136
211372000-09-19 Akim Demaille <akim@epita.fr>
21138
21139 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
21140 portable.
21141
211422000-09-18 Akim Demaille <akim@epita.fr>
21143
21144 * configure.in: Append WARNING_CFLAGS to CFLAGS.
21145 * src/Makefile.am (INCLUDES): Don't.
21146 Be ready to fetch headers in lib/.
21147
211482000-09-18 Akim Demaille <akim@epita.fr>
21149
21150 * doc/bison.texinfo: Update the copyright.
21151 ANSIfy and GNUify the examples.
21152 Remove the old menu.
21153
211542000-09-18 Akim Demaille <akim@epita.fr>
21155
21156 First set of tests: use the `calc' example from the documentation.
21157
21158 * src/bison.s1 (yyparse): Condition the code using `yytname' which
21159 is defined only when YYDEBUG is.
21160 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
21161 * src/files.c (tryopen, tryclose): Formatting changes.
21162 Move to the top and be static.
21163 * src/reader.c (read_signed_integer): Likewise.
21164 * tests/calc.m4: New file.
21165 * Makefile.am, suite.m4: Adjust.
21166 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
21167
211682000-09-18 Akim Demaille <akim@epita.fr>
21169
21170 Add support for an Autotest test suite for Bison.
21171
21172 * m4/m4.m4, m4/atconfig.m4: New files.
21173 * m4/Makefile.am (EXTRA_DIST): Adjust.
21174 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
21175 files.
21176 * src/getargs.c: Display a more standard --version message.
21177 * src/reader.c (reader): Formatting changes.
21178 No longer depend upon VERSION_STRING.
21179 * configure.in: No longer use `dnl'.
21180 Set up the test suite and the new directory `tests/.
21181 (VERSION_STRING): Remove.
21182
211832000-04-14 Akim Demaille <akim@epita.fr>
21184
21185 * src/reader.c (copy_comment2): New function, same as former
21186 `copy_comment', but outputs into two FILE *.
21187 (copy_comment): Use it.
21188 (parse_union_decl): Use it.
21189 (get_type, parse_start_decl): Use the same `invalid' message.
21190 (parse_start_decl, parse_union_decl): Use the same `multiple'
21191 message.
21192 (parse_union_decl, copy_guard, copy_action): Use the same
21193 `unmatched' message.
21194 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
21195
211962000-03-31 Akim Demaille <akim@epita.fr>
21197
21198 * src/files.c (tryopen, tryclose): Move to the top.
21199 Be static.
21200
212012000-03-31 Akim Demaille <akim@epita.fr>
21202
21203 * src/main.c (main): Don't call `done', exit does it.
21204
212052000-03-31 Akim Demaille <akim@epita.fr>
21206
21207 * allocate.c: s/return (foo)/return foo/.
21208 * lalr.c: Likewise.
21209 * LR0.c: Likewise.
21210 * output.c: Likewise.
21211 * reader.c: Likewise.
21212 * symtab.c: Likewise.
21213 * vmsgetargs.c: Likewise.
21214
212152000-03-31 Akim Demaille <akim@epita.fr>
21216
21217 Clean up the error reporting functions.
21218
21219 * src/report.c: New file.
21220 * src/report.h: Likewise.
21221 * src/Makefile.am: Adjust.
21222 * m4/error.m4: New file.
21223 * m4/Makefile.am: Adjust.
21224 * configure.in (jm_PREREQ_ERROR): Call it.
21225 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
21226 Remove.
21227 (fatal, fatals): Remove. All callers use complain.c::fatal.
21228 (warn, warni, warns, warnss, warnss): Remove. All callers use
21229 complain.c::complain.
21230 (toomany): Remove, use fatal instead.
21231 * src/files.c (done): No argument, use complain_message_count.
21232 * src/main.c (main): Register `done' to `atexit'.
21233
21234 * src/getargs.c (usage): More `fputs', less `fprintf'.
21235
212362000-03-28 Akim Demaille <akim@epita.fr>
21237
21238 * lib/: New directory.
21239 * Makefile.am (SUBDIRS): Adjust.
21240 * configure.in: Adjust.
21241 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
21242 useless.
21243 * src/alloca.c: Moved to lib/.
21244 * src/getopt.c: Likewise.
21245 * src/getopt1.c: Likewise.
21246 * src/getopt.h: Likewise.
21247 * src/ansi2knr.c: Likewise.
21248 * src/ansi2knr.1: Likewise.
21249 * src/Makefile.am: Adjust.
21250 * lib/Makefile.am: New file.
21251
212522000-03-28 Akim Demaille <akim@epita.fr>
21253
21254 * src/getargs.c (usage): Refresh the help message.
21255
212562000-03-17 Akim Demaille <akim@epita.fr>
21257
21258 * src/getopt1.c: Updated from textutils 2.0e
21259 * src/getopt.c: Likewise.
21260 * src/getopt.h: Likewise.
21261
212622000-03-17 Akim Demaille <akim@epita.fr>
21263
21264 * src/Makefile.am (bison.simple): Fix the awk program: quote only
21265 the file name, not the whole `#line LINE FILE'.
21266
212672000-03-17 Akim Demaille <akim@epita.fr>
21268
21269 On syntax errors, report the token on which we choked.
21270
21271 * src/bison.s1 (yyparse): In the label yyerrlab, when
21272 YYERROR_VERBOSE, add yychar in msg.
21273
212742000-03-17 Akim Demaille <akim@epita.fr>
21275
21276 * src/reader.c (copy_at): New function.
21277 (copy_guard): Use it.
21278 (copy_action): Use it.
21279
212802000-03-17 Akim Demaille <akim@epita.fr>
21281
21282 Be kind to translators, save some useless translations.
21283
21284 * src/main.c (banner): New function.
21285 (fatal_banner): Use it.
21286 (warn_banner): Use it.
21287
212882000-03-17 Akim Demaille <akim@epita.fr>
21289
21290 * src/reader.c (copy_definition): Use copy_string and
21291 copy_comment. Removed now unused `match', `ended',
21292 `cplus_comment'.
21293 (copy_comment, copy_string): Moved, to be visible from
21294 copy_definition.
21295
212962000-03-17 Akim Demaille <akim@epita.fr>
21297
21298 * src/reader.c (copy_string): Declare `static inline'. No
21299 problems with inline, since it is checked by configure.
21300 (copy_comment): Likewise.
21301
213022000-03-17 Akim Demaille <akim@epita.fr>
21303
21304 * src/reader.c (packsymbols): Formatting changes.
21305
213062000-03-17 Akim Demaille <akim@epita.fr>
21307
21308 * src/reader.c (copy_comment): New function, factored out from:
21309 (copy_action): Use it. Removed now unused `match', `ended',
21310 `cplus_comment'.
21311 (copy_guard): Likewise.
21312
213132000-03-17 Akim Demaille <akim@epita.fr>
21314
21315 * src/reader.c (copy_string): New function, factored out from:
21316 (copy_action): Use it.
21317 (copy_guard): Likewise.
21318
213192000-03-17 Akim Demaille <akim@epita.fr>
21320
21321 Change the handling of @s so that they behave exactly like $s.
21322 There is now a pseudo variable @$ (readble and writable), location
21323 of the lhs of the rule (by default ranging from the location of
21324 the first symbol of the rhs, to the location of the last symbol,
21325 or, if the rhs is empty, YYLLOC).
21326
21327 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
21328 yyval.
21329 (yyparse): When providing a default semantic action, provide a
21330 default location action.
21331 (after the $): No longer change `*YYLSP', just stack YYLOC the
21332 same way you stack YYVAL.
21333 * src/reader.c (read_declarations): Use warns.
21334 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
21335 (copy_action, case '@'): Likewise.
21336 Use a standard error message, to save useless work from
21337 translators.
21338
213392000-03-17 Akim Demaille <akim@epita.fr>
21340
21341 * src/bison.s1: Formatting and cosmetics changes.
21342 * src/reader.c: Likewise.
21343 Update the Copyright notice.
21344
213452000-03-17 Akim Demaille <akim@epita.fr>
21346
21347 * src/bison.s1 (#line): All set to `#line' only, since the
21348 Makefile now handles them.
21349
213502000-03-16 Akim Demaille <akim@epita.fr>
21351
21352 * src/output.c (output_rule_data): Output the documentation of
21353 some of the tables.
21354 (Copyright notice): Update.
21355 Formatting changes.
21356
213572000-03-16 Akim Demaille <akim@epita.fr>
21358
21359 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
21360 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
21361 One `#if YYDEBUG' remains, since it uses variables which are
21362 defined only if `YYDEBUG != 0'.
21363
213642000-03-16 Akim Demaille <akim@epita.fr>
21365
21366 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
21367 and related variables so that the similarities are highlighted.
21368
213692000-03-16 Akim Demaille <akim@epita.fr>
21370
21371 * src/bison.s1: Properly indent CPP directives.
21372
213732000-03-16 Akim Demaille <akim@epita.fr>
21374
21375 * src/bison.s1: Properly indent the `alloca' CPP section.
21376
213772000-03-16 Akim Demaille <akim@epita.fr>
21378
21379 Do not hard code values of directories in `configure.in'.
21380 Update the `configure' tool chain.
21381
21382 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
21383 src/makefile.am.
21384 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
21385 (AC_OUTPUT): Add m4/Makefile.
21386 Bump to bison 1.28a, 1.29 has never been released.
21387 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
21388 handled via src/Makefile.am.
21389 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
21390 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
21391 autoheader.
21392 * Makefile.am (SUBDIRS): Add m4.
21393 (ACLOCAL_AM_FLAGS): New variable.
21394 (AUTOMAKE_OPTIONS): Add check-news.
21395 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
21396 the proper line number and file name.
21397 (DEFS): Propagate the location of bison library files and of the
21398 locale files.
21399 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
21400 builddir.
21401 * acinclude.m4: Remove, replaced by the directory m4.
21402 * m4/Makefile.am (EXTRA_DIST): New variable.
21403 * m4/gettext.m4: New file, from the fileutils.
21404 * m4/lcmessage.m4: Likewise
21405 * m4/progtest.m4: Likewise.
21406 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
21407
214082000-03-10 Akim Demaille <akim@epita.fr>
21409
21410 * src/closure.c:
21411 Formatting changes of various comments.
21412 Respect the GNU coding standards at various places.
21413 Don't use `_()' when no translation is needed.
21414
214151999-12-13 Jesse Thilo <jthilo@gnu.org>
21416
21417 * src/files.c:
21418 OS/2 honors TMPDIR environment variable.
21419
214201999-12-13 Jesse Thilo <jthilo@gnu.org>
21421
21422 * doc/bison.texinfo: Tweaked spelling and grammar.
21423 Updated ISBN.
21424 Removed reference to price of printed copy.
21425 Mention BISON_SIMPLE and BISON_HAIRY.
21426
214271999-12-13 Jesse Thilo <jthilo@gnu.org>
21428
21429 * configure.in, NEWS:
21430 Bison 1.29 released.
21431
214321999-10-27 Jesse Thilo <jthilo@gnu.org>
21433
21434 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
21435 Added reference card.
21436
214371999-07-26 Jesse Thilo <jthilo@gnu.org>
21438
21439 * po/ru.po: Added Russian translation.
21440
214411999-07-26 Jesse Thilo <jthilo@gnu.org>
21442
21443 * configure.in: Added Russian translation.
21444
214451999-07-06 Jesse Thilo <jthilo@gnu.org>
21446
21447 * configure.in, NEWS, README:
21448 Released version 1.28.
21449
214501999-06-14 Jesse Thilo <jthilo@gnu.org>
21451
21452 * src/system.h:
21453 Squashed redefinition warning on some systems.
21454
21455 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
21456 Have configure build version string instead of relying on ANSI string
21457 concatentation.
21458
214591999-06-14 Jesse Thilo <jthilo@gnu.org>
21460
21461 * po/POTFILES.in: Got rid of version.c.
21462
214631999-06-14 Jesse Thilo <jthilo@gnu.org>
21464
21465 * acconfig.h, configure.in:
21466 Have configure build version string instead of relying on ANSI string
21467 concatentation.
21468
214691999-06-08 Jesse Thilo <jthilo@gnu.org>
21470
21471 * doc/bison.1:
21472 Dropped mention of `+' for long-named options.
21473
214741999-05-30 Jesse Thilo <jthilo@gnu.org>
21475
21476 * src/files.c: Added <unistd.h> for unlink().
21477
21478 * src/Makefile.am, src/system.h:
21479 I18n fixes.
21480
214811999-05-30 Jesse Thilo <jthilo@gnu.org>
21482
21483 * README: Added a FAQ list.
21484
21485 * configure.in, acconfig.h:
21486 I18n fixes.
21487
214881999-05-30 Jesse Thilo <jthilo@gnu.org>
21489
21490 * doc/FAQ, doc/Makefile.am:
21491 Added a FAQ list.
21492
214931999-05-19 Jesse Thilo <jthilo@gnu.org>
21494
21495 * src/alloc.h, src/symtab.h, src/version.c:
21496 Protected inclusion of "config.h" with HAVE_CONFIG_H.
21497
214981999-04-18 Jesse Thilo <jthilo@gnu.org>
21499
21500 * src/.cvsignore, src/Makefile.am:
21501 Reorganized: sources in `src', documentation in `doc'.
21502
21503 * src/lex.c (literalchar):
21504 fixed the code for escaping double quotes (thanks
21505 Jonathan Czisny.)
21506
215071999-04-18 Jesse Thilo <jthilo@gnu.org>
21508
21509 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
21510 Adjusted paths to reflect directory reorganization.
21511
215121999-04-18 Jesse Thilo <jthilo@gnu.org>
21513
21514 * doc/.cvsignore, doc/Makefile.am:
21515 Reorganized: sources in `src', documentation in `doc'.
21516
215171999-04-18 Jesse Thilo <jthilo@gnu.org>
21518
21519 * configure.in:
21520 Updated AC_INIT file to reflect directory reorganization.
21521
21522 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
21523 Reorganized: sources in `src', documentation in `doc'.
21524
215251999-04-13 Jesse Thilo <jthilo@gnu.org>
21526
21527 * src/allocate.c:
21528 Don't declare calloc() and realloc() if not necessary.
21529
215301999-04-13 Jesse Thilo <jthilo@gnu.org>
21531
21532 * configure.in, acconfig.h, acinclude.m4:
21533 Don't declare calloc() and realloc() if not necessary.
21534
215351999-03-23 Jesse Thilo <jthilo@gnu.org>
21536
21537 * po/.cvsignore: Added i18n support.
21538
215391999-03-23 Jesse Thilo <jthilo@gnu.org>
21540
21541 * acconfig.h, configure.in, Makefile.am:
21542 Added i18n support.
21543
215441999-03-22 Jesse Thilo <jthilo@gnu.org>
21545
21546 * src/bison.s1: Fixed #line numbers.
21547
215481999-03-15 Jesse Thilo <jthilo@gnu.org>
21549
21550 * po/es.po, po/fr.po, po/nl.po, po/de.po:
21551 Added PO files from Translation Project.
21552
215531999-03-03 Jesse Thilo <jthilo@gnu.org>
21554
21555 * Makefile.am:
21556 Added support for non-ANSI compilers (ansi2knr).
21557
215581999-02-16 Jesse Thilo <jthilo@gnu.org>
21559
21560 * configure.in: Bumped version number to 1.27.
21561
21562 * Makefile.am:
21563 Added `bison.simple' to list of files removed by `make distclean'.
21564
215651999-02-12 Jesse Thilo <jthilo@gnu.org>
21566
21567 * src/files.c, src/files.h:
21568 Defined locations of parser files in config.h instead of Makefile.
21569
215701999-02-12 Jesse Thilo <jthilo@gnu.org>
21571
21572 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
21573 Defined locations of parser files in config.h instead of Makefile.
21574
215751999-02-09 Jesse Thilo <jthilo@gnu.org>
21576
21577 * Makefile.am:
21578 Removed inappropriate use of $< macro.
21579
215801999-02-05 Jesse Thilo <jthilo@gnu.org>
21581
21582 * po/Makefile.in.in, po/POTFILES.in:
21583 Add `po' directory skeleton.
21584
215851999-01-27 Jesse Thilo <jthilo@gnu.org>
21586
21587 * README: Document help-bison list.
21588
21589 * configure.in: Add check for mkstemp().
21590
215911999-01-20 Jesse Thilo <jthilo@gnu.org>
21592
21593 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
21594 Hush a few compiler warnings.
21595
21596 * src/files.c:
21597 Add tryclose(), which verifies that fclose was successful.
21598 Hush a couple of compiler warnings.
21599
216001999-01-20 Jesse Thilo <jthilo@gnu.org>
21601
21602 * Makefile.am, OChangeLog:
21603 ChangeLog is now automatically generated. Include the old version as
21604 OChangeLog.
21605
216061999-01-14 Jesse Thilo <jthilo@gnu.org>
21607
21608 * 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:
21609 Update FSF address.
21610
216111999-01-14 Jesse Thilo <jthilo@gnu.org>
21612
21613 * doc/bison.texinfo: Fix formatting glitch.
21614
21615 * doc/bison.texinfo: Update FSF address.
21616
216171999-01-14 Jesse Thilo <jthilo@gnu.org>
21618
21619 * acconfig.h: Update FSF address.
21620
216211999-01-08 Jesse Thilo <jthilo@gnu.org>
21622
21623 * src/system.h:
21624 Don't define PACKAGE here, since config.h defines it.
21625
216261998-12-30 Jesse Thilo <jthilo@gnu.org>
21627
21628 * src/reader.c: Update copyright date.
21629
21630 * src/main.c:
21631 Ditch sprintf to statically-sized buffers in fatal/warn functions in
21632 favor of output directly to stderr (avoids buffer overruns).
21633
21634 * src/reader.c: Some checks for premature EOF.
21635
21636 * 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:
21637 Use prototypes if the compiler understands them.
21638
21639 * src/files.c: Honor TMPDIR on Unix hosts.
21640 Use prototypes if the compiler understands them.
21641
21642 * src/reader.c:
21643 Fix a couple of buffer overrun bugs.
21644 Use prototypes if the compiler understands them.
21645
21646 * src/system.h: Include unistd.h and ctype.h.
21647 Use #ifdef instead of #if for NLS symbols.
21648
216491998-12-30 Jesse Thilo <jthilo@gnu.org>
21650
21651 * doc/bison.texinfo:
21652 Delete comment "consider using @set for edition number, etc..." since
21653 we now are doing so.
21654
216551998-12-30 Jesse Thilo <jthilo@gnu.org>
21656
21657 * configure.in:
21658 Use prototypes if the compiler understands them.
21659
21660 * NEWS: Document 1.26 highlights.
21661
21662 * Makefile.am: Require Automake 1.3 or later.
21663
21664 * acconfig.h:
21665 Use prototypes if the compiler understands them.
21666
216671998-12-29 Jesse Thilo <jthilo@gnu.org>
21668
21669 * src/version.c:
21670 Use VERSION symbol from automake for version number.
21671
216721998-12-29 Jesse Thilo <jthilo@gnu.org>
21673
21674 * acconfig.h, configure.in, version.cin:
21675 Use VERSION symbol from automake for version number.
21676
216771998-11-28 Jesse Thilo <jthilo@gnu.org>
21678
21679 * Makefile.am:
21680 Distribute original version of simple parser (bison.s1), not built
21681 version (bison.simple).
21682
216831998-11-28 Jesse Thilo <jthilo@gnu.org>
21684
21685 * doc/bison.texinfo: Add info dir entry.
21686
21687 * doc/bison.texinfo:
21688 Let automake put version number into documentation.
21689
216901998-11-26 Jesse Thilo <jthilo@gnu.org>
21691
21692 * src/bison.cld, src/build.com, src/vmshlp.mar:
21693 Add non-RCS files from /gd/gnu/bison.
21694
216951998-11-26 Jesse Thilo <jthilo@gnu.org>
21696
21697 * doc/bison.1:
21698 Document the BISON_HAIRY and BISON_SIMPLE variables.
21699
217001998-11-25 Jesse Thilo <jthilo@gnu.org>
21701
21702 * src/version.c: Build version.c automatically.
21703
21704 * src/reader.c:
21705 Fix token numbering (used to start at 258, not 257).
21706
21707 * src/system.h: Include config.h.
21708
21709 * src/getargs.c: Update bug report address.
21710
21711 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
21712 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
21713
217141998-11-25 Jesse Thilo <jthilo@gnu.org>
21715
21716 * Makefile.am:
21717 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21718
21719 * configure.in, version.cin:
21720 Build version.c automatically.
21721
21722 * AUTHORS: Add AUTHORS file.
21723
21724 * README: Update bug report address.
21725
21726 * bison.simple:
21727 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
21728
21729 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
21730 Add automake stuff.
21731
217321998-11-25 Jesse Thilo <jthilo@gnu.org>
21733
21734 * doc/bison.texinfo: Clean up some formatting.
21735
217361998-05-05 Richard Stallman <rms@gnu.org>
21737
21738 * doc/bison.texinfo:
21739 Explain better why to make a pure parser.
21740
217411998-01-05 Richard Stallman <rms@gnu.org>
21742
21743 * src/files.c (openfiles):
21744 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
21745 find a temporary directory, if possible. Do not unlink files while
21746 they are open.
21747
217481997-08-25 Richard Stallman <rms@gnu.org>
21749
21750 * src/reader.c (stack_offset;):
21751 Change some warni to warns.
21752
21753 * src/lex.c (literalchar): Use warns, not warni.
21754
217551997-06-28 Richard Stallman <rms@gnu.org>
21756
21757 * src/bison.s1: Add a Bison version comment.
21758
21759 * src/main.c (fatal, warn, berror):
21760 Use program_name.
21761
217621997-06-28 Richard Stallman <rms@gnu.org>
21763
21764 * Makefile.in (bison_version): New variable.
21765 (dist): Use that variable.
21766 (bison.s1): Substitute the Bison version into bison.simple.
21767
21768 * bison.simple: Add a Bison version comment.
21769
217701997-06-18 Richard Stallman <rms@gnu.org>
21771
21772 * src/main.c (fatal, warn, berror):
21773 Make error messages standard.
21774 (toomany): Improve error message text.
21775
21776 * 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:
21777 new.h renamed to alloc.h.
21778
217791997-06-18 Richard Stallman <rms@gnu.org>
21780
21781 * Makefile.in: new.h renamed to alloc.h.
21782
217831997-05-24 Richard Stallman <rms@gnu.org>
21784
21785 * src/lex.c (literalchar):
21786 Fix the code for escaping \, " and '.
21787
21788 (lex): Avoid trouble when there are many chars
21789 to discard in a char literal with just several chars in it.
21790
217911997-05-17 Richard Stallman <rms@gnu.org>
21792
21793 * src/bison.s1:
21794 Use malloc, if using alloca is troublesome.
21795 (YYSTACK_USE_ALLOCA): New flag macro.
21796 Define it for some systems and compilers.
21797 (YYSTACK_ALLOC): New macro.
21798 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21799 If it was malloc'd, free it.
21800
218011997-05-17 Richard Stallman <rms@gnu.org>
21802
21803 * bison.simple:
21804 Use malloc, if using alloca is troublesome.
21805 (YYSTACK_USE_ALLOCA): New flag macro.
21806 Define it for some systems and compilers.
21807 (YYSTACK_ALLOC): New macro.
21808 (yyparse): Use YYSTACK_ALLOC to allocate stack.
21809 If it was malloc'd, free it.
21810
218111997-04-23 Richard Stallman <rms@gnu.org>
21812
21813 * src/bison.s1:
21814 (alloca) [__hpux]: Always define as __builtin_alloca.
21815
218161997-04-23 Richard Stallman <rms@gnu.org>
21817
21818 * bison.simple:
21819 (alloca) [__hpux]: Always define as __builtin_alloca.
21820
218211997-04-22 Richard Stallman <rms@gnu.org>
21822
21823 * src/bison.s1:
21824 [__hpux]: Include alloca.h (right for HPUX 10)
21825 instead of declaring alloca (right for HPUX 9).
21826
21827 * src/bison.s1 (__yy_memcpy):
21828 Declare arg `count' as unsigned int.
21829 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21830
218311997-04-22 Richard Stallman <rms@gnu.org>
21832
21833 * bison.simple:
21834 [__hpux]: Include alloca.h (right for HPUX 10)
21835 instead of declaring alloca (right for HPUX 9).
21836
21837 * bison.simple (__yy_memcpy):
21838 Declare arg `count' as unsigned int.
21839 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
21840
218411997-01-03 Richard Stallman <rms@gnu.org>
21842
21843 * src/allocate.c: [__STDC__ or _MSC_VER]:
21844 Declare calloc and realloc to return void *.
21845
218461997-01-02 Richard Stallman <rms@gnu.org>
21847
21848 * src/system.h:
21849 [_MSC_VER]: Include stdlib.h and process.h.
21850 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
21851
21852 * src/main.c (main): Return FAILURE as a value.
21853 (printable_version): Declare arg as int, not char.
21854
218551997-01-02 Richard Stallman <rms@gnu.org>
21856
21857 * Makefile.in (dist):
21858 Explicitly check for symlinks, and copy them.
21859
218601996-12-19 Richard Stallman <rms@gnu.org>
21861
21862 * src/files.c:
21863 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
21864
218651996-12-18 Paul Eggert <eggert@gnu.org>
21866
21867 * src/bison.s1 (yyparse):
21868 If __GNUC__ and YYPARSE_PARAM are both defined,
21869 declare yyparse to have a void * argument.
21870
218711996-12-18 Paul Eggert <eggert@gnu.org>
21872
21873 * bison.simple (yyparse):
21874 If __GNUC__ and YYPARSE_PARAM are both defined,
21875 declare yyparse to have a void * argument.
21876
218771996-12-17 Richard Stallman <rms@gnu.org>
21878
21879 * src/reduce.c (nbits): Add some casts.
21880
218811996-08-12 Richard Stallman <rms@gnu.org>
21882
21883 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
21884
218851996-08-12 Richard Stallman <rms@gnu.org>
21886
21887 * bison.simple: Test _MSDOS as well as _MSDOS_.
21888
218891996-07-31 Richard Stallman <rms@gnu.org>
21890
21891 * src/bison.s1:
21892 [__sun && __i386]: Include alloca.h.
21893
218941996-07-31 Richard Stallman <rms@gnu.org>
21895
21896 * bison.simple:
21897 [__sun && __i386]: Include alloca.h.
21898
218991996-07-30 Richard Stallman <rms@gnu.org>
21900
21901 * src/bison.s1: Comment change.
21902
21903 * src/bison.s1: Test _MSDOS_, not MSDOS.
21904
219051996-07-30 Richard Stallman <rms@gnu.org>
21906
21907 * bison.simple: Comment change.
21908
21909 * bison.simple: Test _MSDOS_, not MSDOS.
21910
219111996-06-01 Richard Stallman <rms@gnu.org>
21912
21913 * 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:
21914 Insert `_' macro around many string constants.
21915
21916 * src/main.c:
21917 Insert `_' macro around many string constants.
21918
21919 (main): Call setlocale, bindtextdomain and textdomain.
21920
21921 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
21922 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
21923 [ENABLE_NLS]: Include libintl.h.
21924 [ENABLE_NLS] (gettext): Define.
21925 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
21926 (N_, PACKAGE, LOCALEDIR): New macros.
21927
219281996-06-01 Richard Stallman <rms@gnu.org>
21929
21930 * POTFILES.in: New file.
21931
21932 * Makefile.in (allocate.o):
21933 Define target explicitly.
21934
21935 * Makefile.in (CFLAGS): Set to @CFLAGS@.
21936 (LDFLAGS): Set to @LDFLAGS@.
21937 (configure): Run autoconf only if preceding `cd' succeeds.
21938 (bison.s1): Redirect output to temporary file then move the
21939 temporary to the target, rather than redirecting directly to bison.s1.
21940 (clean): Remove config.status and config.log.
21941 (distclean): Don't remove config.status here.
21942
219431996-05-12 Richard Stallman <rms@gnu.org>
21944
21945 * src/bison.s1:
21946 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21947
219481996-05-12 Richard Stallman <rms@gnu.org>
21949
21950 * bison.simple:
21951 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
21952
219531996-05-11 Richard Stallman <rms@gnu.org>
21954
21955 * src/bison.s1 (__yy_memcpy):
21956 Really reorder the args, as was supposedly done on Feb 14 1995.
21957 (yyparse): Calls changed accordingly.
21958
219591996-05-11 Richard Stallman <rms@gnu.org>
21960
21961 * Makefile.in (dist): Don't use $(srcdir).
21962
21963 * bison.simple (__yy_memcpy):
21964 Really reorder the args, as was supposedly done on Feb 14 1995.
21965 (yyparse): Calls changed accordingly.
21966
219671996-01-27 Richard Stallman <rms@gnu.org>
21968
21969 * src/output.c (output_rule_data):
21970 Test YYERROR_VERBOSE in the conditional
21971 around the definition of ttyname.
21972
219731995-12-29 Richard Stallman <rms@gnu.org>
21974
21975 * src/bison.s1:
21976 Fix line numbers in #line commands.
21977
219781995-12-29 Richard Stallman <rms@gnu.org>
21979
21980 * bison.simple:
21981 Fix line numbers in #line commands.
21982
219831995-12-27 Richard Stallman <rms@gnu.org>
21984
21985 * src/bison.s1 (YYPARSE_PARAM_DECL):
21986 In C++, make it always null.
21987 (YYPARSE_PARAM_ARG): New macro.
21988 (yyparse): Use YYPARSE_PARAM_ARG.
21989
219901995-12-27 Richard Stallman <rms@gnu.org>
21991
21992 * bison.simple (YYPARSE_PARAM_DECL):
21993 In C++, make it always null.
21994 (YYPARSE_PARAM_ARG): New macro.
21995 (yyparse): Use YYPARSE_PARAM_ARG.
21996
219971995-11-29 Richard Stallman <rms@gnu.org>
21998
21999 * doc/bison.texinfo:
22000 Describe literal string tokens, %raw, %no_lines, %token_table.
22001
220021995-11-29 Daniel Hagerty <hag@gnu.org>
22003
22004 * doc/bison.texinfo: Fixed update date
22005
220061995-10-16 Richard Stallman <rms@gnu.org>
22007
22008 * src/version.c: Version 1.25.
22009
220101995-10-16 Richard Stallman <rms@gnu.org>
22011
22012 * NEWS: *** empty log message ***
22013
220141995-10-16 Richard Stallman <rms@gnu.org>
22015
22016 * doc/bison.1, doc/bison.rnh:
22017 Add new options.
22018
220191995-10-15 Richard Stallman <rms@gnu.org>
22020
22021 * src/vmsgetargs.c, src/getargs.c:
22022 Added -n, -k, and -raw switches.
22023 (noparserflag, toknumflag, rawtoknumflag): New variables.
22024
22025 * src/symtab.h (SALIAS):
22026 New #define for adding aliases to %token.
22027 (struct bucket): Added `alias' field.
22028
22029 * src/reduce.c (reduce_grammar):
22030 Revise error message.
22031 (print_notices): Remove final `.' from error message.
22032
22033 * src/reader.c (reader_output_yylsp):
22034 New function.
22035 (readgram): Use `#if 0' around code that accepted %command
22036 inside grammar rules: The documentation doesn't allow it,
22037 and it will fail since the %command processors scan for the next %.
22038 (parse_token_decl): Extended the %token
22039 declaration to allow a multi-character symbol as an alias.
22040 (parse_thong_decl): New function.
22041 (read_declarations): Added %thong declarations.
22042 (read_declarations): Handle NOOP to deal with allowing
22043 % declarations as another means to specify the flags.
22044 (readgram): Allow %prec prior to semantics embedded in a rule.
22045 (skip_to_char, read_declarations, copy_definition)
22046 (parse_token_decl, parse_start_decl, parse_type_decl)
22047 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
22048 (get_type_name, copy_guard, copy_action, readgram)
22049 (get_type, packsymbols): Revised most error messages.
22050 Changed `fatal' to `warnxxx' to avoid aborting for error.
22051 Revised and use multiple warnxxx functions to avoid using VARARGS1.
22052 (read_declarations): Improve the error message for
22053 an invalid character. Do not abort.
22054 (read_declarations, copy_guard, copy_action): Use
22055 printable_version to avoid unprintable characters in printed output.
22056 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
22057 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
22058 Allow the type of a non-terminal can be given
22059 more than once, as long as all specifications give the same type.
22060
22061 * src/output.c:
22062 (output_headers, output_trailers, output, output_gram)
22063 (output_rule_data): Implement noparserflag variable.
22064 Implement toknumflag variable.
22065 (output): Call reader_output_yylsp to output LTYPESTR.
22066
22067 * src/main.c (main):
22068 If reader sees an error, don't process the grammar.
22069 (fatals): Updated to not use VARARGS1.
22070 (printable_version, int_to_string, warn, warni, warns, warnss)
22071 (warnsss): New error reporting functions. Avoid abort for error.
22072
22073 * src/lex.h:
22074 Added THONG and NOOP for alias processing.
22075 Added SETOPT for the new code that allows setting options with %flags.
22076
22077 * src/lex.c:
22078 Include getopt.h. Add some extern decls.
22079 (safegetc): New function to deal with EOF gracefully.
22080 (literalchar); new function to deal with reading \ escapes.
22081 (lex): Use literalchar.
22082 (lex): Implemented "..." tokens.
22083 (literalchar, lex, parse_percent_token): Made tokenbuffer
22084 always contain the token. This includes growing the token
22085 buffer while reading an integer.
22086 (parse_percent_token): Replaced if-else statement with percent_table.
22087 (parse_percent_token): Added % declarations as another
22088 way to specify the flags -n, -l, and -r. Also added hooks for
22089 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
22090 major changes to files.c.
22091 (lex) Retain in the incoming stream a character following
22092 an incorrect '/'.
22093 (skip_white_space, lex): Revised most error messages
22094 and changed fatal to warn to avoid aborting.
22095 (percent_table): Added %thong declarations.
22096
22097 * src/gram.h: Comment changes.
22098
22099 * src/files.c (openfiles, open_extra_files, done):
22100 Add faction flag
22101 and actfile file. Handle noparserflag. Both for -n switch.
22102
22103 * src/conflicts.c (resolve_sr_conflict):
22104 Remove use of alloca.
22105
221061995-06-01 Jim Meyering <meyering@gnu.org>
22107
22108 * doc/bison.texinfo: *** empty log message ***
22109
221101995-05-06 Richard Stallman <rms@gnu.org>
22111
22112 * src/bison.s1: Comment change.
22113
221141995-05-06 Richard Stallman <rms@gnu.org>
22115
22116 * bison.simple: Comment change.
22117
221181995-05-03 Richard Stallman <rms@gnu.org>
22119
22120 * src/version.c: Version now 1.24.
22121
22122 * src/bison.s1: Change distribution terms.
22123
22124 * src/version.c: Version now 1.23.
22125
221261995-05-03 Richard Stallman <rms@gnu.org>
22127
22128 * doc/bison.texinfo:
22129 Rewrite "Conditions for Using Bison".
22130 Update version to 1.24.
22131
221321995-05-03 Richard Stallman <rms@gnu.org>
22133
22134 * bison.simple: Change distribution terms.
22135
221361995-02-23 Richard Stallman <rms@gnu.org>
22137
22138 * src/files.c: Test __VMS_POSIX as well as VMS.
22139
221401995-02-14 Jim Meyering <meyering@gnu.org>
22141
22142 * src/bison.s1 (__yy_memcpy):
22143 Renamed from __yy_bcopy to avoid
22144 confusion. Reverse FROM and TO arguments to be consistent with
22145 those of memcpy.
22146
221471995-02-14 Jim Meyering <meyering@gnu.org>
22148
22149 * bison.simple (__yy_memcpy):
22150 Renamed from __yy_bcopy to avoid
22151 confusion. Reverse FROM and TO arguments to be consistent with
22152 those of memcpy.
22153
221541994-11-10 David J. MacKenzie <djm@gnu.org>
22155
22156 * NEWS: reformat
22157
22158 * NEWS: New file.
22159
22160 * Makefile.in (DISTFILES): Include NEWS.
22161
22162 * Makefile.in (DISTFILES):
22163 Include install-sh, not install.sh.
22164
22165 * configure.in: Update to Autoconf v2 macro names.
22166
221671994-10-05 David J. MacKenzie <djm@gnu.org>
22168
22169 * Makefile.in: fix typo
22170
22171 * Makefile.in (prefix, exec_prefix):
22172 Let configure set them.
22173
221741994-09-28 David J. MacKenzie <djm@gnu.org>
22175
22176 * Makefile.in: Set datadir to $(prefix)/share.
22177
221781994-09-15 Richard Stallman <rms@gnu.org>
22179
22180 * src/bison.s1:
22181 Update copyright notice and GPL version.
22182
221831994-09-15 Richard Stallman <rms@gnu.org>
22184
22185 * bison.simple:
22186 Update copyright notice and GPL version.
22187
221881994-07-12 Richard Stallman <rms@gnu.org>
22189
22190 * src/reduce.c, src/reader.c:
22191 entered into RCS
22192
221931994-05-05 David J. MacKenzie <djm@gnu.org>
22194
22195 * Makefile.in: entered into RCS
22196
221971994-03-26 Richard Stallman <rms@gnu.org>
22198
22199 * src/bison.s1: entered into RCS
22200
222011994-03-26 Richard Stallman <rms@gnu.org>
22202
22203 * bison.simple: entered into RCS
22204
222051994-03-25 Richard Stallman <rms@gnu.org>
22206
22207 * src/main.c: entered into RCS
22208
222091994-03-24 Richard Stallman <rms@gnu.org>
22210
22211 * src/conflicts.c: entered into RCS
22212
222131994-01-02 Richard Stallman <rms@gnu.org>
22214
22215 * Makefile.in: *** empty log message ***
22216
222171993-11-21 Richard Stallman <rms@gnu.org>
22218
22219 * src/bison.s1: *** empty log message ***
22220
222211993-11-21 Richard Stallman <rms@gnu.org>
22222
22223 * doc/bison.texinfo: entered into RCS
22224
22225 * doc/bison.texinfo: *** empty log message ***
22226
222271993-11-21 Richard Stallman <rms@gnu.org>
22228
22229 * bison.simple: *** empty log message ***
22230
222311993-10-25 David J. MacKenzie <djm@gnu.org>
22232
22233 * doc/bison.texinfo: *** empty log message ***
22234
222351993-10-19 Richard Stallman <rms@gnu.org>
22236
22237 * src/bison.s1: *** empty log message ***
22238
222391993-10-19 Richard Stallman <rms@gnu.org>
22240
22241 * bison.simple: *** empty log message ***
22242
222431993-10-14 Richard Stallman <rms@gnu.org>
22244
22245 * src/bison.s1: *** empty log message ***
22246
222471993-10-14 Richard Stallman <rms@gnu.org>
22248
22249 * bison.simple: *** empty log message ***
22250
222511993-09-14 David J. MacKenzie <djm@gnu.org>
22252
22253 * doc/bison.texinfo: *** empty log message ***
22254
222551993-09-13 Noah Friedman <friedman@gnu.org>
22256
22257 * Makefile.in: *** empty log message ***
22258
222591993-09-10 Richard Stallman <rms@gnu.org>
22260
22261 * src/conflicts.c: *** empty log message ***
22262
22263 * src/system.h: entered into RCS
22264
222651993-09-10 Richard Stallman <rms@gnu.org>
22266
22267 * doc/bison.1: entered into RCS
22268
222691993-09-06 Noah Friedman <friedman@gnu.org>
22270
22271 * src/version.c: entered into RCS
22272
222731993-09-06 Noah Friedman <friedman@gnu.org>
22274
22275 * Makefile.in: *** empty log message ***
22276
222771993-07-30 David J. MacKenzie <djm@gnu.org>
22278
22279 * Makefile.in: *** empty log message ***
22280
222811993-07-24 Richard Stallman <rms@gnu.org>
22282
22283 * src/bison.s1: *** empty log message ***
22284
222851993-07-24 Richard Stallman <rms@gnu.org>
22286
22287 * bison.simple: *** empty log message ***
22288
222891993-07-08 David J. MacKenzie <djm@gnu.org>
22290
22291 * Makefile.in: *** empty log message ***
22292
222931993-07-04 Richard Stallman <rms@gnu.org>
22294
22295 * src/bison.s1: *** empty log message ***
22296
222971993-07-04 Richard Stallman <rms@gnu.org>
22298
22299 * bison.simple: *** empty log message ***
22300
223011993-06-26 David J. MacKenzie <djm@gnu.org>
22302
22303 * src/getargs.c: entered into RCS
22304
223051993-06-26 David J. MacKenzie <djm@gnu.org>
22306
22307 * doc/bison.texinfo: *** empty log message ***
22308
22309 * doc/bison.1: New file.
22310
223111993-06-25 Richard Stallman <rms@gnu.org>
22312
22313 * src/getargs.c: New file.
22314
223151993-06-16 Richard Stallman <rms@gnu.org>
22316
22317 * src/bison.s1: *** empty log message ***
22318
223191993-06-16 Richard Stallman <rms@gnu.org>
22320
22321 * bison.simple: *** empty log message ***
22322
223231993-06-03 Richard Stallman <rms@gnu.org>
22324
22325 * src/bison.s1: New file.
22326
223271993-06-03 Richard Stallman <rms@gnu.org>
22328
22329 * doc/bison.texinfo: *** empty log message ***
22330
223311993-06-03 Richard Stallman <rms@gnu.org>
22332
22333 * bison.simple: New file.
22334
223351993-05-19 Richard Stallman <rms@gnu.org>
22336
22337 * doc/bison.texinfo: New file.
22338
223391993-05-07 Noah Friedman <friedman@gnu.org>
22340
22341 * Makefile.in: *** empty log message ***
22342
223431993-04-28 Noah Friedman <friedman@gnu.org>
22344
22345 * src/reader.c: *** empty log message ***
22346
223471993-04-23 Noah Friedman <friedman@gnu.org>
22348
22349 * src/alloc.h: entered into RCS
22350
223511993-04-20 David J. MacKenzie <djm@gnu.org>
22352
22353 * src/version.c: *** empty log message ***
22354
22355 * src/files.c, src/allocate.c:
22356 entered into RCS
22357
22358 * src/reader.c: *** empty log message ***
22359
22360 * src/lex.c: entered into RCS
22361
22362 * src/conflicts.c: New file.
22363
22364 * src/symtab.c: entered into RCS
22365
22366 * src/alloc.h: New file.
22367
22368 * src/LR0.c: entered into RCS
22369
223701993-04-18 Noah Friedman <friedman@gnu.org>
22371
22372 * src/reader.c: New file.
22373
22374 * src/version.c: *** empty log message ***
22375
223761993-04-18 Noah Friedman <friedman@gnu.org>
22377
22378 * Makefile.in: *** empty log message ***
22379
223801993-04-17 Noah Friedman <friedman@gnu.org>
22381
22382 * Makefile.in: *** empty log message ***
22383
223841993-04-15 Richard Stallman <rms@gnu.org>
22385
22386 * src/main.c, src/files.c:
22387 New file.
22388
223891993-04-15 Noah Friedman <friedman@gnu.org>
22390
22391 * configure.in: entered into RCS
22392
22393 * configure.in: *** empty log message ***
22394
22395 * configure.in: New file.
22396
223971993-04-14 Richard Stallman <rms@gnu.org>
22398
22399 * Makefile.in: New file.
22400
224011993-04-13 Richard Stallman <rms@gnu.org>
22402
22403 * src/version.c: New file.
22404
224051993-03-25 Richard Stallman <rms@gnu.org>
22406
22407 * src/output.c: entered into RCS
22408
224091992-09-25 Richard Stallman <rms@gnu.org>
22410
22411 * configure.bat: entered into RCS
22412
224131992-06-22 Richard Stallman <rms@gnu.org>
22414
22415 * src/vmsgetargs.c: entered into RCS
22416
224171992-06-22 Richard Stallman <rms@gnu.org>
22418
22419 * doc/bison.rnh: entered into RCS
22420
224211992-04-20 David J. MacKenzie <djm@gnu.org>
22422
22423 * README: entered into RCS
22424
224251992-01-22 Richard Stallman <rms@gnu.org>
22426
22427 * src/machine.h: entered into RCS
22428
224291991-12-21 Richard Stallman <rms@gnu.org>
22430
22431 * src/lalr.c, src/closure.c:
22432 entered into RCS
22433
224341991-12-20 Richard Stallman <rms@gnu.org>
22435
22436 * src/state.h: entered into RCS
22437
224381991-12-18 Richard Stallman <rms@gnu.org>
22439
22440 * src/print.c, src/nullable.c, src/derives.c:
22441 entered into RCS
22442
224431991-11-03 David J. MacKenzie <djm@gnu.org>
22444
22445 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
22446 entered into RCS
22447
224481988-09-09 Richard Stallman <rms@gnu.org>
22449
22450 * src/bison.hairy: entered into RCS
22451
224521987-12-16 Richard Stallman <rms@gnu.org>
22453
22454 * REFERENCES: entered into RCS
22455
22456
22457 -----
22458
22459 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
22460 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
22461 2007, 2008, 2009 Free Software Foundation, Inc.
22462
22463 Copying and distribution of this file, with or without
22464 modification, are permitted provided the copyright notice and this
22465 notice are preserved.