]> git.saurik.com Git - bison.git/blame - ChangeLog
Code cleanup.
[bison.git] / ChangeLog
CommitLineData
387b4d50
JD
12009-12-17 Joel E. Denny <jdenny@clemson.edu>
2
3 Code cleanup.
4 * src/symtab.c, src/symtab.h (symbol_class_get_string): Remove
5 function, which is no longer used.
6
a603c6e0
JD
72009-12-16 Joel E. Denny <jdenny@clemson.edu>
8
9 Add gcc's -Wundef to test suite and fix another warning from it.
10 * NEWS (2.4.2): Update description of -Wundef fix.
11 * configure.ac (WARN_CXXFLAGS_TEST): New substitution.
12 (WARN_CFLAGS_TEST): New substitution.
13 * data/glr.c: Avoid warning about __STRICT_ANSI__.
14 * tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
15 WARN_CFLAGS.
16 (NO_WERROR_CFLAGS): Likewise.
17 (CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
18
19750d31
JD
192009-12-16 Joel E. Denny <jdenny@clemson.edu>
20
21 * data/yacc.c: Reformat m4 a little.
22
c938d650
JD
232009-12-16 Joel E. Denny <jdenny@clemson.edu>
24
25 Document gcc -Wundef fix.
26 * NEWS (2.4.2): Here.
27 * THANKS (Jonathan Nieder): Add.
28
fcd32abd
JN
292009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
30
31 Simplify y.tab.c when location tracking is disabled.
32 * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
33 tracking is not enabled. Instead, unconditionally define
34 YY_LOCATION_PRINT as a no-op for backward compatibility.
35
ae93128c
JN
362009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
37
38 Avoid warnings from gcc -Wundef y.tab.c.
39 * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
40 defined before using them.
41 * data/lalr1.cc: Likewise.
42 * data/yacc.c: Likewise.
43
c843aaab
JD
442009-12-15 Joel E. Denny <jdenny@clemson.edu>
45
46 autoconf: update to latest for fix of M4 detection.
47 Reported by Eric Blake.
48 * submodules/autoconf: Update.
49
5c99151a
JD
502009-12-15 Joel E. Denny <jdenny@clemson.edu>
51
52 portability: use -DGNULIB_POSIXCHECK.
53 Reported by Eric Blake. See discussions at
54 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html>
55 and
56 <http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html>.
57 * HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
58 * bootstrap.conf (gnulib_modules): Add all the printf modules
59 suggested by -DGNULIB_POSIXCHECK. Add realloc-posix as
60 suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
61 (excluded_files): Remove m4/printf-posix.m4.
62 * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
63 lib/libbison.a so gnulib libraries can be linked.
64
75f94c6d
JD
652009-12-15 Joel E. Denny <jdenny@clemson.edu>
66
67 gnulib: update for fix of fprintf-posix, which we'll use soon.
68 * etc/prefix-gnulib-mk (prefix): Adjust regex for make file
69 targets so that gnulib's new arg-nonnull.h and link-warning.h
70 are matched.
71 * gnulib: Update.
72
ca01f454
JD
732009-12-14 Joel E. Denny <jdenny@clemson.edu>
74
75 Enable assertion output and --disable-assert for configure.
76 * bootstrap.conf (gnulib_modules): Add assert module.
77 * src/system.h (aver): Define as assert, and summarize the
78 discussion on this issue.
79
9dc3ee6d
JD
802009-12-14 Joel E. Denny <jdenny@clemson.edu>
81
82 Expand GLR acronym in summary of Bison.
83 Based on discussion with Akim Demaille starting at
84 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html>.
85 * doc/bison.texinfo (Introduction): Here.
86 * src/getargs.c (usage): Here.
87
d013372c
AR
882009-10-03 Alex Rozenman <rozenman@gmail.com>
89
90 Document named references.
91 * doc/bison.texinfo (Actions): Add new example and xref to
92 Using Named References node.
93 (Using Named References): New node.
94
5297ebb3
JD
952009-10-16 Joel E. Denny <jdenny@clemson.edu>
96
97 cleanup.
98 * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead
99 of char*.
100 (Sbitset__isEmpty): Use Sbitset instead of char*.
101 * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char
102 instead of char. This helps to avoid casting errors.
103 (Sbitset__or): Use Sbitset instead of char*.
104
175620d3
JD
1052009-10-16 Joel E. Denny <jdenny@clemson.edu>
106
107 portability: don't assume 8-bit bytes.
108 That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff.
109 * src/Sbitset.h (Sbitset__nbytes): Here.
110 (Sbitset__byteAddress): Here.
111 (Sbitset__bit_mask): Here.
112 (Sbitset__last_byte_mask): Here.
113 (Sbitset__ones): Here.
114 (SBITSET__FOR_EACH): Here.
115
786578e3
JD
1162009-10-11 Joel E. Denny <jdenny@clemson.edu>
117
118 portability: use va_start and va_end in the same function.
119 * src/complain.c (error_message): Move va_end from here...
120 (ERROR_MESSAGE): ... to here.
121
416a9da6
JD
1222009-10-08 Joel E. Denny <jdenny@clemson.edu>
123
124 * data/bison.m4: Update comments for rename to muscle-tab.h.
125
10659d0e
JD
1262009-10-07 Joel E. Denny <jdenny@clemson.edu>
127
128 Minor code cleanup.
129 * src/muscle-tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and
130 replace all uses with UNIQSTR_CONCAT.
131 * src/uniqstr.c (uniqstr_vsprintf): New function.
132 * src/uniqstr.h (uniqstr_vsprintf): Add prototype.
133 (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New
134 macros.
135
3c5362b8
JD
1362009-10-06 Joel E. Denny <jdenny@clemson.edu>
137
138 * TODO (Complaint submessage indentation): New.
139
b143f404
JD
1402009-10-04 Joel E. Denny <jdenny@clemson.edu>
141
142 Minor code cleanup.
143 * src/parse-gram.y: Clean up sorting of declarations.
144 Use types to simplify %printer declarations where possible.
145 Provide %printer for BRACKETED_ID and symbol.prec.
146 * src/symtab.c: Whitespace change.
147
7439c5c0
JD
1482009-10-04 Joel E. Denny <jdenny@clemson.edu>
149
150 tests: skip tests of file names that platform does not support.
151 Reported by Michael Raskin at
152 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
153 * THANKS (Michael Raskin): Add.
154 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
155 to fail at least for file names containing ":" or "\".
156
45319f13
JD
1572009-09-23 Joel E. Denny <jdenny@clemson.edu>
158
159 yysyntax_error: avoid duplicate lookahead collection.
160 Except when memory reallocation is required, this change
161 eliminates the need to invoke yysyntax_error twice and thus to
162 repeat the collection of lookaheads. It also prepares for
163 future extensions that will make those repetitions more
164 expensive and that will require additional memory management in
165 yysyntax_error. Finally, it fixes an obscure bug already
166 exercised in the test suite.
167 * data/yacc.c (yysyntax_error): Add arguments for message
168 buffer variables stored in the parser. Instead of size, return
169 status similar to yyparse status but indicating success of
170 message creation. Other than the actual reallocation of the
171 message buffer, import and clean up memory management code
172 from...
173 (yyparse, yypush_parse): ... here.
174 * tests/regression.at (parse.error=verbose overflow): No longer
175 an expected failure.
176
52cea04a
JD
1772009-09-23 Joel E. Denny <jdenny@clemson.edu>
178
179 yysyntax_error: test memory management more.
180 * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro.
181 * tests/regression.at (parse.error=verbose and
182 YYSTACK_USE_ALLOCA): New test group.
183 (parse.error=verbose overflow): New test group that reveals an
184 obscure bug. Expected fail for now.
185
37318e2f
JD
1862009-10-04 Joel E. Denny <jdenny@clemson.edu>
187
188 benchmarks: use %debug consistently among grammars.
189 * etc/bench.pl.in (generate_grammar_triangular): Do not activate
190 %debug by default. It can affect the timings even if yydebug=0.
191 (generate_grammar_calc): For consistency with other grammars,
192 use YYDEBUG environment variable to set yydebug.
193
f74d6d25
JD
1942009-10-03 Joel E. Denny <jdenny@clemson.edu>
195
196 Remove dead code.
197 * src/symtab.c (symbol_pack): Here because every symbol's number
198 is always defined by this time.
199
5b1ff423
AR
2002009-10-03 Alex Rozenman <rozenman@gmail.com>
201
202 Add additional space after periods in NEWS.
203 * NEWS (2.5): here.
204
47eced30
JD
2052009-09-29 Joel E. Denny <jdenny@clemson.edu>
206
207 Use the correct conversion specifier for size_t.
208 Reported by Jim Meyering.
209 * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu"
210 because Sbitset__Index is size_t.
211 * src/Sbitset.c (Sbitset__fprint): Use it instead of %d.
212
d8f68fc2
JD
2132009-09-27 Joel E. Denny <jdenny@clemson.edu>
214
215 tests: don't abuse AT_BISON_CHECK.
216 * tests/regression.at (parse-gram.y: LALR = IELR): Move
217 additional shell commands outside of AT_BISON_CHECK.
218
43aabb70
JD
2192009-09-26 Joel E. Denny <jdenny@clemson.edu>
220
221 tests: check that parse-gram.y's IELR and LALR are identical.
222 * tests/atlocal.in (abs_top_srcdir): New shell variable.
223 * tests/regression.at (parse-gram.y: LALR = IELR): New test
224 group.
225
66381412
AR
2262009-09-19 Alex Rozenman <rozenman@gmail.com>
227
228 Keep sub-messages aligned. Fix strings for translation.
5b1ff423
AR
229 * src/location.h (location_print): Add return value.
230 * src/location.c (location_print): Return number of printed
66381412 231 characters.
5b1ff423
AR
232 * src/complain.h (complain_at_indent, warn_at_indent): Prototype
233 new functions.
234 * src/complain.cpp (indent_ptr): New static variable.
235 (error_message, complain_at_indent, warn_at_indent): Implement
236 the alignment mechanism.
237 * src/scan-code.l (parse_ref, show_sub_messages): Fix strings
238 for translations. Use new alignment mechanism.
239 * tests/named-ref.at: Adjust test-cases.
66381412
AR
240 * NEWS (2.5): Add an announcement about named references.
241
a6ca4ce2
AD
2422009-09-17 Akim Demaille <demaille@gostai.com>
243
244 doc: fixes.
245 * doc/bison.texinfo: here.
246 Reported by Alex Rozenman.
247
3cdc21cf
AD
2482009-09-16 Akim Demaille <demaille@gostai.com>
249
250 doc: lalr1.cc and variants.
251 * doc/bison.texinfo (Decl Summary): Document the "lex_symbol" and
252 "variant" %define variables.
253 (C++ Semantic Values): Split into...
254 (C++ Unions, C++ Variants): these.
255 The latter is new.
256 (C++ Parser Interface): Fix type names.
257 Document parser::syntax_error.
258 Document the fact that locations are not mandatory.
259 (C++ Scanner Interface): Split into...
260 (Split Symbols, Complete Symbols): these.
261 The later is new.
262 (Calc++ Parsing Driver): Use variants.
263 Add more comments.
264 Adjust style.
265 (Calc++ Parser): Declare all the tokens, no
266 longer accept raw characters.
267 Remove %union.
268 Adjust types and printers.
269 Remove destructors.
270 (Calc++ Scanner): Use make_<SYMBOL> functions.
271 Use strerror in error message.
272
f50bfcd6
AD
2732009-09-16 Akim Demaille <demaille@gostai.com>
274
275 doc: spell checking.
276 * doc/bison.texinfo: here.
277
6b5a0de9
AD
2782009-09-16 Akim Demaille <demaille@gostai.com>
279
280 doc: comment changes.
281 * doc/bison.texinfo: Comment changes.
282
2b08bceb
AD
2832009-09-16 Akim Demaille <demaille@gostai.com>
284
285 lalr1.cc: factor the yytranslate_ invocation in make_SYMBOLS.
286 * data/c++.m4, data/lalr1.cc (parser::symbol_type): Change the
287 constructor to take a token_type instead of the (internal) symbol
288 number.
289 Call yytranslate_.
290 * data/variant.hh (b4_symbol_constructor_define_): Therefore,
291 don't call yytranslate_ here.
292
c981ce9b
AD
2932009-09-16 Akim Demaille <demaille@gostai.com>
294
295 TODO: statistics.
296 * TODO (Figures): New.
297
00d80a9c
JD
2982009-09-13 Joel E. Denny <jdenny@clemson.edu>
299
300 tests: clean up push.at test group titles.
301 * tests/push.at: Remove "Push Parsing: " from test group titles
302 because these are already under the banner "Push Parsing Tests".
303
f64e406b
AR
3042009-09-12 Alex Rozenman <rozenman@gmail.com>
305
306 Provide an additional sub-message for clarity.
307 Add "symbol not found in production" error message when
308 an "invalid reference" is detected in named references
309 resolution.
310 * src/scan-code.l: Update "invalid reference" case.
311 * tests/named-ref.at: Adjust test-cases.
312
bb31eb56
JD
3132009-09-10 Joel E. Denny <jdenny@clemson.edu>
314
315 Clean up yacc.c a little.
316 * data/yacc.c: Clean up M4 for readability, and make output
317 whitespace more consistent. For the main parse function
318 comment, instead of saying "yyparse or yypush_parse", say either
319 "yyparse" or "yypush_parse" depending on which it actually is.
320
2d399888
JD
3212009-09-10 Joel E. Denny <jdenny@clemson.edu>
322
323 Fix --enable-gcc-warnings.
324 * src/parse-gram.y (%printer <param>): Handle param_none.
325
ff601366
AD
3262009-09-09 Akim Demaille <demaille@gostai.com>
327
328 lalr1.cc: syntax_error as exceptions.
329 It is common to use sort of factories in the user actions. These
330 factories may check some "syntactic" constraints that are not
331 enforced by the grammar itself. This is possible using YYERROR
332 within the action itself. Provide the user with a means to throw
333 a syntax_error exception.
334
335 * data/c++.m4 (b4_public_types_declare, b4_public_types_define):
336 Declare and define yy::parser::syntax_error.
337 * data/lalr1.cc: Include stdexcept.
338 (yy::parser::parse): Wrap the user action within a try/catch.
339 * data/glr.cc: Include stdexcept.
340
29660062
AD
3412009-09-09 Akim Demaille <demaille@gostai.com>
342
343 lalr1.cc: add missing "inline".
344 * data/c++.m4 (b4_public_types_define): Add missing inline to
345 implementations provided in headers.
346
2055a44e
AD
3472009-09-09 Akim Demaille <demaille@gostai.com>
348
349 %param: documentation.
350 * NEWS (2.6): Document %param, %lex-param, and %parse-param
351 changes.
352 * doc/bison.texinfo: Document that %lex-param and %parse-param
353 are n-ary.
354 Changes some examples to demonstrate it.
355 (Calc++ Parser): Use %param.
356
dd875058
AD
3572009-09-09 Akim Demaille <demaille@gostai.com>
358
359 Regen.
360
f71db70b
AD
3612009-09-09 Akim Demaille <demaille@gostai.com>
362
363 style changes.
364 * src/parse-gram.y (add_param): Scope changes.
365
eaca4c11
AD
3662009-09-09 Akim Demaille <demaille@gostai.com>
367
368 %parse: support several arguments.
369 * src/parse-gram.y (current_param): New.
370 (param_type): Add param_none.
371 (params): New nonterminal.
372 Use it.
373
b18cdd91
AD
3742009-09-09 Akim Demaille <demaille@gostai.com>
375
376 Regen.
377
a7706735
AD
3782009-09-09 Akim Demaille <demaille@gostai.com>
379
380 %param.
381 Provide a means to factor lex-param and parse-param common
382 declarations.
383
384 * src/parse-gram.y (param_type): New.
385 Define a %printer for it.
386 (add_param): Use it.
387 (%parse-param, %lex-param): Merge into...
388 (%parse): this new token.
389 Adjust the grammar to use it.
390 * src/scan-gram.l (RETURN_VALUE): New.
391 (RETURN_PERCENT_FLAG): Use it.
392 (RETURN_PERCENT_PARAM): New.
393 Use it to support %parse-param, %lex-param and %param.
394
9789acf0
JD
3952009-09-03 Joel E. Denny <jdenny@clemson.edu>
396
397 Use aver not assert.
398 * src/output.c: Don't include assert.h.
399 (output_skeleton): Use aver not assert.
400 * src/system.h (aver): In documentation of why, add links to
401 Paul Eggert's explanations in the mailing lists.
402
61bc57e5
AR
4032009-09-05 Alex Rozenman <rozenman@gmail.com>
404
405 Use "Unresolved reference" error message when no symbols were found
406 in a symbolic reference resolution. Remove .expr and -expr from
407 the shown reference when the reference is unresolved.
408 * src/scan-code.l: Change the error message, adjust location columns,
409 rename variable "exact_mode" to "explicit_bracketing".
410 * tests/named-ref.at: Adjust existing tests and add a new one.
411
f4c75eaf
AD
4122009-09-04 Akim Demaille <demaille@gostai.com>
413
414 Adjust synclines in src/parse-gram.[ch].
415 * tests/bison.in: Do some magic (including working around issues
416 with ylwrap) when this wrapper is used to compile
417 src/parse-gram.y.
418
c6abeab1
JD
4192009-09-03 Joel E. Denny <jdenny@clemson.edu>
420
421 Complain about unused %define variables and %code qualifiers.
422 * NEWS (2.5): Document.
423 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
424 * doc/bison.texinfo (Decl Summary): Document complaint, and
425 improve %define documentation a little otherwise.
426 * tests/input.at (Reject unused %code qualifiers): Update.
427 (%define errors): Update.
428 (%define, --define, --force-define): Update.
429 (%define backward compatibility): Update.
430 (Unused %define api.pure): Update.
431 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
432
82db7cdb
JD
4332009-09-03 Joel E. Denny <jdenny@clemson.edu>
434
435 Don't suppress warnings about unused parse.error.
436 * data/bison.m4 (b4_error_verbose_flag): Don't examine value of
437 %define variable parse.error unless b4_error_verbose_flag is
438 actually expanded in a skeleton.
439
2755de8f
AD
4402009-09-03 Akim Demaille <demaille@gostai.com>
441
442 * NEWS (2.4.2): Add "Internationalization" item.
443
1deef26d
AD
4442009-09-03 Akim Demaille <demaille@gostai.com>
445
446 bootstrap: fix/improve find_tool.
447 * bootstrap (find_tool): Improve error messages.
448 Fix typo about find_tool_names.
449
2646cd54
JD
4502009-08-29 Joel E. Denny <jdenny@clemson.edu>
451
452 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
453 See
454 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
455 * src/scan-code.h (code_props_rule_action_init): Rename
456 named_ref arg to name so it doesn't shadow named_ref type. This
457 makes it consistent with the function definition in scan-code.l
458 anyway.
459
cf499cff
JD
4602009-08-28 Joel E. Denny <jdenny@clemson.edu>
461
462 %define: accept unquoted values.
463 * NEWS (2.5): Group all %define changes together, and document
464 this one. Remove quotes in IELR and canonical LR entry.
465 * doc/bison.texinfo: Remove quotes in most examples throughout.
466 (Decl Summary): Update %define documentation.
467 (Table of Symbols): Likewise.
468 * src/ielr.c (LrType): Update documentation.
469 * src/parse-gram.y (content.opt): Add production for ID.
470 * tests/actions.at: Remove quotes in most tests.
471 * tests/calc.at: Likewise.
472 * tests/existing.at: Likewise.
473 * tests/input.at: Likewise.
474 * tests/local.at: Likewise.
475 * tests/push.at: Likewise.
476 * tests/reduce.at: Likewise.
477 * tests/torture.at: Likewise.
478
6ba96404
JD
4792009-08-28 Joel E. Denny <jdenny@clemson.edu>
480
481 %define lr.type: make values lowercase IDs.
482 That is, "LALR" => "lalr", "IELR" => "ielr", and
483 "canonical LR" => "canonical-lr".
484 * NEWS (2.5): Update documentation.
485 * doc/bison.texinfo (Decl Summary): Likewise.
486 * src/ielr.c (ielr): Use new values.
487 * src/ielr.h (ielr): Update documentation.
488 * src/reader.c (prepare_percent_define_front_end_variables): Use
489 and validate new values.
490 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
491 grammars.
492 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
493
4413bbd3
EB
4942009-08-27 Eric Blake <ebb9@byu.net>
495
496 scan-gram: avoid portability trap with ctype usage.
497 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
498 Avoid compiler warning.
499
b70c7fb4
JD
5002009-08-27 Joel E. Denny <jdenny@clemson.edu>
501
502 tests: use perl for printing special sequences to files.
503 And skip tests if perl is not available. This is better than
504 playing tricks with shell portability. Suggested by Akim
505 Demaille.
506 * tests/input.at (Bad character literals): Use it here for
507 omitting final newlines.
508 (Bad escapes in literals): Use it here for special characters.
509
d1cc31c5
JD
5102009-08-26 Joel E. Denny <jdenny@clemson.edu>
511
512 tests: show a use of %define lr.default-reductions "consistent"
513 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
514 prevents the omission of expected tokens for %error-verbose.
515
3bed3a75
AD
5162009-08-26 Akim Demaille <demaille@gostai.com>
517
518 tests: portability fix.
519 * tests/input.at (Bad escapes in literals): Don't expect "echo
520 '\0'" to output \ then 0.
521
aa0cb40d
JD
5222009-08-26 Joel E. Denny <jdenny@clemson.edu>
523
524 Actually handle the yytable zero value correctly this time.
525 * data/bison.m4 (b4_integral_parser_tables_map): Don't mention
526 zero values in the YYTABLE comments.
527 * data/glr.c (yytable_value_is_error): Don't check for zero
528 value.
529 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
530 * data/yacc.c (yytable_value_is_error): Likewise.
531 * data/lalr1.java (yy_table_value_is_error_): Likewise.
532 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
533 * src/tables.h: In header comments, explain why it's useless to
534 check for a zero value in yytable.
535
f2b30bdf
JD
5362009-08-25 Joel E. Denny <jdenny@clemson.edu>
537
538 More fixes related to last two patches.
539 * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE
540 comments: zero indicates syntax error not default action.
541 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
542 defined.
543 * data/glr.c (yyis_pact_ninf): Rename to...
544 (yypact_value_is_default): ... this.
545 (yyisDefaultedState): Update for rename.
546 (yyis_table_ninf): Rename to...
547 (yytable_value_is_error): ... this, and check for value zero
548 besides just YYTABLE_NINF.
549 (yygetLRActions): Check for default value from yypact. It
550 appears that this check is always performed before this function
551 is invoked, and so adding the check here is probably redundant.
552 However, the code may evolve after this subtlety is forgotten.
553 Also, update for rename to yytable_value_is_error. Because that
554 macro now checks for zero, a different but equivalent branch of
555 the if-then-else here is evaluated.
556 (yyreportSyntaxError): Update for rename to
557 yytable_value_is_error. The zero condition was mishandled
558 before.
559 (yyrecoverSyntaxError): Update for renames. No behavioral
560 changes.
561 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
562 New function.
563 (yy_table_value_is_error_): New function.
564 (parse): Use new functions where possible. No behavioral
565 changes.
566 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
567 The zero condition was mishandled before.
568 * data/yacc.c (yyis_pact_ninf): Rename to...
569 (yypact_value_is_default): ... this.
570 (yyis_table_ninf): Rename to...
571 (yytable_value_is_error): ... this, and check for value zero
572 besides just YYTABLE_NINF.
573 (yysyntax_error): Update for rename to yytable_value_is_error.
574 The zero condition was mishandled before.
575 (yyparse): Update for renames. No behavioral changes.
576 * src/tables.h: Improve comments about yypact, yytable, etc.
577 more. Most importantly, say yytable value of zero means syntax
578 error not default action.
579
53f036ce
JD
5802009-08-25 Joel E. Denny <jdenny@clemson.edu>
581
582 Fix %error-verbose for conflicts resolved by %nonassoc.
583 * NEWS (2.5): Document.
584 * data/glr.c (yyreportSyntaxError): Fix this by checking
585 yyis_table_ninf.
586 * data/yacc.c (yysyntax_error): Likewise.
587 * data/lalr1.cc (yysyntax_error_): Fix this by checking
588 yytable_ninf_.
589 * data/lalr1.java (yysyntax_error): Likewise.
590 * tests/conflicts.at (%nonassoc and eof): Update expected output
591 and remove FIXME.
592
87412882
JD
5932009-08-25 Joel E. Denny <jdenny@clemson.edu>
594
595 Some code and documentation improvements.
596 * data/c.m4 (b4_table_value_equals): New macro to capture
597 some repeated code.
598 * data/glr.c (yyis_pact_ninf): Use it here.
599 (yyis_table_ninf): Likewise.
600 (yyreportSyntaxError): Improve internal comments.
601 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
602 Use it everywhere possible.
603 (yyis_table_ninf): Likewise.
604 (yysyntax_error): Improve internal comments.
605 * data/lalr1.cc (yysyntax_error_): Likewise.
606 * data/lalr1.java (yysyntax_error): Likewise.
607 * src/tables.h: Improve comments about yypact, yytable, etc.
608
e6c849d8
JD
6092009-08-21 Joel E. Denny <jdenny@clemson.edu>
610
611 Use locale when quoting.
612 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
613 quote rather than implementing quoting here.
614
d8911864
EB
6152009-08-20 Eric Blake <ebb9@byu.net>
616
b0778bdd
EB
617 Make previous patch more robust.
618 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
619 argmatch.h.
620 (output_skeleton): Use it.
621 Suggested by Akim Demaille.
622
d8911864
EB
623 Import latest m4/m4.m4.
624 * submodules/autoconf: Update to autoconf 2.64.
625 * configure.ac (M4_GNU_OPTION): New define.
626 * src/output.c (output_skeleton): Use it to resolve FIXME.
627 * NEWS: Mention this.
628
c2724603
JD
6292009-08-19 Joel E. Denny <jdenny@clemson.edu>
630
631 Fix complaints about escape sequences.
632 Discussed starting at
633 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
634 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
635 For a \0 and similar escape sequences meaning the null
636 character, report an invalid escape sequence instead of an
637 invalid null character because the latter does not actually
638 appear in the user's input.
639 In all escape sequence complaints, don't escape the initial
640 backslash, and don't quote when the sequence appears at the end
641 of the complaint line unless there's whitespace that quotearg
642 won't escape.
643 Consistently say "invalid" not "unrecognized".
644 Consistently prefer "empty character literal" over "extra
645 characters in character literal" warning for invalid escape
646 sequences; that is, consistently discard those sequences.
647 * tests/input.at (Bad escapes in literals): New.
648
17aed602
AD
6492009-08-19 Akim Demaille <demaille@gostai.com>
650
651 doc: fixes.
652 * doc/bison.texinfo: Fix minor Texinfo errors.
653
9142239a
AD
6542009-08-19 Akim Demaille <demaille@gostai.com>
655
656 tests: distcc compliance.
657 * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's
658 error messages from the output.
659
171ad99d
AD
6602009-08-19 Akim Demaille <demaille@gostai.com>
661
662 variables: simplify the upgrade of namespace into api.namespace.
663
664 This patch simplifies "variables: rename namespace as
665 api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c.
666 Suggested by Joel E. Denny in
667 http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html
668
669 * src/muscle-tab.c (muscle_percent_variable_update): New.
670 (muscle_percent_define_insert): Use it in replacement of the
671 previous tr invocation.
672 Remove variable_tr, no longer needed.
673 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
674 Remove.
675 * data/c++.m4: No longer handle namespace -> api.namespace.
676 * tests/input.at (%define backward compatibility): Check that
677 namespace is treated as api.namespace.
678
d59e456d
AD
6792009-08-19 Akim Demaille <demaille@gostai.com>
680
681 doc: %initial-action to initialize yylloc.
682 Reported by Bill Allombert.
683 * doc/bison.texinfo: Set fill-column to 76.
684 (Location Type): Document the use of %initial-action to initialize
685 yylloc.
686
ceb8b8e6
AD
6872009-08-19 Akim Demaille <demaille@gostai.com>
688
689 lalr1.cc: use state_type.
690 * data/lalr1.cc (yysyntax_error_): Use state_type.
691 Move argument names into yy*.
692
7580c379
AD
6932009-08-19 Akim Demaille <demaille@gostai.com>
694
695 lalr1.cc: get rid of yyparse's yystate.
696 yystate and yystack_[0].state are equal, keep only the latter.
697 The former was also used as a temporary variable to compute the
698 post-reduction state. Move this computation into an auxiliary
699 function.
700
701 * data/glr.c (yyLRgotoState): Fuse variable definition and first
702 assignment.
703 * data/lalr1.cc (yy_lr_goto_state_): New.
704 (yyparse): Use it.
705 Replace remaining uses of yystate by yystate_[0].state.
706 Remove the former.
707
c4dc4c46
AD
7082009-08-19 Akim Demaille <demaille@gostai.com>
709
710 lalr1.cc: destroy $$ when YYERROR is called.
711 * data/lalr1.cc (yyreduce): Compute the resulting state before
712 running the user action so that yylhs is a valid symbol.
713 (yyerrorlab): Since yylhs is complete (it knows its type), we can
714 simply call yy_destroy_ to destroy $$ on YYERROR invocations.
715 * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants.
716
c67e466f
JD
7172009-08-18 Joel E. Denny <jdenny@clemson.edu>
718
719 maint: update for gnulib's recent update-copyright changes
720 * gnulib: Update.
721 * .x-update-copyright (COPYING): Add as it's no longer implied
722 when .x-update-copyright is present.
723 * cfg.mk (update-copyright-local): Remove, now ignored.
724 (update-copyright): Declare update-b4-copyright as a dependency.
725
af6d2358
AD
7262009-08-17 Akim Demaille <demaille@gostai.com>
727
728 build: require gettext 0.17.
729
730 Suggested by Bruno Haible.
731 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
732 * configure.ac: require gettext 0.17 to ensure compatibility with
733 gnulib.
734
91a2b9b1
AD
7352009-08-17 Akim Demaille <demaille@gostai.com>
736
737 build: lower gettext requirements.
738
739 Bison was uselessly requiring the formatstring macros from
740 gettext, which resulted in mo files not being installed on systems
741 that perfectly supported Bison mo files. Lower the requirement.
742 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
743
b0778bdd
EB
744 * configure.ac: Require need-ngettext instead of
745 need-formatstring-macros.
746 Reported by Martin Jabocs.
747 Suggested by Bruno Haible.
748 * INSTALL: Restructure.
749 (Internationalization): New.
91a2b9b1 750
585935e8
JD
7512009-08-14 Joel E. Denny <jdenny@clemson.edu>
752
753 maint: fix use of copyright year intervals.
754 * gnulib: Update.
755 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
756 as now recommended in gnulib/NEWS.
757 * build-aux/update-b4-copyright: Fix.
758 * cfg.mk (update-copyright-env): Configure update-copyright.
759
83b60c97
JD
7602009-08-13 Joel E. Denny <jdenny@clemson.edu>
761
762 Make it easier to write deterministic tests.
763 Continues Akim's work from his 2009-06-10 commits.
764 * src/reader.c (check_and_convert_grammar): Don't add any
765 symbols after the first symbols_do invocation.
766 * src/symtab.c (symbols_sorted): New static global.
767 (user_token_number_redeclaration): Update comments.
768 (symbol_from_uniqstr): If a new symbol is being created, assert
769 that symbols_sorted hasn't been allocated yet.
770 (symbols_free): Free symbols_sorted.
771 (symbols_cmp, symbols_cmp_qsort): New functions.
772 (symbols_do): Sort symbol_table into symbols_sorted on first
773 invocation.
774 * tests/input.at (Numbered tokens): Recombine tests now that the
775 output should be deterministic across multiple numbers.
776
28169bab
AD
7772009-08-12 Akim Demaille <demaille@gostai.com>
778
779 tests: GCC 4.5 compliance.
780 * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's
781 messages about #error.
782
9f14e187
AD
7832009-08-12 Akim Demaille <demaille@gostai.com>
784
785 build: fix the generation of the documentation.
786 Some of our targets use "bison --help", but they can't depend on
787 "bison" itself (to avoid additional requirements on the user), so
788 they used to call "make src/bison" in the commands. Then
789 concurrent builds may fail: one make might be aiming one of its
790 jobs at compiling src/bison, and another job at generating the man
791 page. If the latter is faster than the former, then we have two
792 makes that concurrently try to compile src/bison.
793
794 This might also be a more convincing explanation for the failure
795 described in the patch "build: fix paths".
796
797 * Makefile.am (SUFFIXES): Initialize.
798 * build-aux/move-if-change: New, symlink to gnulib's.
799 * build-aux/local.mk: Ship it.
800 * doc/common.x: Remove, merged into...
801 * doc/bison.x: here.
802 * doc/local.mk (doc/bison.help): New.
803 ($(CROSS_OPTIONS_TEXI)): Depend on it.
804 Use src/bison.
805 (.x.1): Replace with...
806 (doc/bison.1): this explicit, simpler, target.
807 (common_dep): Remove, inlined where appropriate.
808 (SUFFIXES, PREPATH): Remove, unused.
809
d1b55e81
AD
8102009-08-12 Akim Demaille <demaille@gostai.com>
811
812 gnulib: improve prefixing.
813 * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather,
814 change the value of...
815 (gl_LIBOBJS): this.
816 Adjust more variables.
817 * etc/prefix-gnulib-mk (prefix_assignment): Don't rename
818 gl_LIBOBJS.
819 (prefix): Also transform rules whose targets have slashes.
820 Use $prefix liberally.
821 Map @MKDIR_P@ to $(MKDIR_P).
822 Prefix directories that are mkdir'd.
823
838205d5
AD
8242009-08-12 Akim Demaille <demaille@gostai.com>
825
826 build: fix paths.
827 When using $(top_builddir) inconsistently, Make (including GNU
828 Make) is sometimes confused. As a result it may want to build
829 lib/libbison.la and $(top_builddir)/lib/libbison.la (the same
830 file, different names) concurrently, which, amusingly enough,
831 might end with:
832
833 ranlib lib/libbison.a
834 ranlib lib/libbison.a
835 make[2]: *** [lib/libbison.a] Segmentation fault
836
837 on OS X.
838
839 * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not
840 needed.
841
67af7198
AD
8422009-08-12 Akim Demaille <demaille@gostai.com>
843
844 distcheck: fix.
845
b0778bdd 846 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
67af7198 847
c467dc42
JD
8482009-08-10 Joel E. Denny <jdenny@clemson.edu>
849
850 * tests/local.mk (TESTSUITE_AT): Add named-refs.at.
851
dfaa4860
JD
8522009-08-10 Joel E. Denny <jdenny@clemson.edu>
853
854 Miscellaneous code readability improvements.
855
856 * src/reader.c (reader): Move %define front-end variable
857 defaults and checking into...
858 (prepare_percent_define_front_end_variables): ... this new
859 function.
860
861 * src/scan-gram.l (INITIAL): For consistency with string
862 literals, don't store open quote on character literal. It's
863 discarded before returning anyway.
864 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
865 Make length test more readable, and make the character stored
866 for an empty literal more obvious while consistent with the
867 previous behavior.
868
869 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
870 USER_NUMBER_HAS_STRING_ALIAS throughout.
871 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
872 that is repeated in symtab.h. Improve argument names to make it
873 clear which side of the symbol-string alias pair is which.
874 (symbol_check_alias_consistency): Improve local variable names
875 for the same purpose.
876 * src/symtab.h (struct symbol): Make comments about aliases
877 clearer.
878 (symbol_make_alias): Improve comments and argument name.
879 * src/output.c (token_definitions_output): Update for rename to
880 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
881
ce268795
AR
8822009-08-08 Alex Rozenman <rozenman@gmail.com>
883
884 Convert "misleading reference" messages to warnings.
885 * src/scan-code.l: New function 'show_sub_messages', more
886 factoring.
887 * tests/named-ref.at: Adjust tests.
888
401b73af
JD
8892009-08-06 Joel E. Denny <jdenny@clemson.edu>
890
891 maint: run "make update-copyright"
892
a1a9422d
JD
8932009-08-06 Joel E. Denny <jdenny@clemson.edu>
894
895 maint: make update-b4-copyright easier to use
896 * build-aux/update-b4-copyright: In warnings, report line
897 numbers rather than character positions.
898 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
899 that update-copyright runs it.
900 * gnulib: Update.
901
0b61a8ec
JD
9022009-08-05 Joel E. Denny <jdenny@clemson.edu>
903
904 maint: clean up update-b4-copyright code
905 * build-aux/update-b4-copyright: Do not accept 2-digit
906 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
907 Don't accept a `[' in a b4_copyright argument.
908 Format code more consistently.
909 Don't assume b4*copyright never occurs.
910
269e222e
JD
9112009-08-04 Joel E. Denny <jdenny@clemson.edu>
912
913 maint: automate b4_copyright updates.
914 * Makefile.am (update-b4-copyright): New target rule.
915 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
916 * build-aux/update-b4-copyright: New.
917 * data/yacc.c: Remove stray characters around b4_copyright
918 invocations.
919
35905f2b
JD
9202009-08-04 Joel E. Denny <jdenny@clemson.edu>
921
922 maint: automate annual package-wide copyright-year update.
923 * .x-update-copyright: New.
924 * Makefile.am (EXTRA_DIST): Remove maint.mk.
925 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
926 update-copyright. Remove gnumakefile, which is implied by
927 maintainer-makefile.
928 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
929 * gnulib: Update.
930 * maint.mk: Remove, now copied from gnulib.
931 * examples/extexi: Add missing "(C)" in copyright statement so
932 update-copyright can recognize it.
933 * src/LR0.h: Likewise.
934 * src/print.h: Likewise.
935 * src/print_graph.h: Likewise.
936 * src/gram.c: Add missing comma in copyright statement.
937 * src/gram.h: Likewise.
938
b30e18dc
JD
9392009-08-04 Joel E. Denny <jdenny@clemson.edu>
940
941 Fix "make distcheck".
942 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
943 of just calc.stamp.
944
8d90395d
JD
9452009-08-01 Joel E. Denny <jdenny@clemson.edu>
946
947 Pacify "gcc -Wunused" for the input function from Flex.
948 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
949 and later.
950 * src/scan-code.l: Add "%option noinput", which I cannot find in
951 the Flex manual, but which Flex has supported since at least as
952 far back as 2.5.4. However, if any of our developers still use
953 Flex 2.5.4, they'll need to stop configuring with
954 --enable-gcc-warnings because "%option noinput" didn't work
955 correctly until Flex 2.5.6.
956 * src/scan-gram.l: Likewise.
957 * src/scan-skel.l: Likewise.
958
ba4184ec
AR
9592009-07-31 Alex Rozenman <rozenman@gmail.com>
960
961 Fix --enable-gcc-warnings problems.
962 * src/reader.c: Adjust variable names.
963 * src/scan-code.l: Fix prototypes and adjust names.
964 * src/named-ref.c: Remove redundant "if".
965
91a2af97
JD
9662009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
967
968 Fix a --enable-gcc-warnings problem.
969 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
970 variable.
971
3208e3f4
JD
9722009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
973
974 Warn about character literals not of length one.
975 * NEWS (2.5): Document.
976 * src/scan-gram.l (INITIAL): Remove comment that we don't check
977 the length.
978 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
979 * tests/input.at (Bad character literals): New test group.
980
5add20ab 9812009-07-24 Alex Rozenman <rozenman@gmail.com>
13cdf208
AR
982
983 Fix some memory leaks.
984 * src/named-ref.c: Add a pointer check (named_ref_free).
985 * src/scan-code.l: New function (variant_table_free). Called in
986 code_scanner_free.
987 * src/symlist.c: Call to named_ref_free (symbol_list_free).
988
e459fb0e
JD
9892009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
990
991 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
992
c4be5517
JD
9932009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
994
995 Some M4 cleanup in the testsuite.
996 Suggested by Eric Blake at
997 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
998 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
999 complicate the code by distinguishing between a missing value
1000 and an empty string value for an optional argument. This fix is
1001 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
1002 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
1003 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
1004 arguments are not needed because of the following changes.
1005 Fix stale comments.
1006 Bison developers should use GNU M4 and should not use
1007 POSIXLY_CORRECT when building the test suite, so do not
1008 complicate the code by avoiding $10 and above.
1009 Do not quote an empty string value for an optional argument, and
1010 do not distinguish between a missing value and an empty string
1011 value.
1012
feeb56cd
JD
10132009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1014
1015 Revert unnecessary column realignment in --help output.
1016 Reported by Akim Demaille at
1017 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
1018 * src/getargs.c (usage): Here.
1019
5add20ab 10202009-07-04 Alex Rozenman <rozenman@gmail.com>
629e4def
AR
1021
1022 Alphabetical order in src/local.mk.
1023 * src/local.mk: Adjust.
1024
5add20ab 10252009-07-04 Alex Rozenman <rozenman@gmail.com>
872b52bc
AR
1026
1027 Style changes and factoring.
1028 * src/named-ref.h: Add comments.
1029 * src/parse-gram.y: Readability and style changes.
1030 * src/reader.c: Factoring: assign_named_ref function.
1031 * src/scan-code.l: Factoring and style changes. Rename
1032 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
1033 Use "unsigned" type for variant index. Improve readablity.
1034 * src/scan-gram.l: Change error messages and add comments.
1035 * src/symlist.h: symbol_list_null: New function decl.
1036 * src/symlist.c: symbol_list_null: Implement here.
1037 * tests/named-refs.at: Adjust for new error messages.
1038
83ea2423
EB
10392009-06-29 Eric Blake <ebb9@byu.net>
1040
1041 scan-code: avoid compiler warnings
1042 * src/scan-code.l (parse_named_ref): Use correct specifiers.
1043
5ece73ea
AD
10442009-06-29 Akim Demaille <demaille@gostai.com>
1045
1046 build: avoid concurrent extraction of calc++.
1047 * examples/calc++/Makefile.am (calc.stamp): New.
1048 Depend on it to create the sources of calc++ so that concurrent
1049 builds don't launch several "extexi" in parallel.
1050 Not only this is inefficient, this also builds incorrect sources
1051 with several extractions mixed together.
1052
ad597a78
AD
10532009-06-29 Akim Demaille <demaille@gostai.com>
1054
1055 parse.error: fix.
1056 * data/bison.m4: Move code related to specific variables after the
1057 definition of the variable-maintaining macros so that we don't
1058 "invoke" b4_percent_define_check_values before it is defined.
1059
31b850d2
AD
10602009-06-29 Akim Demaille <demaille@gostai.com>
1061
1062 variables: parse.error
1063
1064 Implement, document, and test the replacement of %error-verbose
1065 by %define parse.error "verbose".
1066 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
1067 values of the parse.error variable.
1068 Make "simple" its default value.
1069 Check the valid values.
1070 * src/parse-gram.y: Use %define parse.error.
1071 (PERCENT_ERROR_VERBOSE): New token.
1072 Support it.
1073 * src/scan-gram.l: Support %error-verbose.
1074
1075 * doc/bison.texinfo (Decl Summary): Replace the documentation of
1076 %define error-verbose by that of %define parse.error.
1077 * NEWS: Document it.
1078
1079 * tests/actions.at, tests/calc.at: Use parse.error instead of
1080 %error-verbose.
1081
b9f1d9a4
AR
10822009-06-27 Alex Rozenman <rozenman@gmail.com>
1083
1084 Implement support for named symbol references.
1085 * src/parse-gram.y: Add new syntax (named_ref.opt).
1086 * src/reader.c: Store named refs in symbol lists.
1087 * src/reader.h: New argument for symbol_append and
1088 action_append functions.
1089 * src/scan-code.h: Add new field (named_ref) into
1090 code_props data structure. Keeps named ref of midrule
1091 actions.
1092 * src/scan-code.l: Support for named refs in semantic
1093 action code. New function 'parse_named_ref'.
1094 * src/scan-gram.l: Support bracketed id.
1095 * src/symlist.c: Store named refs in symbol lists.
1096 * src/symlist.h: New field in symbol list: named_ref.
1097 * src/named-ref.h: New file, a struct for named_ref.
1098 * src/named-ref.cp: New file, named_ref_new function.
1099 * src/local.mk: Add two new files.
1100 * tests/testsuite.at: Include new test group:
1101 * tests/named-refs.at: this new file.
1102
b5c212b6
AD
11032009-06-25 Akim Demaille <demaille@gostai.com>
1104
1105 hash: check insertion for memory exhaustion.
1106 * src/uniqstr.c (uniqstr_new): New.
1107
67501061
AD
11082009-06-24 Akim Demaille <demaille@gostai.com>
1109
1110 variables: rename namespace as api.namespace.
1111 Discussed in
1112 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
1113
1114 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1115 New.
1116 (b4_percent_define_use): New.
1117 Use it where applicable.
1118 * data/c++.m4: Replace uses of the variable "namespace" by
1119 "api.namespace".
1120 Default the latter to the former.
1121 * doc/bison.texinfo (Decl Summary): Document "namespace" as
1122 obsolete.
1123 Document api.namespace.
1124 Use @samp to document %define uses, keep @code for identifiers.
1125 * NEWS: Likewise.
1126 * tests/c++.at, tests/input.at: Test api.namespace instead of
1127 namespace. (The tests passed with namespace.)
1128
41976786
AD
11292009-06-11 Akim Demaille <demaille@gostai.com>
1130
1131 style changes.
1132 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
1133 * src/print-xml.c: Style changes.
1134 * tests/conflicts.at: Comment changes.
1135
44bb9084
AD
11362009-06-11 Akim Demaille <demaille@gostai.com>
1137
1138 xml: beware of user strings used to give a %prec to rules.
1139 * tests/conflicts.at (%prec with user strings): New.
1140 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
1141 XML output.
1142
04d1e39d
AD
11432009-06-11 Akim Demaille <demaille@gostai.com>
1144
1145 hash: check insertion for memory exhaustion.
1146 * src/muscle-tab.c (muscle_insert, muscle_grow)
1147 * src/state.c (state_hash_insert): Check the return value of
1148 hash_insert.
1149
a8873669
AD
11502009-06-11 Akim Demaille <demaille@gostai.com>
1151
1152 tests: honor TESTSUITEFLAGS in every check target.
1153 * tests/local.mk (RUN_TESTSUITE): New.
1154 (check-local, installcheck-local, maintainer-check-g++)
1155 (maintainer-check-posix, maintainer-check-valgrind): Use it.
1156
8893145a
AD
11572009-06-10 Akim Demaille <demaille@gostai.com>
1158
1159 deterministic test suite.
1160 Some consistency checks on symbols are performed after all the
1161 symbols were read, by an iteration over the symbol table. This
1162 traversal is nondeterministic, which can be a problem for test
1163 cases.
1164 Avoid this.
1165 Addresses another form of nondeterminism reported by Joel E. Denny.
1166 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1167
1168 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
1169 test in two.
1170 Use different file names for the three tests to make the
1171 maintenance easier.
1172
92d7a23a
AD
11732009-06-10 Akim Demaille <demaille@gostai.com>
1174
1175 gnulib: update.
b0778bdd
EB
1176 * gnulib: Update to latest.
1177 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
1178 * m4/.gitignore: Regen.
1179 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
1180 Call xalloc_die on hash_insert failures.
1181 Requested by the new __warn_unused_result__ attribute of
1182 hash_insert.
92d7a23a 1183
12cf133f
AD
11842009-06-10 Akim Demaille <demaille@gostai.com>
1185
1186 deterministic user-token-number redeclaration errors.
1187 Address nondeterminism reported by Joel E. Denny.
1188 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1189
1190 * src/uniqstr.h: Comment changes.
1191 * src/location.h (boundary_cmp, location_cmp): New.
1192 * src/symtab.c (user_token_number_redeclaration): New.
1193 (symbol_translation): Use it.
1194 * tests/input.at (Numbered tokens): Adjust the expected output.
1195
796a2b0a
AD
11962009-05-25 Akim Demaille <demaille@gostai.com>
1197
1198 build: avoid ignored errors.
1199 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
1200 errors, they pollute the output.
1201
0b6d43c5
JD
12022009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1203
1204 Convert multiple variable definition warnings to complaints.
1205 * NEWS (2.5): Add a new entry for that change.
1206 * doc/bison.texinfo (Decl Summary): Update %define entry.
1207 (Bison Options): Update -D/--define/-F/--force-define entry.
1208 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
1209 * src/muscle-tab.h (muscle_percent_define_insert): Update
1210 comments.
1211 * tests/input.at (`%define errors'): Update.
1212 (`%define, --define, --force-define'): Update.
1213
de5ab940
JD
12142009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1215
1216 -F/--force-define and relative %define/-D/--define priorities.
1217 * NEWS (2.5): Add documentation to -D/--define entry.
1218 * build-aux/cross-options.pl: Hard-code association of
1219 --force-define with %define.
1220 * doc/bison.texinfo (Decl Summary): In %define entry,
1221 cross-reference command-line options.
1222 (Bison Options): Add documentation to -D/--define entry.
1223 (Option Cross Key): Widen column for --force-define row.
1224 * src/getargs.c (usage): Document -F/--force-define. Realign
1225 options in output.
1226 (short_options, long_options, getargs): Parse -F/--force-define,
1227 and update muscle_percent_define_insert invocations.
1228 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
1229 (muscle_percent_define_insert): Add argument with that type.
1230 * src/muscle-tab.c (muscle_percent_define_insert): Implement
1231 -F/--force-define behavior and priorities.
1232 (muscle_percent_define_ensure): Update
1233 muscle_percent_define_insert invocation.
1234 * src/parse-gram.y (prologue_declaration): Update
1235 muscle_percent_define_insert invocations.
1236 * tests/input.at (`%define, --define'): Rename to...
1237 (`%define, --define, --force-define'): ... this and extend.
1238
f8e7258f
JD
12392009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1240
1241 Update some comments to make sense for -D.
1242 * data/bison.m4 (b4_check_user_names): In header comments, say
1243 "user occurrence" instead of "grammar occurrence".
1244 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
1245 (muscle_percent_code_grow): Likewise just for consistency.
1246
b987342b
JD
12472009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1248
1249 * data/c++.m4 (b4_namespace_close): Simplify slightly.
1250
4977e0a7
JD
12512009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
1252
1253 Handle a trailing `:' in a user-supplied C++ namespace better.
1254 * data/c++.m4 (b4_namespace_close): Don't let it be printed
1255 among the closing braces here. This fix might make the
1256 generated code easier to debug, but otherwise it should be
1257 insignificant because a trailing `:' is a C++ error already.
1258
9b04dad7
AD
12592009-05-19 Akim Demaille <demaille@gostai.com>
1260
1261 remove useless variable.
1262 * src/getargs.c (skeleton_arg): Remove now useless variable.
1263 Should help the compiler see that this printf-like call is sane.
1264
4c6622c2
AD
12652009-05-15 Akim Demaille <demaille@gostai.com>
1266
1267 Rename token.prefix as api.tokens.prefix.
1268 Discussed here.
1269 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
1270
1271 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
1272 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
1273 (token.prefix): Rename as...
1274 (api.tokens.prefix): this.
1275
3c248d70
AD
12762009-05-11 Akim Demaille <demaille@gostai.com>
1277
1278 doc: use C++ headers.
1279 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
1280 headers.
1281
99c08fb6
AD
12822009-05-11 Akim Demaille <demaille@gostai.com>
1283
1284 doc: token.prefix
1285 * doc/bison.simple (Decl Summary): Document token.prefix.
1286 (Calc++ Parser): Various fixes.
1287 Formatting changes.
1288 Use token.prefix.
1289 Introduce a macro TOKEN to shorten the code and make it more
1290 readable.
1291 (Calc++ Scanner): Adjust.
1292 * NEWS (Variable token.prefix): New.
1293
84a1cb5a
AD
12942009-05-04 Akim Demaille <demaille@gostai.com>
1295
1296 bison: catch bad symbol names.
1297 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
1298 * tests/input.at: Adjust.
1299
cdf3f113
AD
13002009-05-04 Akim Demaille <demaille@gostai.com>
1301
1302 identifiers: dashes are letters.
1303 Dashes can now start identifiers (symbols and directives).
84a1cb5a 1304
cdf3f113
AD
1305 * src/scan-gram.l ({letter}): Add dash.
1306 ({id}): Remove it.
1307 * tests/input.at (Symbols): Adjust.
1308 Remove stray comment.
1309 * tests/regression.at (Invalid inputs): Adjust error message.
1310 * doc/bison.texinfo (Symbols): Update.
1311
98a345a2
JD
13122009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
1313
1314 Declare %code to be a permanent feature.
1315 * NEWS (2.4.2): Here.
1316 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
1317 experimental.
1318 (Decl Summary): Likewise.
1319
67212941
JD
13202009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1321
1322 Convert underscores to dashes in some %define variable names.
1323 For now, just api.push-pull and lr.keep-unreachable-states.
1324 Maintain old names for backward compatibility.
1325 * NEWS (2.5): Document.
1326 * data/c.m4 (b4_identification): Update comment.
1327 * data/yacc.c: Update access.
1328 * doc/bison.texinfo: Update.
1329 * etc/bench.pl.in (bench_push_parser): Update use.
1330 * src/files.c (tr): Move to...
1331 * src/getargs.c, src/getargs.h (tr): ... here because I can't
1332 think of a better place to expose it. My logic is that, for all
1333 uses of tr so far, command-line arguments can be involved, and
1334 getargs.h is already included.
1335 * src/main.c (main): Update access.
1336 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
1337 variable names to new variable names before assigning value.
1338 * src/reader.c (reader): Update setting default.
1339 * tests/calc.at: Update uses.
1340 * tests/conflicts.at (Unreachable States After Conflict
1341 Resolution): Update use.
1342 * tests/input.at (%define enum variables): Update use.
1343 (%define backward compatibility): New test group.
1344 * tests/push.at: Update uses.
1345 * tests/reduce.at: Update uses.
1346 * tests/torture.at: Update uses.
1347
ba5c6d94
JD
13482009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1349
1350 Set all front-end %define defaults in one place.
1351 * src/main.c (main): Move lr.keep_unreachable_states default...
1352 * src/reader.c (reader): ... to here.
1353
5bab9d08
JD
13542009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1355
1356 Rename lr.default_reductions to lr.default-reductions.
1357 * NEWS (2.5): Here.
1358 * doc/bison.texinfo: Here.
1359 * src/lalr.c (initialize_LA): Here.
1360 * src/print.c (print_reductions): Here.
1361 * src/reader.c (reader): Here.
1362 * src/tables.c (action_row): Here.
1363 * tests/input.at (%define enum variables): Here.
1364 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
1365
d521ee19
JD
13662009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1367
1368 Pacify ./configure --enable-gcc-warnings.
1369 * tests/input.at (Symbols): Prototype yyerror and yylex.
1370
13712009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
c9aded4b
JD
1372
1373 Document how `%define "var" "value"' is not M4-friendly.
1374 * src/parse-gram.y (variable): In comments here.
1375
8f0d265e
JD
13762009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1377
1378 Clean up recent patches a little.
1379 Reported by Akim Demaille.
1380 * doc/bison.texinfo (Understanding): Fix typos.
1381 * src/print.c (print_reductions): Don't use negated variable.
1382
f4909773
JD
13832009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1384
1385 List accepted values for a %define enum variable with an invalid value.
1386 Suggested by Akim Demaille at
1387 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
1388 * data/bison.m4 (_b4_percent_define_check_values): Implement.
1389 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
1390 * tests/input.at (%define lr.default_reductions invalid values): Merge
1391 into...
1392 (%define enum variables): ... here, and update output.
1393
110ef36a
JD
13942009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
1395
1396 Rename "default rule" to "default reduction".
1397 This includes changing variable names in code, changing
1398 comments, and renaming %define lr.default_rules to %define
1399 lr.default_reductions.
1400 * NEWS (2.5): Update IELR documentation.
1401 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
1402 documentation.
1403 * data/glr.c, data/lalr1.java: Sync copyright dates.
1404 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
1405 and lr.type documentation. Make some other wording
1406 improvements.
1407 (Glossary): Adjust cross-references and Default Reduction
1408 definition.
1409 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
1410 Remove a confusing comment pointed out by Akim Demaille.
1411 (initialize_LA): Adjust code.
1412 * src/print-xml.c (print_reductions): Adjust code.
1413 * src/print.c (print_reductions): Adjust code.
1414 * src/reader.c (reader): Adjust code.
1415 * src/tables.c (action_row): Adjust code.
1416 (token_actions): Adjust code.
1417 * src/tables.h: Adjust YYDEFACT documentation.
1418 * tests/input.at (%define lr.default_rules invalid values):
1419 Rename test group to...
1420 (%define lr.default_reductions invalid values): ... this, and
1421 update grammar file and expected output.
1422 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
1423 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
1424
746ee38c
AD
14252009-04-21 Akim Demaille <demaille@gostai.com>
1426
1427 tests: check the use of dashes and periods in symbols.
1428 * tests/input.at (Symbol): New test group.
1429
eb45ef3b
JD
14302009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1431
1432 Document %define lr.type and lr.default_rules.
1433 * NEWS (2.5): Add an entry.
1434 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
1435 besides just LALR(1) and GLR(1).
1436 * doc/bison.texinfo (Introduction): Likewise.
1437 (Language and Grammar): Bison is no longer limited to LALR(1)
1438 restrictions.
1439 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
1440 when trying to distinguish from GLR. Talk about LR(1) grammars
1441 rather than LALR(1) grammars.
1442 (Decl Summary): In %define api.push_pull entry, say it applies
1443 to deterministic parsers in C rather than LALR(1) parsers in C.
1444 Add lr.default_rules entry.
1445 Add lr.type entry.
1446 (Mystery Conflicts): Bison is no longer limited to LALR(1)
1447 restrictions.
1448 (Generalized LR Parsing): Same changes as for the previous GLR
1449 section.
1450 (Memory Management): Say deterministic rather than LALR(1).
1451 (Understanding): Correct some bison output.
1452 Index discussion of "accepting state".
1453 Say deterministic rather than LALR(1).
1454 (Bison Options): In --yacc entry, say deterministic rather than
1455 LALR(1).
1456 In --report, --graph, and --xml entries, just don't mention
1457 LALR(1).
1458 (C++ Parsers): Say deterministic rather than LALR(1).
1459 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
1460 (Glossary): Add Accepting State, Consistent State, Default Rule,
1461 and IELR(1) definitions.
1462 In Generalized LR (GLR) definition, make same changes as in
1463 previous GLR sections.
1464 In LALR(1) definition, say Bison uses LALR(1) by default rather
1465 than implying Bison is limited to LALR(1).
1466 (LocalWords): Add IELR.
1467
db34f798
JD
14682009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1469
1470 Finish implementing %define lr.type.
1471 Its value can be "LALR", "IELR", or "canonical LR".
1472 * lib/timevar.def (TV_IELR_PHASE1): New var.
1473 (TV_IELR_PHASE2): New var.
1474 (TV_IELR_PHASE3): New var.
1475 (TV_IELR_PHASE4): New var.
1476 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
1477 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
1478 Sbitset.h, ielr.h, and ielr.c.
1479 * src/getargs.h, src/getargs.c (enum trace, trace_args,
1480 trace_types): Add trace_ielr.
1481 * src/lalr.h, src/lalr.c (ngotos): Export it.
1482 (F): Rename to...
1483 (goto_follows): ... this, update all uses, and export it.
1484 (set_goto_map): Export it.
1485 (map_goto): Export it.
1486 (compute_lookahead_tokens): Don't free goto_follows yet. Now
1487 handled in ielr.
1488 (initialize_LA): Export it. Move lookback allocation to...
1489 (lalr): ... here because, for canonical LR, initialize_LA must
1490 be invoked but lookback and much of the rest of LALR isn't
1491 needed.
1492 * main.c (main): Instead of lalr, invoke ielr, which invokes
1493 lalr.
1494 * src/reader.c (reader): Default lr.type to "LALR".
1495 Default lr.default_rules to "accepting" if lr.type is "canonical
1496 LR". Leave the default as "all" otherwise.
1497 Check for a valid lr.type value.
1498 * src/state.h, src/state.c (struct state_list): Add state_list
1499 member.
1500 (state_new): Initialize state_list member to NULL.
1501 (state_new_isocore): New function, exported.
1502 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
1503 exercises all values of lr.type.
1504 (GNU AWK Grammar): Rename test group to...
1505 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
1506 AT_TEST_EXISTING_GRAMMAR.
1507 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
1508 (GNU pic Grammar): Rename test group to...
1509 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
1510 AT_TEST_EXISTING_GRAMMAR.
1511 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
1512 all values of lr.type.
1513 (Single State Split): New test groups using AT_TEST_LR_TYPE.
1514 (Lane Split): Likewise.
1515 (Complex Lane Split): Likewise.
1516 (Split During Added Lookahead Propagation): Likewise.
1517
7fe11bb5
JD
15182009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1519
1520 Add new files for IELR and canonical LR implementation.
1521 * src/AnnotationList.c: New.
1522 * src/AnnotationList.h: New.
1523 * src/InadequacyList.c: New.
1524 * src/InadequacyList.h: New.
1525 * src/Sbitset.c: New.
1526 * src/Sbitset.h: New.
1527 * src/ielr.c: New.
1528 * src/ielr.h: New.
1529
7254f6a8
JD
15302009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1531
1532 Implement %define lr.default_rules.
1533 Its value describes the states that are permitted to contain
1534 default rules: "all", "consistent", or "accepting".
1535 * src/reader.c (reader): Default lr.default_rules to "all".
1536 Check for a valid lr.default_rules value.
1537 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
1538 is "accepting", then only mark the accepting state as
1539 consistent.
1540 (initialize_LA): Tell state_lookahead_tokens_count whether
1541 lr.default_rules is "accepting".
1542 * src/tables.c (action_row): If lr.default_rules is not "all",
1543 then disable default rules in inconsistent states.
1544 * src/print.c (print_reductions): Use this opportunity to
1545 perform some assertions about whether lr.default_rules was
1546 obeyed correctly.
1547 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
1548 helps with checking the parser tables for a grammar.
1549 * tests/input.at (%define lr.default_rules invalid values): New
1550 test group.
1551 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
1552 AT_TEST_TABLES_AND_PARSE.
1553 (`no %define lr.default_rules'): New test group generated by
1554 AT_TEST_LR_DEFAULT_RULES.
1555 (`%define lr.default_rules "all"'): Likewise.
1556 (`%define lr.default_rules "consistent"'): Likewise.
1557 (`%define lr.default_rules "accepting"'): Likewise.
1558
72e727f2
AD
15592009-04-20 Akim Demaille <demaille@gostai.com>
1560
1561 Formatting change.
1562
90462b8d
AD
15632009-04-20 Akim Demaille <demaille@gostai.com>
1564
1565 bison: factoring.
1566 * src/output.c (token_definitions_output): Use symbol_id_get
1567 instead of duplicating its logic.
1568 * TODO (YYERRCODE): Extend.
1569
4f646c37
AD
15702009-04-20 Akim Demaille <demaille@gostai.com>
1571
71b00ed8
AD
1572 variables: prefer error-verbose to error_verbose.
1573 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
1574 instead of error_verbose.
1575 * src/scan-gram.l (%error-verbose): Map to the error-verbose
1576 variable.
1577 * doc/bison.texinfo: Promote %define error-verbose instead of
1578 %error-verbose.
1579 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
1580
15812009-04-15 Akim Demaille <demaille@gostai.com>
1582
4f646c37
AD
1583 variables: accept dashes.
1584 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
1585 underscores.
1586 * src/scan-gram.l ({id}): Also accept dashes after the initial
1587 letter.
1588 ({directive}): Use {id}.
1589 * src/parse-gram.y: Comment and formatting changes.
1590 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
1591 symbols.
1592 * src/complain.h, src/complain.c (yacc_at): New.
1593 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
1594 symbol names.
1595 * src/output.c (token_definitions_output): Do not #define token
1596 names with dashes.
1597
184e3179
AD
15982009-04-20 Akim Demaille <demaille@gostai.com>
1599
1600 Consistently refer to Yacc, not YACC.
1601 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
1602
41253c3a
JD
16032009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
1604
1605 Pacify make maintainer-check-posix.
1606 * tests/input.at (%define, --define): Move bison command-line
1607 options before grammar file name.
1608
197b82ba
JD
16092009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1610
1611 Document semicolon warnings.
1612 * NEWS (2.5): Here.
1613
0c90a1f5
AD
16142009-04-14 Akim Demaille <demaille@gostai.com>
1615
1616 variables: use `parse.assert' instead of `assert'.
1617 * TODO (assert): Remove.
1618 * data/bison.m4 (b4_assert_if): Replace with...
1619 (b4_parse_assert_if): this.
1620 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
1621 * doc/bison.texinfo (Decl Summary): Document parse.assert.
1622
fa819509
AD
16232009-04-14 Akim Demaille <demaille@gostai.com>
1624
16dc0d90 1625 variables: use `parse.trace' instead of `debug'.
fa819509
AD
1626 * src/getargs.c (getargs): Map -t to %define trace.parse.
1627 * src/scan-gram.l (%debug): Map to %define trace.parse.
1628 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
1629 names to `_' in macro names.
1630 (b4_debug_if): Replace with...
1631 (b4_parse_trace_if): this.
1632 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1633 * data/yacc.c: Adjust.
1634 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
1635 Use @code to label the variable list.
1636 Document the variable parse.trace.
1637 (Tracing): Promote the parse.trace variable.
1638 * TODO: %printer is not documented.
1639
f7dae1ea
AD
16402009-04-14 Akim Demaille <demaille@gostai.com>
1641
1642 doc: minor fixes.
1643 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
1644 (Table of Symbols): Remove duplicate entry for %debug.
1645
3535c071
EB
16462009-04-10 Eric Blake <ebb9@byu.net>
1647
1648 submodules: update to latest
1649 * submodules/autoconf: Use latest upstream Autoconf.
1650
cf48f675
EB
16512009-04-06 Eric Blake <ebb9@byu.net>
1652
1653 Work around autoconf 2.63b bug in testsuite.
1654 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
1655 autoconf bug related to # in test.
1656
50cca368
JD
16572009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1658
1659 * NEWS (2.5): New section. Describe new -D/--define feature.
1660
3583d96b
AD
16612009-04-06 Akim Demaille <demaille@gostai.com>
1662
1663 Regen.
1664 * src/parse-gram.h, src/parse-gram.c: Regen.
1665
00f5d575
AD
16662009-04-06 Akim Demaille <demaille@gostai.com>
1667
1668 rename muscle_tab.* as muscle-tab.* for consistency.
1669 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
1670 * src/muscle-tab.h, src/muscle-tab.c: these.
1671 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
1672 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
1673
76bf5102
AD
16742009-04-06 Akim Demaille <demaille@gostai.com>
1675
1676 Makefile: introduce $(BISON).
1677 * src/local.mk (BISON): New.
1678 (YACC): Use it.
1679
bc0f5737
AD
16802009-04-06 Akim Demaille <demaille@gostai.com>
1681
1682 parser: handle %locations as %define locations.
1683 * src/getargs.h, src/getargs.c (locations_flag): Remove.
1684 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
1685 to set "locations" to true.
1686 * src/output.c (prepare): Don't output "locations".
1687 * src/scan-gram.l (%locations): Handle it as a %<flag>.
1688 * src/parse-gram.y: It's no longer a token.
1689 Don't handle it.
1690 * data/bison.m4 (b4_locations_if): Define it with
1691 b4_percent_define_if_define.
1692 * data/c.m4, data/glr.cc: Adjust.
1693
697c912f
AD
16942009-04-06 Akim Demaille <demaille@gostai.com>
1695
1696 Regen.
1697 * src/parse-gram.c: Regen.
1698
4920ae8b
AD
16992009-04-06 Akim Demaille <demaille@gostai.com>
1700
1701 muscle: factor the handling of obsolete of obsolete directives.
1702 Suggested by Joel E. Denny.
50cca368 1703
4920ae8b
AD
1704 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
1705 New, extracted from...
1706 * src/parse-gram.y (prologue_declaration: pure-parser): here.
1707 Remove it.
1708 (prologue_declaration: "%<flag>"): Use
1709 muscle_percent_define_ensure.
1710 (%error-verbose, %pure-parser): No longer tokens.
1711 * src/scan-gram.l (pure-parser): Return as a %<flag>.
1712
1d5b3c08
JD
17132009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1714
1715 Fix options documentation.
1716 * build-aux/cross-options.pl: As in --help output, write optional
1717 arguments as [=ARG] not =[ARG].
1718 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
1719
62c99cf4
JD
17202009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1721
1722 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
1723 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
1724 requirements for a correct m4 are stricter.
1725 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
1726 * configure.ac: Update to use AC_PROG_GNU_M4.
1727 Reported by Eric Blake.
1728
1c93f35b
JD
17292009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1730
1731 Help with updating web manual.
1732 * HACKING: Incorporate instructions from gnulib/doc/README.
1733 * bootstrap.conf (gnulib_modules): Add gendocs.
1734
86cfae0a
AD
17352009-04-03 Akim Demaille <demaille@gostai.com>
1736
1737 Regen.
1738 * src/parse-gram.h, src/parse-gram.c: Regen.
1739
ba061fa6
AD
17402009-04-03 Akim Demaille <demaille@gostai.com>
1741
1742 Factor %FLAG at scan level.
1743 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
1744 definitions and associated rules, replaced by....
1745 (PERCENT_FLAG): this new token type, and rule.
1746 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
1747 Use it for %debug and %error-verbose.
1748
b19ebeb3
AD
17492009-04-03 Akim Demaille <demaille@gostai.com>
1750
1751 Regen.
1752 * src/parse-gram.h, src/parse-gram.c: Regen.
1753
001a16a9
AD
17542009-04-03 Akim Demaille <demaille@gostai.com>
1755
1756 Treat %debug as %define debug.
1757 * data/bison.m4 (b4_debug_if): New.
1758 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
1759 * data/lalr1.java: Use it instead of b4_debug_flag.
1760 * src/getargs.h, src/getargs.c (debug_flag): Remove.
1761 * src/output.c (prepare): Don't output it.
1762 * src/parse-gram.y: Treat %debug as %define debug.
1763
17642009-04-03 Akim Demaille <demaille@gostai.com>
1765
1766 Treat %error-verbose as %define error_verbose.
1767 This allows to pass -Derror_verbose on the command line. Better
1768 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
1769 ERROR_VERBOSE being defined as false or true.
1770 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
1771 on b4_percent_define_ifdef, for does not check the defined value,
1772 but only whether the symbol is defined, rely on
1773 b4_percent_define_flag_if, so that a value of "false" is processed
1774 as a false.
1775 If not defined, define the flag to "false".
1776 (b4_error_verbose_if): New.
1777 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
1778 b4_error_verbose_flag.
1779 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
1780 * src/output.c (prepare): Don't output it.
1781 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
1782
92822aff
JD
17832009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1784
1785 Fix strange %define locations for default values.
1786 Reported by Akim Demaille at
1787 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
1788 and discussed again starting at
1789 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
1790 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
1791 because location information is bogus.
1792 Use angle brackets to delimit fake file name because square brackets
1793 look like underexpanded m4. Choose a better fake file name.
1794 Use negative line numbers.
1795 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
1796 * src/location.c (location_print): If line for a boundary is negative,
1797 only print that boundary's file name.
1798 * src/location.h: Document that.
1799 * tests/skeletons.at (%define Boolean variables: invalid skeleton
1800 defaults): Update output.
1801
e021191b
JD
18022009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1803
1804 Pacify ./configure --enable-gcc-warnings.
1805 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
1806 in lib won't compile with it.
1807 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
1808
78f65418
AD
18092009-03-31 Akim Demaille <demaille@gostai.com>
1810
1811 bootstrap: --help to stdout.
1812 * bootstrap (usage): Don't send --help to stderr.
1813 Use a here doc instead of a long string.
1814
f7e241f4
AD
18152009-03-31 Akim Demaille <demaille@gostai.com>
1816
1817 bootstrap: README-hacking no longer exists
1818 * bootstrap (checkout_only_file): Set to HACKING.
1819
31d3e510
AD
18202009-03-26 Akim Demaille <demaille@gostai.com>
1821
1822 doc: merge HACKING and README-hacking.
1823 Two files is confusing.
1824 Reported by Alexandre Duret-Lutz.
1f9d8248 1825
31d3e510
AD
1826 * README-hacking: Merge into...
1827 * HACKING (Working from the repository): here.
1828
81535bfa
AD
18292009-03-26 Akim Demaille <demaille@gostai.com>
1830
1831 doc: update README-hacking.
1832 * README-hacking: We now use git and git submodules.
1833 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
1834
56f772e9
AD
18352009-03-26 Akim Demaille <demaille@gostai.com>
1836
1837 lalr1.cc: avoid GCC 4.3 warnings.
1838 GCC 4.3 now warns about "a || b && c" and asks for explicit
1839 parentheses.
1840 Reported by Alexandre Duret-Lutz.
1841 * data/location.cc: Update copyright years.
1842 (Position::operator==): Use parens to make precedence explicit.
1843 Compare lines and columns first, as they are more likely to be
1844 different, and they are faster to compare.
1845
11c073b7
AD
18462009-03-26 Akim Demaille <demaille@gostai.com>
1847
1848 gnulib: update.
1849 * gnulib: Update to latest.
1850 * src/local.mk (AM_CFLAGS): Move to...
1851 * Makefile.am: here.
1852 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
1853 AM_CFLAGS.
1854
91be6b28
AD
18552009-03-02 Akim Demaille <demaille@gostai.com>
1856
1857 Comment changes.
1858
cbf25ce7
AD
18592009-03-02 Akim Demaille <demaille@gostai.com>
1860
1861 Share b4_yytranslate_define.
1862 * data/lalr1.cc (b4_yytranslate_define): Move to...
1863 * data/c++.m4: here.
1864
882f02ed
AD
18652009-03-02 Akim Demaille <demaille@gostai.com>
1866
1867 Use locations in the variant example.
1f9d8248
AD
1868 Yes, this obfuscates the point of this example, variants only.
1869 But glr.cc cannot work (yet?) without locations. This change
1870 makes it easier to use this example with glr.cc.
11c073b7 1871
882f02ed
AD
1872 * examples/variant.yy (assert): %define it.
1873 (locations): Request them.
1874 (yylex): Bind the location to the stage.
1875
0623bacc
AD
18762009-03-02 Akim Demaille <demaille@gostai.com>
1877
1878 Dub make_TOKEN as a public type interface.
1879 * data/c++.m4 (b4_symbol_constructor_declare)
1880 (b4_symbol_constructor_define): New empty stubs.
1881 (b4_public_types_declare, b4_public_types_define): Use them.
1882 * data/lalr1.cc (b4_symbol_constructor_declare)
1883 (b4_symbol_constructor_declare_)
1884 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
1885 Move to...
1886 * data/variant.hh: here.
1887 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
1888 needed.
1889 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
1890 b4_symbol_constructor_declare, as it is now done by
1891 b4_public_types_define and b4_public_types_declare.
1892
5f5a90df
AD
18932009-03-02 Akim Demaille <demaille@gostai.com>
1894
1895 Coding style changes.
1896 * data/lalr1.cc (b4_symbol_constructor_declaration_)
1897 (b4_symbol_constructor_declarations)
1898 (b4_symbol_constructor_definition_)
1899 (b4_symbol_constructor_definitions)
1900 (b4_yytranslate_definition): Rename as...
1901 (b4_symbol_constructor_declare_)
1902 (b4_symbol_constructor_declare)
1903 (b4_symbol_constructor_define_)
1904 (b4_symbol_constructor_define)
1905 (b4_yytranslate_define): these.
1906 * data/variant.hh (b4_variant_definition): Rename as...
1907 (b4_variant_define): this.
1908
b47b6ff7
AD
19092009-03-02 Akim Demaille <demaille@gostai.com>
1910
1911 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
1912 * data/bison.m4 (b4_percent_define_if_define): New.
1913 * data/c++.m4 (b4_variant_if): Move to...
1914 * data/bison.m4: Here, using b4_percent_define_if_define.
1915 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
1916 * data/bison.m4: Here, using b4_percent_define_if_define.
1917
1d6b689b
AD
19182009-03-02 Akim Demaille <demaille@gostai.com>
1919
1920 Dub symbol_type_base as a public type.
1921 * data/c++.m4 (b4_public_types_declare): Now define
1922 symbol_type_base and symbol_type.
1923 (b4_public_types_define): New.
1924 In both cases, the definitions are taken verbatim from lalr1.cc.
1925 * data/lalr1.cc: Adjust.
1926
4f84717d
AD
19272009-03-02 Akim Demaille <demaille@gostai.com>
1928
1929 b4_public_types_declare.
1930 * data/c++.m4 (b4_public_types_declare): New.
1931 * data/glr.cc, data/lalr1.cc: Use it.
1932
b9e4eb5b
AD
19332009-03-02 Akim Demaille <demaille@gostai.com>
1934
1935 b4_semantic_type_declare.
1936 * data/c++.m4 (b4_semantic_type_declare): New.
1937 Factors and generalizes what was in glr.cc and lalr1.cc.
1938 * data/variant.hh (b4_semantic_type_declare): Redefine it for
1939 variants.
1940 * data/lalr1.cc, data/glr.cc: Use it.
1941
6a6e7f0c
AD
19422009-02-26 Akim Demaille <demaille@gostai.com>
1943
1944 Upgrade gnulib.
1945 * gnulib: Upgrade from master.
1946 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
1947 Regen.
1948
e9e61b00
AD
19492009-02-25 Akim Demaille <demaille@gostai.com>
1950
1951 Remove useless arguments.
1952 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
1953 relevant.
1954
3eead995
AD
19552009-02-25 Akim Demaille <demaille@gostai.com>
1956
1957 Comment changes.
1958 * data/lalr1.cc: here.
1959
87f28efe
AD
19602009-02-25 Akim Demaille <demaille@gostai.com>
1961
1962 Fix glr.cc's debug level handling.
1963 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
1964 glr.c which is used.
1965 (debug_level, set_debug_level): Adjust.
1966
9be2a009
AD
19672009-02-25 Akim Demaille <demaille@gostai.com>
1968
1969 Copyright years.
1970 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
1971
07a6e87d
AD
19722009-02-25 Akim Demaille <demaille@gostai.com>
1973
1974 Style changes.
1975 * etc/bench.pl.in (generate_grammar_list): Consitently use
1976 location_type, not yy::location.
1977
33c78bd2
AD
19782009-02-25 Akim Demaille <demaille@gostai.com>
1979
1980 Comment change.
1981 * data/lalr1.cc: here.
1982
49572920
AD
19832009-02-19 Akim Demaille <demaille@gostai.com>
1984
1985 Make yyparser::error public.
1986 * data/lalr1.cc: here.
1987 There is no good reason to keep it private (and it is convenient
1988 to use it from the scanner for instance). It is already public in
1989 glr.cc.
1990
88654b47
AD
19912009-02-19 Akim Demaille <demaille@gostai.com>
1992
1993 Comment changes.
1994 * data/glr.cc: here.
1995
4524c55b
AD
19962009-02-19 Akim Demaille <demaille@gostai.com>
1997
1998 Remove trailing blanks.
6a6e7f0c
AD
1999 The epilogue has its own ending \n, no need to add another.
2000
4524c55b
AD
2001 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
2002 epilogue.
2003 * data/glr.cc: dnl when extending the epilogue.
2004 Remove stray "private:".
2005
6ceccee8
AD
20062009-02-19 Akim Demaille <demaille@gostai.com>
2007
2008 Use b4_c_modern.
2009 * data/c.m4 (b4_c_function_decl): Here.
2010
9c6a8966
AD
20112009-02-19 Akim Demaille <demaille@gostai.com>
2012
2013 Comment changes.
2014 * data/lalr1.cc: here.
2015
507aa0e2
AD
20162009-02-19 Akim Demaille <demaille@gostai.com>
2017
2018 Extract variant.hh
2019 * data/variant.hh: New, extracted from...
2020 * data/lalr1.cc: here.
2021 Adjust.
2022 * data/local.mk: Adjust.
2023
51bacae6
AD
20242009-02-19 Akim Demaille <demaille@gostai.com>
2025
2026 Extract stack.hh from lalr1.cc.
2027 * data/stack.hh: New.
2028 * data/lalr1.cc: Extract from here.
2029 * data/local.mk: Adjust.
2030
06c3084f
JD
20312009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
2032
2033 Add reminder about uploading public key to keys.gnupg.net.
2034 * HACKING (Release Procedure): Here.
2035
0ea583d2
AD
20362009-01-28 Akim Demaille <demaille@gostai.com>
2037
2038 * NEWS: Update information about 2.4.1 and 2.4.2.
2039
402b123d
AD
20402008-11-04 Akim Demaille <demaille@gostai.com>
2041
2042 Reformat NEWS.
2043 * NEWS: Use more outline-mode markup.
2044 Suggested by Jim Meyering.
2045
74553c98
AD
20462009-01-08 Akim Demaille <demaille@gostai.com>
2047
2048 Fix grep portability issues.
2049 Grep on Solaris does not support -q.
2050 Reported by Summum Bonum.
2051
2052 * NEWS: Add a stub for 2.4.2.
2053 * THANKS: Add Summum Bonum.
2054 * tests/atlocal.in (EGREP): New.
2055 (CC, CXX, XSLTPROC): Make it possible to override them via
2056 envvars.
2057 * tests/java.at: Use $EGREP instead of egrep.
2058 Use AT_CHECK's ignore instead of grep's -q.
2059
84eedf86
AD
20602008-12-11 Akim Demaille <demaille@gostai.com>
2061
2062 Pass the token type to yysyntax_error.
2063 * data/yacc.c (yysyntax_error): Take the transated token instead
2064 of the raw number.
2065 Adjust callers.
2066 * TODO: Update.
2067
5860cc8c
AD
20682008-12-11 Akim Demaille <demaille@gostai.com>
2069
2070 Formatting changes.
2071 * data/glr.c: Formatting changes.
2072
2b008529
AD
20732008-12-11 Akim Demaille <demaille@gostai.com>
2074
2075 Propagate i18n changes into glr.c.
2076 * TODO: Update.
2077 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
2078 building the error message format dynamically.
2079 * data/lalr1.java: Formatting changes.
2080
2cd1af95
AD
20812008-12-11 Akim Demaille <demaille@gostai.com>
2082
2083 Use testsuite -C.
2084 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
2085 Solves problems when top_srcdir is an absolute path.
2086 Suggested by Eric Blake.
2087 * configure.ac: Require Autoconf 2.62.
2088
eeb29422
AD
20892008-12-11 Akim Demaille <demaille@gostai.com>
2090
2091 Simplify the i18n of the error messages.
2092 * data/lalr1.cc: Comment changes.
2093 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
2094 lalr1.cc instead of building dynamically the format string.
2095
6617622c
AD
20962008-12-08 Akim Demaille <demaille@gostai.com>
2097
2098 Fix portability issue in the test suite.
2099 * tests/local.at (AT_MATCHES_CHECK): New.
2100 Based on Perl instead of Sed. Sed has too many portability
2101 pitfalls, not ever Sed is GNU Sed.
2102 * tests/actions.at (Fix user actions without a trailing semicolon):
2103 Use it.
2104
2ca1136c
AD
21052008-12-08 Akim Demaille <demaille@gostai.com>
2106
2107 Update data/README.
2108 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
2109
6c63b895
AD
21102008-12-08 Akim Demaille <demaille@gostai.com>
2111
2112 Install autoconf as a submodule to get m4sugar.
2113 * .gitmodules: Add submodules/autoconf.
2114 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
2115 submodules/autoconf.
2116
417e31d2
AD
21172008-12-08 Akim Demaille <demaille@gostai.com>
2118
2119 Test token.prefix in all the skeletons.
2120 * data/java.m4 (b4_token_enum): Use the token.prefix.
2121 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
2122 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
2123 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
2124 * tests/java.at: Comment changes.
2125 (AT_CHECK_JAVA_MINIMAL): Define the END token.
2126 (Java parser class and package names): Add token.prefix check.
2127
97abf544
AD
21282008-12-08 Akim Demaille <demaille@gostai.com>
2129
2130 Fix regeneration of atconfig.
2131 * tests/local.mk (tests/atconfig): The rule was incorrect, but
2132 remove it: now that there is no tests/Makefile.am, the top-level
2133 Makefile properly updates atconfig when needed.
2134
e8cd1ad6
DJ
21352008-12-07 Di-an Jan <dianj@freeshell.org>
2136
2137 Implement the FIXME that ends an user action with a semicolon
2138 if it seems necessary.
2139 * src/scan-code.l (flex rules section): Flag cpp directive from
2140 any `#' to the first unescaped end-of-line. Semicolon is not
2141 needed after `;', `{', '}', or cpp directives and is needed after
2142 any other token (whitespaces and comments have no effect).
2143 * tests/actions.at (Fix user actions without a trailing semicolon):
2144 New test.
2145 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
2146 to make user actions complete statements.
2147 Adjust column numbers in error messages.
2148 * tests/regression.at (Fix user actions without a trailing semicolon):
2149 Remove. Covered by new test.
2150
ce9447fc
AD
21512008-12-07 Akim Demaille <demaille@gostai.com>
2152
2153 Update gnulib.
2154 * gnulib: Update from master.
2155
d333175f
EB
21562008-12-05 Eric Blake <ebb9@byu.net>
2157
2158 Avoid compiler warning.
2159 * src/output.c (muscle_insert_item_number_table): Delete unused
2160 function.
2161
215b40ac
EB
21622008-12-02 Eric Blake <ebb9@byu.net>
2163
2164 Build testsuite with newer autoconf.
2165 * tests/output.at (m4_expand): Don't override in newer autoconf,
2166 where the underlying implementation changed.
2167 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
2168 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
2169 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
2170 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
2171 since some of them contain unbalanced ')'.
2172
3bb21113
AD
21732008-12-01 Akim Demaille <demaille@gostai.com>
2174
2175 Use b4_symbol for printers and destructors everywhere.
2176 * data/bison.m4 (b4_symbol_action_location): New.
2177 * data/c.m4 (b4_symbol_actions): Remove.
2178 Adjust all callers to use by b4_symbol_foreach and the corresponding
2179 b4_symbol_printer/destructor macro.
2180 * data/glr.cc: Adjust.
2181 * data/lalr1.java: Adjust the %destructor sanity check.
2182 * src/output.c (symbol_code_props_output): Remove, we no longer
2183 need the b4_symbol_printers/destructors tables.
2184
fb7c5b1f
AD
21852008-12-01 Akim Demaille <demaille@gostai.com>
2186
2187 Use b4_symbol_case_.
2188 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
2189 b4_symbol_case_.
2190
cf6fb222
AD
21912008-12-01 Akim Demaille <demaille@gostai.com>
2192
2193 Move b4_symbol based macro to bison.m4.
2194 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
2195 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
2196 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
2197 (b4_type_foreach): Move to...
2198 * data/bison.m4: Here.
2199 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
2200 b4_symbol_value_template instead of b4_symbol_value.
cf6fb222 2201
e3c52a63
AD
22022008-12-01 Akim Demaille <demaille@gostai.com>
2203
2204 b4_symbol/type_foreach.
2205 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
2206 Use them.
2207
2bde9113
AD
22082008-12-01 Akim Demaille <demaille@gostai.com>
2209
2210 Use the symbol properties to output the printer/destructor for lalr1.cc.
30c10faf
AD
2211 Instead of defining complex list of tuples to define various
2212 properties of the symbols, we now prefer to define symbols as
2213 "structs" in m4: using the symbol key (its number), and the
2214 property name, b4_symbol gives it value. Use this to handle
2215 destructors and printers.
2216
2bde9113
AD
2217 * src/output.c (CODE_PROP): New.
2218 (prepare_symbol_definitions): Use it to define the printer and
2219 destructor related attributes of the symbols.
2220 * data/lalr1.cc (b4_symbol_actions): Rename as...
2221 (b4_symbol_action): this.
2222 Use b4_symbol instead of 6 arguments.
2223 (b4_symbol_printer, b4_symbol_destructor): New.
2224 Use them instead of b4_symbol_actions.
2225
44494bf6
AD
22262008-12-01 Akim Demaille <demaille@gostai.com>
2227
2228 Avoid capturing variables too easily.
2229 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
2230 v__ and p__ instead of v and p.
2231
fad814bd
AD
22322008-12-01 Akim Demaille <demaille@gostai.com>
2233
2234 Remove spurious empty line before syncline.
2235 * data/bison.m4 (b4_syncline): Don't output an empty line before
2236 the output.
2237
feda5527
AD
22382008-11-26 Akim Demaille <demaille@gostai.com>
2239
2240 Convert lib/Makefile.am into lib/local.mk.
2241 The real problem is rather gnulib.mk, which itself is extracted
2242 from a Makefile.am that gnulib expects to the "recursive". The
2243 tool prefix-gnulib-mk converts such a gnulib.mk to be
2244 non-recursive. Also, some AC_SUBST variables need to be adjusted.
2245
2246 * etc/prefix-gnulib-mk: New.
2247 * bootstrap (slurp): Use it to convert further gnulib.mk.
2248 No longer try to avoid re-creation of lib/gnulib.mk as the changes
2249 are deeper.
2250 * lib/Makefile.am: Rename as...
2251 * lib/local.mk: this.
2252 Adjust to be prefixed.
2253 * Makefile.am, configure.ac: Adjust.
2254 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
2255
56ddee7f
AD
22562008-11-26 Akim Demaille <demaille@gostai.com>
2257
2258 s/_FLAGS/FLAGS/.
2259 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
2260 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
2261 Reported by Eric Blake.
2262
728e89a0
AD
22632008-11-26 Akim Demaille <demaille@gostai.com>
2264
2265 Use b4_parser_tables_define in glr.cc.
2266 * data/glr.c: Use b4_parser_tables_define instead of defining the
2267 (deterministic integral) tables by hand.
2268
2c1bf9bd
AD
22692008-11-26 Akim Demaille <demaille@gostai.com>
2270
2271 Use b4_parser_tables_define in Java.
2272 * data/java.m4 (b4_typed_parser_table): Rename as...
2273 (b4_typed_parser_table_define): this, for consistency.
2274 Accept a comment as $4.
2275 Move $2 into yy*_.
2276 (b4_integral_parser_table): Rename as...
2277 (b4_integral_parser_table_define): this.
2278 * data/lalr1.java: Adjust all uses.
2279 Use b4_parser_tables_define instead of generation by hand.
2280
ba206cf4
AD
22812008-11-26 Akim Demaille <demaille@gostai.com>
2282
2283 Prepare the convergence bw C style and Java table generation.
2284 * data/bison.m4 (b4_tables_map, b4_tables_declare)
2285 (b4_tables_define): Rename as...
2286 (b4_integral_parser_tables_map, b4_parser_tables_declare)
2287 (b4_parser_tables_define): these.
2288 * data/c.m4 (b4_table_define): Rename as...
2289 (b4_integral_parser_table_define): this.
2290 * data/lalr1.cc: Adjust.
2291 (b4_table_define, b4_table_declare): Rename as...
2292 (b4_integral_parser_table_define)
2293 (b4_integral_parser_table_declare): these.
2294 (yyrline_): Move the comment where it is actually used.
2295 * data/yacc.c: Adjust.
2296 (yyrline): Use b4_integral_parser_table_define.
2297
d12f8e49
AD
22982008-11-26 Akim Demaille <demaille@gostai.com>
2299
2300 Regen.
2301 * src/parse-gram.h, src/parse-gram.c: Regen.
2302
0991e29b
AD
23032008-11-26 Akim Demaille <demaille@gostai.com>
2304
2305 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
2306 * data/lalr1.cc (b4_tables_map): Move to...
2307 * data/bison.m4: here.
2308 Update the comment for yytable during the flight.
2309 (b4_tables_declare, b4_tables_define): New.
2310 * data/lalr1.cc: Use them.
2311 * data/c.m4 (b4_table_define): New.
2312 * data/yacc.c: Use b4_tables_define instead of output the tables
2313 by hand.
2314 * tests/regression.at (Web2c Actions): Adjust the expected output,
2315 the order of the tables changed.
2316
3d3bc1fe
AD
23172008-11-26 Akim Demaille <demaille@gostai.com>
2318
2319 Get rid of (yy)rhs and (yy)prhs.
2320 These tables are no longer needed in the parsers, and they don't seem to
2321 be useful. They are not documented either.
feda5527 2322
3d3bc1fe
AD
2323 * src/output.c (prepare_rules): Get rid of rhs and prhs.
2324 Adjust the computation of (yy)r2.
2325
08c81469
AD
23262008-11-26 Akim Demaille <demaille@gostai.com>
2327
2328 Rule length is unsigned.
2329 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
2330
932b0c96
AD
23312008-11-26 Akim Demaille <demaille@gostai.com>
2332
2333 Get rid of lalr1-split.cc.
2334 It was no longer maintainer.
feda5527 2335
932b0c96
AD
2336 * data/lalr1-split.cc: Remove.
2337 * etc/bench.pl.in (bench_fusion_parser): Remove.
2338 Adjust.
2339
8452c667
AD
23402008-11-26 Akim Demaille <demaille@gostai.com>
2341
2342 Use yy* consistently.
2343 * data/glr.c: Now that yyrhs no longer exists as a global
2344 variable, rename local "rhs" variables into "yyrhs" for
2345 consistency.
2346
783aa653
AD
23472008-11-25 Akim Demaille <demaille@gostai.com>
2348
2349 Get rid of yyrhs and yyprhs in glr.c.
2350 * data/glr.c (yyrhs, yyprhs): Remove.
2351 Instead, use the state stack and yystos.
2352
6130b755
AD
23532008-11-25 Akim Demaille <demaille@gostai.com>
2354
2355 Flag glr tests.
2356 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
2357 as an Autotest keyword.
2358
95a7b1c9
AD
23592008-11-25 Akim Demaille <demaille@gostai.com>
2360
2361 Prefer TESTSUITE_FLAGS.
2362 TESTSUITEFLAGS is barely readable.
feda5527 2363
95a7b1c9
AD
2364 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
2365 for backward compatibility.
2366 Use the former instead of the latter.
2367
b4f18401
AD
23682008-11-25 Akim Demaille <demaille@gostai.com>
2369
2370 Get rid of yyrhs and yyprhs in larl1.java.
2371 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
2372 (yy_reduce_print): Rather, use yystos_ and the state stack.
2373
c265fd6b
AD
23742008-11-25 Akim Demaille <demaille@gostai.com>
2375
2376 Formatting changes.
2377
68dbdee8
AD
23782008-11-25 Akim Demaille <demaille@gostai.com>
2379
2380 Get rid of yyrhs and yyprhs in yacc.c.
30c10faf
AD
2381 They were used to get the symbol types, given a rule number, when
2382 displaying the top of the stack before a reduction. But the
2383 symbol type is available from the state stack. This has two be
2384 benefits: two tables less in the parser (making it smaller), and a
2385 more consistent use of the three stacks which will help to fuse
2386 them.
feda5527 2387
68dbdee8
AD
2388 * data/yacc.c (yyprhs, yyrhs): Remove.
2389 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
2390 (yy_reduce_print): Take yyssp as argument.
2391 Use it, together with yystos, to get the symbol type.
2392 * tests/regression.at (Web2c Report): Remove these tables from the
2393 expected output.
2394
6ab1adbe
AD
23952008-11-25 Akim Demaille <demaille@gostai.com>
2396
2397 b4_tables_map.
2398 The point is to factor the generation of the tables across skeletons.
2399 This is language dependant.
feda5527 2400
6ab1adbe
AD
2401 * data/c.m4 (b4_comment_): New.
2402 Should be usable to define how to generate tables independently of
2403 the language.
2404 (b4_c_comment): New.
2405 (b4_comment): Bounce to b4_c_comment.
2406 Now support $2 = [PREFIX] for indentation.
2407 * data/lalr1.cc (b4_table_declare): Don't output a comment if
2408 there is no comment.
2409 Indent it properly when there is one.
2410 Output the ending semicolon.
2411 (b4_table_define): Space changes.
2412 Output the ending semicolon.
2413 (b4_tables_map): New.
2414 Use it twice instead of declaring and defining the (integral)
2415 tables by hand.
2416
0fddb3d5
AD
24172008-11-25 Akim Demaille <demaille@gostai.com>
2418
2419 b4_table_declare.
2420 * data/lalr1.cc (b4_table_declare): New.
2421 Use it to declare the tables defined with b4_table_define.
2422 (b4_table_define): Declare a third arg to match b4_table_declare
2423 signature.
2424 Move all the comments around invocations of b4_table_define into
2425 the invocations itselves.
2426 Move things around to have the order for declarations and
2427 definitions.
2428
c4ddc0fb
AD
24292008-11-25 Akim Demaille <demaille@gostai.com>
2430
2431 Formatting changes.
2432 * data/lalr1.java: here.
2433
e0c653e7
AD
24342008-11-25 Akim Demaille <demaille@gostai.com>
2435
2436 b4_args is more general than only C++.
2437 * data/lalr1.cc (b4_args, _b4_args): Move to...
2438 * data/bison.m4: here.
2439
4182a0a1
DJ
24402008-11-21 Di-an Jan <dianj@freeshell.org>
2441
2442 Implement no-XXX arguments for --warnings, --report, --trace.
2443 * src/getargs.c (flags_argmatch): Handles no-XXX.
2444 Fix typo in doxygen comment.
2445
01466c3e
AD
24462008-11-21 Akim Demaille <demaille@gostai.com>
2447
2448 Display the changes in cross-options.texi.
2449 * build-aux/cross-options.pl ($sep): New, to separate items.
2450 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
2451 changes.
2452
a7c09cba
DJ
24532008-11-20 Di-an Jan <dianj@freeshell.org>
2454
2455 Improves options in the manual.
2456 * doc/bison.texinfo (-g, -x): Add space before argument.
2457 (Option Cross Key): Implement FIXME: listing directives also.
2458 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
2459 (Short Option): Special case -d. Put arguments inside @option.
feda5527 2460 (Bison Directive): Add column, automatically extracted from
a7c09cba
DJ
2461 src/scan-gram.l (actual name passed as the first argument)
2462 with special case for %define.
2463 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
2464 to build-aux/cross-options.pl.
2465 * src/getargs.c (usage): Document limitations of cross-options.pl.
2466 * src/scan-gram.l: Likewise.
2467
6c88b51e
JD
24682008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2469
2470 Fix unexpanded macros in GLR defines file.
2471 Reported by Csaba Raduly at
2472 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
2473 * THANKS (Csaba Raduly): Add.
2474 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
2475 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
2476 lexer in a separate module that includes the defines file.
2477 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
2478 source.
2479 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
2480 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
2481 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
2482 (AT_DATA_SOURCE_PROLOGUE): New.
2483 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
2484 (AT_DATA_SOURCE): New.
2485 (AT_FULL_COMPILE): Extend to support an additional source file.
2486
1e034807
AD
24872008-11-18 Akim Demaille <demaille@gostai.com>
2488
2489 More TODO.
2490 * TODO: More short term issues.
2491
e3dda35c
AD
24922008-11-18 Akim Demaille <demaille@gostai.com>
2493
2494 Regen.
2495 * src/parse-gram.h, src/parse-gram.c: Regen.
2496
bd187d7b
AD
24972008-11-18 Akim Demaille <demaille@gostai.com>
2498
2499 Use b4_subtract where possible.
2500 * data/lalr1.cc (b4_subtract): Move to...
2501 * data/bison.m4: here.
2502 * data/glr.c (b4_rhs_data): Use it.
2503 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
2504
6085ab0d
AD
25052008-11-18 Akim Demaille <demaille@gostai.com>
2506
2507 Remove incorrect mode specification.
2508 * data/glr.cc: Don't pretend it's C code.
2509
9ce405ce
JD
25102008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2511
2512 Simplify last patch slightly.
2513 * src/getargs.c (getargs): Here.
2514
a8beef7e
JD
25152008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2516
2517 Fix last warning from --enable-gcc-warnings.
2518 * src/getargs.c (getargs): Don't assign const address to non-const
2519 pointer.
2520
d50eea6d
JD
25212008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2522
2523 Don't let maintainer-*-check targets force a version update.
2524 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
2525 handled.
2526
f5f419de
DJ
25272008-11-17 Di-an Jan <dianj@freeshell.org>
2528
2529 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
2530 Align menus. Adjust word wrapping. Use node names for menu names.
2531 (Examples): Don't abbreviate node names.
2532 (LocalWords): Remove abbreviations.
2533 (Copying): Make description a sentence.
d50eea6d 2534 (Java Action Features): Remove period to match the rest of menu.
f5f419de 2535
d73e55e0
DJ
25362008-11-17 Di-an Jan <dianj@freeshell.org>
2537
2538 Handles several --enable-gcc-warnings.
2539 * src/getargs.c (command_line_location): Set parameters to void.
2540 * src/output.c (symbol_type_name_cmp): Make static.
2541 (symbols_by_type_name): Set parameters to void.
2542 (symbol_definitions_output): Remove unused parameter. Rename as...
2543 (prepare_symbol_definitions): this.
2544 (muscles_output): Move symbol_definitions_output to...
2545 (output): here as prepare_symbol_definitions.
2546 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
d50eea6d 2547 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
d73e55e0 2548
68c989de
DJ
25492008-11-17 Di-an Jan <dianj@freeshell.org>
2550
2551 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
2552 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
2553
23ce6f4c
AD
25542008-11-16 Akim Demaille <demaille@gostai.com>
2555
2556 Add missing $(EXEEXT).
2557 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
2558 "src/bison$(EXEEXT)".
2559 Reported by Di-an Jan.
2560
dd704c35
AD
25612008-11-15 Akim Demaille <demaille@gostai.com>
2562
2563 * TODO: Update.
2564
dab244d5
AD
25652008-11-15 Akim Demaille <demaille@gostai.com>
2566
2567 Formatting changes.
2568 * tests/input.at: here.
2569
4b4da9fb
AD
25702008-11-15 Akim Demaille <demaille@gostai.com>
2571
2572 Remove duplicate header inclusion.
2573 * src/LR0.c: here.
2574
4ea3f53d
AD
25752008-11-15 Akim Demaille <demaille@gostai.com>
2576
2577 * src/parse-gram.h, src/parse-gram.c: Regen.
2578
cb823b6f
AD
25792008-11-15 Akim Demaille <demaille@gostai.com>
2580
2581 Support parametric types.
b06df3c2
AD
2582
2583 There are two issues to handle: first scanning nested angle
2584 bracket pairs to support types such as std::pair< std::string,
2585 std::list<std::string> > >.
2586
2587 Another issue is to address idiosyncracies of C++: do not glue two
2588 closing angle brackets together (otherwise it's operator>>), and
2589 avoid sticking blindly a TYPE to the opening <, as it can result
2590 in '<:' which is a digraph for '['.
2591
cb823b6f
AD
2592 * src/scan-gram.l (brace_level): Rename as...
2593 (nesting): this.
2594 (SC_TAG): New.
2595 Implement support for complex tags.
b06df3c2 2596 (tag): Accept
cb823b6f
AD
2597 , but not <.
2598 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
2599 (b4_symbol_variant): Leave space around types as parameters.
2600 * examples/variant.yy: Use nested template types and leading ::.
2601 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
2602 Rename as...
2603 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
2604 * tests/c++.at: Test parametric types.
2605
7b6e6753
AD
26062008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2607
2608 Test token.prefix.
2609 This is not sufficient, but we test at least that the make_SYMBOL
2610 interface is not affected by token.prefix. A more general test
2611 will be implemented when the support of token.prefix is generalized
2612 to more skeletons.
b06df3c2 2613
7b6e6753
AD
2614 * tests/c++.at: One more variant test, using token.prefix.
2615
dddec537
AD
26162008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2617
2618 Test the make_TOKEN interface.
2619 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
2620 Factor the common code in yylex.
2621 Use it to test "%define lex_symbol".
2622
7d3e21ba
AD
26232008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2624
2625 Formatting change.
2626
4fc55348
AD
26272008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2628
2629 Simplify code for variants bench marks.
2630 * etc/bench.pl.in (&generate_grammar_list): Define and use
2631 location_type.
2632 Factor the common code in yylex.
2633
070e6509
AD
26342008-11-15 Akim Demaille <demaille@gostai.com>
2635
2636 Better error message.
2637 * bootstrap (find_tool): Fix the error message.
2638
0078681b
AD
26392008-11-15 Akim Demaille <demaille@gostai.com>
2640
2641 Update variant.yy to newest interface.
2642 * examples/variant.yy: Define lex_symbol.
2643 Adjust.
2644
ff084799
AD
26452008-11-15 Akim Demaille <demaille@gostai.com>
2646
2647 Don't use locations in variant.yy.
2648 * examples/variant.yy: Adjust to not using locations.
2649
b0d79ec6
AD
26502008-11-15 Akim Demaille <demaille@gostai.com>
2651
2652 Comment changes.
2653 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
2654 comments for the license.
2655
d4977ce3
AD
26562008-11-15 Akim Demaille <demaille@gostai.com>
2657
2658 Remove tests/Makefile.am.
2659 * tests/Makefile.am: Rename as...
2660 * tests/local.mk: this.
2661 * Makefile.am, configure.ac: Adjust.
2662 * Makefile.am (DISTCLEANFILES): Define.
2663 (maintainer-check, maintainer-xml-check, maintainer-push-check):
2664 Remove, we no longer need to bounce to the real targets.
2665
87f1149a
AD
26662008-11-15 Akim Demaille <demaille@gostai.com>
2667
2668 Comment changes.
2669
36415906
AD
26702008-11-15 Akim Demaille <demaille@gostai.com>
2671
2672 djgpp/local.mk.
2673 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
2674 * djgpp/local.mk: this new file.
2675
e2c2f696
AD
26762008-11-15 Akim Demaille <demaille@gostai.com>
2677
2678 Remove doc/Makefile.am.
2679 * doc/Makefile.am: Rename as...
2680 * doc/local.mk: this.
2681 Adjust paths
2682 * Makefile.am, configure.ac: Adjust.
2683 * Makefile.am (MOSTLYCLEANFILES): New.
2684 * src/local.mk: Adjust.
2685
2ead32e6
AD
26862008-11-15 Akim Demaille <demaille@gostai.com>
2687
2688 Move sc_tight_scope into maint.mk.
b06df3c2
AD
2689 It does not work, and I don't know how it was supposed to work: it
2690 seems to be looking for sources in the build tree. I just moved
2691 it at a better place, fixing it is still required.
2692
2ead32e6
AD
2693 * src/local.mk (echo): Remove.
2694 (sc_tight_scope): Move to...
2695 * maint.mk: here.
2696
2df9ec37
AD
26972008-11-15 Akim Demaille <demaille@gostai.com>
2698
2699 Regen.
2700 * src/parse-gram.h, src/parse-gram.h: Regen.
2701
0305d25e
AD
27022008-11-15 Akim Demaille <demaille@gostai.com>
2703
2704 Remove src/Makefile.am.
2705 * src/Makefile.am: Rename as...
2706 * src/local.mk: this.
2707 Prefix all the paths with src/.
2708 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
2709 (AM_CPPFLAGS): Find find in builddir/src.
2710 (YACC): Move the flags into...
2711 (AM_YFLAGS): here.
2712 * maint.mk (sc_tight_scope): Disable.
2713 It used to bounce to the version in src/Makefile.am which is now
2714 part of this very Makefile.
2715 * Makefile.am, configure.ac: Adjust.
2716 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
2717 include "..." to find files "here": we are no longer in src/, so
2718 qualify the includes with src/.
2719 * doc/Makefile.am (PREPATH): No longer include the top_builddir
2720 prefix.
2721 (.x.1): Adjust to be able to create src/foo from the top level
2722 Makefile, instead of going bounce to src/Makefile the creation of
2723 foo.
2724
5277c0a3
AD
27252008-11-15 Akim Demaille <demaille@gostai.com>
2726
2727 Remove useless variable.
2728 * doc/Makefile.am (srcsrcdir): Remove.
2729
6a5aa0cd
AD
27302008-11-15 Akim Demaille <demaille@gostai.com>
2731
2732 Remove data/Makefile.am.
2733 * data/Makefile.am: Rename as...
2734 * data/local.mk: this.
2735 Adjust paths.
2736 * Makefile.am, configure.ac: Adjust.
2737
7cb794dc
AD
27382008-11-15 Akim Demaille <demaille@gostai.com>
2739
2740 Remove etc/Makefile.am.
2741 * etc/Makefile.am: Rename as...
2742 * etc/local.mk: this.
2743 Adjust.
2744 * Makefile.am, configure.ac: Adjust.
2745
cd409e3b
AD
27462008-11-15 Akim Demaille <demaille@gostai.com>
2747
2748 Remove examples/local.mk.
2749 examples/calc++/Makefile.am might be interesting to keep as is, since
2750 it is an example in itself.
2df9ec37 2751
cd409e3b
AD
2752 * examples/Makefile.am: Rename as...
2753 * examples/local.mk: this.
2754 Adjust.
2755 * Makefile.am, configure.ac: Adjust.
2756
9a1e4214
AD
27572008-11-15 Akim Demaille <demaille@gostai.com>
2758
2759 Remove build-aux/Makefile.am.
2760 Recursive Makefiles are really way too slow, let's get rid of some of
2761 them.
2df9ec37 2762
9a1e4214
AD
2763 * build-aux/Makefile.am: Rename as...
2764 * build-aux/local.mk: this.
2765 Adjust paths.
2766 * Makefile.am, configure.ac: Adjust.
2767
0634493c
AD
27682008-11-15 Akim Demaille <demaille@gostai.com>
2769
2770 Provide convenience constructors for locations and positions.
2771 * data/location.cc (position::position): Accept file, line and
2772 column as arguments with default values.
2773 Always qualify initial line and column literals as unsigned.
2774 (location::location): Provide convenience constructors.
2775
fe1b448a
AD
27762008-11-15 Akim Demaille <demaille@gostai.com>
2777
b06df3c2
AD
2778 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
2779 token type.
fe1b448a
AD
2780 Using template buys us nothing, and makes it uselessly complex to
2781 construct a symbol. Besides, it could not be generalized to other
2782 languages, while make_FOO would work in C/Java etc.
2df9ec37 2783
fe1b448a
AD
2784 * data/lalr1.cc (b4_symbol_): New.
2785 (b4_symbol): Use it.
2786 (b4_symbol_constructor_declaration_)
2787 (b4_symbol_constructor_definition_): Instead of generating
2788 specializations of an overloaded template function, just generate
2789 several functions whose names are forged from the token names
2790 without the token.prefix.
2791 (b4_symbol_constructor_declarations): Generate them for all the
2792 symbols, not just by class of symbol type, now that instead of
2793 specializing a function template by the token, we generate a
2794 function named after the token.
2795 (b4_symbol_constructor_specialization_)
2796 (b4_symbol_constructor_specializations): Remove.
2797 * etc/bench.pl.in: Adjust to this new API.
2798
5679f311
AD
27992008-11-13 Akim Demaille <demaille@gostai.com>
2800
2801 %define token.prefix.
b06df3c2
AD
2802 Provide a means to add a prefix to the name of the tokens as
2803 output in the generated files. Because of name clashes, it is
2804 good to have such a prefix such as TOK_ that protects from names
2805 such as EOF, FILE etc. But it clutters the grammar itself.
2df9ec37 2806
5679f311
AD
2807 * data/bison.m4 (token.prefix): Empty by default.
2808 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
2809 * data/lalr1.cc (b4_symbol): Ditto.
2810
3204049e
AD
28112008-11-13 Akim Demaille <demaille@gostai.com>
2812
2813 Compute at M4 time some of the subtractions.
90290ce5 2814 * data/lalr1.cc (b4_subtract): New.
3204049e
AD
2815 (b4_rhs_data): Use it.
2816
202598d3
AD
28172008-11-13 Akim Demaille <demaille@gostai.com>
2818
2819 symbol::token.
b06df3c2 2820 This allows the user to get the type of a token returned by yylex.
2df9ec37 2821
202598d3
AD
2822 * data/lalr1.cc (symbol::token): New.
2823 (yytoknum_): Define when %define lex_symbol, independently of
2824 %debug.
2825 (yytoken_number_): Move into...
2826 (symbol::token): here, since that's the only use.
2827 The other one is YYPRINT which was not officially supported
2828 by lalr1.cc, and anyway it did not work since YYPRINT uses this
2829 array under a different name (yytoknum).
2830
fc2476c7
AD
28312008-11-13 Akim Demaille <demaille@gostai.com>
2832
2833 YYERRCODE.
2834 * TODO (YYERRCODE): Mention the case of $undef.
2835
865f1e9f
AD
28362008-11-13 Akim Demaille <demaille@gostai.com>
2837
2838 TODO: YYPRINT.
2839 * TODO (YYPRINT): New.
2840
cb0b136a
AD
28412008-11-13 Akim Demaille <demaille@gostai.com>
2842
2843 Comment changes.
2844 * data/lalr1.cc, data/yacc.c: Fix the description of the
2845 yytranslate and yytoknum tables.
2846
2c086d29
AD
28472008-11-13 Akim Demaille <demaille@gostai.com>
2848
2849 Define make_symbol in the header.
b06df3c2
AD
2850 To reach good performances these functions should be inlined (yet
2851 this is to measure precisely). To this end they must be available
2852 to the caller.
2df9ec37 2853
2c086d29
AD
2854 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
2855 location_type with the class name.
2856 Since will now be output in the header, declare "inline".
2857 No longer use b4_symbol_constructor_specializations, but
2858 b4_symbol_constructor_definitions in the header.
2859 Don't call it in the *.cc file.
2860
1c4af381
AD
28612008-11-13 Akim Demaille <demaille@gostai.com>
2862
2863 Define yytranslate in the header for lex_symbol.
2864 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
2865 into the header file when using %define lex_symbol.
2866 (yytranslate_): Declare inline.
2867
e51b0a82
AD
28682008-11-13 Akim Demaille <demaille@gostai.com>
2869
b06df3c2
AD
2870 Define the constructors of symbol_type in
2871 b4_symbol_constructor_definitions.
e51b0a82 2872 The constructors are called by the make_symbol functions, which a
b06df3c2
AD
2873 forthcoming patch will move elsewhere. Hence the interest of
2874 putting them together.
2df9ec37 2875
b06df3c2
AD
2876 The stack_symbol_type does not need to be moved, it is used only
2877 by the parser.
2df9ec37 2878
e51b0a82
AD
2879 * data/lalr1.cc: Move symbol_type and symbol_base_type
2880 constructors into...
2881 (b4_symbol_constructor_definitions): here.
2882 Adjust.
2883
78835571
AD
28842008-11-13 Akim Demaille <demaille@gostai.com>
2885
2886 Make it easier to move the definition of yytranslate_.
2887 Forthcoming changes will make it possible to use yytranslate_
2888 from outside the parser implementation file.
2df9ec37 2889
78835571
AD
2890 * data/lalr1.cc (b4_yytranslate_definition): New.
2891 Use it.
2892
c1e6c88c
AD
28932008-11-13 Akim Demaille <demaille@gostai.com>
2894
2895 Remove useless class specification.
2896 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
2897 to refer to the class name to use a type defined by the class for
2898 arguments of member functions.
2899
4654b0c0
AD
29002008-11-13 Akim Demaille <demaille@gostai.com>
2901
2902 Finer input type for yytranslate.
2903 This patch is debatable: the tradition expects yylex to return an int
2904 which happens to correspond to token_number (which is an enum). This
2905 allows for instance to return characters (such as '*' etc.). But this
2906 goes against the stronger typing I am trying to have with the new
2907 lex interface which return a symbol_type. So in this case, feed
2908 yytranslate_ with a token_type.
2df9ec37 2909
4654b0c0
AD
2910 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
2911 expect a token_type.
2912
dd735e4e
AD
29132008-11-13 Akim Demaille <demaille@gostai.com>
2914
2915 Honor lex-params in %define lex_symbol mode.
2916 * data/lalr1.cc: Use b4_lex_param.
2917
6659366c
AD
29182008-11-13 Akim Demaille <demaille@gostai.com>
2919
2920 Simplify names.
2921 * src/output.c (symbol_definitions_output): Rename symbol
2922 attributes type_name and has_type_name as type and has_type.
2923 * data/lalr1.cc: Adjust uses.
2924
e9805e57
AD
29252008-11-13 Akim Demaille <demaille@gostai.com>
2926
2927 Use b4_type_names for the union type.
b06df3c2
AD
2928 The union used to compute the size of the variant used to iterate
2929 over the type of all the symbols, with a lot of redundancy. Now
2930 iterate over the lists of symbols having the same type-name.
2df9ec37 2931
e9805e57
AD
2932 * data/lalr1.cc (b4_char_sizeof_): New.
2933 (b4_char_sizeof): Use it.
2934 Adjust to be called with a list of numbers instead of a single
2935 number.
2936 Adjust its caller for new-line issues.
2937
aea10ef4
AD
29382008-11-13 Akim Demaille <demaille@gostai.com>
2939
2940 Define the "identifier" of a symbol.
b06df3c2
AD
2941 Symbols may have several string representations, for instance if
2942 they have an alias. What I call its "id" is a string that can be
2943 used as an identifier. May not exist.
2df9ec37 2944
b06df3c2
AD
2945 Currently the symbols which have the "tag_is_id" flag set are
2946 those that don't have an alias. Look harder for the id.
2df9ec37 2947
aea10ef4
AD
2948 * src/output.c (is_identifier): Move to...
2949 * src/symtab.c (is_identifier): here.
2950 * src/symtab.h, src/symtab.c (symbol_id_get): New.
2951 * src/output.c (symbol_definitions_output): Use it to define "id"
2952 and "has_id".
2953 Remove the definition of "tag_is_id".
2954 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
2955 "tag_is_id" were used to produce code.
2956 We still use "tag" for documentation.
2957
2ea7730c
AD
29582008-11-11 Akim Demaille <demaille@gostai.com>
2959
2960 Locations are no longer required by lalr1.cc.
2961 * data/lalr1.cc (_b4_args, b4_args): New.
2962 Adjust all uses of locations to make them optional.
2963 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
2964 (AT_CHECK_NAMESPACE): Check the use of locations.
2965 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
2966 without locations with lalr1.cc.
2967 Test these cases.
2968 * tests/output.at: Check lalr1.cc with and without location
2969 support.
2970 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
2971 Don't use locations.
2972
7ca2266a
AD
29732008-11-11 Akim Demaille <demaille@gostai.com>
2974
2975 AT_FULL_COMPILE.
2976 * tests/local.at (AT_FULL_COMPILE): New.
2977 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
2978
1a7a65f9
AD
29792008-11-11 Akim Demaille <demaille@gostai.com>
2980
2981 Support parens in calc++.
2982 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
2983 * examples/calc++/test (run): Check the expected output.
2984 Adjust callers.
2985 Check parens too.
2986
c944f7f2
AD
29872008-11-11 Akim Demaille <demaille@gostai.com>
2988
2989 Simplify lalr1.cc since %defines is mandatory.
2990 * data/lalr1.cc: Remove useless calls to b4_defines_if.
2991
dada3cd1
AD
29922008-11-11 Akim Demaille <demaille@gostai.com>
2993
2994 TODO: yyfmt.
2995 * TODO (yysyntax_error): New item.
2996
422c18f4
AD
29972008-11-11 Akim Demaille <demaille@gostai.com>
2998
2999 Prefer M4 to CPP.
3000 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
3001 YYERROR_VERBOSE.
3002
a0ffc175
AD
30032008-11-11 Akim Demaille <demaille@gostai.com>
3004
3005 Support i18n of the parse error messages.
3006 * TODO (lalr1.cc/I18n): Remove.
3007 * data/lalr1.cc (yysyntax_error_): Support the translation of the
3008 error messages, as done in yacc.c.
3009 Stay within the yy* pseudo namespace.
3010
00a8a083
AD
30112008-11-11 Akim Demaille <demaille@gostai.com>
3012
3013 More TODO.
3014 * TODO (single stack, yysyntax_error): New.
3015
09277875
AD
30162008-11-11 Akim Demaille <demaille@gostai.com>
3017
3018 Make it possible to return a symbol_type from yylex.
3019 * data/lalr1.cc (b4_lex_symbol_if): New.
3020 (parse): When lex_symbol is defined, expected yylex to return the
3021 complete lookahead.
3022 * etc/bench.pl.in (generate_grammar_list): Extend to support this
3023 yylex interface.
3024 (bench_variant_parser): Exercise it.
3025
64c1b92a
AD
30262008-11-11 Akim Demaille <demaille@gostai.com>
3027
3028 Remove useless bench case.
3029 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
3030 no longer used.
3031
2722aa42
AD
30322008-11-11 Akim Demaille <demaille@gostai.com>
3033
3034 Improve display of directives.
3035 * etc/bench.pl.in (parse_term): Don't add useless eol.
3036
918eb7c5
AD
30372008-11-11 Akim Demaille <demaille@gostai.com>
3038
3039 Use string_cast in the bench.
3040 * etc/bench.pl.in (generate_grammar_list): Define and use
3041 string_cast.
3042
39be9022
AD
30432008-11-11 Akim Demaille <demaille@gostai.com>
3044
3045 Replace yychar with a Boolean.
3046 * data/lalr1.cc (parse::yychar): Replace by...
3047 (parse::yyempty): this.
3048
a2e3fa77
AD
30492008-11-11 Akim Demaille <demaille@gostai.com>
3050
3051 Factor the tables.
3052 * TODO: New item.
3053
aba12ad1
AD
30542008-11-11 Akim Demaille <demaille@gostai.com>
3055
3056 Let yytranslate handle the eof case.
3057 * data/lalr1.cc (yytranslate_): Handle the EOF case.
3058 Adjust callers.
3059 No longer expect yychar to be equal to yyeof_, rather, test the
3060 lookahead's (translated) kind.
3061
27cb5b59
AD
30622008-11-11 Akim Demaille <demaille@gostai.com>
3063
3064 yychar cannot be empty in yyerrlab.
3065 * TODO (yychar == yyempty_): New.
3066 * data/lalr1.cc: Remove the handling of this case.
3067 This eases forthcoming changes related to yychar and yytranslate.
3068
fce629c0
AD
30692008-11-11 Akim Demaille <demaille@gostai.com>
3070
3071 Bench: syntactic sugar for %define/#define.
3072 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
3073 (&bench_push_parser, bench_variant_parser): Use this feature.
3074 (&eat): New.
3075 Use it.
3076
ce671960
AD
30772008-11-11 Akim Demaille <demaille@gostai.com>
3078
3079 Less memory pressure on the "list" bench.
3080 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
3081 the values, to limit memory pressure.
3082
2873fdf8
AD
30832008-11-11 Akim Demaille <demaille@gostai.com>
3084
3085 Introduce make_symbol.
b06df3c2
AD
3086 make_symbol provides a means to construct a full symbol (kind,
3087 value, location) in a single shot. It is meant to be a Symbol
3088 constructor, parameterized by the symbol kind so that overloading
3089 would prevent incorrect kind/value pairs. Unfortunately
3090 parameterized constructors do not work well in C++ (unless the
3091 parameter also appears as an argument, which is not acceptable),
3092 hence the use of a function instead of a constructor.
2df9ec37 3093
2873fdf8
AD
3094 * data/lalr1.cc (b4_symbol_constructor_declaration_)
3095 (b4_symbol_constructor_declarations)
3096 (b4_symbol_constructor_specialization_)
3097 (b4_symbol_constructor_specializations)
3098 (b4_symbol_constructor_definition_)
3099 (b4_symbol_constructor_definitions): New.
3100 Use them where appropriate to generate declaration, declaration of
3101 the specializations, and implementations of the templated
3102 overloaded function "make_symbol".
3103 (variant::variant): Always define a default ctor.
3104 Also provide a copy ctor.
3105 (symbol_base_type, symbol_type): New ctor overloads for value-less
3106 symbols.
3107 (symbol_type): Now public, so that functions such as yylex can use
3108 it.
3109
8be046d7
AD
31102008-11-11 Akim Demaille <demaille@gostai.com>
3111
3112 Inform m4 whether a tag is a valid id.
3113 * src/output.c (is_identifier): New.
3114 (symbol_definitions_output): Use it to define tag_is_id.
3115 But maybe this should be done at m4 level?
3116
de62edee
AD
31172008-11-11 Akim Demaille <demaille@gostai.com>
3118
3119 Test 214 was failing: it greps with a pattern containing [ ]*
3120 which obviously meant to catch spaces and tabs, but contained only
3121 spaces. Tabulations in sources are a nuisance, so to simplify the
3122 matter, get rid of all the tabulations in the Java sources. The
3123 other skeletons will be treated equally later.
3124
3125 * data/java.m4, data/lalr1.java: Untabify.
3126 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
3127 tabulations are no longer generated.
3128
905f0697
PB
31292008-11-11 Paolo Bonzini <bonzini@gnu.org>
3130
3131 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
3132 * configure.ac: Adjust usage.
3133 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3134 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3135 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
3136
09ccae9b
DJ
31372008-11-10 Di-an Jan <dianj@freeshell.org>
3138
3139 Workaround Java's ``code too large'' problem for parser tables
3140 in most cases, by using one function per initialization.
3141 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
3142 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
3143 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
3144 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
3145 (yytname_): Use b4_typed_parser_table.
3146 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
3147 ``code too large'' error.
3148
1979121c
DJ
31492008-11-10 Di-an Jan <dianj@freeshell.org>
3150
3151 * NEWS: Document them.
de62edee 3152
1979121c
DJ
3153 General Java skeleton improvements.
3154 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
3155 using gcj < 4.3 in the testsuite, according to comments in
3156 gnulib/m4/javacomp.m4.
3157 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
3158 location_type, position_type): Remove extraneous brackets from
3159 b4_percent_define_default.
3160 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
3161 m4_define and m4_define_default.
3162 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
3163 which marks the end of user code with appropriate syncline, like all
3164 the other skeletons.
3165 (b4_user_post_prologue): Add. Don't silently drop.
3166 (yylex): Remove.
3167 (parse): Inline yylex.
3168 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
3169 (%{...%}): Fix typo of %code imports.
3170 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
3171
3172 Support annotations on parser class with %define annotations.
3173 * data/lalr1.java (annotations): Add to parser class modifier.
3174 * doc/bison.texinfo (Java Parser Interface): Document
3175 %define annotations.
3176 (Java Declarations Summary): Document %define annotations.
3177 * tests/java.at (Java parser class modifiers): Test annotations.
3178
3179 Do not generate code for %error-verbose unless requested.
3180 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
3181 Make private. Make conditional on %error-verbose.
3182 (getErrorVerbose, setErrorVerbose): New.
3183 (yytnamerr_): Make conditional on %error-verbose.
3184 (yysyntax_error): Make some code conditional on %error-verbose.
3185 * doc/bison.texinfo (Java Bison Interface): Remove the parts
3186 about %error-verbose having no effect.
3187 (getErrorVerbose, setErrorVerbose): Document.
3188
3189 Move constants for token names to Lexer interface.
3190 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
3191 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
3192 (parse): Qualify EOF to Lexer.EOF.
3193 * doc/bison.texinfo (Java Parser Interface): Move documentation of
3194 EOF and token names to Java Lexer Interface.
3195 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
3196
3197 Make yyerror public.
3198 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
3199 (yyerror): Change to public. Add Javadoc comments. Use longer
3200 parameter names. Make the body rather than the declarator
3201 conditional on %locations.
3202 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
3203
3204 Allow user to add code to the constructor with %code init.
3205 * data/java.m4 (b4_init_throws): New, for %define init_throws.
3206 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
3207 Add %code init to the front of the constructor body.
3208 * doc/bison.texinfo (YYParser.YYParser): Document %code init
3209 and %define init_throws.
3210 (Java Declarations Summary): Document %code init and
3211 %define init_throws.
3212 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
3213 (Java constructor init and init_throws): Add tests.
de62edee 3214
42f832d6
AD
32152008-11-10 Akim Demaille <demaille@gostai.com>
3216
3217 Update TODO.
3218 * TODO (-D): is implemented.
3219 (associativity): Same precedence must have the same associativity.
3220 For instance, how can a * b / c be parsed if * is %left and / is
3221 %right?
3222 (YYERRORCODE, YYFAIL, YYBACKUP): New.
3223
247efe34
AD
32242008-11-10 Akim Demaille <demaille@gostai.com>
3225
3226 Formatting changes.
3227
5d731440
AD
32282008-11-10 Akim Demaille <demaille@gostai.com>
3229
3230 More information about the symbols.
3231 * src/output.c (type_names_output): Document all the symbols,
3232 including those that don't have a type-name.
3233 (symbol_definitions_output): Define "is_token" and
3234 "has_type_name".
3235 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
3236 type-name, now that they are defined too in b4_type_names.
3237
21db118b
AD
32382008-11-10 Akim Demaille <demaille@gostai.com>
3239
3240 Regen.
3241
6ed15cde
AD
32422008-11-10 Akim Demaille <demaille@gostai.com>
3243
3244 Make parser::yytranslate static.
b06df3c2
AD
3245 Small speedup (1%) on the list grammar. And makes yytranslate_
3246 available in non member functions.
de62edee 3247
6ed15cde
AD
3248 * data/lalr1.cc (yytranslate_): Does not need to be a instance
3249 function.
3250
30bb2edc
AD
32512008-11-10 Akim Demaille <demaille@gostai.com>
3252
3253 Avoid trailing spaces.
3254 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
3255 * data/lalr1.cc: Don't indent before rule and symbol actions, as
3256 they can be empty, and anyway this incorrectly indents the first
3257 action.
3258
b3a28fd4
AD
32592008-11-10 Akim Demaille <demaille@gostai.com>
3260
3261 Comment changes.
3262
914202bd
AD
32632008-11-10 Akim Demaille <demaille@gostai.com>
3264
3265 Use "enum" for integral constants.
3266 This is just nicer to read, I observed no speedup.
de62edee 3267
914202bd
AD
3268 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
3269 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
3270 (yyuser_token_number_max_, yyundef_token_): Move into...
3271 (yytranslate_): here.
3272
c17f9a4a
AD
32732008-11-10 Akim Demaille <demaille@gostai.com>
3274
3275 Shortcuts in bench directives.
3276 * etc/bench.pl.in (parse_dirs): New.
3277 Use it.
3278 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
3279 Create the benches in "benches/".
3280
b9855ea5
AD
32812008-11-10 Akim Demaille <demaille@gostai.com>
3282
3283 Formatting changes.
3284 * data/lalr1.cc: here.
3285
6e097787
AD
32862008-11-10 Akim Demaille <demaille@gostai.com>
3287
3288 Adjust verbose message to using emacs.
3289 * etc/bench.pl.in: Inform compilation-mode when we change the
3290 directory.
3291 (generate_grammar_list): Recognize %define "variant" in addition
3292 to %define variant.
3293
4c3cc7da
AD
32942008-11-10 Akim Demaille <demaille@gostai.com>
3295
3296 Classify symbols by type-name.
3297 * src/uniqstr.h (UNIQSTR_CMP): New.
3298 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
3299 (type_names_output): New.
3300 (muscles_output): Use it.
3301 * data/lalr1.cc (b4_symbol_action_): Remove.
3302 (b4_symbol_case_, b4_type_action_): New.
3303 Adjust uses of b4_symbol_action_ to use b4_type_action_.
3304
d69c9694
AD
33052008-11-10 Akim Demaille <demaille@gostai.com>
3306
3307 Change the handling of the symbols in the skeletons.
3308 Before we were using tables which lines were the symbols and which
3309 columns were things like number, tag, type-name etc. It is was
3310 difficult to extend: each time a column was added, all the numbers had
3311 to be updated (you asked for colon $2, not for "tag"). Also, it was
3312 hard to filter these tables when only a subset of the symbols (say the
3313 tokens, or the nterms, or the tokens that have and external number
3314 *and* a type-name) was of interest.
de62edee 3315
d69c9694
AD
3316 Now instead of monolithic tables, we define one macro per cell. For
3317 instance "b4_symbol(0, tag)" is a macro name which contents is
3318 self-decriptive. The macro "b4_symbol" provides easier access to
3319 these cells.
de62edee 3320
d69c9694
AD
3321 * src/output.c (type_names_output): Remove.
3322 (symbol_numbers_output, symbol_definitions_output): New.
3323 (muscles_output): Call them.
3324 (prepare_symbols): Define b4_symbols_number.
3325
5263bea9
AD
33262008-11-10 Akim Demaille <demaille@gostai.com>
3327
3328 --trace=muscles
3329 * src/getargs.h, src/getargs.c (trace_muscle): New.
3330 (trace_types, trace_args): Support it.
3331 * src/output.c (output_skeleton): Use it.
3332
4175f6bb
AD
33332008-11-10 Akim Demaille <demaille@gostai.com>
3334
3335 muscles_output.
3336 * src/output.c (muscles_output): New, extracted from...
3337 (output_skeleton): here.
3338 Adjust.
3339
1de69d6a
AD
33402008-11-10 Akim Demaille <demaille@gostai.com>
3341
3342 Formatting changes.
3343
36db78a7
AD
33442008-11-10 Akim Demaille <demaille@gostai.com>
3345
3346 Update the variant example.
3347 * examples/variant.yy: Formatting changes.
3348 One stage build.
3349
e5eb92e7
AD
33502008-11-10 Akim Demaille <demaille@gostai.com>
3351
3352 Support constructor with an argument.
3353 This improves the "list" bench by 2%.
de62edee 3354
e5eb92e7
AD
3355 * data/lalr1.cc (variant::build): Add an overloaded version with
3356 an argument.
3357 * tests/c++.at (AT_CHECK_VARIANT): Check it.
3358
76307410
AD
33592008-11-10 Akim Demaille <demaille@gostai.com>
3360
3361 Test variants.
3362 * tests/c++.at (AT_CHECK_VARIANTS): New.
3363 Use it with and without %define assert.
3364
d78f0ac9
AD
33652008-11-10 Akim Demaille <demaille@gostai.com>
3366
3367 Add %precedence support.
3368 Unfortunately it is not possible to reuse the %prec directive. This
3369 is because to please POSIX, we do not require to end the rules with a
3370 semicolon. As a result,
de62edee 3371
d78f0ac9 3372 foo: bar %prec baz
de62edee 3373
d78f0ac9
AD
3374 is ambiguous: either a rule which precedence is that of baz, or a rule,
3375 and then a declaration of the precedence of the token baz.
de62edee 3376
d78f0ac9
AD
3377 * doc/bison.texinfo: Document %precedence.
3378 (Precedence Only): New.
3379 * src/assoc.h, src/assoc.c (precedence_assoc): New.
3380 * src/conflicts.c (resolve_sr_conflict): Support it.
3381 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
3382 Parse it.
3383 * tests/calc.at: Use %precedence for NEG.
3384 * tests/conflicts.at (%precedence does not suffice)
3385 (%precedence suffices): New tests.
3386
c85be41a
AD
33872008-11-09 Akim Demaille <demaille@gostai.com>
3388
3389 Make benches in a sub dirs.
3390 * etc/bench.pl.in ($dir): New.
3391 Use it.
3392 Check the use of constructors with an argument.
3393 (bench_variant_parser): Fix.
3394
db65ca1f
AD
33952008-11-09 Akim Demaille <demaille@gostai.com>
3396
3397 fix eof condition
3398
9b0efa5b
AD
33992008-11-09 Akim Demaille <demaille@gostai.com>
3400
3401 Fix --help.
3402
432ac57a
AD
34032008-11-09 Akim Demaille <demaille@gostai.com>
3404
3405 Require the generation of parse-gram.output.
3406 * src/Makefile.am (YACC): Pass --report=all.
3407
deef2a0a
AD
34082008-11-09 Akim Demaille <demaille@gostai.com>
3409
3410 Formatting changes.
3411
df72984a
AD
34122008-11-09 Akim Demaille <demaille@gostai.com>
3413
3414 Update TODO.
3415 * TODO: Remove obsolete items.
3416 Update others.
3417
f10e19fd
AD
34182008-11-09 Akim Demaille <demaille@gostai.com>
3419
3420 Enhance bench.pl.
3421 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
3422 (@token, $grammar, $bench): New.
3423 (generate_grammar_variant): Rename as...
3424 (generate_grammar_list): this.
3425 (generate_grammar): Adjust.
3426 (bench_grammar): Rename as...
3427 (bench): this.
3428 Use it in the various bench-marking routines.
3429 (-b, -g): New options.
3430
5de9c593
AD
34312008-11-09 Akim Demaille <demaille@gostai.com>
3432
3433 Use a static hierarchy for symbols in the C++ parser.
3434 * data/lalr1.cc (symbol_base_type, symbol_type)
3435 (stack_symbol_type): Make it a static hierarchy.
3436 Adjust dependencies.
3437
757f8f98
AD
34382008-11-09 Akim Demaille <demaille@gostai.com>
3439
3440 bench.pl -d, --directive.
3441 * etc/bench.pl.in (@directive): New.
3442 (&bench_grammar): Use it.
3443 (&bench_list_grammar): New, to provide access to the "variant"
3444 grammar.
3445 Use it.
3446 (getopts): Support -d, --directive.
3447
d3be4f6d
AD
34482008-11-09 Akim Demaille <demaille@gostai.com>
3449
3450 Use inline for small operations.
3451 * data/lalr1.cc (symbol_base_type, symbol_type)
3452 (stack_symbol_type): Declare constructor and other operations as
3453 inline.
3454 (yy_destroy_): Inline.
3455
1f7d007b
AD
34562008-11-09 Akim Demaille <demaille@gostai.com>
3457
3458 Introduce a hierarchy for symbols.
3459 * data/lalr1.cc (symbol_base_type, symbol_type): New.
3460 (data_type): Rename as...
3461 (stack_symbol_type): this.
3462 Derive from symbol_base_type.
3463 (yy_symbol_value_print_): Merge into...
3464 (yy_symbol_print_): this.
3465 Rename as...
3466 (yy_print_): this.
3467 (yydestruct_): Rename as...
3468 (yy_destroy_): this.
3469 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
3470 (parser::parse): yyla is now of symbol_type.
3471 Use its type member instead of yytoken.
3472
bc0b0477
AD
34732008-11-09 Akim Demaille <demaille@gostai.com>
3474
3475 Rename data_type and stack_symbol_type.
3476 * data/lalr1.cc (data_type): Rename as...
3477 (stack_symbol_type): this.
3478
57295d14
AD
34792008-11-09 Akim Demaille <demaille@gostai.com>
3480
3481 Handle semantic value and location together.
3482 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
3483 yydata.value and yydata.location.
3484 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
3485 (YY_SYMBOL_PRINT): Now take semantic value and location as a
3486 single arg.
3487 Adjust all callers.
3488 (yydestruct_): New overload for a stack symbol.
3489
e9b0834e
AD
34902008-11-09 Akim Demaille <demaille@gostai.com>
3491
3492 Push a complete symbol, not connected parts.
3493 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
3494 state, value and location.
3495 Adjust callers.
3496
6082531a
AD
34972008-11-09 Akim Demaille <demaille@gostai.com>
3498
3499 Agregate yylval and yylloc.
3500 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
3501 (parser::yyla): this.
3502
33c195cc
AD
35032008-11-09 Akim Demaille <demaille@gostai.com>
3504
3505 Rely on the state stack to display reduction traces.
b06df3c2
AD
3506 To display rhs symbols before a reduction, we used information
3507 about the rule reduced, which required the tables yyrhs and
3508 yyprhs. Now use rely only on the state stack to get the same
3509 information.
de62edee 3510
33c195cc
AD
3511 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
3512 Use them.
3513 (parser::yyrhs_, parser::yyprhs_): Remove.
3514 (parser::yy_reduce_print_): Use the state stack.
3515
e1f93869
AD
35162008-11-09 Akim Demaille <demaille@gostai.com>
3517
3518 Fuse yyval and yyloc into yylhs.
3519 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
3520 yylhs.
3521 (parse): Replace yyval and yyloc with yylhs.value and
3522 yylhs.location.
3523 After a user action, compute yylhs.state earlier.
3524 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
3525 fresh error_token.
3526
2935744b
DJ
35272008-11-09 Di-an Jan <dianj@freeshell.org>
3528
3529 Remove unused variable.
3530 * src/output.c (type_names_output): Remove unused variable sep.
3531
bbf9ca37
PB
35322008-11-09 Paolo Bonzini <bonzini@gnu.org>
3533
3534 Change tests/output.at quoting.
3535 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
3536 expanding arguments.
3537
d9a9b96b
JD
35382008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3539
3540 Don't add a semicolon to actions for %skeleton or %language.
3541 It breaks Java test cases as reported by Akim Demaille.
3542 * src/scan-code.l: Implement.
3543
51365192
JD
35442008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3545
3546 Clean up %skeleton and %language priority implementation.
3547 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
3548 remove static qualifier because others will soon need to see it.
3549 (language_prio): Likewise.
3550 (getargs): Use command_line_prio rather than 0.
3551 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
3552 enum fields.
3553 (skeleton_prio): Extern it.
3554 (language_prio): Extern it.
3555 * src/parse-gram.y: Use grammar_prio rather than 1.
3556
9380cfd0
AD
35572008-11-07 Akim Demaille <demaille@gostai.com>
3558
3559 Moving push traces into yypush_.
3560 * data/lalr1.cc (yypush_): Now takes a optional trace message.
3561 Adjust all uses.
3562
8901f32e
AD
35632008-11-07 Akim Demaille <demaille@gostai.com>
3564
3565 The single-stack C++ parser is now the standard one.
3566 * data/lalr1.cc: Rename as...
3567 * data/lalr1-split.cc: this.
3568 * data/lalr1-fusion.cc: Rename as...
3569 * data/lalr1.cc: this.
3570 * etc/bench.pl.in: Adjust.
3571
8cdabf02
AD
35722008-11-07 Akim Demaille <demaille@gostai.com>
3573
3574 Avoid empty-if warnings.
3575 Reported by Quentin Hocquet.
de62edee 3576
8cdabf02
AD
3577 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
3578 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
3579
5a893c2b
AD
35802008-11-07 Akim Demaille <demaille@gostai.com>
3581
3582 Pass command line location to skeleton_arg and language_argmatch.
3583 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
3584 The location argument is now mandatory.
3585 Adjust all dependencies.
3586 (getargs): Use command_line_location.
3587
58697c6d
AD
35882008-11-07 Akim Demaille <demaille@gostai.com>
3589
3590 -D, --define.
3591 * src/getargs.c (usage): Document -D.
3592 Fix help string for --locations.
3593 (command_line_location): New.
3594 (short_options, long_options, getargs): Support -D, --define.
3595 (getargs): Move -d support at the right place.
3596 * doc/bison.texinfo (Bison Options): Update.
3597 * tests/input.at (%define, --define): New.
3598
9fe5a457
AD
35992008-11-07 Akim Demaille <demaille@gostai.com>
3600
3601 Initialize the muscle table before parsing the command line.
3602 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
3603 (getargs): Define file_name.
3604 * src/main.c (main): Initialize muscle_tab before calling
3605 getargs.
3606 * src/muscle_tab.c (muscle_init): No longer define file_name, as
3607 its value is not available yet.
3608
56c5eca9
AD
36092008-11-07 Akim Demaille <demaille@gostai.com>
3610
3611 Locations without columns for command line arguments.
3612 * src/location.c (location_print): Don't display negative columns.
3613 * src/location.h: Document this.
3614
9b9e0a7d
AD
36152008-11-07 Akim Demaille <demaille@gostai.com>
3616
3617 Fix --help.
3618 * src/getargs.c (usage): Fix help string for -W.
3619
74eae918
AD
36202008-11-07 Akim Demaille <demaille@gostai.com>
3621
3622 Handle more general types of option arguments.
3623 * build-aux/cross-options.pl: The argument ends at the first
3624 space, not the first non-symbol character.
3625 Use @var for each word appearing the argument description.
3626
a3d4c6fb
AD
36272008-11-07 Akim Demaille <demaille@gostai.com>
3628
3629 Destroy the variants that remain on the stack in case of error.
3630 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
3631 destructor.
3632 Display the value only if yymsg is nonnull.
3633 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
3634
2d32fc9f
AD
36352008-11-07 Akim Demaille <demaille@gostai.com>
3636
3637 Add "%define assert" to variants.
3638 This is used to help the user catch cases where some value gets
3639 ovewritten by a new one. This should not happen, as this will
3640 probably leak.
de62edee 3641
2d32fc9f
AD
3642 Unfortunately this uncovered a bug in the C++ parser itself: the
3643 lookahead value was not destroyed between two calls to yylex. For
3644 instance if the previous lookahead was a std::string, and then an int,
3645 then the value of the std::string was correctly taken (i.e., the
3646 lookahead was now an empty string), but std::string structure itself
3647 was not reclaimed.
de62edee 3648
2d32fc9f
AD
3649 This is now done in variant::build(other&) (which is used to take the
3650 value of the lookahead): other is not only stolen from its value, it
3651 is also destroyed. This incurs a new performance penalty of a few
3652 percent, and union becomes faster again.
de62edee 3653
2d32fc9f
AD
3654 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
3655 (b4_variant_if): New.
3656 (variant::built): New.
3657 Use it whereever the status of the variant changes.
3658 * etc/bench.pl.in: Check the penalty of %define assert.
3659
f6038cb8
AD
36602008-11-07 Akim Demaille <demaille@gostai.com>
3661
3662 Use "%define variant" in bench.pl.
3663 * etc/bench.pl.in: No longer use the pseudo directive %variants,
3664 just use %define variants.
3665
ccde1f98
AD
36662008-11-07 Akim Demaille <demaille@gostai.com>
3667
3668 Regen.
3669 * src/parse-gram.h, src/parse-gram.c: Regen.
3670
58bd33b7
JD
36712008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
3672
3673 Fix user actions without a trailing semicolon.
3674 Reported by Sergei Steshenko at
3675 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
3676 * THANKS (Sergei Steshenko): Add.
3677 * src/scan-code.l (SC_RULE_ACTION): Fix it.
3678 * tests/regression.at (Fix user actions without a trailing semicolon):
3679 New test case.
3680
639867b5
AD
36812008-11-04 Akim Demaille <demaille@gostai.com>
3682
3683 Use b4_copyright_years.
3684 * data/yacc.c (b4_copyright_years): New.
3685 Fix its value according to the comments in the file.
3686 Use it and undefine it.
3687
3c262606
AD
36882008-11-04 Akim Demaille <demaille@gostai.com>
3689
3690 Formatting changes.
3691 * data/lalr1-fusion.cc, src/parse-gram.y: here.
3692
a2b93d52
AD
36932008-11-04 Akim Demaille <demaille@gostai.com>
3694
3695 Formatting changes.
3696 * data/lalr1-fusion.cc: here.
3697
3a2803df
AD
36982008-11-04 Akim Demaille <demaille@gostai.com>
3699
3700 Use strict on bench.pl.
3701 * etc/bench.pl.in (&run, &generate_grammar): New.
3702 Rename the grammar generating functions for consistency.
3703 Change the interface so that the list of benches to run is passed
3704 as (optionless) arguments.
3705 (&compile): Use &run.
3706
a0d4650a
AD
37072008-11-04 Akim Demaille <demaille@gostai.com>
3708
3709 Remove spurious initial empty lines.
3710 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
3711 * data/yacc.c: End the @output lines with an @.
3712
cac9e09b
AD
37132008-11-04 Akim Demaille <demaille@gostai.com>
3714
3715 Improve the display of sizes.
3716 * etc/bench.p.in: Higher precision.
3717 Sort by decreasing size.
3718
4af4348a
AD
37192008-11-04 Akim Demaille <demaille@gostai.com>
3720
3721 Don't memcpy C++ structures.
3722 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
3723 arguments.
3724 (variant::build): New overload for
3725 copy-construction-that-destroys.
3726 (variant::swap): New.
3727 (parser::yypush_): Use it in variant mode.
3728
ef05c4d6
AD
37292008-11-04 Akim Demaille <demaille@gostai.com>
3730
3731 Better defaults for bench.pl.
3732 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
3733 default values.
3734 Adjust &verbose uses.
3735 (-q, --quiet): New.
3736
9718cfa9
AD
37372008-11-04 Akim Demaille <demaille@gostai.com>
3738
3739 Make variant.yy more complex.
3740 std::list cannot be copied via memcpy, they are more demanding than
3741 std::string. Use one std::list to strengthen the test.
de62edee 3742
9718cfa9
AD
3743 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
3744 Adjust.
3745 Create a list of strings, instead of a single large string.
3746
a6df593d
AD
37472008-11-04 Akim Demaille <demaille@gostai.com>
3748
3749 bench.pl --bench.
3750 * etc/bench.pl.in (--bench, $bench): New.
3751
006a0303
AD
37522008-11-04 Akim Demaille <demaille@gostai.com>
3753
3754 Sort methods.
3755 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
3756 Define it after as().
3757
faef3466
AD
37582008-11-04 Akim Demaille <demaille@gostai.com>
3759
3760 Useless parens.
3761 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
3762
2141aded
AD
37632008-11-04 Akim Demaille <demaille@gostai.com>
3764
3765 Issue missing synclines after user actions.
3766 * data/c.m4 (b4_case): Issue synclines on the output file.
3767
e426d17b
AD
37682008-11-04 Akim Demaille <demaille@gostai.com>
3769
3770 Remove trailing empty line.
3771 * data/lalr1-fusion.cc: Don't add an empty line after the user's
3772 epilogue.
3773
a9ce3f54
AD
37742008-11-04 Akim Demaille <demaille@gostai.com>
3775
3776 Fix output of copyright years.
3777 * data/bison.m4 (b4_copyright): Fix the indentation of the
3778 copyright year paragraph.
3779 Use b4_copyright_years when no years are given.
3780 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
3781 (b4_copyright_years): New.
3782 Use it.
3783
59c544c2
AD
37842008-11-04 Akim Demaille <demaille@gostai.com>
3785
3786 Avoid the spurious initial empty line.
3787 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
3788 the end of @output request to suppress the empty line that
3789 results.
3790
96b15448
AD
37912008-11-04 Akim Demaille <demaille@gostai.com>
3792
3793 Remove parser::rhs_number_type.
3794 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
3795 (yyrhs_): Use b4_table_define.
3796
f0633174
AD
37972008-11-04 Akim Demaille <demaille@gostai.com>
3798
3799 Fix iteration type.
3800 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
3801
417b8004
AD
38022008-11-04 Akim Demaille <demaille@gostai.com>
3803
3804 Factor the declaration of the integer tables.
3805 * data/lalr1-fusion.cc (b4_table_define): New.
3806 Use it.
3807
1a5246c6
AD
38082008-11-03 Akim Demaille <demaille@gostai.com>
3809
3810 Fix indentation of tables in lalr1.cc
3811 * data/lalr1-fusion.cc: Fix the indentation.
3812
f8a95c9c
AD
38132008-11-03 Akim Demaille <demaille@gostai.com>
3814
3815 Destroy the lhs symbols after reduction.
3816 * data/lalr1-fusion.cc (parse): After the user action, when in
3817 variant mode, destroy the lhs symbols.
3818
d7f4d823
AD
38192008-11-03 Akim Demaille <demaille@gostai.com>
3820
3821 Simplify yysyntax_error_ use.
3822 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
3823 type, but make it unnamed in the declaration when it is not used.
3824
8b9c89fb
AD
38252008-11-03 Akim Demaille <demaille@gostai.com>
3826
3827 Let yy::variant::build return an lvalue.
3828 * data/lalr1-fusion.cc (variant::build): Return a reference to the
3829 object.
3830
83243c24
AD
38312008-11-03 Akim Demaille <demaille@gostai.com>
3832
3833 Define yy::variant only when needed.
3834 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
3835 used.
3836
429b4848
AD
38372008-11-03 Akim Demaille <demaille@gostai.com>
3838
3839 Bench the three-stack lalr1.cc.
3840 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
3841 one-stack one.
3842
414c76a4
AD
38432008-11-03 Akim Demaille <demaille@gostai.com>
3844
3845 Fail on parse error in calc++.
3846 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
3847 status.
3848 * examples/calc++/test ($me, $number, $exit, run): New.
3849 Use them to propagate errors to the exit status.
3850
8a5783fd
AD
38512008-11-03 Akim Demaille <demaille@gostai.com>
3852
3853 Don't specify the skeleton twice in the example.
3854 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
3855 file does what is needed.
3856
0cc5bead
AD
38572008-11-03 Akim Demaille <demaille@gostai.com>
3858
3859 bench: Improve output.
3860 * etc/bench.pl.in (bench_grammar): Tune the printf format.
3861
5b421a4e
AD
38622008-11-03 Akim Demaille <demaille@gostai.com>
3863
3864 bench: check impact of %debug on variants.
3865 * etc/bench.pl.in (variant_grammar): Fix the computation of
3866 $variant.
3867 Generate a grammar file that can work with or without %debug.
3868 Do use the @directive.
3869 (bench_variant_parser): Check impact of %debug.
3870 (@directives): Rename all the occurrences to...
3871 (@directive): this, for consistency.
3872
d11ee647
AD
38732008-11-03 Akim Demaille <demaille@gostai.com>
3874
3875 bench: report the size too.
3876 * etc/bench.pl.in ($iterations): Defaults to -3.
3877 (&bench_grammar): Require hireswallclock.
3878 Compute and display the size of the result.
3879 More comments.
3880
e1b74b92
AD
38812008-11-03 Akim Demaille <demaille@gostai.com>
3882
3883 bench: More use of the verbosity level.
3884 * etc/bench.pl.in ($verbose, &verbose): New.
3885 Use them.
3886 More POD documentation.
3887
7e5f9c54
AD
38882008-11-03 Akim Demaille <demaille@gostai.com>
3889
3890 bench.pl: a command line interface
3891 * etc/bench.pl.in: More doc.
3892 Some fixes in the documentation.
3893 ($cflags, $iterations, &help, &getopt): New.
3894 Use them.
3895 (&variant_grammar): Let the number of stages be 10 times what is
3896 specified.
3897
7109a18d
AD
38982008-11-03 Akim Demaille <demaille@gostai.com>
3899
3900 Bench the use of Boost.Variants.
3901 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
3902 New.
3903 (&compile): Be ready to compile C++ parsers.
3904 (&bench_push_parser): Move debug information to the outermost
3905 level.
3906 * THANKS: Add Michiel De Wilde.
3907
922730fe
AD
39082008-11-03 Akim Demaille <demaille@gostai.com>
3909
3910 bench.pl: Pass directives as a list instead of as a string.
3911 * etc/bench.pl.in (&directives): New.
3912 (&triangular_grammar, &calc_grammar): Use it to format the Bison
3913 directives.
3914 (&triangular_grammar): Do use the directives (were ignored).
3915 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
3916 directives.
3917
7484f1d4
AD
39182008-11-03 Akim Demaille <demaille@gostai.com>
3919
3920 Improve genericity of bench.pl.
3921 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
3922 argument.
3923 (&bench_push_parser): New.
3924 Call it.
3925
15129f25
AD
39262008-11-03 Akim Demaille <demaille@gostai.com>
3927
3928 Add documentation to bench.pl.
3929 * etc/bench.pl.in: Comment changes.
3930
0e0ed236
AD
39312008-11-03 Akim Demaille <demaille@gostai.com>
3932
3933 Fuse the three stacks into a single one.
de62edee 3934
b06df3c2
AD
3935 In order to make it easy to perform benchmarks to ensure that
3936 there are no performance loss, lalr1.cc is forked into
3937 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
3938 lalr1.cc.
3939
3940 Meanwhile, to make sure that lalr1-fusion.cc is correctly
3941 exercized by the test suite, the user must install a symbolic link
3942 from lalr1.cc to it.
de62edee 3943
b06df3c2
AD
3944 Instead of having three stacks (state, value, location), use a
3945 stack of triples. This considerably simplifies the code (and it
3946 will be easier not to require locations as currently does the C++
3947 parser), and also gives a 10% speedup according to
3948 etc/bench (probably mainly since memory allocation is done once
3949 instead of three times).
de62edee 3950
0e0ed236
AD
3951 Another motivation is to make it easier to destruct properly
3952 semantic values: now that they are bound to their state (hence
3953 symbol type) it will be easier to call the appropriate destructor.
de62edee 3954
0e0ed236 3955 These changes should probably benefit the C parser too.
de62edee 3956
b06df3c2
AD
3957 * data/lalr1.cc: Copy as...
3958 * data/lalr1-fusion.cc: this new file.
0e0ed236
AD
3959 (b4_rhs_value, b4_rhs_location): New definitions overriding those
3960 from c++.m4.
3961 (state_stack_type, semantic_stack_type, location_stack_type)
3962 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
3963 (data_type, stack_type, yystack_): New.
3964 (YYLLOC_DEFAULT, yypush_): Adjust.
3965 (yyerror_range): Now based on data_type, not location_type.
3966
7dedf26e
AD
39672008-11-03 Akim Demaille <demaille@gostai.com>
3968
3969 Push the state, value, and location at the same time.
3970 This is needed to prepare a forthcoming patch that fuses the three
3971 stacks into one.
de62edee 3972
7dedf26e
AD
3973 * data/lalr1.cc (parser::yypush_): New.
3974 (parser::yynewstate): Change the semantics: instead of arriving to
3975 this label when value and location have been pushed, but yystate
3976 is to be pushed on the state stack, now the three of them must
3977 have been pushed before. yystate still must be the new state.
3978 This allows to use yypush_ everywhere instead of individual
3979 handling of the stacks.
3980
c4585f1e
AD
39812008-11-03 Akim Demaille <demaille@gostai.com>
3982
3983 Prefer references to pointers.
3984 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
3985 definition to use references instead of pointers.
3986 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
3987 Take the value and location as references.
3988 Adjust callers.
3989
56017c17
AD
39902008-11-03 Akim Demaille <demaille@gostai.com>
3991
3992 stack::size instead of stack::height.
3993 * data/lalr1.cc (stack::height): Rename as...
3994 (stack::size): this.
3995 Fix the output type.
3996 Comment changes.
3997
5ab8c47b
AD
39982008-11-03 Akim Demaille <demaille@gostai.com>
3999
4000 Use variants to support objects as semantic values.
b06df3c2
AD
4001 This patch was inspired by work by Michiel De Wilde. But he used
4002 Boost variants which (i) requires Boost on the user side, (ii) is
4003 slow, and (iii) has useless overhead (the parser knows the type of
4004 the semantic value there is no reason to duplicate this
4005 information as Boost.Variants do).
4006
4007 This implementation reserves a buffer large enough to store the
4008 largest objects. yy::variant implements this buffer. It was
4009 implemented with Quentin Hocquet.
de62edee 4010
5ab8c47b
AD
4011 * src/output.c (type_names_output): New.
4012 (output_skeleton): Invoke it.
4013 * data/c++.m4 (b4_variant_if): New.
4014 (b4_symbol_value): If needed, provide a definition for variants.
4015 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
4016 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
4017 (b4_char_sizeof, yy::variant): New.
4018 (parser::parse): If variants are requested, define
4019 parser::union_type, parser::variant, change the definition of
4020 semantic_type, construct $$ before running the user action instead
4021 of performing a default $$ = $1.
4022 * examples/variant.yy: New.
4023 Based on an example by Michiel De Wilde.
4024
1fa5d8bb
AD
40252008-11-03 Akim Demaille <demaille@gostai.com>
4026
4027 Parameterize the extraction of semantic values.
4028 To make future changes easier, no longer rely on ".TYPE" being the
4029 way to get a semantic value.
de62edee 4030
1fa5d8bb
AD
4031 * data/c.m4 (b4_symbol_value): New.
4032 Use it.
4033 * data/c++.m4, data/yacc.c: Use it.
4034 * data/glr.c: Use b4_symbol_value.
4035 (b4_rhs_data): New.
4036 Use it.
4037
91ba8a55
AD
40382008-11-03 Akim Demaille <demaille@gostai.com>
4039
4040 Prepare easier M4 changes.
4041 * data/lalr1.cc: Use escaped [] instead of literals to prepare
4042 future changes.
4043
c9ba9e59
JD
40442008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4045
4046 Initiate further development.
4047 * NEWS: Create an empty section for new entries.
4048 * gnulib: Update submodule to HEAD.
4049
bfb40910
JD
40502008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4051
4052 * NEWS: Version 2.4.
4053
241fda7a
JD
40542008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4055
4056 Prepare for next release.
4057 * NEWS: Briefly mention changes since 2.3b.
4058 * README: Say GNU m4 1.4.6, which we've been requiring in release
4059 announcements already, not 1.4.3, which breaks the build.
4060
ed4d67dc
JD
40612008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4062
4063 Say %language is experimental.
4064 We're thinking of extending it's effect on output file naming. See the
4065 thread at
4066 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
4067 * NEWS: Say it's experimental.
4068 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
4069 recommend it over %skeleton for now.
4070 (Bison Options): Likewise.
4071 (C++ Bison Interface): Use %skeleton not %language.
4072 (Calc++ Parser): Use %skeleton not %language.
4073 * src/getargs.c (usage): Say it's experimental.
4074
e254a580
DJ
40752008-11-01 Di-an Jan <dianj@freeshell.org>
4076 Paolo Bonzini <bonzini@gnu.org>
4077
4078 Support all Java parser class modifiers.
4079 * data/java.m4 (b4_percent_define_get3): New.
4080 (b4_final_if, b4_strictfp_if): New.
4081 * data/lalr1.java (final, strictfp, extends, implements): Support.
4082 * doc/bison.texinfo (final, strictfp, extends, implements): Add
4083 documentation.
4084 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
4085 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
4086 (AT_CHECK_JAVA_GREP): New.
4087 (Java parser class modifiers): New test.
4088 (Java parser class extends and implements): New test.
4089
4090 Model exception propagation better with throws and lex_throws.
4091 * data/java.m4 (b4_list2): New.
4092 (throws): Change default.
4093 * data/lalr1.java (yyaction): Add throws.
4094 (parse): Add lex_throws in addition to throws.
4095 * doc/bison.texinfo (throws, lex_throws): Add documentation.
4096 * tests/java.at (Java throws specifications): New test.
4097
4098 Improve documentation for Java parsers.
4099 * doc/bison.texinfo (Java Parsers): Add subsections.
4100 Don't quote first argument of %define.
4101 (Java Bison Interface): Document output files. Move documentation
4102 of parser class and merge into Java Parser Interface. Document
4103 features that error out. Document directives with no effect.
4104 Move note about Javadoc higher.
4105 (Java Semantic Values): Explicitly mention stype.
4106 Document that generic types cannot be used.
4107 (Java Location Values): Use @deftypeivar. Document constructors.
4108 Correct return value for toString.
4109 (Java Parser Interface): List undocumented constants/fields.
4110 Move documentation of fields added by %parse-param closer to list
4111 of members. Document that token names are added as fields.
4112 Document constructors accurately. Remove error method.
4113 (Java Scanner Interface): Move note on %pure-parser to Java Bison
4114 Interface. Describe %code lexer and yylex accutately.
4115 Remove documentation that does not match the code.
4116 (Java Action Features): New.
4117 (Java Differences): Add reference. Add item on semantic values.
4118 Add note about @{ ... @}. Clarify %% epilogue placement.
4119 (Java Declarations Summary): New.
4120
4121 Fix Java skeleton.
4122 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
4123 (b4_remove_comma): Quote test argument.
4124 (b4_identification): Remove "bison" field.
4125 * tests/java.at (Java parser class and package names): New test.
4126 (Java %parse-param and %lex-param): New test.
4127 (Java stype, position_class and location_class): New test.
4128
f259e4e6
PB
41292008-10-31 Di-an Jan <dianj@freeshell.org>
4130
4131 * data/lalr1.jave: Update copyright years.
4132 (YYParser): Correct name of "generated from" file in Javadoc:
4133 use b4_file_name instead of @ofile@.
4134 (Location constructor): Correct Javadoc parameter name.
4135 (yylloc): Add missing opening m4 quote after b4_location_if.
4136 This removes a stray [ in the Javadoc of Lexer.getStartPos.
4137 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
4138 (YYParser constructor): Correct Javadoc parameter name.
4139
cae5057f
JD
41402008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
4141
4142 Always put auxiliary code files in the same dir as other output files.
4143 * src/files.c (compute_file_name_parts): When the user specifies
4144 --output but not --file-prefix, extract the directory prefix from the
4145 file prefix not from the grammar file name. This affects the location
4146 of files like location.hh generated by the C++ skeleton. The includes
4147 in the other output files require this fix.
4148 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
4149 for expected output files.
4150 (Output files): Add a test for the above.
4151
4af432ba
JD
41522008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
4153
4154 * gnulib: Update submodule to HEAD.
4155
e26d4e43
JD
41562008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4157
4158 Update copyright year.
4159 * src/files.c: Here.
4160
c0ee9e21
DJ
41612008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
4162
4163 Don't overwrite the input file.
4164 * src/files.c (output_file_name_check): Fatal error if using input file
4165 for output.
4166 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
4167 argument.
4168 (Conflicting output files): Add test.
4169
482dc52f
AD
41702008-10-28 Akim Demaille <demaille@gostai.com>
4171
4172 Space changes.
4173 * data/lalr1.cc: Formatting changes.
4174
52cbbe84
AD
41752008-10-28 Akim Demaille <demaille@gostai.com>
4176
4177 Don't define debugging functions when !YYDEBUG.
4178 * data/lalr1.cc (debug_stream, set_debug_stream)
4179 (debug_level_type, debug_level, set_debug_level): Don't
4180 declare them when YYDEBUG is not defined.
4181 The implementation are already YYDEBUG-aware.
4182
0925d5bf
AD
41832008-10-28 Akim Demaille <demaille@gostai.com>
4184
4185 Prefer "continue" for empty loop bodies.
4186 * etc/bench.pl.in: Use "continue" instead of {}.
4187
cf98343c
AD
41882008-10-28 Akim Demaille <demaille@gostai.com>
4189
4190 Space and comments changes.
4191 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
4192 * data/c.m4, data/lalr1.cc: Space changes.
4193
9f467b7d
AD
41942008-10-28 Akim Demaille <demaille@gostai.com>
4195
4196 Make gnulib a submodule.
4197 * gnulib: New.
4198 * .gitmodules (gnulib): New.
4199
0f0e1ace
JD
42002008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4201
4202 Fix yyerror_range for user-defined location type in C++. Reported by
4203 Georg Sauthoff at
4204 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
4205 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
4206 * THANKS (Georg Sauthoff): Add.
4207
548e2104
JD
42082008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4209
4210 Update several administrative files mainly to facilitate releasing.
4211 * HACKING (Administrivia): Make the git-merge-changelog notes more
4212 helpful.
4213 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
4214 (Release Procedure): Update for git and add numerous details that were
4215 previously missing.
4216 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
4217 * maint.mk (announcement): Don't list bison as a bootstrap tool so
4218 that announcements don't claim we bootstrapped with whatever bison
4219 happened to be in PATH. Add flex as a bootstrap tool.
4220 * Makefile.maint: Remove, previously replaced by maint.mk.
4221 * Makefile.cfg: Remove, and migrate settings to...
4222 * cfg.mk: ... here for the sake of `make announcement'.
4223 * bootstrap.conf (gnulib_modules): Add announce-gen.
4224 * README: Say GNU Bison instead of just Bison. Suggested by Karl
4225 Berry.
4226
ddf17a6e
PB
42272008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
4228
4229 Small but important bugfixes for the Java skeleton.
4230 * data/lalr1.java (yyerror): Change Location to b4_location_type.
4231 (yy_symbol_print): Call toString on yyvaluep.
4232
e1145ad8
AD
42332008-08-29 Akim Demaille <demaille@gostai.com>
4234
4235 Clarify UPDATED use.
215b40ac 4236 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 4237 not to the release date of Bison.
215b40ac 4238 Reported by Joel E. Denny.
e1145ad8 4239
0df72d78
AD
42402008-08-29 Akim Demaille <demaille@gostai.com>
4241
4242 * README: Update FAQ pointer.
4243 Reported by Joel E. Denny.
4244
9a90b6bb
EB
42452008-08-27 Eric Blake <ebb9@byu.net>
4246
4247 Resync m4sugar from autoconf.
4248 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
4249 (m4_init): Adjust to latest m4.git changes.
4250 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
4251 effects.
4252 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
4253 (_m4_list_cmp): Reduce side effects.
4254
65015668
AD
42552008-08-27 Akim Demaille <demaille@gostai.com>
4256
4257 Check yyerrok in calc.at.
215b40ac
EB
4258 * tests/calc.at (calc.y): Use yyerrok on "( error )".
4259 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
4260 expected.
65015668 4261
98e26a92
AD
42622008-08-27 Akim Demaille <demaille@gostai.com>
4263
4264 Support yyerrok in lalr1.cc.
4265 YYBACKUP is still to import back into lalr1.cc.
215b40ac 4266 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 4267
86c0e784
JD
42682008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4269
4270 For maintainer-check*, don't recompile for a $(VERSION) update.
4271 * cfg.mk: New file.
4272 (_is-dist-target): Override the one in GNUmakefile.
4273 * Makefile.am (EXTRA_DIST): Add cfg.mk.
4274
88511166
JD
42752008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4276
4277 Update for recent change to gnulib.
4278 * src/parse-gram.y: Don't include strverscmp.h. It comes from
4279 string.h now.
4280
6bbb2ed5
EB
42812008-08-15 Eric Blake <ebb9@byu.net>
4282
d67c52e8
EB
4283 Remaining m4sugar merge from autoconf.
4284 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
4285 * data/m4sugar/foreach.m4: New file, copied from autoconf.
4286 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
4287 * src/output.c (output_skeleton): Tell m4 how to find it.
4288
6bbb2ed5
EB
4289 Partial m4sugar merge from autoconf: m4_map.
4290 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
4291 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
4292 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
4293 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
4294 for empty list.
4295 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
4296 Likewise.
4297 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
4298 declares it.
4299
8dce3875
JD
43002008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
4301
4302 Keep .version and PACKAGE_VERSION in sync.
4303 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
4304 dependency, and add comments justifying this in more detail. Discussed
4305 starting at
4306 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
4307
882a1fbf
EB
43082008-08-06 Eric Blake <ebb9@byu.net>
4309
a3764451
EB
4310 Partial m4sugar merge from autoconf: m4_shiftn.
4311 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
4312 (m4_shift2, m4_shift3): New macros.
4313 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
4314 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
4315 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
4316 * data/java.m4 (b4_remove_comma): Likewise.
4317
882a1fbf
EB
4318 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
4319 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
4320 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
4321 (m4_init): Consolidate wrapped text into single m4_wrap.
4322 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
4323 in wrapped text.
4324
a30e920d
EB
43252008-08-05 Eric Blake <ebb9@byu.net>
4326
dfcc5959
EB
4327 Partial m4sugar merge from autoconf: builtins, version.m4.
4328 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
4329 (m4_prepend): Remove, as it is unused and inherently quadratic,
4330 whereas m4_append is linear in newer m4.
4331 (m4_mkstemp): New builtin.
4332 (m4_symbols): Make rename conditional.
4333 (m4_version_prereq): Ensure fatal error if used in bison, which
4334 intentionally lacks version.m4.
4335
a30e920d
EB
4336 Fix comments in m4sugar.
4337 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
4338
445b7470
JD
43392008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
4340
4341 Update for recent .gitignore fix in Gnulib.
4342 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
4343 anchored .gitignore entries.
4344
a1e50014
JD
43452008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
4346
4347 Set gnu or gnits strictness.
4348 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
4349 development and gnits strictness for releases. Based on Eric Blake's
4350 suggestion at
4351 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
4352
d43f77e7
PB
43532008-07-31 Paolo Bonzini <bonzini@gnu.org>
4354
4355 * NEWS: Clarify documentation of %language.
4356
fee2ed87
PB
43572008-07-31 Paolo Bonzini <bonzini@gnu.org>
4358
4359 Support usage of git-merge-changelog.
4360 * .gitattributes: New.
4361 * HACKING: Document usage of git-merge-changelog.
4362 * bootstrap: Install git-merge-changelog entries in .git/config
4363 if appropriate.
4364
78029cd5
JD
43652008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4366
4367 Remove remaining dependence on CVS Id keyword.
4368 * ChangeLog: For the sake of people still using CVS, don't use dollars
4369 when mentioning Id.
4370 * data/xslt/bison.xsl: Remove Id from header comments, where it was
4371 unusual anyway.
4372 * data/xslt/xml2dot.xsl: Likewise.
4373 * data/xslt/xml2text.xsl: Likewise.
4374 * data/xslt/xml2xhtml.xsl: Likewise.
4375 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
4376 * doc/Makefile.am (neutralize): Remove, no longer needed.
4377 (.x.1): Don't use neutralize.
4378 (edit): Don't substitute for ID.
4379 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
4380
c53d18b1
JD
43812008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4382
4383 Fix dependence on computed configure variables.
4384 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
4385 $(top_srcdir)/configure.ac so that changes to computed variables, such
4386 as PACKAGE_VERSION, are seen.
4387 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
4388
5523ac79
JD
43892008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
4390
4391 Update copyright dates for recent changes.
4392 * Makefile.am: Here.
4393 * src/Makefile.am: Here.
4394 * src/reduce.c: Here.
4395 * tests/reduce.at: Here.
4396
8fa36911
JD
43972008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
4398
4399 Use git-version-gen for version names between releases.
4400 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
4401 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
4402 * .prev-version: New.
4403 * .version.in: Remove.
78029cd5 4404 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
4405 revision.
4406 * GNUmakefile: Remove, now copied from Gnulib.
4407 * Makefile.am: Add code suggested by comments in
4408 build-aux/git-version-gen.
4409 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
4410 .prev-version, and .version.
4411 * NEWS (2.3b+): Rename to...
4412 (?.?): ... this because we're dropping the "+" version naming scheme,
4413 but, in general, we still can't be sure of our next release name.
4414 * bootstrap: Add a quick hack to remove from .gitignore the
4415 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
4416 entry. This should really be fixed in gnulib instead.
4417 * bootstrap.conf (gnulib_modules): Add gnumakefile.
4418 * configure.ac (AC_INIT): Set version name by invoking
4419 build-aux/git-version-gen.
4420 (AC_CONFIG_FILES): Remove .version, now generated by
4421 build-aux/git-version-gen.
4422 * maint.mk: New, copied from coreutils.
4423 * doc/.cvsignore (bison.1): Add.
4424 * doc/.gitignore (/bison.1): Add.
4425 * doc/bison.1: Remove, generated.
4426 * src/.cvsignore (revision.c): Remove.
4427 * src/.gitignore (/revision.c): Remove.
4428 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
4429 (BUILT_SOURCES): Remove revision.c.
4430 (revision.c): Remove.
4431 * src/getargs.c (version): Don't print revision after the VERSION.
4432 * src/revision.h: Remove.
4433
bcf07cb7
JD
44342008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4435
4436 Fix untranslatable composition of sentences. Reported by Goran
4437 Uddeborg at
4438 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
4439 * THANKS (Goran Uddeborg): Add.
4440 * src/reduce.c (reduce_print): Report the number of nonterminals and
4441 rules useless in the grammar in separate sentences.
4442 * tests/reduce.at (Useless Rules): Update output.
4443 (Reduced Automaton): Likewise.
4444 (Underivable Rules): Likewise.
4445 (Empty Language): Likewise.
4446
9aacab9a
JD
44472008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4448
4449 Fix some .gitignore and .cvsignore problems.
4450 * bootstrap (insert_sorted_if_absent): Replace all uses with...
4451 (insert_vc_ignore): ... this new function, which prepends `/' to all
4452 .gitignore entries before passing them to insert_sorted_if_absent.
4453 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
4454 .cvsignore files are maintained even though Bison developers run
4455 bootstrap while using Git.
4456 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
4457 unneeded by Bison.
4458 (gnulib): Add.
4459 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
4460 unneeded. Reported by Eric Blake.
4461 * lib/.gitignore (/*~): Add.
4462 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
4463 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
4464 Blake.
4465 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
4466
a9fc7990
JD
44672008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4468
4469 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
4470 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
4471 * bootstrap.conf (gnulib_modules): Add unsetenv.
4472 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
4473 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
4474 (/setenv.m4): Add.
4475 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
4476 the first argument because it may become position-dependent, and unset
4477 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
4478 Add comments explaining these issues in more detail.
4479
0f1d6f10
JD
44802008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
4481
4482 Add .gitignore everywhere based on .cvsignore.
4483 * .gitignore: New.
4484 * build-aux/.gitignore: New.
4485 * data/.gitignore: New.
4486 * doc/.gitignore: New.
4487 * etc/.gitignore: New.
4488 * examples/.gitignore: New.
4489 * examples/calc++/.gitignore: New.
4490 * lib/.gitignore: New.
4491 * m4/.gitignore: New.
4492 * po/.gitignore: New.
4493 * runtime-po/.gitignore: New.
4494 * src/.gitignore: New.
4495 * tests/.gitignore: New.
4496
7bd1665a
JD
44972008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4498
4499 * NEWS (2.3b+): New section, empty for now.
4500 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
4501
72c5b982
JD
45022008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4503
4504 * NEWS (2.3b): Update release date since there has been a delay in
4505 getting the announcements and tarballs out.
4506
bd02cd5d
JD
45072008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
4508
4509 * NEWS: Version 2.3b.
4510 * configure.ac (AC_INIT): Likewise.
4511 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
4512
9126263e
JD
45132008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
4514
4515 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
4516 been doing it for years.
4517 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
4518 (Release Procedure): Add FIXME about make alpha being unmaintained.
4519
fa6aa7b3
JD
45202008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
4521
4522 * data/yacc.c: Reformat m4 a little for readability.
4523 * src/lalr.c (build_relations): Correct comment.
4524
d30b312d
JMG
45252008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4526
4527 DJGPP specific issue.
4528 * djgpp/config.sed: Fixes required to run configure scripts generated
4529 by autoconf 2.62.
4530
138d4cd9
JD
45312008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4532
4533 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
4534 coordinator@translationproject.org.
4535
8f7e2e1f
JD
45362008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4537
4538 * THANKS: Add Eric Blake.
4539
f55efa38
JD
45402008-04-23 Eric Blake <ebb9@byu.net>
4541
4542 Revert prior patch, by working around autoconf regression.
4543 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
4544 ("Output file name: ("): Uncomment test.
4545 ("Output file name: )"): Likewise.
4546 Based on an idea from Noah Misch.
4547
096c9f9d
JD
45482008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4549
4550 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
4551 2.61. Reported by Juan Manuel Guerrero at
4552 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
4553 * tests/output.at ("Output file name: ("): Comment out test case for
4554 now.
4555 ("Output file name: )"): Likewise.
4556
0f664b89
JD
45572008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4558
4559 * GNUmakefile: Update git-version-gen invocation so make dist
4560 succeeds.
4561
1cfe6375
JD
45622008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4563
4564 Update to the current gnulib CVS repository, and fix trigraph handling
4565 in Bison.
4566 * bootstrap: Update gnulib CVS repository URL.
4567 (symlink_to_dir): Encapsulate the code that guarantees the destination
4568 directory exists into...
4569 (check_dst_dir): ... this new function, and...
4570 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
4571 fail when copying files into lib/uniwidth/.
4572 * src/output.c (prepare_symbols): When writing yytname muscles, where
4573 symbol names will be encoded in C-string literals, tell quotearg to
4574 escape trigraphs. This used to be the default in gnulib.
4575 * tests/regression.at (Token definitions): Because of the change in
4576 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
4577 escapes trigraphs in symbol names. Thus, yytname no longer has
4578 trigraphs unnecessarily doubly escaped. Update test case output.
4579 Extend test case to be sure Bison's own error messages will no longer
4580 have trigraphs in symbol names unnecessarily escaped once.
4581
74c52fc8
JD
45822008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
4583
4584 Fix make dist infinite loop reported by Juan Manuel Guerrero at
4585 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
4586 * .cvsignore: Add .version.
4587 * .version.in: New.
4588 * bootstrap.conf (gnulib_modules): Add git-version-gen.
4589 * configure.ac (AC_CONFIG_FILES): Add .version.
4590 * build-aux/.cvsignore: Add git-version-gen.
4591
8e55b3aa
JD
45922008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4593
4594 * NEWS (2.3a+): Mention that -g now takes an argument.
4595 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
4596 consistency. Update the -g and -x entries now that they take
4597 arguments. Use brackets to indicate optional arguments.
4598 * src/getargs.c (usage): Explain the relationship between arguments of
4599 long and short options more completely. Document --defines and -d
4600 separately since the former takes an argument but, for POSIX Yacc, the
4601 latter does not.
4602 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 4603 (getargs): Sort cases.
8e55b3aa 4604
59c5ac72
AD
46052008-02-28 Akim Demaille <demaille@gostai.com>
4606
4607 * doc/bison.texinfo: Fix a few typos.
4608
118d4978
AD
46092008-02-28 Akim Demaille <akim@epita.fr>
4610
4611 * doc/bison.texinfo (Bison Options): Document -W.
4612 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
4613
7020f1e9
AD
46142008-02-28 Akim Demaille <akim@epita.fr>
4615
4616 * src/getargs.c (short_options): Split and sort for readability.
4617 -g and -x take optional arguments, just like their long options.
4618 * build-aux/cross-options.pl: Use /x to make the regexp easier to
4619 understand.
4620 Fix the handling of $opt which resulted in all the argument to be
4621 considered as optional.
4622
59da312b
JD
46232008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
4624
4625 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
4626 say its interface is experimental.
4627 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4628 Java.
4629 (Bison Options): In the -L and --language entry, mention Java.
4630 (Java Bison Interface): Say the interface is experimental.
4631 * src/getargs.c (usage): Mention -L and --language.
4632
4633 * NEWS (2.3a+): Say the push parsing interface is experimental.
4634 * doc/bison.texinfo (Push Decl): Likewise.
4635 (Decl Summary): Likewise in the "%define api.push_pull" entry.
4636 (Push Parser Function): Likewise.
4637 (Pull Parser Function): Likewise.
4638 (Parser Create Function): Likewise.
4639 (Parser Delete Function): Likewise.
4640 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
4641 yypull_parse, and yypush_parse entries.
4642
4643 * NEWS (2.3a+): Mention XML support, and say the schema is
4644 experimental.
4645 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
4646 * src/getargs.c (usage): Say the XML schema is experimental.
4647
4648 * NEWS (2.3a+): Say option instead of flag.
4649
2bb3ebec
WP
46502008-02-21 Wojciech Polak <polak@gnu.org>
4651
4652 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
4653 text.
4654
333e670c
JD
46552008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
4656
4657 Fix impure push parser compile error reported by Bob Rossi at
4658 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
4659 * data/yacc.c: Clean up whitespace in the output a little.
4660 (yypstate_allocated): Define for impure push parsers regardless of
4661 whether the pull interface is also requested.
4662 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
4663 check impure push parsers without the pull interface.
4664
4665 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
4666 yyerror takes arguments specified by %parse-param while yypstate_new
4667 does not.
4668 * doc/bison.texinfo (Parser Create Function): Document that
4669 yypstate_new returns 0 for multiple impure parser instances.
4670 * tests/push.at (Push Parsing: Multiple impure instances): Update
4671 expected stderr output.
4672
798096e1
JD
46732008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
4674
4675 * runtime-po/POTFILES.in (push.c): Remove.
4676
9ca7f077
JD
46772008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
4678
4679 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
4680 * data/push.c: Rename to...
4681 * data/yacc.c: ... this, overwriting it.
4682 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
4683 `%push-pull-parser' -> `%define api.push_pull "both"'.
4684 Remove old yacc.c tests, and update push.c tests to yacc.c.
4685
42ee26bb
JD
46862008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
4687
4688 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
4689 `"%code top" blocks' instead of `%code "top" blocks'.
4690 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
4691 Clean up whitespace in the output a little.
4692
b1cc23c4
JD
46932008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
4694
4695 Fix documentation problems reported by Tim Josling at
4696 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
4697 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
4698 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
4699 integers. Explain the effect of literal string aliases on error
4700 messages. Copy token 0 documentation from the C++ skeleton
4701 documentation.
4702
ab7f29f8
JD
47032008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
4704
4705 Accept a token number in a %left, %right, or %nonassoc for POSIX
4706 conformance. Reported by Tim Josling at
4707 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
4708 * NEWS (2.3a+): Mention.
4709 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
4710 and code numbers are treated by precedence declarations.
4711 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
4712 of symbols.1.
4713 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
4714 of symbol.
4715 (symbol.prec): New, just like symbol but allows INT.
4716 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
4717 longer holds.
4718 * tests/regression.at (Token number in precedence declaration): New
4719 test case.
4720
a924ef36
JMG
47212008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4722
4723 DJGPP specific issues.
4724 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
4725 be changed. Copyright timestamp adjusted.
4726 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
4727 be changed. Copyright timestamp adjusted.
4728 * djgpp/config.site: Copyright timestamp adjusted.
4729 * djgpp/config_h.sed: Copyright timestamp adjusted.
4730 * djgpp/djunpack.bat: Copyright timestamp adjusted.
4731 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
4732 filename translation list.
4733 * djgpp/subpipe.c (init_subpipe): Check the environment variables
4734 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
4735 files shall be created. Before trying to use the temp dir where the
4736 environment variable points to check that the dir really exists. If
4737 not default to the cwd as temp dir. Copyright timestamp adjusted.
4738 * djgpp/subpipe.h: Copyright timestamp adjusted.
4739 * djgpp/testsuite.sed: Copyright timestamp adjusted.
4740
389c8cfd
PE
47412008-01-30 Paul Eggert <eggert@cs.ucla.edu>
4742
4743 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
4744
5d1cfef4
PE
47452008-01-09 Paul Eggert <eggert@cs.ucla.edu>
4746
4747 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
4748 Problem reported by Claudio Saavedra in
4749 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
4750
e2dcf996
WP
47512008-01-05 Wojciech Polak <polak@gnu.org>
4752
4753 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
4754 document's title with the input grammar file name.
4755
da730230
JD
47562007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
4757
4758 Automate regression testing of the XML/XSLT implementation. Discussed
4759 starting at
4760 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
4761 * configure.ac (XSLTPROC): New substitution.
4762 * Makefile.am (maintainer-xml-check): New phony target invoking...
4763 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
4764 invoking make maintainer-check with BISON_TEST_XML=1.
4765 * tests/atlocal.in (XSLTPROC): New.
4766 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
4767 not to report reachable memory when Bison is expected to have a
4768 non-zero exit status and (2) to compare XML/XSLT output with --graph
4769 and --report=all output for every working grammar when
4770 BISON_TEST_XML=1.
4771 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
4772 (AT_BISON_CHECK_XML): New.
4773 (AT_QUELL_VALGRIND): New.
4774 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
4775 (AT_CHECK): ... don't redefine this since this was the old way to
4776 quell Valgrind.
4777 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
4778 AT_BISON_CHECK invocations.
4779 * tests/c++.at: Likewise.
4780 * tests/calc.at: Likewise.
4781 * tests/conflicts.at: Likewise.
4782 * tests/cxx-type.at: Likewise.
4783 * tests/existing.at: Likewise.
4784 * tests/glr-regression.at: Likewise.
4785 * tests/headers.at: Likewise.
4786 * tests/input.at: Likewise.
4787 * tests/java.at: Likewise.
4788 * tests/output.at: Likewise.
4789 * tests/push.at: Likewise.
4790 * tests/reduce.at: Likewise.
4791 * tests/regression.at: Likewise.
4792 * tests/sets.at: Likewise.
4793 * tests/skeletons.at: Likewise.
4794 * tests/synclines.at: Likewise.
4795 * tests/torture.at: Likewise.
4796 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
4797 tends to hang xsltproc.
4798 (Big horizontal): Likewise.
4799
408476bc
JD
48002007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
4801
4802 In XML output, remove redundant class attribute on symbol element.
4803 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
4804 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
4805 look up a symbol to determine whether it's a nonterminal or terminal.
4806 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
4807 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
4808
4809 Add prec/assoc information to XML output.
4810 * src/gram.c (grammar_rules_print_xml): For each rule that has a
4811 %prec, add a percent_prec attribute.
4812 * src/print-xml.c (print_grammar): For each terminal that has a
4813 precedence or associativity, add a prec or assoc attribute.
4814 (xml_indent): New.
4815 (xml_puts): Use xml_indent.
4816 (xml_printf): Use xml_indent.
4817 * src/print-xml.h (xml_indent): Prototype.
4818
4819 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
4820 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
4821
d4a26c48
JD
48222007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
4823
4824 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
4825 (bison:ruleByNumber): ... this for clarity.
4826 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
4827 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
4828 (xsl:template match="reduction"): Update.
4829 (xsl:template match="item"): Update.
4830 (xsl:template match="reduction"): Update.
4831
4832 In the XML output, don't print the list of rules where symbols appear.
4833 Compute it in XSLT instead. Discussed at
4834 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
4835 * data/xslt/bison.xsl (bison:ruleByLhs): New.
4836 (bison:ruleByRhs): New.
4837 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
4838 bison:ruleByRhs.
4839 (xsl:template match="terminal/rule"): Remove.
4840 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
4841 bison:ruleByRhs.
4842 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
4843 Remove.
4844 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
4845 bison:ruleByRhs and mode="number-link" for rule template.
4846 (xsl:template match="terminal/rule"): Remove.
4847 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
4848 bison:ruleByRhs and mode="number-link" for rule template.
4849 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
4850 Rewrite as...
4851 (xsl:template match="rule" mode="number-link"): ... this.
4852 * src/print-xml.c (print_grammar): Don't print the list of rules.
4853
ef1b4273
JD
48542007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4855
4856 Don't let --report affect XML output; always print all information.
4857 Discussed at
4858 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
4859 * src/conflicts.c (log_resolution): Implement.
4860 * src/print-xml.c (print_core): Implement.
4861 (print_state): Implement.
4862 (print_xml): Implement.
4863
4864 * NEWS (2.3a+): Fix quotes.
4865 * src/parse-gram.y (prologue_declaration): For consistency with -v,
4866 don't let %verbose clear the list specified by --report.
4867
0f6cd9e3
AD
48682007-11-26 Akim Demaille <akim@epita.fr>
4869
4870 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
4871
d80fb37a
JD
48722007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
4873
4874 In the XML output, list useless and unused symbols and rules with the
4875 useful ones and add a "usefulness" attribute. Discussed starting at
4876 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
4877 * src/gram.c (grammar_rules_partial_print_xml): Remove.
4878 (grammar_rules_print_xml): Print all rules instead of just those
4879 useful in the grammar, and add a "usefulness" attribute.
4880 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
4881 * src/print-xml.c (print_rules_useless_in_parser): Remove.
4882 (print_grammar): Print all nonterminals instead of just useful ones,
4883 and add a "usefulness" attribute to nonterminals and terminals.
4884 (print_xml): Don't print a separate "reductions" or
4885 "rules-useless-in-parser" element.
4886 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
4887 (reduce_xml): Remove.
4888 (reduce_token_unused_in_grammar): New.
4889 (reduce_nonterminal_useless_in_grammar): New.
4890 * src/reduce.h (reduce_xml): Remove prototype.
4891 (reduce_token_unused_in_grammar): Add prototype.
4892 (reduce_nonterminal_useless_in_grammar): Add prototype.
4893 * data/xslt/xml2text.xsl: Update for XML changes.
4894 * data/xslt/xml2xhtml.xsl: Update for XML changes.
4895 * tests/reduce.at (Useless Terminals): Update output.
4896 (Useless Rules): Update output.
4897 (Reduced Automaton): Update output.
4898
4899 Say "Terminals unused in grammar" instead of "Unused terminals".
4900 * NEWS (2.3a+): Update.
4901 * doc/bison.texinfo (Understanding): Update example output.
4902 * src/reduce.c (reduce_output): Implement.
4903 * data/xslt/xml2text.xsl: Implement.
4904 * data/xslt/xml2xhtml.xsl: Implement.
4905
1bb2bd75
JD
49062007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
4907
4908 Accept --report-file=FILE to override the default `.output' filename.
4909 * NEWS (2.3a+): Mention.
4910 * doc/bison.texinfo (Bison Options): Add an entry.
4911 * src/files.c (compute_output_file_names): Don't override
4912 spec_verbose_file if already set.
4913 * src/getargs.c (usage): Document --report-file.
4914 (REPORT_FILE_OPTION): New anonymous enum member.
4915 (long_options): Add entry for it.
4916 (getargs): Add case for it setting spec_verbose_file.
4917
4918 * build-aux/cross-options.pl: Don't record a short option just because
4919 there's an arg.
4920 * doc/.cvsignore: Add yacc.1.
4921
a005a9c4
AD
49222007-11-14 Akim Demaille <akim@epita.fr>
4923
4924 * doc/yacc.1.in: New.
4925 * configure.ac, doc/Makefile.am: Adjust.
4926 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
4927 config.h symbol.
4928 Use AC_SUBST for assignments too.
4929 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
4930
cff03fb2
JD
49312007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4932
4933 * src/gram.c: Remove comments that duplicate comments in gram.h.
4934
4935 When reporting useless rules and nonterminals, say "useless in grammar"
4936 instead of "useless", and say "useless in parser" instead of "never
4937 reduced". Discussed starting at
4938 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
4939 * NEWS (2.3a+): Mention this change.
4940 * data/xslt/xml2text.xsl: Update output text and expected input XML
4941 element names to match changes below.
4942 * data/xslt/xml2xhtml.xsl: Likewise.
4943 (xsl:template match="bison-xml-report"): Add missing entry in Table of
4944 Contents: "Rules useless in parser due to conflicts".
4945 * doc/bison.texinfo (Decl Summary): Reword a little.
4946 (Understanding): Update example output for changes below.
4947 * src/gram.c: (rule_useful_p): Rename to...
4948 (rule_useful_in_grammar_p): ... this.
4949 (rule_useless_p): Rename to...
4950 (rule_useless_in_grammar_p): ... this.
4951 (rule_never_reduced_p): Rename to...
4952 (rule_useless_in_parser_p): ... this.
4953 (grammar_rules_print): Update for renames.
4954 (grammar_rules_print_xml): Update for renames.
4955 (grammar_rules_never_reduced_report): Rename to...
4956 (grammar_rules_useless_report): ... this since it is used for either
4957 kind of useless rule.
4958 * src/gram.h: Reword comments and update function names in prototypes.
4959 * src/main.c (main): Say "rule useless in parser due to conflicts".
4960 * src/print-xml.c (print_rules_never_reduced): Rename to...
4961 (print_rules_useless_in_parser): ... this, and rename output XML
4962 element "rules-never-reduced" to "rules-useless-in-parser".
4963 (print_xml): Update for rename.
4964 * src/print.c (print_results): Say "Rules useless in parser due to
4965 conflicts".
4966 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
4967 (nonterminals_reduce): Say "nonterminal useless in grammar".
4968 (reduce_output): Say "Nonterminals useless in grammar".
4969 Say "Rules useless in grammar".
4970 (reduce_xml): Rename output XML element "useless" to
4971 "useless-in-grammar".
4972 (reduce_print): Don't report the count of grammatically useless rules
4973 as "rules never reduced" just because %yacc is specified.
4974 In the correct report of this count, say nonterminal(s) and rule(s)
4975 "useless in grammar".
4976 * tests/conflicts.at (S/R in initial): Update expected output.
4977 (Defaulted Conflicted Reduction): Likewise.
4978 (Unreachable States After Conflict Resolution): Likewise.
4979 * tests/existing.at (GNU pic Grammar): Likewise.
4980 * tests/reduce.at (Useless Nonterminals): Likewise.
4981 (Useless Rules): Likewise.
4982 (Reduced Automaton): Likewise.
4983 (Underivable Rules): Likewise.
4984 (Empty Language): Likewise.
4985
66f0441d
JD
49862007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4987
4988 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
4989 here document and before the EOF so that BSD's implementation of Bourne
4990 shell doesn't parse the delimiter as part of the here document.
4991 * doc/.cvsignore: Add cross-options.texi.
4992 * src/getargs.c (usage): Add a blank line after the warning categories.
4993
d0ee4105
PB
49942007-11-08 Paolo Bonzini <bonzini@gnu.org>
4995
4996 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
4997
e8b1fb9b
AD
49982007-11-05 Akim Demaille <akim@epita.fr>
4999
5000 Remove Id: from bison.1.
5001 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
5002 (perl -0777 -pi -e 's/\.PP\nId): New.
5003 (.x.1): Use it to ignore the version control revision.
5004
2f7a96b5
AD
50052007-11-05 Akim Demaille <demaille@gostai.com>
5006
5007 * build-aux/Makefile.am: Ship cross-options.pl.
5008 * doc/Makefile.am: Always refer to cross-options.texi with
5009 $(srcdir).
5010 (MAINTAINERCLEANFILES): Add it.
5011
f4101aa6
AD
50122007-11-04 Akim Demaille <demaille@gostai.com>
5013
5014 Generate the long/short option cross-table.
5015 * build-aux/cross-options.pl: New.
5016 * doc/Makefile.am (cross-options.texi): New.
5017 * doc/bison.texinfo: Use it.
5018
727a1401
AD
50192007-11-04 Akim Demaille <demaille@gostai.com>
5020
5021 Generate bison.1 using help2man.
5022 * doc/common.x, doc/bison.x: New.
5023 * doc/Makefile.am (bison.1, .x.1): New.
5024 The code is taken from autoconf-2.61/man/Makefile.am.
5025 * configure.ac: Look for help2man.
5026
6aeb9c57
AD
50272007-11-04 Akim Demaille <demaille@gostai.com>
5028
5029 Complete --help.
5030 * src/getargs.c (usage): Document -W, make it clear that -d,
5031 -g and -x have optional arguments.
5032
d7be4085
AD
50332007-11-04 Akim Demaille <demaille@gostai.com>
5034
5035 Find sha1sum when named gsha1sum.
5036 * bootstrap (find_tool): New.
5037 ($SHA1SUM): New.
5038
d9df47b6
JD
50392007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5040
5041 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
5042 at
5043 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
5044 * NEWS (2.3a+): Mention.
5045 * data/bison.m4 (b4_pure_if): Don't define it here.
5046 * data/c.m4 (b4_identification): Depend on individual skeletons to
5047 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
5048 values of the %define variables api.pure or api.push_pull. Define
5049 YYPURE, YYPUSH, and YYPULL accordingly.
5050 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
5051 glr.cc has already defined b4_pure_flag.
5052 * data/push.c: Define b4_pure_if based on `%define api.pure'.
5053 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 5054 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
5055 * doc/bison.texinfo (Pure Decl): Update.
5056 (Push Decl): Update.
5057 (Decl Summary): Add api.pure to %define entry.
5058 In %pure-parser entry, say it's deprecated and reference %define.
5059 (Pure Calling): Update.
5060 (Error Reporting): Update.
5061 (C++ Scanner Interface): Update.
5062 (How Can I Reset the Parser): Update.
5063 (Table of Symbols): In %pure-parser entry, say it's deprecated and
5064 reference %define.
5065 * src/getargs.c (pure_parser): Remove global variable.
5066 * src/getargs.h (pure_parser): Remove extern.
5067 * src/output.c (prepare): Don't define pure_flag muscle.
5068 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
5069 wrapper around `%define api.pure'.
5070 * tests/calc.at (Simple LALR Calculator): Update.
5071 (Simple GLR Calculator): Update.
5072 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
5073 Update.
5074 (GLR: Resolve ambiguity, pure, locations): Update.
5075 (GLR: Merge conflicting parses, pure, no locations): Update.
5076 (GLR: Merge conflicting parses, pure, locations): Update.
5077 * tests/glr-regression.at (Uninitialized location when reporting
5078 ambiguity): Update
5079 * tests/input.at (Unused %define api.pure): New test case.
5080 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
5081 AT_PURE_IF and AT_PURE_AND_LOC_IF.
5082 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5083
c373bf8b
JD
50842007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5085
5086 %define push_pull -> %define api.push_pull. Discussed starting at
5087 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
5088 * data/push.c: Expect the new name.
5089 * data/yacc.c: Likewise.
5090 * doc/bison.texinfo (Push Decl): Update.
5091 (Decl Summary): Update %define entry.
5092 (Push Parser Function): Update.
5093 (Pull Parser Function): Update.
5094 (Parser Create Function): Update.
5095 (Parser Delete Function): Update.
5096 * tests/calc.at (Simple LALR Calculator): Update.
5097 * tests/input.at (%define enum variables): Update.
5098 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5099 (Push Parsing: Multiple impure instances): Update.
5100 (Push Parsing: Unsupported Skeletons): Update.
5101 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
5102 (Exploding the Stack Size with Malloc): Update.
5103
5104 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
5105 other entries some.
5106
32f19b6b
JD
51072007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
5108
5109 For the XML output's terminal element, rename @number to @token-number,
5110 and add @symbol-number. In the nonterminal element, rename @number to
5111 @symbol-number. Discussed starting at
5112 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
5113 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
5114 renames.
5115 (xsl:template match="nonterminal"): Likewise.
5116 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
5117 (xsl:template match="nonterminal"): Likewise.
5118 * src/print-xml.c (print_grammar): Implement.
5119
255a6b90
JD
51202007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5121
5122 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
5123 2007-10-11 change, the child elements here are items not rules.
408476bc 5124 (xsl:template match="item"): New.
255a6b90
JD
5125 (xsl:template match="rule"): Update for new reduced itemset.
5126 (xsl:template match="point"): Remove.
5127 (xsl:template match="empty"): For consistency with --graph, don't
5128 output "/* empty */".
5129 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
5130 line-wrap, don't pass a negative value as first-line-length since this
5131 won't work with the following changes.
5132 (xsl:template name="line-wrap"): Simplify slightly.
5133 (xsl:template name="ws-search"): Eliminate recursion.
5134 * src/print_graph.c (print_core): Don't print a reduction's lookahead
5135 set next to an item whose dot is not at the end of the RHS even if it
5136 happens to be associated with the same rule.
5137
88c78747
JD
51382007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5139
31984206
JD
5140 Add %define lr.keep_unreachable_states.
5141 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
5142 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
5143 * src/main.c (main): Implement it.
5144 * tests/conflicts.at (Unreachable States After Conflict Resolution):
5145 Extend to test it, and fix a typo.
5146
51472007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5148
5149 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
5150 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
5151 the example .output text.
5152 * tests/regression.at (Extra lookahead sets in report): Improve wording
5153 of comments.
5154
b7a70162
WP
51552007-10-17 Wojciech Polak <polak@gnu.org>
5156
5157 * src/print-xml.c (print_grammar): Renamed
5158 <terminal> and <nonterminal> attributes:
5159 "type" to "number" and "symbol" to "name".
5160 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
5161 Use new attribute names.
5162 (xsl:template match="nonterminal"): Likewise.
5163 * data/xslt/xml2xhtml.xsl: Likewise.
5164
a0de5091
JD
51652007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
5166
5167 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
5168 (Option Cross Key): Likewise.
5169
5170 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
5171 next to an item whose dot is not at the end of the RHS even if it
5172 happens to be associated with the same rule.
5173 * src/print.c (print_core): Likewise.
5174 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
5175 (Resolved SR Conflicts): Update output.
5176 * tests/regression.at (Extra lookahead sets in report): New test case.
5177
4c20d18d
WP
51782007-10-11 Wojciech Polak <polak@gnu.org>
5179
5180 * src/print-xml.c (print_core): Remove item set
5181 redundancy.
5182 * data/xslt/bison.xsl (bison:ruleNumber): New key.
5183 Improve processing time. Suggested by Joel E. Denny.
5184 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
5185 Write xsl:param "required" attribute as comment.
5186 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
5187 (xsl:template match="rule"): Support new reduced itemset.
5188 (xsl:template match="point"): Remove.
5189 * data/xslt/xml2xhtml.xsl: Likewise.
5190
f506ad1c
JD
51912007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5192
5193 * src/getargs.c (version): Update copyright year.
5194
21f1b063
JD
51952007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5196
5197 Make xml2dot.xsl and --graph produce the same output.
5198 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
5199 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
5200 escaped later.
5201 (xsl:template name="output-node"): Use the new escape template instead
5202 of the string-replace template directly.
5203 (xsl:template name="output-edge"): Likewise.
5204 (xsl:template name="escape"): New, escapes backslashes and newlines in
5205 addition to quotation marks.
5206 * src/graphviz.c (start_graph, output_node, output_edge): Add
5207 whitespace to output for legibility.
5208
5209 Make xml2text.xsl and --report produce the same output, and remove the
5210 XML "conflicts" element since a conflict summary is easily extracted
5211 from the automaton.
5212 * data/xslt/bison.xsl: New.
5213 (xsl:template match="state" mode="bison:count-conflicts): New.
5214 * data/xslt/xml2text.xsl: Import bison.xsl.
5215 (xsl:template match="bison-xml-report"): Instead of styling the
5216 "conflicts" element, style the "automaton" element with mode
5217 "conflicts". Unlike the former, the latter lists S/R and R/R
5218 conflicts for a state on the same line.
5219 (xsl:template match="conflicts"): Remove.
5220 (xsl:template match="conflict"): Remove.
5221 (xsl:template match="terminal"): Line-wrap the list of rules in which
5222 the terminal is used.
5223 (xsl:template match="nonterminal"): Likewise for nonterminals.
5224 (xsl:template match="automaton" mode="conflicts"): New.
5225 (xsl:template match="state" mode="conflicts"): New.
5226 (xsl:template name="line-wrap"): New.
5227 (xsl:template name="ws-search"): New.
5228 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
5229 (xsl:template match="bison-xml-report"): Instead of styling the
5230 "conflicts" element, style the "automaton" element with mode
5231 "conflicts."
5232 (xsl:template match="conflicts"): Remove.
5233 (xsl:template match="conflict"): Remove.
5234 (xsl:template match="automaton" mode="conflicts"): New.
5235 (xsl:template match="state" mode="conflicts): New.
5236 * src/conflicts.c (conflicts_output_xml): Remove.
5237 * src/conflicts.h (conflicts_output_xml): Remove prototype.
5238 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
5239 * src/print.c (print_grammar): Consistently wrap at the 66th column so
5240 the corresponding XSLT is easier. Also, never wrap between a word and
5241 the comma that follows it.
5242
793fbca5
JD
52432007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5244
5245 Improve C++ namespace support. Discussed starting at
5246 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
5247 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
5248 b4_namespace_close): New macros that interpret the %define variable
5249 "namespace" so its value can contain "::" to indicate nested
5250 namespaces.
5251 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
5252 the above macros.
5253 * data/lalr1.cc (b4_namespace): Likewise.
5254 * data/location.cc (b4_namespace): Likewise.
5255 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
5256 inside a new table in the general %define entry. Document `%define
5257 namespace' there as well. Point the %name-prefix entry to it since it
5258 explains it more completely in the case of C++.
5259 (C++ Bison Interface): Mention `%define namespace' instead of
5260 %name-prefix.
5261 (Table of Symbols): Remove the `%define push_pull' entry. The %define
5262 entry suffices.
5263 * tests/c++.at (Relative namespace references): New test case.
5264 (Absolute namespace references): New test case.
5265 (Syntactically invalid namespace references): New test case.
5266 * tests/input.at (C++ namespace reference errors): New test case.
5267
35b8730d
JD
52682007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5269
5270 Add syncline support and location accessor to internal %define
5271 interfaces.
5272 * data/bison.m4 (b4_percent_define_get_loc): New.
5273 (b4_percent_define_get_syncline): New.
5274 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
5275 (b4_percent_define_default): Record defining location as line 1 rather
5276 than 0 for the sake of synchronizing #line's, and define
5277 b4_percent_define_syncline(VARIABLE).
5278 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
5279 * src/muscle_tab.c (muscle_syncline_grow): New.
5280 (muscle_code_grow): Use muscle_syncline_grow.
5281 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
5282 define b4_percent_define_syncline(VARIABLE).
5283 (muscle_percent_define_get_loc): New.
5284 (muscle_percent_define_get_syncline): New.
5285 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
5286 remove some unused variables.
5287 (muscle_percent_define_default): Record defining location as line 1
5288 rather than 0 for the sake of synchronizing #line's, and define
5289 b4_percent_define_syncline(VARIABLE).
5290 (muscle_percent_define_check_values): Use
5291 muscle_percent_define_get_loc.
5292 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
5293 (muscle_percent_define_get_syncline): Prototype.
5294 * tests/skeletons.at (%define Boolean variables: invalid skeleton
5295 defaults): Update output for location change.
5296 (Complaining during macro argument expansion): Extend to test
5297 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
5298
7dc4a694
JD
52992007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
5300
5301 Fix some error-reporting macro bugs.
5302 * data/bison.m4 (b4_cat): New.
5303 (b4_error, b4_error_at): Use b4_cat to send error directives directly
5304 to stdout so they don't become arguments to other macros. Update
5305 comments and add examples.
5306 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
5307 add examples.
5308 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
5309 after printing the error directive so that M4 doesn't report subsequent
5310 problems that are induced by this problem.
5311 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
5312 instead of just in them. Recognize @\n in both places. Both expand to
5313 the empty string. Needed by b4_cat.
5314 * tests/skeletons.at (Complaining during macro argument expansion):
5315 New test case.
5316 (Fatal errors make M4 exit immediately): New test case.
5317
d4bd2295
JD
53182007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
5319
5320 Implement --print-datadir.
5321 * src/getargs.c (usage): Mention.
5322 (PRINT_DATADIR_OPTION): New anonymous enum member.
5323 (long_options): Add entry for it.
5324 (getargs): Add case for it calling compute_pkgdatadir.
5325 * src/output.c (output_skeleton): Encapsulate data directory
5326 computation from here...
5327 (prepare): ... and from here...
5328 (compute_pkgdatadir): ... into this new function.
5329 * src/output.h (compute_pkgdatadir): Prototype.
5330
34cdeddf
JD
53312007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
5332
5333 * src/print-xml.c (escape_bufs): New static global variable
5334 replacing...
5335 (xml_escape_n): ... the static local variable buf here.
5336 (print_xml): Free memory for escape_bufs.
5337 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
5338
d782395d
JD
53392007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
5340
5341 Replace `%push-parser' and `%push-pull-parser' with
5342 `%define push_pull "push"' and `%define push_pull "both"'.
5343 `%define push_pull "pull"' is the default.
5344 * doc/bison.texinfo (Push Decl, Push Parser Function,
5345 Pull Parser Function, Parser Create Function, Parser Delete Function):
5346 Update declarations.
5347 (Decl Summary, Table of Symbols): Replace %push-parser and
5348 %push-pull-parser entries with a %define push_pull entry.
5349 * data/bison.m4 (b4_percent_define_check_values): New macro.
5350 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
5351 definitions...
5352 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
5353 definitions...
5354 * data/push.c: ... to here and compute them from the value of the
5355 %define variable push_pull.
5356 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
5357 parsing requests here...
5358 * data/yacc.c: ... hack this to switch to push.c any time
5359 b4_use_push_pull_flag or the %define variable push_pull is set. This
5360 will go away when we mv push.c yacc.c.
5361 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
5362 push parsing is not supported since unused %define variables are
5363 reported anyway.
5364 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
5365 * src/muscle_tab.h (muscle_percent_define_check_values): Update
5366 comments for consistency with b4_percent_define_check_values.
5367 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
5368 muscles.
5369 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
5370 Remove.
5371 (prologue_declaration): Remove %push-parser and %push-pull-parser
5372 rules.
5373 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
5374 * tests/calc.at: Update declarations.
5375 * tests/input.at (%define enum variables): New test case.
5376 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
5377 declaration.
5378 (Push Parsing: Multiple impure instances): Update declaration.
5379 (Push Parsing: Unsupported Skeletons): New test case.
5380 * tests/torture.at (Exploding the Stack Size with Alloca): Update
5381 declaration.
5382 (Exploding the Stack Size with Malloc): Update declaration.
5383
3f999f78
WP
53842007-09-24 Wojciech Polak <polak@gnu.org>
5385
5386 Add XSLT transformations.
5387
5388 * data/xslt/xml2dot.xsl: Transform XML into DOT.
5389 * data/xslt/xml2text.xsl: Transform XML into plain text.
5390 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
5391 * data/Makefile.am (xsltdir): New variable.
5392 (dist_xslt_DATA): Add xslt/*.xsl files.
5393
a4f75309
PE
53942007-09-23 Paul Eggert <eggert@cs.ucla.edu>
5395
5396 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
5397 Problem reported by Wojciech Polak.
5398 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
5399 (xml_printf): Undo change I made on 21 September; that is,
5400 indent 2 spaces, not 1.
5401
ad5feac4
JD
54022007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
5403
5404 Pacify ./configure --enable-gcc-warnings.
5405 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
5406 `char const *' instead of `char *'.
5407 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
5408 local variable `sep'.
5409
41d7a5f2
PE
54102007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5411
5412 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
5413 elsewhere.
5414 * src/print-xml.c: Prefer "const" after types; that's more consistent.
5415 (xml_printf): Indent just 1 space for level.
5416 (e_char, xlate_char): Remove.
5417 (xml_escape_string): Rewrite to avoid undefined behavior (used
5418 storage that was freed from the stack).
5419 (xml_escape_n): Don't bother checking for subscript error.
5420
3f999f78
WP
54212007-09-21 Wojciech Polak <polak@gnu.org>
5422
5423 Add Bison XML Automaton Report.
41d7a5f2
PE
5424
5425 Add support for an -x option to generate an XML report.
5426 It is not documented yet.
5427 * src/print-xml.c: New file.
5428 * src/print-xml.h: Likewise.
5429 * lib/timevar.def (TV_XML): New var.
5430 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
5431 * src/conflicts.c: Include print-xml.h.
5432 (solved_conflicts_xml_obstack): New var.
5433 (log_resolution, conflicts_solve, conflicts_free):
5434 Add support for XML report.
5435 (conflicts_output_val): New function.
5436 * src/conflicts.h (conflicts_output_val): New decl.
5437 * src/files.c (spec_xml_file): New var.
5438 (compute_output_file_names, output_file_names_free): Add XML support.
5439 * src/files.h (spec_xml_file): New decl.
5440 * src/getargs.c (xml_flag): New var.
5441 (usage, short_options, long_options, getargs): Add XML support.
5442 * src/getargs.h (xml_flag): New decl.
5443 * src/gram.c: Include print-xml.h.
5444 (rule_lhs_print_xml, rule_rhs_print_xml):
5445 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
5446 New functions.
5447 * src/gram.h: Declare external ones.
5448 * src/main.c: Include print-xml.h.
5449 (main): Add XML support.
5450 * src/reduce.c: Include print-xml.h.
5451 (reduce_xml): New function.
5452 * src/reduce.h: Declare it.
5453 * src/state.c: Include print-xml.h.
5454 (state_new): Add XML support.
5455 (state_rule_lookahead_tokens_print_xml): New function.
5456 * src/state.h: Declare it.
5457 (struct state): New member solved_conflicts_xml.
5458 * src/symtab.c (symbol_class_get_string): New function.
5459 * src/symtab.h: Declare it.
5460
6d8e724d
PE
54612007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5462
5463 * GNUmakefile: Switch to coreutils's version.
5464 * bootstrap: Likewise.
5465 * Makefile.cfg: Adjust to new GNUmakefile.
5466 * README-hacking: Likewise.
5467
5468 Import from gnulib:
5469
5470 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
5471 Bruno Haible <bruno@clisp.org>
5472
5473 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
5474 and is a script that invokes bison. Tighten the code. Add comments.
5475
922bdd7f
JD
54762007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
5477
5478 Spell "boolean" as "Boolean". Reported by Akim Demaille.
5479 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
5480 * doc/bison.texinfo (Decl Summary): Fix.
5481 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
5482 * tests/input.at (Boolean %define variables): Update output.
5483 * tests/skeletons.at (%define boolean variables: invalid skeleton
5484 defaults): Rename to...
5485 (%define Boolean variables: invalid skeleton defaults): ... this and
5486 update output.
5487
1b17b01d
JD
54882007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
5489
5490 In impure push mode, don't allow more than one yypstate to be allocated
5491 since multiple impure parsers would corrupt yynerrs.
5492 * data/push.c (yypstate_allocated): New static global variable
5493 initialized to 0.
5494 (yypull_parse): If yypstate_new returns 0, don't report it as memory
5495 exhaustion if yypstate_allocated is 1, but still return 2.
5496 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
5497 already 1. Otherwise, set it to 1.
5498 (yypstate_delete): Set it to 0.
5499 * tests/push.at (Push Parsing: Multiple impure instances): New test
5500 case.
5501
9987d1b3
JD
55022007-08-17 Bob Rossi <bob@brasko.net>
5503
5504 * doc/bison.texinfo (Push Decl): Document the push parser.
5505 (Table of Symbols): Ditto.
5506 (Pure Decl): Ditto.
5507 (Decl Summary): Ditto.
5508 (Multiple Parsers, Push Parser Function, Pull Parser Function,
5509 Parser Create Function, Parser Delete Function):
5510 Add new push parser symbols.
5511 (Table of Symbols): Document push-parser, push-pull-parser,
5512 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
5513
f16b0819
PE
55142007-08-15 Paul Eggert <eggert@cs.ucla.edu>
5515
5516 Update to GPLv3.
5517 * doc/gpl-3.0.texi: New file.
5518 * doc/gpl.texi: Remove.
5519 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
5520 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
5521 * README-hacking, TODO, bootstrap, bootstrap.conf:
5522 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
5523 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
5524 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
5525 * data/lalr1.cc, data/lalr1.java, data/location.cc:
5526 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
5527 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
5528 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
5529 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
5530 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
5531 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
5532 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
5533 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
5534 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
5535 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
5536 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
5537 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
5538 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
5539 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
5540 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
5541 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
5542 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
5543 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
5544 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
5545 * src/complain.c, src/complain.h, src/conflicts.c:
5546 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
5547 * src/files.h, src/flex-scanner.h, src/getargs.c:
5548 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
5549 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
5550 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
5551 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
5552 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
5553 * src/print.c, src/print.h, src/print_graph.c:
5554 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
5555 * src/reduce.h, src/relation.c, src/relation.h:
5556 * src/revision.h, src/scan-code.h, src/scan-code.l:
5557 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
5558 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
5559 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
5560 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
5561 * tests/Makefile.am, tests/actions.at, tests/c++.at:
5562 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
5563 * tests/existing.at, tests/glr-regression.at:
5564 * tests/headers.at, tests/input.at, tests/java.at:
5565 * tests/local.at, tests/output.at, tests/push.at:
5566 * tests/reduce.at, tests/regression.at, tests/sets.at:
5567 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
5568 * tests/torture.at:
5569 Update to GPLv3.
5570
728c4be2
JD
55712007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
5572
5573 Get rid of broken %no-parser, -n, and --no-parser implementation and
5574 documentation.
5575 * TODO: Don't mention them.
5576 * doc/bison.1: Likewise.
5577 * doc/bison.texinfo (Decl Summary): Likewise.
5578 (Bison Options): Likewise.
5579 (Option Cross Key): Likewise.
5580 * src/getargs.c (no_parser_flag): Remove global variable.
5581 (usage): Don't print description of -n and --no-parser.
5582 (long_options): Remove --no-parser entry here.
5583 (getargs): Remove -n case in the switch here.
5584 * src/getargs.h (no_parser_flag): Remove extern.
5585 * tests/regression.at (Web2c Actions): Remove comment that mentions
5586 --no-parser.
5587
5d31a216
JD
55882007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
5589
5590 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
5591 name user variables starting with `yy'. Just pass NULL instead of a
5592 dummy local &yylval to yypush_parse.
5593 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
5594 starting with `yy'.
5595
a2ea208d
JD
55962007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
5597
5598 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
5599 true since it's then always used regardless of whether yyoverflow is
5600 defined. Reported by Christian Burger at
5601 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
5602 * THANKS: Add Christian Burger.
5603
91661ebb
JD
5604 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
5605 node names: say "Decl Summary" not "Bison Declaration Summary".
5606
cbd50549
JD
56072007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
5608
5609 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
5610 determine whether this function has already complained about an invalid
5611 value for a %define boolean variable, don't check whether Bison has
5612 ever examined the value. As written, the check was a tautology.
5613 Instead, record and check for this complaint using a separate muscle.
5614
eb1b0740
JD
56152007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
5616
5617 Fix push parsing memory leak reported by Brandon Lucia at
5618 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
5619 * THANKS: Add Brandon Lucia.
5620 * data/push.c (yypstate_delete): Free the stack if it was reallocated
5621 but the parse never completed and thus freed it.
5622 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
5623 * tests/testsuite.at: Include push.at.
5624 * test/push.at: New.
5625 (Push Parsing: Memory Leak for Early Deletion): New test case.
5626
9d774aff
JD
56272007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
5628
5629 Improve handling of multiple S/R conflicts in the same state and of S/R
5630 conflicts involving multiple reductions.
5631 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
5632 set for a state here or Bison will abort if it is reassigned on a
5633 later conflicted reduction in the same state.
5634 Similarly, don't finalize and assign the solved conflicts report here
5635 or it will be lost if it is reassigned on a later conflicted reduction
5636 in the same state.
5637 (set_conflicts): Instead, assign them both here after all S/R conflicts
5638 in the state have been fully examined.
5639 * src/print.c (shift_set): Rename to...
5640 (no_reduce_set): ... this.
5641 (print_reductions): Update for rename, and add %nonassoc error action
5642 tokens to no_reduce_set so that, when printing the first remaining
5643 reduction on an error action token, the reduction is enclosed in
5644 brackets.
5645 (print_results): Update for rename.
5646 * tests/conflicts.at (Solved conflicts report for multiple reductions
5647 in a state): New test case.
5648 (%nonassoc error actions for multiple reductions in a state): New test
5649 case.
5650
5651 * src/main.c (main): Don't depend on C99 features.
5652
10159d2a
JD
56532007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
5654
5655 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
5656 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
5657 uniwidth.
10159d2a 5658
953b3935
JD
56592007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
5660
5661 * bootstrap (slurp): Create target directories that don't exist.
5662 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
5663
6ce2d93a
JD
56642007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5665
5666 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
5667 than item number.
5668 * closure.c (closure): Likewise.
5669 * state.h (reductions): Comment sorting of rules.
5670 (state): Comment sorting of items.
5671
ce3448d5
JD
56722007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
5673
5674 Fix C++ test cases after recent Gnulib changes. Discussed starting at
5675 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
5676 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
5677 definition in order to avoid Gnulib headers since we don't use config.h
5678 here.
5679 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
5680 rather than AT_DATA so that config.h is included.
5681
8a86eef0
JD
56822007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
5683
5684 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
5685 instead of fprintf. Guard these functions with #if YYDEBUG instead of
5686 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
5687 and so that YYFPRINTF is guaranteed to be defined here.
5688
b1a81613
JD
56892007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
5690
5691 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
5692 with...
5693 (muscle_percent_define_check_values): ... this more helpful function.
5694 Again, it's not used yet, but it will be.
5695 * src/muscle_tab.h: Likewise.
5696
71b61d4d
JD
5697 Improve some comments in parser table construction.
5698 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
5699 (generate_states): Don't mention ruleset, which is internal to closure.
5700 * src/closure.c (closure): Explain sorting of core and itemset, which
5701 is required for this function to behave correctly.
5702 * src/closure.h (closure): Mention sorting.
5703
2a6b783d
JD
57042007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
5705
5706 * src/lalr.c (state_lookahead_tokens_count): For code readability,
5707 move the check for disabled transitions to an aver since conflict
5708 resolution hasn't happened yet.
5709
5710 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
5711 labels a state as inconsistent just because it has error transitions.
5712 The original form of this check appeared in revision 1.1 of lalr.c,
5713 which was committed on 1991-12-21. Now (at least), changing the
5714 consistency label on such a state appears to have no useful effect in
5715 any of the places it is examined, which I enumerate below. The key
5716 point to understanding each item in this enumeration is that a state
5717 with an error transition is labelled consistent in the first place only
5718 if it has no rules, so the check cannot matter for states that have
5719 rules. (1) Labelling a state as inconsistent will cause set_conflicts
5720 to try to identify its conflicts, and a state must have *rules* to have
5721 conflicts. (2) Labelling a state as inconsistent will affect how
5722 action_row sets the default *rule* for the state. (3) Labelling a
5723 state as inconsistent will cause build_relations to add lookback edges
5724 to *rules* in that state.
5725 * src/state.h (struct state): Word the comment for member consistent
5726 more carefully.
5727
14462c2b
JD
57282007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5729
5730 Don't depend on C99 features.
5731 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
5732 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
5733 * src/reader.c (check_and_convert_grammar): Fix for-loop.
5734 * src/state.c (state_mark_reachable_states): Fix for-loop.
5735 (state_remove_unreachable_states): Fix for-loop.
5736
5737 Don't widen struct state with member reachable just to temporarily
5738 record reachability. Instead, use a local bitset.
5739 * src/state.h (struct state): Remove member.
5740 * src/state.c (state_new): Don't initialize it.
5741 (state_mark_reachable_states): Rename to...
5742 (state_record_reachable_states): ... this, and use bitset.
5743 (state_remove_unreachable_states): Use bitset.
5744
5a43d418
JD
57452007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
5746
5747 * src/Makefile.am (yacc): Quote target action commands properly so
5748 that the yacc script isn't corrupt. Reported by Hans Aberg at
5749 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
5750
0c650a20
JD
5751 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
5752 the case of pure parsers. Reported by Frans Englich at
5753 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
5754 * THANKS: Add Frans Englich.
5755
61fee93e
JD
5756 * NEWS (2.3a+): In the %code entry, reference section `Bison
5757 Declaration Summary' from the manual now since the %code summary has
5758 moved there.
5759 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
5760 in the rules section must be terminated by semicolons.
5761
f124d423
JD
57622007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
5763
5764 Extend the front-end API for %define variables to more completely
5765 mirror the back-end. This will be useful in the future.
5766 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
5767 Update comments to mention the new front-end counterparts of these
5768 macros.
5769 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
5770 for muscle_string_decode and muscle_location_decode.
5771 (muscle_string_decode): New static function.
5772 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
5773 (muscle_percent_define_get, muscle_percent_define_ifdef): New
5774 functions.
5775 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
5776 muscle_percent_define_get to mimic the b4_percent_define_flag_if
5777 implementation more closely.
5778 (muscle_percent_define_invalid_value): New function.
5779 * src/muscle_tab.h (muscle_percent_define_get,
5780 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
5781 Prototype.
5782
75ad86ee
JD
57832007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
5784
5785 * NEWS (2.3a+): Mention yesterday's state-removal change.
5786 (2.3a): Remove the %language entry, which was added after 2.3a.
5787 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
5788 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
5789 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
5790 tests/existing.at: Update copyright date.
5791
5967f0cf
JD
57922007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5793
5794 If conflict resolution makes states unreachable, remove those states,
5795 report rules that are then unused, and don't report conflicts in those
5796 states.
5797 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
5798 New global function.
5799 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
5800 function.
5801 * src/main.c (main): After conflict resolution, remove the unreachable
5802 states and update all data structures that reference states by number.
5803 * src/state.c (state_new): Initialize each state's reachable member to
5804 false.
5805 (state_mark_reachable_states): New static function.
5806 (state_remove_unreachable_states): New global function.
5807 * src/state.h (struct state): Add member bool reachable.
5808 (state_remove_unreachable_states): Prototype.
5809 * tests/conflicts.at (Unreachable States After Conflict Resolution):
5810 New test case.
5811 * tests/existing.at (GNU pic Grammar): Update test case output now that
5812 an unused rule is discovered.
5813
b09f4f48
JD
58142007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5815
5816 Minor code cleanup in parser table construction.
5817 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
5818 (new_itemsets, save_reductions): Update for rename to nitemset.
5819 * src/closure.c (nritemset): Rename to...
5820 (nitemset): ... this since the "r" appears to meaningless and isn't
5821 used in the comments.
5822 (closure): Update for rename.
5823 * src/closure.h (nritemset): Update extern to...
5824 (nitemset): ... this.
5825 * src/lalr.c (LA): Fix a typo in comments.
5826 * src/print.c (print_core): Update for rename to nitemset.
5827 * src/print_graph.c (print_graph): Likewise.
5828 * src/state.h: Fix some typos in header comments.
5829
bbb44d83
PE
58302007-04-04 Paul Eggert <eggert@cs.ucla.edu>
5831
9b33de72
PE
5832 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
5833 still sticks to ASCII. Sorry!
5834
bbb44d83
PE
5835 * README-hacking: New file, taken mostly from coreutils, with changes
5836 for Bison. Contains much of the contents of:
5837 * README-cvs: Remove.
5838 * bootstrap: Sync from gnulib.
5839 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
5840 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
5841
29553547
JD
58422007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
5843
5844 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
5845 Setzer.
5846 (Java Differences): Fix some typos.
5847 * THANKS: Add Sebastian Setzer.
5848
01b477c6
PB
58492007-03-07 Paolo Bonzini <bonzini@gnu.org>
5850
730739e4
AD
5851 * data/java.m4 (b4_single_class_if): Remove.
5852 (b4_abstract_if): Look at "%define abstract".
5853 (b4_lexer_if): New.
5854 (b4_union_name): Rename...
5855 (b4_yystype): ... to this. Map to "%define stype".
5856 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
5857 b4_maybe_throws): Fix quoting.
5858 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
5859 * data/lalr1.java (Lexer interface): Always define.
5860 (Lexer interface within parser class): Remove.
5861 (YYLexer class): New, used when "%code lexer" is present.
5862 (constructor): When "%code lexer" is used, pass %lex-param
5863 to the lexer constructor.
5864 (yylex, yyparse): Remove %lex-param from method invocations
5865 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
5866
5867 * doc/bison.texinfo (Java Bison Interface): Mention "%define
5868 abstract". Rename "%define union_name" to "%define stype".
5869 Rename method names according to previous patch.
5870 (Java Scanner Interface): Describe "%code lexer" instead of
5871 "%pure-parser" and "%define single_class".
5872 (Java Differences): Mention "%code lexer".
5873
5874 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
5875 Include scanner here, using macros from tests/local.at.
5876 (AT_DATA_CALC_Y): Remove final argument.
5877 (_AT_CHECK_JAVA_CALC): Likewise.
5878 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
5879 of %locations and %error-verbose.
5880 (main): Test with and without %lex-param.
5881 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
5882 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 5883
122bea3a
JMG
58842007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5885
5886 DJGPP spefic issue. Inhibit the use of disallowed characters for
5887 file name genertion on Win98, WinXP, etc. These are |<>":?*\
5888 and concern testsuite case 46.
5889 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
5890 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
5891 * djgpp/config.bat: Inhibit the use of disallowed characters.
5892
9611cfa2
JD
58932007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
5894
5895 Miscellaneous %define and %code cleanup.
5896 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
5897 values are interpreted.
5898 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
5899 documentation a little more.
5900 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
5901 muscle_percent_define_insert, muscle_percent_code_grow): New
5902 functions/macros.
5903 * src/muscle_tab.h (muscle_percent_define_insert,
5904 muscle_percent_code_grow): Prototype.
5905 * src/parse-gram.y (prologue_declaration): Use
5906 muscle_percent_define_insert and muscle_percent_code_grow when parsing
5907 %define and %code directives.
5908
5909 Make it easy to share %define boolean variables between the front-end
5910 and back-end. Though not used yet, this will be useful in the future.
5911 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
5912 Bison uses of names rather than just skeleton uses of names.
5913 (b4_percent_define_get, b4_percent_define_ifdef): Rename
5914 b4_percent_define_skeleton_variables(VARIABLE) to
5915 b4_percent_define_bison_variables(VARIABLE).
5916 (b4_percent_code_get, b4_percent_code_ifdef): Rename
5917 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
5918 b4_percent_code_bison_qualifiers(QUALIFIER).
5919 (b4_check_user_names_wrap): Update for renames.
5920 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
5921 muscle_percent_define_default): New functions mimicking
5922 b4_percent_define_flag_if and b4_percent_define_default.
5923
5924 For %define variables, report locations for invalid values and
bbb44d83 5925 redefinitions.
9611cfa2
JD
5926 * data/bison.m4 (b4_percent_define_flag_if): Read
5927 b4_percent_define_loc(VARIABLE) to report the location of an invalid
5928 value for VARIABLE.
5929 (b4_percent_define_default): Save a special location in
5930 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
5931 must later be reported as invalid.
5932 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
5933 functions.
5934 (muscle_percent_define_insert): Record the location of VARIABLE in
5935 muscle percent_define_loc(VARIABLE), and use it to report the previous
5936 location for a redefinition.
5937 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
5938 (muscle_percent_define_default): Update like b4_percent_define_default.
5939 (muscle_grow_user_name_list): Rename to...
5940 (muscle_user_name_list_grow): ... this for consistency and use
5941 muscle_location_grow.
5942 * src/muscle_tab.h (muscle_location_grow): Prototype.
5943 * tests/input.at (%define errors): Update expected output.
5944 * tests/skeletons.at (%define boolean variables: invalid skeleton
5945 defaults): New test case.
5946
0bf92491
JD
59472007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
5948
5949 * src/print.c (lookahead_set, state_default_rule): Remove.
5950 (print_reductions): Replace state_default_rule invocation with
5951 equivalent use of yydefact, which was computed in token_actions in
5952 tables.c.
5953 (print_results): Don't allocate lookahead_set.
5954
d3b12988
PB
59552007-02-27 Paolo Bonzini <bonzini@gnu.org>
5956
5957 * data/lalr1.java: Prefix all private members with yy.
5958
f57a7536
JD
59592007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
5960
5961 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 5962 Sebastien Fricker at
f57a7536 5963 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 5964 * THANKS: Add Sebastien Fricker.
f57a7536
JD
5965 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
5966 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
5967 accept a variable number of arguments.
5968
6404a5bf
JD
59692007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
5970
5971 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
5972
e4e09639
JMG
59732007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5974
5975 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
5976 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
5977 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
5978
d7e0a1a7
PE
59792007-02-11 Paul Eggert <eggert@cs.ucla.edu>
5980
5981 Undo my 2007-02-07 change, switching back to the c-strcase module
5982 introduced in the 2007-02-03 change. Bruno Haible reported that
5983 the 2007-02-07 change would be dangerous in Turkish if we add a
5984 language whose name contains "i", since "i" is not lowercase "I"
5985 in Turkish.
5986 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
5987 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
5988 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
5989 * m4/.cvsignore: Remove strcase.m4.
5990 * src/getargs.c: Revert 2007-02-07 change, as follows.
5991 Include c-strcase.h.
5992 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
5993
deee93a1
JD
59942007-02-11 Bruno Haible <bruno@clisp.org>
5995
5996 Enable the Java related testsuite tests when the only Java compiler
5997 found is a gcj < 4.3. Discussed at
5998 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
5999 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
6000
574add85
JD
60012007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
6002
6003 * data/Makefile.am: Update copyright date.
6004 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
6005 yypstate_new returns NULL.
6006 (yypstate_new): Return NULL if malloc does.
6007 * src/reader.c (packgram): Move translation of rule actions from the
6008 beginning of packgram to...
6009 (check_and_convert_grammar): ... here right before packgram is invoked
6010 so it's easier to write more complete comments, and remove redundant
6011 code.
6012
e785ccf7
JD
60132007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
6014
6015 As in semantic actions, make @$ in %initial-action, %destructor, and
6016 %printer imply %locations.
6017 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
6018 scanning @$.
6019 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
6020 (@$ in %initial-action implies %locations,
6021 @$ in %destructor implies %locations,
6022 @$ in %printer implies %locations): ... these new test cases.
6023
1cfe1ed7
PE
60242007-02-07 Paul Eggert <eggert@cs.ucla.edu>
6025
6026 Undo most of the 2007-02-03 change, switching to the strcase module
6027 now that gnulib strcase has been fixed.
6028 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
6029 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
6030 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
6031 * m4/.cvsignore: Add strcase.m4.
6032 * src/getargs.c: Revert 2007-02-03 change, as follows.
6033 Don't include c-strcase.h.
6034 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
6035 strcasecmp has "unspecified behavior" outside the POSIX locale,
6036 but it works fine in practice if at least one argument is ASCII,
6037 as is the case in Bison.
6038
0049ec86
PB
60392007-02-07 Paolo Bonzini <bonzini@gnu.org>
6040
6041 * tests/java.at: Skip tests if only one of javac/java is present.
6042 Reported by Joel E. Denny.
6043 * tests/atlocal.in: Adjust copyright years.
6044
60452007-02-05 Paolo Bonzini <bonzini@gnu.org>
6046
6047 * data/lalr1.java (Stack): Work around old verifiers that disallow
6048 access to the private fields of an inner class, from the outer class.
6049 We can make Stack's fields public because user code doesn't have access
6050 to the instance of Stack used by parse(). Reported by Paul Eggert.
6051
2c2b7220
PE
60522007-02-03 Paul Eggert <eggert@cs.ucla.edu>
6053
6054 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
6055 the right spot for these files?
6056 * bootstrap.conf (gnulib_modules): Add c-strcase.
6057 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
6058 c-strncasecmp.c.
6059 * src/getargs.c: Include c-strcase.h.
6060 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
6061 to avoid unspecified behavior.
6062
b2b81dae
JD
60632007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
6064
6065 * doc/bison.texinfo (Decl Summary): Correct typo.
6066
c1d19e10
PB
60672007-01-30 Paolo Bonzini <bonzini@gnu.org>
6068
6069 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
6070 Complain if the value does not match empty, "true" or "false".
6071 * data/c++.m4: Adjust default definitions of %define variables.
6072 * data/java.m4: Adjust default definitions of %define variables.
6073 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
6074 to above behavior.
6075 * tests/input.at (Boolean %define variables): Test new behavior.
6076
8405b70c
PB
60772007-01-29 Paolo Bonzini <bonzini@gnu.org>
6078
6079 * NEWS: Mention java.
6080 * TODO: Remove things that are done.
6081 * bootstrap.conf: Add javacomp-script and javaexec-script.
6082 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
6083
6084 * data/Makefile.am: Add new files.
6085 * data/java-skel.m4: New.
6086 * data/java.m4: New.
6087 * data/lalr1.java: New.
6088
6089 * doc/bison.texinfo: Put "A Complete C++ Example" under
6090 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
6091 under Other Languages.
6092
6093 * src/getargs.c (valid_languages): Add Java.
6094 * src/getargs.h (struct bison_language): Update size of string fields.
6095
6096 * tests/Makefile.am: Add java.at.
6097 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
6098 * tests/java.at: New.
6099 * tests/testsuite.at: Include it.
6100
3eb82471
JD
61012007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
6102
6103 Clean up.
6104 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
6105 at_directive_argv arguments so these no longer have to be global
6106 variables. Also, update the implementation for the following changes.
6107 (fail_for_at_directive_too_many_args,
6108 fail_for_at_directive_too_few_args): Add at_directive_name argument.
6109 (at_directive_name): Remove as at_directive_argv[0] will be used for
6110 this now.
6111 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
6112 for the directive name.
6113 (at_directive_argc, at_directive_argv): Make these local within
6114 skel_lex instead of global.
6115 (INITIAL): Update directive start action for above changes.
6116 (SC_AT_DIRECTIVE_ARG): Rename to...
6117 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
6118 (SC_AT_DIRECTIVE_SKIP_WS): Update.
6119 (scan_skel): Move yylex_destroy to...
6120 (skel_scanner_free): ... here.
6121 * tests/skeletons.at (installed skeleton file name): Rename to...
6122 (installed skeleton file names): ... this.
6123
148d66d8
JD
61242007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
6125
6126 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
6127 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
6128 Summary" not "Directives".
6129 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
6130 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
6131 since the former is now the more complete one.
6132 (Prologue Alternatives): Likewise and do the same for %defines.
6133 (Table of Symbols): Add summary of %code, add summary of %define, and
6134 move full %code documentation to...
6135 (Decl Summary): ... here for consistency with other entries in these
6136 sections.
6137 Move %define entry in order to keep this list alphabetized.
6138 Reword %define entry a little to put less emphasis on the skeleton
6139 concept, which most users shouldn't have to think about.
6140
665f0c24
PE
61412007-01-26 Paul Eggert <eggert@cs.ucla.edu>
6142
6143 Adjust to recent gnulib changes.
6144 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
6145 Add string.h, string_.h, unistd_.h, wchar_.h.
6146 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
6147 * src/system.h: Don't include <stpcpy.h>; this is now done by
6148 <string.h>.
6149
592d0b1e
PB
61502007-01-23 Paolo Bonzini <bonzini@gnu.org>
6151
6152 Simplify implementation of unqualified %code, implement macros for
6153 uniform treatment of boolean %define flags. Document %define.
6154 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
6155 b4_percent_code_ifdef): New.
6156 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
6157 * data/c++.m4: Define default value for global_tokens_and_yystype.
6158 * data/glr.cc: Likewise.
6159 * data/location.cc: Use b4_percent_define_flag_if.
6160
148d66d8 6161 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
6162
6163 * src/parse-gram.y (Unqualified %code): Change muscle name to
6164 b4_percent_code().
6165 (content.opt): Default to empty.
6166
a7867f53
JD
61672007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6168
6169 Implement support for relative and absolute skeleton file names.
6170 Discussed starting at
6171 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
6172 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
6173 (Bison Options): Document in --skeleton entry.
6174 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
6175 full_skeleton can't necessarily hold all of pkgdatadir.
6176 If the specified skeleton file name contains a `/', don't prepend
6177 pkgdatadir.
6178 * src/parse-gram.y (prologue_declaration): If the specified skeleton
6179 file name contains a `/', prepend the grammar file directory.
6180 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
6181 * skeletons.at: New file.
6182 (relative skeleton file names): New test case.
6183 (installed skeleton file names): New test case.
6184 * tests/testsuite.at: Include skeletons.at.
6185
6186 * bootstrap: Update copyright to 2007.
6187
830c9b18
PB
61882007-01-17 Paolo Bonzini <bonzini@gnu.org>
6189
6190 * bootstrap: Remove occurrences of .#bootmp from the files.
6191
a8c2e813
AD
61922007-01-17 Akim Demaille <akim@epita.fr>
6193
6194 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
6195 nonterminals.
6196 Use per-type %printer.
6197
279cabb6
JD
61982007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6199
6200 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
6201 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6202 djgpp/config.site, src/files.c, src/files.h, src/main.c,
6203 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
6204 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
6205 tests/glr-regression.at, tests/input.at, tests/local.at,
6206 tests/output.at, tests/torture.at: Update copyright to 2007.
6207
bb32f4f2
AD
62082007-01-16 Akim Demaille <akim@epita.fr>
6209
6210 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
6211 error code.
6212 (Calc++ Scanner): Exit with failure if we can't open the input
6213 file.
6214 Accept "-" standing for stdin.
6215 (Calc++ Top Level): Print the result only if the parsing was
6216 successful.
6217
7cff04b5
AD
62182007-01-16 Akim Demaille <akim@epita.fr>
6219
6220 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
6221
a4e25e1d
JD
62222007-01-15 Paolo Bonzini <bonzini@gnu.org>
6223 and Joel E. Denny <jdenny@ces.clemson.edu>
6224
6225 Clean up %define and %code implementation in M4 some. Most
6226 importantly, rename all related macros to be in the b4_percent_define
6227 and b4_percent_code namespaces. Also, complete support for `.' in
6228 %define variable names and %code qualifiers.
6229 * data/bison.m4 (b4_check_user_names): Check for special
6230 "SKELETON-NAMESPACE(name)" macros instead of using two nested
6231 m4_foreach loops.
6232 (b4_get_percent_define, b4_get_percent_code): Rename to...
6233 (b4_percent_define_get, b4_percent_code_get): ... these.
6234 Extend documentation with examples.
6235 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
6236 b4_percent_define_skeleton_variables and
6237 b4_percent_code_skeleton_qualifiers.
6238 Expect any value for the %define variable `foo' to be stored in the
6239 macro named `b4_percent_define(foo)'; expect any %code blocks for the
6240 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
6241 expect any unqualified %code blocks to be stored in a macro named
6242 `b4_percent_code_unqualified'.
6243 Use m4_indir so that %define variable names and %code qualifiers can
6244 contain `.', which is allowed by the grammar parser.
6245 (b4_percent_define_default): New macro to set a default value for a
6246 %define variable.
6247 (m4_wrap): Update wrapped code, and fix some underquoting.
6248 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
6249 Expect grammar uses of %define variables and %code qualifiers to be
6250 defined in b4_percent_define_user_variables and
6251 b4_percent_code_user_qualifiers.
6252 * data/c++.m4: Use b4_percent_define_default rather than
6253 m4_define_default. Fix some underquoting. Skeleton usage of %define
6254 variable define_location_comparison now implies skeleton usage of
6255 %define variable filename_type.
6256 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6257 data/push.c, data/yacc.c: Update macro names.
6258 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
6259 muscle names.
6260
e37c665c
JMG
62612007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6262
6263 DJGPP specific issues.
6264
6265 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
6266 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
6267
7d2d521f
JD
62682007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6269
6270 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
6271 run parsers in all tests so that Valgrind is invoked during
6272 maintainer-check-valgrind.
6273 (Duplicate representation of merged trees): Free all semantic values.
6274 (Duplicated user destructor for lookahead): Likewise.
6275
e0ac9b4b
JD
62762007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6277
6278 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
6279 command-line prefix.
6280 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
6281 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
6282 miss Valgrind messages.
6283 (Exploding the Stack Size with Malloc): Likewise.
6284
78143faa
JD
62852007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6286
6287 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
6288 locals. Reported by Juan Manuel Guerrero at
6289 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
6290 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
6291 Fix some indentation also.
6292 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
6293 explaining this issue.
6294
7ecec4dd
JD
62952007-01-09 Paolo Bonzini <bonzini@gnu.org>
6296 and Joel E. Denny <jdenny@ces.clemson.edu>
6297
6298 Simplify union and prologue handling, and escape union and lex/parse
6299 params with digraphs.
6300 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
6301 values to the empty string since these are no longer guaranteed
6302 initialized by the front-end.
6303 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
6304 braces around b4_user_stype since this is no longer done by the
6305 front-end.
6306 * src/files.c, src/files.h (pre_prologue_obstack,
6307 post_prologue_obstack): Remove.
6308 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
6309 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
6310 with digraphs. This fixes lex params and parse params.
6311 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
6312 * src/output.c (prepare): Remove muscle insertion of the prologues.
6313 (output): Remove freeing of pre_prologue_obstack and
6314 post_prologue_obstack.
6315 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
6316 than prologue_augment for prologue parsing so you don't need prologue
6317 obstacks.
5c80250c
JD
6318 (grammar_declaration): For %union RHS, use `braceless' instead of
6319 "{...}" so that braces are already stripped and code is escaped with
6320 digraphs.
7ecec4dd
JD
6321 * src/reader.c (prologue_augment): Remove.
6322 (reader): Remove initialization of pre_prologue_obstack and
6323 post_prologue_obstack.
6324 * src/reader.h (prologue_augment): Remove.
6325
6326 * data/c.m4: Remove stray parenthesis.
6327
16dc6a9e
JD
63282007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6329
6330 Remove quotes from variables names in %define directives and from
6331 qualifiers in %code directives, and restrict the characters that are
6332 allowed in them to M4-friendly ones. For %define, continue to support
6333 the quoted form as a deprecated feature. Discussed starting at
6334 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
6335 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
6336 %code.
6337 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
6338 (Decl Summary): In %defines entry, update mention of `%code requires'
6339 and `%code provides'.
16dc6a9e
JD
6340 (C++ Location Values): Update %define uses.
6341 (Calc++ Parser Interface): Likewise.
6342 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 6343 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
6344 * src/parse-gram.y (prologue_declaration): For %define variables, use
6345 `variable' instead of `STRING'.
6346 (grammar_declaration): For %code qualifiers, use `ID' instead of
6347 `STRING'.
6348 (variable): New nonterminal that takes an `ID' or a `STRING'.
6349 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
6350 and %define uses.
6351 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
6352 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
6353 (%define errors): Update %define uses.
6354
e9813cd4
JD
63552007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6356
6357 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
6358 instead of muscle_insert for %define values so that M4-special
6359 characters are replaced with digraphs.
6360 * tests/input.at (%define errors): Extend to check weird values.
6361
6afc30cc
JD
63622007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6363
6364 Instead of having skeletons declare all valid %define variables and
6365 %code qualifiers, provide macros that retrieve the associated values
6366 and build these lists automatically. Thus Bison will now warn when a
6367 variable or qualifier is not used by the skeleton in the current
6368 invocation regardless of whether it might sometimes be used by that
6369 skeleton in other invocations. Also, move all %define value macros to
6370 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
6371 form, which is replaced by %code.
6372 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
6373 (b4_check_user_names): ... this, and change the series of valid name
6374 arguments to a single list argument for names used in the skeleton
6375 similar to the existing list argument for names used in the grammar.
6376 Warn instead of complaining.
6377 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
6378 values and %code code, to format %code code properly, and to build
6379 lists of all %define variables and %code qualifiers used in the
6380 skeleton: b4_skeleton_percent_define_variables and
6381 b4_skeleton_percent_code_qualifiers.
6382 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
6383 Remove, and...
6384 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
6385 the skeleton names lists can finish building first. In place of
6386 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
6387 expect the lists b4_user_percent_define_variables and
6388 b4_user_percent_code_qualifiers.
6389 * data/c++.m4: Where setting default values for b4_parser_class_name,
6390 b4_location_type, b4_filename_type, b4_namespace, and
6391 b4_define_location_comparison, update their names to the
6392 b4_percent_define_ namespace.
6393 * data/glr.c: Don't use b4_check_percent_define_variables and
6394 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6395 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
6396 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 6397 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
6398 * data/location.cc: Use b4_get_percent_define.
6399 * data/push.c: Don't use b4_check_percent_define_variables and
6400 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6401 * data/yacc.c: Likewise, and don't call m4_exit in
6402 b4_use_push_for_pull_if or m4_wrap code will never execute.
6403 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
6404 Rename to...
6405 (muscle_grow_user_name_list): ... this for consistency with the
6406 terminology used in bison.m4.
6407 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
6408 %define variable names, and rename muscle used_percent_define_variables
6409 to user_percent_define_variables.
6410 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
6411 user_percent_code_qualifiers.
6412 (content): Remove.
6413 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
6414 {CODE} form is no longer accepted.
6415 * tests/input.at (Reject bad %code qualifiers): Rename to...
6416 (Reject unused %code qualifiers): ... this, and update test output.
6417 (%define error): Update test output.
6418
7eb8a0bc
JD
64192007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
6420
6421 Check for unrecognized %define variables similar to checking for
6422 unrecognized %code qualifiers. Check for redefined %define variables.
6423 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
6424 generalizes...
6425 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
6426 (b4_check_percent_define_variables): New, also wraps it.
6427 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
6428 variables using b4_check_percent_define_variables.
6429 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
6430 all those exercised in the test suite and all those listed in the
6431 `Default values' section of c++.m4. Are there others?
6432 * data/push.c, data/yacc.c: Declare no valid %define variables.
6433 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
6434 similar to muscle_find, but it works even when the muscle stores a
6435 const value.
6436 (muscle_grow_used_name_list): New function for constructing the used
6437 name list muscles that b4_check_for_unrecognized_names requires.
6438 * src/parse-gram.y (prologue_declaration): Warn if a variable is
6439 %define'd more than once. Define the b4_used_percent_define_variables
6440 muscle with muscle_grow_used_name_list.
6441 (grammar_declaration): Abbreviate %code code with
6442 muscle_grow_used_name_list.
6443 * tests/input.at (%define errors): New.
6444
3fc65ead
JD
64452007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6446
6447 Provide warn_at, complain_at, and fatal_at function callbacks to the
6448 skeletons, and use this for %code qualifier complaints.
6449 * data/bison.m4 (b4_error_at): New, invoked by...
6450 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
6451 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
6452 @fatal_at(...@) directives.
6453 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
6454 qualifiers in b4_used_percent_code_qualifiers and to use
6455 b4_complain_at.
6456 * src/location.c, src/location.h (boundary_set_from_string): New global
6457 function.
6458 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
6459 function.
6460 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
6461 to b4_used_percent_code_qualifiers.
6462 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
6463 function.
6464 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
6465 (lineno): Rename to...
6466 (out_lineno): ... this so I don't misunderstand it again.
6467 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
6468 here; these newlines are in the input but not the output file.
6469 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
6470 (at_directive_perform): ... this new static function, and add handling
6471 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
6472 directives.
6473 * tests/input.at (Reject bad %code qualifiers): Update test output with
6474 locations and extend.
6475
6476 * tests/output.at (Output file name: [, Output file name: ]): Remove
6477 bogus comment about these tests failing.
6478
1c7b7e1d
JD
64792007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6480
6481 Clean up b4_check_percent_code_qualifiers a little.
6482 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
6483 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
6484 documentation and add examples.
6485 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
6486 qualifiers here.
6487
08af01c2
JD
64882007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
6489
6490 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
6491 unreliable -- especially when they're hidden inside another macro.
6492 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
6493 data/c.m4: Remove m4_divert(-1).
6494 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6495 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
6496 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 6497 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
6498 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
6499 pushed and popped by m4sugar, should be first on the stack.
6500
6501 Provide warn, complain, and fatal function callbacks to the skeletons.
6502 This provides more flexibility than m4_fatal, improves the error
6503 message format, and captures messages for translation. Discussed
6504 starting at
6505 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
6506 * data/bison.m4 (b4_error): New, invoked by...
6507 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
6508 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
6509 directives. Because these M4 macros might be called when the current
6510 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
6511 the previous removal of uses of m4_divert, which caused trouble.
6512 (b4_check_percent_code_qualifiers): Use b4_complain instead of
6513 m4_fatal to report unrecognized %code qualifiers.
6514 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
6515 push parser requests.
6516 * data/glr.c: Use b4_complain instead of m4_fatal to report
6517 non-deterministic push parser requests.
6518 Update @output usage to @output(...@) form.
6519 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
6520 report missing %defines. Update @output usage to @output(...@) form.
6521 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
6522 @output(...@) form.
6523 * src/main.c (main): Invoke skel_scanner_free.
6524 * src/scan-skel.h (skel_scanner_free): Prototype new function.
6525 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
6526 obstack_for_string from flex-scanner.h.
6527 (YY_DECL): Use to declare skel_lex static.
6528 (decode_at_digraphs): Remove; now handled in the new
6529 SC_AT_DIRECTIVE_ARG start condition.
6530 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
6531 functions.
6532 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
6533 at_directive_argv): New static globals.
6534 (INITIAL): Use fail_for_invalid_at.
6535 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
6536 recognize the start of a generalized `@directive(...@)' form and
6537 start...
6538 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
6539 directive args (using the new obstack_for_string), to decode the
6540 contained @ diagraphs, and to perform the directive. It recognizes
6541 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
6542 @output(...@).
6543 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
6544 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
6545 `@,'.
6546 (scan_skel): Initialize obstack_for_string on the first call.
6547 (skel_scanner_free): New function to free obstack_for_string.
6548 * tests/input.at (Reject bad %code qualifiers): Update test output.
6549
8e0a5e9e
JD
65502007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
6551
6552 Consolidate the 4 prologue alternative directives (%code, %requires,
6553 %provides, and %code-top) into a single %code directive with an
6554 optional qualifier field. Discussed at
6555 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
6556 * NEWS (2.3a+): Rewrite the existing entry for the prologue
6557 alternatives.
6558 * doc/bison.texinfo (Prologue Alternatives): Update.
6559 (Decl Summary): Update to %code "requires" and %code "provides".
6560 (Calc++ Parser): Update to %code "requires".
148d66d8 6561 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
6562 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
6563 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
6564 are replaced by b4_percent_code_provides and b4_percent_code_requires,
6565 which are skeleton-specific.
6566 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
6567 declare what %code qualifiers it supports and to complain if any other
6568 qualifiers were used in the grammar.
6569 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
6570 and b4_user_code([b4_percent_code_provides]) in place of
6571 b4_user_requires and b4_user_provides.
6572 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
6573 Add b4_user_code([b4_percent_code_top]) and
6574 b4_user_code([b4_percent_code]).
6575 Invoke b4_check_percent_code_qualifiers.
6576 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
6577 PERCENT_REQUIRES): Remove.
6578 (grammar_declaration): Remove RHS's for %code-top, %provides, and
6579 %requires. Rewrite the %code RHS as the unqualified form defining the
6580 muscle b4_percent_code. Add another RHS for the qualified %code form,
6581 which defines muscles of the form b4_percent_code_QUALIFIER and the
6582 b4_used_percent_code_qualifiers muscle.
6583 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
6584 PERCENT_REQUIRES): Remove.
6585 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
6586 %code "requires" and %code "provides".
6587 * tests/input.at (Reject bad %code qualifiers): New.
6588
95021767
JD
65892007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
6590
6591 Use the new code_props interface for destructors and printers.
6592 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
6593 printer_location members, and change the type of the destructor and
6594 printer members to code_props.
6595 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
6596 symbol_printer_get, semantic_type_destructor_set,
6597 semantic_type_printer_set, default_tagged_destructor_set,
6598 default_tagless_destructor_set, default_tagged_printer_set,
6599 default_tagless_printer_set): Use code_props in arguments and return
6600 types in place of char const * and location.
6601 (symbol_destructor_location_get, symbol_printer_location_get): Remove
6602 since the locations are now contained in the return of
6603 symbol_destructor_get and symbol_printer_get.
6604 * src/output.c (symbol_destructors_output, symbol_printers_output):
6605 Replace with...
6606 (symbol_code_props_output): ... this to eliminate duplicate code.
6607 (output_skeleton): Update to use symbol_code_props_output.
6608 * src/reader.c (symbol_should_be_used): Update use of
6609 symbol_destructor_get.
6610 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
6611 Update uses of the various _destructor_set and _printer_set functions.
6612 * src/symtab.c: (default_tagged_destructor_location,
6613 default_tagless_destructor_location, default_tagged_printer_location,
6614 default_tagless_printer_location): Remove since we...
6615 (default_tagged_destructor, default_tagless_destructor,
6616 default_tagged_printer, default_tagless_printer): ... change the type
6617 of these to code_props.
6618 (symbol_new, semantic_type_new, symbol_destructor_set,
6619 semantic_type_destructor_set, symbol_destructor_get,
6620 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
6621 symbol_check_alias_consistency, default_tagged_destructor_set,
6622 default_tagless_destructor_set, default_tagged_printer_set,
6623 default_tagless_printer_set): Update.
6624 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
6625 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
6626 code_props members.
6627 (symbol_print): Use SYMBOL_CODE_PRINT.
6628
f6857bbf
JD
66292007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
6630
6631 Use the new code_props interface for rule actions.
6632 * src/symlist.h (symbol_list): Replace action, action_location, and
6633 used members with a code_props action_props member.
6634 * src/reader.c (symbol_should_be_used, grammar_rule_check,
6635 grammar_midrule_action, grammar_current_rule_merge_set,
6636 grammar_current_rule_symbol_append, packgram): Update.
6637 * src/scan-code.h (translate_rule_action): Remove, no longer used.
6638 * src/scan-code.l (handle_action_dollar): Update.
6639 (translate_rule_action): Remove, no longer used.
6640 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
6641
7c0c6181
JD
66422007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6643
6644 Use the new code_props interface in parse-gram.y.
6645 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
6646 Update all uses of translate_* functions to use the new code_props
6647 interface and to use gram_scanner_last_string_free and
6648 code_scanner_last_string_free where possible.
6649 (grammar_declaration): symbol_list_destructor_set and
6650 symbol_list_printer_set now perform the translation, so don't do it
6651 here. Use gram_scanner_last_string_free where possible.
6652 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
6653 translate_code): Remove, no longer used.
6654 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
6655 symbol_list_printer_set): Perform code translation here rather than
6656 depending on the caller to do so.
6657
6658 * src/symlist.h (struct symbol_list): Correct some documentation typos.
6659 * src/scan-gram.h (gram_last_string): Remove declaration.
6660 * src/scan-gram.l (last_string): Declare it static.
6661
28e52c0d
JD
66622007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6663
6664 Encapsulate code properties and related functionality for the various
6665 destructors, printers, and actions into a code_props structure and
6666 interface. This patch merely implements code_props in scan-code.h and
6667 scan-code.l. Future patches will rewrite other modules to use it.
6668 Discussed starting at
6669 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
6670 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
6671 consistently initialize const structs that have an empty location
6672 field.
6673 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
6674 to ensure consistency.
6675 * src/scan-code.h (code_props): New structure.
6676 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
6677 function, macro, and const global variable for initializing a
6678 code_props with no code.
6679 (code_props_plain_init, code_props_symbol_action_init,
6680 code_props_rule_action_init, code_props_translate_code): The rest of
6681 the new code_props functional interface. Among other things, the init
6682 functions set the code_props kind field so that
6683 code_props_translate_code will know whether to behave like
6684 translate_symbol_action, translate_rule_action, or translate_code.
6685 These old translate functions must remain until all other modules are
6686 updated to use the new code_props interface.
6687 (code_scanner_last_string_free): New function similar to
6688 gram_scanner_last_string_free.
6689 (code_scanner_free): Add documentation.
6690 * src/scan-code.l: Implement the new interface.
6691 (code_lex): Make it static, add a code_props* argument, and remove the
6692 rule argument.
6693 (last_string): New static global similar to the one in scan-gram.l.
6694 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
6695 instead of rule.
6696 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
6697 code_props since Bison may one day use this information for destructors
6698 and printers.
6699 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
6700 (handle_action_dollar): Use symbol_list_n_get and set used flag
6701 directly since symbol_list_n_used_set is removed.
6702 (translate_action): Add a code_props* argument and remove the rule,
6703 action, and location arguments. Pass the code_props* on to code_lex.
6704 (translate_rule_action, translate_symbol_action, translate_code):
6705 Rewrite as wrappers around the new code_props interface.
6706 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
6707 it would eventually need to break the encapsulation of code_props.
6708
96034983
JD
67092007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
6710
6711 * etc/.cvsignore: New.
6712
945e396c
JD
67132007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
6714
6715 Add maintainer-push-check to run maintainer-check using push parsing in
6716 place of pull parsing where available.
6717 * Makefile.am (maintainer-push-check): New.
6718 * data/bison.m4 (b4_use_push_for_pull_if): New.
6719 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
6720 appropriately based on their existing values.
6721 (yypush_parse): Don't print push-parser-specific diagnostics if push
6722 parsing is being used in place of pull parsing.
6723 * data/yacc.c: If push parsing should replace pull parsing, redirect to
6724 push.c.
6725 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
6726 variable, and insert b4_use_push_for_pull_flag into muscles.
6727 * tests/Makefile.am (maintainer-push-check): New.
6728
7d596384
JD
67292006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
6730
6731 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
6732 (whether successful or failed) so that yypush_parse can be invoked
6733 again to start a new parse using the same yypstate.
6734 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
6735 check multiple yypull_parse invocations on the same yypstate. For pull
6736 mode, extend to check multiple yyparse invocations.
6737 (Exploding the Stack Size with Alloca): Extend to try with
6738 %push-pull-parser.
6739 (Exploding the Stack Size with Malloc): Likewise.
6740
6741 * tests/calc.at (Simple LALR Calculator): Don't specify
6742 %skeleton "push.c" since %push-pull-parser implies that now.
6743 * tests/headers.at (export YYLTYPE): Don't check for the push
6744 declarations. Otherwise, this test case can't be used to see if push
6745 mode can truly emulate pull mode.
6746 * tests/input.at (Torturing the Scanner): Likewise.
6747 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
6748 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
6749 AT_YACC_IF, which now includes the case of push mode since %skeleton
6750 need not be used for push mode. This will be more intuitive once
6751 push.c is renamed to yacc.c.
6752
7172e23e
JD
67532006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
6754
6755 For push mode, convert yyparse from a macro to a function, invoke yylex
6756 instead of passing a yylexp argument to yypull_parse, and don't
6757 generate yypull_parse or yyparse unless %push-pull-parser is declared.
6758 Discussed starting at
6759 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
6760 * data/bison.m4 (b4_pull_if): New.
6761 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
6762 * data/push.c: Improve M4 quoting a little.
6763 (b4_generate_macro_args, b4_parenthesize): Remove.
6764 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
6765 any time a pull parser is requested.
6766 Don't #define this as a wrapper around yypull_parse. Instead, when
6767 both push and pull are requested, make it a function that does that
6768 same thing.
6769 (yypull_parse): If there's a b4_prefix, #define this to
6770 b4_prefix[pull_parse] when both push and pull are requested.
6771 Don't define this as a function unless both push and pull are
6772 requested.
6773 Remove the yylexp argument and hard-code yylex invocation instead.
6774 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
6775 %push-parser.
6776 * src/getargs.c (pull_parser): New global initialized to true.
6777 * getargs.h (pull_parser): extern it.
6778 * src/output.c (prepare): Insert pull_flag muscle.
6779 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
6780 (prologue_declaration): Set both push_parser and pull_parser = true for
6781 %push-pull-parser. Set push_parser = true and pull_parser = false for
6782 %push-parser.
6783 * src/scan-gram.l: Don't accept %push_parser as an alternative to
6784 %push-parser since there's no backward-compatibility concern here.
6785 Scan %push-pull-parser.
6786 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
6787 instead of %push-parser.
6788 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
6789 prototype it in the module that calls yyparse.
6790 * tests/input.at (Torturing the Scanner): Likewise.
6791 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
6792
2e7944cb
JD
67932006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
6794
6795 Update etc/bench.pl. Optimize push mode a little (the yyn change
6796 deserves most of the credit).
6797 * Makefile.am (SUBDIRS): Add etc subdirectory.
6798 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
6799 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
6800 yytoken, yyval, and yyloc declarations to...
6801 (yyparse or yypush_parse): ... here to improve performance. For
6802 yypush_parse invocations after the first, be sure to assign yyn its old
6803 value again.
6804 (yypstate_new): Don't bother initializing the yyresult field since the
6805 initial value isn't used.
6806 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
6807 remove the #define that, in push mode, set it to yyps->NAME.
6808 * etc/Makefile.am: New.
6809 * etc/bench.pl: Remove and build it instead from...
6810 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
6811 "tests/bison" from the build directory by default rather than just
6812 invoking "bison" from $PATH.
6813 (calc_grammar): Update push parser code: don't declare yylval globally,
6814 don't define yyparse_wrapper, and don't #define yyparse.
6815 (bench_grammar): Update to check all working combinations of yacc.c,
6816 push.c, impure, pure, pull, and push.
6817
c3d50342
JD
68182006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
6819
6820 For push mode, add pull wrappers around yypush_parse.
6821 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
6822 (yypull_parse): New function wrapping yypush_parse.
6823 (yyparse): New #define wrapping yypull_parse.
6824 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
6825 is declared.
6826 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
6827 prototype yylex in the module that calls yyparse, and don't prototype
6828 yyparse there. Otherwise, the yyparse expansion won't compile.
6829 * tests/input.at (Torturing the Scanner): Likewise.
6830
94ebeba5
JD
68312006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
6832
6833 Enable push parsers to operate in impure mode. Thus, %push-parser no
6834 longer implies %pure-parser. The point of this change is to move
6835 towards being able to test the push parser code by running the entire
6836 test suite as if %push-parser had been declared.
6837 * data/push.c (yypush_parse): For impure mode, remove the
6838 yypushed_char, yypushed_val, and yypushed_loc arguments.
6839 Instead, declare these as local variables initialized to the global
6840 yychar, yylval, and yylloc.
6841 For the first yypush_parse invocation only, restore the initial values
6842 of these global variables when it's time to read a token since they
6843 have been overwritten.
6844 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
6845 %push-parser.
6846 * tests/calc.at (Simple LALR(1) Calculator): Always declare
6847 %pure-parser along with %push-parser since this test case was designed
6848 for pure push parsers.
6849 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
6850 (AT_YACC_OR_PUSH_IF): New.
6851 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
6852 add a note that it's still wrong for some cases (as it has been for a
6853 while).
6854 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
6855 %push-parser no longer implies %pure-parser.
6856
a0633178
JD
68572006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
6858
6859 Remove some unnecessary differences between the pull parser code and
6860 the push parser code. This patch enables yynerrs in push mode.
6861 * data/push.c: Reformat M4 a little.
6862 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
6863 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
6864 because push mode is on. Instead, if pure mode is on, move yynerrs
6865 to...
6866 (b4_declare_parser_state_variables): ... here.
6867 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
6868 to yyps->NAME so it can be used in yypush_parse.
6869 (yypush_parse): Don't omit uses of yynerrs in push mode.
6870
8646b6a3
JD
68712006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
6872
6873 Fix bug such that the first pushed token's value and location are
6874 sometimes overwritten (sometimes by %initial-action) before being used.
6875 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
6876 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
6877 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
6878 more closely mimic the pull parser logic.
6879 Don't copy the pushed token to yychar, yylval, and yylloc until it's
6880 time to read a token, which is after any initialization of yylval and
6881 yylloc.
6882 (gottoken): Rename label to...
6883 (yyread_pushed_token): ... for clarity and to avoid infringing on the
6884 user namespace.
6885
9baf4d74
JD
68862006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
6887
6888 Rearrange initialization of the parser state variables so that the
6889 skeleton doesn't have to have a copy for pull mode and another for push
6890 mode. This patch also fixes at least a bug such that yylloc was not
6891 initialized (with b4_location_initial_line and
6892 b4_location_initial_column) upon calling yypush_parse. However, that
6893 initialization now overwrites the first token's location;
6894 %initial-action assigning @$ already did the same thing, and both bugs
6895 will be fixed in a later patch.
6896 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
6897 (b4_declare_parser_state_variables): Remove initialization of yytoken,
6898 yyss, yyvs, yyls, and yystacksize.
6899 (yypstate_new): Remove initialization of some yypstate fields: yystate,
6900 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
6901 yylsp.
6902 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
6903 yyps->NAME so it can be used in yypush_parse.
6904 (yyparse or yypush_parse): For yypush_parse, don't print the
6905 "Starting parse" diagnostic for invocations after the first.
6906 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
6907 yypush_parse, only do it for the first invocation.
6908 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
6909 initialization to occur in yypush_parse but only on the first
6910 invocation.
6911
23522164
JD
69122006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6913
6914 * data/push.c: Add CPP guards around push parser declarations in both
6915 the header and the code file.
6916 In the code file, move the push parser declarations to the same place
6917 they appear in the header file.
6918 Clean up the M4 some, especially the inconsistent underquoting in
6919 some b4_c_function_def and b4_c_function_decl uses.
6920
bb010fe5
JD
69212006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6922
6923 Encapsulate the push parser state variables into an M4 macro so the
6924 push skeleton doesn't have to list them again for pull mode's yyparse.
6925 For push mode, remove yypush_parse's local equivalents of these
6926 variables to eliminate unnecessary copying between the two sets at
6927 run-time. This patch also fixes at least a bug related to multiple
6928 %initial-action invocations in push mode.
6929 * data/push.c (b4_declare_parser_variables): Rename to...
6930 (b4_declare_scanner_communication_variables): ... this for clarity and
6931 update both uses.
6932 (b4_declare_yyparse_variables): Remove and move its contents to the one
6933 spot where it was invoked.
6934 (b4_declare_parser_state_variables): New macro containing the parser
6935 state variables required by push mode.
6936 (struct yypstate): Replace all fields but yynew with
6937 b4_declare_parser_state_variables.
6938 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
6939 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
6940 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
6941 (yyparse or yypush_parse): For yyparse in pull mode, replace local
6942 parser state variable declarations with
6943 b4_declare_parser_state_variables.
6944 Don't initialize parser state variables when calling yypush_parse since
6945 yypstate_new already does that.
6946 Invoke the user's initial action only upon the first yypush_parse
6947 invocation.
6948 Remove all code that copies between the local parser state variables
6949 and the yypstate.
6950
2d212f8c
JD
69512006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6952
6953 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
6954 prevent a name collision in a future patch where these names will
6955 sometimes be #define'd.
6956 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
6957 since it no longer has the same name as the existing argument.
6958 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
6959
e6e704dc
JD
69602006-12-19 Paolo Bonzini <bonzini@gnu.org>
6961 and Joel E. Denny <jdenny@ces.clemson.edu>
6962
6963 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
6964 that the argument is case-insensitive, and there's no `=' here.
6965 For the %skeleton entry, mention that %language is better.
6966 (Bison Options): Likewise for --language and --skeleton. Move the
6967 --skeleton entry so that the `Tuning the parser' section is sorted
6968 alphabetically on long options.
6969 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
6970 %language directive in detail here; cross-reference the %language
6971 documentation instead.
6972 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
6973 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 6974 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
6975 * examples/extexi (normalize): Instead of replacing every %require
6976 argument with the current Bison version, just substitute for
6977 `@value{VERSION}'. This guarantees that we're testing what actually
6978 appears in the documentation.
6979 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
6980 rather than `@VERSION@'.
6981
0e021770
PE
69822006-12-18 Paul Eggert <eggert@cs.ucla.edu>
6983
fd575f05
PE
6984 * NEWS: Reword the %language news a bit, and put it earlier.
6985
0e021770
PE
6986 * src/getargs.c (skeleton_arg): Last arg is now location const *.
6987 Rewrite to simplify the logic.
6988 (language_argmatch): Likewise.
fd575f05
PE
6989 (program_name): We now own this var.
6990 * src/getargs.h (struct bison_language): Use char[] rather than
6991 const char *.
0e021770
PE
6992
6993 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
6994 Java is supported.
6995 * src/complain.c (program_name): Remove decl; no longer needed.
6996 * src/main.c (program_name): Remove; now belongs to getargs.
6997
69982006-12-18 Paolo Bonzini <bonzini@gnu.org>
6999
7000 * NEWS: Document %language.
7001
7002 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
7003
7004 * data/c-skel.m4, data/c++-skel.m4: New files.
7005 * data/glr.c: Complain on push parsers.
7006
7007 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
7008 over %skeleton.
148d66d8 7009 (Decl Summary): Document %language and %skeleton.
0e021770
PE
7010 (Command line): Document -L.
7011
7012 * examples/extexi: Rewrite %require directive.
7013 * examples/calc++/Makefile.am: Pass VERSION to extexi.
7014
7015 * src/files.c (compute_exts_from_gc): Look in language structure
7016 for .y extension.
7017 (compute_file_name_parts): Check whether .tab should be added.
7018 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
7019 (language, skeleton_arg, language_argmatch): New.
7020 (long_options): Add --language.
7021 (getargs): Use skeleton_arg, add -L/--language.
7022 * src/getargs.h: Include location.h.
7023 (struct bison_language, language, skeleton_arg, language_argmatch): New.
7024 * src/output.c (prepare): Pick default skeleton from struct language.
7025 Don't dispatch C skeletons here.
7026 * src/parse-gram.y (PERCENT_LANGUAGE): New.
7027 (prologue_declaration): Add "%language" rule, use skeleton_arg.
7028 * src/scan-gram.l ("%language"): New rule.
7029
7030 * tests/calc.at: Test %skeleton and %language.
7031 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
7032 (AT_GLR_IF): Look for %skeleton "glr.cc".
7033 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
7034 (AT_YACC_IF): Reject %language.
7035
5691bf57
PE
70362006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7037
db06f0ce
PE
7038 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
7039 since it wasn't used; only the typedef name 'semantic_type' is needed.
7040 Also, omit trailing white space.
7041
5691bf57
PE
7042 * bootstrap: Sync from coreutils.
7043 (gnulib_extra_files): Add build-aux/announce.gen.
7044 (slurp): Adjust .gitignore files like .cvsignore files.
7045 * build-aux/announce-gen: Remove from CVS, since bootstrap
7046 now creates this.
7047
791934e4
JD
70482006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
7049
7050 Make %push-parser imply %pure-parser. This fixes several bugs; see
7051 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
7052 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
7053 pure_parser = true.
7054 * data/push.c: Don't bother testing b4_push_if when deciding whether
7055 to expand b4_declare_parser_variables globally.
7056 (yypush_parse): Likewise in here.
7057
7058 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
7059 (yy_reduce_print): Reformat M4 for readability.
7060
ee5abb37
JD
70612006-12-15 Bob Rossi <bob@brasko.net>
7062 and Joel Denny <jdenny@ces.clemson.edu>
7063
7064 * data/push.c (yypstate): Add typedef, and update all uses of
7065 struct yypstate to just yypstate.
7066 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
7067
16ca01f9
JD
70682006-12-14 Bob Rossi <bob@brasko.net>
7069
7070 * data/push.c (yypush_parse): Declare prototype regardless of
7071 %locations option.
7072
ab8e7e1a
JD
70732006-12-14 Bob Rossi <bob@brasko.net>
7074
7075 * data/push.c (yyparse): Remove the prototype and the #define when in
7076 push-parser mode.
7077
9bf32be3
JD
70782006-12-13 Bob Rossi <bob@brasko.net>
7079
7080 * data/push.c (yypstate_init): Rename to...
7081 (yypstate_new): ... this and use b4_c_function_def.
7082 (yypstate_delete): New.
7083 (yypush_parse): Change parameters yynval and yynlloc to be const.
7084 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
7085 yypstate_delete functions.
7086
f02e2948
JD
70872006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
7088
7089 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
7090 strange test case titles. Reported by Bob Rossi.
7091
38eb7751
PE
70922006-12-13 Paul Eggert <eggert@cs.ucla.edu>
7093
7094 * TODO: Add pointer to Sylvain Schmitz's work on static detection
7095 of potential ambiguities in GLR grammers.
7096
bd9d212b
JD
70972006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
7098
7099 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
7100 `bison ', use m4_index instead of m4_substr since chopping up a string
7101 containing M4-special characters causes problems here.
7102
7103 Fix a couple of bugs related to special characters in user-specified
7104 file names, and make it easier for skeletons to compute output file
7105 names with the same file name prefix as Bison-computed output file
7106 names.
7107 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
7108 b4_parser_file_name and b4_spec_defines_file instead of
7109 @output_parser_name@ and @output_header_name@, which are now redundant.
7110 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
7111 b4_parser_file_name, b4_spec_defines_file, and the new
7112 @basename(FILENAME@) instead of @output_parser_name@ and
7113 @output_header_name@, which inappropriately escaped the file names as
7114 C string literals.
7115 * src/files.c (all_but_ext): Remove static qualifier.
7116 (compute_output_file_names): Move `free (all_but_ext)' to...
7117 (output_file_names_free): ... here since all_but_ext is needed later.
7118 * src/files.h (all_but_ext): Extern.
7119 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
7120 exactly what MUSCLE_INSERT_STRING used to do.
7121 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
7122 characters are escaped properly.
7123 * src/output.c (prepare): Define muscle file_name_all_but_ext as
7124 all_but_ext.
7125 For pkgdatadir muscle, maintain previous functionality by using
7126 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
7127 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
7128 digraphs would never be expanded. Hopefully no one has M4-special
7129 characters in his Bison installation path.
7130 * src/scan-skel.l: Don't parse @output_header_name@ and
7131 @output_parser_name@ anymore since they're now redundant.
7132 In @output, use decode_at_digraphs.
7133 Parse a new @basename command that invokes last_component.
7134 (decode_at_digraphs): New.
7135 (BASE_QPUTS): Remove unused.
7136 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
7137 (Output file name): New tests.
7138
3f7ca628
JD
71392006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
7140
7141 Warn about output files that are generated by the skeletons and that
7142 conflict with other output files.
7143 * data/glr.c: Don't generate the header file here when glr.cc does.
7144 * src/files.c (file_names, file_names_count): New static globals.
7145 (compute_output_file_names): Invoke output_file_name_check for files
7146 not generated by the skeletons and remove existing checks.
7147 (output_file_name_check): New function that warns about conflicting
7148 output file names.
7149 (output_file_names_free): Free file_names.
7150 * src/files.h (output_file_name_check): Declare.
7151 * src/scan-skel.l: Invoke output_file_name_check for files generated by
7152 the skeletons.
7153 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
7154 (Conflicting output files): New tests.
7155
178e123e
PE
71562006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7157
7158 * doc/bison.texinfo: Fix a couple of typos.
7159
71602006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
7161
7162 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
7163 Rename to...
7164 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
7165 update all uses.
7166 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
7167 (yypush_parse): Rename yypvars argument to yyps and remove redundant
7168 local pv.
7169 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
7170 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
7171
ea17f233
JD
71722006-12-07 Bob Rossi <bob@brasko.net>
7173 and Joel Denny <jdenny@ces.clemson.edu>
7174
7175 * data/push.c (yypvarsinit): Change return type from void* to struct
7176 yypvars*. No longer cast to void* on return.
7177 (struct yypvars): Remove yylen since it need not be remembered between
7178 yypushparse invocations.
7179 (yypushparse): Don't copy between yylen and pv->yylen.
7180
55a30bda
JD
71812006-12-05 Bob Rossi <bob@brasko.net>
7182
7183 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
7184 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
7185 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
7186 (struct yypvars): Remove b4_declare_parser_variables.
7187 (yypvarsinit): Remove init code for removed variables.
7188 (global scope): Do not declare b4_declare_parser_variables if
7189 push or pure mode.
7190 (yypushparse): Add b4_declare_parser_variables.
7191 Init new local variables, and remove init code for removed
7192 yypvars variables.
7193 (yyparse): Delete.
7194 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
7195 and yyparse for other modes.
7196 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
7197 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
7198 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
7199 (AT_PURE_LEX_IF): True if pure or push parser.
7200
85894313
JD
72012006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
7202
7203 Document Yacc prologue alternatives and default %destructor's and
7204 %printer's as experimental. Don't mention Java yet. Discussed at
7205 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
7206 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
7207 (2.3a): Annotate this entry to say the old forms of these features were
7208 also experimental.
7209 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 7210 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
7211 of Java (we'll want this back eventually).
7212
02975b9a
JD
72132006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
7214
7215 Support a file name argument to %defines. Deprecate `=' in
7216 %file-prefix, %name-prefix, and %output. Discussed at
7217 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
7218 * NEWS (2.3a+): Mention.
148d66d8 7219 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
7220 form of %defines, and remove `=' from entries for %file-prefix,
7221 %name-prefix, and %output.
7222 * src/parse-gram.y (prologue_declaration): Implement.
7223 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
7224 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
7225 all but one occurrence of %name-prefix.
7226 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
7227 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
7228 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
7229 occurrence of each of %file-prefix and %output. Add check for %defines
7230 with argument.
7231 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
7232 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
7233 Remove the `=' from %output.
7234
287b314e
JD
72352006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
7236
7237 Don't escape $ in test case titles since Autoconf 2.61 now does that
7238 correctly.
7239 * tests/actions.at (Default %printer and %destructor are not for error
7240 or $undefined): Here.
7241 (Default %printer and %destructor are not for $accept): Here.
7242 * tests/input.at (Invalid $n and @n): Here.
7243
3ebecc24
JD
72442006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
7245
7246 Rename <!> to <>. Discussed starting at
7247 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
7248 * NEWS (2.3a+): Update.
148d66d8 7249 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
7250 Update.
7251 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
7252 * src/scan-gram.l (INITIAL): Implement.
7253 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
7254 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
7255 comment.
7256 * tests/actions.at (Default tagless %printer and %destructor,
7257 Default tagged and per-type %printer and %destructor,
7258 Default %printer and %destructor are not for error or $undefined,
7259 Default %printer and %destructor are not for $accept,
7260 Default %printer and %destructor for mid-rule values): Update.
7261 * tests/input.at (Default %printer and %destructor redeclared,
7262 Unused values with default %destructor): Update.
7263
26b8a438
JD
72642006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
7265
7266 Don't let %prec take a nonterminal.
7267 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
7268 token.
7269 * tests/input.at (%prec takes a token): New test checking that %prec
7270 won't take a nonterminal.
7271
07c39ae9
JD
72722006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7273
405d53b7
JD
7274 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
7275 it was double-quoted.
07c39ae9
JD
7276 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
7277 grammar is maintained with Bison's highest standards.
7278 * src/getargs.c: Fix some typos in Doxygen comments.
7279
580b8926
JD
72802006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7281
7282 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
7283 later. Reported by Paul Eggert in
7284 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
7285 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
7286 * src/scan-code.l (translate_action): Don't bother invoking
7287 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
7288 (code_scanner_free): Instead of invoking
7289 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
7290 which frees more.
7291 * src/scan-gram.l (gram_scanner_free): Likewise.
7292 * src/scan-skel.l (scan_skel): Likewise.
7293
4502eadc
JD
72942006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
7295
7296 * src/files.c (tr): Change return type to void.
7297 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
7298 has been called previously for the same key.
7299 (muscle_find): Return storage instead of value so that
7300 --enable-gcc-warnings doesn't produce warnings that the return discards
7301 const. aver that the value and storage are the same since storage
7302 could potentially be NULL when value is not.
7303 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
7304 same as 0.
7305
7746c8f6
PE
73062006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7307
7308 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
7309 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
7310 us a slightly cleaner distribution, and also works.
7311 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
7312 gnulib changes.
7313
eb095650
PE
73142006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
7315 and Paul Eggert <eggert@cs.ucla.edu>
7316
7317 Don't let Bison leak memory except when it complains.
7318 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
7319 (spec_defines_file, dir_prefix): Now char *, not const char *,
7320 since they are freed.
7321 * src/files.c: Likewise.
7322 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
7323 Likewise.
7324 (tr): Now operates in-place. All uses changed.
7325 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
7326 values.
7327 (compute_file_name_parts, compute_output_file_names): Don't store
7328 read-only data in variables that will be freed.
7329 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
7330 src_extension, and header_extension.
7331 (output_file_names_free): New public function to free
7332 spec_verbose_file, spec_graph_file, spec_defines_file,
7333 parser_file_name, and dir_prefix.
7334 * src/getargs.c (getargs): Don't store read-only data in variables that
7335 will be freed.
7336 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
7337 (which previously existed but was unused), and quotearg_free.
7338 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
7339 * src/muscle_tab.c: Likewise.
7340 (muscle_entry): Make the value char const *,
7341 and add a new storage member that is char * and can be freed.
7342 (muscle_entry_free): New private function.
7343 (muscle_init): Use it instead of free.
7344 (muscle_insert, muscle_grow): Update and use new storage member.
7345 (muscle_code_grow): Free the string passed to muscle_grow
7346 since it's not needed anymore.
7347 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
7348 add a new `char *code' member.
7349 ("{...}"): Declare semantic type as code.
7350 * src/scan-code.h (translate_rule_action):
7351 (translate_symbol_action, translate_code, translate_action): Return
7352 `char const *' rather than `char *' since external code should not free
7353 these strings.
7354 * src/scan-code.l: Likewise.
7355 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
7356 which is "{...}" in the parser.
7357 * tests/Makefile.am (maintainer-check-valgrind): Set
7358 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
7359 Valgrind.
7360 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
7361 complain.
7362 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
7363 expecting a non-zero exit status sets --leak-check=summary and
7364 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
7365 this case, and we don't want to hear about it.
7366
ac564be4
PE
73672006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7368
7369 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
7370 instead of from the template, to simplify configuration a bit.
7371 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
7372 and m4/wint_t.m4, as they are needed with the latest gnulib.
7373
17bd8a73
JD
73742006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7375
7376 Disable unset/unused mid-rule value warnings by default, and recognize
7377 --warnings=midrule-values to enable them. Discussed starting at
7378 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
7379 * NEWS (2.3a+): Mention.
7380 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
7381 warnings): Add entry for midrule-values subargument.
7382 * src/reader.c (symbol_should_be_used): Don't return true just because
7383 the value is a set/used mid-rule value unless
7384 --warnings=midrule-values was specified.
7385 * tests/input.at (Unused values, Unused values before symbol
7386 declarations): Run tests with and without --warnings=midrule-values.
7387
7388 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
7389 than LIST_FREE directly.
7390
89eb3c76
JD
73912006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7392
7393 Finish implementing --warnings=error, which should not be implied by
7394 --warnings=all (or by its synonyms -W and --warnings without
7395 subarguments).
7396 * src/complain.c (set_warning_issued): New function to report that
7397 warnings are being treated as errors and to record an error if so.
7398 Invoke...
7399 (warn_at, warn): ... here.
7400 * src/getargs.c (warnings_args, warnings_types): Reorder so that
7401 "error - warnings are errors" does not appear above "all - all of the
7402 above".
7403 (getargs): For -W and --warnings without subarguments, don't let
7404 FLAGS_ARGMATCH set warnings_error in warnings_flag.
7405 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
7406
ba7560e2
JD
74072006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7408
7409 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
7410 empty subargument list. For example: `bison --warnings= parser.y'.
7411
31283fc3
JD
74122006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7413
7414 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
7415 the parser header file so that gcc doesn't warn.
7416
12e35840
JD
74172006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7418
7419 Split the default %destructor/%printer into two kinds: <*> and <!>.
7420 Discussed starting at
7421 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
7422 * NEWS (2.3a+): Mention.
7423 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
7424 previous change today related to mid-rules.
148d66d8 7425 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 7426 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
7427 (TYPE_TAG_ANY): Add as <*>.
7428 (TYPE_TAG_NONE): Add as <!>.
7429 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
7430 for <*> and <!>.
7431 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
7432 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
7433 * src/symlist.c (symbol_list_default_new): Split into tagged and
7434 tagless versions.
7435 (symbol_list_destructor_set, symbol_list_printer_set): Split
7436 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
7437 SYMLIST_DEFAULT_TAGLESS.
7438 * src/symlist.h: Update symbol_list_default*_new prototypes.
7439 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
7440 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
7441 * src/symtab.c (default_destructor, default_destructor_location,
7442 default_printer, default_printer_location): Split each into tagged and
7443 tagless versions.
7444 (symbol_destructor_get, symbol_destructor_location_get,
7445 symbol_printer_get, symbol_printer_location_get): Implement tagged
7446 default and tagless default cases.
7447 (default_destructor_set, default_printer_set): Split each into tagged
7448 and tagless versions.
7449 * src/symtab.h: Update prototypes.
7450 * tests/actions.at (Default %printer and %destructor): Rename to...
7451 (Default tagless %printer and %destructor): ... this, and extend.
7452 (Per-type %printer and %destructor): Rename to...
7453 (Default tagged and per-type %printer and %destructor): ... this, and
7454 extend.
7455 (Default %printer and %destructor for user-defined end token): Extend.
7456 (Default %printer and %destructor are not for error or $undefined):
7457 Update.
7458 (Default %printer and %destructor are not for $accept): Update.
7459 (Default %printer and %destructor for mid-rule values): Extend.
7460 * tests/input.at (Default %printer and %destructor redeclared): Extend.
7461 (Unused values with default %destructor): Extend.
7462
f91b1629
JD
74632006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7464
7465 Don't apply the default %destructor/%printer to an unreferenced midrule
7466 value. Mentioned at
7467 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
7468 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
7469 like $@n instead of just @n so that the default %destructor/%printer
7470 logic doesn't see them as user-defined symbols.
7471 (symbol_is_dummy): Check for both forms of the name.
7472 * src/reader.c (packgram): Remove the `$' from each midrule symbol
7473 name for which the midrule value is referenced in any action.
7474 * tests/actions.at (Default %printer and %destructor for mid-rule
7475 values): New test.
7476 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
7477 for change to dummy symbol names.
7478
519d0004
JD
74792006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7480
7481 Warn about unset midrule $$ if the corresponding $n is used.
7482 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
7483 $n usage.
7484 (packgram): Before invoking grammar_rule_check on any rule, make sure
7485 all actions have already been scanned in order to set `used' flags.
7486 Otherwise, checking that a midrule's $$ is set will not always work
7487 properly because the midrule check must forward-reference the midrule's
7488 parent rule.
7489 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
7490 warning.
7491
a501eca9
JD
74922006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7493
7494 More improvements to the documentation of the prologue alternatives:
7495 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
7496 Bison manual.
7497 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
7498 some text to clarify the relative importance of the new directives and
7499 to show how these directives may be viewed as code labels.
7500
2cbe6b7f
JD
75012006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
7502
7503 Similar to the recently removed %before-header, add %code-top as the
7504 alternative to the pre-prologue. Mentioned at
7505 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
7506 Also, let the prologue alternatives appear in the grammar section.
7507 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
7508 (prologue_declaration): Move the existing prologue alternatives to...
7509 (grammar_declaration): ... here and add %code-top.
7510 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
7511
7512 Clean up and extend documentation for the prologue alternatives.
7513 * NEWS (2.3a+): Describe prologue alternatives.
7514 * doc/bison.texinfo (Prologue): Move discussion of prologue
7515 alternatives to...
7516 (Prologue Alternatives): ... this new section, and extend it to discuss
7517 all 4 directives in detail.
148d66d8
JD
7518 (Table of Symbols): Clean up discussion of prologue alternatives and
7519 add %code-top.
2cbe6b7f 7520
e557d3ea
JMG
75212006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7522
7523 DJGPP specific issues.
7524
7525 * djgpp/config.bat: config.hin has been moved to lib. Adjust
7526 config.bat accordingly.
7527 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
7528 * djgpp/config.site: Likewise.
7529
136a0f76
PB
75302006-10-16 Paolo Bonzini <bonzini@gnu.org>
7531
27bd5d67
PB
7532 Replace %*-header with %provides, %requires, %code. See discussion at
7533 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
7534
136a0f76
PB
7535 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
7536 (b4_user_start_header): Remove.
7537 * data/glr.c: Use new macros instead of b4_*start_header
7538 and b4_*end_header.
7539 * data/glr.cc: Likewise.
7540 * data/lalr1.cc: Likewise.
7541 * data/push.c: Likewise.
7542 * data/yacc.c: Likewise.
7543
7544 * doc/bison.texinfo: Remove %before-header, rename
7545 %{start,end,after}-header to %requires, %provides, %code.
7546
7547 * src/parse-gram.y: Likewise (also rename token names accordingly).
7548 * src/scan-gram.l: Likewise.
7549 * tests/actions.at: Likewise.
7550
10f429ef
PE
75512006-10-14 Paul Eggert <eggert@cs.ucla.edu>
7552
7553 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
7554 Problem reported by Joel E. Denny.
7555
75562006-10-14 Jim Meyering <jim@meyering.net>
7557
7558 (Sync from coreutils.)
7559 Work also when the working directory (with e.g. coreutils sources)
7560 is version controlled with git, rather than CVS.
7561 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
7562 rather than CVS.
7563 In messages and comments, say e.g., "checked-out sources",
7564 rather than "CVS sources".
7565 (version_controlled_file): New function. Work for git as well as
7566 for CVS. Don't use grep's -q option.
7567 (slurp): Call it here, in place of CVS-specific code.
7568
c4bd5bf7
JD
75692006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
7570
7571 Fix testsuite for ./configure --enable-gcc-warnings:
7572 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
7573 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
7574 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
7575 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
7576 * test/regression.at (Diagnostic that expects two alternatives):
7577 Likewise.
7578
46356ea4
PE
75792006-10-12 Paul Eggert <eggert@cs.ucla.edu>
7580
231ed89a
PE
7581 * bootstrap.conf (gnulib_modules): Add config-h.
7582 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
7583 worry about HAVE_CONFIG_H.
7584 * lib/abitset.c: Likewise.
7585 * lib/bitset.c: Likewise.
7586 * lib/bitset_stats.c: Likewise.
7587 * lib/bitsetv-print.c: Likewise.
7588 * lib/bitsetv.c: Likewise.
7589 * lib/ebitset.c: Likewise.
7590 * lib/get-errno.c: Likewise.
7591 * lib/lbitset.c: Likewise.
7592 * lib/subpipe.c: Likewise.
7593 * lib/timevar.c: Likewise.
7594 * lib/vbitset.c: Likewise.
7595 * lib/bitset.c: Include "bitset.h" first, to test interface.
7596 * lib/bitset_stats.c: Include "bitset_stats.h" first.
7597 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
7598 * lib/bitsetv.c: Include "bitsetv.h" first.
7599 * lib/get-errno.c: Include "get-errno.h" first.
7600 * m4/.cvsignore: Add config-h.m4.
7601 * tests/actions.at (Default %printer and %destructor for ...):
7602 Adjust expected line numbers in output to reflect removal of #if
7603 HAVE_CONFIG_H lines.
7604 * tests/glr-regression.at (Missed %merge type warnings when ...):
7605 Likewise.
7606 * tests/regression.at (Braced code in declaration in rules section):
7607 Likewise.
7608 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
7609 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
7610 Include <config.h> unconditionally.
7611
46356ea4
PE
7612 * bootstrap: Sync from coreutils, as follows:
7613
7614 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
7615
7616 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
7617 variable was sometimes used without being initialized. This
7618 messed up the installation of the INSTALL file in some cases.
7619
7620 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
7621
7622 * bootstrap (usage, main program, symlink_to_gnulib): Add option
7623 --copy. Inspired by a suggestion from Bruno Haible.
7624
7625 2006-10-03 Jim Meyering <jim@meyering.net>
7626
7627 * bootstrap: Undo last change to this file, since now gnulib-tool
7628 sticks with the automake default in generating dependencies.
7629
dd4bf078
PE
76302006-10-12 Paul Eggert <eggert@cs.ucla.edu>
7631
cf2a5f7c
PE
7632 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
7633 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
7634
7635 * doc/bison.1: Add copyright notice.
7636
7637 * data/glr.c: Don't include <stdarg.h>; not used.
7638
35fe0834
PE
7639 * NEWS: The -g and --graph options now output graphs in Graphviz
7640 DOT format, not VCG format.
7641 * doc/bison.1: Likewise.
7642 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
7643 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
7644 of this change in
7645 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
7646 * TODO: Remove Graphviz entry.
7647 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
7648 remove vcg.c, vcg.h, vcg_defaults.h.
7649 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
7650 * src/graphviz.c, src/graphviz.h: New files.
7651 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
7652 * src/files.h: Make comment more generic.
7653 * src/main.c (main): Likewise.
7654 * src/print_graph.h: Likewise.
7655 * src/getargs.c (usage): Make usage description more generic.
7656 * src/print_graph.c: Include graphviz.h rather than vcg.h.
7657 (static_graph, fgraph): Remove. All uses changed to pass
7658 arguments instead of sharing a static var.
7659 (print_core, print_actions, print_state, print_graph):
7660 Output graphviz format rather than VCG format.
7661 * tests/.cvsignore: Remove *.vcg; add *.dot.
7662 * tests/output.at: Expect *.dot files, not *.vcg files.
7663
dd4bf078
PE
7664 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
7665 accommodates the 2006-10-08 change.
7666
efdd7421
PE
76672006-10-11 Bob Rossi <bob@brasko.net>
7668
7669 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
7670 (b4_yyssa, b4_yyerror_range): New macros.
7671 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
7672 (yypvarsinit): Remove init of removed fields.
7673 (yypushparse): Remove use of removed fields; use new macros instead.
7674
96a1981a
PE
76752006-10-11 Paul Eggert <eggert@cs.ucla.edu>
7676
7677 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
7678 in a push parser. Reindent slightly to match yacc.c better.
7679
76802006-10-11 Bob Rossi <bob@brasko.net>
7681
46356ea4
PE
7682 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
7683 yymsg_alloc fields.
7684 (yypvarsinit, yypushparse): Remove init of removed fields.
7685 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 7686
c1630a8b
PE
76872006-10-09 Paul Eggert <eggert@cs.ucla.edu>
7688
7689 * THANKS: Add Paolo Bonzini and Bob Rossi.
7690
90b9908d
PB
76912006-10-08 Paolo Bonzini <bonzini@gnu.org>
7692
7693 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
7694 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
7695 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
7696 b4_define_user_cde and uses): Remove.
7697 (b4_comment, b4_prefix, b4_sync_start): New.
7698 * data/bison.m4: New file, with most of the content removed from c.m4.
7699 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
7700 * src/output.c (output_skeleton): Pass bison.m4.
7701 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
7702 only if specified.
7703
cf806753
PE
77042006-10-05 Paul Eggert <eggert@cs.ucla.edu>
7705
7706 Fix test failure reported by Tom Lane in
7707 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
7708 and try to make such failures easier to catch in the future.
7709 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
7710 that's now the caller's responsibility.
7711 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
7712 Set yychar = YYEOF if it's negative.
7713 * tests/actions.at (yylex): Abort if asked to read past EOF.
7714 * tests/conflicts.at (yylex): Likewise.
7715 * tests/cxx-type.at (yylex): Likewise.
7716 * tests/glr-regression.at (yylex): Likewise.
7717 * tests/input.at (yylex): Likewise.
7718 * tests/regression.at (yylex): Likewise.
7719 * tests/torture.at (yylex): Likewise.
7720
0e2f006a
PE
77212006-10-01 Paul Eggert <eggert@cs.ucla.edu>
7722
7723 Fix problems with translating English-language diagnostics.
7724 * bootstrap: Fix bug introduced in recent bootstrap changes, with
7725 respect to bison-runtime pot generation. The YY_ stuff
7726 wasn't being captured.
7727 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
7728 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
7729 * runtime-po/POTFILES.in: Add data/push.c.
7730
e3ddc1e3
PE
77312006-09-29 Paul Eggert <eggert@cs.ucla.edu>
7732
7733 Merge bootstrap changes from coreutils.
7734
7735 2006-09-28 Jim Meyering <jim@meyering.net>
7736
7737 Automatically generated dependencies are important even
7738 when all of the sources in a directory come from gnulib.
7739 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
7740 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
7741
7742 2006-09-23 Jim Meyering <jim@meyering.net>
7743
7744 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
7745
7746 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7747
7748 * bootstrap: Add support for --force.
7749 (usage): New function. Describe usage less tersely.
7750 (CVS_only_file): New var.
7751
01e972b3
PE
77522006-09-21 Paul Eggert <eggert@cs.ucla.edu>
7753
7754 * data/push.c (YYPUSH_MORE): Make it an enum instead.
7755 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
7756 Adjust white space and comments to match GNU style better.
7757
c63d3e90
PE
77582006-09-20 Bob Rossi <bob@brasko.net>
7759
7760 * data/push.c (yyresult_get): Remove function.
7761 (YYPUSH_MORE): Add #define.
7762 (yypushparse): Modify return value.
7763
e70f46d1
PE
77642006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7765
7766 * stamp-h.in: Remove; no longer needed.
7767 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
7768 Remove config.h, config.hin, intl (no longer created).
7769 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
7770 stamp-h1.
7771
7772 Sync bootstrap from coreutils, as follows:
7773
7774 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
7775
7776 * bootstrap (symlink_to_gnulib): New function.
7777 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
7778 to copies-of-gnulib.
7779 (cp_mark_as_generated, slurp, gnulib_files):
7780 Avoid making a copy if it's the same as the old version.
7781 (gnulib_files): Add support for this variable (used by Bison).
7782
a92be413
PE
77832006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7784
7785 * src/getargs.c (usage): Rework to use conventions similar to
7786 coreutils, to make translation a bit easier and the code a bit
7787 smaller. Problem reported by Tim Van Holder.
7788
4f82b42a
PE
77892006-09-15 Paul Eggert <eggert@cs.ucla.edu>
7790
3b2942e6
PE
7791 Use some of gnulib's new modules, taken from coreutils.
7792
7793 * bootstrap: Sync from coreutils, except add support for gnulib_files.
7794 * bootstrap.conf: New file.
7795 (gnulib_modules): Add configmake, inttypes, unistd.
7796 (XGETTEXT_OPTIONS): Add complain, complain_at,
7797 fatal, fatal_at, warn, warn_at, unexpected_end.
7798 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
7799 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
7800 (gl_EARLY): Add.
7801 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
7802 (gl_INIT): Add
7803 (GNULIB_AUTOCONF_SNIPPET): Remove.
7804 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
7805 the pickiest.
7806 * lib/.cvsignore: Add inttypes_.h.
7807 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
7808 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
7809 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
7810 no-longer-necessary initializations.
7811 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
7812 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
7813 use the unistd module.
7814 * src/system.h: Likewise.
7815 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
7816 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
7817 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
7818 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
7819 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
7820 * src/system.h: Include inttypes.h unconditionally, now that we
7821 use the inttypes module. Don't bother to include stdint.h, since
7822 inttypes.h now does that for us.
7823 (LOCALEDIR): Remove, now that we use the configmake module.
7824 * src/getargs.c: Include configmake.h.
7825 * src/main.c: Likewise.
7826 * src/output.c: Likewise.
7827 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
7828 not from $abs_top_builddir, since config.h moved.
7829
7830
4f82b42a
PE
7831 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
7832 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
7833
7834 * src/parse-gram.y (symbol_declaration): Don't put statements
7835 before declarations; it's not portable to C89.
7836 * src/scan-code.l (handle_action_at): Likewise.
7837
7838 * src/scan-code.l: Always initialize braces_level; the old code
7839 left it uninitialized and therefore had undefined behavior.
7840
7841 Don't attempt to redefine 'assert', since it runs afoul of
7842 systems where standard headers (mistakenly) include <assert.h>.
7843 Instead, define and use our own alternative, called 'aver'.
7844 * src/reader.c: Don't include assert.h, since we no longer
7845 use assert.
7846 * src/scan-code.l: Likewise.
7847 * src/system.h (assert): Remove, replacing with....
7848 (aver): New function, taking a bool arg. All uses changed.
7849 * src/tables.c (pack_vector): Ensure that aver arg is bool,
7850 not merely an integer.
7851
31c10e38
PE
78522006-09-15 Bob Rossi <bob@brasko.net>
7853
7854 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
7855 * data/c.m4 (YYPUSH): New.
7856 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
7857 * src/getargs.c (push_parser): New var.
7858 * src/getargs.h (push_parser): New declaration.
7859 * src/output.c (prepare): Add macro insertion of `push_flag'.
7860 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
7861 (prologue_declaration): Parse %push-parser.
7862 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
7863 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
7864 list of removed lines from the traces observed.
7865 (AT_CHECK_CALC_LALR): Added push parser tests.
7866
fa7b79c0
PE
78672006-09-13 Paul Eggert <eggert@cs.ucla.edu>
7868
21fe08ca
PE
7869 * NEWS: Version 2.3a.
7870 * configure.ac (AC_INIT): Likewise.
7871
e8ec4d9b
PE
7872 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
7873 "#define YYSTYPE int" that caused "make maintainer-check" to fail
7874 due to header ordering dependencies. I don't know why the #define
7875 was there.
7876
fa7b79c0
PE
7877 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
7878 runtime cost when YYDEBUG is not defined, and so that some tests
7879 that used to fail now work. Problem and initial suggestion by
7880 Paolo Bonzini.
7881 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
7882 * data/glr.cc (b4_parser_class_name):
7883 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
7884 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
7885 (yydebug_) [YYDEBUG]: New member.
7886 (yycdebug_): Now defined only if YYDEBUG.
7887 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
7888 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
7889 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
7890 if YYYDEBUG.
7891 (debug_stream, set_debug_stream, debug_level, set_debug_level):
7892 Define only if YYDEBUG.
7893 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
7894 set_debug_level.
7895 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
7896 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
7897 AT_CHECK_CALC_GLR_CC that are working now.
7898
4ec13d60
PE
78992006-09-12 Paul Eggert <eggert@cs.ucla.edu>
7900
7901 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
7902 We don't need them in glr.cc, and glr.c defines them.
7903 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
7904 assumes that defining it to anything is the same as defining
7905 it to 1. Problem reported by Paolo Bonzini.
7906
8e1687ae
PE
79072006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
7908
7909 * data/c.m4 (b4_null, b4_case): Define.
7910 * src/output.c (prepare_symbols): Use b4_null.
7911 (user_actions_output): Use b4_case.
7912
3dc5e96b
PE
79132006-09-11 Paul Eggert <eggert@cs.ucla.edu>
7914
aef3da86
PE
7915 * data/glr.c (b4_shared_declarations): Put start-header first,
7916 before any #includes that we generate, so that feature-test
7917 macros work. Problem reported by Michael Deutschmann in
7918 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
7919 * data/lalr1.cc: Likewise.
7920 * doc/bison.texinfo (Prologue): Document that feature-test macros
7921 should be defined before any Bison declarations.
7922 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
7923 that depend on location.hh after, not before, Bison decls, since
7924 we now include location.hh after the first user prologue.
7925
3dc5e96b
PE
7926 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
7927 Sander Brandenburg in
7928 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
7929 Also, fix minor white space and comment issues.
aef3da86
PE
7930 (Prologue): Mention that it's better to define feature-test macros
7931 before Bison declarations. Problem reported by Michael Deutschmann.
7932
7933 * README-cvs: Fix typo: "&" should be "&&". Problem reported
7934 by Jim Meyering.
7935 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
7936 This adjusts to recent gnulib changes.
3dc5e96b 7937
b2a0b7ca
JD
79382006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
7939
7940 Finish implementation of per-type %destructor/%printer. Discussed
7941 starting at
7942 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
7943 and
7944 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
7945 * NEWS (2.3+): Add a description of this feature to the default
7946 %destructor/%printer description.
7947 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
7948 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
7949 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
7950 list node contains a semantic type.
7951 * src/symtab.c, src/symtab.h: Extend with a table that associates
7952 semantic types with their %destructor's and %printer's.
7953 (semantic_type_from_uniqstr, semantic_type_get,
7954 semantic_type_destructor_set, semantic_type_printer_set): New functions
7955 composing the public interface of that table.
7956 (symbol_destructor_get, symbol_destructor_location_get,
7957 symbol_printer_get, symbol_printer_location_get): If there's no
7958 per-symbol %destructor/%printer, look up the per-type before trying
7959 the default.
7960 * tests/actions.at (Per-type %printer and %destructor): New test case.
7961 * tests/input.at (Default %printer and %destructor redeclared):
7962 Extend to check that multiple occurrences of %symbol-default in a
7963 single %destructor/%printer declaration is an error.
7964 (Per-type %printer and %destructor redeclared, Unused values with
7965 per-type %destructor): New test cases.
7966
3be03b13
JD
79672006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
7968
7969 Require default %destructor/%printer to be declared using
7970 %symbol-default instead of an empty symbol list, and start working on
7971 new per-type %destructor/%printer. Discussed at
7972 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
7973 * NEWS (2.3+): Add %symbol-default to example.
7974 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 7975 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
7976 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
7977 (generic_symlist, generic_symlist_item): New nonterminals for creating
7978 a list in which each item is a symbol, semantic type, or
7979 %symbol-default.
7980 (grammar_declaration): Use generic_symlist in %destructor and %printer
7981 declarations instead of symbols.1 or an empty list.
7982 (symbol_declaration, precedence_declaration, symbols.1): Update actions
7983 for changes to symbol_list.
7984 * src/reader.c: Update for changes to symbol_list.
7985 * src/scan-code.l: Likewise.
7986 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
7987 * src/symlist.c, src/symlist.h: Extend such that a list node may
7988 represent a semantic type or a %symbol-default in addition to just an
7989 ordinary symbol. Add switched functions for setting %destructor's and
7990 %printer's.
7991 * tests/actions.at, tests/input.at: Add %symbol-default to all default
7992 %destructor/%printer declarations.
7993
3508ce36
JD
79942006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
7995
7996 Whether the default %destructor/%printer applies to a particular symbol
7997 isn't a question of whether the user *declares* that symbol (in %token,
7998 for example). It's a question of whether the user by any means
7999 *defines* the symbol at all (by simply using a char token, for
8000 example). $end is defined by Bison whereas any other token with token
8001 number 0 is defined by the user. The error token is always defined by
8002 Bison regardless of whether the user declares it with %token, but we
8003 may one day let the user define error as a nonterminal instead.
8004 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
8005 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
8006 the meaning of "user-defined".
8007 * tests/actions.at (Default %printer and %destructor for user-declared
8008 end token): Rename to...
8009 (Default %printer and %destructor for user-defined end token): ...
8010 this.
8011
8012 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
8013 computation of whether to apply the default, don't maintain a list of
8014 every Bison-defined symbol. Instead, just check for a first character
8015 of '$', which a user symbol cannot have, and check for the error token.
8016
9350499c
JD
80172006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
8018
8019 Don't apply the default %destructor or %printer to the error token,
8020 $undefined, or $accept. This change fits the general rule that the
8021 default %destructor and %printer are only for user-declared symbols,
8022 and it solves several difficulties that are described in the new test
8023 cases listed below.
8024 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
8025 * tests/actions.at (Default %printer and %destructor are not for error
8026 or $undefined, Default %printer and %destructor are not for $accept):
8027 New test cases.
8028
4d7370cb
JD
80292006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
8030
8031 Allow %start after the first rule.
8032 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
8033 when parsing the first rule.
8034 (check_and_convert_grammar): Search for it here after all grammar
8035 declarations have been parsed. Skip midrules, which have dummy LHS
8036 nonterminals.
8037 * src/symtab.c (symbol_is_dummy): New function.
8038 * src/symtab.h (symbol_is_dummy): Declare it.
8039 * tests/input.at (%start after first rule): New test.
8040
6d0ef4ec
JD
80412006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8042
8043 Redo some of the previous commit: add back the ability to use
8044 non-aliased/undeclared string literals since it might be useful to
8045 those declaring %token-table.
8046 * src/reader.c (check_and_convert_grammar): Undo changes in previous
8047 commit: don't worry about complaints from symbols_pack.
8048 * src/symtab.c (symbol_new, symbol_class_set,
8049 symbol_check_alias_consistency): Undo changes in previous commit: count
8050 each string literal as a new symbol and token, assign it a symbol
8051 number, and don't complain about non-aliased string literals.
8052 (symbols_pack): Since symbol_make_alias still does not decrement symbol
8053 and token counts but does still set aliased tokens to the same number,
8054 symbol_pack_processor now leaves empty slots in the symbols array.
8055 Remove those slots.
8056 * tests/regression.at (Undeclared string literal): Remove test case
8057 added in previous commit since non-aliased string literals are allowed
8058 again.
8059 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
8060 remove unnecessary string literal declarations.
8061 * tests/sets.at (Firsts): Likewise.
8062
965537bc
JD
80632006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8064
8065 Don't allow an undeclared string literal, but allow a string literal to
8066 be used before its declaration.
8067 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
8068 symbols_pack complained.
8069 * src/symtab.c (symbol_new): Don't count a string literal as a new
8070 symbol.
8071 (symbol_class_set): Don't count a string literal as a new token, and
8072 don't assign it a symbol number since symbol_make_alias does that.
8073 (symbol_make_alias): It's not necessary to decrement the symbol and
8074 token counts anymore. Don't assume that an alias declaration occurs
8075 before any uses of the identifier or string, and thus don't assert that
8076 one of them has the highest symbol number so far.
8077 (symbol_check_alias_consistency): Complain if there's a string literal
8078 that wasn't declared as an alias.
8079 (symbols_pack): Bail if symbol_check_alias_consistency failed since
8080 symbol_pack asserts that every token has been assigned a symbol number
8081 although undeclared string literals have not.
8082 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 8083 string literal): New test cases.
965537bc
JD
8084 (Characters Escapes, Web2c Actions): Declare string literals as
8085 aliases.
8086 * tests/sets.at (Firsts): Likewise.
8087
47aee066
JD
80882006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
8089
8090 In the grammar scanner, STRING_FINISH unclosed constructs and return
8091 them to the parser in order to improve error messages.
8092 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
8093 SC_BRACED_CODE, SC_PROLOGUE): Implement.
8094 * tests/input.at (Unclosed constructs): New test case.
8095 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
8096 seen.
8097
8098 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
8099 unused global.
8100
1f6b3679
JD
81012006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
8102
8103 Handle string aliases for character tokens correctly.
8104 * src/symtab.c (symbol_user_token_number_set): If the token has an
8105 alias, check and set its alias's user token number instead of its own,
8106 which is set to indicate the alias. Previously, every occurrence of
8107 the character token in the grammar overwrote that alias indicator with
8108 the character code.
8109 * tests/input.at (String aliases for character tokens): New test.
8110
219741d8
JD
81112006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
8112
8113 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
8114
11daa4e7
PE
81152006-08-11 Paul Eggert <eggert@cs.ucla.edu>
8116
8117 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
8118 to prevent failures when building on older platforms.
8119 Check for autopoint failure.
8120 Set XGETTEXT_OPTIONS to values that check for C format strings,
8121 so that translators are warned about them (this also helps
8122 prevent core dumps).
8123
8124 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
8125 function, since it simplifies our code a bit.
8126
8127 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
8128 rather than -W, so we don't get bogus warnings about sign comparisons.
8129 Add -Wpointer-arith, since that warning is useful (it reports code
8130 that does not conform to C89 and that some compilers reject).
8131 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
8132 since it's no longer needed.
8133
f9bfc42a
JD
81342006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
8135
8136 Clean up scanners a bit.
8137 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
8138 definitions so gcc won't warn when obstack_for_string is unused.
8139 * src/scan-code.l: config.h and system.h are already #include'd by
8140 scan-code-c.c, so get rid of them here.
8141 * src/scan-gram.l: Likewise.
8142 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
8143 definitions rather than duplicating the rest of it.
8144 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
8145
06e8700a
JD
81462006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
8147
8148 Suppress signed/unsigned comparison warnings for yycheck.
8149 * data/c.m4 (b4_safest_int_type): New macro.
8150 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
8151 a signed int type, cast it to b4_safest_int_type first.
8152 * data/yacc.c: Likewise.
8153 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
8154 also overwritten.
8155
9c437126
PE
81562006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
8157
8158 * doc/bison.texinfo: Fix some typos.
8159
284d8a13
PE
81602006-08-02 Paul Eggert <eggert@cs.ucla.edu>
8161
8162 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
8163 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
8164
8165 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
8166 the latest gnulib does this a different way.
8167 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
8168 translation was patched, so stop omitting it.
8169
ec5479ce
JD
81702006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8171
8172 Enable declaration of default %printer/%destructor. Make the parser
8173 use these for all user-declared grammar symbols for which the user does
8174 not declare a specific %printer/%destructor. Thus, the parser uses it
8175 for token 0 if the user declares it but not if Bison generates it as
8176 $end. Discussed starting at
8177 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
8178 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
8179 and
8180 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
8181 * NEWS (2.3+): Mention.
8182 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
8183 declare a %destructor for a mid-rule's semantic value. It's just
8184 impossible to declare one specific to it.
8185 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
8186 code. Describe default %destructor form.
8187 * src/parse-gram.y (grammar_declaration): Parse default
8188 %printer/%destructor declarations.
8189 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
8190 and symbol_destructor_location_get rather than accessing the destructor
8191 and destructor_location members of struct symbol.
8192 (symbol_printers_output): Likewise but for %printer's.
8193 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
8194 again.
8195 * src/symtab.c (default_destructor, default_destructor_location,
8196 default_printer, default_printer_location): New static global
8197 variables to record the default %destructor and %printer.
8198 (symbol_destructor_get, symbol_destructor_location_get,
8199 symbol_printer_get, symbol_printer_location_get): New functions to
8200 compute the appropriate %destructor and %printer for a symbol.
8201 (default_destructor_set, default_printer_set): New functions to set the
8202 default %destructor and %printer.
8203 * src/symtab.h: Prototype all those new functions.
8204 * tests/actions.at (Default %printer and %destructor): New test to
8205 check that the right %printer and %destructor are called, that they're
8206 not called for $end, and that $$ and @$ work correctly.
8207 (Default %printer and %destructor for user-declared end token): New
8208 test to check that the default %printer and %destructor are called for
8209 a user-declared end token.
8210 * tests/input.at (Default %printer and %destructor redeclared, Unused
8211 values with default %destructor): New tests to check related grammar
8212 warnings and errors.
8213
868d2d96
JD
82142006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8215
8216 Clean up handling of %destructor for the end token (token 0).
8217 Discussed starting at
8218 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
8219 and
8220 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
8221
8222 Make the skeletons consistent in how they pop the end token and invoke
8223 its %destructor.
8224 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
8225 state, which has token number 0, since this would invoke the
8226 %destructor for the end token.
8227 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
8228 until after shifting the end token, or else it won't be popped.
8229 * data/yacc.c (yyparse): Likewise.
8230
8231 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
8232 it's the end token. Upon termination, destroy an unshifted lookahead
8233 even when it's the end token.
8234 * data/lalr1.cc (yy::parser::parse): Likewise.
8235 * data/yacc.c (yyparse): Likewise.
8236
8237 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
8238 value warnings for the end token when the user gives the end token a
8239 %destructor.
8240
8241 * tests/actions.at (Printers and Destructors): Test all the above.
8242
62a9592d
PE
82432006-07-24 Paul Eggert <eggert@cs.ucla.edu>
8244
8245 Update to latest gnulib and gettext versions.
8246 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
8247 Add fopen-safer.
8248 (gnulib_files): Add m4/warning.m4. Don't worry about files
8249 overwritten by autopoint.
8250 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
8251 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
8252 rejects them.
8253 Don't use autoreconf; instead, invoke autopoint etc. by hand,
8254 so that we can remove the intl files at a better time.
8255 (intl_files_to_remove): Remove aclocal.m4, since it gets
8256 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
8257 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
8258 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
8259 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
8260 Remove datarootdir hack; no longer needed.
8261 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
8262 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
8263 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
8264 strdup.h.
8265 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
8266 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
8267
10d6970f
PE
82682006-07-20 Paul Eggert <eggert@cs.ucla.edu>
8269
8270 * bootstrap: Adjust to today's change to gnulib-tool by invoking
8271 it with --assume-autoconf='latest-stable'.
8272
50a33993
JD
82732006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
8274
8275 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
8276 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
8277 YYSTYPE' and `{'.
8278 * src/muscle_tab.h (muscle_grow): Replace the header comments with
8279 those from muscle_tab.c since the old ones are misleading.
8280
2ce4ed68
AD
82812006-07-13 Akim Demaille <akim@epita.fr>
8282
8283 Support %define "KEY" {VALUE}.
8284 * src/scan-code.h, src/scan-code.l (translate_action)
8285 (translate_rule_action, translate_symbol_action, translate_code):
8286 Return char *, not const char *.
8287 * src/parse-gram.y (declaration): Rename as...
8288 (prologue_declaration): this.
8289 (string_content): Remove this nonterminal, use STRING.
8290 (braceless, content, content.opt): New nonterminal.
8291 Use them.
8292 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
8293 as value.
8294 * src/scan-gram.l (getargs.h): Don't include it.
8295
db7e5eb5
PE
82962006-07-12 Paul Eggert <eggert@cs.ucla.edu>
8297
8298 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
8299 rather than a for-loop that declares a local bool variable. This
8300 should work around a compatibility problem with a Cray x1e C++
8301 compiler reported by Hung Nguyen in
8302 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
8303 The for-loop was introduced in the 2004-11-17 change but I don't
8304 know why it was needed.
8305
a5d80ba5
AD
83062006-07-12 Akim Demaille <akim@epita.fr>
8307
8308 * data/c.m4: Comment changes.
8309
23eb2a69
AD
83102006-07-10 Akim Demaille <akim@lrde.epita.fr>
8311
8312 * src/complain.c (error_message, ERROR_MESSAGE): New.
8313 To factor...
8314 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
8315 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
8316
ddc8ede1
PE
83172006-07-09 Paul Eggert <eggert@cs.ucla.edu>
8318
8319 * NEWS: Instead of %union, you can define and use your own union type
8320 YYSTYPE if your grammar contains at least one <type> tag.
8321 Your YYSTYPE need not be a macro; it can be a typedef.
8322 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
8323 (Union Decl, Decl Summary): Document this.
8324 * data/glr.c (YYSTYPE): Implement this.
8325 * data/glr.cc (YYSTYPE): Likewise.
8326 * data/lalr1.cc (YYSTYPE): Likewise.
8327 * data/yacc.c (YYSTYPE): Likewise.
8328 * src/output.c (prepare): Output tag_seen_flag.
8329 * src/parse-gram.y (declaration, grammar_declaration):
8330 Use 'union_seen' rather than 'typed' to determine whether
8331 %union has been seen, since grammars can now be typed without
8332 %union.
8333 (symbol_declaration, type.opt, symbol_def):
8334 Keep track of whether a tag has been seen.
8335 * src/reader.c (union_seen, tag_seen): New vars.
8336 (typed): remove.
8337 * src/reader.h (union_seen, tag_seen, typed): Likewise.
8338 * src/scan-code.l (untyped_var_seen): New variable.
8339 (handle_action_dollar): Adjust to above changes.
8340 (handle_action_dollar, handle_action_at):
8341 Improve overflow checking for outlandish numbers.
8342 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
8343 avoid new diagnostics generated by above changes.
8344 * tests/regression.at (YYSTYPE typedef): Add test to check
8345 for type tags without %union.
8346
8347 * src/symlist.c (symbol_list_length): Return int, not unsigned
8348 int, since callers expect int. This may need to get revisited
8349 once we have proper integer overflow checking.
8350
8351 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
8352 object is now static.
8353
8354 * src/getargs.c (flags_argmatch): Return void, not int,
8355 to pacify ./configure --enable-gcc-warnings.
8356
8357 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
8358 since last_string is already defined to FLEX_PREFIX (last_string).
8359
7b42569e
AD
83602006-07-09 Akim Demaille <akim@lrde.epita.fr>
8361
8362 Implement --warnings/-W.
8363 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
8364 replaced by...
8365 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
8366 Adjust callers.
8367 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
8368 (warnings_args, warnings_types): New.
8369 (getargs, short_options, long_options): Accept -W/--warnings.
8370 Sort the options by alphabetical order, upper case letter right
8371 before its lower case.
8372
3b452f4e
JD
83732006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
8374
8375 Change %merge result type clash warnings to errors. Discussed at
8376 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
8377 * src/reader.c (record_merge_function_type): Use complain_at.
8378 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8379 declared later): Update test case results.
8380
b8a41559
AD
83812006-07-09 Akim Demaille <akim@lrde.epita.fr>
8382
8383 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
8384 to be in alphabetical order.
8385 (trace_args): Spelling fixes.
8386
cd9e1ba2
PE
83872006-07-09 Paul Eggert <eggert@cs.ucla.edu>
8388
8389 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
8390 so they don't collide with user-defined macros.
8391 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
8392 this was never guaranteed, and now that we're using gnulib stdint,
8393 which defines int_fast16_t to long int, the problem is exposed.
8394
cb48f191
PE
83952006-07-08 Paul Eggert <eggert@cs.ucla.edu>
8396
b8445a15
PE
8397 * data/c.m4 (b4_basename): Simplify a bit, since we don't
8398 need the full POSIX semantics (and weren't implementing them
8399 anyway).
8400
cb48f191
PE
8401 Adjust to Autoconf 2.60 and today's gnulib.
8402 * bootstrap (gnulib_modules): Add stdint.
8403 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
8404 no longer copies it.
8405 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
8406 since stdint needs the former and wcwidth (which is now required
8407 by mbswidth) needs the latter.
8408 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
8409 work around a compatibility glitch between gettext 0.14.6 and
8410 Autoconf 2.60.
8411 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
8412 Do not check for uintptr_t, since new stdint module does the right
8413 thing.
8414 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
8415 Add stdint.h, stdint_.h, wcwidth.h.
8416 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
8417 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
8418 stdint.m4, wchar_t.m4, wcwidth.m4.
8419 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
8420 usual order for ../lib/*.h files.
8421 (file_name_split): Use last_component, not base_name, to adjust
8422 to gnulib changes.
8423 * src/parse-gram.h: Include <strverscmp.h> in the usual order
8424 for ../lib/*.h files.
8425 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
8426 Define unconditionally, since we now assume the stdint module.
8427 * src/scan-skel.l: Include <dirname.h>.
8428 (BASE_QPUTS): Use last_component, not base_name.
8429 * src/system.h: Include <unlocked-io.h> in the usual order
8430 for ../lib/*.h files. Include <stdint.h> unconditionally,
8431 since we now use the stdint module.
8432 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
8433 HAVE_UINTPTR_T, since we now use the stdint module.
8434 (base_name): Remove decl, since files now include <dirname.h>
8435 to get the decl.
8436
cd48d21d
AD
84372006-07-08 Akim Demaille <akim@lrde.epita.fr>
8438
8439 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
8440 New, default to 1.
8441 * data/yacc.c, data/glr.c, data/location.cc: Use them.
8442 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
8443 default.
8444 * tests/calc.at: Adjust.
8445
8ec0a172
AD
84462006-07-08 Akim Demaille <akim@lrde.epita.fr>
8447
b8445a15 8448 * data/c.m4 (b4_basename): New.
8ec0a172
AD
8449 (b4_syncline): Also output the location of its invocation (from
8450 the skeleton).
8451 (b4_user_action, b4_define_user_action, b4_user_actions)
8452 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
8453 (b4_user_stype): New.
8454 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
8455
4a678af8
JD
84562006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8457
8458 In the grammar file, the first column is 1 not 0 on the first line as
8459 on every other line.
8460 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
8461 * tests/input.at (Torturing the Scanner): Update output.
8462
8463 * src/scan-gram.l (scanner_cursor): Declare it static.
8464
dd60572a
JD
84652006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8466
8467 In warnings, say "previous declaration" rather than "first
8468 declaration".
8469 * src/symtab.c (redeclaration): Do that here.
8470 * src/reader.c (record_merge_function_type): In the case of a result
8471 type clash, report the previous declaration rather than the very first
8472 one in the grammar file.
8473 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8474 declared later): Add a third declaration to check this behavior.
8475 * tests/input.at (Incompatible Aliases): Update output.
8476
2073e1b6
AD
84772006-06-27 Akim Demaille <akim@epita.fr>
8478
8479 * doc/Doxyfile.in: New.
8480 * doc/Makefile.am: Use it.
8481 * src/lalr.h, src/symtab.h: Initial doxygenation.
8482
8ee5b538
JD
84832006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8484
8485 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
8486 declared after the %merge. This continues the effort of the previous
8487 patch.
8ee5b538
JD
8488 * src/reader.c (get_merge_function): Don't set the merger type yet.
8489 (record_merge_function_type): New function for setting the merger type
8490 and checking for clashes.
8491 (grammar_current_rule_merge_set): Set the location of the %merge for
8492 the current rule.
8493 (packgram): Invoke record_merge_function_type for each rule now that
8494 all symbol type declarations have been parsed.
8495 * src/reader.h (merger_list.type_declaration_location): New member
8496 storing the location of the first %merge from which the type for this
8497 merging function was derived.
8498 * src/symlist.h (symbol_list.merger_declaration_location): New member
8499 storing the location of a rule's %merge, if any.
8500 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8501 declared later): New test to catch the error fixed by the above patch.
8502
ffa4ba3a
JD
85032006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8504
8505 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
8506 declarations appear after the rules. Discussed at
8507 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
8508 and
8509 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
8510 Don't mistake the type of $$ in a midrule to be that of its parent
8511 rule's $$.
ffa4ba3a
JD
8512 * src/reader.c (grammar_current_rule_end): Don't invoke
8513 grammar_rule_check yet since not all symbol declarations may have been
8514 parsed yet.
8515 (grammar_midrule_action): Likewise.
8516 Don't record whether the midrule's $$ has been used yet since actions
8517 haven't been translated yet.
8518 Record the midrule's parent rule and its RHS index within the parent
8519 rule.
8520 (grammar_current_rule_action_append): Don't translate the action yet
8521 since not all symbol declarations may have been parsed yet and, thus,
8522 warnings about types for $$, $n, @$, and @n can't be reported yet.
8523 (packgram): Translate the action and invoke grammar_rule_check now that
8524 all symbol declarations have been parsed.
8525 * src/scan-code.l (handle_action_dollar): Now that this is invoked
8526 after parsing the entire grammar file, the symbol list here in the case
8527 of a midrule is actually the midrule's empty RHS, so reference its
8528 parent rule's RHS where necessary.
8529 On the other hand, now that you can already know it's a midrule, you
8530 aren't forced to think $$ has the same type as its parent rule's $$.
8531 (handle_action_at): In the case of a midrule, reference the parent rule
8532 where necessary.
8533 * src/symlist.c (symbol_list_new): Initialize new midrule-related
8534 members.
8535 (symbol_list_length): Now that this is invoked after all rules have
8536 been parsed, a NULL symbol (rather than a NULL symbol list node)
8537 terminates a rule. symbol_list_print already does this correctly.
8538 * src/symlist.h (symbol_list.midrule_parent_rule,
8539 symbol_list.midrule_parent_rhs_index): New members so that midrules can
8540 remember their relationships with their parents.
8541 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
8542 fixed by the above patch.
8543 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
8544 implementing...
8545 (Unused values): ... this old test case and...
8546 (Unused values before symbol declarations): ... this new test case.
8547 This one is the same as `Unused values' except that all symbol
8548 declarations appear after the rules in order to catch the rest of the
8549 errors fixed by the above patch.
8550
e256e17f
JD
85512006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8552
300a1930
JD
8553 More cleanup.
8554 * src/reader.c (current_rule): Declare it static since it's no longer
8555 used outside this file.
8556 (grammar_current_rule_action_append): Remove redundant arguments from
8557 translate_rule_action invocation.
8558 * src/reader.h (current_rule): Remove this unused extern.
8559 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
8560 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 8561
381ecb06
JD
85622006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
8563
8564 Clean up yesterday's patch.
8565 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
8566 to...
8567 * src/reader.c (grammar_current_rule_action_append): ... here for
8568 consistency with grammar_current_rule_symbol_append.
8569 * tests/regression.at (Braced code in declaration in rules section):
8570 Make yyerror and yylex static as usual.
8571
4210cd0b
JD
85722006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
8573
8574 Fix bug that mistakes braced code in a declaration in the rules section
8575 to be a rule action. Mentioned at
8576 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
8577 * src/scan-gram.l: Move midrule action detection from the start of the
8578 scanning of any braced code to...
8579 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
8580 action. For readability, use $2 and @2 rather than the equivalent
8581 global variables.
8582 * tests/regression.at (Braced code in declaration in rules section):
8583 New test to catch the error fixed by the above patch.
8584
8585 Work on code readability some.
8586 * src/scan-code.l (current_rule): Get rid of this misleading and
8587 redundant declaration: it's actually extern'ed in reader.h.
8588 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
8589 translate_action): Add a rule argument and use it instead of the global
8590 current_rule.
8591 (translate_rule_action): This already receives current_rule through an
8592 argument, so pass it on to translate_action instead of assigning
8593 current_rule to current_rule.
8594 (translate_symbol_action, translate_code): Pass rule = NULL to
8595 translate_action.
8596
34f98f46
JD
85972006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
8598
8599 Rename %before-definitions to %start-header and %after-definitions to
8600 %end-header. Don't use these declarations to separate pre-prologue
8601 blocks from post-prologue blocks. Add new order-independent
8602 declarations %before-header and %after-header as alternatives to the
8603 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
8604 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
8605 * NEWS (2.3+): Update for these changes.
8606 * data/glr.c (b4_before_definitions): Update to...
8607 (b4_start_header): ... this.
8608 (b4_after_definitions): Update to...
8609 (b4_end_header): ... this.
8610 * data/glr.cc: Likewise.
8611 * data/lalr1.cc: Likewise.
8612 * data/yacc.c: Likewise.
8613 * doc/bison.texinfo (The prologue): Update names, and replace remaining
8614 prologue blocks with %*-header declarations.
8615 (Calc++ Parser): Likewise.
91661ebb 8616 (Decl Summary): Update names.
148d66d8 8617 (Table of Symbols): Update description.
34f98f46
JD
8618 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
8619 (PERCENT_END_HEADER): ... this.
8620 (PERCENT_BEFORE_DEFINITIONS): Update to...
8621 (PERCENT_START_HEADER): ... this.
8622 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
8623 (declaration): Update token names and m4 macro names.
8624 When parsing %end-header and %start-header, invoke translate_code
8625 before muscle_code_grow, and no longer set global booleans to remember
8626 whether these declarations have been seen.
8627 Parse new %after-header and %before-header.
8628 * src/reader.c (before_definitions, after_definitions): Remove.
8629 (prologue_augment): Accept a new bool argument to specify whether to
8630 augment the pre-prologue or post-prologue.
8631 * src/reader.h (before_definitions, after_definitions): Remove these
8632 extern's.
8633 (prologue_augment): Add new bool argument.
8634 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
8635 (PERCENT_END_HEADER): ... this.
8636 (PERCENT_BEFORE_DEFINITIONS): Update to...
8637 (PERCENT_START_HEADER): ... this.
8638 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
8639 * tests/actions.at (Printers and Destructors): Update names.
8640
31b2b07e
JD
86412006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
8642
8643 Add comparison operators for C++ location classes. Discussed at
8644 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
8645 * data/c++.m4 (b4_define_location_comparison): New boolean %define
8646 declaration indicating whether filename_type has an operator==. If
8647 filename_type is `std::string', it defaults to `1', `0' otherwise.
8648 * data/location.cc: Iff b4_define_location_comparison is `1', add
8649 operator== and operator!= for class position and for class location.
8650
8651 Some minor fixes.
8652 * src/scan-action.l: Remove unused file.
8653 * src/symtab.c (symbol_printer_set): Use printer_location not
8654 destructor_location.
8655 * src/symtab.h (struct symbol): Replace incorrect source comment for
8656 printer members.
8657 * tests/input.at (Incompatible Aliases): Update output with correct
8658 printer location.
8659
9bc0dd67
JD
86602006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
8661
8662 Don't put the pre-prologue in the header file. For the yacc.c code
8663 file and the glr.c header and code files, move the pre-prologue before
8664 the token definitions. Add new %before-definitions and
8665 %after-definitions to declare code that will go in both the header file
8666 and code file. Discussed at
8667 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
8668 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
8669 and
8670 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
8671 * NEWS (2.3+): Describe these changes.
8672 * data/glr.c (b4_pre_prologue): Move from within to before...
8673 (b4_shared_declarations): ... this.
8674 Add new b4_before_definitions before b4_token_enums.
8675 Add new b4_after_definitions at the end.
8676 * data/glr.cc (b4_pre_prologue): Replace with...
8677 (b4_before_definitions): ... this in the header file.
8678 (b4_after_definitions): New near the end of the header file.
8679 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
8680 code file right before including the header file.
8681 (b4_before_definitions): New in the previous position of
8682 b4_pre_prologue in the header file.
8683 (b4_after_definitions): New near the end of the header file.
8684 * data/yacc.c: Clean up some m4 quoting especially in the header file.
8685 (b4_token_enums_defines): In the code file, move to right before
8686 YYSTYPE for consistency with the header file.
8687 (b4_before_definitions): New right before b4_token_enums_defines in
8688 both the header and code file.
8689 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
8690 header and code file.
8691 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
8692 of prologues for %union dependencies.
91661ebb
JD
8693 (Decl Summary): In %defines description, mention the effect of
8694 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
8695 (Calc++ Parser): Forward declare driver in a %before-definitions rather
8696 than in the pre-prologue so that make check succeeds.
148d66d8 8697 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
8698 %after-definitions.
8699 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
8700 %before-definitions.
8701 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
8702 (declaration): Parse those declarations and append to
8703 b4_before_definitions and b4_after_definitions, respectively.
8704 * src/reader.c (before_definitions, after_definitions): New bools to
8705 track whether those declarations have been seen.
8706 (prologue_augment): Add to the post-prologue if %union,
8707 %before-definitions, or %after-definitions has been seen.
8708 * src/reader.h (before_definitions, after_definitions): New extern's.
8709 * src/scan-gram.l: Scan the new declarations.
8710 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
8711 prologue block in a %before-definitions or a %after-definitions based
8712 on whether the %union is declared.
8713 * tests/regression.at (Early token definitions with --yacc, Early token
8714 definitions without --yacc): Move tests for token definitions into the
8715 post-prologue since token names are no longer defined in the
8716 pre-prologue.
8717
203b9274
AD
87182006-06-20 Akim Demaille <akim@epita.fr>
8719
8720 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
8721 (symbol_get): Use it.
8722 * src/parse-gram.y: Use it.
8723
a7ee59cf
JD
87242006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
8725
8726 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
8727 build succeeds when configured with --enable-gcc-warnings.
8728
5a2baae7
PE
87292006-06-19 Paul Eggert <eggert@cs.ucla.edu>
8730
33ad1a9c
PE
8731 * src/parse-gram.y (char_name): New function.
8732 (CHAR, STRING, string_content): For %printer, properly escape.
8733 (ID): Prefer fputs to fprintf.
8734 (id): Reindent to be consistent with other rules.
8735 Properly quote char.
8736
5a2baae7
PE
8737 The Translation Project changed its way of publishing translations
8738 to maintainers. I haven't received any responses to my request
8739 for supporting the old way, or for documenting the new way. I
8740 have modified 'bootstrap' to use screen scraping
8741 (in this case, HTML scraping). This is unreliable and inelegant,
8742 but I don't see any better way. Yuck.
8743 * bootstrap (TP_URL, WGET_COMMAND): New vars.
8744 (get_translations): New function, which uses HTML scraping to
8745 deduce locations of latest translations.
8746 Use this function to grab both bison and bison-runtime .po files.
8747 Don't bother priming the pump for the runtime-po domain any more,
8748 as it's now translated better than bison is.
8749
58d7a1a1
AD
87502006-06-19 Akim Demaille <akim@epita.fr>
8751
8752 * src/scan-gram.l: No longer "parse" things after `%union' until
8753 `{'. Rather, return a single "%union" token.
8754 No longer make symbols: return strings, and leave the conversion
8755 to symbols to the parser.
8756 (SC_PRE_CODE, token_type): Remove.
8757 * src/parse-gram.y (%union): New field `character'.
8758 Sort tokens.
8759 (CHAR): New token.
8760 (ID, ID_COLON): Now that the scanner no longer makes them
8761 identifiers, adjust all uses to invoke symbol_get.
8762 (id_colon): New, wraps the conversion from string to symbol.
8763 (%union): Accept a possible union_name.
8764 (symbol): Now can be a char.
8765 * data/c.m4 (b4_union_name): Leave a default value.
8766 * data/glr.c, data/yacc.c: Use it.
8767
b931235e
JD
87682006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
8769
8770 For associating token numbers with token names for "yacc.c", don't use
8771 #define statements unless `--yacc' is specified; always use enum
8772 yytokentype. Most important discussions start at:
8773 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
8774 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
8775 and
8776 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
8777 * NEWS (2.3+): Mention.
8778 * data/c.m4 (b4_yacc_if): New.
8779 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
8780 token #define's.
8781 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
8782 on token name definitions.
8783 * src/getargs.c (usage): Capitalize `Yacc' in English.
8784 * src/output.c (prepare): Define b4_yacc_flag.
8785 * tests/regression.at (Early token definitions): Test that tokens names
8786 are defined before the pre-prologue not just before the post-prologue.
8787 Remove this test case and copy to...
8788 (Early token definitions with --yacc): ... this to test #define's.
8789 (Early token definitions without --yacc): ... and this to test enums.
8790
9e6e7ed2
PE
87912006-06-11 Paul Eggert <eggert@cs.ucla.edu>
8792
8793 * NEWS: Reword the post-2.3 change to not be so optimistic about
8794 removing the old "look-ahead" spelling.
8795 Update previous look-ahead/lookahead change reports.
8796 * REFERENCES: look-ahead -> lookahead (since that's
8797 what he actually wrote).
8798 * doc/refcard.tex: look ahead -> lookahead,
8799 look-ahead -> lookahead
8800
742e4900
JD
88012006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
8802
8803 For consistency, use `lookahead' instead of `look-ahead' or
8804 `look_ahead'. Discussed starting at
8805 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
8806 and then at
8807 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
8808 * NEWS: For the next release, note the change to `--report'.
8809 * TODO, doc/bison.1: Update English.
8810 * doc/bison.texinfo: Update English.
8811 (Understanding Your Parser, Bison Options): Document as
8812 `--report=lookahead' rather than `--report=look-ahead'.
8813 * src/conflicts.c: Update English in comments.
8814 (lookahead_set): Rename from look_ahead_set.
8815 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
8816 (resolve_sr_conflict): Rename local look_ahead_tokens to
8817 lookahead_tokens, and update other uses.
8818 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
8819 count_rr_conflicts, conflicts_free): Update uses.
8820 * src/getargs.c (report_args): Move "lookahead" before alternate
8821 spellings.
8822 (report_types): Update uses.
8823 (usage): For `--report' usage description, state `lookahead' spelling
8824 rather than `look-ahead'.
8825 * src/getargs.h (report.report_lookahead_tokens): Rename from
8826 report_look_ahead_tokens.
8827 * src/lalr.c: Update English in comments.
8828 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
8829 (state_lookahead_tokens_count): Rename from
8830 state_look_ahead_tokens_count.
8831 Rename local n_look_ahead_tokens to n_lookahead_tokens.
8832 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
8833 Rename local n_look_ahead_tokens to n_lookahead_tokens.
8834 Update other uses.
8835 Update English in output.
8836 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
8837 * src/print.c: Update English in comments.
8838 (lookahead_set): Rename from look_ahead_set.
8839 (print_reduction): Rename argument lookahead_token from
8840 look_ahead_token.
8841 (print_core, state_default_rule, print_reductions, print_results):
8842 Update uses.
8843 * src/print_graph.c: Update English in comments.
8844 (print_core): Update uses.
8845 * src/state.c: Update English in comments.
8846 (reductions_new): Update uses.
8847 (state_rule_lookahead_tokens_print): Rename from
8848 state_rule_look_ahead_tokens_print, and update other uses.
8849 * src/state.h: Update English in comments.
8850 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
8851 (state_rule_lookahead_tokens_print): Rename from
8852 state_rule_look_ahead_tokens_print.
8853 * src/tables.c: Update English in comments.
8854 (conflict_row, action_row): Update uses.
8855 * tests/glr-regression.at
8856 (Incorrect lookahead during deterministic GLR,
8857 Incorrect lookahead during nondeterministic GLR): Rename
8858 print_look_ahead to print_lookahead.
8859 * tests/torture.at: Update English in comments.
8860 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
8861 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
8862 (Many lookahead tokens): Update uses.
8863 * data/glr.c: Update English in comments.
8864 * lalr1.cc: Likewise.
8865 * yacc.c: Likewise.
8866 * src/conflicts.h: Likewise.
8867 * src/lalr.h: Likewise.
8868 * src/main.c: Likewise.
8869 * src/output.c: Likewise.
8870 * src/parse-gram.c: Likewise.
8871 * src/tables.h: Likewise.
8872 * tests/calc.at: Likewise.
8873
3c40d0b5
JD
88742006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
8875
8876 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
8877
5d278082
PE
88782006-06-07 Paul Eggert <eggert@cs.ucla.edu>
8879
8880 * TODO: Add request from Nelson H. F. Beebe to be able to install
8881 Bison without installing the yacc script.
8882
9e668899
JD
88832006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
8884
8885 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
8886 and yytext if they're already #define'd.
8887 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
8888 * src/scan-code-c.c: ... here.
8889 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
8890 <config.h>.
8891
0c8e079f
JD
88922006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
8893
8894 Get Bison to build again when configured with --enable-gcc-warnings.
8895 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
8896 missing #include's.
8897 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
8898 loc argument as it shadows a global.
8899 * src/scan-gram.l: Remove stray comma that prevents boundary_set
8900 invocation.
8901
8902 * src/.cvsignore: Add scan-code.c.
8903
2346344a
AD
89042006-06-07 Akim Demaille <akim@epita.fr>
8905
8906 * src/scan-gram.l: Move the "add a trailing ; to actions" code
8907 to...
8908 * src/scan-code.l: here.
8909 * tests/input.at (Torturing the Scanner): Fix another location
8910 error.
8911
4862bdfd
AD
89122006-06-07 Akim Demaille <akim@epita.fr>
8913
8914 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
8915
e9071366
AD
89162006-06-06 Akim Demaille <akim@epita.fr>
8917
8918 Extract the parsing of user actions from the grammar scanner.
8919 As a consequence, the relation between the grammar scanner and
8920 parser is much simpler. We can also split "composite tokens" back
8921 into simple tokens.
8922 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
8923 * src/scan-gram.l (add_column_width, adjust_location): Move to and
8924 rename as...
8925 * src/location.h, src/location.c (add_column_width)
8926 (location_compute): these.
8927 Fix the column count: the initial column is 0.
8928 (location_print): Be robust to ending column being 0.
8929 * src/location.h (boundary_set): New.
8930 * src/main.c: Adjust to scanner_free being renamed as
8931 gram_scanner_free.
8932 * src/output.c: Include scan-code.h.
8933 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
8934 Use boundary_set.
8935 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
8936 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
8937 which is now, again, a separate token.
8938 Adjust all dependencies.
8939 Whereever actions with $ and @ are used, use translate_code.
8940 (action): Remove this nonterminal which is now useless.
8941 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
8942 (grammar_current_rule_action_append): Use translate_code.
8943 (packgram): Bound check ruleno, itemno, and rule_length.
8944 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
8945 (last_string, last_braced_code_loc, max_left_semantic_context)
8946 (scanner_initialize, scanner_free, scanner_last_string_free)
8947 (gram_out, gram_lineno, YY_DECL_): Move to...
8948 * src/scan-gram.h: this new file.
8949 (YY_DECL): Rename as...
8950 (GRAM_DECL): this.
8951 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
8952 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8953 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8954 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8955 Move these declarations, and...
8956 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
8957 these to...
8958 * src/flex-scanner.h: this new file.
8959 * src/scan-gram.l (rule_length, rule_length_overflow)
8960 (increment_rule_length): Remove.
8961 (last_braced_code_loc): Rename as...
8962 (gram_last_braced_code_loc): this.
8963 Adjust to the changes of the parser.
8964 Move all the handling of $ and @ into...
8965 * src/scan-code.l: here.
8966 * src/scan-gram.l (handle_dollar, handle_at): Remove.
8967 (handle_action_dollar, handle_action_at): Move to...
8968 * src/scan-code.l: here.
8969 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
8970 scan-code.h, scan-code-c.c, scan-gram.h.
8971 (EXTRA_bison_SOURCES): Add scan-code.l.
8972 (BUILT_SOURCES): Add scan-code.c.
8973 (yacc): Be robust to white spaces.
8974
8975 * tests/conflicts.at, tests/input.at, tests/reduce.at,
8976 * tests/regression.at: Adjust the column numbers.
8977 * tests/regression.at: Adjust the error message.
7891a7c4 8978
184e42f0
JD
89792006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
8980
8981 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
8982 Use Akim's wording from
8983 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
8984
7891a7c4
JD
89852006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
8986
8987 Between Bison releases, manually append `+' to the previous Bison
8988 release number, and use that as a signal to automatically print the
8989 ChangeLog's CVS Id keyword from --version. Discussed starting at
8990 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
8991 * ChangeLog: Add Id header.
8992 * configure.ac (AC_INIT): Append `+' to `2.3'.
8993 * src/.cvsignore: Add revision.c.
8994 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
8995 (BUILT_SOURCES): Add revision.c.
8996 (revision.c): New target rule. This file defines a new global variable
8997 named revision. It initializes it with either the Id from ChangeLog
8998 or, if VERSION doesn't contain `+', with the empty string.
8999 * src/getargs.c (version): Print the value of revision.
9000 * src/revision.h: Extern revision.
9001
4ad3ed84
PE
90022006-06-05 Paul Eggert <eggert@cs.ucla.edu>
9003
9004 * NEWS: Version 2.3.
9005 * configure.ac (AC_INIT): Likewise.
9006
02103984
PE
90072006-05-30 Paul Eggert <eggert@cs.ucla.edu>
9008
9009 * data/glr.c (YYRECOVERING): Define to be a function-like macro
9010 with no arguments, not as an object-like macro. This is for
9011 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
9012 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
9013 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
9014 Document this.
9015
2c08afa5
JD
90162006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
9017
9018 * src/getargs.c (usage): Back out yesterday's modification of the
9019 --help output so that we don't have to wait for translation before
9020 releasing 2.3.
9021
6077da58
PE
90222006-05-29 Paul Eggert <eggert@cs.ucla.edu>
9023
9024 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
9025 Problem reported by Akim Demaille.
9026
2a26b6c2
JD
90272006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
9028
9029 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9030
aefef0d6
PE
90312006-05-26 Paul Eggert <eggert@cs.ucla.edu>
9032
9033 * data/yacc.c (yy_reduce_print): Omit trailing white space in
9034 generated source code. Problem reported by Frans Englich in
9035 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
9036
fcd8e201
PE
90372006-05-22 Paul Eggert <eggert@cs.ucla.edu>
9038
9039 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
9040 shell, not within 'make', so that 'make' by an ordinary builder
9041 (using GNU make) does not worry about configuring gzip. This also
9042 works around a bug reported independently by Keith Thompson and by
9043 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
9044 stderr rather than stdout, messing up the build logs.
9045
7b5cdcbd
JD
90462006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9047
9048 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
9049 to make sure that YYID will never be unused. This fixes a 'make
9050 maintainer-check' failure caused by the recent changes to the 'Trivial
9051 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
9052 not used.
9053 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
9054
5ad0a449
JD
90552006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9056
9057 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
9058 state before an empty RHS is always resolved here. Only the location
9059 of that state is guaranteed to be resolved, and that's enough. This
9060 fixes the remaining bug reported by Derek M. Jones in
9061 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9062 * tests/glr-regression.at (Uninitialized location when reporting
9063 ambiguity): Test the above case.
9064 Also, the embedded comments in this test case claim it checks the case
9065 of an empty RHS that has inherited the initial location. However, the
9066 corresponding LHS was already resolved, so yyresolveLocations didn't
9067 actually have reason to modify it. Fix this by forcing
9068 nondeterministic operation at the beginning of the parse.
9069
50cce58e
PE
90702006-05-20 Paul Eggert <eggert@cs.ucla.edu>
9071
9072 * data/c.m4 (b4_yy_symbol_print_generate):
9073 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
9074 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
9075 of the bugs reported today by Derek M Jones in
9076 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9077 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
9078 defined to be a type name without parens or brackets.
9079 (Location Type): Similarly for YYLTYPE.
9080 * tests/regression.at (Trivial grammars): Put in a test for this
9081 bug that will be caught by 'make maintainer-check' (though not,
9082 alas, by 'make check' unless your compiler is picky).
9083
ab8d9dc5
PE
90842006-05-19 Paul Eggert <eggert@cs.ucla.edu>
9085
0d2c8934 9086 * NEWS: Version 2.2.
ab8d9dc5
PE
9087 * configure.ac (AC_INIT): Likewise.
9088
9138c575
JD
90892006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
9090
9091 * data/glr.c (yyreportTree): Make room in yystates for the state
9092 preceding the RHS. This fixes the segmentation fault reported by Derek
9093 M. Jones in
9094 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
9095 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
9096 to the user. Reported for yyreportTree by Derek M. Jones later in the
9097 same thread.
9098 * THANKS: Add Derek M. Jones.
9099 Update my email address.
9100 Fix typo in Steve Murphy's name.
9101
276f48df
PE
91022006-05-14 Paul Eggert <eggert@cs.ucla.edu>
9103
d6645148
PE
9104 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
9105 checking against YYLAST that caused the parser to miss a potential
9106 alternative in its diagnostic.
9107 Problem reported by Maria Jose Moron Fernandez in
9108 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
9109 * data/lalr1.cc (yysyntax_error_): Likewise.
9110 * data/yacc.c (yysyntax_error): Likewise.
9111 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
9112 tokens, in case we run into an older C compiler.
9113 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
9114 Use them to check for the off-by-one error fixed above.
9115
276f48df
PE
9116 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
9117 YYSIZE_T, not size_t.
9118 * tests/regression.at (Trivial grammars): New test, to catch
9119 the error fixed by the above patch.
9120
cd8b5791
AD
91212006-05-14 Akim Demaille <akim@lrde.epita.fr>
9122
9123 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
9124 scheme.
9125 Reported by Steve Murphy.
9126
34376418
AD
91272006-05-14 Akim Demaille <akim@lrde.epita.fr>
9128
9129 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
9130 * data/glr.cc: b4_location_flag is now b4_locations_flag.
9131
327afc7c
AD
91322006-05-14 Akim Demaille <akim@lrde.epita.fr>
9133
9134 Implement --trace=m4.
9135 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
9136 * src/output.c (output_skeleton): When set, pass -dV to m4.
9137
9138 Factor the handling of flags in m4.
9139 * src/output.c (prepare): Rename the muscle names debug, defines,
9140 error_verbose to debug_flag, defines_flag, error_verbose_flag.
9141 * data/c.m4: Adjust.
9142 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
9143 Use b4_define_flag_if to define other b4_FLAG_if macros.
9144 (b4_location_if): As a consequence, rename as...
9145 (b4_locations_if): this, for consistency.
9146 Adjust all the skeletons.
9147
ba9ecd19
AD
91482006-05-14 Akim Demaille <akim@lrde.epita.fr>
9149
9150 * etc/bench.pm: Shorten bench names.
9151
4e83ea15
AD
91522006-05-14 Akim Demaille <akim@lrde.epita.fr>
9153
9154 * src/output.h, src/output.c (error_verbose): Move to...
9155 * src/getargs.h, src/getargs.c: here.
9156 Sort the flags.
9157 Adjust dependencies.
9158
6e93d810
PE
91592006-05-13 Paul Eggert <eggert@cs.ucla.edu>
9160
9161 * data/c.m4 (b4_copyright): Put the special exception for Bison
9162 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
9163 uses changed. Suggested by Akim Demaille. Also, wrap the
9164 copyright notice, in case it is longer than 80 columns. Replace
9165 comma by newline after title.
6e93d810 9166
eaea13f5
PE
91672006-05-11 Paul Eggert <eggert@cs.ucla.edu>
9168
9169 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
9170 incompatibility, not a bug. Mention that it wasn't fixed as of
9171 flex 2.5.33.
9172
3cf084ec
AD
91732006-05-11 Akim Demaille <akim@lrde.epita.fr>
9174
9175 * examples/extexi: Enforce the precedence of concatenation over
9176 >>.
0a9f1c7d 9177 Reported by Tommy Nordgren.
3cf084ec 9178
32c96bd7
AD
91792006-05-11 Akim Demaille <akim@lrde.epita.fr>
9180
9181 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
9182 with the member "token".
f94705b2 9183 Reported by Martin Nylin.
32c96bd7 9184
eaea13f5
PE
91852006-05-08 Paul Eggert <eggert@cs.ucla.edu>
9186
9187 * data/glr.c: Switch to Bison 2.2 special-exception language in
9188 the copyright notice. Use more-regular format for titles and
9189 copyright notices.
9190 * data/glr.cc: Likewise.
9191 * data/location.cc: Likewise.
9192 * data/yacc.cc: Likewise.
9193 * doc/bison.texinfo (Conditions): Document this.
9194 * NEWS: likewise. Upgrade version to 2.2.
9195
6e2d1146
AD
91962006-04-27 Akim Demaille <akim@lrde.epita.fr>
9197
9198 * data/glr.cc: Remove dead code.
9199
47671055
PE
92002006-04-25 Paul Eggert <eggert@cs.ucla.edu>
9201
9202 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
9203 that variable and the line breaks the bootstrap. Problem reported
9204 by Juan M. Guerrero.
9205
ed2e6384
AD
92062006-04-24 Akim Demaille <akim@lrde.epita.fr>
9207
9208 * doc/bison.texinfo (Multiple start-symbols): New.
9209
3cedc2dc
AD
92102006-04-24 Akim Demaille <akim@lrde.epita.fr>
9211
9212 * etc/README, etc/bench.pl: New.
9213
b2ddc3f3
AD
92142006-04-03 Akim Demaille <akim@lrde.epita.fr>
9215
9216 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
9217 rule.
9218 Reported by Mickael Labau.
9219 * tests/input.at (Torturing the Scanner): Test it.
9220
91e3ac9a
PE
92212006-03-16 Paul Eggert <eggert@cs.ucla.edu>
9222
9223 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
9224 Problem reported by Bob Rossi.
9225
92262006-03-13 Paul Eggert <eggert@cs.ucla.edu>
9227
9228 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
9229 and didn't really work.
9230 For the index, use @ifnotinfo, not @iftex.
9231 Minor cleanups of spacing and terminology.
9232
5cf61e93
AD
92332006-03-12 Akim Demaille <akim@lrde.epita.fr>
9234
9235 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
9236 of AT_NAME_PREFIX when %name-prefix is not used.
9237
aa08666d
AD
92382006-03-12 Akim Demaille <akim@lrde.epita.fr>
9239
9240 Apply --prefix to C++ skeletons too: they change the namespace.
9241 The test suite already exercize these cases.
9242 * data/c++.m4 (b4_namespace): New.
9243 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
9244 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
9245 * data/yacc.c, data/glr.c: Remove a useless `[]'.
9246 * doc/bison.texinfo: Document it.
9247 (Option Cross Key): Use @multitable in all formats. It looks
9248 nicer, even in TeX outputs.
9249 (Rules): Use the same code whatever the output type is.
9250 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
9251 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
9252 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 9253
45567173
AD
92542006-03-10 Akim Demaille <akim@lrde.epita.fr>
9255
9256 * TODO: Remove dead items.
9257
e9d8f881 92582006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
9259
9260 * doc/FAQ: Remove, merged into...
9261 * doc/bison.texinfo (FAQ): this.
9262 * doc/Makefile.am (EXTRA_DIST): Adjust.
9263
c095d689
AD
92642006-03-10 Akim Demaille <akim@lrde.epita.fr>
9265
9266 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
9267 even if empty.
9268 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
9269 * doc/bison.texinfo (Calc++ Scanner): Use it.
9270
6e0f8287
PE
92712006-03-09 Paul Eggert <eggert@cs.ucla.edu>
9272
9273 Fix two nits reported by twlevo, plus one more that I discovered.
9274
9275 * src/assoc.h (assoc_to_string): Give a name to the arg, as
9276 this is the usual Bison style.
9277 * src/location.h (location_print): Likewise.
9278
9279 * src/reader.h (token_name): Likewise.
9280
d6b771c3
PE
92812006-03-08 Paul Eggert <eggert@cs.ucla.edu>
9282
9283 Fix some nits reported by twlevo.
9284 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
9285 and "POSIX". Use more-modern syntax for URLs. Mention C++
9286 and ask for Java. Don't hardwire OS version numbers. Add
9287 copyright notice.
9288 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
9289 * src/conflicts.c (solved_conflicts_obstack): Now static.
9290
1e137b71
JD
92912006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
9292
9293 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
9294 page. Say "you can use it" not "you may use it" as on the web page;
9295 we're describing capabilities not granting permission.
9296
73f2e47e
PE
92972006-03-06 Paul Eggert <eggert@cs.ucla.edu>
9298
6d05403d
PE
9299 * data/glr.c (yyresolveLocations): Rename local variables to avoid
9300 shadowing warnings. Use usual patter for iterating through RHS.
9301 * tests/glr-regression.at
9302 (Uninitialized location when reporting ambiguity):
9303 Modify yylex so that it uses its argument, rather than trying
9304 to rely on ARGSUSED (which doesn't work for gcc with warnings).
9305 const char -> char const.
9306
73f2e47e
PE
9307 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
9308 Don't use tabs inside commands; it messes up 'ps'.
9309 Problem reported by twlevo.
9310
8710fc41
JD
93112006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
9312
9313 * tests/glr-regression.at (Uninitialized location when reporting
9314 ambiguity): New test case.
9315 * data/glr.c (yyresolveLocations): New function, which uses
9316 YYLLOC_DEFAULT.
9317 (yyresolveValue): Invoke yyresolveLocations before reporting an
9318 ambiguity.
9319 * doc/bison.texinfo (Default Action for Locations): Note
9320 YYLLOC_DEFAULT's usage for ambiguity locations.
9321 (GLR Semantic Actions): Cross-reference those notes.
9322
ae952af2
JD
93232006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
9324
9325 * tests/glr-regression.at (Leaked semantic values when reporting
9326 ambiguity): Remove unnecessary union and type declarations.
9327 (Leaked lookahead after nondeterministic parse syntax error): New test
9328 case.
9329 * data/glr.c (yyparse): Check for zero stacks remaining before
9330 attempting to shift the lookahead so that you don't lose it.
9331
35ee866a
JD
93322006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
9333
9334 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
9335 * tests/glr-regression.at (Leaked semantic values when reporting
9336 ambiguity): New test case.
9337 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
9338 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
9339 now unnecessary yystackp parameter.
9340 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
9341 destructors can be called.
9342
9343 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
9344 in existing testcases.
9345
520181ab
JD
93462006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
9347
9348 Don't leak semantic values for parent RHS when a user action cuts the
9349 parser, and clean up related code a bit.
9350 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
9351 cuts parse): Rename to...
9352 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
9353 for leaked parent RHS values.
9354 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
9355 between an unresolved state (non-empty chain of semantic options) and
9356 an incomplete one (signaled by an empty chain).
ae952af2 9357 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
9358 successfully or unsuccessfully resolved yyGLRState to...
9359 (yyresolveValue): ... here so that yyresolveValue always leaves a
9360 yyGLRState with consistent data and thus is easier to understand.
9361 Remove the yyvalp and yylocp parameters since they are always just
9362 taken from the yys parameter. When reporting a discarded merged value
9363 in debugging output, note that it is incompletely merged. Document the
9364 interface.
9365 (yyresolveAction): If resolving any of the RHS states fails, destroy
9366 them all rather than leaking them. Thus, as long as user actions are
9367 written to clean up the RHS correctly, yyresolveAction always cleans up
9368 the RHS of a semantic option. Document the interface.
9369
18d9185c
PE
93702006-02-27 Paul Eggert <eggert@cs.ucla.edu>
9371
9372 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
9373 led to a segmentation fault in GNU Pascal. Problem reported
9374 by Waldek Hebisch.
9375
841a7737
JD
93762006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
9377
9378 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
9379 mid-rule action inside a nonterminal symbol in order to declare a
9380 destructor for its semantic value.
9381
fc3f467f
PE
93822006-02-16 Paul Eggert <eggert@cs.ucla.edu>
9383
9384 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
9385 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
9386 __cplusplus && ! defined _STDLIB_H && !
9387 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
9388 defined free))]: Include <stdlib.h> rather than rolling our own
9389 declarations of malloc and free, to avoid problems with
9390 incompatible declarations (using 'throw') C++'s stdlib.h. This
9391 should fix Debian bug 340012
9392 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
9393 reported by Guillaume Melquiond.
9394
a3af26dd
PE
93952006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9396
4d7bc38c
PE
9397 * NEWS: Clarify symbols versus types in unused-value warnings.
9398
a3af26dd
PE
9399 * configure.ac (AC_INIT): Bump version number.
9400
4e26c69e
PE
94012006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9402
9403 * NEWS: Version 2.1a.
9404 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
9405 since C99 requires this.
9406
498e897c
PE
94072006-02-11 Paul Eggert <eggert@cs.ucla.edu>
9408
9409 * m4/c-working.m4: New file.
9410 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
9411
57bb17ca
PE
94122006-02-10 Paul Eggert <eggert@cs.ucla.edu>
9413
9414 * Makefile.maint: Merge from coreutils.
9415
0be105dc
PE
94162006-02-09 Paul Eggert <eggert@cs.ucla.edu>
9417
9418 More portability fixes for problems summarized by Nelson H. F. Beebe.
9419
9420 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
9421 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
9422 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
9423 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
9424 messes up because C++ code is compiled in 32-bit mode but linked
9425 in 64-bit mode.
9426
6fc0c024
PE
94272006-02-08 Paul Eggert <eggert@cs.ucla.edu>
9428
9429 More portability fixes for problems summarized by Nelson H. F. Beebe.
9430
7870f699
PE
9431 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
9432 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
9433
6fc0c024
PE
9434 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
9435 nodist_PROGRAMS, since we don't need to actually compile the
9436 example if we're just doing a plain 'make'. This avoids bothering
9437 the installer unnecessarily about problems due to weird C++
9438 compilers.
9439
fe6c2fde
PE
94402006-02-06 Paul Eggert <eggert@cs.ucla.edu>
9441
9442 More portability fixes for problems summarized by Nelson H. F. Beebe.
9443
9444 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
9445 than #include "...", and compile with -I'.'. The old method was
9446 not portable, according to Posix and the C standard, and it does
9447 not work with Sun C 5.7, where previous #line directives affect
9448 the working directory used in later #include "..." directives.
9449
927b425b
JMG
94502006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9451
9452 Various DJGGP specific issues in /djgpp
9453
d9735e9e
PE
94542006-02-02 Paul Eggert <eggert@cs.ucla.edu>
9455
9456 More portability fixes for problems summarized by Nelson H. F. Beebe.
9457
9458 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
9459 '#include <map>' works and that you can apply ++ to iterators.
9460
5a6755af
PE
94612006-02-01 Paul Eggert <eggert@cs.ucla.edu>
9462
67a0dc4f
PE
9463 Work around portability problems summarized by Nelson H. F. Beebe in
9464 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
9465
8c86f0ef
PE
9466 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
9467 that '#include <string>' works.
9468
de35dd59
PE
9469 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
9470 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
9471 "warning: sorry: semantics of inline function static data `const
9472 unsigned char translate_table[262]' are wrong (you'll wind up with
9473 multiple copies)".
9474
67a0dc4f
PE
9475 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
9476 or, xor to not_, and_, or_, and xor_, respectively. This works
9477 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
9478 random system header somewhere that includes the equivalent of
9479 <iso646.h>.
9480
5a6755af
PE
9481 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
9482 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 9483 Suite Version 2.0.
5a6755af 9484
3f001415
JD
94852006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
9486
9487 During deterministic GLR operation, user actions should be able to
9488 influence the parse by changing yychar. To make this easier to fix and
9489 to make glr.c easier to evolve in general, don't maintain yytoken in
9490 parallel with yychar; just compute yytoken when needed.
9491 * tests/glr-regression.at (Incorrect lookahead during deterministic
9492 GLR): Check that setting yychar in a user action has the intended
9493 effect.
9494 * data/glr.c (yyGLRStack): Remove yytokenp member.
9495 (yyclearin): Don't set *yytokenp.
9496 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
9497 yychar rather than *yytokenp to determine the current lookahead.
9498 Compute yytoken locally when needed.
9499 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
9500 point to.
9501
9502 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
9503 after `--report' documentation.
9504
e2a8c0f5
PE
95052006-01-30 Paul Eggert <eggert@cs.ucla.edu>
9506
9507 * src/parse-gram.y (grammar_declaration): Location of printer
9508 symbol is @1, not list->location. Bug reported by twlevo.
9509 * tests/input.at (Incompatible Aliases): Adjust to above change.
9510
6b702268
PE
95112006-01-29 Paul Eggert <eggert@cs.ucla.edu>
9512
27622431
PE
9513 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
9514 all the test at once. This makes the output easier to read in the
9515 normal case.
9516
6b702268
PE
9517 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
9518 got from <http://bro-ids.org/download.html>. The bug is that
9519 when two actions appeared in succession, the second one was
9520 scanned before the first one was added to the grammar rule
9521 as a midrule action. Bison then output the incorrect warning
9522 "parse.y:905.17-906.36: warning: unused value: $3".
9523 * src/parse-gram.y (BRACED_CODE, action): These are no longer
9524 associated with a value.
9525 (rhs): Don't invoke grammar_current_rule_action_append.
9526 (action): Invoke it here instead.
9527 * src/reader.c (grammar_midrule_action): Now extern.
9528 (grammar_current_rule_action_append): Don't invoke
9529 grammar_midrule_action; that is now the scanner's job.
9530 * src/reader.h (last_string, last_braced_code_loc):
9531 (grammar_midrule_action): New decls.
9532 * src/scan-gram.l (last_string): Now extern, sigh.
9533 (last_braced_code_loc): New extern variable.
9534 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
9535 rule already has an action.
9536 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
9537 * tests/input.at (AT_CHECK_UNUSED_VALUES):
9538 Add some tests to check that the above changes fixed the bug.
9539
d40ba6c2
PE
95402006-01-27 Paul Eggert <eggert@cs.ucla.edu>
9541
9542 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
9543 All used changed. Check whether the symbol has a destructor,
9544 not whether it is typed.
9545 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
9546 that the values are still reported as unused. All line numbers
9547 adjusted.
9548
401aace6
PE
95492006-01-23 Paul Eggert <eggert@cs.ucla.edu>
9550
9551 Work around a bug in bro 0.8, which underparenthesizes its
9552 definition of YYLLOC_DEFAULT.
9553 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
9554 their arguments.
9555 * data/lalr1.cc: Likewise.
9556 * data/yacc.cc: Likewise.
9557
06f01bc4
PE
95582006-01-22 Paul Eggert <eggert@cs.ucla.edu>
9559
401aace6
PE
9560 Work around a bug in Pike 7.0, and give the Pike folks a
9561 better way to override the usual int widths.
9562 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
9563 user can override the types.
9564 (short): #undef, to work around a bug in Pike 7.0.
9565 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
9566 (union yyalloc.yyss): Use yytype_int16 rather than short.
9567 All uses changed.
9568 (yysigned_char): Remove.
9569 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
9570 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
9571 * tests/regression.at (Web2c Actions): Adjust to above changes.
9572
9573 * src/reader.c (check_and_convert_grammar): New function.
9574 (reader): Close the input file even if something went wrong during
9575 parsing. Minor file descriptor leak reported by twlevo.
9576
06f01bc4
PE
9577 * src/assoc.c (assoc_to_string): Use a default: abort (); case
9578 to pacify gcc -Wswitch-default.
9579 * src/scan-gram.l (adjust_location): Use a default: break; case
9580 to pacify gcc -Wswitch-default.
9581 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
9582 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
9583 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
9584 Move these decls to scan-skel.l, since they don't need to be
9585 visible elsewhere.
9586 * src/scan-skel.l: Accept the above decls.
9587 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
9588 is used.
9589
02650b7f
PE
95902006-01-21 Paul Eggert <eggert@cs.ucla.edu>
9591
9592 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
9593 since we don't want to insist on a version number at the start
9594 of the changelog every time.
9595 * Makefile.maint: Sync from coreutils a bit better.
9596 (sc_trailing_blank): Renamed from sc_trailing_space.
9597 All uses changed.
9598 (sc_no_if_have_config_h, sc_require_config_h):
9599 (sc_prohibit_assert_without_use): New rules.
9600 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
9601 (sc_dd_max_sym_length): Fix leading spaces in rule.
9602 (sc_system_h_headers): Prefix with @.
9603 (sc_useless_cpp_parens, m4-check): Output line numbers.
9604 (changelog-check): Allow version only in head.
9605 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
9606 satisfy new Makefile.maint rule.
9607 * data/glr.c: Likewise.
9608 * data/glr.cc: Likewise.
9609 * data/lalr1.cc: Likewise.
9610 * data/yacc.c: Likewise.
9611 * lib/ebitsetv.c: Likewise.
9612 * lib/lbitset.c: Likewise.
9613 * lib/subpipe.c: Likewise.
9614 * lib/timevar.c: Likewise.
9615 * src/system.h: Likewise.
9616 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
9617 * djgpp/Makefile.maint: Add copyright notice.
9618 * djgpp/README.in: Likewise.
9619 * djgpp/config.bat: Likewise.
9620 * djgpp/config.site: Likewise.
9621 * djgpp/config_h.sed: Likewise.
9622 * djgpp/djunpack.bat: Likewise.
9623 * djgpp/config.sed: Fix copyright notice to match standard format.
9624 * djgpp/subpipe.h: Likewise.
9625 * lib/bitsetv-print.c: Likewise.
9626 * lib/bitsetv.c: Likewise.
9627 * lib/subpipe.h: Likewise.
9628 * lib/timevar.c: Likewise.
9629 * lib/timevar.h: Likewise.
9630 * djgpp/subpipe.c: Use standard recipe for config.h.
9631 * lib/abitset.c: Likewise.
9632 * lib/bitset.c: Likewise.
9633 * lib/bitset_stats.c: Likewise.
9634 * lib/bitsetv-print.c: Likewise.
9635 * lib/bitsetv.c: Likewise.
9636 * lib/ebitsetv.c: Likewise.
9637 * lib/get-errno.c: Likewise.
9638 * lib/lbitset.c: Likewise.
9639 * lib/subpipe.c: Likewise.
9640 * lib/timevar.c: Likewise.
9641 * lib/vbitset.c: Likewise.
9642 * tests/local.at: Likewise.
9643 * src/scan-gram.l: Don't include verify.h, since system.h does
9644 that for us.
9645 * .x-sc_require_config_h: New file.
9646 * .x-sc_unmarked_diagnostics: New file.
9647
287c78f6
PE
96482006-01-20 Paul Eggert <eggert@cs.ucla.edu>
9649
287c78f6
PE
9650 Be a bit more systematic about using 'abort'.
9651 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
9652 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
9653 Put 'default: abort ();' before some other case, to satisfy older
9654 pedantic compilers.
9655 * lib/bitset_stats.c (bitset_stats_init): Likewise.
9656 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
9657 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
9658 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
9659 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
9660 (get_decision_str, get_orientation_str, get_node_alignment_str):
9661 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
9662 (get_linestyle_str, get_arrowstyle_str): Likewise.
9663 * src/conflicts.c (resolve_sr_conflict):
9664 Use a default case rather than one for the one remaining enum
9665 value, to catch invalid enum values as well.
9666 * src/lalr.c (set_goto_map, map_goto):
9667 Prefer "assert (FOO);" to "if (!FOO) abort ();".
9668 * src/nullable.c (nullable_compute, token_definitions_output):
9669 Likewise.
9670 * src/reader.c (packgram, reader): Likewise.
9671 * src/state.c (transitions_to, state_new, state_reduction_find):
9672 Likewise.
9673 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
9674 (symbol_pack): Likewise.
9675 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
9676 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
9677 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
9678 * src/system.h: Don't include <assert.h>.
9679 (assert): New macro.
9680
9681 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
9682 (Destructor Decl, Parser Function, Pure Calling):
9683 Describe rules for braces inside C code more carefully.
287c78f6 9684
c66dfadd
PE
96852006-01-19 Paul Eggert <eggert@cs.ucla.edu>
9686
c21493b8
PE
9687 Fix some porting glitches found by Nelson H. F. Beebe.
9688 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
9689 compilers that don't understand that abort () does not return.
9690 * src/state.c (transitions_to): Likewise.
9691 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
9692 that '#include <cstdlib>' works.
9693 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
9694 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
9695 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
9696 for the benefit of some pre-C99 compilers.
9697
b6e3facf
PE
9698 * bootstrap: Undo changes to gnulib files that autoreconf made.
9699
c66dfadd
PE
9700 Minor fixups to get 'make maintainer-check' to work.
9701 * configure.ac: Don't use -Wnested-externs, as it's incompatible
9702 with the new verify.h implementation.
9703 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
9704 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
9705 * data/yacc.c (YYUSE): Likewise.
9706 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
9707 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
9708 * src/parse-gram.y (declaration): Don't pass a string constant
9709 to a function that expects char *, since GCC might complain
9710 about the constant value.
9711 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
9712 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
9713 before #defining them.
9714 * tests/glr-regression.at
9715 (Incorrectly initialized location for empty right-hand side in GLR):
9716 In yyerror, use the msg arg.
9717 (Corrupted semantic options if user action cuts parse):
9718 (Incorrect lookahead during deterministic GLR):
9719 (Incorrect lookahead during nondeterministic GLR):
9720 Don't name a local var 'index'; it shadows string.h's 'index'.
9721
ed94ef2a
AD
97222006-01-19 Akim Demaille <akim@epita.fr>
9723
9724 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
9725 location, not just parts of it.
9726
e9ad4aec
PE
97272006-01-18 Paul Eggert <eggert@cs.ucla.edu>
9728
d6ca7905
PE
9729 * NEWS: Document the fact that multiple %unions are now allowed.
9730 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
9731 * TODO: This feature is now implemented, so remove it from
9732 the wishlist.
d6ca7905 9733
ef1b70e0
PE
9734 * Makefile.maint: Merge with coreutils Makefile.maint.
9735 (CVS_LIST): Use build-aux version if available.
9736 (VERSION_REGEXP): New macro.
9737 (syntax-check-rules): Add sc_no_if_have_config_h,
9738 sc_prohibit_assert_without_use, sc_require_config_h,
9739 sc_useless_cpp_parens.
9740 (sc_obsolete_symbols): Check for O_NDELAY.
9741 (sc_dd_max_sym_length): Track coreutils.
9742 (sc_unmarked_diagnostics): Look in all files, not just *.c.
9743 (sc_useless_cpp_parens): New rule.
9744 (news-date-check): Look for version or today's date.
9745 (changelog-check): Don't require version number near head.
9746 (copyright-check): Use current year instead of hardwiring 2005.
9747 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
9748 (announcement): Add --gpg-key-ID.
9749
9750 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
9751 with "file system".
9752
2073ce56 9753 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
9754 array. Problem reported by twlevo.
9755 * src/reader.c (packgram): Prepend a new sentinel before ritem.
9756 * src/lalr.c (build_relations): Rely on new sentinel.
9757 * src/gram.c (gram_free): Adjust to new sentinel.
9758
b7691f15
JD
97592006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
9760
9761 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
9762 yylookaheadNeeds. All uses updated.
9763 (yysplitStack): Rename local yynewLookaheadStatuses to
9764 yynewLookaheadNeeds.
9765 * data/glr-regression.at (Incorrect lookahead during nondeterministic
9766 GLR): In comments, change `lookahead status' to `lookahead need'.
9767
ddee1b06
PH
97682006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9769
9770 * data/glr.c (yysplitStack): A little stylistic rewrite.
9771
12f4614d
PH
97722006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9773
9774 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
9775
32c29292
JD
97762006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
9777
9778 * doc/bison.texinfo: Fix some typos.
9779 (GLR Semantic Actions): New subsection discussing special
9780 considerations because GLR semantic actions might be deferred.
9781 (Actions): Mention look-ahead usage of yylval.
9782 (Actions and Locations): Mention look-ahead usage of yylloc.
9783 (Special Features for Use in Actions): Add YYEOF entry and mention it
9784 in the yychar entry.
9785 In the yychar entry, remove mention of the local yychar case (pure
9786 parser) since this is irrelevant information when writing semantic
148d66d8 9787 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
9788 yychar is otherwise described as an external variable.
9789 In the yychar entry, don't call it the `current' look-ahead since it
9790 isn't when semantic actions are deferred.
9791 In the yychar and yyclearin entries, add note about deferred semantic
9792 actions.
9793 Add yylloc and yylval entries discussing look-ahead usage.
9794 (Look-Ahead Tokens): When discussing yychar, don't call it the
9795 `current' look-ahead, and do mention yylval and yylloc.
9796 (Error Recovery): Cross-reference `Action Features' when mentioning
9797 yyclearin.
148d66d8 9798 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
9799 look-ahead.
9800 In the yylloc and yylval entries, mention look-ahead usage.
9801
de366a2f 98022006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
9803
9804 * tests/glr-regression.at: Update copyright year to 2006.
9805
bf70fa87
JD
98062006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
9807
9808 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
9809 use during nondeterministic operation to track which stacks have
9810 actually needed the current lookahead.
9811 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
9812 Allocate, deallocate, resize, and otherwise shuffle space for
9813 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
9814 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
9815 appropriately during nondeterministic operation.
9816 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
9817 members to store the current lookahead to be used by the deferred
9818 user action.
9819 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
9820 from which the RHS is taken. Set the lookahead members of the new
9821 yySemanticOption according to the lookahead status for stack yyk.
9822 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
9823 yyaddDeferredAction.
9824 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
9825 members of yySemanticOption before invoking yyuserAction, and then set
9826 them back to their current values afterward.
9827 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
9828 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
9829 * tests/glr-regression.at: Remove `.' from the ends of recent test case
9830 titles for consistency.
9831 (Leaked merged semantic value if user action cuts parse): In order to
9832 suppress lint warnings, use arguments in merge function, and assign
9833 char value < 128 in main.
9834 (Incorrect lookahead during deterministic GLR): New test case.
9835 (Incorrect lookahead during nondeterministic GLR): New test case.
9836
05449a2c
JD
98372006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
9838
de366a2f 9839 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
9840 !yyvaluep as signal that no semantic value is available to print.
9841 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
9842 to print a semantic value.
9843
4158e0a1 98442006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 9845
4158e0a1
JD
9846 * tests/glr-regression.at: For consistency with my newer test cases,
9847 don't thank myself.
9848
d659304d
JD
98492006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
9850
9851 * data/glr.c (yyresolveValue): When merging semantic options, if at
9852 least one user action succeeds but a later one cuts the parse, then
9853 destroy the semantic value before returning rather than leaking it.
9854 (yyresolveStates): If a user action cuts the parse and thus
9855 yyresolveValue fails, ignore the (unset) semantic value rather than
9856 corrupting the yyGLRState, and empty the semantic options list since
9857 the user actions should have called all necessary destructors.
9858 Simplify code with YYCHK.
9859 * tests/glr-regression.at (Corrupted semantic options if user action
9860 cuts parse): New test case.
9861 (Undesirable destructors if user action cuts parse): New test case.
9862 Before applying any of this patch, this test case never actually failed
9863 for me... but only because the corrupted semantic options usually
9864 masked this bug.
9865 (Leaked merged semantic value if user action cuts parse): New test
9866 case.
9867
6ec2c0f2
AD
98682006-01-05 Akim Demaille <akim@epita.fr>
9869
9870 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
9871
1b9c21fb
PE
98722006-01-04 Paul Eggert <eggert@cs.ucla.edu>
9873
9874 * data/c.m4 (b4_c_modern): New macro, with a new provision for
9875 _MSC_VER. Problem reported by Cenzato Marco.
9876 (b4_c_function_def): Use it.
9877 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
9878 b4_c_modern.
9879 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
9880 than rolling our own.
9881
84866159
AD
98822006-01-04 Akim Demaille <akim@epita.fr>
9883
9884 Also warn about non-used mid-rule values.
9885 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
9886 member.
9887 (symbol_list_new): Adjust.
9888 * src/reader.c (symbol_typed_p): New.
9889 (grammar_rule_check): Use it.
9890 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
9891 Check its rule.
9892 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
9893 Use it.
9894 * tests/actions.at (Exotic Dollars): Adjust.
9895
378f4bd8
AD
98962006-01-04 Akim Demaille <akim@epita.fr>
9897
9898 * src/reader.c (grammar_midrule_action): If $$ is set in a
9899 mid-rule, move the `used' bit to its lhs.
9900 * tests/input.at (Unused values): New.
9901 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
9902
e2a21b6f
PE
99032006-01-03 Paul Eggert <eggert@cs.ucla.edu>
9904
54662697
PE
9905 * doc/bison.texinfo (Bison Options): Say more accurately what
9906 --yacc does.
9907 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
9908 about declarations in the grammar when in Yacc mode, as POSIX does
9909 not require a diagnostic when the grammar uses extensions.
9910
9911 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
9912
073f9288
PE
9913 Warn about dubious constructions like "%token T T".
9914 Reported by twlevo.
9915 * src/symtab.h (struct symbol.declared): New member.
9916 * src/symtab.c (symbol_new): Initialize it to false.
9917 (symbol_class_set): New arg DECLARING, specifying whether
9918 this is a declaration that we want to warn about, if there
9919 is more than one of them. All uses changed.
9920
1221b78a
PE
9921 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
9922 Allow multiple %union directives, whose contents concatenate.
9923 * src/parse-gram.y (grammar_declaration): Likewise.
9924 Use muscle_code_grow, so that we don't need stype_line any more.
9925 All uses changed.
9926
9927 * src/muscle_tab.c (muscle_grow): Fix comment.
9928
e2a21b6f
PE
9929 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
9930 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
9931 Update copyright year to 2006.
9932
8f7e3cf9
AD
99332006-01-03 Akim Demaille <akim@epita.fr>
9934
9935 Have glr.cc pass (some of) the calc.at tests.
9936 * data/glr.cc (b4_parse_param_orig): New.
9937 (b4_parse_param): Improve its definition, and bound it more
9938 clearly in the skeleton.
9939 (b4_epilogue): Append, instead of prepending, in order to keep
9940 #line consistency.
9941 Simplify the generation of auxiliary functions: locations and
9942 purity are mandated.
9943 (b4_global_tokens_and_yystype): Honor it.
9944 * data/location.cc (c++.m4): Don't include it.
9945 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
9946 and AT_SKEL_CC_IF.
9947 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
9948 AT_LALR1_CC_IF.
9949 Be sure to initialize the first position's filename.
9950 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
9951 mandated anyway.
9952 (AT_CHECK_CALC_GLR_CC): New.
9953 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
9954
3953ed88
AD
99552006-01-02 Akim Demaille <akim@epita.fr>
9956
9957 * src/output.c (output_skeleton): Don't hard wire the inclusion of
9958 c.m4.
0a96ba81 9959 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
9960 * data/glr.cc: Do not include stack.hh.
9961
9ecafbbf
AD
99622006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
9963
9964 * data/glr.c: Reformat whitespace with tabs.
9965 (b4_lpure_formals): Remove this unused m4 macro.
9966 * tests/cxx-type.at: Reformat whitespace with tabs.
9967 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
9968 since it's a member. Rename type to isNterm for clarity.
9969
c4d497a0
AD
99702005-12-29 Akim <akim@sulaco.local>
9971
9972 Let glr.cc catch up with symbol_value_print.
9973 * data/glr.cc (b4_yysymprint_generate): Replace by...
9974 (b4_yy_symbol_print_generate): this.
9975 (yy_symbol_print, yy_symbol_value_print): Declare them.
9976
4517da37
PE
99772005-12-28 Paul Eggert <eggert@cs.ucla.edu>
9978
9979 * src/location.h (boundary): Note that a line or column equal
9980 to INT_MAX indicates an overflow.
9981 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
9982 (rule_length_overflow, increment_rule_length, add_column_width):
9983 New functions.
9984 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
9985 (<SC_BRACED_CODE>"}"):
9986 Use increment_rule_length rather than incrementing it by hand.
9987 (adjust_location, handle_syncline): Diagnose overflow.
9988 (handle_action_dollar, handle_action_at):
9989 Fix bug with monstrosities like $-2147483648.
9990 Remove now-unnecessary checks.
9991 (scan_integer): Verify assumptions and remove now-unnecessary checks.
9992 (convert_ucn_to_byte): Verify assumptions.
9993 (handle_syncline): New arg LOC. All callers changed.
9994 Don't store through a value derived from char const * pointer.
9995
9996 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
9997 GCC warnings.
9998
e3233bf6
PE
99992005-12-27 Paul Eggert <eggert@cs.ucla.edu>
10000
10001 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
10002 Remove unnecessary forward static decls.
10003
8f3596a6
AD
100042005-12-27 Akim Demaille <akim@epita.fr>
10005
10006 * src/reader.c (grammar_current_rule_check): Also check that $$
10007 is used.
10008 Take the rule to check as argument, hence rename as...
10009 (grammar_rule_check): this.
10010 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
10011 Rename as...
10012 (grammar_rule_begin, grammar_rule_end): these, for consistency.
10013 (grammar_midrule_action, grammar_symbol_append): Now static.
10014 * tests/torture.at (input): Don't rely on the default action
10015 being always performed.
10016 * tests/calc.at: "Set" $$ even when the action is "cut" with
10017 YYERROR or other.
10018 * tests/actions.at (Exotic Dollars): Instead of using unused
10019 values, check that the warning is issued.
10020
721be13c
PE
100212005-12-22 Paul Eggert <eggert@cs.ucla.edu>
10022
10023 * NEWS: Improve wording for unused-value warnings.
10024
a0af42fc
AD
100252005-12-22 Akim Demaille <akim@epita.fr>
10026
10027 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
10028 (b4_yysymprint_generate): Rename as...
10029 (b4_yy_symbol_print_generate): this.
10030 Generate yy_symbol_print instead of yysymprint.
10031 Generate also yy_symbol_value_print, and use it.
10032
affac613
AD
100332005-12-22 Akim Demaille <akim@epita.fr>
10034
721be13c 10035 * NEWS: Warn about unused values.
affac613
AD
10036 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
10037 a `used' member.
10038 (symbol_list_n_get, symbol_list_n_used_set): New.
10039 (symbol_list_n_type_name_get): Use symbol_list_n_get.
10040 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
10041 * src/reader.c (grammar_current_rule_check): Check that values are
10042 used.
10043 * src/symtab.c (symbol_print): Accept 0.
10044 * tests/existing.at: Remove the type information.
10045 Empty the actions.
10046 Remove useless actions (beware of mid-rule actions: perl -000
10047 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
10048 * tests/actions.at (Exotic Dollars): Use unused values.
10049 * tests/calc.at: Likewise.
10050 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10051 Likewise.
10052
10053 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
10054 rule_useful_p.
10055
9d9b8b70
PE
100562005-12-21 Paul Eggert <eggert@cs.ucla.edu>
10057
8bb4c753
PE
10058 Undo 2005-12-01 tentative license wording change. The wording is
10059 still being reviewed by the lawyers, and we don't want to wait for
10060 them before publishing a test release. For now, revert to the
10061 previous wording.
10062 * NEWS: Undo 2005-12-01 change.
10063 * data/glr.c: Revert to previous license wording.
10064 * data/glr.cc: Likewise.
10065 * data/lalr1.cc: Likewise.
10066 * data/location.cc: Likewise.
10067 * data/yacc.c: Likewise.
10068
9d9b8b70
PE
10069 * NEWS: Reword %destructor vs YYABORT etc.
10070 * data/glr.c: Use American spacing, for consistency.
10071 * data/glr.cc: Likewise.
10072 * data/lalr1.cc: Likewise.
10073 * data/yacc.c: Likewise.
10074 * data/yacc.c: Reformat comments slightly.
10075 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
10076 for consistency. Fix some spelling errors and reword recently-included
10077 text slightly.
10078 * tests/cxx-type.at: Cast results of malloc, for C++.
10079
2c3b392a
AD
100802005-12-21 Joel E. Denny <address@hidden>
10081
10082 * tests/cxx-type.at: Construct a tree, count the parents of shared
10083 nodes, and free each node once and only once. Previously, the memory
10084 for semantic values was leaked instead.
10085
d6cff4dc
AD
100862005-12-21 Joel E. Denny <address@hidden>
10087
10088 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
10089 (yylval, yylloc): If pure, #define to yystackp->yyval and
10090 yystackp->yyloc similar to yychar and yynerrs.
10091 (yyparse): If pure, remove local yylval and yylloc. Add local
10092 yystackp to accommodate pure definitions of yylval and yylloc.
10093 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
10094 yylvalp and yyllocp to &yylval and &yylloc.
10095 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
10096 namespace. Previously, nerrs and char were missing, but lval and lloc
10097 weren't necessary.
10098 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
10099 yylvalp and yyllocp parameters since, if pure, these are now always
10100 accessible through yystackp. If not pure, they are still accessible
10101 globally.
10102 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
10103 `if (YYID (N))' to pacify lint.
10104
a85284cf
AD
101052005-12-21 Akim Demaille <akim@epita.fr>
10106
10107 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
10108 destroy the RHS symbols of a rule.
10109 * data/yacc.c (yylen): Initialize to 0.
10110 Keep its value to the number of items to possibly shift.
10111 In particular, a regular successful parse that ends on YYFINAL by
10112 a (internal) YYACCEPT must not have yylen != 0.
10113 (yyerrorlab, yyreturn): Pop the RHS.
10114 Reorder a bit to emphasize the `shifting' bits of code.
10115 (YYPOPSTACK): Now accept a number of items to pop.
10116 * data/lalr1.cc: Likewise.
10117 * data/glr.c: Formatting changes.
10118 Use goto instead of fall through.
10119 * doc/bison.texinfo (Destructor Decl): Complete.
10120
d508c281
JMG
101212005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10122
10123 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10124 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
10125 * djgpp/config.bat: Replace every occurence of the file name
10126 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10127 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10128 * djgpp/config.sed: Replace every occurence of the file name
10129 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10130 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10131 * djgpp/djunpack.bat: DJGPP specific file.
10132 * djgpp/fnchange.lst: DJGPP specific file.
10133 * djgpp/README.in: Add new information about how to unpack the bison
10134 source on MSDOS and other systems which have 8.3 file name restrictions
10135 using djunpack.bat and fnchange.lst.
10136
3e7a2cd9
PE
101372005-12-12 Paul Eggert <eggert@cs.ucla.edu>
10138
10139 * bootstrap (build_cvs_prefix): Remove; unused.
10140 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
10141 when getting gnulib.
10142
101432005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
10144
10145 * data/glr.c: Reorder typedef declarations for structs to match order
10146 of struct declarations.
10147 Rename yystack everywhere to yystackp except in yyparse where it's not
10148 a pointer.
10149 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
10150 consistency.
10151 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
10152 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
10153 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
10154 lint.
10155
877519f8
PE
101562005-12-09 Paul Eggert <eggert@cs.ucla.edu>
10157
0eca5a39
PE
10158 * tests/sets.at (Accept): Fix typos in regular expression used to
10159 sed out the final state number.
10160
2cec9080
PE
10161 Work around portability problem on Solaris 10: flex-generated
10162 files include <stdio.h> before <config.h>, which messes up
10163 because the latter defines __EXTENSIONS__. Address the problem
10164 by creating two new little files that include <config.h> first,
10165 then include the flex-generated files. Rewrite everyone else
10166 to include <config.h> first, as well.
10167 * lib/timevar.c: Always include "config.h".
10168 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
10169 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
10170 (EXTRA_bison_SOURCES): New macro.
10171 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
10172 * src/system.h: Don't include config.h.
10173 * src/LR0.c: Include <config.h> first.
10174 * src/assoc.c: Likewise.
10175 * src/closure.c: Likewise.
10176 * src/complain.c: Likewise.
10177 * src/conflicts.c: Likewise.
10178 * src/derives.c: Likewise.
10179 * src/files.c: Likewise.
10180 * src/getargs.c: Likewise.
10181 * src/gram.c: Likewise.
10182 * src/lalr.c: Likewise.
10183 * src/location.c: Likewise.
10184 * src/main.c: Likewise.
10185 * src/muscle_tab.c: Likewise.
10186 * src/nullable.c: Likewise.
10187 * src/output.c: Likewise.
10188 * src/parse-gram.y: Likewise.
10189 * src/print.c: Likewise.
10190 * src/print_graph.c: Likewise.
10191 * src/reader.c: Likewise.
10192 * src/reduce.c: Likewise.
10193 * src/relation.c: Likewise.
10194 * src/state.c: Likewise.
10195 * src/symlist.c: Likewise.
10196 * src/symtab.c: Likewise.
10197 * src/tables.c: Likewise.
10198 * src/uniqstr.c: Likewise.
10199 * src/vcg.c: Likewise.
10200
877519f8
PE
10201 * src/parse-gram.y: Fix minor problems uncovered by lint.
10202 (current_lhs, current_lhs_location): Now static.
10203 (current_assoc): Remove unused variable.
10204
10205 Cleanups so that Bison-generated parsers have less lint.
10206 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
10207 Prepend /*ARGSUSED*/, for lint's sake.
10208 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
10209 definition if 'lint' is defined.
10210 (YYID): New macro (or function, if lint).
10211 All uses of /*CONSTCOND*/0 replaced by YYID(0).
10212 * data/yacc.c: Likewise.
10213 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
10214 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
10215 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
10216 is C++ only.
10217 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
10218 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
10219 Use YYID(0) rather than 0, for lint.
10220 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
10221 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
10222
f5228370
PE
102232005-12-07 Paul Eggert <eggert@cs.ucla.edu>
10224
10225 * tests/glr-regression.at
10226 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10227 Close memory leak reported by twlevo.
10228
69ce078b
PE
102292005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
10230
6ff99711
PE
10231 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
10232 all stacks.
10233 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
10234 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10235 New test case.
10236 (Duplicated user destructor for lookahead): This test now is expected
10237 to succeed.
10238
af3412cd
PE
102392005-12-01 Paul Eggert <eggert@cs.ucla.edu>
10240
32b5b719 10241 * NEWS: Document the following change.
af3412cd
PE
10242 * data/yacc.c: Say "parser skeleton" rather than "file", since
10243 it's no longer just a file.
10244 * data/glr.c: Grant a special exception for C GLR parsers, that
10245 reads like the already-existing exception for C LALR(1) parsers.
10246 * data/glr.cc: Likewise.
10247 * data/lalr1.cc: Likewise.
10248 * data/location.cc: Likewise.
10249 * data/yacc.c: Reword the "written by" statement to clarify that
10250 it was the parser skeleton, not the entire output file.
10251 * data/glr.c: Written by Paul Hilfinger.
10252 * data/glr.cc: Written by Akim Demaille.
10253 * data/lalr1.cc: Likewise.
10254
035aa4a0
PE
102552005-11-18 Paul Eggert <eggert@cs.ucla.edu>
10256
d9963c85
PE
10257 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
10258 Fix typos in previous change that broke 'make check'.
10259 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
10260 supported in C.
10261 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
10262 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
10263 We can revert this once things settle down.
10264
035aa4a0
PE
10265 * src/conflicts.c (conflicts_print): Don't print file name twice
10266 when %expect fails because there were no conflicts.
10267 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
10268 change.
10269 * tests/conflicts.at (%expect not enough, %expect too much):
10270 (%expect with reduce conflicts): Adjust to new behavior.
10271
102722005-11-18 Akim Demaille <akim@epita.fr>
10273
10274 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
10275 errors.
10276 * NEWS: Document this.
10277 * doc/bison.texinfo (Expect Decl): Likewise.
10278
d1ff7a7c
AD
102792005-11-16 Akim Demaille <akim@epita.fr>
10280
10281 Generalize the display of semantic values and locations in traces.
10282 * data/glr.c (yy_reduce_print): Fix indices (again).
10283 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
10284 literal integers.
10285 * data/lalr1.cc (yyreduce_print): Rename as...
10286 (yy_reduce_print): this.
10287 Display values and locations.
10288 * data/yacc.c (yy_reduce_print): Likewise.
10289 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
10290 (yysymprint): Move higher to be visible from yy_reduce_print).
10291 (yyparse): Adjust.
10292 * tests/calc.at: Adjust the expected length of the traces.
10293
6de5398d
AD
102942005-11-14 Akim Demaille <akim@epita.fr>
10295
10296 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
10297 from 1 to N, while values and location start at 0.
10298 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
10299
a1373f55
AD
103002005-11-14 Akim Demaille <akim@epita.fr>
10301
10302 * data/glr.c (yy_reduce_print): Fix the $ number.
10303
613d8952
AD
103042005-11-14 Akim Demaille <akim@epita.fr>
10305
10306 "Use" parse parameters.
10307 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
10308 * data/glr.c, data/glr.cc: Use them.
10309 * data/glr.c (YYUSE): Have a C++ definition that supports
10310 non-pointer types.
10311
b2741627
AD
103122005-11-14 Akim Demaille <akim@epita.fr>
10313
10314 * data/glr.c (yyexpandGLRStack): Declare only if defined.
10315
5059b5c8
AD
103162005-11-14 Akim Demaille <akim@epita.fr>
10317
42249483
AD
10318 * data/glr.cc: New.
10319 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 10320
4626a15d
AD
103212005-11-12 Akim Demaille <akim@epita.fr>
10322
10323 Let position and location be PODs.
10324 * data/location.cc (position::initialize, location::initialize): New.
10325 (position::position, location::location): Define only if
10326 b4_location_constructors is defined.
10327 * data/lalr1.cc (b4_location_constructors): Define it for backward
10328 compatibility.
10329 * doc/bison.texinfo (Initial Action Decl): Use initialize.
10330
103312005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
10332
10333 * data/lalr1.cc: Move the body of the ctor and dtor into the
10334 parser file (instead of the header).
10335 Wrap the implementations in a "namespace yy".
10336
103372005-11-12 Akim Demaille <akim@epita.fr>
10338
10339 Have glr.c include its header file when created.
10340 * data/glr.c (b4_shared_declarations): New.
10341 Output them verbatim in the parser if !%defines, otherwise
10342 output then in the header file, and include it instead.
10343
1989d947
AD
103442005-11-11 Akim Demaille <akim@epita.fr>
10345
10346 * data/glr.c: Comment changes.
10347
103482005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
10349
10350 When yydebug, report semantic and location values for reductions.
10351 * data/glr.c (yy_reduce_print): Report the semantic values and the
10352 locations.
10353 (YY_REDUCE_PRINT): Adjust.
10354 (yyglrReduce): Use them.
10355 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
10356 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
10357 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
10358 traces.
10359
02998094
AD
103602005-11-10 Akim Demaille <akim@epita.fr>
10361
10362 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
10363 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
10364 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
10365
5210672f
PE
103662005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
10367
10368 * m4/cxx.m4, examples/Makefile.am: Don't build
10369 examples/calc++ if no C++ compiler is available. (trivial change)
10370
a8991a1d
AD
103712005-11-09 Akim Demaille <akim@epita.fr>
10372
10373 * src/scan-skel.l: Use a couple of asserts.
10374
36b5e963
AD
103752005-11-03 Akim Demaille <akim@epita.fr>
10376
10377 In some (weird) cases, the final state number is incorrect.
10378 Reported by Alexandre Duret-Lutz.
10379 * src/LR0.c (state_list_append): Remove the computation of
10380 final_state.
10381 (save_reductions): Do it here.
10382 (get_state): Alpha conversion.
10383 (generate_states): Use a for loop.
10384 * src/gram.h (item_number_is_rule_number)
10385 (item_number_is_symbol_number): New.
10386 * src/state.c: Use assert.
10387 * src/system.h: Include assert.h.
10388 * tests/sets.at (Accept): New.
10389
44e7ead1
PH
103902005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10391
10392 * data/glr.c (yyfill): Adjust comment.
36b5e963 10393 (yyresolveAction): Initialize default location properly
44e7ead1
PH
10394 for empty right-hand sides.
10395 (yydoAction): Ditto.
10396 Add comment explaining apparently dead code.
36b5e963
AD
10397 * tests/glr-regression.at
10398 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 10399 New test.
36b5e963 10400
e10a80ee
PE
104012005-10-30 Paul Eggert <eggert@cs.ucla.edu>
10402
10403 * bootstrap (cleanup_gnulib): New function. Use it to clean up
10404 gnulib when interrupted. This fixes some race conditions and
10405 works around some portability problems (one noted by Paul
10406 Hilfinger).
10407
067b32ee
AD
104082005-10-22 Akim <akim@epita.fr>
10409
10410 * Makefile.cfg: Adjust to config -> build-aux.
10411 Reported by twledo.
10412
4b367315
AD
104132005-10-21 Akim Demaille <akim@epita.fr>
10414
10415 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
10416 the %parse-params.
10417 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
10418 * data/yacc.c (b4_Pure_if): Rename as...
10419 (b4_yacc_pure_if): this.
10420 (YY_SYMBOL_PRINT, yyparse): Adjust.
10421 * doc/bison.texinfo: Formatting changes.
10422
24cc23d9
AD
104232005-10-21 Akim Demaille <akim@epita.fr>
10424
10425 Finish the transition config -> build-aux.
10426 * configure.ac, Makefile.am: Use build-aux.
10427 * config/prev-version, config/announce-gen, config/Makefile.am:
10428 Move to...
10429 * build-aux/prev-version, build-aux/announce-gen,
10430 * build-aux/Makefile.am: here.
10431
d4476375
AD
104322005-10-14 Akim Demaille <akim@epita.fr>
10433
10434 * examples/calc++/test: Use set -x only when VERBOSE.
10435
302c0aee
PE
104362005-10-13 Paul Eggert <eggert@cs.ucla.edu>
10437
10438 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
10439 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
10440
7625ec2c
AD
104412005-10-13 Akim Demaille <akim@epita.fr>
10442
10443 * src/scan-skel.l: Output the base name parts of the parser and
10444 header file names.
302c0aee 10445 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
10446 additional checks.
10447 Use this to exercise C++ outputs in subdirs.
10448 Reported by Oleg Smolsky.
10449
ba0fe3c7
PE
104502005-10-12 Paul Eggert <eggert@cs.ucla.edu>
10451
10452 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
10453 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
10454 Problem reported by John P. Hartmann.
10455 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
10456 already defined it.
10457
9b8a5ce0
AD
104582005-10-12 Akim Demaille <akim@epita.fr>
10459
10460 * src/parse-gram.y (version_check): Exit 63 to please missing
10461 (stands for "version mismatch).
10462 * tests/input.at, doc/bison.texinfo: Adjust.
10463
4f6e011e
PE
104642005-10-10 Paul Eggert <eggert@cs.ucla.edu>
10465
10466 Work around portability problems with Visual Age C compiler
10467 (xlc and xlC_r) reported by John P. Hartmann.
10468 * data/location.cc (initial_column, initial_line): Remove.
10469 All uses replaced by 0 and 1.
10470 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
10471 that xlc complains about.
10472 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 10473 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 10474 as __STDC__.
4d7aa45e
PE
10475 * data/yacc.c (YYMODERN_C): New macro, which also looks at
10476 __STDC_VERSION__. Use it everywhere instead of looking at
10477 __STDC__ and __cplusplus.
4f6e011e 10478
a1b3bf8c
AD
104792005-10-10 Akim Demaille <akim@epita.fr>
10480
10481 * examples/calc++/test: Be quiet unless VERBOSE.
10482
412e44aa
PE
104832005-10-05 Paul Eggert <eggert@cs.ucla.edu>
10484
2a4647a3
PE
10485 * data/c.m4 (yydestruct, yysymprint):
10486 Use YYUSE instead of casting to void.
10487 * data/glr.c (YYUSE): New macro.
10488 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10489 Use it instead of rolling our own.
10490 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10491 (YYCHK1):
10492 Use /*CONSTCOND*/ to suppress lint warnings.
10493 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10494 (YY_STACK_PRINT): Use 'false' not '0'.
10495 (YYUSE): New macro.
10496 (yysymprint_, yydestruct_): Use it instead of rolling our own.
10497 * data/yacc.c (YYUSE): New macro.
10498 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
10499 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
10500 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
10501
10502
412e44aa
PE
10503 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
10504 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
10505
88c6637f
PE
105062005-10-04 Paul Eggert <eggert@cs.ucla.edu>
10507
2f4f028d
PE
10508 Undo the parts of the unlocked-I/O change that substituted
10509 putc or puts for printf. This might hurt performance a bit,
10510 but some people prefer the printf style.
10511 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
10512 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
10513 All uses replaced by YYFPRINTF and YYDPRINTF.
10514 * data/yacc.c: Likewise.
10515 * lib/bitset.c (bitset_print): Likewise.
10516 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
10517 putc and puts.
10518 * lib/lbitset.c (debug_lbitset): Likewise.
10519 * src/closure.c (print_firsts, print_fderives): Likewise.
10520 * src/gram.c (grammar_dump): Likewise.
10521 * src/lalr.c (look_ahead_tokens_print): Likewise.
10522 * src/output.c (escaped_output): Likewise.
10523 (user_actions_output): Break apart two printfs.
10524 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
10525 * src/reduce.c (reduce_print): Likewise.
10526 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
10527 * src/system.h: Include unlocked-io.h rathe than stdio.h.
10528
88c6637f
PE
10529 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10530 Use assignments rather than casts-to-void to suppress
10531 unused-variable warnings. This pacifies 'lint'.
10532 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
10533 unused-variable warnings.
10534
fb32e373
JMG
105352005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10536
10537 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10538
edb8f44f
PE
105392005-10-02 Paul Eggert <eggert@cs.ucla.edu>
10540
fb9c0b33
PE
10541 Use unlocked I/O for a minor performance improvement on hosts like
10542 GNU/Linux and Solaris that support unlocked I/O. The basic idea
10543 is to use the gnlib unlocked-io module, and to prefer putc and
10544 puts to printf when either will work (since the latter doesn't
10545 come in an unlocked flavor).
10546 * bootstrap (gnulib_modules): Add unlocked-io.
10547 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
10548 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
10549 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
10550 and similarly for puts and putc and printf.
10551 * data/yacc.c: Likewise.
10552 * lib/bitset.c (bitset_print): Likewise.
10553 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
10554 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
10555 to printf.
10556 * lib/lbitset.c (debug_lbitset): Likewise.
10557 * src/closure.c (print_firsts, print_fderives): Likewise.
10558 * src/gram.c (grammar_dump): Likewise.
10559 * src/lalr.c (look_ahead_tokens_print): Likewise.
10560 * src/output.c (escaped_output): Likewise.
10561 (user_actions_output): Coalesce two printfs.
2f4f028d 10562 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
10563 * src/reduce.c (reduce_print): Likewise.
10564 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 10565 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 10566
edb8f44f
PE
10567 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
10568 this confuses xgettext.
10569
b50d2359
AD
105702005-10-02 Akim Demaille <akim@epita.fr>
10571
10572 * bootstrap (gnulib_modules): Add strverscmp.
10573 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
10574 * m4/.cvsignore: Add strverscmp.m4.
10575 * src/parse-gram.y (%require): New token, new rule.
10576 (version_check): New.
10577 * src/scan-gram.l (%require): Adjust.
10578 * tests/input.at (AT_REQUIRE): New.
10579 Use it.
10580 * doc/bison.texinfo (Require Decl): New.
10581 (Calc++ Parser): Use %require.
10582
21667f64
AD
105832005-10-02 Akim Demaille <akim@epita.fr>
10584
10585 * data/location.cc: New.
10586
2b81e969
AD
105872005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
10588 Akim Demaille <akim@epita.fr>
10589
10590 Make sure -odir/foo.cc creates dir/location.hh etc.
10591 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
10592 (spec_file_prefix, spec_verbose_file, spec_graph_file)
10593 (spec_defines_file): Now const.
10594 (dir_prefix): New.
10595 (short_base_name): Remove.
10596 * src/files.c: Adjust.
10597 (dirname.h): Include.
10598 (base_name): Don't prototype it.
10599 (finput): Remove, duplicates gram_in.
10600 (full_base_name, short_base_name): Replace by...
10601 (all_but_ext, all_but_tab_ext): these.
10602 (compute_base_names): Rename as...
10603 (compute_file_name_parts): this.
10604 Update to compute the new variables, including dir_prefix.
10605 Adjust dependencies.
10606 * src/output.c (prepare): Output them.
10607 * src/reader.c: Adjust to use gram_in, not finput.
10608 * src/scan-skel.l (@dir_prefix@): New.
10609
ad6a9b97
JMG
106102005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10611
10612 * lib/subpipe.c: New function end_of_output_subpipe() added
10613 to allow support for non-posix systems. This is a no-op function
10614 for posix systems.
10615
10616 * lib/subpipe.h: New function end_of_output_subpipe() added
10617 to allow support for non-posix systems. This is a no-op function
10618 for posix systems.
10619
10620 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
10621 handle the lack of pipe/fork functionality on non-posix systems.
10622
10623 * djgpp/Makefile.maint: DJGPP specific file.
10624
10625 * djgpp/README.in: DJGPP specific file.
10626
10627 * djgpp/config.bat: DJGPP specific configuration file.
10628
10629 * djgpp/config.sed: DJGPP specific configuration file.
10630
10631 * djgpp/config.site: DJGPP specific configuration file.
10632
10633 * djgpp/config_h.sed: DJGPP specific configuration file.
10634
10635 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
10636
10637 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
10638
fc695704
AD
106392005-10-02 Akim Demaille <akim@epita.fr>
10640
10641 * data/location.cc: New, extract from...
10642 * data/lalr1.cc: here.
10643 (location.hh): Include it after the user prologue, in case the
10644 filename type is defined by the user.
10645 Forward declation location and position before the pre-prologue.
10646 (yyresult_): Rename as...
10647 (yyresult): this, it's a local variable, not an attribute.
10648 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
10649
106502005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
10651
10652 * examples/extexi: Restore the #line generation.
10653
fb9712a9
AD
106542005-09-30 Akim Demaille <akim@epita.fr>,
10655 Alexandre Duret-Lutz <adl@gnu.org>
10656
10657 Move the token type and YYSTYPE in the parser class.
10658 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
10659 (parser::token): New, from the moved free definition of tokens.
10660 (parser::semantic_value): Now a full definition instead of an
10661 indirection to YYSTYPE.
10662 (b4_post_prologue): No longer included in the header file, but
10663 in the implementation file.
10664 * doc/bison.texi (C+ Language Interface): Update.
10665 * src/parse-gram.y: Support unary %define.
10666 * tests/actions.at: Define global_tokens_and_yystype for backward
10667 compatibility until we update the tests.
10668 * tests/calc.at: Idem.
10669 (first_line, first_column, last_line, last_column): Define for lalr1.cc
10670 to simplify the code.
10671
55f0c7b1
PE
106722005-09-29 Paul Eggert <eggert@cs.ucla.edu>
10673
10674 Port to SunOS 4.1.4, which lacks strtoul and strerror.
10675 Ah, the good old days! Problem reported by Peter Klein.
10676 * bootstrap (gnulib_modules): Add strerror, strtoul.
10677 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
10678 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
10679
fb9712a9 106802005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
10681
10682 * data/c.m4 (b4_error_verbose_if): New.
10683 * data/lalr1.cc: Use it.
10684 (YYERROR_VERBOSE_IF): Remove.
10685 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
10686 parser members, replaced by...
10687 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
10688 local variables.
10689 (yysyntax_error_): Takes the state number as argument.
10690 (yyreduce_print_): Use the argument yyrule, not the former
10691 attribute yyn_.
10692
8a6f72f3
PE
106932005-09-26 Paul Eggert <eggert@cs.ucla.edu>
10694
10695 * bootstrap (gnulib_modules): Add verify.
10696 * lib/.cvsignore: Add verify.h.
10697 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
10698 * src/system.h (verify): Remove.
10699 Include verify.h instead.
10700 * src/tables.c (tables_generate): Use new API for 'verify'.
10701
0d50976f
PE
107022005-09-21 Paul Eggert <eggert@cs.ucla.edu>
10703
ebc3737e
PE
10704 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
10705 local variables whose names begin with 'yy'.
10706 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
10707 Trivial changes from Joel E. Denny.
10708
0d50976f
PE
10709 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
10710 it itself.
10711 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
10712 don't use alloca any more.
10713
10714 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
10715 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 10716 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
10717 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
10718 to match yacc.c, to test more hosts.
10719
a05b79df
PE
107202005-09-20 Paul Eggert <eggert@cs.ucla.edu>
10721
55289366
PE
10722 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
10723 doesn't affect behavior.
10724 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
10725 Solaris, AIX, MSC.
10726 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
10727 This works a bit better with glibc, if user code has already included
10728 stdlib.h.
10729 * doc/bison.texinfo (Bison Parser): Document that users can't
10730 arbitrarily use malloc and free for other purposes. Document
10731 that <alloca.h> and <malloc.h> might be included.
10732 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
10733 user must declare alloca.
10734
a05b79df
PE
10735 * HACKING (release): Forwarn the Translation Project about
10736 stable releses.
10737
3ab2ca22
AD
107382005-09-20 Akim Demaille <akim@epita.fr>
10739
10740 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
10741
a9739e7c
PE
107422005-09-19 Paul Eggert <eggert@cs.ucla.edu>
10743
a702593e
PE
10744 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
10745 (YYSTACK_ALLOC_MAXIMUM): Use it.
10746 (yysyntax_error): New function.
10747 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
10748 multiple syntax errors are reported, and alloca is being used.
10749 Instead, reallocate buffers twice as big each time, so that
10750 we waste at most half the allocated memory. Start with a small
10751 (128-byte) buffer that will suffice in most cases anyway.
10752 Use yysyntax_error to do most of the work.
10753
10754 * doc/bison.texinfo (Error Reporting, Table of Symbols):
10755 yynerrs is the number of errors reported, not the number of
10756 errors encountered.
10757
a9739e7c
PE
10758 * tests/glr-regression.at (Duplicated user destructor for lookahead):
10759 Mark it as expected to fail.
10760 Cast result of malloc; problem reported by twlevo@xs4all.nl.
10761 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
10762 Don't start user-code symbols with "yy", to avoid name space problems.
10763
f479c6c6
AD
107642005-09-19 Akim Demaille <akim@epita.fr>
10765
10766 Remove the traits, failed experiment.
10767 It never proved useful, and anyway because of the current
10768 definition, it was not possible to have several specialization of
10769 this traits, making it useless.
10770 * data/lalr1.cc (yy:traits): Remove.
10771 Inline its definitions in the parser class.
10772
e2586f82
AD
107732005-09-19 Akim Demaille <akim@epita.fr>
10774
10775 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
10776 least Mac OSX with a /usr/local install of gettext.
10777
2e8cf949
AD
107782005-09-19 Akim Demaille <akim@epita.fr>
10779
10780 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
10781 and yytoken for similarity with the other skeletons.
10782
c7fb0b90
AD
107832005-09-19 Akim Demaille <akim@epita.fr>
10784
4e26c69e 10785 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 10786
1bd0deda
PE
107872005-09-16 Paul Eggert <eggert@cs.ucla.edu>
10788
10789 * NEWS: Version 2.1.
10790
10791 * NEWS: Remove notice of yytname change, since it was never in an
10792 official release.
10793 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
10794 diagnostic.
10795 * src/output.c (prepare): Likewise.
10796 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
10797 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
10798 is not defined. This is an awful hack, but it's enough for now.
10799 All callers changed.
10800 * tests/glr-regression-at (make_value): Args are const pointers now,
10801 to avoid GCC warning.
10802 (Duplicated user destructor for lookahead): New test. Currently
10803 skipped. It fails on my host but I'm not sure it'll always fail.
10804
108052005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
10806
10807 * src/symtab.h (struct symbol): Declare the printer and destructor
10808 as const, to avoid accidental calls to free.
10809 (symbol_destructor_set, symbol_printer_set): Adjust.
10810 * src/symtab.c: Adjust.
10811
1bd0deda 108122005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
10813
10814 * data/c.m4 (b4_token_enums): New.
10815 (b4_token_defines): Rename as...
10816 (b4_token_enums_defines): this.
10817 (b4_token_defines): New, output only the #defines.
10818 * data/yacc.c, data/glr.c: Adjust.
10819 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
10820 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
10821 as default values.
10822
dbcdae2d
AD
108232005-09-16 Akim Demaille <akim@epita.fr>
10824
10825 * data/lalr1.cc (yylex_): Remove, inline its code.
10826 (yyreport_syntax_error_): Remove, replaced by...
10827 (yysyntax_error_): this which returns a string and leaves to the
10828 caller the call to the users' error function.
10829 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
10830 Move from members of the parser object...
10831 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
10832 to local variables of the parse function.
10833
70d8f291
AD
108342005-09-16 Akim Demaille <akim@epita.fr>
10835
10836 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
10837 since it's in Bison's name space.
10838
b47dbebe
PE
108392005-09-15 Paul Eggert <eggert@cs.ucla.edu>
10840
ae199bf1
PE
10841 * data/glr.c (yyresolveValue): Add default case to pacify
10842 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
10843
b47dbebe
PE
10844 * NEWS: Document when yyparse started to return 2.
10845 * doc/bison.texinfo (Parser Function): Document when yyparse
10846 returns 2.
10847
10848 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
10849 (b4_filename_type): Renamed back from b4_file_name_type. All uses
10850 changed.
10851 (class position): file_name -> filename (reverting). All uses changed.
10852
108532005-09-14 Paul Eggert <eggert@cs.ucla.edu>
10854
10855 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
10856 do anything if $@ exists. This reverts part of the 2005-07-07
10857 patch.
10858
00292f66
PE
108592005-09-11 Paul Eggert <eggert@cs.ucla.edu>
10860
10861 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
10862 contains obsolete information and isn't worth distributing as a
10863 separate file anyway.
10864 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
10865 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
10866 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
10867 (yyparse): Abort if user code uses longjmp to throw an unexpected
10868 value.
10869
a420f962
PE
108702005-09-09 Paul Eggert <eggert@cs.ucla.edu>
10871
00292f66
PE
10872 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
10873 Suggested by twlevo@xs4all.nl.
10874
127287e9
PE
10875 * data/glr.c (YYCHK1): Do not assume YYE is in range.
10876 This avoids a diagnostic from gcc -Wswitch-enum.
10877 Problem reported by twlevo@xs4all.nl.
10878
a420f962
PE
10879 * doc/bison.texinfo: Don't use "filename", as per GNU coding
10880 standards. Use "file name" or "file" or "name", depending on
10881 the context.
10882 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
10883 not to hack/foo.tab.c.
10884 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
10885 * data/glr.c: b4_filename -> b4_file_name.
10886 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
10887 All uses changed.
10888 (class position): filename -> file_name. All uses changed.
10889 * data/yacc.c: b4_filename -> b4_file_name.
10890 * lib/bitset.h: filename -> file_name in local vars.
10891 * lib/bitset_stats.c: Likewise.
10892 * src/files.c: Likewise.
10893 * src/scan-skel.l ("@output ".*\n): Likewise.
10894 * src/files.c (file_name_split): Renamed from filename_split.
10895 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
10896
108972005-09-08 Paul Eggert <eggert@cs.ucla.edu>
10898
10899 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
10900 to accommodate latest gnulib.
10901
10902 * tests/glr-regression.at (Duplicate representation of merged trees):
10903 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
10904
10905 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
10906 needed.
10907
42a6501d
PE
109082005-08-26 Paul Eggert <eggert@cs.ucla.edu>
10909
10910 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
10911 All uses changed. Invoke user destructor after an error during a
10912 split parse (trivial change from Joel E. Denny).
10913
10914 * tests/glr-regression.at
10915 (User destructor after an error during a split parse): New test case.
10916 Problem reported by Joel E. Denny in:
10917 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
10918
ef9a1faf
PE
109192005-08-25 Paul Eggert <eggert@cs.ucla.edu>
10920
5b4aaf78
PE
10921 * README-cvs: Give URLs for recommended tools.
10922 Mention Gzip version problem, and bootstrapping issues.
10923 Remove troubleshooting section, as it's somewhat obsolete.
10924
b5240ba5
PE
10925 * bootstrap (no_cache): New var, to accommodate different wget
10926 variants. Use it instead of '-C off'. Problem reported by
10927 twlevo@xs4all.nl.
10928
ef9a1faf
PE
10929 * data/glr.c (yydestroyStackItem): New function.
10930 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
10931 debugging information. Problem reported by Joel E. Denny.
10932
e6efa9da
AD
109332005-08-25 Akim Demaille <akim@epita.fr>
10934
10935 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
10936
adc90f13
PE
109372005-08-24 Paul Eggert <eggert@cs.ucla.edu>
10938
10939 * data/glr.c (yyrecoverSyntaxError, yyreturn):
10940 Don't invoke destructor on unresolved entries.
10941 * tests/glr-regression.at
10942 (User destructor for unresolved GLR semantic value): New test case.
10943 Problem reported by Joel E. Denny in:
10944 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
10945
f9315de5
PE
109462005-08-21 Paul Eggert <eggert@cs.ucla.edu>
10947
15d29c1f
PE
10948 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
10949 Add strnlen.c.
10950 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
10951 lib-prefix.m4, po.m4.
10952
dd5f2af2
PE
10953 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
10954 in yydestruct diagnostic, since it might not be an error.
10955 Problem reported by Joel Denny near end of
10956 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 10957 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
10958 * data/yacc.c (yyreturn): Likewise.
10959 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
10960
10961 * src/files.c: Remove obsolete FIXME comment.
10962
10963 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
10964 with the other templates, and to fix bogus run-on messages such
10965 as the one reported at the end of
10966 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
10967 All callers changed to avoid the newline.
10968 (yyprocessOneStack): Output two lines rather than one, to accommodate
10969 the above change. This changes the debug output format slightly.
10970
f9315de5
PE
10971 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
10972 reported by Joel E. Denny in
10973 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
10974 (trivial change).
10975 * tests/glr-regression.at (Duplicate representation of merged trees):
10976 New test, from Joel E. Denny in:
10977 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
10978 * THANKS: Add Joel E. Denny.
10979
10980 * configure.ac (AC_INIT): Bump to 2.0c.
10981
04098407
PE
109822005-07-24 Paul Eggert <eggert@cs.ucla.edu>
10983
10984 * NEWS: Version 2.0b.
10985
ca5d2013
PE
10986 * Makefile.am (SUBDIRS): Put examples before tests, so that
10987 "make check" doesn't finish with "All 1 tests passed".
10988
3d54b576
PE
10989 * tests/regression.at (Token definitions): Don't rely on
10990 AT_PARSER_CHECK for data that contains backslashes. It currently
10991 uses 'echo', and 'echo' isn't portable if its argument contains
10992 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
10993 that the byte '\0xff' is not printable in the C locale; it is,
10994 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
10995 not printable, so use '\0x81' to test.
10996
d53ae497
PE
10997 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
10998 version of GCC, since the macro is used with non-GCC compilers.
10999
fc01665e
PE
11000 Fix core dump reported by Pablo De Napoli in
11001 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
11002 * tests/regression.at (Invalid inputs with {}): New test.
11003 * src/parse-gram.y (token_name): Translate type before using
11004 it as an index.
11005
04098407
PE
11006 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
11007 the user's name space. All uses changed to __attribute__
11008 ((__unused__)).
11009 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
11010 Add __attribute__ ((__noreturn__)).
11011
11012 * etc/clcommit: Remove. We weren't using it, and it failed
11013 "make maintainer-distcheck".
11014 * Makefile.maint: Merge from coreutils.
11015 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
11016 (syntax-check-rules): Change list of rules as described below.
11017 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
11018 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
11019 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
11020 (sc_trailing_space): New rules.
11021 (sc_xalloc_h_in_src): Remove.
11022 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
11023 (sc_space_tab, sc_error_exit_success, sc_changelog):
11024 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
11025 (makefile-check, po-check, author_mark_check):
11026 (makefile_path_separator_check, copyright-check):
11027 Use grep -n, to make it easier to find violations.
11028 Use CVS_LIST and CVS_LIST_EXCEPT.
11029 (header_regexp, h_re): Remove.
11030 (dd_c): New macro.
11031 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
11032 (my-distcheck): Use more-modern GCC flags.
11033 (signatures, %.asc): Remove.
11034 (rel-files, announcement): Remove signatures.
11035 Restore old updating code, even though we don't use it, so
11036 that we're the same as coreutils.
11037 (alpha, beta, major): Depend on news-date-check.
11038 Make the upload commands.
11039
11040 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
11041 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
11042 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
11043 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
11044 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
11045 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
11046 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
11047 * tests/sets.at: Likewise.
11048
11049 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
11050 we comment out the Autoconf version number.
11051 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
11052 it's error-prone and "make maintainer-distcheck" rejects it.
11053
11054 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
11055 Indent calls to "error" to pacify "make maintainer-distcheck",
11056 when the calls are not intended to be translated.
11057 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
11058
11059 * src/Makefile.am (DEFS): Use +=, to pacify
11060 "make maintainer-distcheck".
11061 (bison_SOURCES): Add scan-skel.h.
11062 (sc_tight_scope): New rule, from coreutils.
11063
11064 * src/files.c (src_extension, header_extension):
11065 Now static, not extern.
11066 * src/getargs.c (short_options): Likewise.
11067 * src/muscle_tab.c (muscle_table): Likewise.
11068 * src/parse-gram.y (current_class, current_type, current_prec):
11069 Likewise.
11070 * src/reader.c (grammar_end, previous_rule_end): Likewise.
11071 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
11072 * src/main.c (main): Cast bindtextdomain and textdomain calls to
11073 void, to avoid warning when NLS is disabled.
11074 * src/output.c: Include scan-skel.h.
11075 (scan_skel): Remove decl, since scan-skel.h does this.
11076 (output_skeleton):
11077 Indent calls to "error" to pacify "make maintainer-distcheck".
11078 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
11079 * src/reader.h (gram_end, gram_lineno): New decls to pacify
11080 "make maintainer-distcheck".
11081 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
11082 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
11083 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
11084 (skel_lex_destroy, scan_skel): Move these decls to...
11085 * src/scan-skel.h: New file.
11086 * src/uniqstr.c (uniqstr_assert):
11087 Indent calls to "error" to pacify "make maintainer-distcheck".
11088
11089 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
11090 not @VAR@.
11091
11092 * tests/torture.at: Revamp to avoid misuse of atoi that
11093 "make maintainer-distcheck" complained about.
11094
11095 * examples/extexi (message): Don't print a message more than once,
11096 and omit line-number decoration that makes Emacs compile think
11097 that informative messages are worth worrying about.
11098
110992005-07-22 Paul Eggert <eggert@cs.ucla.edu>
11100
11101 * configure.ac: Update version number.
11102
11103 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
11104 accidentally.
11105 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
11106 autogenerated by the maintainer.
11107 * examples/calc++/.cvsignore: Add *.yy.
11108
11109 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
11110 * lib/bitset_stats.c (bitset_stats_init): Likewise.
11111 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11112
11113 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
11114
11115 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
11116 from maintainer-distcheck about casting the argument of 'free'.
11117
11118 * NEWS: Mention recent yytname changes.
11119 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
11120
11121 * bootstrap: For translations that have not yet been upgraded to
11122 the new runtime-po domain, prime the pump by extracting the
11123 relevant strings from the obsolete translations. This code can be
11124 removed once the bison-runtime domain has been translated by each
11125 team.
11126
11127 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
11128 now that token names are already quoted.
11129
11130 Fix problem reported by Anthony Heading.
11131 * data/glr.c (YYTOKEN_TABLE): New macro.
11132 (yytname): Define if YYTOKEN_TABLE.
11133 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
11134 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
11135 (YYERROR_VERBOSE): Define the same way the other skeletons do.
11136 * src/output.c (prepare_symbols): Output token_table_flag.
11137
0ffda363
PE
111382005-07-21 Paul Eggert <eggert@cs.ucla.edu>
11139
11140 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
11141 again if the first call fails.
11142
11143 * data/glr.c (yytnamerr): New function.
11144 (yyreportSyntaxError): Use it to dequote most string literals.
11145 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
11146 with other skeletons. All uses changed.
11147 (yytnameerr_): New function.
11148 (yyreport_syntax_error): Use it to dequote most string literals.
11149 * data/yacc.c (yytnamerr): New function.
11150 (yyerrlab): Use it to decode most string literals.
11151 * doc/bison.texinfo (Decl Summary, Calling Convention):
11152 Clarify quoting convention of yytname.
11153 * src/output.c (prepare_symbols): Quote all names. This undoes
11154 the 2005-04-17 change, which is now accomplished (mostly) via
11155 changes in the parsers as described above.
11156 * tests/regression.at (Token definitions, Web2c Actions):
11157 Undo most 2005-04-17 change here, too.
11158
111592005-07-20 Paul Eggert <eggert@cs.ucla.edu>
11160
11161 Fix more problems reported by twlevo@xs4all.nl.
11162 * tests/cxx-type.at: Don't pipe output of ./types through sed to
11163 remove trailing spaces. This loses the exit status of ./types,
11164 and isn't needed since ./types shouldn't be emitting trailing
11165 spaces.
11166 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
11167 as the stack isn't valid in that case.
11168
11169 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
11170 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
11171 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
11172 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
11173 is used.
11174 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
11175 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
11176 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
11177 Likewise.
11178
11179 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
11180 overly-picky compilers that reject 'char *foo = "bar";'.
11181
11182 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
11183 to FILE * parameter, not to stderr. This fixes a typo introduced
11184 in the 2005-07-12 change.
11185
11186 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
11187 warnings from GCC 4.
11188
11189 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
11190 (yyglrShiftDefer, yysplitStack):
11191 Remove unused parameters b4_pure_formals. All uses changed.
11192 (yyglrShift): Remove unused parameters b4_user_formals.
11193 All uses changed.
11194 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
11195
6100a9aa
PE
111962005-07-18 Paul Eggert <eggert@cs.ucla.edu>
11197
258b75ca
PE
11198 Destructor cleanups and regularization among the three skeletons.
11199 * NEWS: Document the behavior changes.
11200 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
11201 stack before failing, as the cleanup code will do it for us now.
11202 * data/lalr1.cc (yyerrlab): Likewise.
11203 * data/glr.c (yyparse): Pop everything off the stack before
11204 freeing it, so that destructors get called properly.
11205 * data/lalr1.cc (yyreturn): Likewise.
11206 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
11207 This is more consistent.
11208 * doc/bison.texinfo (Destructor Decl): Mention more reasons
11209 why destructors might be called. 1.875 -> 2.1.
11210 (Destructor Decl, Decl Summary, Table of Symbols):
11211 Some English-language cleanups for %destructor.
11212 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11213 Add output line for destructor of start symbol.
11214 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
11215 because of that same extra output line.
11216
1a059451
PE
11217 * NEWS: Document minor wording changes in diagnostics of
11218 Bison-generated parsers.
11219 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
11220 Remove unused formals. All uses changed.
11221 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
11222 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
11223 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
11224 Rename yyoverflowab to yyexhaustedlab.
11225 When memory exhaustion occurs during syntax-error reporting,
11226 report it separately rather than in a single diagnostic; this
11227 eases translation.
11228 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
11229 (Memory Exhausted): Renamed from Parser Stack Overflow.
11230 Revamp wording slightly to prefer "memory exhaustion".
11231 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
11232
97460c78
PE
11233 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
11234
30757c8c
PE
11235 Add i18n support to the GLR skeleton. Partially fix the C++
11236 skeleton; a C++ expert needs to finish this. Remove debugging
11237 msgids; there's little point to having them translated, since they
11238 can be understood only by someone who can read the
11239 (English-language) source code.
11240
11241 Generate runtime-po/bison-runtime.pot automatically, so that we
11242 don't have to worry about garbage getting in that file. We'll
11243 make sure after the next official release that old msgids don't
11244 get lost. See
11245 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
11246
11247 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
11248 Now auto-generated.
11249 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
11250 Fix typos in explanations of the runtime file.
11251 * bootstrap: Change gettext keyword from YYI18N to YY_.
11252 Use standard Makefile.in.in in runtime-po, since we'll arrange
11253 for backward-compatible bison-runtime.po files in a different way.
11254 * data/glr.c (YY_): New macro, from yacc.c.
11255 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
11256 Translate messages intended for users.
11257 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
11258 the wording in the other skeletons. We don't know that the memory
11259 is virtual.
11260 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
11261 Use same method that yacc.c uses.
11262 Don't translate debugging messages.
11263 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
11264 it doesn't work (yet), and requires C++ expertise to fix.
11265 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
11266 Move defn to a more logical place, to be consistent with other
11267 skeletons.
11268 Don't translate debugging messages.
11269 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
11270 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
11271 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
11272 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
11273
ac8c5689
PE
11274 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
11275 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
11276 void, not int.
11277 * tests/glr-regression.at (Badly Collapsed GLR States):
11278 Likewise.
11279 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
11280 yylex should return 0 at EOF rather than aborting.
11281
6100a9aa
PE
11282 Improve tests for stack overflow in GLR parser.
11283 Problem reported by twlevo@xs4all.nl.
11284 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
11285 All uses removed.
11286 (yyStackOverflow): Just longjmp, but with value 2 so that caller
11287 can handle the problem.
11288 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
11289 (yyparse): New local variable yyresult to record the result.
11290 Use result of setjmp to set it, rather than storing itinto
11291 struct.
11292 (yyDone): Remove label.
11293 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
11294 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
11295 if YYABORT is used).
11296 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
11297 yyparse status; put status > 1 into diagnostic.
11298 Check that status==2 works.
11299 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
11300 Use exit status 3 for failure to open (which shouldn't happen).
11301
15f40952
PE
113022005-07-17 Paul Eggert <eggert@cs.ucla.edu>
11303
67fd79c4
PE
11304 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
11305 1 on syntax error; just let yyparse do its thing.
11306 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
11307 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
11308 (Exploding the Stack Size with Alloca):
11309 (Exploding the Stack Size with Malloc):
11310 Expect exit status 2, not 1, since the parser is supposed to blow
11311 its stack. Problem reported by twlevo@xs4all.nl.
11312
15f40952
PE
11313 * data/glr.c (yyparse): Don't assume that the initial calls
11314 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
11315 Print a stack-overflow message and fail instead.
11316 Initialize the line-number information before creating the stack,
11317 so that the stack-overflow message can report line zero safely.
11318
f32c66b5
PE
113192005-07-14 Paul Eggert <eggert@cs.ucla.edu>
11320
a22ff96f 11321 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
11322 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
11323 (yyuserMerge): Provide a default case if b4_mergers is empty.
11324 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
11325 * tests/glr-regression.at
11326 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 11327 Add casts to pacify C++ compilers.
1beb0b24
PE
11328 * tests/glr-regression.at (Improper merging of GLR delayed action
11329 sets): Declare yylex before using it.
f32c66b5 11330 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
11331 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
11332 test for valgrind; valgrind is independent of g++.
11333 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
11334 for compatibility with POSIX 1003.1-2001 (if running coreutils).
11335 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
11336 Use a destructor, so that we can expand the stack. Change
11337 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 11338
d741bd1b
PE
113392005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11340
11341 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
11342 a valgrind failure. Problem reported by twlevo@xs4all.nl.
11343
0410a6e0
PE
113442005-07-13 Paul Eggert <eggert@cs.ucla.edu>
11345
11346 * PACKAGING: New file, suggested by Bruno Haible and taken from
11347 similar wording in gettext's PACKAGING file.
11348 * NEWS: Mention PACKAGING.
11349 * Makefile.am (EXTRA_DIST): Add PACKAGING.
11350
f7ab6a50
PE
113512005-07-12 Paul Eggert <eggert@cs.ucla.edu>
11352
baf785db 11353 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
11354 * bootstrap: Get runtime translations into runtime-po.
11355 Create runtime-po files automatically, if possible.
11356 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
11357 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
11358 does not infringe on the user's name space.
11359 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
11360 * doc/bison.texinfo (Internationalization): Revamp the English
11361 and Texinfo syntax a bit, to try to make it clearer.
11362 (Bison Options, Option Cross Key): Mention --print-localedir.
11363 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
11364 YYENABLE_NLS. Quote a bit more.
11365 * runtime-po/.cvsignore: New file.
11366 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
11367 * runtime-po/Rules-quot: Remove; now created by bootstrap.
11368 * runtime-po/quot.sed: Likewise.
11369 * runtime-po/boldquot.sed: Likewise.
11370 * runtime-po/en@quot.header: Likewise.
11371 * runtime-po/en@boldquot.header: Likewise.
11372 * runtime-po/insert-header.sin: Likewise.
11373 * runtime-po/remove-potcdate.sin: Likewise.
11374 * runtime-po/Makevars: Likewise.
11375 * runtime-po/LINGUAS: Likewise.
11376 * runtime-po/de.po: Likewise; we will rely on the translation project
11377 to maintain this, so "bootstrap" should get it.
0410a6e0 11378 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
11379 its value.
11380 * src/main.c (main): Bind the bison-runtime domain, too.
11381
113822005-07-12 Bruno Haible <bruno@clisp.org>
11383
11384 * data/yacc.c: Include <libintl.h> when NLS is enabled.
11385 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
11386 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
11387 * runtime-po: New directory.
11388 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
11389 $(DOMAIN).pot-update rule, so that old messages are never dropped.
11390 * runtime-po/Rules-quot: New file, copied from po/.
11391 * runtime-po/quot.sed: Likewise.
11392 * runtime-po/boldquot.sed: Likewise.
11393 * runtime-po/en@quot.header: Likewise.
11394 * runtime-po/en@boldquot.header: Likewise.
11395 * runtime-po/insert-header.sin: Likewise.
11396 * runtime-po/remove-potcdate.sin: Likewise.
11397 * runtime-po/Makevars: New file.
11398 * runtime-po/POTFILES.in: New file.
11399 * runtime-po/LINGUAS: New file.
11400 * runtime-po/bison-runtime.pot: New file.
11401 * runtime-po/de.po: New file.
11402 * m4/bison.m4: New file.
11403 * Makefile.am (SUBDIRS): Add runtime-po.
11404 (aclocaldir, aclocal_DATA): New variables.
11405 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
11406 Define aclocaldir.
11407 * src/getargs.c (usage): Document --print-localedir option.
11408 (PRINT_LOCALEDIR_OPTION): New enum item.
11409 (long_options): Add --print-localedir option.
11410 (getargs): Handle --print-localedir option.
11411 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
11412 (Internationalization): New section.
11413
22dda0f0
AD
114142005-07-12 Akim Demaille <akim@epita.fr>
11415
11416 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
11417 for consistency with the rest of the code.
11418 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
11419 Add separators.
11420
82b248ad
AD
114212005-07-12 Akim Demaille <akim@epita.fr>
11422
11423 * src/parse-gram.y: Use %printer instead of YYPRINT.
11424
fa0e9314
AD
114252005-07-12 Akim Demaille <akim@epita.fr>
11426
867a3e00
AD
11427 * src/symtab.h, src/symtab.c (symbol_print): New.
11428 * src/symlist.h, src/symlist.c (symbol_list_print): New.
11429 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
11430
114312005-07-12 Akim Demaille <akim@epita.fr>
11432
11433 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
11434 b4_at_dollar and b4_dollar_dollar.
11435
e054b190
PE
114362005-07-11 Paul Eggert <eggert@cs.ucla.edu>
11437
11438 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
11439 and Pennello's paper.
11440
34160ec4
PE
114412005-07-09 Paul Eggert <eggert@cs.ucla.edu>
11442
407d4a75
PE
11443 * data/yacc.c (yyparse): Undo previous patch. Instead,
11444 set yylsp[0] and yyvsp[0] only if the initial action
11445 sets yylloc and yylval, respectively.
11446
34160ec4
PE
11447 * data/yacc.c (yyparse): In the initial action, set
11448 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
11449 This avoids the use of undefined variables if the initial
11450 action does not set yylloc and/or yylval.
11451
c3d5a4a7
PE
114522005-07-07 Paul Eggert <eggert@cs.ucla.edu>
11453
b34d96c1
PE
11454 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
11455 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
11456 Remove from CVS. These files are automatically generated.
11457 * examples/extexi: Clarify that this file is now part of Bison,
11458 not GNU M4, and that it works with any POSIX-compatible Awk.
11459 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
11460 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
11461 so that we also get calc++-parser.yy. Geneate it.
11462 Use $(AWK), not gawk, since any conforming Awk will do.
11463 Put comment before action, since older 'make' can't handle comment
11464 in action.
11465 $(BUILT_SOURCES): List all built sources, not just some of them.
11466 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
11467 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
11468 $($(calc_sources_generated)): Remove unnecessary test for existence
11469 of target. (This had a shell syntax error anyway; a stray "x".)
11470 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
11471 calc++-parser.yy.
11472 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
11473
c3d5a4a7
PE
11474 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
11475 implied by the other modules.
11476
828c373b
AD
114772005-07-06 Akim Demaille <akim@epita.fr>
11478
11479 Bind examples/calc++ to the package.
11480 * examples/calc++/Makefile: Remove, replaced by...
11481 * examples/calc++/Makefile.am: ... this new file.
11482 * examples/calc++/test: Remove input.
11483 * examples/calc++/compile: Remove.
11484 * examples/Makefile.am: New.
11485 * configure.ac, Makefile.am: Adjust.
11486 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
11487
63cb01d6
PE
114882005-07-05 Paul Eggert <eggert@cs.ucla.edu>
11489
fd2df2ed
PE
11490 * data/glr.c (yyFail): Drastically simplify; since the format argument
11491 never had any % directives, we can simply pass it to yyerror.
11492 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
11493 be modified later, as that is the usual style in glr.c.
11494 Problems reported by Paul Hilfinger.
11495
63cb01d6
PE
11496 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
11497 and size overflow errors.
11498 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
11499 in case the user prolog sets feature-test macros like _GNU_SOURCE.
11500 (YYSIZEMAX): New macro.
11501 (yystpcpy): New function, taken from yacc.c.
11502 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
11503 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
11504 so that we don't have to maintain their signatures.
11505 (yyFail): Check for buffer overflow, by using vsnprintf rather
11506 than vsprintf. Allocate a bigger buffer if possible.
11507 Report an error if buffer allocation fails.
11508 (yyStackOverflow): New function.
11509 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
11510 the initialization was successful. It might fail if storage was
11511 exhausted.
11512 (yyexpandGLRStack): Add more checks for storage allocation failure.
11513 Use yyStackOverflow to report failures.
11514 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
11515 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
11516 Don't assume stack number fits in int.
11517 (yysplitStack): Check for storage allocation failure.
11518 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
11519 can print diagnostics on storage allocation failure. All callers
11520 changed.
11521 (yyresolveValue): Use yybool for boolean.
11522 (yyreportSyntaxError): Check for size-calculation overflow.
11523 This code is taken from yacc.c.
11524 (yyparse): Check for storage allocation errors when allocating
11525 the initial stack.
11526
1c59e0a1
AD
115272005-07-05 Akim Demaille <akim@epita.fr>
11528
11529 Extract calc++ from the documentation.
11530 * doc/bison.texinfo (Calc++): Add the extraction marks.
11531 * examples/extexi: New, from the aborted GNU Programming 2E.
11532 Separate the different paragraph of a file with empty lines.
11533 * examples/Makefile: Use it to extract the whole calc++ example.
11534
8a0adb01
AD
115352005-06-24 Akim Demaille <akim@epita.fr>
11536
11537 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
11538 class typedefs.
11539
12545799
AD
115402005-06-22 Akim Demaille <akim@epita.fr>
11541
11542 * doc/bison.texinfo (C++ Language Interface): First stab.
11543 (C++ Parsers): Remove.
11544
99be0235
AD
115452005-06-22 Akim Demaille <akim@epita.fr>
11546
11547 * data/lalr1.cc (yylex_): Honor %lex-param.
11548
0ffd4fd1
AD
115492005-06-22 Akim Demaille <akim@epita.fr>
11550
11551 Start a set of simple examples.
11552 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
11553 * examples/calc++/calc++-driver.hh,
11554 * examples/calc++/calc++-parser.yy,
11555 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
11556 * examples/calc++/compile, examples/calc++/test: New.
11557
0925ebb4
PE
115582005-06-09 Paul Eggert <eggert@cs.ucla.edu>
11559
11560 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
11561 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
11562 which stems from the 2005-05-27 patch.
11563
43d3b664
PH
115642005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11565
11566 * data/glr.c: Modify treatment of unused parameters to permit use
11567 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
11568
3062864d
PE
115692005-05-30 Paul Eggert <eggert@cs.ucla.edu>
11570
11571 Fix infringement on user name space reported by Janos Zoltan Szabo.
11572 * data/yacc.c (yyparse): strlen -> yystrlen.
11573
989b5b8e
AD
115742005-05-30 Akim Demaille <akim@epita.fr>
11575
11576 * data/lalr1.cc (_): New.
11577 Translate the various messages.
11578
bedf57f5
PE
115792005-05-27 Paul Eggert <eggert@cs.ucla.edu>
11580
11581 Fix infringement on user name space reported by Bruno Haible.
11582 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
11583 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
11584 the user's name space.
11585 (alloca): Include <stdlib.h> to get it, if it's not built in.
11586 (YYMALLOC, YYFREE): Define only if needed.
11587 (malloc, free): Declare, but only if needed, as this infringes on
11588 the user name space.
11589
4d1801f1
PE
115902005-05-25 Paul Eggert <eggert@cs.ucla.edu>
11591
11592 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
11593 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
11594 with %d format.
11595 * lib/ebitset.c (min, max): Undef before defining.
11596 * lib/vbitset.c (min, max): Likewise.
11597 * lib/subpipe.c (create_subpipe): Save local variables in case
11598 vfork clobbers them.
11599
116002005-05-24 Bruno Haible <bruno@clisp.org>
11601
11602 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
11603 error message syntax used by gcc-4.0.
11604
b94a9e1e
PE
116052005-05-23 Paul Eggert <eggert@cs.ucla.edu>
11606
85ac3861
PE
11607 * README: Mention m4 1.4.3. Remove obsolete advice about
11608 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
11609
b94a9e1e
PE
11610 * bootstrap: Remove workaround for problem I encountered with
11611 gettext 0.14.1; it seems to be fixed now.
11612
51c30d21
PE
116132005-05-22 Paul Eggert <eggert@cs.ucla.edu>
11614
009ce67d
PE
11615 * NEWS: Version 2.0a.
11616
f2a97c62
PE
11617 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
11618 the previous change.
11619
c8775f93
PE
11620 Various maintainer cleanups.
11621 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
11622 conftest*, for benefit of CVS commands run at the same time as
11623 "configure". Add build-aux, since "bootstrap" now creates it and
11624 its subfiles.
11625 * Makefile.cfg (move_if_change): Remove.
11626 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
11627 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
11628 (po_repo, do-po-update, po-update, wget_files, get-targets):
11629 (config.guess-url_prefix, config.sub-url_prefix):
11630 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
11631 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
11632 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
11633 Remove.
11634 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
11635 this is now the recommended name.
11636 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
11637 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
11638 ylwrap. These files now go into build-aux.
11639 * config/move-if-change: Remove.
11640 * config/prev-version.txt: Bump from 1.75 to 2.0.
11641
3ea5f0ec
PE
11642 * bootstrap: Add stdio-safer, unistd-safer modules.
11643 Remove m4/glibc2.m4 (introduced by latest gnulib, but
11644 we don't need it).
11645 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
11646 fopen-safer.c, stdio-safer.h, unistd-safer.h.
11647 * lib/subpipe.c: Include "unistd-safer.h".
11648 (create_subpipe): Make sure all the newly-created
11649 file descriptors are > 2, so that diagnostics don't
11650 get sent down them (which might cause Bison to hang, in theory).
11651 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
11652 * src/files.c (xfopen): Use fopen_safer, not fopen.
11653
51c30d21
PE
11654 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
11655 yesterday's yacc.c fix.
11656
cea1469d
PE
116572005-05-21 Paul Eggert <eggert@cs.ucla.edu>
11658
3ea5f0ec
PE
11659 * data/glr.c, data/lalr1.cc: Update copyright date.
11660
cea1469d
PE
11661 Fix a destructor bug reported by Wolfgang Spraul in
11662 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
11663 * data/yacc.c (yyabortlab): Don't call destructor, and
11664 don't set yychar to EMPTY.
11665 (yyoverflowlab): Don't call destructor.
11666 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
11667 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
11668 since we no longer output the message "discarding lookahead token
11669 end of input ()".
11670
5e6f62f2
PH
116712005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11672
11673 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
11674 fix a small glitch in debugging output.
11675 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
11676 after YY_SYMBOL_PRINT where needed.
11677
11678 (struct yyGLRState): Add some comments.
11679 (struct yySemanticOption): Add some comments.
11680 (union yyGLRStackItem): Add comment.
11681
11682 (yymergeOptionSets): Correct this to properly perform the union,
11683 avoiding infinite reported by Michael Rosien.
11684 Update comment.
11685
11686 * tests/glr-regression.at: Add test for GLR merging error reported
11687 by M. Rosien.
cea1469d 11688
0fb669f9
PE
116892005-05-13 Paul Eggert <eggert@cs.ucla.edu>
11690
11691 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
11692 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
11693 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
11694 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
11695 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
11696 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
11697 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
11698 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
11699 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
11700 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
11701 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
11702 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
11703 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
11704 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
11705 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
11706 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
11707 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
11708 src/derives.h, src/files.c, src/files.h, src/getargs.c,
11709 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
11710 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
11711 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
11712 src/output.h, src/parse-gram.c, src/parse-gram.h,
11713 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
11714 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
11715 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
11716 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
11717 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
11718 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
11719 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
11720 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
11721 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
11722 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
11723 tests/reduce.at, tests/regression.at, tests/sets.at,
11724 tests/synclines.at, tests/testsuite.at, tests/torture.at:
11725 Update FSF postal mail address.
11726
51f4735e
PE
117272005-05-11 Paul Eggert <eggert@cs.ucla.edu>
11728
11729 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
11730 Problem reported by Ralf Menzel.
11731
80ce3401
PE
117322005-05-01 Paul Eggert <eggert@cs.ucla.edu>
11733
11734 * tests/actions.at: Test that stack overflow invokes destructors.
11735 From Marcus Holland-Moritz.
11736 * data/yacc.c (yyerrlab): Move the code that destroys the stack
11737 from here....
11738 (yyreturn): to here. That way, destructors are called properly
11739 even if the stack overflows, or the user calls YYACCEPT or
11740 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
11741 (yyoverflowlab): Destroy the lookahead.
11742
117432005-04-24 Paul Eggert <eggert@cs.ucla.edu>
11744
11745 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
11746
72f000b0
PE
117472005-04-17 Paul Eggert <eggert@cs.ucla.edu>
11748
11749 * NEWS: Bison-generated C parsers no longer quote literal strings
11750 associated with tokens.
11751 * src/output.c (prepare_symbols): Don't escape strings,
11752 since users don't want to see C escapes.
11753 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
11754 in diagnostics.
c19683bb 11755 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
11756 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
11757
1094323f
PE
117582005-04-16 Paul Eggert <eggert@cs.ucla.edu>
11759
11760 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
11761 the data size is known to be too small and we can't increase it.
11762 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
11763
ca407bdf
PE
117642005-04-15 Paul Eggert <eggert@cs.ucla.edu>
11765
11766 * src/parse-gram.y: Include quotearg.h.
11767 (string_as_id): Quote $1 before using it as a key, since the
11768 lexer no longer quotes it for us.
11769 (string_content): Don't strip quotes, since lexer no longer
11770 quotes it for us.
11771 * src/scan-gram.l: Include quotearg.h.
11772 ("\""): Omit quote.
11773 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
11774 a key, since the rest of the lexer doesn't quote it.
11775 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
11776 * tests/regression.at (Token definitions): Check for backslashes
11777 in token strings.
11778
11779 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
11780 (YYSIZE_T): Define to unsigned long int when using an older compiler.
11781 (yyparse): Revamp code to generate long syntax error message, to
11782 make it easier to translate, and to avoid problems with arithmetic
11783 overflow. Change "virtual memory" to "memory" in diagnostic, since
11784 we don't know whether the memory is virtual.
11785
1ce59070
PE
117862005-04-13 Paul Eggert <eggert@cs.ucla.edu>
11787
11788 * NEWS: Bison-generated C parsers now use the _ macro to
11789 translate strings.
11790 * data/yacc.c (_) [!defined _]: New macro.
11791 All English strings wrapped inside this macro.
11792 * doc/bison.texinfo (Bison Parser): Document _.
11793 * po/POTFILES.in: Include src/parse-gram.c, since it now
11794 includes translateable strings that parse-gram.y doesn't.
11795
a749a695
PE
117962005-04-12 Paul Eggert <eggert@cs.ucla.edu>
11797
11798 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
11799 reverting the 2004-10-11 change to this function.
11800 (symbol_check_alias_consistency): Don't call symbol_type_set
11801 if the type name is already correct.
11802 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
11803
8fb1053b
PE
118042005-03-25 Paul Eggert <eggert@cs.ucla.edu>
11805
11806 * tests/regression.at (Token definitions): Don't use a token named
11807 c, as that generates a "#define c ..." that runs afoul of buggy
11808 stdlib.h that uses the identifier c as a member of struct
11809 drand48_data. Problem reported by Horst Wente.
11810
ff498c4a
PE
118112005-03-21 Paul Eggert <eggert@cs.ucla.edu>
11812
11813 * bootstrap: Change translation URL from
11814 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
11815 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
11816 redirection glitches. Problem reported by twlevo@xs4all.nl.
11817
65211d70
PE
118182005-03-20 Paul Eggert <eggert@cs.ucla.edu>
11819
11820 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
11821 after operands; POSIX says this isn't portable for the c99 command.
11822
9577fb1f
PE
118232005-03-18 Paul Eggert <eggert@cs.ucla.edu>
11824
11825 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
11826 immediately if a data overrun has occurred; this may help us track
11827 down what may be a spurious failure on MacOS.
11828
78b178f7
PE
118292005-03-17 Paul Eggert <eggert@cs.ucla.edu>
11830
a2599d0f
PE
11831 Respond to problems reported by twlevo@xs4all.nl.
11832
11833 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
11834
78b178f7
PE
11835 * src/vcg.h: Comment fix.
11836 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
11837 (G_CMAX): Change to -1 instead of INT_MAX.
11838
11839 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 11840
7296e729
PE
118412005-03-15 Paul Eggert <eggert@cs.ucla.edu>
11842
11843 * src/tables.c (state_number_to_vector_number): Put it inside an
11844 "#if 0", since it's not currently used. Problem reported by
11845 Roland McGrath.
11846
05ac60f3
PE
118472005-03-06 Paul Eggert <eggert@cs.ucla.edu>
11848
11849 * src/output.c (escaped_output): Renamed from
11850 escaped_file_name_output, since we now use it for symbol tags as
11851 well. All uses changed.
11852 (symbol_destructors_output, symbol_printers_output):
11853 Escape symbol tags too.
11854 Problem reported by Matyas Forstner in
11855 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
11856
11857 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
11858 not needed.
11859 * src/output.c (user_actions_output, token_definitions_output,
11860 symbol_destructors_output, symbol_printers_output): Likewise.
11861 * src/reader.c (prologue_augment): Likewise.
11862 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
11863
11864 * src/vcg.c (output_edge): Don't quote linestyle arg.
11865 Problem reported by twlevo@xs4all.nl.
11866
7eb453ac
PE
118672005-02-28 Paul Eggert <eggert@cs.ucla.edu>
11868
11869 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
11870 example, reported by Derek M Jones. Also, make the example even
11871 more outrageous, to better illustrate how bad the problem is.
11872
4c04c52a
PE
118732005-02-24 Paul Eggert <eggert@cs.ucla.edu>
11874
11875 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
11876 putsym. Typo reported by Sebastian Piping.
11877
a61e1620
PE
118782005-02-23 Paul Eggert <eggert@cs.ucla.edu>
11879
11880 * doc/bison.texinfo (Language and Grammar): some -> same
11881 (Epilogue): int he -> in the
11882 Typos reported by Sebastian Piping via Justin Pence.
11883
9ec93868
PE
118842005-02-07 Paul Eggert <eggert@cs.ucla.edu>
11885
11886 * tests/glr-regression.at (Improper handling of embedded actions
11887 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
11888 embedded actions and $-N in GLR parsers", work around an Autoconf bug
11889 with dollar signs in test names.
11890 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
11891 for a similar reason.
11892
73ce7e7e
PE
118932005-01-28 Paul Eggert <eggert@cs.ucla.edu>
11894
11895 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
11896 wants to redefine G_VIEW.
11897
2e72b98e
PE
118982005-01-27 Paul Eggert <eggert@cs.ucla.edu>
11899
11900 * src/vcg.c (get_view_str): Remove case for normal_view.
11901 Problem reported by twlevo@xs4all.nl.
11902
e0d634e5
PE
119032005-01-24 Paul Eggert <eggert@cs.ucla.edu>
11904
ccf830a4
PE
11905 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
11906 Problem reported by twlevo@xs4all.nl.
11907
e0d634e5
PE
11908 * doc/bison.texinfo: Change @dircategory from "GNU programming
11909 tools" to "Software development". Requested by Richard Stallman
11910 via Karl Berry.
11911
7bbc8cb0
PE
119122005-01-23 Paul Eggert <eggert@cs.ucla.edu>
11913
11914 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
11915 Problem reported by twlevo@xs4all.nl.
11916
08b770bc
PE
119172005-01-21 Paul Eggert <eggert@cs.ucla.edu>
11918
11919 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
11920 keyword; it's not needed with modern compilers, and it doesn't
11921 affect correctness with older compilers. Suggested by
11922 twlevo@xs4all.nl.
11923
95f22ad2
PE
119242005-01-17 Paul Eggert <eggert@cs.ucla.edu>
11925
11926 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
11927 gcc -Wswitch-default.
11928 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11929 * data/yacc.c (yyparse): Likewise.
11930
d229d15c
PE
119312005-01-12 Paul Eggert <eggert@cs.ucla.edu>
11932
11933 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
11934 already. Let config.h define any nonstandard values.
11935
ecadd90f
PE
119362005-01-10 Paul Eggert <eggert@cs.ucla.edu>
11937
11938 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
11939 for the benefit of slower hosts. Problem reported by
11940 Nelson H. F. Beebe.
11941
213744b5
PE
119422005-01-07 Paul Eggert <eggert@cs.ucla.edu>
11943
11944 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
11945 being defined and not used.
11946 * data/lalr1.cc (yyparse): Likewise.
11947 Use "if (false)" rather than "if (0)".
11948
249d3236
PE
119492005-01-05 Paul Eggert <eggert@cs.ucla.edu>
11950
11951 * TODO: Mention that we should allow NUL bytes in tokens.
11952
987cc1fb
PE
119532005-01-02 Paul Eggert <eggert@cs.ucla.edu>
11954
11955 * src/scan-skel.l (<<EOF>>): Don't close standard output.
11956 Problem reported by Hans Aberg.
11957
08fe02d9
PE
119582005-01-01 Paul Eggert <eggert@cs.ucla.edu>
11959
11960 * src/getargs.c (version): Happy new year; update overall
11961 program copyright date from 2004 to 2005.
11962
11963 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
11964 Problem reported by Hans Aberg.
11965 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
11966 (Output file names.): Add a test for the case when standard output
11967 is closed.
11968
010c0266
PE
119692004-12-26 Paul Eggert <eggert@cs.ucla.edu>
11970
11971 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
11972 to fix an oversight in the Bison 2.0 manual.
11973
da12206a
PE
119742004-12-25 Paul Eggert <eggert@cs.ucla.edu>
11975
11976 * NEWS: Version 2.0. Reformat the existing news items since
11977 1.875, so that related items are grouped together.
3a4734aa 11978 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
11979 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
11980
c935d934
PE
11981 * tests/torture.at (Exploding the Stack Size with Alloca): Set
11982 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
11983 otherwise, we're not testing alloca. Unfortunately there's no
11984 simple way to consult HAVE_ALLOCA here.
11985
da12206a
PE
11986 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
11987 for yymsg, too.
11988
11989 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
11990 hand. This avoids a warning about comparing int to size_t when
11991 GCC warnings are enabled.
11992
0a2c5137
PE
119932004-12-22 Paul Eggert <eggert@cs.ucla.edu>
11994
d7e14fc0
PE
11995 * NEWS: Bison-generated parsers no longer default to using the
11996 alloca function (when available) to extend the parser stack, due
11997 to widespread problems in unchecked stack-overflow detection.
11998 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
11999 responsibility to set it to a positive value. This lets the user
12000 specify a value that is not a preprocessor constant.
12001 * data/yacc.c (YYMAXDEPTH): Likewise.
12002 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
12003 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
12004 to be a compile-time constant. However, explain the constraints on it.
12005 Also, explain the constraints on YYINITDEPTH.
12006 (Table of Symbols): Explain that alloca is no longer the default.
12007 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
12008 to 1.
12009
0a2c5137
PE
12010 * doc/bison.texinfo (Location Default Action): Mention that n must
12011 be zero when k is zero. Suggested by Frank Heckenbach.
12012
e019c247
AD
120132004-12-22 Akim Demaille <akim@epita.fr>
12014
12015 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
12016 (parser::state_type, parser::semantic_type, parser::location_type):
12017 Private, not public.
12018 (parser::parse): Return ints, not bool.
12019 Returning a bool introduces a problem: 0 corresponds to false, and
12020 it seems weird to return false on success. Returning true changes
12021 the conventions for yyparse.
12022 Alternatively we could return void and send an exception.
12023 There is no clear consensus (yet?).
12024 (state_stack, semantic_stack, location_stack): Rename as...
12025 (state_stack_type, semantic_stack_type, location_stack_type): these.
12026 Private, not public.
12027 * tests/c++.at: New.
12028 * tests/testsuite.at, tests/Makefile.am: Adjust.
12029
72731bb7
AD
120302004-12-21 Akim Demaille <akim@epita.fr>
12031
12032 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
12033
9a0d8bec
AD
120342004-12-21 Akim Demaille <akim@epita.fr>
12035
12036 Don't impose std::string for filenames.
12037
12038 * data/lalr1.cc (b4_filename_type): New.
12039 (position::filename): Use it.
12040 (parser.hh): Move the inclusion of stack.hh and location.hh below
12041 the user code, so that needed headers for the filename type can be
12042 included first.
72731bb7
AD
12043 Forward declare them before the user code.
12044 * tests/Makefile.am (check-local, installcheck-local): Pass
12045 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 12046
99880de5
AD
120472004-12-20 Akim Demaille <akim@epita.fr>
12048
12049 Use more STL like names: my_class instead of MyClass.
12050
12051 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
12052 (SemanticStack, SemanticType, StateStack, StateType)
12053 (TokenNumberType, Stack, Slice, Traits, Parser::location)
12054 (Parser::value): Rename as...
12055 (location_stack, location_type, rhs_number_type, semantic_stack)
12056 (semantic_type, state_stack, state_type, token_number_type, stack)
12057 (slice, traits, parser::yylloc, parser::yylval): these.
12058
12059 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
12060
9bec482e
PE
120612004-12-19 Paul Eggert <eggert@cs.ucla.edu>
12062
12063 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
12064 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12065
f6fbd3da
PE
120662004-12-17 Paul Eggert <eggert@cs.ucla.edu>
12067
12068 Remove uses of 'short int' and 'unsigned short int'. This raises
12069 some arbitrary limits. It uses more memory but nowadays that's
12070 not much of an issue.
12071
12072 This change does not affect the generated parsers; that's a different
12073 task, as some users will want to conserve memory there.
12074
12075 Ideally we should use size_t to represent all object counts, and
12076 something like ptrdiff_t to represent signed differences of object
12077 counts; but that will require more code-cleanup than I have the
12078 time to do right now.
12079
12080 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
12081 Use size_t, not int or short int, to count objects.
12082 * src/closure.c (nritemset, closure): Likewise.
12083 * src/closure.h (nritemset, closure): Likewise.
12084 * src/nullable.c (nullable_compute): Likewise.
12085 * src/print.c (print_core): Likewise.
12086 * src/print_graph.c (print_core): Likewise.
12087 * src/state.c (state_compare, state_hash): Likewise.
12088 * src/state.h (struct state): Likewise.
12089 * src/tables.c (default_goto, goto_actions): Likewise.
12090
12091 * src/gram.h (rule_number, rule): Use int, not short int.
12092 * src/output.c (prepare_rules): Likewise.
12093 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
12094 errs, reductions): Likewise.
12095 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
12096 Likewise.
12097 * src/tables.c (vector_number, tally, action_number,
12098 ACTION_NUMBER_MINIMUM): Likewise.
12099 * src/output.c (muscle_insert_short_int_table): Remove.
12100
efeed023
AD
121012004-12-17 Akim Demaille <akim@epita.fr>
12102
12103 * data/lalr1.cc: Extensive Doxygenation.
12104 (error_): Rename as...
12105 (error): this, since it is visible to the user.
12106 Adjust callers.
12107 (Parser::message): Now an automatic variable from...
12108 (Parser::yyreport_syntax_error_): here.
12109 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
12110 Parser::error.
12111 * tests/input.at: Escape $.
12112
bc82c5a5
PE
121132004-12-16 Paul Eggert <eggert@cs.ucla.edu>
12114
12115 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
12116 Parenthesize rhs to avoid obscure problems with mistakes like
12117 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
12118 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12119 b4_rhs_location): Likewise.
12120 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12121 b4_rhs_location): Likewise.
12122
fd19f271
AD
121232004-12-16 Akim Demaille <akim@epita.fr>
12124
12125 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
12126 yacc.c: be sure to stay within yycheck_.
12127 * tests/actions.at: Re-enable C++ tests.
12128
10454ea4
AD
121292004-12-16 Akim Demaille <akim@epita.fr>
12130
12131 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
12132 real.
12133
c5b95ccf
AD
121342004-12-16 Akim Demaille <akim@epita.fr>
12135
12136 Use #define to handle the %name-prefix.
12137
12138 * data/glr.c, data/yacc.c: Comment changes.
12139 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
12140 so that one can refer to yylex in the parser file, and have it
12141 renamed, as is the case with other skeletons.
12142
617a8f12
AD
121432004-12-16 Akim Demaille <akim@epita.fr>
12144
12145 Move lalr1.cc internals into yy*.
12146
12147 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
12148 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
12149 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
12150 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
12151 (empty_, final_, terror_, errcode_, ntokens_)
12152 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
12153 (looka_, ilooka_, error_range_, nerrs_):
12154 Rename as...
12155 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
12156 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
12157 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
12158 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
12159 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
12160 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
12161 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
12162 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
12163 these.
12164
1e547e6e
PE
121652004-12-15 Paul Eggert <eggert@cs.ucla.edu>
12166
12167 Fix some problems reported by twlevo at xs4all.
12168 * src/symtab.c (symbol_new): Report an error if the input grammar
12169 contains too many symbols. This is better than calling abort() later.
12170 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
12171 (struct node, struct graph):
12172 Rename member expand to stretch. All uses changed.
12173 (struct graph): Remove member layoutalgorithm. All uses removed.
12174 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
12175 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
12176 All uses changed.
12177 (N_STRETCH): Rename from N_EXPAND. All uses changed.
12178
735d6bd4
AD
121792004-12-15 Akim Demaille <akim@epita.fr>
12180
12181 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
12182 Add more Doxygen comments.
12183 (symprint_, stack_print_, reduce_print_, destruct_, pop)
12184 (report_syntax_error_, translate_): Rename as...
12185 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
12186 (yypop_, yyreport_syntax_error_, yytranslate_): this.
12187
2e1f5829
AD
121882004-12-15 Akim Demaille <akim@epita.fr>
12189
12190 * data/lalr1.cc (lex_): Rename as...
12191 (yylex_): this.
12192 Move the trace here.
12193 Take the %name-prefix into account.
12194 Reported by Alexandre Duret-Lutz.
12195
a3cb6248
AD
121962004-12-15 Akim Demaille <akim@epita.fr>
12197
12198 Simplify the C++ parser constructor.
12199
12200 * data/lalr1.cc (debug_): Rename as...
12201 (yydebug_): so that the parser's internals are always in the yy*
12202 pseudo namespace.
12203 Adjust uses.
12204 (b4_parse_param_decl): Remove the leading comma as it is now only
12205 called as unique argument list.
12206 (Parser::Parser): Remove the constructor accepting a location and
12207 an initial debugging level.
12208 Remove from the other ctor the argument for the debugging level.
12209 (debug_level_type, debug_level, set_debug_level): New.
12210
12211 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
12212 constructor calls.
12213
07fed891
AD
122142004-12-15 Akim Demaille <akim@epita.fr>
12215
12216 Remove b4_root related material: failure experiment
a3cb6248 12217 (which goal was to allow to derive from a class).
07fed891
AD
12218
12219 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
12220 definitions and uses.
12221
e603eaa5
PE
122222004-12-14 Paul Eggert <eggert@cs.ucla.edu>
12223
12224 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
12225 not 2, since it's not portable to subtract 1 from the start of an
12226 array. The new item 0 is never set or used. All uses changed.
12227
12228 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
12229 the default definition of YYLLOC_DEFAULT. Problem reported
12230 by Frank Heckenbach.
12231
fafb007d
PE
122322004-12-12 Paul Eggert <eggert@cs.ucla.edu>
12233
12234 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
12235 the normal case and one for the error case. Just use the
12236 first one uniformly. Problem reported by Frank Heckenbach.
12237 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
12238 use exactly the same macro in both places.
12239 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
12240 so that the normal-case YYRHSLOC works for the error case too.
12241 All uses changed.
12242 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
12243 (YYLLOC_DEFAULT): Use the same macro as glr.c.
12244 * doc/bison.texinfo (Location Default Action): Don't claim that
12245 we have an array of locations. Use the same macro for both glr
12246 and lalr parsers. Mention YYRHSLOC. Mention what happens when
12247 the index is 0.
12248
48814dcd
PE
122492004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12250
a4e1a53b
PE
12251 * HACKING: Update email addresses to send announcements to.
12252
48814dcd
PE
12253 * configure.ac (AC_INIT): Bump version to 1.875f.
12254
337116ba
PE
122552004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12256
12257 * NEWS: Version 1.875e.
12258 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
12259
12260 * src/scan-skel.l: Include "complain.h", for "fatal".
12261
12262 * src/relation.h (relation_print, relation_digraph):
12263 Relation sizes are of type relation_node, not size_t (this is
12264 merely a doc fix, since the two types are equivalent).
12265 (relation_transpose): Relation sizes are of type relation_node,
12266 not int.
12267 * src/relation.c: Likewise.
12268 (top, infinity): Now of type relation_node, not int.
12269 (traverse, relation_transpose): Use relation_node, not int.
12270
12271 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
12272 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
12273 (yyparse): Remove unused local introduced in 2004-10-25 patch.
12274
12275 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 12276 specifying whether the test should be skipped. Use it tp
337116ba 12277 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 12278 fail on some hosts, and should be skipped.
337116ba 12279
da2a7671
PE
122802004-12-08 Paul Eggert <eggert@cs.ucla.edu>
12281
12282 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
12283 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
12284 unless otherwise specified below.
12285
12286 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
12287 to allocate kernel_base, kernel_items, kernel_size, since
12288 they needn't be initialized to 0.
12289 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
12290 * src/closure.c (new_closure): Likewise, for itemset.
12291 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
12292 * src/lalr.c (set_goto_map): Likewise, for temp_map.
12293 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
12294 (build_relations): Likewise for edge, states1, includes.
12295 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
12296 * src/reader.c (packgram): Likewise, for ritem, rules.
12297 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
12298 * src/relation.c (relation_digraph): Likewise for VERTICES.
12299 (relation_transpose): Likewise for new_R, end_R.
12300 * src/symtab.c (symbols_token_translations_init): Likewise for
12301 token_translations.
12302 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
12303 (token_actions): Likewise for yydefact, actrow, conflrow,
12304 conflict_list.
12305 (save_column): Likewise for froms[symno], tos[symno].
12306 (goto_actions): Likewise for state_count.
12307 (pack_table): Likewise for base, pos, check.
12308 (tables_generate): Likewise for width.
12309
12310 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
12311 for initial core. Just have a separate core, so we needn't worry
12312 about whether kernel_size and kernel_base are initialized.
12313
12314 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
12315 kernel_size, kernel_items): Remove unnecessary initialization.
12316 * src/conflicts.c (conflicts): Likewise.
12317 * src/derives.c (derives): Likewise.
12318 * src/muscle_tablc (muscle_insert): Likewise.
12319 * src/relation.c (relation_digraph): Likewise.
12320 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
12321 conflrow, conflict_table, conflict_list, table, check):
12322 Likewise.
12323
12324 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
12325 This is because all callers pass unsigned int.
12326 * src/closure.h (new_closure): Likewise.
12327
12328 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
12329 (build_relations): Initialize includes[i] in all cases.
12330 * src/reader.c (packgram): Always initialize rules[ruleno].prec
12331 and rules[ruleno].precsym. Initialize members in order.
12332 * src/relation.c (relation_transpose): Always initialize new_R[i]
12333 and end_R[i].
12334 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
12335
12336 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
12337 conflict_list[0] was always 0, but now it isn't initialized.
12338
12339 * src/table.c (table_grow): When conflict_table grew, the grown
12340 area wasn't cleared. Fix this.
12341
12342 * lib/.cvsignore: Add strdup.c, strdup.h.
12343 * m4/.cvsignore: Add strdup.m4.
12344
00baeeac
PE
123452004-12-07 Paul Eggert <eggert@cs.ucla.edu>
12346
12347 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
12348 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
12349 GOTO_NUMBER_MAXIMUM, since we occasionally compute
12350 ngotos + 1 without checking for overflow.
12351 (build_relations): Use END_NODE, not -1, to denote end of edges.
12352 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
12353 build_relations): Use goto_number, not int, for goto numbers.
12354 * src/tables.c (save_column, default_goto): Likewise.
12355
be3d9d42
AD
123562004-11-23 Akim Demaille <akim@epita.fr>
12357
12358 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
12359 of #defining from yystype.
12360 Don't typedef yystype, C++ does not need it.
12361 This lets it possible to forward declare it as union.
12362
78e526d5
PE
123632004-11-23 Paul Eggert <eggert@cs.ucla.edu>
12364
12365 * bootstrap (gnulib_modules): Add extensions.
12366 Problem reported by Jim Meyering.
12367
afbb696d
PE
123682004-11-22 Paul Eggert <eggert@cs.ucla.edu>
12369
12370 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
12371 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
12372 src/system.h, src/tables.c: XFREE -> free, to accommodate
12373 recent change to gnulib xalloc.h.
78e526d5 12374 Problem reported by Jim Meyering.
afbb696d 12375
c1f8f16a
AD
123762004-11-17 Akim Demaille <akim@epita.fr>
12377
12378 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
12379
db7e5eb5 123802004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
12381 Alexandre Duret-Lutz <adl@gnu.org>
12382
12383 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
12384 changes.
12385 (YYCDEBUG): Adjust.
12386 Use it instead of cdebug_.
12387 (Parser::debug_stream, Parser::set_debug_stream): New.
12388 (Parser::symprint_): Define cdebug_ for temporary backward
12389 compatibility.
12390 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
12391 debug_stream ().
12392
68e11668
AD
123932004-11-17 Akim Demaille <akim@epita.fr>
12394
12395 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
12396 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
12397 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
12398 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12399
97cbc73e
PE
124002004-10-27 Paul Eggert <eggert@cs.ucla.edu>
12401
12402 * data/glr.c (yyloc_default): Remove; not used.
12403 Problem reported by Frank Heckenbach.
12404
e342c3be
AD
124052004-10-25 Akim Demaille <akim@epita.fr>
12406
12407 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
12408 Introduce another definition to address simple location arrays.
12409 (yyGLRStack): New member: yyerror_range.
12410 (yyrecoverSyntaxError, yyparse): Update it.
12411 (yyrecoverSyntaxError): Use it when shifting the error token to
12412 have an accurate range, equivalent to the one computed by both
12413 yacc.c and lalr1.cc.
12414 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
12415 that column numbers start at column 0, as per GNU Coding
12416 Standards, the others tests, and the doc.
12417 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
12418 Adjust to the above change (first column is 0).
12419 And adjust the location of the "<error>", now covering the whole
12420 line.
12421
93602feb 124222004-10-22 Akim Demaille <akim@epita.fr>
04098407 12423 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
12424
12425 Remove some arbitrary limits on goto numbers and relations.
12426 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
12427 initial values, since they're never used.
12428 (set_goto_map): ngotos is now unsigned, so test for overflow
12429 by seeing whether it wraps around to zero.
12430 * src/lalr.h (goto_number): Now size_t, not short int.
12431 (GOTO_NUMBER_MAXIMUM): Remove.
12432 * src/relation.c (relation_print, traverse, relation_transpose):
12433 Check for END_NODE rather than looking at sign.
12434 * src/relation.h (END_NODE): New macro.
12435 (relation_node): Now size_t, not short int.
12436
dba08b04
PE
124372004-10-22 Paul Eggert <eggert@cs.ucla.edu>
12438
12439 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
12440 keyword, not an identifier. Problem reported by Baron Schwartz in
12441 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
12442
df09ef2e
AD
124432004-10-11 Akim Demaille <akim@epita.fr>
12444
12445 * src/symtab.c (symbol_check_alias_consistency): Also check
12446 type names, destructors, and printers.
12447 Reported by Alexandre Duret-Lutz.
12448 Recode the handling of associativity and precedence in terms
12449 of symbol_precedence_set.
12450 Accept no redeclaration at all, not even equal to the previous
12451 value.
12452 (redeclaration): New.
12453 Use it to factor redeclaration complaints.
12454 (symbol_make_alias): Don't set the type of the alias, let
12455 symbol_check_alias_consistency do it as for other features.
12456 * src/symtab.h (symbol): Add new member prec_location, and
12457 type_location.
12458 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
12459 * tests/input.at (Incompatible Aliases): New.
12460
146bc99d
PE
124612004-10-09 Paul Eggert <eggert@cs.ucla.edu>
12462
12463 .cvsignore fixes to accommodate gnulib changes,
12464 and the practice of naming build directories "_build".
12465 * .cvsignore: Add "_*". Sort.
12466 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
12467 * m4/.cvsignore: Add "*_gl.m4".
12468
e503aa60
AD
124692004-10-06 Akim Demaille <akim@epita.fr>
12470
12471 * src/parse-gram.y (add_param): Fix the truncation of trailing
12472 spaces.
12473
b4a20338
AD
124742004-10-05 Akim Demaille <akim@epita.fr>
12475
12476 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
12477 whether the reducion was empty or not. This leaves room to
12478 improve the use of YYLLOC_DEFAULT in such a case.
12479 lalr1.cc is still experimental, so changing this is acceptable.
12480 And finally, there are probably not many users who changed the
12481 handling of locations in GLR, so changing is admissible too.
12482
12483 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
12484 empty reduction, set @$ to an empty location ending the previously
12485 stacked symbol.
12486 Adjust uses to make sure the code is triggered on empty
12487 reductions.
12488 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
12489 expected output: empty reductions have empty locations.
12490
f85a5e6f
AD
124912004-09-29 Akim Demaille <akim@epita.fr>
12492
12493 * data/lalr1.cc: Move towards a more standard C++ coding style
12494 for templates: Class < T > -> Class<T>.
12495
b203fc2c
AD
124962004-09-29 Akim Demaille <akim@epita.fr>
12497
12498 * data/lalr1.cc: Reinstall the former ctor, for sake of
12499 compatibility, but warn it will be removed.
12500 Move towards a more standard C++ coding style (i.e., type *var ->
12501 type* var).
12502
5b7e1e73
PE
125032004-09-27 Paul Eggert <eggert@cs.ucla.edu>
12504
3fee967f
PE
12505 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
12506 since it's less likely to work if NULs are involved in the future.
5b7e1e73 12507
0dcca5c2
AD
125082004-09-27 Akim Demaille <akim@epita.fr>
12509
12510 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
12511
6dde1c82
AD
125122004-09-27 Akim Demaille <akim@epita.fr>
12513
12514 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 12515 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
12516 and argument names.
12517 (b4_cc_constructor_call): Likewise.
12518
b233d555
AD
125192004-09-24 Akim Demaille <akim@epita.fr>
12520
12521 * src/parse-gram.y (add_param): Strip the leading and trailing
12522 blanks from a formal argument declaration.
12523 (YY_LOCATION_PRINT): New.
12524
619404e3
AD
125252004-09-24 Akim Demaille <akim@epita.fr>
12526
12527 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
12528 after the location.
12529
dd8d9022
AD
125302004-09-24 Akim Demaille <akim@epita.fr>
12531
12532 * doc/bison.texinfo (Table of Symbols): Sort.
12533
0092f063
AD
125342004-09-21 Akim Demaille <akim@epita.fr>
12535
12536 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
12537 the useless parentheses.
12538 Suggested by Paul Eggert.
12539
451364ed
AD
125402004-09-20 Akim Demaille <akim@epita.fr>
12541
12542 Let the initial-action act on the look-ahead, and use it for the
12543 "initial push" (corresponding to an hypothetical beginning-of-file).
12544 And let lalr1.cc honor %initial-action.
12545
12546 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
12547 example.
12548 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
12549 (Parser::Parser): Remove the ctor that used to initialize it.
12550 (Parser::parse): Like in the other skeletons, issue the "starting
12551 parse" message before any action.
12552 Honor %initial-action.
12553 Initialize the stacks with the lookahead.
12554 * data/yacc.c: Let $$ and @$ in %initial-action designate the
12555 look-ahead.
12556 Push them in the stacks.
12557 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
12558
18d192f0
AD
125592004-09-20 Akim Demaille <akim@epita.fr>
12560
12561 * doc/bison.texinfo (Initial Action Decl): New.
12562
b8458aa5
AD
125632004-09-20 Akim Demaille <akim@epita.fr>
12564
12565 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
12566 clearer criterion to define it.
12567 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
12568 When reducing on an empty RHS, use the latest stacked location as
12569 location.
12570 yylloc is not always available.
12571 * data/glr.c: Likewise.
12572 Also, honor initial-actions.
12573
3fc16193
AD
125742004-09-20 Akim Demaille <akim@epita.fr>
12575
12576 * data/yacc.c (YY_LOCATION_PRINT): New.
12577 Define when we know YYLTYPE's structure, i.e., when the default
12578 YYLLOC_DEFAULT is used.
12579 * data/c.m4 (b4_yysymprint_generate): Use it.
12580 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
12581 value of the result.
12582 (error_start_): Replace with...
12583 (error_range_): this location array.
12584 This allows to replace code relying on the implementation of
12585 locations by portable code.
12586 * data/yacc.c (yylerrsp): Replace with...
12587 (yyerror_range): this.
12588 Every time a token is popped, update yyerror_range[0], to have an
12589 accurate location for the error token.
12590 * data/glr.c (YY_LOCATION_PRINT): New.
12591 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
12592 deference a pointer.
12593 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
12594 report the location in %printers.
12595
12596 * src/scan-skel.l: Instead of abort, report error messages to ease
12597 understanding skeleton scanning failures.
12598
ecfe33e7
AD
125992004-09-16 Akim Demaille <akim@epita.fr>
12600
12601 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
12602 (iterator, const_iterator): these, to be more in the C++ spirit.
12603 Also, return reverse iterators so that when displaying the stack
12604 we display its bottom first.
12605 (Parser::stack_print_, Parser::reduce_print_): Match the messages
12606 from yacc.c.
12607 We should probably use vector here though.
12608
1576d44d
AD
126092004-09-16 Akim Demaille <akim@epita.fr>
12610
12611 Have more complete shift traces.
12612
12613 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
12614 to report Shifts instead of ad hoc YYDPRINTF invocations,
12615 including for the error token.
12616 * data/lalr1.cc (symprint_): Output the location.
12617 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
12618 output the location within the %printer.
12619 Activate GLR tests, at least to make sure they compile properly.
12620 They still don't pass though.
12621 * tests/calc.at: Adjust expect verbose output, since now "Entering
12622 state..." is on a different line than the "Shifting" message.
12623
9c66f418
AD
126242004-09-08 Akim Demaille <akim@epita.fr>
12625
12626 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
12627 Bison directive from the Bison file to the invocation of this
12628 macro, so that these directives are passed to
12629 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
12630 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
12631 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
12632 the extra Bison directives instead of the whole series.
12633 Change the grammar so that there are recoverable errors, and
12634 unrecoverable errors. Now we can have the parser give up before
12635 consuming the whole input. As a result we now can observe that
12636 the lookahead is freed when needed.
12637 Change the parser source to parse argv[1] instead of a hard coded
12638 string.
12639 Simplify yylex, and give a value and location to EOF.
12640 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
12641 passed directives already coded in the file.
12642 Add some tests to check the location of "error".
12643 For some tests, the C++ parser is correct, and not yacc.c.
12644 For other tests, they provide different, but unsatisfying, values,
12645 so keep the C++ value so that at least one parser is "correct"
12646 according to the test suite.
12647 (Actions after errors): Remove, this is subsumed by the
12648 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
12649
52d5733f
AD
126502004-09-06 Akim Demaille <akim@epita.fr>
12651
12652 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 12653 (Parser::pop): New.
52d5733f
AD
12654 Use it.
12655
a0e68930
AD
126562004-09-06 Akim Demaille <akim@epita.fr>
12657
12658 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
12659 argument, an informative message.
12660 Call YY_SYMBOL_PRINT.
12661 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
12662 * data/lalr1.cc (destruct_): Likewise.
12663 In addition, no longer depend on b4_yysymprint_generate and
12664 b4_yydestruct_generate to generate these functions, do it "by
12665 hand".
12666
e757bb10
AD
126672004-09-03 Akim Demaille <akim@epita.fr>
12668
12669 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
12670 invoked, yydestruct the lookahead.
12671 * tests/calc.at (Calculator $1): Update the expected lengths of
12672 traces: there is an added line for the discarded lookahead.
12673 * doc/bison.texinfo (Destructor Decl): Some rewording.
12674 Define "discarded" symbols.
12675
0fe1f06d
AD
126762004-09-02 Akim Demaille <akim@epita.fr>
12677
12678 * data/lalr1.cc (translate_, destruct_): No reason to be static.
12679
284acc8b
AD
126802004-09-02 Akim Demaille <akim@epita.fr>
12681
12682 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
12683 (YYDSYMPRINTF): Rename as...
12684 (YY_SYMBOL_PRINT): this.
12685 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
12686 two.
12687 Use it instead of direct symprint_ calls.
12688 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
12689 one.
12690
a5eb1ed2
AD
126912004-09-02 Akim Demaille <akim@epita.fr>
12692
b7c72fe1
AD
12693 * data/lalr1.cc (b4_yysymprint_generate): New.
12694 (symprint_): New member function, defined when YYDEBUG.
12695 Use it consistently instead of token/nterm debugging output by
12696 hand.
a5eb1ed2
AD
12697 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
12698 %printer calls to use cdebug_ when using lalr1.cc.
12699
417141dd
AD
127002004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
12701
12702 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
12703 with #ifdef YYDEBUG.
12704
2fa09258
AD
127052004-08-26 Akim Demaille <akim@epita.fr>
12706
12707 * doc/bison.texinfo (Implementing Loops): Rename as...
12708 (Implementing Gotos/Loops): this.
12709
9378b508
PE
127102004-08-13 Paul Eggert <eggert@cs.ucla.edu>
12711
12712 Adjust to latest gnulib.
12713 * bootstrap (gnulib_modules): Add xalloc-die.
12714 Set LC_ALL=C so that file names sort consistently.
12715 Prefer the gnulib copies of gettext.m4, glibc21.m4,
12716 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
12717 uintmax_t.m4, ulonglong.m4.
12718 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
12719 po.m4 since we are now using _gl.m4 instead.
12720
87a8ad5c
PE
127212004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
12722
12723 * src/scan-action.l: Remove. Scanning of semantic actions is
12724 handled in scan-gram.l.
12725
dca81a78
PE
127262004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
12727
12728 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
12729
12730 * src/location.h (struct): The file member is a uniqstr.
12731 (equal_boundaries): Use UNIQSTR_EQ for comparison.
12732
c9cbf7c5
PE
127332004-07-22 Paul Eggert <eggert@cs.ucla.edu>
12734
12735 Fix bug with non-%union parsers that have printers or destructors,
12736 which led to a Bison core dump. Reported by Peter Fales in
12737 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 12738
c9cbf7c5
PE
12739 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
12740 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
12741 not to our own type.
12742 * src/output.c (symbol_destructors_output, symbol_printers_output):
12743 Don't assume %union.
12744 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
12745 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
12746 UNION-FLAG. All callers changed.
12747 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
12748 Use type char, not unsigned int, when declaring an array of char;
12749 this lets us remove a cast.
12750 (Printers and Destructors): Add non-%union test cases.
12751
fa7e68c3
PE
127522004-06-21 Paul Eggert <eggert@cs.ucla.edu>
12753
12754 * doc/bison.texinfo: Minor editorial changes, mostly to the new
12755 GLR writeups. E.g., avoid frenchspacing and the future tense,
12756 change "lookahead" to "look-ahead", and change "wrt" to "with
12757 respect to".
2fa09258 12758
fa7e68c3
PE
127592004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12760
12761 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
12762 New sections, split off from the GLR Parsers section. Put the new
12763 Simple GLR Parser near the start of the GLR section, for clarity.
12764 Rewrite connective text.
12765
99a9344e
PE
127662004-06-21 Frank Heckenbach <frank@g-n-u.de>
12767
12768 * doc/bison.texinfo (Simple GLR Parsers): New section.
12769
8dd162d3
PE
127702004-06-21 Paul Eggert <eggert@cs.ucla.edu>
12771
12772 * NEWS, TODO, doc/bison.texinfo:
12773 Use "look-ahead" instead of "lookahead", to be consistent.
12774 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
12775 while we're fixing "look-ahead".
12776 * src/conflicts.c (shift_set): Renamed from shiftset.
12777 (look_ahead_set): Renamed from lookaheadset.
12778 * src/print.c: Likewise.
12779 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
12780 name for "lookahead".
12781 (report_types, usage): Likewise.
12782 * src/getargs.h (report_look_ahead_tokens): Renamed from
12783 report_lookaheads.
12784 * src/lalr.c (compute_look_ahead_tokens): Renamed from
12785 compute_lookaheads.
12786 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
12787 (look_ahead_tokens_print): Renamed from lookaheads_print.
12788 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
12789 state_rule_lookaheads_print.
12790 * src/state.h: Likewise.
12791 (reductions.look_ahead_tokens): Renamed from lookaheads.
12792 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
12793 AT_DATA_LOOKAHEADS_GRAMMAR.
12794
57a90331
PE
127952004-06-03 Paul Eggert <eggert@cs.ucla.edu>
12796
12797 * README: Update location of patched M4 distribution.
12798
8ed3234a
PE
127992004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
12800
12801 Don't assume the C++ compiler takes the same arguments as the C compiler
12802 (trivial change).
12803 * configure.ac (O0CXXFLAGS): New var.
12804 * tests/atlocal.in (CXXFLAGS): Use it.
12805
07971983
PE
128062004-05-29 Paul Eggert <eggert@cs.ucla.edu>
12807
12808 Fix some "make check" problems with C++ reported by
12809 Albert Chin-A-Young for Tru64 C++ in this thread:
12810 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
12811
12812 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
12813 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12814 Output to a .cc file for C++, not to a .c file.
12815 * tests/calc.at (AT_CHECK_CALC): Likewise.
12816 * tests/regression.at (AT_CHECK_DANCER): Likewise.
12817 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
12818
29058652
PE
128192004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
12820
12821 * tests/calc.at, tests/actions.at: Workaround for SGI
12822 C++ compiler. (trivial change)
12823
62cb8a99
PE
128242004-05-27 Paul Eggert <eggert@cs.ucla.edu>
12825
fd418816
PE
12826 Spent a few hours checking out which prerequisite versions the
12827 current sources actually require. I went all the way back to
12828 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
12829 a seemingly endless set of combinations of versions more recent
12830 than that. The bottom line is that the current sources require
12831 fairly recent versions of the build tools, and it'll be some work
12832 to change this.
12833 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
12834 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
12835 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
12836 Add comments explaining why those particular versions are
12837 currently needed.
2fa09258 12838
62cb8a99
PE
12839 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
12840 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 12841 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
12842
12843 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
12844 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
12845
caa52c10
PE
128462004-05-26 Paul Eggert <eggert@cs.ucla.edu>
12847
12848 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
12849 0.11.5. Suggested by Bruno Haible.
12850 * bootstrap: Remove gettext version checking.
12851
12852 * doc/bison.texinfo (Decl Summary): Also mention that %union
12853 can depend on prerequisite types. Problem reported by Tim
12854 Van Holder.
12855
4bfd5e4e
PE
128562004-05-25 Paul Eggert <eggert@cs.ucla.edu>
12857
2cef3017
PE
12858 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
12859 * README-alpha: Don't tell people not to package this.
12860
b9c85d5c
PE
12861 * bootstrap: Don't assume $(...) works; use `...` instead.
12862 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
12863 gettext better.
12864
4bfd5e4e
PE
12865 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
12866 put into the -d output file, and mention what to do if YYSTYPE is
12867 defined as a macro.
12868
6a36ff94
PE
128692004-05-24 Paul Eggert <eggert@cs.ucla.edu>
12870
6712933e
PE
12871 Undo change made earlier today: it caused autopoint to not bring
12872 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
12873 autopoint's.
12874
12875 * bootstrap: Check that gettext version matches what's in
12876 configure.ac. Warn users to ignore robots.txt ERROR 404.
12877 * bootstrap: Undo today's earlier change (logged below).
12878 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 12879
6a36ff94
PE
12880 The gettext version checking is causing more trouble than it's
12881 curing; remove it. Problem reported by Paul Hilfinger.
12882
12883 * bootstrap: Issue a warning that one can expect a message
12884 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
12885 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
12886
209ea708
PE
128872004-05-23 Paul Eggert <eggert@cs.ucla.edu>
12888
12889 Ensure that the C++ compiler used for testing actually works on a
12890 simple test program; if not, skip the C++-related tests. Problem
12891 reported by Vin Shelton in:
161a71f3 12892 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
12893
12894 * m4/cxx.m4: New file.
12895 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
12896 * tests/atlocal.in (BISON_CXX_WORKS): Add.
12897 * tests/local.at (AT_COMPILE_CXX): Use it.
12898
41ca2549
PE
128992004-05-21 Paul Eggert <eggert@cs.ucla.edu>
12900
383e69dc
PE
12901 * data/glr.c (yylloc): Output this macro even if locations are not
12902 being generated, as the GLR parser needs it even in that case.
12903 Problem reported by Troy A. Johnson
12904 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
12905
41ca2549
PE
12906 * configure.ac (AC_INIT): Update to 1.875e.
12907
e476c87d
PE
129082004-05-21 Paul Eggert <eggert@cs.ucla.edu>
12909
12910 * NEWS: Version 1.875d.
12911 * configure.ac (AC_INIT): Likewise.
12912 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
12913
12914 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
12915 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
12916 lalr1.cc runs afoul of the first, and the last two are no longer
12917 supported by GCC 3.4.0.
12918 * README: Mention GNU m4 1.4 or later; mention m4 patches.
12919 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
12920
233a88ad
PE
129212004-05-06 Paul Eggert <eggert@cs.ucla.edu>
12922
12923 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
12924 unsigned int, for compatibility with latest gnulib hash module.
12925 * src/state.c (state_hash, state_hasher): Likewise.
12926 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
12927 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 12928
12ffdd28
PE
129292004-05-03 Paul Eggert <eggert@cs.ucla.edu>
12930
12931 * NEWS: Unescaped newlines are no longer allowed in char & strings.
12932
12933 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
12934 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
12935 character and string literals.
12936 (unexpected_end): New function.
12937 (unexpected_eof): Use it.
12938 (unexpected_newline): New function.
12939 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
12940 actions.
e476c87d 12941
12ffdd28
PE
12942 * NEWS: Document %expect-rr.
12943
12944 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
12945 Fix typo by replacing $1 with $option.
12946 Remove more 'intl'-related files.
9668e2be 12947 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
12948
12949 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
12950 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
12951 strtoul.c.
12952 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
12953 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
12954 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
12955 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
12956 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
12957 * src/.cvsignore: Add *.output.
12958
12959 * src/parse-gram.y: Put copyright notice inside %{ %} so it
12960 gets copied to the output file.
e476c87d 12961
1f65350a
PE
129622004-04-28 Paul Eggert <eggert@twinsun.com>
12963
12964 Get files from the gnulib and po repositories, instead of relying
12965 on them being in our CVS. Upgrade to latest versions of gnulib
12966 and Automake.
12967
12968 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
12969 * bootstrap: Bootstrap from gnulib and po repositories.
12970 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
12971 * README-cvs: Document these changes. Remove version numbers from
12972 mentions of build tools, since they change so often. Mention Flex.
12973
12974 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
12975 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
12976 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
12977 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 12978 does this for us.
12ffdd28
PE
12979 (AC_ISC_POSIX): Remove; we no longer support this
12980 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
12981 (AC_HEADER_STDC): Remove: we now assume C89 or better.
12982 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
12983 Do not check for C89 headers, except for locale.h which is used
12984 by the Yacc library and must port to K&R hosts.
12985 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
12986 Do not check for C89 functions, except for setlocale which is
12987 used by the Yacc library.
12988 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
12989 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
12990 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
12991 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
12992 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
12993 AM_GNU_GETTEXT): Remove; now done by:
12994 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
12995 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
12996 for us.
12997
12998 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
12999 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
13000 Define to empty, as gnulib.mk will do the rest for us.
13001 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
13002 for us.
13003 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
13004 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
13005
13006 * src/files.c: Include gnulib's xstrndup.h.
13007
13008 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
13009 (REALLOC): Use xnrealloc, for likewise.
13010 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
13011 (strnlen, memrchr): Remove decls; functions no longer used.
13012 Include <stpcpy.h>.
13013
13014 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
13015 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
13016 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
13017 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
13018 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
13019 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
13020 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
13021 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
13022 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
13023 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
13024 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
13025 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13026 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
13027 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
13028 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
13029 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
13030 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
13031 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
13032 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
13033 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
13034 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
13035 Remove, as these files are now generated automatically
13036 by bootstrap or automake.
13037
13038 * po/ChangeLog: Remove: all but one entry was a duplicate
13039 of this file, and I moved that 2000-11-02 entry here.
13040
13041 * config/.cvsignore: Add Makefile, depcomp, install-sh.
13042 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
13043 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
13044 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
13045 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
13046 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
13047 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
13048 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
13049 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
13050 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
13051 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
13052 xstrndup.h.
13053 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
13054 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
13055 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
13056 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
13057 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
13058 * src/.cvsignore: Remove *_.c.
13059
13060
13061 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
13062 support it. (The latest stable gzip doesn't.)
13063
130642004-04-27 Paul Eggert <eggert@twinsun.com>
13065
13066 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
13067 case, as stos_ is now used by destructors due to the 2004-02-09
13068 change.
13069
13070 Remove more K&R C support.
13071 * lib/libiberty.y (PARAMS): Remove. All uses removed.
13072 * lib/subpipe.c (errno): Remove decl.
13073 Include <stdlib.h> unconditionally.
13074 (EXIT_FAILURE): Remove macro.
13075 * src/complain.c (vfprintf, strerror): Remove.
13076 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
13077 unconditionally.
13078 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
13079 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
13080 (strchr, strspn, memchr): Remove decls.
13081 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
13082 unconditionally. Do not declare perror.
13083 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
13084 unconditionally.
13085
13086 * src/complain.c (_): Remove useless defn, as system.h defines this.
13087
13088 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
13089 with latest obstack.h.
13090 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
13091 to procedure types, as obstack.h now does that for us.
13092 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
13093
13094 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
13095 so that this include file can stand alone.
13096 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
13097 does this now. Include subpipe.h first after config.h, to
13098 test whether it can stand alone.
13099
13100 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
13101 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
13102 unused declaration.
13103
13104 * tests/synclines.at (%union synch line): Put a dummy member in
13105 the union, because empty unions aren't allowed in C. Caught
13106 by GCC 3.4.0.
13107
4f16766c
PE
131082004-04-13 Jim Meyering <jim@meyering.net>
13109
13110 * src/conflicts.c (conflicts_print): Correct format string typo:
13111 use `%%' to produce literal `%'. (trivial change)
13112
779e7ceb
PE
131132004-03-30 Paul Eggert <eggert@twinsun.com>
13114
13115 * src/getargs.c (version): Update copyright year to 2004.
13116
13117 * data/c.m4 (b4_int_type): Use 'short int' rather than
13118 'short', and similarly for 'long', 'unsigned', etc.
13119 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
13120 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
13121 yy_yypstack, yydumpstack): Likewise.
13122 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
13123 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
13124 Likewise.
13125 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
13126 yy_stack_print, yyparse): Likewise.
13127 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
13128 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
13129 * lib/bitset.c (bitset_print): Likewise.
13130 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
13131 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13132 * lib/bitsetv.c (bitsetv_dump): Likewise.
13133 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
13134 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
13135 Likewise.
13136 * src/LR0.c (allocate_itemsets): Likewise.
13137 * src/gram.h (rule_number, rule): Likewise.
13138 * src/lalr.h (goto_number): Likewise.
13139 * src/nullable.c (nullable_compute): Likewise.
13140 * src/output.c (prepare_rules): Likewise.
13141 * src/relation.c (relation_print, relation_digraph): Likewise.
13142 * src/relation.h (relation_node): Likewise.
13143 * src/state.h (state_number, transitions, errs, reductions,
13144 struct state): Likewise.
13145 * src/symtab.h (symbol_number, struct symbol): Likewise.
13146 * src/tables.c (vector_number, tally, action_number,
13147 default_goto, goto_actions): Likewise.
13148 * tests/existing.at (GNU Cim Grammar): Likewise.
13149 * tests/regression.at (Web2c Actions): Likewise.
13150
13151 * src/output.c (muscle_insert_short_int_table): Renamed from
13152 muscle_insert_short_table. All uses changed.
13153
d6328241
PH
131542004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
13155
13156 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
13157 (declaration): Replace expected_conflicts with expected_sr_conflicts.
13158 Add %expect-rr rule.
4f16766c 13159
d6328241
PH
13160 * src/scan-gram.l: Recognize %expect-rr.
13161
4f16766c 13162 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 13163 expected_conflicts.
4f16766c 13164 (expected_rr_conflicts): Declare.
d6328241
PH
13165
13166 * src/conflicts.c (expected_sr_conflicts): Rename from
13167 expected_conflicts.
13168 (expected_rr_conflicts): Define.
13169 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
13170 for GLR parsers.
13171 Use expected_sr_conflicts in place of expected_conflicts.
13172 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 13173
d6328241 13174 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 13175
1452af69
PE
131762004-03-08 Paul Eggert <eggert@gnu.org>
13177
13178 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 13179 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
13180
13181 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
13182 in lalr1.cc.
13183 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
13184 * src/scan-gram.l (scan_integer): New function.
13185 ({int}): Use it.
13186 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
13187 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
13188 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
13189 Say "long int", not "long", for uniformity with GNU style.
13190
006d217d
PE
131912004-02-25 Paul Eggert <eggert@twinsun.com>
13192
13193 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
13194 compilers. This fixes a problem with Intel's C++ compiler being
13195 chatty, reported by Guido Trentalancia in
161a71f3 13196 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 13197
c2729758
ADL
131982004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
13199
13200 Support %destructor and merge error locations in lalr1.cc.
13201
13202 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
13203 (Parser::stos_): Define unconditionally.
13204 (Parser::destruct_): New method. Generate its body with
13205 b4_yydestruct_generate.
13206 (Parser::error_start_): New attribute.
13207 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
13208 token which are discarded.
13209 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
13210 error_start_ when erroneous token are discarded.
13211 (Parser::parse) <yyerrlab1>: Compute the location of the error
13212 token so that it covers all the discarded tokens.
13213 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
13214 it can be called with `%skeleton "lalr1.cc"', and do that.
13215
dd0e0635
PE
132162004-02-02 Paul Eggert <eggert@twinsun.com>
13217
13218 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
13219 $(top_srcdir)/lib and ../lib. This fixes a bug reported
13220 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
13221 There's no need to mention top_builddir since Automake does that
13222 for us.
13223 (INCLUDES): Remove, as Automake says it's obsolescent.
13224 Contents migrated into AM_CPPFLAGS as described above.
13225 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
13226
132272004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
13228
13229 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
13230 (yyreportSyntaxError): Handle case where lookahead token is
13231 YYEMPTY.
13232
be16239b
PH
132332004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13234
13235 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
13236 resulting parsers are compilable with C++.
13237
5fa90832
PE
132382003-12-23 Paul Eggert <eggert@twinsun.com>
13239
13240 * config/depcomp, config/install-sh: Sync with Automake 1.8.
13241 * src/output.c (output_skeleton): Rename local var.
13242 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
13243 Bison tokens, as this runs afoul of the 2003-10-07 change that
13244 disallowed NUL bytes in character constants or string literals.
13245
13246 * tests/local.at: Require Autoconf 2.59's Autotest.
13247 * tests/testsuite.at: Don't include local.at, since we now assume
13248 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
13249 including it.
13250 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
13251 multiple inclusion warnings.
dd0e0635 13252
b165c324
AD
132532003-12-02 Akim Demaille <akim@epita.fr>
13254
13255 * doc/bison.texinfo (How Can I Reset the Parser): More about start
13256 conditions.
13257 From Bruno Haible.
13258
26e06a21
ADL
132592003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
13260
13261 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
13262
92ac3705
PE
132632003-10-07 Paul Eggert <eggert@twinsun.com>
13264
6a5ecb38
PE
13265 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
13266 if testsuite doesn't exist.
13267
92ac3705
PE
13268 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
13269 literals, unfortunately.
13270 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
13271 Complain about NUL bytes in character constants or string literals.
13272
91d2c560
PE
132732003-10-05 Paul Eggert <eggert@twinsun.com>
13274
13275 * NEWS: Don't document %no-default-prec, as it's still
13276 too experimental.
13277 * doc/bison.texinfo: Document %no-default-prec only if
13278 the defaultprec flag is set. Normally it's not.
13279
0cc3da3a
PE
132802003-10-04 Paul Eggert <eggert@twinsun.com>
13281
13282 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
13283 non-modifiable lvalue, instead of a modifiable one.
13284 * doc/bison.texinfo (Actions): Document that $$ can
13285 be assigned to. Do not claim that $$ and $N are
13286 array element references: user code should not rely on this.
13287
22fccf95
PE
132882003-10-01 Paul Eggert <eggert@twinsun.com>
13289
13290 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
13291 (grammar_declaration): Use it.
13292 * src/scan-gram.l: New token %no-default-prec.
13293 * tests/conflicts.at: Revamp tests to use %no-default-prec.
13294 * NEWS, doc/bison.texinfo: Document the above.
13295
fc8f2965
AD
132962003-10-01 Akim Demaille <akim@epita.fr>
13297
13298 VCG no longer supports long_straight_phase.
13299
13300 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
13301 * src/print_graph.c (print_graph): Adjust.
13302
39a06c25
PE
133032003-09-30 Frank Heckenbach <frank@g-n-u.de>
13304 and Paul Eggert <eggert@twinsun.com>
13305
13306 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
13307 Table of Symbols): Document %default-prec.
13308 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
13309 (grammar_declaration): Set default_prec on %default-prec.
13310 * src/scan-gram.l (%default-prec): New token.
13311 * src/reader.h (default_prec): New flag.
13312 * src/reader.c: Likewise.
13313 (packgram): Handle it.
13314 * tests/conflicts.at (%default-prec without %prec,
13315 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 13316
39a06c25
PE
133172003-09-30 Paul Eggert <eggert@twinsun.com>
13318
13319 * tests/testsuite.at: Include local.at, not input.at, fixing
13320 a typo in the 2003-08-25 patch.
13321
62b6aef9
AD
133222003-08-27 Akim Demaille <akim@epita.fr>
13323
13324 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
13325 GCC warnings.
13326
89e1cc61
AD
133272003-08-26 Akim Demaille <akim@epita.fr>
13328
13329 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
13330 "<\#" to avoid magic from Gnus when posting parts of this script.
13331
a08460b0
AD
133322003-08-26 Akim Demaille <akim@epita.fr>
13333
13334 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
13335 (Parser::parse): here.
13336 Adjust: nerrs and errstatus is now replaced by...
13337 (Parser::nerrs_, Parser::errstatus_): New.
13338
603f1cfd
AD
133392003-08-25 Akim Demaille <akim@epita.fr>
13340
13341 * config/announce-gen, Makefile.cfg: New.
13342 * Makefile.am: Adjust.
13343 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
13344 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
13345
cd3684cf
AD
133462003-08-25 Akim Demaille <akim@epita.fr>
13347
13348 When reducing initial empty rules, Bison parser read an initial
13349 location that is not defined. This results in garbage, and that
13350 affects Bison's own parser. Therefore we need (i) to extend Bison
13351 to support a means to initialize this location, and (ii) to use
13352 this CVS Bison to fix CVS Bison's parser.
13353
13354 * src/reader.h, reader.c (epilogue_augment): Remove, replace
13355 with...
13356 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
13357 * src/parse-gram.y: Adjust.
13358 (%initial-action): New.
13359 (%error-verbose): Since we require CVS Bison, there is no reason
13360 not to use it.
13361 * src/scan-gram.l: Adjust.
13362 * src/Makefile.am (YACC): New, to make sure we use our own parser.
13363 * data/yacc.c (yyparse): Use b4_initial_action.
13364
4e03e201
AD
133652003-08-25 Akim Demaille <akim@epita.fr>
13366
13367 * doc/bison.texinfo: Don't promote stdout for error messages.
13368
8c182d05
AD
133692003-08-25 Akim Demaille <akim@epita.fr>
13370
13371 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
13372 From Alexandre Duret-Lutz.
13373
6a60c4cf
PE
133742003-08-25 Akim Demaille <akim@epita.fr>
13375
13376 Version 1.875c.
13377
25f66e1a
AD
133782003-08-25 Akim Demaille <akim@epita.fr>
13379
13380 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
13381 Use them.
13382
5348bfbe
AD
133832003-08-25 Akim Demaille <akim@epita.fr>
13384
13385 * data/lalr1.cc (Parser::reduce_print_): New.
13386 Use it.
13387
47301314
AD
133882003-08-25 Akim Demaille <akim@epita.fr>
13389
13390 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
13391 error recovery loops. This patch is based on
161a71f3 13392 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
13393 Also, augment the similarity between lalr1.cc and yacc.c.
13394 Note: the locations of error recovery rules are not correct yet.
13395
13396 * data/lalr1.cc: Comment changes to augment the similarity between
13397 lalr1.cc and yacc.c.
13398 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
13399 (yyerrlab1): Remove, but where it used to be (now the bottom part of
13400 yyerrlab), when hitting EOF, pop the whole stack here instead of
13401 merely falling thru the default error handling mechanism.
13402 (yyerrorlab): New label, with the old contents of YYERROR,
13403 plus the following change: pop the stack of rhs corresponding
13404 to the production that invoked YYERROR. That is how Yacc
13405 behaves (required by POSIX).
13406 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
13407 fail.
13408
1f7a61ff
AD
134092003-08-25 Akim Demaille <akim@epita.fr>
13410
13411 Tune local.at so that people can "autom4te -l autotest calc.at -o
13412 calc" for instance, to extract a sub test suite.
13413
13414 * tests/testsuite.at: Move the initialization, Autotest version
13415 requirement, and AT_TESTED invocation into...
13416 * tests/local.at: here.
13417 * tests/testsuite.at: Include it for compatibility with Autoconf
13418 2.57.
13419 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
13420 be ignore.
13421
327b5b56
PE
134222003-08-04 Paul Eggert <eggert@twinsun.com>
13423
13424 Rework code slightly to avoid gcc -Wtraditional warnings.
13425 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
13426 The returned value is now stored in *YY0. All callers changed.
13427 * src/output.c (merge_output): Adjust to the above change.
13428
0051e3ed
PE
134292003-07-26 Paul Eggert <eggert@twinsun.com>
13430
13431 * data/glr.c (YYASSERT): New macro.
13432 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
13433 yyresolveStates, yyprocessOneStack):
13434 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
13435 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 13436
137437c6
PE
134372003-07-25 Paul Eggert <eggert@twinsun.com>
13438
5b620e06
PE
13439 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
13440 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 13441 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
13442 by Frank Heckenbach, though I have omitted the structure-initialization
13443 part of his glr-knr.diff patch since I recall that the Portable
13444 C Compiler didn't require that change.
13445
137437c6
PE
13446 Let the user specify how to allocate and free memory.
13447 Derived from a suggestion by Frank Heckenbach in
161a71f3 13448 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
13449 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
13450 All uses of free, malloc, realloc changed to use these macros,
13451 and unnecessary casts removed.
13452 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
13453
ddb85ca5
PE
134542003-07-06 Matthias Mann <MatthiasMann@gmx.de>
13455
13456 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
13457 use s.empty() rather than s == "" to test for empty string; see
161a71f3 13458 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
13459 (trivial change)
13460
39910e09
AD
134612003-06-25 Akim Demaille <akim@epita.fr>
13462
13463 * config/depcomp, config/install-sh: Update from masters.
13464
0ae99356
PE
134652003-06-20 Paul Eggert <eggert@twinsun.com>
13466
13467 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
13468 and return properly parenthesized result.
13469 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
13470 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
13471 Remove unnecessary parentheses from uses.
13472 * doc/bison.texinfo (Location Default Action): Describe the
13473 conventions for parentheses.
13474
cd05d13c
PE
134752003-06-19 Paul Eggert <eggert@twinsun.com>
13476
81fd08ca
PE
13477 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
13478 yyreportTree): Do not assume that size_t is the same width as int,
13479 when printing sizes. Print sizes using an unsigned format.
13480 Problem reported by Frank Heckenbach in
161a71f3 13481 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 13482
cd05d13c
PE
13483 Port to Forte Developer 7 C compiler.
13484 * data/glr.c (struct YYLTYPE): If locations are not being used,
13485 declare a single dummy member, as empty structs do not conform
13486 to the C standard.
13487 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
13488 the Forte Developer 7 C compiler complains that end-of-loop
13489 code is not reached.
13490
4dcf140b
PE
134912003-06-17 Paul Eggert <eggert@twinsun.com>
13492
13493 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
13494 avoid warnings from picky compilers about redefinition of PARAMS.
13495
8dd76bee
PE
134962003-06-17 Paul Eggert <eggert@twinsun.com>
13497
13498 Version 1.875b.
13499
13500 * NEWS: Document 1.875b.
13501
13502 * lib/bbitset.h: Do not include config.h; that's the includer's job.
13503 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
13504 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
13505 Don't use 'index' in comments, as it's a builtin fn on some hosts.
13506 * lib/bitset_stats.c: Include gettext.h unconditionally, as
13507 per recent gettext manual's suggestion.
13508 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
13509 Use prototypes, not old-style definitions.
13510 * lib/lbitset.c (lbitset_unused_clear): Likewise.
13511 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
13512 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
13513 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
13514 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
13515 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
13516 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
13517 vbitset_or_and_cmp, vbitset_copy): Likewise.
13518
13519 * lib/libiberty.h: Do not include config.h; that's the includer's job.
13520 Do not include <stdlib.h>.
13521 (PARAMS): Define unconditionally for C89.
13522 (ATTRIBUTE_NORETURN): Remove.
13523 (ATTRIBUTE_UNUSED): Define unconditionally.
13524
13525 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 13526 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
13527 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
13528 * lib/vbitset.c, lib/vbitset.h: New files.
13529 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13530 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
13531 from libbitset.
13532
13533 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
13534 `How Can I Reset @code{yyparse}', since texinfo does not allow
13535 arbitrary @ in node names.
13536
13537 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
13538 shouldn't be needed according to the gettext 0.12.1 documentation
13539 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 13540 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 13541 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 13542 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 13543
8dd76bee
PE
13544 * lib/.cvsignore: Add stdbool.h.
13545 * m4/.cvsignore: Add nls.m4, po.m4.
13546
13547 Upgrade to CVS gnulib.
13548 * stdbool_.h: File renamed from stdbool.h.in.
13549 * configure.ac (AM_STDBOOL_H): Invoke this instead of
13550 AC_HEADER_STDBOOL.
13551 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
13552 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
13553 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
13554 (MOSTLYCLEANFILES): New var.
13555 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
13556 (stdbool.h): New rule.
13557 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
13558 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
13559 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
13560 m4/quote.m4: Upgrade to today's gnulib.
13561
13562 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
13563 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
13564 the tests right now.
13565 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
13566 yyerror are declared before use; C99 requires this.
13567
25005f6a
PH
135682003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13569
13570 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
13571 first.
13572 (yyrecoverSyntaxError): Correct the logic for setting and testing
13573 yyerrState.
13574 Correct comment on handling EOF.
13575 Allow states with only a default reduction, rather than failing
8dd76bee 13576 (I can't quite reconstruct why these were not allowed before).
25005f6a 13577
137437c6 13578 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 13579 buffer overruns, corrupting state.
8dd76bee
PE
13580
13581 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
13582 definition.
13583 * src/reader.h (max_left_semantic_context): New variable declaration.
13584 * src/scan-gram.l (max_left_semantic_context): Define.
13585 (handle_action_dollar): Update max_left_semantic_context.
13586 * data/glr.c (YYMAXLEFT): New definition.
13587 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
13588 (yyresolveAction): Ditto.
13589
13590 Fixes to problems with location handling in GLR parsers reported by
13591 Frank Heckenbach (2003/06/05).
13592
13593 * data/glr.c (YYLTYPE): Make trivial if locations not used.
13594 (YYRHSLOC): Add parentheses, and define only if locations used.
13595 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
13596 locations not used.
13597 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
13598 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 13599
25005f6a
PH
13600 * tests/cxx-type.at: Exercise location information; update tests
13601 to differentiate output with and without locations.
8dd76bee 13602 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
13603 because default YYLTYPE not yet defined.
13604 Change semantic actions to compute strings, rather than printing
13605 them directly (to test proper passing of semantics values). Change
13606 output to prefix notation and update test data and expected results.
13607 (yylex): Track locations.
13608 (stmtMerge): Return value rather than printing, and include arguments
13609 in value.
8dd76bee 13610
711f40b7
PE
136112003-06-03 Paul Eggert <eggert@twinsun.com>
13612
13613 Avoid warnings generated by GCC 2.95.4 when Bison is
13614 configured with --enable-gcc-warnings.
13615 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
13616 yy::]b4_parser_class_name[::translate_,
13617 yy::Stack::operator[] (unsigned),
13618 yy::Stack::operator[] (unsigned) const,
13619 yy::Slice::operator[] (unsigned),
13620 yy::Slice::operator[] (unsigned) const):
13621 Rename local vars to avoid warnings.
13622 * tests/glr-regression.at (Improper handling of embedded actions
13623 and $-N in GLR parsers): Remove unused local variable from yylex.
13624 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
13625 (void) as arg when not pure, since we now assume C89 when building
13626 Bison. Pacify GCC by using parameter.
13627
ac695f7d
PE
136282003-06-02 Paul Eggert <eggert@twinsun.com>
13629
13630 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
13631 yy::Location::lines, yy::Location::columns): Rename arguments
13632 to avoid shadowing; this removes a warning generated by GCC 3.3.
13633
26ec81e0
PE
136342003-06-01 Paul Eggert <eggert@twinsun.com>
13635
13636 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
13637 to g++, as GCC 3.3 complains if you do it.
13638 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
13639 everything that WARNING_CFLAGS has, except omit warnings
13640 not suitable for C++.
13641 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
13642 * tests/atlocal.in (CXXFLAGS): New var.
13643 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
13644
13645 Fix a GLR parser bug I reported in February; see
161a71f3 13646 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
13647 The problem was that GLR parsers did not conform to the C standard,
13648 because actions like { $1 = $2 + $3; } expanded to expressions
13649 that invoked YYFILL in separate subexpressions, and YYFILL assigned
13650 to a local variable. The C standard says that expressions
13651 like (var = f ()) + (var = f ()) have undefined behavior.
13652 Another problem was that GCC sometimes issues warnings that
13653 yyfill and its parameters are unused.
13654
13655 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
13656 as possibly unused.
13657 (yyfill): New function.
13658 (YYFILL): Use it.
13659 (yyuserAction): Change type of yynormal to bool, so that it matches
13660 the new yyfill signature. Mark it as possibly unused.
13661
13662
13663 Follow up on a bug I reported in February, where a Bison-generated
13664 parser can loop. Provide a test case and a fix for yacc.c. I
13665 don't have a fix for lalr1.cc or for glr.c, unfortunately.
13666 The original bug report is in:
161a71f3 13667 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
13668
13669 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
13670 macro's size was becoming unwieldy.
13671 (yyerrlab): Do not discard an empty lookahead symbol, as this
13672 might destroy garbage.
13673 (yyerrorlab): New label, with the old contents of YYERROR,
13674 plus the following change: pop the stack of rhs corresponding
13675 to the production that invoked YYERROR. That is how Yacc
13676 behaves, and POSIX requires this behavior.
13677 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
13678 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
13679 Define 'alarm' to do nothing if unistd.h is not available.
13680 Add a new rule "exp: '-' error;" to test the above change to
13681 data/yacc.c. Use 'alarm' to abort any test taking longer than
13682 10 seconds, as it's probably looping.
13683 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
13684 Also, the new yacc.c generates two fewer diagnostics for an
13685 existing test.
13686
d0829076
PE
136872003-05-24 Paul Eggert <eggert@twinsun.com>
13688
c6ae27df
PE
13689 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
13690 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
13691 This fixes a problem reported by John Bowman when the Compaq/HP
13692 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
13693 -ansi -Wall -gall).
13694 * data/yacc.c (union yyalloc): Likewise.
13695 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 13696
d0829076
PE
13697 Switch from 'int' to 'bool' where that makes sense.
13698
13699 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
13700 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
13701 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
13702 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
13703 Return or accept bool, not int. All callers changed.
13704 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
13705 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
13706 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
13707 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
13708 bitset_or_and_cmp_): Likewise.
13709 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
13710 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
13711 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
13712 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
13713 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
13714 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
13715 bitset_stats_or_and_cmp): Likewise.
13716 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
13717 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
13718 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
13719 ebitset_xor_cmp): Likewise.
13720 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
13721 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
13722 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
13723 lbitset_xor_cmp): Likewise.
13724 * lib/bbitset.h: Include <stdbool.h>.
13725 (struct bitset_vtable): The following members now return bool, not
13726 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
13727 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
13728 or_and_cmp).
13729 * src/conflicts.c (count_rr_conflicts): Likewise.
13730 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
13731 All uses changed.
13732 * lib/ebitset.c (ebitset_obstack_init): Likewise.
13733 * lib/lbitset.c (lbitset_obstack_init): Likewise.
13734 * src/getargs.c (debug_flag, defines_flag, locations_flag,
13735 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
13736 graph_flag): Likewise.
13737 * src/getargs.h (debug_flag, defines_flag, locations_flag,
13738 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
13739 graph_flag): Likewise.
13740 * src/output.c (error_verbose): Likewise.
13741 * src/output.h (error_verbose): Likewise.
13742 * src/reader.c (start_flag, typed): Likewise.
13743 * src/reader.h (typed): Likewise.
13744 * src/getargs.c (LOCATIONS_OPTION): New constant.
13745 (long_options, getargs): Use it.
13746 * src/lalr.c (build_relations): Use bool, not int.
13747 * src/nullable.c (nullable_compute): Likewise.
13748 * src/print.c (print_reductions): Likewise.
13749 * src/tables.c (action_row, pack_vector): Likewise.
13750 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
13751 * src/output.c (prepare): Use it.
13752 * src/output.c (token_definitions_output,
13753 symbol_destructors_output, symbol_destructors_output): Use string,
13754 not boolean integer, to keep track of whether to output separator.
13755 * src/print_graph.c (print_core): Likewise.
13756 * src/state.c (state_rule_lookaheads_print): Likewise.
13757
13758 * config/install-sh: Sync from automake 1.7.5.
13759
6b2584b7
PE
137602003-05-14 Paul Eggert <eggert@twinsun.com>
13761
13762 * src/parse-gram.y (rules_or_grammar_declaration): Require a
13763 semicolon after a grammar declaration, in the interest of possible
13764 future changes to the Bison input language.
13765 Do not allow a stray semicolon at the start of the grammar.
13766 (rhses.1): Allow one or more semicolons after any rule, including
13767 just before "|" as required by POSIX.
13768 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
13769 grammar.
13770
caf37a36
ADL
137712003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
13772
13773 %parse-param support for lalr1.cc.
13774
13775 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
13776 b4_cc_constructor_calls, b4_cc_constructor_call,
13777 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
13778 definitions.
13779 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
13780 parse-param arguments.
13781 (yy::b4_parser_class_name): Declare instance variables to
13782 hold parse-param arguments.
13783 * tests/calc.at: s/value/semantic_value/ because value clashes
13784 with a member of yy::b4_parser_class_name. Adjust C++ code
13785 to handle %parse-param. Enable %parse-param test in C++.
13786
3ab37077
PE
137872003-05-12 Paul Eggert <eggert@twinsun.com>
13788
13789 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
13790 English a bit. Fix fclose typo. Change "const char" to "char
13791 const", and use ANSI C rather than K&R for "main". Suggest
13792 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
13793 and suggest yy_switch_to_buffer.
13794
137952003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
13796
13797 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
13798 C89. This avoids a diagnostic on compilers that define __STDC__
13799 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 13800 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 13801
e743727f
PE
138022003-05-03 Paul Eggert <eggert@twinsun.com>
13803
13804 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
13805 Do not overrun array bounds.
13806 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 13807 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 13808
916708d5
AD
138092003-04-29 Akim Demaille <akim@epita.fr>
13810
13811 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
13812 * src/getargs.c, src/getargs.h: here, as bool, not int.
13813 (nondeterministic_parser): New.
13814 * src/parse-gram.y, src/scan-gram.l: Support
13815 %nondeterministic-parser.
13816 * src/output.c (prepare): Use nondeterministic_parser instead
13817 of glr_parser where appropriate.
13818 * src/tables.c (conflict_row, action_row, save_row)
13819 (token_actions, token_actions, pack_vector): Ditto.
13820
a06ea4aa
AD
138212003-04-29 Akim Demaille <akim@epita.fr>
13822
13823 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
13824
211074ca
AD
138252003-04-29 Akim Demaille <akim@epita.fr>
13826
13827 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
13828 with %pure-parser and %locations to exercise the patch from Yakov
13829 Markovitch below.
13830
6175ffe3
PE
138312003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
13832
13833 * data/yacc.c: (b4_lex_param): Corrected for the case where
13834 %lex-param is provided and %pure-parser isn't.
13835
b1e95857
PE
138362003-04-27 Paul Eggert <eggert@twinsun.com>
13837
13838 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 13839 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
13840 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
13841 if it is not defined.
13842 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
13843
acda9df6
PE
138442003-04-26 Paul Eggert <eggert@twinsun.com>
13845
3470c57b
PE
13846 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
13847 Declare to be of type suitable for the ninf value itself, not of
13848 type suitable for the corresponding table, since the latter might
13849 be unsigned but the ninf value might be negative. This fixes a
13850 bug reported by Alexandre Duret-Lutz in
161a71f3 13851 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 13852
acda9df6
PE
13853 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
13854 invokes it. We shouldn't invoke it twice because it will attempt
13855 to put error.o in the archive twice. This fixes a glitch reported
13856 by Martin Mokrejs in
161a71f3 13857 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 13858
b5250f26
PE
138592003-04-21 Paul Eggert <eggert@twinsun.com>
13860
13861 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
13862 to gnulib.
13863
089ac0f1
PE
138642003-04-21 Yakov Markovitch <Markovitch@iso.ru>
13865
13866 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
13867 Fix obvious typo that results in uncompilable GLR parsers
13868 when both %pure-parser and %locations are used. (trivial change)
13869
5ededac6
PE
138702003-04-17 Paul Eggert <eggert@twinsun.com>
13871
1b8f2fff
PE
13872 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
13873 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
13874 Do not insert the expected token via unput, as this runs afoul
13875 of a POSIX-compatibility bug in flex 2.5.31.
13876 All uses changed to BEGIN the parent state,
13877 since we no longer insert the expected token via unput.
13878 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
13879 that is no longer emitted after the above change.
13880
5ededac6
PE
13881 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
13882 the first one. This change is from Paul Hilfinger, and it fixes
13883 regression reported by Werner Lemberg in
161a71f3 13884 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
13885
13886 (resolve_sr_conflict): Don't invoke state_errs_set
13887 unless one or more tokens have been explicitly made errors.
13888 Otherwise, the above change causes Bison to abort.
13889
13890 * tests/existing.at (GNU pic Grammar): New test case, taken from
13891 Lemberg's email.
13892
b8be9132
AD
138932003-03-31 Akim Demaille <akim@epita.fr>
13894
13895 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
13896
d423d460
AD
138972003-03-31 Akim Demaille <akim@epita.fr>
13898
13899 * src/output.c (prepare_symbols): Avoid trailing spaces in the
13900 output.
13901
c7e441b4
AD
139022003-03-31 Akim Demaille <akim@epita.fr>
13903
13904 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
13905 From Paul Hilfinger.
13906
231897ad
AD
139072003-03-29 Akim Demaille <akim@epita.fr>
13908
13909 * m4/error.m4: Do not put under dynamic conditions some code which
13910 expansion is under static control.
13911
5b066063
AD
139122003-03-29 Akim Demaille <akim@epita.fr>
13913
13914 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
13915
22a74fec
AD
139162003-03-29 Akim Demaille <akim@epita.fr>
13917
13918 * doc/bison.texinfo (Strings are Destroyed): New.
13919
0eee27e7
PE
139202003-03-13 Paul Eggert <eggert@twinsun.com>
13921
13922 * .cvsignore: Add configure.lineno.
13923 * src/.cvsignore: Add yacc.
13924 * tests/.cvsignore: Add testsuite.log.
13925 * doc/fdl.texi: Sync with latest FSF version.
13926
f61aad93
PE
139272003-03-12 Paul Eggert <eggert@twinsun.com>
13928
537636c7
PE
13929 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
13930 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
13931 cursor, instead of leaving it undefined. This fixes a bug
13932 reported by Tim Van Holder in
161a71f3 13933 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
13934 * tests/input.at (Torturing the Scanner): Test the scanner on
13935 an empty input file, which was Tim Van Holder's test case.
13936
13937 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
13938 <sys/resource.h> can be included, include sys/time.h and
13939 sys/times.h first, if available. This works around the SunOS
13940 4.1.4 porting bug reported by Bruce Becker in
161a71f3 13941 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
13942
13943 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
13944 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
13945 AC_HEADER_SYS_WAIT.
13946
f61aad93
PE
13947 Merge changes from gnulib. This was prompted because the CVS
13948 snapshot didn't build on Solaris 7 due to strnlen problems.
13949
13950 These changes need to be merged back into gnulib:
13951 * lib/hash.c: Include <stdbool.h> unconditionally.
13952 * m4/onceonly.m4 (m4_quote): New macro.
13953 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
13954 Quote AC_FOREACH variable-expansions properly.
13955 The 2003-01-03 obstack.h change also needs merging.
13956 {end of changes requiring merging}
5b066063 13957
f61aad93
PE
13958 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13959 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
13960 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
13961 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
13962 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
13963 New files, imported from gnulib.
13964 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
13965 above.
13966
13967 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
13968 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
13969 gnulib sources.
13970
13971 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
13972 Add.
13973 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
13974 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
13975 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
13976 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
13977 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
13978 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
13979 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
13980 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
13981 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
13982 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
13983 (jm_PREREQ_ARGMATCH): Remove.
13984 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
13985 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
13986
13987 * src/system.h: Include <stdbool.h> unconditionally.
13988
13989 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
13990 assuming at least C89 in the bitset code for some time now.
13991
d2ffe116
AD
139922003-03-03 Akim Demaille <akim@epita.fr>
13993
13994 * ro.po: New.
13995
052826fd
AD
139962003-03-02 Akim Demaille <akim@epita.fr>
13997
13998 * doc/bison.texinfo (Table of Symbols): Reactivate the
13999 documentation for %lex-param, and %parse-param.
14000
c4749565
AD
140012003-03-02 Akim Demaille <akim@epita.fr>
14002
14003 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
14004 generate verbose error messages.
14005 Use the number of tokens as an upper bound in yytname, as it
14006 cannot be a non terminal.
14007
d5286af1
AD
140082003-03-02 Akim Demaille <akim@epita.fr>
14009
14010 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
14011 message.
14012
22e304a6
AD
140132003-03-02 Akim Demaille <akim@epita.fr>
14014
22e304a6
AD
14015 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
14016 Use them to exercise yycheck overrun.
14017 Based on Andrew Suffield's grammar.
14018
67a25fed
AD
140192003-03-02 Akim Demaille <akim@epita.fr>
14020
14021 Create tests/local.at for Bison generic testing macros.
14022
14023 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
14024 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
14025 This new file.
14026 * tests/calc.at (AT_CHECK_CALC): Adjust.
14027 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
14028 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
14029 * tests/local.at: here.
14030 (AT_COMPILE_CXX): Tags the tests using it as c++.
14031 Ignore the test if CXX is not functional.
14032
9c2b381f
PE
140332003-03-01 Paul Eggert <eggert@twinsun.com>
14034
14035 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
14036 not loc->end, since loc->end might contain garbage and this leads
14037 to undefined behavior on some platforms.
14038 (id_loc, token_start): Use (IF_LINTed) initial values that do not
14039 depend on *loc, so that the reader doesn't give the the false
14040 impression that *loc is initialized.
14041 (<INITIAL>"%%"): Do not bother setting code_start, since its value
14042 does not survive the return.
14043
0433ba88
AD
140442003-03-01 Akim Demaille <akim@epita.fr>
14045
14046 * src/scan-gram.l (code_start): Always initialize it when entering
14047 into yylex, as SC_EPILOGUE is activated *before* the corresponding
14048 yylex invocation. An alternative would be making it static, but
14049 then it starts with the second %%'s beginning, instead of its end.
14050
b305ea69
PE
140512003-02-28 Paul Eggert <eggert@twinsun.com>
14052
14053 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
14054 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 14055 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 14056
c3d25e01
PE
140572003-02-26 Paul Eggert <eggert@twinsun.com>
14058
14059 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
14060 Remove Sequent/Pyramid discussion (nobody uses them any more).
14061 Merge VMS and MS-DOS discussion; these ports may well be dead
14062 but let's keep mentioning them for now. Put <> around email
14063 addresses. Add copyright notice.
14064
c267ffbc
PE
140652003-02-24 Paul Eggert <eggert@twinsun.com>
14066
14067 * data/glr.c (yy_reduce_print): yylineno -> yylno,
14068 to avoid collision with flex use of yylineno.
14069 Problem reported by Bruce Lilly in
161a71f3 14070 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
14071 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
14072 * data/yacc.c (yy_reduce_print): Likewise.
14073
14074 * config/depcomp: Sync with Automake 1.7.3.
14075
f939fc12
AD
140762003-02-21 Akim Demaille <akim@epita.fr>
14077
14078 * data/lalr1.cc: Use temporary variables instead of casts to
14079 change integer types.
14080 Suggested by Paul Eggert.
14081
95923bd6
AD
140822003-02-21 Akim Demaille <akim@epita.fr>
14083
14084 * doc/bison.texinfo: Use "location" consistently to refer to @n,
14085 to avoid confusions with lalr1.cc's notion of Position.
14086 Suggested by Paul Eggert.
14087
2cdc240e
AD
140882003-02-20 Akim Demaille <akim@epita.fr>
14089
14090 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
14091 before initial_columns.
14092 (location.hh): Use consistent variable names when defining the
14093 operator<<.
14094 Use "last" so that we subtract from Positions, not from unsigned.
14095
5d003116
AD
140962003-02-20 Akim Demaille <akim@epita.fr>
14097
14098 * data/lalr1.cc (position.hh): New subfile, including the extended
14099 and Doxygen'ed documentation of class Position.
14100 (location.hh): Use it.
14101 Document a` la Doxygen.
ba1ecc07 14102 With the help of Benoit Perrot.
5d003116 14103
d02b25f9
AD
141042003-02-20 Akim Demaille <akim@epita.fr>
14105
14106 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
14107 AT_YACC_IF.
14108 Redefine AT_YYERROR_SEES_LOC_IF using it.
14109 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
14110 not defined.
14111 Don't use the location in yy::Parser::error_ and
14112 yy::Parser::print_ when not %locations.
14113 Activate more lalr1.cc tests.
14114
0d1c3a04
AD
141152003-02-19 Akim Demaille <akim@epita.fr>
14116
14117 * data/lalr1.cc: When displaying a line number, be sure to make it
14118 an int.
14119
60a777aa
AD
141202003-02-19 Akim Demaille <akim@epita.fr>
14121
14122 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
14123 Remove, useless.
14124 (YYABORT, YYACCEPT, YYERROR): New.
14125 * tests/calc.at: Renable the lalr1.cc test.
14126
0b86fc41
AD
141272003-02-19 Akim Demaille <akim@epita.fr>
14128
14129 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
14130 error recovery, mixing with/without pops and discarding of the
14131 lookahead.
14132 Exercise YYERROR.
14133 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
14134
da99a5dc
PE
141352003-02-17 Paul Eggert <eggert@twinsun.com>
14136
14137 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
14138 * tests/testsuite.at (AT_COMPILE): Use them.
14139 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 14140 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 14141
93b8c255
PE
141422003-02-12 Paul Eggert <eggert@twinsun.com>
14143
14144 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
14145 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 14146 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
14147 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
14148 Check for malloc failure, for consistency with yacc.c.
14149 (yytname_size): Remove, for consistency with yacc.c.
14150
14151 The bug still remains in data/lalr1.cc, as I didn't have time
14152 to fix it there.
14153
7548fed2
AD
141542003-02-06 Akim Demaille <akim@epita.fr>
14155
14156 * configure.ac (GXX): Rename as...
14157 (CXX): this, to keep the original Autoconf semantics.
14158 Require 2.57.
14159 * data/lalr1.cc: Fix b4_copyright invocations.
14160 If YYDEBUG is not defined, don't depend upon name_ being defined.
14161 (location.hh): Include string and iostream.
14162 (Position::filename): New member.
14163 (Position::Position ()): New.
14164 (operator<< (Position)): New.
14165 (operator- (Position, int)): New.
14166 (Location::first, Location::last): Rename as...
14167 (Location::begin, Location::end): these, to mock the conventional
14168 iterator names.
14169 (operator<< (Location)): New.
14170 * tests/atlocal.in (CXX): New.
14171 * tests/testsuite.at (AT_COMPILE_CXX): New.
14172 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
14173 locations in a more synthetic way.
14174 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
14175 lalr1.cc is used.
14176 Adjust the C locations to match those from Emacs: first column is
14177 column 0.
14178 Change all the expected results.
14179 Conform to the GCS: simplify the locations when applicable.
14180 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
14181 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
14182 these CPP macros with the m4 macros new defined by...
14183 (AT_CHECK_PUSHDEFS): this, i.e.:
14184 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 14185 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
14186 New macros.
14187 (AT_CHECK_POPDEFS): Undefine them.
14188 (AT_CHECK_CALC_LALR1_CC): New.
14189 Use it for the first lalr1.cc test.
14190
43a176ef
AD
141912003-02-04 Akim Demaille <akim@epita.fr>
14192
14193 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
14194 Location as is defined.
14195
fc049e9c
AD
141962003-02-04 Akim Demaille <akim@epita.fr>
14197
14198 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
14199 name_ being defined.
14200
a737b216
PE
142012003-02-03 Paul Eggert <eggert@twinsun.com>
14202
14203 * src/gram.h (start_symbol): Remove unused decl.
14204
14205 Use more-consistent naming conventions for local vars.
14206
14207 * src/derives.c (derives_compute): Change type of local var from
14208 int to rule_number.
14209 * src/gram.c (grammar_rules_partial_print): Likewise.
14210 * src/print.c (print_core): Likewise.
14211 * src/reduce.c (reduce_grammar_tables): Likewise.
14212
14213 * src/gram.c (grammar_dump): Change name of item_number *
14214 local var from r to rp.
14215 * src/nullable.c (nullable_compute): Likewise.
14216
14217 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
14218
14219 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
14220 for symbol or symbol_number var.
14221 * src/reader.c (grammar_start_symbol_set): Likewise.
14222 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
14223 Likewise.
14224 * src/state.c (transitions_to): Likewise.
14225 * src/state.h: Likewise.
14226 * src/tables.c (symbol_number_to_vector_number): Likewise.
14227
14228 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
14229 char * var.
14230
14231 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
14232 var.
14233
14234 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
14235 var.
14236
14237 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
14238 Use str, not s, for char * var. Use ch, not c, for character var.
14239 Use size for size var.
14240
14241 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
14242 char * var.
14243 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
14244 uniqstr var.
14245 * src/uniqstr.h: Likewise.
14246
14247 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
14248 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
14249 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
14250 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
14251 param to have same name as that of enum, so that we don't use
14252 "s" to stand for a non-state.
14253
68e93ad5
AD
142542003-02-02 Akim Demaille <akim@epita.fr>
14255
14256 * src/scan-skel.l: Scan more than one inert character per yylex
14257 invocation.
14258
92898986
PE
142592003-02-01 Paul Eggert <eggert@twinsun.com>
14260
14261 Version 1.875a.
14262
1d9d5d71
PE
14263 * po/LINGUAS: Add ms.
14264
0435d061
AD
142652003-01-30 Akim Demaille <akim@epita.fr>
14266
14267 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
14268
6029a57f
PH
142692003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14270
14271 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
14272 of $1.
0435d061
AD
14273
14274 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 14275 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 14276 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 14277
6029a57f
PH
14278 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
14279 (b4_rhs_location): Ditto.
0435d061 14280 (yyfill): New function to copy from stack tree into array
6029a57f 14281 incrementally.
0435d061
AD
14282 (yyuserAction): Modify to allow incremental move of semantic values
14283 to rhs array when in GLR mode.
14284 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
14285 as needed.
14286 Remove dummy use of yystack, as there is now a guaranteed use.
14287 (yydoAction): Modify to allow incremental move of semantic values
14288 to rhs array when in GLR mode.
14289 (yyresolveAction): Ditto.
14290 (yyglrShiftDefer): Update comment.
0435d061 14291 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
14292 (yyglrReduce): Ditto.
14293 (yydoAction): Ditto
0435d061 14294
6029a57f
PH
14295 * tests/glr-regr1.at: Rename to ...
14296 * tests/glr-regression.at: Add new regression test for the problems
14297 described above (adapted from S. Eken).
14298 Update copyright notice.
14299 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
14300 * tests/Makefile.am: Ditto.
14301
6cee6297
PE
143022003-01-28 Paul Eggert <eggert@twinsun.com>
14303
14304 * data/lalr1.cc: Do not use @output_header_name@ unless
14305 b4_defines_flag is set. This fixes two bugs reported by
14306 Tim Van Holder in
161a71f3
PE
14307 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
14308 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 14309
b2a836b5
PE
143102003-01-21 Paul Eggert <eggert@twinsun.com>
14311
14312 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
14313 we don't need to worry about yyerrlab1 being reported as an
14314 "unused label" by non-GCC C compilers. The downside is that if
14315 locations are used then a couple of statements are duplicated each
14316 time YYERROR is invoked, but the upside is that the warnings
14317 should vanish.
14318 (yyerrlab1): Move code to YERROR.
14319 (yyerrlab2): Remove. Change uses back to yyerrlab1.
14320 This reverts some of the 2002-12-27 change.
14321
4196b931
PE
143222003-01-17 Paul Eggert <eggert@twinsun.com>
14323
14324 * src/output.c (symbol_printers_output): Fix typo that led
14325 to core dump. Problem reported by Antonio Rus in
161a71f3 14326 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 14327
3ae831b4
AD
143282003-01-13 Akim Demaille <akim@epita.fr>,
14329 Quoc Peyrot <chojin@lrde.epita.fr>,
14330 Robert Anisko <anisko_r@lrde.epita.fr>
14331
14332 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
14333 when the stacks contain one element, as the loop would otherwise
14334 free the last state, and then use the top state (the one we just
14335 popped). This means that the initial elements will not be freed
14336 explicitly, as is the case in yacc.c; it is not a problem, as
14337 these elements have fake values.
14338
e3aa65c5
PE
143392003-01-11 Paul Eggert <eggert@twinsun.com>
14340
14341 * NEWS: %expect-violations are now just warnings, reverting
14342 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
14343 bootstrapping problem reported by Matthias Klose; see
161a71f3 14344 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
14345 * src/conflicts.c (conflicts_print): Likewise.
14346 * tests/conflicts.at (%expect not enough, %expect too much,
14347 %expect with reduce conflicts): Likewise.
14348 * doc/bison.texinfo (Expect Decl): Document this. Also mention
14349 that the warning is enabled if the number of conflicts changes
14350 (not necessarily increases).
14351
14352 * src/getargs.c (version): Update copyright year.
14353
f0057011
AD
143542003-01-09 Akim Demaille <akim@epita.fr>
14355
14356 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
14357
1ee6d2a0
PE
143582003-01-08 Paul Eggert <eggert@twinsun.com>
14359
14360 * Makefile.maint (WGETFLAGS):
14361 New macro, containing "-C off" to disable proxy caches.
14362 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
14363 (rel-check): Use $(WGET) instead of wget.
14364
d4fd77c4
PE
143652003-01-06 Paul Eggert <eggert@twinsun.com>
14366
14367 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
14368 the GLR paper of Scott, Johnstone and Hussain.
14369
464c6927
PE
143702003-01-04 Paul Eggert <eggert@twinsun.com>
14371
d600ee67
PE
14372 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
14373 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
14374 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
14375 (EXTRA_LIBRARIES): New var, for liby.a.
14376 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
14377 (EXTRA_SCRIPTS): New var, for yacc.
14378
464c6927
PE
14379 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
14380 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
14381 Problem reported by Nelson H. F. Beebe.
14382
143832003-01-03 Paul Eggert <eggert@twinsun.com>
14384
14385 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
14386 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
14387 when compiling Bison 1.875's `bitset bset = obstack_alloc
14388 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
14389
14390 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
14391 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
14392 grow to a huge size with typical invocation.
d600ee67 14393
464c6927
PE
14394 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
14395 Use the pattern recommended by Autoconf 2.57, except also protect
14396 against double-definition.
14397 * src/system.h: Likewise.
14398 Portability issues reported by Nelson H. F. Beebe.
d600ee67 14399
464c6927
PE
14400 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
14401 All uses changed. Provide a definition in both C and C++.
14402 (yytrue, yyfalse): Define even if defined (__cplusplus).
14403
14404 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
14405 Reported by Nelson H. F. Beebe.
d600ee67 14406
464c6927
PE
14407 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
14408
0f42c7d5
PE
144092003-01-02 Paul Eggert <eggert@twinsun.com>
14410
14411 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
14412 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
14413 Bug reported by Nelson H. F. Beebe.
14414
dc546b0f
PE
144152003-01-01 Paul Eggert <eggert@twinsun.com>
14416
14417 * Version 1.875.
14418
2c09b6a7
PE
144192002-12-30 Paul Eggert <eggert@twinsun.com>
14420
14421 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
14422 Moved here from...
14423 (<INITIAL>","): Here. This causes stray "," to be treated
14424 more uniformly.
14425
dc546b0f 14426 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
14427 last brace in braced code when not in Yacc mode, for compatibility
14428 with Bison 1.35. This resurrects the 2001-12-15 patch to
14429 src/reader.c.
14430
14431 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
14432 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
14433
535c0f63
PE
144342002-12-28 Paul Eggert <eggert@twinsun.com>
14435
14436 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
14437 that of SYM's type. This fixes Debian bug 168069, reported by
14438 Thomas Olsson.
d600ee67 14439
963fcc17
PE
144402002-12-28 Paul Eggert <eggert@twinsun.com>
14441
14442 Version 1.75f.
14443
14444 Switch back to the Yacc style of conflict reports, undoing some
14445 of the 2002-07-30 change.
14446 * doc/bison.texinfo (Understanding): Use Yacc style for
14447 conflict reports. Also, use new way of locating rules.
14448 * src/conflicts.c (conflict_report):
14449 Renamed from conflict_report_yacc, removing the old
14450 'conflict_report'. Translate the entire conflict report at once,
14451 so that we don't assume that "," has the same interpretation in
14452 all languages.
14453 (conflicts_output): Use Yacc-style conflict report for each state,
14454 instead of our more-complicated style.
14455 (conflicts_print): Use Yacc-style conflict report, except print
14456 the input file name when not emulating Yacc.
14457 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
14458 Conflicted Reduction, %expect not enough, %expect too much,
14459 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
14460 * tests/existing.at (GNU Cim Grammar): Likewise.
14461 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
14462
14463 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
14464 fatal): Don't invoke fflush; it's not needed and it might even be
14465 harmful for stdout, as stdout might not be open.
14466 * src/reduce.c (reduce_print): Likewise.
14467
b1efe548
PE
144682002-12-27 Paul Eggert <eggert@twinsun.com>
14469
14470 Fix a bug where error locations were not being recorded correctly.
14471 This problem was originally reported by Paul Hilfinger in
161a71f3 14472 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
14473
14474 * data/yacc.c (yyparse): New local var yylerrsp, to record the
14475 top of the location stack's error locations.
14476 (yyerrlab): Set it. When discarding a token, push its location
14477 onto yylerrsp so that we don't lose track of the error's end.
14478 (yyerrlab1): Now is only the target of YYERROR, so that we can
14479 properly record the location of the action that failed. For GCC
14480 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
14481 GCC warning about yyerrlab1 being unused if YYERROR is unused.
14482 (yyerrlab2): New label, which yyerrlab now falls through to.
14483 Compute the error's location by applying YYLLOC_DEFAULT to
14484 the locations of all the symbols that went into the error.
14485 * doc/bison.texinfo (Location Default Action): Mention that
14486 YYLLOC_DEFAULT is also invoked for syntax errors.
14487 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
14488 Error locations include the locations of all the tokens that were
14489 discarded, not just the last token.
d600ee67 14490
983c5c2c
PE
144912002-12-26 Paul Eggert <eggert@twinsun.com>
14492
b1efe548
PE
14493 * src/files.c: Include quote.h.
14494 (compute_output_file_names): Warn if we detect conflicting
14495 outputs to the same file. This should catch the misunderstanding
14496 exemplified by Debian Bug 165349, reported by Bruce Stephens..
14497
14498 * src/conflicts.c (conflicts_print): If the user specifies
14499 "%expect N", report an error if there are any reduce/reduce
14500 conflicts. This is what the manual says should happen.
14501 This fixes Debian bug 130890, reported by Anthony DeRobertis.
14502 * tests/conflicts.at (%expect with reduce conflicts): New test.
14503
983c5c2c
PE
14504 Don't use m4_include on relative file names, as it doesn't work as
14505 desired if there happens to be a file with that name under ".".
d600ee67 14506
983c5c2c
PE
14507 * m4sugar/version.m4: Remove; it was included but it wasn't used.
14508 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
14509 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
14510 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
14511 * src/output.c (output_skeleton): Use full path names when
14512 specifying a file to include; don't rely on include path, as
14513 it's unreliable when the working file contains a file with
14514 that name.
d600ee67 14515
983c5c2c
PE
145162002-12-25 Paul Eggert <eggert@twinsun.com>
14517
14518 Remove obsolete references to bison.simple and bison.hairy.
14519 Problem mentioned by Aubin Mahe in
161a71f3 14520 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
14521 * data/glr.c: Comment fix.
14522 * doc/bison.1: Remove references. Also, mention "yacc".
14523
14524 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
14525 with -g option.
14526
14527 * src/parse-gram.y (declaration): Use enum "report_states" rather
14528 than its numeric value 1.
14529
14530 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
14531 opening a new one. This fixes Debian bug 165349, reported by
14532 Bruce Stephens.
14533
23f2d9dc
PE
145342002-12-24 Paul Eggert <eggert@twinsun.com>
14535
14536 Version 1.75e.
14537
14538 * Makefile.maint (cvs-update): Don't assume that the shell
14539 supports $(...), as Solaris sh doesn't.
14540
14541 * src/parse-gram.y (lloc_default): Remove test for empty
14542 nonterminals at the end, since it didn't change the result.
14543
145442002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
14545
14546 If the user does not define YYSTYPE as a macro, Bison now declares it
14547 using typedef instead of defining it as a macro. POSIX requires this.
14548 For consistency, YYLTYPE is also declared instead of defined.
14549
14550 %union directives can now have a tag before the `{', e.g., the
14551 directive `%union foo {...}' now generates the C code
14552 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
14553 The default union tag is `YYSTYPE', for compatibility with Solaris 9
14554 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
14555 instead of `yyltype'.
14556
14557 `yystype' and `yyltype' are now obsolescent macros instead of being
14558 typedefs or tags; they are no longer documented and will be
14559 withdrawn in a future release.
14560
14561 * data/glr.c (b4_location_type): Remove.
14562 (YYSTYPE): Renamed from yystype.
14563 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
14564 (struct YYLTYPE): Renamed from struct yyltype.
14565 (YYLTYPE): Renamed from yyltype.
14566 (yyltype, yystype): New (and obsolescent) macros,
14567 for backward compatibility.
14568 * data/yacc.c: Likewise.
14569
14570 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
14571 does not specify a union tag. This is for compatibility with
14572 Solaris 9 yacc.
14573
14574 * src/parse-gram.y (add_param): 2nd arg is now char * not char
14575 const *, since it is now modified by stripping surrounding { }.
14576 (current_braced_code): Remove.
14577 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
14578 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
14579 trailing " {...}". Now of type <chars>.
14580 (grammar_declaration): Adjust to bundled tokens.
14581 (code_content): Remove; stripping is now done by add_param.
14582 (print_token_value): Print contents of bundled tokens.
14583 (token_name): New function.
14584
14585 * src/reader.h (braced_code, current_braced_code): Remove.
14586 (token_name): New decl.
14587
14588 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
14589 token_type, not braced_code code_kind. All uses changed.
14590 (SC_PRE_CODE): New state, for scanning after a keyword that
14591 has (or usually has) an immediately-following braced code.
14592 (token_type): New local var, to keep track of which token type
14593 to return when scanning braced code.
14594 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 14595 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
14596 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
14597 instead of returning a token type immediately.
14598 (<INITIAL>"{"): Set token type.
14599 (<SC_BRACED_CODE>"}"): Use it.
14600 (handle_action_dollar, handle_action_at): Now returns bool
14601 indicating success. Fail if ! current_rule; this prevents a core dump.
14602 (handle_symbol_code_dollar, handle_symbol_code_at):
14603 Remove; merge body into caller.
14604 (handle_dollar, handle_at): Complain in invalid contexts.
14605
14606 * NEWS, doc/bison.texinfo: Document the above.
14607 * NEWS: Fix years and program names in copyright notice.
14608
879ca4f8
PE
146092002-12-17 Paul Eggert <eggert@twinsun.com>
14610
14611 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
14612 Reporting, Table of Symbols): Omit mentions of %lex-param and
14613 %parse-param from the documentation for now.
14614
1c5fe69d
PE
146152002-12-15 Paul Eggert <eggert@twinsun.com>
14616
14617 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
14618 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
14619 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
14620 disagreed with the Bison documentation. Bug
14621 reported by Andrew Walrond.
d600ee67 14622
1c5fe69d
PE
14623 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
14624 as the caller now does that.
14625 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
14626 (YYEMPTY): Parenthesize right hand side, since others use it.
14627 (yyparse): Don't assume that our generated code is the only code
14628 that sets yychar.
14629
d1de5372
PE
146302002-12-13 Paul Eggert <eggert@twinsun.com>
14631
14632 Version 1.75d.
14633
14634 POSIX requires a "yacc" command.
14635 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
14636 (MOSTLYCLEANFILES): Add yacc.
14637 (yacc): New rule.
1c5fe69d 14638 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
14639 as an alias for bison y.
14640
14641 * po/LINGUAS: Add da.
d600ee67 14642
d1de5372
PE
14643 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
14644 problem with latest <getopt.h>.
14645 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
14646
14647 * doc/fdl.texi: Upgrade to 1.2.
14648 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
14649 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
14650 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
14651 gnulib.
14652 * config/install-sh: Sync with autotools.
14653
14654 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 14655 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
14656 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
14657 locations are requested.
14658 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
14659 locations are requested.
14660
d0f3fe23
PE
146612002-12-12 Paul Eggert <eggert@twinsun.com>
14662
14663 Remove unportable casts and storage allocation tricks.
14664 While we're at it, remove almost all casts, since they
14665 usually aren't needed and are a sign of trouble.
14666
14667 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
14668
14669 * src/derives.c (derives_compute): Do not subtract NTOKENS from
14670 the pointer DSET returned by malloc; this isn't portable.
14671 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
14672 Similarly for DERIVES.
14673 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
14674 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
14675 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
14676
14677 * src/derives.c (derives_compute): Do not bother invoking
14678 int_of_rule_number, since rule numbers are integers.
14679
14680 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
14681 rather than XMALLOC (char, N).
14682
14683 * src/files.c (filename_split): Rewrite to avoid cast.
14684
14685 * src/gram.h (symbol_number_as_item_number,
14686 item_number_as_symbol_number, rule_number_as_item_number,
14687 item_number_as_rule_number):
14688 Now inline functions rather than macros, to avoid casts.
14689 * src/state.h (state_number_as_int): Likewise.
14690 * src/tables.c (state_number_to_vector_number,
14691 symbol_number_to_vector_number): Likewise.
14692
14693 * src/gram.h (int_of_rule_number): Remove; no longer used.
14694
14695 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
14696 since the resulting storage is always stored into.
14697
14698 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
14699 where it's needed.
14700
14701 * src/muscle_tab.c (muscle_m4_output):
14702 Now inline. Return bool, not int.
14703 * src/state.c (state_compare): Likewise.
14704 * src/symtab.c (symbol_check_defined,
14705 symbol_check_alias_consistency, symbol_pack, symbol_translation,
14706 hash_compare_symbol, hash_symbol):
14707 Likewise.
14708 * src/uniqstr.c (uniqstr_print): Likewise.
14709 * src/muscle_tab.c (muscle_m4_output_processor):
14710 New function, to avoid casts.
14711 * src/state.c (state_comparator, stage_hasher): Likewise.
14712 * src/symtab.c (symbol_check_defined_processor,
14713 symbol_check_alias_consistency_processor, symbol_pack_processor,
14714 symbol_translation_processor, hash_symbol_comparator,
14715 hash_symbol_hasher): Likewise.
14716 * src/uniqstr.c (uniqstr_print_processor): Likewise.
14717 * src/muscle_tab.c (muscles_m4_output):
14718 Use new functions instead of casting old functions unportably.
14719 * src/state.c (state_hash_new): Likewise.
14720 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
14721 symbols_token_translations_init):
14722 Likewise.
14723 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
14724
14725 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
14726 var instead of casting to long, to avoid casts.
14727 (prepare_states): Use MALLOC rather than alloca, so that we don't
14728 have to worry about alloca.
14729 * src/state.c (state_hash_lookup): Likewise.
14730
14731 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
14732 local var instead of casting to unsigned char, to avoid casts.
14733
14734 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
14735 STATE_ALLOC): Remove.
14736 (transitions_new, errs_new, reductions_new, state_new): Use malloc
14737 rather than calloc, and use offsetof to avoid allocating slightly
14738 too much storage.
14739 (state_new): Initialize all members.
14740
14741 * src/state.c (state_hash): Use unsigned accumulator, not signed.
14742
14743 * src/symtab.c (symbol_free): Remove; unused.
14744 (symbol_get): Remove cast in lhs of assignment.
14745 (symbols_do): Now static. Accept generic arguments, not
14746 hashing-related ones.
14747
14748 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
14749 (symbol_processor): Remove.
14750 (symbols_do): Remove decl; now static.
14751
14752 * src/system.h (alloca): Remove; decl no longer needed.
14753 (<stddef.h>): Include, for offsetof.
14754 (<inttypes.>, <stdint.h>): Include if available.
14755 (uintptr_t): New type, if system lacks it.
14756 (CALLOC, MALLOC, REALLOC): New macros.
14757 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
14758 new macros.
14759
14760 * src/tables.c (table_size): Now int, to pacify GCC.
14761 (table_grow, table_ninf_remap): Use signed table size.
14762 (save_row): Don't bother initializing locals when not needed.
14763 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
14764 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
14765
14766 * src/vcg.h: Correct misspellings.
14767
14768 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
14769
14770
14771 * src/getargs.c (getargs): Don't assume EOF == -1.
14772
26b4a969
PE
147732002-12-09 Paul Eggert <eggert@twinsun.com>
14774
14775 Change identifier spellings to avoid collisions with names
14776 that are reserved by POSIX.
14777
14778 Don't use names ending in _t, since POSIX reserves them.
14779 For consistency, remove _e and _s endings -- they're weren't
14780 needed to remove ambiguity. All uses changed.
14781 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
14782 turn was just renamed from struniq_t.
14783 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
14784 which in turn was just renamed from struniq_processor_t.
14785 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
14786 in turn was renamed from hash_compare_struniq_t.
14787 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
14788 (state_list): Renamed from state_list_t.
14789 * src/assoc.h (assoc): Renamed from assoc_t.
14790 * src/conflicts.c (enum conflict_resolution): Renamed from
14791 enum conflict_resolution_e.
14792 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
14793 (rule_list): Renamed from rule_list_t.
14794 * src/getargs.h (enum trace): Renamed from enum trace_e.
14795 (enum report): Renamed from enum report_e.
14796 * src/gram.h (item_number): Renamed from item_number_t.
14797 (rule_number): Renamed from rule_number_t.
14798 (struct rule_s): Remove the "rule_s" part; not used.
14799 (rule): Renamed from rule_t.
14800 (rule_filter): Renamed from rule_filter_t.
14801 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
14802 (goto_list): Renamed from goto_list_t.
14803 * src/lalr.h (goto_number): Renamed from goto_number_t.
14804 * src/location.h (location): Renamed from location_t.
14805 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
14806 and moved here from:
14807 * src/muscle_tab.h (muscle_entry_t): here.
14808 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
14809 (rule_list): Renamed from rule_list_t.
14810 * src/print_graph.c (static_graph): Renamed from graph.
14811 * src/reader.h (braced_code): Renamed from braced_code_t.
14812 Remove brace_code_e tag.
14813 * src/relation.h (relation_node): Renamed from relation_node_t.
14814 (relation_nodes): Renamed from relation_nodes_t.
14815 (relation): Renamed from relation_t.
14816 * src/state.h (state_number): Renamed from state_number_t.
14817 (struct state): Renamed from struct state_s.
14818 (state): Renamed from state_t.
14819 (transitions): Renamed from transitions_t. Unused (and
14820 misspelled) transtion_s tag removed.
14821 (errs): Renamed from errs_t. Unused errs_s tag removed.
14822 (reductions): Renamed from reductions_t. Unused tag
14823 reductions_s removed.
14824 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
14825 (struct symbol_list): Renamed from struct symbol_list_s.
14826 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
14827 (struct symbol): Renamed from struct symbol_s.
14828 (symbol): Renamed from symbol_t.
14829 * src/tables.c (vector_number): Renamed from vector_number_t.
14830 (action_number): Renamed from action_t.
14831 * src/tables.h (base_number): Renamed from base_t.
14832 * src/vcg.h (enum color): Renamed from enum color_e.
14833 (enum textmode): Renamed from enum textmode_e.
14834 (enum shape): Renamed from enum shape_e.
14835 (struct colorentry): Renamed from struct colorentry_s.
14836 (struct classname): Renamed from struct classname_s.
14837 (struct infoname): Renamed from struct infoname_s.
14838 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
14839 (enum decision): Renamed from enum decision_e.
14840 (enum orientation): Renamed from enum orientation_e.
14841 (enum alignment): Renamed from enum alignment_e.
14842 (enum arrow_mode): Renamed from enum arrow_mode_e.
14843 (enum crossing_type): Renamed from enum crossing_type_e.
14844 (enum view): Renamed from enum view_e.
14845 (struct node): Renamed from struct node_s.
14846 (node): Renamed from node_t.
14847 (enum linestyle): Renamed from enum linestyle_e.
14848 (enum arrowstyle): Renamed from enum arrowstyle_e.
14849 (struct edge): Renamed from struct edge.
14850 (edge): Renamed from edge_t.
14851 (struct graph): Renamed from struct graph_s.
14852 (graph): Renamed from graph_t.
14853 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
14854 Rename value_t -> value.
14855 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
14856 value_t_as_yystype -> value_as_yystype.
14857
14858 Don't include <errno.h> in the mainstream code, since it
14859 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
14860 * lib/get-errno.c, lib/get-errno.h: New files.
14861 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
14862 get-errno.c.
14863 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
14864 * src/output.c (output_skeleton): Likewise.
14865 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
14866 instead of errno.
14867 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
14868 Likewise.
14869 (handle_action_dollar, handle_action_at): Likewise.
14870 * src/system.h: Do not include <errno.h>.
14871 (TAB_EXT): Renamed from EXT_TAB.
14872 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
14873
14874 Avoid str[a-z]*, since <string.h> reserves that name space.
14875 Change all instances of "struniq" in names to "uniqstr", and
14876 likewise for "STRUNIQ" and "UNIQSTR".
14877 * src/uniqstr.c: Renamed from src/struniq.c.
14878 * src/uniqstr.h: Renamed from src/struniq.h.
14879 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
14880 * src/files.c (strsuffix): Remove; unused.
14881 (concat2): Renamed from stringappend. Now static.
14882 * src/files.h (strsuffix, stringappend): Remove; unused.
14883 * src/parse-gram.y (<chars>): Renamed from <string>.
14884 (<uniqstr>): Renamed from <struniq>.
14885 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
14886 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
14887 (struct graph_s.expand): Renamed from struct graph_s.stretch.
14888 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
14889 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
14890 (N_EXPAND): Renamed from N_STRETCH.
14891
14892 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
14893 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
14894 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
14895 Remove; unused.
14896 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
14897 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
14898 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
14899 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
14900 (BASE_MAXIMUM): Renamed from BASE_MAX.
14901 (BASE_MINIMUM): Renamed from BASE_MIN.
14902 (ACTION_MAX): Remove; unused.
14903 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
14904 Unnecessary casts removed from above defines.
14905
14906
14907 Fix misspelling in names.
14908 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
14909 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
14910 G_NODE_ALIGNEMENT.
14911
14912
14913 * lib/timevar.c (timevar_report): Renamed from time_report,
14914 for consistency with other names.
14915 * lib/timevar.h (timevar_report): New decl.
14916 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
14917
14918
14919 Sort include-file uses.
14920
14921 Reorder all include files under src to be in the order "system.h".
14922 then the ../lib include files in angle brackets (alphabetized),
14923 then the . include files in double-quotes (alphabetized). Fix
14924 dependency breakages encountered in this process, as follows:
14925 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
14926 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
14927 * src/state.h: Include "symtab.h".
14928
996b1c7e
PE
149292002-12-08 Paul Eggert <eggert@twinsun.com>
14930
14931 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
14932 since this causes problems when __file__ contains character
14933 sequences like "@" that are treated specially by src/scan-skel.l.
14934 Instead, just use the file's basename. This fixes the bug
14935 reported by Martin Mokrejs in
161a71f3 14936 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 14937
e19c4e5d
PE
149382002-12-06 Paul Eggert <eggert@twinsun.com>
14939
14940 Add support for rules that do not have trailing semicolons, as
14941 POSIX requires. Improve the quality of locations in Bison
14942 diagnostics.
26b4a969 14943
e19c4e5d
PE
14944 * src/location.c: Include <quotearg.h>.
14945 (empty_location): Now const.
14946 (location_print): New function. Follow the recommendation of the
14947 GNU Coding Standards for locations that span file boundaries.
14948 * src/location.h: Do not include <quotearg.h>; no longer needed.
14949 (boundary): New type.
14950 (location_t): Use it. This allows locations to span file boundaries.
14951 All member uses changed: file -> start.file or end.file (as needed),
14952 first_line -> start.line, first_column -> start.column,
14953 last_line -> end.line, last_column -> end.column.
14954 (equal_boundaries): New function.
14955 (LOCATION_RESET, LOCATION_STEP): Remove.
14956 (LOCATION_PRINT): Remove. All callers changed to use location_print.
14957 (empty_location): Now const.
14958 (location_print): New decl.
14959 * src/parse-gram.y (lloc_default): New function, which handles
14960 empty locations more accurately.
14961 (YYLLOC_DEFAULT): Use it.
14962 (%token COLON): Remove.
14963 (%token ID_COLON): New token.
26b4a969 14964 (rules): Use it.
e19c4e5d
PE
14965 (declarations, rules): Remove trailing semicolon.
14966 (declaration, rules_or_grammar_declaration):
14967 Allow empty (";") declaration.
14968 (symbol_def): Remove empty actions; no longer needed.
14969 (rules_or_grammar_declaration): Remove trailing semicolon.
14970 (semi_colon.opt): Remove.
14971 * src/reader.h: Include location.h.
14972 (scanner_cursor): New decl.
14973 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
14974 rolling our own.
14975 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
14976 of *loc.
14977 (STEP): Remove. No longer needed, now that adjust_location does
14978 the work. All uses removed.
14979 (scanner_cursor): New var.
14980 (adjust_location): Renamed from extend_location. It now sets
14981 *loc and adjusts the scanner cursor. All uses changed.
14982 Don't bother testing for CR.
14983 (handle_syncline): Remove location arg; now updates scanner cursor.
14984 All callers changed.
14985 (unexpected_end_of_file): Now accepts start boundary of token or
14986 comment, not location. All callers changed. Update scanner cursor,
14987 not the location.
14988 (SC_AFTER_IDENTIFIER): New state.
14989 (context_state): Renamed from c_context. All uses changed.
14990 (id_loc, code_start, token_start): New local vars.
14991 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
14992 processing of Yacc white space and equivalents here.
14993 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
14994 instead of returning ID immediately, since we need to search for
14995 a subsequent colon.
14996 (<INITIAL>"'", "\""): Save token_start.
14997 (<INITIAL>"%{", "{", "%%"): Save code_start.
14998 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
14999 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
15000 BEGIN context_state at end, not INITIAL.
15001 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
15002 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
15003 Return correct token start.
15004 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
15005 the start of a character, string or multiline comment is found.
15006 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
15007 Reduction): Adjust reported locations to match the more-precise
15008 results now expected.
15009 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
15010 * tests/reduce.at (Useless Rules, Reduced Automaton,
15011 Underivable Rules): Likewise.
15012 * tests/regression.at (Invalid inputs): No longer `expecting ";"
15013 or "|"' now that so many other tokens are allowed by the new grammar.
15014
15015 * src/complain.h (current_file): Remove duplicate decl;
15016 current_file is now owned by files.h.
15017 * src/complain.c, src/scan-gram.l: Include files.h.
15018
150192002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 15020
e19c4e5d
PE
15021 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
15022 promotes to int; it might be unsigned int.
15023 * data/yacc.c (yy_reduce_print): Likewise.
15024
15025 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
15026 be #defined in the prologue, not in the Bison declarations.
15027 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 15028
b64755e3
PE
150292002-12-02 Paul Eggert <eggert@twinsun.com>
15030
15031 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
15032 * lib/strtoul.c: New file, from gnulib.
15033 This fixes a porting bug reported by Peter Klein in
161a71f3 15034 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 15035
6e746484
PE
150362002-11-30 Paul Eggert <eggert@twinsun.com>
15037
b64755e3
PE
15038 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
15039 and put only a forward declaration in the prologue. This is for
15040 consistency with the other scanner helper functions.
15041
6ba55592
PE
15042 Type clashes now generate warnings, not errors, since it
15043 appears that POSIX may allow some grammars with type clashes.
15044 * src/reader.c (grammar_current_rule_check): Warn about
15045 type clashes instead of complaining.
15046 * tests/input.at (Type Clashes): Expect warnings, not complaints.
15047
6e746484
PE
15048 Add Yacc library, since POSIX requires it.
15049 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
15050 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
15051 * lib/main.c, lib/yyerror.c: New files.
15052
15053 gram_error can be static; it need not be extern.
15054 * src/reader.h (gram_error): Remove decl.
15055 * src/parse-gram.y (gram_error): Now static. Add static decl.
15056 (print_token_value): Omit parameter names from forward decl,
15057 for consistency.
15058
88510f9c
PE
150592002-11-29 Paul Eggert <eggert@twinsun.com>
15060
6e746484
PE
15061 * doc/bison.texinfo: Emphasize that yylex and yyerror must
15062 be declared before being used. E.g., one should typically
15063 declare them in the prologue. Use GNU coding style in examples.
15064 Put "const" consistently after the type it modifies. Mention
15065 that C99 supports "inline". Mention that yyerror traditionally
15066 returns "int".
15067
88510f9c
PE
15068 %parse-param and %lex-param now take just one argument, the
15069 declaration; the argument name is deduced from the declaration.
15070
15071 * doc/bison.texinfo (Parser Function, Pure Calling, Error
15072 Reporting, Table of Symbols): Document this.
15073 * src/parse-gram.y (add_param): New function.
15074 (COMMA): Remove.
15075 (declaration): Implement new rule for %parse-param and %lex-param.
15076 * src/scan-gram.l: "," now elicits a warning, rather than being
15077 a token; this is more compatible with byacc.
15078 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
15079
bb92250c
PE
150802002-11-27 Paul Eggert <eggert@twinsun.com>
15081
15082 Rename identifiers to avoid real and potential collisions.
15083
15084 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
15085 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 15086 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
15087 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
15088 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
15089 * src/parse-gram.y (print_token_value): Renamed from yyprint.
15090 All uses changed.
15091 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
15092 The name "yycontrol" violates the name space rules, and this stuff
15093 wasn't being used anyway.
15094 (input): Remove action; this stuff wasn't being used.
15095 (gram_error): Rename local variable yylloc -> loc.
15096 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
15097 (YY_DECL): Don't use "yy" at start of local variables.
15098 All uses changed, e.g., yylloc -> loc.
15099 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
15100 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
15101 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
15102 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
15103
15104 * src/parse-gram.y (gram_error): loc is now const *.
15105 * src/reader.h (gram_error): Likewise.
15106
3af4feb2
PE
151072002-11-24 Paul Eggert <eggert@twinsun.com>
15108
15109 Version 1.75c.
15110
15111 * tests/actions.at (Actions after errors): Use an output format
15112 more similar to that of the Printers and Destructors test.
15113 Test the position of the ';' token too.
15114 (Printers and Destructors): Likewise.
15115 (Printers and Destructors: %glr-parser): Remove for now, to avoid
15116 unnecessarily alarming people when the test fails.
15117
15118 * data/yacc.c (yyerrlab1): Move this label down, so that the
15119 parser does not discard the lookahead token if the user code
15120 invokes YYERROR. This change is required for POSIX conformance.
15121
15122 * lib/error.c: Sync with gnulib.
15123
151242002-11-22 Paul Eggert <eggert@twinsun.com>
15125
15126 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
15127 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
15128 * lib/xmalloc.c: Likewise.
26b4a969 15129
58004308
PE
151302002-11-20 Paul Eggert <eggert@twinsun.com>
15131
15132 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
15133
151342002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 15135
58004308
PE
15136 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
15137 should use `if (! x) abort ();' rather than `assert (x);', and
15138 anyway it's one less thing to worry about configuring.
15139
15140 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
15141 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
15142 and replace all instances of assert with abort.
15143 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
15144 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
15145
15146 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
15147 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
15148 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
15149 hash_find_entry, hash_rehash, hash_insert): Likewise.
15150 * src/conflicts.c (resolve_sr_conflict): Likewise.
15151 * src/lalr.c (set_goto_map, map_goto): Likewise.
15152 * src/nullable.c (nullable_compute): Likewise.
15153 * src/output.c (prepare_rules, token_definitions_output): Likewise.
15154 * src/reader.c (packgram, reader): Likewise.
15155 * src/state.c (state_new, state_free, state_transitions_set,
15156 state_reduction_find): Likewise.
15157 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
15158 symbol_pack): Likewise.
15159 * src/tables.c (conflict_row, pack_vector): Likewise.
15160 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
15161 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
15162 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
15163 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
15164
15165 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
15166 (ARGMATCH_CONSTRAINT): New macro.
15167 (ARGMATCH_ASSERT): Use it.
15168
15169 * src/system.h (verify): New macro.
15170 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
15171 rather than assert.
15172 * src/tables.c (tables_generate): Likewise.
15173
15174 * src/struniq.c (struniq_assert): Now returns void, and aborts
15175 if the assertion is false.
15176 (struniq_assert_p): Remove.
15177 * src/struniq.h: Likewise.
15178
76ae8198
PE
151792002-11-18 Paul Eggert <eggert@twinsun.com>
15180
15181 * data/glr.c (yygetLRActions): Replace `yyindex' with
15182 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
15183 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 15184 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 15185
d3c4e709
AD
151862002-11-18 Akim Demaille <akim@epita.fr>
15187
15188 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
15189 space.
15190 From Tim Van Holder.
15191
8d8a7238
PE
151922002-11-17 Paul Eggert <eggert@twinsun.com>
15193
15194 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
15195 to "SyntaxError" for consistency with my 2002-11-15 change.
15196
15197 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
15198 not define to {}, since this breaks the common use of `YYDPRINTF
15199 ((...));' if a single statement is desired (e.g. before `else').
15200 Work around GCC warnings by surrounding corresponding calls with
15201 {} if needed.
15202 (yyhasResolvedValue): Remove unused function.
15203 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
15204 loop body.
15205 (yyreportSyntaxError): Renamed from yyreportParseError.
15206 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
15207 All uses changed.
15208 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
15209 extern when possible. Remove unused initializations.
15210
b0937b22
AD
152112002-11-16 Akim Demaille <akim@epita.fr>
15212
15213 Augment the similarity between GLR and LALR traces.
15214
15215 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
15216 (YY_REDUCE_PRINT): New.
15217 (yyparse): Use them.
15218 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
15219 YYDPRINT here.
15220 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
15221 state reached after the reduction/recovery, since...
15222 (yyparse, yyprocessOneStack): Report the state we are entering in.
15223
c5e3e510
AD
152242002-11-16 Akim Demaille <akim@epita.fr>
15225
15226 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
15227 Add support for --trace=skeleton.
15228 * src/scan-skel.l: %option debug.
15229 Scan strings of non-@ or \n instead of character by character.
15230 (scan_skel): Handle trace_skeleton.
15231 (QPUTS): New.
15232 (@output_parser_name@, @output_header_name@): ``Restore'' their
15233 support (used to be M4 macros).
15234 * data/yacc.c: Quote larger chunks, a la glr.c.
15235 * data/lalr1.cc: Likewise.
15236 The header guards are no longer available, so use some other
15237 string than `YYLSP_NEEDED'.
15238
4c6cc1db
AD
152392002-11-16 Akim Demaille <akim@epita.fr>
15240
15241 Make the ``Printers and Destructors'' test more verbose, taking
15242 `yacc.c''s behavior as (possibly wrong) reference.
15243
15244 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
15245 instead of fprint on stdout.
15246 Set and report the last_line of the symbols.
15247 Consistently display values and locations.
15248
6d9e8019
PE
152492002-11-16 Paul Eggert <eggert@twinsun.com>
15250
15251 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
15252
6e649e65
PE
152532002-11-15 Paul Eggert <eggert@twinsun.com>
15254
b25d88f6
PE
15255 * tests/actions.at (Actions after errors): New test case.
15256
6e649e65
PE
15257 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
15258 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
15259 tests/action.at, tests/calc.at, tests/conflicts.at,
15260 tests/cxx-type.at, tests/regression.at:
15261 "parse error" -> "syntax error" for POSIX compatibility.
15262 "parsing stack overflow..." -> "parser stack overflow" so
15263 that code matches Bison documentation.
15264
0f39aab9
AD
152652002-11-15 Akim Demaille <akim@epita.fr>
15266
15267 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
15268 take two BRACED_CODE, not two string_content.
15269 Free the scanner's obstack when we are done.
15270 (code_content): New.
15271 * tests/calc.at: Adjust.
15272 * doc/bison.texinfo: Adjust.
15273 Also, make sure to include the `,' for these declarations.
15274
761c1926
AD
152752002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
15276
15277 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
15278 definition; avoids potential autoreconf problems.
15279
b0f98b10
AD
152802002-11-15 Akim Demaille <akim@epita.fr>
15281
15282 Always check the value returned by yyparse.
15283
15284 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
15285 returned by yyparse.
15286 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
15287 Adjust calls.
15288 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
15289 returned by yyparse.
15290
970785f1
PH
152912002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15292
15293 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
15294 on input.at test.
15295
8fcc7db1
PE
152962002-11-14 Paul Eggert <eggert@twinsun.com>
15297
7ec1b48e
PE
15298 * src/output.c (output_skeleton): Call xfopen instead of
15299 duplicating xfopen's body.
15300
cfff7583 15301 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 15302 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 15303
8fcc7db1
PE
15304 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
15305 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
15306 Group compiler. Instead, use "$CC -E bar.c". Include the .h
15307 file twice in the grammar, as an extra check.
15308
15309 * tests/input.at (Torturing the Scanner): Surround the
15310 backslash-newline tests with "#if 0", to make it less likely that
15311 we'll run into compiler bugs. Bring back solitary \ inside
15312 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 15313 test backslash-newline in C character constant.
8fcc7db1 15314
4e8d992c
AD
153152002-11-14 Akim Demaille <akim@epita.fr>
15316
15317 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
15318 status of the compiler.
f32b346d 15319 Calling `exit 1' is no longer needed.
4e8d992c
AD
15320 Reported by Nelson H. F. Beebe.
15321
9501dc6e
AD
153222002-11-14 Akim Demaille <akim@epita.fr>
15323
15324 * tests/atlocal.in (CPPFLAGS): We have config.h.
15325 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
15326 New.
15327 * tests/actions.at, tests/calc.at, tests/conflicts.at,
15328 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
15329 * tests/regression.at, tests/torture.at: Use them for all the
15330 grammars that are to be compiled.
15331 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
15332 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
15333 * doc/bison.texinfo (GLR Parsers): Document `inline'.
15334
18b519c0
AD
153352002-11-14 Akim Demaille <akim@epita.fr>
15336
15337 * doc/bison.texinfo: Various formatting changes (alignments in
15338 samples, additional @group/@end group, GCS in samples.
15339 Use @deffn instead of simple @table to define the directives,
15340 macros, variables etc.
15341
9a86cdb9
PE
153422002-11-13 Paul Eggert <eggert@twinsun.com>
15343
daa33def 15344 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 15345 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 15346
daa33def 15347 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 15348 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
15349 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
15350 * tests/headers.at (export YYLTYPE): Likewise.
15351
15352 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 15353 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 15354
9a86cdb9
PE
15355 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
15356 comments, since they're not portable. Use GNU coding style.
15357
9c1e26bd
AD
153582002-11-13 Akim Demaille <akim@epita.fr>
15359
15360 * data/yacc.c: Leave bigger chunks of quoted text.
15361 (YYDSYMPRINTF): New.
15362 Use it to report symbol activities.
15363 * data/glr.c (YYDSYMPRINTF): New.
15364 Use it.
15365
87f721cc
PE
153662002-11-12 Paul Eggert <eggert@twinsun.com>
15367
15368 Version 1.75b.
15369
15370 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
15371 (yyglrReduce): Return yyok, not 0.
15372 This should avoid the enumerated-type warnings reported
464c6927 15373 by Nelson H. F. Beebe in
161a71f3 15374 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
15375
15376 * lib/bbitset.h (BITSET_INLINE): Remove.
15377 * lib/bitset.h [! BITSET_INLINE]: Remove.
15378 (bitset_set, bitset_reset, bitset_test): Rename local vars
15379 to avoid shadowing warnings by GCC.
15380
15381 * data/glr.c (inline): Remove #define. It's the user's
15382 responsibility to #define it away, just like 'const'.
464c6927 15383 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 15384 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 15385
87f721cc
PE
15386 * Makefile.maint (po-check): Scan .l and .y files instead of the
15387 .c and the .h files that they generate. This fixes the bug
15388 reported by Tim Van Holder in:
161a71f3 15389 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
15390 Look for N_ as well as for _. Try to avoid matching #define for
15391 N_ and _.
15392 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
15393 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
15394 * src/scan-gram.l: Revamp regular expressions so that " and '
15395 do not confuse xgettext.
15396
15397 * src/struniq.h (struniq_new): Do not declare the return type
15398 to be 'const'; this violates the C standard.
15399 * src/struniq.c (struniq_new): Likewise.
15400
be14ade5
AD
154012002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
15402
15403 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
15404 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
15405 linker.
15406
05291fbc
AD
154072002-11-12 Akim Demaille <akim@epita.fr>
15408
15409 * Makefile.maint: Sync with Autoconf:
15410 (local_updates): New.
15411
1f5fd52e
AD
154122002-11-12 Akim Demaille <akim@epita.fr>
15413
15414 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
15415
283f1e64
AD
154162002-11-12 Akim Demaille <akim@epita.fr>
15417
15418 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
15419 locations.
15420
886b69d1
AD
154212002-11-12 Akim Demaille <akim@epita.fr>
15422
15423 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
15424 not yyvalue.
15425
3df37415
AD
154262002-11-12 Akim Demaille <akim@epita.fr>
15427
15428 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
15429 Use it to test the GLR parser.
15430
7bd6c77e
AD
154312002-11-12 Akim Demaille <akim@epita.fr>
15432
15433 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
15434 defines it.
15435 * data/glr.c (yystos): New.
15436 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
15437 (YYDSYMPRINT): New.
15438 (yyval): Don't define it, it is handled via M4.
15439 (yyrecoverParseError): Free verbosely the discarded symbols.
15440 * data/yacc.c (yysymprint): Remove, rather...
15441 (b4_yysymprint_generate): invoke.
15442 * data/c.m4 (b4_yysymprint_generate): New.
15443 Accept pointers as arguments, as opposed to the version from
15444 yacc.c.
15445 (b4_yydestruct_generate): Likewise.
15446 * tests/cations.at (Printers and Destructors): Use Bison directives
15447 instead of CPP macros.
15448 Don't rely on internal details.
15449
b0400cc6
AD
154502002-11-12 Akim Demaille <akim@epita.fr>
15451
15452 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
15453 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
15454 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
15455 it against YYEMPTY and so forth), work on yytoken (i.e., set
15456 it to YYEMPTY etc.).
15457 (yydestruct): Replace with a b4_yydestruct_generate invocation.
15458 (b4_symbol_actions): Remove.
15459 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
15460 for 0, end-of-input.
15461
72f889cc
AD
154622002-11-12 Akim Demaille <akim@epita.fr>
15463
15464 * doc/bison.texinfo (Destructor Decl): New.
15465
b1ae9233
AD
154662002-11-12 Akim Demaille <akim@epita.fr>
15467
15468 * src/tables.c (tables_generate): Use free for pointers that
15469 cannot be NULL, not XFREE.
15470 (pack_vector): Use assert, not fatal, for bound violations.
15471 * src/state.c (state_new): Likewise.
15472 * src/reader.c (reader): Likewise.
15473 * src/lalr.c (set_goto_map): Likewise.
72f889cc 15474 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
15475 the file name.
15476
7ec2d4cd
AD
154772002-11-12 Akim Demaille <akim@epita.fr>
15478
15479 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
15480 Restore.
15481 * src/scan-gram.l (last_string): Is global to the file, not to
15482 yylex.
15483 * src/parse-gram.y (input): Don't append the epilogue here,
15484 (epilogue.opt): do it here, and free the scanner's obstack.
15485 * src/reader.c (epilogue_set): Rename as...
15486 (epilogue_augment): this.
15487 * data/c.m4 (b4_epilogue): Defaults to empty.
15488
573a6cd3
AD
154892002-11-12 Akim Demaille <akim@epita.fr>
15490
15491 * src/getargs.c (long_options): Remove duplicates.
15492 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
15493 Remove.
15494 * doc/bison.rnh: Remove.
15495 * doc/bison.texinfo (VMS Invocation): Remove.
15496
95612cfa
AD
154972002-11-12 Akim Demaille <akim@epita.fr>
15498
15499 * src/struniq.h, src/struniq.c (struniq_t): Is const.
15500 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
15501
15502 Use struniq for symbols.
15503
15504 * src/symtab.h (symbol_t): The tag member is a struniq.
15505 (symbol_type_set): Adjust.
15506 * src/symtab.c (symbol_new): Takes a struniq.
15507 (symbol_free): Don't free the tag member.
15508 (hash_compare_symbol_t, hash_symbol_t): Rename as...
15509 (hash_compare_symbol, hash_symbol): these.
15510 Use the fact that tags as struniqs.
15511 (symbol_get): Use struniq_new.
15512 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
15513 Returns a strniq.
15514 * src/reader.h (merger_list, grammar_currentmerge_set): The name
15515 and type members are struniqs.
15516 * src/reader.c (get_merge_function)
15517 (grammar_current_rule_merge_set): Adjust.
15518 (TYPE, current_type): Are struniq.
15519
15520 Use struniq for file names.
15521
15522 * src/files.h, src/files.c (infile): Split into...
15523 (grammar_file, current_file): these.
15524 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
15525 * src/reduce.c (reduce_print): Likewise.
15526 * src/getargs.c (getargs): Likewise.
15527 * src/complain.h, src/complain.c: Likewise.
15528 * src/main.c (main): Call struniqs_new early enough to use it for
15529 file names.
15530 Don't free the input file name.
15531
3e6656f9
AD
155322002-11-12 Akim Demaille <akim@epita.fr>
15533
15534 * src/symtab.c (symbol_free): Remove dead deactivated code:
15535 type_name are properly removed.
15536 Don't use XFREE to free items that cannot be NULL.
15537 * src/struniq.h, src/struniq.c: New.
15538 * src/main.c (main): Initialize/free struniqs.
15539 * src/parse-gram.y (%union): Add astruniq member.
15540 (yyprint): Adjust.
15541 * src/scan-gram.l (<{tag}>): Return a struniq.
15542 Free the obstack bit that used to store it.
15543 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
15544
7672019c
PE
155452002-11-11 Paul Eggert <eggert@twinsun.com>
15546
15547 Revamp to fix many (but not all) of the C- and M4-related quoting
15548 problems. Among other things, this fixes the Bison bug reported
15549 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 15550 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
15551
15552 Use new @ escapes consistently. Represent brackets with @{ and @}
15553 rather than @<:@ and @:>@, since this works a bit better with dumb
15554 editors like vi. Represent @ with @@, since @ is now consistently
15555 an escape. Use @oline@ and @ofile@ rather than __oline__ and
15556 __ofile__, to avoid unexpected expansions. Similarly, use @output
15557 rather than #output.
15558
15559 * data/c.m4 (b4_copyright): Omit file name from comment, since
15560 the file name could contain "*/".
15561 (b4_synclines_flag): Don't quote the 2nd argument; it should already
15562 be quoted. All uses changed.
15563
15564 * data/glr.c: Use new @ escapes consistently.
15565 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
15566 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
15567 Remove, since they couldn't handle arbitrary characters in file
15568 names.
15569 * data/lalr1.cc: Likewise.
15570 * data/yacc.c: Likewise.
15571
15572 * src/files.c (output_infix): Remove; all uses removed.
15573 * src/files.h: Likewise.
15574
15575 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
15576 mishandled funny characters in file names, and anyway it isn't
15577 needed any more.
15578 * data/yacc.c: Likewise.
15579 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
15580
15581 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
15582 * data/yacc.c: Likewise.
15583
15584 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
15585 strings now.
15586 (muscle_init): Quote filename as a C string.
15587 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
15588 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
15589 * src/output.c (escaped_file_name_output): New function.
15590 (prepare_symbols): Quote tokens for M4.
15591 (prepare): Don't insert output_infix, output_prefix,
15592 output_parser_name, output_header_name; this is now down by scan-skel.
15593 Insert skeleton as a C string.
15594
15595 * src/output.c (user_actions_output, symbol_destructors_output,
15596 symbol_printers_output): Quote filenames for C and M4.
15597 * src/reader.c (prologue_augment, epilogue_set): Likewise.
15598
15599 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
15600 escapes other than \\ and \'; this simplifies the code.
15601 (<SC_STRING>): Likewise, for \\ and \".
15602 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
15603 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
15604 Use new escapes @{ and @} for [ and ].
15605
15606 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
15607 them with auto vars.
15608 Switch to new escape scheme, where @ is the escape character uniformly.
15609 Abort if a stray escape character is found. Avoid unbounded input
15610 buffer when parsing non-escaped text.
15611
15612 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
15613 __oline__, #output, $@, and @{ do not have unintended meanings.
15614
acea4f3b
PE
156152002-11-09 Paul Eggert <eggert@twinsun.com>
15616
15617 Fix the test failure due to GCC warnings described in
161a71f3 15618 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
15619 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
15620 evaluate to 0 if it's impossible for NINF to be in the respective
15621 table.
15622 (yygetLRActions, yyrecoverParseError): Use them.
15623
15624 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
15625 counted in the token inserted at end of file. Now takes
15626 location_t *, not location_t, so that the location can be
15627 adjusted. All uses changed.
15628
15629 * tests/regression.at (Invalid inputs): Adjust wording in
15630 diagnostic to match the new behavior.
15631
15632 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
15633 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
15634 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
15635 abort ();'. This reduces the runtime of the "Many lookaheads"
15636 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
15637 GCC 3.2.
15638
20ef1ad5
PE
156392002-11-07 Paul Eggert <eggert@twinsun.com>
15640
15641 * src/parse-gram.y (CHARACTER): Remove unused token.
15642 All uses removed.
15643
15644 * src/scan-gram.l: Remove stack option. We no longer use the
15645 stack, since the stack was never deeper than 1; instead, use the
15646 new auto var c_context to record the stacked value.
15647
15648 Remove nounput option. At an unexpected end of file, we now unput
15649 the minimal input necessary to end cleanly; this simplifies the
15650 code.
15651
15652 Avoid unbounded token sizes where this is easy.
15653
15654 (unexpected_end_of_file): New function.
15655 Use it to systematize the error message on unexpected EOF.
15656 (last-string): Now auto, not static.
15657 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
15658 (scanner_last_string_free): Remove; not used.
15659 (percent_percent_count): Move decl to just before use.
15660 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
15661 not the (never otherwised-used) CHARACTER.
15662
93724f13
AD
156632002-11-07 Akim Demaille <akim@epita.fr>
15664
15665 Let yyerror always receive the msg as last argument, so that
15666 yyerror can be variadic.
15667
15668 * data/yacc.c (b4_yyerror_args): New.
15669 Use it when calling yyerror.
15670 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
15671 Use it when calling yyerror.
15672 * doc/bison.texinfo (Error Reporting): Adjust.
15673 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
15674 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
15675
6e40b4eb
AD
156762002-11-06 Akim Demaille <akim@epita.fr>
15677
15678 #line should have quoted strings.
15679 Ideally, this should be done by m4_quotearg.
15680
15681 * src/scan-skel.l: Include quotearg.h.
15682 Quote __ofile__.
15683 * src/output.c (symbol_printers_output)
15684 (symbol_destructors_output): Quote the file name.
15685
2dfbfc12
AD
156862002-11-06 Akim Demaille <akim@epita.fr>
15687
15688 * tests/regression.at (Invalid inputs): Adjust to the recent
15689 messages.
15690
437c2d80
AD
156912002-11-06 Akim Demaille <akim@epita.fr>
15692
15693 Restore --no-lines.
15694 Reported by Jim Kent.
15695
15696 * data/c.m4 (b4_syncline): New.
15697 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
15698 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
15699 * src/output.c (user_actions_output): Likewise.
15700 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 15701 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 15702
900c5db5
AD
157032002-11-06 Akim Demaille <akim@epita.fr>
15704
15705 * src/main.c (main): Free `infile'.
15706 * src/scan-gram.l (handle_syncline): New.
15707 Recognize `#line'.
15708 * src/output.c (user_actions_output, symbol_destructors_output)
15709 (symbol_printers_output): Use the location's file name, not
15710 infile.
15711 * src/reader.c (prologue_augment, epilogue_set): Likewise.
15712
e183b123 157132002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 15714
e183b123 15715 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 15716 either has GLR conflict entries.
e183b123 15717
193eb6b7
PE
157182002-11-05 Paul Eggert <eggert@twinsun.com>
15719
e183b123
PE
15720 * src/scan-gram.l: Use more accurate diagnostics, e.g.
15721 "integer out of range" rather than "invalid value".
15722 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
15723 accordingly.
15724
193eb6b7
PE
15725 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
15726 Also, remove one static variable in the scanner.
15727
15728 * src/scan-gram.l (braces_level): Now auto, not static.
15729 Initialize to zero if the compiler is being picky.
15730 (INITIAL): Clear braces_level instead of incrementing it.
15731 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
15732 as POSIX 1003.1-2001 requires.
15733 * src/system.h (IF_LINT): New macro, taken from coreutils.
15734 * configure.ac: Define "lint" if --enable-gcc-warnings.
15735
29c01725
AD
157362002-11-05 Akim Demaille <akim@epita.fr>
15737
15738 * src/scan-gram.l: When it starts with `%', complain about the
15739 whole directive, not just that `invalid character: %'.
15740
8aeac3ca
AD
157412002-11-04 Akim Demaille <akim@epita.fr>
15742
15743 * Makefile.maint: Update from Autoconf.
15744 (update, cvs-update, po-update, do-po-update): New.
15745
793a58bb
AD
157462002-11-04 Akim Demaille <akim@epita.fr>
15747
15748 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
15749 and yyerror.
15750 Have yyerror `use' its arguments.
15751 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
15752 returns true when location & yacc & pure & parse-param.
15753 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
15754
c4d720cd
AD
157552002-11-04 Akim Demaille <akim@epita.fr>
15756
15757 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
15758 clashes.
15759 * src/scan-gram.l: Use [\'] instead of ['] to pacify
15760 font-lock-mode.
15761 Use complain_at.
15762 Use quote, not quote_n since LOCATION_PRINT no longer uses the
15763 slot 0.
15764
613a0dc5
PE
157652002-11-03 Paul Eggert <eggert@twinsun.com>
15766
15767 * src/reader.c (get_merge_function, grammar_current_rule_check):
15768 Use consistent diagnostics for reporting type name clashes.
15769 Quote the types with <>, for consistency with Yacc.
15770 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
15771
2a8d363a
AD
157722002-11-03 Akim Demaille <akim@epita.fr>
15773
15774 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
15775 New.
15776 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
15777 (b4_parse_param): Remove.
15778 Use b4_identification.
15779 Propagate b4_pure_args where needed to pass them to yyerror.
15780 * data/glr.m4 (b4_parse_param): Remove.
15781 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
15782 (b4_lpure_formals): New.
15783 Use b4_identification.
15784 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
15785 b4_user_formals and b4_user_args.
15786 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
15787 (yyreportAmbiguity): When using a pure parser, also need
15788 the location, and the parse-params.
15789 Adjust callers.
15790 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
15791 When using a pure parser, also need the parse-params.
15792 Adjust callers.
15793 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
15794 (%pure-parser + %parse-param) LALR and GLR parsers.
15795 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
15796 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
15797 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
15798 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
15799 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
15800 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
15801 * doc/bison.texinfo: Untabify the whole file.
15802 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
15803 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
15804 (Error Reporting): Adjust to these new directives.
15805 Document %error-verbose, deprecate YYERROR_VERBOSE.
15806
9e32add8
AD
158072002-11-03 Akim Demaille <akim@epita.fr>
15808
15809 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
15810 AT_CHECK_CALC_GLR invocations to use % directives, instead of
15811 command line options.
15812 * tests/cxx-type.at: Formatting changes.
15813
b02d90a5
PE
158142002-11-03 Paul Eggert <eggert@twinsun.com>
15815
15816 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
15817 to count columns correctly, and to check for invalid inputs.
9e32add8 15818
b02d90a5
PE
15819 Use mbsnwidth to count columns correctly. Account for tabs, too.
15820 Include mbswidth.h.
15821 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
15822 (extend_location): New function.
15823 (YY_LINES): Remove.
15824
15825 Handle CRLF in C code rather than in Lex code.
15826 (YY_INPUT): New macro.
15827 (no_cr_read): New function.
15828
15829 Scan UCNs, even though we don't fully handle them yet.
15830 (convert_ucn_to_byte): New function.
15831
15832 Handle backslash-newline correctly in C code.
15833 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
15834 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
15835 all uses changed.
15836 (tag, splice): New EREs. Do not allow NUL or newline in tags.
15837 Use {splice} wherever C allows backslash-newline.
15838 YY_STEP after space, newline, vertical-tab.
15839 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 15840
b02d90a5
PE
15841 (letter, id): Don't assume ASCII; e.g., spell out a-z.
15842
15843 ({int}, handle_action_dollar, handle_action_at): Check for integer
15844 overflow.
9e32add8 15845
b02d90a5
PE
15846 (YY_STEP): Omit trailing semicolon, so that it's more like C.
15847
15848 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
15849 as well as \000. Check for UCHAR_MAX, not 255.
15850 Allow \x with an arbitrary positive number of digits, as in C.
15851 Check for overflow here.
15852 Allow \? and UCNs, for compatibility with C.
15853
15854 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
15855 with quote slot used by complain_at.
15856
15857 * tests/input.at: Add tests for backslash-newline, m4 quotes
15858 in symbols, long literals, and funny escapes in strings.
15859
15860 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
15861 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
15862 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
15863 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
15864 * m4/mbswidth.m4: New file, from GNU coreutils.
15865
15866 * doc/bison.texinfo (Grammar Outline): Document // comments.
15867 (Symbols): Document that trigraphs have no special meaning in Bison,
15868 nor is backslash-newline allowed.
15869 (Actions): Document that trigraphs have no special meaning.
15870
15871 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
15872 no longer used.
15873
158742002-11-02 Paul Eggert <eggert@twinsun.com>
15875
15876 * src/reader.c: Don't include quote.h; not needed.
15877 (get_merge_function): Reword warning to be consistent with
15878 type clash diagnostic in grammar_current_rule_check.
15879
15880 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
15881 bug in trigraph handling.
15882
15883 * src/output.c (prepare_symbols): When printing token names,
15884 escape "[" as "@<:@" and likewise for "]".
15885
15886 * src/system.h (errno): Remove declaration, as we are now
15887 assuming C89 or better, and C89 guarantees errno.
15888
762b212b
PE
158892002-10-30 Paul Eggert <eggert@twinsun.com>
15890
15891 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
15892 Check for close failures.
15893 * src/files.h (xfclose): Return void, not int, since it always
15894 returned zero.
15895 * src/files.c (xfclose): Likewise. Report I/O error if ferror
15896 indicates one.
15897 * src/output.c (output_skeleton): Use xfclose rather than fclose
15898 and ferror. xfclose now checks ferror.
15899
15900 * data/glr.c (YYLEFTMOST_STATE): Remove.
15901 (yyreportTree): Use a stack-based leftmost state. This avoids
15902 our continuing battles with bogus warnings about initializers.
15903
56100c60
AD
159042002-10-30 Akim Demaille <akim@epita.fr>
15905
15906 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
15907 #if.
15908
51b4a04c
PH
159092002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15910
15911 * tests/glr-regr1.at: New test for reported regressions.
15912 * tests/testsuite.at: Add glr-regr1.at test.
15913 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 15914
bf1ebda2
PE
159152002-10-24 Paul Eggert <eggert@twinsun.com>
15916
5c16c6b1
PE
15917 Version 1.75a.
15918
bf1ebda2
PE
15919 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
15920 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
15921 we use malloc. Don't assume 'A' through 'Z' are contiguous.
15922 Don't assume strdup exists; POSIX says its an XSI extension.
15923 Check for buffer overflow on input.
15924
b526ee61
AD
159252002-10-24 Akim Demaille <akim@epita.fr>
15926
15927 * src/output.c (output_skeleton): Don't disable M4sugar comments
15928 too soon: it results in comments being expanded.
15929 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
15930 first output.
15931
f1886bb2
AD
159322002-10-24 Akim Demaille <akim@epita.fr>
15933
15934 * data/yacc.c (m4_int_type): New.
15935 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
15936 char' as only yacc.c wants K&R portability.
15937 * data/glr.c (yysigned_char): Remove.
15938 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
15939 Reported by Quoc Peyrot.
15940
c5576256
PE
159412002-10-23 Paul Eggert <eggert@twinsun.com>
15942
15943 * src/main.c (main): With --trace=time, report times even if a
15944 non-fatal error occurs. Formerly, the times were reported in some
15945 such cases but not in others.
15946 * src/reader.c (reader): Just return if a complaint has been issued,
15947 instead of exiting, so that 'main' can report times.
15948
27b0ffea
AD
159492002-10-22 Akim Demaille <akim@epita.fr>
15950
15951 * src/system.h: Include sys/types.
15952 Reported by Bert Deknuydt.
15953
223a7883
PE
159542002-10-23 Paul Eggert <eggert@twinsun.com>
15955
15956 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
15957 Suggested by Art Haas.
15958
159592002-10-22 Paul Eggert <eggert@twinsun.com>
15960
15961 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
15962 decl; not needed any more.
15963 * src/main.c (main): Use return to exit, undoing yesterday's change.
15964 The last OS that we could find where this wouldn't work is
15965 SunOS 3.5, and that's too old to worry about now.
15966
15967 * data/glr.c (struct yyltype): Define members even when not
15968 doing locations. This is more consistent with yacc.c, and it
15969 works around the following bug reports:
161a71f3
PE
15970 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
15971 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 15972
223a7883
PE
15973 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
15974 @acronym consistently. Standardize on "Yacc" instead of "YACC",
15975 "Algol" instead of "ALGOL". Give a bit more history about BNF.
15976
8b76775a
AD
159772002-10-22 Akim Demaille <akim@epita.fr>
15978
15979 * data/README: New.
15980
6db10d14
PE
159812002-10-21 Paul Eggert <eggert@twinsun.com>
15982
15983 Be consistent about 'bool'; the old code used an enum in one
15984 module and an int in another, and this violates the C standard.
15985 * m4/stdbool.m4: New file, from coreutils 4.5.3.
15986 * configure.ac (AC_HEADER_STDBOOL): Add.
15987 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
15988 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
15989 * src/symtab.c (hash_compare_symbol_t): Likewise.
15990 * src/system.h (bool, false, true): Use a definition consistent
15991 with ../lib/hash.c. All uses changed.
15992
15993 * src/complain.c (warning_issued): Renamed from warn_message_count,
15994 so that we needn't worry about integer overflow (!).
15995 Now of type bool. All uses changed.
15996 (complaint_issued): Renamed from complain_message_count; likewise.
15997
15998 * src/main.c (main): Use exit to exit with failure.
27b0ffea 15999
6db10d14
PE
16000 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
16001 rather than 1 and 0.
16002 * src/main.c (main): Likewise.
16003 * src/getargs.c (getargs): Likewise.
16004 * src/reader.c (reader): Likewise.
16005
16006 * src/getarg.c (getargs): Remove duplicate code for
16007 "Try `bison --help'".
16008
16009 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
16010 What was that "2" for?
16011
16012 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
16013 * src/getargs.c (usage): Likewise.
16014
16015 * src/getargs.c (getargs): When there are too few operands, report
16016 the last one. When there are too many, report the first extra
16017 one. This is how diffutils does it.
16018
92a060fd
PE
160192002-10-20 Paul Eggert <eggert@twinsun.com>
16020
16021 Remove K&R vestiges.
16022 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
16023 * src/complain.c (VA_START): Remove. Assume prototypes.
16024 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
16025 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
16026 fatal): Assume prototypes.
16027 * src/complain.h: Assume prototypes.
16028 * src/system.h (PARAMS): Remove.
16029 Include <limits.h> unconditionally, since it's guaranteeed even
16030 for a freestanding C89 compiler.
16031 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
16032 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 16033
e7cb57c0
AD
160342002-10-20 Akim Demaille <akim@epita.fr>
16035
16036 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
16037 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
16038 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
16039 (yyresolveStates, yyresolveAction, yyresolveStack)
16040 (yyprocessOneStack): Use them.
16041 (yy_reduce_print): New.
16042 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
16043
0245f82d
AD
160442002-10-20 Akim Demaille <akim@epita.fr>
16045
16046 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
16047 arguments and output `void'.
16048 (b4_c_function): Rename as...
16049 (b4_c_function_def): this.
16050 (b4_c_function_decl, b4_c_ansi_function_def)
16051 (b4_c_ansi_function_decl): New.
16052 Change the interpretation of the arguments: before `int, foo', now
16053 `int foo, foo'.
16054 * data/yacc.c (yyparse): Prototype and define thanks to these.
16055 Adjust b4_c_function_def uses.
16056 * data/glr.c (yyparse): Likewise, but ANSI only.
16057
39912f52
AD
160582002-10-20 Akim Demaille <akim@epita.fr>
16059
16060 * src/output.c (prepare): Move the definition of `tokens_number',
16061 `nterms_number', `undef_token_number', `user_token_number_max'
16062 to...
16063 (prepare_tokens): Here.
16064 (prepare_tokens): Rename as...
16065 (prepare_symbols): this.
16066 (prepare): Move the definition of `rules_number' to...
16067 (prepare_rules): here.
16068 (prepare): Move the definition of `last', `final_state_number',
16069 `states_number' to...
16070 (prepare_states): here.
16071 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
16072
20c1e2ad
AD
160732002-10-20 Akim Demaille <akim@epita.fr>
16074
16075 * src/tables.h, src/tables.c, src/output.c: Comment changes.
16076
21964f43
AD
160772002-10-20 Akim Demaille <akim@epita.fr>
16078
16079 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
16080 * data/c.m4: here.
16081
66d30cd4
AD
160822002-10-20 Akim Demaille <akim@epita.fr>
16083
16084 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
16085 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
16086 `pair'.
16087 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
16088 `name' to...
16089 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
16090 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
16091 These.
16092
95f2c9fe
PE
160932002-10-19 Paul Eggert <eggert@twinsun.com>
16094
16095 Do not create a temporary file, as that involves security and
16096 cleanup headaches. Instead, use a pair of pipes.
16097 Derived from a suggestion by Florian Krohm.
16098 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
16099 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
16100 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
16101 (BISON_PREREQ_SUBPIPE): Add.
16102 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
16103 Add subpipe.h, subpipe.c.
16104 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
16105 * po/POTFILES.in: Add lib/subpipe.c.
16106 * src/output.c: Include "subpipe.h".
16107 (m4_invoke): Remove decl.
16108 (scan_skel): New decl.
16109 (output_skeleton): Use pipe rather than temporary file for m4 input.
16110 Check that m4sugar.m4 is readable, to avoid deadlock.
16111 Check for pipe I/O error.
16112 * src/scan-skel.l (readpipe): Remove decl.
16113 (scan_skel): New function, to be used in place of m4_invoke.
16114 Read from stream rather than file.
66d30cd4 16115
95f2c9fe
PE
16116 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
16117 float, as this generates a warning on Solaris 8 + GCC 3.2 with
16118 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
16119 this generates a more-accurate value anyway.
16120
16121 * lib/timevar.c (timervar_accumulate): Rename locals to
16122 avoid confusion with similarly-named more-global.
16123 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
16124
16125 * src/output.c (prepare): Use xstrdup to convert char const *
16126 to char *, to avoid GCC warning.
16127
c19988b7
AD
161282002-10-19 Akim Demaille <akim@epita.fr>
16129
16130 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
16131 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
16132 Use them to have `calc.y' ready for %pure-parser.
16133 * data/yacc.c (YYLEX): Pass a yylex return type to
16134 b4_c_function_call.
16135
ae7453f2
AD
161362002-10-19 Akim Demaille <akim@epita.fr>
16137
16138 Prototype support of %lex-param and %parse-param.
16139
16140 * src/parse-gram.y: Add the definition of the %lex-param and
16141 %parse-param tokens, plus their rules.
16142 Drop the `_' version of %glr-parser.
16143 Add the "," token.
16144 * src/scan-gram.l (INITIAL): Scan them.
16145 * src/muscle_tab.c: Comment changes.
16146 (muscle_insert, muscle_find): Rename `pair' as `probe'.
16147 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
16148 (muscle_entry_s): The `value' member is no longer const.
16149 Adjust all dependencies.
16150 * src/muscle_tab.c (muscle_init): Adjust: use
16151 MUSCLE_INSERT_STRING.
16152 Initialize the obstack earlier.
16153 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
16154 (muscle_pair_list_grow): New.
16155 * data/c.m4 (b4_c_function_call, b4_c_args): New.
16156 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
16157 * tests/calc.at: Use %locations, not --locations.
16158 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
16159
0e575721
AD
161602002-10-19 Akim Demaille <akim@epita.fr>
16161
16162 * src/getargs.c (usage): Take status as argument and exit
16163 accordingly.
16164 Report the traditional `Try ... --help' message when status != 0.
16165 (usage, version): Don't take a FILE * as arg, it is pointless.
16166 (getargs): When there is an incorrect number of arguments, make it
16167 an error, and report it GNUlically thanks to `usage ()'.
16168
724ce7f5
PE
161692002-10-18 Paul Eggert <eggert@twinsun.com>
16170
3a781eb2
PE
16171 * data/glr.c (yyreportParseError): Don't assume that sprintf
16172 yields the length of the printed string, as this is not true
16173 on SunOS 4.1.4. Reported by Peter Klein.
16174
724ce7f5
PE
16175 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
16176 * tests/conflicts.at (%nonassoc and eof): Likewise.
16177 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
16178
473d0a75
AD
161792002-10-17 Akim Demaille <akim@epita.fr>
16180
16181 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
16182 * src/getargs.c (trace_types, trace_args): Adjust.
16183 * src/reader.c (grammar_current_rule_prec_set)
16184 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
16185 Standardize error messages.
16186 And s/@prec/%prec/!
16187 (reader): Use trace_flag to enable scanner/parser debugging,
16188 instead of an adhoc scheme.
16189 * src/scan-gram.l: Remove trailing debugging code.
16190
e76d2469
PE
161912002-10-16 Paul Eggert <eggert@twinsun.com>
16192
93e2236a
PE
16193 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
16194 MUSCLE_TAB_H.
16195
e76d2469
PE
16196 * NEWS: Officially drop support for building Bison with K&R C,
16197 since it didn't work anyway and it's not worth worrying about.
16198 * Makefile.maint (wget_files): Remove ansi2knr.c.
16199 (ansi2knr.c-url_prefix): Remove.
16200 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
16201 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16202 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16203
5bd1c419
PE
162042002-10-15 Paul Eggert <eggert@twinsun.com>
16205
16206 Stop using the "enum_" trick for K&R-style function definitions;
16207 it confused me, and I was the author! Instead, assume that people
16208 who want to use K&R C compilers (when using these modules in GCC,
16209 perhaps?) will run ansi2knr.
16210
16211 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
16212 All uses of "enum_" changed to "enum ".
16213 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
16214 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 16215
5bd1c419
PE
16216 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
16217 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
16218 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
16219 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
16220 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
16221 abitset_not, abitset_ones, abitset_or, abitset_or_and,
16222 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
16223 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
16224 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
16225 Use function prototypes; this removes the need for declaring
16226 static functions simply to provide their prototypes.
16227 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
16228 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
16229 bitset_count_, bitset_create, bitset_dump, bitset_first,
16230 bitset_free, bitset_init, bitset_last, bitset_next,
16231 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
16232 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
16233 bitset_print, bitset_release_memory, bitset_toggle_,
16234 bitset_type_choose, bitset_type_get, bitset_type_name_get,
16235 debug_bitset): Likewise.
16236 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
16237 * lib/bitset_stats.c (bitset_log_histogram_print,
16238 bitset_percent_histogram_print, bitset_stats_and,
16239 bitset_stats_and_cmp, bitset_stats_and_or,
16240 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
16241 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
16242 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
16243 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
16244 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
16245 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
16246 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
16247 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
16248 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
16249 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
16250 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
16251 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
16252 bitset_stats_zero): Likewise.
16253 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
16254 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
16255 bitsetv_dump, debug_bitsetv): Likewise.
16256 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
16257 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
16258 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
16259 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
16260 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
16261 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
16262 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
16263 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
16264 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
16265 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
16266 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
16267 Likewise.
16268 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
16269 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
16270 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
16271 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
16272 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
16273 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
16274 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
16275 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
16276 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
16277 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
16278 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 16279
ae26e1f0
AD
162802002-10-14 Akim Demaille <akim@epita.fr>
16281
16282 Version 1.75.
16283
d43baf71
AD
162842002-10-14 Akim Demaille <akim@epita.fr>
16285
16286 * tests/Makefile.am (maintainer-check-posix): New.
16287
7ebc83e3
AD
162882002-10-14 Akim Demaille <akim@epita.fr>
16289
16290 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
16291 member.
16292
05846dae
AD
162932002-10-14 Akim Demaille <akim@epita.fr>
16294
16295 * src/tables.c (table_ninf_remap): base -> tab.
16296 Reported by Matt Rosing.
16297
1318e37d
PE
162982002-10-14 Paul Eggert <eggert@twinsun.com>
16299
447fbb17
PE
16300 * tests/action.at, tests/calc.at, tests/conflicts.at,
16301 tests/cxx-type.at, tests/headers.at, tests/input.at,
16302 tests/regression.at, tests/synclines.at, tests/torture.at:
16303 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
16304 so that the tests still work even if POSIXLY_CORRECT is set.
16305 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 16306
1318e37d
PE
16307 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
16308 for portability to K&R hosts. Fix typo: signed char is guaranteed
16309 only to 127, not to 128.
16310 * data/glr.c (yysigned_char): New type.
16311 * data/yacc.c (yysigned_char): Likewise.
16312 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
16313
cc0f0794
PE
163142002-10-13 Paul Eggert <eggert@twinsun.com>
16315
5038f418
PE
16316 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
16317 true due to limited range of data type" warning from GCC.
16318
cc0f0794
PE
16319 * data/c.m4 (b4_token_defines): Protect against double-inclusion
16320 by wrapping enum yytokentype's definition inside #ifndef
16321 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
16322
6fed0802
AD
163232002-10-13 Akim Demaille <akim@epita.fr>
16324
16325 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
16326 Un yy- yyrhs to avoid the name clash with the global YYRHS.
16327
32f0598d
AD
163282002-10-13 Akim Demaille <akim@epita.fr>
16329
16330 * Makefile.maint: Update from Autoconf 2.54.
16331 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
16332
7ea9a33f
AD
163332002-10-13 Akim Demaille <akim@epita.fr>
16334
16335 * src/print.c (print_state): Separate the list of solved conflicts
16336 from the other items.
16337 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
16338
ea99527d
AD
163392002-10-13 Akim Demaille <akim@epita.fr>
16340
16341 Let nondeterministic skeletons be usable with deterministic
16342 tables.
16343
16344 With the patch, GAWK compiled by GCC without -O2 passes its test
16345 suite using a GLR parser driven by LALR tables. It fails with -O2
16346 because `struct stat' gives two different answers on my machine:
16347 88 (definition of an auto var) and later 96 (memset on this var).
16348 Hence the stack is badly corrumpted. The headers inclusion is to
16349 blame: if I move the awk.h inclusion before GLR's system header
16350 inclusion, the two struct stat have the same size.
16351
16352 * src/tables.c (pack_table): Always create conflict_table.
16353 (token_actions): Always create conflict_list.
16354 * data/glr.c (YYFLAG): Remove, unused.
16355
f377f69f
AD
163562002-10-13 Akim Demaille <akim@epita.fr>
16357
16358 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
16359 (O0FLAGS): New.
16360 (VALGRIND, GXX): New.
16361 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
16362 * tests/bison.in: Run $PREBISON a pre-command.
16363 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
16364 (maintainer-check-g++): New.
16365 * Makefile.am (maintainer-check): New.
16366
2a1fe6ed
AD
163672002-10-13 Akim Demaille <akim@epita.fr>
16368
16369 * data/glr.c: Formatting changes.
16370 Tweak some trace messages to match yacc.c's.
16371
f50adbbd
AD
163722002-10-13 Akim Demaille <akim@epita.fr>
16373
16374 GLR parsers sometimes raise parse errors instead of performing the
16375 default reduction.
16376 Reported by Charles-Henry de Boysson.
16377
16378 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 16379 check the length of the traces when %glr.
f50adbbd
AD
16380 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
16381 GLR's traces.
16382 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
16383 Test GLR parsers.
16384 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
16385 (yyltype): Remove the yy prefix from the member names.
16386 (yytable): Complete its comment.
16387 (yygetLRActions): Map error action number from YYTABLE from
16388 YYTABLE_NINF to 0.
16389 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
16390 (which was a bug: it should have been YYTABEL_NINF, and yet it was
16391 not satisfying as we could compare an YYACTION computed from
16392 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
16393 only value for error actions.
16394 (yyreportParseError): In verbose parse error messages, don't issue
16395 `error' in the list of expected tokens.
16396 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
16397 next action to perform to match glr.c's decoding.
16398 (yytable): Complete its comment.
16399
bcbad5b9
PE
164002002-10-13 Paul Eggert <eggert@twinsun.com>
16401
16402 Fix problem reported by Henrik Grubbstroem in
161a71f3 16403 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
16404 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
16405 because the Bison parser reads the second action before reducing
16406 the first one.
16407 * src/scan-gram.l (rule_length): New static var.
16408 Use it to keep track of the rule length in the scanner, since
16409 we can't expect the parser to be in lock-step sync with the scanner.
16410 (handle_action_dollar, handle_action_at): Use this var.
16411 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 16412
14904b89
PE
164132002-10-12 Paul Eggert <eggert@twinsun.com>
16414
1fe611e5
PE
16415 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
16416 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
16417 Include <sys/time.h> when checking for clock_t and struct tms.
16418 Use same include order as source.
16419 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 16420 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 16421
1fe611e5
PE
16422 * lib/timevar.c: Update copyright date and clarify comments.
16423 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 16424
1fe611e5
PE
16425 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
16426 GCC version as of today, then merge Bison's changes.
16427 Change "GCC" to "Bison" in copyright notice. timevar.def's
16428 author is Akim, so change that too.
16429
98194095
PE
16430 * src/reader.c (grammar_current_rule_check):
16431 Don't worry about the default action if $$ is untyped.
16432 Prevents bogus warnings reported by Jim Gifford in
161a71f3 16433 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 16434
14904b89
PE
16435 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
16436 * data/glr.c, data/lalr1.cc, data/yacc.c:
16437 Output token definitions before the first part of user declarations.
16438 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 16439 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 16440
ff6dca18
PE
164412002-10-11 Paul Eggert <eggert@twinsun.com>
16442
16443 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
16444 (yyparse): here. This undoes some of the 2002-07-25 change.
16445 Compatibility problem reported by Ralf S. Engelschall with
16446 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
16447
eb714592
AD
164482002-10-11 Akim Demaille <akim@epita.fr>
16449
16450 * tests/regression.at Characters Escapes): New.
16451 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
16452 characters.
16453 Reported by Jan Nieuwenhuizen.
16454
b7195100
AD
164552002-10-11 Akim Demaille <akim@epita.fr>
16456
16457 * po/id.po: New.
16458
f28a0f2d
PE
164592002-10-10 Paul Eggert <eggert@twinsun.com>
16460
16461 Portability fixes for bitsets; this also avoids several GCC
16462 warnings.
16463
16464 * lib/abitset.c: Include <stddef.h>, for offsetof.
16465 * lib/lbitset.c: Likewise.
16466
16467 * lib/abitset.c (abitset_bytes): Return a size that is aligned
16468 properly for vectors of objects. Do not assume that adding a
16469 header size to a multiple of a word size yields a value that is
16470 properly aligned for the whole union.
16471 * lib/bitsetv.c (bitsetv_alloc): Likewise.
16472
16473 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
16474 unique names for structures.
16475 * lib/ebitset.c (ebitset_bytes): Likewise.
16476 * lib/lbitset.c (lbitset_bytes): Likewise.
16477
16478 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
16479 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
16480 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
16481 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
16482 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
16483 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
16484 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
16485 to improve the type-checking that GCC can do.
16486 * lib/bitset.c (bitset_op4_cmp): Likewise.
16487 * lib/bitset_stats.c (bitset_stats_count,
16488 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
16489 bitset_stats_copy, bitset_stats_disjoint_p,
16490 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
16491 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
16492 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
16493 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
16494 bitset_stats_and_or_cmp, bitset_stats_andn_or,
16495 bitset_stats_andn_or_cmp, bitset_stats_or_and,
16496 bitset_stats_or_and_cmp): Likewise.
16497 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
16498 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
16499 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
16500 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
16501
16502 * lib/abitset.h: Include bitset.h, not bbitset.h.
16503 * lib/ebitset.h: Likewise.
16504 * lib/lbitset.h: Likewise.
16505
16506 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
16507 All instances of parameters of type enum bitset_opts are now of
16508 type enum_bitset_opts, to conform to the C Standard, and similarly
16509 for enum_bitset_type.
16510 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
16511 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
16512
16513 Do not use "struct bitset_struct" to mean different things in
16514 different modules. Not only is this confusing, it violates
16515 the C Standard, which requires that structure types in different
16516 modules must be compatible if one is to be passed to the other.
16517 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
16518 All instances of "struct bitset_struct *" replaced with "bitset".
16519 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
16520 (union bitset_union, struct abitset_struct, struct ebitset_struct,
16521 struct lbitset_struct, struct bitset_stats_struct): New types.
16522 All uses of struct bitset_struct changed to union bitset_union,
16523 etc.
ba0fe3c7 16524 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
16525 struct bitset_struct): Remove.
16526 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
16527 struct bitset_struct): Remove.
16528 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
16529 bitset_struct): Remove.
16530 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
16531 Likewise.
16532
16533 Do not call a function of type T using a call that assumes the
16534 function is of a different type U. Standard C requires that a
16535 function must be called with a type that is compatible with its
16536 definition.
16537 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
16538 New decls.
16539 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
16540 New functions.
16541 * lib/ebitset.c (PFV): Remove.
16542 * lib/lbitset.c (PFV): Likewise.
16543 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
16544 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
16545 decls.
16546 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
16547 (ebitset_vtable): Use them.
16548 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
16549 lbitset_xor): New functions.
16550 (lbitset_vtable): Use them.
16551
16552 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
16553 Declare.
16554
16555 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
16556 GCC warning.
16557 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
16558 Use offsetof, for simplicity.
16559
6fbe4984
PE
165602002-10-06 Paul Eggert <eggert@twinsun.com>
16561
16562 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
16563 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 16564 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
16565 which was inadvertently undone by the 2002-09-30 patch.
16566 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
16567 the same width as int.
16568
420f93c8
PE
165692002-10-04 Paul Eggert <eggert@twinsun.com>
16570
16571 Version 1.50.
16572
16573 * configure.ac (AC_INIT), NEWS: Increment version number.
16574
16575 * doc/bison.texinfo: Minor spelling, grammar, and white space
16576 fixes.
16577 (Symbols): Mention that any negative value returned from yylex
16578 signifies end-of-input. Warn about negative chars. Mention
16579 the portable Standard C character set.
16580
16581 The GNU coding standard says CFLAGS and YFLAGS are reserved
16582 for the installer to set.
16583 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
16584 * src/Makefile.am (AM_CFLAGS): Likewise.
16585 (AM_YFLAGS): Renamed from YFLAGS.
16586
16587 Fix some MAX and MIN problems.
16588 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
16589 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
16590 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
16591 * src/reader.c (reader): Use it.
16592
16593 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
16594 POSIX 1003.1-2001 has removed fgrep.
16595
165962002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
16597
16598 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
16599 interpreted as signed.
16600 * lib/ebitset.c (ebitset_list): Fix bug.
16601
ff68026d
PE
166022002-10-01 Paul Eggert <eggert@twinsun.com>
16603
16604 More fixes for 64-bit hosts and large bitsets.
16605
16606 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
16607 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
16608 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
16609 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
16610 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
16611 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
16612 bitset_count_): Likewise.
16613 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
16614 bitset_first, bitset_last): Likewise.
16615 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
16616 bitset_stats_list_reverse, bitset_stats_size,
16617 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
16618 Likewise.
16619 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
16620 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
16621 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
16622 bitsetv_reflexive_transitive_closure): Likewise.
16623 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
16624 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
16625 Likewise.
16626 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
16627 Likewise.
420f93c8 16628
ff68026d
PE
16629 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
16630 Use size_t, not unsigned int, to count bytes.
16631 * lib/abitset.h (abitset_bytes): Likewise.
16632 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
16633 Likewise.
16634 * lib/bitset.h (bitset_bytes): Likewise.
16635 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
16636 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
16637 * lib/bitsetv.c (bitsetv_alloc): Likewise.
16638 * lib/ebitset.c (ebitset_bytes): Likewise.
16639 * lib/ebitset.h (ebitset_bytes): Likewise.
16640 * lib/lbitset.c (lbitset_bytes): Likewise.
16641 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 16642
ff68026d
PE
16643 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
16644 abitset_subset_p, abitset_disjoint_p, abitset_and,
16645 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
16646 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
16647 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
16648 abitset_or_and, abitset_or_and_cmp):
16649 Use bitset_windex instead of unsigned int.
16650 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
16651 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
16652 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
16653 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
16654 Likewise.
16655 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 16656
ff68026d
PE
16657 * lib/bitset.c (bitset_print):
16658 Use proper printf formats for widths of integer types.
16659 * lib/bitset_stats.c (bitset_percent_histogram_print,
16660 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
16661 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
16662 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
16663 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 16664
ff68026d
PE
16665 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
16666 BITSET_SIZE_MAX): New macros.
16667 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
16668 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
16669 to BITSET_WINDEX_MAX.
16670
16671 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
16672 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
16673 since we now return the bitset_bindex type (not int).
16674
16675 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
16676 when computing sizes.
16677 * lib/ebitset.c (ebitset_elts_grow): Likewise.
16678
16679 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
16680 and avoid cast to unsigned.
16681
6aa452a6
AD
166822002-09-30 Akim Demaille <akim@epita.fr>
16683
16684 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
16685 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
16686 Updates from Michael Hayes.
16687
927f7817
AD
166882002-09-30 Art Haas <ahaas@neosoft.com>
16689
16690 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
16691 invocations.
16692 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
16693 defined.
16694
9738f41e
AD
166952002-09-27 Akim Demaille <akim@epita.fr>
16696
16697 Version 1.49c.
16698
a5c75d7f
AD
166992002-09-27 Akim Demaille <akim@epita.fr>
16700
16701 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
16702 (Because of AC_LIBSOURCE).
16703
8280e179
AD
167042002-09-27 Akim Demaille <akim@epita.fr>
16705
16706 Playing with Autoscan.
16707
16708 * configure.ac: Remove the old LIBOBJ tweaks.
16709 (AC_REPLACE_FUNCS): Add strrchr and strtol.
16710 * lib/strrchr.c: New.
16711 * lib/strtol.c: New, from the Coreutils 4.5.1.
16712
ae64af35
AD
167132002-09-27 Akim Demaille <akim@epita.fr>
16714
16715 Playing with Autoscan.
16716
16717 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
16718 * lib/Makefile.am (libbison_a_SOURCES): No longer include
16719 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
16720 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
16721 Coreutils 4.5.1.
16722
d1a1114f
AD
167232002-09-24 Akim Demaille <akim@epita.fr>
16724
16725 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
16726 (Frequently Asked Questions, Parser Stack Overflow): New.
16727
b906441c
AD
167282002-09-13 Akim Demaille <akim@epita.fr>
16729
16730 Playing with autoscan.
16731
16732 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
16733 * src/files.c (skeleton_find): Remove, unused.
16734 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
16735 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
16736
bd701811
AD
167372002-09-13 Akim Demaille <akim@epita.fr>
16738
16739 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
16740 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
16741
e0a13e7b
AD
167422002-09-13 Akim Demaille <akim@epita.fr>
16743
16744 * configure.ac: Require 2.54.
16745 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
16746 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
16747 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
16748 Remove, provided by Autoconf macros.
16749
c97011bf
AD
167502002-09-12 Akim Demaille <akim@epita.fr>
16751
16752 * m4/prereq.m4: Update, from Coreutils 4.5.1.
16753
d862b1be
AD
167542002-09-12 Akim Demaille <akim@epita.fr>
16755
16756 * m4/prereq.m4: Update, from Fileutils 4.1.5.
16757 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
16758 Reported by Martin Mokrejs.
16759
3d38c03a
AD
167602002-09-10 Akim Demaille <akim@epita.fr>
16761
16762 * src/parse-gram.y: Associate a human readable string to each
16763 token type.
16764 * tests/regression.at (Invalid inputs): Adjust.
16765
b6347355
AD
167662002-09-10 Gary V. Vaughan <gary@gnu.org>
16767
16768 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
16769 with an Autoconf-2.5x style configure.ac.
16770
09ba4ab2
PE
167712002-09-06 Paul Eggert <eggert@twinsun.com>
16772
16773 * doc/bison.texinfo (Conditions): Make explicit that the GPL
16774 exception applies only to yacc.c. This is a modification of a
16775 patch originally suggested by Akim Demaille.
16776
21846f69
AD
167772002-09-06 Akim Demaille <akim@epita.fr>
16778
09ba4ab2
PE
16779 * data/c.m4 (b4_copyright): Move the GPL exception comment from
16780 here to...
16781 * data/yacc.c: here.
16782
21846f69
AD
16783 * data/lalr1.cc (struct yyltype): Don't define it, since we use
16784 LocationType.
16785 (b4_ltype): Default to yy::Location from location.hh.
16786
c0ad8bf3
AD
167872002-09-04 Jim Meyering <jim@meyering.net>
16788
16789 * data/yacc.c: Guard the declaration of yytoknum also with
16790 `#ifdef YYPRINT', so it is declared only when used.
16791
3a93251e
AD
167922002-09-04 Akim Demaille <akim@epita.fr>
16793
16794 * configure.in: Rename as...
16795 * configure.ac: this.
16796 Bump to 1.49c.
16797
427c0dda
AD
167982002-09-04 Akim Demaille <akim@epita.fr>
16799
16800 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
16801 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
16802 translate maintainer only messages.
16803
6a254321
PE
168042002-08-12 Paul Eggert <eggert@twinsun.com>
16805
645e30d1
PE
16806 Version 1.49b.
16807
6a254321
PE
16808 * Makefile.am (SUBDIRS): Remove intl.
16809 (DISTCLEANFILES): Remove.
16810 * NEWS: Mention that GNU M4 is now required. Clarify what is
16811 meant by "larger grammars". Mention the pt_BR translation.
16812 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
16813 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
16814 Bump version from 0.11.2 to 0.11.5.
16815 (BISON_PREREQ_STAGE): Remove.
16816 (AM_GNU_GETTEXT): Use external gettext.
16817 (AC_OUTPUT): Remove intl/Makefile.
16818
16819 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
16820
16821 * data/glr.c: Include string.h, for strlen.
16822 (yyreportParseError): Use size_t for yysize.
16823 (yy_yypstack): No longer nested inside yypstates, as nested
16824 functions are not portable. Do not assume size_t is the
16825 same width as int.
16826 (yypstates): Do not assume that ptrdiff_t is the same width
16827 as int, and similarly for yyposn and YYINDEX.
16828
16829 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
16830
16831 * lib/Makefile.am (INCLUDES): Do not include from the intl
16832 directory, which has been removed.
16833 * src/Makefile.am (INCLUDES): Likewise.
16834
16835 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
16836 (bitsets_sources, additional_bitsets_sources, timevars_sources):
16837 New vars.
16838
16839 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
16840 * tests/Makefile.am (EXTRA_DIST): Likewise.
16841
16842 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
16843 Do not assume that bitset_windex is the same width as unsigned.
16844
16845 * lib/abitset.c (abitset_unused_clear): Do not assume that
16846 bitset_word is the same width as int.
16847 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
16848 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
16849 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
16850 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
16851 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
16852
16853 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
16854 portability to one's complement hosts!).
16855 * lib/ebitset.c (ebitset_op1): Likewise.
16856 * lib/lbitset.c (lbitset_op1): Likewise.
16857
16858 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
16859 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
16860 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
16861 Sync with fileutils.
16862 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
16863 lib/gettext.h: Sync with diffutils.
16864
16865 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
16866 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
16867
16868 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
16869 PROTOTYPES to check for prototypes, and "defined __STDC__" to
16870 check for void *.
16871
16872 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
16873 size_t; the old version tried to do this but casted improperly.
16874 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
16875 (bitset_test): Now returns int, not unsigned long.
16876
16877 * lib/bitset_stats.c: Include "gettext.h".
16878 (_): New macro.
16879 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
16880 name locals "index", as it generates unnecessary warnings on some
16881 hosts that have an "index" function.
16882
16883 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
16884 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
16885 they need translation.
16886 * src/LR0.c (state_list_append, new_itemsets, get_state,
16887 append_states, generate_states): Likewise.
16888 * src/assoc.c (assoc_to_string): Likewise.
16889 * src/closure.c (print_closure, set_firsts, closure): Likewise.
16890 * src/gram.c (grammar_dump): Likewise.
16891 * src/injections.c (injections_compute): Likewise.
16892 * src/lalr.c (lookaheads_print): Likewise.
16893 * src/relation.c (relation_transpose): Likewise.
16894 * src/scan-gram.l: Likewise.
16895 * src/tables.c (table_grow, pack_vector): Likewise.
16896
16897 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
16898 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
16899 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
16900 * m4/mbstate_t.m4: Sync with fileutils.
16901 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
16902
16903 * po/LINGUAS: Add pt_BR.
16904 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
16905 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
16906 lib/timevar.c.
16907 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
16908 manual recommends.
16909 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
16910
16911 * src/complain.c (strerror_r): Remove decl; not needed.
16912 (strerror): Use same pattern as ../lib/error.c.
16913
16914 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
16915
16916 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
16917
16918 * src/main.c (main): Cast result of bindtextdomain and textdomain
16919 to void, to avoid a GCC warning when --disable-nls is in effect.
16920
16921 * src/scan-gram.l: Use strings rather than escapes when possible,
16922 to minimize the number of warnings from xgettext.
16923 (handle_action_dollar, handle_action_at): Don't use isdigit,
16924 as it mishandles negative chars and it may not work as expected
16925 outside the C locale.
16926
16927 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
16928 this is a GCC extension and is not portable to other compilers.
16929
16930 * src/system.h (alloca): Use same pattern as ../lib/error.c.
16931 Do not include <ctype.h>; no longer needed.
16932 Do not include <malloc.h>; no longer needed (and generates
16933 warnings on OpenBSD 3.0).
16934
16935 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
16936 it's not portable.
16937
16938 * tests/regression.at: Do not use 'cc -c input.c -o input';
16939 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
16940
16941 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
16942 exit status as failure, not just exit status 1. Sun C exits
16943 with status 2 sometimes.
16944
16945 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
16946 Use it for the two large tests.
16947
c8f002c7
AD
169482002-08-02 Akim Demaille <akim@epita.fr>
16949
16950 * src/conflicts.c (conflicts_output): Don't output rules never
16951 reduced here, since anyway that computation doesn't work.
16952 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
16953 (rule_useless_p, rule_never_reduced_p): New.
16954 (grammar_rules_partial_print): Use a filter instead of a range.
16955 Display the title only if needed.
16956 (grammar_rules_print): Adjust.
16957 (grammar_rules_never_reduced_report): New.
16958 * src/tables.c (action_row): Move the computation of rules never
16959 reduced to...
16960 (token_actions): here.
16961 * src/main.c (main): Make the parser before making the report, so
16962 that rules never reduced are computed.
16963 Call grammar_rules_never_reduced_report.
16964 * src/print.c (print_results): Report rules never reduced.
16965 * tests/conflicts.at, tests/reduce.at: Adjust.
16966
cd08e51e
AD
169672002-08-01 Akim Demaille <akim@epita.fr>
16968
16969 Instead of attaching lookaheads and duplicating the rules being
16970 reduced by a state, attach the lookaheads to the reductions.
16971
16972 * src/state.h (state_t): Remove the `lookaheads',
16973 `lookaheads_rule' member.
16974 (reductions_t): Add a `lookaheads' member.
16975 Use a regular array for the `rules'.
16976 * src/state.c (reductions_new): Initialize the lookaheads member
16977 to 0.
16978 (state_rule_lookaheads_print): Adjust.
16979 * src/state.h, src/state.c (state_reductions_find): New.
16980 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
16981 (count_rr_conflicts): Adjust.
16982 * src/lalr.c (LArule): Remove.
16983 (add_lookback_edge): Adjust.
16984 (state_lookaheads_count): New.
16985 (states_lookaheads_initialize): Merge into...
16986 (initialize_LA): this.
16987 (lalr_free): Adjust.
16988 * src/main.c (main): Don't free nullable and derives too early: it
16989 is used by --verbose.
16990 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
16991
bb0027a9
AD
169922002-08-01 Akim Demaille <akim@epita.fr>
16993
16994 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
16995 `rule_number_t**'.
16996 (set_derives, free_derives): Rename as...
16997 (derives_compute, derives_free): this.
16998 Adjust all dependencies.
16999 * src/nullable.c (set_nullable, free_nullable): Rename as...
17000 (nullable_compute, nullable_free): these.
17001 (rule_list_t): Store rule_t *, not rule_number_t.
17002 * src/state.c (state_rule_lookaheads_print): Directly compare rule
17003 pointers, instead of their numbers.
17004 * src/main.c (main): Call nullable_free, and derives_free earlier,
17005 as they were lo longer used.
17006
3325ddc4
AD
170072002-08-01 Akim Demaille <akim@epita.fr>
17008
17009 * lib/timevar.c (get_time): Include children time.
17010 * src/lalr.h (LA, LArule): Don't export them: used with the
17011 state_t.
17012 * src/lalr.c (LA, LArule): Static.
17013 * src/lalr.h, src/lalr.c (lalr_free): New.
17014 * src/main.c (main): Call it.
17015 * src/tables.c (pack_vector): Check whether loc is >= to the
17016 table_size, not >.
17017 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
17018 (tables_generate): do it, since that's also it which allocates
17019 them.
17020 Don't free LA and LArule, main does.
17021
c6f1a33c
AD
170222002-07-31 Akim Demaille <akim@epita.fr>
17023
17024 Separate parser tables computation and output.
17025
17026 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
17027 (conflict_list, conflict_list_cnt, table, check, table_ninf)
17028 (yydefgoto, yydefact, high): Move to...
17029 * src/tables.h, src/tables.c: here.
17030 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17031 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17032 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
17033 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
17034 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
17035 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
17036 (action_row, save_row, token_actions, save_column, default_goto)
17037 (goto_actions, sort_actions, matching_state, pack_vector)
17038 (table_ninf_remap, pack_table, prepare_actions): Move to...
17039 * src/tables.c: here.
17040 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
17041 * src/output.c (token_actions, output_base, output_conflicts)
17042 (output_check): Merge into...
17043 (prepare_actions): this.
17044 (actions_output): Rename as...
17045 (user_actions_output): this.
17046 * src/main.c (main): Call tables_generate and tables_free.
17047
1509d42f
AD
170482002-07-31 Akim Demaille <akim@epita.fr>
17049
17050 Steal GCC's --time-report support.
17051
17052 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
17053 stolen/adjusted from GCC.
17054 * m4/stage.m4: Remove time related checks.
17055 * m4/timevar.m4: New.
17056 * configure.in: Adjust.
17057 * src/system.h: Adjust to using timevar.h.
17058 * src/getargs.h, src/getargs.c: Support trace_time for
17059 --trace=time.
17060 * src/main.c (stage): Remove.
17061 (main): Replace `stage' invocations with timevar calls.
17062 * src/output.c: Insert pertinent timevar calls.
17063
273a74fa
AD
170642002-07-31 Akim Demaille <akim@epita.fr>
17065
17066 Let --trace have arguments.
17067
17068 * src/getargs.h (enum trace_e): New.
17069 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
17070 (long_options, short_options): --trace/-T takes an optional
17071 argument.
17072 Change all the uses of trace_flag to reflect the new flags.
17073 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
17074
17075 Strengthen `stage' portability.
17076
17077 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
17078 * configure.in: Use it.
17079 Don't check for malloc.h and sys/times.h.
17080 * src/system.h: Include them when appropriate.
17081 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
17082 times and struct tms are available.
17083
217598da
AD
170842002-07-30 Akim Demaille <akim@epita.fr>
17085
17086 In verbose parse error message, don't report `error' as an
17087 expected token.
17088 * tests/actions.at (Printers and Destructors): Adjust.
17089 * tests/calc.at (Calculator $1): Adjust.
17090 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
17091 error message, do not report the parser accepts the error token in
17092 that state.
17093
52489d44
AD
170942002-07-30 Akim Demaille <akim@epita.fr>
17095
17096 Normalize conflict related messages.
17097
17098 * src/complain.h, src/complain.c (warn, complain): New.
17099 * src/conflicts.c (conflicts_print): Use them.
17100 (conflict_report_yacc): New, extracted from...
17101 (conflicts_print): here.
17102 * tests/conflicts.at, tests/existing.at: Adjust.
17103
e8832397
AD
171042002-07-30 Akim Demaille <akim@epita.fr>
17105
17106 Report rules which are never reduced by the parser: those hidden
17107 by conflicts.
17108
17109 * src/LR0.c (save_reductions): Don't make the final state too
17110 different: save its reduction (accept) instead of having a state
17111 without any action (no shift or goto, no reduce).
17112 Note: the final state is now a ``regular'' state, i.e., the
17113 parsers now contain `reduce 0' as default reduction.
17114 Nevertheless, since they decide to `accept' when yystate =
17115 final_state, they still will not reduce rule 0.
17116 * src/print.c (print_actions, print_reduction): Adjust.
17117 * src/output.c (action_row): Track reduced rules.
17118 (token_actions): Report rules never reduced.
17119 * tests/conflicts.at, tests/regression.at: Adjust.
17120
caf23d24
AD
171212002-07-30 Akim Demaille <akim@epita.fr>
17122
17123 `stage' was accidently included in a previous patch.
17124 Initiate its autoconfiscation.
17125
17126 * configure.in: Look for malloc.h and sys/times.h.
17127 * src/main.c (stage): Adjust.
17128 Report only when trace_flag.
17129
640748ee
AD
171302002-07-29 Akim Demaille <akim@epita.fr>
17131
17132 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
17133 state_number_t.
17134 (errs_t): symbol_t*, not symbol_number_t.
17135 (reductions_t): rule_t*, not rule_number_t.
17136 (FOR_EACH_SHIFT): New.
17137 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
17138 * src/print.c, src/print_graph.c: Adjust.
17139
88bce5a2
AD
171402002-07-29 Akim Demaille <akim@epita.fr>
17141
17142 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
17143
17144 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
17145 (endtoken, accept): these.
17146 * src/reader.c (reader): Set endtoken's default tag to "$end".
17147 Set undeftoken's tag to "$undefined" instead of "$undefined.".
17148 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
17149 Adjust.
17150
1bfb97db
AD
171512002-07-29 Akim Demaille <akim@epita.fr>
17152
17153 * src/reduce.c (reduce_grammar): When the language is empty,
17154 complain about the start symbol, not the axiom.
17155 Use its location.
17156 * tests/reduce.at (Empty Language): New.
17157
fc5734fe
AD
171582002-07-26 Akim Demaille <akim@epita.fr>
17159
17160 * src/reader.h, src/reader.c (gram_error): ... can't get
17161 yycontrol without making too strong assumptions on the parser
17162 itself.
17163 * src/output.c (prepare_tokens): Use the real 0th value of
17164 token_translations instead of `0'.
17165 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
17166 visible here.
17167 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
17168 for the time being: %locations ought to provide it to yyerror.
17169
3650b4b8
AD
171702002-07-25 Akim Demaille <akim@epita.fr>
17171
17172 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
17173 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
17174 * tests/regression.at (Web2c Actions): Adjust.
17175
4b3d3a8e
AD
171762002-07-25 Akim Demaille <akim@epita.fr>
17177
17178 Stop storing rules from 1 to nrules + 1.
17179
17180 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
17181 * src/nullable.c, src/output.c, src/print.c, src/reader.c
17182 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
17183 Iterate from 0 to nrules.
17184 Use rule_number_as_item_number and item_number_as_rule_number.
17185 Adjust to `derive' now containing possibly 0.
17186 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
17187 Handle the `- 1' part in rule numbers from/to item numbers.
17188 * src/conflicts.c (log_resolution): Fix the message which reversed
17189 shift and reduce.
17190 * src/output.c (action_row): Initialize default_rule to -1.
17191 (token_actions): Adjust.
17192 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
17193 expected output.
17194 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
17195
4a2a22f4
AD
171962002-07-25 Akim Demaille <akim@epita.fr>
17197
17198 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
17199 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
17200 (b4_c_knr_arg_decl): New.
17201 * data/yacc.c: Use it to define yysymprint, yydestruct, and
17202 yyreport_parse_error.
17203
b8df3223
AD
172042002-07-25 Akim Demaille <akim@epita.fr>
17205
17206 * data/yacc.c (yyreport_parse_error): New, extracted from...
17207 (yyparse): here.
17208 (yydestruct, yysymprint): Move above yyparse.
17209 Be K&R compliant.
17210
a762e609
AD
172112002-07-25 Akim Demaille <akim@epita.fr>
17212
17213 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
17214 replace...
17215 (b4_sint_type, b4_uint_type): these.
17216 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
17217 * tests/regression.at (Web2c Actions): Adjust.
17218
12b0043a
AD
172192002-07-25 Akim Demaille <akim@epita.fr>
17220
17221 * src/gram.h (TIEM_NUMBER_MAX): New.
17222 (item_number_of_rule_number, rule_number_of_item_number): Rename
17223 as...
17224 (rule_number_as_item_number, item_number_as_rule_number): these.
17225 Adjust dependencies.
17226 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17227 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17228 (symbol_number_to_vector_number): New.
17229 (order): Of vector_number_t* type.
17230 (base_t, BASE_MAX, BASE_MIN): New.
17231 (froms, tos, width, pos, check): Of base_t type.
17232 (action_number_t, ACTION_MIN, ACTION_MAX): New.
17233 (actrow): Of action_number_t type.
17234 (conflrow): Of unsigned int type.
17235 (table_ninf, base_ninf): New.
17236 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
17237 (muscle_insert_int_table, muscle_insert_base_table)
17238 (muscle_insert_rule_number_table): New.
17239 (prepare_tokens): Output `toknum' as int_table.
17240 (action_row): Returns a rule_number_t.
17241 Use ACTION_MIN, not SHRT_MIN.
17242 (token_actions): yydefact is rule_number_t*.
17243 (table_ninf_remap): New.
17244 (pack_table): Use it for `base' and `table'.
17245 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
17246 replaced with...
17247 (YYPACT_NINF, YYTABLE_NINF): these.
17248 (yypact, yytable): Compute their types instead of hard-coded
17249 `short'.
17250 * tests/regression.at (Web2c Actions): Adjust.
17251
5dde258a
AD
172522002-07-19 Akim Demaille <akim@epita.fr>
17253
17254 * src/scan-gram.l (id): Can start with an underscore.
17255
a945ec39
AD
172562002-07-16 Akim Demaille <akim@epita.fr>
17257
17258 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
17259 Adjust all former `associativity' dependencies.
17260 * src/symtab.c (symbol_new): Default associativity is `undef', not
17261 `right'.
17262 (symbol_check_alias_consistence): Adjust.
17263
fae437e8
AD
172642002-07-09 Akim Demaille <akim@epita.fr>
17265
17266 * doc/bison.texinfo: Properly set the ``header'' part.
17267 Use @dircategory ``GNU programming tools'' as per Texinfo's
17268 documentation.
17269 Use @copying.
17270
1a715ef2
AD
172712002-07-09 Akim Demaille <akim@epita.fr>
17272
17273 * lib/quotearg.h: Protect against multiple inclusions.
17274 * src/location.h (location_t): Add a `file' member.
17275 (LOCATION_RESET, LOCATION_PRINT): Adjust.
17276 * src/complain.c (warn_at, complain_at, fatal_at): Drop
17277 `error_one_per_line' support.
17278
a5d50994
AD
172792002-07-09 Akim Demaille <akim@epita.fr>
17280
17281 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
17282 * src/reader.c (lineno): Remove.
17283 Adjust all dependencies.
17284 (get_merge_function): Take a location and use complain_at.
17285 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
17286 * tests/regression.at (Invalid inputs, Mixing %token styles):
17287 Adjust.
17288
b275314e
AD
172892002-07-09 Akim Demaille <akim@epita.fr>
17290
17291 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
17292 recovery rule, and forbid extensions when --yacc.
17293 (gram_error): Use complain_at.
17294 * src/reader.c (reader): Exit if there were parse errors.
17295
865b9df1
AD
172962002-07-09 Akim Demaille <akim@epita.fr>
17297
17298 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
17299 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
17300 Reported by R Blake <blakers@mac.com>.
17301
c76e14da
AD
173022002-07-09 Akim Demaille <akim@epita.fr>
17303
17304 * data/yacc.c: Output the copyright notive in the header.
17305
7db2ed2d
AD
173062002-07-03 Akim Demaille <akim@epita.fr>
17307
17308 * src/output.c (froms, tos): Are state_number_t.
17309 (save_column): sp, sp1, and sp2 are state_number_t.
17310 (prepare): Rename `final' as `final_state_number', `nnts' as
17311 `nterms_number', `nrules' as `rules_number', `nstates' as
17312 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
17313 unused.
17314 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
17315 * data/lalr1.cc (nsym_): Remove, unused.
17316
e68e0410
AD
173172002-07-03 Akim Demaille <akim@epita.fr>
17318
17319 * src/lalr.h, src/lalr.c (goto_number_t): New.
17320 * src/lalr.c (goto_list_t): New.
17321 Propagate them.
17322 * src/nullable.c (rule_list_t): New.
17323 Propagate.
17324 * src/types.h: Remove.
17325
e1a4f3a4
AD
173262002-07-03 Akim Demaille <akim@epita.fr>
17327
17328 * src/closure.c (print_fderives): Use rule_rhs_print.
17329 * src/derives.c (print_derives): Use rule_rhs_print.
17330 (rule_list_t): New, replaces `shorts'.
17331 (set_derives): Add comments.
17332 * tests/sets.at (Nullable, Firsts): Adjust.
17333
536545f3
AD
173342002-07-03 Akim Demaille <akim@epita.fr>
17335
17336 * src/output.c (prepare_actions): Free `tally' and `width'.
17337 (prepare_actions): Allocate and free `order'.
17338 * src/symtab.c (symbols_free): Free `symbols'.
17339 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
17340 * src/output.c (m4_invoke): Move to...
17341 * src/scan-skel.l: here.
17342 (<<EOF>>): Close yyout, and free its name.
17343
8b752b00
AD
173442002-07-03 Akim Demaille <akim@epita.fr>
17345
17346 Fix some memory leaks, and fix a bug: state 0 was examined twice.
17347
17348 * src/LR0.c (new_state): Merge into...
17349 (state_list_append): this.
17350 (new_states): Merge into...
17351 (generate_states): here.
17352 (set_states): Don't ensure a proper `errs' state member here, do it...
17353 * src/conflicts.c (conflicts_solve): here.
17354 * src/state.h, src/state.c: Comment changes.
17355 (state_t): Rename member `shifts' as `transitions'.
17356 Adjust all dependencies.
17357 (errs_new): For consistency, also take the values as argument.
17358 (errs_dup): Remove.
17359 (state_errs_set): New.
17360 (state_reductions_set, state_transitions_set): Assert that no
17361 previous value was assigned.
17362 (state_free): New.
17363 (states_free): Use it.
17364 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
17365 temporary storage: use `errs' and `nerrs' as elsewhere.
17366 (set_conflicts): Allocate and free this `errs'.
17367
613f5e1a
AD
173682002-07-02 Akim Demaille <akim@epita.fr>
17369
17370 * lib/libiberty.h: New.
17371 * lib: Update the bitset implementation from upstream.
17372 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
17373 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
17374 * src/main.c: Adjust bitset stats calls.
17375
26e0cadc
PE
173762002-07-01 Paul Eggert <eggert@twinsun.com>
17377
17378 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
17379 char, so that negative chars don't collide with $.
17380
1154cced
AD
173812002-06-30 Akim Demaille <akim@epita.fr>
17382
17383 Have the GLR tests be `warning' checked, and fix the warnings.
17384
17385 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
17386 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
17387 (yyremoveDeletes): `yyi' and `yyj' are size_t.
17388 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
17389 (yyaddDeferredAction): static.
17390 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
17391 (yyreportParseError): yyprefix is const.
17392 yytokenp is used only when verbose.
17393 (yy__GNUC__): Replace with __GNUC__.
17394 (yypdumpstack): yyi is size_t.
17395 (yypreference): Un-yy local variables and arguments, to avoid
17396 clashes with `yyr1'. Anyway, we are not in the user name space.
17397 (yytname_size): be an int, as is compared with ints.
17398 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
17399 Use them.
17400 * tests/cxx-gram.at: Use quotation to protect $1.
17401 Use AT_COMPILE to enable warnings hunts.
17402 Prototype yylex and yyerror.
17403 `Use' argc.
17404 Include `string.h', not `strings.h'.
17405 Produce and prototype stmtMerge only when used.
17406 yylex takes a location.
17407
97650f4e
AD
174082002-06-30 Akim Demaille <akim@epita.fr>
17409
17410 We spend a lot of time in quotearg, in particular when --verbose.
17411
17412 * src/symtab.c (symbol_get): Store a quoted version of the key.
17413 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
17414 Adjust all callers.
17415
d2576365
AD
174162002-06-30 Akim Demaille <akim@epita.fr>
17417
17418 * src/state.h (reductions_t): Rename member `nreds' as num.
17419 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
17420 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
17421
ccaf65bc
AD
174222002-06-30 Akim Demaille <akim@epita.fr>
17423
17424 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
17425 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
17426 (shifts_to): Rename as...
17427 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
17428 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
17429 (TRANSITION_IS_DISABLED, transitions_to): these.
17430
87675353
AD
174312002-06-30 Akim Demaille <akim@epita.fr>
17432
17433 * src/print.c (print_shifts, print_gotos): Merge into...
17434 (print_transitions): this.
17435 (print_transitions, print_errs, print_reductions): Align the
17436 lookaheads columns.
17437 (print_core, print_transitions, print_errs, print_state,
17438 print_grammar): Output empty lines separator before, not after.
17439 (state_default_rule_compute): Rename as...
17440 (state_default_rule): this.
17441 * tests/conflicts.at (Defaulted Conflicted Reduction),
17442 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
17443 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
17444
ce4ccb4b
AD
174452002-06-30 Akim Demaille <akim@epita.fr>
17446
17447 Display items as we display rules.
17448
17449 * src/gram.h, src/gram.c (rule_lhs_print): New.
17450 * src/gram.c (grammar_rules_partial_print): Use it.
17451 * src/print.c (print_core): Likewise.
17452 * tests/conflicts.at (Defaulted Conflicted Reduction),
17453 (Unresolved SR Conflicts): Adjust.
17454 (Unresolved SR Conflicts): Adjust and rename as...
17455 (Resolved SR Conflicts): this, as was meant.
17456 * tests/regression.at (Web2c Report): Adjust.
17457
bc933ef1
AD
174582002-06-30 Akim Demaille <akim@epita.fr>
17459
17460 * src/print.c (state_default_rule_compute): New, extracted from...
17461 (print_reductions): here.
17462 Pessimize, but clarify the code.
17463 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
17464
53d4308d
AD
174652002-06-30 Akim Demaille <akim@epita.fr>
17466
17467 * src/output.c (action_row): Let default_rule be always a rule
17468 number.
17469
574fb2d5
AD
174702002-06-30 Akim Demaille <akim@epita.fr>
17471
17472 * src/closure.c (print_firsts, print_fderives, closure):
17473 Use BITSET_EXECUTE.
17474 * src/lalr.c (lookaheads_print): Likewise.
17475 * src/state.c (state_rule_lookaheads_print): Likewise.
17476 * src/print_graph.c (print_core): Likewise.
17477 * src/print.c (print_reductions): Likewise.
17478 * src/output.c (action_row): Likewise.
17479 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
17480
05811fd7
AD
174812002-06-30 Akim Demaille <akim@epita.fr>
17482
17483 * src/print_graph.c: Use report_flag.
17484
0e4d5753
AD
174852002-06-30 Akim Demaille <akim@epita.fr>
17486
17487 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
17488 to...
17489 * src/relation.h, src/relation.c (traverse, relation_digraph)
17490 (relation_print, relation_transpose): New.
17491
24c7d800
AD
174922002-06-30 Akim Demaille <akim@epita.fr>
17493
17494 * src/state.h, src/state.c (shifts_to): New.
17495 * src/lalr.c (build_relations): Use it.
17496
9222837b
AD
174972002-06-30 Akim Demaille <akim@epita.fr>
17498
17499 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
17500 (item_number_of_rule_number, rule_number_of_item_number): New.
17501 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
17502 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
17503 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
17504 Propagate their use.
17505 Much remains to be done, in particular wrt `shorts' from types.h.
17506
260008e5
AD
175072002-06-30 Akim Demaille <akim@epita.fr>
17508
17509 * src/symtab.c (symbol_new): Initialize the `printer' member.
17510
8a731ca8
AD
175112002-06-30 Akim Demaille <akim@epita.fr>
17512
17513 * src/LR0.c (save_reductions): Remove, replaced by...
17514 * src/state.h, src/state.c (state_reductions_set): New.
17515 (reductions, errs): Rename as...
17516 (reductions_t, errs_t): these.
17517 Adjust all dependencies.
17518
32e1e0a4
AD
175192002-06-30 Akim Demaille <akim@epita.fr>
17520
17521 * src/LR0.c (state_list_t, state_list_append): New.
17522 (first_state, last_state): Now symbol_list_t.
17523 (this_state): Remove.
17524 (new_itemsets, append_states, save_reductions): Take a state_t as
17525 argument.
17526 (set_states, generate_states): Adjust.
17527 (save_shifts): Remove, replaced by...
17528 * src/state.h, src/state.c (state_shifts_set): New.
17529 (shifts): Rename as...
17530 (shifts_t): this.
17531 Adjust all dependencies.
17532 * src/state.h (state_t): Remove the `next' member.
17533
e5fb6710
AD
175342002-06-30 Akim Demaille <akim@epita.fr>
17535
17536 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
17537 escaped in slot 0.
17538
c7ca99d4
AD
175392002-06-30 Akim Demaille <akim@epita.fr>
17540
17541 Use hash.h for the state hash table.
17542
17543 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
17544 (allocate_storage): Use state_hash_new.
17545 (free_storage): Use state_hash_free.
17546 (new_state, get_state): Adjust.
17547 * src/lalr.h, src/lalr.c (states): Move to...
17548 * src/states.h (state_t): Remove the `link' member, no longer
17549 used.
17550 * src/states.h, src/states.c: here.
17551 (state_hash_new, state_hash_free, state_hash_lookup)
17552 (state_hash_insert, states_free): New.
17553 * src/states.c (state_table, state_compare, state_hash): New.
17554 * src/output.c (output_actions): Do not free states now, since we
17555 still need to know the final_state number in `prepare', called
17556 afterwards. Do it...
17557 * src/main.c (main): here: call states_free after `output'.
17558
df0e7316
AD
175592002-06-30 Akim Demaille <akim@epita.fr>
17560
17561 * src/state.h, src/state.c (state_new): New, extracted from...
17562 * src/LR0.c (new_state): here.
17563 * src/state.h (STATE_ALLOC): Move to...
17564 * src/state.c: here.
17565 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
17566 * src/state.h, src/state.c: here.
17567
39f41916
AD
175682002-06-30 Akim Demaille <akim@epita.fr>
17569
17570 * src/reader.c (gensym): Rename as...
17571 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
17572 (getsym): Rename as...
17573 (symbol_get): this.
17574
d57650a5
AD
175752002-06-30 Akim Demaille <akim@epita.fr>
17576
17577 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
17578 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
17579 * src/output.c, src/print.c, src/print_graph.c: Propagate.
17580 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
17581
5a08f1ce
AD
175822002-06-30 Akim Demaille <akim@epita.fr>
17583
17584 Make the test suite pass with warnings checked.
17585
17586 * tests/actions.at (Printers and Destructors): Improve.
17587 Avoid unsigned vs. signed issues.
17588 * tests/calc.at: Don't exercise the scanner here, do it...
17589 * tests/input.at (Torturing the Scanner): here.
17590
720623af
PH
175912002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17592
88e7e941 17593 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
17594 reorganize first lines parallel to yacc.c.
17595
fb8135fa
AD
175962002-06-28 Akim Demaille <akim@epita.fr>
17597
17598 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
17599 (b4_token_enum, b4_token_defines): New, factored from...
17600 * data/lalr1.cc, data/yacc.c, glr.c: here.
17601
41442480
AD
176022002-06-28 Akim Demaille <akim@epita.fr>
17603
17604 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
17605 unused variables.
17606 * src/output.c (merger_output): static.
17607
e0e5bf84
AD
176082002-06-28 Akim Demaille <akim@epita.fr>
17609
ba0fe3c7 17610 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
17611 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
17612 pacify GCC.
17613 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 17614
676385e2
PH
176152002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17616
17617 Accumulated changelog for new GLR parsing features.
17618
6a254321 17619 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
17620 conflicts_total_count.
17621 * src/conflicts.h: Ditto.
17622 * src/output.c (token_actions): Use the new name.
17623 (output_conflicts): Change conflp => conflict_list_heads, and
17624 confl => conflict_list for better readability.
17625 * data/glr.c: Use the new names.
17626 * NEWS: Add self to GLR announcement.
e0e5bf84 17627
676385e2
PH
17628 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
17629
17630 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
17631 Akim Demaille.
17632
17633 * data/bison.glr: Change name to glr.c
17634 * data/glr.c: Renamed from bison.glr.
17635 * data/Makefile.am: Add glr.c
e0e5bf84
AD
17636
17637 * src/getargs.c:
17638
676385e2 17639 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 17640 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 17641
676385e2
PH
17642 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17643
17644 * data/bison.glr: Be sure to restore the
17645 current #line when returning to the skeleton contents after having
17646 exposed the input file's #line.
17647
17648 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17649
17650 * data/bison.glr: Bring up to date with changes to bison.simple.
17651
17652 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17653
17654 * data/bison.glr: Correct definitions that use b4_prefix.
17655 Various reformatting.
17656 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
17657 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
17658 yytokenp argument; now part of stack.
17659 (yychar): Define to behave as documented.
17660 (yyclearin): Ditto.
e0e5bf84 17661
676385e2
PH
17662 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17663
17664 * src/reader.h: Add declaration for free_merger_functions.
17665
17666 * src/reader.c (merge_functions): New variable.
17667 (get_merge_function): New function.
17668 (free_merger_functions): New function.
17669 (readgram): Check for %prec that is not followed by a symbol.
17670 Handle %dprec and %merge declarations.
17671 (packgram): Initialize dprec and merger fields in rules array.
17672
17673 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
17674 conflict_list_cnt, conflict_list_free): New variables.
17675 (table_grow): Also grow conflict_table.
e0e5bf84 17676 (prepare_rules): Output dprec and merger tables.
676385e2 17677 (conflict_row): New function.
e0e5bf84 17678 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
17679 default reduction in conflicted states for GLR parser so that there
17680 are spaces for the conflict lists.
17681 (save_row): Also save conflict information.
17682 (token_actions): Allocate conflict list.
17683 (merger_output): New function.
17684 (pack_vector): Pack conflict table, too.
17685 (output_conflicts): New function to output yyconflp and yyconfl.
17686 (output_check): Allocate conflict_tos.
17687 (output_actions): Output conflict tables, also.
17688 (output_skeleton): Output b4_mergers definition.
17689 (prepare): Output b4_max_rhs_length definition.
17690 Use 'bison.glr' as default skeleton for GLR parsers.
17691
17692 * src/gram.c (glr_parser): New flag.
17693 (grammar_free): Call free_merger_functions.
17694
17695 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
17696 all pairs of conflicting reductions, rather than just all tokens
17697 causing conflicts. Needed to size conflict tables.
e0e5bf84 17698 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
17699 interface.
17700 (conflicts_print): Ditto.
17701 (count_total_conflicts): New function.
17702
17703 * src/reader.h (merger_list): New type.
17704 (merge_functions): New variable.
17705
17706 * src/lex.h (tok_dprec, tok_merge): New token types.
17707
17708 * src/gram.h (rule_s): Add dprec and merger fields.
17709 (glr_parser): New flag.
17710
17711 * src/conflicts.h (count_total_conflicts): New function.
17712
17713 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
17714
17715 * doc/bison.texinfo (Generalized LR Parsing): New section.
17716 (GLR Parsers): New section.
17717 (Language and Grammar): Mention GLR parsing.
17718 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
17719 Correct typo ("tge" -> "the").
17720
17721 * data/bison.glr: New skeleton for GLR parsing.
17722
17723 * tests/cxx-gram.at: New tests for GLR parsing.
17724
17725 * tests/testsuite.at: Include cxx-gram.at.
17726
17727 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 17728
676385e2
PH
17729 * src/parse-gram.y:
17730
17731 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
17732
17733 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 17734
b5480d74 177352002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
17736
17737 * src/options.h, src/options.c: Remove.
17738 * src/getargs.c (short_options, long_options): New.
17739
60491a94
AD
177402002-06-27 Akim Demaille <akim@epita.fr>
17741
17742 * data/bison.simple, data/bison.c++: Rename as...
17743 * data/yacc.c, data/lalr1.cc: these.
17744 * doc/bison.texinfo (Environment Variables): Remove.
17745
9be0c25b
AD
177462002-06-25 Raja R Harinath <harinath@cs.umn.edu>
17747
17748 * src/getargs.c (report_argmatch): Initialize strtok().
17749
1ae72863
AD
177502002-06-20 Akim Demaille <akim@epita.fr>
17751
17752 * data/bison.simple (b4_symbol_actions): New, replaces...
17753 (b4_symbol_destructor, b4_symbol_printer): these.
17754 (yysymprint): Be sure to call YYPRINT only for tokens, and using
17755 user token numbers.
17756
87542d29
AD
177572002-06-20 Akim Demaille <akim@epita.fr>
17758
17759 * data/bison.simple (yydestructor): Rename as...
17760 (yydestruct): this.
17761
1a31ed21
AD
177622002-06-20 Akim Demaille <akim@epita.fr>
17763
17764 * src/symtab.h, src/symtab.c (symbol_type_set)
17765 (symbol_destructor_set, symbol_precedence_set): The location is
17766 the last argument.
17767 Adjust all callers.
17768
e776192e
AD
177692002-06-20 Akim Demaille <akim@epita.fr>
17770
17771 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
17772 internals.
17773 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
17774 Takes a location.
17775 * src/symtab.h, src/symtab.c (symbol_class_set)
17776 (symbol_user_token_number_set): Likewise.
17777 Adjust all callers.
17778 Promote complain_at.
17779 * tests/input.at (Type Clashes): Adjust.
17780
5c1180b3
AD
177812002-06-20 Akim Demaille <akim@epita.fr>
17782
17783 * data/bison.simple (YYLEX): Fix the declaration when
17784 %pure-parser.
17785
e3170060
AD
177862002-06-20 Akim Demaille <akim@epita.fr>
17787
17788 * data/bison.simple (yysymprint): Don't print the token number,
17789 just its name.
17790 * tests/actions.at (Destructors): Rename as...
17791 (Printers and Destructors): this.
17792 Also exercise %printer.
17793
253862fd
AD
177942002-06-20 Akim Demaille <akim@epita.fr>
17795
17796 * data/bison.simple (YYDSYMPRINT): New.
17797 Use it to remove many of the #if YYDEBUG/if (yydebug).
17798
366eea36
AD
177992002-06-20 Akim Demaille <akim@epita.fr>
17800
17801 * src/symtab.h, src/symtab.c (symbol_t): printer and
17802 printer_location are new members.
17803 (symbol_printer_set): New.
17804 * src/parse-gram.y (PERCENT_PRINTER): New token.
17805 Handle its associated rule.
17806 * src/scan-gram.l: Adjust.
17807 (handle_destructor_at, handle_destructor_dollar): Rename as...
17808 (handle_symbol_code_at, handle_symbol_code_dollar): these.
17809 * src/output.c (symbol_printers_output): New.
17810 (output_skeleton): Call it.
17811 * data/bison.simple (yysymprint): New. Cannot be named yyprint
17812 since there are already many grammar files with a user `yyprint'.
17813 Replace the calls to YYPRINT to calls to yysymprint.
17814 * tests/calc.at: Adjust.
17815 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
17816 taking advantage of parser very internal details (stack size!).
17817
4f25ebb0
AD
178182002-06-20 Akim Demaille <akim@epita.fr>
17819
17820 * src/scan-gram.l: Complete the scanner with the missing patterns
17821 to pacify Flex.
17822 Use `quote' and `symbol_tag_get' where appropriate.
17823
93b68a0e
AD
178242002-06-19 Akim Demaille <akim@epita.fr>
17825
17826 * tests/actions.at (Destructors): Augment to test locations.
17827 * data/bison.simple (yydestructor): Pass it the current location
17828 if locations are enabled.
17829 Prototype only when __STDC__ or C++.
17830 Change the argument names to move into the yy name space: there is
17831 user code here.
17832
58612f1d
AD
178332002-06-19 Akim Demaille <akim@epita.fr>
17834
74310291
AD
17835 * data/bison.simple (b4_pure_if): New.
17836 Use it instead of #ifdef YYPURE.
17837
178382002-06-19 Akim Demaille <akim@epita.fr>
17839
17840 * data/bison.simple (b4_location_if): New.
58612f1d
AD
17841 Use it instead of #ifdef YYLSP_NEEDED.
17842
f25bfb75
AD
178432002-06-19 Akim Demaille <akim@epita.fr>
17844
17845 Prepare @$ in %destructor, but currently don't bind it in the
17846 skeleton, as %location use is not cleaned up yet.
17847
17848 * src/scan-gram.l (handle_dollar, handle_destructor_at)
17849 (handle_action_at): New.
17850 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
17851 a braced_code_t and a location as additional arguments.
17852 (handle_destructor_dollar): Instead of requiring `b4_eval', just
17853 unquote one when outputting `b4_dollar_dollar'.
17854 Adjust callers.
17855 * data/bison.simple (b4_eval): Remove.
17856 (b4_symbol_destructor): Adjust.
17857 * tests/input.at (Invalid @n): Adjust.
17858
c732d2c6
AD
178592002-06-19 Zack Weinberg <zack@codesourcery.com>
17860
17861 * doc/bison.texinfo: Document ability to have multiple
17862 prologue sections.
17863
8c165d89
AD
178642002-06-18 Akim Demaille <akim@epita.fr>
17865
17866 * src/files.c (compute_base_names): When computing the output file
17867 names from the input file name, strip the directory part.
17868
ca98bf57
AD
178692002-06-18 Akim Demaille <akim@epita.fr>
17870
17871 * data/bison.simple.new: Comment changes.
17872 Reported by Andreas Schwab.
17873
0bfb02ff
AD
178742002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
17875
17876 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
17877 there are no `label `yyoverflowlab' defined but not used' warnings
17878 when yyoverflow is defined.
17879
24c0aad7
AD
178802002-06-18 Akim Demaille <akim@epita.fr>
17881
17882 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
17883 new member.
17884 (symbol_destructor_set): Adjust.
17885 * src/output.c (symbol_destructors_output): Output the destructor
17886 locations.
17887 Output the symbol name.
17888 * data/bison.simple (b4_symbol_destructor): Adjust.
17889
5719c109
AD
178902002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
17891 and Akim Demaille <akim@epita.fr>
17892
17893 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
17894 what's left on the stack when the error recovery hits EOF.
17895 * tests/actions.at (Destructors): Complete to exercise this case.
17896
9280d3ef
AD
178972002-06-17 Akim Demaille <akim@epita.fr>
17898
17899 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
17900 arguments is really empty, not only equal to `[]'.
17901 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
17902 member.
17903 (symbol_destructor_set): New.
17904 * src/output.c (symbol_destructors_output): New.
17905 * src/reader.h (brace_code_t, current_braced_code): New.
17906 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
17907 (handle_dollar): Rename as...
17908 (handle_action_dollar): this.
17909 (handle_destructor_dollar): New.
17910 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
17911 (grammar_declaration): Use it.
17912 * data/bison.simple (yystos): Is always defined.
17913 (yydestructor): New.
17914 * tests/actions.at (Destructors): New.
17915 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
17916
dafdc66f
AD
179172002-06-17 Akim Demaille <akim@epita.fr>
17918
17919 * src/symlist.h, src/symlist.c (symbol_list_length): New.
17920 * src/scan-gram.l (handle_dollar, handle_at): Compute the
17921 rule_length only when needed.
17922 * src/output.c (actions_output, token_definitions_output): Output
17923 the full M4 block.
17924 * src/symtab.c: Don't access directly to the symbol tag, use
17925 symbol_tag_get.
17926 * src/parse-gram.y: Use symbol_list_free.
17927
56c47203
AD
179282002-06-17 Akim Demaille <akim@epita.fr>
17929
17930 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
17931 (symbol_list_prepend, get_type_name): Move to...
17932 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
17933 (symbol_list_prepend, symbol_list_n_type_name_get): here.
17934 Adjust all callers.
17935 (symbol_list_free): New.
17936 * src/scan-gram.l (handle_dollar): Takes a location.
17937 * tests/input.at (Invalid $n): Adjust.
17938
1e0bab92
AD
179392002-06-17 Akim Demaille <akim@epita.fr>
17940
17941 * src/reader.h, src/reader.c (symbol_list_new): Export it.
17942 (symbol_list_prepend): New.
17943 * src/parse-gram.y (%union): `list' is a new member.
17944 (symbols.1): New, replaces...
17945 (terms_to_prec.1, nterms_to_type.1): these.
17946 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
17947 Take a location as additional argument.
17948 Adjust all callers.
17949
04e60654
AD
179502002-06-15 Akim Demaille <akim@epita.fr>
17951
17952 * src/parse-gram.y: Move %token in the declaration section so that
17953 we don't depend upon CVS Bison.
17954
10e5b8bd
AD
179552002-06-15 Akim Demaille <akim@epita.fr>
17956
17957 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
17958 * src/print.c (print_core): Use it.
17959
9801d40c
AD
179602002-06-15 Akim Demaille <akim@epita.fr>
17961
17962 * src/conflicts.c (log_resolution): Accept the rule involved in
17963 the sr conflicts instead of the lookahead number that points to
17964 that rule.
17965 (flush_reduce): Accept the current lookahead vector as argument,
17966 instead of the index in LA.
17967 (resolve_sr_conflict): Accept the current number of lookahead
17968 bitset to consider for the STATE, instead of the index in LA.
17969 (set_conflicts): Adjust.
17970 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
17971
c0263492
AD
179722002-06-15 Akim Demaille <akim@epita.fr>
17973
17974 * src/state.h (state_t): Replace the `lookaheadsp' member, a
17975 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
17976 Adjust all dependencies.
17977 * src/lalr.c (initialize_lookaheads): Split into...
17978 (states_lookaheads_count, states_lookaheads_initialize): these.
17979 (lalr): Adjust.
17980
9757c359
AD
179812002-06-15 Akim Demaille <akim@epita.fr>
17982
17983 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
17984 out of...
17985 (grammar_rules_print): here.
17986 * src/reduce.c (reduce_output): Use it.
17987 * tests/reduce.at (Useless Rules, Reduced Automaton)
17988 (Underivable Rules): Adjust.
17989
6b98e4b5
AD
179902002-06-15 Akim Demaille <akim@epita.fr>
17991
17992 Copy BYacc's nice way to report the grammar.
17993
17994 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
17995 New.
17996 Don't print the rules' location, it is confusing and useless.
17997 (rule_print): Use grammar_rhs_print.
17998 * src/print.c (print_grammar): Use grammar_rules_print.
17999
6b98e4b5
AD
180002002-06-15 Akim Demaille <akim@epita.fr>
18001
18002 Complete and rationalize `useless thing' warnings.
18003
18004 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
18005 (symbol_tag_print): New.
18006 Use them everywhere in place of accessing directly the tag member.
18007 * src/gram.h, src/gram.c (rule_print): New.
18008 Use it where a rule used to be printed `by hand'.
18009 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
18010 (reduce_grammar_tables): Report the useless rules.
18011 (reduce_print): Useless things are a warning, not an error.
18012 Report it as such.
18013 * tests/reduce.at (Useless Nonterminals, Useless Rules):
18014 (Reduced Automaton, Underivable Rules): Adjust.
18015 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
18016 * tests/conflicts.at (Unresolved SR Conflicts)
18017 (Solved SR Conflicts): Adjust.
18018
ee000ba4
AD
180192002-06-15 Akim Demaille <akim@epita.fr>
18020
18021 Let symbols have a location.
18022
18023 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
18024 (getsym): Adjust.
18025 Adjust all callers.
18026 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
18027 Use location_t, not int.
18028 * src/symtab.c (symbol_check_defined): Take advantage of the
18029 location.
18030 * tests/regression.at (Invalid inputs): Adjust.
18031
8efe435c
AD
180322002-06-15 Akim Demaille <akim@epita.fr>
18033
18034 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
18035 (input): Don't try to initialize yylloc here, do it in the
18036 scanner.
18037 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
18038 * src/gram.h (rule_t): Change line and action_line into location
18039 and action_location, of location_t type.
18040 Adjust all dependencies.
18041 * src/location.h, src/location.c (empty_location): New.
18042 * src/reader.h, src/reader.c (grammar_start_symbol_set)
18043 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
18044 (grammar_current_rule_symbol_append)
18045 (grammar_current_rule_action_append): Expect a location as argument.
18046 * src/reader.c (grammar_midrule_action): Adjust to attach an
18047 action's location as dummy symbol location.
18048 * src/symtab.h, src/symtab.c (startsymbol_location): New.
18049 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
18050 the line numbers.
18051
1921f1d7
AD
180522002-06-14 Akim Demaille <akim@epita.fr>
18053
18054 Grammar declarations may be found in the grammar section.
18055
18056 * src/parse-gram.y (rules_or_grammar_declaration): New.
18057 (declarations): Each declaration may end with a semicolon, not
18058 just...
18059 (grammar_declaration): `"%union"'.
18060 (grammar): Branch to rules_or_grammar_declaration.
18061
4515534c
AD
180622002-06-14 Akim Demaille <akim@epita.fr>
18063
18064 * src/main.c (main): Invoke scanner_free.
18065
f958596b
AD
180662002-06-14 Akim Demaille <akim@epita.fr>
18067
18068 * src/output.c (m4_invoke): Extracted from...
18069 (output_skeleton): here.
18070 Free tempfile.
18071
2c569025
AD
180722002-06-14 Akim Demaille <akim@epita.fr>
18073
18074 * src/parse-gram.y (directives, directive, gram)
18075 (grammar_directives, precedence_directives, precedence_directive):
18076 Rename as...
18077 (declarations, declaration, grammar, grammar_declaration)
18078 (precedence_declaration, precedence_declarator): these.
18079 (symbol_declaration): New.
18080
592e8d4d
AD
180812002-06-14 Akim Demaille <akim@epita.fr>
18082
18083 * src/files.c (action_obstack): Remove, unused.
18084 (output_obstack): Remove it, and all its dependencies, as it is no
18085 longer needed.
18086 * src/reader.c (epilogue_set): Build the epilogue in the
18087 muscle_obstack.
18088 * src/output.h, src/output.c (muscle_obstack): Move to...
18089 * src/muscle_tab.h, src/muscle_tab.h: here.
18090 (muscle_init): Initialize muscle_obstack.
18091 (muscle_free): New.
18092 * src/main.c (main): Call it.
18093
0c15323d
AD
180942002-06-14 Akim Demaille <akim@epita.fr>
18095
18096 * src/location.h: New, extracted from...
18097 * src/reader.h: here.
18098 * src/Makefile.am (noinst_HEADERS): Merge into
18099 (bison_SOURCES): this.
18100 Add location.h.
18101 * src/parse-gram.y: Use location_t instead of Bison's.
18102 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
18103 Use location_t instead of ints.
18104
e96c9728
AD
181052002-06-14 Akim Demaille <akim@epita.fr>
18106
18107 * data/bison.simple, data/bison.c++: Be sure to restore the
18108 current #line when returning to the skeleton contents after having
18109 exposed the input file's #line.
18110
75d1fe16
AD
181112002-06-12 Akim Demaille <akim@epita.fr>
18112
18113 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
18114 eager.
18115 * tests/actions.at (Exotic Dollars): New.
18116
6c35d22c
AD
181172002-06-12 Akim Demaille <akim@epita.fr>
18118
18119 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
18120 ['"/] too eagerly.
18121 * tests/input.at (Torturing the Scanner): New.
18122
1d6412ad
AD
181232002-06-11 Akim Demaille <akim@epita.fr>
18124
18125 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
18126 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
18127 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
18128 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
18129 * src/reader.c (reader): Use it.
18130
4cdb01db
AD
181312002-06-11 Akim Demaille <akim@epita.fr>
18132
18133 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
18134 Adjust all callers.
18135 (scanner_last_string_free): New.
18136
44995b2e
AD
181372002-06-11 Akim Demaille <akim@epita.fr>
18138
18139 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
18140 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
18141 (last_string, YY_OBS_FREE): New.
18142 Use them when returning an ID.
18143
e9955c83
AD
181442002-06-11 Akim Demaille <akim@epita.fr>
18145
18146 Have Bison grammars parsed by a Bison grammar.
18147
18148 * src/reader.c, src/reader.h (prologue_augment): New.
18149 * src/reader.c (copy_definition): Remove.
18150
18151 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
18152 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
18153 (grammar_current_rule_prec_set, grammar_current_rule_check)
18154 (grammar_current_rule_symbol_append)
18155 (grammar_current_rule_action_append): Export.
18156 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
18157 (symbol_list_action_append): Remove.
18158 Hook the routines from reader.
18159 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
18160 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
18161
18162 * src/reader.c (read_declarations): Remove, unused.
18163
18164 * src/parse-gram.y: Handle the epilogue.
18165 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
18166 (grammar_start_symbol_set): this.
18167 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
18168 * src/reader.c (readgram): Remove, unused.
18169 (reader): Adjust to insert eoftoken and axiom where appropriate.
18170
18171 * src/reader.c (copy_dollar): Replace with...
18172 * src/scan-gram.h (handle_dollar): this.
18173 * src/parse-gram.y: Remove `%thong'.
18174
18175 * src/reader.c (copy_at): Replace with...
18176 * src/scan-gram.h (handle_at): this.
18177
18178 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
18179 New.
18180
18181 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
18182 time being.
18183
18184 * src/reader.h, src/reader.c (grammar_rule_end): New.
18185
18186 * src/parse.y (current_type, current_class): New.
18187 Implement `%nterm', `%token' support.
18188 Merge `%term' into `%token'.
18189 (string_as_id): New.
18190 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
18191 type name.
18192
18193 * src/parse-gram.y: Be sure to handle properly the beginning of
18194 rules.
18195
18196 * src/parse-gram.y: Handle %type.
18197 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
18198
18199 * src/parse-gram.y: More directives support.
18200 * src/options.c: No longer handle source directives.
18201
18202 * src/parse-gram.y: Fix %output.
18203
18204 * src/parse-gram.y: Handle %union.
18205 Use the prologue locations.
18206 * src/reader.c (parse_union_decl): Remove.
18207
18208 * src/reader.h, src/reader.c (epilogue_set): New.
18209 * src/parse-gram.y: Use it.
18210
18211 * data/bison.simple, data/bison.c++: b4_stype is now either not
18212 defined, then default to int, or to the contents of %union,
18213 without `union' itself.
18214 Adjust.
18215 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
18216
18217 * src/output.c (actions_output): Don't output braces, as they are
18218 already handled by the scanner.
18219
18220 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
18221 characters to themselves.
18222
18223 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
18224 that the epilogue has a proper #line.
18225
18226 * src/parse-gram.y: Handle precedence/associativity.
18227
18228 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
18229 a terminal.
18230 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
18231 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
18232 at all to define terminals that cannot be emitted.
18233
18234 * src/scan-gram.l: Escape M4 characters.
18235
18236 * src/scan-gram.l: Working properly with escapes in user
18237 strings/characters.
18238
18239 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
18240 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
18241 grammar.
18242 Use more modest sizes, as for the time being the parser does not
18243 release memory, and therefore the process swallows a huge amount
18244 of memory.
18245
18246 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
18247 stricter %token grammar.
18248
18249 * src/symtab.h (associativity): Add `undef_assoc'.
18250 (symbol_precedence_set): Do nothing when passed an undef_assoc.
18251 * src/symtab.c (symbol_check_alias_consistence): Adjust.
18252
18253 * tests/regression.at (Invalid %directive): Remove, as it is now
18254 meaningless.
18255 (Invalid inputs): Adjust to the new error messages.
18256 (Token definitions): The new grammar doesn't allow too many
18257 eccentricities.
18258
18259 * src/lex.h, src/lex.c: Remove.
18260 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
18261 (copy_character, copy_string2, copy_string, copy_identifier)
18262 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
18263 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
18264 (parse_action): Remove.
18265 * po/POTFILES.in: Adjust.
18266
2e047461
AD
182672002-06-11 Akim Demaille <akim@epita.fr>
18268
cd05d13c 18269 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
18270 rule's action member: return the action as a string.
18271 Don't require `rule_length' as an argument: compute it.
18272 (grammar_current_rule_symbol_append)
18273 (grammar_current_rule_action_append): New, eved out from
18274 (readgram): here.
18275 Remove `action_flag', `rulelength', unused now.
18276
9af3fbce
AD
182772002-06-11 Akim Demaille <akim@epita.fr>
18278
18279 * src/reader.c (grammar_current_rule_prec_set).
18280 (grammar_current_rule_check): New, eved out from...
18281 (readgram): here.
18282 Remove `xaction', `first_rhs': useless.
18283 * tests/input.at (Type clashes): New.
18284 * tests/existing.at (GNU Cim Grammar): Adjust.
18285
1485e106
AD
182862002-06-11 Akim Demaille <akim@epita.fr>
18287
18288 * src/reader.c (grammar_midrule_action): New, Eved out from
18289 (readgram): here.
18290
da4160c3
AD
182912002-06-11 Akim Demaille <akim@epita.fr>
18292
18293 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
18294 New.
18295 (readgram): Use them as replacement of inlined code, crule and
18296 crule1.
18297
f6d0f937
AD
182982002-06-11 Akim Demaille <akim@epita.fr>
18299
18300 * src/reader.c (grammar_end, grammar_symbol_append): New.
18301 (readgram): Use them.
18302 Make the use of `p' as local as possible.
18303
69078d4b
AD
183042002-06-10 Akim Demaille <akim@epita.fr>
18305
18306 GCJ's parser requires the tokens to be defined before the prologue.
18307
18308 * data/bison.simple: Output the token definition before the user's
18309 prologue.
18310 * tests/regression.at (Braces parsing, Duplicate string)
18311 (Mixing %token styles): Check the output from bison.
18312 (Early token definitions): New.
18313
5e424082
AD
183142002-06-10 Akim Demaille <akim@epita.fr>
18315
18316 * src/symtab.c (symbol_user_token_number_set): Don't complain when
18317 assigning twice the same user number to a token, so that we can
18318 use it in...
18319 * src/lex.c (lex): here.
18320 Also use `symbol_class_set' instead of hand written code.
18321 * src/reader.c (parse_assoc_decl): Likewise.
18322
44536b35
AD
183232002-06-10 Akim Demaille <akim@epita.fr>
18324
18325 * src/symtab.c, src/symtab.c (symbol_class_set)
18326 (symbol_user_token_number_set): New.
18327 * src/reader.c (parse_token_decl): Use them.
18328 Use a switch instead of ifs.
18329 Use a single argument.
18330
8b9f2372
AD
183312002-06-10 Akim Demaille <akim@epita.fr>
18332
18333 Remove `%thong' support as it is undocumented, unused, duplicates
18334 `%token's job, and creates useless e-mail traffic with people who
18335 want to know what it is, why it is undocumented, unused, and
18336 duplicates `%token's job.
18337
18338 * src/reader.c (parse_thong_decl): Remove.
18339 * src/options.c (option_table): Remove "thong".
18340 * src/lex.h (tok_thong): Remove.
18341
3ae2b51f
AD
183422002-06-10 Akim Demaille <akim@epita.fr>
18343
18344 * src/symtab.c, src/symtab.c (symbol_type_set)
18345 (symbol_precedence_set): New.
18346 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
18347 (value_components_used): Remove, unused.
18348
2f1afb73
AD
183492002-06-09 Akim Demaille <akim@epita.fr>
18350
18351 Move symbols handling code out of the reader.
18352
18353 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
18354 (axiom): Move to...
18355 * src/symtab.h, src/symtab.c: here.
18356
18357 * src/gram.c (start_symbol): Remove: use startsymbol->number.
18358 * src/reader.c (startval): Rename as...
18359 * src/symtab.h, src/symtab.c (startsymbol): this.
18360 * src/reader.c: Adjust.
18361
18362 * src/reader.c (symbol_check_defined, symbol_make_alias)
18363 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
18364 (token_translations_init)
18365 Move to...
18366 * src/symtab.c: here.
18367 * src/reader.c (packsymbols): Move to...
18368 * src/symtab.h, src/symtab.c (symbols_pack): here.
18369 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
18370 argument.
18371
e9bca3ad
AD
183722002-06-03 Akim Demaille <akim@epita.fr>
18373
18374 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
18375 then statements.
18376
86eff183
AD
183772002-06-03 Akim Demaille <akim@epita.fr>
18378
18379 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
18380 structs with non literals.
18381 * src/scan-skel.l: never-interactive.
18382 * src/conflicts.c (enum conflict_resolution_e): No trailing
18383 comma.
18384 * src/getargs.c (usage): Split long literal strings.
18385 Reported by Hans Aberg.
18386
717be197
AD
183872002-05-28 Akim Demaille <akim@epita.fr>
18388
18389 * data/bison.c++: Use C++ ostreams.
18390 (cdebug_): New member.
18391
670ddffd
AD
183922002-05-28 Akim Demaille <akim@epita.fr>
18393
18394 * src/output.c (output_skeleton): Be sure to allocate enough room
18395 for `/' _and_ for `\0' in full_skeleton.
18396
769b430f
AD
183972002-05-28 Akim Demaille <akim@epita.fr>
18398
18399 * data/bison.c++: Catch up with bison.simple:
18400 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18401 and Paul Eggert <eggert@twinsun.com>: `error' handing.
18402 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
18403 and popping traces.
18404
7067cb36
PH
184052002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18406
18407 * src/output.c (output_skeleton): Put an explicit path in front of
18408 the skeleton file name, rather than relying on the -I directory,
18409 to partially alleviate effects of having a skeleton file lying around
18410 in the current directory.
769b430f 18411
4a713ec2
PH
184122002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18413
769b430f 18414 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
18415 obstack_printf should be obstack_fgrow1.
18416
b408954b
AD
184172002-05-26 Akim Demaille <akim@epita.fr>
18418
18419 * src/state.h (state_t): `solved_conflicts' is a new member.
18420 * src/LR0.c (new_state): Set it to 0.
18421 * src/conflicts.h, src/conflicts.c (print_conflicts)
18422 (free_conflicts, solve_conflicts): Rename as...
18423 (conflicts_print, conflicts_free, conflicts_solve): these.
18424 Adjust callers.
18425 * src/conflicts.c (enum conflict_resolution_e)
18426 (solved_conflicts_obstack): New, used by...
18427 (log_resolution): this.
18428 Adjust to attach the conflict resolution to each state.
18429 Complete the description with the precedence/associativity
18430 information.
18431 (resolve_sr_conflict): Adjust.
18432 * src/print.c (print_state): Output its solved_conflicts.
18433 * tests/conflicts.at (Unresolved SR Conflicts)
18434 (Solved SR Conflicts): Exercise --report=all.
18435
a49aecd5
AD
184362002-05-26 Akim Demaille <akim@epita.fr>
18437
18438 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
18439 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
18440 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
18441 (token_number_t, item_number_as_token_number)
18442 (token_number_as_item_number, muscle_insert_token_number_table):
18443 Rename as...
18444 (symbol_number_t, item_number_as_symbol_number)
18445 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
18446 these, since it is more appropriate.
18447
5504898e
AD
184482002-05-26 Akim Demaille <akim@epita.fr>
18449
18450 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
18451 `Error:' lines.
18452 * data/bison.simple (yystos) [YYDEBUG]: New.
18453 (yyparse) [YYDEBUG]: Display the symbols which are popped during
18454 error recovery.
18455 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
18456
ec3bc396
AD
184572002-05-25 Akim Demaille <akim@epita.fr>
18458
18459 * doc/bison.texinfo (Debugging): Split into...
18460 (Tracing): this new section, its former contents, and...
18461 (Understanding): this new section.
18462 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
18463 by...
18464 (report_flag): this.
18465 Adjust all dependencies.
18466 (report_args, report_types, report_argmatch): New.
18467 (usage, getargs): Report/support -r, --report.
18468 * src/options.h
18469 (struct option_table_struct): Rename as..,
18470 (struct option_table_s): this.
18471 Rename the `set_flag' member to `flag' to match with getopt_long's
18472 struct.
18473 * src/options.c (option_table): Split verbose into an entry for
18474 %verbose, and another for --verbose.
18475 Support --report/-r, so remove -r from the obsolete --raw.
18476 * src/print.c: Attach full item sets and lookaheads reports to
18477 report_flag instead of trace_flag.
18478 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
18479
78df8250
PE
184802002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18481 and Paul Eggert <eggert@twinsun.com>
769b430f 18482
78df8250
PE
18483 * data/bison.simple (yyparse): Correct error handling to conform to
18484 POSIX and yacc. Specifically, after syntax error is discovered,
18485 do not reduce further before shifting the error token.
18486 Clean up the code a bit by removing the labels yyerrdefault,
18487 yyerrhandle, yyerrpop.
18488 * NEWS: Document the above.
18489
c0c9ea05
PH
184902002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18491
18492 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
18493 type; it isn't always big enough, since it doesn't necessarily
18494 include non-terminals.
769b430f 18495 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
18496 the latter can be removed.
18497 (yy_token_number_type): Remove, only one use.
18498 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
18499 don't use TokenNumberType as element type.
769b430f 18500
c0c9ea05
PH
18501 * tests/regression.at: Modify expected output to agree with change
18502 to yyr1 and yytranslate.
769b430f 18503
6390a83f
FK
185042002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
18505
18506 * src/reader.c (parse_action): Use copy_character instead of
18507 obstack_1grow.
18508
db7c8e9a
AD
185092002-05-13 Akim Demaille <akim@epita.fr>
18510
18511 * tests/regression.at (Token definitions): Prototype yylex and
18512 yyerror.
18513
fcc61800
PH
185142002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18515
158c687b 18516 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
18517 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
18518 32-bit arithmetic.
18519 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
18520
5683e9b2
AD
185212002-05-07 Akim Demaille <akim@epita.fr>
18522
18523 * tests/synclines.at: Be sure to prototype yylex and yyerror to
18524 avoid GCC warnings.
18525
0c2d3f4c
AD
185262002-05-07 Akim Demaille <akim@epita.fr>
18527
18528 Kill GCC warnings.
18529
18530 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
18531 over the RHS of each rule.
18532 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
18533 * src/state.h (state_t): Member `nitems' is unsigned short.
18534 * src/LR0.c (get_state): Adjust.
18535 * src/reader.c (packgram): Likewise.
18536 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
18537 `Type'.
18538 (muscle_insert_int_table): Remove, unused.
18539 (prepare_rules): Remove `max'.
18540
1565b720
AD
185412002-05-06 Akim Demaille <akim@epita.fr>
18542
18543 * src/closure.c (print_firsts): Display of the symbol tags.
18544 (bitmatrix_print): Move to...
18545 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
18546 here.
18547 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
18548
cfaee611
AD
185492002-05-06 Akim Demaille <akim@epita.fr>
18550
18551 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
18552 hash_do_for_each.
18553
458be8e0
AD
185542002-05-06 Akim Demaille <akim@epita.fr>
18555
18556 * src/LR0.c (new_state, get_state): Instead of using the global
18557 `kernel_size' and `kernel_base', have two new arguments:
18558 `core_size' and `core'.
18559 Adjust callers.
18560
a900a624
AD
185612002-05-06 Akim Demaille <akim@epita.fr>
18562
18563 * src/reader.c (packgram): No longer end `ritem' with a 0
18564 sentinel: it is not used.
18565
d4e7d3a1
AD
185662002-05-05 Akim Demaille <akim@epita.fr>
18567
18568 New experimental feature: display the lookaheads in the report and
18569 graph.
18570
18571 * src/print (print_core): When --trace-flag, display the rules
18572 lookaheads.
18573 * src/print_graph.c (print_core): Likewise.
18574 Swap the arguments.
18575 Adjust caller.
18576
39ceb25b
AD
185772002-05-05 Akim Demaille <akim@epita.fr>
18578
18579 * tests/torture.at (Many lookaheads): New test.
18580
5372019f
AD
185812002-05-05 Akim Demaille <akim@epita.fr>
18582
18583 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
18584 (GENERATE_MUSCLE_INSERT_TABLE): this.
18585 (output_int_table, output_unsigned_int_table, output_short_table)
18586 (output_token_number_table, output_item_number_table): Replace with...
18587 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
18588 (muscle_insert_short_table, muscle_insert_token_number_table)
18589 (muscle_insert_item_number_table): these.
18590 Adjust all callers.
18591 (prepare_tokens): Don't free `translations', since...
18592 * src/reader.h, src/reader.c (grammar_free): do it.
18593 Move to...
18594 * src/gram.h, src/gram.c (grammar_free): here.
18595 * data/bison.simple, data/bison.c++: b4_token_number_max is now
18596 b4_translate_max.
18597
5df5f6d5
AD
185982002-05-05 Akim Demaille <akim@epita.fr>
18599
18600 * src/output.c (output_unsigned_int_table): New.
18601 (prepare_rules): `i' is unsigned.
18602 `prhs', `rline', `r2' are unsigned int.
18603 Rename muscle `rhs_number_max' as `rhs_max'.
18604 Output muscles `prhs_max', `rline_max', and `r2_max'.
18605 Free rline and r1.
18606 * data/bison.simple, data/bison.c++: Adjust to use these muscles
18607 to compute types instead of constant types.
18608 * tests/regression.at (Web2c Actions): Adjust.
18609
b87f8b21
AD
186102002-05-04 Akim Demaille <akim@epita.fr>
18611
18612 * src/symtab.h (SALIAS, SUNDEF): Rename as...
18613 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
18614 Adjust dependencies.
18615 * src/output.c (token_definitions_output): Be sure not to output a
18616 `#define 'a'' when fed with `%token 'a' "a"'.
18617 * tests/regression.at (Token definitions): New.
18618
8bb936e4
PE
186192002-05-03 Paul Eggert <eggert@twinsun.com>
18620
18621 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
18622 for K&R C.
18623
186242002-05-03 gettextize <bug-gnu-gettext@gnu.org>
18625
18626 * Makefile.am (SUBDIRS): Remove intl.
18627 (EXTRA_DIST): Add config/config.rpath.
18628
53c71a12
AD
186292002-05-03 Akim Demaille <akim@epita.fr>
18630
18631 * data/bison.simple (m4_if): Don't output empty enums.
18632 And actually, output valid enum definitions :(.
18633
289dd0cf
AD
186342002-05-03 Akim Demaille <akim@epita.fr>
18635
18636 * configure.bat: Remove, completely obsolete.
18637 * Makefile.am (EXTRA_DIST): Adjust.
18638 Don't distribute config.rpath...
18639 * config/Makefile.am (EXTRA_DIST): Do it.
18640
db85e524
AD
186412002-05-03 Akim Demaille <akim@epita.fr>
18642
18643 * configure.in (GETTEXT_VERSION): New.
18644 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
18645
83ccf991
AD
186462002-05-03 Akim Demaille <akim@epita.fr>
18647
18648 * data/bison.simple (b4_token_enum): New.
18649 (b4_token_defines): Use it to output tokens both as #define and
18650 enums.
18651 Suggested by Paul Eggert.
18652 * src/output.c (token_definitions_output): Don't output spurious
18653 white spaces.
18654
1f418995
AD
186552002-05-03 Akim Demaille <akim@epita.fr>
18656
18657 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
18658
45119f04
RA
186592002-05-02 Robert Anisko <robert@lrde.epita.fr>
18660
18661 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
18662 Update the stack class, give a try to deque as the default container.
18663
b2d52318
AD
186642002-05-02 Akim Demaille <akim@epita.fr>
18665
18666 * data/bison.simple (yyparse): Do not implement @$ = @1.
18667 (YYLLOC_DEFAULT): Adjust to do it.
18668 * doc/bison.texinfo (Location Default Action): Fix.
18669
3a8b4109
AD
186702002-05-02 Akim Demaille <akim@epita.fr>
18671
18672 * src/reader.c (parse_braces): Merge into...
18673 (parse_action): this.
18674
84614e13
AD
186752002-05-02 Akim Demaille <akim@epita.fr>
18676
18677 * configure.in (ALL_LINGUAS): Remove.
18678 * po/LINGUAS, hr.po: New.
18679
fdbcd8e2
AD
186802002-05-02 Akim Demaille <akim@epita.fr>
18681
18682 Remove the so called hairy (semantic) parsers.
18683
18684 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
18685 * src/gram.h, src/gram.c (semantic_parser): Remove.
18686 (rule_t): Remove the guard and guard_line members.
18687 * src/lex.h (token_t): remove tok_guard.
18688 * src/options.c (option_table): Remove %guard and %semantic_parser
18689 support.
18690 * src/output.c, src/output.h (guards_output): Remove.
18691 (prepare): Adjust.
18692 (token_definitions_output): Don't output the `T'
18693 tokens (???).
18694 (output_skeleton): Don't output the guards.
18695 * src/files.c, src/files.c (attrsfile): Remove.
18696 * src/reader.c (symbol_list): Remove the guard and guard_line
18697 members.
18698 Adjust dependencies.
18699 (parse_guard): Remove.
18700 * data/bison.hairy: Remove.
18701 * doc/bison.texinfo (Environment Variables): Remove occurrences of
18702 BISON_HAIRY.
18703
82b6cb3f
AD
187042002-05-02 Akim Demaille <akim@epita.fr>
18705
18706 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
18707 (parse_guard): Rename the formal argument `stack_offset' as
18708 `rule_length', which is more readable.
18709 Adjust callers.
18710 (copy_at, copy_dollar): Instead of outputting the hard coded
18711 values of $$, $n and so forth, output invocation to b4_lhs_value,
18712 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
18713 Note: this patch partially drops `semantic-parser' support: it
18714 always does `rule_length - n', where semantic parsers ought to
18715 always use `-n'.
82b6cb3f
AD
18716 * data/bison.simple, data/bison.c++ (b4_lhs_value)
18717 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
18718
6cbfbcc5
AD
187192002-05-02 Akim Demaille <akim@epita.fr>
18720
18721 * configure.in (AC_INIT): Bump to 1.49b.
18722 (AM_INIT_AUTOMAKE): Short invocation.
18723
b8548114
AD
187242002-05-02 Akim Demaille <akim@epita.fr>
18725
18726 Version 1.49a.
18727
c20cd1fa
AD
187282002-05-01 Akim Demaille <akim@epita.fr>
18729
18730 * src/skeleton.h: Remove.
18731
8a9566d4
AD
187322002-05-01 Akim Demaille <akim@epita.fr>
18733
18734 * src/skeleton.h: Fix the #endif.
18735 Reported by Magnus Fromreide.
18736
8c6d399a
PE
187372002-04-26 Paul Eggert <eggert@twinsun.com>
18738
18739 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
18740 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 18741 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 18742
2b7ed18a
RA
187432002-04-25 Robert Anisko <robert@lrde.epita.fr>
18744
18745 * src/scan-skel.l: Postprocess quadrigraphs.
18746
18747 * src/reader.c (copy_character): New function, used to output
18748 single characters while replacing `[' and `]' with quadrigraphs, to
18749 avoid troubles with M4 quotes.
18750 (copy_comment): Output characters with copy_character.
18751 (read_additionnal_code): Likewise.
18752 (copy_string2): Likewise.
18753 (copy_definition): Likewise.
18754
18755 * tests/calc.at: Exercise M4 quoting.
18756
34a89c50
AD
187572002-04-25 Akim Demaille <akim@epita.fr>
18758
18759 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
18760 between `!' and the command.
18761 Reported by Paul Eggert.
18762
0dd1580a
RA
187632002-04-24 Robert Anisko <robert@lrde.epita.fr>
18764
18765 * tests/calc.at: Exercise prologue splitting.
18766
18767 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
18768 `b4_post_prologue' instead of `b4_prologue'.
18769
18770 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
18771 muscles.
18772 (output): Free pre_prologue_obstack and post_prologue_obstack.
18773 * src/files.h, src/files.c (attrs_obstack): Remove.
18774 (pre_prologue_obstack, post_prologue_obstack): New.
18775 * src/reader.c (copy_definition): Add a parameter to specify the
18776 obstack to fill, instead of using attrs_obstack unconditionally.
18777 (read_declarations): Pass pre_prologue_obstack to copy_definition if
18778 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
18779
83c1796f
PE
187802002-04-23 Paul Eggert <eggert@twinsun.com>
18781
18782 * data/bison.simple: Remove unnecessary commentary and white
18783 space differences from 1_29-branch.
18784 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
18785
18786 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
18787 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
18788 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
18789 constructors or destructors.
18790
18791 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
18792
1207eeac
AD
187932002-04-23 Akim Demaille <akim@epita.fr>
18794
18795 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
18796 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
18797 location with columns.
18798 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
18799 All reported by Paul Eggert.
18800
78ab8f67
AD
188012002-04-22 Akim Demaille <akim@epita.fr>
18802
18803 * src/reduce.c (dump_grammar): Move to...
18804 * src/gram.h, src/gram.c (grammar_dump): here.
18805 Be sure to separate long item numbers.
18806 Don't read the members of a rule's prec if its nil.
18807
133c20e2
AD
188082002-04-22 Akim Demaille <akim@epita.fr>
18809
18810 * src/output.c (table_size, table_grow): New.
18811 (MAXTABLE): Remove, replace uses with table_size.
18812 (pack_vector): Instead of dying when the table is too big, grow it.
18813
9515e8a7
AD
188142002-04-22 Akim Demaille <akim@epita.fr>
18815
18816 * data/bison.simple (yyr1): Its type is that of a token number.
18817 * data/bison.c++ (r1_): Likewise.
18818 * tests/regression.at (Web2c Actions): Adjust.
18819
23c5a174
AD
188202002-04-22 Akim Demaille <akim@epita.fr>
18821
18822 * src/reader.c (token_translations_init): 256 is now the default
18823 value for the error token, i.e., it will be assigned another
18824 number if the user assigned 256 to one of her tokens.
18825 (reader): Don't force 256 to error.
18826 * doc/bison.texinfo (Symbols): Adjust.
18827 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
18828 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
18829 etc. instead of 10, 20, 30 (which was used to `jump' over error
18830 (256) and undefined (2)).
18831
5fbb0954
AD
188322002-04-22 Akim Demaille <akim@epita.fr>
18833
18834 Propagate more token_number_t.
18835
18836 * src/gram.h (token_number_as_item_number)
18837 (item_number_as_token_number): New.
18838 * src/output.c (GENERATE_OUTPUT_TABLE): New.
18839 Use it to create output_item_number_table and
18840 output_token_number_table.
18841 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
18842 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
18843 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
18844 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
18845
4f940944
AD
188462002-04-22 Akim Demaille <akim@epita.fr>
18847
18848 * src/output.h, src/output.c (get_lines_number): Remove.
18849
3ded9a63
AD
188502002-04-19 Akim Demaille <akim@epita.fr>
18851
18852 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
18853 as Lex/Flex'.
18854 (Debugging): More details about enabling the debugging features.
18855 (Table of Symbols): Describe $$, $n, @$, and @n.
18856 Suggested by Tim Josling.
18857
e0c471a9
AD
188582002-04-19 Akim Demaille <akim@epita.fr>
18859
18860 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
18861
fecc10cd
AD
188622002-04-10 Akim Demaille <akim@epita.fr>
18863
18864 * src/system.h: Rely on HAVE_LIMITS_H.
18865 Suggested by Paul Eggert.
18866
51dec47b
AD
188672002-04-09 Akim Demaille <akim@epita.fr>
18868
18869 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
18870 full stderr, and strip it according to the bison options, instead
18871 of composing the error message from different bits.
18872 This makes it easier to check for several error messages.
18873 Adjust all the invocations.
18874 Add an invocation exercising the error token.
18875 Add an invocation demonstrating a stupid error message.
18876 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
18877 Adjust the tests.
18878 Error message are for stderr, not stdout.
18879
007a50a4
AD
188802002-04-09 Akim Demaille <akim@epita.fr>
18881
18882 * src/gram.h, src/gram.c (error_token_number): Remove, use
18883 errtoken->number.
18884 * src/reader.c (reader): Don't specify the user token number (2)
18885 for $undefined, as it uselessly prevents using it.
18886 * src/gram.h (token_number_t): Move to...
18887 * src/symtab.h: here.
18888 (state_t.number): Is a token_number_t.
18889 * src/print.c, src/reader.c: Use undeftoken->number instead of
18890 hard coded 2.
18891 (Even though this 2 is not the same as above: the number of the
18892 undeftoken remains being 2, it is its user token number which
18893 might not be 2).
18894 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
18895 `user_token_number_max'.
18896 Output `undef_token_number'.
18897 * data/bison.simple, data/bison.c++: Use them.
18898 Be sure to map invalid yylex return values to
18899 `undef_token_number'. This saves us from gratuitous SEGV.
18900
18901 * tests/conflicts.at (Solved SR Conflicts)
18902 (Unresolved SR Conflicts): Adjust.
18903 * tests/regression.at (Web2c Actions): Adjust.
18904
06446ccf
AD
189052002-04-08 Akim Demaille <akim@epita.fr>
18906
18907 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
18908 Adding #line.
18909 Remove the duplicate `typedefs'.
18910 (RhsNumberType): Fix the declaration and various other typos.
18911 Use __ofile__.
18912 * data/bison.simple: Use __ofile__.
18913 * src/scan-skel.l: Handle __ofile__.
18914
62a3e4f0
AD
189152002-04-08 Akim Demaille <akim@epita.fr>
18916
18917 * src/gram.h (item_number_t): New, the type of item numbers in
18918 RITEM. Note that it must be able to code symbol numbers as
18919 positive number, and the negation of rule numbers as negative
18920 numbers.
18921 Adjust all dependencies (pretty many).
18922 * src/reduce.c (rule): Remove this `short *' pointer: use
18923 item_number_t.
18924 * src/system.h (MINSHORT, MAXSHORT): Remove.
18925 Include `limits.h'.
18926 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
18927 (shortcpy): Remove.
18928 (MAXTABLE): Move to...
18929 * src/output.c (MAXTABLE): here.
18930 (prepare_rules): Use output_int_table to output rhs.
18931 * data/bison.simple, data/bison.c++: Adjust.
18932 * tests/torture.at (Big triangle): Move the limit from 254 to
18933 500.
18934 * tests/regression.at (Web2c Actions): Ajust.
18935
18936 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
18937 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
18938 passes, but produces negative #line number, once fixed, GCC is
18939 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
18940 C), it passes.
18941 * src/state.h (state_h): Code input lines on ints, not shorts.
18942
bb88b0fc
AD
189432002-04-08 Akim Demaille <akim@epita.fr>
18944
18945 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
18946 and then the grammar.
18947
9a636f47
AD
189482002-04-08 Akim Demaille <akim@epita.fr>
18949
18950 * src/system.h: No longer using strndup.
18951
680e8701
AD
189522002-04-07 Akim Demaille <akim@epita.fr>
18953
18954 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
18955 * src/output.c (output_table_data): Return the longest number.
18956 (prepare_tokens): Output `token_number_max').
18957 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
18958 New.
18959 Use them to define yy_token_number_type/TokenNumberType.
18960 Use this type for yytranslate.
18961 * tests/torture.at (Big triangle): Push the limit from 124 to
18962 253.
18963 * tests/regression.at (Web2c Actions): Adjust.
18964
817e9f41
AD
189652002-04-07 Akim Demaille <akim@epita.fr>
18966
18967 * tests/torture.at (Big triangle): New.
18968 (GNU AWK Grammar, GNU Cim Grammar): Move to...
18969 * tests/existing.at: here.
18970
5123689b
AD
189712002-04-07 Akim Demaille <akim@epita.fr>
18972
18973 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
18974 nritems.
18975 Adjust dependencies.
18976
f3849179
AD
189772002-04-07 Akim Demaille <akim@epita.fr>
18978
18979 * src/reader.c: Normalize increments to prefix form.
18980
bd02036a
AD
189812002-04-07 Akim Demaille <akim@epita.fr>
18982
18983 * src/reader.c, symtab.c: Remove debugging code.
18984
db8837cb
AD
189852002-04-07 Akim Demaille <akim@epita.fr>
18986
18987 Rename all the `bucket's as `symbol_t'.
18988
18989 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
18990 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
18991 * src/symtab.c, src/symtab.h (bucket): Rename as...
18992 (symbol_t): this.
18993 (symbol_list_new, bucket_check_defined, bucket_make_alias)
18994 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
18995 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
18996 (buckets_new, buckets_free, buckets_do): Rename as...
18997 (symbol_list_new, symbol_check_defined, symbol_make_alias)
18998 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
18999 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
19000 (symbols_new, symbols_free, symbols_do): these.
19001
72a23c97
AD
190022002-04-07 Akim Demaille <akim@epita.fr>
19003
19004 Use lib/hash for the symbol table.
19005
19006 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
19007 EOF.
19008 * src/lex.c (lex): Set the `number' member of new terminals.
19009 * src/reader.c (bucket_check_defined, bucket_make_alias)
19010 (bucket_check_alias_consistence, bucket_translation): New.
19011 (reader, grammar_free, readgram, token_translations_init)
19012 (packsymbols): Adjust.
19013 (reader): Number the predefined tokens.
19014 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
19015 for predefined tokens.
19016 * src/symtab.h (bucket): Remove all the hash table related
19017 members.
19018 * src/symtab.c (symtab): Replace by...
19019 (bucket_table): this.
19020 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
19021 (buckets_new, buckets_do): New.
19022
280a38c3
AD
190232002-04-07 Akim Demaille <akim@epita.fr>
19024
19025 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
19026 (start_symbol, max_user_token_number, semantic_parser)
19027 (error_token_number): Initialize.
19028 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
19029 Initialize.
19030 (reader): Don't.
19031 (errtoken, eoftoken, undeftoken, axiom): Extern.
19032
03b31c0c
AD
190332002-04-07 Akim Demaille <akim@epita.fr>
19034
19035 * src/gram.h (rule_s): prec and precsym are now pointers
19036 to the bucket giving the priority/associativity.
19037 Member `associativity' removed: useless.
19038 * src/reduce.c, src/conflicts.c: Adjust.
19039
8b3df748
AD
190402002-04-07 Akim Demaille <akim@epita.fr>
19041
19042 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
19043 Properly escape the symbols' TAG when outputting them.
19044
e601aa1d
AD
190452002-04-07 Akim Demaille <akim@epita.fr>
19046
19047 * src/lalr.h (LA): Is a bitsetv, not bitset*.
19048
b0299a2e
AD
190492002-04-07 Akim Demaille <akim@epita.fr>
19050
19051 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
19052 (LArule): this, which is an array to rule_t*.
19053 * src/print.c, src/conflicts.c: Adjust.
19054
d7e1f00c
AD
190552002-04-07 Akim Demaille <akim@epita.fr>
19056
19057 * src/gram.h (rule_t): Rename `number' as `user_number'.
19058 `number' is a new member.
19059 Adjust dependencies.
19060 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
19061
cc9305dd
AD
190622002-04-07 Akim Demaille <akim@epita.fr>
19063
19064 As a result of the previous patch, it is no longer needed
19065 to reorder ritem itself.
19066
19067 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
19068
b0940840
AD
190692002-04-07 Akim Demaille <akim@epita.fr>
19070
19071 Be sure never to walk through RITEMS, but use only data related to
19072 the rules themselves. RITEMS should be banished.
19073
19074 * src/output.c (output_token_translations): Rename as...
19075 (prepare_tokens): this.
19076 In addition to `translate', prepare the muscles `tname' and
19077 `toknum', which were handled by...
19078 (output_rule_data): this.
19079 Remove, and move the remainder of its outputs into...
19080 (prepare_rules): this new routines, which also merges content from
19081 (output_gram): this.
19082 (prepare_rules): Be sure never to walk through RITEMS.
19083 (output_stos): Rename as...
19084 (prepare_stos): this.
19085 (output): Always invoke prepare_states, after all, just don't use it
19086 in the output if you don't need it.
19087
643a5994
AD
190882002-04-07 Akim Demaille <akim@epita.fr>
19089
19090 * src/LR0.c (new_state): Display `nstates' as the name of the
19091 newly created state.
19092 Adjust to initialize first_state and last_state if needed.
19093 Be sure to distinguish the initial from the final state.
19094 (new_states): Create the itemset of the initial state, and use
19095 new_state.
19096 * src/closure.c (closure): Now that the initial state has its
19097 items properly set, there is no need for a special case when
19098 creating `ruleset'.
19099
19100 As a result, now the rule 0, reducing to $axiom, is visible in the
19101 outputs. Adjust the test suite.
19102
19103 * tests/conflicts.at (Solved SR Conflicts)
19104 (Unresolved SR Conflicts): Adjust.
19105 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
19106 * tests/conflicts.at (S/R in initial): New.
19107
b4c4ccc2
AD
191082002-04-07 Akim Demaille <akim@epita.fr>
19109
19110 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
19111 the RHS of the rules.
19112 * src/output.c (output_gram): Likewise.
19113
bba97eb2
AD
191142002-04-07 Akim Demaille <akim@epita.fr>
19115
19116 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
19117 bucket.
19118 Adjust all dependencies.
19119 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
19120 `number' of the buckets too.
19121 * src/gram.h: Include `symtab.h'.
19122 (associativity): Move to...
19123 * src/symtab.h: here.
19124 No longer include `gram.h'.
19125
c3b407f4
AD
191262002-04-07 Akim Demaille <akim@epita.fr>
19127
19128 * src/gram.h, src/gram.c (rules_rhs_length): New.
19129 (ritem_longest_rhs): Use it.
19130 * src/gram.h (rule_t): `number' is a new member.
19131 * src/reader.c (packgram): Set it.
19132 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
19133 the end of `rules', and count them out of `nrules'.
19134 (reduce_output, dump_grammar): Adjust.
19135 * src/print.c (print_grammar): It is no longer needed to check for
19136 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
19137 * tests/reduce.at (Reduced Automaton): New test.
19138
11652ab3
AD
191392002-04-07 Akim Demaille <akim@epita.fr>
19140
19141 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
19142 lacking `+ 1' to nrules, Bison reported as useless a token if it
19143 was used solely to set the precedence of the last rule...
19144
26b23c1a
AD
191452002-04-07 Akim Demaille <akim@epita.fr>
19146
19147 * data/bison.c++, data/bison.simple: Don't output the current file
19148 name in #line, to avoid useless diffs between two identical
19149 outputs under different names.
19150
18bcecb0
AD
191512002-04-07 Akim Demaille <akim@epita.fr>
19152
19153 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
19154 Normalize loops to using `< nrules + 1', not `<= nrules'.
19155
fa770c86
AD
191562002-04-07 Akim Demaille <akim@epita.fr>
19157
19158 * TODO: Update.
19159
d9b739c3
AD
191602002-04-07 Akim Demaille <akim@epita.fr>
19161
19162 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
19163 bucket.value as bucket.number.
19164
99013900
AD
191652002-04-07 Akim Demaille <akim@epita.fr>
19166
19167 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
19168 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
19169 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
19170 RHS, instead of being an index in RITEMS.
19171
e966383b
PE
191722002-04-04 Paul Eggert <eggert@twinsun.com>
19173
19174 * doc/bison.texinfo: Update copyright date.
19175 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
19176 (Symbols): Warn about running Bison in one character set,
19177 but compiling and/or running in an incompatible one.
19178 Warn about character code 256, too.
19179
191802002-04-03 Paul Eggert <eggert@twinsun.com>
19181
19182 * src/bison.data (YYSTACK_ALLOC): Depend on whether
19183 YYERROR_VERBOSE is nonzero, not whether it is defined.
19184
19185 Merge changes from bison-1_29-branch.
c307773e 19186
8d6c48b9
PE
191872002-03-20 Paul Eggert <eggert@twinsun.com>
19188
19189 Merge fixes from Debian bison_1.34-1.diff.
19190
19191 * configure.in (AC_PREREQ): 2.53.
19192
e53c6322
AD
191932002-03-20 Akim Demaille <akim@epita.fr>
19194
19195 * src/conflicts.c (log_resolution): Argument `resolution' is const.
19196
9ffbeca7
PE
191972002-03-19 Paul Eggert <eggert@twinsun.com>
19198
21db0b2a
PE
19199 * src/bison.simple (YYCOPY): New macro.
19200 (YYSTACK_RELOCATE): Use it.
19201 Remove Type arg; no longer needed. All callers changed.
19202 (yymemcpy): Remove; no longer needed.
19203
9ffbeca7
PE
19204 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
19205 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
19206
642cb8f8
AD
192072002-03-19 Akim Demaille <akim@epita.fr>
19208
19209 Test and fix the #line outputs.
19210
19211 * tests/atlocal.at (GCC): New.
19212 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 19213 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
19214 (Action synch line, Epilogue synch line): New tests.
19215 * src/reader.c (parse_union_decl): Define the muscle stype_line.
19216 * data/bison.simple, data/bison.c++: Use it.
19217
3c31a486
AD
192182002-03-19 Akim Demaille <akim@epita.fr>
19219
19220 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
19221 (Solved SR Conflicts, %expect not enough, %expect right)
19222 (%expect too much): Move to...
19223 * tests/conflicts.at: this new file.
19224
0d8bed56
AD
192252002-03-19 Akim Demaille <akim@epita.fr>
19226
19227 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19228 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
19229 that we can move to enums for instance.
19230 * src/output.c (token_definitions_output): Output a list of
19231 `token-name, token-number' instead of the #define.
19232 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
19233
9208d17f
AD
192342002-03-14 Akim Demaille <akim@epita.fr>
19235
19236 Use Gettext 0.11.1.
19237
af27eacb
RA
192382002-03-09 Robert Anisko <robert@lrde.epita.fr>
19239
19240 * data/bison.c++: Make the user able to add members to the generated
19241 parser by subclassing.
19242
9101a310
RA
192432002-03-05 Robert Anisko <robert@lrde.epita.fr>
19244
19245 * src/reader.c (read_additionnal_code): `c' should be an integer, not
19246 a character.
19247 Reported by Nicolas Tisserand and Nicolas Burrus.
19248
fff9bf0b
RA
192492002-03-04 Robert Anisko <robert@lrde.epita.fr>
19250
19251 * src/reader.c: Warn about lacking semi-colons, do not complain.
19252
64dba31e
RA
192532002-03-04 Robert Anisko <robert@lrde.epita.fr>
19254
19255 * data/bison.c++: Remove a debug line.
19256
374f5a14
RA
192572002-03-04 Robert Anisko <robert@lrde.epita.fr>
19258
19259 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
19260 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
19261 provide a default implementation.
19262
bfcf1f3a
AD
192632002-03-04 Akim Demaille <akim@epita.fr>
19264
19265 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
19266 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
19267 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
19268 * tests/semantic.at (Parsing Guards): Similarly.
19269 * src/reader.at (readgram): Complain if the last rule is not ended
19270 with a semi-colon.
19271
65ccf9fc
AD
192722002-03-04 Akim Demaille <akim@epita.fr>
19273
19274 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
19275 * src/closure.c: here.
19276 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
19277 RTC.
19278 * src/warshall.h, src/warshall.c: Remove.
19279 * tests/sets.at (Broken Closure): Adjust.
19280
d0039cbc
AD
192812002-03-04 Akim Demaille <akim@epita.fr>
19282
19283 * src/output.c (output_skeleton): tempdir is const.
19284 bytes_read is unused.
19285
345cea78
AD
192862002-03-04 Akim Demaille <akim@epita.fr>
19287
19288 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19289 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
19290 Update.
19291 From Michael Hayes.
19292
564801f7
AD
192932002-03-04 Akim Demaille <akim@epita.fr>
19294
19295 * src/closure.c (closure): `r' is unused.
19296
e5352bc7
AD
192972002-03-04 Akim Demaille <akim@epita.fr>
19298
19299 * tests/sets.at (Broken Closure): Add the ending `;'.
19300 * src/reader.at (readgram): Complain if a rule is not ended with a
19301 semi-colon.
19302
914feea9
AD
193032002-03-04 Akim Demaille <akim@epita.fr>
19304
19305 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
19306 (count_sr_conflicts): Use bitset_count.
19307 * src/reduce.c (inaccessable_symbols): Ditto.
19308 (bits_size): Remove.
19309 * src/warshall.h, src/warshall.c: Convert to bitsetv.
19310
f0250de6
AD
193112002-03-04 Akim Demaille <akim@epita.fr>
19312
19313 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
19314 * src/reduce.c: Remove the `bitset_zero's following the
19315 `bitset_create's, as now it is performed by the latter.
19316
ef017502
AD
193172002-03-04 Akim Demaille <akim@epita.fr>
19318
19319 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
19320 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
19321 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
19322 latest sources from Michael.
19323
76514394
AD
193242002-03-04 Akim Demaille <akim@epita.fr>
19325
19326 * src/output.c (output): Don't free the grammar.
19327 * src/reader.c (grammar_free): New.
19328 * src/main.c (main): Call it and don't free symtab here.
19329
55024580
AD
193302002-03-04 Akim Demaille <akim@epita.fr>
19331
19332 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
19333 before returning.
19334 Reported by Benoit Perrot.
19335
f9abaa2c
AD
193362002-03-04 Akim Demaille <akim@epita.fr>
19337
19338 Use bitset operations when possible, not loops over bits.
19339
19340 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
19341 bitset_or.
19342 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
19343 * src/reduce.c (useless_nonterminals): Formatting changes.
19344 * src/warshall.c (TC): Use bitset_or.
19345
0e721e75
AD
193462002-03-04 Akim Demaille <akim@epita.fr>
19347
19348 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
19349 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
19350 Ditto.
19351
0fb1ffb1
AD
193522002-03-04 Akim Demaille <akim@epita.fr>
19353
19354 * src/lalr.c (F): Now a bitset*.
19355 Adjust all dependencies.
19356
b86796bf
AD
193572002-03-04 Akim Demaille <akim@epita.fr>
19358
19359 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
19360 Adjust all dependencies.
19361
602bbf31
AD
193622002-03-04 Akim Demaille <akim@epita.fr>
19363
19364 * src/L0.c, src/LR0.h (nstates): Be size_t.
19365 Adjust comparisons (signed vs unsigned).
19366 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
19367 bitset*.
19368 Adjust all dependencies.
19369
d8a0245c
AD
193702002-03-04 Akim Demaille <akim@epita.fr>
19371
19372 * src/closure.c (firsts): Now, also a bitset.
19373 Adjust all dependencies.
19374 (varsetsize): Remove, now unused.
19375 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
19376
34ba9743
AD
193772002-03-04 Akim Demaille <akim@epita.fr>
19378
19379 * src/print.c: Convert to use bitset.h, not hand coded iterations
19380 over ints.
19381
ed86e78c
AD
193822002-03-04 Akim Demaille <akim@epita.fr>
19383
19384 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
19385
dfdb1797
AD
193862002-03-04 Akim Demaille <akim@epita.fr>
19387
19388 * src/closure.c (ruleset): Be a bitset.
19389 (rulesetsize): Remove.
19390
7086e707
AD
193912002-03-04 Akim Demaille <akim@epita.fr>
19392
19393 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19394 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
19395 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
19396 * src/closure.c (fderives): Be an array of bitsets.
19397
98254360
RA
193982002-02-28 Robert Anisko <robert@lrde.epita.fr>
19399
19400 * data/bison.c++: Merge the two generated headers. Insert a copyright
19401 notice in each output file.
19402
a75c057f
AD
194032002-02-28 Akim Demaille <akim@epita.fr>
19404
19405 * data/bison.c++: Copy the prologue of bison.simple to fetch
19406 useful M4 definitions, such as b4_header_guard.
19407
06b00abc
AD
194082002-02-25 Akim Demaille <akim@epita.fr>
19409
19410 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
19411 translator friendly scheme for the bgr
19412 copyright notice.
06b00abc 19413
70e7d534
AD
194142002-02-25 Akim Demaille <akim@epita.fr>
19415
19416 * src/output.c (header_output): Remove, now handled completely via
19417 M4.
19418
abe017f6
AD
194192002-02-25 Akim Demaille <akim@epita.fr>
19420
19421 * m4/m4.m4: New, from CVS Autoconf.
19422 * configure.in: Invoke it.
19423 * src/output.c (output_skeleton): Use its result instead of the
19424 hard coded name.
19425
381fb12e
AD
194262002-02-25 Akim Demaille <akim@epita.fr>
19427
19428 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
19429 Fileutils 4.1.5.
19430 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
19431 * src/output.c (output_skeleton): Use mkstemp to create a real
19432 temporary file.
19433 Move the filling of `skeleton' and its muscle to...
19434 (prepare): here.
19435 (output): Move the definition of the prologue muscle to...
19436 (prepare): here.
19437 * src/system.h (DEFAULT_TMPDIR): New.
19438
6f38107f
PE
194392002-02-14 Paul Eggert <eggert@twinsun.com>
19440
19441 Remove the support for C++ namespace cleanliness; it was
19442 causing more problems than it was curing, since it didn't work
19443 properly on some nonstandard C++ compilers. This can wait
19444 for a proper C++ parser.
19445
19446 * NEWS: Document this.
19447 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
19448 of C++, as it's treated like C now.
19449 * src/bison.simple (YYSTD): Remove.
19450 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
19451 Treat C++ just like Standard C instead of trying to support
19452 namespace cleanliness.
19453
80cce3da
AD
194542002-02-14 Akim Demaille <akim@epita.fr>
19455
19456 * tests/regression.at (else): Adjust to Andreas' change.
19457
842e8679
AD
194582002-02-14 Akim Demaille <akim@epita.fr>
19459
19460 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
19461
4bda3f10
AD
194622002-02-13 Andreas Schwab <schwab@suse.de>
19463
19464 * src/output.c (output_rule_data): Don't output NULL, it might
19465 not be defined yet.
19466
4162fa07 194672002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 19468
4162fa07
RA
19469 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
19470 (Copyright notice): Update.
b418ecd8 19471
bd16a5dc
AD
194722002-02-11 Akim Demaille <akim@epita.fr>
19473
19474 * tests/regression.at (%nonassoc and eof): Don't include
19475 nonportable headers.
19476
8d69a1a3
RA
194772002-02-08 Robert Anisko <robert@lrde.epita.fr>
19478
19479 * data/bison.c++: Correct error recovery. Make the user able to
19480 initialize the starting location.
19481
9b2d0677
AD
194822002-02-07 Akim Demaille <akim@epita.fr>
19483
19484 * tests/input.at: New.
19485
69e2658b
RA
194862002-02-07 Robert Anisko <robert@lrde.epita.fr>
19487
19488 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 19489 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
19490 directives around tables only needed for debugging.
19491
4aacc3a7
RA
194922002-02-07 Robert Anisko <robert@lrde.epita.fr>
19493
19494 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
19495 C++ parsers.
19496 (yy::b4_name::parse): Use print_.
19497
762a801e
RA
194982002-02-07 Robert Anisko <robert@lrde.epita.fr>
19499
19500 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
19501
4bb2bc3f
RA
195022002-02-07 Robert Anisko <robert@lrde.epita.fr>
19503
19504 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
19505 C++ parsers.
19506 (yy::b4_name::parse): Build verbose error messages, and use error_.
19507
6b45a3ca
RA
195082002-02-06 Robert Anisko <robert@lrde.epita.fr>
19509
19510 * data/bison.c++: Fix m4 quoting in comments.
19511
50997c6e
RA
195122002-02-06 Robert Anisko <robert@lrde.epita.fr>
19513
19514 * data/bison.c++: Adjust the parser code. Fix some muscles that were
19515 not expanded by m4.
19516
3f3eed27
AD
195172002-02-05 Akim Demaille <akim@epita.fr>
19518
19519 * data/bison.c++: Adjust to the M4 back end.
19520 More is certainly needed.
19521
be2a1a68
AD
195222002-02-05 Akim Demaille <akim@epita.fr>
19523
19524 Give a try to M4 as a back end.
19525
19526 * lib/readpipe.c: New, from wdiff.
19527 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
19528 BISON_HAIRY.
19529 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
19530 specific values. Now it is m4 that performs the lookup.
19531 * src/parse-skel.y: Remove.
19532 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
19533 * src/output.c (actions_output, guards_output)
19534 (token_definitions_output): No longer keeps track of the output
19535 line number, hence remove the second argument.
19536 (guards_output): Check against the guard member of a rule, not the
19537 action member.
19538 Adjust callers.
19539 (output_skeleton): Don't look for the skeleton location, let m4 do
19540 that.
19541 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
19542 file will be used.
19543 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
19544 (prepare): Given that for the time being changesyntax is not
19545 usable in M4, rename the muscles using `-' to `_'.
19546 Define `defines_flag', `output_parser_name' and `output_header_name'.
19547 * src/output.h (actions_output, guards_output)
19548 (token_definitions_output): Adjust prototypes.
19549 * src/scan-skel.l: Instead of scanning the skeletons, it now
19550 processes the output of m4: `__oline__' and `#output'.
19551 * data/bison.simple: Adjust to be used by M4(sugar).
19552 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
19553 to date.
19554 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
19555 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
19556 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
19557 shamelessly stolen from CVS Autoconf.
19558
beda758b
AD
195592002-02-05 Akim Demaille <akim@epita.fr>
19560
19561 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
19562 * configure.in: Check for the declarations of free and malloc.
19563 * src/muscle_tab.c: Adjust.
19564
5ece6d43
AD
195652002-02-05 Akim Demaille <akim@epita.fr>
19566
19567 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
19568 which have no values.
19569
5bb18f9a
AD
195702002-02-05 Akim Demaille <akim@epita.fr>
19571
19572 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
19573 * data/: here.
19574
894dd62e
PE
195752002-01-29 Paul Eggert <eggert@twinsun.com>
19576
19577 * src/bison.simple (YYSIZE_T): Do not define merely because
19578 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
19579 On some platforms, <alloca.h> does not declare YYSTD (size_t).
19580
82841af7
AD
195812002-01-27 Akim Demaille <akim@epita.fr>
19582
19583 Fix `%nonassoc and eof'.
19584
19585 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
19586 which were not properly copied! Replace
19587 memcpy (res->errs, src->errs, src->nerrs);
19588 with
19589 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
19590 !!!
19591 * tests/regression.at (%nonassoc and eof): Adjust to newest
19592 Autotest: `.' is not in the PATH.
19593
318b76e9
AD
195942002-01-27 Akim Demaille <akim@epita.fr>
19595
19596 * tests/sets.at (AT_EXTRACT_SETS): New.
19597 (Nullable): Use it.
19598 (Firsts): New.
19599
30d2f3d5
AD
196002002-01-26 Akim Demaille <akim@epita.fr>
19601
19602 * tests/actions.at, tests/calc.at, tests/headers.at,
19603 * tests/torture.at: Adjust to the newest Autotest which no longer
19604 forces `.' in the PATH.
19605
30f8c395
AD
196062002-01-25 Akim Demaille <akim@epita.fr>
19607
19608 * tests/regression.at (%nonassoc and eof): New.
19609 Suggested by Robert Anisko.
19610
29ae55f1
AD
196112002-01-24 Akim Demaille <akim@epita.fr>
19612
19613 Bison dumps core when trying to complain about broken input files.
19614 Reported by Cris van Pelt.
19615
19616 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
19617 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
19618 into...
19619 (Invalid inputs): Strengthen: exercise parse_percent_token.
19620
2b548aa6
RA
196212002-01-24 Robert Anisko <robert.anisko@epita.fr>
19622
19623 * src/Makefile.am: Add bison.c++.
19624 * src/bison.c++: New skeleton.
19625
bb0146c2
AD
196262002-01-21 Paolo Bonzini <bonzini@gnu.org>
19627
19628 * po/it.po: New.
19629
bec30531
AD
196302002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
19631
19632 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
19633
fc6edc45
MA
196342002-01-20 Marc Autret <marc@gnu.org>
19635
19636 * src/files.c (compute_output_file_names): Fix
19637
5e5d5415
MA
196382002-01-20 Marc Autret <marc@gnu.org>
19639
19640 * tests/output.at: New test.
19641 * src/files.c (compute_base_names): Don't map extensions when
19642 the YACC flag is set, use defaults.
19643 Reported by Evgeny Stambulchik.
19644
44ea3fbd
MA
196452002-01-20 Marc Autret <marc@gnu.org>
19646
ba0fe3c7
PE
19647 * src/system.h: Need to define __attribute__ away for non-GCC
19648 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
19649 Suggested by Albert Chin-A-Young.
19650
338963d1
TVH
196512002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
19652
19653 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
19654 canonical definition.
19655 * src/system.h: Use the canonical definition for PARAMS (avoids
19656 a conflict with the macro from lib/hash.h).
19657
c57b2479
AD
196582002-01-11 Akim Demaille <akim@epita.fr>
19659
19660 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 19661 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 19662
b85810ae
AD
196632002-01-09 Akim Demaille <akim@epita.fr>
19664
19665 * src/files.c, src/files.h (output_infix): New.
19666 (tab_extension): Remove.
19667 (compute_base_names): Compute the former, drop the latter.
19668 * src/output.c (prepare): Insert the muscles `output-infix', and
19669 `output-suffix'.
19670 * src/parse-skel.y (string, string.1): New.
19671 (section.header): Use it.
19672 (section.yacc): Remove.
19673 (prefix): Remove too.
19674 * src/scan-skel.l: Adjust.
19675 * src/bison.simple, src/bison.hairy: Adjust.
19676
cae60122
AD
196772002-01-09 Akim Demaille <akim@epita.fr>
19678
19679 * configure.in (WERROR_CFLAGS): Compute it.
19680 * src/Makefile.am (CFLAGS): Pass it.
19681 * tests/atlocal.in (CFLAGS): Idem.
19682 * src/files.c: Fix a few warnings.
19683 (get_extension_index): Remove, unused.
19684
ae404801
AD
196852002-01-08 Akim Demaille <akim@epita.fr>
19686
19687 * src/getargs.c (AS_FILE_NAME): New.
19688 (getargs): Use it to convert DOSish file names.
19689 * src/files.c (base_name): Rename as full_base_name to avoid
19690 clashes with `base_name ()'.
19691 (filename_split): New.
19692 (compute_base_names): N-th rewrite, using filename_split.
19693
22312b71
AD
196942002-01-08 Akim Demaille <akim@epita.fr>
19695
19696 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
19697 New, stolen from the Fileutils 4.1.
19698 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
19699 * configure.in: Check for the presence of memrchr, and of its
19700 prototype.
19701
a67cef01
TVH
197022002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
19703
19704 * lib/hash.h (__P): Added definition for this macro.
19705 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
19706 BUILT_SOURCES, to ensure they are generated first.
19707 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
19708 %error-verbose to allow bootstrapping with bison 1.30x.
19709
2b25d624
AD
197102002-01-06 Akim Demaille <akim@epita.fr>
19711
19712 * src/reader.c (parse_braces): Don't fetch the next char, the
19713 convention is to fetch on entry.
19714 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
19715 'switch' without a following semicolon.
19716 * tests/regression.at (braces parsing): New.
19717
3460813b
AD
197182002-01-06 Akim Demaille <akim@epita.fr>
19719
19720 Bison is dead wrong in its RR conflict reports.
19721
19722 * tests/torture.at (GNU Cim Grammar): New.
19723 * src/conflicts.c (count_rr_conflicts): Fix.
19724
73784c64
AD
197252002-01-06 Akim Demaille <akim@epita.fr>
19726
19727 Creating package.m4 from configure.ac causes too many problems.
19728
19729 * tests/Makefile.am (package.m4): Create it by hand,
19730 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
19731
25d81090
AD
197322002-01-06 Akim Demaille <akim@epita.fr>
19733
19734 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
19735 skeleton.h.
19736
a9b8959e
PE
197372002-01-04 Paul Eggert <eggert@twinsun.com>
19738
19739 * doc/bison.texinfo (Debugging):
19740 Remove YYSTDERR; it's no longer defined or used.
19741 Also, s/cstdio.h/cstdio/.
19742
25d81090
AD
197432002-01-03 Akim Demaille <akim@epita.fr>
19744
19745 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
19746
1109455c
AD
197472002-01-03 Akim Demaille <akim@epita.fr>
19748
19749 * src/parse-skel.y (process_skeleton): Don't bind the parser's
19750 tracing code to --trace, wait for a better --trace option, with
19751 args.
19752
7ea5e977
AD
197532002-01-03 Akim Demaille <akim@epita.fr>
19754
19755 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
19756 The ISO C++ standard is extremely clear about it: stderr is
19757 considered a macro, not a regular symbol (see table 94 `Header
19758 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
19759 Therefore std:: does not apply to it. It still does with fprintf.
19760 Also, s/cstdio.h/cstdio/.
19761
fab5b110
AD
197622002-01-03 Akim Demaille <akim@epita.fr>
19763
19764 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
19765 for non system headers.
19766
aed7fd9b
AD
197672002-01-02 Akim Demaille <akim@epita.fr>
19768
19769 Equip the skeleton chain with location tracking, runtime trace,
19770 pure parser and scanner.
19771
19772 * src/parse-skel.y: Request a pure parser, locations, and prefix
19773 renaming.
19774 (%union): Having several members with the same type does not help
19775 type mismatches, simplify.
19776 (YYPRINT, yyprint): New.
19777 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
19778 (skel_error): this.
19779 Handle locations.
19780 * src/scan-skel.l: Adjust to these changes.
19781 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
19782 (LOCATION_PRINT, skel_control_t): New.
19783
24fad99e
AD
197842001-12-30 Akim Demaille <akim@epita.fr>
19785
19786 * src/parse-skel.y: Get rid of the shift/reduce conflict:
19787 replace `gb' with BLANKS.
19788 * src/scan-skel.l: Adjust.
19789
a4b36db4
AD
197902001-12-30 Akim Demaille <akim@epita.fr>
19791
19792 * src/system.h: We don't need nor want bcopy.
19793 Throw away MS-DOS crap: we don't need getpid.
19794 * configure.in: We don't need strndup. It was even causing
19795 problems: because Flex includes the headers *before* us,
19796 _GNU_SOURCE is not defined by config.h, and therefore strndup was
19797 not visible.
19798 * lib/xstrndup.c: New.
19799 * src/scan-skel.l: Use it.
19800 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
19801 * src/parse-skel.y: Use %directives instead of #defines.
19802
1239777d
AD
198032001-12-30 Akim Demaille <akim@epita.fr>
19804
19805 * src/skeleton.h: New.
19806 * src/output.c (output_parser, output_master_parser): Remove, dead
19807 code.
19808 * src/output.h (get_lines_number, actions_output, guards_output)
19809 (token_definitions_output): Prototype them.
19810 * src/parse-skel.y: Add the license notice.
19811 Include output.h and skeleton.h.
19812 (process_skeleton): Returns void, and takes a single parameter.
19813 * src/scan-skel.l: Add the license notice.
19814 Include skeleton.h.
19815 Don't use %option yylineno: it seems that then Flex imagines
19816 REJECT has been used, and therefore it won't reallocate its
19817 buffers (which makes no other sense to me than a bug). It results
19818 in warnings for `unused: yy_flex_realloc'.
19819
9b3add5b
RA
198202001-12-30 Robert Anisko <robert.anisko@epita.fr>
19821
19822 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
19823 (MUSCLE_INSERT_PREFIX): ...to there.
19824 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
19825 (MUSCLE_INSERT_PREFIX): Move from here...
19826
19827 * src/bison.hairy: Add a section directive. Put braces around muscle
19828 names. This parser skeleton is still broken, but Bison should not
19829 choke on a bad muscle 'syntax'.
19830 * src/bison.simple: Add a section directive. Put braces around muscle
19831 names.
19832
19833 * src/files.h (strsuffix, stringappend): Add declarations.
19834 (tab_extension): Add declaration.
19835 (short_base_name): Add declaration.
19836
19837 * src/files.c (strsuffix, stringappend): No longer static. These
19838 functions are used in the skeleton parser.
19839 (tab_extension): New.
19840 (compute_base_names): Use the computations done in this function
fab5b110 19841 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
19842 names.
19843 (short_base_name): No longer static.
19844
19845 * src/output.c (output_skeleton): New.
19846 (output): Disable call to output_master_parser, and give a try to
19847 a new skeleton handling system.
19848 (guards_output, actions_output): No longer static.
19849 (token_definitions_output, get_lines_number): No longer static.
19850
19851 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
19852
fab5b110 19853 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
19854 parse-skel.y.
19855
19856 * src/parse-skel.y: New file.
19857 * src/scan-skel.l: New file.
19858
b5b61c61
AD
198592001-12-29 Akim Demaille <akim@epita.fr>
19860
19861 %name-prefix is broken.
19862
19863 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
19864 Adjust all dependencies.
19865 * tests/headers.at (export YYLTYPE): Strengthen this test: use
19866 %name-prefix.
19867
19868 Renaming yylval but not yylloc is not consistent. Now we do.
19869
19870 * src/bison.simple: Prefix yylloc if used.
19871 * doc/bison.texinfo (Decl Summary): Document that.
19872
8c9a50be
AD
198732001-12-29 Akim Demaille <akim@epita.fr>
19874
19875 * doc/bison.texinfo: Promote `%long-directive' over
19876 `%long_directive'.
19877 Remove all references to fixed-output-files, yacc is enough.
19878
d99361e6
AD
198792001-12-29 Akim Demaille <akim@epita.fr>
19880
19881 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
19882 user prologue. These are defaults.
19883 * tests/actions.at (Mid-rule actions): Make sure the user can
19884 define YYDEBUG and YYERROR_VERBOSE.
19885
b9cecb91
AD
198862001-12-29 Akim Demaille <akim@epita.fr>
19887
19888 * src/output.c (header_output): Don't forget to export YYLTYPE and
19889 yylloc.
19890 * tests/headers.at (export YYLTYPE): New, make sure it does.
19891 * tests/regression.at (%union and --defines, Invalid CPP headers):
19892 Move to...
19893 * tests/headers.at: here.
19894
aea13e97
AD
198952001-12-29 Akim Demaille <akim@epita.fr>
19896
19897 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
19898
931394cb
AD
198992001-12-29 Akim Demaille <akim@epita.fr>
19900
19901 * tests/actions.at (Mid-rule actions): Output on a single line
19902 instead of several.
19903
704a47c4
AD
199042001-12-29 Akim Demaille <akim@epita.fr>
19905
19906 * doc/bison.texinfo: Formatting changes.
19907
091e20bb
AD
199082001-12-29 Akim Demaille <akim@epita.fr>
19909
19910 Don't store the token defs in a muscle, just be ready to output it
19911 on command. Now possible via `symbols'. Fixes a memory leak.
19912
19913 * src/output.c (token_definitions_output): New.
19914 (output_parser, header_output): Use it.
19915 * src/reader.c (symbols_save): Remove.
19916
cce71710
AD
199172001-12-29 Akim Demaille <akim@epita.fr>
19918
19919 * src/bison.simple: Do not provide a default for YYSTYPE and
19920 YYLTYPE before the user's prologue. Otherwise it's hardly... a
19921 default.
19922
82c035a8
AD
199232001-12-29 Akim Demaille <akim@epita.fr>
19924
19925 Mid-rule actions are simply... ignored!
19926
19927 * src/reader.c (readgram): Be sure to attach mid-rule actions to
19928 the empty-rule associated to the dummy symbol, not to the host
19929 rule.
19930 * tests/actions.at (Mid-rule actions): New.
19931
8419d367
AD
199322001-12-29 Akim Demaille <akim@epita.fr>
19933
19934 Memory leak.
19935
19936 * src/reader.c (reader): Free grammar.
19937
375d5806
AD
199382001-12-29 Akim Demaille <akim@epita.fr>
19939
19940 Memory leak.
19941
19942 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
19943 since it allocates it for each state, although only one is needed.
19944 (allocate_storage): Do it here.
19945
f51cb8ff
AD
199462001-12-29 Akim Demaille <akim@epita.fr>
19947
19948 * src/options.h, src/options.c (create_long_option_table): Rename
19949 as...
19950 (long_option_table_new): this, with a clearer prototype.
19951 (percent_table): Remove, unused,
19952 * src/getargs.c (getargs): Adjust.
19953
29e88316
AD
199542001-12-29 Akim Demaille <akim@epita.fr>
19955
19956 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
19957 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
19958 as states.
19959
b9f71f19
AD
199602001-12-29 Akim Demaille <akim@epita.fr>
19961
19962 * src/lalr.c (build_relations): Rename `states' as `states1'.
19963 Sorry, I don't understand exactly what it is, no better name...
19964
1a2b5d37
AD
199652001-12-29 Akim Demaille <akim@epita.fr>
19966
19967 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
19968 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
19969 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
19970 as rules.
19971
1cca533e
AD
199722001-12-29 Akim Demaille <akim@epita.fr>
19973
19974 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
19975 ago.
19976
c03ae966
AD
199772001-12-29 Akim Demaille <akim@epita.fr>
19978
19979 * src/reader.c, src/reader.h (user_toknums): Remove.
19980 Adjust all users to use symbols[i]->user_token_number.
19981
5a670b1e
AD
199822001-12-29 Akim Demaille <akim@epita.fr>
19983
19984 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
19985 Adjust all users to use symbols[i]->prec or ->assoc.
19986
ad949da9
AD
199872001-12-29 Akim Demaille <akim@epita.fr>
19988
19989 * src/reader.c, src/reader.h (tags): Remove.
19990 Adjust all users to use symbols[i]->tag.
19991
0e78e603
AD
199922001-12-29 Akim Demaille <akim@epita.fr>
19993
19994 * src/gram.h, src/gram.c (symbols): New, similar to state_table
19995 and rule_table.
19996 * src/reader.c (packsymbols): Fill this table.
19997 Drop sprec.
19998 * src/conflicts.c (resolve_sr_conflict): Adjust.
19999 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
20000 single table.
20001 Use symbols[i]->tag instead of tags[i].
20002
213e640e
AD
200032001-12-29 Akim Demaille <akim@epita.fr>
20004
20005 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
20006 In addition, put a comment in there, to replace...
20007 * tests/regression.at (%union and C comments): Remove.
20008
e7b8bef1
AD
200092001-12-29 Akim Demaille <akim@epita.fr>
20010
20011 * tests/regression.at (Web2c Actions): Blindly move the actual
20012 output as expected output. The contents *seem* right to me, but I
20013 can't pretend reading perfectly parser tables... Nonetheless, all
20014 the other tests pass correctly, the table look OK, even though the
20015 presence of `$axiom' is to be noted: AFAICS it is useless (but
20016 harmless).
20017
b68e7744
AD
200182001-12-29 Akim Demaille <akim@epita.fr>
20019
20020 * src/reader.c (readgram): Don't add the rule 0 if there were no
20021 rules read. In other words, add it _after_ having performed
20022 grammar sanity checks.
20023 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
20024
78d5bae9
AD
200252001-12-29 Akim Demaille <akim@epita.fr>
20026
20027 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
20028 visible, and some states have now a different number.
20029
ff442794
AD
200302001-12-29 Akim Demaille <akim@epita.fr>
20031
20032 * src/reader.c (readgram): Bind the initial rule's lineno to that
20033 of the first rule.
20034 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
20035 (Solved SR Conflicts): Adjust rule 0's line number.
20036
610ab194
AD
200372001-12-29 Akim Demaille <akim@epita.fr>
20038
20039 Fix the `GAWK Grammar' failure.
20040
20041 * src/LR0.c (final_state): Initialize to -1 so that we do compute
20042 the reductions of the first state which was mistakenly confused
20043 with the final state because precisely final_state was initialized
20044 to 0.
20045 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
20046 now noticed by Bison.
20047 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
20048 have a reduction on $default.
20049
29d29c8f
AD
200502001-12-29 Akim Demaille <akim@epita.fr>
20051
20052 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
20053 rule line numbers.
20054 * src/closure.c (print_closure): Likewise.
20055 * src/derives.c (print_derives): Likewise.
20056 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
20057 now.
20058
7c6b64d0
AD
200592001-12-29 Akim Demaille <akim@epita.fr>
20060
20061 * src/lalr.c (lookaheads_print): New.
20062 (lalr): Call it when --trace-flag.
20063 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
20064 are dumped.
20065
3d4daee3
AD
200662001-12-29 Akim Demaille <akim@epita.fr>
20067
20068 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
20069 when walking through ritem, even via rule->rhs.
20070 * src/reduce.c (dump_grammar, useful_production, reduce_output)
20071 (useful_production, useless_nonterminals): Likewise.
20072 (reduce_grammar_tables): Likewise, plus update nritems.
20073 * src/nullable.c (set_nullable): Likewise.
20074 * src/lalr.c (build_relations): Likewise.
20075 * tests/sets.at (Nullable): Adjust.
20076 Fortunately, now, the $axiom is no longer nullable.
20077
9e7f6bbd
AD
200782001-12-29 Akim Demaille <akim@epita.fr>
20079
20080 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
20081 the 0-sentinel.
20082 * src/gram.c (ritem_longest_rhs): Likewise.
20083 * src/reduce.c (nonterminals_reduce): Likewise.
20084 * src/print_graph.c (print_graph): Likewise.
20085 * src/output.c (output_rule_data): Likewise.
20086 * src/nullable.c (set_nullable): Likewise.
20087
255ef638
AD
200882001-12-29 Akim Demaille <akim@epita.fr>
20089
20090 * src/output.c: Comment changes.
20091
0d8a7363
AD
200922001-12-27 Paul Eggert <eggert@twinsun.com>
20093
20094 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
20095 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
20096 Sparc, as they were causing more porting problems than the
20097 (minor) performance improvement was worth.
20098
20099 Also, catch up with 1.31's YYSTD.
20100
3db472b9
AD
201012001-12-27 Akim Demaille <akim@epita.fr>
20102
20103 * src/output.c (output_gram): Rely on nritems, not the
20104 0-sentinel. See below.
20105 Use -1 as separator, not 0.
20106 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
20107 Rely on -1 as separator in yyrhs, instead of 0.
20108 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
20109 twice `Now at end of input', therefore there are two lines less to
20110 expect.
20111
b365aa05
AD
201122001-12-27 Akim Demaille <akim@epita.fr>
20113
20114 * tests/regression.at (Unresolved SR Conflicts):
20115 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
20116 below.
20117
30171f79
AD
201182001-12-27 Akim Demaille <akim@epita.fr>
20119
20120 * src/LR0.c (new_state): Recognize the final state by the fact it
20121 is reached by eoftoken.
20122 (insert_start_shifting_state, insert_eof_shifting_state)
20123 (insert_accepting_state, augment_automaton): Remove, since now
20124 these states are automatically computed from the initial state.
20125 (generate_states): Adjust.
20126 * src/print.c: When reporting a rule number to the user, substract
20127 1, so that the axiom rule is rule 0, and the first user rule is 1.
20128 * src/reduce.c: Likewise.
20129 * src/print_graph.c (print_core): For the time being, just as for
20130 the report, depend upon --trace-flags to dump the full set of
20131 items.
20132 * src/reader.c (readgram): Once the grammar read, insert the rule
20133 0: `$axiom: START-SYMBOL $'.
20134 * tests/set.at: Adjust: rule 0 is now displayed, and since the
20135 number of the states has changed (the final state is no longer
20136 necessarily the last), catch up.
20137
75142d45
AD
201382001-12-27 Akim Demaille <akim@epita.fr>
20139
20140 Try to make the use of the eoftoken valid. Given that its value
20141 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
20142 is used instead of > 0 where appropriate, (ii), depend upon nritems
20143 instead of the 0-sentinel.
20144
20145 * src/gram.h, src/gram.c (nritems): New.
20146 Expected to be duplication of nitems, but for the time being...
20147 * src/reader.c (packgram): Assert nritems and nitems are equal.
20148 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
20149 * src/closure.c (print_closure, print_fderives): Likewise.
20150 * src/gram.c (ritem_print): Likewise.
20151 * src/print.c (print_core, print_grammar): Likewise.
20152 * src/print_graph.c: Likewise.
20153
b7c49edf
AD
201542001-12-27 Akim Demaille <akim@epita.fr>
20155
20156 * src/main.c (main): If there are complains after grammar
20157 reductions, then output the report anyway if requested, then die.
20158 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
20159 * src/reader.c (eoftoken): New.
20160 (parse_token_decl): If the token being defined has value `0', it
20161 is the eoftoken.
20162 (packsymbols): No longer hack `tags' to insert `$' by hand.
20163 Be sure to preserve the value of the eoftoken.
20164 (reader): Make sure eoftoken is defined.
20165 Initialize nsyms to 0: now eoftoken is created just like the others.
20166 * src/print.c (print_grammar): Don't special case the eof token.
20167 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
20168 lie anyway, albeit pleasant.
20169 * tests/calc.at: Exercise error messages with eoftoken.
20170 Change the grammar so that empty input is invalid.
20171 Adjust expectations.
20172 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
20173
ec2da99f
AD
201742001-12-27 Akim Demaille <akim@epita.fr>
20175
20176 * configure.in: Check the protos of strchr ans strspn.
20177 Replace strchr if needed.
20178 * src/system.h: Provide the protos of strchr, strspn and memchr if
20179 missing.
20180 * lib/strchr.c: New.
20181 * src/reader.c (symbols_save): Use strchr.
20182
8adfa272
AD
201832001-12-27 Akim Demaille <akim@epita.fr>
20184
20185 * src/print.c, src/print_graph.c (escape): New.
20186 Use it to quote the TAGS outputs.
20187 * src/print_graph.c (print_state): Now errors are in red, and
20188 reductions in green.
20189 Prefer high to wide: output the state number on a line of its own.
20190
80dac38c
AD
201912001-12-27 Akim Demaille <akim@epita.fr>
20192
20193 * src/state.h, src/state.c (reductions_new): New.
20194 * src/LR0.c (set_state_table): Let all the states have a
20195 `reductions', even if reduced to 0.
20196 (save_reductions): Adjust.
20197 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
20198 * src/print.c (print_reductions, print_actions): Adjust.
20199 * src/output.c (action_row): Adjust.
20200
2cec70b9
AD
202012001-12-27 Akim Demaille <akim@epita.fr>
20202
20203 * src/state.h, src/state.c (errs_new, errs_dup): New.
20204 * src/LR0.c (set_state_table): Let all the states have an errs,
20205 even if reduced to 0.
20206 * src/print.c (print_errs, print_reductions): Adjust.
20207 * src/output.c (output_actions, action_row): Adjust.
20208 * src/conflicts.c (resolve_sr_conflict): Adjust.
20209
13ca549a
AD
202102001-12-27 Akim Demaille <akim@epita.fr>
20211
20212 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
20213
5092aba5
AD
202142001-12-27 Akim Demaille <akim@epita.fr>
20215
20216 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
20217 * src/print.c: here.
20218 (lookaheadset, shiftset): New, used as additional storage by
20219 print_reductions.
20220 (print_results): Adjust.
20221 (print_shifts, print_gotos, print_errs): New, extracted from...
20222 (print_actions): here.
20223 * src/print_graph.c (print_actions): Remove dead code.
20224
11e2beca
AD
202252001-12-27 Akim Demaille <akim@epita.fr>
20226
20227 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
20228 `$n' and `@n'.
20229
dac3c910
AD
202302001-12-27 Akim Demaille <akim@epita.fr>
20231
20232 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
20233 (build_relations): Adjust.
20234
d0b0fefa
AD
202352001-12-27 Akim Demaille <akim@epita.fr>
20236
20237 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
20238 duplication.
20239
adc8c848
AD
202402001-12-27 Akim Demaille <akim@epita.fr>
20241
20242 * src/reader.c (packgram): Catch nitems overflows.
20243
14d293ac
AD
202442001-12-27 Akim Demaille <akim@epita.fr>
20245
20246 * src/files.c, src/files.h (guard_obstack): Remove.
20247 * src/output.c (output): Adjust.
20248 * src/reader.c (parse_braces): New, factoring...
20249 (copy_action, copy_guard): these two which are renamed as...
20250 (parse_action, parse_guard): these.
20251 As a voluntary consequence, using braces around guards is now
20252 mandatory.
20253
f499b062
AD
202542001-12-27 Akim Demaille <akim@epita.fr>
20255
20256 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
20257 * src/reader.c (symbol_list): `guard' and `guard_line' are new
20258 members.
20259 (symbol_list_new): Adjust.
20260 (copy_action): action_line is the first line, not the last.
20261 (copy_guard): Just as for actions, store the `action' only, not
20262 the switch/case/break flesh.
20263 Don't parse the user action that might follow the guard, let...
20264 (readgram): do it, i.e., now, there can be an action after a
20265 guard.
20266 In other words the guard is just explicitly optional.
20267 (packgram): Adjust.
20268 * src/output.c (guards_output): New.
20269 (output_parser): Call it when needed.
20270 (output): Also free the guard and attrs obstacks.
20271 * src/files.c, src/files.h (obstack_save): Remove.
20272 (output_files): Remove.
20273 As a result, if one needs the former `.act' file, using an
20274 appropriate skeleton which requires actions and guards is now
20275 required.
20276 * src/main.c (main): Adjust.
20277 * tests/semantic.at: New.
20278 * tests/regression.at: Use `input.y' as input file name.
20279 Avoid 8+3 problems by requiring input.c when the test needs the
20280 parser.
20281
d945f5cd
AD
202822001-12-27 Akim Demaille <akim@epita.fr>
20283
20284 * src/reader.c (symbol_list_new): Be sure to initialize all the
20285 fields.
20286
d200e455
AD
202872001-12-27 Akim Demaille <akim@epita.fr>
20288
20289 All the hacks using a final pseudo state are now useless.
20290
20291 * src/LR0.c (set_state_table): state_table holds exactly nstates.
20292 * src/lalr.c (nLA): New.
20293 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
20294 instead of lookaheadsp from the pseudo state (nstate + 1).
20295
f9507c28
AD
202962001-12-27 Akim Demaille <akim@epita.fr>
20297
20298 * src/output.c (action_row, token_actions): Use a state_t instead
20299 of a integer, and nlookaheads instead of the following state's
20300 lookaheadsp.
20301
065fbd27
AD
203022001-12-27 Akim Demaille <akim@epita.fr>
20303
20304 * src/conflicts.c (log_resolution, flush_shift)
20305 (resolve_sr_conflict, set_conflicts, solve_conflicts)
20306 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
20307 (conflicts_print, print_reductions): Use a state_t instead of an
20308 integer when referring to a state.
20309 As much as possible, depend upon nlookaheads, instead of the
20310 `lookaheadsp' member of the following state (since lookaheads of
20311 successive states are successive, the difference between state n + 1
20312 and n served as the number of lookaheads for state n).
20313 * src/lalr.c (add_lookback_edge): Likewise.
20314 * src/print.c (print_core, print_actions, print_state)
20315 (print_results): Likewise.
20316 * src/print_graph.c (print_core, print_actions, print_state)
20317 (print_graph): Likewise.
20318 * src/conflicts.h: Adjust.
20319
1b177bd7
AD
203202001-12-27 Akim Demaille <akim@epita.fr>
20321
20322 * src/bison.hairy: Formatting/comment changes.
20323 ANSIfy.
20324 Remove `register' indications.
20325 Add plenty of `static'.
20326
7742ddeb
AD
203272001-12-27 Akim Demaille <akim@epita.fr>
20328
20329 * src/output.c (prepare): Drop the muscle `ntbase' which
20330 duplicates ntokens.
20331 * src/bison.simple: Formatting/comment changes.
20332 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
20333 is an undocumented synonym.
20334
1fa14068
AD
203352001-12-22 Akim Demaille <akim@epita.fr>
20336
20337 * src/output.c (output_table_data): Change the prototype to use
20338 `int' for array ranges: some invocations do pass an int, not a
20339 short.
20340 Reported by Wayne Green.
20341
b9752825
AD
203422001-12-22 Akim Demaille <akim@epita.fr>
20343
20344 Some actions of web2c.y are improperly triggered.
20345 Reported by Mike Castle.
20346
20347 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
20348 * tests/regression.at (Web2c): Rename as...
20349 (Web2c Report): this.
20350 (Web2c Actions): New.
20351
776209d6
AD
203522001-12-22 Akim Demaille <akim@epita.fr>
20353
20354 Reductions in web2c.y are improperly reported.
20355 Reported by Mike Castle.
20356
20357 * src/conflicts.c (print_reductions): Fix.
20358 * tests/regression.at (Web2c): New.
20359
275fc3ad
AD
203602001-12-18 Akim Demaille <akim@epita.fr>
20361
20362 Some host fail on `assert (!"foo")', which expands to
20363 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
20364 Reported by Nelson Beebee.
20365
20366 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
20367 `#define it_succeeded 0' and `assert (it_succeeded)'.
20368
897668ee
MA
203692001-12-17 Marc Autret <autret_m@epita.fr>
20370
20371 * src/bison.simple: Don't hard code the skeleton line and filename.
20372 * src/output.c (output_parser): Rename 'line' as 'output_line'.
20373 New line counter 'skeleton_line' (skeleton-line muscle).
20374
ab3399e0
PE
203752001-12-17 Paul Eggert <eggert@twinsun.com>
20376
20377 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
20378 YYDEBUG must be defined to a nonzero value.
20379
20380 * src/bison.simple (yytname): Do not assume that the user defines
20381 YYDEBUG to a properly parenthesized expression.
20382
3877f72b
AD
203832001-12-17 Akim Demaille <akim@epita.fr>
20384
20385 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
20386 nlookaheads is a new member.
20387 Adjust all users.
20388 * src/lalr.h (nlookaheads): Remove this orphan declaration.
20389 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
20390 state.
776209d6 20391
331dbc1b
AD
203922001-12-17 Akim Demaille <akim@epita.fr>
20393
20394 * src/files.h, src/files.c (open_files, close_files): Remove.
20395 * src/main.c (main): Don't open/close files, nor invoke lex_free,
20396 let...
20397 * src/reader.c (reader): Do it.
776209d6 20398
be750e4c
AD
203992001-12-17 Akim Demaille <akim@epita.fr>
20400
20401 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 20402
709ae8c6
AD
204032001-12-17 Akim Demaille <akim@epita.fr>
20404
20405 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
20406 (flush_reduce): New.
20407 (resolve_sr_conflict): Adjust.
776209d6 20408
f87685c3
AD
204092001-12-17 Akim Demaille <akim@epita.fr>
20410
20411 * src/output.c (output_obstack): Be static and rename as...
20412 (format_obstack): this, to avoid any confusion with files.c's
20413 output_obstack.
20414 * src/reader.h (muscle_obstack): Move to...
20415 * src/output.h: here, since it's defined in output.c.
20416
837491d8
AD
204172001-12-17 Akim Demaille <akim@epita.fr>
20418
20419 * src/output.c (action_row, save_column, default_goto)
20420 (sort_actions, matching_state, pack_vector): Better variable
20421 locality.
20422
796d61fb
AD
204232001-12-17 Akim Demaille <akim@epita.fr>
20424
20425 * src/output.c: Various formatting changes.
776209d6 20426
64d15509
AD
204272001-12-17 Akim Demaille <akim@epita.fr>
20428
20429 * src/files.c (output_files): Free the output_obstack.
20430 * src/main.c (main): Call print and print_graph conditionally.
20431 * src/print.c (print): Work unconditionally.
20432 * src/print_graph.c (print_graph): Work unconditionally.
20433 * src/conflicts.c (log_resolution): Output only if verbose_flag.
20434
fbc8ecb7
MA
204352001-12-16 Marc Autret <autret_m@epita.fr>
20436
20437 * src/output.c (actions_output): Fix. When we use %no-lines,
20438 there is one less line per action.
20439
f0440388
MA
204402001-12-16 Marc Autret <autret_m@epita.fr>
20441
20442 * src/bison.simple: Remove a useless #line directive.
20443 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
20444 * src/output.c (get_lines_number): New.
776209d6 20445 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
20446 output muscles.
20447 Fix line numbering.
20448 (actions_output): Computes the number of lines taken by actions.
20449 (output_master_parser): Insert new skeleton which is the name of
20450 the output parser file name.
20451
a79986b8
MA
204522001-12-15 Marc Autret <autret_m@epita.fr>
20453
20454 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
20455
4ec8e00f
MA
204562001-12-15 Marc Autret <autret_m@epita.fr>
20457
20458 * src/output.c (output_gram): Keep track of the hairy one.
20459
1a4648ff
AD
204602001-12-15 Akim Demaille <akim@epita.fr>
20461
20462 Make `make distcheck' work.
20463
20464 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
20465 system.h which uses libgettext.h.
20466
9c2c67e6
AD
204672001-12-15 Akim Demaille <akim@epita.fr>
20468
20469 * src/nullable.c (set_nullable): Useless rules must be skipped,
20470 otherwise, since we range over their symbols, we might look at a
20471 nonterminal which no longer ``exists'', i.e., it is not counted in
20472 `nvars', hence we overflow our arrays.
20473
93ede233
AD
204742001-12-15 Akim Demaille <akim@epita.fr>
20475
20476 The header can also be produced directly, without any obstack!
20477 Yahoo!
20478
20479 * src/files.c, src/files.h (defines_obstack): Remove.
20480 (compute_header_macro): Global.
20481 (defines_obstack_save): Remove.
20482 * src/reader.c (parse_union_decl): No longer output to
20483 defines_obstack: its content can be found in the `stype' muscle
20484 anyway.
20485 (output_token_translations): Merge into...
20486 (symbols_output): this.
20487 Rename as...
20488 (symbols_save): this.
20489 (reader): Adjust.
20490 * src/output.c (header_output): New.
20491 (output): Call it.
20492
2666f928
AD
204932001-12-15 Akim Demaille <akim@epita.fr>
20494
20495 * src/reader.c (parse_union_decl): Instead of handling two obstack
20496 simultaneously, use one to define the `stype' muscle, and use the
20497 value of the latter to fill defines_obstack.
20498 (copy_comment): Remove.
20499 (copy_comment2): Work for a single obstack.
20500 Rename as...
20501 (copy_comment): this.
20502
428046f8
AD
205032001-12-15 Akim Demaille <akim@epita.fr>
20504
20505 * src/lex.c, src/lex.h (xgetc): No longer static.
20506 * src/reader.c (parse_union_decl): Revamp.
20507
ea52d706
AD
205082001-12-15 Akim Demaille <akim@epita.fr>
20509
20510 Still making progress in separating Bison into (i) input, (ii)
20511 process, (iii) output: now we can directly output the parser file
20512 without using table_obstack at all.
20513
20514 * src/files.c, src/files.h (table_obstack): Bye bye.
20515 (parser_file_name): New.
20516 * src/files.c (compute_output_file_names): Compute it.
20517 * src/output.c (actions_output, output_parser)
20518 (output_master_parser): To a file instead of an obstack.
20519
3f96f4dc
AD
205202001-12-15 Akim Demaille <akim@epita.fr>
20521
20522 Attach actions to rules, instead of pre-outputting them to
20523 actions_obstack.
20524
20525 * src/gram.h (rule_t): action and action_line are new members.
20526 * src/reader.c (symbol_list): Likewise.
20527 (copy_action): Save the actions within the rule.
20528 (packgram): Save them in rule_table.
20529 * src/output.c (actions_output): New.
20530 (output_parser): Use it on `%%actions'.
20531 (output_rule_data): Don't free rule_table.
20532 (output): Do it.
20533 (prepare): Don't save the `action' muscle.
20534 * src/bison.simple: s/%%action/%%actions/.
20535
51576fb3
AD
205362001-12-15 Akim Demaille <akim@epita.fr>
20537
20538 * src/reader.c (copy_action): When --yacc, don't append a `;'
20539 to the user action: let it fail if lacking.
dee049eb 20540 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 20541
2648a72d
AD
205422001-12-14 Akim Demaille <akim@epita.fr>
20543
20544 * src/lex.c (literalchar): Simply return the char you decoded, non
20545 longer mess around with obstacks and int pointers.
20546 Adjust all callers.
20547
92790e5b
AD
205482001-12-14 Akim Demaille <akim@epita.fr>
20549
20550 * src/lex.c (literalchar): Don't escape the special characters,
20551 just decode them, and keep them as char (before, eol was output as
20552 the 2 char string `\n' etc.).
20553 * src/output.c (output_rule_data): Use quotearg to output the
20554 token strings.
20555
927c1557
PE
205562001-12-13 Paul Eggert <eggert@twinsun.com>
20557
20558 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
20559 Do not infringe on the global user namespace when using C++.
20560 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
20561 All uses of `fprintf' and `stderr' changed.
20562
20563 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
20564
ed8e1f68
AD
205652001-12-13 Akim Demaille <akim@epita.fr>
20566
20567 The computation of nullable is broken: it doesn't handle empty
20568 RHS's properly.
20569
20570 * tests/torture.at (GNU AWK Grammar): New.
20571 * tests/sets.at (Nullable): New.
20572 * src/nullable.c (set_nullable): Instead of blindly looping over
20573 `ritems', loop over the rules, and then over their rhs's.
20574
20575 Work around Autotest bugs.
20576
20577 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
20578 frame, because Autotest understand lines starting with a `+' as
20579 traces from the shell. Then, they are not processed properly.
20580 Admittedly an Autotest bug, but we don't have time to wait for
20581 Autotest to catch up.
20582 * tests/regression.at (Broken Closure): Adjust to the new table
20583 frames.
20584 Move to...
20585 * tests/sets.at: here.
20586
cb581495
AD
205872001-12-13 Akim Demaille <akim@epita.fr>
20588
20589 * src/closure.c (closure): Use nrules instead of playing tricks
20590 with BITS_PER_WORD.
20591
2e729273
AD
205922001-12-13 Akim Demaille <akim@epita.fr>
20593
20594 * src/print.c (print_actions): Output the handling of `$' as the
20595 traces do: shifting the token EOF. Before EOF was treated as a
20596 nonterminal.
20597 * tests/regression.at: Adjust some tests.
20598 * src/print_graph.c (print_core): Complete the set of items via
20599 closure. The next-to-final and final states are still unsatisfying,
20600 but that's to be addressed elsewhere.
20601 No longer output the rule numbers, but do output the state number.
20602 A single loop for the shifts + gotos is enough, but picked a
20603 distinct color for each.
20604 (print_graph): Initialize and finalize closure.
20605
107f7dfb
AD
206062001-12-13 Akim Demaille <akim@epita.fr>
20607
20608 * src/reader.c (readgram): Remove dead code, an strip useless
20609 braces.
20610 (get_type): Remove, unused.
20611
9b53a24f
AD
206122001-12-12 Akim Demaille <akim@epita.fr>
20613
20614 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
20615 on that of lib/error.c.
20616
dbfb6dcd
AD
206172001-12-12 Akim Demaille <akim@epita.fr>
20618
20619 Some hosts don't like `/' in includes.
20620
20621 * src/system.h: Include libgettext.h without qualifying the path.
20622 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
20623 $(top_srcdir).
20624
c25fb648
MA
206252001-12-11 Marc Autret <autret_m@epita.fr>
20626
20627 * src/output.c (output_parser): Remove useless muscle.
20628
710ddc4f
MA
206292001-12-11 Marc Autret <autret_m@epita.fr>
20630
20631 * src/bison.simple: Remove #line just before %%epilogue. It
20632 is now handled in ...
20633 * src/reader.c (read_additionnal_code): Add the output of a
20634 #line for the epilogue.
20635
e83d80b8
MA
206362001-12-10 Marc Autret <autret_m@epita.fr>
20637
927c1557 20638 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
20639 replace precedent remove.
20640 * src/bison.simple: Remove #line before %%prologue because
20641 %%input-line is wrong at this time.
20642
971d5158
MA
206432001-12-10 Marc Autret <autret_m@epita.fr>
20644
20645 * src/reader.c (symbols_output): Clean up.
927c1557 20646 * src/output.c (output_gram, output): Clean up.
971d5158 20647
5edafffd
AD
206482001-12-10 Akim Demaille <akim@epita.fr>
20649
20650 * src/lalr.c (initialize_lookaheads): New. Extracted from...
20651 * src/LR0.c (set_state_table): here.
20652 * src/lalr.c (lalr): Call it.
20653
0279f8e9
AD
206542001-12-10 Akim Demaille <akim@epita.fr>
20655
20656 * src/state.h (shifts): Remove the `number' member: shifts are
20657 attached to state, hence no longer need to be labelled with a
20658 state number.
20659
190c4f5f
AD
206602001-12-10 Akim Demaille <akim@epita.fr>
20661
20662 Now that states have a complete set of members, the linked list of
20663 shifts is useless: just fill directly the state's shifts member.
20664
20665 * src/state.h (shifts): Remove the `next' member.
20666 * src/LR0.c (first_state, last_state): Remove.
20667 Adjust the callers.
20668 (augment_automaton): Don't look for the shifts that must be added
20669 a shift on EOF: it is those of the state we looked for! But now,
20670 since shifts are attached, it is no longer needed to looking
20671 merely by its id: its number.
20672
2a73b93d
AD
206732001-12-10 Akim Demaille <akim@epita.fr>
20674
20675 * src/LR0.c (augment_automaton): Better variable locality.
20676 Remove an impossible branch: if there is a state corresponding to
20677 the start symbol being shifted, then there is shift for the start
20678 symbol from the initial state.
20679
74392f6a
AD
206802001-12-10 Akim Demaille <akim@epita.fr>
20681
20682 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
20683 only when appropriate: when insert_start_shifting_state' is not
20684 invoked.
20685 * tests/regression.at (Rule Line Numbers): Adjust.
20686
37c82725
AD
206872001-12-10 Akim Demaille <akim@epita.fr>
20688
20689 * src/LR0.c (augment_automaton): Now that all states have shifts,
20690 merge the two cases addition shifts to the initial state.
20691
6a164e0c
AD
206922001-12-10 Akim Demaille <akim@epita.fr>
20693
20694 * src/lalr.c (set_state_table): Move to...
20695 * src/LR0.c: here.
20696 * src/lalr.c (lalr): Don't call it...
20697 * src/LR0.c (generate_states): do it.
20698 * src/LR0.h (first_state): Remove, only the table is used.
20699
7215de24
AD
207002001-12-10 Akim Demaille <akim@epita.fr>
20701
20702 * src/LR0.h (first_shift, first_reduction): Remove.
20703 * src/lalr.c: Don't use first_shift: find shifts through the
20704 states.
20705
80e25d4d
AD
207062001-12-10 Akim Demaille <akim@epita.fr>
20707
20708 * src/LR0.c: Attach shifts to states as soon as they are
20709 computed.
20710 * src/lalr.c (set_state_table): Instead of assigning shifts to
20711 state, just assert that the mapping was properly done.
20712
0ab3728b
AD
207132001-12-10 Akim Demaille <akim@epita.fr>
20714
20715 * src/LR0.c (insert_start_shift): Rename as...
20716 (insert_start_shifting_state): this.
20717 (insert_eof_shifting_state, insert_accepting_state): New.
20718 (augment_automaton): Adjust.
20719 Better locality of the variables.
20720 When looking if the start_symbol is shifted from the initial
20721 state, using `while (... symbol != start_symbol ...)' sounds
20722 better than `while (... symbol < start_symbol ...)': If fail
20723 to see how the order between symbols could be relevant!
20724
78af9bbc
AD
207252001-12-10 Akim Demaille <akim@epita.fr>
20726
20727 * src/getargs.h: Don't declare `spec_name_prefix' and
20728 `spec_file_prefix', declared by src/files.h.
20729 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
20730 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
20731 * src/output.c (prepare): Adjust.
20732 * src/reader.c (symbols_output): Likewise.
20733 * src/vmsgetargs.c: Vaguely adjust, but who cares?
20734
bdef2a41
AD
207352001-12-10 Akim Demaille <akim@epita.fr>
20736
20737 * src/muscle_tab.c (muscle_init): NULL is a better default than
20738 `"0"'.
20739
3735969c
AD
207402001-12-10 Akim Demaille <akim@epita.fr>
20741
20742 * src/reader.c (reader): Calling symbols_output once is enough.
20743
49701457
AD
207442001-12-10 Akim Demaille <akim@epita.fr>
20745
20746 Now that states have a complete set of members, the linked list of
20747 reductions is useless: just fill directly the state's reductions
20748 member.
20749
20750 * src/state.h (struct reductions): Remove member `number' and
20751 `next'.
20752 * src/LR0.c (first_reduction, last_reduction): Remove.
20753 (save_reductions): Don't link the new reductions, store them in
20754 this_state.
20755 * src/lalr.c (set_state_table): No need to attach reductions to
20756 states, it's already done.
20757 * src/output.c (output_actions): No longer free the shifts, then
20758 the reductions, then the states: free all the states and their
20759 members.
20760
0edad749
AD
207612001-12-10 Akim Demaille <akim@epita.fr>
20762
20763 * src/options.c (OPTN, DRTV, BOTH): New.
20764 (option_table): Use them.
20765
0edad749
AD
20766 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
20767 the job of system.h.
20768 * src/options.c: Don't include stdio.h and xalloc.h for the same
20769 reasons.
20770
5449dd0f
AD
207712001-12-10 Akim Demaille <akim@epita.fr>
20772
20773 * src/output.c (output, prepare): Make sure the values of the
20774 muscles `action' and `prologue' are 0-terminated.
20775
a870c567
AD
207762001-12-10 Akim Demaille <akim@epita.fr>
20777
20778 Clean up GCC warnings.
20779
20780 * src/reader.c (copy_action): `buf' is not used.
20781 (parse_skel_decl): Be static.
20782 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
20783 * src/options.h (create_long_option_table): Have a real prototype.
20784 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
20785 (hash_delete_at): Return const void *.
20786 Adjust casts to preserve the const.
20787
80df8768
AD
207882001-12-10 Akim Demaille <akim@epita.fr>
20789
20790 * configure.in: Require 2.52g.
20791 M4 is not needed, but AUTOM4TE is.
20792 * m4/m4.m4: Remove.
20793 * tests/Makefile.am: Adjust.
20794
f693ad14
AD
207952001-12-10 Akim Demaille <akim@epita.fr>
20796
20797 One structure for states is enough, even though theoretically
20798 there are LR(0) states and LALR(1) states.
20799
20800 * src/lalr.h (state_t): Remove.
20801 (state_table): Be state_t **, not state_t *.
20802 * src/state.h (core, CORE_ALLOC): Rename as...
20803 (state_t, STATE_ALLOC): this.
20804 Add the LALR(1) members: shifts, reductions, errs.
20805 * src/LR0.c (state_table): Rename as...
20806 (state_hash): this, to avoid name clashes with the global
20807 `state_table'.
20808 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
20809 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
20810
74ffbcb6
AD
208112001-12-10 Akim Demaille <akim@epita.fr>
20812
20813 Bison dumps core on bash.y.
20814 Reported by Pascal Bart.
20815
20816 * src/warshall.c (bitmatrix_print): New.
20817 (TC): Use it.
ba0fe3c7 20818 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
20819 j must be the outer loop.
20820 * tests/regression.at (Broken Closure): New.
20821
07708e19
AD
208222001-12-05 Akim Demaille <akim@epita.fr>
20823
20824 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
20825 its argument.
ba1ecc07 20826 Reported by Peter Hamorsky.
07708e19 20827
92b16366
AD
208282001-12-05 Akim Demaille <akim@epita.fr>
20829
20830 * src/conflicts.c (err_table): Remove.
20831 (resolve_sr_conflict): Adjust.
20832 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
20833 Rename as...
20834 (state_t.reductions, state_t.shifts): this.
20835
076ab033
AD
208362001-12-05 Akim Demaille <akim@epita.fr>
20837
20838 * src/reduce.c (reduce_grammar_tables): No longer disable the
20839 removal of useless rules via CPP but via `if (0)', so that the
20840 compiler still check the code is valid.
20841 For instance, it should have noticed `rline' no longer exists: use
20842 the `line' member of rule_t.
20843 * src/gram.c (dummy, rline): Remove, unused.
20844
3843c413
AD
208452001-12-05 Akim Demaille <akim@epita.fr>
20846
20847 * src/output.c (pack_vector): Use assert, not berror.
20848 * src/main.c (berror): Remove, unused.
20849
43168960
AD
208502001-12-05 Akim Demaille <akim@epita.fr>
20851
20852 New experimental feature: if --verbose --trace output all the
20853 items of a state, not only its kernel.
20854
20855 * src/print.c (print_core): If `trace_flag', then invoke closure
20856 before outputting the items of the state (print_core is no longer
20857 a correct name them).
20858 (print_results): Invoke new_closure/free_closure if needed.
20859
b2872512
AD
208602001-12-05 Akim Demaille <akim@epita.fr>
20861
20862 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
20863 * src/closure.c, src/closure.h (itemsetsize): Rename as...
20864 (nitemset): for consistency with the rest of the project.
20865
23cbcc6c
AD
208662001-12-05 Akim Demaille <akim@epita.fr>
20867
20868 * src/closure.c (print_closure): Improve.
20869 (closure): Use it for printing input and output.
20870
03ec521c
AD
208712001-12-05 Akim Demaille <akim@epita.fr>
20872
20873 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
20874 indexed by nonterminals.
20875
3a7456dd
AD
208762001-12-05 Akim Demaille <akim@epita.fr>
20877
20878 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
20879 what it was!).
20880 * src/warshall.h: Remove accidental duplication of the content.
20881
1cbcf2e7
AD
208822001-12-05 Akim Demaille <akim@epita.fr>
20883
20884 * src/closure.c (set_fderives): De-obfuscate.
20885
84182270
AD
208862001-12-05 Akim Demaille <akim@epita.fr>
20887
20888 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
20889
3f6f053c
AD
208902001-12-05 Akim Demaille <akim@epita.fr>
20891
20892 * src/closure.c (set_firsts): De-obfuscate.
20893
7a5350ba
AD
208942001-12-05 Akim Demaille <akim@epita.fr>
20895
20896 * src/output.c (action_row): De-obfuscate
20897 using the good o' techniques: arrays not pointers, variable
20898 locality, BITISSET, RESETBIT etc.
20899
d954473d
AD
209002001-12-05 Akim Demaille <akim@epita.fr>
20901
20902 Pessimize the code to simplify it: from now on, all the states
20903 have a valid SHIFTS, which NSHIFTS is possibly 0.
20904
20905 * src/LR0.c (shifts_new): Be global and move to..
20906 * src/state.c, src/state.h: here.
20907 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
20908 * src/print_graph: Adjust.
20909
9839bbe5
AD
209102001-12-05 Akim Demaille <akim@epita.fr>
20911
20912 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
20913 * src/conflicts.c: Use it.
20914 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
20915 incorrectly ``simplified''.
20916
9f136c07
AD
209172001-12-05 Akim Demaille <akim@epita.fr>
20918
20919 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
20920 using the good o' techniques: arrays not pointers, variable
20921 locality, BITISSET, RESETBIT etc.
20922
b608206e
AD
209232001-12-05 Akim Demaille <akim@epita.fr>
20924
20925 * src/state.h (SHIFT_SYMBOL): New.
20926 * src/conflicts.c: Use it to deobfuscate.
20927
52afa962
AD
209282001-12-05 Akim Demaille <akim@epita.fr>
20929
20930 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
20931 (print_reductions): De-obfuscate using the good o' techniques:
20932 arrays not pointers, variable locality, BITISSET.
20933
e74dc321
AD
209342001-12-05 Akim Demaille <akim@epita.fr>
20935
20936 * src/conflicts.c (print_reductions): Arrays, not pointers.
20937 Use BITISSET.
20938
768fca83
AD
209392001-12-05 Akim Demaille <akim@epita.fr>
20940
20941 * src/conflicts.c (print_reductions): Pessimize, but clarify.
20942
a17e599f
AD
209432001-12-05 Akim Demaille <akim@epita.fr>
20944
20945 * src/conflicts.c (print_reductions): Improve variable locality.
20946
a04bc341
AD
209472001-12-05 Akim Demaille <akim@epita.fr>
20948
20949 * src/conflicts.c (print_reductions): Pessimize, but clarify.
20950
c8ea038e
AD
209512001-12-05 Akim Demaille <akim@epita.fr>
20952
20953 * src/conflicts.c (print_reductions): Improve variable locality.
20954
aa2aab3c
AD
209552001-12-05 Akim Demaille <akim@epita.fr>
20956
20957 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
20958 * src/lalr.c: Use them.
20959
b178c8cc
AD
209602001-12-05 Akim Demaille <akim@epita.fr>
20961
20962 * src/LR0.c (augment_automaton): Formatting changes.
20963 Better variable locality.
20964
f67d13aa
AD
209652001-12-05 Akim Demaille <akim@epita.fr>
20966
20967 * src/lalr.c (matrix_print): New.
20968 (transpose): Use it.
20969 Use arrays instead of pointers.
20970
c2713865
AD
209712001-12-05 Akim Demaille <akim@epita.fr>
20972
20973 * src/lalr.c (maxrhs): Move to...
20974 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
20975 * src/lalr.c (build_relations): Adjust.
20976
9887c18a
AD
209772001-12-05 Akim Demaille <akim@epita.fr>
20978
20979 * src/lalr.c (transpose): Free the memory allocated to the
20980 argument, as it is replaced by the results by the unique caller.
20981 (build_relations): Merely invoke transpose: it handles the memory
20982 deallocation.
20983 Improve variable locality.
20984 Avoid variables used as mere abbreviations.
20985 (compute_lookaheads): Use arrays instead of pointers.
20986
4d4f699c
AD
209872001-12-05 Akim Demaille <akim@epita.fr>
20988
20989 * src/lalr.c (initialize_F): Improve variable locality.
20990 Avoid variables used as mere abbreviations.
20991
80a69750
AD
209922001-12-05 Akim Demaille <akim@epita.fr>
20993
20994 * src/derives.c (print_derives): Display the ruleno.
20995 * src/lalr.c (initialize_F, transpose): Better variable locality
20996 to improve readability.
20997 Avoid variables used as mere abbreviations.
20998
fe961097
AD
209992001-12-05 Akim Demaille <akim@epita.fr>
21000
21001 * src/lalr.c (traverse): Use arrays instead of pointers.
21002
e3e4e814
AD
210032001-12-05 Akim Demaille <akim@epita.fr>
21004
21005 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
21006 the handling of squeue.
21007 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21008
630e182b
AD
210092001-12-05 Akim Demaille <akim@epita.fr>
21010
21011 Because useless nonterminals are now kept alive (instead of being
21012 `destroyed'), we now sometimes examine them, and store information
21013 related to them. Hence we need to know their number, and adjust
21014 memory allocations.
21015
21016 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
21017 static.
21018 * src/LR0.c (allocate_itemsets): The memory allocated to
21019 `symbol_count' was used for two different purpose: once to count
21020 the number of occurrences of each symbol, and later reassigned to
21021 `shift_symbol', containing the symbol that can be shifted from a
21022 given state.
21023 Deobfuscate, i.e., allocate, use and free `symbol_count' here
21024 only, and...
21025 (new_itemsets): Allocate `shift_symbol' here.
21026 (allocate_itemsets): symbol_count includes useless nonterminals.
21027 Make room for them.
21028 (free_storage): Use `free', not `XFREE', for pointers that cannot
21029 be null.
21030
81b51460
AD
210312001-12-05 Akim Demaille <akim@epita.fr>
21032
21033 * src/nullable.c (set_nullable): Deobfuscate the handling of
21034 ritem.
21035 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21036
3067fbef
AD
210372001-12-05 Akim Demaille <akim@epita.fr>
21038
21039 * src/gram.c, src/gram.h (ritem_print): New.
21040 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
21041 (This useless function was defined only to work around VMS linkers
21042 that can't handle compilation units with variables only).
21043 * src/reduce.c (dump_grammar): Use it to trace the construction of
21044 ritem.
21045
c2bea5f9
PE
210462001-12-04 Paul Eggert <eggert@twinsun.com>
21047
7d27c823
PE
21048 * src/bison.simple (union yyalloc): Change member names
21049 to be the same as the stack names.
21050 (yyparse): yyptr is now union yyalloc *, not char *.
21051 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
21052 and may generate better code on some machines.
c2bea5f9
PE
21053 (yystpcpy): Use prototype if __STDC__ is defined, not just
21054 if __cplusplus is defined.
35687a9d 21055
2c8a9dfa
AD
210562001-11-30 Akim Demaille <akim@epita.fr>
21057
21058 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
21059 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
21060 Gettext doesn't compile cleanly, and dies with -Werror.
21061 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
21062 Include WARNING_CFLAGS here.
21063 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
21064 before being defined.
21065
f4e421e6
AD
210662001-11-27 Paul Eggert <eggert@twinsun.com>
21067
21068 * lib/quotearg.h (quotearg_n, quotearg_n_style):
21069 First arg is int, not unsigned.
21070 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
21071 (SIZE_MAX, UINT_MAX): New macros.
21072 (quotearg_n_options): Abort if N is negative.
21073 Avoid overflow check on hosts where size_t is 64 bits and int
21074 is 32 bits, as overflow is impossible there.
21075 Fix off-by-one typo that caused unnecessary reallocation.
21076
7093d0f5
AD
210772001-11-29 Paul Eggert <eggert@twinsun.com>
21078
21079 Name space cleanup in generated parser.
21080
21081 * doc/bison.texinfo (Bison Parser): Discuss system headers
21082 and their effect on the user name space.
21083
21084 * src/bison.simple:
21085 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
21086 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
21087 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
21088
21089 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
21090 on user names when possible.
21091
21092 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
21093 Simplify test for whather <alloca.h> exists.
21094
21095 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
21096
21097 (<stdio.h>): Include if YYDEBUG.
21098
21099 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
21100 ! defined (yyoverflow) && ! defined (yymemcpy).
21101
21102 (yymemcpy, yyparse): Rename local variables as needed so that
21103 they all begin with 'yy'.
21104
21105 (yystrlen, yystpcpy): New functions.
21106
21107 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
21108 All uses changed.
21109
21110 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
21111 instead of relying on string.h functions. Use YYSTACK_ALLOC
21112 and YYSTACK_FREE instead of malloc and free.
21113
fd51e5ff
AD
211142001-11-30 Akim Demaille <akim@epita.fr>
21115
21116 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
21117 before their first uses.
21118 (YYBISON, YYPURE): Move to the top of the output.
21119
7d13ff5f
AD
211202001-11-30 Akim Demaille <akim@epita.fr>
21121
21122 * tests/reduce.at (Useless Nonterminals): Fix.
21123
892a3995
AD
211242001-11-30 Akim Demaille <akim@epita.fr>
21125
21126 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
21127 if body instead of `;' to pacify GCC's warnings.
21128
68f1e3ed
AD
211292001-11-30 Akim Demaille <akim@epita.fr>
21130
21131 Instead of mapping the LHS of unused rules to -1, keep the LHS
21132 valid, but flag the rules as invalid.
21133
21134 * src/gram.h (rule_t): `useful' is a new member.
21135 * src/print.c (print_grammar): Adjust.
21136 * src/derives.c (set_derives): Likewise.
21137 * src/reader.c (packgram, reduce_output): Likewise.
21138 * src/reduce.c (reduce_grammar_tables): Likewise.
21139 * tests/reduce.at (Underivable Rules, Useless Rules): New.
21140
d2d1b42b
AD
211412001-11-30 Akim Demaille <akim@epita.fr>
21142
21143 * src/reduce.c (reduce_output): Formatting changes.
21144 * src/print.c (print_results, print_grammar): Likewise.
21145 * tests/regression.at (Rule Line Numbers)
21146 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
21147
760b53a8
AD
211482001-11-30 Akim Demaille <akim@epita.fr>
21149
21150 * src/reduce.c (nonterminals_reduce): Instead of throwing away
21151 useless nonterminals, move them at the end of the symbol arrays.
21152 (reduce_output): Adjust.
21153 * tests/reduce.at (Useless Nonterminals): Adjust.
21154
00238958
AD
211552001-11-30 Akim Demaille <akim@epita.fr>
21156
21157 * src/reduce.c: Various comment/formatting changes.
21158 (nonterminals_reduce): New, extracted from...
21159 (reduce_grammar_tables): here.
21160 (reduce_grammar): Call nonterminals_reduce.
21161
396452de
PE
211622001-11-29 Paul Eggert <eggert@twinsun.com>
21163
21164 * src/bison.simple (YYSTACK_REALLOC): Remove.
21165 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
21166 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
21167 New macros.
21168 (union yyalloc): New type.
21169 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
21170 an arbitrary restriction on hosts where size_t is wider than int.
21171
21172 (yyparse): Don't dump core if alloca or malloc fails; instead, report
21173 a parser stack overflow. Allocate just one block of memory for all
21174 three stacks, instead of allocating three blocks; this typically is
21175 faster and reduces fragmentation.
21176
21177 Do not limit the number of items in the stack to a value that fits
21178 in 'int', as this is an arbitrary limit on hosts with 64-bit
21179 size_t and 32-bit int.
21180
147e184c
MA
211812001-11-29 Marc Autret <autret_m@epita.fr>
21182
21183 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
21184 of defining YYERROR_VERBOSE.
21185 [AT_DATA]: $4 is now out of C declarations in the prologue.
21186
426cf563
MA
211872001-11-28 Marc Autret <autret_m@epita.fr>
21188
21189 * src/reader.c (parse_dquoted_param): New.
21190 (parse_skel_decl): Use it.
21191 * src/lex.h: Add its prototype.
21192 * src/lex.c (literalchar): Become not static.
21193
c7925b99
MA
211942001-11-28 Marc Autret <autret_m@epita.fr>
21195
21196 * src/output.h: And put its extern declaration here.
21197 * src/output.c (error_verbose): Define here.
21198 (prepare): Echo name modification.
21199 * src/getargs.h: Clean its extern declaration.
21200 * src/getargs.c (error_verbose_flag): Remove.
21201 (getargs): Remove case 'e'.
21202 * src/options.c (option_table): 'error-verbose' is now seen as simple
21203 percent option.
21204 Include output.h.
21205
21206 * src/reader.c (read_declarations): Remove case tok_include.
21207 (parse_include_decl): Remove.
21208 * src/lex.h (token_t): Remove tok_include.
21209 * src/options.c (option_table): 'include' is now a simple command line
21210 option.
21211
5b5d1929
MA
212122001-11-28 Marc Autret <autret_m@epita.fr>
21213
21214 * src/bison.simple: Adjust muscle names.
21215 * src/muscle_tab.c (muscle_init): Also rename the muscles.
21216 * src/output.c (prepare): s/_/-/ for the muscles names.
21217 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
21218
8850be4b
MA
212192001-11-28 Marc Autret <autret_m@epita.fr>
21220
21221 * src/bison.simple: Fix debug.
21222 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
21223
4a38e613
AD
212242001-11-28 Akim Demaille <akim@epita.fr>
21225
21226 * src/LR0.c (shifts_new): New.
21227 (save_shifts, insert_start_shift, augment_automaton): Use it.
21228
4b35e1c1
AD
212292001-11-28 Akim Demaille <akim@epita.fr>
21230
21231 * src/closure.c (closure): `b' and `ruleno' denote the same value:
21232 keep ruleno only.
21233
d2b04478
AD
212342001-11-28 Akim Demaille <akim@epita.fr>
21235
21236 * src/closure.c (closure): Instead of looping over word in array
21237 then bits in words, loop over bits in array.
21238
2c4c30aa
AD
212392001-11-28 Akim Demaille <akim@epita.fr>
21240
21241 * src/closure.c (closure): No longer optimize the special case
21242 where all the bits of `ruleset[r]' are set to 0, to make the code
21243 clearer.
21244
576890b7
AD
212452001-11-28 Akim Demaille <akim@epita.fr>
21246
21247 * src/closure.c (closure): `r' and `c' are new variables, used to
21248 de-obfuscate accesses to RULESET and CORE.
21249
cb487d7d
AD
212502001-11-28 Akim Demaille <akim@epita.fr>
21251
21252 * src/reduce.c (reduce_print): Use ngettext.
21253 (dump_grammar): Improve the trace accuracy.
21254
6013d43f
AD
212552001-11-28 Akim Demaille <akim@epita.fr>
21256
21257 * src/reduce.c (dump_grammar): Don't translate trace messages.
21258
cb4956ee
AD
212592001-11-28 Akim Demaille <akim@epita.fr>
21260
21261 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
21262 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
21263 as all tags are free'ed afterwards.
21264 From Enrico Scholz.
21265
648185ab
PE
212662001-11-27 Paul Eggert <eggert@twinsun.com>
21267
21268 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
21269 use alloca when we didn't want to, and vice versa.
21270
68254a03
MA
212712001-11-27 Marc Autret <autret_m@epita.fr>
21272
9113b58f
AD
21273 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
21274 initialization.
68254a03
MA
21275 * src/output.c (prepare): Remove its update.
21276
04d843a2
MA
212772001-11-27 Marc Autret <autret_m@epita.fr>
21278
21279 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
21280 Use %error-verbose.
21281
d2079671 212822001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
21283
21284 * src/bison.simple: Remove YYERROR_VERBOSE using.
21285 Use %%error_verbose.
21286 (yyparse): Likewise.
21287 * src/output.c (prepare): Give its final value.
21288 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
21289 * src/getargs.h: Add its extern declaration.
21290 * src/getargs.c (error_verbose_flag): New int.
21291 (getargs): Update to catch new case.
21292 * src/options.c (option_table): 'error-verbose' is a new option.
21293 (shortopts): Update.
21294
e0327bc8
AD
212952001-11-27 Akim Demaille <akim@epita.fr>
21296
21297 * src/system.h: Use intl/libgettext.h.
21298 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
21299
000f1a3c
AD
213002001-11-27 Akim Demaille <akim@epita.fr>
21301
21302 * tests/torture.at (Exploding the Stack Size with Malloc):
21303 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
21304
26cfe0be
AD
213052001-11-27 Akim Demaille <akim@epita.fr>
21306
21307 * src/files.c: Include error.h.
21308 Reported by Hans Aberg.
21309
f6bd5427
MA
213102001-11-26 Marc Autret <autret_m@epita.fr>
21311
d2079671 21312 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
21313 (read_declarations): Add case tok_include.
21314 * src/getargs.h (include): Add its extern definition.
21315 * src/getargs.c (include): New const char *.
21316 (getargs): Add case '-I'.
21317 * src/options.c (option_table): Add include as command line and
21318 percent option.
21319 * src/lex.h (token_t): Add tok_include.
21320
2ca209c1
AD
213212001-11-26 Akim Demaille <akim@epita.fr>
21322
21323 * src/reader.c (readgram): Make sure rules for mid-rule actions
21324 have a lineno equal to that of their host rule.
21325 Reported by Hans Aberg.
21326 * tests/regression.at (Rule Line Numbers): New.
21327
0e41b407
AD
213282001-11-26 Akim Demaille <akim@epita.fr>
21329
21330 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
21331 size_ts.
21332
213332001-11-26 Akim Demaille <akim@epita.fr>
21334
21335 * src/complain.c, src/complain.h (error): Remove, provided by
21336 lib/error.[ch].
21337
e0c40012
AD
213382001-11-26 Akim Demaille <akim@epita.fr>
21339
21340 * src/reader.c (read_declarations): Don't abort on tok_illegal,
21341 issue an error message.
21342 * tests/regression.at (Invalid %directive): New.
21343 Reported by Hans Aberg.
21344
5e147124
AD
213452001-11-26 Akim Demaille <akim@epita.fr>
21346
21347 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
21348 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
21349
a034c8b8
AD
213502001-11-26 Akim Demaille <akim@epita.fr>
21351
21352 * src/conflicts.c (conflicts_print): Don't complain at all when
21353 there are no reduce/reduce conflicts, and as many shift/reduce
21354 conflicts as expected.
21355 * tests/regression.at (%expect right): Adjust.
21356
c64a20f3
AD
213572001-11-23 Akim Demaille <akim@epita.fr>
21358
21359 * lib/alloca.c: Update, from fileutils.
21360
5b0d29bb
AD
213612001-11-23 Akim Demaille <akim@epita.fr>
21362
21363 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
21364
722c4bfe
AD
213652001-11-23 Akim Demaille <akim@epita.fr>
21366
21367 * src/system.h: Include alloca.h.
21368 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
21369
6255b435
AD
213702001-11-23 Akim Demaille <akim@epita.fr>
21371
21372 * src/print_graph.c (print_actions): Remove `rule', unused.
21373 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
21374 pacify GCC's signed < unsigned warnings.
21375 * src/closure.c (itemsetsize): Likewise.
21376 * src/reader.c (symbol_list_new): Static.
21377
b29b2ed5
AD
213782001-11-23 Akim Demaille <akim@epita.fr>
21379
21380 Attaching lineno to buckets is stupid, since only one copy of each
21381 symbol is kept, only the line of the first occurrence is kept too.
21382
21383 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
21384 * src/reader.c (rline_allocated): Remove, unused.
21385 (symbol_list): Have a `line' member.
21386 (symbol_list_new): New.
21387 (readgram): Use it.
21388 * src/print.c (print_grammar): Output the rule line numbers.
21389 * tests/regression.at (Solved SR Conflicts)
21390 (Unresolved SR Conflicts): Adjust.
21391 Reported by Hans Aberg.
21392
a81b1d4a
MA
213932001-11-22 Marc Autret <autret_m@epita.fr>
21394
21395 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
21396
c1ecb3c1
MA
213972001-11-22 Marc Autret <autret_m@epita.fr>
21398
21399 * src/muscle_tab.c (muscle_init): Remove initialization of
21400 skeleton muscle.
21401 * src/output.c (output_master_parser): Do it here.
21402
fbe01355
AD
214032001-11-20 Akim Demaille <akim@epita.fr>
21404
21405 * po/sv.po: New.
21406 * configure.in (ALL_LINGUAS): Adjust.
21407 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
21408 longer contains strings to translate.
21409
81e895c0
AD
214102001-11-19 Akim Demaille <akim@epita.fr>
21411
21412 * src/conflicts.c (conflicts_print): Add a missing \n.
21413
6bb1878b
AD
214142001-11-19 Akim Demaille <akim@epita.fr>
21415
21416 * src/nullable.c (nullable_print): New.
21417 (set_nullable): Call it when tracing.
21418 Better locality of variables.
21419
d9ec2d07
AD
214202001-11-19 Akim Demaille <akim@epita.fr>
21421
21422 * src/print.c (print_actions): Better locality of variables.
21423
720e5c1b
AD
214242001-11-19 Akim Demaille <akim@epita.fr>
21425
21426 * src/derives.c (print_derives): Fix and enrich.
21427 * src/closure.c (print_fderives): Likewise.
21428
fb908786
AD
214292001-11-19 Akim Demaille <akim@epita.fr>
21430
21431 * src/closure.c (itemsetend): Remove, replaced with...
21432 (itemsetsize): new.
21433
125ecb56
AD
214342001-11-19 Akim Demaille <akim@epita.fr>
21435
21436 * src/LR0.c (kernel_end): Remove, replaced with...
21437 (kernel_size): new.
21438
d8cf039f
AD
214392001-11-19 Akim Demaille <akim@epita.fr>
21440
21441 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
21442 to clarify.
21443
7bec0760
AD
214442001-11-19 Akim Demaille <akim@epita.fr>
21445
21446 * src/closure.c (closure): Use arrays instead of pointers to clarify.
21447
c87d4863
AD
214482001-11-19 Akim Demaille <akim@epita.fr>
21449
21450 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
21451 trace messages.
21452 * src/LR0.c: Likewise.
21453 (allocate_itemsets): Use arrays instead of pointers to clarify.
21454
9bfe901c
AD
214552001-11-19 Akim Demaille <akim@epita.fr>
21456
21457 * src/getargs.c (statistics_flag): Replace with...
21458 (trace_flag): New.
21459 (longopts): Accept --trace instead of --statistics.
21460 * src/getargs.h, src/options.c: Adjust.
21461 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
21462 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
21463
97db7bd4
AD
214642001-11-19 Akim Demaille <akim@epita.fr>
21465
cc72668c 21466 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
21467 pointers to clarify the code.
21468 (save_reductions, save_shifts): Factor common parts of alternatives.
21469
2c5f66ed
AD
214702001-11-19 Akim Demaille <akim@epita.fr>
21471
21472 * src/LR0.c (new_state, get_state): Complete TRACE code.
21473 * src/closure.c: Include `reader.h' to get `tags', needed by the
21474 trace code.
21475 Rename the conditional DEBUG as TRACE.
21476 Output consistently TRACEs to stderr, not stdout.
21477 * src/derives.c: Likewise.
21478 * src/reduce.c: (inaccessable_symbols): Using if is better style
21479 than goto.
21480 Use `#if TRACE' instead of `#if 0' for tracing code.
21481
300f275f
AD
214822001-11-19 Akim Demaille <akim@epita.fr>
21483
21484 * src/system.h (LIST_FREE, shortcpy): New.
21485 * src/LR0.c: Use them.
21486 * src/output.c (free_itemsets, free_reductions, free_shifts):
21487 Remove, replaced by LIST_FREE.
21488
f59c437a
AD
214892001-11-19 Akim Demaille <akim@epita.fr>
21490
21491 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
21492 (REDUCTIONS_ALLOC): New.
21493 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
21494 allocation.
21495
6986fd9e
AD
214962001-11-19 Akim Demaille <akim@epita.fr>
21497
21498 * src/LR0.c (new_state): Complete trace code.
21499 * src/nullable.c (set_nullable): Don't translate traces.
21500
4bc30f78
AD
215012001-11-19 Akim Demaille <akim@epita.fr>
21502
21503 * src/print_graph.c (print_core): Better locality of variables.
21504 * src/print.c (print_core): Likewise.
21505
08a946e0
AD
215062001-11-19 Akim Demaille <akim@epita.fr>
21507
21508 * src/vcg.c: You do the output, so you are responsible of the
21509 handling of VCG syntax, in particular: use quotearg.
21510 * src/print_graph.c: Don't.
21511 (print_actions): Don't output the actions as part of the nodes,
21512 since that's the job of the edges.
21513 (print_state): Don't output by hand: fill the node description,
9bfe901c 21514 and ask for its output.
08a946e0 21515
f0473484
AD
215162001-11-19 Akim Demaille <akim@epita.fr>
21517
cc72668c
AD
21518 * src/bison.simple (yyparse): When verbosely reporting an error,
21519 no longer put additional quotes around token names.
f0473484
AD
21520 * tests/calc.at: Adjust.
21521
e41dc700
AD
215222001-11-19 Akim Demaille <akim@epita.fr>
21523
21524 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
21525 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
21526 * src/output.c: Adjust.
21527
652a871c
AD
215282001-11-19 Akim Demaille <akim@epita.fr>
21529
21530 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
21531 (rule_t): this.
21532 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
21533
b2ed6e58
AD
215342001-11-19 Akim Demaille <akim@epita.fr>
21535
21536 * src/gram.h (rule_t): New.
21537 (rule_table): New.
21538 (rrhs, rlhs): Remove, part of state_t.
21539 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
21540 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
21541 * src/reader.c, src/reduce.c: Adjust.
21542
edad7067
AD
215432001-11-19 Akim Demaille <akim@epita.fr>
21544
21545 * src/reader.c (symbols_output): New, extracted from...
21546 (packsymbols): Here.
21547 (reader): Call it.
21548
3feec034
AD
215492001-11-19 Akim Demaille <akim@epita.fr>
21550
21551 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
21552 (maxrhs): this new function.
21553
ddcd5fdf
AD
215542001-11-19 Akim Demaille <akim@epita.fr>
21555
cc72668c 21556 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
21557 Adjust.
21558
bb527fc2
AD
215592001-11-19 Akim Demaille <akim@epita.fr>
21560
cc72668c 21561 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
21562 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21563 * src/lalr.c: Adjust.
21564
a845a697
AD
215652001-11-19 Akim Demaille <akim@epita.fr>
21566
21567 * src/lalr.c (initialize_LA): Only initialize LA. Let...
21568 (set_state_table): handle the `lookaheads' members.
21569
f004bf6a
AD
215702001-11-19 Akim Demaille <akim@epita.fr>
21571
cc72668c
AD
21572 * src/lalr.h (lookaheads): Removed array, whose contents is now
21573 a member of...
f004bf6a
AD
21574 (state_t): this structure.
21575 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21576 Adjust.
21577
de326cc0
AD
215782001-11-19 Akim Demaille <akim@epita.fr>
21579
cc72668c
AD
21580 * src/lalr.h (consistent): Removed array, whose contents is now
21581 a member of...
de326cc0
AD
21582 (state_t): this structure.
21583 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21584 Adjust.
21585
90b4416b
AD
215862001-11-19 Akim Demaille <akim@epita.fr>
21587
cc72668c
AD
21588 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
21589 contents are now members of...
90b4416b
AD
21590 (state_t): this structure.
21591 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21592 Adjust.
21593
9703cc49
AD
215942001-11-19 Akim Demaille <akim@epita.fr>
21595
21596 * src/lalr.h (state_t): New.
21597 (state_table): Be a state_t * instead of a core **.
21598 (accessing_symbol): Remove, part of state_t.
21599 * src/lalr.c: Adjust.
21600 (set_accessing_symbol): Merge into...
21601 (set_state_table): this.
21602 * src/print_graph.c, src/conflicts.c: Adjust.
21603
d803322e
AD
216042001-11-14 Akim Demaille <akim@epita.fr>
21605
21606 * tests/calc.at, tests/output.at, tests/regression.at,
21607 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
21608 now the tests are run in private dirs, therefore AC_CLEANUP and
21609 family can be simplified to 0-ary.
21610 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
21611 use abs. path to find config.h.
21612 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
21613 stderr, there can be way too much random noise.
21614 Instead pass -Werror to GCC and rely on the exit status.
21615 Reported by Wolfram Wagner.
21616
3d76b07d
AD
216172001-11-14 Akim Demaille <akim@epita.fr>
21618
21619 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
21620 defined only if yyoverflow is defined, to avoid `warning: unused
21621 variable `yyvs1''.
21622 Reported by The Test Suite.
21623
09b503c8
AD
216242001-11-14 Akim Demaille <akim@epita.fr>
21625
21626 * src/print.c: Include reduce.h.
21627 Reported by Hans Aberg.
21628
216292001-11-14 Akim Demaille <akim@epita.fr>
21630
21631 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
21632 Revert a previous patch: these are really const.
21633 * src/conflicts.c (conflict_report): Additional useless pair of
21634 braces to pacify GCC's warnings for `if () if () {} else {}'.
21635 * src/lex.c (parse_percent_token): Replace equal_offset with
21636 arg_offset.
21637 arg is const.
21638 Be sure to strdup `arg' when used, since there is no reason for
21639 token_buffer not to change.
21640
0f37a994
AD
216412001-11-14 Akim Demaille <akim@epita.fr>
21642
21643 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
21644 definition.
21645 * src/main.c (main): Use them.
21646 Suggested by Hans Aberg.
21647
d39d93b8
AD
216482001-11-12 Akim Demaille <akim@epita.fr>
21649
21650 * src/system.h (ngettext): Now that we use ngettext, be sure to
21651 provide a default definition when NLS are not used.
21652
9edcd895
AD
216532001-11-12 Akim Demaille <akim@epita.fr>
21654
21655 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
21656 Use @kbd to denote user input.
21657 (Language and Grammar): ANSIfy the example.
21658 Adjust its layout for info/notinfo.
21659 (Location Tracking Calc): Output error messages to stderr.
21660 Output locations in a more GNUtically correct way.
21661 Fix a couple of Englishos.
21662 Adjust @group/@end group pairs.
21663
7da99ede
AD
216642001-11-12 Akim Demaille <akim@epita.fr>
21665
e3aa65c5 21666 %expect was not functioning at all.
7da99ede
AD
21667
21668 * src/conflicts.c (expected_conflicts): Set to -1.
21669 (conflict_report): Use ngettext.
21670 (conflicts_print): Check %expect and make its violation an error.
21671 * doc/bison.texinfo (Expect Decl): Adjust.
21672 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
21673 * tests/regression.at (%expect not enough, %expect right)
21674 (%expect too much): New.
21675
ba9dda1a
AD
216762001-11-12 Akim Demaille <akim@epita.fr>
21677
21678 * tests/regression.at (Conflicts): Rename as...
21679 (Unresolved SR Conflicts): this.
21680 (Solved SR Conflicts): New.
21681
337c5bd1
AD
216822001-11-12 Akim Demaille <akim@epita.fr>
21683
21684 * src/reduce.c (print_results): Rename as...
21685 (reduce_output): This.
21686 Output to OUT, passed as argument, instead of output_obstack.
21687 (dump_grammar): Likewise.
21688 (reduce_free): New.
21689 Also free V1.
21690 (reduce_grammar): No longer call reduce_output, since...
21691 * src/print.c (print_results): do it.
21692 * src/main.c (main): Call reduce_free;
21693
c73a41af
AD
216942001-11-12 Akim Demaille <akim@epita.fr>
21695
21696 * src/conflicts.c (print_reductions): Accept OUT as argument.
21697 Output to it, not to output_obstack.
21698 * src/print.c (print_actions): Adjust.
21699
0df87bb6
AD
217002001-11-12 Akim Demaille <akim@epita.fr>
21701
21702 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
21703 the result instead of using...
21704 (src_total, rrc_total, src_count, rrc_count): Remove.
21705 (any_conflicts): Remove.
21706 (print_conflicts): Split into...
21707 (conflicts_print, conflicts_output): New.
21708 * src/conflicts.h: Adjust.
21709 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 21710 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
21711 * tests/regression.at (Conflicts): New.
21712 Reported by Tom Lane.
21713
e4d3d4de
AD
217142001-11-12 Akim Demaille <akim@epita.fr>
21715
21716 * tests/regression.at (Invalid input): Remove, duplicate with
21717 ``Invalid input: 1''.
21718
6d7d248e
AD
217192001-11-12 Akim Demaille <akim@epita.fr>
21720
21721 * tests/torture.at (AT_DATA_STACK_TORTURE)
21722 (Exploding the Stack Size with Alloca)
21723 (Exploding the Stack Size with Malloc): New.
21724
e9e4c321
AD
217252001-11-12 Akim Demaille <akim@epita.fr>
21726
21727 * src/bison.simple (YYSTACK_REALLOC): New.
21728 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 21729 Reported by Per Allansson.
e9e4c321 21730
5f7e0832
AD
217312001-11-12 Pascal Bart <pascal.bart@epita.fr>
21732
21733 * src/bison.simple: Define type yystype instead of YYSTYPE, and
21734 define CPP macro, which substitute YYSTYPE by yystype.
21735 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
21736 with yyltype/YYLTYPE. This allows inclusion of the generated
21737 header within the parser if the compiler, such as GGC, accepts
21738 multiple equivalent #defines.
21739 From Akim.
21740
e3f1699f
AD
217412001-11-05 Akim Demaille <akim@epita.fr>
21742
21743 * src/reader.c (symbols_output): New, extracted from...
21744 (packsymbols): here.
21745 (reader): Adjust.
21746
65be0866
AD
217472001-11-05 Akim Demaille <akim@epita.fr>
21748
21749 * src/lex.c (parse_percent_token): s/quotearg/quote/.
21750
e4d910bf
AD
217512001-11-05 Akim Demaille <akim@epita.fr>
21752
21753 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
21754 pattern.
21755
951366c1
AD
217562001-11-05 Akim Demaille <akim@epita.fr>
21757
21758 * src/options.h (struct option_table_struct): set_flags is void*.
21759 * src/options.c (longopts): Support `--output' and `%output'.
21760 (usage): Adjust.
21761 * src/lex.h (tok_setopt): Remove, replaced with...
21762 (tok_intopt, tok_stropt): these new guys.
21763 * src/lex.c (getopt.h): Not needed.
21764 (token_buffer, unlexed_token_buffer): Not const.
21765 (percent_table): Promote `-' over `_' in directive names.
21766 Active `%name-prefix', `file-prefix', and `output'.
21767 (parse_percent_token): Accept possible arguments to directives.
21768 Promote `-' over `_' in directive names.
21769
d8988b2f
AD
217702001-11-04 Akim Demaille <akim@epita.fr>
21771
21772 * doc/bison.texinfo (Decl Summary): Split the list into
21773 `directives for grammars' and `directives for bison'.
21774 Sort'em.
21775 Add description of `%name-prefix', `file-prefix', and `output'.
21776 Promote `-' over `_' in directive names.
21777 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
21778 Simplify the description of `--name-prefix'.
21779 Promote `-' over `_' in directive names.
21780 Promote `--output' over `--output-file'.
21781 Fix the description of `--defines'.
21782 * tests/output.at: Exercise %file-prefix and %output.
21783
6468d18e
AD
217842001-11-02 Akim Demaille <akim@epita.fr>
21785
21786 * doc/refcard.tex: Update.
21787
6b7e85b9
AD
217882001-11-02 Akim Demaille <akim@epita.fr>
21789
21790 * src/symtab.h (SUNDEF): New.
21791 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
21792 stand for `uninitialized', instead of 0.
21793 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
21794 * src/lex.c (lex): Adjust.
21795
21796 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
21797 Number it 0.
21798 Let yylex return it instead of a plain 0.
21799 Reported by Dick Streefland.
21800
cd5aafcf
AD
218012001-11-02 Akim Demaille <akim@epita.fr>
21802
21803 * tests/regression.at (Mixing %token styles): New test.
21804
037ca2f1
AD
218052001-11-02 Akim Demaille <akim@epita.fr>
21806
21807 * src/reader.c (parse_thong_decl): Formatting changes.
21808 (token_translations_init): New, extracted from...
21809 (packsymbols): Here.
21810 Adjust.
21811
270a173c
AD
218122001-11-01 Akim Demaille <akim@epita.fr>
21813
21814 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
21815 Check that `9foo.y' produces correct cpp guards.
21816 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
21817 guards.
21818 Reported by Wwp.
21819
561f9a30
AD
218202001-11-01 Akim Demaille <akim@epita.fr>
21821
21822 * tests/regression.at (Invalid input: 2): New.
21823 * src/lex.c (unlexed_token_buffer): New.
21824 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
21825 too.
21826 Reported by Wwp.
21827
f987e9d2
AD
218282001-11-01 Akim Demaille <akim@epita.fr>
21829
21830 * tests/calc.at: Catch up with 1.30.
21831 * configure.in: Bump to 1.49a.
21832 Adjust to newer Autotest.
21833
0846f581
PB
218342001-10-19 Pascal Bart <pascal.bart@epita.fr>
21835
21836 * src/conflicts.c: Move global variables rrc_total and src_total ...
21837 (print_conflicts): here.
21838 * src/output.c (output): Free global variable user_toknums.
21839 * src/lex.c (token_obstack): Become static.
21840
3c1a79b3
AD
218412001-10-18 Akim Demaille <akim@epita.fr>
21842
21843 * tests/atlocal.in (GCC): Add.
21844 * tests/calc.at: s/m4_match/m4_bmatch/.
21845 s/m4_patsubst/m4_bpatsubst/.
21846 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
21847 * configure.in: AC_SUBST(GCC).
21848
5d52e7d0
MA
218492001-10-14 Marc Autret <autret_m@epita.fr>
21850
21851 * src/options.c (create_long_option_table): Fix.
21852
631aa1d3
AD
218532001-10-10 Akim Demaille <akim@epita.fr>
21854
21855 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
21856
f6ec6d13
AD
218572001-10-04 Akim Demaille <akim@epita.fr>
21858
21859 * src/reader.c (parse_union_decl): Push the caracters in
21860 union_obstack, not attrs_obstack.
21861
342b8b6e
AD
218622001-10-04 Akim Demaille <akim@epita.fr>
21863
21864 Merge in the branch 1.29.
21865
21866 * src/reader.c (packsymbols): Use a temporary obstack for
21867 `%%tokendef', since output_stack is already used elsewhere.
21868
21869 2001-10-02 Akim Demaille <akim@epita.fr>
21870
21871 Bump 1.29d.
21872
21873 2001-10-02 Akim Demaille <akim@epita.fr>
21874
21875 Version 1.29c.
21876
21877 2001-10-02 Akim Demaille <akim@epita.fr>
21878
21879 * tests/regression.at (Invalid CPP headers): New.
21880 From Alexander Belopolsky.
21881 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
21882
21883 2001-10-02 Akim Demaille <akim@epita.fr>
21884
21885 * tests/regression.at (Invalid input): New.
21886 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
21887 Reported by Shura.
21888
21889 2001-10-02 Akim Demaille <akim@epita.fr>
21890
21891 * tests/calc.at: Now that --debug works, the tests must be adjusted.
21892
21893 2001-10-02 Akim Demaille <akim@epita.fr>
21894
21895 * src/output.c (output_parser): Assert `skeleton'.
21896 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
21897 systems.
21898 From Shura.
21899
21900 2001-10-01 Marc Autret <autret_m@epita.fr>
21901
21902 * src/lex.h: Echo modifications.
21903 * src/lex.c (unlex): Parameter is now token_t.
21904 From Hans Aberg.
21905
21906 2001-10-01 Marc Autret <autret_m@epita.fr>
21907
21908 * src/main.c: Include lex.h.
21909 From Hans Aberg.
21910
21911 2001-09-29 Akim Demaille <akim@epita.fr>
21912
21913 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
21914
21915 2001-09-28 Akim Demaille <akim@epita.fr>
21916
21917 * tests/testsuite.at: Update to newer Autotest.
21918 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
21919
21920 2001-09-27 Akim Demaille <akim@epita.fr>
21921
21922 Position independent wrapper.
21923
21924 * tests/bison: Remove.
21925 * tests/bison.in: New.
21926 * configure.in: Adjust.
21927
21928 2001-09-27 Paul Eggert <eggert@twinsun.com>
21929
21930 Port quotearg fixes from tar 1.13.24.
21931
21932 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
21933 tm to be declared.
21934 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
21935 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
21936
21937 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
21938 * m4/mbrtowc.m4: New file.
21939 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
21940 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
21941
21942 2001-09-27 Akim Demaille <akim@epita.fr>
21943
21944 Bump to 1.29c.
21945
21946 2001-09-27 Akim Demaille <akim@epita.fr>
21947
21948 Version 1.29b.
21949
21950 2001-09-25 Akim Demaille <akim@epita.fr>
21951
21952 * src/system.h: Include `xalloc.h'.
21953 Remove it from the C files.
21954 * src/files.c (output_files): Free the obstacks.
21955 * src/lex.c (init_lex): Rename as...
21956 (lex_init): this.
21957 (lex_free): New.
21958 * src/main.c (main): Use it.
21959
21960 2001-09-24 Marc Autret <autret_m@epita.fr>
21961
21962 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
21963 to output informations in fout (FILE*).
21964 (open_graph, close_graph): Likewise.
21965 (output_graph, output_edge, output_node): Likewise.
21966 * src/vcg.h: Update function prototypes.
21967 * src/print_graph.c (print_graph): Open output graph file.
21968 (print_actions): Adjust.
21969 * src/files.h: Remove extern declaration.
21970 * src/files.c: Remove graph_obstack declaration.
21971 (open_files): Remove graph_obstack initialization.
21972 (output_files): Remove graph_obstack saving.
21973
21974 2001-09-24 Marc Autret <autret_m@epita.fr>
21975
21976 * src/files.c (compute_output_file_names): Fix.
21977
21978 2001-09-24 Marc Autret <autret_m@epita.fr>,
21979 Akim Demaille <akim@epita.fr>
21980
21981 * src/reader.c (reader): Remove call to free_symtab ().
21982 * src/main.c (main): Call it here.
21983 Include symtab.h.
21984 * src/conflicts.c (initialize_conflicts): Rename as...
21985 (solve_conflicts): this.
21986 * src/print.c (print_core, print_actions, print_state)
21987 (print_grammar): Dump to a file instead a `output_obstack'.
21988 (print_results): Dump `output_obstack', and then proceed with the
21989 FILE *.
21990 * src/files.c (compute_output_file_names, close_files): New.
21991 (output_files): Adjust.
21992 * src/main.c (main): Adjust.
21993
21994 2001-09-23 Marc Autret <autret_m@epita.fr>
21995
21996 * src/files.c (compute_header_macro): Computes header macro name
21997 from spec_defines_file when given.
21998
21999 2001-09-23 Marc Autret <autret_m@epita.fr>
22000
22001 * src/files.c (output_files): Add default extensions.
22002
22003 2001-09-22 Akim Demaille <akim@epita.fr>
22004
22005 * src/conflicts.c (finalize_conflicts): Rename as...
22006 (free_conflicts): this.
22007
22008 2001-09-22 Akim Demaille <akim@epita.fr>
22009
22010 * src/gram.c (gram_free): Rename back as...
22011 (dummy): this.
22012 (output_token_translations): Free `token_translations'.
22013 * src/symtab.c (free_symtab): Free the tag field.
22014
22015 2001-09-22 Akim Demaille <akim@epita.fr>
22016
22017 Remove `translations' as it is always set to true.
22018
22019 * src/gram.h: Adjust.
22020 * src/reader.c (packsymbols, parse_token_decl): Adjust
22021 * src/print.c (print_grammar): Adjust.
22022 * src/output.c (output_token_translations): Adjust.
22023 * src/lex.c (lex): Adjust.
22024 * src/gram.c: Be sure the set pointers to NULL.
22025 (dummy): Rename as...
22026 (gram_free): this.
22027
22028 2001-09-22 Akim Demaille <akim@epita.fr>
22029
22030 * configure.in: Invoke AM_LIB_DMALLOC.
22031 * src/system.h: Use dmalloc.
22032 * src/LR0.c: Be sure to have pointers initialized to NULL.
22033 (allocate_itemsets): Allocate kernel_items only if needed.
22034
22035 2001-09-22 Akim Demaille <akim@epita.fr>
22036
22037 * configure.in: Bump to 1.29b.
22038 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
22039 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
22040 need xmalloc.c in calc.y.
22041 From Pascal Bart.
22042
22043 2001-09-21 Akim Demaille <akim@epita.fr>
22044
22045 Version 1.29a.
22046 * Makefile.maint, config/config.guess, config/config.sub,
22047 * config/missing: Update from masters.
22048 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
22049 upon package.m4.
22050 * configure.in (ALL_LINGUAS): Add `tr'.
22051
22052 2001-09-21 Akim Demaille <akim@epita.fr>
22053
22054 * tests/Makefile.am (package.m4): Move to...
22055 ($(srcdir)/$(TESTSUITE)): here.
22056
22057 2001-09-20 Akim Demaille <akim@epita.fr>
22058
22059 * src/complain.c: No longer try to be standalone: use system.h.
22060 Don't assume __STDC__ is defined to 1. Just test if it is defined.
22061 * src/complain.h: Likewise.
22062 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
22063 Remove the unused variable `n'.
22064 From Albert Chin-A-Young.
22065
22066 2001-09-18 Marc Autret <autret_m@epita.fr>
22067
22068 * doc/bison.1: Update.
22069 * doc/bison.texinfo (Bison Options): Update --defines and --graph
22070 descriptions.
22071 (Option Cross Key): Update.
22072 Add --graph.
22073
22074 2001-09-18 Marc Autret <autret_m@epita.fr>
22075
22076 * tests/regression.at: New test (comment in %union).
22077
22078 2001-09-18 Marc Autret <autret_m@epita.fr>
22079
22080 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
22081 do that.
22082 Reported by Keith Browne.
22083
22084 2001-09-18 Marc Autret <autret_m@epita.fr>
22085
22086 * tests/output.at: Add tests for --defines and --graph.
22087
22088 2001-09-18 Marc Autret <autret_m@epita.fr>
22089
22090 * tests/output.at: Removes tests of %{header,src}_extension features.
22091
22092 2001-09-18 Akim Demaille <akim@epita.fr>
22093
22094 * tests/Makefile.am (package.m4): New.
22095 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
22096 (_AT_CHECK_CALC_ERROR): Likewise.
22097 Factor the `, ' part of verbose error messages.
22098
22099 2001-09-18 Marc Autret <autret_m@epita.fr>
22100
22101 * src/getargs.c (longopts): Declare --defines and --graph as options
22102 with optional arguments.
22103 * src/files.h: Add extern declarations.
22104 * src/files.c (spec_graph_file, spec_defines_file): New.
22105 (output_files): Update.
22106 Remove CPP-outed code.
22107
22108 2001-09-18 Marc Autret <autret_m@epita.fr>
22109
22110 Turn off %{source,header}_extension feature.
22111
22112 * src/files.c (compute_exts_from_gf): Update.
22113 (compute_exts_from_src): Update.
22114 (output_files): CPP-out useless code.
22115 * src/files.h: Remove {header,source}_extension extern declarations.
22116 * src/reader.c (parse_dquoted_param): CPP-out.
22117 (parse_header_extension_decl): Remove.
22118 (parse_source_extension_decl): Remove.
22119 (read_declarations): Remove cases tok_{hdrext,srcext}.
22120 * src/lex.c (percent_table): Remove {header,source}_extension entries.
22121 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
22122
22123 2001-09-10 Akim Demaille <akim@epita.fr>
22124
22125 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
22126 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
22127 (AT_CHECK_OUTPUT): this.
22128 Merely check ls' exit status, its output is useless.
22129
22130 2001-09-10 Akim Demaille <akim@epita.fr>
22131
22132 * tests/calc.at: Use m4_match.
22133 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
22134
22135 2001-09-10 Marc Autret <autret_m@epita.fr>,
22136 Akim Demaille <akim@epita.fr>
22137
22138 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
22139 enum color_e.
22140 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
22141 to `normal'.
22142 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
22143 * src/lex.h: Adjust prototype.
22144 (token_t): Add `tok_undef'.
22145 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
22146 (parse_percent_token): Now returns token_t.
22147 Add default statement in switch.
22148 (lex): Separate `c' as an input variable, from the token_t result
22149 part.
22150 (unlexed): Is a token_t.
22151
22152 2001-09-10 Akim Demaille <akim@epita.fr>
22153
22154 * configure.in: Bump to 1.29a.
22155
22156 2001-09-07 Akim Demaille <akim@epita.fr>
22157
22158 Version 1.29.
22159
22160 2001-08-30 Akim Demaille <akim@epita.fr>
22161
22162 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
22163 * m4/atconfig.m4: Remove.
22164 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
22165 * tests/bison: New.
22166 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
22167 m4_if, m4_patsubst, and m4_regexp.
22168 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
22169 `input' file instead of echo.
22170
22171 2001-08-29 Akim Demaille <akim@epita.fr>
22172
22173 Bump to 1.28e.
22174
22175 2001-08-29 Akim Demaille <akim@epita.fr>
22176
22177 Version 1.28d.
22178
22179 2001-08-29 Paul Eggert <eggert@twinsun.com>
22180
22181 * src/bison.simple (yyparse): Don't take the address of an
22182 item before the start of an array, as that doesn't conform to
22183 the C Standard.
22184
22185 2001-08-29 Robert Anisko <anisko_r@epita.fr>
22186
22187 * doc/bison.texinfo (Location Tracking Calc): New node.
22188
22189 2001-08-29 Paul Eggert <eggert@twinsun.com>
22190
22191 * src/output.c (output): Do not define const, as this now
22192 causes more problems than it cures.
22193
22194 2001-08-29 Akim Demaille <akim@epita.fr>
22195
22196 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
22197 the nodes.
22198 Be sure to tag the `detailmenu'.
22199
22200 2001-08-29 Akim Demaille <akim@epita.fr>
22201
22202 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
22203 download in a tmp dir.
22204
22205 2001-08-28 Marc Autret <autret_m@epita.fr>
22206
22207 * config/depcomp: New file.
22208
22209 2001-08-28 Marc Autret <autret_m@epita.fr>
22210
22211 * doc/bison.1 (mandoc): Adjust.
22212 From Juan Manuel Guerrero.
22213
22214 2001-08-28 Marc Autret <autret_m@epita.fr>
22215
22216 * src/print_graph.c (print_state): Fix.
22217
22218 2001-08-27 Marc Autret <autret_m@epita.fr>
22219
22220 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
22221 char * members.
22222 Echo modifications to the functions prototypes.
22223 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
22224
22225 2001-08-27 Marc Autret <autret_m@epita.fr>
22226
22227 * src/vcg.c: Include `xalloc.h'.
22228 (add_colorentry): New.
22229 (add_classname): New.
22230 (add_infoname): New.
22231 * src/vcg.h: Add new prototypes.
22232
22233 2001-08-27 Akim Demaille <akim@epita.fr>
22234
22235 * Makefile.maint: Sync. again with CVS Autoconf.
22236
22237 2001-08-27 Akim Demaille <akim@epita.fr>
22238
22239 * Makefile.maint: Formatting changes.
22240 (po-update, cvs-update, update): New targets.
22241 (AMTAR): Remove.
22242
22243 2001-08-27 Akim Demaille <akim@epita.fr>
22244
22245 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
22246 * Makefile.maint: Sync. with CVS Autoconf.
22247
22248 2001-08-27 Marc Autret <autret_m@epita.fr>
22249
22250 * src/vcg.h (struct infoname_s): New.
22251 (struct colorentry_s): New.
22252 (graph_s): New fields {vertical,horizontal}_order in structure.
22253 Add `infoname' field.
22254 Add `colorentry' field;
22255 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
22256 (G_HORIZONTAL_ORDER): New.
22257 (G_INFONAME): New.
22258 (G_COLORENTRY): New.
22259 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
22260 Add output of `infoname'.
22261 Add output of `colorentry'.
22262
22263 2001-08-27 Marc Autret <autret_m@epita.fr>
22264
22265 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
22266 This one shadowed a global parameter.
22267
22268 2001-08-24 Marc Autret <autret_m@epita.fr>
22269
22270 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
22271 instead of `unsigned'.
22272 (print_state): Do not call obstack_object_size () in obstack_grow ()
22273 to avoid macro variables shadowing.
22274
22275 2001-08-23 Marc Autret <autret_m@epita.fr>
22276
22277 * src/lex.c (percent_table): Typo: s/naem/name/.
22278 Add graph option.
22279 Normalize new options declarations.
22280
22281 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
22282
22283 * tests/suite.at: Exercise %header_extension and %source_extension.
22284
22285 2001-08-16 Marc Autret <autret_m@epita.fr>
22286
22287 * src/reader.c (parse_dquoted_param): New.
22288 (parse_header_extension_decl): Use it.
22289 (parse_source_extension_decl): Likewise.
22290
22291 2001-08-16 Marc Autret <autret_m@epita.fr>
22292
22293 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
22294 (get_xxxx_str): Use assert () instead of complain ().
22295 Remove return invokations in default cases.
22296 (get_decision_str): Modify default behaviour. Remove second argument.
22297 Echo modifications on calls.
22298 (output_graph): Fix.
22299
22300 2001-08-16 Marc Autret <autret_m@epita.fr>
22301
22302 * src/getargs.c (usage): Update with ``-g, --graph''.
22303
22304 2001-08-16 Marc Autret <autret_m@epita.fr>
22305
22306 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
22307 (Option Cross Key): Likewise.
22308 * doc/bison.1: Update.
22309
1c8c2190
PB
223102001-09-25 Pascal Bart <pascal.bart@epita.fr>
22311
22312 * src/output.c (output_master_parser): Don't finish action_obstack.
22313 (output_parser): Don't care about the muscle action, here.
22314 (prepare): Copy the action_obstack in the action muscle.
22315 (output): Free action_obstack.
22316
180d45ba
PB
223172001-09-23 Pascal Bart <pascal.bart@epita.fr>
22318
22319 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
22320 will contain `%union' declaration.
22321 (parse_union_decl): Delete #line directive output.
22322 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
22323 informations about %union.
22324 (parse_union_decl): Copy the union_obstack in the muscle stype.
22325 * src/bison.simple: Add new #line directive.
22326 Add typdef %%stype YYSTYPE.
22327
c51d1a19
PB
223282001-09-23 Pascal Bart <pascal.bart@epita.fr>
22329
22330 * src/bison.simple: Add new `#line' directive.
22331
6f9344da
PB
223322001-09-22 Pascal Bart <pascal.bart@epita.fr>
22333
22334 * src/bison.simple: New `#line' directive.
22335 * src/output.c (output_parser): Support new dynamic muscle input_line.
22336
652def80
MA
223372001-09-22 Marc Autret <autret_m@epita.fr>
22338
22339 * src/output.c (output_master_parser): New.
22340 (output_parser): Be more re-entrant.
22341
25b222fa
MA
223422001-09-21 Marc Autret <autret_m@epita.fr>
22343
22344 * src/reader.c (copy_definition, parse_union_decl): Update and use
22345 `linef' muscle.
22346 (copy_action): Likewise.
22347 Use obstack_1grow ().
22348 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
22349
6bc35ae5
MA
223502001-09-21 Marc Autret <autret_m@epita.fr>
22351
22352 * src/options.c (option_table): Adjust.
22353 * src/lex.c (parse_percent_token): Fix.
22354
c0629aa1
PB
223552001-09-20 Pascal Bart <pascal.bart@epita.fr>
22356
22357 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 22358
82b6d266
PB
223592001-09-20 Pascal Bart <pascal.bart@epita.fr>
22360
22361 * src/lex.c (parse_percent_token): Change type of variable `tx', which
22362 is now an option_table_struct*.
22363 (option_strcmp): New function option_strcmp.
22364 (parse_percent_token): Call option_strcmp.
22365 * src/getargs.c (xalloc.h, options.h): Include it.
22366 (getargs): Call create_long_option_table.
22367 (getargs): Free longopts at the end of the function.
22368 (shortopts): Move in options.c.
22369 * src/options.c (create_long_option_table): New function. Convert
22370 information from option_table to option structure.
22371 * src/reader.c (options.h): Include it.
22372
22373 * src/Makefile.am: Adjust.
22374 * src/options.c (option_table): Create from longopts and percent_table.
22375 * src/getargs.c (longopts): Delete.
22376 * src/lex.c (struct percent_table_struct): Delete.
22377 (percent_table): Delete.
22378 (options.h): Include it.
22379 * src/options.c: Create.
22380 * src/options.h: Create.
22381 Declare enum opt_access_e.
22382 Define struct option_table_struct.
22383
75f5aaea
MA
223842001-09-20 Marc Autret <autret_m@epita.fr>
22385
22386 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
22387 sections of Bison.
22388
f508cb0a
PB
223892001-09-19 Pascal Bart <pascal.bart@epita.fr>
22390
22391 * src/bison.simple: s/%%filename/%%skeleton.
22392 * src/muscle_tab.c (getargs.h): Include it.
22393 (muscle_init): Insert new muscle skeleton.
22394
13105fc1
PB
223952001-09-18 Pascal Bart <pascal.bart@epita.fr>
22396
22397 * src/output.c (output_parser): Delete unused variable actions_dumped.
22398
b0c4483e
PB
223992001-09-07 Pascal Bart <pascal.bart@epita.fr>
22400
22401 * src/output.c (output): Delete call to reader_output_yylsp.
22402 * src/reader.c (reader): Likewise.
ba0fe3c7 22403 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 22404
11d82f03
MA
224052001-09-02 Marc Autret <autret_m@epita.fr>
22406
22407 * src/reader.c: Include muscle_tab.h.
22408 (parse_union_decl): Update.
22409 (parse_macro_decl): Rename parse_muscle_decl.
22410 Update to use renamed functions and variable.
22411 (read_declarations, copy_action, read_additionnal_code, : Updated
22412 with correct variables and functions names.
22413 (packsymbols, reader): Likewise.
342b8b6e 22414
11d82f03 22415 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 22416
11d82f03
MA
22417 * src/output.c: Include muscle_tab.h
22418 In all functions using macro_insert, change by using muscle_insert ().
22419 (macro_obstack): Rename muscle_obstack.
22420 Echo modifications in the whole file.
22421 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
22422 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
22423 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
22424
22425 * src/muscle_tab.h: Update double inclusion macros.
22426 (macro_entry_s): Rename muscle_entry_s.
22427 Update prototypes.
342b8b6e 22428
11d82f03
MA
22429 * src/muscle_tab.c: Include muscle_tab.h.
22430 Rename macro_tabble to muscle_table.
22431 (mhash1, mhash2, mcmp): Use muscle_entry.
22432 (macro_init): Rename muscle_init. Update.
22433 (macro_insert): Rename muscle_insert. Update.
22434 (macro_find): Rename muscle_find. Update.
22435
22436 * src/main.c: Include muscle_tab.h.
22437 (main): Call muscle_init ().
22438 * src/Makefile.am (bison_SOURCES): Echo modifications.
22439
93a37297
MA
224402001-09-02 Marc Autret <autret_m@epita.fr>
22441
f753cd62 22442 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 22443
f753cd62
MA
22444 * src/muscle_tab.c, src/muscle_tab.h: Add files.
22445
224462001-09-02 Marc Autret <autret_m@epita.fr>
22447
22448 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 22449
682d48cd
PB
224502001-09-01 Pascal Bart <pascal.bart@epita.fr>
22451
342b8b6e 22452 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
22453 filename.
22454
087c8fda
MA
224552001-09-01 Marc Autret <autret_m@epita.fr>
22456
22457 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
22458 to an explicit value to activate the feature. We do it here.
22459
dda680cb
PB
224602001-08-31 Pascal Bart <pascal.bart@epita.fr>
22461
22462 * src/output.c (prepare): Delete the `filename' muscule insertion.
22463 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
22464 (parse_union_decl): Likewise.
22465 * src/macrotab.c (macro_init): Initialize filename by infile.
22466
9e644e64
MA
224672001-08-31 Marc Autret <autret_m@epita.fr>
22468
22469 * src/bison.simple (YYLSP_NEEDED): New definition.
22470 * src/output.c (prepare): Add macro insertion of `locations_flag'
22471
17da6427
PB
224722001-08-31 Pascal Bart <pascal.bart@epita.fr>
22473
22474 * src/output.c (prepare): Delete insertion of previous muscles,
22475 and insert the `prefix' muscles.
22476 * src/macrotab.c (macro_init): Likewise.
22477 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 22478 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
22479 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
22480 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 22481 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
22482 name_prefix.
22483
e8cb70b9
PB
224842001-08-31 Pascal Bart <pascal.bart@epita.fr>
22485
22486 * src/main.c (main): Standardize.
22487 * src/output.c (output_table_data, output_parser): Likewise.
22488 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
22489
63c2d5de
MA
224902001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
22491
342b8b6e 22492 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
22493 %%epilogue.
22494 * src/output.c (output): Rename %%declarations to %%prologue.
22495 * src/bison.simple: Echo modifications.
342b8b6e 22496
d8cb5183
MA
224972001-08-31 Marc Autret <autret_m@epita.fr>
22498
22499 * src/reader.c (readgram): CleanUp.
22500 (output_token_defines): Likewise.
22501 (packsymbols): Likewise.
22502 (reader): Likewise.
22503 * src/output.c (output): CPP-out useless code.
22504
6c686258
PB
225052001-08-31 Pascal Bart <pascal.bart@epita.fr>
22506
342b8b6e 22507 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
22508 output_trailers and output_headers.
22509 * src/output.h: Remove obsolete functions prototypes of output_headers
22510 and output_trailers.
22511
8f451ef7
PB
225122001-08-30 Pascal Bart <pascal.bart@epita.fr>
22513
22514 * src/main.c: Include macrotab.h.
342b8b6e 22515 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
22516 Adjust functions prototypes.
22517 * src/macrotab.c (macro_insert): Constify key and value.
22518 (macro_find): Constify key.
22519 (macro_insert): Include 'xalloc.h'
22520 (macro_insert): Use XMALLOC.
22521 (macro_find): Constify return value.
22522 * src/output.c (output_table_data): Rename table to table_data.
22523 (output_parser): Constify macro_key, macro_value.
22524
997b6fd0 225252001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
22526
22527 * src/reader.c (parse_skel_decl): New.
342b8b6e 22528 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
22529 * src/lex.h (token_t): New token `tok_skel'.
22530 * src/lex.c (percent_table): Add skeleton option entry.
22531 Standardize.
22532
ff48177d
MA
225332001-08-29 Marc Autret <autret_m@epita.fr>
22534
22535 * src/bison.simple: Add %%user_code directive at the end.
22536 * src/reader.c (read_additionnal_code): New.
22537 (reader): Use it.
22538 * src/output.c (output_program): Remove.
22539 (output): Update.
22540
b33160bf
MA
225412001-08-28 Marc Autret <autret_m@epita.fr>
22542
22543 * src/output.c (output_actions): Clean up.
4e5caae2 22544 (output_gram): CPP-out useless code.
b33160bf
MA
22545 * src/reader.c (reader): Clean up, CPP-out useless code.
22546
d1a2daf7
PB
225472001-08-28 Pascal Bart <pascal.bart@epita.fr>
22548
342b8b6e 22549 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 22550 directive.
d1a2daf7
PB
22551 * src/bison.simple: Add `%%definitions'.
22552
2b763dfe
MA
225532001-08-28 Marc Autret <autret_m@epita.fr>
22554
22555 * config/depcomp: New file.
22556
f1a87ef6
PE
225572001-08-27 Paul Eggert <eggert@twinsun.com>
22558
22559 * src/bison.simple (yyparse): Don't take the address of an
22560 item before the start of an array, as that doesn't conform to
22561 the C Standard.
22562
82e236e2
RA
225632001-08-27 Robert Anisko <robert.anisko@epita.fr>
22564
f1a87ef6 22565 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
22566 obstack. It was done too late here.
22567
22568 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
22569 completely wrong.
22570 (reader): Initialize the macro obstack here, since we need it to grow
22571 '%define' directives.
22572
22573 * src/reader.h: Declare the macro obstack as extern.
22574
b0cfa28a
RA
225752001-08-27 Robert Anisko <robert.anisko@epita.fr>
22576
22577 * src/output.c (output_parser): Fix. Store single '%' characters in
22578 the output obstack instead of throwing them away.
22579
6fc74234
AD
225802001-08-27 Akim Demaille <akim@epita.fr>
22581
22582 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
22583
9c76d118
RA
225842001-08-25 Robert Anisko <robert.anisko@epita.fr>
22585
22586 * lib/Makefile.am: Adjust.
22587
a8289c62
RA
225882001-08-25 Robert Anisko <robert.anisko@epita.fr>
22589
22590 * src/bison.simple: Update and add '%%' directives.
22591
b6610515
RA
225922001-08-25 Robert Anisko <robert.anisko@epita.fr>
22593
22594 * src/reader.c (reader): Remove calls to 'output_headers' and
22595 'output_trailers'. Remove some C output.
22596 (readgram): Disable a piece of code that was writing a default
22597 definition for 'YYSTYPE'.
22598 (reader_output_yylsp): Remove.
22599 (packsymbols): Output token defintions to a macro.
22600 (copy_definition): Disable C output.
6fc74234 22601
b6610515
RA
22602 * src/reader.c (parse_macro_decl): New function used to parse macro
22603 declarations.
22604 (copy_string2): Put the body of copy_string into this new function.
22605 Add a parameter to let the caller choose whether he wants to copy the
22606 string delimiters or not.
22607 (copy_string): Be a simple call to copy_string2 with the last argument
22608 bound to true.
22609 (read_declarations): Add case for macro definition.
22610 (copy_identifier): New.
6fc74234 22611 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
22612 rather than lex.
22613
26f609ff
RA
226142001-08-25 Robert Anisko <robert.anisko@epita.fr>
22615
22616 * src/output.c (prepare): Add prefixed names.
22617 (output_parser): Output semantic actions.
22618 (output_parser): Fix bug on '%%line' directives.
6fc74234 22619
26f609ff
RA
22620 * src/output.c (output_headers): Remove. The C code printed by this
22621 function should now be in the skeletons.
22622 (output_trailers): Remove.
22623 (output): Disable call to 'reader_output_yylsp'.
22624 (output_rule_data): Do not output tables to the table obstack.
22625
22626 * src/output.c: Remove some C dedicated output.
22627 Improve the use of macro and output obstacks.
22628 (output_defines): Remove.
6fc74234 22629
26f609ff
RA
22630 * src/output.c (output_token_translations): Associate 'translate'
22631 table with a macro. No output to the table obstack.
22632 (output_gram): Same for 'rhs' and 'prhs'.
22633 (output_stos): Same for 'stos'.
22634 (output_rule_data): Same for 'r1' and 'r2'.
22635 (token_actions): Same for 'defact'.
22636 (goto_actions): Same for 'defgoto'.
22637 (output_base): Same for 'pact' and 'pgoto'.
22638 (output_table): Same for 'table'.
22639 (output_check): Same for 'check'.
6fc74234 22640
26f609ff
RA
22641 * src/output.c (output_table_data): New function.
22642 (output_short_table): Remove.
22643 (output_short_or_char_table): Remove.
6fc74234 22644
26f609ff
RA
22645 * src/output.c (output_parser): Replace most of the skeleton copy code
22646 with something new. Skeletons are now processed character by character
22647 rather than line by line, and Bison looks for '%%' macros. This is the
22648 first step in making Bison's output process (a lot) more flexible.
22649 (output_parser): Use the macro table.
22650
6f43b113
RA
226512001-08-25 Robert Anisko <robert.anisko@epita.fr>
22652
22653 * src/main.c (main): Initialize the macro table.
22654
dd3127cf
RA
226552001-08-25 Robert Anisko <robert.anisko@epita.fr>
22656
22657 * src/lex.c (percent_table): Add tok_define.
22658 * src/lex.h: Add tok_define.
22659
aa321494
RA
226602001-08-25 Robert Anisko <robert.anisko@epita.fr>
22661
22662 * src/macrotab.c: New file.
22663 * src/macrotab.h: New file.
22664 * src/Makefile.am: Update.
22665
68bd3b6b
RA
226662001-08-25 Robert Anisko <robert.anisko@epita.fr>
22667
22668 * lib/hash.c: New file.
22669 * lib/hash.h: New file.
22670 * lib/Makefile.am: Update.
22671
45f8dd1e
AD
226722001-08-15 Akim Demaille <akim@epita.fr>
22673
22674 Version 1.28c.
22675
40a64a7a 226762001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
22677
22678 * src/reader.c (readgram): Indent output macro YYSTYPE.
22679 (packsymbols): Likewise.
22680 (output_token_defines): Likewise.
22681 * src/files.c: Standardize.
22682 (compute_header_macro): New.
22683 (defines_obstack_save): New. Use compute_header_macro.
22684 (output_files): Update. Use defines_obstack_save.
22685
f9a8293a
AD
226862001-08-15 Akim Demaille <akim@epita.fr>
22687
22688 * doc/bison.texinfo (Table of Symbols): Document
22689 YYSTACK_USE_ALLOCA.
22690
150ca7a7
AD
226912001-08-15 Akim Demaille <akim@epita.fr>
22692
22693 * missing: Update from CVS Automake.
22694 * config/config.guess, config/config.sub, config/texinfo.tex:
22695 Update from gnu.org.
22696
69b5cec4
AD
226972001-08-15 Akim Demaille <akim@epita.fr>
22698
22699 * Makefile.maint: Sync with CVS Autoconf.
22700
f2b5126e
PB
227012001-08-14 Pascal Bart <pascal.bart@epita.fr>
22702
69b5cec4 22703 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
22704 `fdl.texi'.
22705 * doc/fdl.texi: Add to package.
22706
4ecbf796
MA
227072001-08-14 Marc Autret <autret_m@epita.fr>
22708
22709 Turn on %{source,header}_extension features.
22710
69b5cec4 22711 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
22712 source_extension.
22713 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 22714 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
22715 between options.
22716
95fb5662
MA
227172001-08-14 Marc Autret <autret_m@epita.fr>
22718
22719 * src/files.c (compute_base_names): Add extensions computing when
22720 `--file-prefix' used.
22721 Standardize function calls.
22722
78d09da9
MA
227232001-08-13 Marc Autret <autret_m@epita.fr>
22724
69b5cec4 22725 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
22726 defining it (defined but null disables alloca).
22727
5a009f2c
MA
227282001-08-13 Marc Autret <autret_m@epita.fr>
22729
22730 * src/bison.simple (_yy_memcpy): CPP reformat.
22731
1e41465a
PB
227322001-08-13 Pascal Bart <pascal.bart@epita.fr>
22733
22734 * tests/atconfig.in (CPPFLAGS): Fix.
22735
c67a198d
PB
227362001-08-10 Pascal Bart <pascal.bart@epita.fr>
22737
79282c6c 22738 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
22739 `gpl.texi'.
22740 * doc/gpl.texi: Add to package.
22741
09a6de7e
MA
227422001-08-10 Marc Autret <autret_m@epita.fr>
22743
22744 * src/print_graph.h: Fix.
22745 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
22746
b77b9ee0
AD
227472001-08-10 Akim Demaille <akim@epita.fr>
22748
22749 * src/system.h: Provide default declarations for stpcpy, strndup,
22750 and strnlen.
22751
3e259915
MA
227522001-08-10 Robert Anisko <anisko_r@epita.fr>
22753
22754 * doc/bison.texinfo (Locations): Update @$ stuff.
22755
ca96bc2d
MA
227562001-08-09 Robert Anisko <anisko_r@epita.fr>
22757
22758 * src/bison.simple (YYLLOC_DEFAULT): Update.
22759 (yyparse): Adjust.
22760
fdc6758b
MA
227612001-08-08 Marc Autret <autret_m@epita.fr>
22762
b77b9ee0 22763 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
22764 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
22765 Reported by Fabrice Bauzac.
957d4dbf 22766
600cad3b
MA
227672001-08-08 Marc Autret <autret_m@epita.fr>
22768
22769 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
22770 * src/vcg.c (output_node): Fix.
22771 * src/vcg.h: Cleanup.
22772 * src/print_graph.c: Add comments.
b77b9ee0 22773 (node_output_size): New global variable. Simplify the formatting of
600cad3b 22774 the VCG graph output.
b77b9ee0 22775 (print_actions): Unused code is now used. It notifies the final state
600cad3b 22776 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 22777 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
22778 blue.
22779 Get the current node name and node_obstack by argument.
22780 (node_obstack): New variable.
22781 (print_state): Manage node_obstack.
22782 (print_core): Use node_obstack given by argument.
22783 A node is not only computed here but in print_actions also.
22784 (print_graph): CPP out useless code instead of commenting it.
22785
976e528f
AD
227862001-08-07 Pascal Bart <pascal.bart@epita.fr>
22787
22788 * tests/atconfig.in (CPPFLAGS): Fix.
22789
20e8e5ca
AD
227902001-08-07 Akim Demaille <akim@epita.fr>
22791
22792 * src/print_graph.c (quote): New.
22793 (print_core): Use it.
22794
957d4dbf 227952001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 22796
3e3da797
AD
22797 * src/vcg.c (complain.h): Include it.
22798 Unepitaize `return' invocations.
c4b66126 22799 [NDEBUG] (main): Remove.
79282c6c 22800 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
22801 * src/files.c (open_files): Initialize graph_obstack.
22802 * src/print_graph.c (print_actions): CPP out useless code.
22803 (print_core): Don't output the last `\n' in labels.
22804 Use `quote'.
22805 * src/files.c (output_files): Output the VCG file.
22806 * src/main.c (main): Invoke print_graph ();
3e3da797 22807
957d4dbf 228082001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
22809
22810 Automaton VCG graph output.
22811 Using option ``-g'' or long option ``--graph'', you can generate
22812 a gram_filename.vcg file containing a VCG description of the LALR (1)
22813 automaton of your grammar.
22814
22815 * src/main.c: Call to print_graph() function.
22816 * src/getargs.h: Update.
22817 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
22818 (graph_flag): New flag.
22819 (longopts): Update.
22820 (getargs): Add case `g'.
22821 * src/files.c (graph_obstack): New obstack struct.
22822 (open_files): Initialize new obstack.
22823 (output_files): Saves graph_obstack if required.
22824 * src/files.h (graph_obstack): New extern declaration.
22825 * src/Makefile.am: Add new source files.
22826
927c1557 228272001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
22828
22829 * src/print_graph.c, src/print_graph.h (graph): New.
22830 * src/vcg.h: New file.
22831 * src/vcg.c: New file, VCG graph handling.
22832
7333d403
AD
228332001-08-06 Marc Autret <autret_m@epita.fr>
22834
22835 Add of %source_extension and %header_extension which specify
22836 the source or/and the header output file extension.
22837
22838 * src/files.c (compute_base_names): Remove initialisation of
22839 src_extension and header_extension.
22840 (compute_exts_from_gf): Update.
22841 (compute_exts_from_src): Update.
22842 (output_files): Update.
22843 * src/reader.c (parse_header_extension_decl): New.
22844 (parse_source_extension_decl): New.
22845 (read_declarations): New case statements for the new tokens.
22846 * src/lex.c (percent_table): Add entries for %source_extension
22847 and %header_extension.
22848 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
22849
84163231
AD
228502001-08-06 Marc Autret <autret_m@epita.fr>
22851
22852 * configure.in: Bump to 1.28c.
22853 * doc/bison.texinfo: Texinfo thingies.
22854
8303fc42
AD
228552001-08-04 Pascal Bart <pascal.bart@epita.fr>
22856
22857 * tests/atconfig.in (CPPFLAGS): Add.
22858 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
22859
70a84437
AD
228602001-08-03 Akim Demaille <akim@epita.fr>
22861
22862 Version 1.28b.
22863
2ce10144
AD
228642001-08-03 Akim Demaille <akim@epita.fr>
22865
22866 * tests/Makefile.am (check-local): Ship testsuite.
22867 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
22868 Include `string.h'.
22869
1e3e4bc1
AD
228702001-08-03 Akim Demaille <akim@epita.fr>
22871
22872 * configure.in: Try using -Wformat when compiling.
22873
42b45b7f
AD
228742001-08-03 Akim Demaille <akim@epita.fr>
22875
22876 * configure.in: Bump to 1.28b.
22877
8f13fe33
AD
228782001-08-03 Akim Demaille <akim@epita.fr>
22879
22880 * src/complain.c: Adjust strerror_r portability issues.
22881
b37ba92c
AD
228822001-08-03 Akim Demaille <akim@epita.fr>
22883
22884 Version 1.28a.
22885
b0ce6046
AD
228862001-08-03 Akim Demaille <akim@epita.fr>
22887
22888 * src/getargs.c, src/getarg.h (skeleton)): Constify.
22889 * src/lex.c (literalchar): Avoid name clashes on `buf'.
22890 * src/getargs.c: Include complain.h.
22891 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
22892 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
22893
d01c415b
AD
228942001-08-03 Akim Demaille <akim@epita.fr>
22895
22896 * src/reader.c (readgram): Display hidden chars in error messages.
22897
459dd1a6
AD
228982001-08-03 Akim Demaille <akim@epita.fr>
22899
22900 Update to gettext 0.10.39.
22901
53b74c0c
AD
229022001-08-03 Akim Demaille <akim@epita.fr>
22903
22904 * lib/strspn.c: New.
22905
234a3be3
AD
229062001-08-01 Marc Autret <autret_m@epita.fr>
22907
22908 * doc/bison.texinfo: Update.
22909 * doc/bison.1 (mandoc): Update.
22910 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
22911 * src/files.c: Support output files extensions computing.
22912 (src_extension): New static variable.
22913 (header_extension): New static variable.
22914 (tr): New function.
22915 (get_extension_index): New function, gets the index of an extension
22916 filename in a string.
22917 (compute_exts_from_gf): New function, computes extensions from the
22918 grammar file extension.
22919 (compute_exts_from_src): New functions, computes extensions from the
22920 C source file extension, file given by ``-o'' option.
22921 (compute_base_names): Update.
22922 (output_files): Update.
22923
847bf1f5
AD
229242001-08-01 Robert Anisko <anisko_r@epita.fr>
22925
d995fee7 22926 * doc/bison.texi: Document @$.
847bf1f5
AD
22927 (Locations): New section.
22928
d074a105
AD
229292001-07-18 Akim Demaille <akim@epita.fr>
22930
22931 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
22932 * config/prev-version.txt, config/move-if-change: New.
22933 * Makefile.am: Adjust.
22934
3419715d
AD
229352001-07-08 Pascal Bart <pascal.bart@epita.fr>
22936
22937 * src/bison.simple (yyparse): Suppress warning `comparaison
22938 between signed and unsigned'.
22939
62ab6972
AD
229402001-07-05 Pascal Bart <pascal.bart@epita.fr>
22941
22942 * src/getargs.h (raw_flag): Remove.
22943 * src/getargs.c: Die on `-r'/`--raw'.
22944 * src/lex.c (parse_percent_token): Die on `%raw'.
22945 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
22946 * tests/calc.at: Suppress test with option `--raw'.
22947
1e24cc5b
AD
229482001-07-14 Akim Demaille <akim@epita.fr>
22949
22950 * config/: New.
22951 * configure.in: Require Autoconf 2.50.
22952 Update to gettext 0.10.38.
22953
32dfccf8
AD
229542001-03-16 Akim Demaille <akim@epita.fr>
22955
22956 * doc/bison.texinfo: ANSIfy the examples.
22957
cd5bd6ac
AD
229582001-03-16 Akim Demaille <akim@epita.fr>
22959
22960 * getargs.c (skeleton): New variable.
22961 (longopts): --skeleton is a new option.
22962 (shortopts, getargs): -S is a new option.
22963 * getargs.h: Declare skeleton.
22964 * output.c (output_parser): Use it.
22965
5141b016
AD
229662001-03-16 Akim Demaille <akim@epita.fr>
22967
22968 * m4/strerror_r.m4: New.
22969 * m4/error.m4: Run AC_FUNC_STRERROR_R.
22970 * lib/error.h, lib/error.c: Update.
22971
447992b9
AD
229722001-03-16 Akim Demaille <akim@epita.fr>
22973
22974 * src/getargs.c (longopts): Clean up.
22975
274d42ce
AD
229762001-02-21 Akim Demaille <akim@epita.fr>
22977
22978 * src/reader.c (gensym): `gensym_count' is your own.
22979 Use a static buf to create the symbol name, as token_buffer is no
22980 longer a buffer.
22981
22c821f3
AD
229822001-02-08 Akim Demaille <akim@epita.fr>
22983
22984 * src/conflicts.c (conflict_report): Be sure not to append to res
22985 between two calls, which could happen if both first sprintf were
22986 skipped, but not the first cp += strlen.
22987
18569462
AD
229882001-02-08 Akim Demaille <akim@epita.fr>
22989
22990 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
22991 New, from fileutils 4.0.37.
22992 * configure.in: Require Autoconf 2.49c. I took some time before
22993 making this decision. This is the only way out for portability
22994 issues in Bison, it would mean way too much duplicate effort to
22995 import in Bison features implemented in 2.49c since 2.13.
22996 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
22997
0d8f3c8a
AD
229982001-02-02 Akim Demaille <akim@epita.fr>
22999
23000 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 23001 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 23002
f17bcd1f
AD
230032001-01-19 Akim Demaille <akim@epita.fr>
23004
23005 Get rid of the ad hoc handling of token_buffer in the scanner: use
23006 the obstacks.
23007
23008 * src/lex.c (token_obstack): New.
23009 (init_lex): Initialize it. No longer call...
23010 (grow_token_buffer): this. Remove it.
23011 Adjust all the places which used it to use the obstack.
23012
511e79b3
AD
230132001-01-19 Akim Demaille <akim@epita.fr>
23014
23015 * src/lex.h: Rename all the tokens:
23016 s/\bENDFILE\b/tok_eof/g;
23017 s/\bIDENTIFIER\b/tok_identifier/g;
23018 etc.
23019 Let them be enums, not #define, to ease debugging.
23020 Adjust all the code.
23021
0d6508ef
AD
230222001-01-18 Akim Demaille <akim@epita.fr>
23023
23024 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
23025 * src/lex.c (maxtoken, grow_token_buffer): Static.
23026
6deb4447
AD
230272001-01-18 Akim Demaille <akim@epita.fr>
23028
23029 Since we now use obstacks, more % directives can be enabled.
23030
23031 * src/lex.c (percent_table): Also accept `%yacc',
23032 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
23033 `%debug'.
23034 Handle the actions for `%semantic_parser' and `%pure_parser' here,
23035 instead of returning a token.
23036 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
23037 * src/reader.c (read_declarations): Adjust.
23038 * src/files.c (open_files): Don't call `compute_base_names', don't
23039 compute `attrsfile' since they depend upon data which might be
23040 *in* the input file now.
23041 (output_files): Do it here.
23042 * src/output.c (output_headers): Document the fact that this patch
23043 introduces a guaranteed SEGV for semantic parsers.
23044 * doc/bison.texinfo: Document them.
23045 * tests/suite.at: Exercise these %options.
23046
ff4423cc
AD
230472000-12-20 Akim Demaille <akim@epita.fr>
23048
23049 Also handle the output file (--verbose) with obstacks.
23050
23051 * files.c (foutput): Remove.
23052 (output_obstack): New.
23053 Adjust all dependencies.
23054 * src/conflicts.c: Return a string.
23055 * src/system.h (obstack_grow_string): Rename as...
23056 (obstack_sgrow): this. Be ready to work with non literals.
23057 (obstack_fgrow4): New.
23058
956dba3a
AD
230592000-12-20 Akim Demaille <akim@epita.fr>
23060
23061 * src/files.c (open_files): Fix the computation of short_base_name
23062 in the case of `-o foo.tab.c'.
23063
337bab46
AD
230642000-12-20 Akim Demaille <akim@epita.fr>
23065
23066 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
23067 (copy_dollar): Now that everything uses obstacks, get rid of the
23068 FILE * parameters.
23069
5d3214b8
AD
230702000-12-20 Akim Demaille <akim@epita.fr>
23071
23072 * src/files.c (open_files): Actually the `.output' file is based
23073 on the short_base_name, not base_name.
23074 * tests/suite.at (Checking output file names): Adjust.
23075
29092a57
AD
230762000-12-20 Akim Demaille <akim@epita.fr>
23077
23078 * src/bison.s1: Remove, we now use directly...
23079 * src/bison.simple: this.
23080 * src/Makefile.am: Use pkgdata instead of data.
23081
ea5607fd
AD
230822000-12-20 Akim Demaille <akim@epita.fr>
23083
23084 * src/files.c (guard_obstack): New.
23085 (open_files): Initialize it.
23086 (output_files): Dump it...
23087 * src/files.h: Export it.
23088 * src/reader.c (copy_guard): Use it.
23089
27110317
AD
230902000-12-19 Akim Demaille <akim@epita.fr>
23091
23092 * src/files.c (outfile, defsfile, actfile): Removed as global
23093 vars.
23094 (open_files): Don't compute them.
23095 (output_files): Adjust.
23096 (base_name, short_base_name): Be global.
23097 Adjust dependencies.
23098
19c50364
AD
230992000-12-19 Akim Demaille <akim@epita.fr>
23100
23101 * src/files.c (strsuffix): New.
23102 (stringappend): Be just like strcat but allocate.
23103 (base_names): Eve out from open_files.
23104 Try to simplify the rather hairy computation of base_name and
23105 short_base_name.
23106 (open_files): Use it.
23107 * tests/suite.at (Checking output file names): New test.
23108
573c1d9f
AD
231092000-12-19 Akim Demaille <akim@epita.fr>
23110
23111 * src/system.h (obstack_grow_literal_string): Rename as...
23112 (obstack_grow_string): this.
23113 * src/output.c (output_parser): Recognize `%% actions' instead of
23114 `$'.
23115 * src/bison.s1: s/$/%% actions/.
23116 * src/bison.hairy: Likewise.
23117
ef7ddedd
AD
231182000-12-19 Akim Demaille <akim@epita.fr>
23119
23120 * src/output.c (output_parser): Compute the `#line' lines when
23121 there are.
23122 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
23123 Suggested by Hans Aberg.
23124
ff61dabd
AD
231252000-12-19 Akim Demaille <akim@epita.fr>
23126
23127 Let the handling of the skeleton files be local to the procedures
23128 that use it.
23129
23130 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
23131 longer static.
23132 (fparser, open_extra_files): Remove.
23133 (open_files, output_files): Don't take care of fparser.
23134 * src/files.h: Adjust.
23135 * src/output.c (output_parser): Open and close the file to the
23136 skeleton.
23137 * src/reader.c (read_declarations): When %semantic_parser, open
23138 fguard.
23139
55b96341
AD
231402000-12-19 Akim Demaille <akim@epita.fr>
23141
23142 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
23143 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
23144
358c15b7
AD
231452000-12-19 Akim Demaille <akim@epita.fr>
23146
23147 * src/files.c (open_files): Yipee! We no longer need all the code
23148 looking for `/tmp' since we have no tmp file.
23149
7de3329e
AD
231502000-12-19 Akim Demaille <akim@epita.fr>
23151
23152 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
23153 New macros.
23154 * src/files.c (open_files): Less dependency on MSDOS etc.
23155
3abcd459
AD
231562000-12-14 Akim Demaille <akim@epita.fr>
23157
23158 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
23159 Provide a default definition.
23160 Use it when executing the default @ action.
23161 * src/reader.c (reader_output_yylsp): No longer include
23162 `timestamp' and `text' in the default YYLTYPE.
23163
2a91a95e
AD
231642000-12-12 Akim Demaille <akim@epita.fr>
23165
23166 * src/reader.c (copy_definition, parse_union_decl, copy_action)
23167 (copy_guard): Quote the file names.
23168 Reported by Laurent Mascherpa.
23169
14d3eb9b
AD
231702000-12-12 Akim Demaille <akim@epita.fr>
23171
23172 * src/output.c (output_headers, output_program, output): Be sure
23173 to escape special characters when outputting filenames.
23174 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
23175 (output_headers): Don't depend on them, Use ACTSTR.
23176
d7045ec6
AD
231772000-11-17 Akim Demaille <akim@epita.fr>
23178
23179 * lib/obstack.h: Formatting changes.
23180 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
23181 prevents type checking.
23182 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
23183 cast the value to (void *): assigning a `foo *' to a `void *'
23184 variable is valid.
23185 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
23186 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
23187 append characters.
23188
6fd54b73
AD
231892000-11-17 Akim Demaille <akim@epita.fr>
23190
23191 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
23192 as...
23193 (suite.m4, regression.m4, calc.m4): these.
23194 * tests/atgeneral.m4: Update from CVS Autoconf.
23195
4c50eae6
AD
231962000-11-17 Akim Demaille <akim@epita.fr>
23197
23198 * tests/regression.m4 (%union and --defines): New test,
23199 demonstrating a current bug in the obstack implementation.
23200
a35f64ea
AD
232012000-11-17 Akim Demaille <akim@epita.fr>
23202
23203 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
23204 macros.
23205 Use them to declare the variables which are global or local to
23206 `yyparse'.
23207
7de23534
AD
232082000-11-17 Akim Demaille <akim@epita.fr>
23209
23210 * acconfig.h: Remove, no longer used.
23211
aa7815f5
AD
232122000-11-07 Akim Demaille <akim@epita.fr>
23213
23214 * src: s/Copyright (C)/Copyright/g.
23215
5af1f549
AD
232162000-11-07 Akim Demaille <akim@epita.fr>
23217
23218 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
23219 defining.
23220 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
23221
553e2b22
AD
232222000-11-07 Akim Demaille <akim@epita.fr>
23223
23224 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
23225 Merge in a single CPP if/else.
23226
8a4f41d6
AD
232272000-11-07 Akim Demaille <akim@epita.fr>
23228
23229 * src/output.c (output): Remove useless variables.
23230 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
23231 argument `data' for consistency with the prototypes.
23232 Qualify it `const'.
23233 (obstack_copy, obstack_copy0): Rename the second argument as
23234 `address' for consistency. Qualify it `const'.
23235 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
23236 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
23237 `const' their input argument (`data' or `address').
23238 Adjust the corresponding macros to include `const' in casts.
23239
095a3fb5
AD
232402000-11-03 Akim Demaille <akim@epita.fr>
23241
23242 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
23243 s/PFILE1/BISON_HAIRY/.
23244 Adjust dependencies.
23245
d1cdce7c
AD
232462000-11-03 Akim Demaille <akim@epita.fr>
23247
090c5ebf 23248 For some reason, this was not applied.
d1cdce7c
AD
23249
23250 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23251 `unlink': it's no longer used.
23252
9311529b
AD
232532000-11-03 Akim Demaille <akim@epita.fr>
23254
23255 * src/files.c (skeleton_find): New function, eved out of...
23256 (open_files, open_extra_files): here.
23257
d8880f69
AD
232582000-11-03 Akim Demaille <akim@epita.fr>
23259
23260 Don't use `atexit'.
23261
23262 * src/files.c (obstack_save): New function.
23263 (done): Rename as...
23264 (output_files): this.
23265 Use `obstack_save'.
23266 * src/main.c (main): Don't use `atexit' to register `done', since
23267 it no longer has to remove tmp files, just call `output_files'
23268 when there are no errors.
23269
0dbb648e
AD
232702000-11-02 Akim Demaille <akim@epita.fr>
23271
23272 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23273 `unlink': it's no longer used.
23274 * src/files.h: Formatting changes.
23275
896fe5c1
AD
232762000-11-02 Akim Demaille <akim@epita.fr>
23277
23278 Remove the last uses of mktemp and unlink/delete.
23279
23280 * src/files.c (fdefines, ftable): Removed.
23281 (defines_ostack, table_obstack): New.
23282 Adjust dependencies of the former into uses of the latter.
23283 * src/output.c (output_short_or_char_table, output_short_table):
23284 Convert to using obstacks.
23285 * src/reader.c (copy_comment2): Accept one FILE * and two
23286 obstacks.
23287 (output_token_defines, reader_output_yylsp): Use obstacks.
23288 * src/system.h (obstack_fgrow3): New.
1f65350a 23289 * po/POTFILES.in: Adjust.
896fe5c1 23290
dd60faec
AD
232912000-11-01 Akim Demaille <akim@epita.fr>
23292
23293 Change each use of `fattrs' into a use of `attrs_obstack'.
23294
23295 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
23296 * src/files.c (fattrs): Remove.
23297 (attrs_obstack): New.
23298 Adjust all dependencies.
23299 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
23300
8c7ebe49
AD
233012000-11-01 Akim Demaille <akim@epita.fr>
23302
23303 Introduce obstacks.
23304 Change each use of `faction' into a use of `action_obstack'.
23305
23306 * lib/obstack.h, lib/obstack.c: New files.
23307 * src/files.c (faction): Remove.
23308 (action_obstack): New.
23309 Adjust all dependencies.
23310
77aee789
AD
233112000-10-20 Akim Demaille <akim@epita.fr>
23312
23313 * lib/quote.h (PARAMS): New macro. Use it.
23314
43591cec
AD
233152000-10-16 Akim Demaille <akim@epita.fr>
23316
23317 * src/output.c (output_short_or_char_table): New function.
23318 (output_short_table, output_token_translations): Use it.
23319 (goto_actions): Use output_short_table.
23320
1e9798d5
AD
233212000-10-16 Akim Demaille <akim@epita.fr>
23322
23323 * src/symtab.c (bucket_new): New function.
23324 (getsym): Use it.
23325
23326 * src/output.c (output_short_table): New argument to display the
23327 comment associated with the table.
23328 Adjust dependencies.
23329 (output_gram): Use it.
23330 (output_rule_data): Nicer output layout for YYTNAME.
23331
f282676b
AD
233322000-10-16 Akim Demaille <akim@epita.fr>
23333
23334 * src/lex.c (read_typename): New function.
23335 (lex): Use it.
23336 * src/reader.c (copy_dollar): Likewise.
23337
550a72a3
AD
233382000-10-16 Akim Demaille <akim@epita.fr>
23339
23340 * src/reader.c (copy_comment2): Expect the input stream to be on
23341 the `/' which is suspected to open a comment, instead of being
23342 called after `//' or `/*' was read.
23343 (copy_comment, copy_definition, parse_union_decl, copy_action)
23344 (copy_guard): Adjust.
23345
131e2fef
AD
233462000-10-16 Akim Demaille <akim@epita.fr>
23347
23348 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
23349 `read_signed_integer'.
23350
79282c5a
AD
233512000-10-16 Akim Demaille <akim@epita.fr>
23352
23353 * src/reader.c (copy_dollar): New function.
23354 (copy_guard, copy_action): Use it.
23355
ff4a34be
AD
233562000-10-16 Akim Demaille <akim@epita.fr>
23357
23358 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
23359 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
23360 New files, from Fileutils 4.0.27.
23361 * src/main.c (printable_version): Remove.
23362 * src/lex.c, src/reader.c: Use `quote'.
23363
233642000-10-04 Akim Demaille <akim@epita.fr>
23365
23366 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
23367
14ded682
AD
233682000-10-04 Akim Demaille <akim@epita.fr>
23369
23370 * doc/bison.texinfo: Various typos spotted by Neil Booth.
23371
8e03724b
AD
233722000-10-04 Akim Demaille <akim@epita.fr>
23373
23374 When a literal string is used to define two different tokens,
23375 `bison -v' segfaults.
23376 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
23377
23378 * tests/regression.m4: New file.
23379 Include the core of the sample provided by Piotr Gackiewicz.
23380 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
23381 properly.
23382
a9e64249
AD
233832000-10-04 Akim Demaille <akim@epita.fr>
23384
23385 * src/reader.c (parse_expect_decl): Keep `count' within the size
23386 of `buffer'.
23387 From Neil Booth.
23388
da9abf43
AD
233892000-10-02 Paul Eggert <eggert@twinsun.com>
23390
23391 * bison.s1 (yyparse): Assign the default value
23392 unconditionally, to avoid a GCC warning and make the parser a
23393 tad smaller.
23394
c33638bb
AD
233952000-10-02 Akim Demaille <akim@epita.fr>
23396
23397 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
23398 options.
23399
444c570a
AD
234002000-10-02 Akim Demaille <akim@epita.fr>
23401
23402 * src/derives.c, src/print.c, src/reduce.c: To ease the
23403 translation, move some `\n' out of the translated strings.
23404
89cab50d
AD
234052000-10-02 Akim Demaille <akim@epita.fr>
23406
23407 The location tracking mechanism is precious for parse error
23408 messages. Nevertheless, it is enabled only when `@n' is used in
23409 the grammar, which is a different issue (you can use it in error
23410 message, but not in the grammar per se). Therefore, there should
23411 be another means to enable it.
23412
23413 * src/getargs.c (getargs): Support `--locations'.
23414 (usage): Report it.
23415 * src/getargs.h (locationsflag): Export it.
23416 * src/lex.c (percent_table): Support `%locations'.
23417 * src/reader.c (yylsp_needed): Remove this variable, now replaced
23418 with `locationsflag'.
23419 * doc/bison.texinfo: Document `--locations' and `%locations'.
23420 Sort the options.
23421 * tests/calc.m4: Test it.
23422
23423 For regularity of the names, replace each
23424 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
23425 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
23426 In addition replace each `flag' with `_flag'.
23427
d6c2cba0
AD
234282000-10-02 Akim Demaille <akim@epita.fr>
23429
23430 Also test parse error messages, including with YYERROR_VERBOSE.
23431
23432 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
23433 associative).
23434 Use it to check the computations.
23435 Use it to check `nonassoc' is honored.
23436 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
23437 `--yyerror-verbose'.
23438 (_AT_CHECK_CALC): Adjust to this option.
23439 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
23440
5a35a6cb
AD
234412000-10-02 Akim Demaille <akim@epita.fr>
23442
23443 Test also `--verbose', `--defines' and `--name-prefix'. Testing
23444 the latter demonstrates a flaw in the handling of non debugging
23445 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
23446 was used in order to simplify:
23447
23448 #if YYDEBUG
23449 if (yydebug)
23450 {
23451 ...
23452 }
23453 #endif
23454
23455 into
23456
23457 if (yydebug)
23458 {
23459 ...
23460 }
23461
23462 unfortunately this leads to a CPP conflict when
23463 `--name-prefix=foo' is used since it produces `#define yydebug
23464 foodebug'.
23465
23466 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
23467 (YYDPRINTF): New macro.
23468 Spread its use.
23469 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
23470 the bison options.
23471 Also test `--verbose', `--defines' and `--name-prefix'.
23472
71da9eea
AD
234732000-10-02 Akim Demaille <akim@epita.fr>
23474
23475 Improve the readability of the produced parsers.
23476
23477 * src/bison.s1: Formatting changes.
23478 Improve the comment related to the `$' mark.
23479 (yydefault): Don't fall through to `yyresume': `goto' there.
23480 * src/output.c (output_parser): When the `$' is met, skip the end
23481 of its line.
23482 New variable, `number_of_dollar_signs', to check there's exactly
23483 one `$' in the parser skeleton.
23484
95e36146
AD
234852000-10-02 Akim Demaille <akim@epita.fr>
23486
23487 * lib/xstrdup.c: New file, from the fileutils.
23488 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
23489 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
23490 instead of strlen + xmalloc + strcpy.
23491 * src/symtab.c (copys): Remove, use xstrdup instead.
23492
d7020c20
AD
234932000-10-02 Akim Demaille <akim@epita.fr>
23494
23495 * src/gram.h (associativity): New enum type which replaces the
23496 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
23497 `right_assoc', `left_assoc' and `non_assoc'.
23498 Adjust all dependencies.
23499 * src/reader.c: Formatting changes.
23500 (LTYPESTR): Don't define it, use it as a literal in
23501 `reader_output_yylsp'.
23502 * src/symtab.h (symbol_class): New enum type which replaces the
23503 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
23504 `sunknown', `stoken and `snterm'.
23505
1916f98e
AD
235062000-10-02 Akim Demaille <akim@epita.fr>
23507
23508 * src/getargs.c (fixed_outfiles): Rename as...
23509 (yaccflag): for consistency and accuracy.
23510 Adjust dependencies.
23511
d7913476
AD
235122000-10-02 Akim Demaille <akim@epita.fr>
23513
23514 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
23515 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
23516 difficult and introduced a lot of core dump. It turns out that
23517 Bison used an implementation of `xmalloc' based on `calloc', and
23518 at various places it does depend upon the initialization to 0. I
23519 have not tried to isolate the pertinent places, and all the former
23520 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
23521 someone should address this issue.
23522
23523 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
23524 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
23525 files.
23526 Adjust dependencies.
23527 * src/warshall.h: New file.
23528 Propagate.
23529
340ef489
AD
235302000-10-02 Akim Demaille <akim@epita.fr>
23531
23532 Various anti-`extern in *.c' changes.
23533
23534 * src/system.h: Include `assert.h'.
23535
b2ca4022
AD
235362000-10-02 Akim Demaille <akim@epita.fr>
23537
23538 * src/state.h (nstates, final_state, first_state, first_shift)
23539 (first_reduction): Move their exportation from here...
23540 * src/LR0.h: to here.
23541 Adjust dependencies.
23542 * src/getargs.c (statisticsflag): New variable.
23543 Add support for `--statistics'.
23544 Adjust dependencies.
23545
23546 Remove a lot of now useless `extern' statements in most files.
23547
403b315b
AD
235482000-10-02 Akim Demaille <akim@epita.fr>
23549
23550 * src/LR0.h: New file.
23551 Propagate its use.
23552
07a58c13
AD
235532000-10-02 Akim Demaille <akim@epita.fr>
23554
23555 * src/print.h: New file.
23556 Propagate its use.
23557 * src/print.c: Formatting and ordering changes.
23558 (verbose, terse): Replace with...
23559 (print_results): this new function.
23560 Adjust dependencies.
23561
0619caf0
AD
235622000-10-02 Akim Demaille <akim@epita.fr>
23563
23564 * src/conflicts.c (conflict_report): New function.
23565 (conflict_log, verbose_conflict_log): Replace with...
23566 (print_conflicts): this function.
23567 Adjust dependencies.
23568 * src/conflicts.h: New file.
23569 Propagate its inclusion.
23570
3519ec76
AD
235712000-10-02 Akim Demaille <akim@epita.fr>
23572
23573 * src/nullable.h: New file.
23574 Propagate its inclusion.
23575 * src/nullable.c: Formatting changes.
23576
015acc48
AD
235772000-10-02 Akim Demaille <akim@epita.fr>
23578
23579 * src/reduce.h: New file.
23580 Propagate its inclusion.
23581 * src/reduce.c: Topological sort and other formatting changes.
23582 (bool, TRUE, FALSE): Move their definition to...
23583 * src/system.h: here.
23584
8963a27b
AD
235852000-10-02 Akim Demaille <akim@epita.fr>
23586
23587 * src/files.c: Formatting changes.
23588 (tryopen, tryclose, openfiles): Rename as...
23589 (xfopen, xfclose, open_files): this.
23590 (stringappend): static.
23591 * src/files.h: Complete the list of exported symbols.
23592 Propagate its use.
23593
a70083a3
AD
235942000-10-02 Akim Demaille <akim@epita.fr>
23595
23596 * src/reader.h: New file.
23597 Propagate its use instead of tedious list of `extern' and
23598 prototypes.
23599 * src/reader.c: Formatting changes, topological sort,
23600 s/register//.
23601
abadc117
AD
236022000-10-02 Akim Demaille <akim@epita.fr>
23603
23604 * src/lex.h: Prototype `lex.c' exported functions.
23605 * src/reader.c: Adjust.
23606 * src/lex.c: Formatting changes.
23607 (safegetc): Rename as...
23608 (xgetc): this.
23609
720d742f
AD
236102000-10-02 Akim Demaille <akim@epita.fr>
23611
23612 * src/lalr.h: New file.
23613 Propagate its inclusion instead of prototypes and `extern'.
23614 * src/lalr.c: Formatting changes, topological sorting etc.
23615
f2acea59
AD
236162000-10-02 Akim Demaille <akim@epita.fr>
23617
23618 * src/output.c (token_actions): Introduce a temporary array,
23619 YYDEFACT, that makes it possible for this function to use
23620 output_short_table.
23621
d019d655
AD
236222000-10-02 Akim Demaille <akim@epita.fr>
23623
23624 `user_toknums' is output as a `short[]' in `output.c', while it is
23625 defined as a `int[]' in `reader.c'. For consistency with the
23626 other output tables, `user_toknums' is now defined as a table of
23627 shorts.
23628
23629 * src/reader.c (user_toknums): Be a short table instead of an int
23630 table.
23631 Adjust dependencies.
23632
23633 Factor the short table outputs.
23634
23635 * src/output.c (output_short_table): New function.
23636 * src/output.c (output_gram, output_stos, output_rule_data)
23637 (output_base, output_table, output_check): Use it.
23638
6c89f1c1
AD
236392000-10-02 Akim Demaille <akim@epita.fr>
23640
23641 * src/output.c (output): Topological sort of the functions, in
23642 order to get rid of the `static' prototypes.
23643 No longer use `register'.
23644 * src/output.h: New file.
23645 Propagate its inclusion in files explicitly prototyping functions
23646 from output.c.
23647
d9efd181
AD
236482000-09-21 Akim Demaille <akim@epita.fr>
23649
23650 * src/atgeneral.m4: Update from Autoconf.
23651
c29240e7 236522000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
23653
23654 * src/closure.h: New file.
23655 * src/closure.c: Formatting changes, topological sort over the
23656 functions, use of closure.h.
23657 (initialize_closure, finalize_closure): Rename as...
23658 (new_closure, free_closure): these. Adjust dependencies.
23659 * src/LR0.c: Formatting changes, topological sort, use of
23660 cloture.h.
23661 (initialize_states): Rename as...
23662 (new_states): this.
23663 * src/Makefile.am (noinst_HEADERS): Adjust.
23664
499daa50
AD
236652000-09-20 Akim Demaille <akim@epita.fr>
23666
23667 * src/acconfig.h: Don't protect config.h against multiple
23668 inclusion.
23669 Don't define PARAMS.
23670 * src/system.h: Define PARAMS.
23671 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
23672 purpose of config.h. system.h must not try to fix wrong
23673 definitions in config.h.
23674
cc84fd5d
AD
236752000-09-20 Akim Demaille <akim@epita.fr>
23676
23677 * src/derives.h: New file.
23678 * src/main.c, src/derives.h: Use it.
23679 Formatting changes.
23680 * src/Makefile.am (noinst_HEADERS): Adjust.
23681
db5b3a89
AD
236822000-09-20 Akim Demaille <akim@epita.fr>
23683
23684 * tests/atgeneral.m4: Update from Autoconf.
23685 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
23686 (AT_CHECK_CALC): New macros.
23687 Use these macros to test bison with options `', `--raw',
23688 `--debug', `--yacc', `--yacc --debug'.
23689
ceed8467
AD
236902000-09-19 Akim Demaille <akim@epita.fr>
23691
23692 * src/output.c: Formatting changes.
23693 * src/machine.h: Remove, leaving its contents in...
23694 * src/system.h: here.
23695 Include stdio.h.
23696 Adjust all dependencies on stdio.h and machine.h.
23697 * src/getargs.h: New file.
23698 Let all `extern' declarations about getargs.c be replaced with
23699 inclusion of `getargs.h'.
23700 * src/Makefile.am (noinst_HEADERS): Adjust.
23701
23702 * tests/calc.m4 (yyin): Be initialized in main, not on the global
23703 scope.
23704 (yyerror): Returns void, not int.
23705 * doc/bison.texinfo: Formatting changes.
23706
05a1d24b
AD
237072000-09-19 Akim Demaille <akim@epita.fr>
23708
23709 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
23710 portable.
23711
cbd25751
AD
237122000-09-18 Akim Demaille <akim@epita.fr>
23713
23714 * configure.in: Append WARNING_CFLAGS to CFLAGS.
23715 * src/Makefile.am (INCLUDES): Don't.
23716 Be ready to fetch headers in lib/.
23717
13863333
AD
237182000-09-18 Akim Demaille <akim@epita.fr>
23719
23720 * doc/bison.texinfo: Update the copyright.
23721 ANSIfy and GNUify the examples.
23722 Remove the old menu.
23723
0d533154
AD
237242000-09-18 Akim Demaille <akim@epita.fr>
23725
23726 First set of tests: use the `calc' example from the documentation.
23727
23728 * src/bison.s1 (yyparse): Condition the code using `yytname' which
23729 is defined only when YYDEBUG is.
23730 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
23731 * src/files.c (tryopen, tryclose): Formatting changes.
23732 Move to the top and be static.
23733 * src/reader.c (read_signed_integer): Likewise.
23734 * tests/calc.m4: New file.
23735 * Makefile.am, suite.m4: Adjust.
23736 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
23737
e79137ac
AD
237382000-09-18 Akim Demaille <akim@epita.fr>
23739
23740 Add support for an Autotest test suite for Bison.
23741
23742 * m4/m4.m4, m4/atconfig.m4: New files.
23743 * m4/Makefile.am (EXTRA_DIST): Adjust.
23744 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
23745 files.
23746 * src/getargs.c: Display a more standard --version message.
23747 * src/reader.c (reader): Formatting changes.
23748 No longer depend upon VERSION_STRING.
23749 * configure.in: No longer use `dnl'.
23750 Set up the test suite and the new directory `tests/.
23751 (VERSION_STRING): Remove.
23752
27821bff
AD
237532000-04-14 Akim Demaille <akim@epita.fr>
23754
23755 * src/reader.c (copy_comment2): New function, same as former
23756 `copy_comment', but outputs into two FILE *.
23757 (copy_comment): Use it.
23758 (parse_union_decl): Use it.
23759 (get_type, parse_start_decl): Use the same `invalid' message.
23760 (parse_start_decl, parse_union_decl): Use the same `multiple'
23761 message.
23762 (parse_union_decl, copy_guard, copy_action): Use the same
23763 `unmatched' message.
23764 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
23765
cfe5fbc0
AD
237662000-03-31 Akim Demaille <akim@epita.fr>
23767
23768 * src/files.c (tryopen, tryclose): Move to the top.
23769 Be static.
23770
cb7db13e
AD
237712000-03-31 Akim Demaille <akim@epita.fr>
23772
23773 * src/main.c (main): Don't call `done', exit does it.
23774
a0f6b076
AD
237752000-03-31 Akim Demaille <akim@epita.fr>
23776
36281465
AD
23777 * allocate.c: s/return (foo)/return foo/.
23778 * lalr.c: Likewise.
23779 * LR0.c: Likewise.
23780 * output.c: Likewise.
23781 * reader.c: Likewise.
23782 * symtab.c: Likewise.
23783 * vmsgetargs.c: Likewise.
23784
237852000-03-31 Akim Demaille <akim@epita.fr>
23786
23787 Clean up the error reporting functions.
a0f6b076
AD
23788
23789 * src/report.c: New file.
23790 * src/report.h: Likewise.
23791 * src/Makefile.am: Adjust.
23792 * m4/error.m4: New file.
23793 * m4/Makefile.am: Adjust.
23794 * configure.in (jm_PREREQ_ERROR): Call it.
23795 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
23796 Remove.
23797 (fatal, fatals): Remove. All callers use complain.c::fatal.
23798 (warn, warni, warns, warnss, warnss): Remove. All callers use
23799 complain.c::complain.
23800 (toomany): Remove, use fatal instead.
23801 * src/files.c (done): No argument, use complain_message_count.
23802 * src/main.c (main): Register `done' to `atexit'.
23803
23804 * src/getargs.c (usage): More `fputs', less `fprintf'.
23805
18539825
AD
238062000-03-28 Akim Demaille <akim@epita.fr>
23807
23808 * lib/: New directory.
23809 * Makefile.am (SUBDIRS): Adjust.
23810 * configure.in: Adjust.
23811 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
23812 useless.
23813 * src/alloca.c: Moved to lib/.
23814 * src/getopt.c: Likewise.
23815 * src/getopt1.c: Likewise.
23816 * src/getopt.h: Likewise.
23817 * src/ansi2knr.c: Likewise.
23818 * src/ansi2knr.1: Likewise.
23819 * src/Makefile.am: Adjust.
23820 * lib/Makefile.am: New file.
23821
9f306f2a
AD
238222000-03-28 Akim Demaille <akim@epita.fr>
23823
23824 * src/getargs.c (usage): Refresh the help message.
23825
0ba347b6
AD
238262000-03-17 Akim Demaille <akim@epita.fr>
23827
23828 * src/getopt1.c: Updated from textutils 2.0e
23829 * src/getopt.c: Likewise.
23830 * src/getopt.h: Likewise.
23831
dbe7f271
AD
238322000-03-17 Akim Demaille <akim@epita.fr>
23833
23834 * src/Makefile.am (bison.simple): Fix the awk program: quote only
23835 the file name, not the whole `#line LINE FILE'.
23836
75bbe78d
AD
238372000-03-17 Akim Demaille <akim@epita.fr>
23838
23839 On syntax errors, report the token on which we choked.
23840
aa5fd0ee
AD
23841 * src/bison.s1 (yyparse): In the label yyerrlab, when
23842 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 23843
7b306f52
AD
238442000-03-17 Akim Demaille <akim@epita.fr>
23845
aa5fd0ee 23846 * src/reader.c (copy_at): New function.
7b306f52
AD
23847 (copy_guard): Use it.
23848 (copy_action): Use it.
23849
e87b5700
AD
238502000-03-17 Akim Demaille <akim@epita.fr>
23851
23852 Be kind to translators, save some useless translations.
23853
aa5fd0ee 23854 * src/main.c (banner): New function.
e87b5700
AD
23855 (fatal_banner): Use it.
23856 (warn_banner): Use it.
23857
ae3c3164
AD
238582000-03-17 Akim Demaille <akim@epita.fr>
23859
aa5fd0ee
AD
23860 * src/reader.c (copy_definition): Use copy_string and
23861 copy_comment. Removed now unused `match', `ended',
23862 `cplus_comment'.
ae3c3164
AD
23863 (copy_comment, copy_string): Moved, to be visible from
23864 copy_definition.
23865
4dc58e7c
AD
238662000-03-17 Akim Demaille <akim@epita.fr>
23867
aa5fd0ee
AD
23868 * src/reader.c (copy_string): Declare `static inline'. No
23869 problems with inline, since it is checked by configure.
4dc58e7c
AD
23870 (copy_comment): Likewise.
23871
0a6384c4
AD
238722000-03-17 Akim Demaille <akim@epita.fr>
23873
aa5fd0ee 23874 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 23875
3cef001a
AD
238762000-03-17 Akim Demaille <akim@epita.fr>
23877
aa5fd0ee 23878 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
23879 (copy_action): Use it. Removed now unused `match', `ended',
23880 `cplus_comment'.
23881 (copy_guard): Likewise.
23882
ca36d2ef
AD
238832000-03-17 Akim Demaille <akim@epita.fr>
23884
aa5fd0ee 23885 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
23886 (copy_action): Use it.
23887 (copy_guard): Likewise.
23888
6666f98f
AD
238892000-03-17 Akim Demaille <akim@epita.fr>
23890
23891 Change the handling of @s so that they behave exactly like $s.
23892 There is now a pseudo variable @$ (readble and writable), location
23893 of the lhs of the rule (by default ranging from the location of
23894 the first symbol of the rhs, to the location of the last symbol,
23895 or, if the rhs is empty, YYLLOC).
23896
23897 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
23898 yyval.
23899 (yyparse): When providing a default semantic action, provide a
23900 default location action.
23901 (after the $): No longer change `*YYLSP', just stack YYLOC the
23902 same way you stack YYVAL.
23903 * src/reader.c (read_declarations): Use warns.
23904 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
23905 (copy_action, case '@'): Likewise.
23906 Use a standard error message, to save useless work from
23907 translators.
23908
41aca2e0
AD
239092000-03-17 Akim Demaille <akim@epita.fr>
23910
aa5fd0ee
AD
23911 * src/bison.s1: Formatting and cosmetics changes.
23912 * src/reader.c: Likewise.
41aca2e0
AD
23913 Update the Copyright notice.
23914
dc08c1d5
AD
239152000-03-17 Akim Demaille <akim@epita.fr>
23916
aa5fd0ee
AD
23917 * src/bison.s1 (#line): All set to `#line' only, since the
23918 Makefile now handles them.
dc08c1d5 23919
9ee3c97b
AD
239202000-03-16 Akim Demaille <akim@epita.fr>
23921
23922 * src/output.c (output_rule_data): Output the documentation of
23923 some of the tables.
23924 (Copyright notice): Update.
23925 Formatting changes.
23926
0de741ca
AD
239272000-03-16 Akim Demaille <akim@epita.fr>
23928
23929 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
23930 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
23931 One `#if YYDEBUG' remains, since it uses variables which are
23932 defined only if `YYDEBUG != 0'.
23933
bb10be54
AD
239342000-03-16 Akim Demaille <akim@epita.fr>
23935
23936 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
23937 and related variables so that the similarities are highlighted.
23938
b07b484a
AD
239392000-03-16 Akim Demaille <akim@epita.fr>
23940
23941 * src/bison.s1: Properly indent CPP directives.
23942
361f60b3
AD
239432000-03-16 Akim Demaille <akim@epita.fr>
23944
23945 * src/bison.s1: Properly indent the `alloca' CPP section.
23946
8c44d3ec
AD
239472000-03-16 Akim Demaille <akim@epita.fr>
23948
23949 Do not hard code values of directories in `configure.in'.
23950 Update the `configure' tool chain.
23951
23952 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
23953 src/makefile.am.
23954 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
23955 (AC_OUTPUT): Add m4/Makefile.
23956 Bump to bison 1.28a, 1.29 has never been released.
23957 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
23958 handled via src/Makefile.am.
23959 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
23960 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
23961 autoheader.
23962 * Makefile.am (SUBDIRS): Add m4.
23963 (ACLOCAL_AM_FLAGS): New variable.
23964 (AUTOMAKE_OPTIONS): Add check-news.
23965 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
23966 the proper line number and file name.
23967 (DEFS): Propagate the location of bison library files and of the
23968 locale files.
23969 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
23970 builddir.
23971 * acinclude.m4: Remove, replaced by the directory m4.
23972 * m4/Makefile.am (EXTRA_DIST): New variable.
23973 * m4/gettext.m4: New file, from the fileutils.
23974 * m4/lcmessage.m4: Likewise
23975 * m4/progtest.m4: Likewise.
23976 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
23977
f95997e7
AD
239782000-03-10 Akim Demaille <akim@epita.fr>
23979
23980 * src/closure.c:
23981 Formatting changes of various comments.
23982 Respect the GNU coding standards at various places.
23983 Don't use `_()' when no translation is needed.
23984
239851999-12-13 Jesse Thilo <jthilo@gnu.org>
23986
23987 * src/files.c:
23988 OS/2 honors TMPDIR environment variable.
23989
239901999-12-13 Jesse Thilo <jthilo@gnu.org>
23991
23992 * doc/bison.texinfo: Tweaked spelling and grammar.
23993 Updated ISBN.
23994 Removed reference to price of printed copy.
23995 Mention BISON_SIMPLE and BISON_HAIRY.
23996
239971999-12-13 Jesse Thilo <jthilo@gnu.org>
23998
23999 * configure.in, NEWS:
24000 Bison 1.29 released.
24001
240021999-10-27 Jesse Thilo <jthilo@gnu.org>
24003
24004 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
24005 Added reference card.
24006
240071999-07-26 Jesse Thilo <jthilo@gnu.org>
24008
24009 * po/ru.po: Added Russian translation.
24010
240111999-07-26 Jesse Thilo <jthilo@gnu.org>
24012
24013 * configure.in: Added Russian translation.
24014
240151999-07-06 Jesse Thilo <jthilo@gnu.org>
24016
24017 * configure.in, NEWS, README:
24018 Released version 1.28.
24019
240201999-06-14 Jesse Thilo <jthilo@gnu.org>
24021
24022 * src/system.h:
24023 Squashed redefinition warning on some systems.
24024
24025 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
24026 Have configure build version string instead of relying on ANSI string
24027 concatentation.
24028
240291999-06-14 Jesse Thilo <jthilo@gnu.org>
24030
24031 * po/POTFILES.in: Got rid of version.c.
24032
240331999-06-14 Jesse Thilo <jthilo@gnu.org>
24034
24035 * acconfig.h, configure.in:
24036 Have configure build version string instead of relying on ANSI string
24037 concatentation.
24038
240391999-06-08 Jesse Thilo <jthilo@gnu.org>
24040
24041 * doc/bison.1:
24042 Dropped mention of `+' for long-named options.
24043
240441999-05-30 Jesse Thilo <jthilo@gnu.org>
24045
24046 * src/files.c: Added <unistd.h> for unlink().
24047
24048 * src/Makefile.am, src/system.h:
24049 I18n fixes.
24050
240511999-05-30 Jesse Thilo <jthilo@gnu.org>
24052
24053 * README: Added a FAQ list.
24054
24055 * configure.in, acconfig.h:
24056 I18n fixes.
24057
240581999-05-30 Jesse Thilo <jthilo@gnu.org>
24059
24060 * doc/FAQ, doc/Makefile.am:
24061 Added a FAQ list.
24062
240631999-05-19 Jesse Thilo <jthilo@gnu.org>
24064
24065 * src/alloc.h, src/symtab.h, src/version.c:
24066 Protected inclusion of "config.h" with HAVE_CONFIG_H.
24067
240681999-04-18 Jesse Thilo <jthilo@gnu.org>
24069
24070 * src/.cvsignore, src/Makefile.am:
24071 Reorganized: sources in `src', documentation in `doc'.
24072
24073 * src/lex.c (literalchar):
24074 fixed the code for escaping double quotes (thanks
24075 Jonathan Czisny.)
24076
240771999-04-18 Jesse Thilo <jthilo@gnu.org>
24078
24079 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
24080 Adjusted paths to reflect directory reorganization.
24081
240821999-04-18 Jesse Thilo <jthilo@gnu.org>
24083
24084 * doc/.cvsignore, doc/Makefile.am:
24085 Reorganized: sources in `src', documentation in `doc'.
24086
240871999-04-18 Jesse Thilo <jthilo@gnu.org>
24088
24089 * configure.in:
24090 Updated AC_INIT file to reflect directory reorganization.
24091
24092 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
24093 Reorganized: sources in `src', documentation in `doc'.
24094
240951999-04-13 Jesse Thilo <jthilo@gnu.org>
24096
24097 * src/allocate.c:
24098 Don't declare calloc() and realloc() if not necessary.
24099
241001999-04-13 Jesse Thilo <jthilo@gnu.org>
24101
24102 * configure.in, acconfig.h, acinclude.m4:
24103 Don't declare calloc() and realloc() if not necessary.
24104
241051999-03-23 Jesse Thilo <jthilo@gnu.org>
24106
24107 * po/.cvsignore: Added i18n support.
24108
241091999-03-23 Jesse Thilo <jthilo@gnu.org>
24110
24111 * acconfig.h, configure.in, Makefile.am:
24112 Added i18n support.
24113
241141999-03-22 Jesse Thilo <jthilo@gnu.org>
24115
24116 * src/bison.s1: Fixed #line numbers.
24117
241181999-03-15 Jesse Thilo <jthilo@gnu.org>
24119
24120 * po/es.po, po/fr.po, po/nl.po, po/de.po:
24121 Added PO files from Translation Project.
24122
241231999-03-03 Jesse Thilo <jthilo@gnu.org>
24124
24125 * Makefile.am:
24126 Added support for non-ANSI compilers (ansi2knr).
24127
241281999-02-16 Jesse Thilo <jthilo@gnu.org>
24129
24130 * configure.in: Bumped version number to 1.27.
24131
24132 * Makefile.am:
24133 Added `bison.simple' to list of files removed by `make distclean'.
24134
241351999-02-12 Jesse Thilo <jthilo@gnu.org>
24136
24137 * src/files.c, src/files.h:
24138 Defined locations of parser files in config.h instead of Makefile.
24139
241401999-02-12 Jesse Thilo <jthilo@gnu.org>
24141
24142 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
24143 Defined locations of parser files in config.h instead of Makefile.
24144
241451999-02-09 Jesse Thilo <jthilo@gnu.org>
24146
24147 * Makefile.am:
24148 Removed inappropriate use of $< macro.
24149
241501999-02-05 Jesse Thilo <jthilo@gnu.org>
24151
24152 * po/Makefile.in.in, po/POTFILES.in:
24153 Add `po' directory skeleton.
24154
241551999-01-27 Jesse Thilo <jthilo@gnu.org>
24156
24157 * README: Document help-bison list.
24158
24159 * configure.in: Add check for mkstemp().
24160
241611999-01-20 Jesse Thilo <jthilo@gnu.org>
24162
24163 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
24164 Hush a few compiler warnings.
24165
24166 * src/files.c:
24167 Add tryclose(), which verifies that fclose was successful.
24168 Hush a couple of compiler warnings.
24169
241701999-01-20 Jesse Thilo <jthilo@gnu.org>
24171
24172 * Makefile.am, OChangeLog:
24173 ChangeLog is now automatically generated. Include the old version as
24174 OChangeLog.
24175
241761999-01-14 Jesse Thilo <jthilo@gnu.org>
24177
24178 * 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:
24179 Update FSF address.
24180
241811999-01-14 Jesse Thilo <jthilo@gnu.org>
24182
24183 * doc/bison.texinfo: Fix formatting glitch.
24184
24185 * doc/bison.texinfo: Update FSF address.
24186
241871999-01-14 Jesse Thilo <jthilo@gnu.org>
24188
24189 * acconfig.h: Update FSF address.
24190
241911999-01-08 Jesse Thilo <jthilo@gnu.org>
24192
24193 * src/system.h:
24194 Don't define PACKAGE here, since config.h defines it.
24195
241961998-12-30 Jesse Thilo <jthilo@gnu.org>
24197
24198 * src/reader.c: Update copyright date.
24199
24200 * src/main.c:
24201 Ditch sprintf to statically-sized buffers in fatal/warn functions in
24202 favor of output directly to stderr (avoids buffer overruns).
24203
24204 * src/reader.c: Some checks for premature EOF.
24205
24206 * 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:
24207 Use prototypes if the compiler understands them.
24208
24209 * src/files.c: Honor TMPDIR on Unix hosts.
24210 Use prototypes if the compiler understands them.
24211
24212 * src/reader.c:
24213 Fix a couple of buffer overrun bugs.
24214 Use prototypes if the compiler understands them.
24215
24216 * src/system.h: Include unistd.h and ctype.h.
24217 Use #ifdef instead of #if for NLS symbols.
24218
242191998-12-30 Jesse Thilo <jthilo@gnu.org>
24220
24221 * doc/bison.texinfo:
24222 Delete comment "consider using @set for edition number, etc..." since
24223 we now are doing so.
24224
242251998-12-30 Jesse Thilo <jthilo@gnu.org>
24226
24227 * configure.in:
24228 Use prototypes if the compiler understands them.
24229
24230 * NEWS: Document 1.26 highlights.
24231
24232 * Makefile.am: Require Automake 1.3 or later.
24233
24234 * acconfig.h:
24235 Use prototypes if the compiler understands them.
24236
242371998-12-29 Jesse Thilo <jthilo@gnu.org>
24238
24239 * src/version.c:
24240 Use VERSION symbol from automake for version number.
24241
242421998-12-29 Jesse Thilo <jthilo@gnu.org>
24243
24244 * acconfig.h, configure.in, version.cin:
24245 Use VERSION symbol from automake for version number.
24246
242471998-11-28 Jesse Thilo <jthilo@gnu.org>
24248
24249 * Makefile.am:
24250 Distribute original version of simple parser (bison.s1), not built
24251 version (bison.simple).
24252
242531998-11-28 Jesse Thilo <jthilo@gnu.org>
24254
24255 * doc/bison.texinfo: Add info dir entry.
24256
24257 * doc/bison.texinfo:
24258 Let automake put version number into documentation.
24259
242601998-11-26 Jesse Thilo <jthilo@gnu.org>
24261
24262 * src/bison.cld, src/build.com, src/vmshlp.mar:
24263 Add non-RCS files from /gd/gnu/bison.
24264
242651998-11-26 Jesse Thilo <jthilo@gnu.org>
24266
24267 * doc/bison.1:
24268 Document the BISON_HAIRY and BISON_SIMPLE variables.
24269
242701998-11-25 Jesse Thilo <jthilo@gnu.org>
24271
24272 * src/version.c: Build version.c automatically.
24273
24274 * src/reader.c:
24275 Fix token numbering (used to start at 258, not 257).
24276
24277 * src/system.h: Include config.h.
24278
24279 * src/getargs.c: Update bug report address.
24280
24281 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
24282 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
24283
242841998-11-25 Jesse Thilo <jthilo@gnu.org>
24285
24286 * Makefile.am:
24287 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24288
24289 * configure.in, version.cin:
24290 Build version.c automatically.
24291
24292 * AUTHORS: Add AUTHORS file.
24293
24294 * README: Update bug report address.
24295
24296 * bison.simple:
24297 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24298
24299 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
24300 Add automake stuff.
24301
243021998-11-25 Jesse Thilo <jthilo@gnu.org>
24303
24304 * doc/bison.texinfo: Clean up some formatting.
24305
243061998-05-05 Richard Stallman <rms@gnu.org>
24307
24308 * doc/bison.texinfo:
24309 Explain better why to make a pure parser.
24310
243111998-01-05 Richard Stallman <rms@gnu.org>
24312
24313 * src/files.c (openfiles):
24314 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
24315 find a temporary directory, if possible. Do not unlink files while
24316 they are open.
24317
243181997-08-25 Richard Stallman <rms@gnu.org>
24319
24320 * src/reader.c (stack_offset;):
24321 Change some warni to warns.
24322
24323 * src/lex.c (literalchar): Use warns, not warni.
24324
243251997-06-28 Richard Stallman <rms@gnu.org>
24326
24327 * src/bison.s1: Add a Bison version comment.
24328
24329 * src/main.c (fatal, warn, berror):
24330 Use program_name.
24331
243321997-06-28 Richard Stallman <rms@gnu.org>
24333
24334 * Makefile.in (bison_version): New variable.
24335 (dist): Use that variable.
24336 (bison.s1): Substitute the Bison version into bison.simple.
24337
24338 * bison.simple: Add a Bison version comment.
24339
243401997-06-18 Richard Stallman <rms@gnu.org>
24341
24342 * src/main.c (fatal, warn, berror):
24343 Make error messages standard.
24344 (toomany): Improve error message text.
24345
24346 * 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:
24347 new.h renamed to alloc.h.
24348
243491997-06-18 Richard Stallman <rms@gnu.org>
24350
24351 * Makefile.in: new.h renamed to alloc.h.
24352
243531997-05-24 Richard Stallman <rms@gnu.org>
24354
24355 * src/lex.c (literalchar):
24356 Fix the code for escaping \, " and '.
24357
24358 (lex): Avoid trouble when there are many chars
24359 to discard in a char literal with just several chars in it.
24360
243611997-05-17 Richard Stallman <rms@gnu.org>
24362
24363 * src/bison.s1:
24364 Use malloc, if using alloca is troublesome.
24365 (YYSTACK_USE_ALLOCA): New flag macro.
24366 Define it for some systems and compilers.
24367 (YYSTACK_ALLOC): New macro.
24368 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24369 If it was malloc'd, free it.
24370
243711997-05-17 Richard Stallman <rms@gnu.org>
24372
24373 * bison.simple:
24374 Use malloc, if using alloca is troublesome.
24375 (YYSTACK_USE_ALLOCA): New flag macro.
24376 Define it for some systems and compilers.
24377 (YYSTACK_ALLOC): New macro.
24378 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24379 If it was malloc'd, free it.
24380
243811997-04-23 Richard Stallman <rms@gnu.org>
24382
24383 * src/bison.s1:
24384 (alloca) [__hpux]: Always define as __builtin_alloca.
24385
243861997-04-23 Richard Stallman <rms@gnu.org>
24387
24388 * bison.simple:
24389 (alloca) [__hpux]: Always define as __builtin_alloca.
24390
243911997-04-22 Richard Stallman <rms@gnu.org>
24392
24393 * src/bison.s1:
24394 [__hpux]: Include alloca.h (right for HPUX 10)
24395 instead of declaring alloca (right for HPUX 9).
24396
24397 * src/bison.s1 (__yy_memcpy):
24398 Declare arg `count' as unsigned int.
24399 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24400
244011997-04-22 Richard Stallman <rms@gnu.org>
24402
24403 * bison.simple:
24404 [__hpux]: Include alloca.h (right for HPUX 10)
24405 instead of declaring alloca (right for HPUX 9).
24406
24407 * bison.simple (__yy_memcpy):
24408 Declare arg `count' as unsigned int.
24409 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24410
244111997-01-03 Richard Stallman <rms@gnu.org>
24412
24413 * src/allocate.c: [__STDC__ or _MSC_VER]:
24414 Declare calloc and realloc to return void *.
24415
244161997-01-02 Richard Stallman <rms@gnu.org>
24417
24418 * src/system.h:
24419 [_MSC_VER]: Include stdlib.h and process.h.
24420 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
24421
24422 * src/main.c (main): Return FAILURE as a value.
24423 (printable_version): Declare arg as int, not char.
24424
244251997-01-02 Richard Stallman <rms@gnu.org>
24426
24427 * Makefile.in (dist):
24428 Explicitly check for symlinks, and copy them.
24429
244301996-12-19 Richard Stallman <rms@gnu.org>
24431
24432 * src/files.c:
24433 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
24434
244351996-12-18 Paul Eggert <eggert@gnu.org>
24436
24437 * src/bison.s1 (yyparse):
24438 If __GNUC__ and YYPARSE_PARAM are both defined,
24439 declare yyparse to have a void * argument.
24440
244411996-12-18 Paul Eggert <eggert@gnu.org>
24442
24443 * bison.simple (yyparse):
24444 If __GNUC__ and YYPARSE_PARAM are both defined,
24445 declare yyparse to have a void * argument.
24446
244471996-12-17 Richard Stallman <rms@gnu.org>
24448
24449 * src/reduce.c (nbits): Add some casts.
24450
244511996-08-12 Richard Stallman <rms@gnu.org>
24452
24453 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
24454
244551996-08-12 Richard Stallman <rms@gnu.org>
24456
24457 * bison.simple: Test _MSDOS as well as _MSDOS_.
24458
244591996-07-31 Richard Stallman <rms@gnu.org>
24460
24461 * src/bison.s1:
24462 [__sun && __i386]: Include alloca.h.
24463
244641996-07-31 Richard Stallman <rms@gnu.org>
24465
24466 * bison.simple:
24467 [__sun && __i386]: Include alloca.h.
24468
244691996-07-30 Richard Stallman <rms@gnu.org>
24470
24471 * src/bison.s1: Comment change.
24472
24473 * src/bison.s1: Test _MSDOS_, not MSDOS.
24474
244751996-07-30 Richard Stallman <rms@gnu.org>
24476
24477 * bison.simple: Comment change.
24478
24479 * bison.simple: Test _MSDOS_, not MSDOS.
24480
244811996-06-01 Richard Stallman <rms@gnu.org>
24482
24483 * 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:
24484 Insert `_' macro around many string constants.
24485
24486 * src/main.c:
24487 Insert `_' macro around many string constants.
24488
24489 (main): Call setlocale, bindtextdomain and textdomain.
24490
24491 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
24492 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
24493 [ENABLE_NLS]: Include libintl.h.
24494 [ENABLE_NLS] (gettext): Define.
24495 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
24496 (N_, PACKAGE, LOCALEDIR): New macros.
24497
244981996-06-01 Richard Stallman <rms@gnu.org>
24499
24500 * POTFILES.in: New file.
24501
24502 * Makefile.in (allocate.o):
24503 Define target explicitly.
24504
24505 * Makefile.in (CFLAGS): Set to @CFLAGS@.
24506 (LDFLAGS): Set to @LDFLAGS@.
24507 (configure): Run autoconf only if preceding `cd' succeeds.
24508 (bison.s1): Redirect output to temporary file then move the
24509 temporary to the target, rather than redirecting directly to bison.s1.
24510 (clean): Remove config.status and config.log.
24511 (distclean): Don't remove config.status here.
24512
245131996-05-12 Richard Stallman <rms@gnu.org>
24514
24515 * src/bison.s1:
24516 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24517
245181996-05-12 Richard Stallman <rms@gnu.org>
24519
24520 * bison.simple:
24521 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24522
245231996-05-11 Richard Stallman <rms@gnu.org>
24524
24525 * src/bison.s1 (__yy_memcpy):
24526 Really reorder the args, as was supposedly done on Feb 14 1995.
24527 (yyparse): Calls changed accordingly.
24528
245291996-05-11 Richard Stallman <rms@gnu.org>
24530
24531 * Makefile.in (dist): Don't use $(srcdir).
24532
24533 * bison.simple (__yy_memcpy):
24534 Really reorder the args, as was supposedly done on Feb 14 1995.
24535 (yyparse): Calls changed accordingly.
24536
245371996-01-27 Richard Stallman <rms@gnu.org>
24538
24539 * src/output.c (output_rule_data):
24540 Test YYERROR_VERBOSE in the conditional
24541 around the definition of ttyname.
24542
245431995-12-29 Richard Stallman <rms@gnu.org>
24544
24545 * src/bison.s1:
24546 Fix line numbers in #line commands.
24547
245481995-12-29 Richard Stallman <rms@gnu.org>
24549
24550 * bison.simple:
24551 Fix line numbers in #line commands.
24552
245531995-12-27 Richard Stallman <rms@gnu.org>
24554
24555 * src/bison.s1 (YYPARSE_PARAM_DECL):
24556 In C++, make it always null.
24557 (YYPARSE_PARAM_ARG): New macro.
24558 (yyparse): Use YYPARSE_PARAM_ARG.
24559
245601995-12-27 Richard Stallman <rms@gnu.org>
24561
24562 * bison.simple (YYPARSE_PARAM_DECL):
24563 In C++, make it always null.
24564 (YYPARSE_PARAM_ARG): New macro.
24565 (yyparse): Use YYPARSE_PARAM_ARG.
24566
245671995-11-29 Richard Stallman <rms@gnu.org>
24568
24569 * doc/bison.texinfo:
24570 Describe literal string tokens, %raw, %no_lines, %token_table.
24571
245721995-11-29 Daniel Hagerty <hag@gnu.org>
24573
24574 * doc/bison.texinfo: Fixed update date
24575
245761995-10-16 Richard Stallman <rms@gnu.org>
24577
24578 * src/version.c: Version 1.25.
24579
245801995-10-16 Richard Stallman <rms@gnu.org>
24581
24582 * NEWS: *** empty log message ***
24583
245841995-10-16 Richard Stallman <rms@gnu.org>
24585
24586 * doc/bison.1, doc/bison.rnh:
24587 Add new options.
24588
245891995-10-15 Richard Stallman <rms@gnu.org>
24590
24591 * src/vmsgetargs.c, src/getargs.c:
24592 Added -n, -k, and -raw switches.
24593 (noparserflag, toknumflag, rawtoknumflag): New variables.
24594
24595 * src/symtab.h (SALIAS):
24596 New #define for adding aliases to %token.
24597 (struct bucket): Added `alias' field.
24598
24599 * src/reduce.c (reduce_grammar):
24600 Revise error message.
24601 (print_notices): Remove final `.' from error message.
24602
24603 * src/reader.c (reader_output_yylsp):
24604 New function.
24605 (readgram): Use `#if 0' around code that accepted %command
24606 inside grammar rules: The documentation doesn't allow it,
24607 and it will fail since the %command processors scan for the next %.
24608 (parse_token_decl): Extended the %token
24609 declaration to allow a multi-character symbol as an alias.
24610 (parse_thong_decl): New function.
24611 (read_declarations): Added %thong declarations.
24612 (read_declarations): Handle NOOP to deal with allowing
24613 % declarations as another means to specify the flags.
24614 (readgram): Allow %prec prior to semantics embedded in a rule.
24615 (skip_to_char, read_declarations, copy_definition)
24616 (parse_token_decl, parse_start_decl, parse_type_decl)
24617 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
24618 (get_type_name, copy_guard, copy_action, readgram)
24619 (get_type, packsymbols): Revised most error messages.
24620 Changed `fatal' to `warnxxx' to avoid aborting for error.
24621 Revised and use multiple warnxxx functions to avoid using VARARGS1.
24622 (read_declarations): Improve the error message for
24623 an invalid character. Do not abort.
24624 (read_declarations, copy_guard, copy_action): Use
24625 printable_version to avoid unprintable characters in printed output.
24626 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
24627 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
24628 Allow the type of a non-terminal can be given
24629 more than once, as long as all specifications give the same type.
24630
24631 * src/output.c:
24632 (output_headers, output_trailers, output, output_gram)
24633 (output_rule_data): Implement noparserflag variable.
24634 Implement toknumflag variable.
24635 (output): Call reader_output_yylsp to output LTYPESTR.
24636
24637 * src/main.c (main):
24638 If reader sees an error, don't process the grammar.
24639 (fatals): Updated to not use VARARGS1.
24640 (printable_version, int_to_string, warn, warni, warns, warnss)
24641 (warnsss): New error reporting functions. Avoid abort for error.
24642
24643 * src/lex.h:
24644 Added THONG and NOOP for alias processing.
24645 Added SETOPT for the new code that allows setting options with %flags.
24646
24647 * src/lex.c:
24648 Include getopt.h. Add some extern decls.
24649 (safegetc): New function to deal with EOF gracefully.
24650 (literalchar); new function to deal with reading \ escapes.
24651 (lex): Use literalchar.
24652 (lex): Implemented "..." tokens.
24653 (literalchar, lex, parse_percent_token): Made tokenbuffer
24654 always contain the token. This includes growing the token
24655 buffer while reading an integer.
24656 (parse_percent_token): Replaced if-else statement with percent_table.
24657 (parse_percent_token): Added % declarations as another
24658 way to specify the flags -n, -l, and -r. Also added hooks for
24659 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
24660 major changes to files.c.
24661 (lex) Retain in the incoming stream a character following
24662 an incorrect '/'.
24663 (skip_white_space, lex): Revised most error messages
24664 and changed fatal to warn to avoid aborting.
24665 (percent_table): Added %thong declarations.
24666
24667 * src/gram.h: Comment changes.
24668
24669 * src/files.c (openfiles, open_extra_files, done):
24670 Add faction flag
24671 and actfile file. Handle noparserflag. Both for -n switch.
24672
24673 * src/conflicts.c (resolve_sr_conflict):
24674 Remove use of alloca.
24675
246761995-06-01 Jim Meyering <meyering@gnu.org>
24677
24678 * doc/bison.texinfo: *** empty log message ***
24679
246801995-05-06 Richard Stallman <rms@gnu.org>
24681
24682 * src/bison.s1: Comment change.
24683
246841995-05-06 Richard Stallman <rms@gnu.org>
24685
24686 * bison.simple: Comment change.
24687
246881995-05-03 Richard Stallman <rms@gnu.org>
24689
24690 * src/version.c: Version now 1.24.
24691
24692 * src/bison.s1: Change distribution terms.
24693
24694 * src/version.c: Version now 1.23.
24695
246961995-05-03 Richard Stallman <rms@gnu.org>
24697
24698 * doc/bison.texinfo:
24699 Rewrite "Conditions for Using Bison".
24700 Update version to 1.24.
24701
247021995-05-03 Richard Stallman <rms@gnu.org>
24703
24704 * bison.simple: Change distribution terms.
24705
247061995-02-23 Richard Stallman <rms@gnu.org>
24707
24708 * src/files.c: Test __VMS_POSIX as well as VMS.
24709
247101995-02-14 Jim Meyering <meyering@gnu.org>
24711
24712 * src/bison.s1 (__yy_memcpy):
24713 Renamed from __yy_bcopy to avoid
24714 confusion. Reverse FROM and TO arguments to be consistent with
24715 those of memcpy.
24716
247171995-02-14 Jim Meyering <meyering@gnu.org>
24718
24719 * bison.simple (__yy_memcpy):
24720 Renamed from __yy_bcopy to avoid
24721 confusion. Reverse FROM and TO arguments to be consistent with
24722 those of memcpy.
24723
247241994-11-10 David J. MacKenzie <djm@gnu.org>
24725
24726 * NEWS: reformat
24727
24728 * NEWS: New file.
24729
24730 * Makefile.in (DISTFILES): Include NEWS.
24731
24732 * Makefile.in (DISTFILES):
24733 Include install-sh, not install.sh.
24734
24735 * configure.in: Update to Autoconf v2 macro names.
24736
247371994-10-05 David J. MacKenzie <djm@gnu.org>
24738
24739 * Makefile.in: fix typo
24740
24741 * Makefile.in (prefix, exec_prefix):
24742 Let configure set them.
24743
247441994-09-28 David J. MacKenzie <djm@gnu.org>
24745
24746 * Makefile.in: Set datadir to $(prefix)/share.
24747
247481994-09-15 Richard Stallman <rms@gnu.org>
24749
24750 * src/bison.s1:
24751 Update copyright notice and GPL version.
24752
247531994-09-15 Richard Stallman <rms@gnu.org>
24754
24755 * bison.simple:
24756 Update copyright notice and GPL version.
24757
247581994-07-12 Richard Stallman <rms@gnu.org>
24759
24760 * src/reduce.c, src/reader.c:
24761 entered into RCS
24762
247631994-05-05 David J. MacKenzie <djm@gnu.org>
24764
24765 * Makefile.in: entered into RCS
24766
247671994-03-26 Richard Stallman <rms@gnu.org>
24768
24769 * src/bison.s1: entered into RCS
24770
247711994-03-26 Richard Stallman <rms@gnu.org>
24772
24773 * bison.simple: entered into RCS
24774
247751994-03-25 Richard Stallman <rms@gnu.org>
24776
24777 * src/main.c: entered into RCS
24778
247791994-03-24 Richard Stallman <rms@gnu.org>
24780
24781 * src/conflicts.c: entered into RCS
24782
247831994-01-02 Richard Stallman <rms@gnu.org>
24784
24785 * Makefile.in: *** empty log message ***
24786
247871993-11-21 Richard Stallman <rms@gnu.org>
24788
24789 * src/bison.s1: *** empty log message ***
24790
247911993-11-21 Richard Stallman <rms@gnu.org>
24792
24793 * doc/bison.texinfo: entered into RCS
24794
24795 * doc/bison.texinfo: *** empty log message ***
24796
247971993-11-21 Richard Stallman <rms@gnu.org>
24798
24799 * bison.simple: *** empty log message ***
24800
248011993-10-25 David J. MacKenzie <djm@gnu.org>
24802
24803 * doc/bison.texinfo: *** empty log message ***
24804
248051993-10-19 Richard Stallman <rms@gnu.org>
24806
24807 * src/bison.s1: *** empty log message ***
24808
248091993-10-19 Richard Stallman <rms@gnu.org>
24810
24811 * bison.simple: *** empty log message ***
24812
248131993-10-14 Richard Stallman <rms@gnu.org>
24814
24815 * src/bison.s1: *** empty log message ***
24816
248171993-10-14 Richard Stallman <rms@gnu.org>
24818
24819 * bison.simple: *** empty log message ***
24820
248211993-09-14 David J. MacKenzie <djm@gnu.org>
24822
24823 * doc/bison.texinfo: *** empty log message ***
24824
248251993-09-13 Noah Friedman <friedman@gnu.org>
24826
24827 * Makefile.in: *** empty log message ***
24828
248291993-09-10 Richard Stallman <rms@gnu.org>
24830
24831 * src/conflicts.c: *** empty log message ***
24832
24833 * src/system.h: entered into RCS
24834
248351993-09-10 Richard Stallman <rms@gnu.org>
24836
24837 * doc/bison.1: entered into RCS
24838
248391993-09-06 Noah Friedman <friedman@gnu.org>
24840
24841 * src/version.c: entered into RCS
24842
248431993-09-06 Noah Friedman <friedman@gnu.org>
24844
24845 * Makefile.in: *** empty log message ***
24846
248471993-07-30 David J. MacKenzie <djm@gnu.org>
24848
24849 * Makefile.in: *** empty log message ***
24850
248511993-07-24 Richard Stallman <rms@gnu.org>
24852
24853 * src/bison.s1: *** empty log message ***
24854
248551993-07-24 Richard Stallman <rms@gnu.org>
24856
24857 * bison.simple: *** empty log message ***
24858
248591993-07-08 David J. MacKenzie <djm@gnu.org>
24860
24861 * Makefile.in: *** empty log message ***
24862
248631993-07-04 Richard Stallman <rms@gnu.org>
24864
24865 * src/bison.s1: *** empty log message ***
24866
248671993-07-04 Richard Stallman <rms@gnu.org>
24868
24869 * bison.simple: *** empty log message ***
24870
248711993-06-26 David J. MacKenzie <djm@gnu.org>
24872
24873 * src/getargs.c: entered into RCS
24874
248751993-06-26 David J. MacKenzie <djm@gnu.org>
24876
24877 * doc/bison.texinfo: *** empty log message ***
24878
24879 * doc/bison.1: New file.
24880
248811993-06-25 Richard Stallman <rms@gnu.org>
24882
24883 * src/getargs.c: New file.
24884
248851993-06-16 Richard Stallman <rms@gnu.org>
24886
24887 * src/bison.s1: *** empty log message ***
24888
248891993-06-16 Richard Stallman <rms@gnu.org>
24890
24891 * bison.simple: *** empty log message ***
24892
248931993-06-03 Richard Stallman <rms@gnu.org>
24894
24895 * src/bison.s1: New file.
24896
248971993-06-03 Richard Stallman <rms@gnu.org>
24898
24899 * doc/bison.texinfo: *** empty log message ***
24900
249011993-06-03 Richard Stallman <rms@gnu.org>
24902
24903 * bison.simple: New file.
24904
249051993-05-19 Richard Stallman <rms@gnu.org>
24906
24907 * doc/bison.texinfo: New file.
24908
249091993-05-07 Noah Friedman <friedman@gnu.org>
24910
24911 * Makefile.in: *** empty log message ***
24912
249131993-04-28 Noah Friedman <friedman@gnu.org>
24914
24915 * src/reader.c: *** empty log message ***
24916
249171993-04-23 Noah Friedman <friedman@gnu.org>
24918
24919 * src/alloc.h: entered into RCS
24920
249211993-04-20 David J. MacKenzie <djm@gnu.org>
24922
24923 * src/version.c: *** empty log message ***
24924
24925 * src/files.c, src/allocate.c:
24926 entered into RCS
24927
24928 * src/reader.c: *** empty log message ***
24929
24930 * src/lex.c: entered into RCS
24931
24932 * src/conflicts.c: New file.
24933
24934 * src/symtab.c: entered into RCS
24935
24936 * src/alloc.h: New file.
24937
24938 * src/LR0.c: entered into RCS
24939
249401993-04-18 Noah Friedman <friedman@gnu.org>
24941
24942 * src/reader.c: New file.
24943
24944 * src/version.c: *** empty log message ***
24945
249461993-04-18 Noah Friedman <friedman@gnu.org>
24947
24948 * Makefile.in: *** empty log message ***
24949
249501993-04-17 Noah Friedman <friedman@gnu.org>
24951
24952 * Makefile.in: *** empty log message ***
24953
249541993-04-15 Richard Stallman <rms@gnu.org>
24955
24956 * src/main.c, src/files.c:
24957 New file.
24958
249591993-04-15 Noah Friedman <friedman@gnu.org>
24960
24961 * configure.in: entered into RCS
24962
24963 * configure.in: *** empty log message ***
24964
24965 * configure.in: New file.
24966
249671993-04-14 Richard Stallman <rms@gnu.org>
24968
24969 * Makefile.in: New file.
24970
249711993-04-13 Richard Stallman <rms@gnu.org>
24972
24973 * src/version.c: New file.
24974
249751993-03-25 Richard Stallman <rms@gnu.org>
24976
24977 * src/output.c: entered into RCS
24978
249791992-09-25 Richard Stallman <rms@gnu.org>
24980
24981 * configure.bat: entered into RCS
24982
249831992-06-22 Richard Stallman <rms@gnu.org>
24984
24985 * src/vmsgetargs.c: entered into RCS
24986
249871992-06-22 Richard Stallman <rms@gnu.org>
24988
24989 * doc/bison.rnh: entered into RCS
24990
249911992-04-20 David J. MacKenzie <djm@gnu.org>
24992
24993 * README: entered into RCS
24994
249951992-01-22 Richard Stallman <rms@gnu.org>
24996
24997 * src/machine.h: entered into RCS
24998
249991991-12-21 Richard Stallman <rms@gnu.org>
25000
25001 * src/lalr.c, src/closure.c:
25002 entered into RCS
25003
250041991-12-20 Richard Stallman <rms@gnu.org>
25005
25006 * src/state.h: entered into RCS
25007
250081991-12-18 Richard Stallman <rms@gnu.org>
25009
25010 * src/print.c, src/nullable.c, src/derives.c:
25011 entered into RCS
25012
250131991-11-03 David J. MacKenzie <djm@gnu.org>
25014
25015 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
25016 entered into RCS
25017
250181988-09-09 Richard Stallman <rms@gnu.org>
25019
25020 * src/bison.hairy: entered into RCS
25021
250221987-12-16 Richard Stallman <rms@gnu.org>
25023
25024 * REFERENCES: entered into RCS
dc546b0f 25025
f294a2c2 25026
04098407 25027 -----
f294a2c2 25028
04098407 25029 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
e021191b
JD
25030 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
25031 2008, 2009 Free Software Foundation, Inc.
f294a2c2 25032
04098407
PE
25033 Copying and distribution of this file, with or without
25034 modification, are permitted provided the copyright notice and this
25035 notice are preserved.