]> git.saurik.com Git - bison.git/blame - ChangeLog
Port small part of master's 11707b2b so future ports are easier.
[bison.git] / ChangeLog
CommitLineData
70afaf26
JD
12009-12-22 Joel E. Denny <jdenny@clemson.edu>
2
3 Port small part of master's 11707b2b so future ports are easier.
4 * data/lalr1.java (YYParser::yysyntax_error): Untabify.
5
8200219a
AD
62008-12-11 Akim Demaille <demaille@gostai.com>
7
8 Simplify the i18n of the error messages.
9 * data/lalr1.cc: Comment changes.
10
39f6a8d1
AD
112008-11-11 Akim Demaille <demaille@gostai.com>
12
13 Prefer M4 to CPP.
14 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
15 YYERROR_VERBOSE.
16
e657f369
AD
172008-11-11 Akim Demaille <demaille@gostai.com>
18
19 Support i18n of the parse error messages.
20 * TODO (lalr1.cc/I18n): Remove.
21 * data/lalr1.cc (yysyntax_error_): Support the translation of the
22 error messages, as done in yacc.c.
23 Stay within the yy* pseudo namespace.
24
1e05521d
JD
252009-12-22 Joel E. Denny <jdenny@clemson.edu>
26
27 Port small part of master's 8901f32e so future ports are easier.
28 * data/lalr1.cc (yy::parser::yysyntax_error_): Always add second
29 argument, but name it in the function definition only when
30 verbose error messages are enabled and it'll thus be used.
31 (yy::parser::parse): Update use of yysyntax_error_.
32
2728ac7e
JD
332009-12-29 Joel E. Denny <jdenny@clemson.edu>
34
35 portability: `<' and `>' are not always defined on addresses.
36 Specifically, don't sort objects by their memory addresses when
37 they're not allocated in the same array or other object. Though
38 I haven't found a test case where that fails on my platform, C
39 says the behavior is undefined.
40 * src/AnnotationList.c (AnnotationList__insertInto): Remove
41 FIXME. Use new id field of InadequacyList nodes rather than
42 their memory addresses when sorting.
43 (AnnotationList__compute_from_inadequacies): Add
44 inadequacy_list_node_count argument to pass to
45 InadequacyList__new_conflict.
46 * src/AnnotationList.h
47 (AnnotationList__compute_from_inadequacies): Update prototype
48 and documentation for new argument.
49 * src/InadequacyList.c (InadequacyList__new_conflict): Add
50 node_count argument and use it to assign a unique ID.
51 * src/InadequacyList.h (InadequacyListNodeCount): New typedef.
52 (InadequacyList): Add id field.
53 (InadequacyList__new_conflict): Update prototype and
54 documentation for new argument.
55 * src/ielr.c (ielr_compute_annotation_lists): Update
56 AnnotationList__compute_from_inadequacies invocation.
57
abcc7c03
JD
582009-12-20 Joel E. Denny <jdenny@clemson.edu>
59
60 Fix handling of yychar manipulation in user semantic actions.
61 The problem was that yacc.c didn't always update the yychar
62 translation afterwards. However, other skeletons appear to be
63 fine. glr.c appears to already translate yychar before every
64 use. lalr1.cc does not define yychar and does not document its
65 replacement, yyla, for users. It does provide yyclearin, but
66 that does not manipulate yyla and thus requires no translation
67 update. In lalr1.java, yychar is out of scope during semantic
68 actions.
69 * NEWS (2.5): Document.
70 * data/yacc.c (YYBACKUP): Don't bother translating yychar into
71 yytoken here.
72 (yyparse, yypush_parse): Instead, translate before every use of
73 yytoken, and add comments explaining this approach.
74 * tests/actions.at (Destroying lookahead assigned by semantic
75 action): New test group checking that translation happens before
76 lookahead destructor calls at parser return. Previously,
77 incorrect destructors were called.
78 * tests/conflicts.at (%error-verbose and consistent
79 errors): New test group checking that translation happens at
80 syntax error detection before the associated verbose error
81 message and the associated lookahead destructor calls. While
82 the destructor call is fixed by this patch, the verbose error
83 message is currently incorrect due to another bug (see
84 comments in test group), so this is an expected failure for now.
85
62efdd2a
JD
862009-12-21 Joel E. Denny <jdenny@clemson.edu>
87
88 YYFAIL: warn about uses and remove from lalr1.java.
89 * NEWS (2.5): Document.
90 * data/lalr1.java (parser::YYStack::YYFAIL): Rename to YYERRLAB,
91 and make it private. Update all uses.
92 * src/scan-code.l (SC_RULE_ACTION): Implement warning.
93
41d35e54
JD
942009-12-21 Joel E. Denny <jdenny@clemson.edu>
95
96 YYFAIL: deprecate.
97 * NEWS (2.4.2): Document deprecation and the phase-out plan.
98 * data/lalr1.java (parser::YYStack::YYFAIL): Add comment about
99 deprecation.
100 * data/yacc.c (YYFAIL): Likewise, and suppress warnings about
101 YYFAIL from GCC cpp's -Wunused-macros.
102 * doc/bison.texinfo (Java Action Features): Remove YYFAIL
103 documentation.
104 (LocalWords): Remove YYFAIL.
105
692d04cb
JD
1062009-12-17 Joel E. Denny <jdenny@clemson.edu>
107
108 Code cleanup.
109 * src/symtab.c, src/symtab.h (symbol_class_get_string): Remove
110 function, which is no longer used.
111
34731471
JD
1122009-12-16 Joel E. Denny <jdenny@clemson.edu>
113
114 Add gcc's -Wundef to test suite and fix another warning from it.
115 * NEWS (2.4.2): Update description of -Wundef fix.
116 * configure.ac (WARN_CXXFLAGS_TEST): New substitution.
117 (WARN_CFLAGS_TEST): New substitution.
118 * data/glr.c: Avoid warning about __STRICT_ANSI__.
119 * tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
120 WARN_CFLAGS.
121 (NO_WERROR_CFLAGS): Likewise.
122 (CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
123
3bba2dad
JD
1242009-12-16 Joel E. Denny <jdenny@clemson.edu>
125
126 * data/yacc.c: Reformat m4 a little.
127
af2ffe5c
JD
1282009-12-16 Joel E. Denny <jdenny@clemson.edu>
129
130 Document gcc -Wundef fix.
131 * NEWS (2.4.2): Here.
132 * THANKS (Jonathan Nieder): Add.
133
874ac415
JN
1342009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
135
136 Simplify y.tab.c when location tracking is disabled.
137 * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
138 tracking is not enabled. Instead, unconditionally define
139 YY_LOCATION_PRINT as a no-op for backward compatibility.
140
06caf0e1
JN
1412009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
142
143 Avoid warnings from gcc -Wundef y.tab.c.
144 * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
145 defined before using them.
146 * data/lalr1.cc: Likewise.
147 * data/yacc.c: Likewise.
148
687f011a
JD
1492009-12-15 Joel E. Denny <jdenny@clemson.edu>
150
151 autoconf: update to latest for fix of M4 detection.
152 Reported by Eric Blake.
153 * submodules/autoconf: Update.
154
fb9a3976
JD
1552009-12-15 Joel E. Denny <jdenny@clemson.edu>
156
157 portability: use -DGNULIB_POSIXCHECK.
158 Reported by Eric Blake. See discussions at
159 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html>
160 and
161 <http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html>.
162 * HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
163 * bootstrap.conf (gnulib_modules): Add all the printf modules
164 suggested by -DGNULIB_POSIXCHECK. Add realloc-posix as
165 suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
166 (excluded_files): Remove m4/printf-posix.m4.
167 * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
168 lib/libbison.a so gnulib libraries can be linked.
169
f1fb412c
JD
1702009-12-14 Joel E. Denny <jdenny@clemson.edu>
171
172 Enable assertion output and --disable-assert for configure.
173 * bootstrap.conf (gnulib_modules): Add assert module.
174 * src/system.h (aver): Define as assert, and summarize the
175 discussion on this issue.
176
51c7ca01
JD
1772009-12-14 Joel E. Denny <jdenny@clemson.edu>
178
179 Expand GLR acronym in summary of Bison.
180 Based on discussion with Akim Demaille starting at
181 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html>.
182 * doc/bison.texinfo (Introduction): Here.
183 * src/getargs.c (usage): Here.
184
1f68dca5
AR
1852009-10-03 Alex Rozenman <rozenman@gmail.com>
186
187 Document named references.
188 * doc/bison.texinfo (Actions): Add new example and xref to
189 Using Named References node.
190 (Using Named References): New node.
191
aa01d193
JD
1922009-10-16 Joel E. Denny <jdenny@clemson.edu>
193
194 cleanup.
195 * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead
196 of char*.
197 (Sbitset__isEmpty): Use Sbitset instead of char*.
198 * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char
199 instead of char. This helps to avoid casting errors.
200 (Sbitset__or): Use Sbitset instead of char*.
201
61747047
JD
2022009-10-16 Joel E. Denny <jdenny@clemson.edu>
203
204 portability: don't assume 8-bit bytes.
205 That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff.
206 * src/Sbitset.h (Sbitset__nbytes): Here.
207 (Sbitset__byteAddress): Here.
208 (Sbitset__bit_mask): Here.
209 (Sbitset__last_byte_mask): Here.
210 (Sbitset__ones): Here.
211 (SBITSET__FOR_EACH): Here.
212
a70596de
JD
2132009-10-11 Joel E. Denny <jdenny@clemson.edu>
214
215 portability: use va_start and va_end in the same function.
216 * src/complain.c (error_message): Move va_end from here...
217 (ERROR_MESSAGE): ... to here.
218
51f255a5
JD
2192009-10-08 Joel E. Denny <jdenny@clemson.edu>
220
221 * data/bison.m4: Update comments for rename to muscle-tab.h.
222
23ec25b7
JD
2232009-10-08 Joel E. Denny <jdenny@clemson.edu>
224
225 Rename muscle_tab.* to muscle-tab.* for consistency with master.
226 * src/Makefile.am (bison_SOURCES): Update.
227 * src/getargs.c, src/ielr.c, src/lalr.c, src/main.c,
228 src/output.c, src/parse-gram.y, src/print.c, src/reader.c,
229 src/tables.c: Update include.
230 * src/muscle_tab.c, src/muscle_tab.h: Rename to...
231 * src/muscle-tab.c, src/muscle-tab.h: ... these and update
232 include.
233
0ab402b4
JD
2342009-10-07 Joel E. Denny <jdenny@clemson.edu>
235
236 Minor code cleanup.
237 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and
238 replace all uses with UNIQSTR_CONCAT.
239 * src/uniqstr.c (uniqstr_vsprintf): New function.
240 * src/uniqstr.h (uniqstr_vsprintf): Add prototype.
241 (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New
242 macros.
243
42ec0ae1
JD
2442009-10-04 Joel E. Denny <jdenny@clemson.edu>
245
246 Minor code cleanup.
247 * src/parse-gram.y: Clean up sorting of declarations.
248 Use types to simplify %printer declarations where possible.
249 Provide %printer for BRACKETED_ID and symbol.prec.
250 * src/symtab.c: Whitespace change.
251
9637e0ed
JD
2522009-10-04 Joel E. Denny <jdenny@clemson.edu>
253
254 tests: skip tests of file names that platform does not support.
255 Reported by Michael Raskin at
256 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
257 * THANKS (Michael Raskin): Add.
258 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
259 to fail at least for file names containing ":" or "\".
260
69a2ab11
JD
2612009-09-23 Joel E. Denny <jdenny@clemson.edu>
262
263 yysyntax_error: avoid duplicate lookahead collection.
264 Except when memory reallocation is required, this change
265 eliminates the need to invoke yysyntax_error twice and thus to
266 repeat the collection of lookaheads. It also prepares for
267 future extensions that will make those repetitions more
268 expensive and that will require additional memory management in
269 yysyntax_error. Finally, it fixes an obscure bug already
270 exercised in the test suite.
271 * data/yacc.c (yysyntax_error): Add arguments for message
272 buffer variables stored in the parser. Instead of size, return
273 status similar to yyparse status but indicating success of
274 message creation. Other than the actual reallocation of the
275 message buffer, import and clean up memory management code
276 from...
277 (yyparse, yypush_parse): ... here.
278 * tests/regression.at (%error-verbose overflow): No longer an
279 expected failure.
280
d88cf117
JD
2812009-09-23 Joel E. Denny <jdenny@clemson.edu>
282
283 yysyntax_error: test memory management more.
284 * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro.
285 * tests/regression.at (%error-verbose and YYSTACK_USE_ALLOCA):
286 New test group.
287 (%error-verbose overflow): New test group that reveals an
288 obscure bug. Expected fail for now.
289
9da640ea
AD
2902008-12-11 Akim Demaille <demaille@gostai.com>
291
292 Pass the token type to yysyntax_error.
293 * data/yacc.c (yysyntax_error): Take the transated token instead
294 of the raw number.
295 Adjust callers.
296
d3d3628b
AD
2972008-12-11 Akim Demaille <demaille@gostai.com>
298
299 Simplify the i18n of the error messages.
300 * data/yacc.c (yysyntax_error): Rewrite, using a switch instead
301 of building dynamically the format string.
302
4c6b13f3
JD
3032009-10-03 Joel E. Denny <jdenny@clemson.edu>
304
305 Remove dead code.
306 * src/symtab.c (symbol_pack): Here because every symbol's number
307 is always defined by this time.
308
f840c05a
AR
3092009-10-03 Alex Rozenman <rozenman@gmail.com>
310
311 Add additional space after periods in NEWS.
312 * NEWS (2.5): here.
313
17a407dc
JD
3142009-09-29 Joel E. Denny <jdenny@clemson.edu>
315
316 Use the correct conversion specifier for size_t.
317 Reported by Jim Meyering.
318 * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu"
319 because Sbitset__Index is size_t.
320 * src/Sbitset.c (Sbitset__fprint): Use it instead of %d.
321
4b7a4c1b
JD
3222009-09-27 Joel E. Denny <jdenny@clemson.edu>
323
324 tests: don't abuse AT_BISON_CHECK.
325 * tests/regression.at (parse-gram.y: LALR = IELR): Move
326 additional shell commands outside of AT_BISON_CHECK.
327
873ac263
JD
3282009-09-26 Joel E. Denny <jdenny@clemson.edu>
329
330 tests: check that parse-gram.y's IELR and LALR are identical.
331 * tests/atlocal.in (abs_top_srcdir): New shell variable.
332 * tests/regression.at (parse-gram.y: LALR = IELR): New test
333 group.
334
232be91a
AD
3352009-09-16 Akim Demaille <demaille@gostai.com>
336
337 doc: comment changes.
338 * doc/bison.texinfo: Comment changes.
339
c781580d
AD
3402009-09-16 Akim Demaille <demaille@gostai.com>
341
342 doc: spell checking.
343 * doc/bison.texinfo: here.
344
348f5608
AR
3452009-09-19 Alex Rozenman <rozenman@gmail.com>
346
347 Keep sub-messages aligned. Fix strings for translation.
f840c05a
AR
348 * src/location.h (location_print): Add return value.
349 * src/location.c (location_print): Return number of printed
348f5608 350 characters.
f840c05a
AR
351 * src/complain.h (complain_at_indent, warn_at_indent): Prototype
352 new functions.
353 * src/complain.cpp (indent_ptr): New static variable.
354 (error_message, complain_at_indent, warn_at_indent): Implement
355 the alignment mechanism.
356 * src/scan-code.l (parse_ref, show_sub_messages): Fix strings
357 for translations. Use new alignment mechanism.
358 * tests/named-ref.at: Adjust test-cases.
348f5608
AR
359 * NEWS (2.5): Add an announcement about named references.
360
d93b5f50
JD
3612009-09-13 Joel E. Denny <jdenny@clemson.edu>
362
363 tests: clean up push.at test group titles.
364 * tests/push.at: Remove "Push Parsing: " from test group titles
365 because these are already under the banner "Push Parsing Tests".
366
4c56b131
AR
3672009-09-12 Alex Rozenman <rozenman@gmail.com>
368
369 Provide an additional sub-message for clarity.
370 Add "symbol not found in production" error message when
371 an "invalid reference" is detected in named references
372 resolution.
373 * src/scan-code.l: Update "invalid reference" case.
374 * tests/named-ref.at: Adjust test-cases.
375
93d0103d
JD
3762009-09-10 Joel E. Denny <jdenny@clemson.edu>
377
378 Clean up yacc.c a little.
379 * data/yacc.c: Clean up M4 for readability, and make output
380 whitespace more consistent. For the main parse function
381 comment, instead of saying "yyparse or yypush_parse", say either
382 "yyparse" or "yypush_parse" depending on which it actually is.
383
628be6c9
JD
3842009-09-03 Joel E. Denny <jdenny@clemson.edu>
385
386 Complain about unused %define variables and %code qualifiers.
387 * NEWS (2.5): Document.
388 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
389 * doc/bison.texinfo (Decl Summary): Document complaint, and
390 improve %define documentation a little otherwise.
391 * tests/input.at (Reject unused %code qualifiers): Update.
392 (%define errors): Update.
393 (%define, --define, --force-define): Update.
394 (%define backward compatibility): Update.
395 (Unused %define api.pure): Update.
396 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
397
c842365a
JD
3982009-09-03 Joel E. Denny <jdenny@clemson.edu>
399
400 Use aver not assert.
401 * src/output.c: Don't include assert.h.
402 (output_skeleton): Use aver not assert.
403 * src/system.h (aver): In documentation of why, add links to
404 Paul Eggert's explanations in the mailing lists.
405
14e568d7
AR
4062009-09-05 Alex Rozenman <rozenman@gmail.com>
407
408 Use "Unresolved reference" error message when no symbols were found
409 in a symbolic reference resolution. Remove .expr and -expr from
410 the shown reference when the reference is unresolved.
411 * src/scan-code.l: Change the error message, adjust location columns,
412 rename variable "exact_mode" to "explicit_bracketing".
413 * tests/named-ref.at: Adjust existing tests and add a new one.
414
dac8cc0d
AD
4152009-09-03 Akim Demaille <demaille@gostai.com>
416
417 * NEWS (2.4.2): Add "Internationalization" item.
418
3710dd02
AD
4192009-09-03 Akim Demaille <demaille@gostai.com>
420
421 bootstrap: fix/improve find_tool.
422 * bootstrap (find_tool): Improve error messages.
423 Fix typo about find_tool_names.
424
9852b61c
JD
4252009-08-29 Joel E. Denny <jdenny@clemson.edu>
426
427 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
428 See
429 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
430 * src/scan-code.h (code_props_rule_action_init): Rename
431 named_ref arg to name so it doesn't shadow named_ref type. This
432 makes it consistent with the function definition in scan-code.l
433 anyway.
434
f37495f6
JD
4352009-08-28 Joel E. Denny <jdenny@clemson.edu>
436
437 %define: accept unquoted values.
438 * NEWS (2.5): Group all %define changes together, and document
439 this one. Remove quotes in IELR and canonical LR entry.
440 * doc/bison.texinfo: Remove quotes in most examples throughout.
441 (Decl Summary): Update %define documentation.
442 (Table of Symbols): Likewise.
443 * src/ielr.c (LrType): Update documentation.
444 * src/parse-gram.y (content.opt): Add production for ID.
5bf2bf7a 445 * tests/calc.at: Remove quotes in most tests.
f37495f6
JD
446 * tests/existing.at: Likewise.
447 * tests/input.at: Likewise.
448 * tests/local.at: Likewise.
449 * tests/push.at: Likewise.
450 * tests/reduce.at: Likewise.
451 * tests/torture.at: Likewise.
452
3a414bbf
JD
4532009-08-28 Joel E. Denny <jdenny@clemson.edu>
454
455 %define lr.type: make values lowercase IDs.
456 That is, "LALR" => "lalr", "IELR" => "ielr", and
457 "canonical LR" => "canonical-lr".
458 * NEWS (2.5): Update documentation.
459 * doc/bison.texinfo (Decl Summary): Likewise.
460 * src/ielr.c (ielr): Use new values.
461 * src/ielr.h (ielr): Update documentation.
462 * src/reader.c (prepare_percent_define_front_end_variables): Use
463 and validate new values.
464 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
465 grammars.
466 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
467
4bb975e1
EB
4682009-08-27 Eric Blake <ebb9@byu.net>
469
470 scan-gram: avoid portability trap with ctype usage.
471 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
472 Avoid compiler warning.
473
74baf5c9
JD
4742009-08-27 Joel E. Denny <jdenny@clemson.edu>
475
476 tests: use perl for printing special sequences to files.
477 And skip tests if perl is not available. This is better than
478 playing tricks with shell portability. Suggested by Akim
479 Demaille.
480 * tests/input.at (Bad character literals): Use it here for
481 omitting final newlines.
482 (Bad escapes in literals): Use it here for special characters.
483
d63e1279
JD
4842009-08-26 Joel E. Denny <jdenny@clemson.edu>
485
486 tests: show a use of %define lr.default-reductions "consistent"
487 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
488 prevents the omission of expected tokens for %error-verbose.
489
833d1720
AD
4902009-08-26 Akim Demaille <demaille@gostai.com>
491
492 tests: portability fix.
493 * tests/input.at (Bad escapes in literals): Don't expect "echo
494 '\0'" to output \ then 0.
495
e4bcae3c
JD
4962009-08-26 Joel E. Denny <jdenny@clemson.edu>
497
498 Actually handle the yytable zero value correctly this time.
499 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Don't
500 mention zero values in the YYTABLE comments.
501 * data/glr.c (yytable_value_is_error): Don't check for zero
502 value.
503 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
504 * data/yacc.c (yytable_value_is_error): Likewise.
505 * data/lalr1.java (yy_table_value_is_error_): Likewise.
506 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
507 * src/tables.h: In header comments, explain why it's useless to
508 check for a zero value in yytable.
509
d5eb0826
JD
5102009-08-25 Joel E. Denny <jdenny@clemson.edu>
511
512 More fixes related to last two patches.
513 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
514 defined.
515 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Fix
516 yytable comments: zero indicates syntax error not default
517 action.
518 * data/glr.c (yyis_pact_ninf): Rename to...
519 (yypact_value_is_default): ... this.
520 (yyisDefaultedState): Update for rename.
521 (yyis_table_ninf): Rename to...
522 (yytable_value_is_error): ... this, and check for value zero
523 besides just YYTABLE_NINF.
524 (yygetLRActions): Check for default value from yypact. It
525 appears that this check is always performed before this function
526 is invoked, and so adding the check here is probably redundant.
527 However, the code may evolve after this subtlety is forgotten.
528 Also, update for rename to yytable_value_is_error. Because that
529 macro now checks for zero, a different but equivalent branch of
530 the if-then-else here is evaluated.
531 (yyreportSyntaxError): Update for rename to
532 yytable_value_is_error. The zero condition was mishandled
533 before.
534 (yyrecoverSyntaxError): Update for renames. No behavioral
535 changes.
536 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
537 New function.
538 (yy_table_value_is_error_): New function.
539 (parse): Use new functions where possible. No behavioral
540 changes.
541 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
542 The zero condition was mishandled before.
543 * data/yacc.c (yyis_pact_ninf): Rename to...
544 (yypact_value_is_default): ... this.
545 (yyis_table_ninf): Rename to...
546 (yytable_value_is_error): ... this, and check for value zero
547 besides just YYTABLE_NINF.
548 (yysyntax_error): Update for rename to yytable_value_is_error.
549 The zero condition was mishandled before.
550 (yyparse): Update for renames. No behavioral changes.
551 * src/tables.h: Improve comments about yypact, yytable, etc.
552 more. Most importantly, say yytable value of zero means syntax
553 error not default action.
554
1fa30307
JD
5552009-08-25 Joel E. Denny <jdenny@clemson.edu>
556
557 Fix %error-verbose for conflicts resolved by %nonassoc.
558 * NEWS (2.5): Document.
559 * data/glr.c (yyreportSyntaxError): Fix this by checking
560 yyis_table_ninf.
561 * data/yacc.c (yysyntax_error): Likewise.
562 * data/lalr1.cc (yysyntax_error_): Fix this by checking
563 yytable_ninf_.
564 * data/lalr1.java (yysyntax_error): Likewise.
565 * tests/conflicts.at (%nonassoc and eof): Update expected output
566 and remove FIXME.
567
77373efa
JD
5682009-08-25 Joel E. Denny <jdenny@clemson.edu>
569
570 Some code and documentation improvements.
571 * data/c.m4 (b4_table_value_equals): New macro to capture
572 some repeated code.
573 * data/glr.c (yyis_pact_ninf): Use it here.
574 (yyis_table_ninf): Likewise.
575 (yyreportSyntaxError): Improve internal comments.
576 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
577 Use it everywhere possible.
578 (yyis_table_ninf): Likewise.
579 (yysyntax_error): Improve internal comments.
580 * data/lalr1.cc (yysyntax_error_): Likewise.
581 * data/lalr1.java (yysyntax_error): Likewise.
582 * src/tables.h: Improve comments about yypact, yytable, etc.
583
890ab17c
JD
5842009-08-21 Joel E. Denny <jdenny@clemson.edu>
585
586 Use locale when quoting.
587 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
588 quote rather than implementing quoting here.
589
c5196098
EB
5902009-08-20 Eric Blake <ebb9@byu.net>
591
aa50ba7b
EB
592 Make previous patch more robust.
593 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
594 argmatch.h.
595 (output_skeleton): Use it.
596 Suggested by Akim Demaille.
597
c5196098
EB
598 Import latest m4/m4.m4.
599 * submodules/autoconf: Update to autoconf 2.64.
600 * configure.ac (M4_GNU_OPTION): New define.
601 * src/output.c (output_skeleton): Use it to resolve FIXME.
602 * NEWS: Mention this.
603
39fb7e62
JD
6042009-08-19 Joel E. Denny <jdenny@clemson.edu>
605
606 Fix complaints about escape sequences.
607 Discussed starting at
608 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
609 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
610 For a \0 and similar escape sequences meaning the null
611 character, report an invalid escape sequence instead of an
612 invalid null character because the latter does not actually
613 appear in the user's input.
614 In all escape sequence complaints, don't escape the initial
615 backslash, and don't quote when the sequence appears at the end
616 of the complaint line unless there's whitespace that quotearg
617 won't escape.
618 Consistently say "invalid" not "unrecognized".
619 Consistently prefer "empty character literal" over "extra
620 characters in character literal" warning for invalid escape
621 sequences; that is, consistently discard those sequences.
622 * tests/input.at (Bad escapes in literals): New.
623
c33bc800
AD
6242009-08-19 Akim Demaille <demaille@gostai.com>
625
626 doc: fixes.
627 * doc/bison.texinfo: Fix minor Texinfo errors.
628
8fbbeba2
AD
6292009-08-19 Akim Demaille <demaille@gostai.com>
630
631 doc: %initial-action to initialize yylloc.
632 Reported by Bill Allombert.
633 * doc/bison.texinfo: Set fill-column to 76.
634 (Location Type): Document the use of %initial-action to initialize
635 yylloc.
636
1874a474
JD
6372009-08-18 Joel E. Denny <jdenny@clemson.edu>
638
639 maint: update for gnulib's recent update-copyright changes
640 * gnulib: Update.
641 * .x-update-copyright (COPYING): Add as it's no longer implied
642 when .x-update-copyright is present.
643 * cfg.mk (update-copyright-local): Remove, now ignored.
644 (update-copyright): Declare update-b4-copyright as a dependency.
645
f4bfd5a9
AD
6462009-08-17 Akim Demaille <demaille@gostai.com>
647
648 build: require gettext 0.17.
649
650 Suggested by Bruno Haible.
651 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
652 * configure.ac: require gettext 0.17 to ensure compatibility with
653 gnulib.
654
2509eba6
AD
6552009-08-17 Akim Demaille <demaille@gostai.com>
656
657 build: lower gettext requirements.
658
659 Bison was uselessly requiring the formatstring macros from
660 gettext, which resulted in mo files not being installed on systems
661 that perfectly supported Bison mo files. Lower the requirement.
662 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
663
aa50ba7b
EB
664 * configure.ac: Require need-ngettext instead of
665 need-formatstring-macros.
666 Reported by Martin Jabocs.
667 Suggested by Bruno Haible.
668 * INSTALL: Restructure.
669 (Internationalization): New.
2509eba6 670
314542f9
JD
6712009-08-14 Joel E. Denny <jdenny@clemson.edu>
672
673 maint: fix use of copyright year intervals.
674 * gnulib: Update.
675 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
676 as now recommended in gnulib/NEWS.
677 * build-aux/update-b4-copyright: Fix.
678 * cfg.mk (update-copyright-env): Configure update-copyright.
679
24985964
JD
6802009-08-13 Joel E. Denny <jdenny@clemson.edu>
681
682 Make it easier to write deterministic tests.
683 Continues Akim's work from his 2009-06-10 commits.
684 * src/reader.c (check_and_convert_grammar): Don't add any
685 symbols after the first symbols_do invocation.
686 * src/symtab.c (symbols_sorted): New static global.
687 (user_token_number_redeclaration): Update comments.
688 (symbol_from_uniqstr): If a new symbol is being created, assert
689 that symbols_sorted hasn't been allocated yet.
690 (symbols_free): Free symbols_sorted.
691 (symbols_cmp, symbols_cmp_qsort): New functions.
692 (symbols_do): Sort symbol_table into symbols_sorted on first
693 invocation.
694 * tests/input.at (Numbered tokens): Recombine tests now that the
695 output should be deterministic across multiple numbers.
696
47076da5
AD
6972009-08-12 Akim Demaille <demaille@gostai.com>
698
699 distcheck: fix.
700
aa50ba7b 701 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
47076da5 702
36dfe466
JD
7032009-08-10 Joel E. Denny <jdenny@clemson.edu>
704
705 * tests/Makefile.am (TESTSUITE_AT): Add named-refs.at.
706
07c0db18
JD
7072009-08-10 Joel E. Denny <jdenny@clemson.edu>
708
709 Miscellaneous code readability improvements.
710
711 * src/reader.c (reader): Move %define front-end variable
712 defaults and checking into...
713 (prepare_percent_define_front_end_variables): ... this new
714 function.
715
716 * src/scan-gram.l (INITIAL): For consistency with string
717 literals, don't store open quote on character literal. It's
718 discarded before returning anyway.
719 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
720 Make length test more readable, and make the character stored
721 for an empty literal more obvious while consistent with the
722 previous behavior.
723
724 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
725 USER_NUMBER_HAS_STRING_ALIAS throughout.
726 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
727 that is repeated in symtab.h. Improve argument names to make it
728 clear which side of the symbol-string alias pair is which.
729 (symbol_check_alias_consistency): Improve local variable names
730 for the same purpose.
731 * src/symtab.h (struct symbol): Make comments about aliases
732 clearer.
733 (symbol_make_alias): Improve comments and argument name.
734 * src/output.c (token_definitions_output): Update for rename to
735 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
736
1a323c2f
AR
7372009-08-08 Alex Rozenman <rozenman@gmail.com>
738
739 Convert "misleading reference" messages to warnings.
740 * src/scan-code.l: New function 'show_sub_messages', more
741 factoring.
742 * tests/named-ref.at: Adjust tests.
743
38609c34
JD
7442009-08-06 Joel E. Denny <jdenny@clemson.edu>
745
746 maint: run "make update-copyright"
747
642f240e
JD
7482009-08-06 Joel E. Denny <jdenny@clemson.edu>
749
750 maint: make update-b4-copyright easier to use
751 * build-aux/update-b4-copyright: In warnings, report line
752 numbers rather than character positions.
753 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
754 that update-copyright runs it.
755 * gnulib: Update.
756
d0caad01
JD
7572009-08-05 Joel E. Denny <jdenny@clemson.edu>
758
759 maint: clean up update-b4-copyright code
760 * build-aux/update-b4-copyright: Do not accept 2-digit
761 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
762 Don't accept a `[' in a b4_copyright argument.
763 Format code more consistently.
764 Don't assume b4*copyright never occurs.
765
ac2def56
JD
7662009-08-04 Joel E. Denny <jdenny@clemson.edu>
767
768 maint: automate b4_copyright updates.
769 * Makefile.am (update-b4-copyright): New target rule.
770 * build-aux/Makefile.am (EXTRA_DIST): Add update-b4-copyright.
771 * build-aux/update-b4-copyright: New.
772 * data/yacc.c: Remove stray characters around b4_copyright
773 invocations.
774
dbbb64f0
JD
7752009-08-04 Joel E. Denny <jdenny@clemson.edu>
776
777 maint: automate annual package-wide copyright-year update.
778 * .x-update-copyright: New.
779 * Makefile.am (EXTRA_DIST): Remove maint.mk.
780 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
781 update-copyright. Remove gnumakefile, which is implied by
782 maintainer-makefile.
783 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
784 * gnulib: Update.
785 * maint.mk: Remove, now copied from gnulib.
786 * examples/extexi: Add missing "(C)" in copyright statement so
787 update-copyright can recognize it.
788 * src/LR0.h: Likewise.
789 * src/print.h: Likewise.
790 * src/print_graph.h: Likewise.
791 * src/gram.c: Add missing comma in copyright statement.
792 * src/gram.h: Likewise.
793
bfa018d4
JD
7942009-08-04 Joel E. Denny <jdenny@clemson.edu>
795
796 Fix "make distcheck".
797 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
798 of just calc.stamp.
799
4521fcdf
JD
8002009-08-01 Joel E. Denny <jdenny@clemson.edu>
801
802 Pacify "gcc -Wunused" for the input function from Flex.
803 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
804 and later.
805 * src/scan-code.l: Add "%option noinput", which I cannot find in
806 the Flex manual, but which Flex has supported since at least as
807 far back as 2.5.4. However, if any of our developers still use
808 Flex 2.5.4, they'll need to stop configuring with
809 --enable-gcc-warnings because "%option noinput" didn't work
810 correctly until Flex 2.5.6.
811 * src/scan-gram.l: Likewise.
812 * src/scan-skel.l: Likewise.
813
992e874a
AR
8142009-07-31 Alex Rozenman <rozenman@gmail.com>
815
816 Fix --enable-gcc-warnings problems.
817 * src/reader.c: Adjust variable names.
818 * src/scan-code.l: Fix prototypes and adjust names.
819 * src/named-ref.c: Remove redundant "if".
820
a1ed2b71
JD
8212009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
822
823 Fix a --enable-gcc-warnings problem.
824 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
825 variable.
826
cbc6a70e 8272009-07-24 Alex Rozenman <rozenman@gmail.com>
1e20ad11
AR
828
829 Fix some memory leaks.
830 * src/named-ref.c: Add a pointer check (named_ref_free).
831 * src/scan-code.l: New function (variant_table_free). Called in
832 code_scanner_free.
833 * src/symlist.c: Call to named_ref_free (symbol_list_free).
834
ac9b0e95
JD
8352009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
836
837 Warn about character literals not of length one.
838 * NEWS (2.5): Document.
839 * src/scan-gram.l (INITIAL): Remove comment that we don't check
840 the length.
841 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
842 * tests/input.at (Bad character literals): New test group.
843
2de160e1
JD
8442009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
845
846 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
847
cba97506
JD
8482009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
849
850 Some M4 cleanup in the testsuite.
851 Suggested by Eric Blake at
852 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
853 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
854 complicate the code by distinguishing between a missing value
855 and an empty string value for an optional argument. This fix is
856 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
857 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
858 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
859 arguments are not needed because of the following changes.
860 Fix stale comments.
861 Bison developers should use GNU M4 and should not use
862 POSIXLY_CORRECT when building the test suite, so do not
863 complicate the code by avoiding $10 and above.
864 Do not quote an empty string value for an optional argument, and
865 do not distinguish between a missing value and an empty string
866 value.
867
62eb2d1b
JD
8682009-07-21 Joel E. Denny <jdenny@ces.clemson.edu>
869
870 * m4/m4.m4: Make it a sym link to submodules/autoconf/m4/m4.m4.
871
620b2e36
JD
8722009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
873
874 Revert unnecessary column realignment in --help output.
875 Reported by Akim Demaille at
876 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
877 * src/getargs.c (usage): Here.
878
cbc6a70e 8792009-07-04 Alex Rozenman <rozenman@gmail.com>
dad6544d
AR
880
881 Alphabetical order in src/Makefile.am.
882 * src/Makefile.am: Adjust.
883
cbc6a70e 8842009-07-04 Alex Rozenman <rozenman@gmail.com>
d5e8574b
AR
885
886 Style changes and factoring.
887 * src/named-ref.h: Add comments.
888 * src/parse-gram.y: Readability and style changes.
889 * src/reader.c: Factoring: assign_named_ref function.
890 * src/scan-code.l: Factoring and style changes. Rename
891 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
892 Use "unsigned" type for variant index. Improve readablity.
893 * src/scan-gram.l: Change error messages and add comments.
894 * src/symlist.h: symbol_list_null: New function decl.
895 * src/symlist.c: symbol_list_null: Implement here.
896 * tests/named-refs.at: Adjust for new error messages.
897
ae09ec85
EB
8982009-06-29 Eric Blake <ebb9@byu.net>
899
900 scan-code: avoid compiler warnings
901 * src/scan-code.l (parse_named_ref): Use correct specifiers.
902
80d653fd
AD
9032009-06-29 Akim Demaille <demaille@gostai.com>
904
905 build: avoid concurrent extraction of calc++.
906 * examples/calc++/Makefile.am (calc.stamp): New.
907 Depend on it to create the sources of calc++ so that concurrent
908 builds don't launch several "extexi" in parallel.
909 Not only this is inefficient, this also builds incorrect sources
910 with several extractions mixed together.
911
7685e2f7
AR
9122009-06-27 Alex Rozenman <rozenman@gmail.com>
913
914 Implement support for named symbol references.
915 * src/parse-gram.y: Add new syntax (named_ref.opt).
916 * src/reader.c: Store named refs in symbol lists.
917 * src/reader.h: New argument for symbol_append and
918 action_append functions.
919 * src/scan-code.h: Add new field (named_ref) into
920 code_props data structure. Keeps named ref of midrule
921 actions.
922 * src/scan-code.l: Support for named refs in semantic
923 action code. New function 'parse_named_ref'.
924 * src/scan-gram.l: Support bracketed id.
925 * src/symlist.c: Store named refs in symbol lists.
926 * src/symlist.h: New field in symbol list: named_ref.
927 * src/named-ref.h: New file, a struct for named_ref.
928 * src/named-ref.cp: New file, named_ref_new function.
929 * src/local.mk: Add two new files.
930 * tests/testsuite.at: Include new test group:
931 * tests/named-refs.at: this new file.
932
67f8cf51
AD
9332009-06-25 Akim Demaille <demaille@gostai.com>
934
935 hash: check insertion for memory exhaustion.
936 * src/uniqstr.c (uniqstr_new): New.
937
83b66ddd
AD
9382009-06-11 Akim Demaille <demaille@gostai.com>
939
940 style changes.
941 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
942 * src/print-xml.c: Style changes.
943 * tests/conflicts.at: Comment changes.
944
517cb0ad
AD
9452009-06-11 Akim Demaille <demaille@gostai.com>
946
947 xml: beware of user strings used to give a %prec to rules.
948 * tests/conflicts.at (%prec with user strings): New.
949 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
950 XML output.
951
75c7a52a
AD
9522009-06-11 Akim Demaille <demaille@gostai.com>
953
954 hash: check insertion for memory exhaustion.
955 * src/muscle-tab.c (muscle_insert, muscle_grow)
956 * src/state.c (state_hash_insert): Check the return value of
957 hash_insert.
958
66ed9753
AD
9592009-06-10 Akim Demaille <demaille@gostai.com>
960
961 deterministic test suite.
962 Some consistency checks on symbols are performed after all the
963 symbols were read, by an iteration over the symbol table. This
964 traversal is nondeterministic, which can be a problem for test
965 cases.
966 Avoid this.
967 Addresses another form of nondeterminism reported by Joel E. Denny.
968 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
969
970 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
971 test in two.
972 Use different file names for the three tests to make the
973 maintenance easier.
974
ed15d907
AD
9752009-06-10 Akim Demaille <demaille@gostai.com>
976
95d176ff
AD
977 deterministic user-token-number redeclaration errors.
978 Address nondeterminism reported by Joel E. Denny.
979 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
980
981 * src/uniqstr.h: Comment changes.
982 * src/location.h (boundary_cmp, location_cmp): New.
983 * src/symtab.c (user_token_number_redeclaration): New.
984 (symbol_translation): Use it.
985 * tests/input.at (Numbered tokens): Adjust the expected output.
986
9872009-05-25 Akim Demaille <demaille@gostai.com>
988
ed15d907 989 gnulib: update.
aa50ba7b
EB
990 * gnulib: Update to latest.
991 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
992 * m4/.gitignore: Regen.
993 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
994 Call xalloc_die on hash_insert failures.
995 Requested by the new __warn_unused_result__ attribute of
996 hash_insert.
ed15d907 997
e3a33f7c
JD
9982009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
999
1000 Convert multiple variable definition warnings to complaints.
1001 * NEWS (2.5): Add a new entry for that change.
1002 * doc/bison.texinfo (Decl Summary): Update %define entry.
1003 (Bison Options): Update -D/--define/-F/--force-define entry.
1004 * src/muscle_tab.c (muscle_percent_define_insert): Implement.
1005 * src/muscle_tab.h (muscle_percent_define_insert): Update
1006 comments.
1007 * tests/input.at (`%define errors'): Update.
1008 (`%define, --define, --force-define'): Update.
1009
34d41938
JD
10102009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1011
1012 -F/--force-define and relative %define/-D/--define priorities.
1013 * NEWS (2.5): Add documentation to -D/--define entry.
1014 * build-aux/cross-options.pl: Hard-code association of
1015 --force-define with %define.
1016 * doc/bison.texinfo (Decl Summary): In %define entry,
1017 cross-reference command-line options.
1018 (Bison Options): Add documentation to -D/--define entry.
1019 (Option Cross Key): Widen column for --force-define row.
1020 * src/getargs.c (usage): Document -F/--force-define. Realign
1021 options in output.
1022 (short_options, long_options, getargs): Parse -F/--force-define,
1023 and update muscle_percent_define_insert invocation.
1024 * src/muscle_tab.h (muscle_percent_define_how): New enum type.
1025 (muscle_percent_define_insert): Add argument with that type.
1026 * src/muscle_tab.c (muscle_percent_define_insert): Implement
1027 -F/--force-define behavior and priorities.
1028 * src/parse-gram.y (prologue_declaration): Update
1029 muscle_percent_define_insert invocations.
1030 * tests/input.at (`%define, --define'): Rename to...
1031 (`%define, --define, --force-define'): ... this and extend.
1032
246c4efa
JD
10332009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1034
1035 Update some comments to make sense for -D.
1036 * data/bison.m4 (b4_check_user_names): In header comments, say
1037 "user occurrence" instead of "grammar occurrence".
1038 * src/muscle_tab.h (muscle_percent_define_insert): Likewise.
1039 (muscle_percent_code_grow): Likewise just for consistency.
1040
531683e7
JD
10412009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1042
1043 * data/c++.m4: Update copyright year.
1044
e7bfa8b7
JD
10452009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1046
1047 * data/c++.m4 (b4_namespace_close): Simplify slightly.
1048
8c221795
JD
10492009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
1050
1051 Handle a trailing `:' in a user-supplied C++ namespace better.
1052 * data/c++.m4 (b4_namespace_close): Don't let it be printed
1053 among the closing braces here. This fix might make the
1054 generated code easier to debug, but otherwise it should be
1055 insignificant because a trailing `:' is a C++ error already.
1056
c8bf65f0
AD
10572009-05-19 Akim Demaille <demaille@gostai.com>
1058
1059 remove useless variable.
1060 * src/getargs.c (skeleton_arg): Remove now useless variable.
1061 Should help the compiler see that this printf-like call is sane.
1062
7ac45a46
AD
10632009-05-11 Akim Demaille <demaille@gostai.com>
1064
1065 doc: use C++ headers.
1066 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
1067 headers.
1068
601bdfab
AD
10692009-05-05 Akim Demaille <demaille@gostai.com>
1070
1071 fix hexadecimal token number support.
1072 * src/scan-gram.l: Catch incorrect ids after hexadecimal numbers.
1073
d19123e6
AD
10742009-05-05 Akim Demaille <demaille@gostai.com>
1075
1076 tests: check token numbers.
1077 * tests/input.at (Numbered tokens): New.
1078
ecdfea9a
AD
10792009-05-04 Akim Demaille <demaille@gostai.com>
1080
1081 bison: catch bad symbol names.
1082 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
1083 * tests/input.at: Adjust.
1084
43e6aea5
AD
10852009-05-04 Akim Demaille <demaille@gostai.com>
1086
1087 space changes.
1088 * src/scan-gram.l: Untabify to be robust to zealous editors.
1089
c046698e
AD
10902009-05-04 Akim Demaille <demaille@gostai.com>
1091
1092 identifiers: dashes are letters.
1093 Dashes can now start identifiers (symbols and directives).
b10dd689 1094
c046698e
AD
1095 * src/scan-gram.l ({letter}): Add dash.
1096 ({id}): Remove it.
1097 * tests/input.at (Symbols): Adjust.
1098 Remove stray comment.
1099 * tests/regression.at (Invalid inputs): Adjust error message.
1100 * doc/bison.texinfo (Symbols): Update.
1101
966aba65
JD
11022009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
1103
1104 Declare %code to be a permanent feature.
1105 * NEWS (2.4.2): Here.
1106 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
1107 experimental.
1108 (Decl Summary): Likewise.
1109
812775a0
JD
11102009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1111
1112 Convert underscores to dashes in some %define variable names.
1113 For now, just api.push-pull and lr.keep-unreachable-states.
1114 Maintain old names for backward compatibility.
1115 * NEWS (2.5): Document.
1116 * data/c.m4 (b4_identification): Update comment.
1117 * data/yacc.c: Update access.
1118 * doc/bison.texinfo: Update.
1119 * etc/bench.pl.in (bench_grammar): Update use.
1120 * src/files.c (tr): Move to...
1121 * src/getargs.c, src/getargs.h (tr): ... here because I can't
1122 think of a better place to expose it. My logic is that, for all
1123 uses of tr so far, command-line arguments can be involved, and
1124 getargs.h is already included.
1125 * src/main.c (main): Update access.
1126 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
1127 variable names to new variable names before assigning value.
1128 * src/reader.c (reader): Update setting default.
1129 * tests/calc.at: Update uses.
1130 * tests/conflicts.at (Unreachable States After Conflict
1131 Resolution): Update use.
1132 * tests/input.at (%define enum variables): Update use.
1133 (%define backward compatibility): New test group.
1134 * tests/push.at: Update uses.
1135 * tests/reduce.at: Update uses.
1136 * tests/torture.at: Update uses.
1137
1c4aa81d
JD
11382009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1139
1140 Set all front-end %define defaults in one place.
1141 * src/main.c (main): Move lr.keep_unreachable_states default...
1142 * src/reader.c (reader): ... to here.
1143
1d0f55cc
JD
11442009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1145
1146 Rename lr.default_reductions to lr.default-reductions.
1147 * NEWS (2.5): Here.
1148 * doc/bison.texinfo: Here.
1149 * src/lalr.c (initialize_LA): Here.
1150 * src/print.c (print_reductions): Here.
1151 * src/reader.c (reader): Here.
1152 * src/tables.c (action_row): Here.
1153 * tests/input.at (%define enum variables): Here.
1154 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
1155
0b593457
JD
11562009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1157
1158 Pacify ./configure --enable-gcc-warnings.
1159 * tests/input.at (Symbols): Prototype yyerror and yylex.
1160
0939aa2d
AD
11612009-04-21 Akim Demaille <demaille@gostai.com>
1162
1163 tests: check the use of dashes and periods in symbols.
1164 * tests/input.at (Symbol): New test group.
1165
0b593457 11662009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
ae618dcc
JD
1167
1168 Document how `%define "var" "value"' is not M4-friendly.
1169 * src/parse-gram.y (variable): In comments here.
1170
0b593457 11712009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
6789b8bd
JD
1172
1173 Add copyright updates missed during previous cherry pick.
1174 * src/output.c: Here.
1175 * src/parse-gram.y: Here.
1176 * src/scan-gram.l: Here.
1177
663ce7bb
AD
11782009-04-20 Akim Demaille <demaille@gostai.com>
1179
1180 variables: accept dashes.
1181 * src/scan-gram.l ({id}): Also accept dashes after the initial
1182 letter.
1183 ({directive}): Use {id}.
1184 * src/parse-gram.y: Comment and formatting changes.
1185 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
1186 symbols.
1187 * src/complain.h, src/complain.c (yacc_at): New.
1188 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
1189 symbol names.
1190 * src/output.c (token_definitions_output): Do not #define token
1191 names with dashes.
1192
379261b3
JD
11932009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1194
1195 Clean up recent patches a little.
1196 Reported by Akim Demaille.
1197 * doc/bison.texinfo (Understanding): Fix typos.
1198 * src/print.c (print_reductions): Don't use negated variable.
1199
25029e16
JD
12002009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1201
1202 List accepted values for a %define enum variable with an invalid value.
1203 Suggested by Akim Demaille at
1204 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
1205 * data/bison.m4 (_b4_percent_define_check_values): Implement.
1206 * src/muscle_tab.c (muscle_percent_define_check_values): Implement.
1207 * tests/input.at (%define lr.default_reductions invalid values): Merge
1208 into...
1209 (%define enum variables): ... here, and update output.
1210
620b5727
JD
12112009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
1212
1213 Rename "default rule" to "default reduction".
1214 This includes changing variable names in code, changing
1215 comments, and renaming %define lr.default_rules to %define
1216 lr.default_reductions.
1217 * NEWS (2.5): Update IELR documentation.
1218 * data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c:
1219 Adjust YYDEFACT and yydefact_ documentation.
1220 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
1221 and lr.type documentation. Make some other wording
1222 improvements.
1223 (Glossary): Adjust cross-references and Default Reduction
1224 definition.
1225 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
1226 Remove a confusing comment pointed out by Akim Demaille.
1227 (initialize_LA): Adjust code.
1228 * src/print-xml.c (print_reductions): Adjust code.
1229 * src/print.c (print_reductions): Adjust code.
1230 * src/reader.c (reader): Adjust code.
1231 * src/tables.c (action_row): Adjust code.
1232 (token_actions): Adjust code.
1233 * src/tables.h: Adjust YYDEFACT documentation.
1234 * tests/input.at (%define lr.default_rules invalid values):
1235 Rename test group to...
1236 (%define lr.default_reductions invalid values): ... this, and
1237 update grammar file and expected output.
1238 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
1239 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
1240
34a6c2d1
JD
12412009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1242
1243 Document %define lr.type and lr.default_rules.
1244 * NEWS (2.5): Add an entry.
1245 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
1246 besides just LALR(1) and GLR(1).
1247 * doc/bison.texinfo (Introduction): Likewise.
1248 (Language and Grammar): Bison is no longer limited to LALR(1)
1249 restrictions.
1250 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
1251 when trying to distinguish from GLR. Talk about LR(1) grammars
1252 rather than LALR(1) grammars.
1253 (Decl Summary): In %define api.push_pull entry, say it applies
1254 to deterministic parsers in C rather than LALR(1) parsers in C.
1255 Add lr.default_rules entry.
1256 Add lr.type entry.
1257 (Mystery Conflicts): Bison is no longer limited to LALR(1)
1258 restrictions.
1259 (Generalized LR Parsing): Same changes as for the previous GLR
1260 section.
1261 (Memory Management): Say deterministic rather than LALR(1).
1262 (Understanding): Correct some bison output.
1263 Index discussion of "accepting state".
1264 Say deterministic rather than LALR(1).
1265 (Bison Options): In --yacc entry, say deterministic rather than
1266 LALR(1).
1267 In --report, --graph, and --xml entries, just don't mention
1268 LALR(1).
1269 (C++ Parsers): Say deterministic rather than LALR(1).
1270 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
1271 (Glossary): Add Accepting State, Consistent State, Default Rule,
1272 and IELR(1) definitions.
1273 In Generalized LR (GLR) definition, make same changes as in
1274 previous GLR sections.
1275 In LALR(1) definition, say Bison uses LALR(1) by default rather
1276 than implying Bison is limited to LALR(1).
1277 (LocalWords): Add IELR.
1278
f805dfcb
JD
12792009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1280
1281 Finish implementing %define lr.type.
1282 Its value can be "LALR", "IELR", or "canonical LR".
1283 * lib/timevar.def (TV_IELR_PHASE1): New var.
1284 (TV_IELR_PHASE2): New var.
1285 (TV_IELR_PHASE3): New var.
1286 (TV_IELR_PHASE4): New var.
1287 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
1288 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
1289 Sbitset.h, ielr.h, and ielr.c.
1290 * src/getargs.h, src/getargs.c (enum trace, trace_args,
1291 trace_types): Add trace_ielr.
1292 * src/lalr.h, src/lalr.c (ngotos): Export it.
1293 (F): Rename to...
1294 (goto_follows): ... this, update all uses, and export it.
1295 (set_goto_map): Export it.
1296 (map_goto): Export it.
1297 (compute_lookahead_tokens): Don't free goto_follows yet. Now
1298 handled in ielr.
1299 (initialize_LA): Export it. Move lookback allocation to...
1300 (lalr): ... here because, for canonical LR, initialize_LA must
1301 be invoked but lookback and much of the rest of LALR isn't
1302 needed.
1303 * main.c (main): Instead of lalr, invoke ielr, which invokes
1304 lalr.
1305 * src/reader.c (reader): Default lr.type to "LALR".
1306 Default lr.default_rules to "accepting" if lr.type is "canonical
1307 LR". Leave the default as "all" otherwise.
1308 Check for a valid lr.type value.
1309 * src/state.h, src/state.c (struct state_list): Add state_list
1310 member.
1311 (state_new): Initialize state_list member to NULL.
1312 (state_new_isocore): New function, exported.
1313 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
1314 exercises all values of lr.type.
1315 (GNU AWK Grammar): Rename test group to...
1316 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
1317 AT_TEST_EXISTING_GRAMMAR.
1318 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
1319 (GNU pic Grammar): Rename test group to...
1320 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
1321 AT_TEST_EXISTING_GRAMMAR.
1322 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
1323 all values of lr.type.
1324 (Single State Split): New test groups using AT_TEST_LR_TYPE.
1325 (Lane Split): Likewise.
1326 (Complex Lane Split): Likewise.
1327 (Split During Added Lookahead Propagation): Likewise.
1328
166366b2
JD
13292009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1330
1331 Add new files for IELR and canonical LR implementation.
1332 * src/AnnotationList.c: New.
1333 * src/AnnotationList.h: New.
1334 * src/InadequacyList.c: New.
1335 * src/InadequacyList.h: New.
1336 * src/Sbitset.c: New.
1337 * src/Sbitset.h: New.
1338 * src/ielr.c: New.
1339 * src/ielr.h: New.
1340
03c07b03
JD
13412009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1342
1343 Implement %define lr.default_rules.
1344 Its value describes the states that are permitted to contain
1345 default rules: "all", "consistent", or "accepting".
1346 * src/reader.c (reader): Default lr.default_rules to "all".
1347 Check for a valid lr.default_rules value.
1348 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
1349 is "accepting", then only mark the accepting state as
1350 consistent.
1351 (initialize_LA): Tell state_lookahead_tokens_count whether
1352 lr.default_rules is "accepting".
1353 * src/tables.c (action_row): If lr.default_rules is not "all",
1354 then disable default rules in inconsistent states.
1355 * src/print.c (print_reductions): Use this opportunity to
1356 perform some assertions about whether lr.default_rules was
1357 obeyed correctly.
1358 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
1359 helps with checking the parser tables for a grammar.
1360 * tests/input.at (%define lr.default_rules invalid values): New
1361 test group.
1362 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
1363 AT_TEST_TABLES_AND_PARSE.
1364 (`no %define lr.default_rules'): New test group generated by
1365 AT_TEST_LR_DEFAULT_RULES.
1366 (`%define lr.default_rules "all"'): Likewise.
1367 (`%define lr.default_rules "consistent"'): Likewise.
1368 (`%define lr.default_rules "accepting"'): Likewise.
1369
44c124a3
AD
13702009-04-20 Akim Demaille <demaille@gostai.com>
1371
1372 Consistently refer to Yacc, not YACC.
1373 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
1374
42660736
JD
13752009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
1376
1377 Pacify make maintainer-check-posix.
1378 * tests/input.at (%define, --define): Move bison command-line
1379 options before grammar file name.
1380
a2d05674
JD
13812009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1382
1383 Document semicolon warnings.
1384 * NEWS (2.5): Here.
1385
c4fae1ef
AD
13862008-12-08 Akim Demaille <demaille@gostai.com>
1387
1388 Fix portability issue in the test suite.
1389 * tests/local.at (AT_MATCHES_CHECK): New.
1390 Based on Perl instead of Sed. Sed has too many portability
1391 pitfalls, not ever Sed is GNU Sed.
1392 * tests/actions.at (Fix user actions without a trailing semicolon):
1393 Use it.
1394
42f4393a
DJ
13952008-12-07 Di-an Jan <dianj@freeshell.org>
1396
1397 Implement the FIXME that ends an user action with a semicolon
1398 if it seems necessary.
1399 * src/scan-code.l (flex rules section): Flag cpp directive from
1400 any `#' to the first unescaped end-of-line. Semicolon is not
1401 needed after `;', `{', '}', or cpp directives and is needed after
1402 any other token (whitespaces and comments have no effect).
1403 * tests/actions.at (Fix user actions without a trailing semicolon):
1404 New test.
1405 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
1406 to make user actions complete statements.
1407 Adjust column numbers in error messages.
1408 * tests/regression.at (Fix user actions without a trailing semicolon):
1409 Remove. Covered by new test.
1410
bd5df716
AD
14112009-04-14 Akim Demaille <demaille@gostai.com>
1412
1413 doc: minor fixes.
1414 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
1415 (Table of Symbols): Remove duplicate entry for %debug.
1416
7ba0d59d
EB
14172009-04-10 Eric Blake <ebb9@byu.net>
1418
1419 submodules: update to latest
1420 * submodules/autoconf: Use latest upstream Autoconf.
1421
b4d71a96
EB
14222009-04-06 Eric Blake <ebb9@byu.net>
1423
1424 Work around autoconf 2.63b bug in testsuite.
1425 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
1426 autoconf bug related to # in test.
1427
4ecd3681
JD
14282009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1429
1430 * NEWS (2.5): Describe new -D/--define feature.
1431
c65e5292
AD
14322008-11-10 Akim Demaille <demaille@gostai.com>
1433
1434 --trace=muscles
1435 * src/getargs.h, src/getargs.c (trace_muscle): New.
1436 (trace_types, trace_args): Support it.
1437 * src/output.c (output_skeleton): Use it.
1438
96002de2
AD
14392008-11-10 Akim Demaille <demaille@gostai.com>
1440
1441 muscles_output.
1442 * src/output.c (muscles_output): New, extracted from...
1443 (output_skeleton): here.
1444 Adjust.
1445
fadb13b5
AD
14462008-11-21 Akim Demaille <demaille@gostai.com>
1447
1448 Display the changes in cross-options.texi.
1449 * build-aux/cross-options.pl ($sep): New, to separate items.
1450 * doc/Makefile.am ($(srcdir)/cross-options.texi): Use diff to display
1451 the changes.
1452
72183df4
DJ
14532008-11-20 Di-an Jan <dianj@freeshell.org>
1454
1455 Improves options in the manual.
1456 * doc/bison.texinfo (-g, -x): Add space before argument.
1457 (Option Cross Key): Implement FIXME: listing directives also.
1458 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
1459 (Short Option): Special case -d. Put arguments inside @option.
fadb13b5 1460 (Bison Directive): Add column, automatically extracted from
72183df4
DJ
1461 src/scan-gram.l (actual name passed as the first argument)
1462 with special case for %define.
1463 * doc/Makefile.am (doc/cross-options.texi): Pass src/scan-gram.l
1464 to build-aux/cross-options.pl.
1465 * src/getargs.c (usage): Document limitations of cross-options.pl.
1466 * src/scan-gram.l: Likewise.
1467
e80b068c
AD
14682009-02-25 Akim Demaille <demaille@gostai.com>
1469
1470 Copyright years.
1471 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
1472
e3ee30b8
AD
14732008-12-08 Akim Demaille <demaille@gostai.com>
1474
1475 Install autoconf as a submodule to get m4sugar.
1476 * .gitmodules: Add submodules/autoconf.
1477 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
1478 submodules/autoconf.
1479
c4eb1e84
JD
14802008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1481
1482 Simplify last patch slightly.
1483 * src/getargs.c (getargs): Here.
1484
10fa0146
JD
14852008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1486
1487 Fix last warning from --enable-gcc-warnings.
1488 * src/getargs.c (getargs): Don't assign const address to non-const
1489 pointer.
1490
6f5be1ab
DJ
14912008-11-17 Di-an Jan <dianj@freeshell.org>
1492
1493 Handle --enable-gcc-warnings.
1494 * src/getargs.c (command_line_location): Set parameters to void.
1495
11c4e57d
AD
14962008-11-11 Akim Demaille <demaille@gostai.com>
1497
1498 AT_FULL_COMPILE.
1499 * tests/actions.at, tests/regression.at: Use it.
1500
e186a284
AD
15012008-11-07 Akim Demaille <demaille@gostai.com>
1502
1503 Pass command line location to skeleton_arg and language_argmatch.
1504 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
1505 The location argument is now mandatory.
1506 Adjust all dependencies.
1507 (getargs): Use command_line_location.
1508
e14c6831
AD
15092008-11-07 Akim Demaille <demaille@gostai.com>
1510
1511 -D, --define.
1512 * src/getargs.c (usage): Document -D.
1513 Fix help string for --locations.
1514 (command_line_location): New.
1515 (short_options, long_options, getargs): Support -D, --define.
1516 (getargs): Move -d support at the right place.
1517 * doc/bison.texinfo (Bison Options): Update.
1518 * tests/input.at (%define, --define): New.
1519
75c21b61
AD
15202008-11-07 Akim Demaille <demaille@gostai.com>
1521
1522 Initialize the muscle table before parsing the command line.
1523 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
1524 (getargs): Define file_name.
1525 * src/main.c (main): Initialize muscle_tab before calling
1526 getargs.
1527 * src/muscle_tab.c (muscle_init): No longer define file_name, as
1528 its value is not available yet.
1529
33d2a860
AD
15302008-11-09 Akim Demaille <demaille@gostai.com>
1531
1532 Require the generation of parse-gram.output.
1533 * src/Makefile.am (YACC): Pass --report=all.
1534
006faedf
JD
15352009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1536
1537 * NEWS (2.5): New stub.
1538
ecd1b61c
JD
15392009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1540
1541 Fix options documentation.
1542 * build-aux/cross-options.pl: As in --help output, write optional
1543 arguments as [=ARG] not =[ARG].
1544 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
1545
f67c4037
AD
15462008-11-07 Akim Demaille <demaille@gostai.com>
1547
1548 Fix --help.
1549 * src/getargs.c (usage): Fix help string for -W.
1550
0213d651
AD
15512008-11-07 Akim Demaille <demaille@gostai.com>
1552
1553 Handle more general types of option arguments.
1554 * build-aux/cross-options.pl: The argument ends at the first
1555 space, not the first non-symbol character.
1556 Use @var for each word appearing the argument description.
1557
c19178bf
JD
15582009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1559
1560 Remove spurious initial empty lines.
1561 * data/location.cc: End the @output lines with an @.
1562
0d2b2ab0
AD
15632008-11-04 Akim Demaille <demaille@gostai.com>
1564
1565 Remove spurious initial empty lines.
1566 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1567 * data/yacc.c: End the @output lines with an @.
1568
8ba62e3e
JD
15692009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1570
1571 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
1572 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
1573 requirements for a correct m4 are stricter.
1574 * m4/m4.m4: Replace with Autoconf 2.63's m4/m4.m4.
1575 * configure.ac: Update to use AC_PROG_GNU_M4.
1576 Reported by Eric Blake.
1577
5bc993d9
JD
15782009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1579
1580 Help with updating web manual.
1581 * HACKING: Incorporate instructions from gnulib/doc/README.
1582 * bootstrap.conf (gnulib_modules): Add gendocs.
1583
580c075d
JD
15842009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1585
1586 Fix strange %define locations for default values.
1587 Reported by Akim Demaille at
1588 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
1589 and discussed again starting at
1590 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
1591 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
1592 because location information is bogus.
1593 Use angle brackets to delimit fake file name because square brackets
1594 look like underexpanded m4. Choose a better fake file name.
1595 Use negative line numbers.
1596 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
1597 * src/location.c (location_print): If line for a boundary is negative,
1598 only print that boundary's file name.
1599 * src/location.h: Document that.
1600 * tests/skeletons.at (%define Boolean variables: invalid skeleton
1601 defaults): Update output.
1602
5d3a1ecb
AD
16032008-11-07 Akim Demaille <demaille@gostai.com>
1604
1605 Locations without columns for command line arguments.
1606 * src/location.c (location_print): Don't display negative columns.
1607 * src/location.h: Document this.
1608
015e86a7
JD
16092009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
1610
1611 Add reminder about uploading public key to keys.gnupg.net.
1612 * HACKING (Release Procedure): Here.
1613
c1455bab
AD
16142009-03-31 Akim Demaille <demaille@gostai.com>
1615
1616 bootstrap: --help to stdout.
1617 * bootstrap (usage): Don't send --help to stderr.
1618 Use a here doc instead of a long string.
1619
2075a82a
AD
16202009-03-31 Akim Demaille <demaille@gostai.com>
1621
1622 bootstrap: README-hacking no longer exists
1623 * bootstrap (checkout_only_file): Set to HACKING.
1624
26fccd4d
AD
16252009-03-26 Akim Demaille <demaille@gostai.com>
1626
1627 doc: merge HACKING and README-hacking.
1628 Two files is confusing.
1629 Reported by Alexandre Duret-Lutz.
5bc993d9 1630
26fccd4d
AD
1631 * README-hacking: Merge into...
1632 * HACKING (Working from the repository): here.
1633
6469c4d7
AD
16342009-03-26 Akim Demaille <demaille@gostai.com>
1635
1636 doc: update README-hacking.
1637 * README-hacking: We now use git and git submodules.
1638 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
1639
b328890a
AD
16402009-03-26 Akim Demaille <demaille@gostai.com>
1641
1642 lalr1.cc: avoid GCC 4.3 warnings.
1643 GCC 4.3 now warns about "a || b && c" and asks for explicit
1644 parentheses.
1645 Reported by Alexandre Duret-Lutz.
1646 * data/location.cc: Update copyright years.
1647 (Position::operator==): Use parens to make precedence explicit.
1648 Compare lines and columns first, as they are more likely to be
1649 different, and they are faster to compare.
1650
f3079439
AD
16512009-03-26 Akim Demaille <demaille@gostai.com>
1652
1653 gnulib: update.
1654 * gnulib: Update to latest.
1655 * lib/Makefile.am (AM_CPPFLAGS): It is now defined by gnulib, so
1656 use +=.
1657
8defe11b
AD
16582009-01-08 Akim Demaille <demaille@gostai.com>
1659
1660 Fix grep portability issues.
1661 Grep on Solaris does not support -q.
1662 Reported by Summum Bonum.
5bc993d9 1663
8defe11b
AD
1664 * NEWS: Add a stub for 2.4.2.
1665 * THANKS: Add Summum Bonum.
1666 * tests/atlocal.in (EGREP): New.
1667 (CC, CXX, XSLTPROC): Make it possible to override them via
1668 envvars.
1669 * tests/java.at: Use $EGREP instead of egrep.
1670 Use AT_CHECK's ignore instead of grep's -q.
1671
41930e7a
JD
16722008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1673
1674 Version 2.4.1.
1675 * NEWS: Set version and date.
1676 * lib/Makefile.am: Update copyright year.
1677 * tests/atlocal.in: Update copyright year.
1678
d07932ef
JD
16792008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1680
1681 Semicolon feature removal is not about future language support.
1682 * NEWS: The semicolon feature is no longer active for newer languages,
1683 so don't claim that it causes trouble for them.
1684
0364b334
JD
16852008-12-11 Joel E. Denny <jdenny@ces.clemson.edu>
1686
1687 * gnulib: Update submodule to HEAD.
1688
876fd835
AD
16892008-12-09 Akim Demaille <demaille@gostai.com>
1690
1691 Update data/README.
1692 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
1693
bee1df15
EB
16942008-12-05 Eric Blake <ebb9@byu.net>
1695
1696 Build testsuite with newer autoconf.
1697 * tests/output.at (m4_expand): Don't override in newer autoconf,
1698 where the underlying implementation changed.
1699 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
1700 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
1701 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
1702 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
1703 since some of them contain unbalanced ')'.
1704
7e6d1e22
JD
17052008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
1706
1707 * NEWS: Clarify a little.
1708
a957d06c
JD
17092008-11-19 Joel E. Denny <jdenny@ces.clemson.edu>
1710
1711 * NEWS: Update for recent changes.
1712
462503f8
JD
17132008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1714
1715 Fix unexpanded macros in GLR defines file.
1716 Reported by Csaba Raduly at
1717 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
1718 * THANKS (Csaba Raduly): Add.
1719 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
1720 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
1721 lexer in a separate module that includes the defines file.
1722 (AT_CHECK_CALC): Use AT_FULL_COMPILE and request compilation of lexer
1723 source.
1724 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
1725 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
1726 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
1727 (AT_DATA_SOURCE_PROLOGUE): New.
1728 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
1729 (AT_DATA_SOURCE): New.
1730 (AT_FULL_COMPILE): New, copied from master branch and extended to
1731 support an additional source file.
1732
bf151b75
JD
17332008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1734
1735 Don't let maintainer-*-check targets force a version update.
1736 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
1737 handled.
1738
f56274a8
DJ
17392008-11-17 Di-an Jan <dianj@freeshell.org>
1740
1741 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
1742 Align menus. Adjust word wrapping. Use node names for menu names.
1743 (Examples): Don't abbreviate node names.
1744 (LocalWords): Remove abbreviations.
1745 (Copying): Make description a sentence.
bf151b75 1746 (Java Action Features): Remove period to match the rest of menu.
f56274a8 1747
b5775a81
PB
17482008-11-11 Paolo Bonzini <bonzini@gnu.org>
1749
1750 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
1751 * configure.ac: Adjust usage.
1752 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1753 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
1754 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
1755
7ed73f82
JD
17562008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1757
1758 Don't add a semicolon to actions for %skeleton or %language.
1759 It breaks Java test cases as reported by Akim Demaille.
1760 * src/scan-code.l: Implement.
1761
4b1ebc49
JD
17622008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
1763
1764 Clean up %skeleton and %language priority implementation.
1765 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
1766 remove static qualifier because others will soon need to see it.
1767 (language_prio): Likewise.
1768 (getargs): Use command_line_prio rather than 0.
1769 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
1770 enum fields.
1771 (skeleton_prio): Extern it.
1772 (language_prio): Extern it.
1773 * src/parse-gram.y: Use grammar_prio rather than 1.
1774
738cde3e
AD
17752008-11-04 Akim Demaille <demaille@gostai.com>
1776
1777 * NEWS: Mention the trailing semicolon in action.
1778
d6fb461d
AD
17792008-11-04 Akim Demaille <demaille@gostai.com>
1780
1781 Reformat NEWS.
1782 * NEWS: Use more outline-mode markup.
1783 Suggested by Jim Meyering.
1784
14da0cdd
JD
17852008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
1786
1787 Fix user actions without a trailing semicolon.
1788 Reported by Sergei Steshenko at
1789 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
1790 * THANKS (Sergei Steshenko): Add.
1791 * src/scan-code.l (SC_RULE_ACTION): Fix it.
1792 * tests/regression.at (Fix user actions without a trailing semicolon):
1793 New test case.
1794
c9ba9e59
JD
17952008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1796
1797 Initiate further development.
1798 * NEWS: Create an empty section for new entries.
1799 * gnulib: Update submodule to HEAD.
1800
bfb40910
JD
18012008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1802
1803 * NEWS: Version 2.4.
1804
241fda7a
JD
18052008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1806
1807 Prepare for next release.
1808 * NEWS: Briefly mention changes since 2.3b.
1809 * README: Say GNU m4 1.4.6, which we've been requiring in release
1810 announcements already, not 1.4.3, which breaks the build.
1811
ed4d67dc
JD
18122008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
1813
1814 Say %language is experimental.
1815 We're thinking of extending it's effect on output file naming. See the
1816 thread at
1817 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
1818 * NEWS: Say it's experimental.
1819 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
1820 recommend it over %skeleton for now.
1821 (Bison Options): Likewise.
1822 (C++ Bison Interface): Use %skeleton not %language.
1823 (Calc++ Parser): Use %skeleton not %language.
1824 * src/getargs.c (usage): Say it's experimental.
1825
e254a580
DJ
18262008-11-01 Di-an Jan <dianj@freeshell.org>
1827 Paolo Bonzini <bonzini@gnu.org>
1828
1829 Support all Java parser class modifiers.
1830 * data/java.m4 (b4_percent_define_get3): New.
1831 (b4_final_if, b4_strictfp_if): New.
1832 * data/lalr1.java (final, strictfp, extends, implements): Support.
1833 * doc/bison.texinfo (final, strictfp, extends, implements): Add
1834 documentation.
1835 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
1836 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
1837 (AT_CHECK_JAVA_GREP): New.
1838 (Java parser class modifiers): New test.
1839 (Java parser class extends and implements): New test.
1840
1841 Model exception propagation better with throws and lex_throws.
1842 * data/java.m4 (b4_list2): New.
1843 (throws): Change default.
1844 * data/lalr1.java (yyaction): Add throws.
1845 (parse): Add lex_throws in addition to throws.
1846 * doc/bison.texinfo (throws, lex_throws): Add documentation.
1847 * tests/java.at (Java throws specifications): New test.
1848
1849 Improve documentation for Java parsers.
1850 * doc/bison.texinfo (Java Parsers): Add subsections.
1851 Don't quote first argument of %define.
1852 (Java Bison Interface): Document output files. Move documentation
1853 of parser class and merge into Java Parser Interface. Document
1854 features that error out. Document directives with no effect.
1855 Move note about Javadoc higher.
1856 (Java Semantic Values): Explicitly mention stype.
1857 Document that generic types cannot be used.
1858 (Java Location Values): Use @deftypeivar. Document constructors.
1859 Correct return value for toString.
1860 (Java Parser Interface): List undocumented constants/fields.
1861 Move documentation of fields added by %parse-param closer to list
1862 of members. Document that token names are added as fields.
1863 Document constructors accurately. Remove error method.
1864 (Java Scanner Interface): Move note on %pure-parser to Java Bison
1865 Interface. Describe %code lexer and yylex accutately.
1866 Remove documentation that does not match the code.
1867 (Java Action Features): New.
1868 (Java Differences): Add reference. Add item on semantic values.
1869 Add note about @{ ... @}. Clarify %% epilogue placement.
1870 (Java Declarations Summary): New.
1871
1872 Fix Java skeleton.
1873 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
1874 (b4_remove_comma): Quote test argument.
1875 (b4_identification): Remove "bison" field.
1876 * tests/java.at (Java parser class and package names): New test.
1877 (Java %parse-param and %lex-param): New test.
1878 (Java stype, position_class and location_class): New test.
1879
f259e4e6
PB
18802008-10-31 Di-an Jan <dianj@freeshell.org>
1881
1882 * data/lalr1.jave: Update copyright years.
1883 (YYParser): Correct name of "generated from" file in Javadoc:
1884 use b4_file_name instead of @ofile@.
1885 (Location constructor): Correct Javadoc parameter name.
1886 (yylloc): Add missing opening m4 quote after b4_location_if.
1887 This removes a stray [ in the Javadoc of Lexer.getStartPos.
1888 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
1889 (YYParser constructor): Correct Javadoc parameter name.
1890
cae5057f
JD
18912008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
1892
1893 Always put auxiliary code files in the same dir as other output files.
1894 * src/files.c (compute_file_name_parts): When the user specifies
1895 --output but not --file-prefix, extract the directory prefix from the
1896 file prefix not from the grammar file name. This affects the location
1897 of files like location.hh generated by the C++ skeleton. The includes
1898 in the other output files require this fix.
1899 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
1900 for expected output files.
1901 (Output files): Add a test for the above.
1902
4af432ba
JD
19032008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
1904
1905 * gnulib: Update submodule to HEAD.
1906
e26d4e43
JD
19072008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
1908
1909 Update copyright year.
1910 * src/files.c: Here.
1911
c0ee9e21
DJ
19122008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
1913
1914 Don't overwrite the input file.
1915 * src/files.c (output_file_name_check): Fatal error if using input file
1916 for output.
1917 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
1918 argument.
1919 (Conflicting output files): Add test.
1920
482dc52f
AD
19212008-10-28 Akim Demaille <demaille@gostai.com>
1922
1923 Space changes.
1924 * data/lalr1.cc: Formatting changes.
1925
52cbbe84
AD
19262008-10-28 Akim Demaille <demaille@gostai.com>
1927
1928 Don't define debugging functions when !YYDEBUG.
1929 * data/lalr1.cc (debug_stream, set_debug_stream)
1930 (debug_level_type, debug_level, set_debug_level): Don't
1931 declare them when YYDEBUG is not defined.
1932 The implementation are already YYDEBUG-aware.
1933
0925d5bf
AD
19342008-10-28 Akim Demaille <demaille@gostai.com>
1935
1936 Prefer "continue" for empty loop bodies.
1937 * etc/bench.pl.in: Use "continue" instead of {}.
1938
cf98343c
AD
19392008-10-28 Akim Demaille <demaille@gostai.com>
1940
1941 Space and comments changes.
1942 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
1943 * data/c.m4, data/lalr1.cc: Space changes.
1944
9f467b7d
AD
19452008-10-28 Akim Demaille <demaille@gostai.com>
1946
1947 Make gnulib a submodule.
1948 * gnulib: New.
1949 * .gitmodules (gnulib): New.
1950
0f0e1ace
JD
19512008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1952
1953 Fix yyerror_range for user-defined location type in C++. Reported by
1954 Georg Sauthoff at
1955 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
1956 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
1957 * THANKS (Georg Sauthoff): Add.
1958
548e2104
JD
19592008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
1960
1961 Update several administrative files mainly to facilitate releasing.
1962 * HACKING (Administrivia): Make the git-merge-changelog notes more
1963 helpful.
1964 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
1965 (Release Procedure): Update for git and add numerous details that were
1966 previously missing.
1967 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
1968 * maint.mk (announcement): Don't list bison as a bootstrap tool so
1969 that announcements don't claim we bootstrapped with whatever bison
1970 happened to be in PATH. Add flex as a bootstrap tool.
1971 * Makefile.maint: Remove, previously replaced by maint.mk.
1972 * Makefile.cfg: Remove, and migrate settings to...
1973 * cfg.mk: ... here for the sake of `make announcement'.
1974 * bootstrap.conf (gnulib_modules): Add announce-gen.
1975 * README: Say GNU Bison instead of just Bison. Suggested by Karl
1976 Berry.
1977
ddf17a6e
PB
19782008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
1979
1980 Small but important bugfixes for the Java skeleton.
1981 * data/lalr1.java (yyerror): Change Location to b4_location_type.
1982 (yy_symbol_print): Call toString on yyvaluep.
1983
e1145ad8
AD
19842008-08-29 Akim Demaille <demaille@gostai.com>
1985
1986 Clarify UPDATED use.
bee1df15 1987 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 1988 not to the release date of Bison.
bee1df15 1989 Reported by Joel E. Denny.
e1145ad8 1990
0df72d78
AD
19912008-08-29 Akim Demaille <demaille@gostai.com>
1992
1993 * README: Update FAQ pointer.
1994 Reported by Joel E. Denny.
1995
9a90b6bb
EB
19962008-08-27 Eric Blake <ebb9@byu.net>
1997
1998 Resync m4sugar from autoconf.
1999 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
2000 (m4_init): Adjust to latest m4.git changes.
2001 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
2002 effects.
2003 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
2004 (_m4_list_cmp): Reduce side effects.
2005
65015668
AD
20062008-08-27 Akim Demaille <demaille@gostai.com>
2007
2008 Check yyerrok in calc.at.
bee1df15
EB
2009 * tests/calc.at (calc.y): Use yyerrok on "( error )".
2010 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
2011 expected.
65015668 2012
98e26a92
AD
20132008-08-27 Akim Demaille <demaille@gostai.com>
2014
2015 Support yyerrok in lalr1.cc.
2016 YYBACKUP is still to import back into lalr1.cc.
bee1df15 2017 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 2018
86c0e784
JD
20192008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
2020
2021 For maintainer-check*, don't recompile for a $(VERSION) update.
2022 * cfg.mk: New file.
2023 (_is-dist-target): Override the one in GNUmakefile.
2024 * Makefile.am (EXTRA_DIST): Add cfg.mk.
2025
88511166
JD
20262008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
2027
2028 Update for recent change to gnulib.
2029 * src/parse-gram.y: Don't include strverscmp.h. It comes from
2030 string.h now.
2031
6bbb2ed5
EB
20322008-08-15 Eric Blake <ebb9@byu.net>
2033
d67c52e8
EB
2034 Remaining m4sugar merge from autoconf.
2035 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
2036 * data/m4sugar/foreach.m4: New file, copied from autoconf.
2037 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
2038 * src/output.c (output_skeleton): Tell m4 how to find it.
2039
6bbb2ed5
EB
2040 Partial m4sugar merge from autoconf: m4_map.
2041 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
2042 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
2043 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
2044 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
2045 for empty list.
2046 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
2047 Likewise.
2048 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
2049 declares it.
2050
8dce3875
JD
20512008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
2052
2053 Keep .version and PACKAGE_VERSION in sync.
2054 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
2055 dependency, and add comments justifying this in more detail. Discussed
2056 starting at
2057 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
2058
882a1fbf
EB
20592008-08-06 Eric Blake <ebb9@byu.net>
2060
a3764451
EB
2061 Partial m4sugar merge from autoconf: m4_shiftn.
2062 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
2063 (m4_shift2, m4_shift3): New macros.
2064 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
2065 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
2066 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
2067 * data/java.m4 (b4_remove_comma): Likewise.
2068
882a1fbf
EB
2069 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
2070 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
2071 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
2072 (m4_init): Consolidate wrapped text into single m4_wrap.
2073 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
2074 in wrapped text.
2075
a30e920d
EB
20762008-08-05 Eric Blake <ebb9@byu.net>
2077
dfcc5959
EB
2078 Partial m4sugar merge from autoconf: builtins, version.m4.
2079 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
2080 (m4_prepend): Remove, as it is unused and inherently quadratic,
2081 whereas m4_append is linear in newer m4.
2082 (m4_mkstemp): New builtin.
2083 (m4_symbols): Make rename conditional.
2084 (m4_version_prereq): Ensure fatal error if used in bison, which
2085 intentionally lacks version.m4.
2086
a30e920d
EB
2087 Fix comments in m4sugar.
2088 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
2089
445b7470
JD
20902008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
2091
2092 Update for recent .gitignore fix in Gnulib.
2093 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
2094 anchored .gitignore entries.
2095
a1e50014
JD
20962008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
2097
2098 Set gnu or gnits strictness.
2099 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
2100 development and gnits strictness for releases. Based on Eric Blake's
2101 suggestion at
2102 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
2103
d43f77e7
PB
21042008-07-31 Paolo Bonzini <bonzini@gnu.org>
2105
2106 * NEWS: Clarify documentation of %language.
2107
fee2ed87
PB
21082008-07-31 Paolo Bonzini <bonzini@gnu.org>
2109
2110 Support usage of git-merge-changelog.
2111 * .gitattributes: New.
2112 * HACKING: Document usage of git-merge-changelog.
2113 * bootstrap: Install git-merge-changelog entries in .git/config
2114 if appropriate.
2115
78029cd5
JD
21162008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2117
2118 Remove remaining dependence on CVS Id keyword.
2119 * ChangeLog: For the sake of people still using CVS, don't use dollars
2120 when mentioning Id.
2121 * data/xslt/bison.xsl: Remove Id from header comments, where it was
2122 unusual anyway.
2123 * data/xslt/xml2dot.xsl: Likewise.
2124 * data/xslt/xml2text.xsl: Likewise.
2125 * data/xslt/xml2xhtml.xsl: Likewise.
2126 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
2127 * doc/Makefile.am (neutralize): Remove, no longer needed.
2128 (.x.1): Don't use neutralize.
2129 (edit): Don't substitute for ID.
2130 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
2131
c53d18b1
JD
21322008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
2133
2134 Fix dependence on computed configure variables.
2135 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
2136 $(top_srcdir)/configure.ac so that changes to computed variables, such
2137 as PACKAGE_VERSION, are seen.
2138 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
2139
5523ac79
JD
21402008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
2141
2142 Update copyright dates for recent changes.
2143 * Makefile.am: Here.
2144 * src/Makefile.am: Here.
2145 * src/reduce.c: Here.
2146 * tests/reduce.at: Here.
2147
8fa36911
JD
21482008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
2149
2150 Use git-version-gen for version names between releases.
2151 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
2152 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
2153 * .prev-version: New.
2154 * .version.in: Remove.
78029cd5 2155 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
2156 revision.
2157 * GNUmakefile: Remove, now copied from Gnulib.
2158 * Makefile.am: Add code suggested by comments in
2159 build-aux/git-version-gen.
2160 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
2161 .prev-version, and .version.
2162 * NEWS (2.3b+): Rename to...
2163 (?.?): ... this because we're dropping the "+" version naming scheme,
2164 but, in general, we still can't be sure of our next release name.
2165 * bootstrap: Add a quick hack to remove from .gitignore the
2166 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
2167 entry. This should really be fixed in gnulib instead.
2168 * bootstrap.conf (gnulib_modules): Add gnumakefile.
2169 * configure.ac (AC_INIT): Set version name by invoking
2170 build-aux/git-version-gen.
2171 (AC_CONFIG_FILES): Remove .version, now generated by
2172 build-aux/git-version-gen.
2173 * maint.mk: New, copied from coreutils.
2174 * doc/.cvsignore (bison.1): Add.
2175 * doc/.gitignore (/bison.1): Add.
2176 * doc/bison.1: Remove, generated.
2177 * src/.cvsignore (revision.c): Remove.
2178 * src/.gitignore (/revision.c): Remove.
2179 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
2180 (BUILT_SOURCES): Remove revision.c.
2181 (revision.c): Remove.
2182 * src/getargs.c (version): Don't print revision after the VERSION.
2183 * src/revision.h: Remove.
2184
bcf07cb7
JD
21852008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
2186
2187 Fix untranslatable composition of sentences. Reported by Goran
2188 Uddeborg at
2189 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
2190 * THANKS (Goran Uddeborg): Add.
2191 * src/reduce.c (reduce_print): Report the number of nonterminals and
2192 rules useless in the grammar in separate sentences.
2193 * tests/reduce.at (Useless Rules): Update output.
2194 (Reduced Automaton): Likewise.
2195 (Underivable Rules): Likewise.
2196 (Empty Language): Likewise.
2197
9aacab9a
JD
21982008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2199
2200 Fix some .gitignore and .cvsignore problems.
2201 * bootstrap (insert_sorted_if_absent): Replace all uses with...
2202 (insert_vc_ignore): ... this new function, which prepends `/' to all
2203 .gitignore entries before passing them to insert_sorted_if_absent.
2204 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
2205 .cvsignore files are maintained even though Bison developers run
2206 bootstrap while using Git.
2207 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
2208 unneeded by Bison.
2209 (gnulib): Add.
2210 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
2211 unneeded. Reported by Eric Blake.
2212 * lib/.gitignore (/*~): Add.
2213 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
2214 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
2215 Blake.
2216 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
2217
a9fc7990
JD
22182008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
2219
2220 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
2221 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
2222 * bootstrap.conf (gnulib_modules): Add unsetenv.
2223 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
2224 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
2225 (/setenv.m4): Add.
2226 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
2227 the first argument because it may become position-dependent, and unset
2228 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
2229 Add comments explaining these issues in more detail.
2230
0f1d6f10
JD
22312008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
2232
2233 Add .gitignore everywhere based on .cvsignore.
2234 * .gitignore: New.
2235 * build-aux/.gitignore: New.
2236 * data/.gitignore: New.
2237 * doc/.gitignore: New.
2238 * etc/.gitignore: New.
2239 * examples/.gitignore: New.
2240 * examples/calc++/.gitignore: New.
2241 * lib/.gitignore: New.
2242 * m4/.gitignore: New.
2243 * po/.gitignore: New.
2244 * runtime-po/.gitignore: New.
2245 * src/.gitignore: New.
2246 * tests/.gitignore: New.
2247
7bd1665a
JD
22482008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2249
2250 * NEWS (2.3b+): New section, empty for now.
2251 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
2252
72c5b982
JD
22532008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
2254
2255 * NEWS (2.3b): Update release date since there has been a delay in
2256 getting the announcements and tarballs out.
2257
bd02cd5d
JD
22582008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
2259
2260 * NEWS: Version 2.3b.
2261 * configure.ac (AC_INIT): Likewise.
2262 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
2263
9126263e
JD
22642008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
2265
2266 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
2267 been doing it for years.
2268 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
2269 (Release Procedure): Add FIXME about make alpha being unmaintained.
2270
fa6aa7b3
JD
22712008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
2272
2273 * data/yacc.c: Reformat m4 a little for readability.
2274 * src/lalr.c (build_relations): Correct comment.
2275
d30b312d
JMG
22762008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2277
2278 DJGPP specific issue.
2279 * djgpp/config.sed: Fixes required to run configure scripts generated
2280 by autoconf 2.62.
2281
138d4cd9
JD
22822008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
2283
2284 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
2285 coordinator@translationproject.org.
2286
8f7e2e1f
JD
22872008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
2288
2289 * THANKS: Add Eric Blake.
2290
f55efa38
JD
22912008-04-23 Eric Blake <ebb9@byu.net>
2292
2293 Revert prior patch, by working around autoconf regression.
2294 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
2295 ("Output file name: ("): Uncomment test.
2296 ("Output file name: )"): Likewise.
2297 Based on an idea from Noah Misch.
2298
096c9f9d
JD
22992008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2300
2301 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
2302 2.61. Reported by Juan Manuel Guerrero at
2303 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
2304 * tests/output.at ("Output file name: ("): Comment out test case for
2305 now.
2306 ("Output file name: )"): Likewise.
2307
0f664b89
JD
23082008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2309
2310 * GNUmakefile: Update git-version-gen invocation so make dist
2311 succeeds.
2312
1cfe6375
JD
23132008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
2314
2315 Update to the current gnulib CVS repository, and fix trigraph handling
2316 in Bison.
2317 * bootstrap: Update gnulib CVS repository URL.
2318 (symlink_to_dir): Encapsulate the code that guarantees the destination
2319 directory exists into...
2320 (check_dst_dir): ... this new function, and...
2321 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
2322 fail when copying files into lib/uniwidth/.
2323 * src/output.c (prepare_symbols): When writing yytname muscles, where
2324 symbol names will be encoded in C-string literals, tell quotearg to
2325 escape trigraphs. This used to be the default in gnulib.
2326 * tests/regression.at (Token definitions): Because of the change in
2327 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
2328 escapes trigraphs in symbol names. Thus, yytname no longer has
2329 trigraphs unnecessarily doubly escaped. Update test case output.
2330 Extend test case to be sure Bison's own error messages will no longer
2331 have trigraphs in symbol names unnecessarily escaped once.
2332
74c52fc8
JD
23332008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
2334
2335 Fix make dist infinite loop reported by Juan Manuel Guerrero at
2336 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
2337 * .cvsignore: Add .version.
2338 * .version.in: New.
2339 * bootstrap.conf (gnulib_modules): Add git-version-gen.
2340 * configure.ac (AC_CONFIG_FILES): Add .version.
2341 * build-aux/.cvsignore: Add git-version-gen.
2342
8e55b3aa
JD
23432008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2344
2345 * NEWS (2.3a+): Mention that -g now takes an argument.
2346 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
2347 consistency. Update the -g and -x entries now that they take
2348 arguments. Use brackets to indicate optional arguments.
2349 * src/getargs.c (usage): Explain the relationship between arguments of
2350 long and short options more completely. Document --defines and -d
2351 separately since the former takes an argument but, for POSIX Yacc, the
2352 latter does not.
2353 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 2354 (getargs): Sort cases.
8e55b3aa 2355
59c5ac72
AD
23562008-02-28 Akim Demaille <demaille@gostai.com>
2357
2358 * doc/bison.texinfo: Fix a few typos.
2359
118d4978
AD
23602008-02-28 Akim Demaille <akim@epita.fr>
2361
2362 * doc/bison.texinfo (Bison Options): Document -W.
2363 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
2364
7020f1e9
AD
23652008-02-28 Akim Demaille <akim@epita.fr>
2366
2367 * src/getargs.c (short_options): Split and sort for readability.
2368 -g and -x take optional arguments, just like their long options.
2369 * build-aux/cross-options.pl: Use /x to make the regexp easier to
2370 understand.
2371 Fix the handling of $opt which resulted in all the argument to be
2372 considered as optional.
2373
59da312b
JD
23742008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
2375
2376 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
2377 say its interface is experimental.
2378 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
2379 Java.
2380 (Bison Options): In the -L and --language entry, mention Java.
2381 (Java Bison Interface): Say the interface is experimental.
2382 * src/getargs.c (usage): Mention -L and --language.
2383
2384 * NEWS (2.3a+): Say the push parsing interface is experimental.
2385 * doc/bison.texinfo (Push Decl): Likewise.
2386 (Decl Summary): Likewise in the "%define api.push_pull" entry.
2387 (Push Parser Function): Likewise.
2388 (Pull Parser Function): Likewise.
2389 (Parser Create Function): Likewise.
2390 (Parser Delete Function): Likewise.
2391 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
2392 yypull_parse, and yypush_parse entries.
2393
2394 * NEWS (2.3a+): Mention XML support, and say the schema is
2395 experimental.
2396 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
2397 * src/getargs.c (usage): Say the XML schema is experimental.
2398
2399 * NEWS (2.3a+): Say option instead of flag.
2400
2bb3ebec
WP
24012008-02-21 Wojciech Polak <polak@gnu.org>
2402
2403 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
2404 text.
2405
333e670c
JD
24062008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
2407
2408 Fix impure push parser compile error reported by Bob Rossi at
2409 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
2410 * data/yacc.c: Clean up whitespace in the output a little.
2411 (yypstate_allocated): Define for impure push parsers regardless of
2412 whether the pull interface is also requested.
2413 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
2414 check impure push parsers without the pull interface.
2415
2416 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
2417 yyerror takes arguments specified by %parse-param while yypstate_new
2418 does not.
2419 * doc/bison.texinfo (Parser Create Function): Document that
2420 yypstate_new returns 0 for multiple impure parser instances.
2421 * tests/push.at (Push Parsing: Multiple impure instances): Update
2422 expected stderr output.
2423
798096e1
JD
24242008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
2425
2426 * runtime-po/POTFILES.in (push.c): Remove.
2427
9ca7f077
JD
24282008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
2429
2430 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
2431 * data/push.c: Rename to...
2432 * data/yacc.c: ... this, overwriting it.
2433 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
2434 `%push-pull-parser' -> `%define api.push_pull "both"'.
2435 Remove old yacc.c tests, and update push.c tests to yacc.c.
2436
42ee26bb
JD
24372008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
2438
2439 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
2440 `"%code top" blocks' instead of `%code "top" blocks'.
2441 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
2442 Clean up whitespace in the output a little.
2443
b1cc23c4
JD
24442008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
2445
2446 Fix documentation problems reported by Tim Josling at
2447 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
2448 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
2449 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
2450 integers. Explain the effect of literal string aliases on error
2451 messages. Copy token 0 documentation from the C++ skeleton
2452 documentation.
2453
ab7f29f8
JD
24542008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
2455
2456 Accept a token number in a %left, %right, or %nonassoc for POSIX
2457 conformance. Reported by Tim Josling at
2458 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
2459 * NEWS (2.3a+): Mention.
2460 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
2461 and code numbers are treated by precedence declarations.
2462 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
2463 of symbols.1.
2464 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
2465 of symbol.
2466 (symbol.prec): New, just like symbol but allows INT.
2467 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
2468 longer holds.
2469 * tests/regression.at (Token number in precedence declaration): New
2470 test case.
2471
a924ef36
JMG
24722008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2473
2474 DJGPP specific issues.
2475 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
2476 be changed. Copyright timestamp adjusted.
2477 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
2478 be changed. Copyright timestamp adjusted.
2479 * djgpp/config.site: Copyright timestamp adjusted.
2480 * djgpp/config_h.sed: Copyright timestamp adjusted.
2481 * djgpp/djunpack.bat: Copyright timestamp adjusted.
2482 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
2483 filename translation list.
2484 * djgpp/subpipe.c (init_subpipe): Check the environment variables
2485 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
2486 files shall be created. Before trying to use the temp dir where the
2487 environment variable points to check that the dir really exists. If
2488 not default to the cwd as temp dir. Copyright timestamp adjusted.
2489 * djgpp/subpipe.h: Copyright timestamp adjusted.
2490 * djgpp/testsuite.sed: Copyright timestamp adjusted.
2491
389c8cfd
PE
24922008-01-30 Paul Eggert <eggert@cs.ucla.edu>
2493
2494 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
2495
5d1cfef4
PE
24962008-01-09 Paul Eggert <eggert@cs.ucla.edu>
2497
2498 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
2499 Problem reported by Claudio Saavedra in
2500 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
2501
e2dcf996
WP
25022008-01-05 Wojciech Polak <polak@gnu.org>
2503
2504 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
2505 document's title with the input grammar file name.
2506
da730230
JD
25072007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
2508
2509 Automate regression testing of the XML/XSLT implementation. Discussed
2510 starting at
2511 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
2512 * configure.ac (XSLTPROC): New substitution.
2513 * Makefile.am (maintainer-xml-check): New phony target invoking...
2514 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
2515 invoking make maintainer-check with BISON_TEST_XML=1.
2516 * tests/atlocal.in (XSLTPROC): New.
2517 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
2518 not to report reachable memory when Bison is expected to have a
2519 non-zero exit status and (2) to compare XML/XSLT output with --graph
2520 and --report=all output for every working grammar when
2521 BISON_TEST_XML=1.
2522 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
2523 (AT_BISON_CHECK_XML): New.
2524 (AT_QUELL_VALGRIND): New.
2525 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
2526 (AT_CHECK): ... don't redefine this since this was the old way to
2527 quell Valgrind.
2528 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
2529 AT_BISON_CHECK invocations.
2530 * tests/c++.at: Likewise.
2531 * tests/calc.at: Likewise.
2532 * tests/conflicts.at: Likewise.
2533 * tests/cxx-type.at: Likewise.
2534 * tests/existing.at: Likewise.
2535 * tests/glr-regression.at: Likewise.
2536 * tests/headers.at: Likewise.
2537 * tests/input.at: Likewise.
2538 * tests/java.at: Likewise.
2539 * tests/output.at: Likewise.
2540 * tests/push.at: Likewise.
2541 * tests/reduce.at: Likewise.
2542 * tests/regression.at: Likewise.
2543 * tests/sets.at: Likewise.
2544 * tests/skeletons.at: Likewise.
2545 * tests/synclines.at: Likewise.
2546 * tests/torture.at: Likewise.
2547 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
2548 tends to hang xsltproc.
2549 (Big horizontal): Likewise.
2550
408476bc
JD
25512007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2552
2553 In XML output, remove redundant class attribute on symbol element.
2554 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
2555 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
2556 look up a symbol to determine whether it's a nonterminal or terminal.
2557 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
2558 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
2559
2560 Add prec/assoc information to XML output.
2561 * src/gram.c (grammar_rules_print_xml): For each rule that has a
2562 %prec, add a percent_prec attribute.
2563 * src/print-xml.c (print_grammar): For each terminal that has a
2564 precedence or associativity, add a prec or assoc attribute.
2565 (xml_indent): New.
2566 (xml_puts): Use xml_indent.
2567 (xml_printf): Use xml_indent.
2568 * src/print-xml.h (xml_indent): Prototype.
2569
2570 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
2571 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
2572
d4a26c48
JD
25732007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
2574
2575 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
2576 (bison:ruleByNumber): ... this for clarity.
2577 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
2578 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
2579 (xsl:template match="reduction"): Update.
2580 (xsl:template match="item"): Update.
2581 (xsl:template match="reduction"): Update.
2582
2583 In the XML output, don't print the list of rules where symbols appear.
2584 Compute it in XSLT instead. Discussed at
2585 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
2586 * data/xslt/bison.xsl (bison:ruleByLhs): New.
2587 (bison:ruleByRhs): New.
2588 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
2589 bison:ruleByRhs.
2590 (xsl:template match="terminal/rule"): Remove.
2591 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2592 bison:ruleByRhs.
2593 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2594 Remove.
2595 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
2596 bison:ruleByRhs and mode="number-link" for rule template.
2597 (xsl:template match="terminal/rule"): Remove.
2598 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
2599 bison:ruleByRhs and mode="number-link" for rule template.
2600 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
2601 Rewrite as...
2602 (xsl:template match="rule" mode="number-link"): ... this.
2603 * src/print-xml.c (print_grammar): Don't print the list of rules.
2604
ef1b4273
JD
26052007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2606
2607 Don't let --report affect XML output; always print all information.
2608 Discussed at
2609 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
2610 * src/conflicts.c (log_resolution): Implement.
2611 * src/print-xml.c (print_core): Implement.
2612 (print_state): Implement.
2613 (print_xml): Implement.
2614
2615 * NEWS (2.3a+): Fix quotes.
2616 * src/parse-gram.y (prologue_declaration): For consistency with -v,
2617 don't let %verbose clear the list specified by --report.
2618
0f6cd9e3
AD
26192007-11-26 Akim Demaille <akim@epita.fr>
2620
2621 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
2622
d80fb37a
JD
26232007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
2624
2625 In the XML output, list useless and unused symbols and rules with the
2626 useful ones and add a "usefulness" attribute. Discussed starting at
2627 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
2628 * src/gram.c (grammar_rules_partial_print_xml): Remove.
2629 (grammar_rules_print_xml): Print all rules instead of just those
2630 useful in the grammar, and add a "usefulness" attribute.
2631 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
2632 * src/print-xml.c (print_rules_useless_in_parser): Remove.
2633 (print_grammar): Print all nonterminals instead of just useful ones,
2634 and add a "usefulness" attribute to nonterminals and terminals.
2635 (print_xml): Don't print a separate "reductions" or
2636 "rules-useless-in-parser" element.
2637 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
2638 (reduce_xml): Remove.
2639 (reduce_token_unused_in_grammar): New.
2640 (reduce_nonterminal_useless_in_grammar): New.
2641 * src/reduce.h (reduce_xml): Remove prototype.
2642 (reduce_token_unused_in_grammar): Add prototype.
2643 (reduce_nonterminal_useless_in_grammar): Add prototype.
2644 * data/xslt/xml2text.xsl: Update for XML changes.
2645 * data/xslt/xml2xhtml.xsl: Update for XML changes.
2646 * tests/reduce.at (Useless Terminals): Update output.
2647 (Useless Rules): Update output.
2648 (Reduced Automaton): Update output.
2649
2650 Say "Terminals unused in grammar" instead of "Unused terminals".
2651 * NEWS (2.3a+): Update.
2652 * doc/bison.texinfo (Understanding): Update example output.
2653 * src/reduce.c (reduce_output): Implement.
2654 * data/xslt/xml2text.xsl: Implement.
2655 * data/xslt/xml2xhtml.xsl: Implement.
2656
1bb2bd75
JD
26572007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2658
2659 Accept --report-file=FILE to override the default `.output' filename.
2660 * NEWS (2.3a+): Mention.
2661 * doc/bison.texinfo (Bison Options): Add an entry.
2662 * src/files.c (compute_output_file_names): Don't override
2663 spec_verbose_file if already set.
2664 * src/getargs.c (usage): Document --report-file.
2665 (REPORT_FILE_OPTION): New anonymous enum member.
2666 (long_options): Add entry for it.
2667 (getargs): Add case for it setting spec_verbose_file.
2668
2669 * build-aux/cross-options.pl: Don't record a short option just because
2670 there's an arg.
2671 * doc/.cvsignore: Add yacc.1.
2672
a005a9c4
AD
26732007-11-14 Akim Demaille <akim@epita.fr>
2674
2675 * doc/yacc.1.in: New.
2676 * configure.ac, doc/Makefile.am: Adjust.
2677 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
2678 config.h symbol.
2679 Use AC_SUBST for assignments too.
2680 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
2681
cff03fb2
JD
26822007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2683
2684 * src/gram.c: Remove comments that duplicate comments in gram.h.
2685
2686 When reporting useless rules and nonterminals, say "useless in grammar"
2687 instead of "useless", and say "useless in parser" instead of "never
2688 reduced". Discussed starting at
2689 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
2690 * NEWS (2.3a+): Mention this change.
2691 * data/xslt/xml2text.xsl: Update output text and expected input XML
2692 element names to match changes below.
2693 * data/xslt/xml2xhtml.xsl: Likewise.
2694 (xsl:template match="bison-xml-report"): Add missing entry in Table of
2695 Contents: "Rules useless in parser due to conflicts".
2696 * doc/bison.texinfo (Decl Summary): Reword a little.
2697 (Understanding): Update example output for changes below.
2698 * src/gram.c: (rule_useful_p): Rename to...
2699 (rule_useful_in_grammar_p): ... this.
2700 (rule_useless_p): Rename to...
2701 (rule_useless_in_grammar_p): ... this.
2702 (rule_never_reduced_p): Rename to...
2703 (rule_useless_in_parser_p): ... this.
2704 (grammar_rules_print): Update for renames.
2705 (grammar_rules_print_xml): Update for renames.
2706 (grammar_rules_never_reduced_report): Rename to...
2707 (grammar_rules_useless_report): ... this since it is used for either
2708 kind of useless rule.
2709 * src/gram.h: Reword comments and update function names in prototypes.
2710 * src/main.c (main): Say "rule useless in parser due to conflicts".
2711 * src/print-xml.c (print_rules_never_reduced): Rename to...
2712 (print_rules_useless_in_parser): ... this, and rename output XML
2713 element "rules-never-reduced" to "rules-useless-in-parser".
2714 (print_xml): Update for rename.
2715 * src/print.c (print_results): Say "Rules useless in parser due to
2716 conflicts".
2717 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
2718 (nonterminals_reduce): Say "nonterminal useless in grammar".
2719 (reduce_output): Say "Nonterminals useless in grammar".
2720 Say "Rules useless in grammar".
2721 (reduce_xml): Rename output XML element "useless" to
2722 "useless-in-grammar".
2723 (reduce_print): Don't report the count of grammatically useless rules
2724 as "rules never reduced" just because %yacc is specified.
2725 In the correct report of this count, say nonterminal(s) and rule(s)
2726 "useless in grammar".
2727 * tests/conflicts.at (S/R in initial): Update expected output.
2728 (Defaulted Conflicted Reduction): Likewise.
2729 (Unreachable States After Conflict Resolution): Likewise.
2730 * tests/existing.at (GNU pic Grammar): Likewise.
2731 * tests/reduce.at (Useless Nonterminals): Likewise.
2732 (Useless Rules): Likewise.
2733 (Reduced Automaton): Likewise.
2734 (Underivable Rules): Likewise.
2735 (Empty Language): Likewise.
2736
66f0441d
JD
27372007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2738
2739 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
2740 here document and before the EOF so that BSD's implementation of Bourne
2741 shell doesn't parse the delimiter as part of the here document.
2742 * doc/.cvsignore: Add cross-options.texi.
2743 * src/getargs.c (usage): Add a blank line after the warning categories.
2744
d0ee4105
PB
27452007-11-08 Paolo Bonzini <bonzini@gnu.org>
2746
2747 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
2748
e8b1fb9b
AD
27492007-11-05 Akim Demaille <akim@epita.fr>
2750
2751 Remove Id: from bison.1.
2752 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
2753 (perl -0777 -pi -e 's/\.PP\nId): New.
2754 (.x.1): Use it to ignore the version control revision.
2755
2f7a96b5
AD
27562007-11-05 Akim Demaille <demaille@gostai.com>
2757
2758 * build-aux/Makefile.am: Ship cross-options.pl.
2759 * doc/Makefile.am: Always refer to cross-options.texi with
2760 $(srcdir).
2761 (MAINTAINERCLEANFILES): Add it.
2762
f4101aa6
AD
27632007-11-04 Akim Demaille <demaille@gostai.com>
2764
2765 Generate the long/short option cross-table.
2766 * build-aux/cross-options.pl: New.
2767 * doc/Makefile.am (cross-options.texi): New.
2768 * doc/bison.texinfo: Use it.
2769
727a1401
AD
27702007-11-04 Akim Demaille <demaille@gostai.com>
2771
2772 Generate bison.1 using help2man.
2773 * doc/common.x, doc/bison.x: New.
2774 * doc/Makefile.am (bison.1, .x.1): New.
2775 The code is taken from autoconf-2.61/man/Makefile.am.
2776 * configure.ac: Look for help2man.
2777
6aeb9c57
AD
27782007-11-04 Akim Demaille <demaille@gostai.com>
2779
2780 Complete --help.
2781 * src/getargs.c (usage): Document -W, make it clear that -d,
2782 -g and -x have optional arguments.
2783
d7be4085
AD
27842007-11-04 Akim Demaille <demaille@gostai.com>
2785
2786 Find sha1sum when named gsha1sum.
2787 * bootstrap (find_tool): New.
2788 ($SHA1SUM): New.
2789
d9df47b6
JD
27902007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2791
2792 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
2793 at
2794 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
2795 * NEWS (2.3a+): Mention.
2796 * data/bison.m4 (b4_pure_if): Don't define it here.
2797 * data/c.m4 (b4_identification): Depend on individual skeletons to
2798 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
2799 values of the %define variables api.pure or api.push_pull. Define
2800 YYPURE, YYPUSH, and YYPULL accordingly.
2801 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
2802 glr.cc has already defined b4_pure_flag.
2803 * data/push.c: Define b4_pure_if based on `%define api.pure'.
2804 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 2805 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
2806 * doc/bison.texinfo (Pure Decl): Update.
2807 (Push Decl): Update.
2808 (Decl Summary): Add api.pure to %define entry.
2809 In %pure-parser entry, say it's deprecated and reference %define.
2810 (Pure Calling): Update.
2811 (Error Reporting): Update.
2812 (C++ Scanner Interface): Update.
2813 (How Can I Reset the Parser): Update.
2814 (Table of Symbols): In %pure-parser entry, say it's deprecated and
2815 reference %define.
2816 * src/getargs.c (pure_parser): Remove global variable.
2817 * src/getargs.h (pure_parser): Remove extern.
2818 * src/output.c (prepare): Don't define pure_flag muscle.
2819 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
2820 wrapper around `%define api.pure'.
2821 * tests/calc.at (Simple LALR Calculator): Update.
2822 (Simple GLR Calculator): Update.
2823 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
2824 Update.
2825 (GLR: Resolve ambiguity, pure, locations): Update.
2826 (GLR: Merge conflicting parses, pure, no locations): Update.
2827 (GLR: Merge conflicting parses, pure, locations): Update.
2828 * tests/glr-regression.at (Uninitialized location when reporting
2829 ambiguity): Update
2830 * tests/input.at (Unused %define api.pure): New test case.
2831 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
2832 AT_PURE_IF and AT_PURE_AND_LOC_IF.
2833 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2834
c373bf8b
JD
28352007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
2836
2837 %define push_pull -> %define api.push_pull. Discussed starting at
2838 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
2839 * data/push.c: Expect the new name.
2840 * data/yacc.c: Likewise.
2841 * doc/bison.texinfo (Push Decl): Update.
2842 (Decl Summary): Update %define entry.
2843 (Push Parser Function): Update.
2844 (Pull Parser Function): Update.
2845 (Parser Create Function): Update.
2846 (Parser Delete Function): Update.
2847 * tests/calc.at (Simple LALR Calculator): Update.
2848 * tests/input.at (%define enum variables): Update.
2849 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
2850 (Push Parsing: Multiple impure instances): Update.
2851 (Push Parsing: Unsupported Skeletons): Update.
2852 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
2853 (Exploding the Stack Size with Malloc): Update.
2854
2855 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
2856 other entries some.
2857
32f19b6b
JD
28582007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
2859
2860 For the XML output's terminal element, rename @number to @token-number,
2861 and add @symbol-number. In the nonterminal element, rename @number to
2862 @symbol-number. Discussed starting at
2863 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
2864 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
2865 renames.
2866 (xsl:template match="nonterminal"): Likewise.
2867 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
2868 (xsl:template match="nonterminal"): Likewise.
2869 * src/print-xml.c (print_grammar): Implement.
2870
255a6b90
JD
28712007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2872
2873 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
2874 2007-10-11 change, the child elements here are items not rules.
408476bc 2875 (xsl:template match="item"): New.
255a6b90
JD
2876 (xsl:template match="rule"): Update for new reduced itemset.
2877 (xsl:template match="point"): Remove.
2878 (xsl:template match="empty"): For consistency with --graph, don't
2879 output "/* empty */".
2880 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
2881 line-wrap, don't pass a negative value as first-line-length since this
2882 won't work with the following changes.
2883 (xsl:template name="line-wrap"): Simplify slightly.
2884 (xsl:template name="ws-search"): Eliminate recursion.
2885 * src/print_graph.c (print_core): Don't print a reduction's lookahead
2886 set next to an item whose dot is not at the end of the RHS even if it
2887 happens to be associated with the same rule.
2888
88c78747
JD
28892007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2890
31984206
JD
2891 Add %define lr.keep_unreachable_states.
2892 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
2893 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
2894 * src/main.c (main): Implement it.
2895 * tests/conflicts.at (Unreachable States After Conflict Resolution):
2896 Extend to test it, and fix a typo.
2897
28982007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
2899
2900 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
2901 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
2902 the example .output text.
2903 * tests/regression.at (Extra lookahead sets in report): Improve wording
2904 of comments.
2905
b7a70162
WP
29062007-10-17 Wojciech Polak <polak@gnu.org>
2907
2908 * src/print-xml.c (print_grammar): Renamed
2909 <terminal> and <nonterminal> attributes:
2910 "type" to "number" and "symbol" to "name".
2911 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
2912 Use new attribute names.
2913 (xsl:template match="nonterminal"): Likewise.
2914 * data/xslt/xml2xhtml.xsl: Likewise.
2915
a0de5091
JD
29162007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
2917
2918 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
2919 (Option Cross Key): Likewise.
2920
2921 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
2922 next to an item whose dot is not at the end of the RHS even if it
2923 happens to be associated with the same rule.
2924 * src/print.c (print_core): Likewise.
2925 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
2926 (Resolved SR Conflicts): Update output.
2927 * tests/regression.at (Extra lookahead sets in report): New test case.
2928
4c20d18d
WP
29292007-10-11 Wojciech Polak <polak@gnu.org>
2930
2931 * src/print-xml.c (print_core): Remove item set
2932 redundancy.
2933 * data/xslt/bison.xsl (bison:ruleNumber): New key.
2934 Improve processing time. Suggested by Joel E. Denny.
2935 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
2936 Write xsl:param "required" attribute as comment.
2937 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
2938 (xsl:template match="rule"): Support new reduced itemset.
2939 (xsl:template match="point"): Remove.
2940 * data/xslt/xml2xhtml.xsl: Likewise.
2941
f506ad1c
JD
29422007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2943
2944 * src/getargs.c (version): Update copyright year.
2945
21f1b063
JD
29462007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
2947
2948 Make xml2dot.xsl and --graph produce the same output.
2949 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
2950 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
2951 escaped later.
2952 (xsl:template name="output-node"): Use the new escape template instead
2953 of the string-replace template directly.
2954 (xsl:template name="output-edge"): Likewise.
2955 (xsl:template name="escape"): New, escapes backslashes and newlines in
2956 addition to quotation marks.
2957 * src/graphviz.c (start_graph, output_node, output_edge): Add
2958 whitespace to output for legibility.
2959
2960 Make xml2text.xsl and --report produce the same output, and remove the
2961 XML "conflicts" element since a conflict summary is easily extracted
2962 from the automaton.
2963 * data/xslt/bison.xsl: New.
2964 (xsl:template match="state" mode="bison:count-conflicts): New.
2965 * data/xslt/xml2text.xsl: Import bison.xsl.
2966 (xsl:template match="bison-xml-report"): Instead of styling the
2967 "conflicts" element, style the "automaton" element with mode
2968 "conflicts". Unlike the former, the latter lists S/R and R/R
2969 conflicts for a state on the same line.
2970 (xsl:template match="conflicts"): Remove.
2971 (xsl:template match="conflict"): Remove.
2972 (xsl:template match="terminal"): Line-wrap the list of rules in which
2973 the terminal is used.
2974 (xsl:template match="nonterminal"): Likewise for nonterminals.
2975 (xsl:template match="automaton" mode="conflicts"): New.
2976 (xsl:template match="state" mode="conflicts"): New.
2977 (xsl:template name="line-wrap"): New.
2978 (xsl:template name="ws-search"): New.
2979 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
2980 (xsl:template match="bison-xml-report"): Instead of styling the
2981 "conflicts" element, style the "automaton" element with mode
2982 "conflicts."
2983 (xsl:template match="conflicts"): Remove.
2984 (xsl:template match="conflict"): Remove.
2985 (xsl:template match="automaton" mode="conflicts"): New.
2986 (xsl:template match="state" mode="conflicts): New.
2987 * src/conflicts.c (conflicts_output_xml): Remove.
2988 * src/conflicts.h (conflicts_output_xml): Remove prototype.
2989 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
2990 * src/print.c (print_grammar): Consistently wrap at the 66th column so
2991 the corresponding XSLT is easier. Also, never wrap between a word and
2992 the comma that follows it.
2993
793fbca5
JD
29942007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
2995
2996 Improve C++ namespace support. Discussed starting at
2997 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
2998 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
2999 b4_namespace_close): New macros that interpret the %define variable
3000 "namespace" so its value can contain "::" to indicate nested
3001 namespaces.
3002 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
3003 the above macros.
3004 * data/lalr1.cc (b4_namespace): Likewise.
3005 * data/location.cc (b4_namespace): Likewise.
3006 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
3007 inside a new table in the general %define entry. Document `%define
3008 namespace' there as well. Point the %name-prefix entry to it since it
3009 explains it more completely in the case of C++.
3010 (C++ Bison Interface): Mention `%define namespace' instead of
3011 %name-prefix.
3012 (Table of Symbols): Remove the `%define push_pull' entry. The %define
3013 entry suffices.
3014 * tests/c++.at (Relative namespace references): New test case.
3015 (Absolute namespace references): New test case.
3016 (Syntactically invalid namespace references): New test case.
3017 * tests/input.at (C++ namespace reference errors): New test case.
3018
35b8730d
JD
30192007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
3020
3021 Add syncline support and location accessor to internal %define
3022 interfaces.
3023 * data/bison.m4 (b4_percent_define_get_loc): New.
3024 (b4_percent_define_get_syncline): New.
3025 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
3026 (b4_percent_define_default): Record defining location as line 1 rather
3027 than 0 for the sake of synchronizing #line's, and define
3028 b4_percent_define_syncline(VARIABLE).
3029 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
3030 * src/muscle_tab.c (muscle_syncline_grow): New.
3031 (muscle_code_grow): Use muscle_syncline_grow.
3032 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
3033 define b4_percent_define_syncline(VARIABLE).
3034 (muscle_percent_define_get_loc): New.
3035 (muscle_percent_define_get_syncline): New.
3036 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
3037 remove some unused variables.
3038 (muscle_percent_define_default): Record defining location as line 1
3039 rather than 0 for the sake of synchronizing #line's, and define
3040 b4_percent_define_syncline(VARIABLE).
3041 (muscle_percent_define_check_values): Use
3042 muscle_percent_define_get_loc.
3043 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
3044 (muscle_percent_define_get_syncline): Prototype.
3045 * tests/skeletons.at (%define Boolean variables: invalid skeleton
3046 defaults): Update output for location change.
3047 (Complaining during macro argument expansion): Extend to test
3048 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
3049
7dc4a694
JD
30502007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
3051
3052 Fix some error-reporting macro bugs.
3053 * data/bison.m4 (b4_cat): New.
3054 (b4_error, b4_error_at): Use b4_cat to send error directives directly
3055 to stdout so they don't become arguments to other macros. Update
3056 comments and add examples.
3057 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
3058 add examples.
3059 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
3060 after printing the error directive so that M4 doesn't report subsequent
3061 problems that are induced by this problem.
3062 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
3063 instead of just in them. Recognize @\n in both places. Both expand to
3064 the empty string. Needed by b4_cat.
3065 * tests/skeletons.at (Complaining during macro argument expansion):
3066 New test case.
3067 (Fatal errors make M4 exit immediately): New test case.
3068
d4bd2295
JD
30692007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
3070
3071 Implement --print-datadir.
3072 * src/getargs.c (usage): Mention.
3073 (PRINT_DATADIR_OPTION): New anonymous enum member.
3074 (long_options): Add entry for it.
3075 (getargs): Add case for it calling compute_pkgdatadir.
3076 * src/output.c (output_skeleton): Encapsulate data directory
3077 computation from here...
3078 (prepare): ... and from here...
3079 (compute_pkgdatadir): ... into this new function.
3080 * src/output.h (compute_pkgdatadir): Prototype.
3081
34cdeddf
JD
30822007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
3083
3084 * src/print-xml.c (escape_bufs): New static global variable
3085 replacing...
3086 (xml_escape_n): ... the static local variable buf here.
3087 (print_xml): Free memory for escape_bufs.
3088 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
3089
d782395d
JD
30902007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
3091
3092 Replace `%push-parser' and `%push-pull-parser' with
3093 `%define push_pull "push"' and `%define push_pull "both"'.
3094 `%define push_pull "pull"' is the default.
3095 * doc/bison.texinfo (Push Decl, Push Parser Function,
3096 Pull Parser Function, Parser Create Function, Parser Delete Function):
3097 Update declarations.
3098 (Decl Summary, Table of Symbols): Replace %push-parser and
3099 %push-pull-parser entries with a %define push_pull entry.
3100 * data/bison.m4 (b4_percent_define_check_values): New macro.
3101 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
3102 definitions...
3103 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
3104 definitions...
3105 * data/push.c: ... to here and compute them from the value of the
3106 %define variable push_pull.
3107 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
3108 parsing requests here...
3109 * data/yacc.c: ... hack this to switch to push.c any time
3110 b4_use_push_pull_flag or the %define variable push_pull is set. This
3111 will go away when we mv push.c yacc.c.
3112 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
3113 push parsing is not supported since unused %define variables are
3114 reported anyway.
3115 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
3116 * src/muscle_tab.h (muscle_percent_define_check_values): Update
3117 comments for consistency with b4_percent_define_check_values.
3118 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
3119 muscles.
3120 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
3121 Remove.
3122 (prologue_declaration): Remove %push-parser and %push-pull-parser
3123 rules.
3124 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
3125 * tests/calc.at: Update declarations.
3126 * tests/input.at (%define enum variables): New test case.
3127 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
3128 declaration.
3129 (Push Parsing: Multiple impure instances): Update declaration.
3130 (Push Parsing: Unsupported Skeletons): New test case.
3131 * tests/torture.at (Exploding the Stack Size with Alloca): Update
3132 declaration.
3133 (Exploding the Stack Size with Malloc): Update declaration.
3134
3f999f78
WP
31352007-09-24 Wojciech Polak <polak@gnu.org>
3136
3137 Add XSLT transformations.
3138
3139 * data/xslt/xml2dot.xsl: Transform XML into DOT.
3140 * data/xslt/xml2text.xsl: Transform XML into plain text.
3141 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
3142 * data/Makefile.am (xsltdir): New variable.
3143 (dist_xslt_DATA): Add xslt/*.xsl files.
3144
a4f75309
PE
31452007-09-23 Paul Eggert <eggert@cs.ucla.edu>
3146
3147 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
3148 Problem reported by Wojciech Polak.
3149 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
3150 (xml_printf): Undo change I made on 21 September; that is,
3151 indent 2 spaces, not 1.
3152
ad5feac4
JD
31532007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
3154
3155 Pacify ./configure --enable-gcc-warnings.
3156 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
3157 `char const *' instead of `char *'.
3158 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
3159 local variable `sep'.
3160
41d7a5f2
PE
31612007-09-21 Paul Eggert <eggert@cs.ucla.edu>
3162
3163 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
3164 elsewhere.
3165 * src/print-xml.c: Prefer "const" after types; that's more consistent.
3166 (xml_printf): Indent just 1 space for level.
3167 (e_char, xlate_char): Remove.
3168 (xml_escape_string): Rewrite to avoid undefined behavior (used
3169 storage that was freed from the stack).
3170 (xml_escape_n): Don't bother checking for subscript error.
3171
3f999f78
WP
31722007-09-21 Wojciech Polak <polak@gnu.org>
3173
3174 Add Bison XML Automaton Report.
41d7a5f2
PE
3175
3176 Add support for an -x option to generate an XML report.
3177 It is not documented yet.
3178 * src/print-xml.c: New file.
3179 * src/print-xml.h: Likewise.
3180 * lib/timevar.def (TV_XML): New var.
3181 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
3182 * src/conflicts.c: Include print-xml.h.
3183 (solved_conflicts_xml_obstack): New var.
3184 (log_resolution, conflicts_solve, conflicts_free):
3185 Add support for XML report.
3186 (conflicts_output_val): New function.
3187 * src/conflicts.h (conflicts_output_val): New decl.
3188 * src/files.c (spec_xml_file): New var.
3189 (compute_output_file_names, output_file_names_free): Add XML support.
3190 * src/files.h (spec_xml_file): New decl.
3191 * src/getargs.c (xml_flag): New var.
3192 (usage, short_options, long_options, getargs): Add XML support.
3193 * src/getargs.h (xml_flag): New decl.
3194 * src/gram.c: Include print-xml.h.
3195 (rule_lhs_print_xml, rule_rhs_print_xml):
3196 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
3197 New functions.
3198 * src/gram.h: Declare external ones.
3199 * src/main.c: Include print-xml.h.
3200 (main): Add XML support.
3201 * src/reduce.c: Include print-xml.h.
3202 (reduce_xml): New function.
3203 * src/reduce.h: Declare it.
3204 * src/state.c: Include print-xml.h.
3205 (state_new): Add XML support.
3206 (state_rule_lookahead_tokens_print_xml): New function.
3207 * src/state.h: Declare it.
3208 (struct state): New member solved_conflicts_xml.
3209 * src/symtab.c (symbol_class_get_string): New function.
3210 * src/symtab.h: Declare it.
3211
6d8e724d
PE
32122007-09-21 Paul Eggert <eggert@cs.ucla.edu>
3213
3214 * GNUmakefile: Switch to coreutils's version.
3215 * bootstrap: Likewise.
3216 * Makefile.cfg: Adjust to new GNUmakefile.
3217 * README-hacking: Likewise.
3218
3219 Import from gnulib:
3220
3221 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
3222 Bruno Haible <bruno@clisp.org>
3223
3224 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
3225 and is a script that invokes bison. Tighten the code. Add comments.
3226
922bdd7f
JD
32272007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
3228
3229 Spell "boolean" as "Boolean". Reported by Akim Demaille.
3230 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
3231 * doc/bison.texinfo (Decl Summary): Fix.
3232 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
3233 * tests/input.at (Boolean %define variables): Update output.
3234 * tests/skeletons.at (%define boolean variables: invalid skeleton
3235 defaults): Rename to...
3236 (%define Boolean variables: invalid skeleton defaults): ... this and
3237 update output.
3238
1b17b01d
JD
32392007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
3240
3241 In impure push mode, don't allow more than one yypstate to be allocated
3242 since multiple impure parsers would corrupt yynerrs.
3243 * data/push.c (yypstate_allocated): New static global variable
3244 initialized to 0.
3245 (yypull_parse): If yypstate_new returns 0, don't report it as memory
3246 exhaustion if yypstate_allocated is 1, but still return 2.
3247 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
3248 already 1. Otherwise, set it to 1.
3249 (yypstate_delete): Set it to 0.
3250 * tests/push.at (Push Parsing: Multiple impure instances): New test
3251 case.
3252
9987d1b3
JD
32532007-08-17 Bob Rossi <bob@brasko.net>
3254
3255 * doc/bison.texinfo (Push Decl): Document the push parser.
3256 (Table of Symbols): Ditto.
3257 (Pure Decl): Ditto.
3258 (Decl Summary): Ditto.
3259 (Multiple Parsers, Push Parser Function, Pull Parser Function,
3260 Parser Create Function, Parser Delete Function):
3261 Add new push parser symbols.
3262 (Table of Symbols): Document push-parser, push-pull-parser,
3263 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
3264
f16b0819
PE
32652007-08-15 Paul Eggert <eggert@cs.ucla.edu>
3266
3267 Update to GPLv3.
3268 * doc/gpl-3.0.texi: New file.
3269 * doc/gpl.texi: Remove.
3270 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
3271 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
3272 * README-hacking, TODO, bootstrap, bootstrap.conf:
3273 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
3274 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
3275 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
3276 * data/lalr1.cc, data/lalr1.java, data/location.cc:
3277 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
3278 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
3279 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
3280 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
3281 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
3282 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
3283 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
3284 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
3285 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
3286 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
3287 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
3288 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
3289 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
3290 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
3291 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
3292 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
3293 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
3294 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
3295 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
3296 * src/complain.c, src/complain.h, src/conflicts.c:
3297 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
3298 * src/files.h, src/flex-scanner.h, src/getargs.c:
3299 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
3300 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
3301 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
3302 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
3303 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
3304 * src/print.c, src/print.h, src/print_graph.c:
3305 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
3306 * src/reduce.h, src/relation.c, src/relation.h:
3307 * src/revision.h, src/scan-code.h, src/scan-code.l:
3308 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
3309 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
3310 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
3311 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
3312 * tests/Makefile.am, tests/actions.at, tests/c++.at:
3313 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
3314 * tests/existing.at, tests/glr-regression.at:
3315 * tests/headers.at, tests/input.at, tests/java.at:
3316 * tests/local.at, tests/output.at, tests/push.at:
3317 * tests/reduce.at, tests/regression.at, tests/sets.at:
3318 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
3319 * tests/torture.at:
3320 Update to GPLv3.
3321
728c4be2
JD
33222007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3323
3324 Get rid of broken %no-parser, -n, and --no-parser implementation and
3325 documentation.
3326 * TODO: Don't mention them.
3327 * doc/bison.1: Likewise.
3328 * doc/bison.texinfo (Decl Summary): Likewise.
3329 (Bison Options): Likewise.
3330 (Option Cross Key): Likewise.
3331 * src/getargs.c (no_parser_flag): Remove global variable.
3332 (usage): Don't print description of -n and --no-parser.
3333 (long_options): Remove --no-parser entry here.
3334 (getargs): Remove -n case in the switch here.
3335 * src/getargs.h (no_parser_flag): Remove extern.
3336 * tests/regression.at (Web2c Actions): Remove comment that mentions
3337 --no-parser.
3338
5d31a216
JD
33392007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
3340
3341 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
3342 name user variables starting with `yy'. Just pass NULL instead of a
3343 dummy local &yylval to yypush_parse.
3344 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
3345 starting with `yy'.
3346
a2ea208d
JD
33472007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
3348
3349 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
3350 true since it's then always used regardless of whether yyoverflow is
3351 defined. Reported by Christian Burger at
3352 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
3353 * THANKS: Add Christian Burger.
3354
91661ebb
JD
3355 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3356 node names: say "Decl Summary" not "Bison Declaration Summary".
3357
cbd50549
JD
33582007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
3359
3360 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
3361 determine whether this function has already complained about an invalid
3362 value for a %define boolean variable, don't check whether Bison has
3363 ever examined the value. As written, the check was a tautology.
3364 Instead, record and check for this complaint using a separate muscle.
3365
eb1b0740
JD
33662007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3367
3368 Fix push parsing memory leak reported by Brandon Lucia at
3369 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
3370 * THANKS: Add Brandon Lucia.
3371 * data/push.c (yypstate_delete): Free the stack if it was reallocated
3372 but the parse never completed and thus freed it.
3373 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
3374 * tests/testsuite.at: Include push.at.
3375 * test/push.at: New.
3376 (Push Parsing: Memory Leak for Early Deletion): New test case.
3377
9d774aff
JD
33782007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
3379
3380 Improve handling of multiple S/R conflicts in the same state and of S/R
3381 conflicts involving multiple reductions.
3382 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
3383 set for a state here or Bison will abort if it is reassigned on a
3384 later conflicted reduction in the same state.
3385 Similarly, don't finalize and assign the solved conflicts report here
3386 or it will be lost if it is reassigned on a later conflicted reduction
3387 in the same state.
3388 (set_conflicts): Instead, assign them both here after all S/R conflicts
3389 in the state have been fully examined.
3390 * src/print.c (shift_set): Rename to...
3391 (no_reduce_set): ... this.
3392 (print_reductions): Update for rename, and add %nonassoc error action
3393 tokens to no_reduce_set so that, when printing the first remaining
3394 reduction on an error action token, the reduction is enclosed in
3395 brackets.
3396 (print_results): Update for rename.
3397 * tests/conflicts.at (Solved conflicts report for multiple reductions
3398 in a state): New test case.
3399 (%nonassoc error actions for multiple reductions in a state): New test
3400 case.
3401
3402 * src/main.c (main): Don't depend on C99 features.
3403
10159d2a
JD
34042007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3405
3406 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
3407 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
3408 uniwidth.
10159d2a 3409
953b3935
JD
34102007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
3411
3412 * bootstrap (slurp): Create target directories that don't exist.
3413 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
3414
6ce2d93a
JD
34152007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3416
3417 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
3418 than item number.
3419 * closure.c (closure): Likewise.
3420 * state.h (reductions): Comment sorting of rules.
3421 (state): Comment sorting of items.
3422
ce3448d5
JD
34232007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
3424
3425 Fix C++ test cases after recent Gnulib changes. Discussed starting at
3426 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
3427 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
3428 definition in order to avoid Gnulib headers since we don't use config.h
3429 here.
3430 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
3431 rather than AT_DATA so that config.h is included.
3432
8a86eef0
JD
34332007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
3434
3435 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
3436 instead of fprintf. Guard these functions with #if YYDEBUG instead of
3437 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
3438 and so that YYFPRINTF is guaranteed to be defined here.
3439
b1a81613
JD
34402007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
3441
3442 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
3443 with...
3444 (muscle_percent_define_check_values): ... this more helpful function.
3445 Again, it's not used yet, but it will be.
3446 * src/muscle_tab.h: Likewise.
3447
71b61d4d
JD
3448 Improve some comments in parser table construction.
3449 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
3450 (generate_states): Don't mention ruleset, which is internal to closure.
3451 * src/closure.c (closure): Explain sorting of core and itemset, which
3452 is required for this function to behave correctly.
3453 * src/closure.h (closure): Mention sorting.
3454
2a6b783d
JD
34552007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
3456
3457 * src/lalr.c (state_lookahead_tokens_count): For code readability,
3458 move the check for disabled transitions to an aver since conflict
3459 resolution hasn't happened yet.
3460
3461 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
3462 labels a state as inconsistent just because it has error transitions.
3463 The original form of this check appeared in revision 1.1 of lalr.c,
3464 which was committed on 1991-12-21. Now (at least), changing the
3465 consistency label on such a state appears to have no useful effect in
3466 any of the places it is examined, which I enumerate below. The key
3467 point to understanding each item in this enumeration is that a state
3468 with an error transition is labelled consistent in the first place only
3469 if it has no rules, so the check cannot matter for states that have
3470 rules. (1) Labelling a state as inconsistent will cause set_conflicts
3471 to try to identify its conflicts, and a state must have *rules* to have
3472 conflicts. (2) Labelling a state as inconsistent will affect how
3473 action_row sets the default *rule* for the state. (3) Labelling a
3474 state as inconsistent will cause build_relations to add lookback edges
3475 to *rules* in that state.
3476 * src/state.h (struct state): Word the comment for member consistent
3477 more carefully.
3478
14462c2b
JD
34792007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3480
3481 Don't depend on C99 features.
3482 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
3483 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
3484 * src/reader.c (check_and_convert_grammar): Fix for-loop.
3485 * src/state.c (state_mark_reachable_states): Fix for-loop.
3486 (state_remove_unreachable_states): Fix for-loop.
3487
3488 Don't widen struct state with member reachable just to temporarily
3489 record reachability. Instead, use a local bitset.
3490 * src/state.h (struct state): Remove member.
3491 * src/state.c (state_new): Don't initialize it.
3492 (state_mark_reachable_states): Rename to...
3493 (state_record_reachable_states): ... this, and use bitset.
3494 (state_remove_unreachable_states): Use bitset.
3495
5a43d418
JD
34962007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
3497
3498 * src/Makefile.am (yacc): Quote target action commands properly so
3499 that the yacc script isn't corrupt. Reported by Hans Aberg at
3500 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
3501
0c650a20
JD
3502 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
3503 the case of pure parsers. Reported by Frans Englich at
3504 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
3505 * THANKS: Add Frans Englich.
3506
61fee93e
JD
3507 * NEWS (2.3a+): In the %code entry, reference section `Bison
3508 Declaration Summary' from the manual now since the %code summary has
3509 moved there.
3510 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
3511 in the rules section must be terminated by semicolons.
3512
f124d423
JD
35132007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
3514
3515 Extend the front-end API for %define variables to more completely
3516 mirror the back-end. This will be useful in the future.
3517 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
3518 Update comments to mention the new front-end counterparts of these
3519 macros.
3520 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
3521 for muscle_string_decode and muscle_location_decode.
3522 (muscle_string_decode): New static function.
3523 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
3524 (muscle_percent_define_get, muscle_percent_define_ifdef): New
3525 functions.
3526 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
3527 muscle_percent_define_get to mimic the b4_percent_define_flag_if
3528 implementation more closely.
3529 (muscle_percent_define_invalid_value): New function.
3530 * src/muscle_tab.h (muscle_percent_define_get,
3531 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
3532 Prototype.
3533
75ad86ee
JD
35342007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3535
3536 * NEWS (2.3a+): Mention yesterday's state-removal change.
3537 (2.3a): Remove the %language entry, which was added after 2.3a.
3538 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
3539 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
3540 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
3541 tests/existing.at: Update copyright date.
3542
5967f0cf
JD
35432007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3544
3545 If conflict resolution makes states unreachable, remove those states,
3546 report rules that are then unused, and don't report conflicts in those
3547 states.
3548 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
3549 New global function.
3550 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
3551 function.
3552 * src/main.c (main): After conflict resolution, remove the unreachable
3553 states and update all data structures that reference states by number.
3554 * src/state.c (state_new): Initialize each state's reachable member to
3555 false.
3556 (state_mark_reachable_states): New static function.
3557 (state_remove_unreachable_states): New global function.
3558 * src/state.h (struct state): Add member bool reachable.
3559 (state_remove_unreachable_states): Prototype.
3560 * tests/conflicts.at (Unreachable States After Conflict Resolution):
3561 New test case.
3562 * tests/existing.at (GNU pic Grammar): Update test case output now that
3563 an unused rule is discovered.
3564
b09f4f48
JD
35652007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3566
3567 Minor code cleanup in parser table construction.
3568 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
3569 (new_itemsets, save_reductions): Update for rename to nitemset.
3570 * src/closure.c (nritemset): Rename to...
3571 (nitemset): ... this since the "r" appears to meaningless and isn't
3572 used in the comments.
3573 (closure): Update for rename.
3574 * src/closure.h (nritemset): Update extern to...
3575 (nitemset): ... this.
3576 * src/lalr.c (LA): Fix a typo in comments.
3577 * src/print.c (print_core): Update for rename to nitemset.
3578 * src/print_graph.c (print_graph): Likewise.
3579 * src/state.h: Fix some typos in header comments.
3580
bbb44d83
PE
35812007-04-04 Paul Eggert <eggert@cs.ucla.edu>
3582
9b33de72
PE
3583 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
3584 still sticks to ASCII. Sorry!
3585
bbb44d83
PE
3586 * README-hacking: New file, taken mostly from coreutils, with changes
3587 for Bison. Contains much of the contents of:
3588 * README-cvs: Remove.
3589 * bootstrap: Sync from gnulib.
3590 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
3591 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
3592
29553547
JD
35932007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
3594
3595 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
3596 Setzer.
3597 (Java Differences): Fix some typos.
3598 * THANKS: Add Sebastian Setzer.
3599
01b477c6
PB
36002007-03-07 Paolo Bonzini <bonzini@gnu.org>
3601
730739e4
AD
3602 * data/java.m4 (b4_single_class_if): Remove.
3603 (b4_abstract_if): Look at "%define abstract".
3604 (b4_lexer_if): New.
3605 (b4_union_name): Rename...
3606 (b4_yystype): ... to this. Map to "%define stype".
3607 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
3608 b4_maybe_throws): Fix quoting.
3609 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
3610 * data/lalr1.java (Lexer interface): Always define.
3611 (Lexer interface within parser class): Remove.
3612 (YYLexer class): New, used when "%code lexer" is present.
3613 (constructor): When "%code lexer" is used, pass %lex-param
3614 to the lexer constructor.
3615 (yylex, yyparse): Remove %lex-param from method invocations
3616 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
3617
3618 * doc/bison.texinfo (Java Bison Interface): Mention "%define
3619 abstract". Rename "%define union_name" to "%define stype".
3620 Rename method names according to previous patch.
3621 (Java Scanner Interface): Describe "%code lexer" instead of
3622 "%pure-parser" and "%define single_class".
3623 (Java Differences): Mention "%code lexer".
3624
3625 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
3626 Include scanner here, using macros from tests/local.at.
3627 (AT_DATA_CALC_Y): Remove final argument.
3628 (_AT_CHECK_JAVA_CALC): Likewise.
3629 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
3630 of %locations and %error-verbose.
3631 (main): Test with and without %lex-param.
3632 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
3633 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 3634
122bea3a
JMG
36352007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3636
3637 DJGPP spefic issue. Inhibit the use of disallowed characters for
3638 file name genertion on Win98, WinXP, etc. These are |<>":?*\
3639 and concern testsuite case 46.
3640 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
3641 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
3642 * djgpp/config.bat: Inhibit the use of disallowed characters.
3643
9611cfa2
JD
36442007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3645
3646 Miscellaneous %define and %code cleanup.
3647 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
3648 values are interpreted.
3649 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
3650 documentation a little more.
3651 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
3652 muscle_percent_define_insert, muscle_percent_code_grow): New
3653 functions/macros.
3654 * src/muscle_tab.h (muscle_percent_define_insert,
3655 muscle_percent_code_grow): Prototype.
3656 * src/parse-gram.y (prologue_declaration): Use
3657 muscle_percent_define_insert and muscle_percent_code_grow when parsing
3658 %define and %code directives.
3659
3660 Make it easy to share %define boolean variables between the front-end
3661 and back-end. Though not used yet, this will be useful in the future.
3662 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
3663 Bison uses of names rather than just skeleton uses of names.
3664 (b4_percent_define_get, b4_percent_define_ifdef): Rename
3665 b4_percent_define_skeleton_variables(VARIABLE) to
3666 b4_percent_define_bison_variables(VARIABLE).
3667 (b4_percent_code_get, b4_percent_code_ifdef): Rename
3668 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
3669 b4_percent_code_bison_qualifiers(QUALIFIER).
3670 (b4_check_user_names_wrap): Update for renames.
3671 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
3672 muscle_percent_define_default): New functions mimicking
3673 b4_percent_define_flag_if and b4_percent_define_default.
3674
3675 For %define variables, report locations for invalid values and
bbb44d83 3676 redefinitions.
9611cfa2
JD
3677 * data/bison.m4 (b4_percent_define_flag_if): Read
3678 b4_percent_define_loc(VARIABLE) to report the location of an invalid
3679 value for VARIABLE.
3680 (b4_percent_define_default): Save a special location in
3681 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
3682 must later be reported as invalid.
3683 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
3684 functions.
3685 (muscle_percent_define_insert): Record the location of VARIABLE in
3686 muscle percent_define_loc(VARIABLE), and use it to report the previous
3687 location for a redefinition.
3688 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
3689 (muscle_percent_define_default): Update like b4_percent_define_default.
3690 (muscle_grow_user_name_list): Rename to...
3691 (muscle_user_name_list_grow): ... this for consistency and use
3692 muscle_location_grow.
3693 * src/muscle_tab.h (muscle_location_grow): Prototype.
3694 * tests/input.at (%define errors): Update expected output.
3695 * tests/skeletons.at (%define boolean variables: invalid skeleton
3696 defaults): New test case.
3697
0bf92491
JD
36982007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
3699
3700 * src/print.c (lookahead_set, state_default_rule): Remove.
3701 (print_reductions): Replace state_default_rule invocation with
3702 equivalent use of yydefact, which was computed in token_actions in
3703 tables.c.
3704 (print_results): Don't allocate lookahead_set.
3705
d3b12988
PB
37062007-02-27 Paolo Bonzini <bonzini@gnu.org>
3707
3708 * data/lalr1.java: Prefix all private members with yy.
3709
f57a7536
JD
37102007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
3711
3712 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 3713 Sebastien Fricker at
f57a7536 3714 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 3715 * THANKS: Add Sebastien Fricker.
f57a7536
JD
3716 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
3717 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
3718 accept a variable number of arguments.
3719
6404a5bf
JD
37202007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3721
3722 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
3723
e4e09639
JMG
37242007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3725
3726 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
3727 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
3728 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
3729
d7e0a1a7
PE
37302007-02-11 Paul Eggert <eggert@cs.ucla.edu>
3731
3732 Undo my 2007-02-07 change, switching back to the c-strcase module
3733 introduced in the 2007-02-03 change. Bruno Haible reported that
3734 the 2007-02-07 change would be dangerous in Turkish if we add a
3735 language whose name contains "i", since "i" is not lowercase "I"
3736 in Turkish.
3737 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
3738 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
3739 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
3740 * m4/.cvsignore: Remove strcase.m4.
3741 * src/getargs.c: Revert 2007-02-07 change, as follows.
3742 Include c-strcase.h.
3743 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
3744
deee93a1
JD
37452007-02-11 Bruno Haible <bruno@clisp.org>
3746
3747 Enable the Java related testsuite tests when the only Java compiler
3748 found is a gcj < 4.3. Discussed at
3749 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
3750 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
3751
574add85
JD
37522007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
3753
3754 * data/Makefile.am: Update copyright date.
3755 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
3756 yypstate_new returns NULL.
3757 (yypstate_new): Return NULL if malloc does.
3758 * src/reader.c (packgram): Move translation of rule actions from the
3759 beginning of packgram to...
3760 (check_and_convert_grammar): ... here right before packgram is invoked
3761 so it's easier to write more complete comments, and remove redundant
3762 code.
3763
e785ccf7
JD
37642007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
3765
3766 As in semantic actions, make @$ in %initial-action, %destructor, and
3767 %printer imply %locations.
3768 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
3769 scanning @$.
3770 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
3771 (@$ in %initial-action implies %locations,
3772 @$ in %destructor implies %locations,
3773 @$ in %printer implies %locations): ... these new test cases.
3774
1cfe1ed7
PE
37752007-02-07 Paul Eggert <eggert@cs.ucla.edu>
3776
3777 Undo most of the 2007-02-03 change, switching to the strcase module
3778 now that gnulib strcase has been fixed.
3779 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
3780 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
3781 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
3782 * m4/.cvsignore: Add strcase.m4.
3783 * src/getargs.c: Revert 2007-02-03 change, as follows.
3784 Don't include c-strcase.h.
3785 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
3786 strcasecmp has "unspecified behavior" outside the POSIX locale,
3787 but it works fine in practice if at least one argument is ASCII,
3788 as is the case in Bison.
3789
0049ec86
PB
37902007-02-07 Paolo Bonzini <bonzini@gnu.org>
3791
3792 * tests/java.at: Skip tests if only one of javac/java is present.
3793 Reported by Joel E. Denny.
3794 * tests/atlocal.in: Adjust copyright years.
3795
37962007-02-05 Paolo Bonzini <bonzini@gnu.org>
3797
3798 * data/lalr1.java (Stack): Work around old verifiers that disallow
3799 access to the private fields of an inner class, from the outer class.
3800 We can make Stack's fields public because user code doesn't have access
3801 to the instance of Stack used by parse(). Reported by Paul Eggert.
3802
2c2b7220
PE
38032007-02-03 Paul Eggert <eggert@cs.ucla.edu>
3804
3805 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
3806 the right spot for these files?
3807 * bootstrap.conf (gnulib_modules): Add c-strcase.
3808 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
3809 c-strncasecmp.c.
3810 * src/getargs.c: Include c-strcase.h.
3811 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
3812 to avoid unspecified behavior.
3813
b2b81dae
JD
38142007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
3815
3816 * doc/bison.texinfo (Decl Summary): Correct typo.
3817
c1d19e10
PB
38182007-01-30 Paolo Bonzini <bonzini@gnu.org>
3819
3820 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
3821 Complain if the value does not match empty, "true" or "false".
3822 * data/c++.m4: Adjust default definitions of %define variables.
3823 * data/java.m4: Adjust default definitions of %define variables.
3824 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
3825 to above behavior.
3826 * tests/input.at (Boolean %define variables): Test new behavior.
3827
8405b70c
PB
38282007-01-29 Paolo Bonzini <bonzini@gnu.org>
3829
3830 * NEWS: Mention java.
3831 * TODO: Remove things that are done.
3832 * bootstrap.conf: Add javacomp-script and javaexec-script.
3833 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
3834
3835 * data/Makefile.am: Add new files.
3836 * data/java-skel.m4: New.
3837 * data/java.m4: New.
3838 * data/lalr1.java: New.
3839
3840 * doc/bison.texinfo: Put "A Complete C++ Example" under
3841 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
3842 under Other Languages.
3843
3844 * src/getargs.c (valid_languages): Add Java.
3845 * src/getargs.h (struct bison_language): Update size of string fields.
3846
3847 * tests/Makefile.am: Add java.at.
3848 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
3849 * tests/java.at: New.
3850 * tests/testsuite.at: Include it.
3851
3eb82471
JD
38522007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
3853
3854 Clean up.
3855 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
3856 at_directive_argv arguments so these no longer have to be global
3857 variables. Also, update the implementation for the following changes.
3858 (fail_for_at_directive_too_many_args,
3859 fail_for_at_directive_too_few_args): Add at_directive_name argument.
3860 (at_directive_name): Remove as at_directive_argv[0] will be used for
3861 this now.
3862 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
3863 for the directive name.
3864 (at_directive_argc, at_directive_argv): Make these local within
3865 skel_lex instead of global.
3866 (INITIAL): Update directive start action for above changes.
3867 (SC_AT_DIRECTIVE_ARG): Rename to...
3868 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
3869 (SC_AT_DIRECTIVE_SKIP_WS): Update.
3870 (scan_skel): Move yylex_destroy to...
3871 (skel_scanner_free): ... here.
3872 * tests/skeletons.at (installed skeleton file name): Rename to...
3873 (installed skeleton file names): ... this.
3874
148d66d8
JD
38752007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
3876
3877 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
3878 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
3879 Summary" not "Directives".
3880 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
3881 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
3882 since the former is now the more complete one.
3883 (Prologue Alternatives): Likewise and do the same for %defines.
3884 (Table of Symbols): Add summary of %code, add summary of %define, and
3885 move full %code documentation to...
3886 (Decl Summary): ... here for consistency with other entries in these
3887 sections.
3888 Move %define entry in order to keep this list alphabetized.
3889 Reword %define entry a little to put less emphasis on the skeleton
3890 concept, which most users shouldn't have to think about.
3891
665f0c24
PE
38922007-01-26 Paul Eggert <eggert@cs.ucla.edu>
3893
3894 Adjust to recent gnulib changes.
3895 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
3896 Add string.h, string_.h, unistd_.h, wchar_.h.
3897 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
3898 * src/system.h: Don't include <stpcpy.h>; this is now done by
3899 <string.h>.
3900
592d0b1e
PB
39012007-01-23 Paolo Bonzini <bonzini@gnu.org>
3902
3903 Simplify implementation of unqualified %code, implement macros for
3904 uniform treatment of boolean %define flags. Document %define.
3905 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
3906 b4_percent_code_ifdef): New.
3907 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
3908 * data/c++.m4: Define default value for global_tokens_and_yystype.
3909 * data/glr.cc: Likewise.
3910 * data/location.cc: Use b4_percent_define_flag_if.
3911
148d66d8 3912 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
3913
3914 * src/parse-gram.y (Unqualified %code): Change muscle name to
3915 b4_percent_code().
3916 (content.opt): Default to empty.
3917
a7867f53
JD
39182007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3919
3920 Implement support for relative and absolute skeleton file names.
3921 Discussed starting at
3922 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
3923 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
3924 (Bison Options): Document in --skeleton entry.
3925 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
3926 full_skeleton can't necessarily hold all of pkgdatadir.
3927 If the specified skeleton file name contains a `/', don't prepend
3928 pkgdatadir.
3929 * src/parse-gram.y (prologue_declaration): If the specified skeleton
3930 file name contains a `/', prepend the grammar file directory.
3931 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
3932 * skeletons.at: New file.
3933 (relative skeleton file names): New test case.
3934 (installed skeleton file names): New test case.
3935 * tests/testsuite.at: Include skeletons.at.
3936
3937 * bootstrap: Update copyright to 2007.
3938
830c9b18
PB
39392007-01-17 Paolo Bonzini <bonzini@gnu.org>
3940
3941 * bootstrap: Remove occurrences of .#bootmp from the files.
3942
a8c2e813
AD
39432007-01-17 Akim Demaille <akim@epita.fr>
3944
3945 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
3946 nonterminals.
3947 Use per-type %printer.
3948
279cabb6
JD
39492007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
3950
3951 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
3952 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
3953 djgpp/config.site, src/files.c, src/files.h, src/main.c,
3954 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
3955 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
3956 tests/glr-regression.at, tests/input.at, tests/local.at,
3957 tests/output.at, tests/torture.at: Update copyright to 2007.
3958
bb32f4f2
AD
39592007-01-16 Akim Demaille <akim@epita.fr>
3960
3961 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
3962 error code.
3963 (Calc++ Scanner): Exit with failure if we can't open the input
3964 file.
3965 Accept "-" standing for stdin.
3966 (Calc++ Top Level): Print the result only if the parsing was
3967 successful.
3968
7cff04b5
AD
39692007-01-16 Akim Demaille <akim@epita.fr>
3970
3971 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
3972
a4e25e1d
JD
39732007-01-15 Paolo Bonzini <bonzini@gnu.org>
3974 and Joel E. Denny <jdenny@ces.clemson.edu>
3975
3976 Clean up %define and %code implementation in M4 some. Most
3977 importantly, rename all related macros to be in the b4_percent_define
3978 and b4_percent_code namespaces. Also, complete support for `.' in
3979 %define variable names and %code qualifiers.
3980 * data/bison.m4 (b4_check_user_names): Check for special
3981 "SKELETON-NAMESPACE(name)" macros instead of using two nested
3982 m4_foreach loops.
3983 (b4_get_percent_define, b4_get_percent_code): Rename to...
3984 (b4_percent_define_get, b4_percent_code_get): ... these.
3985 Extend documentation with examples.
3986 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
3987 b4_percent_define_skeleton_variables and
3988 b4_percent_code_skeleton_qualifiers.
3989 Expect any value for the %define variable `foo' to be stored in the
3990 macro named `b4_percent_define(foo)'; expect any %code blocks for the
3991 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
3992 expect any unqualified %code blocks to be stored in a macro named
3993 `b4_percent_code_unqualified'.
3994 Use m4_indir so that %define variable names and %code qualifiers can
3995 contain `.', which is allowed by the grammar parser.
3996 (b4_percent_define_default): New macro to set a default value for a
3997 %define variable.
3998 (m4_wrap): Update wrapped code, and fix some underquoting.
3999 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
4000 Expect grammar uses of %define variables and %code qualifiers to be
4001 defined in b4_percent_define_user_variables and
4002 b4_percent_code_user_qualifiers.
4003 * data/c++.m4: Use b4_percent_define_default rather than
4004 m4_define_default. Fix some underquoting. Skeleton usage of %define
4005 variable define_location_comparison now implies skeleton usage of
4006 %define variable filename_type.
4007 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4008 data/push.c, data/yacc.c: Update macro names.
4009 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
4010 muscle names.
4011
e37c665c
JMG
40122007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4013
4014 DJGPP specific issues.
4015
4016 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
4017 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
4018
7d2d521f
JD
40192007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4020
4021 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
4022 run parsers in all tests so that Valgrind is invoked during
4023 maintainer-check-valgrind.
4024 (Duplicate representation of merged trees): Free all semantic values.
4025 (Duplicated user destructor for lookahead): Likewise.
4026
e0ac9b4b
JD
40272007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4028
4029 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
4030 command-line prefix.
4031 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
4032 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
4033 miss Valgrind messages.
4034 (Exploding the Stack Size with Malloc): Likewise.
4035
78143faa
JD
40362007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
4037
4038 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
4039 locals. Reported by Juan Manuel Guerrero at
4040 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
4041 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
4042 Fix some indentation also.
4043 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
4044 explaining this issue.
4045
7ecec4dd
JD
40462007-01-09 Paolo Bonzini <bonzini@gnu.org>
4047 and Joel E. Denny <jdenny@ces.clemson.edu>
4048
4049 Simplify union and prologue handling, and escape union and lex/parse
4050 params with digraphs.
4051 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
4052 values to the empty string since these are no longer guaranteed
4053 initialized by the front-end.
4054 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
4055 braces around b4_user_stype since this is no longer done by the
4056 front-end.
4057 * src/files.c, src/files.h (pre_prologue_obstack,
4058 post_prologue_obstack): Remove.
4059 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
4060 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
4061 with digraphs. This fixes lex params and parse params.
4062 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
4063 * src/output.c (prepare): Remove muscle insertion of the prologues.
4064 (output): Remove freeing of pre_prologue_obstack and
4065 post_prologue_obstack.
4066 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
4067 than prologue_augment for prologue parsing so you don't need prologue
4068 obstacks.
5c80250c
JD
4069 (grammar_declaration): For %union RHS, use `braceless' instead of
4070 "{...}" so that braces are already stripped and code is escaped with
4071 digraphs.
7ecec4dd
JD
4072 * src/reader.c (prologue_augment): Remove.
4073 (reader): Remove initialization of pre_prologue_obstack and
4074 post_prologue_obstack.
4075 * src/reader.h (prologue_augment): Remove.
4076
4077 * data/c.m4: Remove stray parenthesis.
4078
16dc6a9e
JD
40792007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4080
4081 Remove quotes from variables names in %define directives and from
4082 qualifiers in %code directives, and restrict the characters that are
4083 allowed in them to M4-friendly ones. For %define, continue to support
4084 the quoted form as a deprecated feature. Discussed starting at
4085 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
4086 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
4087 %code.
4088 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
4089 (Decl Summary): In %defines entry, update mention of `%code requires'
4090 and `%code provides'.
16dc6a9e
JD
4091 (C++ Location Values): Update %define uses.
4092 (Calc++ Parser Interface): Likewise.
4093 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 4094 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
4095 * src/parse-gram.y (prologue_declaration): For %define variables, use
4096 `variable' instead of `STRING'.
4097 (grammar_declaration): For %code qualifiers, use `ID' instead of
4098 `STRING'.
4099 (variable): New nonterminal that takes an `ID' or a `STRING'.
4100 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
4101 and %define uses.
4102 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
4103 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
4104 (%define errors): Update %define uses.
4105
e9813cd4
JD
41062007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4107
4108 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
4109 instead of muscle_insert for %define values so that M4-special
4110 characters are replaced with digraphs.
4111 * tests/input.at (%define errors): Extend to check weird values.
4112
6afc30cc
JD
41132007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4114
4115 Instead of having skeletons declare all valid %define variables and
4116 %code qualifiers, provide macros that retrieve the associated values
4117 and build these lists automatically. Thus Bison will now warn when a
4118 variable or qualifier is not used by the skeleton in the current
4119 invocation regardless of whether it might sometimes be used by that
4120 skeleton in other invocations. Also, move all %define value macros to
4121 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
4122 form, which is replaced by %code.
4123 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
4124 (b4_check_user_names): ... this, and change the series of valid name
4125 arguments to a single list argument for names used in the skeleton
4126 similar to the existing list argument for names used in the grammar.
4127 Warn instead of complaining.
4128 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
4129 values and %code code, to format %code code properly, and to build
4130 lists of all %define variables and %code qualifiers used in the
4131 skeleton: b4_skeleton_percent_define_variables and
4132 b4_skeleton_percent_code_qualifiers.
4133 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
4134 Remove, and...
4135 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
4136 the skeleton names lists can finish building first. In place of
4137 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
4138 expect the lists b4_user_percent_define_variables and
4139 b4_user_percent_code_qualifiers.
4140 * data/c++.m4: Where setting default values for b4_parser_class_name,
4141 b4_location_type, b4_filename_type, b4_namespace, and
4142 b4_define_location_comparison, update their names to the
4143 b4_percent_define_ namespace.
4144 * data/glr.c: Don't use b4_check_percent_define_variables and
4145 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
4146 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
4147 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 4148 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
4149 * data/location.cc: Use b4_get_percent_define.
4150 * data/push.c: Don't use b4_check_percent_define_variables and
4151 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
4152 * data/yacc.c: Likewise, and don't call m4_exit in
4153 b4_use_push_for_pull_if or m4_wrap code will never execute.
4154 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
4155 Rename to...
4156 (muscle_grow_user_name_list): ... this for consistency with the
4157 terminology used in bison.m4.
4158 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
4159 %define variable names, and rename muscle used_percent_define_variables
4160 to user_percent_define_variables.
4161 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
4162 user_percent_code_qualifiers.
4163 (content): Remove.
4164 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
4165 {CODE} form is no longer accepted.
4166 * tests/input.at (Reject bad %code qualifiers): Rename to...
4167 (Reject unused %code qualifiers): ... this, and update test output.
4168 (%define error): Update test output.
4169
7eb8a0bc
JD
41702007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
4171
4172 Check for unrecognized %define variables similar to checking for
4173 unrecognized %code qualifiers. Check for redefined %define variables.
4174 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
4175 generalizes...
4176 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
4177 (b4_check_percent_define_variables): New, also wraps it.
4178 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
4179 variables using b4_check_percent_define_variables.
4180 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
4181 all those exercised in the test suite and all those listed in the
4182 `Default values' section of c++.m4. Are there others?
4183 * data/push.c, data/yacc.c: Declare no valid %define variables.
4184 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
4185 similar to muscle_find, but it works even when the muscle stores a
4186 const value.
4187 (muscle_grow_used_name_list): New function for constructing the used
4188 name list muscles that b4_check_for_unrecognized_names requires.
4189 * src/parse-gram.y (prologue_declaration): Warn if a variable is
4190 %define'd more than once. Define the b4_used_percent_define_variables
4191 muscle with muscle_grow_used_name_list.
4192 (grammar_declaration): Abbreviate %code code with
4193 muscle_grow_used_name_list.
4194 * tests/input.at (%define errors): New.
4195
3fc65ead
JD
41962007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4197
4198 Provide warn_at, complain_at, and fatal_at function callbacks to the
4199 skeletons, and use this for %code qualifier complaints.
4200 * data/bison.m4 (b4_error_at): New, invoked by...
4201 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
4202 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
4203 @fatal_at(...@) directives.
4204 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
4205 qualifiers in b4_used_percent_code_qualifiers and to use
4206 b4_complain_at.
4207 * src/location.c, src/location.h (boundary_set_from_string): New global
4208 function.
4209 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
4210 function.
4211 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
4212 to b4_used_percent_code_qualifiers.
4213 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
4214 function.
4215 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
4216 (lineno): Rename to...
4217 (out_lineno): ... this so I don't misunderstand it again.
4218 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
4219 here; these newlines are in the input but not the output file.
4220 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
4221 (at_directive_perform): ... this new static function, and add handling
4222 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
4223 directives.
4224 * tests/input.at (Reject bad %code qualifiers): Update test output with
4225 locations and extend.
4226
4227 * tests/output.at (Output file name: [, Output file name: ]): Remove
4228 bogus comment about these tests failing.
4229
1c7b7e1d
JD
42302007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4231
4232 Clean up b4_check_percent_code_qualifiers a little.
4233 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
4234 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
4235 documentation and add examples.
4236 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
4237 qualifiers here.
4238
08af01c2
JD
42392007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
4240
4241 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
4242 unreliable -- especially when they're hidden inside another macro.
4243 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
4244 data/c.m4: Remove m4_divert(-1).
4245 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
4246 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
4247 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 4248 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
4249 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
4250 pushed and popped by m4sugar, should be first on the stack.
4251
4252 Provide warn, complain, and fatal function callbacks to the skeletons.
4253 This provides more flexibility than m4_fatal, improves the error
4254 message format, and captures messages for translation. Discussed
4255 starting at
4256 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
4257 * data/bison.m4 (b4_error): New, invoked by...
4258 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
4259 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
4260 directives. Because these M4 macros might be called when the current
4261 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
4262 the previous removal of uses of m4_divert, which caused trouble.
4263 (b4_check_percent_code_qualifiers): Use b4_complain instead of
4264 m4_fatal to report unrecognized %code qualifiers.
4265 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
4266 push parser requests.
4267 * data/glr.c: Use b4_complain instead of m4_fatal to report
4268 non-deterministic push parser requests.
4269 Update @output usage to @output(...@) form.
4270 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
4271 report missing %defines. Update @output usage to @output(...@) form.
4272 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
4273 @output(...@) form.
4274 * src/main.c (main): Invoke skel_scanner_free.
4275 * src/scan-skel.h (skel_scanner_free): Prototype new function.
4276 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
4277 obstack_for_string from flex-scanner.h.
4278 (YY_DECL): Use to declare skel_lex static.
4279 (decode_at_digraphs): Remove; now handled in the new
4280 SC_AT_DIRECTIVE_ARG start condition.
4281 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
4282 functions.
4283 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
4284 at_directive_argv): New static globals.
4285 (INITIAL): Use fail_for_invalid_at.
4286 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
4287 recognize the start of a generalized `@directive(...@)' form and
4288 start...
4289 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
4290 directive args (using the new obstack_for_string), to decode the
4291 contained @ diagraphs, and to perform the directive. It recognizes
4292 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
4293 @output(...@).
4294 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
4295 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
4296 `@,'.
4297 (scan_skel): Initialize obstack_for_string on the first call.
4298 (skel_scanner_free): New function to free obstack_for_string.
4299 * tests/input.at (Reject bad %code qualifiers): Update test output.
4300
8e0a5e9e
JD
43012007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
4302
4303 Consolidate the 4 prologue alternative directives (%code, %requires,
4304 %provides, and %code-top) into a single %code directive with an
4305 optional qualifier field. Discussed at
4306 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
4307 * NEWS (2.3a+): Rewrite the existing entry for the prologue
4308 alternatives.
4309 * doc/bison.texinfo (Prologue Alternatives): Update.
4310 (Decl Summary): Update to %code "requires" and %code "provides".
4311 (Calc++ Parser): Update to %code "requires".
148d66d8 4312 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
4313 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
4314 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
4315 are replaced by b4_percent_code_provides and b4_percent_code_requires,
4316 which are skeleton-specific.
4317 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
4318 declare what %code qualifiers it supports and to complain if any other
4319 qualifiers were used in the grammar.
4320 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
4321 and b4_user_code([b4_percent_code_provides]) in place of
4322 b4_user_requires and b4_user_provides.
4323 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
4324 Add b4_user_code([b4_percent_code_top]) and
4325 b4_user_code([b4_percent_code]).
4326 Invoke b4_check_percent_code_qualifiers.
4327 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4328 PERCENT_REQUIRES): Remove.
4329 (grammar_declaration): Remove RHS's for %code-top, %provides, and
4330 %requires. Rewrite the %code RHS as the unqualified form defining the
4331 muscle b4_percent_code. Add another RHS for the qualified %code form,
4332 which defines muscles of the form b4_percent_code_QUALIFIER and the
4333 b4_used_percent_code_qualifiers muscle.
4334 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
4335 PERCENT_REQUIRES): Remove.
4336 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
4337 %code "requires" and %code "provides".
4338 * tests/input.at (Reject bad %code qualifiers): New.
4339
95021767
JD
43402007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
4341
4342 Use the new code_props interface for destructors and printers.
4343 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
4344 printer_location members, and change the type of the destructor and
4345 printer members to code_props.
4346 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
4347 symbol_printer_get, semantic_type_destructor_set,
4348 semantic_type_printer_set, default_tagged_destructor_set,
4349 default_tagless_destructor_set, default_tagged_printer_set,
4350 default_tagless_printer_set): Use code_props in arguments and return
4351 types in place of char const * and location.
4352 (symbol_destructor_location_get, symbol_printer_location_get): Remove
4353 since the locations are now contained in the return of
4354 symbol_destructor_get and symbol_printer_get.
4355 * src/output.c (symbol_destructors_output, symbol_printers_output):
4356 Replace with...
4357 (symbol_code_props_output): ... this to eliminate duplicate code.
4358 (output_skeleton): Update to use symbol_code_props_output.
4359 * src/reader.c (symbol_should_be_used): Update use of
4360 symbol_destructor_get.
4361 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
4362 Update uses of the various _destructor_set and _printer_set functions.
4363 * src/symtab.c: (default_tagged_destructor_location,
4364 default_tagless_destructor_location, default_tagged_printer_location,
4365 default_tagless_printer_location): Remove since we...
4366 (default_tagged_destructor, default_tagless_destructor,
4367 default_tagged_printer, default_tagless_printer): ... change the type
4368 of these to code_props.
4369 (symbol_new, semantic_type_new, symbol_destructor_set,
4370 semantic_type_destructor_set, symbol_destructor_get,
4371 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
4372 symbol_check_alias_consistency, default_tagged_destructor_set,
4373 default_tagless_destructor_set, default_tagged_printer_set,
4374 default_tagless_printer_set): Update.
4375 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
4376 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
4377 code_props members.
4378 (symbol_print): Use SYMBOL_CODE_PRINT.
4379
f6857bbf
JD
43802007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
4381
4382 Use the new code_props interface for rule actions.
4383 * src/symlist.h (symbol_list): Replace action, action_location, and
4384 used members with a code_props action_props member.
4385 * src/reader.c (symbol_should_be_used, grammar_rule_check,
4386 grammar_midrule_action, grammar_current_rule_merge_set,
4387 grammar_current_rule_symbol_append, packgram): Update.
4388 * src/scan-code.h (translate_rule_action): Remove, no longer used.
4389 * src/scan-code.l (handle_action_dollar): Update.
4390 (translate_rule_action): Remove, no longer used.
4391 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
4392
7c0c6181
JD
43932007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4394
4395 Use the new code_props interface in parse-gram.y.
4396 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
4397 Update all uses of translate_* functions to use the new code_props
4398 interface and to use gram_scanner_last_string_free and
4399 code_scanner_last_string_free where possible.
4400 (grammar_declaration): symbol_list_destructor_set and
4401 symbol_list_printer_set now perform the translation, so don't do it
4402 here. Use gram_scanner_last_string_free where possible.
4403 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
4404 translate_code): Remove, no longer used.
4405 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
4406 symbol_list_printer_set): Perform code translation here rather than
4407 depending on the caller to do so.
4408
4409 * src/symlist.h (struct symbol_list): Correct some documentation typos.
4410 * src/scan-gram.h (gram_last_string): Remove declaration.
4411 * src/scan-gram.l (last_string): Declare it static.
4412
28e52c0d
JD
44132007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4414
4415 Encapsulate code properties and related functionality for the various
4416 destructors, printers, and actions into a code_props structure and
4417 interface. This patch merely implements code_props in scan-code.h and
4418 scan-code.l. Future patches will rewrite other modules to use it.
4419 Discussed starting at
4420 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
4421 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
4422 consistently initialize const structs that have an empty location
4423 field.
4424 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
4425 to ensure consistency.
4426 * src/scan-code.h (code_props): New structure.
4427 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
4428 function, macro, and const global variable for initializing a
4429 code_props with no code.
4430 (code_props_plain_init, code_props_symbol_action_init,
4431 code_props_rule_action_init, code_props_translate_code): The rest of
4432 the new code_props functional interface. Among other things, the init
4433 functions set the code_props kind field so that
4434 code_props_translate_code will know whether to behave like
4435 translate_symbol_action, translate_rule_action, or translate_code.
4436 These old translate functions must remain until all other modules are
4437 updated to use the new code_props interface.
4438 (code_scanner_last_string_free): New function similar to
4439 gram_scanner_last_string_free.
4440 (code_scanner_free): Add documentation.
4441 * src/scan-code.l: Implement the new interface.
4442 (code_lex): Make it static, add a code_props* argument, and remove the
4443 rule argument.
4444 (last_string): New static global similar to the one in scan-gram.l.
4445 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
4446 instead of rule.
4447 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
4448 code_props since Bison may one day use this information for destructors
4449 and printers.
4450 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
4451 (handle_action_dollar): Use symbol_list_n_get and set used flag
4452 directly since symbol_list_n_used_set is removed.
4453 (translate_action): Add a code_props* argument and remove the rule,
4454 action, and location arguments. Pass the code_props* on to code_lex.
4455 (translate_rule_action, translate_symbol_action, translate_code):
4456 Rewrite as wrappers around the new code_props interface.
4457 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
4458 it would eventually need to break the encapsulation of code_props.
4459
96034983
JD
44602007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
4461
4462 * etc/.cvsignore: New.
4463
945e396c
JD
44642007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
4465
4466 Add maintainer-push-check to run maintainer-check using push parsing in
4467 place of pull parsing where available.
4468 * Makefile.am (maintainer-push-check): New.
4469 * data/bison.m4 (b4_use_push_for_pull_if): New.
4470 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
4471 appropriately based on their existing values.
4472 (yypush_parse): Don't print push-parser-specific diagnostics if push
4473 parsing is being used in place of pull parsing.
4474 * data/yacc.c: If push parsing should replace pull parsing, redirect to
4475 push.c.
4476 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
4477 variable, and insert b4_use_push_for_pull_flag into muscles.
4478 * tests/Makefile.am (maintainer-push-check): New.
4479
7d596384
JD
44802006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4481
4482 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
4483 (whether successful or failed) so that yypush_parse can be invoked
4484 again to start a new parse using the same yypstate.
4485 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
4486 check multiple yypull_parse invocations on the same yypstate. For pull
4487 mode, extend to check multiple yyparse invocations.
4488 (Exploding the Stack Size with Alloca): Extend to try with
4489 %push-pull-parser.
4490 (Exploding the Stack Size with Malloc): Likewise.
4491
4492 * tests/calc.at (Simple LALR Calculator): Don't specify
4493 %skeleton "push.c" since %push-pull-parser implies that now.
4494 * tests/headers.at (export YYLTYPE): Don't check for the push
4495 declarations. Otherwise, this test case can't be used to see if push
4496 mode can truly emulate pull mode.
4497 * tests/input.at (Torturing the Scanner): Likewise.
4498 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
4499 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
4500 AT_YACC_IF, which now includes the case of push mode since %skeleton
4501 need not be used for push mode. This will be more intuitive once
4502 push.c is renamed to yacc.c.
4503
7172e23e
JD
45042006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
4505
4506 For push mode, convert yyparse from a macro to a function, invoke yylex
4507 instead of passing a yylexp argument to yypull_parse, and don't
4508 generate yypull_parse or yyparse unless %push-pull-parser is declared.
4509 Discussed starting at
4510 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
4511 * data/bison.m4 (b4_pull_if): New.
4512 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
4513 * data/push.c: Improve M4 quoting a little.
4514 (b4_generate_macro_args, b4_parenthesize): Remove.
4515 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
4516 any time a pull parser is requested.
4517 Don't #define this as a wrapper around yypull_parse. Instead, when
4518 both push and pull are requested, make it a function that does that
4519 same thing.
4520 (yypull_parse): If there's a b4_prefix, #define this to
4521 b4_prefix[pull_parse] when both push and pull are requested.
4522 Don't define this as a function unless both push and pull are
4523 requested.
4524 Remove the yylexp argument and hard-code yylex invocation instead.
4525 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
4526 %push-parser.
4527 * src/getargs.c (pull_parser): New global initialized to true.
4528 * getargs.h (pull_parser): extern it.
4529 * src/output.c (prepare): Insert pull_flag muscle.
4530 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
4531 (prologue_declaration): Set both push_parser and pull_parser = true for
4532 %push-pull-parser. Set push_parser = true and pull_parser = false for
4533 %push-parser.
4534 * src/scan-gram.l: Don't accept %push_parser as an alternative to
4535 %push-parser since there's no backward-compatibility concern here.
4536 Scan %push-pull-parser.
4537 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
4538 instead of %push-parser.
4539 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
4540 prototype it in the module that calls yyparse.
4541 * tests/input.at (Torturing the Scanner): Likewise.
4542 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
4543
2e7944cb
JD
45442006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
4545
4546 Update etc/bench.pl. Optimize push mode a little (the yyn change
4547 deserves most of the credit).
4548 * Makefile.am (SUBDIRS): Add etc subdirectory.
4549 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
4550 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
4551 yytoken, yyval, and yyloc declarations to...
4552 (yyparse or yypush_parse): ... here to improve performance. For
4553 yypush_parse invocations after the first, be sure to assign yyn its old
4554 value again.
4555 (yypstate_new): Don't bother initializing the yyresult field since the
4556 initial value isn't used.
4557 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
4558 remove the #define that, in push mode, set it to yyps->NAME.
4559 * etc/Makefile.am: New.
4560 * etc/bench.pl: Remove and build it instead from...
4561 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
4562 "tests/bison" from the build directory by default rather than just
4563 invoking "bison" from $PATH.
4564 (calc_grammar): Update push parser code: don't declare yylval globally,
4565 don't define yyparse_wrapper, and don't #define yyparse.
4566 (bench_grammar): Update to check all working combinations of yacc.c,
4567 push.c, impure, pure, pull, and push.
4568
c3d50342
JD
45692006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4570
4571 For push mode, add pull wrappers around yypush_parse.
4572 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
4573 (yypull_parse): New function wrapping yypush_parse.
4574 (yyparse): New #define wrapping yypull_parse.
4575 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
4576 is declared.
4577 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
4578 prototype yylex in the module that calls yyparse, and don't prototype
4579 yyparse there. Otherwise, the yyparse expansion won't compile.
4580 * tests/input.at (Torturing the Scanner): Likewise.
4581
94ebeba5
JD
45822006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
4583
4584 Enable push parsers to operate in impure mode. Thus, %push-parser no
4585 longer implies %pure-parser. The point of this change is to move
4586 towards being able to test the push parser code by running the entire
4587 test suite as if %push-parser had been declared.
4588 * data/push.c (yypush_parse): For impure mode, remove the
4589 yypushed_char, yypushed_val, and yypushed_loc arguments.
4590 Instead, declare these as local variables initialized to the global
4591 yychar, yylval, and yylloc.
4592 For the first yypush_parse invocation only, restore the initial values
4593 of these global variables when it's time to read a token since they
4594 have been overwritten.
4595 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
4596 %push-parser.
4597 * tests/calc.at (Simple LALR(1) Calculator): Always declare
4598 %pure-parser along with %push-parser since this test case was designed
4599 for pure push parsers.
4600 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
4601 (AT_YACC_OR_PUSH_IF): New.
4602 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
4603 add a note that it's still wrong for some cases (as it has been for a
4604 while).
4605 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
4606 %push-parser no longer implies %pure-parser.
4607
a0633178
JD
46082006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4609
4610 Remove some unnecessary differences between the pull parser code and
4611 the push parser code. This patch enables yynerrs in push mode.
4612 * data/push.c: Reformat M4 a little.
4613 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
4614 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
4615 because push mode is on. Instead, if pure mode is on, move yynerrs
4616 to...
4617 (b4_declare_parser_state_variables): ... here.
4618 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
4619 to yyps->NAME so it can be used in yypush_parse.
4620 (yypush_parse): Don't omit uses of yynerrs in push mode.
4621
8646b6a3
JD
46222006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4623
4624 Fix bug such that the first pushed token's value and location are
4625 sometimes overwritten (sometimes by %initial-action) before being used.
4626 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
4627 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
4628 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
4629 more closely mimic the pull parser logic.
4630 Don't copy the pushed token to yychar, yylval, and yylloc until it's
4631 time to read a token, which is after any initialization of yylval and
4632 yylloc.
4633 (gottoken): Rename label to...
4634 (yyread_pushed_token): ... for clarity and to avoid infringing on the
4635 user namespace.
4636
9baf4d74
JD
46372006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
4638
4639 Rearrange initialization of the parser state variables so that the
4640 skeleton doesn't have to have a copy for pull mode and another for push
4641 mode. This patch also fixes at least a bug such that yylloc was not
4642 initialized (with b4_location_initial_line and
4643 b4_location_initial_column) upon calling yypush_parse. However, that
4644 initialization now overwrites the first token's location;
4645 %initial-action assigning @$ already did the same thing, and both bugs
4646 will be fixed in a later patch.
4647 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
4648 (b4_declare_parser_state_variables): Remove initialization of yytoken,
4649 yyss, yyvs, yyls, and yystacksize.
4650 (yypstate_new): Remove initialization of some yypstate fields: yystate,
4651 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
4652 yylsp.
4653 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
4654 yyps->NAME so it can be used in yypush_parse.
4655 (yyparse or yypush_parse): For yypush_parse, don't print the
4656 "Starting parse" diagnostic for invocations after the first.
4657 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
4658 yypush_parse, only do it for the first invocation.
4659 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
4660 initialization to occur in yypush_parse but only on the first
4661 invocation.
4662
23522164
JD
46632006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4664
4665 * data/push.c: Add CPP guards around push parser declarations in both
4666 the header and the code file.
4667 In the code file, move the push parser declarations to the same place
4668 they appear in the header file.
4669 Clean up the M4 some, especially the inconsistent underquoting in
4670 some b4_c_function_def and b4_c_function_decl uses.
4671
bb010fe5
JD
46722006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4673
4674 Encapsulate the push parser state variables into an M4 macro so the
4675 push skeleton doesn't have to list them again for pull mode's yyparse.
4676 For push mode, remove yypush_parse's local equivalents of these
4677 variables to eliminate unnecessary copying between the two sets at
4678 run-time. This patch also fixes at least a bug related to multiple
4679 %initial-action invocations in push mode.
4680 * data/push.c (b4_declare_parser_variables): Rename to...
4681 (b4_declare_scanner_communication_variables): ... this for clarity and
4682 update both uses.
4683 (b4_declare_yyparse_variables): Remove and move its contents to the one
4684 spot where it was invoked.
4685 (b4_declare_parser_state_variables): New macro containing the parser
4686 state variables required by push mode.
4687 (struct yypstate): Replace all fields but yynew with
4688 b4_declare_parser_state_variables.
4689 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
4690 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
4691 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
4692 (yyparse or yypush_parse): For yyparse in pull mode, replace local
4693 parser state variable declarations with
4694 b4_declare_parser_state_variables.
4695 Don't initialize parser state variables when calling yypush_parse since
4696 yypstate_new already does that.
4697 Invoke the user's initial action only upon the first yypush_parse
4698 invocation.
4699 Remove all code that copies between the local parser state variables
4700 and the yypstate.
4701
2d212f8c
JD
47022006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
4703
4704 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
4705 prevent a name collision in a future patch where these names will
4706 sometimes be #define'd.
4707 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
4708 since it no longer has the same name as the existing argument.
4709 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
4710
e6e704dc
JD
47112006-12-19 Paolo Bonzini <bonzini@gnu.org>
4712 and Joel E. Denny <jdenny@ces.clemson.edu>
4713
4714 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4715 that the argument is case-insensitive, and there's no `=' here.
4716 For the %skeleton entry, mention that %language is better.
4717 (Bison Options): Likewise for --language and --skeleton. Move the
4718 --skeleton entry so that the `Tuning the parser' section is sorted
4719 alphabetically on long options.
4720 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
4721 %language directive in detail here; cross-reference the %language
4722 documentation instead.
4723 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
4724 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 4725 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
4726 * examples/extexi (normalize): Instead of replacing every %require
4727 argument with the current Bison version, just substitute for
4728 `@value{VERSION}'. This guarantees that we're testing what actually
4729 appears in the documentation.
4730 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
4731 rather than `@VERSION@'.
4732
0e021770
PE
47332006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4734
fd575f05
PE
4735 * NEWS: Reword the %language news a bit, and put it earlier.
4736
0e021770
PE
4737 * src/getargs.c (skeleton_arg): Last arg is now location const *.
4738 Rewrite to simplify the logic.
4739 (language_argmatch): Likewise.
fd575f05
PE
4740 (program_name): We now own this var.
4741 * src/getargs.h (struct bison_language): Use char[] rather than
4742 const char *.
0e021770
PE
4743
4744 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
4745 Java is supported.
4746 * src/complain.c (program_name): Remove decl; no longer needed.
4747 * src/main.c (program_name): Remove; now belongs to getargs.
4748
47492006-12-18 Paolo Bonzini <bonzini@gnu.org>
4750
4751 * NEWS: Document %language.
4752
4753 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
4754
4755 * data/c-skel.m4, data/c++-skel.m4: New files.
4756 * data/glr.c: Complain on push parsers.
4757
4758 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
4759 over %skeleton.
148d66d8 4760 (Decl Summary): Document %language and %skeleton.
0e021770
PE
4761 (Command line): Document -L.
4762
4763 * examples/extexi: Rewrite %require directive.
4764 * examples/calc++/Makefile.am: Pass VERSION to extexi.
4765
4766 * src/files.c (compute_exts_from_gc): Look in language structure
4767 for .y extension.
4768 (compute_file_name_parts): Check whether .tab should be added.
4769 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
4770 (language, skeleton_arg, language_argmatch): New.
4771 (long_options): Add --language.
4772 (getargs): Use skeleton_arg, add -L/--language.
4773 * src/getargs.h: Include location.h.
4774 (struct bison_language, language, skeleton_arg, language_argmatch): New.
4775 * src/output.c (prepare): Pick default skeleton from struct language.
4776 Don't dispatch C skeletons here.
4777 * src/parse-gram.y (PERCENT_LANGUAGE): New.
4778 (prologue_declaration): Add "%language" rule, use skeleton_arg.
4779 * src/scan-gram.l ("%language"): New rule.
4780
4781 * tests/calc.at: Test %skeleton and %language.
4782 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
4783 (AT_GLR_IF): Look for %skeleton "glr.cc".
4784 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
4785 (AT_YACC_IF): Reject %language.
4786
5691bf57
PE
47872006-12-18 Paul Eggert <eggert@cs.ucla.edu>
4788
db06f0ce
PE
4789 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
4790 since it wasn't used; only the typedef name 'semantic_type' is needed.
4791 Also, omit trailing white space.
4792
5691bf57
PE
4793 * bootstrap: Sync from coreutils.
4794 (gnulib_extra_files): Add build-aux/announce.gen.
4795 (slurp): Adjust .gitignore files like .cvsignore files.
4796 * build-aux/announce-gen: Remove from CVS, since bootstrap
4797 now creates this.
4798
791934e4
JD
47992006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
4800
4801 Make %push-parser imply %pure-parser. This fixes several bugs; see
4802 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
4803 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
4804 pure_parser = true.
4805 * data/push.c: Don't bother testing b4_push_if when deciding whether
4806 to expand b4_declare_parser_variables globally.
4807 (yypush_parse): Likewise in here.
4808
4809 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
4810 (yy_reduce_print): Reformat M4 for readability.
4811
ee5abb37
JD
48122006-12-15 Bob Rossi <bob@brasko.net>
4813 and Joel Denny <jdenny@ces.clemson.edu>
4814
4815 * data/push.c (yypstate): Add typedef, and update all uses of
4816 struct yypstate to just yypstate.
4817 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
4818
16ca01f9
JD
48192006-12-14 Bob Rossi <bob@brasko.net>
4820
4821 * data/push.c (yypush_parse): Declare prototype regardless of
4822 %locations option.
4823
ab8e7e1a
JD
48242006-12-14 Bob Rossi <bob@brasko.net>
4825
4826 * data/push.c (yyparse): Remove the prototype and the #define when in
4827 push-parser mode.
4828
9bf32be3
JD
48292006-12-13 Bob Rossi <bob@brasko.net>
4830
4831 * data/push.c (yypstate_init): Rename to...
4832 (yypstate_new): ... this and use b4_c_function_def.
4833 (yypstate_delete): New.
4834 (yypush_parse): Change parameters yynval and yynlloc to be const.
4835 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
4836 yypstate_delete functions.
4837
f02e2948
JD
48382006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
4839
4840 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
4841 strange test case titles. Reported by Bob Rossi.
4842
38eb7751
PE
48432006-12-13 Paul Eggert <eggert@cs.ucla.edu>
4844
4845 * TODO: Add pointer to Sylvain Schmitz's work on static detection
4846 of potential ambiguities in GLR grammers.
4847
bd9d212b
JD
48482006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
4849
4850 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
4851 `bison ', use m4_index instead of m4_substr since chopping up a string
4852 containing M4-special characters causes problems here.
4853
4854 Fix a couple of bugs related to special characters in user-specified
4855 file names, and make it easier for skeletons to compute output file
4856 names with the same file name prefix as Bison-computed output file
4857 names.
4858 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
4859 b4_parser_file_name and b4_spec_defines_file instead of
4860 @output_parser_name@ and @output_header_name@, which are now redundant.
4861 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
4862 b4_parser_file_name, b4_spec_defines_file, and the new
4863 @basename(FILENAME@) instead of @output_parser_name@ and
4864 @output_header_name@, which inappropriately escaped the file names as
4865 C string literals.
4866 * src/files.c (all_but_ext): Remove static qualifier.
4867 (compute_output_file_names): Move `free (all_but_ext)' to...
4868 (output_file_names_free): ... here since all_but_ext is needed later.
4869 * src/files.h (all_but_ext): Extern.
4870 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
4871 exactly what MUSCLE_INSERT_STRING used to do.
4872 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
4873 characters are escaped properly.
4874 * src/output.c (prepare): Define muscle file_name_all_but_ext as
4875 all_but_ext.
4876 For pkgdatadir muscle, maintain previous functionality by using
4877 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
4878 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
4879 digraphs would never be expanded. Hopefully no one has M4-special
4880 characters in his Bison installation path.
4881 * src/scan-skel.l: Don't parse @output_header_name@ and
4882 @output_parser_name@ anymore since they're now redundant.
4883 In @output, use decode_at_digraphs.
4884 Parse a new @basename command that invokes last_component.
4885 (decode_at_digraphs): New.
4886 (BASE_QPUTS): Remove unused.
4887 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
4888 (Output file name): New tests.
4889
3f7ca628
JD
48902006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
4891
4892 Warn about output files that are generated by the skeletons and that
4893 conflict with other output files.
4894 * data/glr.c: Don't generate the header file here when glr.cc does.
4895 * src/files.c (file_names, file_names_count): New static globals.
4896 (compute_output_file_names): Invoke output_file_name_check for files
4897 not generated by the skeletons and remove existing checks.
4898 (output_file_name_check): New function that warns about conflicting
4899 output file names.
4900 (output_file_names_free): Free file_names.
4901 * src/files.h (output_file_name_check): Declare.
4902 * src/scan-skel.l: Invoke output_file_name_check for files generated by
4903 the skeletons.
4904 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
4905 (Conflicting output files): New tests.
4906
178e123e
PE
49072006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4908
4909 * doc/bison.texinfo: Fix a couple of typos.
4910
49112006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
4912
4913 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
4914 Rename to...
4915 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
4916 update all uses.
4917 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
4918 (yypush_parse): Rename yypvars argument to yyps and remove redundant
4919 local pv.
4920 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
4921 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
4922
ea17f233
JD
49232006-12-07 Bob Rossi <bob@brasko.net>
4924 and Joel Denny <jdenny@ces.clemson.edu>
4925
4926 * data/push.c (yypvarsinit): Change return type from void* to struct
4927 yypvars*. No longer cast to void* on return.
4928 (struct yypvars): Remove yylen since it need not be remembered between
4929 yypushparse invocations.
4930 (yypushparse): Don't copy between yylen and pv->yylen.
4931
55a30bda
JD
49322006-12-05 Bob Rossi <bob@brasko.net>
4933
4934 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
4935 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
4936 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
4937 (struct yypvars): Remove b4_declare_parser_variables.
4938 (yypvarsinit): Remove init code for removed variables.
4939 (global scope): Do not declare b4_declare_parser_variables if
4940 push or pure mode.
4941 (yypushparse): Add b4_declare_parser_variables.
4942 Init new local variables, and remove init code for removed
4943 yypvars variables.
4944 (yyparse): Delete.
4945 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
4946 and yyparse for other modes.
4947 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
4948 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
4949 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
4950 (AT_PURE_LEX_IF): True if pure or push parser.
4951
85894313
JD
49522006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
4953
4954 Document Yacc prologue alternatives and default %destructor's and
4955 %printer's as experimental. Don't mention Java yet. Discussed at
4956 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
4957 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
4958 (2.3a): Annotate this entry to say the old forms of these features were
4959 also experimental.
4960 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 4961 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
4962 of Java (we'll want this back eventually).
4963
02975b9a
JD
49642006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4965
4966 Support a file name argument to %defines. Deprecate `=' in
4967 %file-prefix, %name-prefix, and %output. Discussed at
4968 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
4969 * NEWS (2.3a+): Mention.
148d66d8 4970 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
4971 form of %defines, and remove `=' from entries for %file-prefix,
4972 %name-prefix, and %output.
4973 * src/parse-gram.y (prologue_declaration): Implement.
4974 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
4975 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
4976 all but one occurrence of %name-prefix.
4977 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
4978 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
4979 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
4980 occurrence of each of %file-prefix and %output. Add check for %defines
4981 with argument.
4982 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
4983 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
4984 Remove the `=' from %output.
4985
287b314e
JD
49862006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
4987
4988 Don't escape $ in test case titles since Autoconf 2.61 now does that
4989 correctly.
4990 * tests/actions.at (Default %printer and %destructor are not for error
4991 or $undefined): Here.
4992 (Default %printer and %destructor are not for $accept): Here.
4993 * tests/input.at (Invalid $n and @n): Here.
4994
3ebecc24
JD
49952006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
4996
4997 Rename <!> to <>. Discussed starting at
4998 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
4999 * NEWS (2.3a+): Update.
148d66d8 5000 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
5001 Update.
5002 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
5003 * src/scan-gram.l (INITIAL): Implement.
5004 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
5005 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
5006 comment.
5007 * tests/actions.at (Default tagless %printer and %destructor,
5008 Default tagged and per-type %printer and %destructor,
5009 Default %printer and %destructor are not for error or $undefined,
5010 Default %printer and %destructor are not for $accept,
5011 Default %printer and %destructor for mid-rule values): Update.
5012 * tests/input.at (Default %printer and %destructor redeclared,
5013 Unused values with default %destructor): Update.
5014
26b8a438
JD
50152006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
5016
5017 Don't let %prec take a nonterminal.
5018 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
5019 token.
5020 * tests/input.at (%prec takes a token): New test checking that %prec
5021 won't take a nonterminal.
5022
07c39ae9
JD
50232006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5024
405d53b7
JD
5025 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
5026 it was double-quoted.
07c39ae9
JD
5027 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
5028 grammar is maintained with Bison's highest standards.
5029 * src/getargs.c: Fix some typos in Doxygen comments.
5030
580b8926
JD
50312006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5032
5033 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
5034 later. Reported by Paul Eggert in
5035 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
5036 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
5037 * src/scan-code.l (translate_action): Don't bother invoking
5038 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
5039 (code_scanner_free): Instead of invoking
5040 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
5041 which frees more.
5042 * src/scan-gram.l (gram_scanner_free): Likewise.
5043 * src/scan-skel.l (scan_skel): Likewise.
5044
4502eadc
JD
50452006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
5046
5047 * src/files.c (tr): Change return type to void.
5048 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
5049 has been called previously for the same key.
5050 (muscle_find): Return storage instead of value so that
5051 --enable-gcc-warnings doesn't produce warnings that the return discards
5052 const. aver that the value and storage are the same since storage
5053 could potentially be NULL when value is not.
5054 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
5055 same as 0.
5056
7746c8f6
PE
50572006-11-08 Paul Eggert <eggert@cs.ucla.edu>
5058
5059 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
5060 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
5061 us a slightly cleaner distribution, and also works.
5062 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
5063 gnulib changes.
5064
eb095650
PE
50652006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
5066 and Paul Eggert <eggert@cs.ucla.edu>
5067
5068 Don't let Bison leak memory except when it complains.
5069 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
5070 (spec_defines_file, dir_prefix): Now char *, not const char *,
5071 since they are freed.
5072 * src/files.c: Likewise.
5073 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
5074 Likewise.
5075 (tr): Now operates in-place. All uses changed.
5076 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
5077 values.
5078 (compute_file_name_parts, compute_output_file_names): Don't store
5079 read-only data in variables that will be freed.
5080 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
5081 src_extension, and header_extension.
5082 (output_file_names_free): New public function to free
5083 spec_verbose_file, spec_graph_file, spec_defines_file,
5084 parser_file_name, and dir_prefix.
5085 * src/getargs.c (getargs): Don't store read-only data in variables that
5086 will be freed.
5087 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
5088 (which previously existed but was unused), and quotearg_free.
5089 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
5090 * src/muscle_tab.c: Likewise.
5091 (muscle_entry): Make the value char const *,
5092 and add a new storage member that is char * and can be freed.
5093 (muscle_entry_free): New private function.
5094 (muscle_init): Use it instead of free.
5095 (muscle_insert, muscle_grow): Update and use new storage member.
5096 (muscle_code_grow): Free the string passed to muscle_grow
5097 since it's not needed anymore.
5098 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
5099 add a new `char *code' member.
5100 ("{...}"): Declare semantic type as code.
5101 * src/scan-code.h (translate_rule_action):
5102 (translate_symbol_action, translate_code, translate_action): Return
5103 `char const *' rather than `char *' since external code should not free
5104 these strings.
5105 * src/scan-code.l: Likewise.
5106 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
5107 which is "{...}" in the parser.
5108 * tests/Makefile.am (maintainer-check-valgrind): Set
5109 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
5110 Valgrind.
5111 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
5112 complain.
5113 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
5114 expecting a non-zero exit status sets --leak-check=summary and
5115 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
5116 this case, and we don't want to hear about it.
5117
ac564be4
PE
51182006-11-08 Paul Eggert <eggert@cs.ucla.edu>
5119
5120 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
5121 instead of from the template, to simplify configuration a bit.
5122 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
5123 and m4/wint_t.m4, as they are needed with the latest gnulib.
5124
17bd8a73
JD
51252006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5126
5127 Disable unset/unused mid-rule value warnings by default, and recognize
5128 --warnings=midrule-values to enable them. Discussed starting at
5129 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
5130 * NEWS (2.3a+): Mention.
5131 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
5132 warnings): Add entry for midrule-values subargument.
5133 * src/reader.c (symbol_should_be_used): Don't return true just because
5134 the value is a set/used mid-rule value unless
5135 --warnings=midrule-values was specified.
5136 * tests/input.at (Unused values, Unused values before symbol
5137 declarations): Run tests with and without --warnings=midrule-values.
5138
5139 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
5140 than LIST_FREE directly.
5141
89eb3c76
JD
51422006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5143
5144 Finish implementing --warnings=error, which should not be implied by
5145 --warnings=all (or by its synonyms -W and --warnings without
5146 subarguments).
5147 * src/complain.c (set_warning_issued): New function to report that
5148 warnings are being treated as errors and to record an error if so.
5149 Invoke...
5150 (warn_at, warn): ... here.
5151 * src/getargs.c (warnings_args, warnings_types): Reorder so that
5152 "error - warnings are errors" does not appear above "all - all of the
5153 above".
5154 (getargs): For -W and --warnings without subarguments, don't let
5155 FLAGS_ARGMATCH set warnings_error in warnings_flag.
5156 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
5157
ba7560e2
JD
51582006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
5159
5160 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
5161 empty subargument list. For example: `bison --warnings= parser.y'.
5162
31283fc3
JD
51632006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5164
5165 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
5166 the parser header file so that gcc doesn't warn.
5167
12e35840
JD
51682006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5169
5170 Split the default %destructor/%printer into two kinds: <*> and <!>.
5171 Discussed starting at
5172 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
5173 * NEWS (2.3a+): Mention.
5174 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
5175 previous change today related to mid-rules.
148d66d8 5176 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 5177 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
5178 (TYPE_TAG_ANY): Add as <*>.
5179 (TYPE_TAG_NONE): Add as <!>.
5180 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
5181 for <*> and <!>.
5182 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
5183 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
5184 * src/symlist.c (symbol_list_default_new): Split into tagged and
5185 tagless versions.
5186 (symbol_list_destructor_set, symbol_list_printer_set): Split
5187 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
5188 SYMLIST_DEFAULT_TAGLESS.
5189 * src/symlist.h: Update symbol_list_default*_new prototypes.
5190 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
5191 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
5192 * src/symtab.c (default_destructor, default_destructor_location,
5193 default_printer, default_printer_location): Split each into tagged and
5194 tagless versions.
5195 (symbol_destructor_get, symbol_destructor_location_get,
5196 symbol_printer_get, symbol_printer_location_get): Implement tagged
5197 default and tagless default cases.
5198 (default_destructor_set, default_printer_set): Split each into tagged
5199 and tagless versions.
5200 * src/symtab.h: Update prototypes.
5201 * tests/actions.at (Default %printer and %destructor): Rename to...
5202 (Default tagless %printer and %destructor): ... this, and extend.
5203 (Per-type %printer and %destructor): Rename to...
5204 (Default tagged and per-type %printer and %destructor): ... this, and
5205 extend.
5206 (Default %printer and %destructor for user-defined end token): Extend.
5207 (Default %printer and %destructor are not for error or $undefined):
5208 Update.
5209 (Default %printer and %destructor are not for $accept): Update.
5210 (Default %printer and %destructor for mid-rule values): Extend.
5211 * tests/input.at (Default %printer and %destructor redeclared): Extend.
5212 (Unused values with default %destructor): Extend.
5213
f91b1629
JD
52142006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5215
5216 Don't apply the default %destructor/%printer to an unreferenced midrule
5217 value. Mentioned at
5218 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
5219 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
5220 like $@n instead of just @n so that the default %destructor/%printer
5221 logic doesn't see them as user-defined symbols.
5222 (symbol_is_dummy): Check for both forms of the name.
5223 * src/reader.c (packgram): Remove the `$' from each midrule symbol
5224 name for which the midrule value is referenced in any action.
5225 * tests/actions.at (Default %printer and %destructor for mid-rule
5226 values): New test.
5227 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
5228 for change to dummy symbol names.
5229
519d0004
JD
52302006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
5231
5232 Warn about unset midrule $$ if the corresponding $n is used.
5233 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
5234 $n usage.
5235 (packgram): Before invoking grammar_rule_check on any rule, make sure
5236 all actions have already been scanned in order to set `used' flags.
5237 Otherwise, checking that a midrule's $$ is set will not always work
5238 properly because the midrule check must forward-reference the midrule's
5239 parent rule.
5240 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
5241 warning.
5242
a501eca9
JD
52432006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
5244
5245 More improvements to the documentation of the prologue alternatives:
5246 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
5247 Bison manual.
5248 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
5249 some text to clarify the relative importance of the new directives and
5250 to show how these directives may be viewed as code labels.
5251
2cbe6b7f
JD
52522006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
5253
5254 Similar to the recently removed %before-header, add %code-top as the
5255 alternative to the pre-prologue. Mentioned at
5256 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
5257 Also, let the prologue alternatives appear in the grammar section.
5258 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
5259 (prologue_declaration): Move the existing prologue alternatives to...
5260 (grammar_declaration): ... here and add %code-top.
5261 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
5262
5263 Clean up and extend documentation for the prologue alternatives.
5264 * NEWS (2.3a+): Describe prologue alternatives.
5265 * doc/bison.texinfo (Prologue): Move discussion of prologue
5266 alternatives to...
5267 (Prologue Alternatives): ... this new section, and extend it to discuss
5268 all 4 directives in detail.
148d66d8
JD
5269 (Table of Symbols): Clean up discussion of prologue alternatives and
5270 add %code-top.
2cbe6b7f 5271
e557d3ea
JMG
52722006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5273
5274 DJGPP specific issues.
5275
5276 * djgpp/config.bat: config.hin has been moved to lib. Adjust
5277 config.bat accordingly.
5278 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
5279 * djgpp/config.site: Likewise.
5280
136a0f76
PB
52812006-10-16 Paolo Bonzini <bonzini@gnu.org>
5282
27bd5d67
PB
5283 Replace %*-header with %provides, %requires, %code. See discussion at
5284 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
5285
136a0f76
PB
5286 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
5287 (b4_user_start_header): Remove.
5288 * data/glr.c: Use new macros instead of b4_*start_header
5289 and b4_*end_header.
5290 * data/glr.cc: Likewise.
5291 * data/lalr1.cc: Likewise.
5292 * data/push.c: Likewise.
5293 * data/yacc.c: Likewise.
5294
5295 * doc/bison.texinfo: Remove %before-header, rename
5296 %{start,end,after}-header to %requires, %provides, %code.
5297
5298 * src/parse-gram.y: Likewise (also rename token names accordingly).
5299 * src/scan-gram.l: Likewise.
5300 * tests/actions.at: Likewise.
5301
10f429ef
PE
53022006-10-14 Paul Eggert <eggert@cs.ucla.edu>
5303
5304 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
5305 Problem reported by Joel E. Denny.
5306
53072006-10-14 Jim Meyering <jim@meyering.net>
5308
5309 (Sync from coreutils.)
5310 Work also when the working directory (with e.g. coreutils sources)
5311 is version controlled with git, rather than CVS.
5312 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
5313 rather than CVS.
5314 In messages and comments, say e.g., "checked-out sources",
5315 rather than "CVS sources".
5316 (version_controlled_file): New function. Work for git as well as
5317 for CVS. Don't use grep's -q option.
5318 (slurp): Call it here, in place of CVS-specific code.
5319
c4bd5bf7
JD
53202006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
5321
5322 Fix testsuite for ./configure --enable-gcc-warnings:
5323 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
5324 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
5325 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
5326 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
5327 * test/regression.at (Diagnostic that expects two alternatives):
5328 Likewise.
5329
46356ea4
PE
53302006-10-12 Paul Eggert <eggert@cs.ucla.edu>
5331
231ed89a
PE
5332 * bootstrap.conf (gnulib_modules): Add config-h.
5333 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
5334 worry about HAVE_CONFIG_H.
5335 * lib/abitset.c: Likewise.
5336 * lib/bitset.c: Likewise.
5337 * lib/bitset_stats.c: Likewise.
5338 * lib/bitsetv-print.c: Likewise.
5339 * lib/bitsetv.c: Likewise.
5340 * lib/ebitset.c: Likewise.
5341 * lib/get-errno.c: Likewise.
5342 * lib/lbitset.c: Likewise.
5343 * lib/subpipe.c: Likewise.
5344 * lib/timevar.c: Likewise.
5345 * lib/vbitset.c: Likewise.
5346 * lib/bitset.c: Include "bitset.h" first, to test interface.
5347 * lib/bitset_stats.c: Include "bitset_stats.h" first.
5348 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
5349 * lib/bitsetv.c: Include "bitsetv.h" first.
5350 * lib/get-errno.c: Include "get-errno.h" first.
5351 * m4/.cvsignore: Add config-h.m4.
5352 * tests/actions.at (Default %printer and %destructor for ...):
5353 Adjust expected line numbers in output to reflect removal of #if
5354 HAVE_CONFIG_H lines.
5355 * tests/glr-regression.at (Missed %merge type warnings when ...):
5356 Likewise.
5357 * tests/regression.at (Braced code in declaration in rules section):
5358 Likewise.
5359 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
5360 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
5361 Include <config.h> unconditionally.
5362
46356ea4
PE
5363 * bootstrap: Sync from coreutils, as follows:
5364
5365 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
5366
5367 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
5368 variable was sometimes used without being initialized. This
5369 messed up the installation of the INSTALL file in some cases.
5370
5371 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
5372
5373 * bootstrap (usage, main program, symlink_to_gnulib): Add option
5374 --copy. Inspired by a suggestion from Bruno Haible.
5375
5376 2006-10-03 Jim Meyering <jim@meyering.net>
5377
5378 * bootstrap: Undo last change to this file, since now gnulib-tool
5379 sticks with the automake default in generating dependencies.
5380
dd4bf078
PE
53812006-10-12 Paul Eggert <eggert@cs.ucla.edu>
5382
cf2a5f7c
PE
5383 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
5384 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
5385
5386 * doc/bison.1: Add copyright notice.
5387
5388 * data/glr.c: Don't include <stdarg.h>; not used.
5389
35fe0834
PE
5390 * NEWS: The -g and --graph options now output graphs in Graphviz
5391 DOT format, not VCG format.
5392 * doc/bison.1: Likewise.
5393 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
5394 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
5395 of this change in
5396 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
5397 * TODO: Remove Graphviz entry.
5398 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
5399 remove vcg.c, vcg.h, vcg_defaults.h.
5400 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
5401 * src/graphviz.c, src/graphviz.h: New files.
5402 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
5403 * src/files.h: Make comment more generic.
5404 * src/main.c (main): Likewise.
5405 * src/print_graph.h: Likewise.
5406 * src/getargs.c (usage): Make usage description more generic.
5407 * src/print_graph.c: Include graphviz.h rather than vcg.h.
5408 (static_graph, fgraph): Remove. All uses changed to pass
5409 arguments instead of sharing a static var.
5410 (print_core, print_actions, print_state, print_graph):
5411 Output graphviz format rather than VCG format.
5412 * tests/.cvsignore: Remove *.vcg; add *.dot.
5413 * tests/output.at: Expect *.dot files, not *.vcg files.
5414
dd4bf078
PE
5415 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
5416 accommodates the 2006-10-08 change.
5417
efdd7421
PE
54182006-10-11 Bob Rossi <bob@brasko.net>
5419
5420 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
5421 (b4_yyssa, b4_yyerror_range): New macros.
5422 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
5423 (yypvarsinit): Remove init of removed fields.
5424 (yypushparse): Remove use of removed fields; use new macros instead.
5425
96a1981a
PE
54262006-10-11 Paul Eggert <eggert@cs.ucla.edu>
5427
5428 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
5429 in a push parser. Reindent slightly to match yacc.c better.
5430
54312006-10-11 Bob Rossi <bob@brasko.net>
5432
46356ea4
PE
5433 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
5434 yymsg_alloc fields.
5435 (yypvarsinit, yypushparse): Remove init of removed fields.
5436 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 5437
c1630a8b
PE
54382006-10-09 Paul Eggert <eggert@cs.ucla.edu>
5439
5440 * THANKS: Add Paolo Bonzini and Bob Rossi.
5441
90b9908d
PB
54422006-10-08 Paolo Bonzini <bonzini@gnu.org>
5443
5444 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
5445 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
5446 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
5447 b4_define_user_cde and uses): Remove.
5448 (b4_comment, b4_prefix, b4_sync_start): New.
5449 * data/bison.m4: New file, with most of the content removed from c.m4.
5450 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
5451 * src/output.c (output_skeleton): Pass bison.m4.
5452 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
5453 only if specified.
5454
cf806753
PE
54552006-10-05 Paul Eggert <eggert@cs.ucla.edu>
5456
5457 Fix test failure reported by Tom Lane in
5458 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
5459 and try to make such failures easier to catch in the future.
5460 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
5461 that's now the caller's responsibility.
5462 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
5463 Set yychar = YYEOF if it's negative.
5464 * tests/actions.at (yylex): Abort if asked to read past EOF.
5465 * tests/conflicts.at (yylex): Likewise.
5466 * tests/cxx-type.at (yylex): Likewise.
5467 * tests/glr-regression.at (yylex): Likewise.
5468 * tests/input.at (yylex): Likewise.
5469 * tests/regression.at (yylex): Likewise.
5470 * tests/torture.at (yylex): Likewise.
5471
0e2f006a
PE
54722006-10-01 Paul Eggert <eggert@cs.ucla.edu>
5473
5474 Fix problems with translating English-language diagnostics.
5475 * bootstrap: Fix bug introduced in recent bootstrap changes, with
5476 respect to bison-runtime pot generation. The YY_ stuff
5477 wasn't being captured.
5478 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
5479 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
5480 * runtime-po/POTFILES.in: Add data/push.c.
5481
e3ddc1e3
PE
54822006-09-29 Paul Eggert <eggert@cs.ucla.edu>
5483
5484 Merge bootstrap changes from coreutils.
5485
5486 2006-09-28 Jim Meyering <jim@meyering.net>
5487
5488 Automatically generated dependencies are important even
5489 when all of the sources in a directory come from gnulib.
5490 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
5491 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
5492
5493 2006-09-23 Jim Meyering <jim@meyering.net>
5494
5495 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
5496
5497 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5498
5499 * bootstrap: Add support for --force.
5500 (usage): New function. Describe usage less tersely.
5501 (CVS_only_file): New var.
5502
01e972b3
PE
55032006-09-21 Paul Eggert <eggert@cs.ucla.edu>
5504
5505 * data/push.c (YYPUSH_MORE): Make it an enum instead.
5506 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
5507 Adjust white space and comments to match GNU style better.
5508
c63d3e90
PE
55092006-09-20 Bob Rossi <bob@brasko.net>
5510
5511 * data/push.c (yyresult_get): Remove function.
5512 (YYPUSH_MORE): Add #define.
5513 (yypushparse): Modify return value.
5514
e70f46d1
PE
55152006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5516
5517 * stamp-h.in: Remove; no longer needed.
5518 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
5519 Remove config.h, config.hin, intl (no longer created).
5520 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
5521 stamp-h1.
5522
5523 Sync bootstrap from coreutils, as follows:
5524
5525 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
5526
5527 * bootstrap (symlink_to_gnulib): New function.
5528 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
5529 to copies-of-gnulib.
5530 (cp_mark_as_generated, slurp, gnulib_files):
5531 Avoid making a copy if it's the same as the old version.
5532 (gnulib_files): Add support for this variable (used by Bison).
5533
a92be413
PE
55342006-09-20 Paul Eggert <eggert@cs.ucla.edu>
5535
5536 * src/getargs.c (usage): Rework to use conventions similar to
5537 coreutils, to make translation a bit easier and the code a bit
5538 smaller. Problem reported by Tim Van Holder.
5539
4f82b42a
PE
55402006-09-15 Paul Eggert <eggert@cs.ucla.edu>
5541
3b2942e6
PE
5542 Use some of gnulib's new modules, taken from coreutils.
5543
5544 * bootstrap: Sync from coreutils, except add support for gnulib_files.
5545 * bootstrap.conf: New file.
5546 (gnulib_modules): Add configmake, inttypes, unistd.
5547 (XGETTEXT_OPTIONS): Add complain, complain_at,
5548 fatal, fatal_at, warn, warn_at, unexpected_end.
5549 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
5550 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
5551 (gl_EARLY): Add.
5552 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
5553 (gl_INIT): Add
5554 (GNULIB_AUTOCONF_SNIPPET): Remove.
5555 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
5556 the pickiest.
5557 * lib/.cvsignore: Add inttypes_.h.
5558 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
5559 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
5560 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
5561 no-longer-necessary initializations.
5562 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
5563 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
5564 use the unistd module.
5565 * src/system.h: Likewise.
5566 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
5567 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
5568 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
5569 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
5570 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
5571 * src/system.h: Include inttypes.h unconditionally, now that we
5572 use the inttypes module. Don't bother to include stdint.h, since
5573 inttypes.h now does that for us.
5574 (LOCALEDIR): Remove, now that we use the configmake module.
5575 * src/getargs.c: Include configmake.h.
5576 * src/main.c: Likewise.
5577 * src/output.c: Likewise.
5578 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
5579 not from $abs_top_builddir, since config.h moved.
5580
5581
4f82b42a
PE
5582 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
5583 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
5584
5585 * src/parse-gram.y (symbol_declaration): Don't put statements
5586 before declarations; it's not portable to C89.
5587 * src/scan-code.l (handle_action_at): Likewise.
5588
5589 * src/scan-code.l: Always initialize braces_level; the old code
5590 left it uninitialized and therefore had undefined behavior.
5591
5592 Don't attempt to redefine 'assert', since it runs afoul of
5593 systems where standard headers (mistakenly) include <assert.h>.
5594 Instead, define and use our own alternative, called 'aver'.
5595 * src/reader.c: Don't include assert.h, since we no longer
5596 use assert.
5597 * src/scan-code.l: Likewise.
5598 * src/system.h (assert): Remove, replacing with....
5599 (aver): New function, taking a bool arg. All uses changed.
5600 * src/tables.c (pack_vector): Ensure that aver arg is bool,
5601 not merely an integer.
5602
31c10e38
PE
56032006-09-15 Bob Rossi <bob@brasko.net>
5604
5605 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
5606 * data/c.m4 (YYPUSH): New.
5607 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
5608 * src/getargs.c (push_parser): New var.
5609 * src/getargs.h (push_parser): New declaration.
5610 * src/output.c (prepare): Add macro insertion of `push_flag'.
5611 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
5612 (prologue_declaration): Parse %push-parser.
5613 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
5614 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
5615 list of removed lines from the traces observed.
5616 (AT_CHECK_CALC_LALR): Added push parser tests.
5617
fa7b79c0
PE
56182006-09-13 Paul Eggert <eggert@cs.ucla.edu>
5619
21fe08ca
PE
5620 * NEWS: Version 2.3a.
5621 * configure.ac (AC_INIT): Likewise.
5622
e8ec4d9b
PE
5623 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
5624 "#define YYSTYPE int" that caused "make maintainer-check" to fail
5625 due to header ordering dependencies. I don't know why the #define
5626 was there.
5627
fa7b79c0
PE
5628 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
5629 runtime cost when YYDEBUG is not defined, and so that some tests
5630 that used to fail now work. Problem and initial suggestion by
5631 Paolo Bonzini.
5632 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
5633 * data/glr.cc (b4_parser_class_name):
5634 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
5635 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
5636 (yydebug_) [YYDEBUG]: New member.
5637 (yycdebug_): Now defined only if YYDEBUG.
5638 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
5639 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
5640 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
5641 if YYYDEBUG.
5642 (debug_stream, set_debug_stream, debug_level, set_debug_level):
5643 Define only if YYDEBUG.
5644 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
5645 set_debug_level.
5646 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
5647 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
5648 AT_CHECK_CALC_GLR_CC that are working now.
5649
4ec13d60
PE
56502006-09-12 Paul Eggert <eggert@cs.ucla.edu>
5651
5652 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
5653 We don't need them in glr.cc, and glr.c defines them.
5654 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
5655 assumes that defining it to anything is the same as defining
5656 it to 1. Problem reported by Paolo Bonzini.
5657
8e1687ae
PE
56582006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
5659
5660 * data/c.m4 (b4_null, b4_case): Define.
5661 * src/output.c (prepare_symbols): Use b4_null.
5662 (user_actions_output): Use b4_case.
5663
3dc5e96b
PE
56642006-09-11 Paul Eggert <eggert@cs.ucla.edu>
5665
aef3da86
PE
5666 * data/glr.c (b4_shared_declarations): Put start-header first,
5667 before any #includes that we generate, so that feature-test
5668 macros work. Problem reported by Michael Deutschmann in
5669 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
5670 * data/lalr1.cc: Likewise.
5671 * doc/bison.texinfo (Prologue): Document that feature-test macros
5672 should be defined before any Bison declarations.
5673 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
5674 that depend on location.hh after, not before, Bison decls, since
5675 we now include location.hh after the first user prologue.
5676
3dc5e96b
PE
5677 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
5678 Sander Brandenburg in
5679 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
5680 Also, fix minor white space and comment issues.
aef3da86
PE
5681 (Prologue): Mention that it's better to define feature-test macros
5682 before Bison declarations. Problem reported by Michael Deutschmann.
5683
5684 * README-cvs: Fix typo: "&" should be "&&". Problem reported
5685 by Jim Meyering.
5686 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
5687 This adjusts to recent gnulib changes.
3dc5e96b 5688
b2a0b7ca
JD
56892006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5690
5691 Finish implementation of per-type %destructor/%printer. Discussed
5692 starting at
5693 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
5694 and
5695 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
5696 * NEWS (2.3+): Add a description of this feature to the default
5697 %destructor/%printer description.
5698 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
5699 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5700 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
5701 list node contains a semantic type.
5702 * src/symtab.c, src/symtab.h: Extend with a table that associates
5703 semantic types with their %destructor's and %printer's.
5704 (semantic_type_from_uniqstr, semantic_type_get,
5705 semantic_type_destructor_set, semantic_type_printer_set): New functions
5706 composing the public interface of that table.
5707 (symbol_destructor_get, symbol_destructor_location_get,
5708 symbol_printer_get, symbol_printer_location_get): If there's no
5709 per-symbol %destructor/%printer, look up the per-type before trying
5710 the default.
5711 * tests/actions.at (Per-type %printer and %destructor): New test case.
5712 * tests/input.at (Default %printer and %destructor redeclared):
5713 Extend to check that multiple occurrences of %symbol-default in a
5714 single %destructor/%printer declaration is an error.
5715 (Per-type %printer and %destructor redeclared, Unused values with
5716 per-type %destructor): New test cases.
5717
3be03b13
JD
57182006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
5719
5720 Require default %destructor/%printer to be declared using
5721 %symbol-default instead of an empty symbol list, and start working on
5722 new per-type %destructor/%printer. Discussed at
5723 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
5724 * NEWS (2.3+): Add %symbol-default to example.
5725 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 5726 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
5727 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
5728 (generic_symlist, generic_symlist_item): New nonterminals for creating
5729 a list in which each item is a symbol, semantic type, or
5730 %symbol-default.
5731 (grammar_declaration): Use generic_symlist in %destructor and %printer
5732 declarations instead of symbols.1 or an empty list.
5733 (symbol_declaration, precedence_declaration, symbols.1): Update actions
5734 for changes to symbol_list.
5735 * src/reader.c: Update for changes to symbol_list.
5736 * src/scan-code.l: Likewise.
5737 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
5738 * src/symlist.c, src/symlist.h: Extend such that a list node may
5739 represent a semantic type or a %symbol-default in addition to just an
5740 ordinary symbol. Add switched functions for setting %destructor's and
5741 %printer's.
5742 * tests/actions.at, tests/input.at: Add %symbol-default to all default
5743 %destructor/%printer declarations.
5744
3508ce36
JD
57452006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
5746
5747 Whether the default %destructor/%printer applies to a particular symbol
5748 isn't a question of whether the user *declares* that symbol (in %token,
5749 for example). It's a question of whether the user by any means
5750 *defines* the symbol at all (by simply using a char token, for
5751 example). $end is defined by Bison whereas any other token with token
5752 number 0 is defined by the user. The error token is always defined by
5753 Bison regardless of whether the user declares it with %token, but we
5754 may one day let the user define error as a nonterminal instead.
5755 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
5756 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
5757 the meaning of "user-defined".
5758 * tests/actions.at (Default %printer and %destructor for user-declared
5759 end token): Rename to...
5760 (Default %printer and %destructor for user-defined end token): ...
5761 this.
5762
5763 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
5764 computation of whether to apply the default, don't maintain a list of
5765 every Bison-defined symbol. Instead, just check for a first character
5766 of '$', which a user symbol cannot have, and check for the error token.
5767
9350499c
JD
57682006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
5769
5770 Don't apply the default %destructor or %printer to the error token,
5771 $undefined, or $accept. This change fits the general rule that the
5772 default %destructor and %printer are only for user-declared symbols,
5773 and it solves several difficulties that are described in the new test
5774 cases listed below.
5775 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
5776 * tests/actions.at (Default %printer and %destructor are not for error
5777 or $undefined, Default %printer and %destructor are not for $accept):
5778 New test cases.
5779
4d7370cb
JD
57802006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
5781
5782 Allow %start after the first rule.
5783 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
5784 when parsing the first rule.
5785 (check_and_convert_grammar): Search for it here after all grammar
5786 declarations have been parsed. Skip midrules, which have dummy LHS
5787 nonterminals.
5788 * src/symtab.c (symbol_is_dummy): New function.
5789 * src/symtab.h (symbol_is_dummy): Declare it.
5790 * tests/input.at (%start after first rule): New test.
5791
6d0ef4ec
JD
57922006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5793
5794 Redo some of the previous commit: add back the ability to use
5795 non-aliased/undeclared string literals since it might be useful to
5796 those declaring %token-table.
5797 * src/reader.c (check_and_convert_grammar): Undo changes in previous
5798 commit: don't worry about complaints from symbols_pack.
5799 * src/symtab.c (symbol_new, symbol_class_set,
5800 symbol_check_alias_consistency): Undo changes in previous commit: count
5801 each string literal as a new symbol and token, assign it a symbol
5802 number, and don't complain about non-aliased string literals.
5803 (symbols_pack): Since symbol_make_alias still does not decrement symbol
5804 and token counts but does still set aliased tokens to the same number,
5805 symbol_pack_processor now leaves empty slots in the symbols array.
5806 Remove those slots.
5807 * tests/regression.at (Undeclared string literal): Remove test case
5808 added in previous commit since non-aliased string literals are allowed
5809 again.
5810 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
5811 remove unnecessary string literal declarations.
5812 * tests/sets.at (Firsts): Likewise.
5813
965537bc
JD
58142006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
5815
5816 Don't allow an undeclared string literal, but allow a string literal to
5817 be used before its declaration.
5818 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
5819 symbols_pack complained.
5820 * src/symtab.c (symbol_new): Don't count a string literal as a new
5821 symbol.
5822 (symbol_class_set): Don't count a string literal as a new token, and
5823 don't assign it a symbol number since symbol_make_alias does that.
5824 (symbol_make_alias): It's not necessary to decrement the symbol and
5825 token counts anymore. Don't assume that an alias declaration occurs
5826 before any uses of the identifier or string, and thus don't assert that
5827 one of them has the highest symbol number so far.
5828 (symbol_check_alias_consistency): Complain if there's a string literal
5829 that wasn't declared as an alias.
5830 (symbols_pack): Bail if symbol_check_alias_consistency failed since
5831 symbol_pack asserts that every token has been assigned a symbol number
5832 although undeclared string literals have not.
5833 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 5834 string literal): New test cases.
965537bc
JD
5835 (Characters Escapes, Web2c Actions): Declare string literals as
5836 aliases.
5837 * tests/sets.at (Firsts): Likewise.
5838
47aee066
JD
58392006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
5840
5841 In the grammar scanner, STRING_FINISH unclosed constructs and return
5842 them to the parser in order to improve error messages.
5843 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
5844 SC_BRACED_CODE, SC_PROLOGUE): Implement.
5845 * tests/input.at (Unclosed constructs): New test case.
5846 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
5847 seen.
5848
5849 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
5850 unused global.
5851
1f6b3679
JD
58522006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
5853
5854 Handle string aliases for character tokens correctly.
5855 * src/symtab.c (symbol_user_token_number_set): If the token has an
5856 alias, check and set its alias's user token number instead of its own,
5857 which is set to indicate the alias. Previously, every occurrence of
5858 the character token in the grammar overwrote that alias indicator with
5859 the character code.
5860 * tests/input.at (String aliases for character tokens): New test.
5861
219741d8
JD
58622006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
5863
5864 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
5865
11daa4e7
PE
58662006-08-11 Paul Eggert <eggert@cs.ucla.edu>
5867
5868 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
5869 to prevent failures when building on older platforms.
5870 Check for autopoint failure.
5871 Set XGETTEXT_OPTIONS to values that check for C format strings,
5872 so that translators are warned about them (this also helps
5873 prevent core dumps).
5874
5875 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
5876 function, since it simplifies our code a bit.
5877
5878 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
5879 rather than -W, so we don't get bogus warnings about sign comparisons.
5880 Add -Wpointer-arith, since that warning is useful (it reports code
5881 that does not conform to C89 and that some compilers reject).
5882 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
5883 since it's no longer needed.
5884
f9bfc42a
JD
58852006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
5886
5887 Clean up scanners a bit.
5888 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
5889 definitions so gcc won't warn when obstack_for_string is unused.
5890 * src/scan-code.l: config.h and system.h are already #include'd by
5891 scan-code-c.c, so get rid of them here.
5892 * src/scan-gram.l: Likewise.
5893 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
5894 definitions rather than duplicating the rest of it.
5895 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
5896
06e8700a
JD
58972006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
5898
5899 Suppress signed/unsigned comparison warnings for yycheck.
5900 * data/c.m4 (b4_safest_int_type): New macro.
5901 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
5902 a signed int type, cast it to b4_safest_int_type first.
5903 * data/yacc.c: Likewise.
5904 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
5905 also overwritten.
5906
9c437126
PE
59072006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
5908
5909 * doc/bison.texinfo: Fix some typos.
5910
284d8a13
PE
59112006-08-02 Paul Eggert <eggert@cs.ucla.edu>
5912
5913 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
5914 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
5915
5916 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
5917 the latest gnulib does this a different way.
5918 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
5919 translation was patched, so stop omitting it.
5920
ec5479ce
JD
59212006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5922
5923 Enable declaration of default %printer/%destructor. Make the parser
5924 use these for all user-declared grammar symbols for which the user does
5925 not declare a specific %printer/%destructor. Thus, the parser uses it
5926 for token 0 if the user declares it but not if Bison generates it as
5927 $end. Discussed starting at
5928 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
5929 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
5930 and
5931 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
5932 * NEWS (2.3+): Mention.
5933 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
5934 declare a %destructor for a mid-rule's semantic value. It's just
5935 impossible to declare one specific to it.
5936 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
5937 code. Describe default %destructor form.
5938 * src/parse-gram.y (grammar_declaration): Parse default
5939 %printer/%destructor declarations.
5940 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
5941 and symbol_destructor_location_get rather than accessing the destructor
5942 and destructor_location members of struct symbol.
5943 (symbol_printers_output): Likewise but for %printer's.
5944 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
5945 again.
5946 * src/symtab.c (default_destructor, default_destructor_location,
5947 default_printer, default_printer_location): New static global
5948 variables to record the default %destructor and %printer.
5949 (symbol_destructor_get, symbol_destructor_location_get,
5950 symbol_printer_get, symbol_printer_location_get): New functions to
5951 compute the appropriate %destructor and %printer for a symbol.
5952 (default_destructor_set, default_printer_set): New functions to set the
5953 default %destructor and %printer.
5954 * src/symtab.h: Prototype all those new functions.
5955 * tests/actions.at (Default %printer and %destructor): New test to
5956 check that the right %printer and %destructor are called, that they're
5957 not called for $end, and that $$ and @$ work correctly.
5958 (Default %printer and %destructor for user-declared end token): New
5959 test to check that the default %printer and %destructor are called for
5960 a user-declared end token.
5961 * tests/input.at (Default %printer and %destructor redeclared, Unused
5962 values with default %destructor): New tests to check related grammar
5963 warnings and errors.
5964
868d2d96
JD
59652006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
5966
5967 Clean up handling of %destructor for the end token (token 0).
5968 Discussed starting at
5969 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
5970 and
5971 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
5972
5973 Make the skeletons consistent in how they pop the end token and invoke
5974 its %destructor.
5975 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
5976 state, which has token number 0, since this would invoke the
5977 %destructor for the end token.
5978 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
5979 until after shifting the end token, or else it won't be popped.
5980 * data/yacc.c (yyparse): Likewise.
5981
5982 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
5983 it's the end token. Upon termination, destroy an unshifted lookahead
5984 even when it's the end token.
5985 * data/lalr1.cc (yy::parser::parse): Likewise.
5986 * data/yacc.c (yyparse): Likewise.
5987
5988 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
5989 value warnings for the end token when the user gives the end token a
5990 %destructor.
5991
5992 * tests/actions.at (Printers and Destructors): Test all the above.
5993
62a9592d
PE
59942006-07-24 Paul Eggert <eggert@cs.ucla.edu>
5995
5996 Update to latest gnulib and gettext versions.
5997 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
5998 Add fopen-safer.
5999 (gnulib_files): Add m4/warning.m4. Don't worry about files
6000 overwritten by autopoint.
6001 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
6002 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
6003 rejects them.
6004 Don't use autoreconf; instead, invoke autopoint etc. by hand,
6005 so that we can remove the intl files at a better time.
6006 (intl_files_to_remove): Remove aclocal.m4, since it gets
6007 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
6008 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
6009 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
6010 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
6011 Remove datarootdir hack; no longer needed.
6012 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
6013 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
6014 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
6015 strdup.h.
6016 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
6017 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
6018
10d6970f
PE
60192006-07-20 Paul Eggert <eggert@cs.ucla.edu>
6020
6021 * bootstrap: Adjust to today's change to gnulib-tool by invoking
6022 it with --assume-autoconf='latest-stable'.
6023
50a33993
JD
60242006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
6025
6026 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
6027 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
6028 YYSTYPE' and `{'.
6029 * src/muscle_tab.h (muscle_grow): Replace the header comments with
6030 those from muscle_tab.c since the old ones are misleading.
6031
2ce4ed68
AD
60322006-07-13 Akim Demaille <akim@epita.fr>
6033
6034 Support %define "KEY" {VALUE}.
6035 * src/scan-code.h, src/scan-code.l (translate_action)
6036 (translate_rule_action, translate_symbol_action, translate_code):
6037 Return char *, not const char *.
6038 * src/parse-gram.y (declaration): Rename as...
6039 (prologue_declaration): this.
6040 (string_content): Remove this nonterminal, use STRING.
6041 (braceless, content, content.opt): New nonterminal.
6042 Use them.
6043 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
6044 as value.
6045 * src/scan-gram.l (getargs.h): Don't include it.
6046
db7e5eb5
PE
60472006-07-12 Paul Eggert <eggert@cs.ucla.edu>
6048
6049 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
6050 rather than a for-loop that declares a local bool variable. This
6051 should work around a compatibility problem with a Cray x1e C++
6052 compiler reported by Hung Nguyen in
6053 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
6054 The for-loop was introduced in the 2004-11-17 change but I don't
6055 know why it was needed.
6056
a5d80ba5
AD
60572006-07-12 Akim Demaille <akim@epita.fr>
6058
6059 * data/c.m4: Comment changes.
6060
23eb2a69
AD
60612006-07-10 Akim Demaille <akim@lrde.epita.fr>
6062
6063 * src/complain.c (error_message, ERROR_MESSAGE): New.
6064 To factor...
6065 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
6066 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
6067
ddc8ede1
PE
60682006-07-09 Paul Eggert <eggert@cs.ucla.edu>
6069
6070 * NEWS: Instead of %union, you can define and use your own union type
6071 YYSTYPE if your grammar contains at least one <type> tag.
6072 Your YYSTYPE need not be a macro; it can be a typedef.
6073 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
6074 (Union Decl, Decl Summary): Document this.
6075 * data/glr.c (YYSTYPE): Implement this.
6076 * data/glr.cc (YYSTYPE): Likewise.
6077 * data/lalr1.cc (YYSTYPE): Likewise.
6078 * data/yacc.c (YYSTYPE): Likewise.
6079 * src/output.c (prepare): Output tag_seen_flag.
6080 * src/parse-gram.y (declaration, grammar_declaration):
6081 Use 'union_seen' rather than 'typed' to determine whether
6082 %union has been seen, since grammars can now be typed without
6083 %union.
6084 (symbol_declaration, type.opt, symbol_def):
6085 Keep track of whether a tag has been seen.
6086 * src/reader.c (union_seen, tag_seen): New vars.
6087 (typed): remove.
6088 * src/reader.h (union_seen, tag_seen, typed): Likewise.
6089 * src/scan-code.l (untyped_var_seen): New variable.
6090 (handle_action_dollar): Adjust to above changes.
6091 (handle_action_dollar, handle_action_at):
6092 Improve overflow checking for outlandish numbers.
6093 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
6094 avoid new diagnostics generated by above changes.
6095 * tests/regression.at (YYSTYPE typedef): Add test to check
6096 for type tags without %union.
6097
6098 * src/symlist.c (symbol_list_length): Return int, not unsigned
6099 int, since callers expect int. This may need to get revisited
6100 once we have proper integer overflow checking.
6101
6102 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
6103 object is now static.
6104
6105 * src/getargs.c (flags_argmatch): Return void, not int,
6106 to pacify ./configure --enable-gcc-warnings.
6107
6108 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
6109 since last_string is already defined to FLEX_PREFIX (last_string).
6110
7b42569e
AD
61112006-07-09 Akim Demaille <akim@lrde.epita.fr>
6112
6113 Implement --warnings/-W.
6114 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
6115 replaced by...
6116 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
6117 Adjust callers.
6118 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
6119 (warnings_args, warnings_types): New.
6120 (getargs, short_options, long_options): Accept -W/--warnings.
6121 Sort the options by alphabetical order, upper case letter right
6122 before its lower case.
6123
3b452f4e
JD
61242006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
6125
6126 Change %merge result type clash warnings to errors. Discussed at
6127 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
6128 * src/reader.c (record_merge_function_type): Use complain_at.
6129 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6130 declared later): Update test case results.
6131
b8a41559
AD
61322006-07-09 Akim Demaille <akim@lrde.epita.fr>
6133
6134 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
6135 to be in alphabetical order.
6136 (trace_args): Spelling fixes.
6137
cd9e1ba2
PE
61382006-07-09 Paul Eggert <eggert@cs.ucla.edu>
6139
6140 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
6141 so they don't collide with user-defined macros.
6142 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
6143 this was never guaranteed, and now that we're using gnulib stdint,
6144 which defines int_fast16_t to long int, the problem is exposed.
6145
cb48f191
PE
61462006-07-08 Paul Eggert <eggert@cs.ucla.edu>
6147
b8445a15
PE
6148 * data/c.m4 (b4_basename): Simplify a bit, since we don't
6149 need the full POSIX semantics (and weren't implementing them
6150 anyway).
6151
cb48f191
PE
6152 Adjust to Autoconf 2.60 and today's gnulib.
6153 * bootstrap (gnulib_modules): Add stdint.
6154 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
6155 no longer copies it.
6156 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
6157 since stdint needs the former and wcwidth (which is now required
6158 by mbswidth) needs the latter.
6159 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
6160 work around a compatibility glitch between gettext 0.14.6 and
6161 Autoconf 2.60.
6162 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
6163 Do not check for uintptr_t, since new stdint module does the right
6164 thing.
6165 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
6166 Add stdint.h, stdint_.h, wcwidth.h.
6167 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
6168 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
6169 stdint.m4, wchar_t.m4, wcwidth.m4.
6170 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
6171 usual order for ../lib/*.h files.
6172 (file_name_split): Use last_component, not base_name, to adjust
6173 to gnulib changes.
6174 * src/parse-gram.h: Include <strverscmp.h> in the usual order
6175 for ../lib/*.h files.
6176 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
6177 Define unconditionally, since we now assume the stdint module.
6178 * src/scan-skel.l: Include <dirname.h>.
6179 (BASE_QPUTS): Use last_component, not base_name.
6180 * src/system.h: Include <unlocked-io.h> in the usual order
6181 for ../lib/*.h files. Include <stdint.h> unconditionally,
6182 since we now use the stdint module.
6183 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
6184 HAVE_UINTPTR_T, since we now use the stdint module.
6185 (base_name): Remove decl, since files now include <dirname.h>
6186 to get the decl.
6187
cd48d21d
AD
61882006-07-08 Akim Demaille <akim@lrde.epita.fr>
6189
6190 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
6191 New, default to 1.
6192 * data/yacc.c, data/glr.c, data/location.cc: Use them.
6193 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
6194 default.
6195 * tests/calc.at: Adjust.
6196
8ec0a172
AD
61972006-07-08 Akim Demaille <akim@lrde.epita.fr>
6198
b8445a15 6199 * data/c.m4 (b4_basename): New.
8ec0a172
AD
6200 (b4_syncline): Also output the location of its invocation (from
6201 the skeleton).
6202 (b4_user_action, b4_define_user_action, b4_user_actions)
6203 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
6204 (b4_user_stype): New.
6205 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
6206
4a678af8
JD
62072006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
6208
6209 In the grammar file, the first column is 1 not 0 on the first line as
6210 on every other line.
6211 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
6212 * tests/input.at (Torturing the Scanner): Update output.
6213
6214 * src/scan-gram.l (scanner_cursor): Declare it static.
6215
dd60572a
JD
62162006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
6217
6218 In warnings, say "previous declaration" rather than "first
6219 declaration".
6220 * src/symtab.c (redeclaration): Do that here.
6221 * src/reader.c (record_merge_function_type): In the case of a result
6222 type clash, report the previous declaration rather than the very first
6223 one in the grammar file.
6224 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6225 declared later): Add a third declaration to check this behavior.
6226 * tests/input.at (Incompatible Aliases): Update output.
6227
2073e1b6
AD
62282006-06-27 Akim Demaille <akim@epita.fr>
6229
6230 * doc/Doxyfile.in: New.
6231 * doc/Makefile.am: Use it.
6232 * src/lalr.h, src/symtab.h: Initial doxygenation.
6233
8ee5b538
JD
62342006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6235
6236 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
6237 declared after the %merge. This continues the effort of the previous
6238 patch.
8ee5b538
JD
6239 * src/reader.c (get_merge_function): Don't set the merger type yet.
6240 (record_merge_function_type): New function for setting the merger type
6241 and checking for clashes.
6242 (grammar_current_rule_merge_set): Set the location of the %merge for
6243 the current rule.
6244 (packgram): Invoke record_merge_function_type for each rule now that
6245 all symbol type declarations have been parsed.
6246 * src/reader.h (merger_list.type_declaration_location): New member
6247 storing the location of the first %merge from which the type for this
6248 merging function was derived.
6249 * src/symlist.h (symbol_list.merger_declaration_location): New member
6250 storing the location of a rule's %merge, if any.
6251 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
6252 declared later): New test to catch the error fixed by the above patch.
6253
ffa4ba3a
JD
62542006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6255
6256 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
6257 declarations appear after the rules. Discussed at
6258 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
6259 and
6260 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
6261 Don't mistake the type of $$ in a midrule to be that of its parent
6262 rule's $$.
ffa4ba3a
JD
6263 * src/reader.c (grammar_current_rule_end): Don't invoke
6264 grammar_rule_check yet since not all symbol declarations may have been
6265 parsed yet.
6266 (grammar_midrule_action): Likewise.
6267 Don't record whether the midrule's $$ has been used yet since actions
6268 haven't been translated yet.
6269 Record the midrule's parent rule and its RHS index within the parent
6270 rule.
6271 (grammar_current_rule_action_append): Don't translate the action yet
6272 since not all symbol declarations may have been parsed yet and, thus,
6273 warnings about types for $$, $n, @$, and @n can't be reported yet.
6274 (packgram): Translate the action and invoke grammar_rule_check now that
6275 all symbol declarations have been parsed.
6276 * src/scan-code.l (handle_action_dollar): Now that this is invoked
6277 after parsing the entire grammar file, the symbol list here in the case
6278 of a midrule is actually the midrule's empty RHS, so reference its
6279 parent rule's RHS where necessary.
6280 On the other hand, now that you can already know it's a midrule, you
6281 aren't forced to think $$ has the same type as its parent rule's $$.
6282 (handle_action_at): In the case of a midrule, reference the parent rule
6283 where necessary.
6284 * src/symlist.c (symbol_list_new): Initialize new midrule-related
6285 members.
6286 (symbol_list_length): Now that this is invoked after all rules have
6287 been parsed, a NULL symbol (rather than a NULL symbol list node)
6288 terminates a rule. symbol_list_print already does this correctly.
6289 * src/symlist.h (symbol_list.midrule_parent_rule,
6290 symbol_list.midrule_parent_rhs_index): New members so that midrules can
6291 remember their relationships with their parents.
6292 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
6293 fixed by the above patch.
6294 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
6295 implementing...
6296 (Unused values): ... this old test case and...
6297 (Unused values before symbol declarations): ... this new test case.
6298 This one is the same as `Unused values' except that all symbol
6299 declarations appear after the rules in order to catch the rest of the
6300 errors fixed by the above patch.
6301
e256e17f
JD
63022006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
6303
300a1930
JD
6304 More cleanup.
6305 * src/reader.c (current_rule): Declare it static since it's no longer
6306 used outside this file.
6307 (grammar_current_rule_action_append): Remove redundant arguments from
6308 translate_rule_action invocation.
6309 * src/reader.h (current_rule): Remove this unused extern.
6310 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
6311 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 6312
381ecb06
JD
63132006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
6314
6315 Clean up yesterday's patch.
6316 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
6317 to...
6318 * src/reader.c (grammar_current_rule_action_append): ... here for
6319 consistency with grammar_current_rule_symbol_append.
6320 * tests/regression.at (Braced code in declaration in rules section):
6321 Make yyerror and yylex static as usual.
6322
4210cd0b
JD
63232006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
6324
6325 Fix bug that mistakes braced code in a declaration in the rules section
6326 to be a rule action. Mentioned at
6327 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
6328 * src/scan-gram.l: Move midrule action detection from the start of the
6329 scanning of any braced code to...
6330 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
6331 action. For readability, use $2 and @2 rather than the equivalent
6332 global variables.
6333 * tests/regression.at (Braced code in declaration in rules section):
6334 New test to catch the error fixed by the above patch.
6335
6336 Work on code readability some.
6337 * src/scan-code.l (current_rule): Get rid of this misleading and
6338 redundant declaration: it's actually extern'ed in reader.h.
6339 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
6340 translate_action): Add a rule argument and use it instead of the global
6341 current_rule.
6342 (translate_rule_action): This already receives current_rule through an
6343 argument, so pass it on to translate_action instead of assigning
6344 current_rule to current_rule.
6345 (translate_symbol_action, translate_code): Pass rule = NULL to
6346 translate_action.
6347
34f98f46
JD
63482006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
6349
6350 Rename %before-definitions to %start-header and %after-definitions to
6351 %end-header. Don't use these declarations to separate pre-prologue
6352 blocks from post-prologue blocks. Add new order-independent
6353 declarations %before-header and %after-header as alternatives to the
6354 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
6355 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
6356 * NEWS (2.3+): Update for these changes.
6357 * data/glr.c (b4_before_definitions): Update to...
6358 (b4_start_header): ... this.
6359 (b4_after_definitions): Update to...
6360 (b4_end_header): ... this.
6361 * data/glr.cc: Likewise.
6362 * data/lalr1.cc: Likewise.
6363 * data/yacc.c: Likewise.
6364 * doc/bison.texinfo (The prologue): Update names, and replace remaining
6365 prologue blocks with %*-header declarations.
6366 (Calc++ Parser): Likewise.
91661ebb 6367 (Decl Summary): Update names.
148d66d8 6368 (Table of Symbols): Update description.
34f98f46
JD
6369 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
6370 (PERCENT_END_HEADER): ... this.
6371 (PERCENT_BEFORE_DEFINITIONS): Update to...
6372 (PERCENT_START_HEADER): ... this.
6373 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
6374 (declaration): Update token names and m4 macro names.
6375 When parsing %end-header and %start-header, invoke translate_code
6376 before muscle_code_grow, and no longer set global booleans to remember
6377 whether these declarations have been seen.
6378 Parse new %after-header and %before-header.
6379 * src/reader.c (before_definitions, after_definitions): Remove.
6380 (prologue_augment): Accept a new bool argument to specify whether to
6381 augment the pre-prologue or post-prologue.
6382 * src/reader.h (before_definitions, after_definitions): Remove these
6383 extern's.
6384 (prologue_augment): Add new bool argument.
6385 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
6386 (PERCENT_END_HEADER): ... this.
6387 (PERCENT_BEFORE_DEFINITIONS): Update to...
6388 (PERCENT_START_HEADER): ... this.
6389 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
6390 * tests/actions.at (Printers and Destructors): Update names.
6391
31b2b07e
JD
63922006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
6393
6394 Add comparison operators for C++ location classes. Discussed at
6395 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
6396 * data/c++.m4 (b4_define_location_comparison): New boolean %define
6397 declaration indicating whether filename_type has an operator==. If
6398 filename_type is `std::string', it defaults to `1', `0' otherwise.
6399 * data/location.cc: Iff b4_define_location_comparison is `1', add
6400 operator== and operator!= for class position and for class location.
6401
6402 Some minor fixes.
6403 * src/scan-action.l: Remove unused file.
6404 * src/symtab.c (symbol_printer_set): Use printer_location not
6405 destructor_location.
6406 * src/symtab.h (struct symbol): Replace incorrect source comment for
6407 printer members.
6408 * tests/input.at (Incompatible Aliases): Update output with correct
6409 printer location.
6410
9bc0dd67
JD
64112006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
6412
6413 Don't put the pre-prologue in the header file. For the yacc.c code
6414 file and the glr.c header and code files, move the pre-prologue before
6415 the token definitions. Add new %before-definitions and
6416 %after-definitions to declare code that will go in both the header file
6417 and code file. Discussed at
6418 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
6419 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
6420 and
6421 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
6422 * NEWS (2.3+): Describe these changes.
6423 * data/glr.c (b4_pre_prologue): Move from within to before...
6424 (b4_shared_declarations): ... this.
6425 Add new b4_before_definitions before b4_token_enums.
6426 Add new b4_after_definitions at the end.
6427 * data/glr.cc (b4_pre_prologue): Replace with...
6428 (b4_before_definitions): ... this in the header file.
6429 (b4_after_definitions): New near the end of the header file.
6430 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
6431 code file right before including the header file.
6432 (b4_before_definitions): New in the previous position of
6433 b4_pre_prologue in the header file.
6434 (b4_after_definitions): New near the end of the header file.
6435 * data/yacc.c: Clean up some m4 quoting especially in the header file.
6436 (b4_token_enums_defines): In the code file, move to right before
6437 YYSTYPE for consistency with the header file.
6438 (b4_before_definitions): New right before b4_token_enums_defines in
6439 both the header and code file.
6440 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
6441 header and code file.
6442 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
6443 of prologues for %union dependencies.
91661ebb
JD
6444 (Decl Summary): In %defines description, mention the effect of
6445 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
6446 (Calc++ Parser): Forward declare driver in a %before-definitions rather
6447 than in the pre-prologue so that make check succeeds.
148d66d8 6448 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
6449 %after-definitions.
6450 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
6451 %before-definitions.
6452 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
6453 (declaration): Parse those declarations and append to
6454 b4_before_definitions and b4_after_definitions, respectively.
6455 * src/reader.c (before_definitions, after_definitions): New bools to
6456 track whether those declarations have been seen.
6457 (prologue_augment): Add to the post-prologue if %union,
6458 %before-definitions, or %after-definitions has been seen.
6459 * src/reader.h (before_definitions, after_definitions): New extern's.
6460 * src/scan-gram.l: Scan the new declarations.
6461 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
6462 prologue block in a %before-definitions or a %after-definitions based
6463 on whether the %union is declared.
6464 * tests/regression.at (Early token definitions with --yacc, Early token
6465 definitions without --yacc): Move tests for token definitions into the
6466 post-prologue since token names are no longer defined in the
6467 pre-prologue.
6468
203b9274
AD
64692006-06-20 Akim Demaille <akim@epita.fr>
6470
6471 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
6472 (symbol_get): Use it.
6473 * src/parse-gram.y: Use it.
6474
a7ee59cf
JD
64752006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
6476
6477 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
6478 build succeeds when configured with --enable-gcc-warnings.
6479
5a2baae7
PE
64802006-06-19 Paul Eggert <eggert@cs.ucla.edu>
6481
33ad1a9c
PE
6482 * src/parse-gram.y (char_name): New function.
6483 (CHAR, STRING, string_content): For %printer, properly escape.
6484 (ID): Prefer fputs to fprintf.
6485 (id): Reindent to be consistent with other rules.
6486 Properly quote char.
6487
5a2baae7
PE
6488 The Translation Project changed its way of publishing translations
6489 to maintainers. I haven't received any responses to my request
6490 for supporting the old way, or for documenting the new way. I
6491 have modified 'bootstrap' to use screen scraping
6492 (in this case, HTML scraping). This is unreliable and inelegant,
6493 but I don't see any better way. Yuck.
6494 * bootstrap (TP_URL, WGET_COMMAND): New vars.
6495 (get_translations): New function, which uses HTML scraping to
6496 deduce locations of latest translations.
6497 Use this function to grab both bison and bison-runtime .po files.
6498 Don't bother priming the pump for the runtime-po domain any more,
6499 as it's now translated better than bison is.
6500
58d7a1a1
AD
65012006-06-19 Akim Demaille <akim@epita.fr>
6502
6503 * src/scan-gram.l: No longer "parse" things after `%union' until
6504 `{'. Rather, return a single "%union" token.
6505 No longer make symbols: return strings, and leave the conversion
6506 to symbols to the parser.
6507 (SC_PRE_CODE, token_type): Remove.
6508 * src/parse-gram.y (%union): New field `character'.
6509 Sort tokens.
6510 (CHAR): New token.
6511 (ID, ID_COLON): Now that the scanner no longer makes them
6512 identifiers, adjust all uses to invoke symbol_get.
6513 (id_colon): New, wraps the conversion from string to symbol.
6514 (%union): Accept a possible union_name.
6515 (symbol): Now can be a char.
6516 * data/c.m4 (b4_union_name): Leave a default value.
6517 * data/glr.c, data/yacc.c: Use it.
6518
b931235e
JD
65192006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
6520
6521 For associating token numbers with token names for "yacc.c", don't use
6522 #define statements unless `--yacc' is specified; always use enum
6523 yytokentype. Most important discussions start at:
6524 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
6525 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
6526 and
6527 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
6528 * NEWS (2.3+): Mention.
6529 * data/c.m4 (b4_yacc_if): New.
6530 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
6531 token #define's.
6532 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
6533 on token name definitions.
6534 * src/getargs.c (usage): Capitalize `Yacc' in English.
6535 * src/output.c (prepare): Define b4_yacc_flag.
6536 * tests/regression.at (Early token definitions): Test that tokens names
6537 are defined before the pre-prologue not just before the post-prologue.
6538 Remove this test case and copy to...
6539 (Early token definitions with --yacc): ... this to test #define's.
6540 (Early token definitions without --yacc): ... and this to test enums.
6541
9e6e7ed2
PE
65422006-06-11 Paul Eggert <eggert@cs.ucla.edu>
6543
6544 * NEWS: Reword the post-2.3 change to not be so optimistic about
6545 removing the old "look-ahead" spelling.
6546 Update previous look-ahead/lookahead change reports.
6547 * REFERENCES: look-ahead -> lookahead (since that's
6548 what he actually wrote).
6549 * doc/refcard.tex: look ahead -> lookahead,
6550 look-ahead -> lookahead
6551
742e4900
JD
65522006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
6553
6554 For consistency, use `lookahead' instead of `look-ahead' or
6555 `look_ahead'. Discussed starting at
6556 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
6557 and then at
6558 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
6559 * NEWS: For the next release, note the change to `--report'.
6560 * TODO, doc/bison.1: Update English.
6561 * doc/bison.texinfo: Update English.
6562 (Understanding Your Parser, Bison Options): Document as
6563 `--report=lookahead' rather than `--report=look-ahead'.
6564 * src/conflicts.c: Update English in comments.
6565 (lookahead_set): Rename from look_ahead_set.
6566 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
6567 (resolve_sr_conflict): Rename local look_ahead_tokens to
6568 lookahead_tokens, and update other uses.
6569 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
6570 count_rr_conflicts, conflicts_free): Update uses.
6571 * src/getargs.c (report_args): Move "lookahead" before alternate
6572 spellings.
6573 (report_types): Update uses.
6574 (usage): For `--report' usage description, state `lookahead' spelling
6575 rather than `look-ahead'.
6576 * src/getargs.h (report.report_lookahead_tokens): Rename from
6577 report_look_ahead_tokens.
6578 * src/lalr.c: Update English in comments.
6579 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
6580 (state_lookahead_tokens_count): Rename from
6581 state_look_ahead_tokens_count.
6582 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6583 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
6584 Rename local n_look_ahead_tokens to n_lookahead_tokens.
6585 Update other uses.
6586 Update English in output.
6587 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
6588 * src/print.c: Update English in comments.
6589 (lookahead_set): Rename from look_ahead_set.
6590 (print_reduction): Rename argument lookahead_token from
6591 look_ahead_token.
6592 (print_core, state_default_rule, print_reductions, print_results):
6593 Update uses.
6594 * src/print_graph.c: Update English in comments.
6595 (print_core): Update uses.
6596 * src/state.c: Update English in comments.
6597 (reductions_new): Update uses.
6598 (state_rule_lookahead_tokens_print): Rename from
6599 state_rule_look_ahead_tokens_print, and update other uses.
6600 * src/state.h: Update English in comments.
6601 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
6602 (state_rule_lookahead_tokens_print): Rename from
6603 state_rule_look_ahead_tokens_print.
6604 * src/tables.c: Update English in comments.
6605 (conflict_row, action_row): Update uses.
6606 * tests/glr-regression.at
6607 (Incorrect lookahead during deterministic GLR,
6608 Incorrect lookahead during nondeterministic GLR): Rename
6609 print_look_ahead to print_lookahead.
6610 * tests/torture.at: Update English in comments.
6611 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
6612 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
6613 (Many lookahead tokens): Update uses.
6614 * data/glr.c: Update English in comments.
6615 * lalr1.cc: Likewise.
6616 * yacc.c: Likewise.
6617 * src/conflicts.h: Likewise.
6618 * src/lalr.h: Likewise.
6619 * src/main.c: Likewise.
6620 * src/output.c: Likewise.
6621 * src/parse-gram.c: Likewise.
6622 * src/tables.h: Likewise.
6623 * tests/calc.at: Likewise.
6624
3c40d0b5
JD
66252006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
6626
6627 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
6628
5d278082
PE
66292006-06-07 Paul Eggert <eggert@cs.ucla.edu>
6630
6631 * TODO: Add request from Nelson H. F. Beebe to be able to install
6632 Bison without installing the yacc script.
6633
9e668899
JD
66342006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6635
6636 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
6637 and yytext if they're already #define'd.
6638 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
6639 * src/scan-code-c.c: ... here.
6640 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
6641 <config.h>.
6642
0c8e079f
JD
66432006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
6644
6645 Get Bison to build again when configured with --enable-gcc-warnings.
6646 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
6647 missing #include's.
6648 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
6649 loc argument as it shadows a global.
6650 * src/scan-gram.l: Remove stray comma that prevents boundary_set
6651 invocation.
6652
6653 * src/.cvsignore: Add scan-code.c.
6654
2346344a
AD
66552006-06-07 Akim Demaille <akim@epita.fr>
6656
6657 * src/scan-gram.l: Move the "add a trailing ; to actions" code
6658 to...
6659 * src/scan-code.l: here.
6660 * tests/input.at (Torturing the Scanner): Fix another location
6661 error.
6662
4862bdfd
AD
66632006-06-07 Akim Demaille <akim@epita.fr>
6664
6665 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
6666
e9071366
AD
66672006-06-06 Akim Demaille <akim@epita.fr>
6668
6669 Extract the parsing of user actions from the grammar scanner.
6670 As a consequence, the relation between the grammar scanner and
6671 parser is much simpler. We can also split "composite tokens" back
6672 into simple tokens.
6673 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
6674 * src/scan-gram.l (add_column_width, adjust_location): Move to and
6675 rename as...
6676 * src/location.h, src/location.c (add_column_width)
6677 (location_compute): these.
6678 Fix the column count: the initial column is 0.
6679 (location_print): Be robust to ending column being 0.
6680 * src/location.h (boundary_set): New.
6681 * src/main.c: Adjust to scanner_free being renamed as
6682 gram_scanner_free.
6683 * src/output.c: Include scan-code.h.
6684 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
6685 Use boundary_set.
6686 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
6687 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
6688 which is now, again, a separate token.
6689 Adjust all dependencies.
6690 Whereever actions with $ and @ are used, use translate_code.
6691 (action): Remove this nonterminal which is now useless.
6692 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
6693 (grammar_current_rule_action_append): Use translate_code.
6694 (packgram): Bound check ruleno, itemno, and rule_length.
6695 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
6696 (last_string, last_braced_code_loc, max_left_semantic_context)
6697 (scanner_initialize, scanner_free, scanner_last_string_free)
6698 (gram_out, gram_lineno, YY_DECL_): Move to...
6699 * src/scan-gram.h: this new file.
6700 (YY_DECL): Rename as...
6701 (GRAM_DECL): this.
6702 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
6703 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6704 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6705 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6706 Move these declarations, and...
6707 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
6708 these to...
6709 * src/flex-scanner.h: this new file.
6710 * src/scan-gram.l (rule_length, rule_length_overflow)
6711 (increment_rule_length): Remove.
6712 (last_braced_code_loc): Rename as...
6713 (gram_last_braced_code_loc): this.
6714 Adjust to the changes of the parser.
6715 Move all the handling of $ and @ into...
6716 * src/scan-code.l: here.
6717 * src/scan-gram.l (handle_dollar, handle_at): Remove.
6718 (handle_action_dollar, handle_action_at): Move to...
6719 * src/scan-code.l: here.
6720 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
6721 scan-code.h, scan-code-c.c, scan-gram.h.
6722 (EXTRA_bison_SOURCES): Add scan-code.l.
6723 (BUILT_SOURCES): Add scan-code.c.
6724 (yacc): Be robust to white spaces.
6725
6726 * tests/conflicts.at, tests/input.at, tests/reduce.at,
6727 * tests/regression.at: Adjust the column numbers.
6728 * tests/regression.at: Adjust the error message.
7891a7c4 6729
184e42f0
JD
67302006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6731
6732 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6733 Use Akim's wording from
6734 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
6735
7891a7c4
JD
67362006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
6737
6738 Between Bison releases, manually append `+' to the previous Bison
6739 release number, and use that as a signal to automatically print the
6740 ChangeLog's CVS Id keyword from --version. Discussed starting at
6741 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
6742 * ChangeLog: Add Id header.
6743 * configure.ac (AC_INIT): Append `+' to `2.3'.
6744 * src/.cvsignore: Add revision.c.
6745 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
6746 (BUILT_SOURCES): Add revision.c.
6747 (revision.c): New target rule. This file defines a new global variable
6748 named revision. It initializes it with either the Id from ChangeLog
6749 or, if VERSION doesn't contain `+', with the empty string.
6750 * src/getargs.c (version): Print the value of revision.
6751 * src/revision.h: Extern revision.
6752
4ad3ed84
PE
67532006-06-05 Paul Eggert <eggert@cs.ucla.edu>
6754
6755 * NEWS: Version 2.3.
6756 * configure.ac (AC_INIT): Likewise.
6757
02103984
PE
67582006-05-30 Paul Eggert <eggert@cs.ucla.edu>
6759
6760 * data/glr.c (YYRECOVERING): Define to be a function-like macro
6761 with no arguments, not as an object-like macro. This is for
6762 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
6763 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
6764 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
6765 Document this.
6766
2c08afa5
JD
67672006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
6768
6769 * src/getargs.c (usage): Back out yesterday's modification of the
6770 --help output so that we don't have to wait for translation before
6771 releasing 2.3.
6772
6077da58
PE
67732006-05-29 Paul Eggert <eggert@cs.ucla.edu>
6774
6775 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
6776 Problem reported by Akim Demaille.
6777
2a26b6c2
JD
67782006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6779
6780 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
6781
aefef0d6
PE
67822006-05-26 Paul Eggert <eggert@cs.ucla.edu>
6783
6784 * data/yacc.c (yy_reduce_print): Omit trailing white space in
6785 generated source code. Problem reported by Frans Englich in
6786 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
6787
fcd8e201
PE
67882006-05-22 Paul Eggert <eggert@cs.ucla.edu>
6789
6790 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
6791 shell, not within 'make', so that 'make' by an ordinary builder
6792 (using GNU make) does not worry about configuring gzip. This also
6793 works around a bug reported independently by Keith Thompson and by
6794 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
6795 stderr rather than stdout, messing up the build logs.
6796
7b5cdcbd
JD
67972006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6798
6799 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
6800 to make sure that YYID will never be unused. This fixes a 'make
6801 maintainer-check' failure caused by the recent changes to the 'Trivial
6802 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
6803 not used.
6804 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
6805
5ad0a449
JD
68062006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
6807
6808 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
6809 state before an empty RHS is always resolved here. Only the location
6810 of that state is guaranteed to be resolved, and that's enough. This
6811 fixes the remaining bug reported by Derek M. Jones in
6812 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6813 * tests/glr-regression.at (Uninitialized location when reporting
6814 ambiguity): Test the above case.
6815 Also, the embedded comments in this test case claim it checks the case
6816 of an empty RHS that has inherited the initial location. However, the
6817 corresponding LHS was already resolved, so yyresolveLocations didn't
6818 actually have reason to modify it. Fix this by forcing
6819 nondeterministic operation at the beginning of the parse.
6820
50cce58e
PE
68212006-05-20 Paul Eggert <eggert@cs.ucla.edu>
6822
6823 * data/c.m4 (b4_yy_symbol_print_generate):
6824 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
6825 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
6826 of the bugs reported today by Derek M Jones in
6827 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
6828 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
6829 defined to be a type name without parens or brackets.
6830 (Location Type): Similarly for YYLTYPE.
6831 * tests/regression.at (Trivial grammars): Put in a test for this
6832 bug that will be caught by 'make maintainer-check' (though not,
6833 alas, by 'make check' unless your compiler is picky).
6834
ab8d9dc5
PE
68352006-05-19 Paul Eggert <eggert@cs.ucla.edu>
6836
0d2c8934 6837 * NEWS: Version 2.2.
ab8d9dc5
PE
6838 * configure.ac (AC_INIT): Likewise.
6839
9138c575
JD
68402006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
6841
6842 * data/glr.c (yyreportTree): Make room in yystates for the state
6843 preceding the RHS. This fixes the segmentation fault reported by Derek
6844 M. Jones in
6845 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
6846 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
6847 to the user. Reported for yyreportTree by Derek M. Jones later in the
6848 same thread.
6849 * THANKS: Add Derek M. Jones.
6850 Update my email address.
6851 Fix typo in Steve Murphy's name.
6852
276f48df
PE
68532006-05-14 Paul Eggert <eggert@cs.ucla.edu>
6854
d6645148
PE
6855 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
6856 checking against YYLAST that caused the parser to miss a potential
6857 alternative in its diagnostic.
6858 Problem reported by Maria Jose Moron Fernandez in
6859 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
6860 * data/lalr1.cc (yysyntax_error_): Likewise.
6861 * data/yacc.c (yysyntax_error): Likewise.
6862 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
6863 tokens, in case we run into an older C compiler.
6864 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
6865 Use them to check for the off-by-one error fixed above.
6866
276f48df
PE
6867 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
6868 YYSIZE_T, not size_t.
6869 * tests/regression.at (Trivial grammars): New test, to catch
6870 the error fixed by the above patch.
6871
cd8b5791
AD
68722006-05-14 Akim Demaille <akim@lrde.epita.fr>
6873
6874 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
6875 scheme.
6876 Reported by Steve Murphy.
6877
34376418
AD
68782006-05-14 Akim Demaille <akim@lrde.epita.fr>
6879
6880 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
6881 * data/glr.cc: b4_location_flag is now b4_locations_flag.
6882
327afc7c
AD
68832006-05-14 Akim Demaille <akim@lrde.epita.fr>
6884
6885 Implement --trace=m4.
6886 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
6887 * src/output.c (output_skeleton): When set, pass -dV to m4.
6888
6889 Factor the handling of flags in m4.
6890 * src/output.c (prepare): Rename the muscle names debug, defines,
6891 error_verbose to debug_flag, defines_flag, error_verbose_flag.
6892 * data/c.m4: Adjust.
6893 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
6894 Use b4_define_flag_if to define other b4_FLAG_if macros.
6895 (b4_location_if): As a consequence, rename as...
6896 (b4_locations_if): this, for consistency.
6897 Adjust all the skeletons.
6898
ba9ecd19
AD
68992006-05-14 Akim Demaille <akim@lrde.epita.fr>
6900
6901 * etc/bench.pm: Shorten bench names.
6902
4e83ea15
AD
69032006-05-14 Akim Demaille <akim@lrde.epita.fr>
6904
6905 * src/output.h, src/output.c (error_verbose): Move to...
6906 * src/getargs.h, src/getargs.c: here.
6907 Sort the flags.
6908 Adjust dependencies.
6909
6e93d810
PE
69102006-05-13 Paul Eggert <eggert@cs.ucla.edu>
6911
6912 * data/c.m4 (b4_copyright): Put the special exception for Bison
6913 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
6914 uses changed. Suggested by Akim Demaille. Also, wrap the
6915 copyright notice, in case it is longer than 80 columns. Replace
6916 comma by newline after title.
6e93d810 6917
eaea13f5
PE
69182006-05-11 Paul Eggert <eggert@cs.ucla.edu>
6919
6920 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
6921 incompatibility, not a bug. Mention that it wasn't fixed as of
6922 flex 2.5.33.
6923
3cf084ec
AD
69242006-05-11 Akim Demaille <akim@lrde.epita.fr>
6925
6926 * examples/extexi: Enforce the precedence of concatenation over
6927 >>.
0a9f1c7d 6928 Reported by Tommy Nordgren.
3cf084ec 6929
32c96bd7
AD
69302006-05-11 Akim Demaille <akim@lrde.epita.fr>
6931
6932 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
6933 with the member "token".
f94705b2 6934 Reported by Martin Nylin.
32c96bd7 6935
eaea13f5
PE
69362006-05-08 Paul Eggert <eggert@cs.ucla.edu>
6937
6938 * data/glr.c: Switch to Bison 2.2 special-exception language in
6939 the copyright notice. Use more-regular format for titles and
6940 copyright notices.
6941 * data/glr.cc: Likewise.
6942 * data/location.cc: Likewise.
6943 * data/yacc.cc: Likewise.
6944 * doc/bison.texinfo (Conditions): Document this.
6945 * NEWS: likewise. Upgrade version to 2.2.
6946
6e2d1146
AD
69472006-04-27 Akim Demaille <akim@lrde.epita.fr>
6948
6949 * data/glr.cc: Remove dead code.
6950
47671055
PE
69512006-04-25 Paul Eggert <eggert@cs.ucla.edu>
6952
6953 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
6954 that variable and the line breaks the bootstrap. Problem reported
6955 by Juan M. Guerrero.
6956
ed2e6384
AD
69572006-04-24 Akim Demaille <akim@lrde.epita.fr>
6958
6959 * doc/bison.texinfo (Multiple start-symbols): New.
6960
3cedc2dc
AD
69612006-04-24 Akim Demaille <akim@lrde.epita.fr>
6962
6963 * etc/README, etc/bench.pl: New.
6964
b2ddc3f3
AD
69652006-04-03 Akim Demaille <akim@lrde.epita.fr>
6966
6967 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
6968 rule.
6969 Reported by Mickael Labau.
6970 * tests/input.at (Torturing the Scanner): Test it.
6971
91e3ac9a
PE
69722006-03-16 Paul Eggert <eggert@cs.ucla.edu>
6973
6974 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
6975 Problem reported by Bob Rossi.
6976
69772006-03-13 Paul Eggert <eggert@cs.ucla.edu>
6978
6979 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
6980 and didn't really work.
6981 For the index, use @ifnotinfo, not @iftex.
6982 Minor cleanups of spacing and terminology.
6983
5cf61e93
AD
69842006-03-12 Akim Demaille <akim@lrde.epita.fr>
6985
6986 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
6987 of AT_NAME_PREFIX when %name-prefix is not used.
6988
aa08666d
AD
69892006-03-12 Akim Demaille <akim@lrde.epita.fr>
6990
6991 Apply --prefix to C++ skeletons too: they change the namespace.
6992 The test suite already exercize these cases.
6993 * data/c++.m4 (b4_namespace): New.
6994 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
6995 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
6996 * data/yacc.c, data/glr.c: Remove a useless `[]'.
6997 * doc/bison.texinfo: Document it.
6998 (Option Cross Key): Use @multitable in all formats. It looks
6999 nicer, even in TeX outputs.
7000 (Rules): Use the same code whatever the output type is.
7001 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
7002 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
7003 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 7004
45567173
AD
70052006-03-10 Akim Demaille <akim@lrde.epita.fr>
7006
7007 * TODO: Remove dead items.
7008
e9d8f881 70092006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
7010
7011 * doc/FAQ: Remove, merged into...
7012 * doc/bison.texinfo (FAQ): this.
7013 * doc/Makefile.am (EXTRA_DIST): Adjust.
7014
c095d689
AD
70152006-03-10 Akim Demaille <akim@lrde.epita.fr>
7016
7017 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
7018 even if empty.
7019 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
7020 * doc/bison.texinfo (Calc++ Scanner): Use it.
7021
6e0f8287
PE
70222006-03-09 Paul Eggert <eggert@cs.ucla.edu>
7023
7024 Fix two nits reported by twlevo, plus one more that I discovered.
7025
7026 * src/assoc.h (assoc_to_string): Give a name to the arg, as
7027 this is the usual Bison style.
7028 * src/location.h (location_print): Likewise.
7029
7030 * src/reader.h (token_name): Likewise.
7031
d6b771c3
PE
70322006-03-08 Paul Eggert <eggert@cs.ucla.edu>
7033
7034 Fix some nits reported by twlevo.
7035 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
7036 and "POSIX". Use more-modern syntax for URLs. Mention C++
7037 and ask for Java. Don't hardwire OS version numbers. Add
7038 copyright notice.
7039 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
7040 * src/conflicts.c (solved_conflicts_obstack): Now static.
7041
1e137b71
JD
70422006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
7043
7044 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
7045 page. Say "you can use it" not "you may use it" as on the web page;
7046 we're describing capabilities not granting permission.
7047
73f2e47e
PE
70482006-03-06 Paul Eggert <eggert@cs.ucla.edu>
7049
6d05403d
PE
7050 * data/glr.c (yyresolveLocations): Rename local variables to avoid
7051 shadowing warnings. Use usual patter for iterating through RHS.
7052 * tests/glr-regression.at
7053 (Uninitialized location when reporting ambiguity):
7054 Modify yylex so that it uses its argument, rather than trying
7055 to rely on ARGSUSED (which doesn't work for gcc with warnings).
7056 const char -> char const.
7057
73f2e47e
PE
7058 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
7059 Don't use tabs inside commands; it messes up 'ps'.
7060 Problem reported by twlevo.
7061
8710fc41
JD
70622006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
7063
7064 * tests/glr-regression.at (Uninitialized location when reporting
7065 ambiguity): New test case.
7066 * data/glr.c (yyresolveLocations): New function, which uses
7067 YYLLOC_DEFAULT.
7068 (yyresolveValue): Invoke yyresolveLocations before reporting an
7069 ambiguity.
7070 * doc/bison.texinfo (Default Action for Locations): Note
7071 YYLLOC_DEFAULT's usage for ambiguity locations.
7072 (GLR Semantic Actions): Cross-reference those notes.
7073
ae952af2
JD
70742006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
7075
7076 * tests/glr-regression.at (Leaked semantic values when reporting
7077 ambiguity): Remove unnecessary union and type declarations.
7078 (Leaked lookahead after nondeterministic parse syntax error): New test
7079 case.
7080 * data/glr.c (yyparse): Check for zero stacks remaining before
7081 attempting to shift the lookahead so that you don't lose it.
7082
35ee866a
JD
70832006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7084
7085 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
7086 * tests/glr-regression.at (Leaked semantic values when reporting
7087 ambiguity): New test case.
7088 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
7089 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
7090 now unnecessary yystackp parameter.
7091 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
7092 destructors can be called.
7093
7094 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
7095 in existing testcases.
7096
520181ab
JD
70972006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
7098
7099 Don't leak semantic values for parent RHS when a user action cuts the
7100 parser, and clean up related code a bit.
7101 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
7102 cuts parse): Rename to...
7103 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
7104 for leaked parent RHS values.
7105 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
7106 between an unresolved state (non-empty chain of semantic options) and
7107 an incomplete one (signaled by an empty chain).
ae952af2 7108 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
7109 successfully or unsuccessfully resolved yyGLRState to...
7110 (yyresolveValue): ... here so that yyresolveValue always leaves a
7111 yyGLRState with consistent data and thus is easier to understand.
7112 Remove the yyvalp and yylocp parameters since they are always just
7113 taken from the yys parameter. When reporting a discarded merged value
7114 in debugging output, note that it is incompletely merged. Document the
7115 interface.
7116 (yyresolveAction): If resolving any of the RHS states fails, destroy
7117 them all rather than leaking them. Thus, as long as user actions are
7118 written to clean up the RHS correctly, yyresolveAction always cleans up
7119 the RHS of a semantic option. Document the interface.
7120
18d9185c
PE
71212006-02-27 Paul Eggert <eggert@cs.ucla.edu>
7122
7123 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
7124 led to a segmentation fault in GNU Pascal. Problem reported
7125 by Waldek Hebisch.
7126
841a7737
JD
71272006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
7128
7129 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
7130 mid-rule action inside a nonterminal symbol in order to declare a
7131 destructor for its semantic value.
7132
fc3f467f
PE
71332006-02-16 Paul Eggert <eggert@cs.ucla.edu>
7134
7135 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
7136 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
7137 __cplusplus && ! defined _STDLIB_H && !
7138 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
7139 defined free))]: Include <stdlib.h> rather than rolling our own
7140 declarations of malloc and free, to avoid problems with
7141 incompatible declarations (using 'throw') C++'s stdlib.h. This
7142 should fix Debian bug 340012
7143 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
7144 reported by Guillaume Melquiond.
7145
a3af26dd
PE
71462006-02-13 Paul Eggert <eggert@cs.ucla.edu>
7147
4d7bc38c
PE
7148 * NEWS: Clarify symbols versus types in unused-value warnings.
7149
a3af26dd
PE
7150 * configure.ac (AC_INIT): Bump version number.
7151
4e26c69e
PE
71522006-02-13 Paul Eggert <eggert@cs.ucla.edu>
7153
7154 * NEWS: Version 2.1a.
7155 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
7156 since C99 requires this.
7157
498e897c
PE
71582006-02-11 Paul Eggert <eggert@cs.ucla.edu>
7159
7160 * m4/c-working.m4: New file.
7161 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
7162
57bb17ca
PE
71632006-02-10 Paul Eggert <eggert@cs.ucla.edu>
7164
7165 * Makefile.maint: Merge from coreutils.
7166
0be105dc
PE
71672006-02-09 Paul Eggert <eggert@cs.ucla.edu>
7168
7169 More portability fixes for problems summarized by Nelson H. F. Beebe.
7170
7171 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
7172 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
7173 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
7174 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
7175 messes up because C++ code is compiled in 32-bit mode but linked
7176 in 64-bit mode.
7177
6fc0c024
PE
71782006-02-08 Paul Eggert <eggert@cs.ucla.edu>
7179
7180 More portability fixes for problems summarized by Nelson H. F. Beebe.
7181
7870f699
PE
7182 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
7183 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
7184
6fc0c024
PE
7185 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
7186 nodist_PROGRAMS, since we don't need to actually compile the
7187 example if we're just doing a plain 'make'. This avoids bothering
7188 the installer unnecessarily about problems due to weird C++
7189 compilers.
7190
fe6c2fde
PE
71912006-02-06 Paul Eggert <eggert@cs.ucla.edu>
7192
7193 More portability fixes for problems summarized by Nelson H. F. Beebe.
7194
7195 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
7196 than #include "...", and compile with -I'.'. The old method was
7197 not portable, according to Posix and the C standard, and it does
7198 not work with Sun C 5.7, where previous #line directives affect
7199 the working directory used in later #include "..." directives.
7200
927b425b
JMG
72012006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7202
7203 Various DJGGP specific issues in /djgpp
7204
d9735e9e
PE
72052006-02-02 Paul Eggert <eggert@cs.ucla.edu>
7206
7207 More portability fixes for problems summarized by Nelson H. F. Beebe.
7208
7209 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
7210 '#include <map>' works and that you can apply ++ to iterators.
7211
5a6755af
PE
72122006-02-01 Paul Eggert <eggert@cs.ucla.edu>
7213
67a0dc4f
PE
7214 Work around portability problems summarized by Nelson H. F. Beebe in
7215 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
7216
8c86f0ef
PE
7217 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
7218 that '#include <string>' works.
7219
de35dd59
PE
7220 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
7221 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
7222 "warning: sorry: semantics of inline function static data `const
7223 unsigned char translate_table[262]' are wrong (you'll wind up with
7224 multiple copies)".
7225
67a0dc4f
PE
7226 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
7227 or, xor to not_, and_, or_, and xor_, respectively. This works
7228 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
7229 random system header somewhere that includes the equivalent of
7230 <iso646.h>.
7231
5a6755af
PE
7232 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
7233 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 7234 Suite Version 2.0.
5a6755af 7235
3f001415
JD
72362006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
7237
7238 During deterministic GLR operation, user actions should be able to
7239 influence the parse by changing yychar. To make this easier to fix and
7240 to make glr.c easier to evolve in general, don't maintain yytoken in
7241 parallel with yychar; just compute yytoken when needed.
7242 * tests/glr-regression.at (Incorrect lookahead during deterministic
7243 GLR): Check that setting yychar in a user action has the intended
7244 effect.
7245 * data/glr.c (yyGLRStack): Remove yytokenp member.
7246 (yyclearin): Don't set *yytokenp.
7247 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
7248 yychar rather than *yytokenp to determine the current lookahead.
7249 Compute yytoken locally when needed.
7250 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
7251 point to.
7252
7253 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
7254 after `--report' documentation.
7255
e2a8c0f5
PE
72562006-01-30 Paul Eggert <eggert@cs.ucla.edu>
7257
7258 * src/parse-gram.y (grammar_declaration): Location of printer
7259 symbol is @1, not list->location. Bug reported by twlevo.
7260 * tests/input.at (Incompatible Aliases): Adjust to above change.
7261
6b702268
PE
72622006-01-29 Paul Eggert <eggert@cs.ucla.edu>
7263
27622431
PE
7264 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
7265 all the test at once. This makes the output easier to read in the
7266 normal case.
7267
6b702268
PE
7268 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
7269 got from <http://bro-ids.org/download.html>. The bug is that
7270 when two actions appeared in succession, the second one was
7271 scanned before the first one was added to the grammar rule
7272 as a midrule action. Bison then output the incorrect warning
7273 "parse.y:905.17-906.36: warning: unused value: $3".
7274 * src/parse-gram.y (BRACED_CODE, action): These are no longer
7275 associated with a value.
7276 (rhs): Don't invoke grammar_current_rule_action_append.
7277 (action): Invoke it here instead.
7278 * src/reader.c (grammar_midrule_action): Now extern.
7279 (grammar_current_rule_action_append): Don't invoke
7280 grammar_midrule_action; that is now the scanner's job.
7281 * src/reader.h (last_string, last_braced_code_loc):
7282 (grammar_midrule_action): New decls.
7283 * src/scan-gram.l (last_string): Now extern, sigh.
7284 (last_braced_code_loc): New extern variable.
7285 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
7286 rule already has an action.
7287 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
7288 * tests/input.at (AT_CHECK_UNUSED_VALUES):
7289 Add some tests to check that the above changes fixed the bug.
7290
d40ba6c2
PE
72912006-01-27 Paul Eggert <eggert@cs.ucla.edu>
7292
7293 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
7294 All used changed. Check whether the symbol has a destructor,
7295 not whether it is typed.
7296 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
7297 that the values are still reported as unused. All line numbers
7298 adjusted.
7299
401aace6
PE
73002006-01-23 Paul Eggert <eggert@cs.ucla.edu>
7301
7302 Work around a bug in bro 0.8, which underparenthesizes its
7303 definition of YYLLOC_DEFAULT.
7304 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
7305 their arguments.
7306 * data/lalr1.cc: Likewise.
7307 * data/yacc.cc: Likewise.
7308
06f01bc4
PE
73092006-01-22 Paul Eggert <eggert@cs.ucla.edu>
7310
401aace6
PE
7311 Work around a bug in Pike 7.0, and give the Pike folks a
7312 better way to override the usual int widths.
7313 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
7314 user can override the types.
7315 (short): #undef, to work around a bug in Pike 7.0.
7316 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
7317 (union yyalloc.yyss): Use yytype_int16 rather than short.
7318 All uses changed.
7319 (yysigned_char): Remove.
7320 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
7321 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
7322 * tests/regression.at (Web2c Actions): Adjust to above changes.
7323
7324 * src/reader.c (check_and_convert_grammar): New function.
7325 (reader): Close the input file even if something went wrong during
7326 parsing. Minor file descriptor leak reported by twlevo.
7327
06f01bc4
PE
7328 * src/assoc.c (assoc_to_string): Use a default: abort (); case
7329 to pacify gcc -Wswitch-default.
7330 * src/scan-gram.l (adjust_location): Use a default: break; case
7331 to pacify gcc -Wswitch-default.
7332 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
7333 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
7334 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
7335 Move these decls to scan-skel.l, since they don't need to be
7336 visible elsewhere.
7337 * src/scan-skel.l: Accept the above decls.
7338 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
7339 is used.
7340
02650b7f
PE
73412006-01-21 Paul Eggert <eggert@cs.ucla.edu>
7342
7343 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
7344 since we don't want to insist on a version number at the start
7345 of the changelog every time.
7346 * Makefile.maint: Sync from coreutils a bit better.
7347 (sc_trailing_blank): Renamed from sc_trailing_space.
7348 All uses changed.
7349 (sc_no_if_have_config_h, sc_require_config_h):
7350 (sc_prohibit_assert_without_use): New rules.
7351 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
7352 (sc_dd_max_sym_length): Fix leading spaces in rule.
7353 (sc_system_h_headers): Prefix with @.
7354 (sc_useless_cpp_parens, m4-check): Output line numbers.
7355 (changelog-check): Allow version only in head.
7356 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
7357 satisfy new Makefile.maint rule.
7358 * data/glr.c: Likewise.
7359 * data/glr.cc: Likewise.
7360 * data/lalr1.cc: Likewise.
7361 * data/yacc.c: Likewise.
7362 * lib/ebitsetv.c: Likewise.
7363 * lib/lbitset.c: Likewise.
7364 * lib/subpipe.c: Likewise.
7365 * lib/timevar.c: Likewise.
7366 * src/system.h: Likewise.
7367 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
7368 * djgpp/Makefile.maint: Add copyright notice.
7369 * djgpp/README.in: Likewise.
7370 * djgpp/config.bat: Likewise.
7371 * djgpp/config.site: Likewise.
7372 * djgpp/config_h.sed: Likewise.
7373 * djgpp/djunpack.bat: Likewise.
7374 * djgpp/config.sed: Fix copyright notice to match standard format.
7375 * djgpp/subpipe.h: Likewise.
7376 * lib/bitsetv-print.c: Likewise.
7377 * lib/bitsetv.c: Likewise.
7378 * lib/subpipe.h: Likewise.
7379 * lib/timevar.c: Likewise.
7380 * lib/timevar.h: Likewise.
7381 * djgpp/subpipe.c: Use standard recipe for config.h.
7382 * lib/abitset.c: Likewise.
7383 * lib/bitset.c: Likewise.
7384 * lib/bitset_stats.c: Likewise.
7385 * lib/bitsetv-print.c: Likewise.
7386 * lib/bitsetv.c: Likewise.
7387 * lib/ebitsetv.c: Likewise.
7388 * lib/get-errno.c: Likewise.
7389 * lib/lbitset.c: Likewise.
7390 * lib/subpipe.c: Likewise.
7391 * lib/timevar.c: Likewise.
7392 * lib/vbitset.c: Likewise.
7393 * tests/local.at: Likewise.
7394 * src/scan-gram.l: Don't include verify.h, since system.h does
7395 that for us.
7396 * .x-sc_require_config_h: New file.
7397 * .x-sc_unmarked_diagnostics: New file.
7398
287c78f6
PE
73992006-01-20 Paul Eggert <eggert@cs.ucla.edu>
7400
287c78f6
PE
7401 Be a bit more systematic about using 'abort'.
7402 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
7403 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
7404 Put 'default: abort ();' before some other case, to satisfy older
7405 pedantic compilers.
7406 * lib/bitset_stats.c (bitset_stats_init): Likewise.
7407 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
7408 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
7409 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
7410 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
7411 (get_decision_str, get_orientation_str, get_node_alignment_str):
7412 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
7413 (get_linestyle_str, get_arrowstyle_str): Likewise.
7414 * src/conflicts.c (resolve_sr_conflict):
7415 Use a default case rather than one for the one remaining enum
7416 value, to catch invalid enum values as well.
7417 * src/lalr.c (set_goto_map, map_goto):
7418 Prefer "assert (FOO);" to "if (!FOO) abort ();".
7419 * src/nullable.c (nullable_compute, token_definitions_output):
7420 Likewise.
7421 * src/reader.c (packgram, reader): Likewise.
7422 * src/state.c (transitions_to, state_new, state_reduction_find):
7423 Likewise.
7424 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
7425 (symbol_pack): Likewise.
7426 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
7427 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
7428 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
7429 * src/system.h: Don't include <assert.h>.
7430 (assert): New macro.
7431
7432 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
7433 (Destructor Decl, Parser Function, Pure Calling):
7434 Describe rules for braces inside C code more carefully.
287c78f6 7435
c66dfadd
PE
74362006-01-19 Paul Eggert <eggert@cs.ucla.edu>
7437
c21493b8
PE
7438 Fix some porting glitches found by Nelson H. F. Beebe.
7439 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
7440 compilers that don't understand that abort () does not return.
7441 * src/state.c (transitions_to): Likewise.
7442 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
7443 that '#include <cstdlib>' works.
7444 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
7445 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
7446 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
7447 for the benefit of some pre-C99 compilers.
7448
b6e3facf
PE
7449 * bootstrap: Undo changes to gnulib files that autoreconf made.
7450
c66dfadd
PE
7451 Minor fixups to get 'make maintainer-check' to work.
7452 * configure.ac: Don't use -Wnested-externs, as it's incompatible
7453 with the new verify.h implementation.
7454 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
7455 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
7456 * data/yacc.c (YYUSE): Likewise.
7457 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
7458 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
7459 * src/parse-gram.y (declaration): Don't pass a string constant
7460 to a function that expects char *, since GCC might complain
7461 about the constant value.
7462 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
7463 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
7464 before #defining them.
7465 * tests/glr-regression.at
7466 (Incorrectly initialized location for empty right-hand side in GLR):
7467 In yyerror, use the msg arg.
7468 (Corrupted semantic options if user action cuts parse):
7469 (Incorrect lookahead during deterministic GLR):
7470 (Incorrect lookahead during nondeterministic GLR):
7471 Don't name a local var 'index'; it shadows string.h's 'index'.
7472
ed94ef2a
AD
74732006-01-19 Akim Demaille <akim@epita.fr>
7474
7475 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
7476 location, not just parts of it.
7477
e9ad4aec
PE
74782006-01-18 Paul Eggert <eggert@cs.ucla.edu>
7479
d6ca7905
PE
7480 * NEWS: Document the fact that multiple %unions are now allowed.
7481 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
7482 * TODO: This feature is now implemented, so remove it from
7483 the wishlist.
d6ca7905 7484
ef1b70e0
PE
7485 * Makefile.maint: Merge with coreutils Makefile.maint.
7486 (CVS_LIST): Use build-aux version if available.
7487 (VERSION_REGEXP): New macro.
7488 (syntax-check-rules): Add sc_no_if_have_config_h,
7489 sc_prohibit_assert_without_use, sc_require_config_h,
7490 sc_useless_cpp_parens.
7491 (sc_obsolete_symbols): Check for O_NDELAY.
7492 (sc_dd_max_sym_length): Track coreutils.
7493 (sc_unmarked_diagnostics): Look in all files, not just *.c.
7494 (sc_useless_cpp_parens): New rule.
7495 (news-date-check): Look for version or today's date.
7496 (changelog-check): Don't require version number near head.
7497 (copyright-check): Use current year instead of hardwiring 2005.
7498 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
7499 (announcement): Add --gpg-key-ID.
7500
7501 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
7502 with "file system".
7503
2073ce56 7504 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
7505 array. Problem reported by twlevo.
7506 * src/reader.c (packgram): Prepend a new sentinel before ritem.
7507 * src/lalr.c (build_relations): Rely on new sentinel.
7508 * src/gram.c (gram_free): Adjust to new sentinel.
7509
b7691f15
JD
75102006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
7511
7512 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
7513 yylookaheadNeeds. All uses updated.
7514 (yysplitStack): Rename local yynewLookaheadStatuses to
7515 yynewLookaheadNeeds.
7516 * data/glr-regression.at (Incorrect lookahead during nondeterministic
7517 GLR): In comments, change `lookahead status' to `lookahead need'.
7518
ddee1b06
PH
75192006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7520
7521 * data/glr.c (yysplitStack): A little stylistic rewrite.
7522
12f4614d
PH
75232006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7524
7525 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
7526
32c29292
JD
75272006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
7528
7529 * doc/bison.texinfo: Fix some typos.
7530 (GLR Semantic Actions): New subsection discussing special
7531 considerations because GLR semantic actions might be deferred.
7532 (Actions): Mention look-ahead usage of yylval.
7533 (Actions and Locations): Mention look-ahead usage of yylloc.
7534 (Special Features for Use in Actions): Add YYEOF entry and mention it
7535 in the yychar entry.
7536 In the yychar entry, remove mention of the local yychar case (pure
7537 parser) since this is irrelevant information when writing semantic
148d66d8 7538 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
7539 yychar is otherwise described as an external variable.
7540 In the yychar entry, don't call it the `current' look-ahead since it
7541 isn't when semantic actions are deferred.
7542 In the yychar and yyclearin entries, add note about deferred semantic
7543 actions.
7544 Add yylloc and yylval entries discussing look-ahead usage.
7545 (Look-Ahead Tokens): When discussing yychar, don't call it the
7546 `current' look-ahead, and do mention yylval and yylloc.
7547 (Error Recovery): Cross-reference `Action Features' when mentioning
7548 yyclearin.
148d66d8 7549 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
7550 look-ahead.
7551 In the yylloc and yylval entries, mention look-ahead usage.
7552
de366a2f 75532006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
7554
7555 * tests/glr-regression.at: Update copyright year to 2006.
7556
bf70fa87
JD
75572006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7558
7559 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
7560 use during nondeterministic operation to track which stacks have
7561 actually needed the current lookahead.
7562 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
7563 Allocate, deallocate, resize, and otherwise shuffle space for
7564 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
7565 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
7566 appropriately during nondeterministic operation.
7567 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
7568 members to store the current lookahead to be used by the deferred
7569 user action.
7570 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
7571 from which the RHS is taken. Set the lookahead members of the new
7572 yySemanticOption according to the lookahead status for stack yyk.
7573 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
7574 yyaddDeferredAction.
7575 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
7576 members of yySemanticOption before invoking yyuserAction, and then set
7577 them back to their current values afterward.
7578 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
7579 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
7580 * tests/glr-regression.at: Remove `.' from the ends of recent test case
7581 titles for consistency.
7582 (Leaked merged semantic value if user action cuts parse): In order to
7583 suppress lint warnings, use arguments in merge function, and assign
7584 char value < 128 in main.
7585 (Incorrect lookahead during deterministic GLR): New test case.
7586 (Incorrect lookahead during nondeterministic GLR): New test case.
7587
05449a2c
JD
75882006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
7589
de366a2f 7590 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
7591 !yyvaluep as signal that no semantic value is available to print.
7592 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
7593 to print a semantic value.
7594
4158e0a1 75952006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 7596
4158e0a1
JD
7597 * tests/glr-regression.at: For consistency with my newer test cases,
7598 don't thank myself.
7599
d659304d
JD
76002006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
7601
7602 * data/glr.c (yyresolveValue): When merging semantic options, if at
7603 least one user action succeeds but a later one cuts the parse, then
7604 destroy the semantic value before returning rather than leaking it.
7605 (yyresolveStates): If a user action cuts the parse and thus
7606 yyresolveValue fails, ignore the (unset) semantic value rather than
7607 corrupting the yyGLRState, and empty the semantic options list since
7608 the user actions should have called all necessary destructors.
7609 Simplify code with YYCHK.
7610 * tests/glr-regression.at (Corrupted semantic options if user action
7611 cuts parse): New test case.
7612 (Undesirable destructors if user action cuts parse): New test case.
7613 Before applying any of this patch, this test case never actually failed
7614 for me... but only because the corrupted semantic options usually
7615 masked this bug.
7616 (Leaked merged semantic value if user action cuts parse): New test
7617 case.
7618
6ec2c0f2
AD
76192006-01-05 Akim Demaille <akim@epita.fr>
7620
7621 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
7622
1b9c21fb
PE
76232006-01-04 Paul Eggert <eggert@cs.ucla.edu>
7624
7625 * data/c.m4 (b4_c_modern): New macro, with a new provision for
7626 _MSC_VER. Problem reported by Cenzato Marco.
7627 (b4_c_function_def): Use it.
7628 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
7629 b4_c_modern.
7630 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
7631 than rolling our own.
7632
84866159
AD
76332006-01-04 Akim Demaille <akim@epita.fr>
7634
7635 Also warn about non-used mid-rule values.
7636 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
7637 member.
7638 (symbol_list_new): Adjust.
7639 * src/reader.c (symbol_typed_p): New.
7640 (grammar_rule_check): Use it.
7641 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
7642 Check its rule.
7643 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
7644 Use it.
7645 * tests/actions.at (Exotic Dollars): Adjust.
7646
378f4bd8
AD
76472006-01-04 Akim Demaille <akim@epita.fr>
7648
7649 * src/reader.c (grammar_midrule_action): If $$ is set in a
7650 mid-rule, move the `used' bit to its lhs.
7651 * tests/input.at (Unused values): New.
7652 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
7653
e2a21b6f
PE
76542006-01-03 Paul Eggert <eggert@cs.ucla.edu>
7655
54662697
PE
7656 * doc/bison.texinfo (Bison Options): Say more accurately what
7657 --yacc does.
7658 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
7659 about declarations in the grammar when in Yacc mode, as POSIX does
7660 not require a diagnostic when the grammar uses extensions.
7661
7662 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
7663
073f9288
PE
7664 Warn about dubious constructions like "%token T T".
7665 Reported by twlevo.
7666 * src/symtab.h (struct symbol.declared): New member.
7667 * src/symtab.c (symbol_new): Initialize it to false.
7668 (symbol_class_set): New arg DECLARING, specifying whether
7669 this is a declaration that we want to warn about, if there
7670 is more than one of them. All uses changed.
7671
1221b78a
PE
7672 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
7673 Allow multiple %union directives, whose contents concatenate.
7674 * src/parse-gram.y (grammar_declaration): Likewise.
7675 Use muscle_code_grow, so that we don't need stype_line any more.
7676 All uses changed.
7677
7678 * src/muscle_tab.c (muscle_grow): Fix comment.
7679
e2a21b6f
PE
7680 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
7681 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
7682 Update copyright year to 2006.
7683
8f7e3cf9
AD
76842006-01-03 Akim Demaille <akim@epita.fr>
7685
7686 Have glr.cc pass (some of) the calc.at tests.
7687 * data/glr.cc (b4_parse_param_orig): New.
7688 (b4_parse_param): Improve its definition, and bound it more
7689 clearly in the skeleton.
7690 (b4_epilogue): Append, instead of prepending, in order to keep
7691 #line consistency.
7692 Simplify the generation of auxiliary functions: locations and
7693 purity are mandated.
7694 (b4_global_tokens_and_yystype): Honor it.
7695 * data/location.cc (c++.m4): Don't include it.
7696 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
7697 and AT_SKEL_CC_IF.
7698 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
7699 AT_LALR1_CC_IF.
7700 Be sure to initialize the first position's filename.
7701 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
7702 mandated anyway.
7703 (AT_CHECK_CALC_GLR_CC): New.
7704 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
7705
3953ed88
AD
77062006-01-02 Akim Demaille <akim@epita.fr>
7707
7708 * src/output.c (output_skeleton): Don't hard wire the inclusion of
7709 c.m4.
0a96ba81 7710 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
7711 * data/glr.cc: Do not include stack.hh.
7712
9ecafbbf
AD
77132006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7714
7715 * data/glr.c: Reformat whitespace with tabs.
7716 (b4_lpure_formals): Remove this unused m4 macro.
7717 * tests/cxx-type.at: Reformat whitespace with tabs.
7718 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
7719 since it's a member. Rename type to isNterm for clarity.
7720
c4d497a0
AD
77212005-12-29 Akim <akim@sulaco.local>
7722
7723 Let glr.cc catch up with symbol_value_print.
7724 * data/glr.cc (b4_yysymprint_generate): Replace by...
7725 (b4_yy_symbol_print_generate): this.
7726 (yy_symbol_print, yy_symbol_value_print): Declare them.
7727
4517da37
PE
77282005-12-28 Paul Eggert <eggert@cs.ucla.edu>
7729
7730 * src/location.h (boundary): Note that a line or column equal
7731 to INT_MAX indicates an overflow.
7732 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
7733 (rule_length_overflow, increment_rule_length, add_column_width):
7734 New functions.
7735 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
7736 (<SC_BRACED_CODE>"}"):
7737 Use increment_rule_length rather than incrementing it by hand.
7738 (adjust_location, handle_syncline): Diagnose overflow.
7739 (handle_action_dollar, handle_action_at):
7740 Fix bug with monstrosities like $-2147483648.
7741 Remove now-unnecessary checks.
7742 (scan_integer): Verify assumptions and remove now-unnecessary checks.
7743 (convert_ucn_to_byte): Verify assumptions.
7744 (handle_syncline): New arg LOC. All callers changed.
7745 Don't store through a value derived from char const * pointer.
7746
7747 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
7748 GCC warnings.
7749
e3233bf6
PE
77502005-12-27 Paul Eggert <eggert@cs.ucla.edu>
7751
7752 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
7753 Remove unnecessary forward static decls.
7754
8f3596a6
AD
77552005-12-27 Akim Demaille <akim@epita.fr>
7756
7757 * src/reader.c (grammar_current_rule_check): Also check that $$
7758 is used.
7759 Take the rule to check as argument, hence rename as...
7760 (grammar_rule_check): this.
7761 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
7762 Rename as...
7763 (grammar_rule_begin, grammar_rule_end): these, for consistency.
7764 (grammar_midrule_action, grammar_symbol_append): Now static.
7765 * tests/torture.at (input): Don't rely on the default action
7766 being always performed.
7767 * tests/calc.at: "Set" $$ even when the action is "cut" with
7768 YYERROR or other.
7769 * tests/actions.at (Exotic Dollars): Instead of using unused
7770 values, check that the warning is issued.
7771
721be13c
PE
77722005-12-22 Paul Eggert <eggert@cs.ucla.edu>
7773
7774 * NEWS: Improve wording for unused-value warnings.
7775
a0af42fc
AD
77762005-12-22 Akim Demaille <akim@epita.fr>
7777
7778 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
7779 (b4_yysymprint_generate): Rename as...
7780 (b4_yy_symbol_print_generate): this.
7781 Generate yy_symbol_print instead of yysymprint.
7782 Generate also yy_symbol_value_print, and use it.
7783
affac613
AD
77842005-12-22 Akim Demaille <akim@epita.fr>
7785
721be13c 7786 * NEWS: Warn about unused values.
affac613
AD
7787 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
7788 a `used' member.
7789 (symbol_list_n_get, symbol_list_n_used_set): New.
7790 (symbol_list_n_type_name_get): Use symbol_list_n_get.
7791 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
7792 * src/reader.c (grammar_current_rule_check): Check that values are
7793 used.
7794 * src/symtab.c (symbol_print): Accept 0.
7795 * tests/existing.at: Remove the type information.
7796 Empty the actions.
7797 Remove useless actions (beware of mid-rule actions: perl -000
7798 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
7799 * tests/actions.at (Exotic Dollars): Use unused values.
7800 * tests/calc.at: Likewise.
7801 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7802 Likewise.
7803
7804 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
7805 rule_useful_p.
7806
9d9b8b70
PE
78072005-12-21 Paul Eggert <eggert@cs.ucla.edu>
7808
8bb4c753
PE
7809 Undo 2005-12-01 tentative license wording change. The wording is
7810 still being reviewed by the lawyers, and we don't want to wait for
7811 them before publishing a test release. For now, revert to the
7812 previous wording.
7813 * NEWS: Undo 2005-12-01 change.
7814 * data/glr.c: Revert to previous license wording.
7815 * data/glr.cc: Likewise.
7816 * data/lalr1.cc: Likewise.
7817 * data/location.cc: Likewise.
7818 * data/yacc.c: Likewise.
7819
9d9b8b70
PE
7820 * NEWS: Reword %destructor vs YYABORT etc.
7821 * data/glr.c: Use American spacing, for consistency.
7822 * data/glr.cc: Likewise.
7823 * data/lalr1.cc: Likewise.
7824 * data/yacc.c: Likewise.
7825 * data/yacc.c: Reformat comments slightly.
7826 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
7827 for consistency. Fix some spelling errors and reword recently-included
7828 text slightly.
7829 * tests/cxx-type.at: Cast results of malloc, for C++.
7830
2c3b392a
AD
78312005-12-21 Joel E. Denny <address@hidden>
7832
7833 * tests/cxx-type.at: Construct a tree, count the parents of shared
7834 nodes, and free each node once and only once. Previously, the memory
7835 for semantic values was leaked instead.
7836
d6cff4dc
AD
78372005-12-21 Joel E. Denny <address@hidden>
7838
7839 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
7840 (yylval, yylloc): If pure, #define to yystackp->yyval and
7841 yystackp->yyloc similar to yychar and yynerrs.
7842 (yyparse): If pure, remove local yylval and yylloc. Add local
7843 yystackp to accommodate pure definitions of yylval and yylloc.
7844 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
7845 yylvalp and yyllocp to &yylval and &yylloc.
7846 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
7847 namespace. Previously, nerrs and char were missing, but lval and lloc
7848 weren't necessary.
7849 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
7850 yylvalp and yyllocp parameters since, if pure, these are now always
7851 accessible through yystackp. If not pure, they are still accessible
7852 globally.
7853 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
7854 `if (YYID (N))' to pacify lint.
7855
a85284cf
AD
78562005-12-21 Akim Demaille <akim@epita.fr>
7857
7858 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
7859 destroy the RHS symbols of a rule.
7860 * data/yacc.c (yylen): Initialize to 0.
7861 Keep its value to the number of items to possibly shift.
7862 In particular, a regular successful parse that ends on YYFINAL by
7863 a (internal) YYACCEPT must not have yylen != 0.
7864 (yyerrorlab, yyreturn): Pop the RHS.
7865 Reorder a bit to emphasize the `shifting' bits of code.
7866 (YYPOPSTACK): Now accept a number of items to pop.
7867 * data/lalr1.cc: Likewise.
7868 * data/glr.c: Formatting changes.
7869 Use goto instead of fall through.
7870 * doc/bison.texinfo (Destructor Decl): Complete.
7871
d508c281
JMG
78722005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7873
7874 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
7875 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
7876 * djgpp/config.bat: Replace every occurence of the file name
7877 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7878 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7879 * djgpp/config.sed: Replace every occurence of the file name
7880 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
7881 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
7882 * djgpp/djunpack.bat: DJGPP specific file.
7883 * djgpp/fnchange.lst: DJGPP specific file.
7884 * djgpp/README.in: Add new information about how to unpack the bison
7885 source on MSDOS and other systems which have 8.3 file name restrictions
7886 using djunpack.bat and fnchange.lst.
7887
3e7a2cd9
PE
78882005-12-12 Paul Eggert <eggert@cs.ucla.edu>
7889
7890 * bootstrap (build_cvs_prefix): Remove; unused.
7891 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
7892 when getting gnulib.
7893
78942005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
7895
7896 * data/glr.c: Reorder typedef declarations for structs to match order
7897 of struct declarations.
7898 Rename yystack everywhere to yystackp except in yyparse where it's not
7899 a pointer.
7900 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
7901 consistency.
7902 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
7903 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
7904 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
7905 lint.
7906
877519f8
PE
79072005-12-09 Paul Eggert <eggert@cs.ucla.edu>
7908
0eca5a39
PE
7909 * tests/sets.at (Accept): Fix typos in regular expression used to
7910 sed out the final state number.
7911
2cec9080
PE
7912 Work around portability problem on Solaris 10: flex-generated
7913 files include <stdio.h> before <config.h>, which messes up
7914 because the latter defines __EXTENSIONS__. Address the problem
7915 by creating two new little files that include <config.h> first,
7916 then include the flex-generated files. Rewrite everyone else
7917 to include <config.h> first, as well.
7918 * lib/timevar.c: Always include "config.h".
7919 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
7920 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
7921 (EXTRA_bison_SOURCES): New macro.
7922 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
7923 * src/system.h: Don't include config.h.
7924 * src/LR0.c: Include <config.h> first.
7925 * src/assoc.c: Likewise.
7926 * src/closure.c: Likewise.
7927 * src/complain.c: Likewise.
7928 * src/conflicts.c: Likewise.
7929 * src/derives.c: Likewise.
7930 * src/files.c: Likewise.
7931 * src/getargs.c: Likewise.
7932 * src/gram.c: Likewise.
7933 * src/lalr.c: Likewise.
7934 * src/location.c: Likewise.
7935 * src/main.c: Likewise.
7936 * src/muscle_tab.c: Likewise.
7937 * src/nullable.c: Likewise.
7938 * src/output.c: Likewise.
7939 * src/parse-gram.y: Likewise.
7940 * src/print.c: Likewise.
7941 * src/print_graph.c: Likewise.
7942 * src/reader.c: Likewise.
7943 * src/reduce.c: Likewise.
7944 * src/relation.c: Likewise.
7945 * src/state.c: Likewise.
7946 * src/symlist.c: Likewise.
7947 * src/symtab.c: Likewise.
7948 * src/tables.c: Likewise.
7949 * src/uniqstr.c: Likewise.
7950 * src/vcg.c: Likewise.
7951
877519f8
PE
7952 * src/parse-gram.y: Fix minor problems uncovered by lint.
7953 (current_lhs, current_lhs_location): Now static.
7954 (current_assoc): Remove unused variable.
7955
7956 Cleanups so that Bison-generated parsers have less lint.
7957 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
7958 Prepend /*ARGSUSED*/, for lint's sake.
7959 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
7960 definition if 'lint' is defined.
7961 (YYID): New macro (or function, if lint).
7962 All uses of /*CONSTCOND*/0 replaced by YYID(0).
7963 * data/yacc.c: Likewise.
7964 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
7965 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
7966 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
7967 is C++ only.
7968 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
7969 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
7970 Use YYID(0) rather than 0, for lint.
7971 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
7972 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
7973
f5228370
PE
79742005-12-07 Paul Eggert <eggert@cs.ucla.edu>
7975
7976 * tests/glr-regression.at
7977 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
7978 Close memory leak reported by twlevo.
7979
69ce078b
PE
79802005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
7981
6ff99711
PE
7982 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
7983 all stacks.
7984 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
7985 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7986 New test case.
7987 (Duplicated user destructor for lookahead): This test now is expected
7988 to succeed.
7989
af3412cd
PE
79902005-12-01 Paul Eggert <eggert@cs.ucla.edu>
7991
32b5b719 7992 * NEWS: Document the following change.
af3412cd
PE
7993 * data/yacc.c: Say "parser skeleton" rather than "file", since
7994 it's no longer just a file.
7995 * data/glr.c: Grant a special exception for C GLR parsers, that
7996 reads like the already-existing exception for C LALR(1) parsers.
7997 * data/glr.cc: Likewise.
7998 * data/lalr1.cc: Likewise.
7999 * data/location.cc: Likewise.
8000 * data/yacc.c: Reword the "written by" statement to clarify that
8001 it was the parser skeleton, not the entire output file.
8002 * data/glr.c: Written by Paul Hilfinger.
8003 * data/glr.cc: Written by Akim Demaille.
8004 * data/lalr1.cc: Likewise.
8005
035aa4a0
PE
80062005-11-18 Paul Eggert <eggert@cs.ucla.edu>
8007
d9963c85
PE
8008 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
8009 Fix typos in previous change that broke 'make check'.
8010 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
8011 supported in C.
8012 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
8013 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
8014 We can revert this once things settle down.
8015
035aa4a0
PE
8016 * src/conflicts.c (conflicts_print): Don't print file name twice
8017 when %expect fails because there were no conflicts.
8018 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
8019 change.
8020 * tests/conflicts.at (%expect not enough, %expect too much):
8021 (%expect with reduce conflicts): Adjust to new behavior.
8022
80232005-11-18 Akim Demaille <akim@epita.fr>
8024
8025 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
8026 errors.
8027 * NEWS: Document this.
8028 * doc/bison.texinfo (Expect Decl): Likewise.
8029
d1ff7a7c
AD
80302005-11-16 Akim Demaille <akim@epita.fr>
8031
8032 Generalize the display of semantic values and locations in traces.
8033 * data/glr.c (yy_reduce_print): Fix indices (again).
8034 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
8035 literal integers.
8036 * data/lalr1.cc (yyreduce_print): Rename as...
8037 (yy_reduce_print): this.
8038 Display values and locations.
8039 * data/yacc.c (yy_reduce_print): Likewise.
8040 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
8041 (yysymprint): Move higher to be visible from yy_reduce_print).
8042 (yyparse): Adjust.
8043 * tests/calc.at: Adjust the expected length of the traces.
8044
6de5398d
AD
80452005-11-14 Akim Demaille <akim@epita.fr>
8046
8047 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
8048 from 1 to N, while values and location start at 0.
8049 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
8050
a1373f55
AD
80512005-11-14 Akim Demaille <akim@epita.fr>
8052
8053 * data/glr.c (yy_reduce_print): Fix the $ number.
8054
613d8952
AD
80552005-11-14 Akim Demaille <akim@epita.fr>
8056
8057 "Use" parse parameters.
8058 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
8059 * data/glr.c, data/glr.cc: Use them.
8060 * data/glr.c (YYUSE): Have a C++ definition that supports
8061 non-pointer types.
8062
b2741627
AD
80632005-11-14 Akim Demaille <akim@epita.fr>
8064
8065 * data/glr.c (yyexpandGLRStack): Declare only if defined.
8066
5059b5c8
AD
80672005-11-14 Akim Demaille <akim@epita.fr>
8068
42249483
AD
8069 * data/glr.cc: New.
8070 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 8071
4626a15d
AD
80722005-11-12 Akim Demaille <akim@epita.fr>
8073
8074 Let position and location be PODs.
8075 * data/location.cc (position::initialize, location::initialize): New.
8076 (position::position, location::location): Define only if
8077 b4_location_constructors is defined.
8078 * data/lalr1.cc (b4_location_constructors): Define it for backward
8079 compatibility.
8080 * doc/bison.texinfo (Initial Action Decl): Use initialize.
8081
80822005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
8083
8084 * data/lalr1.cc: Move the body of the ctor and dtor into the
8085 parser file (instead of the header).
8086 Wrap the implementations in a "namespace yy".
8087
80882005-11-12 Akim Demaille <akim@epita.fr>
8089
8090 Have glr.c include its header file when created.
8091 * data/glr.c (b4_shared_declarations): New.
8092 Output them verbatim in the parser if !%defines, otherwise
8093 output then in the header file, and include it instead.
8094
1989d947
AD
80952005-11-11 Akim Demaille <akim@epita.fr>
8096
8097 * data/glr.c: Comment changes.
8098
80992005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
8100
8101 When yydebug, report semantic and location values for reductions.
8102 * data/glr.c (yy_reduce_print): Report the semantic values and the
8103 locations.
8104 (YY_REDUCE_PRINT): Adjust.
8105 (yyglrReduce): Use them.
8106 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
8107 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
8108 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
8109 traces.
8110
02998094
AD
81112005-11-10 Akim Demaille <akim@epita.fr>
8112
8113 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
8114 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
8115 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
8116
5210672f
PE
81172005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
8118
8119 * m4/cxx.m4, examples/Makefile.am: Don't build
8120 examples/calc++ if no C++ compiler is available. (trivial change)
8121
a8991a1d
AD
81222005-11-09 Akim Demaille <akim@epita.fr>
8123
8124 * src/scan-skel.l: Use a couple of asserts.
8125
36b5e963
AD
81262005-11-03 Akim Demaille <akim@epita.fr>
8127
8128 In some (weird) cases, the final state number is incorrect.
8129 Reported by Alexandre Duret-Lutz.
8130 * src/LR0.c (state_list_append): Remove the computation of
8131 final_state.
8132 (save_reductions): Do it here.
8133 (get_state): Alpha conversion.
8134 (generate_states): Use a for loop.
8135 * src/gram.h (item_number_is_rule_number)
8136 (item_number_is_symbol_number): New.
8137 * src/state.c: Use assert.
8138 * src/system.h: Include assert.h.
8139 * tests/sets.at (Accept): New.
8140
44e7ead1
PH
81412005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8142
8143 * data/glr.c (yyfill): Adjust comment.
36b5e963 8144 (yyresolveAction): Initialize default location properly
44e7ead1
PH
8145 for empty right-hand sides.
8146 (yydoAction): Ditto.
8147 Add comment explaining apparently dead code.
36b5e963
AD
8148 * tests/glr-regression.at
8149 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 8150 New test.
36b5e963 8151
e10a80ee
PE
81522005-10-30 Paul Eggert <eggert@cs.ucla.edu>
8153
8154 * bootstrap (cleanup_gnulib): New function. Use it to clean up
8155 gnulib when interrupted. This fixes some race conditions and
8156 works around some portability problems (one noted by Paul
8157 Hilfinger).
8158
067b32ee
AD
81592005-10-22 Akim <akim@epita.fr>
8160
8161 * Makefile.cfg: Adjust to config -> build-aux.
8162 Reported by twledo.
8163
4b367315
AD
81642005-10-21 Akim Demaille <akim@epita.fr>
8165
8166 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
8167 the %parse-params.
8168 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
8169 * data/yacc.c (b4_Pure_if): Rename as...
8170 (b4_yacc_pure_if): this.
8171 (YY_SYMBOL_PRINT, yyparse): Adjust.
8172 * doc/bison.texinfo: Formatting changes.
8173
24cc23d9
AD
81742005-10-21 Akim Demaille <akim@epita.fr>
8175
8176 Finish the transition config -> build-aux.
8177 * configure.ac, Makefile.am: Use build-aux.
8178 * config/prev-version, config/announce-gen, config/Makefile.am:
8179 Move to...
8180 * build-aux/prev-version, build-aux/announce-gen,
8181 * build-aux/Makefile.am: here.
8182
d4476375
AD
81832005-10-14 Akim Demaille <akim@epita.fr>
8184
8185 * examples/calc++/test: Use set -x only when VERBOSE.
8186
302c0aee
PE
81872005-10-13 Paul Eggert <eggert@cs.ucla.edu>
8188
8189 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
8190 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
8191
7625ec2c
AD
81922005-10-13 Akim Demaille <akim@epita.fr>
8193
8194 * src/scan-skel.l: Output the base name parts of the parser and
8195 header file names.
302c0aee 8196 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
8197 additional checks.
8198 Use this to exercise C++ outputs in subdirs.
8199 Reported by Oleg Smolsky.
8200
ba0fe3c7
PE
82012005-10-12 Paul Eggert <eggert@cs.ucla.edu>
8202
8203 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
8204 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
8205 Problem reported by John P. Hartmann.
8206 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
8207 already defined it.
8208
9b8a5ce0
AD
82092005-10-12 Akim Demaille <akim@epita.fr>
8210
8211 * src/parse-gram.y (version_check): Exit 63 to please missing
8212 (stands for "version mismatch).
8213 * tests/input.at, doc/bison.texinfo: Adjust.
8214
4f6e011e
PE
82152005-10-10 Paul Eggert <eggert@cs.ucla.edu>
8216
8217 Work around portability problems with Visual Age C compiler
8218 (xlc and xlC_r) reported by John P. Hartmann.
8219 * data/location.cc (initial_column, initial_line): Remove.
8220 All uses replaced by 0 and 1.
8221 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
8222 that xlc complains about.
8223 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 8224 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 8225 as __STDC__.
4d7aa45e
PE
8226 * data/yacc.c (YYMODERN_C): New macro, which also looks at
8227 __STDC_VERSION__. Use it everywhere instead of looking at
8228 __STDC__ and __cplusplus.
4f6e011e 8229
a1b3bf8c
AD
82302005-10-10 Akim Demaille <akim@epita.fr>
8231
8232 * examples/calc++/test: Be quiet unless VERBOSE.
8233
412e44aa
PE
82342005-10-05 Paul Eggert <eggert@cs.ucla.edu>
8235
2a4647a3
PE
8236 * data/c.m4 (yydestruct, yysymprint):
8237 Use YYUSE instead of casting to void.
8238 * data/glr.c (YYUSE): New macro.
8239 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
8240 Use it instead of rolling our own.
8241 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
8242 (YYCHK1):
8243 Use /*CONSTCOND*/ to suppress lint warnings.
8244 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
8245 (YY_STACK_PRINT): Use 'false' not '0'.
8246 (YYUSE): New macro.
8247 (yysymprint_, yydestruct_): Use it instead of rolling our own.
8248 * data/yacc.c (YYUSE): New macro.
8249 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
8250 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
8251 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
8252
8253
412e44aa
PE
8254 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
8255 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
8256
88c6637f
PE
82572005-10-04 Paul Eggert <eggert@cs.ucla.edu>
8258
2f4f028d
PE
8259 Undo the parts of the unlocked-I/O change that substituted
8260 putc or puts for printf. This might hurt performance a bit,
8261 but some people prefer the printf style.
8262 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
8263 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
8264 All uses replaced by YYFPRINTF and YYDPRINTF.
8265 * data/yacc.c: Likewise.
8266 * lib/bitset.c (bitset_print): Likewise.
8267 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
8268 putc and puts.
8269 * lib/lbitset.c (debug_lbitset): Likewise.
8270 * src/closure.c (print_firsts, print_fderives): Likewise.
8271 * src/gram.c (grammar_dump): Likewise.
8272 * src/lalr.c (look_ahead_tokens_print): Likewise.
8273 * src/output.c (escaped_output): Likewise.
8274 (user_actions_output): Break apart two printfs.
8275 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
8276 * src/reduce.c (reduce_print): Likewise.
8277 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
8278 * src/system.h: Include unlocked-io.h rathe than stdio.h.
8279
88c6637f
PE
8280 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
8281 Use assignments rather than casts-to-void to suppress
8282 unused-variable warnings. This pacifies 'lint'.
8283 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
8284 unused-variable warnings.
8285
fb32e373
JMG
82862005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8287
8288 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
8289
edb8f44f
PE
82902005-10-02 Paul Eggert <eggert@cs.ucla.edu>
8291
fb9c0b33
PE
8292 Use unlocked I/O for a minor performance improvement on hosts like
8293 GNU/Linux and Solaris that support unlocked I/O. The basic idea
8294 is to use the gnlib unlocked-io module, and to prefer putc and
8295 puts to printf when either will work (since the latter doesn't
8296 come in an unlocked flavor).
8297 * bootstrap (gnulib_modules): Add unlocked-io.
8298 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
8299 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
8300 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
8301 and similarly for puts and putc and printf.
8302 * data/yacc.c: Likewise.
8303 * lib/bitset.c (bitset_print): Likewise.
8304 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
8305 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
8306 to printf.
8307 * lib/lbitset.c (debug_lbitset): Likewise.
8308 * src/closure.c (print_firsts, print_fderives): Likewise.
8309 * src/gram.c (grammar_dump): Likewise.
8310 * src/lalr.c (look_ahead_tokens_print): Likewise.
8311 * src/output.c (escaped_output): Likewise.
8312 (user_actions_output): Coalesce two printfs.
2f4f028d 8313 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
8314 * src/reduce.c (reduce_print): Likewise.
8315 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 8316 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 8317
edb8f44f
PE
8318 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
8319 this confuses xgettext.
8320
b50d2359
AD
83212005-10-02 Akim Demaille <akim@epita.fr>
8322
8323 * bootstrap (gnulib_modules): Add strverscmp.
8324 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
8325 * m4/.cvsignore: Add strverscmp.m4.
8326 * src/parse-gram.y (%require): New token, new rule.
8327 (version_check): New.
8328 * src/scan-gram.l (%require): Adjust.
8329 * tests/input.at (AT_REQUIRE): New.
8330 Use it.
8331 * doc/bison.texinfo (Require Decl): New.
8332 (Calc++ Parser): Use %require.
8333
21667f64
AD
83342005-10-02 Akim Demaille <akim@epita.fr>
8335
8336 * data/location.cc: New.
8337
2b81e969
AD
83382005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
8339 Akim Demaille <akim@epita.fr>
8340
8341 Make sure -odir/foo.cc creates dir/location.hh etc.
8342 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
8343 (spec_file_prefix, spec_verbose_file, spec_graph_file)
8344 (spec_defines_file): Now const.
8345 (dir_prefix): New.
8346 (short_base_name): Remove.
8347 * src/files.c: Adjust.
8348 (dirname.h): Include.
8349 (base_name): Don't prototype it.
8350 (finput): Remove, duplicates gram_in.
8351 (full_base_name, short_base_name): Replace by...
8352 (all_but_ext, all_but_tab_ext): these.
8353 (compute_base_names): Rename as...
8354 (compute_file_name_parts): this.
8355 Update to compute the new variables, including dir_prefix.
8356 Adjust dependencies.
8357 * src/output.c (prepare): Output them.
8358 * src/reader.c: Adjust to use gram_in, not finput.
8359 * src/scan-skel.l (@dir_prefix@): New.
8360
ad6a9b97
JMG
83612005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8362
8363 * lib/subpipe.c: New function end_of_output_subpipe() added
8364 to allow support for non-posix systems. This is a no-op function
8365 for posix systems.
8366
8367 * lib/subpipe.h: New function end_of_output_subpipe() added
8368 to allow support for non-posix systems. This is a no-op function
8369 for posix systems.
8370
8371 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
8372 handle the lack of pipe/fork functionality on non-posix systems.
8373
8374 * djgpp/Makefile.maint: DJGPP specific file.
8375
8376 * djgpp/README.in: DJGPP specific file.
8377
8378 * djgpp/config.bat: DJGPP specific configuration file.
8379
8380 * djgpp/config.sed: DJGPP specific configuration file.
8381
8382 * djgpp/config.site: DJGPP specific configuration file.
8383
8384 * djgpp/config_h.sed: DJGPP specific configuration file.
8385
8386 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
8387
8388 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
8389
fc695704
AD
83902005-10-02 Akim Demaille <akim@epita.fr>
8391
8392 * data/location.cc: New, extract from...
8393 * data/lalr1.cc: here.
8394 (location.hh): Include it after the user prologue, in case the
8395 filename type is defined by the user.
8396 Forward declation location and position before the pre-prologue.
8397 (yyresult_): Rename as...
8398 (yyresult): this, it's a local variable, not an attribute.
8399 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
8400
84012005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
8402
8403 * examples/extexi: Restore the #line generation.
8404
fb9712a9
AD
84052005-09-30 Akim Demaille <akim@epita.fr>,
8406 Alexandre Duret-Lutz <adl@gnu.org>
8407
8408 Move the token type and YYSTYPE in the parser class.
8409 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
8410 (parser::token): New, from the moved free definition of tokens.
8411 (parser::semantic_value): Now a full definition instead of an
8412 indirection to YYSTYPE.
8413 (b4_post_prologue): No longer included in the header file, but
8414 in the implementation file.
8415 * doc/bison.texi (C+ Language Interface): Update.
8416 * src/parse-gram.y: Support unary %define.
8417 * tests/actions.at: Define global_tokens_and_yystype for backward
8418 compatibility until we update the tests.
8419 * tests/calc.at: Idem.
8420 (first_line, first_column, last_line, last_column): Define for lalr1.cc
8421 to simplify the code.
8422
55f0c7b1
PE
84232005-09-29 Paul Eggert <eggert@cs.ucla.edu>
8424
8425 Port to SunOS 4.1.4, which lacks strtoul and strerror.
8426 Ah, the good old days! Problem reported by Peter Klein.
8427 * bootstrap (gnulib_modules): Add strerror, strtoul.
8428 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
8429 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
8430
fb9712a9 84312005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
8432
8433 * data/c.m4 (b4_error_verbose_if): New.
8434 * data/lalr1.cc: Use it.
8435 (YYERROR_VERBOSE_IF): Remove.
8436 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
8437 parser members, replaced by...
8438 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
8439 local variables.
8440 (yysyntax_error_): Takes the state number as argument.
8441 (yyreduce_print_): Use the argument yyrule, not the former
8442 attribute yyn_.
8443
8a6f72f3
PE
84442005-09-26 Paul Eggert <eggert@cs.ucla.edu>
8445
8446 * bootstrap (gnulib_modules): Add verify.
8447 * lib/.cvsignore: Add verify.h.
8448 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
8449 * src/system.h (verify): Remove.
8450 Include verify.h instead.
8451 * src/tables.c (tables_generate): Use new API for 'verify'.
8452
0d50976f
PE
84532005-09-21 Paul Eggert <eggert@cs.ucla.edu>
8454
ebc3737e
PE
8455 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
8456 local variables whose names begin with 'yy'.
8457 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8458 Trivial changes from Joel E. Denny.
8459
0d50976f
PE
8460 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
8461 it itself.
8462 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
8463 don't use alloca any more.
8464
8465 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
8466 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 8467 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
8468 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
8469 to match yacc.c, to test more hosts.
8470
a05b79df
PE
84712005-09-20 Paul Eggert <eggert@cs.ucla.edu>
8472
55289366
PE
8473 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
8474 doesn't affect behavior.
8475 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
8476 Solaris, AIX, MSC.
8477 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
8478 This works a bit better with glibc, if user code has already included
8479 stdlib.h.
8480 * doc/bison.texinfo (Bison Parser): Document that users can't
8481 arbitrarily use malloc and free for other purposes. Document
8482 that <alloca.h> and <malloc.h> might be included.
8483 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
8484 user must declare alloca.
8485
a05b79df
PE
8486 * HACKING (release): Forwarn the Translation Project about
8487 stable releses.
8488
3ab2ca22
AD
84892005-09-20 Akim Demaille <akim@epita.fr>
8490
8491 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
8492
a9739e7c
PE
84932005-09-19 Paul Eggert <eggert@cs.ucla.edu>
8494
a702593e
PE
8495 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
8496 (YYSTACK_ALLOC_MAXIMUM): Use it.
8497 (yysyntax_error): New function.
8498 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
8499 multiple syntax errors are reported, and alloca is being used.
8500 Instead, reallocate buffers twice as big each time, so that
8501 we waste at most half the allocated memory. Start with a small
8502 (128-byte) buffer that will suffice in most cases anyway.
8503 Use yysyntax_error to do most of the work.
8504
8505 * doc/bison.texinfo (Error Reporting, Table of Symbols):
8506 yynerrs is the number of errors reported, not the number of
8507 errors encountered.
8508
a9739e7c
PE
8509 * tests/glr-regression.at (Duplicated user destructor for lookahead):
8510 Mark it as expected to fail.
8511 Cast result of malloc; problem reported by twlevo@xs4all.nl.
8512 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
8513 Don't start user-code symbols with "yy", to avoid name space problems.
8514
f479c6c6
AD
85152005-09-19 Akim Demaille <akim@epita.fr>
8516
8517 Remove the traits, failed experiment.
8518 It never proved useful, and anyway because of the current
8519 definition, it was not possible to have several specialization of
8520 this traits, making it useless.
8521 * data/lalr1.cc (yy:traits): Remove.
8522 Inline its definitions in the parser class.
8523
e2586f82
AD
85242005-09-19 Akim Demaille <akim@epita.fr>
8525
8526 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
8527 least Mac OSX with a /usr/local install of gettext.
8528
2e8cf949
AD
85292005-09-19 Akim Demaille <akim@epita.fr>
8530
8531 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
8532 and yytoken for similarity with the other skeletons.
8533
c7fb0b90
AD
85342005-09-19 Akim Demaille <akim@epita.fr>
8535
4e26c69e 8536 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 8537
1bd0deda
PE
85382005-09-16 Paul Eggert <eggert@cs.ucla.edu>
8539
8540 * NEWS: Version 2.1.
8541
8542 * NEWS: Remove notice of yytname change, since it was never in an
8543 official release.
8544 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
8545 diagnostic.
8546 * src/output.c (prepare): Likewise.
8547 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
8548 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
8549 is not defined. This is an awful hack, but it's enough for now.
8550 All callers changed.
8551 * tests/glr-regression-at (make_value): Args are const pointers now,
8552 to avoid GCC warning.
8553 (Duplicated user destructor for lookahead): New test. Currently
8554 skipped. It fails on my host but I'm not sure it'll always fail.
8555
85562005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
8557
8558 * src/symtab.h (struct symbol): Declare the printer and destructor
8559 as const, to avoid accidental calls to free.
8560 (symbol_destructor_set, symbol_printer_set): Adjust.
8561 * src/symtab.c: Adjust.
8562
1bd0deda 85632005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
8564
8565 * data/c.m4 (b4_token_enums): New.
8566 (b4_token_defines): Rename as...
8567 (b4_token_enums_defines): this.
8568 (b4_token_defines): New, output only the #defines.
8569 * data/yacc.c, data/glr.c: Adjust.
8570 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
8571 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
8572 as default values.
8573
dbcdae2d
AD
85742005-09-16 Akim Demaille <akim@epita.fr>
8575
8576 * data/lalr1.cc (yylex_): Remove, inline its code.
8577 (yyreport_syntax_error_): Remove, replaced by...
8578 (yysyntax_error_): this which returns a string and leaves to the
8579 caller the call to the users' error function.
8580 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
8581 Move from members of the parser object...
8582 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
8583 to local variables of the parse function.
8584
70d8f291
AD
85852005-09-16 Akim Demaille <akim@epita.fr>
8586
8587 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
8588 since it's in Bison's name space.
8589
b47dbebe
PE
85902005-09-15 Paul Eggert <eggert@cs.ucla.edu>
8591
ae199bf1
PE
8592 * data/glr.c (yyresolveValue): Add default case to pacify
8593 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
8594
b47dbebe
PE
8595 * NEWS: Document when yyparse started to return 2.
8596 * doc/bison.texinfo (Parser Function): Document when yyparse
8597 returns 2.
8598
8599 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
8600 (b4_filename_type): Renamed back from b4_file_name_type. All uses
8601 changed.
8602 (class position): file_name -> filename (reverting). All uses changed.
8603
86042005-09-14 Paul Eggert <eggert@cs.ucla.edu>
8605
8606 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
8607 do anything if $@ exists. This reverts part of the 2005-07-07
8608 patch.
8609
00292f66
PE
86102005-09-11 Paul Eggert <eggert@cs.ucla.edu>
8611
8612 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
8613 contains obsolete information and isn't worth distributing as a
8614 separate file anyway.
8615 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
8616 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
8617 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
8618 (yyparse): Abort if user code uses longjmp to throw an unexpected
8619 value.
8620
a420f962
PE
86212005-09-09 Paul Eggert <eggert@cs.ucla.edu>
8622
00292f66
PE
8623 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
8624 Suggested by twlevo@xs4all.nl.
8625
127287e9
PE
8626 * data/glr.c (YYCHK1): Do not assume YYE is in range.
8627 This avoids a diagnostic from gcc -Wswitch-enum.
8628 Problem reported by twlevo@xs4all.nl.
8629
a420f962
PE
8630 * doc/bison.texinfo: Don't use "filename", as per GNU coding
8631 standards. Use "file name" or "file" or "name", depending on
8632 the context.
8633 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
8634 not to hack/foo.tab.c.
8635 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
8636 * data/glr.c: b4_filename -> b4_file_name.
8637 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
8638 All uses changed.
8639 (class position): filename -> file_name. All uses changed.
8640 * data/yacc.c: b4_filename -> b4_file_name.
8641 * lib/bitset.h: filename -> file_name in local vars.
8642 * lib/bitset_stats.c: Likewise.
8643 * src/files.c: Likewise.
8644 * src/scan-skel.l ("@output ".*\n): Likewise.
8645 * src/files.c (file_name_split): Renamed from filename_split.
8646 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
8647
86482005-09-08 Paul Eggert <eggert@cs.ucla.edu>
8649
8650 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
8651 to accommodate latest gnulib.
8652
8653 * tests/glr-regression.at (Duplicate representation of merged trees):
8654 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
8655
8656 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
8657 needed.
8658
42a6501d
PE
86592005-08-26 Paul Eggert <eggert@cs.ucla.edu>
8660
8661 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
8662 All uses changed. Invoke user destructor after an error during a
8663 split parse (trivial change from Joel E. Denny).
8664
8665 * tests/glr-regression.at
8666 (User destructor after an error during a split parse): New test case.
8667 Problem reported by Joel E. Denny in:
8668 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
8669
ef9a1faf
PE
86702005-08-25 Paul Eggert <eggert@cs.ucla.edu>
8671
5b4aaf78
PE
8672 * README-cvs: Give URLs for recommended tools.
8673 Mention Gzip version problem, and bootstrapping issues.
8674 Remove troubleshooting section, as it's somewhat obsolete.
8675
b5240ba5
PE
8676 * bootstrap (no_cache): New var, to accommodate different wget
8677 variants. Use it instead of '-C off'. Problem reported by
8678 twlevo@xs4all.nl.
8679
ef9a1faf
PE
8680 * data/glr.c (yydestroyStackItem): New function.
8681 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
8682 debugging information. Problem reported by Joel E. Denny.
8683
e6efa9da
AD
86842005-08-25 Akim Demaille <akim@epita.fr>
8685
8686 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
8687
adc90f13
PE
86882005-08-24 Paul Eggert <eggert@cs.ucla.edu>
8689
8690 * data/glr.c (yyrecoverSyntaxError, yyreturn):
8691 Don't invoke destructor on unresolved entries.
8692 * tests/glr-regression.at
8693 (User destructor for unresolved GLR semantic value): New test case.
8694 Problem reported by Joel E. Denny in:
8695 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
8696
f9315de5
PE
86972005-08-21 Paul Eggert <eggert@cs.ucla.edu>
8698
15d29c1f
PE
8699 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
8700 Add strnlen.c.
8701 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
8702 lib-prefix.m4, po.m4.
8703
dd5f2af2
PE
8704 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
8705 in yydestruct diagnostic, since it might not be an error.
8706 Problem reported by Joel Denny near end of
8707 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 8708 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
8709 * data/yacc.c (yyreturn): Likewise.
8710 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
8711
8712 * src/files.c: Remove obsolete FIXME comment.
8713
8714 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
8715 with the other templates, and to fix bogus run-on messages such
8716 as the one reported at the end of
8717 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
8718 All callers changed to avoid the newline.
8719 (yyprocessOneStack): Output two lines rather than one, to accommodate
8720 the above change. This changes the debug output format slightly.
8721
f9315de5
PE
8722 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
8723 reported by Joel E. Denny in
8724 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
8725 (trivial change).
8726 * tests/glr-regression.at (Duplicate representation of merged trees):
8727 New test, from Joel E. Denny in:
8728 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
8729 * THANKS: Add Joel E. Denny.
8730
8731 * configure.ac (AC_INIT): Bump to 2.0c.
8732
04098407
PE
87332005-07-24 Paul Eggert <eggert@cs.ucla.edu>
8734
8735 * NEWS: Version 2.0b.
8736
ca5d2013
PE
8737 * Makefile.am (SUBDIRS): Put examples before tests, so that
8738 "make check" doesn't finish with "All 1 tests passed".
8739
3d54b576
PE
8740 * tests/regression.at (Token definitions): Don't rely on
8741 AT_PARSER_CHECK for data that contains backslashes. It currently
8742 uses 'echo', and 'echo' isn't portable if its argument contains
8743 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
8744 that the byte '\0xff' is not printable in the C locale; it is,
8745 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
8746 not printable, so use '\0x81' to test.
8747
d53ae497
PE
8748 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
8749 version of GCC, since the macro is used with non-GCC compilers.
8750
fc01665e
PE
8751 Fix core dump reported by Pablo De Napoli in
8752 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
8753 * tests/regression.at (Invalid inputs with {}): New test.
8754 * src/parse-gram.y (token_name): Translate type before using
8755 it as an index.
8756
04098407
PE
8757 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
8758 the user's name space. All uses changed to __attribute__
8759 ((__unused__)).
8760 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
8761 Add __attribute__ ((__noreturn__)).
8762
8763 * etc/clcommit: Remove. We weren't using it, and it failed
8764 "make maintainer-distcheck".
8765 * Makefile.maint: Merge from coreutils.
8766 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
8767 (syntax-check-rules): Change list of rules as described below.
8768 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
8769 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
8770 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
8771 (sc_trailing_space): New rules.
8772 (sc_xalloc_h_in_src): Remove.
8773 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
8774 (sc_space_tab, sc_error_exit_success, sc_changelog):
8775 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
8776 (makefile-check, po-check, author_mark_check):
8777 (makefile_path_separator_check, copyright-check):
8778 Use grep -n, to make it easier to find violations.
8779 Use CVS_LIST and CVS_LIST_EXCEPT.
8780 (header_regexp, h_re): Remove.
8781 (dd_c): New macro.
8782 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
8783 (my-distcheck): Use more-modern GCC flags.
8784 (signatures, %.asc): Remove.
8785 (rel-files, announcement): Remove signatures.
8786 Restore old updating code, even though we don't use it, so
8787 that we're the same as coreutils.
8788 (alpha, beta, major): Depend on news-date-check.
8789 Make the upload commands.
8790
8791 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
8792 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
8793 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
8794 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
8795 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
8796 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
8797 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
8798 * tests/sets.at: Likewise.
8799
8800 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
8801 we comment out the Autoconf version number.
8802 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
8803 it's error-prone and "make maintainer-distcheck" rejects it.
8804
8805 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
8806 Indent calls to "error" to pacify "make maintainer-distcheck",
8807 when the calls are not intended to be translated.
8808 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
8809
8810 * src/Makefile.am (DEFS): Use +=, to pacify
8811 "make maintainer-distcheck".
8812 (bison_SOURCES): Add scan-skel.h.
8813 (sc_tight_scope): New rule, from coreutils.
8814
8815 * src/files.c (src_extension, header_extension):
8816 Now static, not extern.
8817 * src/getargs.c (short_options): Likewise.
8818 * src/muscle_tab.c (muscle_table): Likewise.
8819 * src/parse-gram.y (current_class, current_type, current_prec):
8820 Likewise.
8821 * src/reader.c (grammar_end, previous_rule_end): Likewise.
8822 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
8823 * src/main.c (main): Cast bindtextdomain and textdomain calls to
8824 void, to avoid warning when NLS is disabled.
8825 * src/output.c: Include scan-skel.h.
8826 (scan_skel): Remove decl, since scan-skel.h does this.
8827 (output_skeleton):
8828 Indent calls to "error" to pacify "make maintainer-distcheck".
8829 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
8830 * src/reader.h (gram_end, gram_lineno): New decls to pacify
8831 "make maintainer-distcheck".
8832 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
8833 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
8834 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
8835 (skel_lex_destroy, scan_skel): Move these decls to...
8836 * src/scan-skel.h: New file.
8837 * src/uniqstr.c (uniqstr_assert):
8838 Indent calls to "error" to pacify "make maintainer-distcheck".
8839
8840 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
8841 not @VAR@.
8842
8843 * tests/torture.at: Revamp to avoid misuse of atoi that
8844 "make maintainer-distcheck" complained about.
8845
8846 * examples/extexi (message): Don't print a message more than once,
8847 and omit line-number decoration that makes Emacs compile think
8848 that informative messages are worth worrying about.
8849
88502005-07-22 Paul Eggert <eggert@cs.ucla.edu>
8851
8852 * configure.ac: Update version number.
8853
8854 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
8855 accidentally.
8856 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
8857 autogenerated by the maintainer.
8858 * examples/calc++/.cvsignore: Add *.yy.
8859
8860 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
8861 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8862 * lib/bitsetv.c (bitsetv_alloc): Likewise.
8863
8864 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
8865
8866 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
8867 from maintainer-distcheck about casting the argument of 'free'.
8868
8869 * NEWS: Mention recent yytname changes.
8870 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
8871
8872 * bootstrap: For translations that have not yet been upgraded to
8873 the new runtime-po domain, prime the pump by extracting the
8874 relevant strings from the obsolete translations. This code can be
8875 removed once the bison-runtime domain has been translated by each
8876 team.
8877
8878 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
8879 now that token names are already quoted.
8880
8881 Fix problem reported by Anthony Heading.
8882 * data/glr.c (YYTOKEN_TABLE): New macro.
8883 (yytname): Define if YYTOKEN_TABLE.
8884 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
8885 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
8886 (YYERROR_VERBOSE): Define the same way the other skeletons do.
8887 * src/output.c (prepare_symbols): Output token_table_flag.
8888
0ffda363
PE
88892005-07-21 Paul Eggert <eggert@cs.ucla.edu>
8890
8891 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
8892 again if the first call fails.
8893
8894 * data/glr.c (yytnamerr): New function.
8895 (yyreportSyntaxError): Use it to dequote most string literals.
8896 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
8897 with other skeletons. All uses changed.
8898 (yytnameerr_): New function.
8899 (yyreport_syntax_error): Use it to dequote most string literals.
8900 * data/yacc.c (yytnamerr): New function.
8901 (yyerrlab): Use it to decode most string literals.
8902 * doc/bison.texinfo (Decl Summary, Calling Convention):
8903 Clarify quoting convention of yytname.
8904 * src/output.c (prepare_symbols): Quote all names. This undoes
8905 the 2005-04-17 change, which is now accomplished (mostly) via
8906 changes in the parsers as described above.
8907 * tests/regression.at (Token definitions, Web2c Actions):
8908 Undo most 2005-04-17 change here, too.
8909
89102005-07-20 Paul Eggert <eggert@cs.ucla.edu>
8911
8912 Fix more problems reported by twlevo@xs4all.nl.
8913 * tests/cxx-type.at: Don't pipe output of ./types through sed to
8914 remove trailing spaces. This loses the exit status of ./types,
8915 and isn't needed since ./types shouldn't be emitting trailing
8916 spaces.
8917 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
8918 as the stack isn't valid in that case.
8919
8920 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8921 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8922 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8923 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
8924 is used.
8925 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
8926 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8927 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8928 Likewise.
8929
8930 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
8931 overly-picky compilers that reject 'char *foo = "bar";'.
8932
8933 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
8934 to FILE * parameter, not to stderr. This fixes a typo introduced
8935 in the 2005-07-12 change.
8936
8937 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
8938 warnings from GCC 4.
8939
8940 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
8941 (yyglrShiftDefer, yysplitStack):
8942 Remove unused parameters b4_pure_formals. All uses changed.
8943 (yyglrShift): Remove unused parameters b4_user_formals.
8944 All uses changed.
8945 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
8946
6100a9aa
PE
89472005-07-18 Paul Eggert <eggert@cs.ucla.edu>
8948
258b75ca
PE
8949 Destructor cleanups and regularization among the three skeletons.
8950 * NEWS: Document the behavior changes.
8951 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
8952 stack before failing, as the cleanup code will do it for us now.
8953 * data/lalr1.cc (yyerrlab): Likewise.
8954 * data/glr.c (yyparse): Pop everything off the stack before
8955 freeing it, so that destructors get called properly.
8956 * data/lalr1.cc (yyreturn): Likewise.
8957 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
8958 This is more consistent.
8959 * doc/bison.texinfo (Destructor Decl): Mention more reasons
8960 why destructors might be called. 1.875 -> 2.1.
8961 (Destructor Decl, Decl Summary, Table of Symbols):
8962 Some English-language cleanups for %destructor.
8963 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8964 Add output line for destructor of start symbol.
8965 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
8966 because of that same extra output line.
8967
1a059451
PE
8968 * NEWS: Document minor wording changes in diagnostics of
8969 Bison-generated parsers.
8970 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
8971 Remove unused formals. All uses changed.
8972 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
8973 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
8974 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
8975 Rename yyoverflowab to yyexhaustedlab.
8976 When memory exhaustion occurs during syntax-error reporting,
8977 report it separately rather than in a single diagnostic; this
8978 eases translation.
8979 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
8980 (Memory Exhausted): Renamed from Parser Stack Overflow.
8981 Revamp wording slightly to prefer "memory exhaustion".
8982 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
8983
97460c78
PE
8984 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
8985
30757c8c
PE
8986 Add i18n support to the GLR skeleton. Partially fix the C++
8987 skeleton; a C++ expert needs to finish this. Remove debugging
8988 msgids; there's little point to having them translated, since they
8989 can be understood only by someone who can read the
8990 (English-language) source code.
8991
8992 Generate runtime-po/bison-runtime.pot automatically, so that we
8993 don't have to worry about garbage getting in that file. We'll
8994 make sure after the next official release that old msgids don't
8995 get lost. See
8996 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
8997
8998 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
8999 Now auto-generated.
9000 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
9001 Fix typos in explanations of the runtime file.
9002 * bootstrap: Change gettext keyword from YYI18N to YY_.
9003 Use standard Makefile.in.in in runtime-po, since we'll arrange
9004 for backward-compatible bison-runtime.po files in a different way.
9005 * data/glr.c (YY_): New macro, from yacc.c.
9006 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
9007 Translate messages intended for users.
9008 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
9009 the wording in the other skeletons. We don't know that the memory
9010 is virtual.
9011 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
9012 Use same method that yacc.c uses.
9013 Don't translate debugging messages.
9014 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
9015 it doesn't work (yet), and requires C++ expertise to fix.
9016 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
9017 Move defn to a more logical place, to be consistent with other
9018 skeletons.
9019 Don't translate debugging messages.
9020 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
9021 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
9022 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
9023 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
9024
ac8c5689
PE
9025 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
9026 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
9027 void, not int.
9028 * tests/glr-regression.at (Badly Collapsed GLR States):
9029 Likewise.
9030 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9031 yylex should return 0 at EOF rather than aborting.
9032
6100a9aa
PE
9033 Improve tests for stack overflow in GLR parser.
9034 Problem reported by twlevo@xs4all.nl.
9035 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
9036 All uses removed.
9037 (yyStackOverflow): Just longjmp, but with value 2 so that caller
9038 can handle the problem.
9039 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
9040 (yyparse): New local variable yyresult to record the result.
9041 Use result of setjmp to set it, rather than storing itinto
9042 struct.
9043 (yyDone): Remove label.
9044 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
9045 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
9046 if YYABORT is used).
9047 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
9048 yyparse status; put status > 1 into diagnostic.
9049 Check that status==2 works.
9050 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
9051 Use exit status 3 for failure to open (which shouldn't happen).
9052
15f40952
PE
90532005-07-17 Paul Eggert <eggert@cs.ucla.edu>
9054
67fd79c4
PE
9055 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
9056 1 on syntax error; just let yyparse do its thing.
9057 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
9058 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
9059 (Exploding the Stack Size with Alloca):
9060 (Exploding the Stack Size with Malloc):
9061 Expect exit status 2, not 1, since the parser is supposed to blow
9062 its stack. Problem reported by twlevo@xs4all.nl.
9063
15f40952
PE
9064 * data/glr.c (yyparse): Don't assume that the initial calls
9065 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
9066 Print a stack-overflow message and fail instead.
9067 Initialize the line-number information before creating the stack,
9068 so that the stack-overflow message can report line zero safely.
9069
f32c66b5
PE
90702005-07-14 Paul Eggert <eggert@cs.ucla.edu>
9071
a22ff96f 9072 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
9073 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
9074 (yyuserMerge): Provide a default case if b4_mergers is empty.
9075 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
9076 * tests/glr-regression.at
9077 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 9078 Add casts to pacify C++ compilers.
1beb0b24
PE
9079 * tests/glr-regression.at (Improper merging of GLR delayed action
9080 sets): Declare yylex before using it.
f32c66b5 9081 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
9082 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
9083 test for valgrind; valgrind is independent of g++.
9084 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
9085 for compatibility with POSIX 1003.1-2001 (if running coreutils).
9086 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
9087 Use a destructor, so that we can expand the stack. Change
9088 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 9089
d741bd1b
PE
90902005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9091
9092 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
9093 a valgrind failure. Problem reported by twlevo@xs4all.nl.
9094
0410a6e0
PE
90952005-07-13 Paul Eggert <eggert@cs.ucla.edu>
9096
9097 * PACKAGING: New file, suggested by Bruno Haible and taken from
9098 similar wording in gettext's PACKAGING file.
9099 * NEWS: Mention PACKAGING.
9100 * Makefile.am (EXTRA_DIST): Add PACKAGING.
9101
f7ab6a50
PE
91022005-07-12 Paul Eggert <eggert@cs.ucla.edu>
9103
baf785db 9104 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
9105 * bootstrap: Get runtime translations into runtime-po.
9106 Create runtime-po files automatically, if possible.
9107 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
9108 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
9109 does not infringe on the user's name space.
9110 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
9111 * doc/bison.texinfo (Internationalization): Revamp the English
9112 and Texinfo syntax a bit, to try to make it clearer.
9113 (Bison Options, Option Cross Key): Mention --print-localedir.
9114 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
9115 YYENABLE_NLS. Quote a bit more.
9116 * runtime-po/.cvsignore: New file.
9117 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
9118 * runtime-po/Rules-quot: Remove; now created by bootstrap.
9119 * runtime-po/quot.sed: Likewise.
9120 * runtime-po/boldquot.sed: Likewise.
9121 * runtime-po/en@quot.header: Likewise.
9122 * runtime-po/en@boldquot.header: Likewise.
9123 * runtime-po/insert-header.sin: Likewise.
9124 * runtime-po/remove-potcdate.sin: Likewise.
9125 * runtime-po/Makevars: Likewise.
9126 * runtime-po/LINGUAS: Likewise.
9127 * runtime-po/de.po: Likewise; we will rely on the translation project
9128 to maintain this, so "bootstrap" should get it.
0410a6e0 9129 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
9130 its value.
9131 * src/main.c (main): Bind the bison-runtime domain, too.
9132
91332005-07-12 Bruno Haible <bruno@clisp.org>
9134
9135 * data/yacc.c: Include <libintl.h> when NLS is enabled.
9136 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
9137 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
9138 * runtime-po: New directory.
9139 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
9140 $(DOMAIN).pot-update rule, so that old messages are never dropped.
9141 * runtime-po/Rules-quot: New file, copied from po/.
9142 * runtime-po/quot.sed: Likewise.
9143 * runtime-po/boldquot.sed: Likewise.
9144 * runtime-po/en@quot.header: Likewise.
9145 * runtime-po/en@boldquot.header: Likewise.
9146 * runtime-po/insert-header.sin: Likewise.
9147 * runtime-po/remove-potcdate.sin: Likewise.
9148 * runtime-po/Makevars: New file.
9149 * runtime-po/POTFILES.in: New file.
9150 * runtime-po/LINGUAS: New file.
9151 * runtime-po/bison-runtime.pot: New file.
9152 * runtime-po/de.po: New file.
9153 * m4/bison.m4: New file.
9154 * Makefile.am (SUBDIRS): Add runtime-po.
9155 (aclocaldir, aclocal_DATA): New variables.
9156 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
9157 Define aclocaldir.
9158 * src/getargs.c (usage): Document --print-localedir option.
9159 (PRINT_LOCALEDIR_OPTION): New enum item.
9160 (long_options): Add --print-localedir option.
9161 (getargs): Handle --print-localedir option.
9162 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
9163 (Internationalization): New section.
9164
22dda0f0
AD
91652005-07-12 Akim Demaille <akim@epita.fr>
9166
9167 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
9168 for consistency with the rest of the code.
9169 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
9170 Add separators.
9171
82b248ad
AD
91722005-07-12 Akim Demaille <akim@epita.fr>
9173
9174 * src/parse-gram.y: Use %printer instead of YYPRINT.
9175
fa0e9314
AD
91762005-07-12 Akim Demaille <akim@epita.fr>
9177
867a3e00
AD
9178 * src/symtab.h, src/symtab.c (symbol_print): New.
9179 * src/symlist.h, src/symlist.c (symbol_list_print): New.
9180 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
9181
91822005-07-12 Akim Demaille <akim@epita.fr>
9183
9184 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
9185 b4_at_dollar and b4_dollar_dollar.
9186
e054b190
PE
91872005-07-11 Paul Eggert <eggert@cs.ucla.edu>
9188
9189 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
9190 and Pennello's paper.
9191
34160ec4
PE
91922005-07-09 Paul Eggert <eggert@cs.ucla.edu>
9193
407d4a75
PE
9194 * data/yacc.c (yyparse): Undo previous patch. Instead,
9195 set yylsp[0] and yyvsp[0] only if the initial action
9196 sets yylloc and yylval, respectively.
9197
34160ec4
PE
9198 * data/yacc.c (yyparse): In the initial action, set
9199 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
9200 This avoids the use of undefined variables if the initial
9201 action does not set yylloc and/or yylval.
9202
c3d5a4a7
PE
92032005-07-07 Paul Eggert <eggert@cs.ucla.edu>
9204
b34d96c1
PE
9205 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
9206 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
9207 Remove from CVS. These files are automatically generated.
9208 * examples/extexi: Clarify that this file is now part of Bison,
9209 not GNU M4, and that it works with any POSIX-compatible Awk.
9210 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
9211 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
9212 so that we also get calc++-parser.yy. Geneate it.
9213 Use $(AWK), not gawk, since any conforming Awk will do.
9214 Put comment before action, since older 'make' can't handle comment
9215 in action.
9216 $(BUILT_SOURCES): List all built sources, not just some of them.
9217 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
9218 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
9219 $($(calc_sources_generated)): Remove unnecessary test for existence
9220 of target. (This had a shell syntax error anyway; a stray "x".)
9221 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
9222 calc++-parser.yy.
9223 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
9224
c3d5a4a7
PE
9225 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
9226 implied by the other modules.
9227
828c373b
AD
92282005-07-06 Akim Demaille <akim@epita.fr>
9229
9230 Bind examples/calc++ to the package.
9231 * examples/calc++/Makefile: Remove, replaced by...
9232 * examples/calc++/Makefile.am: ... this new file.
9233 * examples/calc++/test: Remove input.
9234 * examples/calc++/compile: Remove.
9235 * examples/Makefile.am: New.
9236 * configure.ac, Makefile.am: Adjust.
9237 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
9238
63cb01d6
PE
92392005-07-05 Paul Eggert <eggert@cs.ucla.edu>
9240
fd2df2ed
PE
9241 * data/glr.c (yyFail): Drastically simplify; since the format argument
9242 never had any % directives, we can simply pass it to yyerror.
9243 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
9244 be modified later, as that is the usual style in glr.c.
9245 Problems reported by Paul Hilfinger.
9246
63cb01d6
PE
9247 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
9248 and size overflow errors.
9249 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
9250 in case the user prolog sets feature-test macros like _GNU_SOURCE.
9251 (YYSIZEMAX): New macro.
9252 (yystpcpy): New function, taken from yacc.c.
9253 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
9254 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
9255 so that we don't have to maintain their signatures.
9256 (yyFail): Check for buffer overflow, by using vsnprintf rather
9257 than vsprintf. Allocate a bigger buffer if possible.
9258 Report an error if buffer allocation fails.
9259 (yyStackOverflow): New function.
9260 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
9261 the initialization was successful. It might fail if storage was
9262 exhausted.
9263 (yyexpandGLRStack): Add more checks for storage allocation failure.
9264 Use yyStackOverflow to report failures.
9265 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
9266 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
9267 Don't assume stack number fits in int.
9268 (yysplitStack): Check for storage allocation failure.
9269 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
9270 can print diagnostics on storage allocation failure. All callers
9271 changed.
9272 (yyresolveValue): Use yybool for boolean.
9273 (yyreportSyntaxError): Check for size-calculation overflow.
9274 This code is taken from yacc.c.
9275 (yyparse): Check for storage allocation errors when allocating
9276 the initial stack.
9277
1c59e0a1
AD
92782005-07-05 Akim Demaille <akim@epita.fr>
9279
9280 Extract calc++ from the documentation.
9281 * doc/bison.texinfo (Calc++): Add the extraction marks.
9282 * examples/extexi: New, from the aborted GNU Programming 2E.
9283 Separate the different paragraph of a file with empty lines.
9284 * examples/Makefile: Use it to extract the whole calc++ example.
9285
8a0adb01
AD
92862005-06-24 Akim Demaille <akim@epita.fr>
9287
9288 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
9289 class typedefs.
9290
12545799
AD
92912005-06-22 Akim Demaille <akim@epita.fr>
9292
9293 * doc/bison.texinfo (C++ Language Interface): First stab.
9294 (C++ Parsers): Remove.
9295
99be0235
AD
92962005-06-22 Akim Demaille <akim@epita.fr>
9297
9298 * data/lalr1.cc (yylex_): Honor %lex-param.
9299
0ffd4fd1
AD
93002005-06-22 Akim Demaille <akim@epita.fr>
9301
9302 Start a set of simple examples.
9303 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
9304 * examples/calc++/calc++-driver.hh,
9305 * examples/calc++/calc++-parser.yy,
9306 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
9307 * examples/calc++/compile, examples/calc++/test: New.
9308
0925ebb4
PE
93092005-06-09 Paul Eggert <eggert@cs.ucla.edu>
9310
9311 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
9312 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
9313 which stems from the 2005-05-27 patch.
9314
43d3b664
PH
93152005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9316
9317 * data/glr.c: Modify treatment of unused parameters to permit use
9318 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
9319
3062864d
PE
93202005-05-30 Paul Eggert <eggert@cs.ucla.edu>
9321
9322 Fix infringement on user name space reported by Janos Zoltan Szabo.
9323 * data/yacc.c (yyparse): strlen -> yystrlen.
9324
989b5b8e
AD
93252005-05-30 Akim Demaille <akim@epita.fr>
9326
9327 * data/lalr1.cc (_): New.
9328 Translate the various messages.
9329
bedf57f5
PE
93302005-05-27 Paul Eggert <eggert@cs.ucla.edu>
9331
9332 Fix infringement on user name space reported by Bruno Haible.
9333 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
9334 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
9335 the user's name space.
9336 (alloca): Include <stdlib.h> to get it, if it's not built in.
9337 (YYMALLOC, YYFREE): Define only if needed.
9338 (malloc, free): Declare, but only if needed, as this infringes on
9339 the user name space.
9340
4d1801f1
PE
93412005-05-25 Paul Eggert <eggert@cs.ucla.edu>
9342
9343 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
9344 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
9345 with %d format.
9346 * lib/ebitset.c (min, max): Undef before defining.
9347 * lib/vbitset.c (min, max): Likewise.
9348 * lib/subpipe.c (create_subpipe): Save local variables in case
9349 vfork clobbers them.
9350
93512005-05-24 Bruno Haible <bruno@clisp.org>
9352
9353 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
9354 error message syntax used by gcc-4.0.
9355
b94a9e1e
PE
93562005-05-23 Paul Eggert <eggert@cs.ucla.edu>
9357
85ac3861
PE
9358 * README: Mention m4 1.4.3. Remove obsolete advice about
9359 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
9360
b94a9e1e
PE
9361 * bootstrap: Remove workaround for problem I encountered with
9362 gettext 0.14.1; it seems to be fixed now.
9363
51c30d21
PE
93642005-05-22 Paul Eggert <eggert@cs.ucla.edu>
9365
009ce67d
PE
9366 * NEWS: Version 2.0a.
9367
f2a97c62
PE
9368 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
9369 the previous change.
9370
c8775f93
PE
9371 Various maintainer cleanups.
9372 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
9373 conftest*, for benefit of CVS commands run at the same time as
9374 "configure". Add build-aux, since "bootstrap" now creates it and
9375 its subfiles.
9376 * Makefile.cfg (move_if_change): Remove.
9377 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
9378 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
9379 (po_repo, do-po-update, po-update, wget_files, get-targets):
9380 (config.guess-url_prefix, config.sub-url_prefix):
9381 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
9382 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
9383 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
9384 Remove.
9385 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
9386 this is now the recommended name.
9387 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
9388 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
9389 ylwrap. These files now go into build-aux.
9390 * config/move-if-change: Remove.
9391 * config/prev-version.txt: Bump from 1.75 to 2.0.
9392
3ea5f0ec
PE
9393 * bootstrap: Add stdio-safer, unistd-safer modules.
9394 Remove m4/glibc2.m4 (introduced by latest gnulib, but
9395 we don't need it).
9396 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
9397 fopen-safer.c, stdio-safer.h, unistd-safer.h.
9398 * lib/subpipe.c: Include "unistd-safer.h".
9399 (create_subpipe): Make sure all the newly-created
9400 file descriptors are > 2, so that diagnostics don't
9401 get sent down them (which might cause Bison to hang, in theory).
9402 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
9403 * src/files.c (xfopen): Use fopen_safer, not fopen.
9404
51c30d21
PE
9405 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
9406 yesterday's yacc.c fix.
9407
cea1469d
PE
94082005-05-21 Paul Eggert <eggert@cs.ucla.edu>
9409
3ea5f0ec
PE
9410 * data/glr.c, data/lalr1.cc: Update copyright date.
9411
cea1469d
PE
9412 Fix a destructor bug reported by Wolfgang Spraul in
9413 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
9414 * data/yacc.c (yyabortlab): Don't call destructor, and
9415 don't set yychar to EMPTY.
9416 (yyoverflowlab): Don't call destructor.
9417 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
9418 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
9419 since we no longer output the message "discarding lookahead token
9420 end of input ()".
9421
5e6f62f2
PH
94222005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
9423
9424 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
9425 fix a small glitch in debugging output.
9426 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
9427 after YY_SYMBOL_PRINT where needed.
9428
9429 (struct yyGLRState): Add some comments.
9430 (struct yySemanticOption): Add some comments.
9431 (union yyGLRStackItem): Add comment.
9432
9433 (yymergeOptionSets): Correct this to properly perform the union,
9434 avoiding infinite reported by Michael Rosien.
9435 Update comment.
9436
9437 * tests/glr-regression.at: Add test for GLR merging error reported
9438 by M. Rosien.
cea1469d 9439
0fb669f9
PE
94402005-05-13 Paul Eggert <eggert@cs.ucla.edu>
9441
9442 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
9443 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
9444 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
9445 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
9446 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
9447 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
9448 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
9449 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
9450 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
9451 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
9452 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
9453 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
9454 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
9455 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
9456 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
9457 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
9458 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
9459 src/derives.h, src/files.c, src/files.h, src/getargs.c,
9460 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
9461 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
9462 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
9463 src/output.h, src/parse-gram.c, src/parse-gram.h,
9464 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
9465 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
9466 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
9467 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
9468 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
9469 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
9470 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
9471 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
9472 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
9473 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
9474 tests/reduce.at, tests/regression.at, tests/sets.at,
9475 tests/synclines.at, tests/testsuite.at, tests/torture.at:
9476 Update FSF postal mail address.
9477
51f4735e
PE
94782005-05-11 Paul Eggert <eggert@cs.ucla.edu>
9479
9480 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
9481 Problem reported by Ralf Menzel.
9482
80ce3401
PE
94832005-05-01 Paul Eggert <eggert@cs.ucla.edu>
9484
9485 * tests/actions.at: Test that stack overflow invokes destructors.
9486 From Marcus Holland-Moritz.
9487 * data/yacc.c (yyerrlab): Move the code that destroys the stack
9488 from here....
9489 (yyreturn): to here. That way, destructors are called properly
9490 even if the stack overflows, or the user calls YYACCEPT or
9491 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
9492 (yyoverflowlab): Destroy the lookahead.
9493
94942005-04-24 Paul Eggert <eggert@cs.ucla.edu>
9495
9496 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
9497
72f000b0
PE
94982005-04-17 Paul Eggert <eggert@cs.ucla.edu>
9499
9500 * NEWS: Bison-generated C parsers no longer quote literal strings
9501 associated with tokens.
9502 * src/output.c (prepare_symbols): Don't escape strings,
9503 since users don't want to see C escapes.
9504 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
9505 in diagnostics.
c19683bb 9506 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
9507 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
9508
1094323f
PE
95092005-04-16 Paul Eggert <eggert@cs.ucla.edu>
9510
9511 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
9512 the data size is known to be too small and we can't increase it.
9513 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
9514
ca407bdf
PE
95152005-04-15 Paul Eggert <eggert@cs.ucla.edu>
9516
9517 * src/parse-gram.y: Include quotearg.h.
9518 (string_as_id): Quote $1 before using it as a key, since the
9519 lexer no longer quotes it for us.
9520 (string_content): Don't strip quotes, since lexer no longer
9521 quotes it for us.
9522 * src/scan-gram.l: Include quotearg.h.
9523 ("\""): Omit quote.
9524 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
9525 a key, since the rest of the lexer doesn't quote it.
9526 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
9527 * tests/regression.at (Token definitions): Check for backslashes
9528 in token strings.
9529
9530 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
9531 (YYSIZE_T): Define to unsigned long int when using an older compiler.
9532 (yyparse): Revamp code to generate long syntax error message, to
9533 make it easier to translate, and to avoid problems with arithmetic
9534 overflow. Change "virtual memory" to "memory" in diagnostic, since
9535 we don't know whether the memory is virtual.
9536
1ce59070
PE
95372005-04-13 Paul Eggert <eggert@cs.ucla.edu>
9538
9539 * NEWS: Bison-generated C parsers now use the _ macro to
9540 translate strings.
9541 * data/yacc.c (_) [!defined _]: New macro.
9542 All English strings wrapped inside this macro.
9543 * doc/bison.texinfo (Bison Parser): Document _.
9544 * po/POTFILES.in: Include src/parse-gram.c, since it now
9545 includes translateable strings that parse-gram.y doesn't.
9546
a749a695
PE
95472005-04-12 Paul Eggert <eggert@cs.ucla.edu>
9548
9549 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
9550 reverting the 2004-10-11 change to this function.
9551 (symbol_check_alias_consistency): Don't call symbol_type_set
9552 if the type name is already correct.
9553 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
9554
8fb1053b
PE
95552005-03-25 Paul Eggert <eggert@cs.ucla.edu>
9556
9557 * tests/regression.at (Token definitions): Don't use a token named
9558 c, as that generates a "#define c ..." that runs afoul of buggy
9559 stdlib.h that uses the identifier c as a member of struct
9560 drand48_data. Problem reported by Horst Wente.
9561
ff498c4a
PE
95622005-03-21 Paul Eggert <eggert@cs.ucla.edu>
9563
9564 * bootstrap: Change translation URL from
9565 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
9566 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
9567 redirection glitches. Problem reported by twlevo@xs4all.nl.
9568
65211d70
PE
95692005-03-20 Paul Eggert <eggert@cs.ucla.edu>
9570
9571 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
9572 after operands; POSIX says this isn't portable for the c99 command.
9573
9577fb1f
PE
95742005-03-18 Paul Eggert <eggert@cs.ucla.edu>
9575
9576 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
9577 immediately if a data overrun has occurred; this may help us track
9578 down what may be a spurious failure on MacOS.
9579
78b178f7
PE
95802005-03-17 Paul Eggert <eggert@cs.ucla.edu>
9581
a2599d0f
PE
9582 Respond to problems reported by twlevo@xs4all.nl.
9583
9584 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
9585
78b178f7
PE
9586 * src/vcg.h: Comment fix.
9587 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
9588 (G_CMAX): Change to -1 instead of INT_MAX.
9589
9590 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 9591
7296e729
PE
95922005-03-15 Paul Eggert <eggert@cs.ucla.edu>
9593
9594 * src/tables.c (state_number_to_vector_number): Put it inside an
9595 "#if 0", since it's not currently used. Problem reported by
9596 Roland McGrath.
9597
05ac60f3
PE
95982005-03-06 Paul Eggert <eggert@cs.ucla.edu>
9599
9600 * src/output.c (escaped_output): Renamed from
9601 escaped_file_name_output, since we now use it for symbol tags as
9602 well. All uses changed.
9603 (symbol_destructors_output, symbol_printers_output):
9604 Escape symbol tags too.
9605 Problem reported by Matyas Forstner in
9606 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
9607
9608 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
9609 not needed.
9610 * src/output.c (user_actions_output, token_definitions_output,
9611 symbol_destructors_output, symbol_printers_output): Likewise.
9612 * src/reader.c (prologue_augment): Likewise.
9613 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
9614
9615 * src/vcg.c (output_edge): Don't quote linestyle arg.
9616 Problem reported by twlevo@xs4all.nl.
9617
7eb453ac
PE
96182005-02-28 Paul Eggert <eggert@cs.ucla.edu>
9619
9620 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
9621 example, reported by Derek M Jones. Also, make the example even
9622 more outrageous, to better illustrate how bad the problem is.
9623
4c04c52a
PE
96242005-02-24 Paul Eggert <eggert@cs.ucla.edu>
9625
9626 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
9627 putsym. Typo reported by Sebastian Piping.
9628
a61e1620
PE
96292005-02-23 Paul Eggert <eggert@cs.ucla.edu>
9630
9631 * doc/bison.texinfo (Language and Grammar): some -> same
9632 (Epilogue): int he -> in the
9633 Typos reported by Sebastian Piping via Justin Pence.
9634
9ec93868
PE
96352005-02-07 Paul Eggert <eggert@cs.ucla.edu>
9636
9637 * tests/glr-regression.at (Improper handling of embedded actions
9638 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
9639 embedded actions and $-N in GLR parsers", work around an Autoconf bug
9640 with dollar signs in test names.
9641 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
9642 for a similar reason.
9643
73ce7e7e
PE
96442005-01-28 Paul Eggert <eggert@cs.ucla.edu>
9645
9646 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
9647 wants to redefine G_VIEW.
9648
2e72b98e
PE
96492005-01-27 Paul Eggert <eggert@cs.ucla.edu>
9650
9651 * src/vcg.c (get_view_str): Remove case for normal_view.
9652 Problem reported by twlevo@xs4all.nl.
9653
e0d634e5
PE
96542005-01-24 Paul Eggert <eggert@cs.ucla.edu>
9655
ccf830a4
PE
9656 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
9657 Problem reported by twlevo@xs4all.nl.
9658
e0d634e5
PE
9659 * doc/bison.texinfo: Change @dircategory from "GNU programming
9660 tools" to "Software development". Requested by Richard Stallman
9661 via Karl Berry.
9662
7bbc8cb0
PE
96632005-01-23 Paul Eggert <eggert@cs.ucla.edu>
9664
9665 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
9666 Problem reported by twlevo@xs4all.nl.
9667
08b770bc
PE
96682005-01-21 Paul Eggert <eggert@cs.ucla.edu>
9669
9670 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
9671 keyword; it's not needed with modern compilers, and it doesn't
9672 affect correctness with older compilers. Suggested by
9673 twlevo@xs4all.nl.
9674
95f22ad2
PE
96752005-01-17 Paul Eggert <eggert@cs.ucla.edu>
9676
9677 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
9678 gcc -Wswitch-default.
9679 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9680 * data/yacc.c (yyparse): Likewise.
9681
d229d15c
PE
96822005-01-12 Paul Eggert <eggert@cs.ucla.edu>
9683
9684 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
9685 already. Let config.h define any nonstandard values.
9686
ecadd90f
PE
96872005-01-10 Paul Eggert <eggert@cs.ucla.edu>
9688
9689 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
9690 for the benefit of slower hosts. Problem reported by
9691 Nelson H. F. Beebe.
9692
213744b5
PE
96932005-01-07 Paul Eggert <eggert@cs.ucla.edu>
9694
9695 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
9696 being defined and not used.
9697 * data/lalr1.cc (yyparse): Likewise.
9698 Use "if (false)" rather than "if (0)".
9699
249d3236
PE
97002005-01-05 Paul Eggert <eggert@cs.ucla.edu>
9701
9702 * TODO: Mention that we should allow NUL bytes in tokens.
9703
987cc1fb
PE
97042005-01-02 Paul Eggert <eggert@cs.ucla.edu>
9705
9706 * src/scan-skel.l (<<EOF>>): Don't close standard output.
9707 Problem reported by Hans Aberg.
9708
08fe02d9
PE
97092005-01-01 Paul Eggert <eggert@cs.ucla.edu>
9710
9711 * src/getargs.c (version): Happy new year; update overall
9712 program copyright date from 2004 to 2005.
9713
9714 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
9715 Problem reported by Hans Aberg.
9716 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
9717 (Output file names.): Add a test for the case when standard output
9718 is closed.
9719
010c0266
PE
97202004-12-26 Paul Eggert <eggert@cs.ucla.edu>
9721
9722 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
9723 to fix an oversight in the Bison 2.0 manual.
9724
da12206a
PE
97252004-12-25 Paul Eggert <eggert@cs.ucla.edu>
9726
9727 * NEWS: Version 2.0. Reformat the existing news items since
9728 1.875, so that related items are grouped together.
3a4734aa 9729 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
9730 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
9731
c935d934
PE
9732 * tests/torture.at (Exploding the Stack Size with Alloca): Set
9733 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
9734 otherwise, we're not testing alloca. Unfortunately there's no
9735 simple way to consult HAVE_ALLOCA here.
9736
da12206a
PE
9737 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
9738 for yymsg, too.
9739
9740 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
9741 hand. This avoids a warning about comparing int to size_t when
9742 GCC warnings are enabled.
9743
0a2c5137
PE
97442004-12-22 Paul Eggert <eggert@cs.ucla.edu>
9745
d7e14fc0
PE
9746 * NEWS: Bison-generated parsers no longer default to using the
9747 alloca function (when available) to extend the parser stack, due
9748 to widespread problems in unchecked stack-overflow detection.
9749 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
9750 responsibility to set it to a positive value. This lets the user
9751 specify a value that is not a preprocessor constant.
9752 * data/yacc.c (YYMAXDEPTH): Likewise.
9753 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
9754 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
9755 to be a compile-time constant. However, explain the constraints on it.
9756 Also, explain the constraints on YYINITDEPTH.
9757 (Table of Symbols): Explain that alloca is no longer the default.
9758 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
9759 to 1.
9760
0a2c5137
PE
9761 * doc/bison.texinfo (Location Default Action): Mention that n must
9762 be zero when k is zero. Suggested by Frank Heckenbach.
9763
e019c247
AD
97642004-12-22 Akim Demaille <akim@epita.fr>
9765
9766 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
9767 (parser::state_type, parser::semantic_type, parser::location_type):
9768 Private, not public.
9769 (parser::parse): Return ints, not bool.
9770 Returning a bool introduces a problem: 0 corresponds to false, and
9771 it seems weird to return false on success. Returning true changes
9772 the conventions for yyparse.
9773 Alternatively we could return void and send an exception.
9774 There is no clear consensus (yet?).
9775 (state_stack, semantic_stack, location_stack): Rename as...
9776 (state_stack_type, semantic_stack_type, location_stack_type): these.
9777 Private, not public.
9778 * tests/c++.at: New.
9779 * tests/testsuite.at, tests/Makefile.am: Adjust.
9780
72731bb7
AD
97812004-12-21 Akim Demaille <akim@epita.fr>
9782
9783 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
9784
9a0d8bec
AD
97852004-12-21 Akim Demaille <akim@epita.fr>
9786
9787 Don't impose std::string for filenames.
9788
9789 * data/lalr1.cc (b4_filename_type): New.
9790 (position::filename): Use it.
9791 (parser.hh): Move the inclusion of stack.hh and location.hh below
9792 the user code, so that needed headers for the filename type can be
9793 included first.
72731bb7
AD
9794 Forward declare them before the user code.
9795 * tests/Makefile.am (check-local, installcheck-local): Pass
9796 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 9797
99880de5
AD
97982004-12-20 Akim Demaille <akim@epita.fr>
9799
9800 Use more STL like names: my_class instead of MyClass.
9801
9802 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
9803 (SemanticStack, SemanticType, StateStack, StateType)
9804 (TokenNumberType, Stack, Slice, Traits, Parser::location)
9805 (Parser::value): Rename as...
9806 (location_stack, location_type, rhs_number_type, semantic_stack)
9807 (semantic_type, state_stack, state_type, token_number_type, stack)
9808 (slice, traits, parser::yylloc, parser::yylval): these.
9809
9810 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
9811
9bec482e
PE
98122004-12-19 Paul Eggert <eggert@cs.ucla.edu>
9813
9814 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
9815 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
9816
f6fbd3da
PE
98172004-12-17 Paul Eggert <eggert@cs.ucla.edu>
9818
9819 Remove uses of 'short int' and 'unsigned short int'. This raises
9820 some arbitrary limits. It uses more memory but nowadays that's
9821 not much of an issue.
9822
9823 This change does not affect the generated parsers; that's a different
9824 task, as some users will want to conserve memory there.
9825
9826 Ideally we should use size_t to represent all object counts, and
9827 something like ptrdiff_t to represent signed differences of object
9828 counts; but that will require more code-cleanup than I have the
9829 time to do right now.
9830
9831 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
9832 Use size_t, not int or short int, to count objects.
9833 * src/closure.c (nritemset, closure): Likewise.
9834 * src/closure.h (nritemset, closure): Likewise.
9835 * src/nullable.c (nullable_compute): Likewise.
9836 * src/print.c (print_core): Likewise.
9837 * src/print_graph.c (print_core): Likewise.
9838 * src/state.c (state_compare, state_hash): Likewise.
9839 * src/state.h (struct state): Likewise.
9840 * src/tables.c (default_goto, goto_actions): Likewise.
9841
9842 * src/gram.h (rule_number, rule): Use int, not short int.
9843 * src/output.c (prepare_rules): Likewise.
9844 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
9845 errs, reductions): Likewise.
9846 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
9847 Likewise.
9848 * src/tables.c (vector_number, tally, action_number,
9849 ACTION_NUMBER_MINIMUM): Likewise.
9850 * src/output.c (muscle_insert_short_int_table): Remove.
9851
efeed023
AD
98522004-12-17 Akim Demaille <akim@epita.fr>
9853
9854 * data/lalr1.cc: Extensive Doxygenation.
9855 (error_): Rename as...
9856 (error): this, since it is visible to the user.
9857 Adjust callers.
9858 (Parser::message): Now an automatic variable from...
9859 (Parser::yyreport_syntax_error_): here.
9860 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
9861 Parser::error.
9862 * tests/input.at: Escape $.
9863
bc82c5a5
PE
98642004-12-16 Paul Eggert <eggert@cs.ucla.edu>
9865
9866 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
9867 Parenthesize rhs to avoid obscure problems with mistakes like
9868 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
9869 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9870 b4_rhs_location): Likewise.
9871 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
9872 b4_rhs_location): Likewise.
9873
fd19f271
AD
98742004-12-16 Akim Demaille <akim@epita.fr>
9875
9876 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
9877 yacc.c: be sure to stay within yycheck_.
9878 * tests/actions.at: Re-enable C++ tests.
9879
10454ea4
AD
98802004-12-16 Akim Demaille <akim@epita.fr>
9881
9882 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
9883 real.
9884
c5b95ccf
AD
98852004-12-16 Akim Demaille <akim@epita.fr>
9886
9887 Use #define to handle the %name-prefix.
9888
9889 * data/glr.c, data/yacc.c: Comment changes.
9890 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
9891 so that one can refer to yylex in the parser file, and have it
9892 renamed, as is the case with other skeletons.
9893
617a8f12
AD
98942004-12-16 Akim Demaille <akim@epita.fr>
9895
9896 Move lalr1.cc internals into yy*.
9897
9898 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
9899 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
9900 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
9901 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
9902 (empty_, final_, terror_, errcode_, ntokens_)
9903 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
9904 (looka_, ilooka_, error_range_, nerrs_):
9905 Rename as...
9906 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
9907 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
9908 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
9909 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
9910 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
9911 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
9912 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
9913 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
9914 these.
9915
1e547e6e
PE
99162004-12-15 Paul Eggert <eggert@cs.ucla.edu>
9917
9918 Fix some problems reported by twlevo at xs4all.
9919 * src/symtab.c (symbol_new): Report an error if the input grammar
9920 contains too many symbols. This is better than calling abort() later.
9921 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
9922 (struct node, struct graph):
9923 Rename member expand to stretch. All uses changed.
9924 (struct graph): Remove member layoutalgorithm. All uses removed.
9925 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
9926 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
9927 All uses changed.
9928 (N_STRETCH): Rename from N_EXPAND. All uses changed.
9929
735d6bd4
AD
99302004-12-15 Akim Demaille <akim@epita.fr>
9931
9932 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
9933 Add more Doxygen comments.
9934 (symprint_, stack_print_, reduce_print_, destruct_, pop)
9935 (report_syntax_error_, translate_): Rename as...
9936 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
9937 (yypop_, yyreport_syntax_error_, yytranslate_): this.
9938
2e1f5829
AD
99392004-12-15 Akim Demaille <akim@epita.fr>
9940
9941 * data/lalr1.cc (lex_): Rename as...
9942 (yylex_): this.
9943 Move the trace here.
9944 Take the %name-prefix into account.
9945 Reported by Alexandre Duret-Lutz.
9946
a3cb6248
AD
99472004-12-15 Akim Demaille <akim@epita.fr>
9948
9949 Simplify the C++ parser constructor.
9950
9951 * data/lalr1.cc (debug_): Rename as...
9952 (yydebug_): so that the parser's internals are always in the yy*
9953 pseudo namespace.
9954 Adjust uses.
9955 (b4_parse_param_decl): Remove the leading comma as it is now only
9956 called as unique argument list.
9957 (Parser::Parser): Remove the constructor accepting a location and
9958 an initial debugging level.
9959 Remove from the other ctor the argument for the debugging level.
9960 (debug_level_type, debug_level, set_debug_level): New.
9961
9962 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
9963 constructor calls.
9964
07fed891
AD
99652004-12-15 Akim Demaille <akim@epita.fr>
9966
9967 Remove b4_root related material: failure experiment
a3cb6248 9968 (which goal was to allow to derive from a class).
07fed891
AD
9969
9970 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
9971 definitions and uses.
9972
e603eaa5
PE
99732004-12-14 Paul Eggert <eggert@cs.ucla.edu>
9974
9975 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
9976 not 2, since it's not portable to subtract 1 from the start of an
9977 array. The new item 0 is never set or used. All uses changed.
9978
9979 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
9980 the default definition of YYLLOC_DEFAULT. Problem reported
9981 by Frank Heckenbach.
9982
fafb007d
PE
99832004-12-12 Paul Eggert <eggert@cs.ucla.edu>
9984
9985 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
9986 the normal case and one for the error case. Just use the
9987 first one uniformly. Problem reported by Frank Heckenbach.
9988 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
9989 use exactly the same macro in both places.
9990 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
9991 so that the normal-case YYRHSLOC works for the error case too.
9992 All uses changed.
9993 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
9994 (YYLLOC_DEFAULT): Use the same macro as glr.c.
9995 * doc/bison.texinfo (Location Default Action): Don't claim that
9996 we have an array of locations. Use the same macro for both glr
9997 and lalr parsers. Mention YYRHSLOC. Mention what happens when
9998 the index is 0.
9999
48814dcd
PE
100002004-12-10 Paul Eggert <eggert@cs.ucla.edu>
10001
a4e1a53b
PE
10002 * HACKING: Update email addresses to send announcements to.
10003
48814dcd
PE
10004 * configure.ac (AC_INIT): Bump version to 1.875f.
10005
337116ba
PE
100062004-12-10 Paul Eggert <eggert@cs.ucla.edu>
10007
10008 * NEWS: Version 1.875e.
10009 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
10010
10011 * src/scan-skel.l: Include "complain.h", for "fatal".
10012
10013 * src/relation.h (relation_print, relation_digraph):
10014 Relation sizes are of type relation_node, not size_t (this is
10015 merely a doc fix, since the two types are equivalent).
10016 (relation_transpose): Relation sizes are of type relation_node,
10017 not int.
10018 * src/relation.c: Likewise.
10019 (top, infinity): Now of type relation_node, not int.
10020 (traverse, relation_transpose): Use relation_node, not int.
10021
10022 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
10023 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
10024 (yyparse): Remove unused local introduced in 2004-10-25 patch.
10025
10026 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 10027 specifying whether the test should be skipped. Use it tp
337116ba 10028 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 10029 fail on some hosts, and should be skipped.
337116ba 10030
da2a7671
PE
100312004-12-08 Paul Eggert <eggert@cs.ucla.edu>
10032
10033 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
10034 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
10035 unless otherwise specified below.
10036
10037 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
10038 to allocate kernel_base, kernel_items, kernel_size, since
10039 they needn't be initialized to 0.
10040 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
10041 * src/closure.c (new_closure): Likewise, for itemset.
10042 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
10043 * src/lalr.c (set_goto_map): Likewise, for temp_map.
10044 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
10045 (build_relations): Likewise for edge, states1, includes.
10046 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
10047 * src/reader.c (packgram): Likewise, for ritem, rules.
10048 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
10049 * src/relation.c (relation_digraph): Likewise for VERTICES.
10050 (relation_transpose): Likewise for new_R, end_R.
10051 * src/symtab.c (symbols_token_translations_init): Likewise for
10052 token_translations.
10053 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
10054 (token_actions): Likewise for yydefact, actrow, conflrow,
10055 conflict_list.
10056 (save_column): Likewise for froms[symno], tos[symno].
10057 (goto_actions): Likewise for state_count.
10058 (pack_table): Likewise for base, pos, check.
10059 (tables_generate): Likewise for width.
10060
10061 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
10062 for initial core. Just have a separate core, so we needn't worry
10063 about whether kernel_size and kernel_base are initialized.
10064
10065 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
10066 kernel_size, kernel_items): Remove unnecessary initialization.
10067 * src/conflicts.c (conflicts): Likewise.
10068 * src/derives.c (derives): Likewise.
10069 * src/muscle_tablc (muscle_insert): Likewise.
10070 * src/relation.c (relation_digraph): Likewise.
10071 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
10072 conflrow, conflict_table, conflict_list, table, check):
10073 Likewise.
10074
10075 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
10076 This is because all callers pass unsigned int.
10077 * src/closure.h (new_closure): Likewise.
10078
10079 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
10080 (build_relations): Initialize includes[i] in all cases.
10081 * src/reader.c (packgram): Always initialize rules[ruleno].prec
10082 and rules[ruleno].precsym. Initialize members in order.
10083 * src/relation.c (relation_transpose): Always initialize new_R[i]
10084 and end_R[i].
10085 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
10086
10087 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
10088 conflict_list[0] was always 0, but now it isn't initialized.
10089
10090 * src/table.c (table_grow): When conflict_table grew, the grown
10091 area wasn't cleared. Fix this.
10092
10093 * lib/.cvsignore: Add strdup.c, strdup.h.
10094 * m4/.cvsignore: Add strdup.m4.
10095
00baeeac
PE
100962004-12-07 Paul Eggert <eggert@cs.ucla.edu>
10097
10098 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
10099 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
10100 GOTO_NUMBER_MAXIMUM, since we occasionally compute
10101 ngotos + 1 without checking for overflow.
10102 (build_relations): Use END_NODE, not -1, to denote end of edges.
10103 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
10104 build_relations): Use goto_number, not int, for goto numbers.
10105 * src/tables.c (save_column, default_goto): Likewise.
10106
be3d9d42
AD
101072004-11-23 Akim Demaille <akim@epita.fr>
10108
10109 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
10110 of #defining from yystype.
10111 Don't typedef yystype, C++ does not need it.
10112 This lets it possible to forward declare it as union.
10113
78e526d5
PE
101142004-11-23 Paul Eggert <eggert@cs.ucla.edu>
10115
10116 * bootstrap (gnulib_modules): Add extensions.
10117 Problem reported by Jim Meyering.
10118
afbb696d
PE
101192004-11-22 Paul Eggert <eggert@cs.ucla.edu>
10120
10121 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
10122 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
10123 src/system.h, src/tables.c: XFREE -> free, to accommodate
10124 recent change to gnulib xalloc.h.
78e526d5 10125 Problem reported by Jim Meyering.
afbb696d 10126
c1f8f16a
AD
101272004-11-17 Akim Demaille <akim@epita.fr>
10128
10129 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
10130
db7e5eb5 101312004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
10132 Alexandre Duret-Lutz <adl@gnu.org>
10133
10134 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
10135 changes.
10136 (YYCDEBUG): Adjust.
10137 Use it instead of cdebug_.
10138 (Parser::debug_stream, Parser::set_debug_stream): New.
10139 (Parser::symprint_): Define cdebug_ for temporary backward
10140 compatibility.
10141 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
10142 debug_stream ().
10143
68e11668
AD
101442004-11-17 Akim Demaille <akim@epita.fr>
10145
10146 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
10147 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
10148 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
10149 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
10150
97cbc73e
PE
101512004-10-27 Paul Eggert <eggert@cs.ucla.edu>
10152
10153 * data/glr.c (yyloc_default): Remove; not used.
10154 Problem reported by Frank Heckenbach.
10155
e342c3be
AD
101562004-10-25 Akim Demaille <akim@epita.fr>
10157
10158 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
10159 Introduce another definition to address simple location arrays.
10160 (yyGLRStack): New member: yyerror_range.
10161 (yyrecoverSyntaxError, yyparse): Update it.
10162 (yyrecoverSyntaxError): Use it when shifting the error token to
10163 have an accurate range, equivalent to the one computed by both
10164 yacc.c and lalr1.cc.
10165 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
10166 that column numbers start at column 0, as per GNU Coding
10167 Standards, the others tests, and the doc.
10168 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
10169 Adjust to the above change (first column is 0).
10170 And adjust the location of the "<error>", now covering the whole
10171 line.
10172
93602feb 101732004-10-22 Akim Demaille <akim@epita.fr>
04098407 10174 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
10175
10176 Remove some arbitrary limits on goto numbers and relations.
10177 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
10178 initial values, since they're never used.
10179 (set_goto_map): ngotos is now unsigned, so test for overflow
10180 by seeing whether it wraps around to zero.
10181 * src/lalr.h (goto_number): Now size_t, not short int.
10182 (GOTO_NUMBER_MAXIMUM): Remove.
10183 * src/relation.c (relation_print, traverse, relation_transpose):
10184 Check for END_NODE rather than looking at sign.
10185 * src/relation.h (END_NODE): New macro.
10186 (relation_node): Now size_t, not short int.
10187
dba08b04
PE
101882004-10-22 Paul Eggert <eggert@cs.ucla.edu>
10189
10190 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
10191 keyword, not an identifier. Problem reported by Baron Schwartz in
10192 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
10193
df09ef2e
AD
101942004-10-11 Akim Demaille <akim@epita.fr>
10195
10196 * src/symtab.c (symbol_check_alias_consistency): Also check
10197 type names, destructors, and printers.
10198 Reported by Alexandre Duret-Lutz.
10199 Recode the handling of associativity and precedence in terms
10200 of symbol_precedence_set.
10201 Accept no redeclaration at all, not even equal to the previous
10202 value.
10203 (redeclaration): New.
10204 Use it to factor redeclaration complaints.
10205 (symbol_make_alias): Don't set the type of the alias, let
10206 symbol_check_alias_consistency do it as for other features.
10207 * src/symtab.h (symbol): Add new member prec_location, and
10208 type_location.
10209 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
10210 * tests/input.at (Incompatible Aliases): New.
10211
146bc99d
PE
102122004-10-09 Paul Eggert <eggert@cs.ucla.edu>
10213
10214 .cvsignore fixes to accommodate gnulib changes,
10215 and the practice of naming build directories "_build".
10216 * .cvsignore: Add "_*". Sort.
10217 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
10218 * m4/.cvsignore: Add "*_gl.m4".
10219
e503aa60
AD
102202004-10-06 Akim Demaille <akim@epita.fr>
10221
10222 * src/parse-gram.y (add_param): Fix the truncation of trailing
10223 spaces.
10224
b4a20338
AD
102252004-10-05 Akim Demaille <akim@epita.fr>
10226
10227 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
10228 whether the reducion was empty or not. This leaves room to
10229 improve the use of YYLLOC_DEFAULT in such a case.
10230 lalr1.cc is still experimental, so changing this is acceptable.
10231 And finally, there are probably not many users who changed the
10232 handling of locations in GLR, so changing is admissible too.
10233
10234 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
10235 empty reduction, set @$ to an empty location ending the previously
10236 stacked symbol.
10237 Adjust uses to make sure the code is triggered on empty
10238 reductions.
10239 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
10240 expected output: empty reductions have empty locations.
10241
f85a5e6f
AD
102422004-09-29 Akim Demaille <akim@epita.fr>
10243
10244 * data/lalr1.cc: Move towards a more standard C++ coding style
10245 for templates: Class < T > -> Class<T>.
10246
b203fc2c
AD
102472004-09-29 Akim Demaille <akim@epita.fr>
10248
10249 * data/lalr1.cc: Reinstall the former ctor, for sake of
10250 compatibility, but warn it will be removed.
10251 Move towards a more standard C++ coding style (i.e., type *var ->
10252 type* var).
10253
5b7e1e73
PE
102542004-09-27 Paul Eggert <eggert@cs.ucla.edu>
10255
3fee967f
PE
10256 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
10257 since it's less likely to work if NULs are involved in the future.
5b7e1e73 10258
0dcca5c2
AD
102592004-09-27 Akim Demaille <akim@epita.fr>
10260
10261 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
10262
6dde1c82
AD
102632004-09-27 Akim Demaille <akim@epita.fr>
10264
10265 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 10266 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
10267 and argument names.
10268 (b4_cc_constructor_call): Likewise.
10269
b233d555
AD
102702004-09-24 Akim Demaille <akim@epita.fr>
10271
10272 * src/parse-gram.y (add_param): Strip the leading and trailing
10273 blanks from a formal argument declaration.
10274 (YY_LOCATION_PRINT): New.
10275
619404e3
AD
102762004-09-24 Akim Demaille <akim@epita.fr>
10277
10278 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
10279 after the location.
10280
dd8d9022
AD
102812004-09-24 Akim Demaille <akim@epita.fr>
10282
10283 * doc/bison.texinfo (Table of Symbols): Sort.
10284
0092f063
AD
102852004-09-21 Akim Demaille <akim@epita.fr>
10286
10287 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
10288 the useless parentheses.
10289 Suggested by Paul Eggert.
10290
451364ed
AD
102912004-09-20 Akim Demaille <akim@epita.fr>
10292
10293 Let the initial-action act on the look-ahead, and use it for the
10294 "initial push" (corresponding to an hypothetical beginning-of-file).
10295 And let lalr1.cc honor %initial-action.
10296
10297 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
10298 example.
10299 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
10300 (Parser::Parser): Remove the ctor that used to initialize it.
10301 (Parser::parse): Like in the other skeletons, issue the "starting
10302 parse" message before any action.
10303 Honor %initial-action.
10304 Initialize the stacks with the lookahead.
10305 * data/yacc.c: Let $$ and @$ in %initial-action designate the
10306 look-ahead.
10307 Push them in the stacks.
10308 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
10309
18d192f0
AD
103102004-09-20 Akim Demaille <akim@epita.fr>
10311
10312 * doc/bison.texinfo (Initial Action Decl): New.
10313
b8458aa5
AD
103142004-09-20 Akim Demaille <akim@epita.fr>
10315
10316 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
10317 clearer criterion to define it.
10318 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
10319 When reducing on an empty RHS, use the latest stacked location as
10320 location.
10321 yylloc is not always available.
10322 * data/glr.c: Likewise.
10323 Also, honor initial-actions.
10324
3fc16193
AD
103252004-09-20 Akim Demaille <akim@epita.fr>
10326
10327 * data/yacc.c (YY_LOCATION_PRINT): New.
10328 Define when we know YYLTYPE's structure, i.e., when the default
10329 YYLLOC_DEFAULT is used.
10330 * data/c.m4 (b4_yysymprint_generate): Use it.
10331 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
10332 value of the result.
10333 (error_start_): Replace with...
10334 (error_range_): this location array.
10335 This allows to replace code relying on the implementation of
10336 locations by portable code.
10337 * data/yacc.c (yylerrsp): Replace with...
10338 (yyerror_range): this.
10339 Every time a token is popped, update yyerror_range[0], to have an
10340 accurate location for the error token.
10341 * data/glr.c (YY_LOCATION_PRINT): New.
10342 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
10343 deference a pointer.
10344 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
10345 report the location in %printers.
10346
10347 * src/scan-skel.l: Instead of abort, report error messages to ease
10348 understanding skeleton scanning failures.
10349
ecfe33e7
AD
103502004-09-16 Akim Demaille <akim@epita.fr>
10351
10352 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
10353 (iterator, const_iterator): these, to be more in the C++ spirit.
10354 Also, return reverse iterators so that when displaying the stack
10355 we display its bottom first.
10356 (Parser::stack_print_, Parser::reduce_print_): Match the messages
10357 from yacc.c.
10358 We should probably use vector here though.
10359
1576d44d
AD
103602004-09-16 Akim Demaille <akim@epita.fr>
10361
10362 Have more complete shift traces.
10363
10364 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
10365 to report Shifts instead of ad hoc YYDPRINTF invocations,
10366 including for the error token.
10367 * data/lalr1.cc (symprint_): Output the location.
10368 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
10369 output the location within the %printer.
10370 Activate GLR tests, at least to make sure they compile properly.
10371 They still don't pass though.
10372 * tests/calc.at: Adjust expect verbose output, since now "Entering
10373 state..." is on a different line than the "Shifting" message.
10374
9c66f418
AD
103752004-09-08 Akim Demaille <akim@epita.fr>
10376
10377 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
10378 Bison directive from the Bison file to the invocation of this
10379 macro, so that these directives are passed to
10380 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
10381 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
10382 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
10383 the extra Bison directives instead of the whole series.
10384 Change the grammar so that there are recoverable errors, and
10385 unrecoverable errors. Now we can have the parser give up before
10386 consuming the whole input. As a result we now can observe that
10387 the lookahead is freed when needed.
10388 Change the parser source to parse argv[1] instead of a hard coded
10389 string.
10390 Simplify yylex, and give a value and location to EOF.
10391 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
10392 passed directives already coded in the file.
10393 Add some tests to check the location of "error".
10394 For some tests, the C++ parser is correct, and not yacc.c.
10395 For other tests, they provide different, but unsatisfying, values,
10396 so keep the C++ value so that at least one parser is "correct"
10397 according to the test suite.
10398 (Actions after errors): Remove, this is subsumed by the
10399 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
10400
52d5733f
AD
104012004-09-06 Akim Demaille <akim@epita.fr>
10402
10403 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 10404 (Parser::pop): New.
52d5733f
AD
10405 Use it.
10406
a0e68930
AD
104072004-09-06 Akim Demaille <akim@epita.fr>
10408
10409 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
10410 argument, an informative message.
10411 Call YY_SYMBOL_PRINT.
10412 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
10413 * data/lalr1.cc (destruct_): Likewise.
10414 In addition, no longer depend on b4_yysymprint_generate and
10415 b4_yydestruct_generate to generate these functions, do it "by
10416 hand".
10417
e757bb10
AD
104182004-09-03 Akim Demaille <akim@epita.fr>
10419
10420 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
10421 invoked, yydestruct the lookahead.
10422 * tests/calc.at (Calculator $1): Update the expected lengths of
10423 traces: there is an added line for the discarded lookahead.
10424 * doc/bison.texinfo (Destructor Decl): Some rewording.
10425 Define "discarded" symbols.
10426
0fe1f06d
AD
104272004-09-02 Akim Demaille <akim@epita.fr>
10428
10429 * data/lalr1.cc (translate_, destruct_): No reason to be static.
10430
284acc8b
AD
104312004-09-02 Akim Demaille <akim@epita.fr>
10432
10433 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
10434 (YYDSYMPRINTF): Rename as...
10435 (YY_SYMBOL_PRINT): this.
10436 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
10437 two.
10438 Use it instead of direct symprint_ calls.
10439 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
10440 one.
10441
a5eb1ed2
AD
104422004-09-02 Akim Demaille <akim@epita.fr>
10443
b7c72fe1
AD
10444 * data/lalr1.cc (b4_yysymprint_generate): New.
10445 (symprint_): New member function, defined when YYDEBUG.
10446 Use it consistently instead of token/nterm debugging output by
10447 hand.
a5eb1ed2
AD
10448 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
10449 %printer calls to use cdebug_ when using lalr1.cc.
10450
417141dd
AD
104512004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
10452
10453 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
10454 with #ifdef YYDEBUG.
10455
2fa09258
AD
104562004-08-26 Akim Demaille <akim@epita.fr>
10457
10458 * doc/bison.texinfo (Implementing Loops): Rename as...
10459 (Implementing Gotos/Loops): this.
10460
9378b508
PE
104612004-08-13 Paul Eggert <eggert@cs.ucla.edu>
10462
10463 Adjust to latest gnulib.
10464 * bootstrap (gnulib_modules): Add xalloc-die.
10465 Set LC_ALL=C so that file names sort consistently.
10466 Prefer the gnulib copies of gettext.m4, glibc21.m4,
10467 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
10468 uintmax_t.m4, ulonglong.m4.
10469 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
10470 po.m4 since we are now using _gl.m4 instead.
10471
87a8ad5c
PE
104722004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
10473
10474 * src/scan-action.l: Remove. Scanning of semantic actions is
10475 handled in scan-gram.l.
10476
dca81a78
PE
104772004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
10478
10479 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
10480
10481 * src/location.h (struct): The file member is a uniqstr.
10482 (equal_boundaries): Use UNIQSTR_EQ for comparison.
10483
c9cbf7c5
PE
104842004-07-22 Paul Eggert <eggert@cs.ucla.edu>
10485
10486 Fix bug with non-%union parsers that have printers or destructors,
10487 which led to a Bison core dump. Reported by Peter Fales in
10488 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 10489
c9cbf7c5
PE
10490 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
10491 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
10492 not to our own type.
10493 * src/output.c (symbol_destructors_output, symbol_printers_output):
10494 Don't assume %union.
10495 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
10496 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
10497 UNION-FLAG. All callers changed.
10498 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
10499 Use type char, not unsigned int, when declaring an array of char;
10500 this lets us remove a cast.
10501 (Printers and Destructors): Add non-%union test cases.
10502
fa7e68c3
PE
105032004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10504
10505 * doc/bison.texinfo: Minor editorial changes, mostly to the new
10506 GLR writeups. E.g., avoid frenchspacing and the future tense,
10507 change "lookahead" to "look-ahead", and change "wrt" to "with
10508 respect to".
2fa09258 10509
fa7e68c3
PE
105102004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10511
10512 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
10513 New sections, split off from the GLR Parsers section. Put the new
10514 Simple GLR Parser near the start of the GLR section, for clarity.
10515 Rewrite connective text.
10516
99a9344e
PE
105172004-06-21 Frank Heckenbach <frank@g-n-u.de>
10518
10519 * doc/bison.texinfo (Simple GLR Parsers): New section.
10520
8dd162d3
PE
105212004-06-21 Paul Eggert <eggert@cs.ucla.edu>
10522
10523 * NEWS, TODO, doc/bison.texinfo:
10524 Use "look-ahead" instead of "lookahead", to be consistent.
10525 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
10526 while we're fixing "look-ahead".
10527 * src/conflicts.c (shift_set): Renamed from shiftset.
10528 (look_ahead_set): Renamed from lookaheadset.
10529 * src/print.c: Likewise.
10530 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
10531 name for "lookahead".
10532 (report_types, usage): Likewise.
10533 * src/getargs.h (report_look_ahead_tokens): Renamed from
10534 report_lookaheads.
10535 * src/lalr.c (compute_look_ahead_tokens): Renamed from
10536 compute_lookaheads.
10537 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
10538 (look_ahead_tokens_print): Renamed from lookaheads_print.
10539 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
10540 state_rule_lookaheads_print.
10541 * src/state.h: Likewise.
10542 (reductions.look_ahead_tokens): Renamed from lookaheads.
10543 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
10544 AT_DATA_LOOKAHEADS_GRAMMAR.
10545
57a90331
PE
105462004-06-03 Paul Eggert <eggert@cs.ucla.edu>
10547
10548 * README: Update location of patched M4 distribution.
10549
8ed3234a
PE
105502004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
10551
10552 Don't assume the C++ compiler takes the same arguments as the C compiler
10553 (trivial change).
10554 * configure.ac (O0CXXFLAGS): New var.
10555 * tests/atlocal.in (CXXFLAGS): Use it.
10556
07971983
PE
105572004-05-29 Paul Eggert <eggert@cs.ucla.edu>
10558
10559 Fix some "make check" problems with C++ reported by
10560 Albert Chin-A-Young for Tru64 C++ in this thread:
10561 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
10562
10563 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
10564 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10565 Output to a .cc file for C++, not to a .c file.
10566 * tests/calc.at (AT_CHECK_CALC): Likewise.
10567 * tests/regression.at (AT_CHECK_DANCER): Likewise.
10568 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
10569
29058652
PE
105702004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
10571
10572 * tests/calc.at, tests/actions.at: Workaround for SGI
10573 C++ compiler. (trivial change)
10574
62cb8a99
PE
105752004-05-27 Paul Eggert <eggert@cs.ucla.edu>
10576
fd418816
PE
10577 Spent a few hours checking out which prerequisite versions the
10578 current sources actually require. I went all the way back to
10579 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
10580 a seemingly endless set of combinations of versions more recent
10581 than that. The bottom line is that the current sources require
10582 fairly recent versions of the build tools, and it'll be some work
10583 to change this.
10584 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
10585 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
10586 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
10587 Add comments explaining why those particular versions are
10588 currently needed.
2fa09258 10589
62cb8a99
PE
10590 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
10591 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 10592 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
10593
10594 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
10595 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
10596
caa52c10
PE
105972004-05-26 Paul Eggert <eggert@cs.ucla.edu>
10598
10599 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
10600 0.11.5. Suggested by Bruno Haible.
10601 * bootstrap: Remove gettext version checking.
10602
10603 * doc/bison.texinfo (Decl Summary): Also mention that %union
10604 can depend on prerequisite types. Problem reported by Tim
10605 Van Holder.
10606
4bfd5e4e
PE
106072004-05-25 Paul Eggert <eggert@cs.ucla.edu>
10608
2cef3017
PE
10609 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
10610 * README-alpha: Don't tell people not to package this.
10611
b9c85d5c
PE
10612 * bootstrap: Don't assume $(...) works; use `...` instead.
10613 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
10614 gettext better.
10615
4bfd5e4e
PE
10616 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
10617 put into the -d output file, and mention what to do if YYSTYPE is
10618 defined as a macro.
10619
6a36ff94
PE
106202004-05-24 Paul Eggert <eggert@cs.ucla.edu>
10621
6712933e
PE
10622 Undo change made earlier today: it caused autopoint to not bring
10623 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
10624 autopoint's.
10625
10626 * bootstrap: Check that gettext version matches what's in
10627 configure.ac. Warn users to ignore robots.txt ERROR 404.
10628 * bootstrap: Undo today's earlier change (logged below).
10629 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 10630
6a36ff94
PE
10631 The gettext version checking is causing more trouble than it's
10632 curing; remove it. Problem reported by Paul Hilfinger.
10633
10634 * bootstrap: Issue a warning that one can expect a message
10635 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
10636 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
10637
209ea708
PE
106382004-05-23 Paul Eggert <eggert@cs.ucla.edu>
10639
10640 Ensure that the C++ compiler used for testing actually works on a
10641 simple test program; if not, skip the C++-related tests. Problem
10642 reported by Vin Shelton in:
161a71f3 10643 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
10644
10645 * m4/cxx.m4: New file.
10646 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
10647 * tests/atlocal.in (BISON_CXX_WORKS): Add.
10648 * tests/local.at (AT_COMPILE_CXX): Use it.
10649
41ca2549
PE
106502004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10651
383e69dc
PE
10652 * data/glr.c (yylloc): Output this macro even if locations are not
10653 being generated, as the GLR parser needs it even in that case.
10654 Problem reported by Troy A. Johnson
10655 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
10656
41ca2549
PE
10657 * configure.ac (AC_INIT): Update to 1.875e.
10658
e476c87d
PE
106592004-05-21 Paul Eggert <eggert@cs.ucla.edu>
10660
10661 * NEWS: Version 1.875d.
10662 * configure.ac (AC_INIT): Likewise.
10663 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
10664
10665 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
10666 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
10667 lalr1.cc runs afoul of the first, and the last two are no longer
10668 supported by GCC 3.4.0.
10669 * README: Mention GNU m4 1.4 or later; mention m4 patches.
10670 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
10671
233a88ad
PE
106722004-05-06 Paul Eggert <eggert@cs.ucla.edu>
10673
10674 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
10675 unsigned int, for compatibility with latest gnulib hash module.
10676 * src/state.c (state_hash, state_hasher): Likewise.
10677 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
10678 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 10679
12ffdd28
PE
106802004-05-03 Paul Eggert <eggert@cs.ucla.edu>
10681
10682 * NEWS: Unescaped newlines are no longer allowed in char & strings.
10683
10684 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
10685 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
10686 character and string literals.
10687 (unexpected_end): New function.
10688 (unexpected_eof): Use it.
10689 (unexpected_newline): New function.
10690 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
10691 actions.
e476c87d 10692
12ffdd28
PE
10693 * NEWS: Document %expect-rr.
10694
10695 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
10696 Fix typo by replacing $1 with $option.
10697 Remove more 'intl'-related files.
9668e2be 10698 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
10699
10700 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
10701 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
10702 strtoul.c.
10703 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
10704 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
10705 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
10706 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
10707 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
10708 * src/.cvsignore: Add *.output.
10709
10710 * src/parse-gram.y: Put copyright notice inside %{ %} so it
10711 gets copied to the output file.
e476c87d 10712
1f65350a
PE
107132004-04-28 Paul Eggert <eggert@twinsun.com>
10714
10715 Get files from the gnulib and po repositories, instead of relying
10716 on them being in our CVS. Upgrade to latest versions of gnulib
10717 and Automake.
10718
10719 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
10720 * bootstrap: Bootstrap from gnulib and po repositories.
10721 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
10722 * README-cvs: Document these changes. Remove version numbers from
10723 mentions of build tools, since they change so often. Mention Flex.
10724
10725 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
10726 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
10727 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
10728 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 10729 does this for us.
12ffdd28
PE
10730 (AC_ISC_POSIX): Remove; we no longer support this
10731 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
10732 (AC_HEADER_STDC): Remove: we now assume C89 or better.
10733 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
10734 Do not check for C89 headers, except for locale.h which is used
10735 by the Yacc library and must port to K&R hosts.
10736 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
10737 Do not check for C89 functions, except for setlocale which is
10738 used by the Yacc library.
10739 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
10740 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
10741 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
10742 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
10743 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
10744 AM_GNU_GETTEXT): Remove; now done by:
10745 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
10746 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
10747 for us.
10748
10749 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
10750 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
10751 Define to empty, as gnulib.mk will do the rest for us.
10752 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
10753 for us.
10754 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
10755 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
10756
10757 * src/files.c: Include gnulib's xstrndup.h.
10758
10759 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
10760 (REALLOC): Use xnrealloc, for likewise.
10761 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
10762 (strnlen, memrchr): Remove decls; functions no longer used.
10763 Include <stpcpy.h>.
10764
10765 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
10766 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10767 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
10768 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
10769 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
10770 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
10771 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
10772 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
10773 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
10774 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
10775 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
10776 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
10777 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
10778 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
10779 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
10780 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
10781 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
10782 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
10783 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
10784 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
10785 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
10786 Remove, as these files are now generated automatically
10787 by bootstrap or automake.
10788
10789 * po/ChangeLog: Remove: all but one entry was a duplicate
10790 of this file, and I moved that 2000-11-02 entry here.
10791
10792 * config/.cvsignore: Add Makefile, depcomp, install-sh.
10793 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
10794 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
10795 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
10796 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
10797 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
10798 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
10799 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
10800 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
10801 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
10802 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
10803 xstrndup.h.
10804 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
10805 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
10806 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
10807 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
10808 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
10809 * src/.cvsignore: Remove *_.c.
10810
10811
10812 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
10813 support it. (The latest stable gzip doesn't.)
10814
108152004-04-27 Paul Eggert <eggert@twinsun.com>
10816
10817 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
10818 case, as stos_ is now used by destructors due to the 2004-02-09
10819 change.
10820
10821 Remove more K&R C support.
10822 * lib/libiberty.y (PARAMS): Remove. All uses removed.
10823 * lib/subpipe.c (errno): Remove decl.
10824 Include <stdlib.h> unconditionally.
10825 (EXIT_FAILURE): Remove macro.
10826 * src/complain.c (vfprintf, strerror): Remove.
10827 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
10828 unconditionally.
10829 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
10830 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
10831 (strchr, strspn, memchr): Remove decls.
10832 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
10833 unconditionally. Do not declare perror.
10834 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
10835 unconditionally.
10836
10837 * src/complain.c (_): Remove useless defn, as system.h defines this.
10838
10839 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
10840 with latest obstack.h.
10841 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
10842 to procedure types, as obstack.h now does that for us.
10843 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
10844
10845 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
10846 so that this include file can stand alone.
10847 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
10848 does this now. Include subpipe.h first after config.h, to
10849 test whether it can stand alone.
10850
10851 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
10852 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
10853 unused declaration.
10854
10855 * tests/synclines.at (%union synch line): Put a dummy member in
10856 the union, because empty unions aren't allowed in C. Caught
10857 by GCC 3.4.0.
10858
4f16766c
PE
108592004-04-13 Jim Meyering <jim@meyering.net>
10860
10861 * src/conflicts.c (conflicts_print): Correct format string typo:
10862 use `%%' to produce literal `%'. (trivial change)
10863
779e7ceb
PE
108642004-03-30 Paul Eggert <eggert@twinsun.com>
10865
10866 * src/getargs.c (version): Update copyright year to 2004.
10867
10868 * data/c.m4 (b4_int_type): Use 'short int' rather than
10869 'short', and similarly for 'long', 'unsigned', etc.
10870 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
10871 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
10872 yy_yypstack, yydumpstack): Likewise.
10873 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
10874 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
10875 Likewise.
10876 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
10877 yy_stack_print, yyparse): Likewise.
10878 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
10879 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
10880 * lib/bitset.c (bitset_print): Likewise.
10881 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
10882 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10883 * lib/bitsetv.c (bitsetv_dump): Likewise.
10884 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
10885 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
10886 Likewise.
10887 * src/LR0.c (allocate_itemsets): Likewise.
10888 * src/gram.h (rule_number, rule): Likewise.
10889 * src/lalr.h (goto_number): Likewise.
10890 * src/nullable.c (nullable_compute): Likewise.
10891 * src/output.c (prepare_rules): Likewise.
10892 * src/relation.c (relation_print, relation_digraph): Likewise.
10893 * src/relation.h (relation_node): Likewise.
10894 * src/state.h (state_number, transitions, errs, reductions,
10895 struct state): Likewise.
10896 * src/symtab.h (symbol_number, struct symbol): Likewise.
10897 * src/tables.c (vector_number, tally, action_number,
10898 default_goto, goto_actions): Likewise.
10899 * tests/existing.at (GNU Cim Grammar): Likewise.
10900 * tests/regression.at (Web2c Actions): Likewise.
10901
10902 * src/output.c (muscle_insert_short_int_table): Renamed from
10903 muscle_insert_short_table. All uses changed.
10904
d6328241
PH
109052004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10906
10907 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
10908 (declaration): Replace expected_conflicts with expected_sr_conflicts.
10909 Add %expect-rr rule.
4f16766c 10910
d6328241
PH
10911 * src/scan-gram.l: Recognize %expect-rr.
10912
4f16766c 10913 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 10914 expected_conflicts.
4f16766c 10915 (expected_rr_conflicts): Declare.
d6328241
PH
10916
10917 * src/conflicts.c (expected_sr_conflicts): Rename from
10918 expected_conflicts.
10919 (expected_rr_conflicts): Define.
10920 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
10921 for GLR parsers.
10922 Use expected_sr_conflicts in place of expected_conflicts.
10923 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 10924
d6328241 10925 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 10926
1452af69
PE
109272004-03-08 Paul Eggert <eggert@gnu.org>
10928
10929 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 10930 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
10931
10932 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
10933 in lalr1.cc.
10934 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
10935 * src/scan-gram.l (scan_integer): New function.
10936 ({int}): Use it.
10937 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
10938 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
10939 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
10940 Say "long int", not "long", for uniformity with GNU style.
10941
006d217d
PE
109422004-02-25 Paul Eggert <eggert@twinsun.com>
10943
10944 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
10945 compilers. This fixes a problem with Intel's C++ compiler being
10946 chatty, reported by Guido Trentalancia in
161a71f3 10947 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 10948
c2729758
ADL
109492004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
10950
10951 Support %destructor and merge error locations in lalr1.cc.
10952
10953 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
10954 (Parser::stos_): Define unconditionally.
10955 (Parser::destruct_): New method. Generate its body with
10956 b4_yydestruct_generate.
10957 (Parser::error_start_): New attribute.
10958 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
10959 token which are discarded.
10960 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
10961 error_start_ when erroneous token are discarded.
10962 (Parser::parse) <yyerrlab1>: Compute the location of the error
10963 token so that it covers all the discarded tokens.
10964 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
10965 it can be called with `%skeleton "lalr1.cc"', and do that.
10966
dd0e0635
PE
109672004-02-02 Paul Eggert <eggert@twinsun.com>
10968
10969 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
10970 $(top_srcdir)/lib and ../lib. This fixes a bug reported
10971 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
10972 There's no need to mention top_builddir since Automake does that
10973 for us.
10974 (INCLUDES): Remove, as Automake says it's obsolescent.
10975 Contents migrated into AM_CPPFLAGS as described above.
10976 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
10977
109782004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10979
10980 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
10981 (yyreportSyntaxError): Handle case where lookahead token is
10982 YYEMPTY.
10983
be16239b
PH
109842004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10985
10986 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
10987 resulting parsers are compilable with C++.
10988
5fa90832
PE
109892003-12-23 Paul Eggert <eggert@twinsun.com>
10990
10991 * config/depcomp, config/install-sh: Sync with Automake 1.8.
10992 * src/output.c (output_skeleton): Rename local var.
10993 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
10994 Bison tokens, as this runs afoul of the 2003-10-07 change that
10995 disallowed NUL bytes in character constants or string literals.
10996
10997 * tests/local.at: Require Autoconf 2.59's Autotest.
10998 * tests/testsuite.at: Don't include local.at, since we now assume
10999 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
11000 including it.
11001 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
11002 multiple inclusion warnings.
dd0e0635 11003
b165c324
AD
110042003-12-02 Akim Demaille <akim@epita.fr>
11005
11006 * doc/bison.texinfo (How Can I Reset the Parser): More about start
11007 conditions.
11008 From Bruno Haible.
11009
26e06a21
ADL
110102003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
11011
11012 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
11013
92ac3705
PE
110142003-10-07 Paul Eggert <eggert@twinsun.com>
11015
6a5ecb38
PE
11016 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
11017 if testsuite doesn't exist.
11018
92ac3705
PE
11019 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
11020 literals, unfortunately.
11021 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
11022 Complain about NUL bytes in character constants or string literals.
11023
91d2c560
PE
110242003-10-05 Paul Eggert <eggert@twinsun.com>
11025
11026 * NEWS: Don't document %no-default-prec, as it's still
11027 too experimental.
11028 * doc/bison.texinfo: Document %no-default-prec only if
11029 the defaultprec flag is set. Normally it's not.
11030
0cc3da3a
PE
110312003-10-04 Paul Eggert <eggert@twinsun.com>
11032
11033 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
11034 non-modifiable lvalue, instead of a modifiable one.
11035 * doc/bison.texinfo (Actions): Document that $$ can
11036 be assigned to. Do not claim that $$ and $N are
11037 array element references: user code should not rely on this.
11038
22fccf95
PE
110392003-10-01 Paul Eggert <eggert@twinsun.com>
11040
11041 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
11042 (grammar_declaration): Use it.
11043 * src/scan-gram.l: New token %no-default-prec.
11044 * tests/conflicts.at: Revamp tests to use %no-default-prec.
11045 * NEWS, doc/bison.texinfo: Document the above.
11046
fc8f2965
AD
110472003-10-01 Akim Demaille <akim@epita.fr>
11048
11049 VCG no longer supports long_straight_phase.
11050
11051 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
11052 * src/print_graph.c (print_graph): Adjust.
11053
39a06c25
PE
110542003-09-30 Frank Heckenbach <frank@g-n-u.de>
11055 and Paul Eggert <eggert@twinsun.com>
11056
11057 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
11058 Table of Symbols): Document %default-prec.
11059 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
11060 (grammar_declaration): Set default_prec on %default-prec.
11061 * src/scan-gram.l (%default-prec): New token.
11062 * src/reader.h (default_prec): New flag.
11063 * src/reader.c: Likewise.
11064 (packgram): Handle it.
11065 * tests/conflicts.at (%default-prec without %prec,
11066 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 11067
39a06c25
PE
110682003-09-30 Paul Eggert <eggert@twinsun.com>
11069
11070 * tests/testsuite.at: Include local.at, not input.at, fixing
11071 a typo in the 2003-08-25 patch.
11072
62b6aef9
AD
110732003-08-27 Akim Demaille <akim@epita.fr>
11074
11075 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
11076 GCC warnings.
11077
89e1cc61
AD
110782003-08-26 Akim Demaille <akim@epita.fr>
11079
11080 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
11081 "<\#" to avoid magic from Gnus when posting parts of this script.
11082
a08460b0
AD
110832003-08-26 Akim Demaille <akim@epita.fr>
11084
11085 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
11086 (Parser::parse): here.
11087 Adjust: nerrs and errstatus is now replaced by...
11088 (Parser::nerrs_, Parser::errstatus_): New.
11089
603f1cfd
AD
110902003-08-25 Akim Demaille <akim@epita.fr>
11091
11092 * config/announce-gen, Makefile.cfg: New.
11093 * Makefile.am: Adjust.
11094 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
11095 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
11096
cd3684cf
AD
110972003-08-25 Akim Demaille <akim@epita.fr>
11098
11099 When reducing initial empty rules, Bison parser read an initial
11100 location that is not defined. This results in garbage, and that
11101 affects Bison's own parser. Therefore we need (i) to extend Bison
11102 to support a means to initialize this location, and (ii) to use
11103 this CVS Bison to fix CVS Bison's parser.
11104
11105 * src/reader.h, reader.c (epilogue_augment): Remove, replace
11106 with...
11107 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
11108 * src/parse-gram.y: Adjust.
11109 (%initial-action): New.
11110 (%error-verbose): Since we require CVS Bison, there is no reason
11111 not to use it.
11112 * src/scan-gram.l: Adjust.
11113 * src/Makefile.am (YACC): New, to make sure we use our own parser.
11114 * data/yacc.c (yyparse): Use b4_initial_action.
11115
4e03e201
AD
111162003-08-25 Akim Demaille <akim@epita.fr>
11117
11118 * doc/bison.texinfo: Don't promote stdout for error messages.
11119
8c182d05
AD
111202003-08-25 Akim Demaille <akim@epita.fr>
11121
11122 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
11123 From Alexandre Duret-Lutz.
11124
6a60c4cf
PE
111252003-08-25 Akim Demaille <akim@epita.fr>
11126
11127 Version 1.875c.
11128
25f66e1a
AD
111292003-08-25 Akim Demaille <akim@epita.fr>
11130
11131 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
11132 Use them.
11133
5348bfbe
AD
111342003-08-25 Akim Demaille <akim@epita.fr>
11135
11136 * data/lalr1.cc (Parser::reduce_print_): New.
11137 Use it.
11138
47301314
AD
111392003-08-25 Akim Demaille <akim@epita.fr>
11140
11141 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
11142 error recovery loops. This patch is based on
161a71f3 11143 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
11144 Also, augment the similarity between lalr1.cc and yacc.c.
11145 Note: the locations of error recovery rules are not correct yet.
11146
11147 * data/lalr1.cc: Comment changes to augment the similarity between
11148 lalr1.cc and yacc.c.
11149 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
11150 (yyerrlab1): Remove, but where it used to be (now the bottom part of
11151 yyerrlab), when hitting EOF, pop the whole stack here instead of
11152 merely falling thru the default error handling mechanism.
11153 (yyerrorlab): New label, with the old contents of YYERROR,
11154 plus the following change: pop the stack of rhs corresponding
11155 to the production that invoked YYERROR. That is how Yacc
11156 behaves (required by POSIX).
11157 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
11158 fail.
11159
1f7a61ff
AD
111602003-08-25 Akim Demaille <akim@epita.fr>
11161
11162 Tune local.at so that people can "autom4te -l autotest calc.at -o
11163 calc" for instance, to extract a sub test suite.
11164
11165 * tests/testsuite.at: Move the initialization, Autotest version
11166 requirement, and AT_TESTED invocation into...
11167 * tests/local.at: here.
11168 * tests/testsuite.at: Include it for compatibility with Autoconf
11169 2.57.
11170 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
11171 be ignore.
11172
327b5b56
PE
111732003-08-04 Paul Eggert <eggert@twinsun.com>
11174
11175 Rework code slightly to avoid gcc -Wtraditional warnings.
11176 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
11177 The returned value is now stored in *YY0. All callers changed.
11178 * src/output.c (merge_output): Adjust to the above change.
11179
0051e3ed
PE
111802003-07-26 Paul Eggert <eggert@twinsun.com>
11181
11182 * data/glr.c (YYASSERT): New macro.
11183 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
11184 yyresolveStates, yyprocessOneStack):
11185 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
11186 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 11187
137437c6
PE
111882003-07-25 Paul Eggert <eggert@twinsun.com>
11189
5b620e06
PE
11190 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
11191 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 11192 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
11193 by Frank Heckenbach, though I have omitted the structure-initialization
11194 part of his glr-knr.diff patch since I recall that the Portable
11195 C Compiler didn't require that change.
11196
137437c6
PE
11197 Let the user specify how to allocate and free memory.
11198 Derived from a suggestion by Frank Heckenbach in
161a71f3 11199 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
11200 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
11201 All uses of free, malloc, realloc changed to use these macros,
11202 and unnecessary casts removed.
11203 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
11204
ddb85ca5
PE
112052003-07-06 Matthias Mann <MatthiasMann@gmx.de>
11206
11207 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
11208 use s.empty() rather than s == "" to test for empty string; see
161a71f3 11209 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
11210 (trivial change)
11211
39910e09
AD
112122003-06-25 Akim Demaille <akim@epita.fr>
11213
11214 * config/depcomp, config/install-sh: Update from masters.
11215
0ae99356
PE
112162003-06-20 Paul Eggert <eggert@twinsun.com>
11217
11218 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
11219 and return properly parenthesized result.
11220 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
11221 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
11222 Remove unnecessary parentheses from uses.
11223 * doc/bison.texinfo (Location Default Action): Describe the
11224 conventions for parentheses.
11225
cd05d13c
PE
112262003-06-19 Paul Eggert <eggert@twinsun.com>
11227
81fd08ca
PE
11228 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
11229 yyreportTree): Do not assume that size_t is the same width as int,
11230 when printing sizes. Print sizes using an unsigned format.
11231 Problem reported by Frank Heckenbach in
161a71f3 11232 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 11233
cd05d13c
PE
11234 Port to Forte Developer 7 C compiler.
11235 * data/glr.c (struct YYLTYPE): If locations are not being used,
11236 declare a single dummy member, as empty structs do not conform
11237 to the C standard.
11238 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
11239 the Forte Developer 7 C compiler complains that end-of-loop
11240 code is not reached.
11241
4dcf140b
PE
112422003-06-17 Paul Eggert <eggert@twinsun.com>
11243
11244 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
11245 avoid warnings from picky compilers about redefinition of PARAMS.
11246
8dd76bee
PE
112472003-06-17 Paul Eggert <eggert@twinsun.com>
11248
11249 Version 1.875b.
11250
11251 * NEWS: Document 1.875b.
11252
11253 * lib/bbitset.h: Do not include config.h; that's the includer's job.
11254 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
11255 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
11256 Don't use 'index' in comments, as it's a builtin fn on some hosts.
11257 * lib/bitset_stats.c: Include gettext.h unconditionally, as
11258 per recent gettext manual's suggestion.
11259 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
11260 Use prototypes, not old-style definitions.
11261 * lib/lbitset.c (lbitset_unused_clear): Likewise.
11262 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
11263 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
11264 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
11265 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
11266 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
11267 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
11268 vbitset_or_and_cmp, vbitset_copy): Likewise.
11269
11270 * lib/libiberty.h: Do not include config.h; that's the includer's job.
11271 Do not include <stdlib.h>.
11272 (PARAMS): Define unconditionally for C89.
11273 (ATTRIBUTE_NORETURN): Remove.
11274 (ATTRIBUTE_UNUSED): Define unconditionally.
11275
11276 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 11277 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
11278 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
11279 * lib/vbitset.c, lib/vbitset.h: New files.
11280 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
11281 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
11282 from libbitset.
11283
11284 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
11285 `How Can I Reset @code{yyparse}', since texinfo does not allow
11286 arbitrary @ in node names.
11287
11288 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
11289 shouldn't be needed according to the gettext 0.12.1 documentation
11290 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 11291 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 11292 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 11293 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 11294
8dd76bee
PE
11295 * lib/.cvsignore: Add stdbool.h.
11296 * m4/.cvsignore: Add nls.m4, po.m4.
11297
11298 Upgrade to CVS gnulib.
11299 * stdbool_.h: File renamed from stdbool.h.in.
11300 * configure.ac (AM_STDBOOL_H): Invoke this instead of
11301 AC_HEADER_STDBOOL.
11302 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
11303 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
11304 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
11305 (MOSTLYCLEANFILES): New var.
11306 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
11307 (stdbool.h): New rule.
11308 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
11309 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
11310 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
11311 m4/quote.m4: Upgrade to today's gnulib.
11312
11313 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
11314 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
11315 the tests right now.
11316 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
11317 yyerror are declared before use; C99 requires this.
11318
25005f6a
PH
113192003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11320
11321 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
11322 first.
11323 (yyrecoverSyntaxError): Correct the logic for setting and testing
11324 yyerrState.
11325 Correct comment on handling EOF.
11326 Allow states with only a default reduction, rather than failing
8dd76bee 11327 (I can't quite reconstruct why these were not allowed before).
25005f6a 11328
137437c6 11329 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 11330 buffer overruns, corrupting state.
8dd76bee
PE
11331
11332 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
11333 definition.
11334 * src/reader.h (max_left_semantic_context): New variable declaration.
11335 * src/scan-gram.l (max_left_semantic_context): Define.
11336 (handle_action_dollar): Update max_left_semantic_context.
11337 * data/glr.c (YYMAXLEFT): New definition.
11338 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
11339 (yyresolveAction): Ditto.
11340
11341 Fixes to problems with location handling in GLR parsers reported by
11342 Frank Heckenbach (2003/06/05).
11343
11344 * data/glr.c (YYLTYPE): Make trivial if locations not used.
11345 (YYRHSLOC): Add parentheses, and define only if locations used.
11346 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
11347 locations not used.
11348 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
11349 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 11350
25005f6a
PH
11351 * tests/cxx-type.at: Exercise location information; update tests
11352 to differentiate output with and without locations.
8dd76bee 11353 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
11354 because default YYLTYPE not yet defined.
11355 Change semantic actions to compute strings, rather than printing
11356 them directly (to test proper passing of semantics values). Change
11357 output to prefix notation and update test data and expected results.
11358 (yylex): Track locations.
11359 (stmtMerge): Return value rather than printing, and include arguments
11360 in value.
8dd76bee 11361
711f40b7
PE
113622003-06-03 Paul Eggert <eggert@twinsun.com>
11363
11364 Avoid warnings generated by GCC 2.95.4 when Bison is
11365 configured with --enable-gcc-warnings.
11366 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
11367 yy::]b4_parser_class_name[::translate_,
11368 yy::Stack::operator[] (unsigned),
11369 yy::Stack::operator[] (unsigned) const,
11370 yy::Slice::operator[] (unsigned),
11371 yy::Slice::operator[] (unsigned) const):
11372 Rename local vars to avoid warnings.
11373 * tests/glr-regression.at (Improper handling of embedded actions
11374 and $-N in GLR parsers): Remove unused local variable from yylex.
11375 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
11376 (void) as arg when not pure, since we now assume C89 when building
11377 Bison. Pacify GCC by using parameter.
11378
ac695f7d
PE
113792003-06-02 Paul Eggert <eggert@twinsun.com>
11380
11381 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
11382 yy::Location::lines, yy::Location::columns): Rename arguments
11383 to avoid shadowing; this removes a warning generated by GCC 3.3.
11384
26ec81e0
PE
113852003-06-01 Paul Eggert <eggert@twinsun.com>
11386
11387 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
11388 to g++, as GCC 3.3 complains if you do it.
11389 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
11390 everything that WARNING_CFLAGS has, except omit warnings
11391 not suitable for C++.
11392 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
11393 * tests/atlocal.in (CXXFLAGS): New var.
11394 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
11395
11396 Fix a GLR parser bug I reported in February; see
161a71f3 11397 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
11398 The problem was that GLR parsers did not conform to the C standard,
11399 because actions like { $1 = $2 + $3; } expanded to expressions
11400 that invoked YYFILL in separate subexpressions, and YYFILL assigned
11401 to a local variable. The C standard says that expressions
11402 like (var = f ()) + (var = f ()) have undefined behavior.
11403 Another problem was that GCC sometimes issues warnings that
11404 yyfill and its parameters are unused.
11405
11406 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
11407 as possibly unused.
11408 (yyfill): New function.
11409 (YYFILL): Use it.
11410 (yyuserAction): Change type of yynormal to bool, so that it matches
11411 the new yyfill signature. Mark it as possibly unused.
11412
11413
11414 Follow up on a bug I reported in February, where a Bison-generated
11415 parser can loop. Provide a test case and a fix for yacc.c. I
11416 don't have a fix for lalr1.cc or for glr.c, unfortunately.
11417 The original bug report is in:
161a71f3 11418 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
11419
11420 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
11421 macro's size was becoming unwieldy.
11422 (yyerrlab): Do not discard an empty lookahead symbol, as this
11423 might destroy garbage.
11424 (yyerrorlab): New label, with the old contents of YYERROR,
11425 plus the following change: pop the stack of rhs corresponding
11426 to the production that invoked YYERROR. That is how Yacc
11427 behaves, and POSIX requires this behavior.
11428 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
11429 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
11430 Define 'alarm' to do nothing if unistd.h is not available.
11431 Add a new rule "exp: '-' error;" to test the above change to
11432 data/yacc.c. Use 'alarm' to abort any test taking longer than
11433 10 seconds, as it's probably looping.
11434 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
11435 Also, the new yacc.c generates two fewer diagnostics for an
11436 existing test.
11437
d0829076
PE
114382003-05-24 Paul Eggert <eggert@twinsun.com>
11439
c6ae27df
PE
11440 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
11441 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
11442 This fixes a problem reported by John Bowman when the Compaq/HP
11443 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
11444 -ansi -Wall -gall).
11445 * data/yacc.c (union yyalloc): Likewise.
11446 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 11447
d0829076
PE
11448 Switch from 'int' to 'bool' where that makes sense.
11449
11450 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
11451 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
11452 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
11453 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
11454 Return or accept bool, not int. All callers changed.
11455 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
11456 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
11457 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
11458 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
11459 bitset_or_and_cmp_): Likewise.
11460 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
11461 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
11462 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
11463 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
11464 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
11465 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
11466 bitset_stats_or_and_cmp): Likewise.
11467 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
11468 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
11469 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
11470 ebitset_xor_cmp): Likewise.
11471 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
11472 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
11473 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
11474 lbitset_xor_cmp): Likewise.
11475 * lib/bbitset.h: Include <stdbool.h>.
11476 (struct bitset_vtable): The following members now return bool, not
11477 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
11478 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
11479 or_and_cmp).
11480 * src/conflicts.c (count_rr_conflicts): Likewise.
11481 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
11482 All uses changed.
11483 * lib/ebitset.c (ebitset_obstack_init): Likewise.
11484 * lib/lbitset.c (lbitset_obstack_init): Likewise.
11485 * src/getargs.c (debug_flag, defines_flag, locations_flag,
11486 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
11487 graph_flag): Likewise.
11488 * src/getargs.h (debug_flag, defines_flag, locations_flag,
11489 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
11490 graph_flag): Likewise.
11491 * src/output.c (error_verbose): Likewise.
11492 * src/output.h (error_verbose): Likewise.
11493 * src/reader.c (start_flag, typed): Likewise.
11494 * src/reader.h (typed): Likewise.
11495 * src/getargs.c (LOCATIONS_OPTION): New constant.
11496 (long_options, getargs): Use it.
11497 * src/lalr.c (build_relations): Use bool, not int.
11498 * src/nullable.c (nullable_compute): Likewise.
11499 * src/print.c (print_reductions): Likewise.
11500 * src/tables.c (action_row, pack_vector): Likewise.
11501 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
11502 * src/output.c (prepare): Use it.
11503 * src/output.c (token_definitions_output,
11504 symbol_destructors_output, symbol_destructors_output): Use string,
11505 not boolean integer, to keep track of whether to output separator.
11506 * src/print_graph.c (print_core): Likewise.
11507 * src/state.c (state_rule_lookaheads_print): Likewise.
11508
11509 * config/install-sh: Sync from automake 1.7.5.
11510
6b2584b7
PE
115112003-05-14 Paul Eggert <eggert@twinsun.com>
11512
11513 * src/parse-gram.y (rules_or_grammar_declaration): Require a
11514 semicolon after a grammar declaration, in the interest of possible
11515 future changes to the Bison input language.
11516 Do not allow a stray semicolon at the start of the grammar.
11517 (rhses.1): Allow one or more semicolons after any rule, including
11518 just before "|" as required by POSIX.
11519 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
11520 grammar.
11521
caf37a36
ADL
115222003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
11523
11524 %parse-param support for lalr1.cc.
11525
11526 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
11527 b4_cc_constructor_calls, b4_cc_constructor_call,
11528 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
11529 definitions.
11530 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
11531 parse-param arguments.
11532 (yy::b4_parser_class_name): Declare instance variables to
11533 hold parse-param arguments.
11534 * tests/calc.at: s/value/semantic_value/ because value clashes
11535 with a member of yy::b4_parser_class_name. Adjust C++ code
11536 to handle %parse-param. Enable %parse-param test in C++.
11537
3ab37077
PE
115382003-05-12 Paul Eggert <eggert@twinsun.com>
11539
11540 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
11541 English a bit. Fix fclose typo. Change "const char" to "char
11542 const", and use ANSI C rather than K&R for "main". Suggest
11543 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
11544 and suggest yy_switch_to_buffer.
11545
115462003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
11547
11548 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
11549 C89. This avoids a diagnostic on compilers that define __STDC__
11550 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 11551 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 11552
e743727f
PE
115532003-05-03 Paul Eggert <eggert@twinsun.com>
11554
11555 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
11556 Do not overrun array bounds.
11557 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 11558 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 11559
916708d5
AD
115602003-04-29 Akim Demaille <akim@epita.fr>
11561
11562 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
11563 * src/getargs.c, src/getargs.h: here, as bool, not int.
11564 (nondeterministic_parser): New.
11565 * src/parse-gram.y, src/scan-gram.l: Support
11566 %nondeterministic-parser.
11567 * src/output.c (prepare): Use nondeterministic_parser instead
11568 of glr_parser where appropriate.
11569 * src/tables.c (conflict_row, action_row, save_row)
11570 (token_actions, token_actions, pack_vector): Ditto.
11571
a06ea4aa
AD
115722003-04-29 Akim Demaille <akim@epita.fr>
11573
11574 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
11575
211074ca
AD
115762003-04-29 Akim Demaille <akim@epita.fr>
11577
11578 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
11579 with %pure-parser and %locations to exercise the patch from Yakov
11580 Markovitch below.
11581
6175ffe3
PE
115822003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
11583
11584 * data/yacc.c: (b4_lex_param): Corrected for the case where
11585 %lex-param is provided and %pure-parser isn't.
11586
b1e95857
PE
115872003-04-27 Paul Eggert <eggert@twinsun.com>
11588
11589 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 11590 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
11591 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
11592 if it is not defined.
11593 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
11594
acda9df6
PE
115952003-04-26 Paul Eggert <eggert@twinsun.com>
11596
3470c57b
PE
11597 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
11598 Declare to be of type suitable for the ninf value itself, not of
11599 type suitable for the corresponding table, since the latter might
11600 be unsigned but the ninf value might be negative. This fixes a
11601 bug reported by Alexandre Duret-Lutz in
161a71f3 11602 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 11603
acda9df6
PE
11604 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
11605 invokes it. We shouldn't invoke it twice because it will attempt
11606 to put error.o in the archive twice. This fixes a glitch reported
11607 by Martin Mokrejs in
161a71f3 11608 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 11609
b5250f26
PE
116102003-04-21 Paul Eggert <eggert@twinsun.com>
11611
11612 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
11613 to gnulib.
11614
089ac0f1
PE
116152003-04-21 Yakov Markovitch <Markovitch@iso.ru>
11616
11617 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
11618 Fix obvious typo that results in uncompilable GLR parsers
11619 when both %pure-parser and %locations are used. (trivial change)
11620
5ededac6
PE
116212003-04-17 Paul Eggert <eggert@twinsun.com>
11622
1b8f2fff
PE
11623 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
11624 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
11625 Do not insert the expected token via unput, as this runs afoul
11626 of a POSIX-compatibility bug in flex 2.5.31.
11627 All uses changed to BEGIN the parent state,
11628 since we no longer insert the expected token via unput.
11629 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
11630 that is no longer emitted after the above change.
11631
5ededac6
PE
11632 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
11633 the first one. This change is from Paul Hilfinger, and it fixes
11634 regression reported by Werner Lemberg in
161a71f3 11635 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
11636
11637 (resolve_sr_conflict): Don't invoke state_errs_set
11638 unless one or more tokens have been explicitly made errors.
11639 Otherwise, the above change causes Bison to abort.
11640
11641 * tests/existing.at (GNU pic Grammar): New test case, taken from
11642 Lemberg's email.
11643
b8be9132
AD
116442003-03-31 Akim Demaille <akim@epita.fr>
11645
11646 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
11647
d423d460
AD
116482003-03-31 Akim Demaille <akim@epita.fr>
11649
11650 * src/output.c (prepare_symbols): Avoid trailing spaces in the
11651 output.
11652
c7e441b4
AD
116532003-03-31 Akim Demaille <akim@epita.fr>
11654
11655 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
11656 From Paul Hilfinger.
11657
231897ad
AD
116582003-03-29 Akim Demaille <akim@epita.fr>
11659
11660 * m4/error.m4: Do not put under dynamic conditions some code which
11661 expansion is under static control.
11662
5b066063
AD
116632003-03-29 Akim Demaille <akim@epita.fr>
11664
11665 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
11666
22a74fec
AD
116672003-03-29 Akim Demaille <akim@epita.fr>
11668
11669 * doc/bison.texinfo (Strings are Destroyed): New.
11670
0eee27e7
PE
116712003-03-13 Paul Eggert <eggert@twinsun.com>
11672
11673 * .cvsignore: Add configure.lineno.
11674 * src/.cvsignore: Add yacc.
11675 * tests/.cvsignore: Add testsuite.log.
11676 * doc/fdl.texi: Sync with latest FSF version.
11677
f61aad93
PE
116782003-03-12 Paul Eggert <eggert@twinsun.com>
11679
537636c7
PE
11680 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
11681 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
11682 cursor, instead of leaving it undefined. This fixes a bug
11683 reported by Tim Van Holder in
161a71f3 11684 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
11685 * tests/input.at (Torturing the Scanner): Test the scanner on
11686 an empty input file, which was Tim Van Holder's test case.
11687
11688 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
11689 <sys/resource.h> can be included, include sys/time.h and
11690 sys/times.h first, if available. This works around the SunOS
11691 4.1.4 porting bug reported by Bruce Becker in
161a71f3 11692 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
11693
11694 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
11695 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
11696 AC_HEADER_SYS_WAIT.
11697
f61aad93
PE
11698 Merge changes from gnulib. This was prompted because the CVS
11699 snapshot didn't build on Solaris 7 due to strnlen problems.
11700
11701 These changes need to be merged back into gnulib:
11702 * lib/hash.c: Include <stdbool.h> unconditionally.
11703 * m4/onceonly.m4 (m4_quote): New macro.
11704 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
11705 Quote AC_FOREACH variable-expansions properly.
11706 The 2003-01-03 obstack.h change also needs merging.
11707 {end of changes requiring merging}
5b066063 11708
f61aad93
PE
11709 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
11710 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
11711 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
11712 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
11713 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
11714 New files, imported from gnulib.
11715 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
11716 above.
11717
11718 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
11719 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
11720 gnulib sources.
11721
11722 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
11723 Add.
11724 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
11725 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
11726 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
11727 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
11728 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
11729 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
11730 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
11731 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
11732 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
11733 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
11734 (jm_PREREQ_ARGMATCH): Remove.
11735 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
11736 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
11737
11738 * src/system.h: Include <stdbool.h> unconditionally.
11739
11740 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
11741 assuming at least C89 in the bitset code for some time now.
11742
d2ffe116
AD
117432003-03-03 Akim Demaille <akim@epita.fr>
11744
11745 * ro.po: New.
11746
052826fd
AD
117472003-03-02 Akim Demaille <akim@epita.fr>
11748
11749 * doc/bison.texinfo (Table of Symbols): Reactivate the
11750 documentation for %lex-param, and %parse-param.
11751
c4749565
AD
117522003-03-02 Akim Demaille <akim@epita.fr>
11753
11754 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
11755 generate verbose error messages.
11756 Use the number of tokens as an upper bound in yytname, as it
11757 cannot be a non terminal.
11758
d5286af1
AD
117592003-03-02 Akim Demaille <akim@epita.fr>
11760
11761 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
11762 message.
11763
22e304a6
AD
117642003-03-02 Akim Demaille <akim@epita.fr>
11765
22e304a6
AD
11766 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
11767 Use them to exercise yycheck overrun.
11768 Based on Andrew Suffield's grammar.
11769
67a25fed
AD
117702003-03-02 Akim Demaille <akim@epita.fr>
11771
11772 Create tests/local.at for Bison generic testing macros.
11773
11774 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
11775 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
11776 This new file.
11777 * tests/calc.at (AT_CHECK_CALC): Adjust.
11778 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
11779 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
11780 * tests/local.at: here.
11781 (AT_COMPILE_CXX): Tags the tests using it as c++.
11782 Ignore the test if CXX is not functional.
11783
9c2b381f
PE
117842003-03-01 Paul Eggert <eggert@twinsun.com>
11785
11786 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
11787 not loc->end, since loc->end might contain garbage and this leads
11788 to undefined behavior on some platforms.
11789 (id_loc, token_start): Use (IF_LINTed) initial values that do not
11790 depend on *loc, so that the reader doesn't give the the false
11791 impression that *loc is initialized.
11792 (<INITIAL>"%%"): Do not bother setting code_start, since its value
11793 does not survive the return.
11794
0433ba88
AD
117952003-03-01 Akim Demaille <akim@epita.fr>
11796
11797 * src/scan-gram.l (code_start): Always initialize it when entering
11798 into yylex, as SC_EPILOGUE is activated *before* the corresponding
11799 yylex invocation. An alternative would be making it static, but
11800 then it starts with the second %%'s beginning, instead of its end.
11801
b305ea69
PE
118022003-02-28 Paul Eggert <eggert@twinsun.com>
11803
11804 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
11805 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 11806 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 11807
c3d25e01
PE
118082003-02-26 Paul Eggert <eggert@twinsun.com>
11809
11810 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
11811 Remove Sequent/Pyramid discussion (nobody uses them any more).
11812 Merge VMS and MS-DOS discussion; these ports may well be dead
11813 but let's keep mentioning them for now. Put <> around email
11814 addresses. Add copyright notice.
11815
c267ffbc
PE
118162003-02-24 Paul Eggert <eggert@twinsun.com>
11817
11818 * data/glr.c (yy_reduce_print): yylineno -> yylno,
11819 to avoid collision with flex use of yylineno.
11820 Problem reported by Bruce Lilly in
161a71f3 11821 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
11822 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11823 * data/yacc.c (yy_reduce_print): Likewise.
11824
11825 * config/depcomp: Sync with Automake 1.7.3.
11826
f939fc12
AD
118272003-02-21 Akim Demaille <akim@epita.fr>
11828
11829 * data/lalr1.cc: Use temporary variables instead of casts to
11830 change integer types.
11831 Suggested by Paul Eggert.
11832
95923bd6
AD
118332003-02-21 Akim Demaille <akim@epita.fr>
11834
11835 * doc/bison.texinfo: Use "location" consistently to refer to @n,
11836 to avoid confusions with lalr1.cc's notion of Position.
11837 Suggested by Paul Eggert.
11838
2cdc240e
AD
118392003-02-20 Akim Demaille <akim@epita.fr>
11840
11841 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
11842 before initial_columns.
11843 (location.hh): Use consistent variable names when defining the
11844 operator<<.
11845 Use "last" so that we subtract from Positions, not from unsigned.
11846
5d003116
AD
118472003-02-20 Akim Demaille <akim@epita.fr>
11848
11849 * data/lalr1.cc (position.hh): New subfile, including the extended
11850 and Doxygen'ed documentation of class Position.
11851 (location.hh): Use it.
11852 Document a` la Doxygen.
ba1ecc07 11853 With the help of Benoit Perrot.
5d003116 11854
d02b25f9
AD
118552003-02-20 Akim Demaille <akim@epita.fr>
11856
11857 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
11858 AT_YACC_IF.
11859 Redefine AT_YYERROR_SEES_LOC_IF using it.
11860 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
11861 not defined.
11862 Don't use the location in yy::Parser::error_ and
11863 yy::Parser::print_ when not %locations.
11864 Activate more lalr1.cc tests.
11865
0d1c3a04
AD
118662003-02-19 Akim Demaille <akim@epita.fr>
11867
11868 * data/lalr1.cc: When displaying a line number, be sure to make it
11869 an int.
11870
60a777aa
AD
118712003-02-19 Akim Demaille <akim@epita.fr>
11872
11873 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
11874 Remove, useless.
11875 (YYABORT, YYACCEPT, YYERROR): New.
11876 * tests/calc.at: Renable the lalr1.cc test.
11877
0b86fc41
AD
118782003-02-19 Akim Demaille <akim@epita.fr>
11879
11880 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
11881 error recovery, mixing with/without pops and discarding of the
11882 lookahead.
11883 Exercise YYERROR.
11884 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
11885
da99a5dc
PE
118862003-02-17 Paul Eggert <eggert@twinsun.com>
11887
11888 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
11889 * tests/testsuite.at (AT_COMPILE): Use them.
11890 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 11891 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 11892
93b8c255
PE
118932003-02-12 Paul Eggert <eggert@twinsun.com>
11894
11895 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
11896 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 11897 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
11898 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
11899 Check for malloc failure, for consistency with yacc.c.
11900 (yytname_size): Remove, for consistency with yacc.c.
11901
11902 The bug still remains in data/lalr1.cc, as I didn't have time
11903 to fix it there.
11904
7548fed2
AD
119052003-02-06 Akim Demaille <akim@epita.fr>
11906
11907 * configure.ac (GXX): Rename as...
11908 (CXX): this, to keep the original Autoconf semantics.
11909 Require 2.57.
11910 * data/lalr1.cc: Fix b4_copyright invocations.
11911 If YYDEBUG is not defined, don't depend upon name_ being defined.
11912 (location.hh): Include string and iostream.
11913 (Position::filename): New member.
11914 (Position::Position ()): New.
11915 (operator<< (Position)): New.
11916 (operator- (Position, int)): New.
11917 (Location::first, Location::last): Rename as...
11918 (Location::begin, Location::end): these, to mock the conventional
11919 iterator names.
11920 (operator<< (Location)): New.
11921 * tests/atlocal.in (CXX): New.
11922 * tests/testsuite.at (AT_COMPILE_CXX): New.
11923 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
11924 locations in a more synthetic way.
11925 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
11926 lalr1.cc is used.
11927 Adjust the C locations to match those from Emacs: first column is
11928 column 0.
11929 Change all the expected results.
11930 Conform to the GCS: simplify the locations when applicable.
11931 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
11932 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
11933 these CPP macros with the m4 macros new defined by...
11934 (AT_CHECK_PUSHDEFS): this, i.e.:
11935 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 11936 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
11937 New macros.
11938 (AT_CHECK_POPDEFS): Undefine them.
11939 (AT_CHECK_CALC_LALR1_CC): New.
11940 Use it for the first lalr1.cc test.
11941
43a176ef
AD
119422003-02-04 Akim Demaille <akim@epita.fr>
11943
11944 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
11945 Location as is defined.
11946
fc049e9c
AD
119472003-02-04 Akim Demaille <akim@epita.fr>
11948
11949 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
11950 name_ being defined.
11951
a737b216
PE
119522003-02-03 Paul Eggert <eggert@twinsun.com>
11953
11954 * src/gram.h (start_symbol): Remove unused decl.
11955
11956 Use more-consistent naming conventions for local vars.
11957
11958 * src/derives.c (derives_compute): Change type of local var from
11959 int to rule_number.
11960 * src/gram.c (grammar_rules_partial_print): Likewise.
11961 * src/print.c (print_core): Likewise.
11962 * src/reduce.c (reduce_grammar_tables): Likewise.
11963
11964 * src/gram.c (grammar_dump): Change name of item_number *
11965 local var from r to rp.
11966 * src/nullable.c (nullable_compute): Likewise.
11967
11968 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
11969
11970 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
11971 for symbol or symbol_number var.
11972 * src/reader.c (grammar_start_symbol_set): Likewise.
11973 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
11974 Likewise.
11975 * src/state.c (transitions_to): Likewise.
11976 * src/state.h: Likewise.
11977 * src/tables.c (symbol_number_to_vector_number): Likewise.
11978
11979 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
11980 char * var.
11981
11982 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
11983 var.
11984
11985 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
11986 var.
11987
11988 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
11989 Use str, not s, for char * var. Use ch, not c, for character var.
11990 Use size for size var.
11991
11992 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
11993 char * var.
11994 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
11995 uniqstr var.
11996 * src/uniqstr.h: Likewise.
11997
11998 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
11999 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12000 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
12001 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
12002 param to have same name as that of enum, so that we don't use
12003 "s" to stand for a non-state.
12004
68e93ad5
AD
120052003-02-02 Akim Demaille <akim@epita.fr>
12006
12007 * src/scan-skel.l: Scan more than one inert character per yylex
12008 invocation.
12009
92898986
PE
120102003-02-01 Paul Eggert <eggert@twinsun.com>
12011
12012 Version 1.875a.
12013
1d9d5d71
PE
12014 * po/LINGUAS: Add ms.
12015
0435d061
AD
120162003-01-30 Akim Demaille <akim@epita.fr>
12017
12018 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
12019
6029a57f
PH
120202003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12021
12022 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
12023 of $1.
0435d061
AD
12024
12025 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 12026 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 12027 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 12028
6029a57f
PH
12029 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
12030 (b4_rhs_location): Ditto.
0435d061 12031 (yyfill): New function to copy from stack tree into array
6029a57f 12032 incrementally.
0435d061
AD
12033 (yyuserAction): Modify to allow incremental move of semantic values
12034 to rhs array when in GLR mode.
12035 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
12036 as needed.
12037 Remove dummy use of yystack, as there is now a guaranteed use.
12038 (yydoAction): Modify to allow incremental move of semantic values
12039 to rhs array when in GLR mode.
12040 (yyresolveAction): Ditto.
12041 (yyglrShiftDefer): Update comment.
0435d061 12042 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
12043 (yyglrReduce): Ditto.
12044 (yydoAction): Ditto
0435d061 12045
6029a57f
PH
12046 * tests/glr-regr1.at: Rename to ...
12047 * tests/glr-regression.at: Add new regression test for the problems
12048 described above (adapted from S. Eken).
12049 Update copyright notice.
12050 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
12051 * tests/Makefile.am: Ditto.
12052
6cee6297
PE
120532003-01-28 Paul Eggert <eggert@twinsun.com>
12054
12055 * data/lalr1.cc: Do not use @output_header_name@ unless
12056 b4_defines_flag is set. This fixes two bugs reported by
12057 Tim Van Holder in
161a71f3
PE
12058 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
12059 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 12060
b2a836b5
PE
120612003-01-21 Paul Eggert <eggert@twinsun.com>
12062
12063 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
12064 we don't need to worry about yyerrlab1 being reported as an
12065 "unused label" by non-GCC C compilers. The downside is that if
12066 locations are used then a couple of statements are duplicated each
12067 time YYERROR is invoked, but the upside is that the warnings
12068 should vanish.
12069 (yyerrlab1): Move code to YERROR.
12070 (yyerrlab2): Remove. Change uses back to yyerrlab1.
12071 This reverts some of the 2002-12-27 change.
12072
4196b931
PE
120732003-01-17 Paul Eggert <eggert@twinsun.com>
12074
12075 * src/output.c (symbol_printers_output): Fix typo that led
12076 to core dump. Problem reported by Antonio Rus in
161a71f3 12077 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 12078
3ae831b4
AD
120792003-01-13 Akim Demaille <akim@epita.fr>,
12080 Quoc Peyrot <chojin@lrde.epita.fr>,
12081 Robert Anisko <anisko_r@lrde.epita.fr>
12082
12083 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
12084 when the stacks contain one element, as the loop would otherwise
12085 free the last state, and then use the top state (the one we just
12086 popped). This means that the initial elements will not be freed
12087 explicitly, as is the case in yacc.c; it is not a problem, as
12088 these elements have fake values.
12089
e3aa65c5
PE
120902003-01-11 Paul Eggert <eggert@twinsun.com>
12091
12092 * NEWS: %expect-violations are now just warnings, reverting
12093 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
12094 bootstrapping problem reported by Matthias Klose; see
161a71f3 12095 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
12096 * src/conflicts.c (conflicts_print): Likewise.
12097 * tests/conflicts.at (%expect not enough, %expect too much,
12098 %expect with reduce conflicts): Likewise.
12099 * doc/bison.texinfo (Expect Decl): Document this. Also mention
12100 that the warning is enabled if the number of conflicts changes
12101 (not necessarily increases).
12102
12103 * src/getargs.c (version): Update copyright year.
12104
f0057011
AD
121052003-01-09 Akim Demaille <akim@epita.fr>
12106
12107 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
12108
1ee6d2a0
PE
121092003-01-08 Paul Eggert <eggert@twinsun.com>
12110
12111 * Makefile.maint (WGETFLAGS):
12112 New macro, containing "-C off" to disable proxy caches.
12113 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
12114 (rel-check): Use $(WGET) instead of wget.
12115
d4fd77c4
PE
121162003-01-06 Paul Eggert <eggert@twinsun.com>
12117
12118 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
12119 the GLR paper of Scott, Johnstone and Hussain.
12120
464c6927
PE
121212003-01-04 Paul Eggert <eggert@twinsun.com>
12122
d600ee67
PE
12123 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
12124 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
12125 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
12126 (EXTRA_LIBRARIES): New var, for liby.a.
12127 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
12128 (EXTRA_SCRIPTS): New var, for yacc.
12129
464c6927
PE
12130 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
12131 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
12132 Problem reported by Nelson H. F. Beebe.
12133
121342003-01-03 Paul Eggert <eggert@twinsun.com>
12135
12136 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
12137 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
12138 when compiling Bison 1.875's `bitset bset = obstack_alloc
12139 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
12140
12141 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
12142 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
12143 grow to a huge size with typical invocation.
d600ee67 12144
464c6927
PE
12145 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
12146 Use the pattern recommended by Autoconf 2.57, except also protect
12147 against double-definition.
12148 * src/system.h: Likewise.
12149 Portability issues reported by Nelson H. F. Beebe.
d600ee67 12150
464c6927
PE
12151 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
12152 All uses changed. Provide a definition in both C and C++.
12153 (yytrue, yyfalse): Define even if defined (__cplusplus).
12154
12155 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
12156 Reported by Nelson H. F. Beebe.
d600ee67 12157
464c6927
PE
12158 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
12159
0f42c7d5
PE
121602003-01-02 Paul Eggert <eggert@twinsun.com>
12161
12162 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
12163 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
12164 Bug reported by Nelson H. F. Beebe.
12165
dc546b0f
PE
121662003-01-01 Paul Eggert <eggert@twinsun.com>
12167
12168 * Version 1.875.
12169
2c09b6a7
PE
121702002-12-30 Paul Eggert <eggert@twinsun.com>
12171
12172 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
12173 Moved here from...
12174 (<INITIAL>","): Here. This causes stray "," to be treated
12175 more uniformly.
12176
dc546b0f 12177 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
12178 last brace in braced code when not in Yacc mode, for compatibility
12179 with Bison 1.35. This resurrects the 2001-12-15 patch to
12180 src/reader.c.
12181
12182 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
12183 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
12184
535c0f63
PE
121852002-12-28 Paul Eggert <eggert@twinsun.com>
12186
12187 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
12188 that of SYM's type. This fixes Debian bug 168069, reported by
12189 Thomas Olsson.
d600ee67 12190
963fcc17
PE
121912002-12-28 Paul Eggert <eggert@twinsun.com>
12192
12193 Version 1.75f.
12194
12195 Switch back to the Yacc style of conflict reports, undoing some
12196 of the 2002-07-30 change.
12197 * doc/bison.texinfo (Understanding): Use Yacc style for
12198 conflict reports. Also, use new way of locating rules.
12199 * src/conflicts.c (conflict_report):
12200 Renamed from conflict_report_yacc, removing the old
12201 'conflict_report'. Translate the entire conflict report at once,
12202 so that we don't assume that "," has the same interpretation in
12203 all languages.
12204 (conflicts_output): Use Yacc-style conflict report for each state,
12205 instead of our more-complicated style.
12206 (conflicts_print): Use Yacc-style conflict report, except print
12207 the input file name when not emulating Yacc.
12208 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
12209 Conflicted Reduction, %expect not enough, %expect too much,
12210 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
12211 * tests/existing.at (GNU Cim Grammar): Likewise.
12212 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
12213
12214 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
12215 fatal): Don't invoke fflush; it's not needed and it might even be
12216 harmful for stdout, as stdout might not be open.
12217 * src/reduce.c (reduce_print): Likewise.
12218
b1efe548
PE
122192002-12-27 Paul Eggert <eggert@twinsun.com>
12220
12221 Fix a bug where error locations were not being recorded correctly.
12222 This problem was originally reported by Paul Hilfinger in
161a71f3 12223 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
12224
12225 * data/yacc.c (yyparse): New local var yylerrsp, to record the
12226 top of the location stack's error locations.
12227 (yyerrlab): Set it. When discarding a token, push its location
12228 onto yylerrsp so that we don't lose track of the error's end.
12229 (yyerrlab1): Now is only the target of YYERROR, so that we can
12230 properly record the location of the action that failed. For GCC
12231 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
12232 GCC warning about yyerrlab1 being unused if YYERROR is unused.
12233 (yyerrlab2): New label, which yyerrlab now falls through to.
12234 Compute the error's location by applying YYLLOC_DEFAULT to
12235 the locations of all the symbols that went into the error.
12236 * doc/bison.texinfo (Location Default Action): Mention that
12237 YYLLOC_DEFAULT is also invoked for syntax errors.
12238 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12239 Error locations include the locations of all the tokens that were
12240 discarded, not just the last token.
d600ee67 12241
983c5c2c
PE
122422002-12-26 Paul Eggert <eggert@twinsun.com>
12243
b1efe548
PE
12244 * src/files.c: Include quote.h.
12245 (compute_output_file_names): Warn if we detect conflicting
12246 outputs to the same file. This should catch the misunderstanding
12247 exemplified by Debian Bug 165349, reported by Bruce Stephens..
12248
12249 * src/conflicts.c (conflicts_print): If the user specifies
12250 "%expect N", report an error if there are any reduce/reduce
12251 conflicts. This is what the manual says should happen.
12252 This fixes Debian bug 130890, reported by Anthony DeRobertis.
12253 * tests/conflicts.at (%expect with reduce conflicts): New test.
12254
983c5c2c
PE
12255 Don't use m4_include on relative file names, as it doesn't work as
12256 desired if there happens to be a file with that name under ".".
d600ee67 12257
983c5c2c
PE
12258 * m4sugar/version.m4: Remove; it was included but it wasn't used.
12259 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
12260 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
12261 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
12262 * src/output.c (output_skeleton): Use full path names when
12263 specifying a file to include; don't rely on include path, as
12264 it's unreliable when the working file contains a file with
12265 that name.
d600ee67 12266
983c5c2c
PE
122672002-12-25 Paul Eggert <eggert@twinsun.com>
12268
12269 Remove obsolete references to bison.simple and bison.hairy.
12270 Problem mentioned by Aubin Mahe in
161a71f3 12271 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
12272 * data/glr.c: Comment fix.
12273 * doc/bison.1: Remove references. Also, mention "yacc".
12274
12275 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
12276 with -g option.
12277
12278 * src/parse-gram.y (declaration): Use enum "report_states" rather
12279 than its numeric value 1.
12280
12281 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
12282 opening a new one. This fixes Debian bug 165349, reported by
12283 Bruce Stephens.
12284
23f2d9dc
PE
122852002-12-24 Paul Eggert <eggert@twinsun.com>
12286
12287 Version 1.75e.
12288
12289 * Makefile.maint (cvs-update): Don't assume that the shell
12290 supports $(...), as Solaris sh doesn't.
12291
12292 * src/parse-gram.y (lloc_default): Remove test for empty
12293 nonterminals at the end, since it didn't change the result.
12294
122952002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
12296
12297 If the user does not define YYSTYPE as a macro, Bison now declares it
12298 using typedef instead of defining it as a macro. POSIX requires this.
12299 For consistency, YYLTYPE is also declared instead of defined.
12300
12301 %union directives can now have a tag before the `{', e.g., the
12302 directive `%union foo {...}' now generates the C code
12303 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
12304 The default union tag is `YYSTYPE', for compatibility with Solaris 9
12305 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
12306 instead of `yyltype'.
12307
12308 `yystype' and `yyltype' are now obsolescent macros instead of being
12309 typedefs or tags; they are no longer documented and will be
12310 withdrawn in a future release.
12311
12312 * data/glr.c (b4_location_type): Remove.
12313 (YYSTYPE): Renamed from yystype.
12314 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
12315 (struct YYLTYPE): Renamed from struct yyltype.
12316 (YYLTYPE): Renamed from yyltype.
12317 (yyltype, yystype): New (and obsolescent) macros,
12318 for backward compatibility.
12319 * data/yacc.c: Likewise.
12320
12321 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
12322 does not specify a union tag. This is for compatibility with
12323 Solaris 9 yacc.
12324
12325 * src/parse-gram.y (add_param): 2nd arg is now char * not char
12326 const *, since it is now modified by stripping surrounding { }.
12327 (current_braced_code): Remove.
12328 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
12329 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
12330 trailing " {...}". Now of type <chars>.
12331 (grammar_declaration): Adjust to bundled tokens.
12332 (code_content): Remove; stripping is now done by add_param.
12333 (print_token_value): Print contents of bundled tokens.
12334 (token_name): New function.
12335
12336 * src/reader.h (braced_code, current_braced_code): Remove.
12337 (token_name): New decl.
12338
12339 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
12340 token_type, not braced_code code_kind. All uses changed.
12341 (SC_PRE_CODE): New state, for scanning after a keyword that
12342 has (or usually has) an immediately-following braced code.
12343 (token_type): New local var, to keep track of which token type
12344 to return when scanning braced code.
12345 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 12346 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
12347 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
12348 instead of returning a token type immediately.
12349 (<INITIAL>"{"): Set token type.
12350 (<SC_BRACED_CODE>"}"): Use it.
12351 (handle_action_dollar, handle_action_at): Now returns bool
12352 indicating success. Fail if ! current_rule; this prevents a core dump.
12353 (handle_symbol_code_dollar, handle_symbol_code_at):
12354 Remove; merge body into caller.
12355 (handle_dollar, handle_at): Complain in invalid contexts.
12356
12357 * NEWS, doc/bison.texinfo: Document the above.
12358 * NEWS: Fix years and program names in copyright notice.
12359
879ca4f8
PE
123602002-12-17 Paul Eggert <eggert@twinsun.com>
12361
12362 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
12363 Reporting, Table of Symbols): Omit mentions of %lex-param and
12364 %parse-param from the documentation for now.
12365
1c5fe69d
PE
123662002-12-15 Paul Eggert <eggert@twinsun.com>
12367
12368 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
12369 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
12370 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
12371 disagreed with the Bison documentation. Bug
12372 reported by Andrew Walrond.
d600ee67 12373
1c5fe69d
PE
12374 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
12375 as the caller now does that.
12376 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
12377 (YYEMPTY): Parenthesize right hand side, since others use it.
12378 (yyparse): Don't assume that our generated code is the only code
12379 that sets yychar.
12380
d1de5372
PE
123812002-12-13 Paul Eggert <eggert@twinsun.com>
12382
12383 Version 1.75d.
12384
12385 POSIX requires a "yacc" command.
12386 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
12387 (MOSTLYCLEANFILES): Add yacc.
12388 (yacc): New rule.
1c5fe69d 12389 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
12390 as an alias for bison y.
12391
12392 * po/LINGUAS: Add da.
d600ee67 12393
d1de5372
PE
12394 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
12395 problem with latest <getopt.h>.
12396 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
12397
12398 * doc/fdl.texi: Upgrade to 1.2.
12399 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
12400 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
12401 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
12402 gnulib.
12403 * config/install-sh: Sync with autotools.
12404
12405 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 12406 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
12407 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
12408 locations are requested.
12409 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
12410 locations are requested.
12411
d0f3fe23
PE
124122002-12-12 Paul Eggert <eggert@twinsun.com>
12413
12414 Remove unportable casts and storage allocation tricks.
12415 While we're at it, remove almost all casts, since they
12416 usually aren't needed and are a sign of trouble.
12417
12418 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
12419
12420 * src/derives.c (derives_compute): Do not subtract NTOKENS from
12421 the pointer DSET returned by malloc; this isn't portable.
12422 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
12423 Similarly for DERIVES.
12424 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
12425 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
12426 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
12427
12428 * src/derives.c (derives_compute): Do not bother invoking
12429 int_of_rule_number, since rule numbers are integers.
12430
12431 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
12432 rather than XMALLOC (char, N).
12433
12434 * src/files.c (filename_split): Rewrite to avoid cast.
12435
12436 * src/gram.h (symbol_number_as_item_number,
12437 item_number_as_symbol_number, rule_number_as_item_number,
12438 item_number_as_rule_number):
12439 Now inline functions rather than macros, to avoid casts.
12440 * src/state.h (state_number_as_int): Likewise.
12441 * src/tables.c (state_number_to_vector_number,
12442 symbol_number_to_vector_number): Likewise.
12443
12444 * src/gram.h (int_of_rule_number): Remove; no longer used.
12445
12446 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
12447 since the resulting storage is always stored into.
12448
12449 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
12450 where it's needed.
12451
12452 * src/muscle_tab.c (muscle_m4_output):
12453 Now inline. Return bool, not int.
12454 * src/state.c (state_compare): Likewise.
12455 * src/symtab.c (symbol_check_defined,
12456 symbol_check_alias_consistency, symbol_pack, symbol_translation,
12457 hash_compare_symbol, hash_symbol):
12458 Likewise.
12459 * src/uniqstr.c (uniqstr_print): Likewise.
12460 * src/muscle_tab.c (muscle_m4_output_processor):
12461 New function, to avoid casts.
12462 * src/state.c (state_comparator, stage_hasher): Likewise.
12463 * src/symtab.c (symbol_check_defined_processor,
12464 symbol_check_alias_consistency_processor, symbol_pack_processor,
12465 symbol_translation_processor, hash_symbol_comparator,
12466 hash_symbol_hasher): Likewise.
12467 * src/uniqstr.c (uniqstr_print_processor): Likewise.
12468 * src/muscle_tab.c (muscles_m4_output):
12469 Use new functions instead of casting old functions unportably.
12470 * src/state.c (state_hash_new): Likewise.
12471 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
12472 symbols_token_translations_init):
12473 Likewise.
12474 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
12475
12476 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
12477 var instead of casting to long, to avoid casts.
12478 (prepare_states): Use MALLOC rather than alloca, so that we don't
12479 have to worry about alloca.
12480 * src/state.c (state_hash_lookup): Likewise.
12481
12482 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
12483 local var instead of casting to unsigned char, to avoid casts.
12484
12485 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
12486 STATE_ALLOC): Remove.
12487 (transitions_new, errs_new, reductions_new, state_new): Use malloc
12488 rather than calloc, and use offsetof to avoid allocating slightly
12489 too much storage.
12490 (state_new): Initialize all members.
12491
12492 * src/state.c (state_hash): Use unsigned accumulator, not signed.
12493
12494 * src/symtab.c (symbol_free): Remove; unused.
12495 (symbol_get): Remove cast in lhs of assignment.
12496 (symbols_do): Now static. Accept generic arguments, not
12497 hashing-related ones.
12498
12499 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
12500 (symbol_processor): Remove.
12501 (symbols_do): Remove decl; now static.
12502
12503 * src/system.h (alloca): Remove; decl no longer needed.
12504 (<stddef.h>): Include, for offsetof.
12505 (<inttypes.>, <stdint.h>): Include if available.
12506 (uintptr_t): New type, if system lacks it.
12507 (CALLOC, MALLOC, REALLOC): New macros.
12508 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
12509 new macros.
12510
12511 * src/tables.c (table_size): Now int, to pacify GCC.
12512 (table_grow, table_ninf_remap): Use signed table size.
12513 (save_row): Don't bother initializing locals when not needed.
12514 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
12515 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
12516
12517 * src/vcg.h: Correct misspellings.
12518
12519 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
12520
12521
12522 * src/getargs.c (getargs): Don't assume EOF == -1.
12523
26b4a969
PE
125242002-12-09 Paul Eggert <eggert@twinsun.com>
12525
12526 Change identifier spellings to avoid collisions with names
12527 that are reserved by POSIX.
12528
12529 Don't use names ending in _t, since POSIX reserves them.
12530 For consistency, remove _e and _s endings -- they're weren't
12531 needed to remove ambiguity. All uses changed.
12532 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
12533 turn was just renamed from struniq_t.
12534 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
12535 which in turn was just renamed from struniq_processor_t.
12536 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
12537 in turn was renamed from hash_compare_struniq_t.
12538 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
12539 (state_list): Renamed from state_list_t.
12540 * src/assoc.h (assoc): Renamed from assoc_t.
12541 * src/conflicts.c (enum conflict_resolution): Renamed from
12542 enum conflict_resolution_e.
12543 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
12544 (rule_list): Renamed from rule_list_t.
12545 * src/getargs.h (enum trace): Renamed from enum trace_e.
12546 (enum report): Renamed from enum report_e.
12547 * src/gram.h (item_number): Renamed from item_number_t.
12548 (rule_number): Renamed from rule_number_t.
12549 (struct rule_s): Remove the "rule_s" part; not used.
12550 (rule): Renamed from rule_t.
12551 (rule_filter): Renamed from rule_filter_t.
12552 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
12553 (goto_list): Renamed from goto_list_t.
12554 * src/lalr.h (goto_number): Renamed from goto_number_t.
12555 * src/location.h (location): Renamed from location_t.
12556 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
12557 and moved here from:
12558 * src/muscle_tab.h (muscle_entry_t): here.
12559 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
12560 (rule_list): Renamed from rule_list_t.
12561 * src/print_graph.c (static_graph): Renamed from graph.
12562 * src/reader.h (braced_code): Renamed from braced_code_t.
12563 Remove brace_code_e tag.
12564 * src/relation.h (relation_node): Renamed from relation_node_t.
12565 (relation_nodes): Renamed from relation_nodes_t.
12566 (relation): Renamed from relation_t.
12567 * src/state.h (state_number): Renamed from state_number_t.
12568 (struct state): Renamed from struct state_s.
12569 (state): Renamed from state_t.
12570 (transitions): Renamed from transitions_t. Unused (and
12571 misspelled) transtion_s tag removed.
12572 (errs): Renamed from errs_t. Unused errs_s tag removed.
12573 (reductions): Renamed from reductions_t. Unused tag
12574 reductions_s removed.
12575 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
12576 (struct symbol_list): Renamed from struct symbol_list_s.
12577 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
12578 (struct symbol): Renamed from struct symbol_s.
12579 (symbol): Renamed from symbol_t.
12580 * src/tables.c (vector_number): Renamed from vector_number_t.
12581 (action_number): Renamed from action_t.
12582 * src/tables.h (base_number): Renamed from base_t.
12583 * src/vcg.h (enum color): Renamed from enum color_e.
12584 (enum textmode): Renamed from enum textmode_e.
12585 (enum shape): Renamed from enum shape_e.
12586 (struct colorentry): Renamed from struct colorentry_s.
12587 (struct classname): Renamed from struct classname_s.
12588 (struct infoname): Renamed from struct infoname_s.
12589 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
12590 (enum decision): Renamed from enum decision_e.
12591 (enum orientation): Renamed from enum orientation_e.
12592 (enum alignment): Renamed from enum alignment_e.
12593 (enum arrow_mode): Renamed from enum arrow_mode_e.
12594 (enum crossing_type): Renamed from enum crossing_type_e.
12595 (enum view): Renamed from enum view_e.
12596 (struct node): Renamed from struct node_s.
12597 (node): Renamed from node_t.
12598 (enum linestyle): Renamed from enum linestyle_e.
12599 (enum arrowstyle): Renamed from enum arrowstyle_e.
12600 (struct edge): Renamed from struct edge.
12601 (edge): Renamed from edge_t.
12602 (struct graph): Renamed from struct graph_s.
12603 (graph): Renamed from graph_t.
12604 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
12605 Rename value_t -> value.
12606 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
12607 value_t_as_yystype -> value_as_yystype.
12608
12609 Don't include <errno.h> in the mainstream code, since it
12610 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
12611 * lib/get-errno.c, lib/get-errno.h: New files.
12612 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
12613 get-errno.c.
12614 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
12615 * src/output.c (output_skeleton): Likewise.
12616 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
12617 instead of errno.
12618 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
12619 Likewise.
12620 (handle_action_dollar, handle_action_at): Likewise.
12621 * src/system.h: Do not include <errno.h>.
12622 (TAB_EXT): Renamed from EXT_TAB.
12623 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
12624
12625 Avoid str[a-z]*, since <string.h> reserves that name space.
12626 Change all instances of "struniq" in names to "uniqstr", and
12627 likewise for "STRUNIQ" and "UNIQSTR".
12628 * src/uniqstr.c: Renamed from src/struniq.c.
12629 * src/uniqstr.h: Renamed from src/struniq.h.
12630 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
12631 * src/files.c (strsuffix): Remove; unused.
12632 (concat2): Renamed from stringappend. Now static.
12633 * src/files.h (strsuffix, stringappend): Remove; unused.
12634 * src/parse-gram.y (<chars>): Renamed from <string>.
12635 (<uniqstr>): Renamed from <struniq>.
12636 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
12637 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
12638 (struct graph_s.expand): Renamed from struct graph_s.stretch.
12639 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
12640 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
12641 (N_EXPAND): Renamed from N_STRETCH.
12642
12643 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
12644 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
12645 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
12646 Remove; unused.
12647 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
12648 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
12649 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
12650 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
12651 (BASE_MAXIMUM): Renamed from BASE_MAX.
12652 (BASE_MINIMUM): Renamed from BASE_MIN.
12653 (ACTION_MAX): Remove; unused.
12654 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
12655 Unnecessary casts removed from above defines.
12656
12657
12658 Fix misspelling in names.
12659 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
12660 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
12661 G_NODE_ALIGNEMENT.
12662
12663
12664 * lib/timevar.c (timevar_report): Renamed from time_report,
12665 for consistency with other names.
12666 * lib/timevar.h (timevar_report): New decl.
12667 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
12668
12669
12670 Sort include-file uses.
12671
12672 Reorder all include files under src to be in the order "system.h".
12673 then the ../lib include files in angle brackets (alphabetized),
12674 then the . include files in double-quotes (alphabetized). Fix
12675 dependency breakages encountered in this process, as follows:
12676 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
12677 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
12678 * src/state.h: Include "symtab.h".
12679
996b1c7e
PE
126802002-12-08 Paul Eggert <eggert@twinsun.com>
12681
12682 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
12683 since this causes problems when __file__ contains character
12684 sequences like "@" that are treated specially by src/scan-skel.l.
12685 Instead, just use the file's basename. This fixes the bug
12686 reported by Martin Mokrejs in
161a71f3 12687 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 12688
e19c4e5d
PE
126892002-12-06 Paul Eggert <eggert@twinsun.com>
12690
12691 Add support for rules that do not have trailing semicolons, as
12692 POSIX requires. Improve the quality of locations in Bison
12693 diagnostics.
26b4a969 12694
e19c4e5d
PE
12695 * src/location.c: Include <quotearg.h>.
12696 (empty_location): Now const.
12697 (location_print): New function. Follow the recommendation of the
12698 GNU Coding Standards for locations that span file boundaries.
12699 * src/location.h: Do not include <quotearg.h>; no longer needed.
12700 (boundary): New type.
12701 (location_t): Use it. This allows locations to span file boundaries.
12702 All member uses changed: file -> start.file or end.file (as needed),
12703 first_line -> start.line, first_column -> start.column,
12704 last_line -> end.line, last_column -> end.column.
12705 (equal_boundaries): New function.
12706 (LOCATION_RESET, LOCATION_STEP): Remove.
12707 (LOCATION_PRINT): Remove. All callers changed to use location_print.
12708 (empty_location): Now const.
12709 (location_print): New decl.
12710 * src/parse-gram.y (lloc_default): New function, which handles
12711 empty locations more accurately.
12712 (YYLLOC_DEFAULT): Use it.
12713 (%token COLON): Remove.
12714 (%token ID_COLON): New token.
26b4a969 12715 (rules): Use it.
e19c4e5d
PE
12716 (declarations, rules): Remove trailing semicolon.
12717 (declaration, rules_or_grammar_declaration):
12718 Allow empty (";") declaration.
12719 (symbol_def): Remove empty actions; no longer needed.
12720 (rules_or_grammar_declaration): Remove trailing semicolon.
12721 (semi_colon.opt): Remove.
12722 * src/reader.h: Include location.h.
12723 (scanner_cursor): New decl.
12724 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
12725 rolling our own.
12726 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
12727 of *loc.
12728 (STEP): Remove. No longer needed, now that adjust_location does
12729 the work. All uses removed.
12730 (scanner_cursor): New var.
12731 (adjust_location): Renamed from extend_location. It now sets
12732 *loc and adjusts the scanner cursor. All uses changed.
12733 Don't bother testing for CR.
12734 (handle_syncline): Remove location arg; now updates scanner cursor.
12735 All callers changed.
12736 (unexpected_end_of_file): Now accepts start boundary of token or
12737 comment, not location. All callers changed. Update scanner cursor,
12738 not the location.
12739 (SC_AFTER_IDENTIFIER): New state.
12740 (context_state): Renamed from c_context. All uses changed.
12741 (id_loc, code_start, token_start): New local vars.
12742 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
12743 processing of Yacc white space and equivalents here.
12744 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
12745 instead of returning ID immediately, since we need to search for
12746 a subsequent colon.
12747 (<INITIAL>"'", "\""): Save token_start.
12748 (<INITIAL>"%{", "{", "%%"): Save code_start.
12749 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
12750 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
12751 BEGIN context_state at end, not INITIAL.
12752 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
12753 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
12754 Return correct token start.
12755 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
12756 the start of a character, string or multiline comment is found.
12757 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
12758 Reduction): Adjust reported locations to match the more-precise
12759 results now expected.
12760 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
12761 * tests/reduce.at (Useless Rules, Reduced Automaton,
12762 Underivable Rules): Likewise.
12763 * tests/regression.at (Invalid inputs): No longer `expecting ";"
12764 or "|"' now that so many other tokens are allowed by the new grammar.
12765
12766 * src/complain.h (current_file): Remove duplicate decl;
12767 current_file is now owned by files.h.
12768 * src/complain.c, src/scan-gram.l: Include files.h.
12769
127702002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 12771
e19c4e5d
PE
12772 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
12773 promotes to int; it might be unsigned int.
12774 * data/yacc.c (yy_reduce_print): Likewise.
12775
12776 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
12777 be #defined in the prologue, not in the Bison declarations.
12778 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 12779
b64755e3
PE
127802002-12-02 Paul Eggert <eggert@twinsun.com>
12781
12782 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
12783 * lib/strtoul.c: New file, from gnulib.
12784 This fixes a porting bug reported by Peter Klein in
161a71f3 12785 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 12786
6e746484
PE
127872002-11-30 Paul Eggert <eggert@twinsun.com>
12788
b64755e3
PE
12789 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
12790 and put only a forward declaration in the prologue. This is for
12791 consistency with the other scanner helper functions.
12792
6ba55592
PE
12793 Type clashes now generate warnings, not errors, since it
12794 appears that POSIX may allow some grammars with type clashes.
12795 * src/reader.c (grammar_current_rule_check): Warn about
12796 type clashes instead of complaining.
12797 * tests/input.at (Type Clashes): Expect warnings, not complaints.
12798
6e746484
PE
12799 Add Yacc library, since POSIX requires it.
12800 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
12801 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
12802 * lib/main.c, lib/yyerror.c: New files.
12803
12804 gram_error can be static; it need not be extern.
12805 * src/reader.h (gram_error): Remove decl.
12806 * src/parse-gram.y (gram_error): Now static. Add static decl.
12807 (print_token_value): Omit parameter names from forward decl,
12808 for consistency.
12809
88510f9c
PE
128102002-11-29 Paul Eggert <eggert@twinsun.com>
12811
6e746484
PE
12812 * doc/bison.texinfo: Emphasize that yylex and yyerror must
12813 be declared before being used. E.g., one should typically
12814 declare them in the prologue. Use GNU coding style in examples.
12815 Put "const" consistently after the type it modifies. Mention
12816 that C99 supports "inline". Mention that yyerror traditionally
12817 returns "int".
12818
88510f9c
PE
12819 %parse-param and %lex-param now take just one argument, the
12820 declaration; the argument name is deduced from the declaration.
12821
12822 * doc/bison.texinfo (Parser Function, Pure Calling, Error
12823 Reporting, Table of Symbols): Document this.
12824 * src/parse-gram.y (add_param): New function.
12825 (COMMA): Remove.
12826 (declaration): Implement new rule for %parse-param and %lex-param.
12827 * src/scan-gram.l: "," now elicits a warning, rather than being
12828 a token; this is more compatible with byacc.
12829 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
12830
bb92250c
PE
128312002-11-27 Paul Eggert <eggert@twinsun.com>
12832
12833 Rename identifiers to avoid real and potential collisions.
12834
12835 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
12836 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 12837 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
12838 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12839 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
12840 * src/parse-gram.y (print_token_value): Renamed from yyprint.
12841 All uses changed.
12842 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
12843 The name "yycontrol" violates the name space rules, and this stuff
12844 wasn't being used anyway.
12845 (input): Remove action; this stuff wasn't being used.
12846 (gram_error): Rename local variable yylloc -> loc.
12847 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
12848 (YY_DECL): Don't use "yy" at start of local variables.
12849 All uses changed, e.g., yylloc -> loc.
12850 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
12851 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
12852 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
12853 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
12854
12855 * src/parse-gram.y (gram_error): loc is now const *.
12856 * src/reader.h (gram_error): Likewise.
12857
3af4feb2
PE
128582002-11-24 Paul Eggert <eggert@twinsun.com>
12859
12860 Version 1.75c.
12861
12862 * tests/actions.at (Actions after errors): Use an output format
12863 more similar to that of the Printers and Destructors test.
12864 Test the position of the ';' token too.
12865 (Printers and Destructors): Likewise.
12866 (Printers and Destructors: %glr-parser): Remove for now, to avoid
12867 unnecessarily alarming people when the test fails.
12868
12869 * data/yacc.c (yyerrlab1): Move this label down, so that the
12870 parser does not discard the lookahead token if the user code
12871 invokes YYERROR. This change is required for POSIX conformance.
12872
12873 * lib/error.c: Sync with gnulib.
12874
128752002-11-22 Paul Eggert <eggert@twinsun.com>
12876
12877 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
12878 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
12879 * lib/xmalloc.c: Likewise.
26b4a969 12880
58004308
PE
128812002-11-20 Paul Eggert <eggert@twinsun.com>
12882
12883 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
12884
128852002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 12886
58004308
PE
12887 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
12888 should use `if (! x) abort ();' rather than `assert (x);', and
12889 anyway it's one less thing to worry about configuring.
12890
12891 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
12892 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
12893 and replace all instances of assert with abort.
12894 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
12895 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
12896
12897 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
12898 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
12899 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
12900 hash_find_entry, hash_rehash, hash_insert): Likewise.
12901 * src/conflicts.c (resolve_sr_conflict): Likewise.
12902 * src/lalr.c (set_goto_map, map_goto): Likewise.
12903 * src/nullable.c (nullable_compute): Likewise.
12904 * src/output.c (prepare_rules, token_definitions_output): Likewise.
12905 * src/reader.c (packgram, reader): Likewise.
12906 * src/state.c (state_new, state_free, state_transitions_set,
12907 state_reduction_find): Likewise.
12908 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
12909 symbol_pack): Likewise.
12910 * src/tables.c (conflict_row, pack_vector): Likewise.
12911 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
12912 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
12913 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
12914 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
12915
12916 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
12917 (ARGMATCH_CONSTRAINT): New macro.
12918 (ARGMATCH_ASSERT): Use it.
12919
12920 * src/system.h (verify): New macro.
12921 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
12922 rather than assert.
12923 * src/tables.c (tables_generate): Likewise.
12924
12925 * src/struniq.c (struniq_assert): Now returns void, and aborts
12926 if the assertion is false.
12927 (struniq_assert_p): Remove.
12928 * src/struniq.h: Likewise.
12929
76ae8198
PE
129302002-11-18 Paul Eggert <eggert@twinsun.com>
12931
12932 * data/glr.c (yygetLRActions): Replace `yyindex' with
12933 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
12934 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 12935 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 12936
d3c4e709
AD
129372002-11-18 Akim Demaille <akim@epita.fr>
12938
12939 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
12940 space.
12941 From Tim Van Holder.
12942
8d8a7238
PE
129432002-11-17 Paul Eggert <eggert@twinsun.com>
12944
12945 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
12946 to "SyntaxError" for consistency with my 2002-11-15 change.
12947
12948 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
12949 not define to {}, since this breaks the common use of `YYDPRINTF
12950 ((...));' if a single statement is desired (e.g. before `else').
12951 Work around GCC warnings by surrounding corresponding calls with
12952 {} if needed.
12953 (yyhasResolvedValue): Remove unused function.
12954 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
12955 loop body.
12956 (yyreportSyntaxError): Renamed from yyreportParseError.
12957 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
12958 All uses changed.
12959 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
12960 extern when possible. Remove unused initializations.
12961
b0937b22
AD
129622002-11-16 Akim Demaille <akim@epita.fr>
12963
12964 Augment the similarity between GLR and LALR traces.
12965
12966 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
12967 (YY_REDUCE_PRINT): New.
12968 (yyparse): Use them.
12969 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
12970 YYDPRINT here.
12971 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
12972 state reached after the reduction/recovery, since...
12973 (yyparse, yyprocessOneStack): Report the state we are entering in.
12974
c5e3e510
AD
129752002-11-16 Akim Demaille <akim@epita.fr>
12976
12977 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
12978 Add support for --trace=skeleton.
12979 * src/scan-skel.l: %option debug.
12980 Scan strings of non-@ or \n instead of character by character.
12981 (scan_skel): Handle trace_skeleton.
12982 (QPUTS): New.
12983 (@output_parser_name@, @output_header_name@): ``Restore'' their
12984 support (used to be M4 macros).
12985 * data/yacc.c: Quote larger chunks, a la glr.c.
12986 * data/lalr1.cc: Likewise.
12987 The header guards are no longer available, so use some other
12988 string than `YYLSP_NEEDED'.
12989
4c6cc1db
AD
129902002-11-16 Akim Demaille <akim@epita.fr>
12991
12992 Make the ``Printers and Destructors'' test more verbose, taking
12993 `yacc.c''s behavior as (possibly wrong) reference.
12994
12995 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
12996 instead of fprint on stdout.
12997 Set and report the last_line of the symbols.
12998 Consistently display values and locations.
12999
6d9e8019
PE
130002002-11-16 Paul Eggert <eggert@twinsun.com>
13001
13002 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
13003
6e649e65
PE
130042002-11-15 Paul Eggert <eggert@twinsun.com>
13005
b25d88f6
PE
13006 * tests/actions.at (Actions after errors): New test case.
13007
6e649e65
PE
13008 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
13009 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
13010 tests/action.at, tests/calc.at, tests/conflicts.at,
13011 tests/cxx-type.at, tests/regression.at:
13012 "parse error" -> "syntax error" for POSIX compatibility.
13013 "parsing stack overflow..." -> "parser stack overflow" so
13014 that code matches Bison documentation.
13015
0f39aab9
AD
130162002-11-15 Akim Demaille <akim@epita.fr>
13017
13018 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
13019 take two BRACED_CODE, not two string_content.
13020 Free the scanner's obstack when we are done.
13021 (code_content): New.
13022 * tests/calc.at: Adjust.
13023 * doc/bison.texinfo: Adjust.
13024 Also, make sure to include the `,' for these declarations.
13025
761c1926
AD
130262002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
13027
13028 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
13029 definition; avoids potential autoreconf problems.
13030
b0f98b10
AD
130312002-11-15 Akim Demaille <akim@epita.fr>
13032
13033 Always check the value returned by yyparse.
13034
13035 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
13036 returned by yyparse.
13037 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
13038 Adjust calls.
13039 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
13040 returned by yyparse.
13041
970785f1
PH
130422002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13043
13044 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
13045 on input.at test.
13046
8fcc7db1
PE
130472002-11-14 Paul Eggert <eggert@twinsun.com>
13048
7ec1b48e
PE
13049 * src/output.c (output_skeleton): Call xfopen instead of
13050 duplicating xfopen's body.
13051
cfff7583 13052 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 13053 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 13054
8fcc7db1
PE
13055 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
13056 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
13057 Group compiler. Instead, use "$CC -E bar.c". Include the .h
13058 file twice in the grammar, as an extra check.
13059
13060 * tests/input.at (Torturing the Scanner): Surround the
13061 backslash-newline tests with "#if 0", to make it less likely that
13062 we'll run into compiler bugs. Bring back solitary \ inside
13063 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 13064 test backslash-newline in C character constant.
8fcc7db1 13065
4e8d992c
AD
130662002-11-14 Akim Demaille <akim@epita.fr>
13067
13068 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
13069 status of the compiler.
f32b346d 13070 Calling `exit 1' is no longer needed.
4e8d992c
AD
13071 Reported by Nelson H. F. Beebe.
13072
9501dc6e
AD
130732002-11-14 Akim Demaille <akim@epita.fr>
13074
13075 * tests/atlocal.in (CPPFLAGS): We have config.h.
13076 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
13077 New.
13078 * tests/actions.at, tests/calc.at, tests/conflicts.at,
13079 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
13080 * tests/regression.at, tests/torture.at: Use them for all the
13081 grammars that are to be compiled.
13082 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
13083 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
13084 * doc/bison.texinfo (GLR Parsers): Document `inline'.
13085
18b519c0
AD
130862002-11-14 Akim Demaille <akim@epita.fr>
13087
13088 * doc/bison.texinfo: Various formatting changes (alignments in
13089 samples, additional @group/@end group, GCS in samples.
13090 Use @deffn instead of simple @table to define the directives,
13091 macros, variables etc.
13092
9a86cdb9
PE
130932002-11-13 Paul Eggert <eggert@twinsun.com>
13094
daa33def 13095 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 13096 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 13097
daa33def 13098 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 13099 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
13100 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
13101 * tests/headers.at (export YYLTYPE): Likewise.
13102
13103 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 13104 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 13105
9a86cdb9
PE
13106 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
13107 comments, since they're not portable. Use GNU coding style.
13108
9c1e26bd
AD
131092002-11-13 Akim Demaille <akim@epita.fr>
13110
13111 * data/yacc.c: Leave bigger chunks of quoted text.
13112 (YYDSYMPRINTF): New.
13113 Use it to report symbol activities.
13114 * data/glr.c (YYDSYMPRINTF): New.
13115 Use it.
13116
87f721cc
PE
131172002-11-12 Paul Eggert <eggert@twinsun.com>
13118
13119 Version 1.75b.
13120
13121 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
13122 (yyglrReduce): Return yyok, not 0.
13123 This should avoid the enumerated-type warnings reported
464c6927 13124 by Nelson H. F. Beebe in
161a71f3 13125 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
13126
13127 * lib/bbitset.h (BITSET_INLINE): Remove.
13128 * lib/bitset.h [! BITSET_INLINE]: Remove.
13129 (bitset_set, bitset_reset, bitset_test): Rename local vars
13130 to avoid shadowing warnings by GCC.
13131
13132 * data/glr.c (inline): Remove #define. It's the user's
13133 responsibility to #define it away, just like 'const'.
464c6927 13134 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 13135 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 13136
87f721cc
PE
13137 * Makefile.maint (po-check): Scan .l and .y files instead of the
13138 .c and the .h files that they generate. This fixes the bug
13139 reported by Tim Van Holder in:
161a71f3 13140 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
13141 Look for N_ as well as for _. Try to avoid matching #define for
13142 N_ and _.
13143 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
13144 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
13145 * src/scan-gram.l: Revamp regular expressions so that " and '
13146 do not confuse xgettext.
13147
13148 * src/struniq.h (struniq_new): Do not declare the return type
13149 to be 'const'; this violates the C standard.
13150 * src/struniq.c (struniq_new): Likewise.
13151
be14ade5
AD
131522002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
13153
13154 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
13155 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
13156 linker.
13157
05291fbc
AD
131582002-11-12 Akim Demaille <akim@epita.fr>
13159
13160 * Makefile.maint: Sync with Autoconf:
13161 (local_updates): New.
13162
1f5fd52e
AD
131632002-11-12 Akim Demaille <akim@epita.fr>
13164
13165 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
13166
283f1e64
AD
131672002-11-12 Akim Demaille <akim@epita.fr>
13168
13169 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
13170 locations.
13171
886b69d1
AD
131722002-11-12 Akim Demaille <akim@epita.fr>
13173
13174 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
13175 not yyvalue.
13176
3df37415
AD
131772002-11-12 Akim Demaille <akim@epita.fr>
13178
13179 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
13180 Use it to test the GLR parser.
13181
7bd6c77e
AD
131822002-11-12 Akim Demaille <akim@epita.fr>
13183
13184 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
13185 defines it.
13186 * data/glr.c (yystos): New.
13187 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
13188 (YYDSYMPRINT): New.
13189 (yyval): Don't define it, it is handled via M4.
13190 (yyrecoverParseError): Free verbosely the discarded symbols.
13191 * data/yacc.c (yysymprint): Remove, rather...
13192 (b4_yysymprint_generate): invoke.
13193 * data/c.m4 (b4_yysymprint_generate): New.
13194 Accept pointers as arguments, as opposed to the version from
13195 yacc.c.
13196 (b4_yydestruct_generate): Likewise.
13197 * tests/cations.at (Printers and Destructors): Use Bison directives
13198 instead of CPP macros.
13199 Don't rely on internal details.
13200
b0400cc6
AD
132012002-11-12 Akim Demaille <akim@epita.fr>
13202
13203 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
13204 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
13205 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
13206 it against YYEMPTY and so forth), work on yytoken (i.e., set
13207 it to YYEMPTY etc.).
13208 (yydestruct): Replace with a b4_yydestruct_generate invocation.
13209 (b4_symbol_actions): Remove.
13210 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
13211 for 0, end-of-input.
13212
72f889cc
AD
132132002-11-12 Akim Demaille <akim@epita.fr>
13214
13215 * doc/bison.texinfo (Destructor Decl): New.
13216
b1ae9233
AD
132172002-11-12 Akim Demaille <akim@epita.fr>
13218
13219 * src/tables.c (tables_generate): Use free for pointers that
13220 cannot be NULL, not XFREE.
13221 (pack_vector): Use assert, not fatal, for bound violations.
13222 * src/state.c (state_new): Likewise.
13223 * src/reader.c (reader): Likewise.
13224 * src/lalr.c (set_goto_map): Likewise.
72f889cc 13225 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
13226 the file name.
13227
7ec2d4cd
AD
132282002-11-12 Akim Demaille <akim@epita.fr>
13229
13230 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
13231 Restore.
13232 * src/scan-gram.l (last_string): Is global to the file, not to
13233 yylex.
13234 * src/parse-gram.y (input): Don't append the epilogue here,
13235 (epilogue.opt): do it here, and free the scanner's obstack.
13236 * src/reader.c (epilogue_set): Rename as...
13237 (epilogue_augment): this.
13238 * data/c.m4 (b4_epilogue): Defaults to empty.
13239
573a6cd3
AD
132402002-11-12 Akim Demaille <akim@epita.fr>
13241
13242 * src/getargs.c (long_options): Remove duplicates.
13243 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
13244 Remove.
13245 * doc/bison.rnh: Remove.
13246 * doc/bison.texinfo (VMS Invocation): Remove.
13247
95612cfa
AD
132482002-11-12 Akim Demaille <akim@epita.fr>
13249
13250 * src/struniq.h, src/struniq.c (struniq_t): Is const.
13251 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
13252
13253 Use struniq for symbols.
13254
13255 * src/symtab.h (symbol_t): The tag member is a struniq.
13256 (symbol_type_set): Adjust.
13257 * src/symtab.c (symbol_new): Takes a struniq.
13258 (symbol_free): Don't free the tag member.
13259 (hash_compare_symbol_t, hash_symbol_t): Rename as...
13260 (hash_compare_symbol, hash_symbol): these.
13261 Use the fact that tags as struniqs.
13262 (symbol_get): Use struniq_new.
13263 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
13264 Returns a strniq.
13265 * src/reader.h (merger_list, grammar_currentmerge_set): The name
13266 and type members are struniqs.
13267 * src/reader.c (get_merge_function)
13268 (grammar_current_rule_merge_set): Adjust.
13269 (TYPE, current_type): Are struniq.
13270
13271 Use struniq for file names.
13272
13273 * src/files.h, src/files.c (infile): Split into...
13274 (grammar_file, current_file): these.
13275 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
13276 * src/reduce.c (reduce_print): Likewise.
13277 * src/getargs.c (getargs): Likewise.
13278 * src/complain.h, src/complain.c: Likewise.
13279 * src/main.c (main): Call struniqs_new early enough to use it for
13280 file names.
13281 Don't free the input file name.
13282
3e6656f9
AD
132832002-11-12 Akim Demaille <akim@epita.fr>
13284
13285 * src/symtab.c (symbol_free): Remove dead deactivated code:
13286 type_name are properly removed.
13287 Don't use XFREE to free items that cannot be NULL.
13288 * src/struniq.h, src/struniq.c: New.
13289 * src/main.c (main): Initialize/free struniqs.
13290 * src/parse-gram.y (%union): Add astruniq member.
13291 (yyprint): Adjust.
13292 * src/scan-gram.l (<{tag}>): Return a struniq.
13293 Free the obstack bit that used to store it.
13294 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
13295
7672019c
PE
132962002-11-11 Paul Eggert <eggert@twinsun.com>
13297
13298 Revamp to fix many (but not all) of the C- and M4-related quoting
13299 problems. Among other things, this fixes the Bison bug reported
13300 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 13301 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
13302
13303 Use new @ escapes consistently. Represent brackets with @{ and @}
13304 rather than @<:@ and @:>@, since this works a bit better with dumb
13305 editors like vi. Represent @ with @@, since @ is now consistently
13306 an escape. Use @oline@ and @ofile@ rather than __oline__ and
13307 __ofile__, to avoid unexpected expansions. Similarly, use @output
13308 rather than #output.
13309
13310 * data/c.m4 (b4_copyright): Omit file name from comment, since
13311 the file name could contain "*/".
13312 (b4_synclines_flag): Don't quote the 2nd argument; it should already
13313 be quoted. All uses changed.
13314
13315 * data/glr.c: Use new @ escapes consistently.
13316 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
13317 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
13318 Remove, since they couldn't handle arbitrary characters in file
13319 names.
13320 * data/lalr1.cc: Likewise.
13321 * data/yacc.c: Likewise.
13322
13323 * src/files.c (output_infix): Remove; all uses removed.
13324 * src/files.h: Likewise.
13325
13326 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
13327 mishandled funny characters in file names, and anyway it isn't
13328 needed any more.
13329 * data/yacc.c: Likewise.
13330 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
13331
13332 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
13333 * data/yacc.c: Likewise.
13334
13335 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
13336 strings now.
13337 (muscle_init): Quote filename as a C string.
13338 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
13339 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
13340 * src/output.c (escaped_file_name_output): New function.
13341 (prepare_symbols): Quote tokens for M4.
13342 (prepare): Don't insert output_infix, output_prefix,
13343 output_parser_name, output_header_name; this is now down by scan-skel.
13344 Insert skeleton as a C string.
13345
13346 * src/output.c (user_actions_output, symbol_destructors_output,
13347 symbol_printers_output): Quote filenames for C and M4.
13348 * src/reader.c (prologue_augment, epilogue_set): Likewise.
13349
13350 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
13351 escapes other than \\ and \'; this simplifies the code.
13352 (<SC_STRING>): Likewise, for \\ and \".
13353 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
13354 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
13355 Use new escapes @{ and @} for [ and ].
13356
13357 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
13358 them with auto vars.
13359 Switch to new escape scheme, where @ is the escape character uniformly.
13360 Abort if a stray escape character is found. Avoid unbounded input
13361 buffer when parsing non-escaped text.
13362
13363 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
13364 __oline__, #output, $@, and @{ do not have unintended meanings.
13365
acea4f3b
PE
133662002-11-09 Paul Eggert <eggert@twinsun.com>
13367
13368 Fix the test failure due to GCC warnings described in
161a71f3 13369 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
13370 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
13371 evaluate to 0 if it's impossible for NINF to be in the respective
13372 table.
13373 (yygetLRActions, yyrecoverParseError): Use them.
13374
13375 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
13376 counted in the token inserted at end of file. Now takes
13377 location_t *, not location_t, so that the location can be
13378 adjusted. All uses changed.
13379
13380 * tests/regression.at (Invalid inputs): Adjust wording in
13381 diagnostic to match the new behavior.
13382
13383 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
13384 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
13385 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
13386 abort ();'. This reduces the runtime of the "Many lookaheads"
13387 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
13388 GCC 3.2.
13389
20ef1ad5
PE
133902002-11-07 Paul Eggert <eggert@twinsun.com>
13391
13392 * src/parse-gram.y (CHARACTER): Remove unused token.
13393 All uses removed.
13394
13395 * src/scan-gram.l: Remove stack option. We no longer use the
13396 stack, since the stack was never deeper than 1; instead, use the
13397 new auto var c_context to record the stacked value.
13398
13399 Remove nounput option. At an unexpected end of file, we now unput
13400 the minimal input necessary to end cleanly; this simplifies the
13401 code.
13402
13403 Avoid unbounded token sizes where this is easy.
13404
13405 (unexpected_end_of_file): New function.
13406 Use it to systematize the error message on unexpected EOF.
13407 (last-string): Now auto, not static.
13408 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
13409 (scanner_last_string_free): Remove; not used.
13410 (percent_percent_count): Move decl to just before use.
13411 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
13412 not the (never otherwised-used) CHARACTER.
13413
93724f13
AD
134142002-11-07 Akim Demaille <akim@epita.fr>
13415
13416 Let yyerror always receive the msg as last argument, so that
13417 yyerror can be variadic.
13418
13419 * data/yacc.c (b4_yyerror_args): New.
13420 Use it when calling yyerror.
13421 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
13422 Use it when calling yyerror.
13423 * doc/bison.texinfo (Error Reporting): Adjust.
13424 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
13425 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
13426
6e40b4eb
AD
134272002-11-06 Akim Demaille <akim@epita.fr>
13428
13429 #line should have quoted strings.
13430 Ideally, this should be done by m4_quotearg.
13431
13432 * src/scan-skel.l: Include quotearg.h.
13433 Quote __ofile__.
13434 * src/output.c (symbol_printers_output)
13435 (symbol_destructors_output): Quote the file name.
13436
2dfbfc12
AD
134372002-11-06 Akim Demaille <akim@epita.fr>
13438
13439 * tests/regression.at (Invalid inputs): Adjust to the recent
13440 messages.
13441
437c2d80
AD
134422002-11-06 Akim Demaille <akim@epita.fr>
13443
13444 Restore --no-lines.
13445 Reported by Jim Kent.
13446
13447 * data/c.m4 (b4_syncline): New.
13448 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
13449 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
13450 * src/output.c (user_actions_output): Likewise.
13451 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 13452 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 13453
900c5db5
AD
134542002-11-06 Akim Demaille <akim@epita.fr>
13455
13456 * src/main.c (main): Free `infile'.
13457 * src/scan-gram.l (handle_syncline): New.
13458 Recognize `#line'.
13459 * src/output.c (user_actions_output, symbol_destructors_output)
13460 (symbol_printers_output): Use the location's file name, not
13461 infile.
13462 * src/reader.c (prologue_augment, epilogue_set): Likewise.
13463
e183b123 134642002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 13465
e183b123 13466 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 13467 either has GLR conflict entries.
e183b123 13468
193eb6b7
PE
134692002-11-05 Paul Eggert <eggert@twinsun.com>
13470
e183b123
PE
13471 * src/scan-gram.l: Use more accurate diagnostics, e.g.
13472 "integer out of range" rather than "invalid value".
13473 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
13474 accordingly.
13475
193eb6b7
PE
13476 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
13477 Also, remove one static variable in the scanner.
13478
13479 * src/scan-gram.l (braces_level): Now auto, not static.
13480 Initialize to zero if the compiler is being picky.
13481 (INITIAL): Clear braces_level instead of incrementing it.
13482 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
13483 as POSIX 1003.1-2001 requires.
13484 * src/system.h (IF_LINT): New macro, taken from coreutils.
13485 * configure.ac: Define "lint" if --enable-gcc-warnings.
13486
29c01725
AD
134872002-11-05 Akim Demaille <akim@epita.fr>
13488
13489 * src/scan-gram.l: When it starts with `%', complain about the
13490 whole directive, not just that `invalid character: %'.
13491
8aeac3ca
AD
134922002-11-04 Akim Demaille <akim@epita.fr>
13493
13494 * Makefile.maint: Update from Autoconf.
13495 (update, cvs-update, po-update, do-po-update): New.
13496
793a58bb
AD
134972002-11-04 Akim Demaille <akim@epita.fr>
13498
13499 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
13500 and yyerror.
13501 Have yyerror `use' its arguments.
13502 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
13503 returns true when location & yacc & pure & parse-param.
13504 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
13505
c4d720cd
AD
135062002-11-04 Akim Demaille <akim@epita.fr>
13507
13508 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
13509 clashes.
13510 * src/scan-gram.l: Use [\'] instead of ['] to pacify
13511 font-lock-mode.
13512 Use complain_at.
13513 Use quote, not quote_n since LOCATION_PRINT no longer uses the
13514 slot 0.
13515
613a0dc5
PE
135162002-11-03 Paul Eggert <eggert@twinsun.com>
13517
13518 * src/reader.c (get_merge_function, grammar_current_rule_check):
13519 Use consistent diagnostics for reporting type name clashes.
13520 Quote the types with <>, for consistency with Yacc.
13521 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
13522
2a8d363a
AD
135232002-11-03 Akim Demaille <akim@epita.fr>
13524
13525 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
13526 New.
13527 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
13528 (b4_parse_param): Remove.
13529 Use b4_identification.
13530 Propagate b4_pure_args where needed to pass them to yyerror.
13531 * data/glr.m4 (b4_parse_param): Remove.
13532 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
13533 (b4_lpure_formals): New.
13534 Use b4_identification.
13535 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
13536 b4_user_formals and b4_user_args.
13537 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
13538 (yyreportAmbiguity): When using a pure parser, also need
13539 the location, and the parse-params.
13540 Adjust callers.
13541 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
13542 When using a pure parser, also need the parse-params.
13543 Adjust callers.
13544 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
13545 (%pure-parser + %parse-param) LALR and GLR parsers.
13546 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
13547 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
13548 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
13549 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
13550 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
13551 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
13552 * doc/bison.texinfo: Untabify the whole file.
13553 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
13554 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
13555 (Error Reporting): Adjust to these new directives.
13556 Document %error-verbose, deprecate YYERROR_VERBOSE.
13557
9e32add8
AD
135582002-11-03 Akim Demaille <akim@epita.fr>
13559
13560 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
13561 AT_CHECK_CALC_GLR invocations to use % directives, instead of
13562 command line options.
13563 * tests/cxx-type.at: Formatting changes.
13564
b02d90a5
PE
135652002-11-03 Paul Eggert <eggert@twinsun.com>
13566
13567 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
13568 to count columns correctly, and to check for invalid inputs.
9e32add8 13569
b02d90a5
PE
13570 Use mbsnwidth to count columns correctly. Account for tabs, too.
13571 Include mbswidth.h.
13572 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
13573 (extend_location): New function.
13574 (YY_LINES): Remove.
13575
13576 Handle CRLF in C code rather than in Lex code.
13577 (YY_INPUT): New macro.
13578 (no_cr_read): New function.
13579
13580 Scan UCNs, even though we don't fully handle them yet.
13581 (convert_ucn_to_byte): New function.
13582
13583 Handle backslash-newline correctly in C code.
13584 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
13585 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
13586 all uses changed.
13587 (tag, splice): New EREs. Do not allow NUL or newline in tags.
13588 Use {splice} wherever C allows backslash-newline.
13589 YY_STEP after space, newline, vertical-tab.
13590 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 13591
b02d90a5
PE
13592 (letter, id): Don't assume ASCII; e.g., spell out a-z.
13593
13594 ({int}, handle_action_dollar, handle_action_at): Check for integer
13595 overflow.
9e32add8 13596
b02d90a5
PE
13597 (YY_STEP): Omit trailing semicolon, so that it's more like C.
13598
13599 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
13600 as well as \000. Check for UCHAR_MAX, not 255.
13601 Allow \x with an arbitrary positive number of digits, as in C.
13602 Check for overflow here.
13603 Allow \? and UCNs, for compatibility with C.
13604
13605 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
13606 with quote slot used by complain_at.
13607
13608 * tests/input.at: Add tests for backslash-newline, m4 quotes
13609 in symbols, long literals, and funny escapes in strings.
13610
13611 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
13612 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
13613 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
13614 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
13615 * m4/mbswidth.m4: New file, from GNU coreutils.
13616
13617 * doc/bison.texinfo (Grammar Outline): Document // comments.
13618 (Symbols): Document that trigraphs have no special meaning in Bison,
13619 nor is backslash-newline allowed.
13620 (Actions): Document that trigraphs have no special meaning.
13621
13622 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
13623 no longer used.
13624
136252002-11-02 Paul Eggert <eggert@twinsun.com>
13626
13627 * src/reader.c: Don't include quote.h; not needed.
13628 (get_merge_function): Reword warning to be consistent with
13629 type clash diagnostic in grammar_current_rule_check.
13630
13631 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
13632 bug in trigraph handling.
13633
13634 * src/output.c (prepare_symbols): When printing token names,
13635 escape "[" as "@<:@" and likewise for "]".
13636
13637 * src/system.h (errno): Remove declaration, as we are now
13638 assuming C89 or better, and C89 guarantees errno.
13639
762b212b
PE
136402002-10-30 Paul Eggert <eggert@twinsun.com>
13641
13642 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
13643 Check for close failures.
13644 * src/files.h (xfclose): Return void, not int, since it always
13645 returned zero.
13646 * src/files.c (xfclose): Likewise. Report I/O error if ferror
13647 indicates one.
13648 * src/output.c (output_skeleton): Use xfclose rather than fclose
13649 and ferror. xfclose now checks ferror.
13650
13651 * data/glr.c (YYLEFTMOST_STATE): Remove.
13652 (yyreportTree): Use a stack-based leftmost state. This avoids
13653 our continuing battles with bogus warnings about initializers.
13654
56100c60
AD
136552002-10-30 Akim Demaille <akim@epita.fr>
13656
13657 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
13658 #if.
13659
51b4a04c
PH
136602002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13661
13662 * tests/glr-regr1.at: New test for reported regressions.
13663 * tests/testsuite.at: Add glr-regr1.at test.
13664 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 13665
bf1ebda2
PE
136662002-10-24 Paul Eggert <eggert@twinsun.com>
13667
5c16c6b1
PE
13668 Version 1.75a.
13669
bf1ebda2
PE
13670 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
13671 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
13672 we use malloc. Don't assume 'A' through 'Z' are contiguous.
13673 Don't assume strdup exists; POSIX says its an XSI extension.
13674 Check for buffer overflow on input.
13675
b526ee61
AD
136762002-10-24 Akim Demaille <akim@epita.fr>
13677
13678 * src/output.c (output_skeleton): Don't disable M4sugar comments
13679 too soon: it results in comments being expanded.
13680 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
13681 first output.
13682
f1886bb2
AD
136832002-10-24 Akim Demaille <akim@epita.fr>
13684
13685 * data/yacc.c (m4_int_type): New.
13686 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
13687 char' as only yacc.c wants K&R portability.
13688 * data/glr.c (yysigned_char): Remove.
13689 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
13690 Reported by Quoc Peyrot.
13691
c5576256
PE
136922002-10-23 Paul Eggert <eggert@twinsun.com>
13693
13694 * src/main.c (main): With --trace=time, report times even if a
13695 non-fatal error occurs. Formerly, the times were reported in some
13696 such cases but not in others.
13697 * src/reader.c (reader): Just return if a complaint has been issued,
13698 instead of exiting, so that 'main' can report times.
13699
27b0ffea
AD
137002002-10-22 Akim Demaille <akim@epita.fr>
13701
13702 * src/system.h: Include sys/types.
13703 Reported by Bert Deknuydt.
13704
223a7883
PE
137052002-10-23 Paul Eggert <eggert@twinsun.com>
13706
13707 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
13708 Suggested by Art Haas.
13709
137102002-10-22 Paul Eggert <eggert@twinsun.com>
13711
13712 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
13713 decl; not needed any more.
13714 * src/main.c (main): Use return to exit, undoing yesterday's change.
13715 The last OS that we could find where this wouldn't work is
13716 SunOS 3.5, and that's too old to worry about now.
13717
13718 * data/glr.c (struct yyltype): Define members even when not
13719 doing locations. This is more consistent with yacc.c, and it
13720 works around the following bug reports:
161a71f3
PE
13721 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
13722 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 13723
223a7883
PE
13724 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
13725 @acronym consistently. Standardize on "Yacc" instead of "YACC",
13726 "Algol" instead of "ALGOL". Give a bit more history about BNF.
13727
8b76775a
AD
137282002-10-22 Akim Demaille <akim@epita.fr>
13729
13730 * data/README: New.
13731
6db10d14
PE
137322002-10-21 Paul Eggert <eggert@twinsun.com>
13733
13734 Be consistent about 'bool'; the old code used an enum in one
13735 module and an int in another, and this violates the C standard.
13736 * m4/stdbool.m4: New file, from coreutils 4.5.3.
13737 * configure.ac (AC_HEADER_STDBOOL): Add.
13738 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
13739 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
13740 * src/symtab.c (hash_compare_symbol_t): Likewise.
13741 * src/system.h (bool, false, true): Use a definition consistent
13742 with ../lib/hash.c. All uses changed.
13743
13744 * src/complain.c (warning_issued): Renamed from warn_message_count,
13745 so that we needn't worry about integer overflow (!).
13746 Now of type bool. All uses changed.
13747 (complaint_issued): Renamed from complain_message_count; likewise.
13748
13749 * src/main.c (main): Use exit to exit with failure.
27b0ffea 13750
6db10d14
PE
13751 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
13752 rather than 1 and 0.
13753 * src/main.c (main): Likewise.
13754 * src/getargs.c (getargs): Likewise.
13755 * src/reader.c (reader): Likewise.
13756
13757 * src/getarg.c (getargs): Remove duplicate code for
13758 "Try `bison --help'".
13759
13760 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
13761 What was that "2" for?
13762
13763 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
13764 * src/getargs.c (usage): Likewise.
13765
13766 * src/getargs.c (getargs): When there are too few operands, report
13767 the last one. When there are too many, report the first extra
13768 one. This is how diffutils does it.
13769
92a060fd
PE
137702002-10-20 Paul Eggert <eggert@twinsun.com>
13771
13772 Remove K&R vestiges.
13773 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
13774 * src/complain.c (VA_START): Remove. Assume prototypes.
13775 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
13776 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
13777 fatal): Assume prototypes.
13778 * src/complain.h: Assume prototypes.
13779 * src/system.h (PARAMS): Remove.
13780 Include <limits.h> unconditionally, since it's guaranteeed even
13781 for a freestanding C89 compiler.
13782 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
13783 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 13784
e7cb57c0
AD
137852002-10-20 Akim Demaille <akim@epita.fr>
13786
13787 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
13788 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
13789 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
13790 (yyresolveStates, yyresolveAction, yyresolveStack)
13791 (yyprocessOneStack): Use them.
13792 (yy_reduce_print): New.
13793 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
13794
0245f82d
AD
137952002-10-20 Akim Demaille <akim@epita.fr>
13796
13797 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
13798 arguments and output `void'.
13799 (b4_c_function): Rename as...
13800 (b4_c_function_def): this.
13801 (b4_c_function_decl, b4_c_ansi_function_def)
13802 (b4_c_ansi_function_decl): New.
13803 Change the interpretation of the arguments: before `int, foo', now
13804 `int foo, foo'.
13805 * data/yacc.c (yyparse): Prototype and define thanks to these.
13806 Adjust b4_c_function_def uses.
13807 * data/glr.c (yyparse): Likewise, but ANSI only.
13808
39912f52
AD
138092002-10-20 Akim Demaille <akim@epita.fr>
13810
13811 * src/output.c (prepare): Move the definition of `tokens_number',
13812 `nterms_number', `undef_token_number', `user_token_number_max'
13813 to...
13814 (prepare_tokens): Here.
13815 (prepare_tokens): Rename as...
13816 (prepare_symbols): this.
13817 (prepare): Move the definition of `rules_number' to...
13818 (prepare_rules): here.
13819 (prepare): Move the definition of `last', `final_state_number',
13820 `states_number' to...
13821 (prepare_states): here.
13822 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
13823
20c1e2ad
AD
138242002-10-20 Akim Demaille <akim@epita.fr>
13825
13826 * src/tables.h, src/tables.c, src/output.c: Comment changes.
13827
21964f43
AD
138282002-10-20 Akim Demaille <akim@epita.fr>
13829
13830 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
13831 * data/c.m4: here.
13832
66d30cd4
AD
138332002-10-20 Akim Demaille <akim@epita.fr>
13834
13835 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
13836 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
13837 `pair'.
13838 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
13839 `name' to...
13840 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
13841 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
13842 These.
13843
95f2c9fe
PE
138442002-10-19 Paul Eggert <eggert@twinsun.com>
13845
13846 Do not create a temporary file, as that involves security and
13847 cleanup headaches. Instead, use a pair of pipes.
13848 Derived from a suggestion by Florian Krohm.
13849 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
13850 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
13851 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
13852 (BISON_PREREQ_SUBPIPE): Add.
13853 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
13854 Add subpipe.h, subpipe.c.
13855 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
13856 * po/POTFILES.in: Add lib/subpipe.c.
13857 * src/output.c: Include "subpipe.h".
13858 (m4_invoke): Remove decl.
13859 (scan_skel): New decl.
13860 (output_skeleton): Use pipe rather than temporary file for m4 input.
13861 Check that m4sugar.m4 is readable, to avoid deadlock.
13862 Check for pipe I/O error.
13863 * src/scan-skel.l (readpipe): Remove decl.
13864 (scan_skel): New function, to be used in place of m4_invoke.
13865 Read from stream rather than file.
66d30cd4 13866
95f2c9fe
PE
13867 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
13868 float, as this generates a warning on Solaris 8 + GCC 3.2 with
13869 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
13870 this generates a more-accurate value anyway.
13871
13872 * lib/timevar.c (timervar_accumulate): Rename locals to
13873 avoid confusion with similarly-named more-global.
13874 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
13875
13876 * src/output.c (prepare): Use xstrdup to convert char const *
13877 to char *, to avoid GCC warning.
13878
c19988b7
AD
138792002-10-19 Akim Demaille <akim@epita.fr>
13880
13881 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
13882 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
13883 Use them to have `calc.y' ready for %pure-parser.
13884 * data/yacc.c (YYLEX): Pass a yylex return type to
13885 b4_c_function_call.
13886
ae7453f2
AD
138872002-10-19 Akim Demaille <akim@epita.fr>
13888
13889 Prototype support of %lex-param and %parse-param.
13890
13891 * src/parse-gram.y: Add the definition of the %lex-param and
13892 %parse-param tokens, plus their rules.
13893 Drop the `_' version of %glr-parser.
13894 Add the "," token.
13895 * src/scan-gram.l (INITIAL): Scan them.
13896 * src/muscle_tab.c: Comment changes.
13897 (muscle_insert, muscle_find): Rename `pair' as `probe'.
13898 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
13899 (muscle_entry_s): The `value' member is no longer const.
13900 Adjust all dependencies.
13901 * src/muscle_tab.c (muscle_init): Adjust: use
13902 MUSCLE_INSERT_STRING.
13903 Initialize the obstack earlier.
13904 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
13905 (muscle_pair_list_grow): New.
13906 * data/c.m4 (b4_c_function_call, b4_c_args): New.
13907 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
13908 * tests/calc.at: Use %locations, not --locations.
13909 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
13910
0e575721
AD
139112002-10-19 Akim Demaille <akim@epita.fr>
13912
13913 * src/getargs.c (usage): Take status as argument and exit
13914 accordingly.
13915 Report the traditional `Try ... --help' message when status != 0.
13916 (usage, version): Don't take a FILE * as arg, it is pointless.
13917 (getargs): When there is an incorrect number of arguments, make it
13918 an error, and report it GNUlically thanks to `usage ()'.
13919
724ce7f5
PE
139202002-10-18 Paul Eggert <eggert@twinsun.com>
13921
3a781eb2
PE
13922 * data/glr.c (yyreportParseError): Don't assume that sprintf
13923 yields the length of the printed string, as this is not true
13924 on SunOS 4.1.4. Reported by Peter Klein.
13925
724ce7f5
PE
13926 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
13927 * tests/conflicts.at (%nonassoc and eof): Likewise.
13928 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
13929
473d0a75
AD
139302002-10-17 Akim Demaille <akim@epita.fr>
13931
13932 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
13933 * src/getargs.c (trace_types, trace_args): Adjust.
13934 * src/reader.c (grammar_current_rule_prec_set)
13935 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
13936 Standardize error messages.
13937 And s/@prec/%prec/!
13938 (reader): Use trace_flag to enable scanner/parser debugging,
13939 instead of an adhoc scheme.
13940 * src/scan-gram.l: Remove trailing debugging code.
13941
e76d2469
PE
139422002-10-16 Paul Eggert <eggert@twinsun.com>
13943
93e2236a
PE
13944 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
13945 MUSCLE_TAB_H.
13946
e76d2469
PE
13947 * NEWS: Officially drop support for building Bison with K&R C,
13948 since it didn't work anyway and it's not worth worrying about.
13949 * Makefile.maint (wget_files): Remove ansi2knr.c.
13950 (ansi2knr.c-url_prefix): Remove.
13951 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
13952 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13953 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
13954
5bd1c419
PE
139552002-10-15 Paul Eggert <eggert@twinsun.com>
13956
13957 Stop using the "enum_" trick for K&R-style function definitions;
13958 it confused me, and I was the author! Instead, assume that people
13959 who want to use K&R C compilers (when using these modules in GCC,
13960 perhaps?) will run ansi2knr.
13961
13962 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
13963 All uses of "enum_" changed to "enum ".
13964 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
13965 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 13966
5bd1c419
PE
13967 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
13968 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
13969 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
13970 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
13971 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
13972 abitset_not, abitset_ones, abitset_or, abitset_or_and,
13973 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
13974 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
13975 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
13976 Use function prototypes; this removes the need for declaring
13977 static functions simply to provide their prototypes.
13978 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
13979 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
13980 bitset_count_, bitset_create, bitset_dump, bitset_first,
13981 bitset_free, bitset_init, bitset_last, bitset_next,
13982 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
13983 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
13984 bitset_print, bitset_release_memory, bitset_toggle_,
13985 bitset_type_choose, bitset_type_get, bitset_type_name_get,
13986 debug_bitset): Likewise.
13987 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
13988 * lib/bitset_stats.c (bitset_log_histogram_print,
13989 bitset_percent_histogram_print, bitset_stats_and,
13990 bitset_stats_and_cmp, bitset_stats_and_or,
13991 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
13992 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
13993 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
13994 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
13995 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
13996 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
13997 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
13998 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
13999 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
14000 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
14001 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
14002 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
14003 bitset_stats_zero): Likewise.
14004 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
14005 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
14006 bitsetv_dump, debug_bitsetv): Likewise.
14007 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
14008 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
14009 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
14010 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
14011 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
14012 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
14013 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
14014 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
14015 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
14016 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
14017 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
14018 Likewise.
14019 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
14020 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
14021 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
14022 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
14023 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
14024 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
14025 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
14026 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
14027 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
14028 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
14029 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 14030
ae26e1f0
AD
140312002-10-14 Akim Demaille <akim@epita.fr>
14032
14033 Version 1.75.
14034
d43baf71
AD
140352002-10-14 Akim Demaille <akim@epita.fr>
14036
14037 * tests/Makefile.am (maintainer-check-posix): New.
14038
7ebc83e3
AD
140392002-10-14 Akim Demaille <akim@epita.fr>
14040
14041 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
14042 member.
14043
05846dae
AD
140442002-10-14 Akim Demaille <akim@epita.fr>
14045
14046 * src/tables.c (table_ninf_remap): base -> tab.
14047 Reported by Matt Rosing.
14048
1318e37d
PE
140492002-10-14 Paul Eggert <eggert@twinsun.com>
14050
447fbb17
PE
14051 * tests/action.at, tests/calc.at, tests/conflicts.at,
14052 tests/cxx-type.at, tests/headers.at, tests/input.at,
14053 tests/regression.at, tests/synclines.at, tests/torture.at:
14054 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
14055 so that the tests still work even if POSIXLY_CORRECT is set.
14056 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 14057
1318e37d
PE
14058 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
14059 for portability to K&R hosts. Fix typo: signed char is guaranteed
14060 only to 127, not to 128.
14061 * data/glr.c (yysigned_char): New type.
14062 * data/yacc.c (yysigned_char): Likewise.
14063 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
14064
cc0f0794
PE
140652002-10-13 Paul Eggert <eggert@twinsun.com>
14066
5038f418
PE
14067 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
14068 true due to limited range of data type" warning from GCC.
14069
cc0f0794
PE
14070 * data/c.m4 (b4_token_defines): Protect against double-inclusion
14071 by wrapping enum yytokentype's definition inside #ifndef
14072 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
14073
6fed0802
AD
140742002-10-13 Akim Demaille <akim@epita.fr>
14075
14076 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
14077 Un yy- yyrhs to avoid the name clash with the global YYRHS.
14078
32f0598d
AD
140792002-10-13 Akim Demaille <akim@epita.fr>
14080
14081 * Makefile.maint: Update from Autoconf 2.54.
14082 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
14083
7ea9a33f
AD
140842002-10-13 Akim Demaille <akim@epita.fr>
14085
14086 * src/print.c (print_state): Separate the list of solved conflicts
14087 from the other items.
14088 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
14089
ea99527d
AD
140902002-10-13 Akim Demaille <akim@epita.fr>
14091
14092 Let nondeterministic skeletons be usable with deterministic
14093 tables.
14094
14095 With the patch, GAWK compiled by GCC without -O2 passes its test
14096 suite using a GLR parser driven by LALR tables. It fails with -O2
14097 because `struct stat' gives two different answers on my machine:
14098 88 (definition of an auto var) and later 96 (memset on this var).
14099 Hence the stack is badly corrumpted. The headers inclusion is to
14100 blame: if I move the awk.h inclusion before GLR's system header
14101 inclusion, the two struct stat have the same size.
14102
14103 * src/tables.c (pack_table): Always create conflict_table.
14104 (token_actions): Always create conflict_list.
14105 * data/glr.c (YYFLAG): Remove, unused.
14106
f377f69f
AD
141072002-10-13 Akim Demaille <akim@epita.fr>
14108
14109 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
14110 (O0FLAGS): New.
14111 (VALGRIND, GXX): New.
14112 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
14113 * tests/bison.in: Run $PREBISON a pre-command.
14114 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
14115 (maintainer-check-g++): New.
14116 * Makefile.am (maintainer-check): New.
14117
2a1fe6ed
AD
141182002-10-13 Akim Demaille <akim@epita.fr>
14119
14120 * data/glr.c: Formatting changes.
14121 Tweak some trace messages to match yacc.c's.
14122
f50adbbd
AD
141232002-10-13 Akim Demaille <akim@epita.fr>
14124
14125 GLR parsers sometimes raise parse errors instead of performing the
14126 default reduction.
14127 Reported by Charles-Henry de Boysson.
14128
14129 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 14130 check the length of the traces when %glr.
f50adbbd
AD
14131 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
14132 GLR's traces.
14133 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
14134 Test GLR parsers.
14135 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
14136 (yyltype): Remove the yy prefix from the member names.
14137 (yytable): Complete its comment.
14138 (yygetLRActions): Map error action number from YYTABLE from
14139 YYTABLE_NINF to 0.
14140 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
14141 (which was a bug: it should have been YYTABEL_NINF, and yet it was
14142 not satisfying as we could compare an YYACTION computed from
14143 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
14144 only value for error actions.
14145 (yyreportParseError): In verbose parse error messages, don't issue
14146 `error' in the list of expected tokens.
14147 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
14148 next action to perform to match glr.c's decoding.
14149 (yytable): Complete its comment.
14150
bcbad5b9
PE
141512002-10-13 Paul Eggert <eggert@twinsun.com>
14152
14153 Fix problem reported by Henrik Grubbstroem in
161a71f3 14154 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
14155 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
14156 because the Bison parser reads the second action before reducing
14157 the first one.
14158 * src/scan-gram.l (rule_length): New static var.
14159 Use it to keep track of the rule length in the scanner, since
14160 we can't expect the parser to be in lock-step sync with the scanner.
14161 (handle_action_dollar, handle_action_at): Use this var.
14162 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 14163
14904b89
PE
141642002-10-12 Paul Eggert <eggert@twinsun.com>
14165
1fe611e5
PE
14166 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
14167 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
14168 Include <sys/time.h> when checking for clock_t and struct tms.
14169 Use same include order as source.
14170 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 14171 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 14172
1fe611e5
PE
14173 * lib/timevar.c: Update copyright date and clarify comments.
14174 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 14175
1fe611e5
PE
14176 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
14177 GCC version as of today, then merge Bison's changes.
14178 Change "GCC" to "Bison" in copyright notice. timevar.def's
14179 author is Akim, so change that too.
14180
98194095
PE
14181 * src/reader.c (grammar_current_rule_check):
14182 Don't worry about the default action if $$ is untyped.
14183 Prevents bogus warnings reported by Jim Gifford in
161a71f3 14184 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 14185
14904b89
PE
14186 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
14187 * data/glr.c, data/lalr1.cc, data/yacc.c:
14188 Output token definitions before the first part of user declarations.
14189 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 14190 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 14191
ff6dca18
PE
141922002-10-11 Paul Eggert <eggert@twinsun.com>
14193
14194 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
14195 (yyparse): here. This undoes some of the 2002-07-25 change.
14196 Compatibility problem reported by Ralf S. Engelschall with
14197 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
14198
eb714592
AD
141992002-10-11 Akim Demaille <akim@epita.fr>
14200
14201 * tests/regression.at Characters Escapes): New.
14202 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
14203 characters.
14204 Reported by Jan Nieuwenhuizen.
14205
b7195100
AD
142062002-10-11 Akim Demaille <akim@epita.fr>
14207
14208 * po/id.po: New.
14209
f28a0f2d
PE
142102002-10-10 Paul Eggert <eggert@twinsun.com>
14211
14212 Portability fixes for bitsets; this also avoids several GCC
14213 warnings.
14214
14215 * lib/abitset.c: Include <stddef.h>, for offsetof.
14216 * lib/lbitset.c: Likewise.
14217
14218 * lib/abitset.c (abitset_bytes): Return a size that is aligned
14219 properly for vectors of objects. Do not assume that adding a
14220 header size to a multiple of a word size yields a value that is
14221 properly aligned for the whole union.
14222 * lib/bitsetv.c (bitsetv_alloc): Likewise.
14223
14224 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
14225 unique names for structures.
14226 * lib/ebitset.c (ebitset_bytes): Likewise.
14227 * lib/lbitset.c (lbitset_bytes): Likewise.
14228
14229 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
14230 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
14231 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
14232 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
14233 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
14234 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
14235 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
14236 to improve the type-checking that GCC can do.
14237 * lib/bitset.c (bitset_op4_cmp): Likewise.
14238 * lib/bitset_stats.c (bitset_stats_count,
14239 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
14240 bitset_stats_copy, bitset_stats_disjoint_p,
14241 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
14242 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
14243 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
14244 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
14245 bitset_stats_and_or_cmp, bitset_stats_andn_or,
14246 bitset_stats_andn_or_cmp, bitset_stats_or_and,
14247 bitset_stats_or_and_cmp): Likewise.
14248 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
14249 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
14250 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
14251 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
14252
14253 * lib/abitset.h: Include bitset.h, not bbitset.h.
14254 * lib/ebitset.h: Likewise.
14255 * lib/lbitset.h: Likewise.
14256
14257 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
14258 All instances of parameters of type enum bitset_opts are now of
14259 type enum_bitset_opts, to conform to the C Standard, and similarly
14260 for enum_bitset_type.
14261 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
14262 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
14263
14264 Do not use "struct bitset_struct" to mean different things in
14265 different modules. Not only is this confusing, it violates
14266 the C Standard, which requires that structure types in different
14267 modules must be compatible if one is to be passed to the other.
14268 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
14269 All instances of "struct bitset_struct *" replaced with "bitset".
14270 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
14271 (union bitset_union, struct abitset_struct, struct ebitset_struct,
14272 struct lbitset_struct, struct bitset_stats_struct): New types.
14273 All uses of struct bitset_struct changed to union bitset_union,
14274 etc.
ba0fe3c7 14275 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
14276 struct bitset_struct): Remove.
14277 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
14278 struct bitset_struct): Remove.
14279 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
14280 bitset_struct): Remove.
14281 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
14282 Likewise.
14283
14284 Do not call a function of type T using a call that assumes the
14285 function is of a different type U. Standard C requires that a
14286 function must be called with a type that is compatible with its
14287 definition.
14288 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
14289 New decls.
14290 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
14291 New functions.
14292 * lib/ebitset.c (PFV): Remove.
14293 * lib/lbitset.c (PFV): Likewise.
14294 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
14295 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
14296 decls.
14297 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
14298 (ebitset_vtable): Use them.
14299 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
14300 lbitset_xor): New functions.
14301 (lbitset_vtable): Use them.
14302
14303 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
14304 Declare.
14305
14306 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
14307 GCC warning.
14308 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
14309 Use offsetof, for simplicity.
14310
6fbe4984
PE
143112002-10-06 Paul Eggert <eggert@twinsun.com>
14312
14313 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
14314 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 14315 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
14316 which was inadvertently undone by the 2002-09-30 patch.
14317 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
14318 the same width as int.
14319
420f93c8
PE
143202002-10-04 Paul Eggert <eggert@twinsun.com>
14321
14322 Version 1.50.
14323
14324 * configure.ac (AC_INIT), NEWS: Increment version number.
14325
14326 * doc/bison.texinfo: Minor spelling, grammar, and white space
14327 fixes.
14328 (Symbols): Mention that any negative value returned from yylex
14329 signifies end-of-input. Warn about negative chars. Mention
14330 the portable Standard C character set.
14331
14332 The GNU coding standard says CFLAGS and YFLAGS are reserved
14333 for the installer to set.
14334 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
14335 * src/Makefile.am (AM_CFLAGS): Likewise.
14336 (AM_YFLAGS): Renamed from YFLAGS.
14337
14338 Fix some MAX and MIN problems.
14339 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
14340 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
14341 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
14342 * src/reader.c (reader): Use it.
14343
14344 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
14345 POSIX 1003.1-2001 has removed fgrep.
14346
143472002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
14348
14349 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
14350 interpreted as signed.
14351 * lib/ebitset.c (ebitset_list): Fix bug.
14352
ff68026d
PE
143532002-10-01 Paul Eggert <eggert@twinsun.com>
14354
14355 More fixes for 64-bit hosts and large bitsets.
14356
14357 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
14358 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
14359 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
14360 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
14361 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
14362 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
14363 bitset_count_): Likewise.
14364 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
14365 bitset_first, bitset_last): Likewise.
14366 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
14367 bitset_stats_list_reverse, bitset_stats_size,
14368 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
14369 Likewise.
14370 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14371 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
14372 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
14373 bitsetv_reflexive_transitive_closure): Likewise.
14374 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
14375 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
14376 Likewise.
14377 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
14378 Likewise.
420f93c8 14379
ff68026d
PE
14380 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
14381 Use size_t, not unsigned int, to count bytes.
14382 * lib/abitset.h (abitset_bytes): Likewise.
14383 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
14384 Likewise.
14385 * lib/bitset.h (bitset_bytes): Likewise.
14386 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
14387 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
14388 * lib/bitsetv.c (bitsetv_alloc): Likewise.
14389 * lib/ebitset.c (ebitset_bytes): Likewise.
14390 * lib/ebitset.h (ebitset_bytes): Likewise.
14391 * lib/lbitset.c (lbitset_bytes): Likewise.
14392 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 14393
ff68026d
PE
14394 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
14395 abitset_subset_p, abitset_disjoint_p, abitset_and,
14396 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
14397 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
14398 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
14399 abitset_or_and, abitset_or_and_cmp):
14400 Use bitset_windex instead of unsigned int.
14401 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
14402 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
14403 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
14404 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
14405 Likewise.
14406 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 14407
ff68026d
PE
14408 * lib/bitset.c (bitset_print):
14409 Use proper printf formats for widths of integer types.
14410 * lib/bitset_stats.c (bitset_percent_histogram_print,
14411 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
14412 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
14413 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
14414 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 14415
ff68026d
PE
14416 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
14417 BITSET_SIZE_MAX): New macros.
14418 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
14419 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
14420 to BITSET_WINDEX_MAX.
14421
14422 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
14423 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
14424 since we now return the bitset_bindex type (not int).
14425
14426 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
14427 when computing sizes.
14428 * lib/ebitset.c (ebitset_elts_grow): Likewise.
14429
14430 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
14431 and avoid cast to unsigned.
14432
6aa452a6
AD
144332002-09-30 Akim Demaille <akim@epita.fr>
14434
14435 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
14436 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
14437 Updates from Michael Hayes.
14438
927f7817
AD
144392002-09-30 Art Haas <ahaas@neosoft.com>
14440
14441 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
14442 invocations.
14443 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
14444 defined.
14445
9738f41e
AD
144462002-09-27 Akim Demaille <akim@epita.fr>
14447
14448 Version 1.49c.
14449
a5c75d7f
AD
144502002-09-27 Akim Demaille <akim@epita.fr>
14451
14452 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
14453 (Because of AC_LIBSOURCE).
14454
8280e179
AD
144552002-09-27 Akim Demaille <akim@epita.fr>
14456
14457 Playing with Autoscan.
14458
14459 * configure.ac: Remove the old LIBOBJ tweaks.
14460 (AC_REPLACE_FUNCS): Add strrchr and strtol.
14461 * lib/strrchr.c: New.
14462 * lib/strtol.c: New, from the Coreutils 4.5.1.
14463
ae64af35
AD
144642002-09-27 Akim Demaille <akim@epita.fr>
14465
14466 Playing with Autoscan.
14467
14468 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
14469 * lib/Makefile.am (libbison_a_SOURCES): No longer include
14470 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
14471 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
14472 Coreutils 4.5.1.
14473
d1a1114f
AD
144742002-09-24 Akim Demaille <akim@epita.fr>
14475
14476 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
14477 (Frequently Asked Questions, Parser Stack Overflow): New.
14478
b906441c
AD
144792002-09-13 Akim Demaille <akim@epita.fr>
14480
14481 Playing with autoscan.
14482
14483 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
14484 * src/files.c (skeleton_find): Remove, unused.
14485 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
14486 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
14487
bd701811
AD
144882002-09-13 Akim Demaille <akim@epita.fr>
14489
14490 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
14491 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
14492
e0a13e7b
AD
144932002-09-13 Akim Demaille <akim@epita.fr>
14494
14495 * configure.ac: Require 2.54.
14496 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
14497 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
14498 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
14499 Remove, provided by Autoconf macros.
14500
c97011bf
AD
145012002-09-12 Akim Demaille <akim@epita.fr>
14502
14503 * m4/prereq.m4: Update, from Coreutils 4.5.1.
14504
d862b1be
AD
145052002-09-12 Akim Demaille <akim@epita.fr>
14506
14507 * m4/prereq.m4: Update, from Fileutils 4.1.5.
14508 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
14509 Reported by Martin Mokrejs.
14510
3d38c03a
AD
145112002-09-10 Akim Demaille <akim@epita.fr>
14512
14513 * src/parse-gram.y: Associate a human readable string to each
14514 token type.
14515 * tests/regression.at (Invalid inputs): Adjust.
14516
b6347355
AD
145172002-09-10 Gary V. Vaughan <gary@gnu.org>
14518
14519 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
14520 with an Autoconf-2.5x style configure.ac.
14521
09ba4ab2
PE
145222002-09-06 Paul Eggert <eggert@twinsun.com>
14523
14524 * doc/bison.texinfo (Conditions): Make explicit that the GPL
14525 exception applies only to yacc.c. This is a modification of a
14526 patch originally suggested by Akim Demaille.
14527
21846f69
AD
145282002-09-06 Akim Demaille <akim@epita.fr>
14529
09ba4ab2
PE
14530 * data/c.m4 (b4_copyright): Move the GPL exception comment from
14531 here to...
14532 * data/yacc.c: here.
14533
21846f69
AD
14534 * data/lalr1.cc (struct yyltype): Don't define it, since we use
14535 LocationType.
14536 (b4_ltype): Default to yy::Location from location.hh.
14537
c0ad8bf3
AD
145382002-09-04 Jim Meyering <jim@meyering.net>
14539
14540 * data/yacc.c: Guard the declaration of yytoknum also with
14541 `#ifdef YYPRINT', so it is declared only when used.
14542
3a93251e
AD
145432002-09-04 Akim Demaille <akim@epita.fr>
14544
14545 * configure.in: Rename as...
14546 * configure.ac: this.
14547 Bump to 1.49c.
14548
427c0dda
AD
145492002-09-04 Akim Demaille <akim@epita.fr>
14550
14551 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
14552 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
14553 translate maintainer only messages.
14554
6a254321
PE
145552002-08-12 Paul Eggert <eggert@twinsun.com>
14556
645e30d1
PE
14557 Version 1.49b.
14558
6a254321
PE
14559 * Makefile.am (SUBDIRS): Remove intl.
14560 (DISTCLEANFILES): Remove.
14561 * NEWS: Mention that GNU M4 is now required. Clarify what is
14562 meant by "larger grammars". Mention the pt_BR translation.
14563 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
14564 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
14565 Bump version from 0.11.2 to 0.11.5.
14566 (BISON_PREREQ_STAGE): Remove.
14567 (AM_GNU_GETTEXT): Use external gettext.
14568 (AC_OUTPUT): Remove intl/Makefile.
14569
14570 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
14571
14572 * data/glr.c: Include string.h, for strlen.
14573 (yyreportParseError): Use size_t for yysize.
14574 (yy_yypstack): No longer nested inside yypstates, as nested
14575 functions are not portable. Do not assume size_t is the
14576 same width as int.
14577 (yypstates): Do not assume that ptrdiff_t is the same width
14578 as int, and similarly for yyposn and YYINDEX.
14579
14580 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
14581
14582 * lib/Makefile.am (INCLUDES): Do not include from the intl
14583 directory, which has been removed.
14584 * src/Makefile.am (INCLUDES): Likewise.
14585
14586 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
14587 (bitsets_sources, additional_bitsets_sources, timevars_sources):
14588 New vars.
14589
14590 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
14591 * tests/Makefile.am (EXTRA_DIST): Likewise.
14592
14593 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
14594 Do not assume that bitset_windex is the same width as unsigned.
14595
14596 * lib/abitset.c (abitset_unused_clear): Do not assume that
14597 bitset_word is the same width as int.
14598 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
14599 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
14600 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
14601 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
14602 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
14603
14604 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
14605 portability to one's complement hosts!).
14606 * lib/ebitset.c (ebitset_op1): Likewise.
14607 * lib/lbitset.c (lbitset_op1): Likewise.
14608
14609 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
14610 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
14611 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
14612 Sync with fileutils.
14613 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
14614 lib/gettext.h: Sync with diffutils.
14615
14616 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
14617 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
14618
14619 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
14620 PROTOTYPES to check for prototypes, and "defined __STDC__" to
14621 check for void *.
14622
14623 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
14624 size_t; the old version tried to do this but casted improperly.
14625 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
14626 (bitset_test): Now returns int, not unsigned long.
14627
14628 * lib/bitset_stats.c: Include "gettext.h".
14629 (_): New macro.
14630 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
14631 name locals "index", as it generates unnecessary warnings on some
14632 hosts that have an "index" function.
14633
14634 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
14635 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
14636 they need translation.
14637 * src/LR0.c (state_list_append, new_itemsets, get_state,
14638 append_states, generate_states): Likewise.
14639 * src/assoc.c (assoc_to_string): Likewise.
14640 * src/closure.c (print_closure, set_firsts, closure): Likewise.
14641 * src/gram.c (grammar_dump): Likewise.
14642 * src/injections.c (injections_compute): Likewise.
14643 * src/lalr.c (lookaheads_print): Likewise.
14644 * src/relation.c (relation_transpose): Likewise.
14645 * src/scan-gram.l: Likewise.
14646 * src/tables.c (table_grow, pack_vector): Likewise.
14647
14648 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
14649 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
14650 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
14651 * m4/mbstate_t.m4: Sync with fileutils.
14652 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
14653
14654 * po/LINGUAS: Add pt_BR.
14655 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
14656 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
14657 lib/timevar.c.
14658 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
14659 manual recommends.
14660 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
14661
14662 * src/complain.c (strerror_r): Remove decl; not needed.
14663 (strerror): Use same pattern as ../lib/error.c.
14664
14665 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
14666
14667 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
14668
14669 * src/main.c (main): Cast result of bindtextdomain and textdomain
14670 to void, to avoid a GCC warning when --disable-nls is in effect.
14671
14672 * src/scan-gram.l: Use strings rather than escapes when possible,
14673 to minimize the number of warnings from xgettext.
14674 (handle_action_dollar, handle_action_at): Don't use isdigit,
14675 as it mishandles negative chars and it may not work as expected
14676 outside the C locale.
14677
14678 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
14679 this is a GCC extension and is not portable to other compilers.
14680
14681 * src/system.h (alloca): Use same pattern as ../lib/error.c.
14682 Do not include <ctype.h>; no longer needed.
14683 Do not include <malloc.h>; no longer needed (and generates
14684 warnings on OpenBSD 3.0).
14685
14686 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
14687 it's not portable.
14688
14689 * tests/regression.at: Do not use 'cc -c input.c -o input';
14690 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
14691
14692 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
14693 exit status as failure, not just exit status 1. Sun C exits
14694 with status 2 sometimes.
14695
14696 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
14697 Use it for the two large tests.
14698
c8f002c7
AD
146992002-08-02 Akim Demaille <akim@epita.fr>
14700
14701 * src/conflicts.c (conflicts_output): Don't output rules never
14702 reduced here, since anyway that computation doesn't work.
14703 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
14704 (rule_useless_p, rule_never_reduced_p): New.
14705 (grammar_rules_partial_print): Use a filter instead of a range.
14706 Display the title only if needed.
14707 (grammar_rules_print): Adjust.
14708 (grammar_rules_never_reduced_report): New.
14709 * src/tables.c (action_row): Move the computation of rules never
14710 reduced to...
14711 (token_actions): here.
14712 * src/main.c (main): Make the parser before making the report, so
14713 that rules never reduced are computed.
14714 Call grammar_rules_never_reduced_report.
14715 * src/print.c (print_results): Report rules never reduced.
14716 * tests/conflicts.at, tests/reduce.at: Adjust.
14717
cd08e51e
AD
147182002-08-01 Akim Demaille <akim@epita.fr>
14719
14720 Instead of attaching lookaheads and duplicating the rules being
14721 reduced by a state, attach the lookaheads to the reductions.
14722
14723 * src/state.h (state_t): Remove the `lookaheads',
14724 `lookaheads_rule' member.
14725 (reductions_t): Add a `lookaheads' member.
14726 Use a regular array for the `rules'.
14727 * src/state.c (reductions_new): Initialize the lookaheads member
14728 to 0.
14729 (state_rule_lookaheads_print): Adjust.
14730 * src/state.h, src/state.c (state_reductions_find): New.
14731 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
14732 (count_rr_conflicts): Adjust.
14733 * src/lalr.c (LArule): Remove.
14734 (add_lookback_edge): Adjust.
14735 (state_lookaheads_count): New.
14736 (states_lookaheads_initialize): Merge into...
14737 (initialize_LA): this.
14738 (lalr_free): Adjust.
14739 * src/main.c (main): Don't free nullable and derives too early: it
14740 is used by --verbose.
14741 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
14742
bb0027a9
AD
147432002-08-01 Akim Demaille <akim@epita.fr>
14744
14745 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
14746 `rule_number_t**'.
14747 (set_derives, free_derives): Rename as...
14748 (derives_compute, derives_free): this.
14749 Adjust all dependencies.
14750 * src/nullable.c (set_nullable, free_nullable): Rename as...
14751 (nullable_compute, nullable_free): these.
14752 (rule_list_t): Store rule_t *, not rule_number_t.
14753 * src/state.c (state_rule_lookaheads_print): Directly compare rule
14754 pointers, instead of their numbers.
14755 * src/main.c (main): Call nullable_free, and derives_free earlier,
14756 as they were lo longer used.
14757
3325ddc4
AD
147582002-08-01 Akim Demaille <akim@epita.fr>
14759
14760 * lib/timevar.c (get_time): Include children time.
14761 * src/lalr.h (LA, LArule): Don't export them: used with the
14762 state_t.
14763 * src/lalr.c (LA, LArule): Static.
14764 * src/lalr.h, src/lalr.c (lalr_free): New.
14765 * src/main.c (main): Call it.
14766 * src/tables.c (pack_vector): Check whether loc is >= to the
14767 table_size, not >.
14768 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
14769 (tables_generate): do it, since that's also it which allocates
14770 them.
14771 Don't free LA and LArule, main does.
14772
c6f1a33c
AD
147732002-07-31 Akim Demaille <akim@epita.fr>
14774
14775 Separate parser tables computation and output.
14776
14777 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
14778 (conflict_list, conflict_list_cnt, table, check, table_ninf)
14779 (yydefgoto, yydefact, high): Move to...
14780 * src/tables.h, src/tables.c: here.
14781 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14782 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14783 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
14784 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
14785 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
14786 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
14787 (action_row, save_row, token_actions, save_column, default_goto)
14788 (goto_actions, sort_actions, matching_state, pack_vector)
14789 (table_ninf_remap, pack_table, prepare_actions): Move to...
14790 * src/tables.c: here.
14791 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
14792 * src/output.c (token_actions, output_base, output_conflicts)
14793 (output_check): Merge into...
14794 (prepare_actions): this.
14795 (actions_output): Rename as...
14796 (user_actions_output): this.
14797 * src/main.c (main): Call tables_generate and tables_free.
14798
1509d42f
AD
147992002-07-31 Akim Demaille <akim@epita.fr>
14800
14801 Steal GCC's --time-report support.
14802
14803 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
14804 stolen/adjusted from GCC.
14805 * m4/stage.m4: Remove time related checks.
14806 * m4/timevar.m4: New.
14807 * configure.in: Adjust.
14808 * src/system.h: Adjust to using timevar.h.
14809 * src/getargs.h, src/getargs.c: Support trace_time for
14810 --trace=time.
14811 * src/main.c (stage): Remove.
14812 (main): Replace `stage' invocations with timevar calls.
14813 * src/output.c: Insert pertinent timevar calls.
14814
273a74fa
AD
148152002-07-31 Akim Demaille <akim@epita.fr>
14816
14817 Let --trace have arguments.
14818
14819 * src/getargs.h (enum trace_e): New.
14820 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
14821 (long_options, short_options): --trace/-T takes an optional
14822 argument.
14823 Change all the uses of trace_flag to reflect the new flags.
14824 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
14825
14826 Strengthen `stage' portability.
14827
14828 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
14829 * configure.in: Use it.
14830 Don't check for malloc.h and sys/times.h.
14831 * src/system.h: Include them when appropriate.
14832 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
14833 times and struct tms are available.
14834
217598da
AD
148352002-07-30 Akim Demaille <akim@epita.fr>
14836
14837 In verbose parse error message, don't report `error' as an
14838 expected token.
14839 * tests/actions.at (Printers and Destructors): Adjust.
14840 * tests/calc.at (Calculator $1): Adjust.
14841 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
14842 error message, do not report the parser accepts the error token in
14843 that state.
14844
52489d44
AD
148452002-07-30 Akim Demaille <akim@epita.fr>
14846
14847 Normalize conflict related messages.
14848
14849 * src/complain.h, src/complain.c (warn, complain): New.
14850 * src/conflicts.c (conflicts_print): Use them.
14851 (conflict_report_yacc): New, extracted from...
14852 (conflicts_print): here.
14853 * tests/conflicts.at, tests/existing.at: Adjust.
14854
e8832397
AD
148552002-07-30 Akim Demaille <akim@epita.fr>
14856
14857 Report rules which are never reduced by the parser: those hidden
14858 by conflicts.
14859
14860 * src/LR0.c (save_reductions): Don't make the final state too
14861 different: save its reduction (accept) instead of having a state
14862 without any action (no shift or goto, no reduce).
14863 Note: the final state is now a ``regular'' state, i.e., the
14864 parsers now contain `reduce 0' as default reduction.
14865 Nevertheless, since they decide to `accept' when yystate =
14866 final_state, they still will not reduce rule 0.
14867 * src/print.c (print_actions, print_reduction): Adjust.
14868 * src/output.c (action_row): Track reduced rules.
14869 (token_actions): Report rules never reduced.
14870 * tests/conflicts.at, tests/regression.at: Adjust.
14871
caf23d24
AD
148722002-07-30 Akim Demaille <akim@epita.fr>
14873
14874 `stage' was accidently included in a previous patch.
14875 Initiate its autoconfiscation.
14876
14877 * configure.in: Look for malloc.h and sys/times.h.
14878 * src/main.c (stage): Adjust.
14879 Report only when trace_flag.
14880
640748ee
AD
148812002-07-29 Akim Demaille <akim@epita.fr>
14882
14883 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
14884 state_number_t.
14885 (errs_t): symbol_t*, not symbol_number_t.
14886 (reductions_t): rule_t*, not rule_number_t.
14887 (FOR_EACH_SHIFT): New.
14888 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
14889 * src/print.c, src/print_graph.c: Adjust.
14890
88bce5a2
AD
148912002-07-29 Akim Demaille <akim@epita.fr>
14892
14893 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
14894
14895 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
14896 (endtoken, accept): these.
14897 * src/reader.c (reader): Set endtoken's default tag to "$end".
14898 Set undeftoken's tag to "$undefined" instead of "$undefined.".
14899 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
14900 Adjust.
14901
1bfb97db
AD
149022002-07-29 Akim Demaille <akim@epita.fr>
14903
14904 * src/reduce.c (reduce_grammar): When the language is empty,
14905 complain about the start symbol, not the axiom.
14906 Use its location.
14907 * tests/reduce.at (Empty Language): New.
14908
fc5734fe
AD
149092002-07-26 Akim Demaille <akim@epita.fr>
14910
14911 * src/reader.h, src/reader.c (gram_error): ... can't get
14912 yycontrol without making too strong assumptions on the parser
14913 itself.
14914 * src/output.c (prepare_tokens): Use the real 0th value of
14915 token_translations instead of `0'.
14916 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
14917 visible here.
14918 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
14919 for the time being: %locations ought to provide it to yyerror.
14920
3650b4b8
AD
149212002-07-25 Akim Demaille <akim@epita.fr>
14922
14923 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
14924 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
14925 * tests/regression.at (Web2c Actions): Adjust.
14926
4b3d3a8e
AD
149272002-07-25 Akim Demaille <akim@epita.fr>
14928
14929 Stop storing rules from 1 to nrules + 1.
14930
14931 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
14932 * src/nullable.c, src/output.c, src/print.c, src/reader.c
14933 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
14934 Iterate from 0 to nrules.
14935 Use rule_number_as_item_number and item_number_as_rule_number.
14936 Adjust to `derive' now containing possibly 0.
14937 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
14938 Handle the `- 1' part in rule numbers from/to item numbers.
14939 * src/conflicts.c (log_resolution): Fix the message which reversed
14940 shift and reduce.
14941 * src/output.c (action_row): Initialize default_rule to -1.
14942 (token_actions): Adjust.
14943 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
14944 expected output.
14945 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
14946
4a2a22f4
AD
149472002-07-25 Akim Demaille <akim@epita.fr>
14948
14949 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
14950 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
14951 (b4_c_knr_arg_decl): New.
14952 * data/yacc.c: Use it to define yysymprint, yydestruct, and
14953 yyreport_parse_error.
14954
b8df3223
AD
149552002-07-25 Akim Demaille <akim@epita.fr>
14956
14957 * data/yacc.c (yyreport_parse_error): New, extracted from...
14958 (yyparse): here.
14959 (yydestruct, yysymprint): Move above yyparse.
14960 Be K&R compliant.
14961
a762e609
AD
149622002-07-25 Akim Demaille <akim@epita.fr>
14963
14964 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
14965 replace...
14966 (b4_sint_type, b4_uint_type): these.
14967 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
14968 * tests/regression.at (Web2c Actions): Adjust.
14969
12b0043a
AD
149702002-07-25 Akim Demaille <akim@epita.fr>
14971
14972 * src/gram.h (TIEM_NUMBER_MAX): New.
14973 (item_number_of_rule_number, rule_number_of_item_number): Rename
14974 as...
14975 (rule_number_as_item_number, item_number_as_rule_number): these.
14976 Adjust dependencies.
14977 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
14978 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
14979 (symbol_number_to_vector_number): New.
14980 (order): Of vector_number_t* type.
14981 (base_t, BASE_MAX, BASE_MIN): New.
14982 (froms, tos, width, pos, check): Of base_t type.
14983 (action_number_t, ACTION_MIN, ACTION_MAX): New.
14984 (actrow): Of action_number_t type.
14985 (conflrow): Of unsigned int type.
14986 (table_ninf, base_ninf): New.
14987 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
14988 (muscle_insert_int_table, muscle_insert_base_table)
14989 (muscle_insert_rule_number_table): New.
14990 (prepare_tokens): Output `toknum' as int_table.
14991 (action_row): Returns a rule_number_t.
14992 Use ACTION_MIN, not SHRT_MIN.
14993 (token_actions): yydefact is rule_number_t*.
14994 (table_ninf_remap): New.
14995 (pack_table): Use it for `base' and `table'.
14996 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
14997 replaced with...
14998 (YYPACT_NINF, YYTABLE_NINF): these.
14999 (yypact, yytable): Compute their types instead of hard-coded
15000 `short'.
15001 * tests/regression.at (Web2c Actions): Adjust.
15002
5dde258a
AD
150032002-07-19 Akim Demaille <akim@epita.fr>
15004
15005 * src/scan-gram.l (id): Can start with an underscore.
15006
a945ec39
AD
150072002-07-16 Akim Demaille <akim@epita.fr>
15008
15009 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
15010 Adjust all former `associativity' dependencies.
15011 * src/symtab.c (symbol_new): Default associativity is `undef', not
15012 `right'.
15013 (symbol_check_alias_consistence): Adjust.
15014
fae437e8
AD
150152002-07-09 Akim Demaille <akim@epita.fr>
15016
15017 * doc/bison.texinfo: Properly set the ``header'' part.
15018 Use @dircategory ``GNU programming tools'' as per Texinfo's
15019 documentation.
15020 Use @copying.
15021
1a715ef2
AD
150222002-07-09 Akim Demaille <akim@epita.fr>
15023
15024 * lib/quotearg.h: Protect against multiple inclusions.
15025 * src/location.h (location_t): Add a `file' member.
15026 (LOCATION_RESET, LOCATION_PRINT): Adjust.
15027 * src/complain.c (warn_at, complain_at, fatal_at): Drop
15028 `error_one_per_line' support.
15029
a5d50994
AD
150302002-07-09 Akim Demaille <akim@epita.fr>
15031
15032 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
15033 * src/reader.c (lineno): Remove.
15034 Adjust all dependencies.
15035 (get_merge_function): Take a location and use complain_at.
15036 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
15037 * tests/regression.at (Invalid inputs, Mixing %token styles):
15038 Adjust.
15039
b275314e
AD
150402002-07-09 Akim Demaille <akim@epita.fr>
15041
15042 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
15043 recovery rule, and forbid extensions when --yacc.
15044 (gram_error): Use complain_at.
15045 * src/reader.c (reader): Exit if there were parse errors.
15046
865b9df1
AD
150472002-07-09 Akim Demaille <akim@epita.fr>
15048
15049 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
15050 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
15051 Reported by R Blake <blakers@mac.com>.
15052
c76e14da
AD
150532002-07-09 Akim Demaille <akim@epita.fr>
15054
15055 * data/yacc.c: Output the copyright notive in the header.
15056
7db2ed2d
AD
150572002-07-03 Akim Demaille <akim@epita.fr>
15058
15059 * src/output.c (froms, tos): Are state_number_t.
15060 (save_column): sp, sp1, and sp2 are state_number_t.
15061 (prepare): Rename `final' as `final_state_number', `nnts' as
15062 `nterms_number', `nrules' as `rules_number', `nstates' as
15063 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
15064 unused.
15065 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
15066 * data/lalr1.cc (nsym_): Remove, unused.
15067
e68e0410
AD
150682002-07-03 Akim Demaille <akim@epita.fr>
15069
15070 * src/lalr.h, src/lalr.c (goto_number_t): New.
15071 * src/lalr.c (goto_list_t): New.
15072 Propagate them.
15073 * src/nullable.c (rule_list_t): New.
15074 Propagate.
15075 * src/types.h: Remove.
15076
e1a4f3a4
AD
150772002-07-03 Akim Demaille <akim@epita.fr>
15078
15079 * src/closure.c (print_fderives): Use rule_rhs_print.
15080 * src/derives.c (print_derives): Use rule_rhs_print.
15081 (rule_list_t): New, replaces `shorts'.
15082 (set_derives): Add comments.
15083 * tests/sets.at (Nullable, Firsts): Adjust.
15084
536545f3
AD
150852002-07-03 Akim Demaille <akim@epita.fr>
15086
15087 * src/output.c (prepare_actions): Free `tally' and `width'.
15088 (prepare_actions): Allocate and free `order'.
15089 * src/symtab.c (symbols_free): Free `symbols'.
15090 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
15091 * src/output.c (m4_invoke): Move to...
15092 * src/scan-skel.l: here.
15093 (<<EOF>>): Close yyout, and free its name.
15094
8b752b00
AD
150952002-07-03 Akim Demaille <akim@epita.fr>
15096
15097 Fix some memory leaks, and fix a bug: state 0 was examined twice.
15098
15099 * src/LR0.c (new_state): Merge into...
15100 (state_list_append): this.
15101 (new_states): Merge into...
15102 (generate_states): here.
15103 (set_states): Don't ensure a proper `errs' state member here, do it...
15104 * src/conflicts.c (conflicts_solve): here.
15105 * src/state.h, src/state.c: Comment changes.
15106 (state_t): Rename member `shifts' as `transitions'.
15107 Adjust all dependencies.
15108 (errs_new): For consistency, also take the values as argument.
15109 (errs_dup): Remove.
15110 (state_errs_set): New.
15111 (state_reductions_set, state_transitions_set): Assert that no
15112 previous value was assigned.
15113 (state_free): New.
15114 (states_free): Use it.
15115 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
15116 temporary storage: use `errs' and `nerrs' as elsewhere.
15117 (set_conflicts): Allocate and free this `errs'.
15118
613f5e1a
AD
151192002-07-02 Akim Demaille <akim@epita.fr>
15120
15121 * lib/libiberty.h: New.
15122 * lib: Update the bitset implementation from upstream.
15123 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
15124 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
15125 * src/main.c: Adjust bitset stats calls.
15126
26e0cadc
PE
151272002-07-01 Paul Eggert <eggert@twinsun.com>
15128
15129 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
15130 char, so that negative chars don't collide with $.
15131
1154cced
AD
151322002-06-30 Akim Demaille <akim@epita.fr>
15133
15134 Have the GLR tests be `warning' checked, and fix the warnings.
15135
15136 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
15137 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
15138 (yyremoveDeletes): `yyi' and `yyj' are size_t.
15139 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
15140 (yyaddDeferredAction): static.
15141 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
15142 (yyreportParseError): yyprefix is const.
15143 yytokenp is used only when verbose.
15144 (yy__GNUC__): Replace with __GNUC__.
15145 (yypdumpstack): yyi is size_t.
15146 (yypreference): Un-yy local variables and arguments, to avoid
15147 clashes with `yyr1'. Anyway, we are not in the user name space.
15148 (yytname_size): be an int, as is compared with ints.
15149 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
15150 Use them.
15151 * tests/cxx-gram.at: Use quotation to protect $1.
15152 Use AT_COMPILE to enable warnings hunts.
15153 Prototype yylex and yyerror.
15154 `Use' argc.
15155 Include `string.h', not `strings.h'.
15156 Produce and prototype stmtMerge only when used.
15157 yylex takes a location.
15158
97650f4e
AD
151592002-06-30 Akim Demaille <akim@epita.fr>
15160
15161 We spend a lot of time in quotearg, in particular when --verbose.
15162
15163 * src/symtab.c (symbol_get): Store a quoted version of the key.
15164 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
15165 Adjust all callers.
15166
d2576365
AD
151672002-06-30 Akim Demaille <akim@epita.fr>
15168
15169 * src/state.h (reductions_t): Rename member `nreds' as num.
15170 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
15171 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
15172
ccaf65bc
AD
151732002-06-30 Akim Demaille <akim@epita.fr>
15174
15175 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
15176 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
15177 (shifts_to): Rename as...
15178 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
15179 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
15180 (TRANSITION_IS_DISABLED, transitions_to): these.
15181
87675353
AD
151822002-06-30 Akim Demaille <akim@epita.fr>
15183
15184 * src/print.c (print_shifts, print_gotos): Merge into...
15185 (print_transitions): this.
15186 (print_transitions, print_errs, print_reductions): Align the
15187 lookaheads columns.
15188 (print_core, print_transitions, print_errs, print_state,
15189 print_grammar): Output empty lines separator before, not after.
15190 (state_default_rule_compute): Rename as...
15191 (state_default_rule): this.
15192 * tests/conflicts.at (Defaulted Conflicted Reduction),
15193 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
15194 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
15195
ce4ccb4b
AD
151962002-06-30 Akim Demaille <akim@epita.fr>
15197
15198 Display items as we display rules.
15199
15200 * src/gram.h, src/gram.c (rule_lhs_print): New.
15201 * src/gram.c (grammar_rules_partial_print): Use it.
15202 * src/print.c (print_core): Likewise.
15203 * tests/conflicts.at (Defaulted Conflicted Reduction),
15204 (Unresolved SR Conflicts): Adjust.
15205 (Unresolved SR Conflicts): Adjust and rename as...
15206 (Resolved SR Conflicts): this, as was meant.
15207 * tests/regression.at (Web2c Report): Adjust.
15208
bc933ef1
AD
152092002-06-30 Akim Demaille <akim@epita.fr>
15210
15211 * src/print.c (state_default_rule_compute): New, extracted from...
15212 (print_reductions): here.
15213 Pessimize, but clarify the code.
15214 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
15215
53d4308d
AD
152162002-06-30 Akim Demaille <akim@epita.fr>
15217
15218 * src/output.c (action_row): Let default_rule be always a rule
15219 number.
15220
574fb2d5
AD
152212002-06-30 Akim Demaille <akim@epita.fr>
15222
15223 * src/closure.c (print_firsts, print_fderives, closure):
15224 Use BITSET_EXECUTE.
15225 * src/lalr.c (lookaheads_print): Likewise.
15226 * src/state.c (state_rule_lookaheads_print): Likewise.
15227 * src/print_graph.c (print_core): Likewise.
15228 * src/print.c (print_reductions): Likewise.
15229 * src/output.c (action_row): Likewise.
15230 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
15231
05811fd7
AD
152322002-06-30 Akim Demaille <akim@epita.fr>
15233
15234 * src/print_graph.c: Use report_flag.
15235
0e4d5753
AD
152362002-06-30 Akim Demaille <akim@epita.fr>
15237
15238 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
15239 to...
15240 * src/relation.h, src/relation.c (traverse, relation_digraph)
15241 (relation_print, relation_transpose): New.
15242
24c7d800
AD
152432002-06-30 Akim Demaille <akim@epita.fr>
15244
15245 * src/state.h, src/state.c (shifts_to): New.
15246 * src/lalr.c (build_relations): Use it.
15247
9222837b
AD
152482002-06-30 Akim Demaille <akim@epita.fr>
15249
15250 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
15251 (item_number_of_rule_number, rule_number_of_item_number): New.
15252 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
15253 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
15254 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
15255 Propagate their use.
15256 Much remains to be done, in particular wrt `shorts' from types.h.
15257
260008e5
AD
152582002-06-30 Akim Demaille <akim@epita.fr>
15259
15260 * src/symtab.c (symbol_new): Initialize the `printer' member.
15261
8a731ca8
AD
152622002-06-30 Akim Demaille <akim@epita.fr>
15263
15264 * src/LR0.c (save_reductions): Remove, replaced by...
15265 * src/state.h, src/state.c (state_reductions_set): New.
15266 (reductions, errs): Rename as...
15267 (reductions_t, errs_t): these.
15268 Adjust all dependencies.
15269
32e1e0a4
AD
152702002-06-30 Akim Demaille <akim@epita.fr>
15271
15272 * src/LR0.c (state_list_t, state_list_append): New.
15273 (first_state, last_state): Now symbol_list_t.
15274 (this_state): Remove.
15275 (new_itemsets, append_states, save_reductions): Take a state_t as
15276 argument.
15277 (set_states, generate_states): Adjust.
15278 (save_shifts): Remove, replaced by...
15279 * src/state.h, src/state.c (state_shifts_set): New.
15280 (shifts): Rename as...
15281 (shifts_t): this.
15282 Adjust all dependencies.
15283 * src/state.h (state_t): Remove the `next' member.
15284
e5fb6710
AD
152852002-06-30 Akim Demaille <akim@epita.fr>
15286
15287 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
15288 escaped in slot 0.
15289
c7ca99d4
AD
152902002-06-30 Akim Demaille <akim@epita.fr>
15291
15292 Use hash.h for the state hash table.
15293
15294 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
15295 (allocate_storage): Use state_hash_new.
15296 (free_storage): Use state_hash_free.
15297 (new_state, get_state): Adjust.
15298 * src/lalr.h, src/lalr.c (states): Move to...
15299 * src/states.h (state_t): Remove the `link' member, no longer
15300 used.
15301 * src/states.h, src/states.c: here.
15302 (state_hash_new, state_hash_free, state_hash_lookup)
15303 (state_hash_insert, states_free): New.
15304 * src/states.c (state_table, state_compare, state_hash): New.
15305 * src/output.c (output_actions): Do not free states now, since we
15306 still need to know the final_state number in `prepare', called
15307 afterwards. Do it...
15308 * src/main.c (main): here: call states_free after `output'.
15309
df0e7316
AD
153102002-06-30 Akim Demaille <akim@epita.fr>
15311
15312 * src/state.h, src/state.c (state_new): New, extracted from...
15313 * src/LR0.c (new_state): here.
15314 * src/state.h (STATE_ALLOC): Move to...
15315 * src/state.c: here.
15316 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
15317 * src/state.h, src/state.c: here.
15318
39f41916
AD
153192002-06-30 Akim Demaille <akim@epita.fr>
15320
15321 * src/reader.c (gensym): Rename as...
15322 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
15323 (getsym): Rename as...
15324 (symbol_get): this.
15325
d57650a5
AD
153262002-06-30 Akim Demaille <akim@epita.fr>
15327
15328 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
15329 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
15330 * src/output.c, src/print.c, src/print_graph.c: Propagate.
15331 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
15332
5a08f1ce
AD
153332002-06-30 Akim Demaille <akim@epita.fr>
15334
15335 Make the test suite pass with warnings checked.
15336
15337 * tests/actions.at (Printers and Destructors): Improve.
15338 Avoid unsigned vs. signed issues.
15339 * tests/calc.at: Don't exercise the scanner here, do it...
15340 * tests/input.at (Torturing the Scanner): here.
15341
720623af
PH
153422002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15343
88e7e941 15344 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
15345 reorganize first lines parallel to yacc.c.
15346
fb8135fa
AD
153472002-06-28 Akim Demaille <akim@epita.fr>
15348
15349 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
15350 (b4_token_enum, b4_token_defines): New, factored from...
15351 * data/lalr1.cc, data/yacc.c, glr.c: here.
15352
41442480
AD
153532002-06-28 Akim Demaille <akim@epita.fr>
15354
15355 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
15356 unused variables.
15357 * src/output.c (merger_output): static.
15358
e0e5bf84
AD
153592002-06-28 Akim Demaille <akim@epita.fr>
15360
ba0fe3c7 15361 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
15362 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
15363 pacify GCC.
15364 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 15365
676385e2
PH
153662002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15367
15368 Accumulated changelog for new GLR parsing features.
15369
6a254321 15370 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
15371 conflicts_total_count.
15372 * src/conflicts.h: Ditto.
15373 * src/output.c (token_actions): Use the new name.
15374 (output_conflicts): Change conflp => conflict_list_heads, and
15375 confl => conflict_list for better readability.
15376 * data/glr.c: Use the new names.
15377 * NEWS: Add self to GLR announcement.
e0e5bf84 15378
676385e2
PH
15379 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
15380
15381 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
15382 Akim Demaille.
15383
15384 * data/bison.glr: Change name to glr.c
15385 * data/glr.c: Renamed from bison.glr.
15386 * data/Makefile.am: Add glr.c
e0e5bf84
AD
15387
15388 * src/getargs.c:
15389
676385e2 15390 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 15391 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 15392
676385e2
PH
15393 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15394
15395 * data/bison.glr: Be sure to restore the
15396 current #line when returning to the skeleton contents after having
15397 exposed the input file's #line.
15398
15399 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15400
15401 * data/bison.glr: Bring up to date with changes to bison.simple.
15402
15403 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15404
15405 * data/bison.glr: Correct definitions that use b4_prefix.
15406 Various reformatting.
15407 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
15408 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
15409 yytokenp argument; now part of stack.
15410 (yychar): Define to behave as documented.
15411 (yyclearin): Ditto.
e0e5bf84 15412
676385e2
PH
15413 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15414
15415 * src/reader.h: Add declaration for free_merger_functions.
15416
15417 * src/reader.c (merge_functions): New variable.
15418 (get_merge_function): New function.
15419 (free_merger_functions): New function.
15420 (readgram): Check for %prec that is not followed by a symbol.
15421 Handle %dprec and %merge declarations.
15422 (packgram): Initialize dprec and merger fields in rules array.
15423
15424 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
15425 conflict_list_cnt, conflict_list_free): New variables.
15426 (table_grow): Also grow conflict_table.
e0e5bf84 15427 (prepare_rules): Output dprec and merger tables.
676385e2 15428 (conflict_row): New function.
e0e5bf84 15429 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
15430 default reduction in conflicted states for GLR parser so that there
15431 are spaces for the conflict lists.
15432 (save_row): Also save conflict information.
15433 (token_actions): Allocate conflict list.
15434 (merger_output): New function.
15435 (pack_vector): Pack conflict table, too.
15436 (output_conflicts): New function to output yyconflp and yyconfl.
15437 (output_check): Allocate conflict_tos.
15438 (output_actions): Output conflict tables, also.
15439 (output_skeleton): Output b4_mergers definition.
15440 (prepare): Output b4_max_rhs_length definition.
15441 Use 'bison.glr' as default skeleton for GLR parsers.
15442
15443 * src/gram.c (glr_parser): New flag.
15444 (grammar_free): Call free_merger_functions.
15445
15446 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
15447 all pairs of conflicting reductions, rather than just all tokens
15448 causing conflicts. Needed to size conflict tables.
e0e5bf84 15449 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
15450 interface.
15451 (conflicts_print): Ditto.
15452 (count_total_conflicts): New function.
15453
15454 * src/reader.h (merger_list): New type.
15455 (merge_functions): New variable.
15456
15457 * src/lex.h (tok_dprec, tok_merge): New token types.
15458
15459 * src/gram.h (rule_s): Add dprec and merger fields.
15460 (glr_parser): New flag.
15461
15462 * src/conflicts.h (count_total_conflicts): New function.
15463
15464 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
15465
15466 * doc/bison.texinfo (Generalized LR Parsing): New section.
15467 (GLR Parsers): New section.
15468 (Language and Grammar): Mention GLR parsing.
15469 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
15470 Correct typo ("tge" -> "the").
15471
15472 * data/bison.glr: New skeleton for GLR parsing.
15473
15474 * tests/cxx-gram.at: New tests for GLR parsing.
15475
15476 * tests/testsuite.at: Include cxx-gram.at.
15477
15478 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 15479
676385e2
PH
15480 * src/parse-gram.y:
15481
15482 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
15483
15484 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 15485
b5480d74 154862002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
15487
15488 * src/options.h, src/options.c: Remove.
15489 * src/getargs.c (short_options, long_options): New.
15490
60491a94
AD
154912002-06-27 Akim Demaille <akim@epita.fr>
15492
15493 * data/bison.simple, data/bison.c++: Rename as...
15494 * data/yacc.c, data/lalr1.cc: these.
15495 * doc/bison.texinfo (Environment Variables): Remove.
15496
9be0c25b
AD
154972002-06-25 Raja R Harinath <harinath@cs.umn.edu>
15498
15499 * src/getargs.c (report_argmatch): Initialize strtok().
15500
1ae72863
AD
155012002-06-20 Akim Demaille <akim@epita.fr>
15502
15503 * data/bison.simple (b4_symbol_actions): New, replaces...
15504 (b4_symbol_destructor, b4_symbol_printer): these.
15505 (yysymprint): Be sure to call YYPRINT only for tokens, and using
15506 user token numbers.
15507
87542d29
AD
155082002-06-20 Akim Demaille <akim@epita.fr>
15509
15510 * data/bison.simple (yydestructor): Rename as...
15511 (yydestruct): this.
15512
1a31ed21
AD
155132002-06-20 Akim Demaille <akim@epita.fr>
15514
15515 * src/symtab.h, src/symtab.c (symbol_type_set)
15516 (symbol_destructor_set, symbol_precedence_set): The location is
15517 the last argument.
15518 Adjust all callers.
15519
e776192e
AD
155202002-06-20 Akim Demaille <akim@epita.fr>
15521
15522 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
15523 internals.
15524 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
15525 Takes a location.
15526 * src/symtab.h, src/symtab.c (symbol_class_set)
15527 (symbol_user_token_number_set): Likewise.
15528 Adjust all callers.
15529 Promote complain_at.
15530 * tests/input.at (Type Clashes): Adjust.
15531
5c1180b3
AD
155322002-06-20 Akim Demaille <akim@epita.fr>
15533
15534 * data/bison.simple (YYLEX): Fix the declaration when
15535 %pure-parser.
15536
e3170060
AD
155372002-06-20 Akim Demaille <akim@epita.fr>
15538
15539 * data/bison.simple (yysymprint): Don't print the token number,
15540 just its name.
15541 * tests/actions.at (Destructors): Rename as...
15542 (Printers and Destructors): this.
15543 Also exercise %printer.
15544
253862fd
AD
155452002-06-20 Akim Demaille <akim@epita.fr>
15546
15547 * data/bison.simple (YYDSYMPRINT): New.
15548 Use it to remove many of the #if YYDEBUG/if (yydebug).
15549
366eea36
AD
155502002-06-20 Akim Demaille <akim@epita.fr>
15551
15552 * src/symtab.h, src/symtab.c (symbol_t): printer and
15553 printer_location are new members.
15554 (symbol_printer_set): New.
15555 * src/parse-gram.y (PERCENT_PRINTER): New token.
15556 Handle its associated rule.
15557 * src/scan-gram.l: Adjust.
15558 (handle_destructor_at, handle_destructor_dollar): Rename as...
15559 (handle_symbol_code_at, handle_symbol_code_dollar): these.
15560 * src/output.c (symbol_printers_output): New.
15561 (output_skeleton): Call it.
15562 * data/bison.simple (yysymprint): New. Cannot be named yyprint
15563 since there are already many grammar files with a user `yyprint'.
15564 Replace the calls to YYPRINT to calls to yysymprint.
15565 * tests/calc.at: Adjust.
15566 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
15567 taking advantage of parser very internal details (stack size!).
15568
4f25ebb0
AD
155692002-06-20 Akim Demaille <akim@epita.fr>
15570
15571 * src/scan-gram.l: Complete the scanner with the missing patterns
15572 to pacify Flex.
15573 Use `quote' and `symbol_tag_get' where appropriate.
15574
93b68a0e
AD
155752002-06-19 Akim Demaille <akim@epita.fr>
15576
15577 * tests/actions.at (Destructors): Augment to test locations.
15578 * data/bison.simple (yydestructor): Pass it the current location
15579 if locations are enabled.
15580 Prototype only when __STDC__ or C++.
15581 Change the argument names to move into the yy name space: there is
15582 user code here.
15583
58612f1d
AD
155842002-06-19 Akim Demaille <akim@epita.fr>
15585
74310291
AD
15586 * data/bison.simple (b4_pure_if): New.
15587 Use it instead of #ifdef YYPURE.
15588
155892002-06-19 Akim Demaille <akim@epita.fr>
15590
15591 * data/bison.simple (b4_location_if): New.
58612f1d
AD
15592 Use it instead of #ifdef YYLSP_NEEDED.
15593
f25bfb75
AD
155942002-06-19 Akim Demaille <akim@epita.fr>
15595
15596 Prepare @$ in %destructor, but currently don't bind it in the
15597 skeleton, as %location use is not cleaned up yet.
15598
15599 * src/scan-gram.l (handle_dollar, handle_destructor_at)
15600 (handle_action_at): New.
15601 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
15602 a braced_code_t and a location as additional arguments.
15603 (handle_destructor_dollar): Instead of requiring `b4_eval', just
15604 unquote one when outputting `b4_dollar_dollar'.
15605 Adjust callers.
15606 * data/bison.simple (b4_eval): Remove.
15607 (b4_symbol_destructor): Adjust.
15608 * tests/input.at (Invalid @n): Adjust.
15609
c732d2c6
AD
156102002-06-19 Zack Weinberg <zack@codesourcery.com>
15611
15612 * doc/bison.texinfo: Document ability to have multiple
15613 prologue sections.
15614
8c165d89
AD
156152002-06-18 Akim Demaille <akim@epita.fr>
15616
15617 * src/files.c (compute_base_names): When computing the output file
15618 names from the input file name, strip the directory part.
15619
ca98bf57
AD
156202002-06-18 Akim Demaille <akim@epita.fr>
15621
15622 * data/bison.simple.new: Comment changes.
15623 Reported by Andreas Schwab.
15624
0bfb02ff
AD
156252002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
15626
15627 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
15628 there are no `label `yyoverflowlab' defined but not used' warnings
15629 when yyoverflow is defined.
15630
24c0aad7
AD
156312002-06-18 Akim Demaille <akim@epita.fr>
15632
15633 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
15634 new member.
15635 (symbol_destructor_set): Adjust.
15636 * src/output.c (symbol_destructors_output): Output the destructor
15637 locations.
15638 Output the symbol name.
15639 * data/bison.simple (b4_symbol_destructor): Adjust.
15640
5719c109
AD
156412002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
15642 and Akim Demaille <akim@epita.fr>
15643
15644 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
15645 what's left on the stack when the error recovery hits EOF.
15646 * tests/actions.at (Destructors): Complete to exercise this case.
15647
9280d3ef
AD
156482002-06-17 Akim Demaille <akim@epita.fr>
15649
15650 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
15651 arguments is really empty, not only equal to `[]'.
15652 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
15653 member.
15654 (symbol_destructor_set): New.
15655 * src/output.c (symbol_destructors_output): New.
15656 * src/reader.h (brace_code_t, current_braced_code): New.
15657 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
15658 (handle_dollar): Rename as...
15659 (handle_action_dollar): this.
15660 (handle_destructor_dollar): New.
15661 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
15662 (grammar_declaration): Use it.
15663 * data/bison.simple (yystos): Is always defined.
15664 (yydestructor): New.
15665 * tests/actions.at (Destructors): New.
15666 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
15667
dafdc66f
AD
156682002-06-17 Akim Demaille <akim@epita.fr>
15669
15670 * src/symlist.h, src/symlist.c (symbol_list_length): New.
15671 * src/scan-gram.l (handle_dollar, handle_at): Compute the
15672 rule_length only when needed.
15673 * src/output.c (actions_output, token_definitions_output): Output
15674 the full M4 block.
15675 * src/symtab.c: Don't access directly to the symbol tag, use
15676 symbol_tag_get.
15677 * src/parse-gram.y: Use symbol_list_free.
15678
56c47203
AD
156792002-06-17 Akim Demaille <akim@epita.fr>
15680
15681 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
15682 (symbol_list_prepend, get_type_name): Move to...
15683 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
15684 (symbol_list_prepend, symbol_list_n_type_name_get): here.
15685 Adjust all callers.
15686 (symbol_list_free): New.
15687 * src/scan-gram.l (handle_dollar): Takes a location.
15688 * tests/input.at (Invalid $n): Adjust.
15689
1e0bab92
AD
156902002-06-17 Akim Demaille <akim@epita.fr>
15691
15692 * src/reader.h, src/reader.c (symbol_list_new): Export it.
15693 (symbol_list_prepend): New.
15694 * src/parse-gram.y (%union): `list' is a new member.
15695 (symbols.1): New, replaces...
15696 (terms_to_prec.1, nterms_to_type.1): these.
15697 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
15698 Take a location as additional argument.
15699 Adjust all callers.
15700
04e60654
AD
157012002-06-15 Akim Demaille <akim@epita.fr>
15702
15703 * src/parse-gram.y: Move %token in the declaration section so that
15704 we don't depend upon CVS Bison.
15705
10e5b8bd
AD
157062002-06-15 Akim Demaille <akim@epita.fr>
15707
15708 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
15709 * src/print.c (print_core): Use it.
15710
9801d40c
AD
157112002-06-15 Akim Demaille <akim@epita.fr>
15712
15713 * src/conflicts.c (log_resolution): Accept the rule involved in
15714 the sr conflicts instead of the lookahead number that points to
15715 that rule.
15716 (flush_reduce): Accept the current lookahead vector as argument,
15717 instead of the index in LA.
15718 (resolve_sr_conflict): Accept the current number of lookahead
15719 bitset to consider for the STATE, instead of the index in LA.
15720 (set_conflicts): Adjust.
15721 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
15722
c0263492
AD
157232002-06-15 Akim Demaille <akim@epita.fr>
15724
15725 * src/state.h (state_t): Replace the `lookaheadsp' member, a
15726 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
15727 Adjust all dependencies.
15728 * src/lalr.c (initialize_lookaheads): Split into...
15729 (states_lookaheads_count, states_lookaheads_initialize): these.
15730 (lalr): Adjust.
15731
9757c359
AD
157322002-06-15 Akim Demaille <akim@epita.fr>
15733
15734 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
15735 out of...
15736 (grammar_rules_print): here.
15737 * src/reduce.c (reduce_output): Use it.
15738 * tests/reduce.at (Useless Rules, Reduced Automaton)
15739 (Underivable Rules): Adjust.
15740
6b98e4b5
AD
157412002-06-15 Akim Demaille <akim@epita.fr>
15742
15743 Copy BYacc's nice way to report the grammar.
15744
15745 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
15746 New.
15747 Don't print the rules' location, it is confusing and useless.
15748 (rule_print): Use grammar_rhs_print.
15749 * src/print.c (print_grammar): Use grammar_rules_print.
15750
6b98e4b5
AD
157512002-06-15 Akim Demaille <akim@epita.fr>
15752
15753 Complete and rationalize `useless thing' warnings.
15754
15755 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
15756 (symbol_tag_print): New.
15757 Use them everywhere in place of accessing directly the tag member.
15758 * src/gram.h, src/gram.c (rule_print): New.
15759 Use it where a rule used to be printed `by hand'.
15760 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
15761 (reduce_grammar_tables): Report the useless rules.
15762 (reduce_print): Useless things are a warning, not an error.
15763 Report it as such.
15764 * tests/reduce.at (Useless Nonterminals, Useless Rules):
15765 (Reduced Automaton, Underivable Rules): Adjust.
15766 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
15767 * tests/conflicts.at (Unresolved SR Conflicts)
15768 (Solved SR Conflicts): Adjust.
15769
ee000ba4
AD
157702002-06-15 Akim Demaille <akim@epita.fr>
15771
15772 Let symbols have a location.
15773
15774 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
15775 (getsym): Adjust.
15776 Adjust all callers.
15777 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
15778 Use location_t, not int.
15779 * src/symtab.c (symbol_check_defined): Take advantage of the
15780 location.
15781 * tests/regression.at (Invalid inputs): Adjust.
15782
8efe435c
AD
157832002-06-15 Akim Demaille <akim@epita.fr>
15784
15785 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
15786 (input): Don't try to initialize yylloc here, do it in the
15787 scanner.
15788 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
15789 * src/gram.h (rule_t): Change line and action_line into location
15790 and action_location, of location_t type.
15791 Adjust all dependencies.
15792 * src/location.h, src/location.c (empty_location): New.
15793 * src/reader.h, src/reader.c (grammar_start_symbol_set)
15794 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
15795 (grammar_current_rule_symbol_append)
15796 (grammar_current_rule_action_append): Expect a location as argument.
15797 * src/reader.c (grammar_midrule_action): Adjust to attach an
15798 action's location as dummy symbol location.
15799 * src/symtab.h, src/symtab.c (startsymbol_location): New.
15800 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
15801 the line numbers.
15802
1921f1d7
AD
158032002-06-14 Akim Demaille <akim@epita.fr>
15804
15805 Grammar declarations may be found in the grammar section.
15806
15807 * src/parse-gram.y (rules_or_grammar_declaration): New.
15808 (declarations): Each declaration may end with a semicolon, not
15809 just...
15810 (grammar_declaration): `"%union"'.
15811 (grammar): Branch to rules_or_grammar_declaration.
15812
4515534c
AD
158132002-06-14 Akim Demaille <akim@epita.fr>
15814
15815 * src/main.c (main): Invoke scanner_free.
15816
f958596b
AD
158172002-06-14 Akim Demaille <akim@epita.fr>
15818
15819 * src/output.c (m4_invoke): Extracted from...
15820 (output_skeleton): here.
15821 Free tempfile.
15822
2c569025
AD
158232002-06-14 Akim Demaille <akim@epita.fr>
15824
15825 * src/parse-gram.y (directives, directive, gram)
15826 (grammar_directives, precedence_directives, precedence_directive):
15827 Rename as...
15828 (declarations, declaration, grammar, grammar_declaration)
15829 (precedence_declaration, precedence_declarator): these.
15830 (symbol_declaration): New.
15831
592e8d4d
AD
158322002-06-14 Akim Demaille <akim@epita.fr>
15833
15834 * src/files.c (action_obstack): Remove, unused.
15835 (output_obstack): Remove it, and all its dependencies, as it is no
15836 longer needed.
15837 * src/reader.c (epilogue_set): Build the epilogue in the
15838 muscle_obstack.
15839 * src/output.h, src/output.c (muscle_obstack): Move to...
15840 * src/muscle_tab.h, src/muscle_tab.h: here.
15841 (muscle_init): Initialize muscle_obstack.
15842 (muscle_free): New.
15843 * src/main.c (main): Call it.
15844
0c15323d
AD
158452002-06-14 Akim Demaille <akim@epita.fr>
15846
15847 * src/location.h: New, extracted from...
15848 * src/reader.h: here.
15849 * src/Makefile.am (noinst_HEADERS): Merge into
15850 (bison_SOURCES): this.
15851 Add location.h.
15852 * src/parse-gram.y: Use location_t instead of Bison's.
15853 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
15854 Use location_t instead of ints.
15855
e96c9728
AD
158562002-06-14 Akim Demaille <akim@epita.fr>
15857
15858 * data/bison.simple, data/bison.c++: Be sure to restore the
15859 current #line when returning to the skeleton contents after having
15860 exposed the input file's #line.
15861
75d1fe16
AD
158622002-06-12 Akim Demaille <akim@epita.fr>
15863
15864 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
15865 eager.
15866 * tests/actions.at (Exotic Dollars): New.
15867
6c35d22c
AD
158682002-06-12 Akim Demaille <akim@epita.fr>
15869
15870 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
15871 ['"/] too eagerly.
15872 * tests/input.at (Torturing the Scanner): New.
15873
1d6412ad
AD
158742002-06-11 Akim Demaille <akim@epita.fr>
15875
15876 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
15877 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
15878 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
15879 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
15880 * src/reader.c (reader): Use it.
15881
4cdb01db
AD
158822002-06-11 Akim Demaille <akim@epita.fr>
15883
15884 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
15885 Adjust all callers.
15886 (scanner_last_string_free): New.
15887
44995b2e
AD
158882002-06-11 Akim Demaille <akim@epita.fr>
15889
15890 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
15891 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
15892 (last_string, YY_OBS_FREE): New.
15893 Use them when returning an ID.
15894
e9955c83
AD
158952002-06-11 Akim Demaille <akim@epita.fr>
15896
15897 Have Bison grammars parsed by a Bison grammar.
15898
15899 * src/reader.c, src/reader.h (prologue_augment): New.
15900 * src/reader.c (copy_definition): Remove.
15901
15902 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
15903 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
15904 (grammar_current_rule_prec_set, grammar_current_rule_check)
15905 (grammar_current_rule_symbol_append)
15906 (grammar_current_rule_action_append): Export.
15907 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
15908 (symbol_list_action_append): Remove.
15909 Hook the routines from reader.
15910 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
15911 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
15912
15913 * src/reader.c (read_declarations): Remove, unused.
15914
15915 * src/parse-gram.y: Handle the epilogue.
15916 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
15917 (grammar_start_symbol_set): this.
15918 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
15919 * src/reader.c (readgram): Remove, unused.
15920 (reader): Adjust to insert eoftoken and axiom where appropriate.
15921
15922 * src/reader.c (copy_dollar): Replace with...
15923 * src/scan-gram.h (handle_dollar): this.
15924 * src/parse-gram.y: Remove `%thong'.
15925
15926 * src/reader.c (copy_at): Replace with...
15927 * src/scan-gram.h (handle_at): this.
15928
15929 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
15930 New.
15931
15932 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
15933 time being.
15934
15935 * src/reader.h, src/reader.c (grammar_rule_end): New.
15936
15937 * src/parse.y (current_type, current_class): New.
15938 Implement `%nterm', `%token' support.
15939 Merge `%term' into `%token'.
15940 (string_as_id): New.
15941 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
15942 type name.
15943
15944 * src/parse-gram.y: Be sure to handle properly the beginning of
15945 rules.
15946
15947 * src/parse-gram.y: Handle %type.
15948 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
15949
15950 * src/parse-gram.y: More directives support.
15951 * src/options.c: No longer handle source directives.
15952
15953 * src/parse-gram.y: Fix %output.
15954
15955 * src/parse-gram.y: Handle %union.
15956 Use the prologue locations.
15957 * src/reader.c (parse_union_decl): Remove.
15958
15959 * src/reader.h, src/reader.c (epilogue_set): New.
15960 * src/parse-gram.y: Use it.
15961
15962 * data/bison.simple, data/bison.c++: b4_stype is now either not
15963 defined, then default to int, or to the contents of %union,
15964 without `union' itself.
15965 Adjust.
15966 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
15967
15968 * src/output.c (actions_output): Don't output braces, as they are
15969 already handled by the scanner.
15970
15971 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
15972 characters to themselves.
15973
15974 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
15975 that the epilogue has a proper #line.
15976
15977 * src/parse-gram.y: Handle precedence/associativity.
15978
15979 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
15980 a terminal.
15981 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
15982 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
15983 at all to define terminals that cannot be emitted.
15984
15985 * src/scan-gram.l: Escape M4 characters.
15986
15987 * src/scan-gram.l: Working properly with escapes in user
15988 strings/characters.
15989
15990 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
15991 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
15992 grammar.
15993 Use more modest sizes, as for the time being the parser does not
15994 release memory, and therefore the process swallows a huge amount
15995 of memory.
15996
15997 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
15998 stricter %token grammar.
15999
16000 * src/symtab.h (associativity): Add `undef_assoc'.
16001 (symbol_precedence_set): Do nothing when passed an undef_assoc.
16002 * src/symtab.c (symbol_check_alias_consistence): Adjust.
16003
16004 * tests/regression.at (Invalid %directive): Remove, as it is now
16005 meaningless.
16006 (Invalid inputs): Adjust to the new error messages.
16007 (Token definitions): The new grammar doesn't allow too many
16008 eccentricities.
16009
16010 * src/lex.h, src/lex.c: Remove.
16011 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
16012 (copy_character, copy_string2, copy_string, copy_identifier)
16013 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
16014 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
16015 (parse_action): Remove.
16016 * po/POTFILES.in: Adjust.
16017
2e047461
AD
160182002-06-11 Akim Demaille <akim@epita.fr>
16019
cd05d13c 16020 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
16021 rule's action member: return the action as a string.
16022 Don't require `rule_length' as an argument: compute it.
16023 (grammar_current_rule_symbol_append)
16024 (grammar_current_rule_action_append): New, eved out from
16025 (readgram): here.
16026 Remove `action_flag', `rulelength', unused now.
16027
9af3fbce
AD
160282002-06-11 Akim Demaille <akim@epita.fr>
16029
16030 * src/reader.c (grammar_current_rule_prec_set).
16031 (grammar_current_rule_check): New, eved out from...
16032 (readgram): here.
16033 Remove `xaction', `first_rhs': useless.
16034 * tests/input.at (Type clashes): New.
16035 * tests/existing.at (GNU Cim Grammar): Adjust.
16036
1485e106
AD
160372002-06-11 Akim Demaille <akim@epita.fr>
16038
16039 * src/reader.c (grammar_midrule_action): New, Eved out from
16040 (readgram): here.
16041
da4160c3
AD
160422002-06-11 Akim Demaille <akim@epita.fr>
16043
16044 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
16045 New.
16046 (readgram): Use them as replacement of inlined code, crule and
16047 crule1.
16048
f6d0f937
AD
160492002-06-11 Akim Demaille <akim@epita.fr>
16050
16051 * src/reader.c (grammar_end, grammar_symbol_append): New.
16052 (readgram): Use them.
16053 Make the use of `p' as local as possible.
16054
69078d4b
AD
160552002-06-10 Akim Demaille <akim@epita.fr>
16056
16057 GCJ's parser requires the tokens to be defined before the prologue.
16058
16059 * data/bison.simple: Output the token definition before the user's
16060 prologue.
16061 * tests/regression.at (Braces parsing, Duplicate string)
16062 (Mixing %token styles): Check the output from bison.
16063 (Early token definitions): New.
16064
5e424082
AD
160652002-06-10 Akim Demaille <akim@epita.fr>
16066
16067 * src/symtab.c (symbol_user_token_number_set): Don't complain when
16068 assigning twice the same user number to a token, so that we can
16069 use it in...
16070 * src/lex.c (lex): here.
16071 Also use `symbol_class_set' instead of hand written code.
16072 * src/reader.c (parse_assoc_decl): Likewise.
16073
44536b35
AD
160742002-06-10 Akim Demaille <akim@epita.fr>
16075
16076 * src/symtab.c, src/symtab.c (symbol_class_set)
16077 (symbol_user_token_number_set): New.
16078 * src/reader.c (parse_token_decl): Use them.
16079 Use a switch instead of ifs.
16080 Use a single argument.
16081
8b9f2372
AD
160822002-06-10 Akim Demaille <akim@epita.fr>
16083
16084 Remove `%thong' support as it is undocumented, unused, duplicates
16085 `%token's job, and creates useless e-mail traffic with people who
16086 want to know what it is, why it is undocumented, unused, and
16087 duplicates `%token's job.
16088
16089 * src/reader.c (parse_thong_decl): Remove.
16090 * src/options.c (option_table): Remove "thong".
16091 * src/lex.h (tok_thong): Remove.
16092
3ae2b51f
AD
160932002-06-10 Akim Demaille <akim@epita.fr>
16094
16095 * src/symtab.c, src/symtab.c (symbol_type_set)
16096 (symbol_precedence_set): New.
16097 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
16098 (value_components_used): Remove, unused.
16099
2f1afb73
AD
161002002-06-09 Akim Demaille <akim@epita.fr>
16101
16102 Move symbols handling code out of the reader.
16103
16104 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
16105 (axiom): Move to...
16106 * src/symtab.h, src/symtab.c: here.
16107
16108 * src/gram.c (start_symbol): Remove: use startsymbol->number.
16109 * src/reader.c (startval): Rename as...
16110 * src/symtab.h, src/symtab.c (startsymbol): this.
16111 * src/reader.c: Adjust.
16112
16113 * src/reader.c (symbol_check_defined, symbol_make_alias)
16114 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16115 (token_translations_init)
16116 Move to...
16117 * src/symtab.c: here.
16118 * src/reader.c (packsymbols): Move to...
16119 * src/symtab.h, src/symtab.c (symbols_pack): here.
16120 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
16121 argument.
16122
e9bca3ad
AD
161232002-06-03 Akim Demaille <akim@epita.fr>
16124
16125 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
16126 then statements.
16127
86eff183
AD
161282002-06-03 Akim Demaille <akim@epita.fr>
16129
16130 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
16131 structs with non literals.
16132 * src/scan-skel.l: never-interactive.
16133 * src/conflicts.c (enum conflict_resolution_e): No trailing
16134 comma.
16135 * src/getargs.c (usage): Split long literal strings.
16136 Reported by Hans Aberg.
16137
717be197
AD
161382002-05-28 Akim Demaille <akim@epita.fr>
16139
16140 * data/bison.c++: Use C++ ostreams.
16141 (cdebug_): New member.
16142
670ddffd
AD
161432002-05-28 Akim Demaille <akim@epita.fr>
16144
16145 * src/output.c (output_skeleton): Be sure to allocate enough room
16146 for `/' _and_ for `\0' in full_skeleton.
16147
769b430f
AD
161482002-05-28 Akim Demaille <akim@epita.fr>
16149
16150 * data/bison.c++: Catch up with bison.simple:
16151 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16152 and Paul Eggert <eggert@twinsun.com>: `error' handing.
16153 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
16154 and popping traces.
16155
7067cb36
PH
161562002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16157
16158 * src/output.c (output_skeleton): Put an explicit path in front of
16159 the skeleton file name, rather than relying on the -I directory,
16160 to partially alleviate effects of having a skeleton file lying around
16161 in the current directory.
769b430f 16162
4a713ec2
PH
161632002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16164
769b430f 16165 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
16166 obstack_printf should be obstack_fgrow1.
16167
b408954b
AD
161682002-05-26 Akim Demaille <akim@epita.fr>
16169
16170 * src/state.h (state_t): `solved_conflicts' is a new member.
16171 * src/LR0.c (new_state): Set it to 0.
16172 * src/conflicts.h, src/conflicts.c (print_conflicts)
16173 (free_conflicts, solve_conflicts): Rename as...
16174 (conflicts_print, conflicts_free, conflicts_solve): these.
16175 Adjust callers.
16176 * src/conflicts.c (enum conflict_resolution_e)
16177 (solved_conflicts_obstack): New, used by...
16178 (log_resolution): this.
16179 Adjust to attach the conflict resolution to each state.
16180 Complete the description with the precedence/associativity
16181 information.
16182 (resolve_sr_conflict): Adjust.
16183 * src/print.c (print_state): Output its solved_conflicts.
16184 * tests/conflicts.at (Unresolved SR Conflicts)
16185 (Solved SR Conflicts): Exercise --report=all.
16186
a49aecd5
AD
161872002-05-26 Akim Demaille <akim@epita.fr>
16188
16189 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16190 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16191 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
16192 (token_number_t, item_number_as_token_number)
16193 (token_number_as_item_number, muscle_insert_token_number_table):
16194 Rename as...
16195 (symbol_number_t, item_number_as_symbol_number)
16196 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
16197 these, since it is more appropriate.
16198
5504898e
AD
161992002-05-26 Akim Demaille <akim@epita.fr>
16200
16201 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
16202 `Error:' lines.
16203 * data/bison.simple (yystos) [YYDEBUG]: New.
16204 (yyparse) [YYDEBUG]: Display the symbols which are popped during
16205 error recovery.
16206 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
16207
ec3bc396
AD
162082002-05-25 Akim Demaille <akim@epita.fr>
16209
16210 * doc/bison.texinfo (Debugging): Split into...
16211 (Tracing): this new section, its former contents, and...
16212 (Understanding): this new section.
16213 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
16214 by...
16215 (report_flag): this.
16216 Adjust all dependencies.
16217 (report_args, report_types, report_argmatch): New.
16218 (usage, getargs): Report/support -r, --report.
16219 * src/options.h
16220 (struct option_table_struct): Rename as..,
16221 (struct option_table_s): this.
16222 Rename the `set_flag' member to `flag' to match with getopt_long's
16223 struct.
16224 * src/options.c (option_table): Split verbose into an entry for
16225 %verbose, and another for --verbose.
16226 Support --report/-r, so remove -r from the obsolete --raw.
16227 * src/print.c: Attach full item sets and lookaheads reports to
16228 report_flag instead of trace_flag.
16229 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
16230
78df8250
PE
162312002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16232 and Paul Eggert <eggert@twinsun.com>
769b430f 16233
78df8250
PE
16234 * data/bison.simple (yyparse): Correct error handling to conform to
16235 POSIX and yacc. Specifically, after syntax error is discovered,
16236 do not reduce further before shifting the error token.
16237 Clean up the code a bit by removing the labels yyerrdefault,
16238 yyerrhandle, yyerrpop.
16239 * NEWS: Document the above.
16240
c0c9ea05
PH
162412002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16242
16243 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
16244 type; it isn't always big enough, since it doesn't necessarily
16245 include non-terminals.
769b430f 16246 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
16247 the latter can be removed.
16248 (yy_token_number_type): Remove, only one use.
16249 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
16250 don't use TokenNumberType as element type.
769b430f 16251
c0c9ea05
PH
16252 * tests/regression.at: Modify expected output to agree with change
16253 to yyr1 and yytranslate.
769b430f 16254
6390a83f
FK
162552002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
16256
16257 * src/reader.c (parse_action): Use copy_character instead of
16258 obstack_1grow.
16259
db7c8e9a
AD
162602002-05-13 Akim Demaille <akim@epita.fr>
16261
16262 * tests/regression.at (Token definitions): Prototype yylex and
16263 yyerror.
16264
fcc61800
PH
162652002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16266
158c687b 16267 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
16268 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
16269 32-bit arithmetic.
16270 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
16271
5683e9b2
AD
162722002-05-07 Akim Demaille <akim@epita.fr>
16273
16274 * tests/synclines.at: Be sure to prototype yylex and yyerror to
16275 avoid GCC warnings.
16276
0c2d3f4c
AD
162772002-05-07 Akim Demaille <akim@epita.fr>
16278
16279 Kill GCC warnings.
16280
16281 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
16282 over the RHS of each rule.
16283 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
16284 * src/state.h (state_t): Member `nitems' is unsigned short.
16285 * src/LR0.c (get_state): Adjust.
16286 * src/reader.c (packgram): Likewise.
16287 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
16288 `Type'.
16289 (muscle_insert_int_table): Remove, unused.
16290 (prepare_rules): Remove `max'.
16291
1565b720
AD
162922002-05-06 Akim Demaille <akim@epita.fr>
16293
16294 * src/closure.c (print_firsts): Display of the symbol tags.
16295 (bitmatrix_print): Move to...
16296 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
16297 here.
16298 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
16299
cfaee611
AD
163002002-05-06 Akim Demaille <akim@epita.fr>
16301
16302 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
16303 hash_do_for_each.
16304
458be8e0
AD
163052002-05-06 Akim Demaille <akim@epita.fr>
16306
16307 * src/LR0.c (new_state, get_state): Instead of using the global
16308 `kernel_size' and `kernel_base', have two new arguments:
16309 `core_size' and `core'.
16310 Adjust callers.
16311
a900a624
AD
163122002-05-06 Akim Demaille <akim@epita.fr>
16313
16314 * src/reader.c (packgram): No longer end `ritem' with a 0
16315 sentinel: it is not used.
16316
d4e7d3a1
AD
163172002-05-05 Akim Demaille <akim@epita.fr>
16318
16319 New experimental feature: display the lookaheads in the report and
16320 graph.
16321
16322 * src/print (print_core): When --trace-flag, display the rules
16323 lookaheads.
16324 * src/print_graph.c (print_core): Likewise.
16325 Swap the arguments.
16326 Adjust caller.
16327
39ceb25b
AD
163282002-05-05 Akim Demaille <akim@epita.fr>
16329
16330 * tests/torture.at (Many lookaheads): New test.
16331
5372019f
AD
163322002-05-05 Akim Demaille <akim@epita.fr>
16333
16334 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
16335 (GENERATE_MUSCLE_INSERT_TABLE): this.
16336 (output_int_table, output_unsigned_int_table, output_short_table)
16337 (output_token_number_table, output_item_number_table): Replace with...
16338 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
16339 (muscle_insert_short_table, muscle_insert_token_number_table)
16340 (muscle_insert_item_number_table): these.
16341 Adjust all callers.
16342 (prepare_tokens): Don't free `translations', since...
16343 * src/reader.h, src/reader.c (grammar_free): do it.
16344 Move to...
16345 * src/gram.h, src/gram.c (grammar_free): here.
16346 * data/bison.simple, data/bison.c++: b4_token_number_max is now
16347 b4_translate_max.
16348
5df5f6d5
AD
163492002-05-05 Akim Demaille <akim@epita.fr>
16350
16351 * src/output.c (output_unsigned_int_table): New.
16352 (prepare_rules): `i' is unsigned.
16353 `prhs', `rline', `r2' are unsigned int.
16354 Rename muscle `rhs_number_max' as `rhs_max'.
16355 Output muscles `prhs_max', `rline_max', and `r2_max'.
16356 Free rline and r1.
16357 * data/bison.simple, data/bison.c++: Adjust to use these muscles
16358 to compute types instead of constant types.
16359 * tests/regression.at (Web2c Actions): Adjust.
16360
b87f8b21
AD
163612002-05-04 Akim Demaille <akim@epita.fr>
16362
16363 * src/symtab.h (SALIAS, SUNDEF): Rename as...
16364 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
16365 Adjust dependencies.
16366 * src/output.c (token_definitions_output): Be sure not to output a
16367 `#define 'a'' when fed with `%token 'a' "a"'.
16368 * tests/regression.at (Token definitions): New.
16369
8bb936e4
PE
163702002-05-03 Paul Eggert <eggert@twinsun.com>
16371
16372 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
16373 for K&R C.
16374
163752002-05-03 gettextize <bug-gnu-gettext@gnu.org>
16376
16377 * Makefile.am (SUBDIRS): Remove intl.
16378 (EXTRA_DIST): Add config/config.rpath.
16379
53c71a12
AD
163802002-05-03 Akim Demaille <akim@epita.fr>
16381
16382 * data/bison.simple (m4_if): Don't output empty enums.
16383 And actually, output valid enum definitions :(.
16384
289dd0cf
AD
163852002-05-03 Akim Demaille <akim@epita.fr>
16386
16387 * configure.bat: Remove, completely obsolete.
16388 * Makefile.am (EXTRA_DIST): Adjust.
16389 Don't distribute config.rpath...
16390 * config/Makefile.am (EXTRA_DIST): Do it.
16391
db85e524
AD
163922002-05-03 Akim Demaille <akim@epita.fr>
16393
16394 * configure.in (GETTEXT_VERSION): New.
16395 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
16396
83ccf991
AD
163972002-05-03 Akim Demaille <akim@epita.fr>
16398
16399 * data/bison.simple (b4_token_enum): New.
16400 (b4_token_defines): Use it to output tokens both as #define and
16401 enums.
16402 Suggested by Paul Eggert.
16403 * src/output.c (token_definitions_output): Don't output spurious
16404 white spaces.
16405
1f418995
AD
164062002-05-03 Akim Demaille <akim@epita.fr>
16407
16408 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16409
45119f04
RA
164102002-05-02 Robert Anisko <robert@lrde.epita.fr>
16411
16412 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
16413 Update the stack class, give a try to deque as the default container.
16414
b2d52318
AD
164152002-05-02 Akim Demaille <akim@epita.fr>
16416
16417 * data/bison.simple (yyparse): Do not implement @$ = @1.
16418 (YYLLOC_DEFAULT): Adjust to do it.
16419 * doc/bison.texinfo (Location Default Action): Fix.
16420
3a8b4109
AD
164212002-05-02 Akim Demaille <akim@epita.fr>
16422
16423 * src/reader.c (parse_braces): Merge into...
16424 (parse_action): this.
16425
84614e13
AD
164262002-05-02 Akim Demaille <akim@epita.fr>
16427
16428 * configure.in (ALL_LINGUAS): Remove.
16429 * po/LINGUAS, hr.po: New.
16430
fdbcd8e2
AD
164312002-05-02 Akim Demaille <akim@epita.fr>
16432
16433 Remove the so called hairy (semantic) parsers.
16434
16435 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
16436 * src/gram.h, src/gram.c (semantic_parser): Remove.
16437 (rule_t): Remove the guard and guard_line members.
16438 * src/lex.h (token_t): remove tok_guard.
16439 * src/options.c (option_table): Remove %guard and %semantic_parser
16440 support.
16441 * src/output.c, src/output.h (guards_output): Remove.
16442 (prepare): Adjust.
16443 (token_definitions_output): Don't output the `T'
16444 tokens (???).
16445 (output_skeleton): Don't output the guards.
16446 * src/files.c, src/files.c (attrsfile): Remove.
16447 * src/reader.c (symbol_list): Remove the guard and guard_line
16448 members.
16449 Adjust dependencies.
16450 (parse_guard): Remove.
16451 * data/bison.hairy: Remove.
16452 * doc/bison.texinfo (Environment Variables): Remove occurrences of
16453 BISON_HAIRY.
16454
82b6cb3f
AD
164552002-05-02 Akim Demaille <akim@epita.fr>
16456
16457 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
16458 (parse_guard): Rename the formal argument `stack_offset' as
16459 `rule_length', which is more readable.
16460 Adjust callers.
16461 (copy_at, copy_dollar): Instead of outputting the hard coded
16462 values of $$, $n and so forth, output invocation to b4_lhs_value,
16463 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
16464 Note: this patch partially drops `semantic-parser' support: it
16465 always does `rule_length - n', where semantic parsers ought to
16466 always use `-n'.
82b6cb3f
AD
16467 * data/bison.simple, data/bison.c++ (b4_lhs_value)
16468 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
16469
6cbfbcc5
AD
164702002-05-02 Akim Demaille <akim@epita.fr>
16471
16472 * configure.in (AC_INIT): Bump to 1.49b.
16473 (AM_INIT_AUTOMAKE): Short invocation.
16474
b8548114
AD
164752002-05-02 Akim Demaille <akim@epita.fr>
16476
16477 Version 1.49a.
16478
c20cd1fa
AD
164792002-05-01 Akim Demaille <akim@epita.fr>
16480
16481 * src/skeleton.h: Remove.
16482
8a9566d4
AD
164832002-05-01 Akim Demaille <akim@epita.fr>
16484
16485 * src/skeleton.h: Fix the #endif.
16486 Reported by Magnus Fromreide.
16487
8c6d399a
PE
164882002-04-26 Paul Eggert <eggert@twinsun.com>
16489
16490 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
16491 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 16492 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 16493
2b7ed18a
RA
164942002-04-25 Robert Anisko <robert@lrde.epita.fr>
16495
16496 * src/scan-skel.l: Postprocess quadrigraphs.
16497
16498 * src/reader.c (copy_character): New function, used to output
16499 single characters while replacing `[' and `]' with quadrigraphs, to
16500 avoid troubles with M4 quotes.
16501 (copy_comment): Output characters with copy_character.
16502 (read_additionnal_code): Likewise.
16503 (copy_string2): Likewise.
16504 (copy_definition): Likewise.
16505
16506 * tests/calc.at: Exercise M4 quoting.
16507
34a89c50
AD
165082002-04-25 Akim Demaille <akim@epita.fr>
16509
16510 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
16511 between `!' and the command.
16512 Reported by Paul Eggert.
16513
0dd1580a
RA
165142002-04-24 Robert Anisko <robert@lrde.epita.fr>
16515
16516 * tests/calc.at: Exercise prologue splitting.
16517
16518 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
16519 `b4_post_prologue' instead of `b4_prologue'.
16520
16521 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
16522 muscles.
16523 (output): Free pre_prologue_obstack and post_prologue_obstack.
16524 * src/files.h, src/files.c (attrs_obstack): Remove.
16525 (pre_prologue_obstack, post_prologue_obstack): New.
16526 * src/reader.c (copy_definition): Add a parameter to specify the
16527 obstack to fill, instead of using attrs_obstack unconditionally.
16528 (read_declarations): Pass pre_prologue_obstack to copy_definition if
16529 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
16530
83c1796f
PE
165312002-04-23 Paul Eggert <eggert@twinsun.com>
16532
16533 * data/bison.simple: Remove unnecessary commentary and white
16534 space differences from 1_29-branch.
16535 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
16536
16537 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
16538 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
16539 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
16540 constructors or destructors.
16541
16542 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
16543
1207eeac
AD
165442002-04-23 Akim Demaille <akim@epita.fr>
16545
16546 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
16547 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
16548 location with columns.
16549 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
16550 All reported by Paul Eggert.
16551
78ab8f67
AD
165522002-04-22 Akim Demaille <akim@epita.fr>
16553
16554 * src/reduce.c (dump_grammar): Move to...
16555 * src/gram.h, src/gram.c (grammar_dump): here.
16556 Be sure to separate long item numbers.
16557 Don't read the members of a rule's prec if its nil.
16558
133c20e2
AD
165592002-04-22 Akim Demaille <akim@epita.fr>
16560
16561 * src/output.c (table_size, table_grow): New.
16562 (MAXTABLE): Remove, replace uses with table_size.
16563 (pack_vector): Instead of dying when the table is too big, grow it.
16564
9515e8a7
AD
165652002-04-22 Akim Demaille <akim@epita.fr>
16566
16567 * data/bison.simple (yyr1): Its type is that of a token number.
16568 * data/bison.c++ (r1_): Likewise.
16569 * tests/regression.at (Web2c Actions): Adjust.
16570
23c5a174
AD
165712002-04-22 Akim Demaille <akim@epita.fr>
16572
16573 * src/reader.c (token_translations_init): 256 is now the default
16574 value for the error token, i.e., it will be assigned another
16575 number if the user assigned 256 to one of her tokens.
16576 (reader): Don't force 256 to error.
16577 * doc/bison.texinfo (Symbols): Adjust.
16578 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
16579 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
16580 etc. instead of 10, 20, 30 (which was used to `jump' over error
16581 (256) and undefined (2)).
16582
5fbb0954
AD
165832002-04-22 Akim Demaille <akim@epita.fr>
16584
16585 Propagate more token_number_t.
16586
16587 * src/gram.h (token_number_as_item_number)
16588 (item_number_as_token_number): New.
16589 * src/output.c (GENERATE_OUTPUT_TABLE): New.
16590 Use it to create output_item_number_table and
16591 output_token_number_table.
16592 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
16593 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
16594 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
16595 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
16596
4f940944
AD
165972002-04-22 Akim Demaille <akim@epita.fr>
16598
16599 * src/output.h, src/output.c (get_lines_number): Remove.
16600
3ded9a63
AD
166012002-04-19 Akim Demaille <akim@epita.fr>
16602
16603 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
16604 as Lex/Flex'.
16605 (Debugging): More details about enabling the debugging features.
16606 (Table of Symbols): Describe $$, $n, @$, and @n.
16607 Suggested by Tim Josling.
16608
e0c471a9
AD
166092002-04-19 Akim Demaille <akim@epita.fr>
16610
16611 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
16612
fecc10cd
AD
166132002-04-10 Akim Demaille <akim@epita.fr>
16614
16615 * src/system.h: Rely on HAVE_LIMITS_H.
16616 Suggested by Paul Eggert.
16617
51dec47b
AD
166182002-04-09 Akim Demaille <akim@epita.fr>
16619
16620 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
16621 full stderr, and strip it according to the bison options, instead
16622 of composing the error message from different bits.
16623 This makes it easier to check for several error messages.
16624 Adjust all the invocations.
16625 Add an invocation exercising the error token.
16626 Add an invocation demonstrating a stupid error message.
16627 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
16628 Adjust the tests.
16629 Error message are for stderr, not stdout.
16630
007a50a4
AD
166312002-04-09 Akim Demaille <akim@epita.fr>
16632
16633 * src/gram.h, src/gram.c (error_token_number): Remove, use
16634 errtoken->number.
16635 * src/reader.c (reader): Don't specify the user token number (2)
16636 for $undefined, as it uselessly prevents using it.
16637 * src/gram.h (token_number_t): Move to...
16638 * src/symtab.h: here.
16639 (state_t.number): Is a token_number_t.
16640 * src/print.c, src/reader.c: Use undeftoken->number instead of
16641 hard coded 2.
16642 (Even though this 2 is not the same as above: the number of the
16643 undeftoken remains being 2, it is its user token number which
16644 might not be 2).
16645 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
16646 `user_token_number_max'.
16647 Output `undef_token_number'.
16648 * data/bison.simple, data/bison.c++: Use them.
16649 Be sure to map invalid yylex return values to
16650 `undef_token_number'. This saves us from gratuitous SEGV.
16651
16652 * tests/conflicts.at (Solved SR Conflicts)
16653 (Unresolved SR Conflicts): Adjust.
16654 * tests/regression.at (Web2c Actions): Adjust.
16655
06446ccf
AD
166562002-04-08 Akim Demaille <akim@epita.fr>
16657
16658 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
16659 Adding #line.
16660 Remove the duplicate `typedefs'.
16661 (RhsNumberType): Fix the declaration and various other typos.
16662 Use __ofile__.
16663 * data/bison.simple: Use __ofile__.
16664 * src/scan-skel.l: Handle __ofile__.
16665
62a3e4f0
AD
166662002-04-08 Akim Demaille <akim@epita.fr>
16667
16668 * src/gram.h (item_number_t): New, the type of item numbers in
16669 RITEM. Note that it must be able to code symbol numbers as
16670 positive number, and the negation of rule numbers as negative
16671 numbers.
16672 Adjust all dependencies (pretty many).
16673 * src/reduce.c (rule): Remove this `short *' pointer: use
16674 item_number_t.
16675 * src/system.h (MINSHORT, MAXSHORT): Remove.
16676 Include `limits.h'.
16677 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
16678 (shortcpy): Remove.
16679 (MAXTABLE): Move to...
16680 * src/output.c (MAXTABLE): here.
16681 (prepare_rules): Use output_int_table to output rhs.
16682 * data/bison.simple, data/bison.c++: Adjust.
16683 * tests/torture.at (Big triangle): Move the limit from 254 to
16684 500.
16685 * tests/regression.at (Web2c Actions): Ajust.
16686
16687 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
16688 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
16689 passes, but produces negative #line number, once fixed, GCC is
16690 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
16691 C), it passes.
16692 * src/state.h (state_h): Code input lines on ints, not shorts.
16693
bb88b0fc
AD
166942002-04-08 Akim Demaille <akim@epita.fr>
16695
16696 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
16697 and then the grammar.
16698
9a636f47
AD
166992002-04-08 Akim Demaille <akim@epita.fr>
16700
16701 * src/system.h: No longer using strndup.
16702
680e8701
AD
167032002-04-07 Akim Demaille <akim@epita.fr>
16704
16705 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
16706 * src/output.c (output_table_data): Return the longest number.
16707 (prepare_tokens): Output `token_number_max').
16708 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
16709 New.
16710 Use them to define yy_token_number_type/TokenNumberType.
16711 Use this type for yytranslate.
16712 * tests/torture.at (Big triangle): Push the limit from 124 to
16713 253.
16714 * tests/regression.at (Web2c Actions): Adjust.
16715
817e9f41
AD
167162002-04-07 Akim Demaille <akim@epita.fr>
16717
16718 * tests/torture.at (Big triangle): New.
16719 (GNU AWK Grammar, GNU Cim Grammar): Move to...
16720 * tests/existing.at: here.
16721
5123689b
AD
167222002-04-07 Akim Demaille <akim@epita.fr>
16723
16724 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
16725 nritems.
16726 Adjust dependencies.
16727
f3849179
AD
167282002-04-07 Akim Demaille <akim@epita.fr>
16729
16730 * src/reader.c: Normalize increments to prefix form.
16731
bd02036a
AD
167322002-04-07 Akim Demaille <akim@epita.fr>
16733
16734 * src/reader.c, symtab.c: Remove debugging code.
16735
db8837cb
AD
167362002-04-07 Akim Demaille <akim@epita.fr>
16737
16738 Rename all the `bucket's as `symbol_t'.
16739
16740 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
16741 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
16742 * src/symtab.c, src/symtab.h (bucket): Rename as...
16743 (symbol_t): this.
16744 (symbol_list_new, bucket_check_defined, bucket_make_alias)
16745 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
16746 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16747 (buckets_new, buckets_free, buckets_do): Rename as...
16748 (symbol_list_new, symbol_check_defined, symbol_make_alias)
16749 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
16750 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
16751 (symbols_new, symbols_free, symbols_do): these.
16752
72a23c97
AD
167532002-04-07 Akim Demaille <akim@epita.fr>
16754
16755 Use lib/hash for the symbol table.
16756
16757 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
16758 EOF.
16759 * src/lex.c (lex): Set the `number' member of new terminals.
16760 * src/reader.c (bucket_check_defined, bucket_make_alias)
16761 (bucket_check_alias_consistence, bucket_translation): New.
16762 (reader, grammar_free, readgram, token_translations_init)
16763 (packsymbols): Adjust.
16764 (reader): Number the predefined tokens.
16765 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
16766 for predefined tokens.
16767 * src/symtab.h (bucket): Remove all the hash table related
16768 members.
16769 * src/symtab.c (symtab): Replace by...
16770 (bucket_table): this.
16771 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
16772 (buckets_new, buckets_do): New.
16773
280a38c3
AD
167742002-04-07 Akim Demaille <akim@epita.fr>
16775
16776 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
16777 (start_symbol, max_user_token_number, semantic_parser)
16778 (error_token_number): Initialize.
16779 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
16780 Initialize.
16781 (reader): Don't.
16782 (errtoken, eoftoken, undeftoken, axiom): Extern.
16783
03b31c0c
AD
167842002-04-07 Akim Demaille <akim@epita.fr>
16785
16786 * src/gram.h (rule_s): prec and precsym are now pointers
16787 to the bucket giving the priority/associativity.
16788 Member `associativity' removed: useless.
16789 * src/reduce.c, src/conflicts.c: Adjust.
16790
8b3df748
AD
167912002-04-07 Akim Demaille <akim@epita.fr>
16792
16793 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
16794 Properly escape the symbols' TAG when outputting them.
16795
e601aa1d
AD
167962002-04-07 Akim Demaille <akim@epita.fr>
16797
16798 * src/lalr.h (LA): Is a bitsetv, not bitset*.
16799
b0299a2e
AD
168002002-04-07 Akim Demaille <akim@epita.fr>
16801
16802 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
16803 (LArule): this, which is an array to rule_t*.
16804 * src/print.c, src/conflicts.c: Adjust.
16805
d7e1f00c
AD
168062002-04-07 Akim Demaille <akim@epita.fr>
16807
16808 * src/gram.h (rule_t): Rename `number' as `user_number'.
16809 `number' is a new member.
16810 Adjust dependencies.
16811 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
16812
cc9305dd
AD
168132002-04-07 Akim Demaille <akim@epita.fr>
16814
16815 As a result of the previous patch, it is no longer needed
16816 to reorder ritem itself.
16817
16818 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
16819
b0940840
AD
168202002-04-07 Akim Demaille <akim@epita.fr>
16821
16822 Be sure never to walk through RITEMS, but use only data related to
16823 the rules themselves. RITEMS should be banished.
16824
16825 * src/output.c (output_token_translations): Rename as...
16826 (prepare_tokens): this.
16827 In addition to `translate', prepare the muscles `tname' and
16828 `toknum', which were handled by...
16829 (output_rule_data): this.
16830 Remove, and move the remainder of its outputs into...
16831 (prepare_rules): this new routines, which also merges content from
16832 (output_gram): this.
16833 (prepare_rules): Be sure never to walk through RITEMS.
16834 (output_stos): Rename as...
16835 (prepare_stos): this.
16836 (output): Always invoke prepare_states, after all, just don't use it
16837 in the output if you don't need it.
16838
643a5994
AD
168392002-04-07 Akim Demaille <akim@epita.fr>
16840
16841 * src/LR0.c (new_state): Display `nstates' as the name of the
16842 newly created state.
16843 Adjust to initialize first_state and last_state if needed.
16844 Be sure to distinguish the initial from the final state.
16845 (new_states): Create the itemset of the initial state, and use
16846 new_state.
16847 * src/closure.c (closure): Now that the initial state has its
16848 items properly set, there is no need for a special case when
16849 creating `ruleset'.
16850
16851 As a result, now the rule 0, reducing to $axiom, is visible in the
16852 outputs. Adjust the test suite.
16853
16854 * tests/conflicts.at (Solved SR Conflicts)
16855 (Unresolved SR Conflicts): Adjust.
16856 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
16857 * tests/conflicts.at (S/R in initial): New.
16858
b4c4ccc2
AD
168592002-04-07 Akim Demaille <akim@epita.fr>
16860
16861 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
16862 the RHS of the rules.
16863 * src/output.c (output_gram): Likewise.
16864
bba97eb2
AD
168652002-04-07 Akim Demaille <akim@epita.fr>
16866
16867 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
16868 bucket.
16869 Adjust all dependencies.
16870 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
16871 `number' of the buckets too.
16872 * src/gram.h: Include `symtab.h'.
16873 (associativity): Move to...
16874 * src/symtab.h: here.
16875 No longer include `gram.h'.
16876
c3b407f4
AD
168772002-04-07 Akim Demaille <akim@epita.fr>
16878
16879 * src/gram.h, src/gram.c (rules_rhs_length): New.
16880 (ritem_longest_rhs): Use it.
16881 * src/gram.h (rule_t): `number' is a new member.
16882 * src/reader.c (packgram): Set it.
16883 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
16884 the end of `rules', and count them out of `nrules'.
16885 (reduce_output, dump_grammar): Adjust.
16886 * src/print.c (print_grammar): It is no longer needed to check for
16887 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
16888 * tests/reduce.at (Reduced Automaton): New test.
16889
11652ab3
AD
168902002-04-07 Akim Demaille <akim@epita.fr>
16891
16892 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
16893 lacking `+ 1' to nrules, Bison reported as useless a token if it
16894 was used solely to set the precedence of the last rule...
16895
26b23c1a
AD
168962002-04-07 Akim Demaille <akim@epita.fr>
16897
16898 * data/bison.c++, data/bison.simple: Don't output the current file
16899 name in #line, to avoid useless diffs between two identical
16900 outputs under different names.
16901
18bcecb0
AD
169022002-04-07 Akim Demaille <akim@epita.fr>
16903
16904 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
16905 Normalize loops to using `< nrules + 1', not `<= nrules'.
16906
fa770c86
AD
169072002-04-07 Akim Demaille <akim@epita.fr>
16908
16909 * TODO: Update.
16910
d9b739c3
AD
169112002-04-07 Akim Demaille <akim@epita.fr>
16912
16913 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
16914 bucket.value as bucket.number.
16915
99013900
AD
169162002-04-07 Akim Demaille <akim@epita.fr>
16917
16918 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
16919 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
16920 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
16921 RHS, instead of being an index in RITEMS.
16922
e966383b
PE
169232002-04-04 Paul Eggert <eggert@twinsun.com>
16924
16925 * doc/bison.texinfo: Update copyright date.
16926 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
16927 (Symbols): Warn about running Bison in one character set,
16928 but compiling and/or running in an incompatible one.
16929 Warn about character code 256, too.
16930
169312002-04-03 Paul Eggert <eggert@twinsun.com>
16932
16933 * src/bison.data (YYSTACK_ALLOC): Depend on whether
16934 YYERROR_VERBOSE is nonzero, not whether it is defined.
16935
16936 Merge changes from bison-1_29-branch.
c307773e 16937
8d6c48b9
PE
169382002-03-20 Paul Eggert <eggert@twinsun.com>
16939
16940 Merge fixes from Debian bison_1.34-1.diff.
16941
16942 * configure.in (AC_PREREQ): 2.53.
16943
e53c6322
AD
169442002-03-20 Akim Demaille <akim@epita.fr>
16945
16946 * src/conflicts.c (log_resolution): Argument `resolution' is const.
16947
9ffbeca7
PE
169482002-03-19 Paul Eggert <eggert@twinsun.com>
16949
21db0b2a
PE
16950 * src/bison.simple (YYCOPY): New macro.
16951 (YYSTACK_RELOCATE): Use it.
16952 Remove Type arg; no longer needed. All callers changed.
16953 (yymemcpy): Remove; no longer needed.
16954
9ffbeca7
PE
16955 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
16956 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16957
642cb8f8
AD
169582002-03-19 Akim Demaille <akim@epita.fr>
16959
16960 Test and fix the #line outputs.
16961
16962 * tests/atlocal.at (GCC): New.
16963 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 16964 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
16965 (Action synch line, Epilogue synch line): New tests.
16966 * src/reader.c (parse_union_decl): Define the muscle stype_line.
16967 * data/bison.simple, data/bison.c++: Use it.
16968
3c31a486
AD
169692002-03-19 Akim Demaille <akim@epita.fr>
16970
16971 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
16972 (Solved SR Conflicts, %expect not enough, %expect right)
16973 (%expect too much): Move to...
16974 * tests/conflicts.at: this new file.
16975
0d8bed56
AD
169762002-03-19 Akim Demaille <akim@epita.fr>
16977
16978 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
16979 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
16980 that we can move to enums for instance.
16981 * src/output.c (token_definitions_output): Output a list of
16982 `token-name, token-number' instead of the #define.
16983 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
16984
9208d17f
AD
169852002-03-14 Akim Demaille <akim@epita.fr>
16986
16987 Use Gettext 0.11.1.
16988
af27eacb
RA
169892002-03-09 Robert Anisko <robert@lrde.epita.fr>
16990
16991 * data/bison.c++: Make the user able to add members to the generated
16992 parser by subclassing.
16993
9101a310
RA
169942002-03-05 Robert Anisko <robert@lrde.epita.fr>
16995
16996 * src/reader.c (read_additionnal_code): `c' should be an integer, not
16997 a character.
16998 Reported by Nicolas Tisserand and Nicolas Burrus.
16999
fff9bf0b
RA
170002002-03-04 Robert Anisko <robert@lrde.epita.fr>
17001
17002 * src/reader.c: Warn about lacking semi-colons, do not complain.
17003
64dba31e
RA
170042002-03-04 Robert Anisko <robert@lrde.epita.fr>
17005
17006 * data/bison.c++: Remove a debug line.
17007
374f5a14
RA
170082002-03-04 Robert Anisko <robert@lrde.epita.fr>
17009
17010 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
17011 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
17012 provide a default implementation.
17013
bfcf1f3a
AD
170142002-03-04 Akim Demaille <akim@epita.fr>
17015
17016 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
17017 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
17018 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
17019 * tests/semantic.at (Parsing Guards): Similarly.
17020 * src/reader.at (readgram): Complain if the last rule is not ended
17021 with a semi-colon.
17022
65ccf9fc
AD
170232002-03-04 Akim Demaille <akim@epita.fr>
17024
17025 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
17026 * src/closure.c: here.
17027 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
17028 RTC.
17029 * src/warshall.h, src/warshall.c: Remove.
17030 * tests/sets.at (Broken Closure): Adjust.
17031
d0039cbc
AD
170322002-03-04 Akim Demaille <akim@epita.fr>
17033
17034 * src/output.c (output_skeleton): tempdir is const.
17035 bytes_read is unused.
17036
345cea78
AD
170372002-03-04 Akim Demaille <akim@epita.fr>
17038
17039 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
17040 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
17041 Update.
17042 From Michael Hayes.
17043
564801f7
AD
170442002-03-04 Akim Demaille <akim@epita.fr>
17045
17046 * src/closure.c (closure): `r' is unused.
17047
e5352bc7
AD
170482002-03-04 Akim Demaille <akim@epita.fr>
17049
17050 * tests/sets.at (Broken Closure): Add the ending `;'.
17051 * src/reader.at (readgram): Complain if a rule is not ended with a
17052 semi-colon.
17053
914feea9
AD
170542002-03-04 Akim Demaille <akim@epita.fr>
17055
17056 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
17057 (count_sr_conflicts): Use bitset_count.
17058 * src/reduce.c (inaccessable_symbols): Ditto.
17059 (bits_size): Remove.
17060 * src/warshall.h, src/warshall.c: Convert to bitsetv.
17061
f0250de6
AD
170622002-03-04 Akim Demaille <akim@epita.fr>
17063
17064 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
17065 * src/reduce.c: Remove the `bitset_zero's following the
17066 `bitset_create's, as now it is performed by the latter.
17067
ef017502
AD
170682002-03-04 Akim Demaille <akim@epita.fr>
17069
17070 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
17071 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
17072 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
17073 latest sources from Michael.
17074
76514394
AD
170752002-03-04 Akim Demaille <akim@epita.fr>
17076
17077 * src/output.c (output): Don't free the grammar.
17078 * src/reader.c (grammar_free): New.
17079 * src/main.c (main): Call it and don't free symtab here.
17080
55024580
AD
170812002-03-04 Akim Demaille <akim@epita.fr>
17082
17083 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
17084 before returning.
17085 Reported by Benoit Perrot.
17086
f9abaa2c
AD
170872002-03-04 Akim Demaille <akim@epita.fr>
17088
17089 Use bitset operations when possible, not loops over bits.
17090
17091 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
17092 bitset_or.
17093 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
17094 * src/reduce.c (useless_nonterminals): Formatting changes.
17095 * src/warshall.c (TC): Use bitset_or.
17096
0e721e75
AD
170972002-03-04 Akim Demaille <akim@epita.fr>
17098
17099 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
17100 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
17101 Ditto.
17102
0fb1ffb1
AD
171032002-03-04 Akim Demaille <akim@epita.fr>
17104
17105 * src/lalr.c (F): Now a bitset*.
17106 Adjust all dependencies.
17107
b86796bf
AD
171082002-03-04 Akim Demaille <akim@epita.fr>
17109
17110 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
17111 Adjust all dependencies.
17112
602bbf31
AD
171132002-03-04 Akim Demaille <akim@epita.fr>
17114
17115 * src/L0.c, src/LR0.h (nstates): Be size_t.
17116 Adjust comparisons (signed vs unsigned).
17117 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
17118 bitset*.
17119 Adjust all dependencies.
17120
d8a0245c
AD
171212002-03-04 Akim Demaille <akim@epita.fr>
17122
17123 * src/closure.c (firsts): Now, also a bitset.
17124 Adjust all dependencies.
17125 (varsetsize): Remove, now unused.
17126 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
17127
34ba9743
AD
171282002-03-04 Akim Demaille <akim@epita.fr>
17129
17130 * src/print.c: Convert to use bitset.h, not hand coded iterations
17131 over ints.
17132
ed86e78c
AD
171332002-03-04 Akim Demaille <akim@epita.fr>
17134
17135 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
17136
dfdb1797
AD
171372002-03-04 Akim Demaille <akim@epita.fr>
17138
17139 * src/closure.c (ruleset): Be a bitset.
17140 (rulesetsize): Remove.
17141
7086e707
AD
171422002-03-04 Akim Demaille <akim@epita.fr>
17143
17144 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
17145 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
17146 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
17147 * src/closure.c (fderives): Be an array of bitsets.
17148
98254360
RA
171492002-02-28 Robert Anisko <robert@lrde.epita.fr>
17150
17151 * data/bison.c++: Merge the two generated headers. Insert a copyright
17152 notice in each output file.
17153
a75c057f
AD
171542002-02-28 Akim Demaille <akim@epita.fr>
17155
17156 * data/bison.c++: Copy the prologue of bison.simple to fetch
17157 useful M4 definitions, such as b4_header_guard.
17158
06b00abc
AD
171592002-02-25 Akim Demaille <akim@epita.fr>
17160
17161 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
17162 translator friendly scheme for the bgr
17163 copyright notice.
06b00abc 17164
70e7d534
AD
171652002-02-25 Akim Demaille <akim@epita.fr>
17166
17167 * src/output.c (header_output): Remove, now handled completely via
17168 M4.
17169
abe017f6
AD
171702002-02-25 Akim Demaille <akim@epita.fr>
17171
17172 * m4/m4.m4: New, from CVS Autoconf.
17173 * configure.in: Invoke it.
17174 * src/output.c (output_skeleton): Use its result instead of the
17175 hard coded name.
17176
381fb12e
AD
171772002-02-25 Akim Demaille <akim@epita.fr>
17178
17179 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
17180 Fileutils 4.1.5.
17181 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
17182 * src/output.c (output_skeleton): Use mkstemp to create a real
17183 temporary file.
17184 Move the filling of `skeleton' and its muscle to...
17185 (prepare): here.
17186 (output): Move the definition of the prologue muscle to...
17187 (prepare): here.
17188 * src/system.h (DEFAULT_TMPDIR): New.
17189
6f38107f
PE
171902002-02-14 Paul Eggert <eggert@twinsun.com>
17191
17192 Remove the support for C++ namespace cleanliness; it was
17193 causing more problems than it was curing, since it didn't work
17194 properly on some nonstandard C++ compilers. This can wait
17195 for a proper C++ parser.
17196
17197 * NEWS: Document this.
17198 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
17199 of C++, as it's treated like C now.
17200 * src/bison.simple (YYSTD): Remove.
17201 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
17202 Treat C++ just like Standard C instead of trying to support
17203 namespace cleanliness.
17204
80cce3da
AD
172052002-02-14 Akim Demaille <akim@epita.fr>
17206
17207 * tests/regression.at (else): Adjust to Andreas' change.
17208
842e8679
AD
172092002-02-14 Akim Demaille <akim@epita.fr>
17210
17211 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
17212
4bda3f10
AD
172132002-02-13 Andreas Schwab <schwab@suse.de>
17214
17215 * src/output.c (output_rule_data): Don't output NULL, it might
17216 not be defined yet.
17217
4162fa07 172182002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 17219
4162fa07
RA
17220 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
17221 (Copyright notice): Update.
b418ecd8 17222
bd16a5dc
AD
172232002-02-11 Akim Demaille <akim@epita.fr>
17224
17225 * tests/regression.at (%nonassoc and eof): Don't include
17226 nonportable headers.
17227
8d69a1a3
RA
172282002-02-08 Robert Anisko <robert@lrde.epita.fr>
17229
17230 * data/bison.c++: Correct error recovery. Make the user able to
17231 initialize the starting location.
17232
9b2d0677
AD
172332002-02-07 Akim Demaille <akim@epita.fr>
17234
17235 * tests/input.at: New.
17236
69e2658b
RA
172372002-02-07 Robert Anisko <robert@lrde.epita.fr>
17238
17239 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 17240 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
17241 directives around tables only needed for debugging.
17242
4aacc3a7
RA
172432002-02-07 Robert Anisko <robert@lrde.epita.fr>
17244
17245 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
17246 C++ parsers.
17247 (yy::b4_name::parse): Use print_.
17248
762a801e
RA
172492002-02-07 Robert Anisko <robert@lrde.epita.fr>
17250
17251 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
17252
4bb2bc3f
RA
172532002-02-07 Robert Anisko <robert@lrde.epita.fr>
17254
17255 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
17256 C++ parsers.
17257 (yy::b4_name::parse): Build verbose error messages, and use error_.
17258
6b45a3ca
RA
172592002-02-06 Robert Anisko <robert@lrde.epita.fr>
17260
17261 * data/bison.c++: Fix m4 quoting in comments.
17262
50997c6e
RA
172632002-02-06 Robert Anisko <robert@lrde.epita.fr>
17264
17265 * data/bison.c++: Adjust the parser code. Fix some muscles that were
17266 not expanded by m4.
17267
3f3eed27
AD
172682002-02-05 Akim Demaille <akim@epita.fr>
17269
17270 * data/bison.c++: Adjust to the M4 back end.
17271 More is certainly needed.
17272
be2a1a68
AD
172732002-02-05 Akim Demaille <akim@epita.fr>
17274
17275 Give a try to M4 as a back end.
17276
17277 * lib/readpipe.c: New, from wdiff.
17278 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
17279 BISON_HAIRY.
17280 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
17281 specific values. Now it is m4 that performs the lookup.
17282 * src/parse-skel.y: Remove.
17283 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
17284 * src/output.c (actions_output, guards_output)
17285 (token_definitions_output): No longer keeps track of the output
17286 line number, hence remove the second argument.
17287 (guards_output): Check against the guard member of a rule, not the
17288 action member.
17289 Adjust callers.
17290 (output_skeleton): Don't look for the skeleton location, let m4 do
17291 that.
17292 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
17293 file will be used.
17294 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
17295 (prepare): Given that for the time being changesyntax is not
17296 usable in M4, rename the muscles using `-' to `_'.
17297 Define `defines_flag', `output_parser_name' and `output_header_name'.
17298 * src/output.h (actions_output, guards_output)
17299 (token_definitions_output): Adjust prototypes.
17300 * src/scan-skel.l: Instead of scanning the skeletons, it now
17301 processes the output of m4: `__oline__' and `#output'.
17302 * data/bison.simple: Adjust to be used by M4(sugar).
17303 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
17304 to date.
17305 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
17306 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
17307 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
17308 shamelessly stolen from CVS Autoconf.
17309
beda758b
AD
173102002-02-05 Akim Demaille <akim@epita.fr>
17311
17312 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
17313 * configure.in: Check for the declarations of free and malloc.
17314 * src/muscle_tab.c: Adjust.
17315
5ece6d43
AD
173162002-02-05 Akim Demaille <akim@epita.fr>
17317
17318 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
17319 which have no values.
17320
5bb18f9a
AD
173212002-02-05 Akim Demaille <akim@epita.fr>
17322
17323 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
17324 * data/: here.
17325
894dd62e
PE
173262002-01-29 Paul Eggert <eggert@twinsun.com>
17327
17328 * src/bison.simple (YYSIZE_T): Do not define merely because
17329 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
17330 On some platforms, <alloca.h> does not declare YYSTD (size_t).
17331
82841af7
AD
173322002-01-27 Akim Demaille <akim@epita.fr>
17333
17334 Fix `%nonassoc and eof'.
17335
17336 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
17337 which were not properly copied! Replace
17338 memcpy (res->errs, src->errs, src->nerrs);
17339 with
17340 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
17341 !!!
17342 * tests/regression.at (%nonassoc and eof): Adjust to newest
17343 Autotest: `.' is not in the PATH.
17344
318b76e9
AD
173452002-01-27 Akim Demaille <akim@epita.fr>
17346
17347 * tests/sets.at (AT_EXTRACT_SETS): New.
17348 (Nullable): Use it.
17349 (Firsts): New.
17350
30d2f3d5
AD
173512002-01-26 Akim Demaille <akim@epita.fr>
17352
17353 * tests/actions.at, tests/calc.at, tests/headers.at,
17354 * tests/torture.at: Adjust to the newest Autotest which no longer
17355 forces `.' in the PATH.
17356
30f8c395
AD
173572002-01-25 Akim Demaille <akim@epita.fr>
17358
17359 * tests/regression.at (%nonassoc and eof): New.
17360 Suggested by Robert Anisko.
17361
29ae55f1
AD
173622002-01-24 Akim Demaille <akim@epita.fr>
17363
17364 Bison dumps core when trying to complain about broken input files.
17365 Reported by Cris van Pelt.
17366
17367 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
17368 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
17369 into...
17370 (Invalid inputs): Strengthen: exercise parse_percent_token.
17371
2b548aa6
RA
173722002-01-24 Robert Anisko <robert.anisko@epita.fr>
17373
17374 * src/Makefile.am: Add bison.c++.
17375 * src/bison.c++: New skeleton.
17376
bb0146c2
AD
173772002-01-21 Paolo Bonzini <bonzini@gnu.org>
17378
17379 * po/it.po: New.
17380
bec30531
AD
173812002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
17382
17383 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
17384
fc6edc45
MA
173852002-01-20 Marc Autret <marc@gnu.org>
17386
17387 * src/files.c (compute_output_file_names): Fix
17388
5e5d5415
MA
173892002-01-20 Marc Autret <marc@gnu.org>
17390
17391 * tests/output.at: New test.
17392 * src/files.c (compute_base_names): Don't map extensions when
17393 the YACC flag is set, use defaults.
17394 Reported by Evgeny Stambulchik.
17395
44ea3fbd
MA
173962002-01-20 Marc Autret <marc@gnu.org>
17397
ba0fe3c7
PE
17398 * src/system.h: Need to define __attribute__ away for non-GCC
17399 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
17400 Suggested by Albert Chin-A-Young.
17401
338963d1
TVH
174022002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
17403
17404 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
17405 canonical definition.
17406 * src/system.h: Use the canonical definition for PARAMS (avoids
17407 a conflict with the macro from lib/hash.h).
17408
c57b2479
AD
174092002-01-11 Akim Demaille <akim@epita.fr>
17410
17411 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 17412 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 17413
b85810ae
AD
174142002-01-09 Akim Demaille <akim@epita.fr>
17415
17416 * src/files.c, src/files.h (output_infix): New.
17417 (tab_extension): Remove.
17418 (compute_base_names): Compute the former, drop the latter.
17419 * src/output.c (prepare): Insert the muscles `output-infix', and
17420 `output-suffix'.
17421 * src/parse-skel.y (string, string.1): New.
17422 (section.header): Use it.
17423 (section.yacc): Remove.
17424 (prefix): Remove too.
17425 * src/scan-skel.l: Adjust.
17426 * src/bison.simple, src/bison.hairy: Adjust.
17427
cae60122
AD
174282002-01-09 Akim Demaille <akim@epita.fr>
17429
17430 * configure.in (WERROR_CFLAGS): Compute it.
17431 * src/Makefile.am (CFLAGS): Pass it.
17432 * tests/atlocal.in (CFLAGS): Idem.
17433 * src/files.c: Fix a few warnings.
17434 (get_extension_index): Remove, unused.
17435
ae404801
AD
174362002-01-08 Akim Demaille <akim@epita.fr>
17437
17438 * src/getargs.c (AS_FILE_NAME): New.
17439 (getargs): Use it to convert DOSish file names.
17440 * src/files.c (base_name): Rename as full_base_name to avoid
17441 clashes with `base_name ()'.
17442 (filename_split): New.
17443 (compute_base_names): N-th rewrite, using filename_split.
17444
22312b71
AD
174452002-01-08 Akim Demaille <akim@epita.fr>
17446
17447 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
17448 New, stolen from the Fileutils 4.1.
17449 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
17450 * configure.in: Check for the presence of memrchr, and of its
17451 prototype.
17452
a67cef01
TVH
174532002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
17454
17455 * lib/hash.h (__P): Added definition for this macro.
17456 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
17457 BUILT_SOURCES, to ensure they are generated first.
17458 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
17459 %error-verbose to allow bootstrapping with bison 1.30x.
17460
2b25d624
AD
174612002-01-06 Akim Demaille <akim@epita.fr>
17462
17463 * src/reader.c (parse_braces): Don't fetch the next char, the
17464 convention is to fetch on entry.
17465 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
17466 'switch' without a following semicolon.
17467 * tests/regression.at (braces parsing): New.
17468
3460813b
AD
174692002-01-06 Akim Demaille <akim@epita.fr>
17470
17471 Bison is dead wrong in its RR conflict reports.
17472
17473 * tests/torture.at (GNU Cim Grammar): New.
17474 * src/conflicts.c (count_rr_conflicts): Fix.
17475
73784c64
AD
174762002-01-06 Akim Demaille <akim@epita.fr>
17477
17478 Creating package.m4 from configure.ac causes too many problems.
17479
17480 * tests/Makefile.am (package.m4): Create it by hand,
17481 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
17482
25d81090
AD
174832002-01-06 Akim Demaille <akim@epita.fr>
17484
17485 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
17486 skeleton.h.
17487
a9b8959e
PE
174882002-01-04 Paul Eggert <eggert@twinsun.com>
17489
17490 * doc/bison.texinfo (Debugging):
17491 Remove YYSTDERR; it's no longer defined or used.
17492 Also, s/cstdio.h/cstdio/.
17493
25d81090
AD
174942002-01-03 Akim Demaille <akim@epita.fr>
17495
17496 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
17497
1109455c
AD
174982002-01-03 Akim Demaille <akim@epita.fr>
17499
17500 * src/parse-skel.y (process_skeleton): Don't bind the parser's
17501 tracing code to --trace, wait for a better --trace option, with
17502 args.
17503
7ea5e977
AD
175042002-01-03 Akim Demaille <akim@epita.fr>
17505
17506 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
17507 The ISO C++ standard is extremely clear about it: stderr is
17508 considered a macro, not a regular symbol (see table 94 `Header
17509 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
17510 Therefore std:: does not apply to it. It still does with fprintf.
17511 Also, s/cstdio.h/cstdio/.
17512
fab5b110
AD
175132002-01-03 Akim Demaille <akim@epita.fr>
17514
17515 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
17516 for non system headers.
17517
aed7fd9b
AD
175182002-01-02 Akim Demaille <akim@epita.fr>
17519
17520 Equip the skeleton chain with location tracking, runtime trace,
17521 pure parser and scanner.
17522
17523 * src/parse-skel.y: Request a pure parser, locations, and prefix
17524 renaming.
17525 (%union): Having several members with the same type does not help
17526 type mismatches, simplify.
17527 (YYPRINT, yyprint): New.
17528 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
17529 (skel_error): this.
17530 Handle locations.
17531 * src/scan-skel.l: Adjust to these changes.
17532 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
17533 (LOCATION_PRINT, skel_control_t): New.
17534
24fad99e
AD
175352001-12-30 Akim Demaille <akim@epita.fr>
17536
17537 * src/parse-skel.y: Get rid of the shift/reduce conflict:
17538 replace `gb' with BLANKS.
17539 * src/scan-skel.l: Adjust.
17540
a4b36db4
AD
175412001-12-30 Akim Demaille <akim@epita.fr>
17542
17543 * src/system.h: We don't need nor want bcopy.
17544 Throw away MS-DOS crap: we don't need getpid.
17545 * configure.in: We don't need strndup. It was even causing
17546 problems: because Flex includes the headers *before* us,
17547 _GNU_SOURCE is not defined by config.h, and therefore strndup was
17548 not visible.
17549 * lib/xstrndup.c: New.
17550 * src/scan-skel.l: Use it.
17551 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
17552 * src/parse-skel.y: Use %directives instead of #defines.
17553
1239777d
AD
175542001-12-30 Akim Demaille <akim@epita.fr>
17555
17556 * src/skeleton.h: New.
17557 * src/output.c (output_parser, output_master_parser): Remove, dead
17558 code.
17559 * src/output.h (get_lines_number, actions_output, guards_output)
17560 (token_definitions_output): Prototype them.
17561 * src/parse-skel.y: Add the license notice.
17562 Include output.h and skeleton.h.
17563 (process_skeleton): Returns void, and takes a single parameter.
17564 * src/scan-skel.l: Add the license notice.
17565 Include skeleton.h.
17566 Don't use %option yylineno: it seems that then Flex imagines
17567 REJECT has been used, and therefore it won't reallocate its
17568 buffers (which makes no other sense to me than a bug). It results
17569 in warnings for `unused: yy_flex_realloc'.
17570
9b3add5b
RA
175712001-12-30 Robert Anisko <robert.anisko@epita.fr>
17572
17573 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17574 (MUSCLE_INSERT_PREFIX): ...to there.
17575 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
17576 (MUSCLE_INSERT_PREFIX): Move from here...
17577
17578 * src/bison.hairy: Add a section directive. Put braces around muscle
17579 names. This parser skeleton is still broken, but Bison should not
17580 choke on a bad muscle 'syntax'.
17581 * src/bison.simple: Add a section directive. Put braces around muscle
17582 names.
17583
17584 * src/files.h (strsuffix, stringappend): Add declarations.
17585 (tab_extension): Add declaration.
17586 (short_base_name): Add declaration.
17587
17588 * src/files.c (strsuffix, stringappend): No longer static. These
17589 functions are used in the skeleton parser.
17590 (tab_extension): New.
17591 (compute_base_names): Use the computations done in this function
fab5b110 17592 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
17593 names.
17594 (short_base_name): No longer static.
17595
17596 * src/output.c (output_skeleton): New.
17597 (output): Disable call to output_master_parser, and give a try to
17598 a new skeleton handling system.
17599 (guards_output, actions_output): No longer static.
17600 (token_definitions_output, get_lines_number): No longer static.
17601
17602 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
17603
fab5b110 17604 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
17605 parse-skel.y.
17606
17607 * src/parse-skel.y: New file.
17608 * src/scan-skel.l: New file.
17609
b5b61c61
AD
176102001-12-29 Akim Demaille <akim@epita.fr>
17611
17612 %name-prefix is broken.
17613
17614 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
17615 Adjust all dependencies.
17616 * tests/headers.at (export YYLTYPE): Strengthen this test: use
17617 %name-prefix.
17618
17619 Renaming yylval but not yylloc is not consistent. Now we do.
17620
17621 * src/bison.simple: Prefix yylloc if used.
17622 * doc/bison.texinfo (Decl Summary): Document that.
17623
8c9a50be
AD
176242001-12-29 Akim Demaille <akim@epita.fr>
17625
17626 * doc/bison.texinfo: Promote `%long-directive' over
17627 `%long_directive'.
17628 Remove all references to fixed-output-files, yacc is enough.
17629
d99361e6
AD
176302001-12-29 Akim Demaille <akim@epita.fr>
17631
17632 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
17633 user prologue. These are defaults.
17634 * tests/actions.at (Mid-rule actions): Make sure the user can
17635 define YYDEBUG and YYERROR_VERBOSE.
17636
b9cecb91
AD
176372001-12-29 Akim Demaille <akim@epita.fr>
17638
17639 * src/output.c (header_output): Don't forget to export YYLTYPE and
17640 yylloc.
17641 * tests/headers.at (export YYLTYPE): New, make sure it does.
17642 * tests/regression.at (%union and --defines, Invalid CPP headers):
17643 Move to...
17644 * tests/headers.at: here.
17645
aea13e97
AD
176462001-12-29 Akim Demaille <akim@epita.fr>
17647
17648 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
17649
931394cb
AD
176502001-12-29 Akim Demaille <akim@epita.fr>
17651
17652 * tests/actions.at (Mid-rule actions): Output on a single line
17653 instead of several.
17654
704a47c4
AD
176552001-12-29 Akim Demaille <akim@epita.fr>
17656
17657 * doc/bison.texinfo: Formatting changes.
17658
091e20bb
AD
176592001-12-29 Akim Demaille <akim@epita.fr>
17660
17661 Don't store the token defs in a muscle, just be ready to output it
17662 on command. Now possible via `symbols'. Fixes a memory leak.
17663
17664 * src/output.c (token_definitions_output): New.
17665 (output_parser, header_output): Use it.
17666 * src/reader.c (symbols_save): Remove.
17667
cce71710
AD
176682001-12-29 Akim Demaille <akim@epita.fr>
17669
17670 * src/bison.simple: Do not provide a default for YYSTYPE and
17671 YYLTYPE before the user's prologue. Otherwise it's hardly... a
17672 default.
17673
82c035a8
AD
176742001-12-29 Akim Demaille <akim@epita.fr>
17675
17676 Mid-rule actions are simply... ignored!
17677
17678 * src/reader.c (readgram): Be sure to attach mid-rule actions to
17679 the empty-rule associated to the dummy symbol, not to the host
17680 rule.
17681 * tests/actions.at (Mid-rule actions): New.
17682
8419d367
AD
176832001-12-29 Akim Demaille <akim@epita.fr>
17684
17685 Memory leak.
17686
17687 * src/reader.c (reader): Free grammar.
17688
375d5806
AD
176892001-12-29 Akim Demaille <akim@epita.fr>
17690
17691 Memory leak.
17692
17693 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
17694 since it allocates it for each state, although only one is needed.
17695 (allocate_storage): Do it here.
17696
f51cb8ff
AD
176972001-12-29 Akim Demaille <akim@epita.fr>
17698
17699 * src/options.h, src/options.c (create_long_option_table): Rename
17700 as...
17701 (long_option_table_new): this, with a clearer prototype.
17702 (percent_table): Remove, unused,
17703 * src/getargs.c (getargs): Adjust.
17704
29e88316
AD
177052001-12-29 Akim Demaille <akim@epita.fr>
17706
17707 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
17708 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
17709 as states.
17710
b9f71f19
AD
177112001-12-29 Akim Demaille <akim@epita.fr>
17712
17713 * src/lalr.c (build_relations): Rename `states' as `states1'.
17714 Sorry, I don't understand exactly what it is, no better name...
17715
1a2b5d37
AD
177162001-12-29 Akim Demaille <akim@epita.fr>
17717
17718 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
17719 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
17720 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
17721 as rules.
17722
1cca533e
AD
177232001-12-29 Akim Demaille <akim@epita.fr>
17724
17725 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
17726 ago.
17727
c03ae966
AD
177282001-12-29 Akim Demaille <akim@epita.fr>
17729
17730 * src/reader.c, src/reader.h (user_toknums): Remove.
17731 Adjust all users to use symbols[i]->user_token_number.
17732
5a670b1e
AD
177332001-12-29 Akim Demaille <akim@epita.fr>
17734
17735 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
17736 Adjust all users to use symbols[i]->prec or ->assoc.
17737
ad949da9
AD
177382001-12-29 Akim Demaille <akim@epita.fr>
17739
17740 * src/reader.c, src/reader.h (tags): Remove.
17741 Adjust all users to use symbols[i]->tag.
17742
0e78e603
AD
177432001-12-29 Akim Demaille <akim@epita.fr>
17744
17745 * src/gram.h, src/gram.c (symbols): New, similar to state_table
17746 and rule_table.
17747 * src/reader.c (packsymbols): Fill this table.
17748 Drop sprec.
17749 * src/conflicts.c (resolve_sr_conflict): Adjust.
17750 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
17751 single table.
17752 Use symbols[i]->tag instead of tags[i].
17753
213e640e
AD
177542001-12-29 Akim Demaille <akim@epita.fr>
17755
17756 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
17757 In addition, put a comment in there, to replace...
17758 * tests/regression.at (%union and C comments): Remove.
17759
e7b8bef1
AD
177602001-12-29 Akim Demaille <akim@epita.fr>
17761
17762 * tests/regression.at (Web2c Actions): Blindly move the actual
17763 output as expected output. The contents *seem* right to me, but I
17764 can't pretend reading perfectly parser tables... Nonetheless, all
17765 the other tests pass correctly, the table look OK, even though the
17766 presence of `$axiom' is to be noted: AFAICS it is useless (but
17767 harmless).
17768
b68e7744
AD
177692001-12-29 Akim Demaille <akim@epita.fr>
17770
17771 * src/reader.c (readgram): Don't add the rule 0 if there were no
17772 rules read. In other words, add it _after_ having performed
17773 grammar sanity checks.
17774 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
17775
78d5bae9
AD
177762001-12-29 Akim Demaille <akim@epita.fr>
17777
17778 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
17779 visible, and some states have now a different number.
17780
ff442794
AD
177812001-12-29 Akim Demaille <akim@epita.fr>
17782
17783 * src/reader.c (readgram): Bind the initial rule's lineno to that
17784 of the first rule.
17785 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
17786 (Solved SR Conflicts): Adjust rule 0's line number.
17787
610ab194
AD
177882001-12-29 Akim Demaille <akim@epita.fr>
17789
17790 Fix the `GAWK Grammar' failure.
17791
17792 * src/LR0.c (final_state): Initialize to -1 so that we do compute
17793 the reductions of the first state which was mistakenly confused
17794 with the final state because precisely final_state was initialized
17795 to 0.
17796 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
17797 now noticed by Bison.
17798 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
17799 have a reduction on $default.
17800
29d29c8f
AD
178012001-12-29 Akim Demaille <akim@epita.fr>
17802
17803 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
17804 rule line numbers.
17805 * src/closure.c (print_closure): Likewise.
17806 * src/derives.c (print_derives): Likewise.
17807 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
17808 now.
17809
7c6b64d0
AD
178102001-12-29 Akim Demaille <akim@epita.fr>
17811
17812 * src/lalr.c (lookaheads_print): New.
17813 (lalr): Call it when --trace-flag.
17814 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
17815 are dumped.
17816
3d4daee3
AD
178172001-12-29 Akim Demaille <akim@epita.fr>
17818
17819 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
17820 when walking through ritem, even via rule->rhs.
17821 * src/reduce.c (dump_grammar, useful_production, reduce_output)
17822 (useful_production, useless_nonterminals): Likewise.
17823 (reduce_grammar_tables): Likewise, plus update nritems.
17824 * src/nullable.c (set_nullable): Likewise.
17825 * src/lalr.c (build_relations): Likewise.
17826 * tests/sets.at (Nullable): Adjust.
17827 Fortunately, now, the $axiom is no longer nullable.
17828
9e7f6bbd
AD
178292001-12-29 Akim Demaille <akim@epita.fr>
17830
17831 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
17832 the 0-sentinel.
17833 * src/gram.c (ritem_longest_rhs): Likewise.
17834 * src/reduce.c (nonterminals_reduce): Likewise.
17835 * src/print_graph.c (print_graph): Likewise.
17836 * src/output.c (output_rule_data): Likewise.
17837 * src/nullable.c (set_nullable): Likewise.
17838
255ef638
AD
178392001-12-29 Akim Demaille <akim@epita.fr>
17840
17841 * src/output.c: Comment changes.
17842
0d8a7363
AD
178432001-12-27 Paul Eggert <eggert@twinsun.com>
17844
17845 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
17846 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
17847 Sparc, as they were causing more porting problems than the
17848 (minor) performance improvement was worth.
17849
17850 Also, catch up with 1.31's YYSTD.
17851
3db472b9
AD
178522001-12-27 Akim Demaille <akim@epita.fr>
17853
17854 * src/output.c (output_gram): Rely on nritems, not the
17855 0-sentinel. See below.
17856 Use -1 as separator, not 0.
17857 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
17858 Rely on -1 as separator in yyrhs, instead of 0.
17859 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
17860 twice `Now at end of input', therefore there are two lines less to
17861 expect.
17862
b365aa05
AD
178632001-12-27 Akim Demaille <akim@epita.fr>
17864
17865 * tests/regression.at (Unresolved SR Conflicts):
17866 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
17867 below.
17868
30171f79
AD
178692001-12-27 Akim Demaille <akim@epita.fr>
17870
17871 * src/LR0.c (new_state): Recognize the final state by the fact it
17872 is reached by eoftoken.
17873 (insert_start_shifting_state, insert_eof_shifting_state)
17874 (insert_accepting_state, augment_automaton): Remove, since now
17875 these states are automatically computed from the initial state.
17876 (generate_states): Adjust.
17877 * src/print.c: When reporting a rule number to the user, substract
17878 1, so that the axiom rule is rule 0, and the first user rule is 1.
17879 * src/reduce.c: Likewise.
17880 * src/print_graph.c (print_core): For the time being, just as for
17881 the report, depend upon --trace-flags to dump the full set of
17882 items.
17883 * src/reader.c (readgram): Once the grammar read, insert the rule
17884 0: `$axiom: START-SYMBOL $'.
17885 * tests/set.at: Adjust: rule 0 is now displayed, and since the
17886 number of the states has changed (the final state is no longer
17887 necessarily the last), catch up.
17888
75142d45
AD
178892001-12-27 Akim Demaille <akim@epita.fr>
17890
17891 Try to make the use of the eoftoken valid. Given that its value
17892 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
17893 is used instead of > 0 where appropriate, (ii), depend upon nritems
17894 instead of the 0-sentinel.
17895
17896 * src/gram.h, src/gram.c (nritems): New.
17897 Expected to be duplication of nitems, but for the time being...
17898 * src/reader.c (packgram): Assert nritems and nitems are equal.
17899 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
17900 * src/closure.c (print_closure, print_fderives): Likewise.
17901 * src/gram.c (ritem_print): Likewise.
17902 * src/print.c (print_core, print_grammar): Likewise.
17903 * src/print_graph.c: Likewise.
17904
b7c49edf
AD
179052001-12-27 Akim Demaille <akim@epita.fr>
17906
17907 * src/main.c (main): If there are complains after grammar
17908 reductions, then output the report anyway if requested, then die.
17909 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
17910 * src/reader.c (eoftoken): New.
17911 (parse_token_decl): If the token being defined has value `0', it
17912 is the eoftoken.
17913 (packsymbols): No longer hack `tags' to insert `$' by hand.
17914 Be sure to preserve the value of the eoftoken.
17915 (reader): Make sure eoftoken is defined.
17916 Initialize nsyms to 0: now eoftoken is created just like the others.
17917 * src/print.c (print_grammar): Don't special case the eof token.
17918 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
17919 lie anyway, albeit pleasant.
17920 * tests/calc.at: Exercise error messages with eoftoken.
17921 Change the grammar so that empty input is invalid.
17922 Adjust expectations.
17923 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
17924
ec2da99f
AD
179252001-12-27 Akim Demaille <akim@epita.fr>
17926
17927 * configure.in: Check the protos of strchr ans strspn.
17928 Replace strchr if needed.
17929 * src/system.h: Provide the protos of strchr, strspn and memchr if
17930 missing.
17931 * lib/strchr.c: New.
17932 * src/reader.c (symbols_save): Use strchr.
17933
8adfa272
AD
179342001-12-27 Akim Demaille <akim@epita.fr>
17935
17936 * src/print.c, src/print_graph.c (escape): New.
17937 Use it to quote the TAGS outputs.
17938 * src/print_graph.c (print_state): Now errors are in red, and
17939 reductions in green.
17940 Prefer high to wide: output the state number on a line of its own.
17941
80dac38c
AD
179422001-12-27 Akim Demaille <akim@epita.fr>
17943
17944 * src/state.h, src/state.c (reductions_new): New.
17945 * src/LR0.c (set_state_table): Let all the states have a
17946 `reductions', even if reduced to 0.
17947 (save_reductions): Adjust.
17948 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
17949 * src/print.c (print_reductions, print_actions): Adjust.
17950 * src/output.c (action_row): Adjust.
17951
2cec70b9
AD
179522001-12-27 Akim Demaille <akim@epita.fr>
17953
17954 * src/state.h, src/state.c (errs_new, errs_dup): New.
17955 * src/LR0.c (set_state_table): Let all the states have an errs,
17956 even if reduced to 0.
17957 * src/print.c (print_errs, print_reductions): Adjust.
17958 * src/output.c (output_actions, action_row): Adjust.
17959 * src/conflicts.c (resolve_sr_conflict): Adjust.
17960
13ca549a
AD
179612001-12-27 Akim Demaille <akim@epita.fr>
17962
17963 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
17964
5092aba5
AD
179652001-12-27 Akim Demaille <akim@epita.fr>
17966
17967 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
17968 * src/print.c: here.
17969 (lookaheadset, shiftset): New, used as additional storage by
17970 print_reductions.
17971 (print_results): Adjust.
17972 (print_shifts, print_gotos, print_errs): New, extracted from...
17973 (print_actions): here.
17974 * src/print_graph.c (print_actions): Remove dead code.
17975
11e2beca
AD
179762001-12-27 Akim Demaille <akim@epita.fr>
17977
17978 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
17979 `$n' and `@n'.
17980
dac3c910
AD
179812001-12-27 Akim Demaille <akim@epita.fr>
17982
17983 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
17984 (build_relations): Adjust.
17985
d0b0fefa
AD
179862001-12-27 Akim Demaille <akim@epita.fr>
17987
17988 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
17989 duplication.
17990
adc8c848
AD
179912001-12-27 Akim Demaille <akim@epita.fr>
17992
17993 * src/reader.c (packgram): Catch nitems overflows.
17994
14d293ac
AD
179952001-12-27 Akim Demaille <akim@epita.fr>
17996
17997 * src/files.c, src/files.h (guard_obstack): Remove.
17998 * src/output.c (output): Adjust.
17999 * src/reader.c (parse_braces): New, factoring...
18000 (copy_action, copy_guard): these two which are renamed as...
18001 (parse_action, parse_guard): these.
18002 As a voluntary consequence, using braces around guards is now
18003 mandatory.
18004
f499b062
AD
180052001-12-27 Akim Demaille <akim@epita.fr>
18006
18007 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
18008 * src/reader.c (symbol_list): `guard' and `guard_line' are new
18009 members.
18010 (symbol_list_new): Adjust.
18011 (copy_action): action_line is the first line, not the last.
18012 (copy_guard): Just as for actions, store the `action' only, not
18013 the switch/case/break flesh.
18014 Don't parse the user action that might follow the guard, let...
18015 (readgram): do it, i.e., now, there can be an action after a
18016 guard.
18017 In other words the guard is just explicitly optional.
18018 (packgram): Adjust.
18019 * src/output.c (guards_output): New.
18020 (output_parser): Call it when needed.
18021 (output): Also free the guard and attrs obstacks.
18022 * src/files.c, src/files.h (obstack_save): Remove.
18023 (output_files): Remove.
18024 As a result, if one needs the former `.act' file, using an
18025 appropriate skeleton which requires actions and guards is now
18026 required.
18027 * src/main.c (main): Adjust.
18028 * tests/semantic.at: New.
18029 * tests/regression.at: Use `input.y' as input file name.
18030 Avoid 8+3 problems by requiring input.c when the test needs the
18031 parser.
18032
d945f5cd
AD
180332001-12-27 Akim Demaille <akim@epita.fr>
18034
18035 * src/reader.c (symbol_list_new): Be sure to initialize all the
18036 fields.
18037
d200e455
AD
180382001-12-27 Akim Demaille <akim@epita.fr>
18039
18040 All the hacks using a final pseudo state are now useless.
18041
18042 * src/LR0.c (set_state_table): state_table holds exactly nstates.
18043 * src/lalr.c (nLA): New.
18044 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
18045 instead of lookaheadsp from the pseudo state (nstate + 1).
18046
f9507c28
AD
180472001-12-27 Akim Demaille <akim@epita.fr>
18048
18049 * src/output.c (action_row, token_actions): Use a state_t instead
18050 of a integer, and nlookaheads instead of the following state's
18051 lookaheadsp.
18052
065fbd27
AD
180532001-12-27 Akim Demaille <akim@epita.fr>
18054
18055 * src/conflicts.c (log_resolution, flush_shift)
18056 (resolve_sr_conflict, set_conflicts, solve_conflicts)
18057 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
18058 (conflicts_print, print_reductions): Use a state_t instead of an
18059 integer when referring to a state.
18060 As much as possible, depend upon nlookaheads, instead of the
18061 `lookaheadsp' member of the following state (since lookaheads of
18062 successive states are successive, the difference between state n + 1
18063 and n served as the number of lookaheads for state n).
18064 * src/lalr.c (add_lookback_edge): Likewise.
18065 * src/print.c (print_core, print_actions, print_state)
18066 (print_results): Likewise.
18067 * src/print_graph.c (print_core, print_actions, print_state)
18068 (print_graph): Likewise.
18069 * src/conflicts.h: Adjust.
18070
1b177bd7
AD
180712001-12-27 Akim Demaille <akim@epita.fr>
18072
18073 * src/bison.hairy: Formatting/comment changes.
18074 ANSIfy.
18075 Remove `register' indications.
18076 Add plenty of `static'.
18077
7742ddeb
AD
180782001-12-27 Akim Demaille <akim@epita.fr>
18079
18080 * src/output.c (prepare): Drop the muscle `ntbase' which
18081 duplicates ntokens.
18082 * src/bison.simple: Formatting/comment changes.
18083 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
18084 is an undocumented synonym.
18085
1fa14068
AD
180862001-12-22 Akim Demaille <akim@epita.fr>
18087
18088 * src/output.c (output_table_data): Change the prototype to use
18089 `int' for array ranges: some invocations do pass an int, not a
18090 short.
18091 Reported by Wayne Green.
18092
b9752825
AD
180932001-12-22 Akim Demaille <akim@epita.fr>
18094
18095 Some actions of web2c.y are improperly triggered.
18096 Reported by Mike Castle.
18097
18098 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
18099 * tests/regression.at (Web2c): Rename as...
18100 (Web2c Report): this.
18101 (Web2c Actions): New.
18102
776209d6
AD
181032001-12-22 Akim Demaille <akim@epita.fr>
18104
18105 Reductions in web2c.y are improperly reported.
18106 Reported by Mike Castle.
18107
18108 * src/conflicts.c (print_reductions): Fix.
18109 * tests/regression.at (Web2c): New.
18110
275fc3ad
AD
181112001-12-18 Akim Demaille <akim@epita.fr>
18112
18113 Some host fail on `assert (!"foo")', which expands to
18114 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
18115 Reported by Nelson Beebee.
18116
18117 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
18118 `#define it_succeeded 0' and `assert (it_succeeded)'.
18119
897668ee
MA
181202001-12-17 Marc Autret <autret_m@epita.fr>
18121
18122 * src/bison.simple: Don't hard code the skeleton line and filename.
18123 * src/output.c (output_parser): Rename 'line' as 'output_line'.
18124 New line counter 'skeleton_line' (skeleton-line muscle).
18125
ab3399e0
PE
181262001-12-17 Paul Eggert <eggert@twinsun.com>
18127
18128 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
18129 YYDEBUG must be defined to a nonzero value.
18130
18131 * src/bison.simple (yytname): Do not assume that the user defines
18132 YYDEBUG to a properly parenthesized expression.
18133
3877f72b
AD
181342001-12-17 Akim Demaille <akim@epita.fr>
18135
18136 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
18137 nlookaheads is a new member.
18138 Adjust all users.
18139 * src/lalr.h (nlookaheads): Remove this orphan declaration.
18140 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
18141 state.
776209d6 18142
331dbc1b
AD
181432001-12-17 Akim Demaille <akim@epita.fr>
18144
18145 * src/files.h, src/files.c (open_files, close_files): Remove.
18146 * src/main.c (main): Don't open/close files, nor invoke lex_free,
18147 let...
18148 * src/reader.c (reader): Do it.
776209d6 18149
be750e4c
AD
181502001-12-17 Akim Demaille <akim@epita.fr>
18151
18152 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 18153
709ae8c6
AD
181542001-12-17 Akim Demaille <akim@epita.fr>
18155
18156 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
18157 (flush_reduce): New.
18158 (resolve_sr_conflict): Adjust.
776209d6 18159
f87685c3
AD
181602001-12-17 Akim Demaille <akim@epita.fr>
18161
18162 * src/output.c (output_obstack): Be static and rename as...
18163 (format_obstack): this, to avoid any confusion with files.c's
18164 output_obstack.
18165 * src/reader.h (muscle_obstack): Move to...
18166 * src/output.h: here, since it's defined in output.c.
18167
837491d8
AD
181682001-12-17 Akim Demaille <akim@epita.fr>
18169
18170 * src/output.c (action_row, save_column, default_goto)
18171 (sort_actions, matching_state, pack_vector): Better variable
18172 locality.
18173
796d61fb
AD
181742001-12-17 Akim Demaille <akim@epita.fr>
18175
18176 * src/output.c: Various formatting changes.
776209d6 18177
64d15509
AD
181782001-12-17 Akim Demaille <akim@epita.fr>
18179
18180 * src/files.c (output_files): Free the output_obstack.
18181 * src/main.c (main): Call print and print_graph conditionally.
18182 * src/print.c (print): Work unconditionally.
18183 * src/print_graph.c (print_graph): Work unconditionally.
18184 * src/conflicts.c (log_resolution): Output only if verbose_flag.
18185
fbc8ecb7
MA
181862001-12-16 Marc Autret <autret_m@epita.fr>
18187
18188 * src/output.c (actions_output): Fix. When we use %no-lines,
18189 there is one less line per action.
18190
f0440388
MA
181912001-12-16 Marc Autret <autret_m@epita.fr>
18192
18193 * src/bison.simple: Remove a useless #line directive.
18194 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
18195 * src/output.c (get_lines_number): New.
776209d6 18196 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
18197 output muscles.
18198 Fix line numbering.
18199 (actions_output): Computes the number of lines taken by actions.
18200 (output_master_parser): Insert new skeleton which is the name of
18201 the output parser file name.
18202
a79986b8
MA
182032001-12-15 Marc Autret <autret_m@epita.fr>
18204
18205 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
18206
4ec8e00f
MA
182072001-12-15 Marc Autret <autret_m@epita.fr>
18208
18209 * src/output.c (output_gram): Keep track of the hairy one.
18210
1a4648ff
AD
182112001-12-15 Akim Demaille <akim@epita.fr>
18212
18213 Make `make distcheck' work.
18214
18215 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
18216 system.h which uses libgettext.h.
18217
9c2c67e6
AD
182182001-12-15 Akim Demaille <akim@epita.fr>
18219
18220 * src/nullable.c (set_nullable): Useless rules must be skipped,
18221 otherwise, since we range over their symbols, we might look at a
18222 nonterminal which no longer ``exists'', i.e., it is not counted in
18223 `nvars', hence we overflow our arrays.
18224
93ede233
AD
182252001-12-15 Akim Demaille <akim@epita.fr>
18226
18227 The header can also be produced directly, without any obstack!
18228 Yahoo!
18229
18230 * src/files.c, src/files.h (defines_obstack): Remove.
18231 (compute_header_macro): Global.
18232 (defines_obstack_save): Remove.
18233 * src/reader.c (parse_union_decl): No longer output to
18234 defines_obstack: its content can be found in the `stype' muscle
18235 anyway.
18236 (output_token_translations): Merge into...
18237 (symbols_output): this.
18238 Rename as...
18239 (symbols_save): this.
18240 (reader): Adjust.
18241 * src/output.c (header_output): New.
18242 (output): Call it.
18243
2666f928
AD
182442001-12-15 Akim Demaille <akim@epita.fr>
18245
18246 * src/reader.c (parse_union_decl): Instead of handling two obstack
18247 simultaneously, use one to define the `stype' muscle, and use the
18248 value of the latter to fill defines_obstack.
18249 (copy_comment): Remove.
18250 (copy_comment2): Work for a single obstack.
18251 Rename as...
18252 (copy_comment): this.
18253
428046f8
AD
182542001-12-15 Akim Demaille <akim@epita.fr>
18255
18256 * src/lex.c, src/lex.h (xgetc): No longer static.
18257 * src/reader.c (parse_union_decl): Revamp.
18258
ea52d706
AD
182592001-12-15 Akim Demaille <akim@epita.fr>
18260
18261 Still making progress in separating Bison into (i) input, (ii)
18262 process, (iii) output: now we can directly output the parser file
18263 without using table_obstack at all.
18264
18265 * src/files.c, src/files.h (table_obstack): Bye bye.
18266 (parser_file_name): New.
18267 * src/files.c (compute_output_file_names): Compute it.
18268 * src/output.c (actions_output, output_parser)
18269 (output_master_parser): To a file instead of an obstack.
18270
3f96f4dc
AD
182712001-12-15 Akim Demaille <akim@epita.fr>
18272
18273 Attach actions to rules, instead of pre-outputting them to
18274 actions_obstack.
18275
18276 * src/gram.h (rule_t): action and action_line are new members.
18277 * src/reader.c (symbol_list): Likewise.
18278 (copy_action): Save the actions within the rule.
18279 (packgram): Save them in rule_table.
18280 * src/output.c (actions_output): New.
18281 (output_parser): Use it on `%%actions'.
18282 (output_rule_data): Don't free rule_table.
18283 (output): Do it.
18284 (prepare): Don't save the `action' muscle.
18285 * src/bison.simple: s/%%action/%%actions/.
18286
51576fb3
AD
182872001-12-15 Akim Demaille <akim@epita.fr>
18288
18289 * src/reader.c (copy_action): When --yacc, don't append a `;'
18290 to the user action: let it fail if lacking.
dee049eb 18291 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 18292
2648a72d
AD
182932001-12-14 Akim Demaille <akim@epita.fr>
18294
18295 * src/lex.c (literalchar): Simply return the char you decoded, non
18296 longer mess around with obstacks and int pointers.
18297 Adjust all callers.
18298
92790e5b
AD
182992001-12-14 Akim Demaille <akim@epita.fr>
18300
18301 * src/lex.c (literalchar): Don't escape the special characters,
18302 just decode them, and keep them as char (before, eol was output as
18303 the 2 char string `\n' etc.).
18304 * src/output.c (output_rule_data): Use quotearg to output the
18305 token strings.
18306
927c1557
PE
183072001-12-13 Paul Eggert <eggert@twinsun.com>
18308
18309 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
18310 Do not infringe on the global user namespace when using C++.
18311 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
18312 All uses of `fprintf' and `stderr' changed.
18313
18314 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
18315
ed8e1f68
AD
183162001-12-13 Akim Demaille <akim@epita.fr>
18317
18318 The computation of nullable is broken: it doesn't handle empty
18319 RHS's properly.
18320
18321 * tests/torture.at (GNU AWK Grammar): New.
18322 * tests/sets.at (Nullable): New.
18323 * src/nullable.c (set_nullable): Instead of blindly looping over
18324 `ritems', loop over the rules, and then over their rhs's.
18325
18326 Work around Autotest bugs.
18327
18328 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
18329 frame, because Autotest understand lines starting with a `+' as
18330 traces from the shell. Then, they are not processed properly.
18331 Admittedly an Autotest bug, but we don't have time to wait for
18332 Autotest to catch up.
18333 * tests/regression.at (Broken Closure): Adjust to the new table
18334 frames.
18335 Move to...
18336 * tests/sets.at: here.
18337
cb581495
AD
183382001-12-13 Akim Demaille <akim@epita.fr>
18339
18340 * src/closure.c (closure): Use nrules instead of playing tricks
18341 with BITS_PER_WORD.
18342
2e729273
AD
183432001-12-13 Akim Demaille <akim@epita.fr>
18344
18345 * src/print.c (print_actions): Output the handling of `$' as the
18346 traces do: shifting the token EOF. Before EOF was treated as a
18347 nonterminal.
18348 * tests/regression.at: Adjust some tests.
18349 * src/print_graph.c (print_core): Complete the set of items via
18350 closure. The next-to-final and final states are still unsatisfying,
18351 but that's to be addressed elsewhere.
18352 No longer output the rule numbers, but do output the state number.
18353 A single loop for the shifts + gotos is enough, but picked a
18354 distinct color for each.
18355 (print_graph): Initialize and finalize closure.
18356
107f7dfb
AD
183572001-12-13 Akim Demaille <akim@epita.fr>
18358
18359 * src/reader.c (readgram): Remove dead code, an strip useless
18360 braces.
18361 (get_type): Remove, unused.
18362
9b53a24f
AD
183632001-12-12 Akim Demaille <akim@epita.fr>
18364
18365 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
18366 on that of lib/error.c.
18367
dbfb6dcd
AD
183682001-12-12 Akim Demaille <akim@epita.fr>
18369
18370 Some hosts don't like `/' in includes.
18371
18372 * src/system.h: Include libgettext.h without qualifying the path.
18373 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
18374 $(top_srcdir).
18375
c25fb648
MA
183762001-12-11 Marc Autret <autret_m@epita.fr>
18377
18378 * src/output.c (output_parser): Remove useless muscle.
18379
710ddc4f
MA
183802001-12-11 Marc Autret <autret_m@epita.fr>
18381
18382 * src/bison.simple: Remove #line just before %%epilogue. It
18383 is now handled in ...
18384 * src/reader.c (read_additionnal_code): Add the output of a
18385 #line for the epilogue.
18386
e83d80b8
MA
183872001-12-10 Marc Autret <autret_m@epita.fr>
18388
927c1557 18389 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
18390 replace precedent remove.
18391 * src/bison.simple: Remove #line before %%prologue because
18392 %%input-line is wrong at this time.
18393
971d5158
MA
183942001-12-10 Marc Autret <autret_m@epita.fr>
18395
18396 * src/reader.c (symbols_output): Clean up.
927c1557 18397 * src/output.c (output_gram, output): Clean up.
971d5158 18398
5edafffd
AD
183992001-12-10 Akim Demaille <akim@epita.fr>
18400
18401 * src/lalr.c (initialize_lookaheads): New. Extracted from...
18402 * src/LR0.c (set_state_table): here.
18403 * src/lalr.c (lalr): Call it.
18404
0279f8e9
AD
184052001-12-10 Akim Demaille <akim@epita.fr>
18406
18407 * src/state.h (shifts): Remove the `number' member: shifts are
18408 attached to state, hence no longer need to be labelled with a
18409 state number.
18410
190c4f5f
AD
184112001-12-10 Akim Demaille <akim@epita.fr>
18412
18413 Now that states have a complete set of members, the linked list of
18414 shifts is useless: just fill directly the state's shifts member.
18415
18416 * src/state.h (shifts): Remove the `next' member.
18417 * src/LR0.c (first_state, last_state): Remove.
18418 Adjust the callers.
18419 (augment_automaton): Don't look for the shifts that must be added
18420 a shift on EOF: it is those of the state we looked for! But now,
18421 since shifts are attached, it is no longer needed to looking
18422 merely by its id: its number.
18423
2a73b93d
AD
184242001-12-10 Akim Demaille <akim@epita.fr>
18425
18426 * src/LR0.c (augment_automaton): Better variable locality.
18427 Remove an impossible branch: if there is a state corresponding to
18428 the start symbol being shifted, then there is shift for the start
18429 symbol from the initial state.
18430
74392f6a
AD
184312001-12-10 Akim Demaille <akim@epita.fr>
18432
18433 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
18434 only when appropriate: when insert_start_shifting_state' is not
18435 invoked.
18436 * tests/regression.at (Rule Line Numbers): Adjust.
18437
37c82725
AD
184382001-12-10 Akim Demaille <akim@epita.fr>
18439
18440 * src/LR0.c (augment_automaton): Now that all states have shifts,
18441 merge the two cases addition shifts to the initial state.
18442
6a164e0c
AD
184432001-12-10 Akim Demaille <akim@epita.fr>
18444
18445 * src/lalr.c (set_state_table): Move to...
18446 * src/LR0.c: here.
18447 * src/lalr.c (lalr): Don't call it...
18448 * src/LR0.c (generate_states): do it.
18449 * src/LR0.h (first_state): Remove, only the table is used.
18450
7215de24
AD
184512001-12-10 Akim Demaille <akim@epita.fr>
18452
18453 * src/LR0.h (first_shift, first_reduction): Remove.
18454 * src/lalr.c: Don't use first_shift: find shifts through the
18455 states.
18456
80e25d4d
AD
184572001-12-10 Akim Demaille <akim@epita.fr>
18458
18459 * src/LR0.c: Attach shifts to states as soon as they are
18460 computed.
18461 * src/lalr.c (set_state_table): Instead of assigning shifts to
18462 state, just assert that the mapping was properly done.
18463
0ab3728b
AD
184642001-12-10 Akim Demaille <akim@epita.fr>
18465
18466 * src/LR0.c (insert_start_shift): Rename as...
18467 (insert_start_shifting_state): this.
18468 (insert_eof_shifting_state, insert_accepting_state): New.
18469 (augment_automaton): Adjust.
18470 Better locality of the variables.
18471 When looking if the start_symbol is shifted from the initial
18472 state, using `while (... symbol != start_symbol ...)' sounds
18473 better than `while (... symbol < start_symbol ...)': If fail
18474 to see how the order between symbols could be relevant!
18475
78af9bbc
AD
184762001-12-10 Akim Demaille <akim@epita.fr>
18477
18478 * src/getargs.h: Don't declare `spec_name_prefix' and
18479 `spec_file_prefix', declared by src/files.h.
18480 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
18481 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
18482 * src/output.c (prepare): Adjust.
18483 * src/reader.c (symbols_output): Likewise.
18484 * src/vmsgetargs.c: Vaguely adjust, but who cares?
18485
bdef2a41
AD
184862001-12-10 Akim Demaille <akim@epita.fr>
18487
18488 * src/muscle_tab.c (muscle_init): NULL is a better default than
18489 `"0"'.
18490
3735969c
AD
184912001-12-10 Akim Demaille <akim@epita.fr>
18492
18493 * src/reader.c (reader): Calling symbols_output once is enough.
18494
49701457
AD
184952001-12-10 Akim Demaille <akim@epita.fr>
18496
18497 Now that states have a complete set of members, the linked list of
18498 reductions is useless: just fill directly the state's reductions
18499 member.
18500
18501 * src/state.h (struct reductions): Remove member `number' and
18502 `next'.
18503 * src/LR0.c (first_reduction, last_reduction): Remove.
18504 (save_reductions): Don't link the new reductions, store them in
18505 this_state.
18506 * src/lalr.c (set_state_table): No need to attach reductions to
18507 states, it's already done.
18508 * src/output.c (output_actions): No longer free the shifts, then
18509 the reductions, then the states: free all the states and their
18510 members.
18511
0edad749
AD
185122001-12-10 Akim Demaille <akim@epita.fr>
18513
18514 * src/options.c (OPTN, DRTV, BOTH): New.
18515 (option_table): Use them.
18516
0edad749
AD
18517 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
18518 the job of system.h.
18519 * src/options.c: Don't include stdio.h and xalloc.h for the same
18520 reasons.
18521
5449dd0f
AD
185222001-12-10 Akim Demaille <akim@epita.fr>
18523
18524 * src/output.c (output, prepare): Make sure the values of the
18525 muscles `action' and `prologue' are 0-terminated.
18526
a870c567
AD
185272001-12-10 Akim Demaille <akim@epita.fr>
18528
18529 Clean up GCC warnings.
18530
18531 * src/reader.c (copy_action): `buf' is not used.
18532 (parse_skel_decl): Be static.
18533 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
18534 * src/options.h (create_long_option_table): Have a real prototype.
18535 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
18536 (hash_delete_at): Return const void *.
18537 Adjust casts to preserve the const.
18538
80df8768
AD
185392001-12-10 Akim Demaille <akim@epita.fr>
18540
18541 * configure.in: Require 2.52g.
18542 M4 is not needed, but AUTOM4TE is.
18543 * m4/m4.m4: Remove.
18544 * tests/Makefile.am: Adjust.
18545
f693ad14
AD
185462001-12-10 Akim Demaille <akim@epita.fr>
18547
18548 One structure for states is enough, even though theoretically
18549 there are LR(0) states and LALR(1) states.
18550
18551 * src/lalr.h (state_t): Remove.
18552 (state_table): Be state_t **, not state_t *.
18553 * src/state.h (core, CORE_ALLOC): Rename as...
18554 (state_t, STATE_ALLOC): this.
18555 Add the LALR(1) members: shifts, reductions, errs.
18556 * src/LR0.c (state_table): Rename as...
18557 (state_hash): this, to avoid name clashes with the global
18558 `state_table'.
18559 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
18560 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
18561
74ffbcb6
AD
185622001-12-10 Akim Demaille <akim@epita.fr>
18563
18564 Bison dumps core on bash.y.
18565 Reported by Pascal Bart.
18566
18567 * src/warshall.c (bitmatrix_print): New.
18568 (TC): Use it.
ba0fe3c7 18569 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
18570 j must be the outer loop.
18571 * tests/regression.at (Broken Closure): New.
18572
07708e19
AD
185732001-12-05 Akim Demaille <akim@epita.fr>
18574
18575 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
18576 its argument.
ba1ecc07 18577 Reported by Peter Hamorsky.
07708e19 18578
92b16366
AD
185792001-12-05 Akim Demaille <akim@epita.fr>
18580
18581 * src/conflicts.c (err_table): Remove.
18582 (resolve_sr_conflict): Adjust.
18583 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
18584 Rename as...
18585 (state_t.reductions, state_t.shifts): this.
18586
076ab033
AD
185872001-12-05 Akim Demaille <akim@epita.fr>
18588
18589 * src/reduce.c (reduce_grammar_tables): No longer disable the
18590 removal of useless rules via CPP but via `if (0)', so that the
18591 compiler still check the code is valid.
18592 For instance, it should have noticed `rline' no longer exists: use
18593 the `line' member of rule_t.
18594 * src/gram.c (dummy, rline): Remove, unused.
18595
3843c413
AD
185962001-12-05 Akim Demaille <akim@epita.fr>
18597
18598 * src/output.c (pack_vector): Use assert, not berror.
18599 * src/main.c (berror): Remove, unused.
18600
43168960
AD
186012001-12-05 Akim Demaille <akim@epita.fr>
18602
18603 New experimental feature: if --verbose --trace output all the
18604 items of a state, not only its kernel.
18605
18606 * src/print.c (print_core): If `trace_flag', then invoke closure
18607 before outputting the items of the state (print_core is no longer
18608 a correct name them).
18609 (print_results): Invoke new_closure/free_closure if needed.
18610
b2872512
AD
186112001-12-05 Akim Demaille <akim@epita.fr>
18612
18613 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
18614 * src/closure.c, src/closure.h (itemsetsize): Rename as...
18615 (nitemset): for consistency with the rest of the project.
18616
23cbcc6c
AD
186172001-12-05 Akim Demaille <akim@epita.fr>
18618
18619 * src/closure.c (print_closure): Improve.
18620 (closure): Use it for printing input and output.
18621
03ec521c
AD
186222001-12-05 Akim Demaille <akim@epita.fr>
18623
18624 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
18625 indexed by nonterminals.
18626
3a7456dd
AD
186272001-12-05 Akim Demaille <akim@epita.fr>
18628
18629 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
18630 what it was!).
18631 * src/warshall.h: Remove accidental duplication of the content.
18632
1cbcf2e7
AD
186332001-12-05 Akim Demaille <akim@epita.fr>
18634
18635 * src/closure.c (set_fderives): De-obfuscate.
18636
84182270
AD
186372001-12-05 Akim Demaille <akim@epita.fr>
18638
18639 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
18640
3f6f053c
AD
186412001-12-05 Akim Demaille <akim@epita.fr>
18642
18643 * src/closure.c (set_firsts): De-obfuscate.
18644
7a5350ba
AD
186452001-12-05 Akim Demaille <akim@epita.fr>
18646
18647 * src/output.c (action_row): De-obfuscate
18648 using the good o' techniques: arrays not pointers, variable
18649 locality, BITISSET, RESETBIT etc.
18650
d954473d
AD
186512001-12-05 Akim Demaille <akim@epita.fr>
18652
18653 Pessimize the code to simplify it: from now on, all the states
18654 have a valid SHIFTS, which NSHIFTS is possibly 0.
18655
18656 * src/LR0.c (shifts_new): Be global and move to..
18657 * src/state.c, src/state.h: here.
18658 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
18659 * src/print_graph: Adjust.
18660
9839bbe5
AD
186612001-12-05 Akim Demaille <akim@epita.fr>
18662
18663 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
18664 * src/conflicts.c: Use it.
18665 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
18666 incorrectly ``simplified''.
18667
9f136c07
AD
186682001-12-05 Akim Demaille <akim@epita.fr>
18669
18670 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
18671 using the good o' techniques: arrays not pointers, variable
18672 locality, BITISSET, RESETBIT etc.
18673
b608206e
AD
186742001-12-05 Akim Demaille <akim@epita.fr>
18675
18676 * src/state.h (SHIFT_SYMBOL): New.
18677 * src/conflicts.c: Use it to deobfuscate.
18678
52afa962
AD
186792001-12-05 Akim Demaille <akim@epita.fr>
18680
18681 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
18682 (print_reductions): De-obfuscate using the good o' techniques:
18683 arrays not pointers, variable locality, BITISSET.
18684
e74dc321
AD
186852001-12-05 Akim Demaille <akim@epita.fr>
18686
18687 * src/conflicts.c (print_reductions): Arrays, not pointers.
18688 Use BITISSET.
18689
768fca83
AD
186902001-12-05 Akim Demaille <akim@epita.fr>
18691
18692 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18693
a17e599f
AD
186942001-12-05 Akim Demaille <akim@epita.fr>
18695
18696 * src/conflicts.c (print_reductions): Improve variable locality.
18697
a04bc341
AD
186982001-12-05 Akim Demaille <akim@epita.fr>
18699
18700 * src/conflicts.c (print_reductions): Pessimize, but clarify.
18701
c8ea038e
AD
187022001-12-05 Akim Demaille <akim@epita.fr>
18703
18704 * src/conflicts.c (print_reductions): Improve variable locality.
18705
aa2aab3c
AD
187062001-12-05 Akim Demaille <akim@epita.fr>
18707
18708 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
18709 * src/lalr.c: Use them.
18710
b178c8cc
AD
187112001-12-05 Akim Demaille <akim@epita.fr>
18712
18713 * src/LR0.c (augment_automaton): Formatting changes.
18714 Better variable locality.
18715
f67d13aa
AD
187162001-12-05 Akim Demaille <akim@epita.fr>
18717
18718 * src/lalr.c (matrix_print): New.
18719 (transpose): Use it.
18720 Use arrays instead of pointers.
18721
c2713865
AD
187222001-12-05 Akim Demaille <akim@epita.fr>
18723
18724 * src/lalr.c (maxrhs): Move to...
18725 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
18726 * src/lalr.c (build_relations): Adjust.
18727
9887c18a
AD
187282001-12-05 Akim Demaille <akim@epita.fr>
18729
18730 * src/lalr.c (transpose): Free the memory allocated to the
18731 argument, as it is replaced by the results by the unique caller.
18732 (build_relations): Merely invoke transpose: it handles the memory
18733 deallocation.
18734 Improve variable locality.
18735 Avoid variables used as mere abbreviations.
18736 (compute_lookaheads): Use arrays instead of pointers.
18737
4d4f699c
AD
187382001-12-05 Akim Demaille <akim@epita.fr>
18739
18740 * src/lalr.c (initialize_F): Improve variable locality.
18741 Avoid variables used as mere abbreviations.
18742
80a69750
AD
187432001-12-05 Akim Demaille <akim@epita.fr>
18744
18745 * src/derives.c (print_derives): Display the ruleno.
18746 * src/lalr.c (initialize_F, transpose): Better variable locality
18747 to improve readability.
18748 Avoid variables used as mere abbreviations.
18749
fe961097
AD
187502001-12-05 Akim Demaille <akim@epita.fr>
18751
18752 * src/lalr.c (traverse): Use arrays instead of pointers.
18753
e3e4e814
AD
187542001-12-05 Akim Demaille <akim@epita.fr>
18755
18756 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
18757 the handling of squeue.
18758 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18759
630e182b
AD
187602001-12-05 Akim Demaille <akim@epita.fr>
18761
18762 Because useless nonterminals are now kept alive (instead of being
18763 `destroyed'), we now sometimes examine them, and store information
18764 related to them. Hence we need to know their number, and adjust
18765 memory allocations.
18766
18767 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
18768 static.
18769 * src/LR0.c (allocate_itemsets): The memory allocated to
18770 `symbol_count' was used for two different purpose: once to count
18771 the number of occurrences of each symbol, and later reassigned to
18772 `shift_symbol', containing the symbol that can be shifted from a
18773 given state.
18774 Deobfuscate, i.e., allocate, use and free `symbol_count' here
18775 only, and...
18776 (new_itemsets): Allocate `shift_symbol' here.
18777 (allocate_itemsets): symbol_count includes useless nonterminals.
18778 Make room for them.
18779 (free_storage): Use `free', not `XFREE', for pointers that cannot
18780 be null.
18781
81b51460
AD
187822001-12-05 Akim Demaille <akim@epita.fr>
18783
18784 * src/nullable.c (set_nullable): Deobfuscate the handling of
18785 ritem.
18786 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
18787
3067fbef
AD
187882001-12-05 Akim Demaille <akim@epita.fr>
18789
18790 * src/gram.c, src/gram.h (ritem_print): New.
18791 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
18792 (This useless function was defined only to work around VMS linkers
18793 that can't handle compilation units with variables only).
18794 * src/reduce.c (dump_grammar): Use it to trace the construction of
18795 ritem.
18796
c2bea5f9
PE
187972001-12-04 Paul Eggert <eggert@twinsun.com>
18798
7d27c823
PE
18799 * src/bison.simple (union yyalloc): Change member names
18800 to be the same as the stack names.
18801 (yyparse): yyptr is now union yyalloc *, not char *.
18802 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
18803 and may generate better code on some machines.
c2bea5f9
PE
18804 (yystpcpy): Use prototype if __STDC__ is defined, not just
18805 if __cplusplus is defined.
35687a9d 18806
2c8a9dfa
AD
188072001-11-30 Akim Demaille <akim@epita.fr>
18808
18809 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
18810 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
18811 Gettext doesn't compile cleanly, and dies with -Werror.
18812 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
18813 Include WARNING_CFLAGS here.
18814 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
18815 before being defined.
18816
f4e421e6
AD
188172001-11-27 Paul Eggert <eggert@twinsun.com>
18818
18819 * lib/quotearg.h (quotearg_n, quotearg_n_style):
18820 First arg is int, not unsigned.
18821 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
18822 (SIZE_MAX, UINT_MAX): New macros.
18823 (quotearg_n_options): Abort if N is negative.
18824 Avoid overflow check on hosts where size_t is 64 bits and int
18825 is 32 bits, as overflow is impossible there.
18826 Fix off-by-one typo that caused unnecessary reallocation.
18827
7093d0f5
AD
188282001-11-29 Paul Eggert <eggert@twinsun.com>
18829
18830 Name space cleanup in generated parser.
18831
18832 * doc/bison.texinfo (Bison Parser): Discuss system headers
18833 and their effect on the user name space.
18834
18835 * src/bison.simple:
18836 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
18837 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
18838 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
18839
18840 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
18841 on user names when possible.
18842
18843 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
18844 Simplify test for whather <alloca.h> exists.
18845
18846 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
18847
18848 (<stdio.h>): Include if YYDEBUG.
18849
18850 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
18851 ! defined (yyoverflow) && ! defined (yymemcpy).
18852
18853 (yymemcpy, yyparse): Rename local variables as needed so that
18854 they all begin with 'yy'.
18855
18856 (yystrlen, yystpcpy): New functions.
18857
18858 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
18859 All uses changed.
18860
18861 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
18862 instead of relying on string.h functions. Use YYSTACK_ALLOC
18863 and YYSTACK_FREE instead of malloc and free.
18864
fd51e5ff
AD
188652001-11-30 Akim Demaille <akim@epita.fr>
18866
18867 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
18868 before their first uses.
18869 (YYBISON, YYPURE): Move to the top of the output.
18870
7d13ff5f
AD
188712001-11-30 Akim Demaille <akim@epita.fr>
18872
18873 * tests/reduce.at (Useless Nonterminals): Fix.
18874
892a3995
AD
188752001-11-30 Akim Demaille <akim@epita.fr>
18876
18877 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
18878 if body instead of `;' to pacify GCC's warnings.
18879
68f1e3ed
AD
188802001-11-30 Akim Demaille <akim@epita.fr>
18881
18882 Instead of mapping the LHS of unused rules to -1, keep the LHS
18883 valid, but flag the rules as invalid.
18884
18885 * src/gram.h (rule_t): `useful' is a new member.
18886 * src/print.c (print_grammar): Adjust.
18887 * src/derives.c (set_derives): Likewise.
18888 * src/reader.c (packgram, reduce_output): Likewise.
18889 * src/reduce.c (reduce_grammar_tables): Likewise.
18890 * tests/reduce.at (Underivable Rules, Useless Rules): New.
18891
d2d1b42b
AD
188922001-11-30 Akim Demaille <akim@epita.fr>
18893
18894 * src/reduce.c (reduce_output): Formatting changes.
18895 * src/print.c (print_results, print_grammar): Likewise.
18896 * tests/regression.at (Rule Line Numbers)
18897 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
18898
760b53a8
AD
188992001-11-30 Akim Demaille <akim@epita.fr>
18900
18901 * src/reduce.c (nonterminals_reduce): Instead of throwing away
18902 useless nonterminals, move them at the end of the symbol arrays.
18903 (reduce_output): Adjust.
18904 * tests/reduce.at (Useless Nonterminals): Adjust.
18905
00238958
AD
189062001-11-30 Akim Demaille <akim@epita.fr>
18907
18908 * src/reduce.c: Various comment/formatting changes.
18909 (nonterminals_reduce): New, extracted from...
18910 (reduce_grammar_tables): here.
18911 (reduce_grammar): Call nonterminals_reduce.
18912
396452de
PE
189132001-11-29 Paul Eggert <eggert@twinsun.com>
18914
18915 * src/bison.simple (YYSTACK_REALLOC): Remove.
18916 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
18917 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
18918 New macros.
18919 (union yyalloc): New type.
18920 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
18921 an arbitrary restriction on hosts where size_t is wider than int.
18922
18923 (yyparse): Don't dump core if alloca or malloc fails; instead, report
18924 a parser stack overflow. Allocate just one block of memory for all
18925 three stacks, instead of allocating three blocks; this typically is
18926 faster and reduces fragmentation.
18927
18928 Do not limit the number of items in the stack to a value that fits
18929 in 'int', as this is an arbitrary limit on hosts with 64-bit
18930 size_t and 32-bit int.
18931
147e184c
MA
189322001-11-29 Marc Autret <autret_m@epita.fr>
18933
18934 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
18935 of defining YYERROR_VERBOSE.
18936 [AT_DATA]: $4 is now out of C declarations in the prologue.
18937
426cf563
MA
189382001-11-28 Marc Autret <autret_m@epita.fr>
18939
18940 * src/reader.c (parse_dquoted_param): New.
18941 (parse_skel_decl): Use it.
18942 * src/lex.h: Add its prototype.
18943 * src/lex.c (literalchar): Become not static.
18944
c7925b99
MA
189452001-11-28 Marc Autret <autret_m@epita.fr>
18946
18947 * src/output.h: And put its extern declaration here.
18948 * src/output.c (error_verbose): Define here.
18949 (prepare): Echo name modification.
18950 * src/getargs.h: Clean its extern declaration.
18951 * src/getargs.c (error_verbose_flag): Remove.
18952 (getargs): Remove case 'e'.
18953 * src/options.c (option_table): 'error-verbose' is now seen as simple
18954 percent option.
18955 Include output.h.
18956
18957 * src/reader.c (read_declarations): Remove case tok_include.
18958 (parse_include_decl): Remove.
18959 * src/lex.h (token_t): Remove tok_include.
18960 * src/options.c (option_table): 'include' is now a simple command line
18961 option.
18962
5b5d1929
MA
189632001-11-28 Marc Autret <autret_m@epita.fr>
18964
18965 * src/bison.simple: Adjust muscle names.
18966 * src/muscle_tab.c (muscle_init): Also rename the muscles.
18967 * src/output.c (prepare): s/_/-/ for the muscles names.
18968 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
18969
8850be4b
MA
189702001-11-28 Marc Autret <autret_m@epita.fr>
18971
18972 * src/bison.simple: Fix debug.
18973 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
18974
4a38e613
AD
189752001-11-28 Akim Demaille <akim@epita.fr>
18976
18977 * src/LR0.c (shifts_new): New.
18978 (save_shifts, insert_start_shift, augment_automaton): Use it.
18979
4b35e1c1
AD
189802001-11-28 Akim Demaille <akim@epita.fr>
18981
18982 * src/closure.c (closure): `b' and `ruleno' denote the same value:
18983 keep ruleno only.
18984
d2b04478
AD
189852001-11-28 Akim Demaille <akim@epita.fr>
18986
18987 * src/closure.c (closure): Instead of looping over word in array
18988 then bits in words, loop over bits in array.
18989
2c4c30aa
AD
189902001-11-28 Akim Demaille <akim@epita.fr>
18991
18992 * src/closure.c (closure): No longer optimize the special case
18993 where all the bits of `ruleset[r]' are set to 0, to make the code
18994 clearer.
18995
576890b7
AD
189962001-11-28 Akim Demaille <akim@epita.fr>
18997
18998 * src/closure.c (closure): `r' and `c' are new variables, used to
18999 de-obfuscate accesses to RULESET and CORE.
19000
cb487d7d
AD
190012001-11-28 Akim Demaille <akim@epita.fr>
19002
19003 * src/reduce.c (reduce_print): Use ngettext.
19004 (dump_grammar): Improve the trace accuracy.
19005
6013d43f
AD
190062001-11-28 Akim Demaille <akim@epita.fr>
19007
19008 * src/reduce.c (dump_grammar): Don't translate trace messages.
19009
cb4956ee
AD
190102001-11-28 Akim Demaille <akim@epita.fr>
19011
19012 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
19013 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
19014 as all tags are free'ed afterwards.
19015 From Enrico Scholz.
19016
648185ab
PE
190172001-11-27 Paul Eggert <eggert@twinsun.com>
19018
19019 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
19020 use alloca when we didn't want to, and vice versa.
19021
68254a03
MA
190222001-11-27 Marc Autret <autret_m@epita.fr>
19023
9113b58f
AD
19024 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
19025 initialization.
68254a03
MA
19026 * src/output.c (prepare): Remove its update.
19027
04d843a2
MA
190282001-11-27 Marc Autret <autret_m@epita.fr>
19029
19030 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
19031 Use %error-verbose.
19032
d2079671 190332001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
19034
19035 * src/bison.simple: Remove YYERROR_VERBOSE using.
19036 Use %%error_verbose.
19037 (yyparse): Likewise.
19038 * src/output.c (prepare): Give its final value.
19039 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
19040 * src/getargs.h: Add its extern declaration.
19041 * src/getargs.c (error_verbose_flag): New int.
19042 (getargs): Update to catch new case.
19043 * src/options.c (option_table): 'error-verbose' is a new option.
19044 (shortopts): Update.
19045
e0327bc8
AD
190462001-11-27 Akim Demaille <akim@epita.fr>
19047
19048 * src/system.h: Use intl/libgettext.h.
19049 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
19050
000f1a3c
AD
190512001-11-27 Akim Demaille <akim@epita.fr>
19052
19053 * tests/torture.at (Exploding the Stack Size with Malloc):
19054 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
19055
26cfe0be
AD
190562001-11-27 Akim Demaille <akim@epita.fr>
19057
19058 * src/files.c: Include error.h.
19059 Reported by Hans Aberg.
19060
f6bd5427
MA
190612001-11-26 Marc Autret <autret_m@epita.fr>
19062
d2079671 19063 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
19064 (read_declarations): Add case tok_include.
19065 * src/getargs.h (include): Add its extern definition.
19066 * src/getargs.c (include): New const char *.
19067 (getargs): Add case '-I'.
19068 * src/options.c (option_table): Add include as command line and
19069 percent option.
19070 * src/lex.h (token_t): Add tok_include.
19071
2ca209c1
AD
190722001-11-26 Akim Demaille <akim@epita.fr>
19073
19074 * src/reader.c (readgram): Make sure rules for mid-rule actions
19075 have a lineno equal to that of their host rule.
19076 Reported by Hans Aberg.
19077 * tests/regression.at (Rule Line Numbers): New.
19078
0e41b407
AD
190792001-11-26 Akim Demaille <akim@epita.fr>
19080
19081 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
19082 size_ts.
19083
190842001-11-26 Akim Demaille <akim@epita.fr>
19085
19086 * src/complain.c, src/complain.h (error): Remove, provided by
19087 lib/error.[ch].
19088
e0c40012
AD
190892001-11-26 Akim Demaille <akim@epita.fr>
19090
19091 * src/reader.c (read_declarations): Don't abort on tok_illegal,
19092 issue an error message.
19093 * tests/regression.at (Invalid %directive): New.
19094 Reported by Hans Aberg.
19095
5e147124
AD
190962001-11-26 Akim Demaille <akim@epita.fr>
19097
19098 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
19099 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
19100
a034c8b8
AD
191012001-11-26 Akim Demaille <akim@epita.fr>
19102
19103 * src/conflicts.c (conflicts_print): Don't complain at all when
19104 there are no reduce/reduce conflicts, and as many shift/reduce
19105 conflicts as expected.
19106 * tests/regression.at (%expect right): Adjust.
19107
c64a20f3
AD
191082001-11-23 Akim Demaille <akim@epita.fr>
19109
19110 * lib/alloca.c: Update, from fileutils.
19111
5b0d29bb
AD
191122001-11-23 Akim Demaille <akim@epita.fr>
19113
19114 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
19115
722c4bfe
AD
191162001-11-23 Akim Demaille <akim@epita.fr>
19117
19118 * src/system.h: Include alloca.h.
19119 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
19120
6255b435
AD
191212001-11-23 Akim Demaille <akim@epita.fr>
19122
19123 * src/print_graph.c (print_actions): Remove `rule', unused.
19124 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
19125 pacify GCC's signed < unsigned warnings.
19126 * src/closure.c (itemsetsize): Likewise.
19127 * src/reader.c (symbol_list_new): Static.
19128
b29b2ed5
AD
191292001-11-23 Akim Demaille <akim@epita.fr>
19130
19131 Attaching lineno to buckets is stupid, since only one copy of each
19132 symbol is kept, only the line of the first occurrence is kept too.
19133
19134 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
19135 * src/reader.c (rline_allocated): Remove, unused.
19136 (symbol_list): Have a `line' member.
19137 (symbol_list_new): New.
19138 (readgram): Use it.
19139 * src/print.c (print_grammar): Output the rule line numbers.
19140 * tests/regression.at (Solved SR Conflicts)
19141 (Unresolved SR Conflicts): Adjust.
19142 Reported by Hans Aberg.
19143
a81b1d4a
MA
191442001-11-22 Marc Autret <autret_m@epita.fr>
19145
19146 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
19147
c1ecb3c1
MA
191482001-11-22 Marc Autret <autret_m@epita.fr>
19149
19150 * src/muscle_tab.c (muscle_init): Remove initialization of
19151 skeleton muscle.
19152 * src/output.c (output_master_parser): Do it here.
19153
fbe01355
AD
191542001-11-20 Akim Demaille <akim@epita.fr>
19155
19156 * po/sv.po: New.
19157 * configure.in (ALL_LINGUAS): Adjust.
19158 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
19159 longer contains strings to translate.
19160
81e895c0
AD
191612001-11-19 Akim Demaille <akim@epita.fr>
19162
19163 * src/conflicts.c (conflicts_print): Add a missing \n.
19164
6bb1878b
AD
191652001-11-19 Akim Demaille <akim@epita.fr>
19166
19167 * src/nullable.c (nullable_print): New.
19168 (set_nullable): Call it when tracing.
19169 Better locality of variables.
19170
d9ec2d07
AD
191712001-11-19 Akim Demaille <akim@epita.fr>
19172
19173 * src/print.c (print_actions): Better locality of variables.
19174
720e5c1b
AD
191752001-11-19 Akim Demaille <akim@epita.fr>
19176
19177 * src/derives.c (print_derives): Fix and enrich.
19178 * src/closure.c (print_fderives): Likewise.
19179
fb908786
AD
191802001-11-19 Akim Demaille <akim@epita.fr>
19181
19182 * src/closure.c (itemsetend): Remove, replaced with...
19183 (itemsetsize): new.
19184
125ecb56
AD
191852001-11-19 Akim Demaille <akim@epita.fr>
19186
19187 * src/LR0.c (kernel_end): Remove, replaced with...
19188 (kernel_size): new.
19189
d8cf039f
AD
191902001-11-19 Akim Demaille <akim@epita.fr>
19191
19192 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
19193 to clarify.
19194
7bec0760
AD
191952001-11-19 Akim Demaille <akim@epita.fr>
19196
19197 * src/closure.c (closure): Use arrays instead of pointers to clarify.
19198
c87d4863
AD
191992001-11-19 Akim Demaille <akim@epita.fr>
19200
19201 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
19202 trace messages.
19203 * src/LR0.c: Likewise.
19204 (allocate_itemsets): Use arrays instead of pointers to clarify.
19205
9bfe901c
AD
192062001-11-19 Akim Demaille <akim@epita.fr>
19207
19208 * src/getargs.c (statistics_flag): Replace with...
19209 (trace_flag): New.
19210 (longopts): Accept --trace instead of --statistics.
19211 * src/getargs.h, src/options.c: Adjust.
19212 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
19213 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
19214
97db7bd4
AD
192152001-11-19 Akim Demaille <akim@epita.fr>
19216
cc72668c 19217 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
19218 pointers to clarify the code.
19219 (save_reductions, save_shifts): Factor common parts of alternatives.
19220
2c5f66ed
AD
192212001-11-19 Akim Demaille <akim@epita.fr>
19222
19223 * src/LR0.c (new_state, get_state): Complete TRACE code.
19224 * src/closure.c: Include `reader.h' to get `tags', needed by the
19225 trace code.
19226 Rename the conditional DEBUG as TRACE.
19227 Output consistently TRACEs to stderr, not stdout.
19228 * src/derives.c: Likewise.
19229 * src/reduce.c: (inaccessable_symbols): Using if is better style
19230 than goto.
19231 Use `#if TRACE' instead of `#if 0' for tracing code.
19232
300f275f
AD
192332001-11-19 Akim Demaille <akim@epita.fr>
19234
19235 * src/system.h (LIST_FREE, shortcpy): New.
19236 * src/LR0.c: Use them.
19237 * src/output.c (free_itemsets, free_reductions, free_shifts):
19238 Remove, replaced by LIST_FREE.
19239
f59c437a
AD
192402001-11-19 Akim Demaille <akim@epita.fr>
19241
19242 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
19243 (REDUCTIONS_ALLOC): New.
19244 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
19245 allocation.
19246
6986fd9e
AD
192472001-11-19 Akim Demaille <akim@epita.fr>
19248
19249 * src/LR0.c (new_state): Complete trace code.
19250 * src/nullable.c (set_nullable): Don't translate traces.
19251
4bc30f78
AD
192522001-11-19 Akim Demaille <akim@epita.fr>
19253
19254 * src/print_graph.c (print_core): Better locality of variables.
19255 * src/print.c (print_core): Likewise.
19256
08a946e0
AD
192572001-11-19 Akim Demaille <akim@epita.fr>
19258
19259 * src/vcg.c: You do the output, so you are responsible of the
19260 handling of VCG syntax, in particular: use quotearg.
19261 * src/print_graph.c: Don't.
19262 (print_actions): Don't output the actions as part of the nodes,
19263 since that's the job of the edges.
19264 (print_state): Don't output by hand: fill the node description,
9bfe901c 19265 and ask for its output.
08a946e0 19266
f0473484
AD
192672001-11-19 Akim Demaille <akim@epita.fr>
19268
cc72668c
AD
19269 * src/bison.simple (yyparse): When verbosely reporting an error,
19270 no longer put additional quotes around token names.
f0473484
AD
19271 * tests/calc.at: Adjust.
19272
e41dc700
AD
192732001-11-19 Akim Demaille <akim@epita.fr>
19274
19275 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
19276 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
19277 * src/output.c: Adjust.
19278
652a871c
AD
192792001-11-19 Akim Demaille <akim@epita.fr>
19280
19281 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
19282 (rule_t): this.
19283 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
19284
b2ed6e58
AD
192852001-11-19 Akim Demaille <akim@epita.fr>
19286
19287 * src/gram.h (rule_t): New.
19288 (rule_table): New.
19289 (rrhs, rlhs): Remove, part of state_t.
19290 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
19291 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
19292 * src/reader.c, src/reduce.c: Adjust.
19293
edad7067
AD
192942001-11-19 Akim Demaille <akim@epita.fr>
19295
19296 * src/reader.c (symbols_output): New, extracted from...
19297 (packsymbols): Here.
19298 (reader): Call it.
19299
3feec034
AD
193002001-11-19 Akim Demaille <akim@epita.fr>
19301
19302 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
19303 (maxrhs): this new function.
19304
ddcd5fdf
AD
193052001-11-19 Akim Demaille <akim@epita.fr>
19306
cc72668c 19307 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
19308 Adjust.
19309
bb527fc2
AD
193102001-11-19 Akim Demaille <akim@epita.fr>
19311
cc72668c 19312 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
19313 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19314 * src/lalr.c: Adjust.
19315
a845a697
AD
193162001-11-19 Akim Demaille <akim@epita.fr>
19317
19318 * src/lalr.c (initialize_LA): Only initialize LA. Let...
19319 (set_state_table): handle the `lookaheads' members.
19320
f004bf6a
AD
193212001-11-19 Akim Demaille <akim@epita.fr>
19322
cc72668c
AD
19323 * src/lalr.h (lookaheads): Removed array, whose contents is now
19324 a member of...
f004bf6a
AD
19325 (state_t): this structure.
19326 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19327 Adjust.
19328
de326cc0
AD
193292001-11-19 Akim Demaille <akim@epita.fr>
19330
cc72668c
AD
19331 * src/lalr.h (consistent): Removed array, whose contents is now
19332 a member of...
de326cc0
AD
19333 (state_t): this structure.
19334 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19335 Adjust.
19336
90b4416b
AD
193372001-11-19 Akim Demaille <akim@epita.fr>
19338
cc72668c
AD
19339 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
19340 contents are now members of...
90b4416b
AD
19341 (state_t): this structure.
19342 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
19343 Adjust.
19344
9703cc49
AD
193452001-11-19 Akim Demaille <akim@epita.fr>
19346
19347 * src/lalr.h (state_t): New.
19348 (state_table): Be a state_t * instead of a core **.
19349 (accessing_symbol): Remove, part of state_t.
19350 * src/lalr.c: Adjust.
19351 (set_accessing_symbol): Merge into...
19352 (set_state_table): this.
19353 * src/print_graph.c, src/conflicts.c: Adjust.
19354
d803322e
AD
193552001-11-14 Akim Demaille <akim@epita.fr>
19356
19357 * tests/calc.at, tests/output.at, tests/regression.at,
19358 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
19359 now the tests are run in private dirs, therefore AC_CLEANUP and
19360 family can be simplified to 0-ary.
19361 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
19362 use abs. path to find config.h.
19363 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
19364 stderr, there can be way too much random noise.
19365 Instead pass -Werror to GCC and rely on the exit status.
19366 Reported by Wolfram Wagner.
19367
3d76b07d
AD
193682001-11-14 Akim Demaille <akim@epita.fr>
19369
19370 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
19371 defined only if yyoverflow is defined, to avoid `warning: unused
19372 variable `yyvs1''.
19373 Reported by The Test Suite.
19374
09b503c8
AD
193752001-11-14 Akim Demaille <akim@epita.fr>
19376
19377 * src/print.c: Include reduce.h.
19378 Reported by Hans Aberg.
19379
193802001-11-14 Akim Demaille <akim@epita.fr>
19381
19382 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
19383 Revert a previous patch: these are really const.
19384 * src/conflicts.c (conflict_report): Additional useless pair of
19385 braces to pacify GCC's warnings for `if () if () {} else {}'.
19386 * src/lex.c (parse_percent_token): Replace equal_offset with
19387 arg_offset.
19388 arg is const.
19389 Be sure to strdup `arg' when used, since there is no reason for
19390 token_buffer not to change.
19391
0f37a994
AD
193922001-11-14 Akim Demaille <akim@epita.fr>
19393
19394 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
19395 definition.
19396 * src/main.c (main): Use them.
19397 Suggested by Hans Aberg.
19398
d39d93b8
AD
193992001-11-12 Akim Demaille <akim@epita.fr>
19400
19401 * src/system.h (ngettext): Now that we use ngettext, be sure to
19402 provide a default definition when NLS are not used.
19403
9edcd895
AD
194042001-11-12 Akim Demaille <akim@epita.fr>
19405
19406 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
19407 Use @kbd to denote user input.
19408 (Language and Grammar): ANSIfy the example.
19409 Adjust its layout for info/notinfo.
19410 (Location Tracking Calc): Output error messages to stderr.
19411 Output locations in a more GNUtically correct way.
19412 Fix a couple of Englishos.
19413 Adjust @group/@end group pairs.
19414
7da99ede
AD
194152001-11-12 Akim Demaille <akim@epita.fr>
19416
e3aa65c5 19417 %expect was not functioning at all.
7da99ede
AD
19418
19419 * src/conflicts.c (expected_conflicts): Set to -1.
19420 (conflict_report): Use ngettext.
19421 (conflicts_print): Check %expect and make its violation an error.
19422 * doc/bison.texinfo (Expect Decl): Adjust.
19423 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
19424 * tests/regression.at (%expect not enough, %expect right)
19425 (%expect too much): New.
19426
ba9dda1a
AD
194272001-11-12 Akim Demaille <akim@epita.fr>
19428
19429 * tests/regression.at (Conflicts): Rename as...
19430 (Unresolved SR Conflicts): this.
19431 (Solved SR Conflicts): New.
19432
337c5bd1
AD
194332001-11-12 Akim Demaille <akim@epita.fr>
19434
19435 * src/reduce.c (print_results): Rename as...
19436 (reduce_output): This.
19437 Output to OUT, passed as argument, instead of output_obstack.
19438 (dump_grammar): Likewise.
19439 (reduce_free): New.
19440 Also free V1.
19441 (reduce_grammar): No longer call reduce_output, since...
19442 * src/print.c (print_results): do it.
19443 * src/main.c (main): Call reduce_free;
19444
c73a41af
AD
194452001-11-12 Akim Demaille <akim@epita.fr>
19446
19447 * src/conflicts.c (print_reductions): Accept OUT as argument.
19448 Output to it, not to output_obstack.
19449 * src/print.c (print_actions): Adjust.
19450
0df87bb6
AD
194512001-11-12 Akim Demaille <akim@epita.fr>
19452
19453 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
19454 the result instead of using...
19455 (src_total, rrc_total, src_count, rrc_count): Remove.
19456 (any_conflicts): Remove.
19457 (print_conflicts): Split into...
19458 (conflicts_print, conflicts_output): New.
19459 * src/conflicts.h: Adjust.
19460 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 19461 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
19462 * tests/regression.at (Conflicts): New.
19463 Reported by Tom Lane.
19464
e4d3d4de
AD
194652001-11-12 Akim Demaille <akim@epita.fr>
19466
19467 * tests/regression.at (Invalid input): Remove, duplicate with
19468 ``Invalid input: 1''.
19469
6d7d248e
AD
194702001-11-12 Akim Demaille <akim@epita.fr>
19471
19472 * tests/torture.at (AT_DATA_STACK_TORTURE)
19473 (Exploding the Stack Size with Alloca)
19474 (Exploding the Stack Size with Malloc): New.
19475
e9e4c321
AD
194762001-11-12 Akim Demaille <akim@epita.fr>
19477
19478 * src/bison.simple (YYSTACK_REALLOC): New.
19479 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 19480 Reported by Per Allansson.
e9e4c321 19481
5f7e0832
AD
194822001-11-12 Pascal Bart <pascal.bart@epita.fr>
19483
19484 * src/bison.simple: Define type yystype instead of YYSTYPE, and
19485 define CPP macro, which substitute YYSTYPE by yystype.
19486 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
19487 with yyltype/YYLTYPE. This allows inclusion of the generated
19488 header within the parser if the compiler, such as GGC, accepts
19489 multiple equivalent #defines.
19490 From Akim.
19491
e3f1699f
AD
194922001-11-05 Akim Demaille <akim@epita.fr>
19493
19494 * src/reader.c (symbols_output): New, extracted from...
19495 (packsymbols): here.
19496 (reader): Adjust.
19497
65be0866
AD
194982001-11-05 Akim Demaille <akim@epita.fr>
19499
19500 * src/lex.c (parse_percent_token): s/quotearg/quote/.
19501
e4d910bf
AD
195022001-11-05 Akim Demaille <akim@epita.fr>
19503
19504 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
19505 pattern.
19506
951366c1
AD
195072001-11-05 Akim Demaille <akim@epita.fr>
19508
19509 * src/options.h (struct option_table_struct): set_flags is void*.
19510 * src/options.c (longopts): Support `--output' and `%output'.
19511 (usage): Adjust.
19512 * src/lex.h (tok_setopt): Remove, replaced with...
19513 (tok_intopt, tok_stropt): these new guys.
19514 * src/lex.c (getopt.h): Not needed.
19515 (token_buffer, unlexed_token_buffer): Not const.
19516 (percent_table): Promote `-' over `_' in directive names.
19517 Active `%name-prefix', `file-prefix', and `output'.
19518 (parse_percent_token): Accept possible arguments to directives.
19519 Promote `-' over `_' in directive names.
19520
d8988b2f
AD
195212001-11-04 Akim Demaille <akim@epita.fr>
19522
19523 * doc/bison.texinfo (Decl Summary): Split the list into
19524 `directives for grammars' and `directives for bison'.
19525 Sort'em.
19526 Add description of `%name-prefix', `file-prefix', and `output'.
19527 Promote `-' over `_' in directive names.
19528 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
19529 Simplify the description of `--name-prefix'.
19530 Promote `-' over `_' in directive names.
19531 Promote `--output' over `--output-file'.
19532 Fix the description of `--defines'.
19533 * tests/output.at: Exercise %file-prefix and %output.
19534
6468d18e
AD
195352001-11-02 Akim Demaille <akim@epita.fr>
19536
19537 * doc/refcard.tex: Update.
19538
6b7e85b9
AD
195392001-11-02 Akim Demaille <akim@epita.fr>
19540
19541 * src/symtab.h (SUNDEF): New.
19542 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
19543 stand for `uninitialized', instead of 0.
19544 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
19545 * src/lex.c (lex): Adjust.
19546
19547 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
19548 Number it 0.
19549 Let yylex return it instead of a plain 0.
19550 Reported by Dick Streefland.
19551
cd5aafcf
AD
195522001-11-02 Akim Demaille <akim@epita.fr>
19553
19554 * tests/regression.at (Mixing %token styles): New test.
19555
037ca2f1
AD
195562001-11-02 Akim Demaille <akim@epita.fr>
19557
19558 * src/reader.c (parse_thong_decl): Formatting changes.
19559 (token_translations_init): New, extracted from...
19560 (packsymbols): Here.
19561 Adjust.
19562
270a173c
AD
195632001-11-01 Akim Demaille <akim@epita.fr>
19564
19565 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
19566 Check that `9foo.y' produces correct cpp guards.
19567 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
19568 guards.
19569 Reported by Wwp.
19570
561f9a30
AD
195712001-11-01 Akim Demaille <akim@epita.fr>
19572
19573 * tests/regression.at (Invalid input: 2): New.
19574 * src/lex.c (unlexed_token_buffer): New.
19575 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
19576 too.
19577 Reported by Wwp.
19578
f987e9d2
AD
195792001-11-01 Akim Demaille <akim@epita.fr>
19580
19581 * tests/calc.at: Catch up with 1.30.
19582 * configure.in: Bump to 1.49a.
19583 Adjust to newer Autotest.
19584
0846f581
PB
195852001-10-19 Pascal Bart <pascal.bart@epita.fr>
19586
19587 * src/conflicts.c: Move global variables rrc_total and src_total ...
19588 (print_conflicts): here.
19589 * src/output.c (output): Free global variable user_toknums.
19590 * src/lex.c (token_obstack): Become static.
19591
3c1a79b3
AD
195922001-10-18 Akim Demaille <akim@epita.fr>
19593
19594 * tests/atlocal.in (GCC): Add.
19595 * tests/calc.at: s/m4_match/m4_bmatch/.
19596 s/m4_patsubst/m4_bpatsubst/.
19597 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
19598 * configure.in: AC_SUBST(GCC).
19599
5d52e7d0
MA
196002001-10-14 Marc Autret <autret_m@epita.fr>
19601
19602 * src/options.c (create_long_option_table): Fix.
19603
631aa1d3
AD
196042001-10-10 Akim Demaille <akim@epita.fr>
19605
19606 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
19607
f6ec6d13
AD
196082001-10-04 Akim Demaille <akim@epita.fr>
19609
19610 * src/reader.c (parse_union_decl): Push the caracters in
19611 union_obstack, not attrs_obstack.
19612
342b8b6e
AD
196132001-10-04 Akim Demaille <akim@epita.fr>
19614
19615 Merge in the branch 1.29.
19616
19617 * src/reader.c (packsymbols): Use a temporary obstack for
19618 `%%tokendef', since output_stack is already used elsewhere.
19619
19620 2001-10-02 Akim Demaille <akim@epita.fr>
19621
19622 Bump 1.29d.
19623
19624 2001-10-02 Akim Demaille <akim@epita.fr>
19625
19626 Version 1.29c.
19627
19628 2001-10-02 Akim Demaille <akim@epita.fr>
19629
19630 * tests/regression.at (Invalid CPP headers): New.
19631 From Alexander Belopolsky.
19632 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
19633
19634 2001-10-02 Akim Demaille <akim@epita.fr>
19635
19636 * tests/regression.at (Invalid input): New.
19637 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
19638 Reported by Shura.
19639
19640 2001-10-02 Akim Demaille <akim@epita.fr>
19641
19642 * tests/calc.at: Now that --debug works, the tests must be adjusted.
19643
19644 2001-10-02 Akim Demaille <akim@epita.fr>
19645
19646 * src/output.c (output_parser): Assert `skeleton'.
19647 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
19648 systems.
19649 From Shura.
19650
19651 2001-10-01 Marc Autret <autret_m@epita.fr>
19652
19653 * src/lex.h: Echo modifications.
19654 * src/lex.c (unlex): Parameter is now token_t.
19655 From Hans Aberg.
19656
19657 2001-10-01 Marc Autret <autret_m@epita.fr>
19658
19659 * src/main.c: Include lex.h.
19660 From Hans Aberg.
19661
19662 2001-09-29 Akim Demaille <akim@epita.fr>
19663
19664 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
19665
19666 2001-09-28 Akim Demaille <akim@epita.fr>
19667
19668 * tests/testsuite.at: Update to newer Autotest.
19669 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
19670
19671 2001-09-27 Akim Demaille <akim@epita.fr>
19672
19673 Position independent wrapper.
19674
19675 * tests/bison: Remove.
19676 * tests/bison.in: New.
19677 * configure.in: Adjust.
19678
19679 2001-09-27 Paul Eggert <eggert@twinsun.com>
19680
19681 Port quotearg fixes from tar 1.13.24.
19682
19683 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
19684 tm to be declared.
19685 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
19686 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
19687
19688 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
19689 * m4/mbrtowc.m4: New file.
19690 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
19691 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
19692
19693 2001-09-27 Akim Demaille <akim@epita.fr>
19694
19695 Bump to 1.29c.
19696
19697 2001-09-27 Akim Demaille <akim@epita.fr>
19698
19699 Version 1.29b.
19700
19701 2001-09-25 Akim Demaille <akim@epita.fr>
19702
19703 * src/system.h: Include `xalloc.h'.
19704 Remove it from the C files.
19705 * src/files.c (output_files): Free the obstacks.
19706 * src/lex.c (init_lex): Rename as...
19707 (lex_init): this.
19708 (lex_free): New.
19709 * src/main.c (main): Use it.
19710
19711 2001-09-24 Marc Autret <autret_m@epita.fr>
19712
19713 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
19714 to output informations in fout (FILE*).
19715 (open_graph, close_graph): Likewise.
19716 (output_graph, output_edge, output_node): Likewise.
19717 * src/vcg.h: Update function prototypes.
19718 * src/print_graph.c (print_graph): Open output graph file.
19719 (print_actions): Adjust.
19720 * src/files.h: Remove extern declaration.
19721 * src/files.c: Remove graph_obstack declaration.
19722 (open_files): Remove graph_obstack initialization.
19723 (output_files): Remove graph_obstack saving.
19724
19725 2001-09-24 Marc Autret <autret_m@epita.fr>
19726
19727 * src/files.c (compute_output_file_names): Fix.
19728
19729 2001-09-24 Marc Autret <autret_m@epita.fr>,
19730 Akim Demaille <akim@epita.fr>
19731
19732 * src/reader.c (reader): Remove call to free_symtab ().
19733 * src/main.c (main): Call it here.
19734 Include symtab.h.
19735 * src/conflicts.c (initialize_conflicts): Rename as...
19736 (solve_conflicts): this.
19737 * src/print.c (print_core, print_actions, print_state)
19738 (print_grammar): Dump to a file instead a `output_obstack'.
19739 (print_results): Dump `output_obstack', and then proceed with the
19740 FILE *.
19741 * src/files.c (compute_output_file_names, close_files): New.
19742 (output_files): Adjust.
19743 * src/main.c (main): Adjust.
19744
19745 2001-09-23 Marc Autret <autret_m@epita.fr>
19746
19747 * src/files.c (compute_header_macro): Computes header macro name
19748 from spec_defines_file when given.
19749
19750 2001-09-23 Marc Autret <autret_m@epita.fr>
19751
19752 * src/files.c (output_files): Add default extensions.
19753
19754 2001-09-22 Akim Demaille <akim@epita.fr>
19755
19756 * src/conflicts.c (finalize_conflicts): Rename as...
19757 (free_conflicts): this.
19758
19759 2001-09-22 Akim Demaille <akim@epita.fr>
19760
19761 * src/gram.c (gram_free): Rename back as...
19762 (dummy): this.
19763 (output_token_translations): Free `token_translations'.
19764 * src/symtab.c (free_symtab): Free the tag field.
19765
19766 2001-09-22 Akim Demaille <akim@epita.fr>
19767
19768 Remove `translations' as it is always set to true.
19769
19770 * src/gram.h: Adjust.
19771 * src/reader.c (packsymbols, parse_token_decl): Adjust
19772 * src/print.c (print_grammar): Adjust.
19773 * src/output.c (output_token_translations): Adjust.
19774 * src/lex.c (lex): Adjust.
19775 * src/gram.c: Be sure the set pointers to NULL.
19776 (dummy): Rename as...
19777 (gram_free): this.
19778
19779 2001-09-22 Akim Demaille <akim@epita.fr>
19780
19781 * configure.in: Invoke AM_LIB_DMALLOC.
19782 * src/system.h: Use dmalloc.
19783 * src/LR0.c: Be sure to have pointers initialized to NULL.
19784 (allocate_itemsets): Allocate kernel_items only if needed.
19785
19786 2001-09-22 Akim Demaille <akim@epita.fr>
19787
19788 * configure.in: Bump to 1.29b.
19789 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
19790 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
19791 need xmalloc.c in calc.y.
19792 From Pascal Bart.
19793
19794 2001-09-21 Akim Demaille <akim@epita.fr>
19795
19796 Version 1.29a.
19797 * Makefile.maint, config/config.guess, config/config.sub,
19798 * config/missing: Update from masters.
19799 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
19800 upon package.m4.
19801 * configure.in (ALL_LINGUAS): Add `tr'.
19802
19803 2001-09-21 Akim Demaille <akim@epita.fr>
19804
19805 * tests/Makefile.am (package.m4): Move to...
19806 ($(srcdir)/$(TESTSUITE)): here.
19807
19808 2001-09-20 Akim Demaille <akim@epita.fr>
19809
19810 * src/complain.c: No longer try to be standalone: use system.h.
19811 Don't assume __STDC__ is defined to 1. Just test if it is defined.
19812 * src/complain.h: Likewise.
19813 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
19814 Remove the unused variable `n'.
19815 From Albert Chin-A-Young.
19816
19817 2001-09-18 Marc Autret <autret_m@epita.fr>
19818
19819 * doc/bison.1: Update.
19820 * doc/bison.texinfo (Bison Options): Update --defines and --graph
19821 descriptions.
19822 (Option Cross Key): Update.
19823 Add --graph.
19824
19825 2001-09-18 Marc Autret <autret_m@epita.fr>
19826
19827 * tests/regression.at: New test (comment in %union).
19828
19829 2001-09-18 Marc Autret <autret_m@epita.fr>
19830
19831 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
19832 do that.
19833 Reported by Keith Browne.
19834
19835 2001-09-18 Marc Autret <autret_m@epita.fr>
19836
19837 * tests/output.at: Add tests for --defines and --graph.
19838
19839 2001-09-18 Marc Autret <autret_m@epita.fr>
19840
19841 * tests/output.at: Removes tests of %{header,src}_extension features.
19842
19843 2001-09-18 Akim Demaille <akim@epita.fr>
19844
19845 * tests/Makefile.am (package.m4): New.
19846 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
19847 (_AT_CHECK_CALC_ERROR): Likewise.
19848 Factor the `, ' part of verbose error messages.
19849
19850 2001-09-18 Marc Autret <autret_m@epita.fr>
19851
19852 * src/getargs.c (longopts): Declare --defines and --graph as options
19853 with optional arguments.
19854 * src/files.h: Add extern declarations.
19855 * src/files.c (spec_graph_file, spec_defines_file): New.
19856 (output_files): Update.
19857 Remove CPP-outed code.
19858
19859 2001-09-18 Marc Autret <autret_m@epita.fr>
19860
19861 Turn off %{source,header}_extension feature.
19862
19863 * src/files.c (compute_exts_from_gf): Update.
19864 (compute_exts_from_src): Update.
19865 (output_files): CPP-out useless code.
19866 * src/files.h: Remove {header,source}_extension extern declarations.
19867 * src/reader.c (parse_dquoted_param): CPP-out.
19868 (parse_header_extension_decl): Remove.
19869 (parse_source_extension_decl): Remove.
19870 (read_declarations): Remove cases tok_{hdrext,srcext}.
19871 * src/lex.c (percent_table): Remove {header,source}_extension entries.
19872 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
19873
19874 2001-09-10 Akim Demaille <akim@epita.fr>
19875
19876 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
19877 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
19878 (AT_CHECK_OUTPUT): this.
19879 Merely check ls' exit status, its output is useless.
19880
19881 2001-09-10 Akim Demaille <akim@epita.fr>
19882
19883 * tests/calc.at: Use m4_match.
19884 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
19885
19886 2001-09-10 Marc Autret <autret_m@epita.fr>,
19887 Akim Demaille <akim@epita.fr>
19888
19889 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
19890 enum color_e.
19891 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
19892 to `normal'.
19893 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
19894 * src/lex.h: Adjust prototype.
19895 (token_t): Add `tok_undef'.
19896 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
19897 (parse_percent_token): Now returns token_t.
19898 Add default statement in switch.
19899 (lex): Separate `c' as an input variable, from the token_t result
19900 part.
19901 (unlexed): Is a token_t.
19902
19903 2001-09-10 Akim Demaille <akim@epita.fr>
19904
19905 * configure.in: Bump to 1.29a.
19906
19907 2001-09-07 Akim Demaille <akim@epita.fr>
19908
19909 Version 1.29.
19910
19911 2001-08-30 Akim Demaille <akim@epita.fr>
19912
19913 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
19914 * m4/atconfig.m4: Remove.
19915 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
19916 * tests/bison: New.
19917 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
19918 m4_if, m4_patsubst, and m4_regexp.
19919 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
19920 `input' file instead of echo.
19921
19922 2001-08-29 Akim Demaille <akim@epita.fr>
19923
19924 Bump to 1.28e.
19925
19926 2001-08-29 Akim Demaille <akim@epita.fr>
19927
19928 Version 1.28d.
19929
19930 2001-08-29 Paul Eggert <eggert@twinsun.com>
19931
19932 * src/bison.simple (yyparse): Don't take the address of an
19933 item before the start of an array, as that doesn't conform to
19934 the C Standard.
19935
19936 2001-08-29 Robert Anisko <anisko_r@epita.fr>
19937
19938 * doc/bison.texinfo (Location Tracking Calc): New node.
19939
19940 2001-08-29 Paul Eggert <eggert@twinsun.com>
19941
19942 * src/output.c (output): Do not define const, as this now
19943 causes more problems than it cures.
19944
19945 2001-08-29 Akim Demaille <akim@epita.fr>
19946
19947 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
19948 the nodes.
19949 Be sure to tag the `detailmenu'.
19950
19951 2001-08-29 Akim Demaille <akim@epita.fr>
19952
19953 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
19954 download in a tmp dir.
19955
19956 2001-08-28 Marc Autret <autret_m@epita.fr>
19957
19958 * config/depcomp: New file.
19959
19960 2001-08-28 Marc Autret <autret_m@epita.fr>
19961
19962 * doc/bison.1 (mandoc): Adjust.
19963 From Juan Manuel Guerrero.
19964
19965 2001-08-28 Marc Autret <autret_m@epita.fr>
19966
19967 * src/print_graph.c (print_state): Fix.
19968
19969 2001-08-27 Marc Autret <autret_m@epita.fr>
19970
19971 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
19972 char * members.
19973 Echo modifications to the functions prototypes.
19974 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
19975
19976 2001-08-27 Marc Autret <autret_m@epita.fr>
19977
19978 * src/vcg.c: Include `xalloc.h'.
19979 (add_colorentry): New.
19980 (add_classname): New.
19981 (add_infoname): New.
19982 * src/vcg.h: Add new prototypes.
19983
19984 2001-08-27 Akim Demaille <akim@epita.fr>
19985
19986 * Makefile.maint: Sync. again with CVS Autoconf.
19987
19988 2001-08-27 Akim Demaille <akim@epita.fr>
19989
19990 * Makefile.maint: Formatting changes.
19991 (po-update, cvs-update, update): New targets.
19992 (AMTAR): Remove.
19993
19994 2001-08-27 Akim Demaille <akim@epita.fr>
19995
19996 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
19997 * Makefile.maint: Sync. with CVS Autoconf.
19998
19999 2001-08-27 Marc Autret <autret_m@epita.fr>
20000
20001 * src/vcg.h (struct infoname_s): New.
20002 (struct colorentry_s): New.
20003 (graph_s): New fields {vertical,horizontal}_order in structure.
20004 Add `infoname' field.
20005 Add `colorentry' field;
20006 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
20007 (G_HORIZONTAL_ORDER): New.
20008 (G_INFONAME): New.
20009 (G_COLORENTRY): New.
20010 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
20011 Add output of `infoname'.
20012 Add output of `colorentry'.
20013
20014 2001-08-27 Marc Autret <autret_m@epita.fr>
20015
20016 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
20017 This one shadowed a global parameter.
20018
20019 2001-08-24 Marc Autret <autret_m@epita.fr>
20020
20021 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
20022 instead of `unsigned'.
20023 (print_state): Do not call obstack_object_size () in obstack_grow ()
20024 to avoid macro variables shadowing.
20025
20026 2001-08-23 Marc Autret <autret_m@epita.fr>
20027
20028 * src/lex.c (percent_table): Typo: s/naem/name/.
20029 Add graph option.
20030 Normalize new options declarations.
20031
20032 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
20033
20034 * tests/suite.at: Exercise %header_extension and %source_extension.
20035
20036 2001-08-16 Marc Autret <autret_m@epita.fr>
20037
20038 * src/reader.c (parse_dquoted_param): New.
20039 (parse_header_extension_decl): Use it.
20040 (parse_source_extension_decl): Likewise.
20041
20042 2001-08-16 Marc Autret <autret_m@epita.fr>
20043
20044 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
20045 (get_xxxx_str): Use assert () instead of complain ().
20046 Remove return invokations in default cases.
20047 (get_decision_str): Modify default behaviour. Remove second argument.
20048 Echo modifications on calls.
20049 (output_graph): Fix.
20050
20051 2001-08-16 Marc Autret <autret_m@epita.fr>
20052
20053 * src/getargs.c (usage): Update with ``-g, --graph''.
20054
20055 2001-08-16 Marc Autret <autret_m@epita.fr>
20056
20057 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
20058 (Option Cross Key): Likewise.
20059 * doc/bison.1: Update.
20060
1c8c2190
PB
200612001-09-25 Pascal Bart <pascal.bart@epita.fr>
20062
20063 * src/output.c (output_master_parser): Don't finish action_obstack.
20064 (output_parser): Don't care about the muscle action, here.
20065 (prepare): Copy the action_obstack in the action muscle.
20066 (output): Free action_obstack.
20067
180d45ba
PB
200682001-09-23 Pascal Bart <pascal.bart@epita.fr>
20069
20070 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
20071 will contain `%union' declaration.
20072 (parse_union_decl): Delete #line directive output.
20073 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
20074 informations about %union.
20075 (parse_union_decl): Copy the union_obstack in the muscle stype.
20076 * src/bison.simple: Add new #line directive.
20077 Add typdef %%stype YYSTYPE.
20078
c51d1a19
PB
200792001-09-23 Pascal Bart <pascal.bart@epita.fr>
20080
20081 * src/bison.simple: Add new `#line' directive.
20082
6f9344da
PB
200832001-09-22 Pascal Bart <pascal.bart@epita.fr>
20084
20085 * src/bison.simple: New `#line' directive.
20086 * src/output.c (output_parser): Support new dynamic muscle input_line.
20087
652def80
MA
200882001-09-22 Marc Autret <autret_m@epita.fr>
20089
20090 * src/output.c (output_master_parser): New.
20091 (output_parser): Be more re-entrant.
20092
25b222fa
MA
200932001-09-21 Marc Autret <autret_m@epita.fr>
20094
20095 * src/reader.c (copy_definition, parse_union_decl): Update and use
20096 `linef' muscle.
20097 (copy_action): Likewise.
20098 Use obstack_1grow ().
20099 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
20100
6bc35ae5
MA
201012001-09-21 Marc Autret <autret_m@epita.fr>
20102
20103 * src/options.c (option_table): Adjust.
20104 * src/lex.c (parse_percent_token): Fix.
20105
c0629aa1
PB
201062001-09-20 Pascal Bart <pascal.bart@epita.fr>
20107
20108 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 20109
82b6d266
PB
201102001-09-20 Pascal Bart <pascal.bart@epita.fr>
20111
20112 * src/lex.c (parse_percent_token): Change type of variable `tx', which
20113 is now an option_table_struct*.
20114 (option_strcmp): New function option_strcmp.
20115 (parse_percent_token): Call option_strcmp.
20116 * src/getargs.c (xalloc.h, options.h): Include it.
20117 (getargs): Call create_long_option_table.
20118 (getargs): Free longopts at the end of the function.
20119 (shortopts): Move in options.c.
20120 * src/options.c (create_long_option_table): New function. Convert
20121 information from option_table to option structure.
20122 * src/reader.c (options.h): Include it.
20123
20124 * src/Makefile.am: Adjust.
20125 * src/options.c (option_table): Create from longopts and percent_table.
20126 * src/getargs.c (longopts): Delete.
20127 * src/lex.c (struct percent_table_struct): Delete.
20128 (percent_table): Delete.
20129 (options.h): Include it.
20130 * src/options.c: Create.
20131 * src/options.h: Create.
20132 Declare enum opt_access_e.
20133 Define struct option_table_struct.
20134
75f5aaea
MA
201352001-09-20 Marc Autret <autret_m@epita.fr>
20136
20137 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
20138 sections of Bison.
20139
f508cb0a
PB
201402001-09-19 Pascal Bart <pascal.bart@epita.fr>
20141
20142 * src/bison.simple: s/%%filename/%%skeleton.
20143 * src/muscle_tab.c (getargs.h): Include it.
20144 (muscle_init): Insert new muscle skeleton.
20145
13105fc1
PB
201462001-09-18 Pascal Bart <pascal.bart@epita.fr>
20147
20148 * src/output.c (output_parser): Delete unused variable actions_dumped.
20149
b0c4483e
PB
201502001-09-07 Pascal Bart <pascal.bart@epita.fr>
20151
20152 * src/output.c (output): Delete call to reader_output_yylsp.
20153 * src/reader.c (reader): Likewise.
ba0fe3c7 20154 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 20155
11d82f03
MA
201562001-09-02 Marc Autret <autret_m@epita.fr>
20157
20158 * src/reader.c: Include muscle_tab.h.
20159 (parse_union_decl): Update.
20160 (parse_macro_decl): Rename parse_muscle_decl.
20161 Update to use renamed functions and variable.
20162 (read_declarations, copy_action, read_additionnal_code, : Updated
20163 with correct variables and functions names.
20164 (packsymbols, reader): Likewise.
342b8b6e 20165
11d82f03 20166 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 20167
11d82f03
MA
20168 * src/output.c: Include muscle_tab.h
20169 In all functions using macro_insert, change by using muscle_insert ().
20170 (macro_obstack): Rename muscle_obstack.
20171 Echo modifications in the whole file.
20172 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
20173 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
20174 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
20175
20176 * src/muscle_tab.h: Update double inclusion macros.
20177 (macro_entry_s): Rename muscle_entry_s.
20178 Update prototypes.
342b8b6e 20179
11d82f03
MA
20180 * src/muscle_tab.c: Include muscle_tab.h.
20181 Rename macro_tabble to muscle_table.
20182 (mhash1, mhash2, mcmp): Use muscle_entry.
20183 (macro_init): Rename muscle_init. Update.
20184 (macro_insert): Rename muscle_insert. Update.
20185 (macro_find): Rename muscle_find. Update.
20186
20187 * src/main.c: Include muscle_tab.h.
20188 (main): Call muscle_init ().
20189 * src/Makefile.am (bison_SOURCES): Echo modifications.
20190
93a37297
MA
201912001-09-02 Marc Autret <autret_m@epita.fr>
20192
f753cd62 20193 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 20194
f753cd62
MA
20195 * src/muscle_tab.c, src/muscle_tab.h: Add files.
20196
201972001-09-02 Marc Autret <autret_m@epita.fr>
20198
20199 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 20200
682d48cd
PB
202012001-09-01 Pascal Bart <pascal.bart@epita.fr>
20202
342b8b6e 20203 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
20204 filename.
20205
087c8fda
MA
202062001-09-01 Marc Autret <autret_m@epita.fr>
20207
20208 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
20209 to an explicit value to activate the feature. We do it here.
20210
dda680cb
PB
202112001-08-31 Pascal Bart <pascal.bart@epita.fr>
20212
20213 * src/output.c (prepare): Delete the `filename' muscule insertion.
20214 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
20215 (parse_union_decl): Likewise.
20216 * src/macrotab.c (macro_init): Initialize filename by infile.
20217
9e644e64
MA
202182001-08-31 Marc Autret <autret_m@epita.fr>
20219
20220 * src/bison.simple (YYLSP_NEEDED): New definition.
20221 * src/output.c (prepare): Add macro insertion of `locations_flag'
20222
17da6427
PB
202232001-08-31 Pascal Bart <pascal.bart@epita.fr>
20224
20225 * src/output.c (prepare): Delete insertion of previous muscles,
20226 and insert the `prefix' muscles.
20227 * src/macrotab.c (macro_init): Likewise.
20228 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 20229 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
20230 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
20231 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 20232 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
20233 name_prefix.
20234
e8cb70b9
PB
202352001-08-31 Pascal Bart <pascal.bart@epita.fr>
20236
20237 * src/main.c (main): Standardize.
20238 * src/output.c (output_table_data, output_parser): Likewise.
20239 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
20240
63c2d5de
MA
202412001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
20242
342b8b6e 20243 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
20244 %%epilogue.
20245 * src/output.c (output): Rename %%declarations to %%prologue.
20246 * src/bison.simple: Echo modifications.
342b8b6e 20247
d8cb5183
MA
202482001-08-31 Marc Autret <autret_m@epita.fr>
20249
20250 * src/reader.c (readgram): CleanUp.
20251 (output_token_defines): Likewise.
20252 (packsymbols): Likewise.
20253 (reader): Likewise.
20254 * src/output.c (output): CPP-out useless code.
20255
6c686258
PB
202562001-08-31 Pascal Bart <pascal.bart@epita.fr>
20257
342b8b6e 20258 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
20259 output_trailers and output_headers.
20260 * src/output.h: Remove obsolete functions prototypes of output_headers
20261 and output_trailers.
20262
8f451ef7
PB
202632001-08-30 Pascal Bart <pascal.bart@epita.fr>
20264
20265 * src/main.c: Include macrotab.h.
342b8b6e 20266 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
20267 Adjust functions prototypes.
20268 * src/macrotab.c (macro_insert): Constify key and value.
20269 (macro_find): Constify key.
20270 (macro_insert): Include 'xalloc.h'
20271 (macro_insert): Use XMALLOC.
20272 (macro_find): Constify return value.
20273 * src/output.c (output_table_data): Rename table to table_data.
20274 (output_parser): Constify macro_key, macro_value.
20275
997b6fd0 202762001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
20277
20278 * src/reader.c (parse_skel_decl): New.
342b8b6e 20279 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
20280 * src/lex.h (token_t): New token `tok_skel'.
20281 * src/lex.c (percent_table): Add skeleton option entry.
20282 Standardize.
20283
ff48177d
MA
202842001-08-29 Marc Autret <autret_m@epita.fr>
20285
20286 * src/bison.simple: Add %%user_code directive at the end.
20287 * src/reader.c (read_additionnal_code): New.
20288 (reader): Use it.
20289 * src/output.c (output_program): Remove.
20290 (output): Update.
20291
b33160bf
MA
202922001-08-28 Marc Autret <autret_m@epita.fr>
20293
20294 * src/output.c (output_actions): Clean up.
4e5caae2 20295 (output_gram): CPP-out useless code.
b33160bf
MA
20296 * src/reader.c (reader): Clean up, CPP-out useless code.
20297
d1a2daf7
PB
202982001-08-28 Pascal Bart <pascal.bart@epita.fr>
20299
342b8b6e 20300 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 20301 directive.
d1a2daf7
PB
20302 * src/bison.simple: Add `%%definitions'.
20303
2b763dfe
MA
203042001-08-28 Marc Autret <autret_m@epita.fr>
20305
20306 * config/depcomp: New file.
20307
f1a87ef6
PE
203082001-08-27 Paul Eggert <eggert@twinsun.com>
20309
20310 * src/bison.simple (yyparse): Don't take the address of an
20311 item before the start of an array, as that doesn't conform to
20312 the C Standard.
20313
82e236e2
RA
203142001-08-27 Robert Anisko <robert.anisko@epita.fr>
20315
f1a87ef6 20316 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
20317 obstack. It was done too late here.
20318
20319 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
20320 completely wrong.
20321 (reader): Initialize the macro obstack here, since we need it to grow
20322 '%define' directives.
20323
20324 * src/reader.h: Declare the macro obstack as extern.
20325
b0cfa28a
RA
203262001-08-27 Robert Anisko <robert.anisko@epita.fr>
20327
20328 * src/output.c (output_parser): Fix. Store single '%' characters in
20329 the output obstack instead of throwing them away.
20330
6fc74234
AD
203312001-08-27 Akim Demaille <akim@epita.fr>
20332
20333 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
20334
9c76d118
RA
203352001-08-25 Robert Anisko <robert.anisko@epita.fr>
20336
20337 * lib/Makefile.am: Adjust.
20338
a8289c62
RA
203392001-08-25 Robert Anisko <robert.anisko@epita.fr>
20340
20341 * src/bison.simple: Update and add '%%' directives.
20342
b6610515
RA
203432001-08-25 Robert Anisko <robert.anisko@epita.fr>
20344
20345 * src/reader.c (reader): Remove calls to 'output_headers' and
20346 'output_trailers'. Remove some C output.
20347 (readgram): Disable a piece of code that was writing a default
20348 definition for 'YYSTYPE'.
20349 (reader_output_yylsp): Remove.
20350 (packsymbols): Output token defintions to a macro.
20351 (copy_definition): Disable C output.
6fc74234 20352
b6610515
RA
20353 * src/reader.c (parse_macro_decl): New function used to parse macro
20354 declarations.
20355 (copy_string2): Put the body of copy_string into this new function.
20356 Add a parameter to let the caller choose whether he wants to copy the
20357 string delimiters or not.
20358 (copy_string): Be a simple call to copy_string2 with the last argument
20359 bound to true.
20360 (read_declarations): Add case for macro definition.
20361 (copy_identifier): New.
6fc74234 20362 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
20363 rather than lex.
20364
26f609ff
RA
203652001-08-25 Robert Anisko <robert.anisko@epita.fr>
20366
20367 * src/output.c (prepare): Add prefixed names.
20368 (output_parser): Output semantic actions.
20369 (output_parser): Fix bug on '%%line' directives.
6fc74234 20370
26f609ff
RA
20371 * src/output.c (output_headers): Remove. The C code printed by this
20372 function should now be in the skeletons.
20373 (output_trailers): Remove.
20374 (output): Disable call to 'reader_output_yylsp'.
20375 (output_rule_data): Do not output tables to the table obstack.
20376
20377 * src/output.c: Remove some C dedicated output.
20378 Improve the use of macro and output obstacks.
20379 (output_defines): Remove.
6fc74234 20380
26f609ff
RA
20381 * src/output.c (output_token_translations): Associate 'translate'
20382 table with a macro. No output to the table obstack.
20383 (output_gram): Same for 'rhs' and 'prhs'.
20384 (output_stos): Same for 'stos'.
20385 (output_rule_data): Same for 'r1' and 'r2'.
20386 (token_actions): Same for 'defact'.
20387 (goto_actions): Same for 'defgoto'.
20388 (output_base): Same for 'pact' and 'pgoto'.
20389 (output_table): Same for 'table'.
20390 (output_check): Same for 'check'.
6fc74234 20391
26f609ff
RA
20392 * src/output.c (output_table_data): New function.
20393 (output_short_table): Remove.
20394 (output_short_or_char_table): Remove.
6fc74234 20395
26f609ff
RA
20396 * src/output.c (output_parser): Replace most of the skeleton copy code
20397 with something new. Skeletons are now processed character by character
20398 rather than line by line, and Bison looks for '%%' macros. This is the
20399 first step in making Bison's output process (a lot) more flexible.
20400 (output_parser): Use the macro table.
20401
6f43b113
RA
204022001-08-25 Robert Anisko <robert.anisko@epita.fr>
20403
20404 * src/main.c (main): Initialize the macro table.
20405
dd3127cf
RA
204062001-08-25 Robert Anisko <robert.anisko@epita.fr>
20407
20408 * src/lex.c (percent_table): Add tok_define.
20409 * src/lex.h: Add tok_define.
20410
aa321494
RA
204112001-08-25 Robert Anisko <robert.anisko@epita.fr>
20412
20413 * src/macrotab.c: New file.
20414 * src/macrotab.h: New file.
20415 * src/Makefile.am: Update.
20416
68bd3b6b
RA
204172001-08-25 Robert Anisko <robert.anisko@epita.fr>
20418
20419 * lib/hash.c: New file.
20420 * lib/hash.h: New file.
20421 * lib/Makefile.am: Update.
20422
45f8dd1e
AD
204232001-08-15 Akim Demaille <akim@epita.fr>
20424
20425 Version 1.28c.
20426
40a64a7a 204272001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
20428
20429 * src/reader.c (readgram): Indent output macro YYSTYPE.
20430 (packsymbols): Likewise.
20431 (output_token_defines): Likewise.
20432 * src/files.c: Standardize.
20433 (compute_header_macro): New.
20434 (defines_obstack_save): New. Use compute_header_macro.
20435 (output_files): Update. Use defines_obstack_save.
20436
f9a8293a
AD
204372001-08-15 Akim Demaille <akim@epita.fr>
20438
20439 * doc/bison.texinfo (Table of Symbols): Document
20440 YYSTACK_USE_ALLOCA.
20441
150ca7a7
AD
204422001-08-15 Akim Demaille <akim@epita.fr>
20443
20444 * missing: Update from CVS Automake.
20445 * config/config.guess, config/config.sub, config/texinfo.tex:
20446 Update from gnu.org.
20447
69b5cec4
AD
204482001-08-15 Akim Demaille <akim@epita.fr>
20449
20450 * Makefile.maint: Sync with CVS Autoconf.
20451
f2b5126e
PB
204522001-08-14 Pascal Bart <pascal.bart@epita.fr>
20453
69b5cec4 20454 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
20455 `fdl.texi'.
20456 * doc/fdl.texi: Add to package.
20457
4ecbf796
MA
204582001-08-14 Marc Autret <autret_m@epita.fr>
20459
20460 Turn on %{source,header}_extension features.
20461
69b5cec4 20462 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
20463 source_extension.
20464 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 20465 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
20466 between options.
20467
95fb5662
MA
204682001-08-14 Marc Autret <autret_m@epita.fr>
20469
20470 * src/files.c (compute_base_names): Add extensions computing when
20471 `--file-prefix' used.
20472 Standardize function calls.
20473
78d09da9
MA
204742001-08-13 Marc Autret <autret_m@epita.fr>
20475
69b5cec4 20476 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
20477 defining it (defined but null disables alloca).
20478
5a009f2c
MA
204792001-08-13 Marc Autret <autret_m@epita.fr>
20480
20481 * src/bison.simple (_yy_memcpy): CPP reformat.
20482
1e41465a
PB
204832001-08-13 Pascal Bart <pascal.bart@epita.fr>
20484
20485 * tests/atconfig.in (CPPFLAGS): Fix.
20486
c67a198d
PB
204872001-08-10 Pascal Bart <pascal.bart@epita.fr>
20488
79282c6c 20489 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
20490 `gpl.texi'.
20491 * doc/gpl.texi: Add to package.
20492
09a6de7e
MA
204932001-08-10 Marc Autret <autret_m@epita.fr>
20494
20495 * src/print_graph.h: Fix.
20496 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
20497
b77b9ee0
AD
204982001-08-10 Akim Demaille <akim@epita.fr>
20499
20500 * src/system.h: Provide default declarations for stpcpy, strndup,
20501 and strnlen.
20502
3e259915
MA
205032001-08-10 Robert Anisko <anisko_r@epita.fr>
20504
20505 * doc/bison.texinfo (Locations): Update @$ stuff.
20506
ca96bc2d
MA
205072001-08-09 Robert Anisko <anisko_r@epita.fr>
20508
20509 * src/bison.simple (YYLLOC_DEFAULT): Update.
20510 (yyparse): Adjust.
20511
fdc6758b
MA
205122001-08-08 Marc Autret <autret_m@epita.fr>
20513
b77b9ee0 20514 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
20515 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
20516 Reported by Fabrice Bauzac.
957d4dbf 20517
600cad3b
MA
205182001-08-08 Marc Autret <autret_m@epita.fr>
20519
20520 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
20521 * src/vcg.c (output_node): Fix.
20522 * src/vcg.h: Cleanup.
20523 * src/print_graph.c: Add comments.
b77b9ee0 20524 (node_output_size): New global variable. Simplify the formatting of
600cad3b 20525 the VCG graph output.
b77b9ee0 20526 (print_actions): Unused code is now used. It notifies the final state
600cad3b 20527 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 20528 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
20529 blue.
20530 Get the current node name and node_obstack by argument.
20531 (node_obstack): New variable.
20532 (print_state): Manage node_obstack.
20533 (print_core): Use node_obstack given by argument.
20534 A node is not only computed here but in print_actions also.
20535 (print_graph): CPP out useless code instead of commenting it.
20536
976e528f
AD
205372001-08-07 Pascal Bart <pascal.bart@epita.fr>
20538
20539 * tests/atconfig.in (CPPFLAGS): Fix.
20540
20e8e5ca
AD
205412001-08-07 Akim Demaille <akim@epita.fr>
20542
20543 * src/print_graph.c (quote): New.
20544 (print_core): Use it.
20545
957d4dbf 205462001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 20547
3e3da797
AD
20548 * src/vcg.c (complain.h): Include it.
20549 Unepitaize `return' invocations.
c4b66126 20550 [NDEBUG] (main): Remove.
79282c6c 20551 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
20552 * src/files.c (open_files): Initialize graph_obstack.
20553 * src/print_graph.c (print_actions): CPP out useless code.
20554 (print_core): Don't output the last `\n' in labels.
20555 Use `quote'.
20556 * src/files.c (output_files): Output the VCG file.
20557 * src/main.c (main): Invoke print_graph ();
3e3da797 20558
957d4dbf 205592001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
20560
20561 Automaton VCG graph output.
20562 Using option ``-g'' or long option ``--graph'', you can generate
20563 a gram_filename.vcg file containing a VCG description of the LALR (1)
20564 automaton of your grammar.
20565
20566 * src/main.c: Call to print_graph() function.
20567 * src/getargs.h: Update.
20568 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
20569 (graph_flag): New flag.
20570 (longopts): Update.
20571 (getargs): Add case `g'.
20572 * src/files.c (graph_obstack): New obstack struct.
20573 (open_files): Initialize new obstack.
20574 (output_files): Saves graph_obstack if required.
20575 * src/files.h (graph_obstack): New extern declaration.
20576 * src/Makefile.am: Add new source files.
20577
927c1557 205782001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
20579
20580 * src/print_graph.c, src/print_graph.h (graph): New.
20581 * src/vcg.h: New file.
20582 * src/vcg.c: New file, VCG graph handling.
20583
7333d403
AD
205842001-08-06 Marc Autret <autret_m@epita.fr>
20585
20586 Add of %source_extension and %header_extension which specify
20587 the source or/and the header output file extension.
20588
20589 * src/files.c (compute_base_names): Remove initialisation of
20590 src_extension and header_extension.
20591 (compute_exts_from_gf): Update.
20592 (compute_exts_from_src): Update.
20593 (output_files): Update.
20594 * src/reader.c (parse_header_extension_decl): New.
20595 (parse_source_extension_decl): New.
20596 (read_declarations): New case statements for the new tokens.
20597 * src/lex.c (percent_table): Add entries for %source_extension
20598 and %header_extension.
20599 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
20600
84163231
AD
206012001-08-06 Marc Autret <autret_m@epita.fr>
20602
20603 * configure.in: Bump to 1.28c.
20604 * doc/bison.texinfo: Texinfo thingies.
20605
8303fc42
AD
206062001-08-04 Pascal Bart <pascal.bart@epita.fr>
20607
20608 * tests/atconfig.in (CPPFLAGS): Add.
20609 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
20610
70a84437
AD
206112001-08-03 Akim Demaille <akim@epita.fr>
20612
20613 Version 1.28b.
20614
2ce10144
AD
206152001-08-03 Akim Demaille <akim@epita.fr>
20616
20617 * tests/Makefile.am (check-local): Ship testsuite.
20618 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
20619 Include `string.h'.
20620
1e3e4bc1
AD
206212001-08-03 Akim Demaille <akim@epita.fr>
20622
20623 * configure.in: Try using -Wformat when compiling.
20624
42b45b7f
AD
206252001-08-03 Akim Demaille <akim@epita.fr>
20626
20627 * configure.in: Bump to 1.28b.
20628
8f13fe33
AD
206292001-08-03 Akim Demaille <akim@epita.fr>
20630
20631 * src/complain.c: Adjust strerror_r portability issues.
20632
b37ba92c
AD
206332001-08-03 Akim Demaille <akim@epita.fr>
20634
20635 Version 1.28a.
20636
b0ce6046
AD
206372001-08-03 Akim Demaille <akim@epita.fr>
20638
20639 * src/getargs.c, src/getarg.h (skeleton)): Constify.
20640 * src/lex.c (literalchar): Avoid name clashes on `buf'.
20641 * src/getargs.c: Include complain.h.
20642 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
20643 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
20644
d01c415b
AD
206452001-08-03 Akim Demaille <akim@epita.fr>
20646
20647 * src/reader.c (readgram): Display hidden chars in error messages.
20648
459dd1a6
AD
206492001-08-03 Akim Demaille <akim@epita.fr>
20650
20651 Update to gettext 0.10.39.
20652
53b74c0c
AD
206532001-08-03 Akim Demaille <akim@epita.fr>
20654
20655 * lib/strspn.c: New.
20656
234a3be3
AD
206572001-08-01 Marc Autret <autret_m@epita.fr>
20658
20659 * doc/bison.texinfo: Update.
20660 * doc/bison.1 (mandoc): Update.
20661 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
20662 * src/files.c: Support output files extensions computing.
20663 (src_extension): New static variable.
20664 (header_extension): New static variable.
20665 (tr): New function.
20666 (get_extension_index): New function, gets the index of an extension
20667 filename in a string.
20668 (compute_exts_from_gf): New function, computes extensions from the
20669 grammar file extension.
20670 (compute_exts_from_src): New functions, computes extensions from the
20671 C source file extension, file given by ``-o'' option.
20672 (compute_base_names): Update.
20673 (output_files): Update.
20674
847bf1f5
AD
206752001-08-01 Robert Anisko <anisko_r@epita.fr>
20676
d995fee7 20677 * doc/bison.texi: Document @$.
847bf1f5
AD
20678 (Locations): New section.
20679
d074a105
AD
206802001-07-18 Akim Demaille <akim@epita.fr>
20681
20682 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
20683 * config/prev-version.txt, config/move-if-change: New.
20684 * Makefile.am: Adjust.
20685
3419715d
AD
206862001-07-08 Pascal Bart <pascal.bart@epita.fr>
20687
20688 * src/bison.simple (yyparse): Suppress warning `comparaison
20689 between signed and unsigned'.
20690
62ab6972
AD
206912001-07-05 Pascal Bart <pascal.bart@epita.fr>
20692
20693 * src/getargs.h (raw_flag): Remove.
20694 * src/getargs.c: Die on `-r'/`--raw'.
20695 * src/lex.c (parse_percent_token): Die on `%raw'.
20696 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
20697 * tests/calc.at: Suppress test with option `--raw'.
20698
1e24cc5b
AD
206992001-07-14 Akim Demaille <akim@epita.fr>
20700
20701 * config/: New.
20702 * configure.in: Require Autoconf 2.50.
20703 Update to gettext 0.10.38.
20704
32dfccf8
AD
207052001-03-16 Akim Demaille <akim@epita.fr>
20706
20707 * doc/bison.texinfo: ANSIfy the examples.
20708
cd5bd6ac
AD
207092001-03-16 Akim Demaille <akim@epita.fr>
20710
20711 * getargs.c (skeleton): New variable.
20712 (longopts): --skeleton is a new option.
20713 (shortopts, getargs): -S is a new option.
20714 * getargs.h: Declare skeleton.
20715 * output.c (output_parser): Use it.
20716
5141b016
AD
207172001-03-16 Akim Demaille <akim@epita.fr>
20718
20719 * m4/strerror_r.m4: New.
20720 * m4/error.m4: Run AC_FUNC_STRERROR_R.
20721 * lib/error.h, lib/error.c: Update.
20722
447992b9
AD
207232001-03-16 Akim Demaille <akim@epita.fr>
20724
20725 * src/getargs.c (longopts): Clean up.
20726
274d42ce
AD
207272001-02-21 Akim Demaille <akim@epita.fr>
20728
20729 * src/reader.c (gensym): `gensym_count' is your own.
20730 Use a static buf to create the symbol name, as token_buffer is no
20731 longer a buffer.
20732
22c821f3
AD
207332001-02-08 Akim Demaille <akim@epita.fr>
20734
20735 * src/conflicts.c (conflict_report): Be sure not to append to res
20736 between two calls, which could happen if both first sprintf were
20737 skipped, but not the first cp += strlen.
20738
18569462
AD
207392001-02-08 Akim Demaille <akim@epita.fr>
20740
20741 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
20742 New, from fileutils 4.0.37.
20743 * configure.in: Require Autoconf 2.49c. I took some time before
20744 making this decision. This is the only way out for portability
20745 issues in Bison, it would mean way too much duplicate effort to
20746 import in Bison features implemented in 2.49c since 2.13.
20747 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
20748
0d8f3c8a
AD
207492001-02-02 Akim Demaille <akim@epita.fr>
20750
20751 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 20752 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 20753
f17bcd1f
AD
207542001-01-19 Akim Demaille <akim@epita.fr>
20755
20756 Get rid of the ad hoc handling of token_buffer in the scanner: use
20757 the obstacks.
20758
20759 * src/lex.c (token_obstack): New.
20760 (init_lex): Initialize it. No longer call...
20761 (grow_token_buffer): this. Remove it.
20762 Adjust all the places which used it to use the obstack.
20763
511e79b3
AD
207642001-01-19 Akim Demaille <akim@epita.fr>
20765
20766 * src/lex.h: Rename all the tokens:
20767 s/\bENDFILE\b/tok_eof/g;
20768 s/\bIDENTIFIER\b/tok_identifier/g;
20769 etc.
20770 Let them be enums, not #define, to ease debugging.
20771 Adjust all the code.
20772
0d6508ef
AD
207732001-01-18 Akim Demaille <akim@epita.fr>
20774
20775 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
20776 * src/lex.c (maxtoken, grow_token_buffer): Static.
20777
6deb4447
AD
207782001-01-18 Akim Demaille <akim@epita.fr>
20779
20780 Since we now use obstacks, more % directives can be enabled.
20781
20782 * src/lex.c (percent_table): Also accept `%yacc',
20783 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
20784 `%debug'.
20785 Handle the actions for `%semantic_parser' and `%pure_parser' here,
20786 instead of returning a token.
20787 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
20788 * src/reader.c (read_declarations): Adjust.
20789 * src/files.c (open_files): Don't call `compute_base_names', don't
20790 compute `attrsfile' since they depend upon data which might be
20791 *in* the input file now.
20792 (output_files): Do it here.
20793 * src/output.c (output_headers): Document the fact that this patch
20794 introduces a guaranteed SEGV for semantic parsers.
20795 * doc/bison.texinfo: Document them.
20796 * tests/suite.at: Exercise these %options.
20797
ff4423cc
AD
207982000-12-20 Akim Demaille <akim@epita.fr>
20799
20800 Also handle the output file (--verbose) with obstacks.
20801
20802 * files.c (foutput): Remove.
20803 (output_obstack): New.
20804 Adjust all dependencies.
20805 * src/conflicts.c: Return a string.
20806 * src/system.h (obstack_grow_string): Rename as...
20807 (obstack_sgrow): this. Be ready to work with non literals.
20808 (obstack_fgrow4): New.
20809
956dba3a
AD
208102000-12-20 Akim Demaille <akim@epita.fr>
20811
20812 * src/files.c (open_files): Fix the computation of short_base_name
20813 in the case of `-o foo.tab.c'.
20814
337bab46
AD
208152000-12-20 Akim Demaille <akim@epita.fr>
20816
20817 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
20818 (copy_dollar): Now that everything uses obstacks, get rid of the
20819 FILE * parameters.
20820
5d3214b8
AD
208212000-12-20 Akim Demaille <akim@epita.fr>
20822
20823 * src/files.c (open_files): Actually the `.output' file is based
20824 on the short_base_name, not base_name.
20825 * tests/suite.at (Checking output file names): Adjust.
20826
29092a57
AD
208272000-12-20 Akim Demaille <akim@epita.fr>
20828
20829 * src/bison.s1: Remove, we now use directly...
20830 * src/bison.simple: this.
20831 * src/Makefile.am: Use pkgdata instead of data.
20832
ea5607fd
AD
208332000-12-20 Akim Demaille <akim@epita.fr>
20834
20835 * src/files.c (guard_obstack): New.
20836 (open_files): Initialize it.
20837 (output_files): Dump it...
20838 * src/files.h: Export it.
20839 * src/reader.c (copy_guard): Use it.
20840
27110317
AD
208412000-12-19 Akim Demaille <akim@epita.fr>
20842
20843 * src/files.c (outfile, defsfile, actfile): Removed as global
20844 vars.
20845 (open_files): Don't compute them.
20846 (output_files): Adjust.
20847 (base_name, short_base_name): Be global.
20848 Adjust dependencies.
20849
19c50364
AD
208502000-12-19 Akim Demaille <akim@epita.fr>
20851
20852 * src/files.c (strsuffix): New.
20853 (stringappend): Be just like strcat but allocate.
20854 (base_names): Eve out from open_files.
20855 Try to simplify the rather hairy computation of base_name and
20856 short_base_name.
20857 (open_files): Use it.
20858 * tests/suite.at (Checking output file names): New test.
20859
573c1d9f
AD
208602000-12-19 Akim Demaille <akim@epita.fr>
20861
20862 * src/system.h (obstack_grow_literal_string): Rename as...
20863 (obstack_grow_string): this.
20864 * src/output.c (output_parser): Recognize `%% actions' instead of
20865 `$'.
20866 * src/bison.s1: s/$/%% actions/.
20867 * src/bison.hairy: Likewise.
20868
ef7ddedd
AD
208692000-12-19 Akim Demaille <akim@epita.fr>
20870
20871 * src/output.c (output_parser): Compute the `#line' lines when
20872 there are.
20873 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
20874 Suggested by Hans Aberg.
20875
ff61dabd
AD
208762000-12-19 Akim Demaille <akim@epita.fr>
20877
20878 Let the handling of the skeleton files be local to the procedures
20879 that use it.
20880
20881 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
20882 longer static.
20883 (fparser, open_extra_files): Remove.
20884 (open_files, output_files): Don't take care of fparser.
20885 * src/files.h: Adjust.
20886 * src/output.c (output_parser): Open and close the file to the
20887 skeleton.
20888 * src/reader.c (read_declarations): When %semantic_parser, open
20889 fguard.
20890
55b96341
AD
208912000-12-19 Akim Demaille <akim@epita.fr>
20892
20893 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
20894 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
20895
358c15b7
AD
208962000-12-19 Akim Demaille <akim@epita.fr>
20897
20898 * src/files.c (open_files): Yipee! We no longer need all the code
20899 looking for `/tmp' since we have no tmp file.
20900
7de3329e
AD
209012000-12-19 Akim Demaille <akim@epita.fr>
20902
20903 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
20904 New macros.
20905 * src/files.c (open_files): Less dependency on MSDOS etc.
20906
3abcd459
AD
209072000-12-14 Akim Demaille <akim@epita.fr>
20908
20909 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
20910 Provide a default definition.
20911 Use it when executing the default @ action.
20912 * src/reader.c (reader_output_yylsp): No longer include
20913 `timestamp' and `text' in the default YYLTYPE.
20914
2a91a95e
AD
209152000-12-12 Akim Demaille <akim@epita.fr>
20916
20917 * src/reader.c (copy_definition, parse_union_decl, copy_action)
20918 (copy_guard): Quote the file names.
20919 Reported by Laurent Mascherpa.
20920
14d3eb9b
AD
209212000-12-12 Akim Demaille <akim@epita.fr>
20922
20923 * src/output.c (output_headers, output_program, output): Be sure
20924 to escape special characters when outputting filenames.
20925 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
20926 (output_headers): Don't depend on them, Use ACTSTR.
20927
d7045ec6
AD
209282000-11-17 Akim Demaille <akim@epita.fr>
20929
20930 * lib/obstack.h: Formatting changes.
20931 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
20932 prevents type checking.
20933 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
20934 cast the value to (void *): assigning a `foo *' to a `void *'
20935 variable is valid.
20936 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
20937 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
20938 append characters.
20939
6fd54b73
AD
209402000-11-17 Akim Demaille <akim@epita.fr>
20941
20942 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
20943 as...
20944 (suite.m4, regression.m4, calc.m4): these.
20945 * tests/atgeneral.m4: Update from CVS Autoconf.
20946
4c50eae6
AD
209472000-11-17 Akim Demaille <akim@epita.fr>
20948
20949 * tests/regression.m4 (%union and --defines): New test,
20950 demonstrating a current bug in the obstack implementation.
20951
a35f64ea
AD
209522000-11-17 Akim Demaille <akim@epita.fr>
20953
20954 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
20955 macros.
20956 Use them to declare the variables which are global or local to
20957 `yyparse'.
20958
7de23534
AD
209592000-11-17 Akim Demaille <akim@epita.fr>
20960
20961 * acconfig.h: Remove, no longer used.
20962
aa7815f5
AD
209632000-11-07 Akim Demaille <akim@epita.fr>
20964
20965 * src: s/Copyright (C)/Copyright/g.
20966
5af1f549
AD
209672000-11-07 Akim Demaille <akim@epita.fr>
20968
20969 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
20970 defining.
20971 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
20972
553e2b22
AD
209732000-11-07 Akim Demaille <akim@epita.fr>
20974
20975 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
20976 Merge in a single CPP if/else.
20977
8a4f41d6
AD
209782000-11-07 Akim Demaille <akim@epita.fr>
20979
20980 * src/output.c (output): Remove useless variables.
20981 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
20982 argument `data' for consistency with the prototypes.
20983 Qualify it `const'.
20984 (obstack_copy, obstack_copy0): Rename the second argument as
20985 `address' for consistency. Qualify it `const'.
20986 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
20987 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
20988 `const' their input argument (`data' or `address').
20989 Adjust the corresponding macros to include `const' in casts.
20990
095a3fb5
AD
209912000-11-03 Akim Demaille <akim@epita.fr>
20992
20993 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
20994 s/PFILE1/BISON_HAIRY/.
20995 Adjust dependencies.
20996
d1cdce7c
AD
209972000-11-03 Akim Demaille <akim@epita.fr>
20998
090c5ebf 20999 For some reason, this was not applied.
d1cdce7c
AD
21000
21001 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
21002 `unlink': it's no longer used.
21003
9311529b
AD
210042000-11-03 Akim Demaille <akim@epita.fr>
21005
21006 * src/files.c (skeleton_find): New function, eved out of...
21007 (open_files, open_extra_files): here.
21008
d8880f69
AD
210092000-11-03 Akim Demaille <akim@epita.fr>
21010
21011 Don't use `atexit'.
21012
21013 * src/files.c (obstack_save): New function.
21014 (done): Rename as...
21015 (output_files): this.
21016 Use `obstack_save'.
21017 * src/main.c (main): Don't use `atexit' to register `done', since
21018 it no longer has to remove tmp files, just call `output_files'
21019 when there are no errors.
21020
0dbb648e
AD
210212000-11-02 Akim Demaille <akim@epita.fr>
21022
21023 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
21024 `unlink': it's no longer used.
21025 * src/files.h: Formatting changes.
21026
896fe5c1
AD
210272000-11-02 Akim Demaille <akim@epita.fr>
21028
21029 Remove the last uses of mktemp and unlink/delete.
21030
21031 * src/files.c (fdefines, ftable): Removed.
21032 (defines_ostack, table_obstack): New.
21033 Adjust dependencies of the former into uses of the latter.
21034 * src/output.c (output_short_or_char_table, output_short_table):
21035 Convert to using obstacks.
21036 * src/reader.c (copy_comment2): Accept one FILE * and two
21037 obstacks.
21038 (output_token_defines, reader_output_yylsp): Use obstacks.
21039 * src/system.h (obstack_fgrow3): New.
1f65350a 21040 * po/POTFILES.in: Adjust.
896fe5c1 21041
dd60faec
AD
210422000-11-01 Akim Demaille <akim@epita.fr>
21043
21044 Change each use of `fattrs' into a use of `attrs_obstack'.
21045
21046 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
21047 * src/files.c (fattrs): Remove.
21048 (attrs_obstack): New.
21049 Adjust all dependencies.
21050 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
21051
8c7ebe49
AD
210522000-11-01 Akim Demaille <akim@epita.fr>
21053
21054 Introduce obstacks.
21055 Change each use of `faction' into a use of `action_obstack'.
21056
21057 * lib/obstack.h, lib/obstack.c: New files.
21058 * src/files.c (faction): Remove.
21059 (action_obstack): New.
21060 Adjust all dependencies.
21061
77aee789
AD
210622000-10-20 Akim Demaille <akim@epita.fr>
21063
21064 * lib/quote.h (PARAMS): New macro. Use it.
21065
43591cec
AD
210662000-10-16 Akim Demaille <akim@epita.fr>
21067
21068 * src/output.c (output_short_or_char_table): New function.
21069 (output_short_table, output_token_translations): Use it.
21070 (goto_actions): Use output_short_table.
21071
1e9798d5
AD
210722000-10-16 Akim Demaille <akim@epita.fr>
21073
21074 * src/symtab.c (bucket_new): New function.
21075 (getsym): Use it.
21076
21077 * src/output.c (output_short_table): New argument to display the
21078 comment associated with the table.
21079 Adjust dependencies.
21080 (output_gram): Use it.
21081 (output_rule_data): Nicer output layout for YYTNAME.
21082
f282676b
AD
210832000-10-16 Akim Demaille <akim@epita.fr>
21084
21085 * src/lex.c (read_typename): New function.
21086 (lex): Use it.
21087 * src/reader.c (copy_dollar): Likewise.
21088
550a72a3
AD
210892000-10-16 Akim Demaille <akim@epita.fr>
21090
21091 * src/reader.c (copy_comment2): Expect the input stream to be on
21092 the `/' which is suspected to open a comment, instead of being
21093 called after `//' or `/*' was read.
21094 (copy_comment, copy_definition, parse_union_decl, copy_action)
21095 (copy_guard): Adjust.
21096
131e2fef
AD
210972000-10-16 Akim Demaille <akim@epita.fr>
21098
21099 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
21100 `read_signed_integer'.
21101
79282c5a
AD
211022000-10-16 Akim Demaille <akim@epita.fr>
21103
21104 * src/reader.c (copy_dollar): New function.
21105 (copy_guard, copy_action): Use it.
21106
ff4a34be
AD
211072000-10-16 Akim Demaille <akim@epita.fr>
21108
21109 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
21110 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
21111 New files, from Fileutils 4.0.27.
21112 * src/main.c (printable_version): Remove.
21113 * src/lex.c, src/reader.c: Use `quote'.
21114
211152000-10-04 Akim Demaille <akim@epita.fr>
21116
21117 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
21118
14ded682
AD
211192000-10-04 Akim Demaille <akim@epita.fr>
21120
21121 * doc/bison.texinfo: Various typos spotted by Neil Booth.
21122
8e03724b
AD
211232000-10-04 Akim Demaille <akim@epita.fr>
21124
21125 When a literal string is used to define two different tokens,
21126 `bison -v' segfaults.
21127 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
21128
21129 * tests/regression.m4: New file.
21130 Include the core of the sample provided by Piotr Gackiewicz.
21131 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
21132 properly.
21133
a9e64249
AD
211342000-10-04 Akim Demaille <akim@epita.fr>
21135
21136 * src/reader.c (parse_expect_decl): Keep `count' within the size
21137 of `buffer'.
21138 From Neil Booth.
21139
da9abf43
AD
211402000-10-02 Paul Eggert <eggert@twinsun.com>
21141
21142 * bison.s1 (yyparse): Assign the default value
21143 unconditionally, to avoid a GCC warning and make the parser a
21144 tad smaller.
21145
c33638bb
AD
211462000-10-02 Akim Demaille <akim@epita.fr>
21147
21148 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
21149 options.
21150
444c570a
AD
211512000-10-02 Akim Demaille <akim@epita.fr>
21152
21153 * src/derives.c, src/print.c, src/reduce.c: To ease the
21154 translation, move some `\n' out of the translated strings.
21155
89cab50d
AD
211562000-10-02 Akim Demaille <akim@epita.fr>
21157
21158 The location tracking mechanism is precious for parse error
21159 messages. Nevertheless, it is enabled only when `@n' is used in
21160 the grammar, which is a different issue (you can use it in error
21161 message, but not in the grammar per se). Therefore, there should
21162 be another means to enable it.
21163
21164 * src/getargs.c (getargs): Support `--locations'.
21165 (usage): Report it.
21166 * src/getargs.h (locationsflag): Export it.
21167 * src/lex.c (percent_table): Support `%locations'.
21168 * src/reader.c (yylsp_needed): Remove this variable, now replaced
21169 with `locationsflag'.
21170 * doc/bison.texinfo: Document `--locations' and `%locations'.
21171 Sort the options.
21172 * tests/calc.m4: Test it.
21173
21174 For regularity of the names, replace each
21175 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
21176 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
21177 In addition replace each `flag' with `_flag'.
21178
d6c2cba0
AD
211792000-10-02 Akim Demaille <akim@epita.fr>
21180
21181 Also test parse error messages, including with YYERROR_VERBOSE.
21182
21183 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
21184 associative).
21185 Use it to check the computations.
21186 Use it to check `nonassoc' is honored.
21187 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
21188 `--yyerror-verbose'.
21189 (_AT_CHECK_CALC): Adjust to this option.
21190 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
21191
5a35a6cb
AD
211922000-10-02 Akim Demaille <akim@epita.fr>
21193
21194 Test also `--verbose', `--defines' and `--name-prefix'. Testing
21195 the latter demonstrates a flaw in the handling of non debugging
21196 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
21197 was used in order to simplify:
21198
21199 #if YYDEBUG
21200 if (yydebug)
21201 {
21202 ...
21203 }
21204 #endif
21205
21206 into
21207
21208 if (yydebug)
21209 {
21210 ...
21211 }
21212
21213 unfortunately this leads to a CPP conflict when
21214 `--name-prefix=foo' is used since it produces `#define yydebug
21215 foodebug'.
21216
21217 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
21218 (YYDPRINTF): New macro.
21219 Spread its use.
21220 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
21221 the bison options.
21222 Also test `--verbose', `--defines' and `--name-prefix'.
21223
71da9eea
AD
212242000-10-02 Akim Demaille <akim@epita.fr>
21225
21226 Improve the readability of the produced parsers.
21227
21228 * src/bison.s1: Formatting changes.
21229 Improve the comment related to the `$' mark.
21230 (yydefault): Don't fall through to `yyresume': `goto' there.
21231 * src/output.c (output_parser): When the `$' is met, skip the end
21232 of its line.
21233 New variable, `number_of_dollar_signs', to check there's exactly
21234 one `$' in the parser skeleton.
21235
95e36146
AD
212362000-10-02 Akim Demaille <akim@epita.fr>
21237
21238 * lib/xstrdup.c: New file, from the fileutils.
21239 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
21240 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
21241 instead of strlen + xmalloc + strcpy.
21242 * src/symtab.c (copys): Remove, use xstrdup instead.
21243
d7020c20
AD
212442000-10-02 Akim Demaille <akim@epita.fr>
21245
21246 * src/gram.h (associativity): New enum type which replaces the
21247 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
21248 `right_assoc', `left_assoc' and `non_assoc'.
21249 Adjust all dependencies.
21250 * src/reader.c: Formatting changes.
21251 (LTYPESTR): Don't define it, use it as a literal in
21252 `reader_output_yylsp'.
21253 * src/symtab.h (symbol_class): New enum type which replaces the
21254 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
21255 `sunknown', `stoken and `snterm'.
21256
1916f98e
AD
212572000-10-02 Akim Demaille <akim@epita.fr>
21258
21259 * src/getargs.c (fixed_outfiles): Rename as...
21260 (yaccflag): for consistency and accuracy.
21261 Adjust dependencies.
21262
d7913476
AD
212632000-10-02 Akim Demaille <akim@epita.fr>
21264
21265 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
21266 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
21267 difficult and introduced a lot of core dump. It turns out that
21268 Bison used an implementation of `xmalloc' based on `calloc', and
21269 at various places it does depend upon the initialization to 0. I
21270 have not tried to isolate the pertinent places, and all the former
21271 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
21272 someone should address this issue.
21273
21274 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
21275 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
21276 files.
21277 Adjust dependencies.
21278 * src/warshall.h: New file.
21279 Propagate.
21280
340ef489
AD
212812000-10-02 Akim Demaille <akim@epita.fr>
21282
21283 Various anti-`extern in *.c' changes.
21284
21285 * src/system.h: Include `assert.h'.
21286
b2ca4022
AD
212872000-10-02 Akim Demaille <akim@epita.fr>
21288
21289 * src/state.h (nstates, final_state, first_state, first_shift)
21290 (first_reduction): Move their exportation from here...
21291 * src/LR0.h: to here.
21292 Adjust dependencies.
21293 * src/getargs.c (statisticsflag): New variable.
21294 Add support for `--statistics'.
21295 Adjust dependencies.
21296
21297 Remove a lot of now useless `extern' statements in most files.
21298
403b315b
AD
212992000-10-02 Akim Demaille <akim@epita.fr>
21300
21301 * src/LR0.h: New file.
21302 Propagate its use.
21303
07a58c13
AD
213042000-10-02 Akim Demaille <akim@epita.fr>
21305
21306 * src/print.h: New file.
21307 Propagate its use.
21308 * src/print.c: Formatting and ordering changes.
21309 (verbose, terse): Replace with...
21310 (print_results): this new function.
21311 Adjust dependencies.
21312
0619caf0
AD
213132000-10-02 Akim Demaille <akim@epita.fr>
21314
21315 * src/conflicts.c (conflict_report): New function.
21316 (conflict_log, verbose_conflict_log): Replace with...
21317 (print_conflicts): this function.
21318 Adjust dependencies.
21319 * src/conflicts.h: New file.
21320 Propagate its inclusion.
21321
3519ec76
AD
213222000-10-02 Akim Demaille <akim@epita.fr>
21323
21324 * src/nullable.h: New file.
21325 Propagate its inclusion.
21326 * src/nullable.c: Formatting changes.
21327
015acc48
AD
213282000-10-02 Akim Demaille <akim@epita.fr>
21329
21330 * src/reduce.h: New file.
21331 Propagate its inclusion.
21332 * src/reduce.c: Topological sort and other formatting changes.
21333 (bool, TRUE, FALSE): Move their definition to...
21334 * src/system.h: here.
21335
8963a27b
AD
213362000-10-02 Akim Demaille <akim@epita.fr>
21337
21338 * src/files.c: Formatting changes.
21339 (tryopen, tryclose, openfiles): Rename as...
21340 (xfopen, xfclose, open_files): this.
21341 (stringappend): static.
21342 * src/files.h: Complete the list of exported symbols.
21343 Propagate its use.
21344
a70083a3
AD
213452000-10-02 Akim Demaille <akim@epita.fr>
21346
21347 * src/reader.h: New file.
21348 Propagate its use instead of tedious list of `extern' and
21349 prototypes.
21350 * src/reader.c: Formatting changes, topological sort,
21351 s/register//.
21352
abadc117
AD
213532000-10-02 Akim Demaille <akim@epita.fr>
21354
21355 * src/lex.h: Prototype `lex.c' exported functions.
21356 * src/reader.c: Adjust.
21357 * src/lex.c: Formatting changes.
21358 (safegetc): Rename as...
21359 (xgetc): this.
21360
720d742f
AD
213612000-10-02 Akim Demaille <akim@epita.fr>
21362
21363 * src/lalr.h: New file.
21364 Propagate its inclusion instead of prototypes and `extern'.
21365 * src/lalr.c: Formatting changes, topological sorting etc.
21366
f2acea59
AD
213672000-10-02 Akim Demaille <akim@epita.fr>
21368
21369 * src/output.c (token_actions): Introduce a temporary array,
21370 YYDEFACT, that makes it possible for this function to use
21371 output_short_table.
21372
d019d655
AD
213732000-10-02 Akim Demaille <akim@epita.fr>
21374
21375 `user_toknums' is output as a `short[]' in `output.c', while it is
21376 defined as a `int[]' in `reader.c'. For consistency with the
21377 other output tables, `user_toknums' is now defined as a table of
21378 shorts.
21379
21380 * src/reader.c (user_toknums): Be a short table instead of an int
21381 table.
21382 Adjust dependencies.
21383
21384 Factor the short table outputs.
21385
21386 * src/output.c (output_short_table): New function.
21387 * src/output.c (output_gram, output_stos, output_rule_data)
21388 (output_base, output_table, output_check): Use it.
21389
6c89f1c1
AD
213902000-10-02 Akim Demaille <akim@epita.fr>
21391
21392 * src/output.c (output): Topological sort of the functions, in
21393 order to get rid of the `static' prototypes.
21394 No longer use `register'.
21395 * src/output.h: New file.
21396 Propagate its inclusion in files explicitly prototyping functions
21397 from output.c.
21398
d9efd181
AD
213992000-09-21 Akim Demaille <akim@epita.fr>
21400
21401 * src/atgeneral.m4: Update from Autoconf.
21402
c29240e7 214032000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
21404
21405 * src/closure.h: New file.
21406 * src/closure.c: Formatting changes, topological sort over the
21407 functions, use of closure.h.
21408 (initialize_closure, finalize_closure): Rename as...
21409 (new_closure, free_closure): these. Adjust dependencies.
21410 * src/LR0.c: Formatting changes, topological sort, use of
21411 cloture.h.
21412 (initialize_states): Rename as...
21413 (new_states): this.
21414 * src/Makefile.am (noinst_HEADERS): Adjust.
21415
499daa50
AD
214162000-09-20 Akim Demaille <akim@epita.fr>
21417
21418 * src/acconfig.h: Don't protect config.h against multiple
21419 inclusion.
21420 Don't define PARAMS.
21421 * src/system.h: Define PARAMS.
21422 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
21423 purpose of config.h. system.h must not try to fix wrong
21424 definitions in config.h.
21425
cc84fd5d
AD
214262000-09-20 Akim Demaille <akim@epita.fr>
21427
21428 * src/derives.h: New file.
21429 * src/main.c, src/derives.h: Use it.
21430 Formatting changes.
21431 * src/Makefile.am (noinst_HEADERS): Adjust.
21432
db5b3a89
AD
214332000-09-20 Akim Demaille <akim@epita.fr>
21434
21435 * tests/atgeneral.m4: Update from Autoconf.
21436 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
21437 (AT_CHECK_CALC): New macros.
21438 Use these macros to test bison with options `', `--raw',
21439 `--debug', `--yacc', `--yacc --debug'.
21440
ceed8467
AD
214412000-09-19 Akim Demaille <akim@epita.fr>
21442
21443 * src/output.c: Formatting changes.
21444 * src/machine.h: Remove, leaving its contents in...
21445 * src/system.h: here.
21446 Include stdio.h.
21447 Adjust all dependencies on stdio.h and machine.h.
21448 * src/getargs.h: New file.
21449 Let all `extern' declarations about getargs.c be replaced with
21450 inclusion of `getargs.h'.
21451 * src/Makefile.am (noinst_HEADERS): Adjust.
21452
21453 * tests/calc.m4 (yyin): Be initialized in main, not on the global
21454 scope.
21455 (yyerror): Returns void, not int.
21456 * doc/bison.texinfo: Formatting changes.
21457
05a1d24b
AD
214582000-09-19 Akim Demaille <akim@epita.fr>
21459
21460 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
21461 portable.
21462
cbd25751
AD
214632000-09-18 Akim Demaille <akim@epita.fr>
21464
21465 * configure.in: Append WARNING_CFLAGS to CFLAGS.
21466 * src/Makefile.am (INCLUDES): Don't.
21467 Be ready to fetch headers in lib/.
21468
13863333
AD
214692000-09-18 Akim Demaille <akim@epita.fr>
21470
21471 * doc/bison.texinfo: Update the copyright.
21472 ANSIfy and GNUify the examples.
21473 Remove the old menu.
21474
0d533154
AD
214752000-09-18 Akim Demaille <akim@epita.fr>
21476
21477 First set of tests: use the `calc' example from the documentation.
21478
21479 * src/bison.s1 (yyparse): Condition the code using `yytname' which
21480 is defined only when YYDEBUG is.
21481 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
21482 * src/files.c (tryopen, tryclose): Formatting changes.
21483 Move to the top and be static.
21484 * src/reader.c (read_signed_integer): Likewise.
21485 * tests/calc.m4: New file.
21486 * Makefile.am, suite.m4: Adjust.
21487 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
21488
e79137ac
AD
214892000-09-18 Akim Demaille <akim@epita.fr>
21490
21491 Add support for an Autotest test suite for Bison.
21492
21493 * m4/m4.m4, m4/atconfig.m4: New files.
21494 * m4/Makefile.am (EXTRA_DIST): Adjust.
21495 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
21496 files.
21497 * src/getargs.c: Display a more standard --version message.
21498 * src/reader.c (reader): Formatting changes.
21499 No longer depend upon VERSION_STRING.
21500 * configure.in: No longer use `dnl'.
21501 Set up the test suite and the new directory `tests/.
21502 (VERSION_STRING): Remove.
21503
27821bff
AD
215042000-04-14 Akim Demaille <akim@epita.fr>
21505
21506 * src/reader.c (copy_comment2): New function, same as former
21507 `copy_comment', but outputs into two FILE *.
21508 (copy_comment): Use it.
21509 (parse_union_decl): Use it.
21510 (get_type, parse_start_decl): Use the same `invalid' message.
21511 (parse_start_decl, parse_union_decl): Use the same `multiple'
21512 message.
21513 (parse_union_decl, copy_guard, copy_action): Use the same
21514 `unmatched' message.
21515 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
21516
cfe5fbc0
AD
215172000-03-31 Akim Demaille <akim@epita.fr>
21518
21519 * src/files.c (tryopen, tryclose): Move to the top.
21520 Be static.
21521
cb7db13e
AD
215222000-03-31 Akim Demaille <akim@epita.fr>
21523
21524 * src/main.c (main): Don't call `done', exit does it.
21525
a0f6b076
AD
215262000-03-31 Akim Demaille <akim@epita.fr>
21527
36281465
AD
21528 * allocate.c: s/return (foo)/return foo/.
21529 * lalr.c: Likewise.
21530 * LR0.c: Likewise.
21531 * output.c: Likewise.
21532 * reader.c: Likewise.
21533 * symtab.c: Likewise.
21534 * vmsgetargs.c: Likewise.
21535
215362000-03-31 Akim Demaille <akim@epita.fr>
21537
21538 Clean up the error reporting functions.
a0f6b076
AD
21539
21540 * src/report.c: New file.
21541 * src/report.h: Likewise.
21542 * src/Makefile.am: Adjust.
21543 * m4/error.m4: New file.
21544 * m4/Makefile.am: Adjust.
21545 * configure.in (jm_PREREQ_ERROR): Call it.
21546 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
21547 Remove.
21548 (fatal, fatals): Remove. All callers use complain.c::fatal.
21549 (warn, warni, warns, warnss, warnss): Remove. All callers use
21550 complain.c::complain.
21551 (toomany): Remove, use fatal instead.
21552 * src/files.c (done): No argument, use complain_message_count.
21553 * src/main.c (main): Register `done' to `atexit'.
21554
21555 * src/getargs.c (usage): More `fputs', less `fprintf'.
21556
18539825
AD
215572000-03-28 Akim Demaille <akim@epita.fr>
21558
21559 * lib/: New directory.
21560 * Makefile.am (SUBDIRS): Adjust.
21561 * configure.in: Adjust.
21562 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
21563 useless.
21564 * src/alloca.c: Moved to lib/.
21565 * src/getopt.c: Likewise.
21566 * src/getopt1.c: Likewise.
21567 * src/getopt.h: Likewise.
21568 * src/ansi2knr.c: Likewise.
21569 * src/ansi2knr.1: Likewise.
21570 * src/Makefile.am: Adjust.
21571 * lib/Makefile.am: New file.
21572
9f306f2a
AD
215732000-03-28 Akim Demaille <akim@epita.fr>
21574
21575 * src/getargs.c (usage): Refresh the help message.
21576
0ba347b6
AD
215772000-03-17 Akim Demaille <akim@epita.fr>
21578
21579 * src/getopt1.c: Updated from textutils 2.0e
21580 * src/getopt.c: Likewise.
21581 * src/getopt.h: Likewise.
21582
dbe7f271
AD
215832000-03-17 Akim Demaille <akim@epita.fr>
21584
21585 * src/Makefile.am (bison.simple): Fix the awk program: quote only
21586 the file name, not the whole `#line LINE FILE'.
21587
75bbe78d
AD
215882000-03-17 Akim Demaille <akim@epita.fr>
21589
21590 On syntax errors, report the token on which we choked.
21591
aa5fd0ee
AD
21592 * src/bison.s1 (yyparse): In the label yyerrlab, when
21593 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 21594
7b306f52
AD
215952000-03-17 Akim Demaille <akim@epita.fr>
21596
aa5fd0ee 21597 * src/reader.c (copy_at): New function.
7b306f52
AD
21598 (copy_guard): Use it.
21599 (copy_action): Use it.
21600
e87b5700
AD
216012000-03-17 Akim Demaille <akim@epita.fr>
21602
21603 Be kind to translators, save some useless translations.
21604
aa5fd0ee 21605 * src/main.c (banner): New function.
e87b5700
AD
21606 (fatal_banner): Use it.
21607 (warn_banner): Use it.
21608
ae3c3164
AD
216092000-03-17 Akim Demaille <akim@epita.fr>
21610
aa5fd0ee
AD
21611 * src/reader.c (copy_definition): Use copy_string and
21612 copy_comment. Removed now unused `match', `ended',
21613 `cplus_comment'.
ae3c3164
AD
21614 (copy_comment, copy_string): Moved, to be visible from
21615 copy_definition.
21616
4dc58e7c
AD
216172000-03-17 Akim Demaille <akim@epita.fr>
21618
aa5fd0ee
AD
21619 * src/reader.c (copy_string): Declare `static inline'. No
21620 problems with inline, since it is checked by configure.
4dc58e7c
AD
21621 (copy_comment): Likewise.
21622
0a6384c4
AD
216232000-03-17 Akim Demaille <akim@epita.fr>
21624
aa5fd0ee 21625 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 21626
3cef001a
AD
216272000-03-17 Akim Demaille <akim@epita.fr>
21628
aa5fd0ee 21629 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
21630 (copy_action): Use it. Removed now unused `match', `ended',
21631 `cplus_comment'.
21632 (copy_guard): Likewise.
21633
ca36d2ef
AD
216342000-03-17 Akim Demaille <akim@epita.fr>
21635
aa5fd0ee 21636 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
21637 (copy_action): Use it.
21638 (copy_guard): Likewise.
21639
6666f98f
AD
216402000-03-17 Akim Demaille <akim@epita.fr>
21641
21642 Change the handling of @s so that they behave exactly like $s.
21643 There is now a pseudo variable @$ (readble and writable), location
21644 of the lhs of the rule (by default ranging from the location of
21645 the first symbol of the rhs, to the location of the last symbol,
21646 or, if the rhs is empty, YYLLOC).
21647
21648 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
21649 yyval.
21650 (yyparse): When providing a default semantic action, provide a
21651 default location action.
21652 (after the $): No longer change `*YYLSP', just stack YYLOC the
21653 same way you stack YYVAL.
21654 * src/reader.c (read_declarations): Use warns.
21655 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
21656 (copy_action, case '@'): Likewise.
21657 Use a standard error message, to save useless work from
21658 translators.
21659
41aca2e0
AD
216602000-03-17 Akim Demaille <akim@epita.fr>
21661
aa5fd0ee
AD
21662 * src/bison.s1: Formatting and cosmetics changes.
21663 * src/reader.c: Likewise.
41aca2e0
AD
21664 Update the Copyright notice.
21665
dc08c1d5
AD
216662000-03-17 Akim Demaille <akim@epita.fr>
21667
aa5fd0ee
AD
21668 * src/bison.s1 (#line): All set to `#line' only, since the
21669 Makefile now handles them.
dc08c1d5 21670
9ee3c97b
AD
216712000-03-16 Akim Demaille <akim@epita.fr>
21672
21673 * src/output.c (output_rule_data): Output the documentation of
21674 some of the tables.
21675 (Copyright notice): Update.
21676 Formatting changes.
21677
0de741ca
AD
216782000-03-16 Akim Demaille <akim@epita.fr>
21679
21680 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
21681 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
21682 One `#if YYDEBUG' remains, since it uses variables which are
21683 defined only if `YYDEBUG != 0'.
21684
bb10be54
AD
216852000-03-16 Akim Demaille <akim@epita.fr>
21686
21687 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
21688 and related variables so that the similarities are highlighted.
21689
b07b484a
AD
216902000-03-16 Akim Demaille <akim@epita.fr>
21691
21692 * src/bison.s1: Properly indent CPP directives.
21693
361f60b3
AD
216942000-03-16 Akim Demaille <akim@epita.fr>
21695
21696 * src/bison.s1: Properly indent the `alloca' CPP section.
21697
8c44d3ec
AD
216982000-03-16 Akim Demaille <akim@epita.fr>
21699
21700 Do not hard code values of directories in `configure.in'.
21701 Update the `configure' tool chain.
21702
21703 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
21704 src/makefile.am.
21705 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
21706 (AC_OUTPUT): Add m4/Makefile.
21707 Bump to bison 1.28a, 1.29 has never been released.
21708 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
21709 handled via src/Makefile.am.
21710 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
21711 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
21712 autoheader.
21713 * Makefile.am (SUBDIRS): Add m4.
21714 (ACLOCAL_AM_FLAGS): New variable.
21715 (AUTOMAKE_OPTIONS): Add check-news.
21716 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
21717 the proper line number and file name.
21718 (DEFS): Propagate the location of bison library files and of the
21719 locale files.
21720 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
21721 builddir.
21722 * acinclude.m4: Remove, replaced by the directory m4.
21723 * m4/Makefile.am (EXTRA_DIST): New variable.
21724 * m4/gettext.m4: New file, from the fileutils.
21725 * m4/lcmessage.m4: Likewise
21726 * m4/progtest.m4: Likewise.
21727 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
21728
f95997e7
AD
217292000-03-10 Akim Demaille <akim@epita.fr>
21730
21731 * src/closure.c:
21732 Formatting changes of various comments.
21733 Respect the GNU coding standards at various places.
21734 Don't use `_()' when no translation is needed.
21735
217361999-12-13 Jesse Thilo <jthilo@gnu.org>
21737
21738 * src/files.c:
21739 OS/2 honors TMPDIR environment variable.
21740
217411999-12-13 Jesse Thilo <jthilo@gnu.org>
21742
21743 * doc/bison.texinfo: Tweaked spelling and grammar.
21744 Updated ISBN.
21745 Removed reference to price of printed copy.
21746 Mention BISON_SIMPLE and BISON_HAIRY.
21747
217481999-12-13 Jesse Thilo <jthilo@gnu.org>
21749
21750 * configure.in, NEWS:
21751 Bison 1.29 released.
21752
217531999-10-27 Jesse Thilo <jthilo@gnu.org>
21754
21755 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
21756 Added reference card.
21757
217581999-07-26 Jesse Thilo <jthilo@gnu.org>
21759
21760 * po/ru.po: Added Russian translation.
21761
217621999-07-26 Jesse Thilo <jthilo@gnu.org>
21763
21764 * configure.in: Added Russian translation.
21765
217661999-07-06 Jesse Thilo <jthilo@gnu.org>
21767
21768 * configure.in, NEWS, README:
21769 Released version 1.28.
21770
217711999-06-14 Jesse Thilo <jthilo@gnu.org>
21772
21773 * src/system.h:
21774 Squashed redefinition warning on some systems.
21775
21776 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
21777 Have configure build version string instead of relying on ANSI string
21778 concatentation.
21779
217801999-06-14 Jesse Thilo <jthilo@gnu.org>
21781
21782 * po/POTFILES.in: Got rid of version.c.
21783
217841999-06-14 Jesse Thilo <jthilo@gnu.org>
21785
21786 * acconfig.h, configure.in:
21787 Have configure build version string instead of relying on ANSI string
21788 concatentation.
21789
217901999-06-08 Jesse Thilo <jthilo@gnu.org>
21791
21792 * doc/bison.1:
21793 Dropped mention of `+' for long-named options.
21794
217951999-05-30 Jesse Thilo <jthilo@gnu.org>
21796
21797 * src/files.c: Added <unistd.h> for unlink().
21798
21799 * src/Makefile.am, src/system.h:
21800 I18n fixes.
21801
218021999-05-30 Jesse Thilo <jthilo@gnu.org>
21803
21804 * README: Added a FAQ list.
21805
21806 * configure.in, acconfig.h:
21807 I18n fixes.
21808
218091999-05-30 Jesse Thilo <jthilo@gnu.org>
21810
21811 * doc/FAQ, doc/Makefile.am:
21812 Added a FAQ list.
21813
218141999-05-19 Jesse Thilo <jthilo@gnu.org>
21815
21816 * src/alloc.h, src/symtab.h, src/version.c:
21817 Protected inclusion of "config.h" with HAVE_CONFIG_H.
21818
218191999-04-18 Jesse Thilo <jthilo@gnu.org>
21820
21821 * src/.cvsignore, src/Makefile.am:
21822 Reorganized: sources in `src', documentation in `doc'.
21823
21824 * src/lex.c (literalchar):
21825 fixed the code for escaping double quotes (thanks
21826 Jonathan Czisny.)
21827
218281999-04-18 Jesse Thilo <jthilo@gnu.org>
21829
21830 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
21831 Adjusted paths to reflect directory reorganization.
21832
218331999-04-18 Jesse Thilo <jthilo@gnu.org>
21834
21835 * doc/.cvsignore, doc/Makefile.am:
21836 Reorganized: sources in `src', documentation in `doc'.
21837
218381999-04-18 Jesse Thilo <jthilo@gnu.org>
21839
21840 * configure.in:
21841 Updated AC_INIT file to reflect directory reorganization.
21842
21843 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
21844 Reorganized: sources in `src', documentation in `doc'.
21845
218461999-04-13 Jesse Thilo <jthilo@gnu.org>
21847
21848 * src/allocate.c:
21849 Don't declare calloc() and realloc() if not necessary.
21850
218511999-04-13 Jesse Thilo <jthilo@gnu.org>
21852
21853 * configure.in, acconfig.h, acinclude.m4:
21854 Don't declare calloc() and realloc() if not necessary.
21855
218561999-03-23 Jesse Thilo <jthilo@gnu.org>
21857
21858 * po/.cvsignore: Added i18n support.
21859
218601999-03-23 Jesse Thilo <jthilo@gnu.org>
21861
21862 * acconfig.h, configure.in, Makefile.am:
21863 Added i18n support.
21864
218651999-03-22 Jesse Thilo <jthilo@gnu.org>
21866
21867 * src/bison.s1: Fixed #line numbers.
21868
218691999-03-15 Jesse Thilo <jthilo@gnu.org>
21870
21871 * po/es.po, po/fr.po, po/nl.po, po/de.po:
21872 Added PO files from Translation Project.
21873
218741999-03-03 Jesse Thilo <jthilo@gnu.org>
21875
21876 * Makefile.am:
21877 Added support for non-ANSI compilers (ansi2knr).
21878
218791999-02-16 Jesse Thilo <jthilo@gnu.org>
21880
21881 * configure.in: Bumped version number to 1.27.
21882
21883 * Makefile.am:
21884 Added `bison.simple' to list of files removed by `make distclean'.
21885
218861999-02-12 Jesse Thilo <jthilo@gnu.org>
21887
21888 * src/files.c, src/files.h:
21889 Defined locations of parser files in config.h instead of Makefile.
21890
218911999-02-12 Jesse Thilo <jthilo@gnu.org>
21892
21893 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
21894 Defined locations of parser files in config.h instead of Makefile.
21895
218961999-02-09 Jesse Thilo <jthilo@gnu.org>
21897
21898 * Makefile.am:
21899 Removed inappropriate use of $< macro.
21900
219011999-02-05 Jesse Thilo <jthilo@gnu.org>
21902
21903 * po/Makefile.in.in, po/POTFILES.in:
21904 Add `po' directory skeleton.
21905
219061999-01-27 Jesse Thilo <jthilo@gnu.org>
21907
21908 * README: Document help-bison list.
21909
21910 * configure.in: Add check for mkstemp().
21911
219121999-01-20 Jesse Thilo <jthilo@gnu.org>
21913
21914 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
21915 Hush a few compiler warnings.
21916
21917 * src/files.c:
21918 Add tryclose(), which verifies that fclose was successful.
21919 Hush a couple of compiler warnings.
21920
219211999-01-20 Jesse Thilo <jthilo@gnu.org>
21922
21923 * Makefile.am, OChangeLog:
21924 ChangeLog is now automatically generated. Include the old version as
21925 OChangeLog.
21926
219271999-01-14 Jesse Thilo <jthilo@gnu.org>
21928
21929 * 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:
21930 Update FSF address.
21931
219321999-01-14 Jesse Thilo <jthilo@gnu.org>
21933
21934 * doc/bison.texinfo: Fix formatting glitch.
21935
21936 * doc/bison.texinfo: Update FSF address.
21937
219381999-01-14 Jesse Thilo <jthilo@gnu.org>
21939
21940 * acconfig.h: Update FSF address.
21941
219421999-01-08 Jesse Thilo <jthilo@gnu.org>
21943
21944 * src/system.h:
21945 Don't define PACKAGE here, since config.h defines it.
21946
219471998-12-30 Jesse Thilo <jthilo@gnu.org>
21948
21949 * src/reader.c: Update copyright date.
21950
21951 * src/main.c:
21952 Ditch sprintf to statically-sized buffers in fatal/warn functions in
21953 favor of output directly to stderr (avoids buffer overruns).
21954
21955 * src/reader.c: Some checks for premature EOF.
21956
21957 * 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:
21958 Use prototypes if the compiler understands them.
21959
21960 * src/files.c: Honor TMPDIR on Unix hosts.
21961 Use prototypes if the compiler understands them.
21962
21963 * src/reader.c:
21964 Fix a couple of buffer overrun bugs.
21965 Use prototypes if the compiler understands them.
21966
21967 * src/system.h: Include unistd.h and ctype.h.
21968 Use #ifdef instead of #if for NLS symbols.
21969
219701998-12-30 Jesse Thilo <jthilo@gnu.org>
21971
21972 * doc/bison.texinfo:
21973 Delete comment "consider using @set for edition number, etc..." since
21974 we now are doing so.
21975
219761998-12-30 Jesse Thilo <jthilo@gnu.org>
21977
21978 * configure.in:
21979 Use prototypes if the compiler understands them.
21980
21981 * NEWS: Document 1.26 highlights.
21982
21983 * Makefile.am: Require Automake 1.3 or later.
21984
21985 * acconfig.h:
21986 Use prototypes if the compiler understands them.
21987
219881998-12-29 Jesse Thilo <jthilo@gnu.org>
21989
21990 * src/version.c:
21991 Use VERSION symbol from automake for version number.
21992
219931998-12-29 Jesse Thilo <jthilo@gnu.org>
21994
21995 * acconfig.h, configure.in, version.cin:
21996 Use VERSION symbol from automake for version number.
21997
219981998-11-28 Jesse Thilo <jthilo@gnu.org>
21999
22000 * Makefile.am:
22001 Distribute original version of simple parser (bison.s1), not built
22002 version (bison.simple).
22003
220041998-11-28 Jesse Thilo <jthilo@gnu.org>
22005
22006 * doc/bison.texinfo: Add info dir entry.
22007
22008 * doc/bison.texinfo:
22009 Let automake put version number into documentation.
22010
220111998-11-26 Jesse Thilo <jthilo@gnu.org>
22012
22013 * src/bison.cld, src/build.com, src/vmshlp.mar:
22014 Add non-RCS files from /gd/gnu/bison.
22015
220161998-11-26 Jesse Thilo <jthilo@gnu.org>
22017
22018 * doc/bison.1:
22019 Document the BISON_HAIRY and BISON_SIMPLE variables.
22020
220211998-11-25 Jesse Thilo <jthilo@gnu.org>
22022
22023 * src/version.c: Build version.c automatically.
22024
22025 * src/reader.c:
22026 Fix token numbering (used to start at 258, not 257).
22027
22028 * src/system.h: Include config.h.
22029
22030 * src/getargs.c: Update bug report address.
22031
22032 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
22033 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
22034
220351998-11-25 Jesse Thilo <jthilo@gnu.org>
22036
22037 * Makefile.am:
22038 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
22039
22040 * configure.in, version.cin:
22041 Build version.c automatically.
22042
22043 * AUTHORS: Add AUTHORS file.
22044
22045 * README: Update bug report address.
22046
22047 * bison.simple:
22048 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
22049
22050 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
22051 Add automake stuff.
22052
220531998-11-25 Jesse Thilo <jthilo@gnu.org>
22054
22055 * doc/bison.texinfo: Clean up some formatting.
22056
220571998-05-05 Richard Stallman <rms@gnu.org>
22058
22059 * doc/bison.texinfo:
22060 Explain better why to make a pure parser.
22061
220621998-01-05 Richard Stallman <rms@gnu.org>
22063
22064 * src/files.c (openfiles):
22065 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
22066 find a temporary directory, if possible. Do not unlink files while
22067 they are open.
22068
220691997-08-25 Richard Stallman <rms@gnu.org>
22070
22071 * src/reader.c (stack_offset;):
22072 Change some warni to warns.
22073
22074 * src/lex.c (literalchar): Use warns, not warni.
22075
220761997-06-28 Richard Stallman <rms@gnu.org>
22077
22078 * src/bison.s1: Add a Bison version comment.
22079
22080 * src/main.c (fatal, warn, berror):
22081 Use program_name.
22082
220831997-06-28 Richard Stallman <rms@gnu.org>
22084
22085 * Makefile.in (bison_version): New variable.
22086 (dist): Use that variable.
22087 (bison.s1): Substitute the Bison version into bison.simple.
22088
22089 * bison.simple: Add a Bison version comment.
22090
220911997-06-18 Richard Stallman <rms@gnu.org>
22092
22093 * src/main.c (fatal, warn, berror):
22094 Make error messages standard.
22095 (toomany): Improve error message text.
22096
22097 * 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:
22098 new.h renamed to alloc.h.
22099
221001997-06-18 Richard Stallman <rms@gnu.org>
22101
22102 * Makefile.in: new.h renamed to alloc.h.
22103
221041997-05-24 Richard Stallman <rms@gnu.org>
22105
22106 * src/lex.c (literalchar):
22107 Fix the code for escaping \, " and '.
22108
22109 (lex): Avoid trouble when there are many chars
22110 to discard in a char literal with just several chars in it.
22111
221121997-05-17 Richard Stallman <rms@gnu.org>
22113
22114 * src/bison.s1:
22115 Use malloc, if using alloca is troublesome.
22116 (YYSTACK_USE_ALLOCA): New flag macro.
22117 Define it for some systems and compilers.
22118 (YYSTACK_ALLOC): New macro.
22119 (yyparse): Use YYSTACK_ALLOC to allocate stack.
22120 If it was malloc'd, free it.
22121
221221997-05-17 Richard Stallman <rms@gnu.org>
22123
22124 * bison.simple:
22125 Use malloc, if using alloca is troublesome.
22126 (YYSTACK_USE_ALLOCA): New flag macro.
22127 Define it for some systems and compilers.
22128 (YYSTACK_ALLOC): New macro.
22129 (yyparse): Use YYSTACK_ALLOC to allocate stack.
22130 If it was malloc'd, free it.
22131
221321997-04-23 Richard Stallman <rms@gnu.org>
22133
22134 * src/bison.s1:
22135 (alloca) [__hpux]: Always define as __builtin_alloca.
22136
221371997-04-23 Richard Stallman <rms@gnu.org>
22138
22139 * bison.simple:
22140 (alloca) [__hpux]: Always define as __builtin_alloca.
22141
221421997-04-22 Richard Stallman <rms@gnu.org>
22143
22144 * src/bison.s1:
22145 [__hpux]: Include alloca.h (right for HPUX 10)
22146 instead of declaring alloca (right for HPUX 9).
22147
22148 * src/bison.s1 (__yy_memcpy):
22149 Declare arg `count' as unsigned int.
22150 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
22151
221521997-04-22 Richard Stallman <rms@gnu.org>
22153
22154 * bison.simple:
22155 [__hpux]: Include alloca.h (right for HPUX 10)
22156 instead of declaring alloca (right for HPUX 9).
22157
22158 * bison.simple (__yy_memcpy):
22159 Declare arg `count' as unsigned int.
22160 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
22161
221621997-01-03 Richard Stallman <rms@gnu.org>
22163
22164 * src/allocate.c: [__STDC__ or _MSC_VER]:
22165 Declare calloc and realloc to return void *.
22166
221671997-01-02 Richard Stallman <rms@gnu.org>
22168
22169 * src/system.h:
22170 [_MSC_VER]: Include stdlib.h and process.h.
22171 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
22172
22173 * src/main.c (main): Return FAILURE as a value.
22174 (printable_version): Declare arg as int, not char.
22175
221761997-01-02 Richard Stallman <rms@gnu.org>
22177
22178 * Makefile.in (dist):
22179 Explicitly check for symlinks, and copy them.
22180
221811996-12-19 Richard Stallman <rms@gnu.org>
22182
22183 * src/files.c:
22184 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
22185
221861996-12-18 Paul Eggert <eggert@gnu.org>
22187
22188 * src/bison.s1 (yyparse):
22189 If __GNUC__ and YYPARSE_PARAM are both defined,
22190 declare yyparse to have a void * argument.
22191
221921996-12-18 Paul Eggert <eggert@gnu.org>
22193
22194 * bison.simple (yyparse):
22195 If __GNUC__ and YYPARSE_PARAM are both defined,
22196 declare yyparse to have a void * argument.
22197
221981996-12-17 Richard Stallman <rms@gnu.org>
22199
22200 * src/reduce.c (nbits): Add some casts.
22201
222021996-08-12 Richard Stallman <rms@gnu.org>
22203
22204 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
22205
222061996-08-12 Richard Stallman <rms@gnu.org>
22207
22208 * bison.simple: Test _MSDOS as well as _MSDOS_.
22209
222101996-07-31 Richard Stallman <rms@gnu.org>
22211
22212 * src/bison.s1:
22213 [__sun && __i386]: Include alloca.h.
22214
222151996-07-31 Richard Stallman <rms@gnu.org>
22216
22217 * bison.simple:
22218 [__sun && __i386]: Include alloca.h.
22219
222201996-07-30 Richard Stallman <rms@gnu.org>
22221
22222 * src/bison.s1: Comment change.
22223
22224 * src/bison.s1: Test _MSDOS_, not MSDOS.
22225
222261996-07-30 Richard Stallman <rms@gnu.org>
22227
22228 * bison.simple: Comment change.
22229
22230 * bison.simple: Test _MSDOS_, not MSDOS.
22231
222321996-06-01 Richard Stallman <rms@gnu.org>
22233
22234 * 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:
22235 Insert `_' macro around many string constants.
22236
22237 * src/main.c:
22238 Insert `_' macro around many string constants.
22239
22240 (main): Call setlocale, bindtextdomain and textdomain.
22241
22242 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
22243 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
22244 [ENABLE_NLS]: Include libintl.h.
22245 [ENABLE_NLS] (gettext): Define.
22246 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
22247 (N_, PACKAGE, LOCALEDIR): New macros.
22248
222491996-06-01 Richard Stallman <rms@gnu.org>
22250
22251 * POTFILES.in: New file.
22252
22253 * Makefile.in (allocate.o):
22254 Define target explicitly.
22255
22256 * Makefile.in (CFLAGS): Set to @CFLAGS@.
22257 (LDFLAGS): Set to @LDFLAGS@.
22258 (configure): Run autoconf only if preceding `cd' succeeds.
22259 (bison.s1): Redirect output to temporary file then move the
22260 temporary to the target, rather than redirecting directly to bison.s1.
22261 (clean): Remove config.status and config.log.
22262 (distclean): Don't remove config.status here.
22263
222641996-05-12 Richard Stallman <rms@gnu.org>
22265
22266 * src/bison.s1:
22267 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
22268
222691996-05-12 Richard Stallman <rms@gnu.org>
22270
22271 * bison.simple:
22272 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
22273
222741996-05-11 Richard Stallman <rms@gnu.org>
22275
22276 * src/bison.s1 (__yy_memcpy):
22277 Really reorder the args, as was supposedly done on Feb 14 1995.
22278 (yyparse): Calls changed accordingly.
22279
222801996-05-11 Richard Stallman <rms@gnu.org>
22281
22282 * Makefile.in (dist): Don't use $(srcdir).
22283
22284 * bison.simple (__yy_memcpy):
22285 Really reorder the args, as was supposedly done on Feb 14 1995.
22286 (yyparse): Calls changed accordingly.
22287
222881996-01-27 Richard Stallman <rms@gnu.org>
22289
22290 * src/output.c (output_rule_data):
22291 Test YYERROR_VERBOSE in the conditional
22292 around the definition of ttyname.
22293
222941995-12-29 Richard Stallman <rms@gnu.org>
22295
22296 * src/bison.s1:
22297 Fix line numbers in #line commands.
22298
222991995-12-29 Richard Stallman <rms@gnu.org>
22300
22301 * bison.simple:
22302 Fix line numbers in #line commands.
22303
223041995-12-27 Richard Stallman <rms@gnu.org>
22305
22306 * src/bison.s1 (YYPARSE_PARAM_DECL):
22307 In C++, make it always null.
22308 (YYPARSE_PARAM_ARG): New macro.
22309 (yyparse): Use YYPARSE_PARAM_ARG.
22310
223111995-12-27 Richard Stallman <rms@gnu.org>
22312
22313 * bison.simple (YYPARSE_PARAM_DECL):
22314 In C++, make it always null.
22315 (YYPARSE_PARAM_ARG): New macro.
22316 (yyparse): Use YYPARSE_PARAM_ARG.
22317
223181995-11-29 Richard Stallman <rms@gnu.org>
22319
22320 * doc/bison.texinfo:
22321 Describe literal string tokens, %raw, %no_lines, %token_table.
22322
223231995-11-29 Daniel Hagerty <hag@gnu.org>
22324
22325 * doc/bison.texinfo: Fixed update date
22326
223271995-10-16 Richard Stallman <rms@gnu.org>
22328
22329 * src/version.c: Version 1.25.
22330
223311995-10-16 Richard Stallman <rms@gnu.org>
22332
22333 * NEWS: *** empty log message ***
22334
223351995-10-16 Richard Stallman <rms@gnu.org>
22336
22337 * doc/bison.1, doc/bison.rnh:
22338 Add new options.
22339
223401995-10-15 Richard Stallman <rms@gnu.org>
22341
22342 * src/vmsgetargs.c, src/getargs.c:
22343 Added -n, -k, and -raw switches.
22344 (noparserflag, toknumflag, rawtoknumflag): New variables.
22345
22346 * src/symtab.h (SALIAS):
22347 New #define for adding aliases to %token.
22348 (struct bucket): Added `alias' field.
22349
22350 * src/reduce.c (reduce_grammar):
22351 Revise error message.
22352 (print_notices): Remove final `.' from error message.
22353
22354 * src/reader.c (reader_output_yylsp):
22355 New function.
22356 (readgram): Use `#if 0' around code that accepted %command
22357 inside grammar rules: The documentation doesn't allow it,
22358 and it will fail since the %command processors scan for the next %.
22359 (parse_token_decl): Extended the %token
22360 declaration to allow a multi-character symbol as an alias.
22361 (parse_thong_decl): New function.
22362 (read_declarations): Added %thong declarations.
22363 (read_declarations): Handle NOOP to deal with allowing
22364 % declarations as another means to specify the flags.
22365 (readgram): Allow %prec prior to semantics embedded in a rule.
22366 (skip_to_char, read_declarations, copy_definition)
22367 (parse_token_decl, parse_start_decl, parse_type_decl)
22368 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
22369 (get_type_name, copy_guard, copy_action, readgram)
22370 (get_type, packsymbols): Revised most error messages.
22371 Changed `fatal' to `warnxxx' to avoid aborting for error.
22372 Revised and use multiple warnxxx functions to avoid using VARARGS1.
22373 (read_declarations): Improve the error message for
22374 an invalid character. Do not abort.
22375 (read_declarations, copy_guard, copy_action): Use
22376 printable_version to avoid unprintable characters in printed output.
22377 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
22378 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
22379 Allow the type of a non-terminal can be given
22380 more than once, as long as all specifications give the same type.
22381
22382 * src/output.c:
22383 (output_headers, output_trailers, output, output_gram)
22384 (output_rule_data): Implement noparserflag variable.
22385 Implement toknumflag variable.
22386 (output): Call reader_output_yylsp to output LTYPESTR.
22387
22388 * src/main.c (main):
22389 If reader sees an error, don't process the grammar.
22390 (fatals): Updated to not use VARARGS1.
22391 (printable_version, int_to_string, warn, warni, warns, warnss)
22392 (warnsss): New error reporting functions. Avoid abort for error.
22393
22394 * src/lex.h:
22395 Added THONG and NOOP for alias processing.
22396 Added SETOPT for the new code that allows setting options with %flags.
22397
22398 * src/lex.c:
22399 Include getopt.h. Add some extern decls.
22400 (safegetc): New function to deal with EOF gracefully.
22401 (literalchar); new function to deal with reading \ escapes.
22402 (lex): Use literalchar.
22403 (lex): Implemented "..." tokens.
22404 (literalchar, lex, parse_percent_token): Made tokenbuffer
22405 always contain the token. This includes growing the token
22406 buffer while reading an integer.
22407 (parse_percent_token): Replaced if-else statement with percent_table.
22408 (parse_percent_token): Added % declarations as another
22409 way to specify the flags -n, -l, and -r. Also added hooks for
22410 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
22411 major changes to files.c.
22412 (lex) Retain in the incoming stream a character following
22413 an incorrect '/'.
22414 (skip_white_space, lex): Revised most error messages
22415 and changed fatal to warn to avoid aborting.
22416 (percent_table): Added %thong declarations.
22417
22418 * src/gram.h: Comment changes.
22419
22420 * src/files.c (openfiles, open_extra_files, done):
22421 Add faction flag
22422 and actfile file. Handle noparserflag. Both for -n switch.
22423
22424 * src/conflicts.c (resolve_sr_conflict):
22425 Remove use of alloca.
22426
224271995-06-01 Jim Meyering <meyering@gnu.org>
22428
22429 * doc/bison.texinfo: *** empty log message ***
22430
224311995-05-06 Richard Stallman <rms@gnu.org>
22432
22433 * src/bison.s1: Comment change.
22434
224351995-05-06 Richard Stallman <rms@gnu.org>
22436
22437 * bison.simple: Comment change.
22438
224391995-05-03 Richard Stallman <rms@gnu.org>
22440
22441 * src/version.c: Version now 1.24.
22442
22443 * src/bison.s1: Change distribution terms.
22444
22445 * src/version.c: Version now 1.23.
22446
224471995-05-03 Richard Stallman <rms@gnu.org>
22448
22449 * doc/bison.texinfo:
22450 Rewrite "Conditions for Using Bison".
22451 Update version to 1.24.
22452
224531995-05-03 Richard Stallman <rms@gnu.org>
22454
22455 * bison.simple: Change distribution terms.
22456
224571995-02-23 Richard Stallman <rms@gnu.org>
22458
22459 * src/files.c: Test __VMS_POSIX as well as VMS.
22460
224611995-02-14 Jim Meyering <meyering@gnu.org>
22462
22463 * src/bison.s1 (__yy_memcpy):
22464 Renamed from __yy_bcopy to avoid
22465 confusion. Reverse FROM and TO arguments to be consistent with
22466 those of memcpy.
22467
224681995-02-14 Jim Meyering <meyering@gnu.org>
22469
22470 * bison.simple (__yy_memcpy):
22471 Renamed from __yy_bcopy to avoid
22472 confusion. Reverse FROM and TO arguments to be consistent with
22473 those of memcpy.
22474
224751994-11-10 David J. MacKenzie <djm@gnu.org>
22476
22477 * NEWS: reformat
22478
22479 * NEWS: New file.
22480
22481 * Makefile.in (DISTFILES): Include NEWS.
22482
22483 * Makefile.in (DISTFILES):
22484 Include install-sh, not install.sh.
22485
22486 * configure.in: Update to Autoconf v2 macro names.
22487
224881994-10-05 David J. MacKenzie <djm@gnu.org>
22489
22490 * Makefile.in: fix typo
22491
22492 * Makefile.in (prefix, exec_prefix):
22493 Let configure set them.
22494
224951994-09-28 David J. MacKenzie <djm@gnu.org>
22496
22497 * Makefile.in: Set datadir to $(prefix)/share.
22498
224991994-09-15 Richard Stallman <rms@gnu.org>
22500
22501 * src/bison.s1:
22502 Update copyright notice and GPL version.
22503
225041994-09-15 Richard Stallman <rms@gnu.org>
22505
22506 * bison.simple:
22507 Update copyright notice and GPL version.
22508
225091994-07-12 Richard Stallman <rms@gnu.org>
22510
22511 * src/reduce.c, src/reader.c:
22512 entered into RCS
22513
225141994-05-05 David J. MacKenzie <djm@gnu.org>
22515
22516 * Makefile.in: entered into RCS
22517
225181994-03-26 Richard Stallman <rms@gnu.org>
22519
22520 * src/bison.s1: entered into RCS
22521
225221994-03-26 Richard Stallman <rms@gnu.org>
22523
22524 * bison.simple: entered into RCS
22525
225261994-03-25 Richard Stallman <rms@gnu.org>
22527
22528 * src/main.c: entered into RCS
22529
225301994-03-24 Richard Stallman <rms@gnu.org>
22531
22532 * src/conflicts.c: entered into RCS
22533
225341994-01-02 Richard Stallman <rms@gnu.org>
22535
22536 * Makefile.in: *** empty log message ***
22537
225381993-11-21 Richard Stallman <rms@gnu.org>
22539
22540 * src/bison.s1: *** empty log message ***
22541
225421993-11-21 Richard Stallman <rms@gnu.org>
22543
22544 * doc/bison.texinfo: entered into RCS
22545
22546 * doc/bison.texinfo: *** empty log message ***
22547
225481993-11-21 Richard Stallman <rms@gnu.org>
22549
22550 * bison.simple: *** empty log message ***
22551
225521993-10-25 David J. MacKenzie <djm@gnu.org>
22553
22554 * doc/bison.texinfo: *** empty log message ***
22555
225561993-10-19 Richard Stallman <rms@gnu.org>
22557
22558 * src/bison.s1: *** empty log message ***
22559
225601993-10-19 Richard Stallman <rms@gnu.org>
22561
22562 * bison.simple: *** empty log message ***
22563
225641993-10-14 Richard Stallman <rms@gnu.org>
22565
22566 * src/bison.s1: *** empty log message ***
22567
225681993-10-14 Richard Stallman <rms@gnu.org>
22569
22570 * bison.simple: *** empty log message ***
22571
225721993-09-14 David J. MacKenzie <djm@gnu.org>
22573
22574 * doc/bison.texinfo: *** empty log message ***
22575
225761993-09-13 Noah Friedman <friedman@gnu.org>
22577
22578 * Makefile.in: *** empty log message ***
22579
225801993-09-10 Richard Stallman <rms@gnu.org>
22581
22582 * src/conflicts.c: *** empty log message ***
22583
22584 * src/system.h: entered into RCS
22585
225861993-09-10 Richard Stallman <rms@gnu.org>
22587
22588 * doc/bison.1: entered into RCS
22589
225901993-09-06 Noah Friedman <friedman@gnu.org>
22591
22592 * src/version.c: entered into RCS
22593
225941993-09-06 Noah Friedman <friedman@gnu.org>
22595
22596 * Makefile.in: *** empty log message ***
22597
225981993-07-30 David J. MacKenzie <djm@gnu.org>
22599
22600 * Makefile.in: *** empty log message ***
22601
226021993-07-24 Richard Stallman <rms@gnu.org>
22603
22604 * src/bison.s1: *** empty log message ***
22605
226061993-07-24 Richard Stallman <rms@gnu.org>
22607
22608 * bison.simple: *** empty log message ***
22609
226101993-07-08 David J. MacKenzie <djm@gnu.org>
22611
22612 * Makefile.in: *** empty log message ***
22613
226141993-07-04 Richard Stallman <rms@gnu.org>
22615
22616 * src/bison.s1: *** empty log message ***
22617
226181993-07-04 Richard Stallman <rms@gnu.org>
22619
22620 * bison.simple: *** empty log message ***
22621
226221993-06-26 David J. MacKenzie <djm@gnu.org>
22623
22624 * src/getargs.c: entered into RCS
22625
226261993-06-26 David J. MacKenzie <djm@gnu.org>
22627
22628 * doc/bison.texinfo: *** empty log message ***
22629
22630 * doc/bison.1: New file.
22631
226321993-06-25 Richard Stallman <rms@gnu.org>
22633
22634 * src/getargs.c: New file.
22635
226361993-06-16 Richard Stallman <rms@gnu.org>
22637
22638 * src/bison.s1: *** empty log message ***
22639
226401993-06-16 Richard Stallman <rms@gnu.org>
22641
22642 * bison.simple: *** empty log message ***
22643
226441993-06-03 Richard Stallman <rms@gnu.org>
22645
22646 * src/bison.s1: New file.
22647
226481993-06-03 Richard Stallman <rms@gnu.org>
22649
22650 * doc/bison.texinfo: *** empty log message ***
22651
226521993-06-03 Richard Stallman <rms@gnu.org>
22653
22654 * bison.simple: New file.
22655
226561993-05-19 Richard Stallman <rms@gnu.org>
22657
22658 * doc/bison.texinfo: New file.
22659
226601993-05-07 Noah Friedman <friedman@gnu.org>
22661
22662 * Makefile.in: *** empty log message ***
22663
226641993-04-28 Noah Friedman <friedman@gnu.org>
22665
22666 * src/reader.c: *** empty log message ***
22667
226681993-04-23 Noah Friedman <friedman@gnu.org>
22669
22670 * src/alloc.h: entered into RCS
22671
226721993-04-20 David J. MacKenzie <djm@gnu.org>
22673
22674 * src/version.c: *** empty log message ***
22675
22676 * src/files.c, src/allocate.c:
22677 entered into RCS
22678
22679 * src/reader.c: *** empty log message ***
22680
22681 * src/lex.c: entered into RCS
22682
22683 * src/conflicts.c: New file.
22684
22685 * src/symtab.c: entered into RCS
22686
22687 * src/alloc.h: New file.
22688
22689 * src/LR0.c: entered into RCS
22690
226911993-04-18 Noah Friedman <friedman@gnu.org>
22692
22693 * src/reader.c: New file.
22694
22695 * src/version.c: *** empty log message ***
22696
226971993-04-18 Noah Friedman <friedman@gnu.org>
22698
22699 * Makefile.in: *** empty log message ***
22700
227011993-04-17 Noah Friedman <friedman@gnu.org>
22702
22703 * Makefile.in: *** empty log message ***
22704
227051993-04-15 Richard Stallman <rms@gnu.org>
22706
22707 * src/main.c, src/files.c:
22708 New file.
22709
227101993-04-15 Noah Friedman <friedman@gnu.org>
22711
22712 * configure.in: entered into RCS
22713
22714 * configure.in: *** empty log message ***
22715
22716 * configure.in: New file.
22717
227181993-04-14 Richard Stallman <rms@gnu.org>
22719
22720 * Makefile.in: New file.
22721
227221993-04-13 Richard Stallman <rms@gnu.org>
22723
22724 * src/version.c: New file.
22725
227261993-03-25 Richard Stallman <rms@gnu.org>
22727
22728 * src/output.c: entered into RCS
22729
227301992-09-25 Richard Stallman <rms@gnu.org>
22731
22732 * configure.bat: entered into RCS
22733
227341992-06-22 Richard Stallman <rms@gnu.org>
22735
22736 * src/vmsgetargs.c: entered into RCS
22737
227381992-06-22 Richard Stallman <rms@gnu.org>
22739
22740 * doc/bison.rnh: entered into RCS
22741
227421992-04-20 David J. MacKenzie <djm@gnu.org>
22743
22744 * README: entered into RCS
22745
227461992-01-22 Richard Stallman <rms@gnu.org>
22747
22748 * src/machine.h: entered into RCS
22749
227501991-12-21 Richard Stallman <rms@gnu.org>
22751
22752 * src/lalr.c, src/closure.c:
22753 entered into RCS
22754
227551991-12-20 Richard Stallman <rms@gnu.org>
22756
22757 * src/state.h: entered into RCS
22758
227591991-12-18 Richard Stallman <rms@gnu.org>
22760
22761 * src/print.c, src/nullable.c, src/derives.c:
22762 entered into RCS
22763
227641991-11-03 David J. MacKenzie <djm@gnu.org>
22765
22766 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
22767 entered into RCS
22768
227691988-09-09 Richard Stallman <rms@gnu.org>
22770
22771 * src/bison.hairy: entered into RCS
22772
227731987-12-16 Richard Stallman <rms@gnu.org>
22774
22775 * REFERENCES: entered into RCS
dc546b0f 22776
f294a2c2 22777
04098407 22778 -----
f294a2c2 22779
04098407 22780 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
f490771b
JD
22781 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
22782 2007, 2008, 2009 Free Software Foundation, Inc.
f294a2c2 22783
04098407
PE
22784 Copying and distribution of this file, with or without
22785 modification, are permitted provided the copyright notice and this
22786 notice are preserved.