]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
Document gcc -Wundef fix.
[bison.git] / ChangeLog
... / ...
CommitLineData
12009-12-16 Joel E. Denny <jdenny@clemson.edu>
2
3 Document gcc -Wundef fix.
4 * NEWS (2.4.2): Here.
5 * THANKS (Jonathan Nieder): Add.
6
72009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
8
9 Simplify y.tab.c when location tracking is disabled.
10 * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
11 tracking is not enabled. Instead, unconditionally define
12 YY_LOCATION_PRINT as a no-op for backward compatibility.
13
142009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
15
16 Avoid warnings from gcc -Wundef y.tab.c.
17 * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
18 defined before using them.
19 * data/lalr1.cc: Likewise.
20 * data/yacc.c: Likewise.
21
222009-12-15 Joel E. Denny <jdenny@clemson.edu>
23
24 autoconf: update to latest for fix of M4 detection.
25 Reported by Eric Blake.
26 * submodules/autoconf: Update.
27
282009-12-15 Joel E. Denny <jdenny@clemson.edu>
29
30 portability: use -DGNULIB_POSIXCHECK.
31 Reported by Eric Blake. See discussions at
32 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html>
33 and
34 <http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html>.
35 * HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
36 * bootstrap.conf (gnulib_modules): Add all the printf modules
37 suggested by -DGNULIB_POSIXCHECK. Add realloc-posix as
38 suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
39 (excluded_files): Remove m4/printf-posix.m4.
40 * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
41 lib/libbison.a so gnulib libraries can be linked.
42
432009-12-15 Joel E. Denny <jdenny@clemson.edu>
44
45 gnulib: update for fix of fprintf-posix, which we'll use soon.
46 * etc/prefix-gnulib-mk (prefix): Adjust regex for make file
47 targets so that gnulib's new arg-nonnull.h and link-warning.h
48 are matched.
49 * gnulib: Update.
50
512009-12-14 Joel E. Denny <jdenny@clemson.edu>
52
53 Enable assertion output and --disable-assert for configure.
54 * bootstrap.conf (gnulib_modules): Add assert module.
55 * src/system.h (aver): Define as assert, and summarize the
56 discussion on this issue.
57
582009-12-14 Joel E. Denny <jdenny@clemson.edu>
59
60 Expand GLR acronym in summary of Bison.
61 Based on discussion with Akim Demaille starting at
62 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html>.
63 * doc/bison.texinfo (Introduction): Here.
64 * src/getargs.c (usage): Here.
65
662009-10-03 Alex Rozenman <rozenman@gmail.com>
67
68 Document named references.
69 * doc/bison.texinfo (Actions): Add new example and xref to
70 Using Named References node.
71 (Using Named References): New node.
72
732009-10-16 Joel E. Denny <jdenny@clemson.edu>
74
75 cleanup.
76 * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead
77 of char*.
78 (Sbitset__isEmpty): Use Sbitset instead of char*.
79 * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char
80 instead of char. This helps to avoid casting errors.
81 (Sbitset__or): Use Sbitset instead of char*.
82
832009-10-16 Joel E. Denny <jdenny@clemson.edu>
84
85 portability: don't assume 8-bit bytes.
86 That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff.
87 * src/Sbitset.h (Sbitset__nbytes): Here.
88 (Sbitset__byteAddress): Here.
89 (Sbitset__bit_mask): Here.
90 (Sbitset__last_byte_mask): Here.
91 (Sbitset__ones): Here.
92 (SBITSET__FOR_EACH): Here.
93
942009-10-11 Joel E. Denny <jdenny@clemson.edu>
95
96 portability: use va_start and va_end in the same function.
97 * src/complain.c (error_message): Move va_end from here...
98 (ERROR_MESSAGE): ... to here.
99
1002009-10-08 Joel E. Denny <jdenny@clemson.edu>
101
102 * data/bison.m4: Update comments for rename to muscle-tab.h.
103
1042009-10-07 Joel E. Denny <jdenny@clemson.edu>
105
106 Minor code cleanup.
107 * src/muscle-tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and
108 replace all uses with UNIQSTR_CONCAT.
109 * src/uniqstr.c (uniqstr_vsprintf): New function.
110 * src/uniqstr.h (uniqstr_vsprintf): Add prototype.
111 (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New
112 macros.
113
1142009-10-06 Joel E. Denny <jdenny@clemson.edu>
115
116 * TODO (Complaint submessage indentation): New.
117
1182009-10-04 Joel E. Denny <jdenny@clemson.edu>
119
120 Minor code cleanup.
121 * src/parse-gram.y: Clean up sorting of declarations.
122 Use types to simplify %printer declarations where possible.
123 Provide %printer for BRACKETED_ID and symbol.prec.
124 * src/symtab.c: Whitespace change.
125
1262009-10-04 Joel E. Denny <jdenny@clemson.edu>
127
128 tests: skip tests of file names that platform does not support.
129 Reported by Michael Raskin at
130 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
131 * THANKS (Michael Raskin): Add.
132 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
133 to fail at least for file names containing ":" or "\".
134
1352009-09-23 Joel E. Denny <jdenny@clemson.edu>
136
137 yysyntax_error: avoid duplicate lookahead collection.
138 Except when memory reallocation is required, this change
139 eliminates the need to invoke yysyntax_error twice and thus to
140 repeat the collection of lookaheads. It also prepares for
141 future extensions that will make those repetitions more
142 expensive and that will require additional memory management in
143 yysyntax_error. Finally, it fixes an obscure bug already
144 exercised in the test suite.
145 * data/yacc.c (yysyntax_error): Add arguments for message
146 buffer variables stored in the parser. Instead of size, return
147 status similar to yyparse status but indicating success of
148 message creation. Other than the actual reallocation of the
149 message buffer, import and clean up memory management code
150 from...
151 (yyparse, yypush_parse): ... here.
152 * tests/regression.at (parse.error=verbose overflow): No longer
153 an expected failure.
154
1552009-09-23 Joel E. Denny <jdenny@clemson.edu>
156
157 yysyntax_error: test memory management more.
158 * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro.
159 * tests/regression.at (parse.error=verbose and
160 YYSTACK_USE_ALLOCA): New test group.
161 (parse.error=verbose overflow): New test group that reveals an
162 obscure bug. Expected fail for now.
163
1642009-10-04 Joel E. Denny <jdenny@clemson.edu>
165
166 benchmarks: use %debug consistently among grammars.
167 * etc/bench.pl.in (generate_grammar_triangular): Do not activate
168 %debug by default. It can affect the timings even if yydebug=0.
169 (generate_grammar_calc): For consistency with other grammars,
170 use YYDEBUG environment variable to set yydebug.
171
1722009-10-03 Joel E. Denny <jdenny@clemson.edu>
173
174 Remove dead code.
175 * src/symtab.c (symbol_pack): Here because every symbol's number
176 is always defined by this time.
177
1782009-10-03 Alex Rozenman <rozenman@gmail.com>
179
180 Add additional space after periods in NEWS.
181 * NEWS (2.5): here.
182
1832009-09-29 Joel E. Denny <jdenny@clemson.edu>
184
185 Use the correct conversion specifier for size_t.
186 Reported by Jim Meyering.
187 * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu"
188 because Sbitset__Index is size_t.
189 * src/Sbitset.c (Sbitset__fprint): Use it instead of %d.
190
1912009-09-27 Joel E. Denny <jdenny@clemson.edu>
192
193 tests: don't abuse AT_BISON_CHECK.
194 * tests/regression.at (parse-gram.y: LALR = IELR): Move
195 additional shell commands outside of AT_BISON_CHECK.
196
1972009-09-26 Joel E. Denny <jdenny@clemson.edu>
198
199 tests: check that parse-gram.y's IELR and LALR are identical.
200 * tests/atlocal.in (abs_top_srcdir): New shell variable.
201 * tests/regression.at (parse-gram.y: LALR = IELR): New test
202 group.
203
2042009-09-19 Alex Rozenman <rozenman@gmail.com>
205
206 Keep sub-messages aligned. Fix strings for translation.
207 * src/location.h (location_print): Add return value.
208 * src/location.c (location_print): Return number of printed
209 characters.
210 * src/complain.h (complain_at_indent, warn_at_indent): Prototype
211 new functions.
212 * src/complain.cpp (indent_ptr): New static variable.
213 (error_message, complain_at_indent, warn_at_indent): Implement
214 the alignment mechanism.
215 * src/scan-code.l (parse_ref, show_sub_messages): Fix strings
216 for translations. Use new alignment mechanism.
217 * tests/named-ref.at: Adjust test-cases.
218 * NEWS (2.5): Add an announcement about named references.
219
2202009-09-17 Akim Demaille <demaille@gostai.com>
221
222 doc: fixes.
223 * doc/bison.texinfo: here.
224 Reported by Alex Rozenman.
225
2262009-09-16 Akim Demaille <demaille@gostai.com>
227
228 doc: lalr1.cc and variants.
229 * doc/bison.texinfo (Decl Summary): Document the "lex_symbol" and
230 "variant" %define variables.
231 (C++ Semantic Values): Split into...
232 (C++ Unions, C++ Variants): these.
233 The latter is new.
234 (C++ Parser Interface): Fix type names.
235 Document parser::syntax_error.
236 Document the fact that locations are not mandatory.
237 (C++ Scanner Interface): Split into...
238 (Split Symbols, Complete Symbols): these.
239 The later is new.
240 (Calc++ Parsing Driver): Use variants.
241 Add more comments.
242 Adjust style.
243 (Calc++ Parser): Declare all the tokens, no
244 longer accept raw characters.
245 Remove %union.
246 Adjust types and printers.
247 Remove destructors.
248 (Calc++ Scanner): Use make_<SYMBOL> functions.
249 Use strerror in error message.
250
2512009-09-16 Akim Demaille <demaille@gostai.com>
252
253 doc: spell checking.
254 * doc/bison.texinfo: here.
255
2562009-09-16 Akim Demaille <demaille@gostai.com>
257
258 doc: comment changes.
259 * doc/bison.texinfo: Comment changes.
260
2612009-09-16 Akim Demaille <demaille@gostai.com>
262
263 lalr1.cc: factor the yytranslate_ invocation in make_SYMBOLS.
264 * data/c++.m4, data/lalr1.cc (parser::symbol_type): Change the
265 constructor to take a token_type instead of the (internal) symbol
266 number.
267 Call yytranslate_.
268 * data/variant.hh (b4_symbol_constructor_define_): Therefore,
269 don't call yytranslate_ here.
270
2712009-09-16 Akim Demaille <demaille@gostai.com>
272
273 TODO: statistics.
274 * TODO (Figures): New.
275
2762009-09-13 Joel E. Denny <jdenny@clemson.edu>
277
278 tests: clean up push.at test group titles.
279 * tests/push.at: Remove "Push Parsing: " from test group titles
280 because these are already under the banner "Push Parsing Tests".
281
2822009-09-12 Alex Rozenman <rozenman@gmail.com>
283
284 Provide an additional sub-message for clarity.
285 Add "symbol not found in production" error message when
286 an "invalid reference" is detected in named references
287 resolution.
288 * src/scan-code.l: Update "invalid reference" case.
289 * tests/named-ref.at: Adjust test-cases.
290
2912009-09-10 Joel E. Denny <jdenny@clemson.edu>
292
293 Clean up yacc.c a little.
294 * data/yacc.c: Clean up M4 for readability, and make output
295 whitespace more consistent. For the main parse function
296 comment, instead of saying "yyparse or yypush_parse", say either
297 "yyparse" or "yypush_parse" depending on which it actually is.
298
2992009-09-10 Joel E. Denny <jdenny@clemson.edu>
300
301 Fix --enable-gcc-warnings.
302 * src/parse-gram.y (%printer <param>): Handle param_none.
303
3042009-09-09 Akim Demaille <demaille@gostai.com>
305
306 lalr1.cc: syntax_error as exceptions.
307 It is common to use sort of factories in the user actions. These
308 factories may check some "syntactic" constraints that are not
309 enforced by the grammar itself. This is possible using YYERROR
310 within the action itself. Provide the user with a means to throw
311 a syntax_error exception.
312
313 * data/c++.m4 (b4_public_types_declare, b4_public_types_define):
314 Declare and define yy::parser::syntax_error.
315 * data/lalr1.cc: Include stdexcept.
316 (yy::parser::parse): Wrap the user action within a try/catch.
317 * data/glr.cc: Include stdexcept.
318
3192009-09-09 Akim Demaille <demaille@gostai.com>
320
321 lalr1.cc: add missing "inline".
322 * data/c++.m4 (b4_public_types_define): Add missing inline to
323 implementations provided in headers.
324
3252009-09-09 Akim Demaille <demaille@gostai.com>
326
327 %param: documentation.
328 * NEWS (2.6): Document %param, %lex-param, and %parse-param
329 changes.
330 * doc/bison.texinfo: Document that %lex-param and %parse-param
331 are n-ary.
332 Changes some examples to demonstrate it.
333 (Calc++ Parser): Use %param.
334
3352009-09-09 Akim Demaille <demaille@gostai.com>
336
337 Regen.
338
3392009-09-09 Akim Demaille <demaille@gostai.com>
340
341 style changes.
342 * src/parse-gram.y (add_param): Scope changes.
343
3442009-09-09 Akim Demaille <demaille@gostai.com>
345
346 %parse: support several arguments.
347 * src/parse-gram.y (current_param): New.
348 (param_type): Add param_none.
349 (params): New nonterminal.
350 Use it.
351
3522009-09-09 Akim Demaille <demaille@gostai.com>
353
354 Regen.
355
3562009-09-09 Akim Demaille <demaille@gostai.com>
357
358 %param.
359 Provide a means to factor lex-param and parse-param common
360 declarations.
361
362 * src/parse-gram.y (param_type): New.
363 Define a %printer for it.
364 (add_param): Use it.
365 (%parse-param, %lex-param): Merge into...
366 (%parse): this new token.
367 Adjust the grammar to use it.
368 * src/scan-gram.l (RETURN_VALUE): New.
369 (RETURN_PERCENT_FLAG): Use it.
370 (RETURN_PERCENT_PARAM): New.
371 Use it to support %parse-param, %lex-param and %param.
372
3732009-09-03 Joel E. Denny <jdenny@clemson.edu>
374
375 Use aver not assert.
376 * src/output.c: Don't include assert.h.
377 (output_skeleton): Use aver not assert.
378 * src/system.h (aver): In documentation of why, add links to
379 Paul Eggert's explanations in the mailing lists.
380
3812009-09-05 Alex Rozenman <rozenman@gmail.com>
382
383 Use "Unresolved reference" error message when no symbols were found
384 in a symbolic reference resolution. Remove .expr and -expr from
385 the shown reference when the reference is unresolved.
386 * src/scan-code.l: Change the error message, adjust location columns,
387 rename variable "exact_mode" to "explicit_bracketing".
388 * tests/named-ref.at: Adjust existing tests and add a new one.
389
3902009-09-04 Akim Demaille <demaille@gostai.com>
391
392 Adjust synclines in src/parse-gram.[ch].
393 * tests/bison.in: Do some magic (including working around issues
394 with ylwrap) when this wrapper is used to compile
395 src/parse-gram.y.
396
3972009-09-03 Joel E. Denny <jdenny@clemson.edu>
398
399 Complain about unused %define variables and %code qualifiers.
400 * NEWS (2.5): Document.
401 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
402 * doc/bison.texinfo (Decl Summary): Document complaint, and
403 improve %define documentation a little otherwise.
404 * tests/input.at (Reject unused %code qualifiers): Update.
405 (%define errors): Update.
406 (%define, --define, --force-define): Update.
407 (%define backward compatibility): Update.
408 (Unused %define api.pure): Update.
409 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
410
4112009-09-03 Joel E. Denny <jdenny@clemson.edu>
412
413 Don't suppress warnings about unused parse.error.
414 * data/bison.m4 (b4_error_verbose_flag): Don't examine value of
415 %define variable parse.error unless b4_error_verbose_flag is
416 actually expanded in a skeleton.
417
4182009-09-03 Akim Demaille <demaille@gostai.com>
419
420 * NEWS (2.4.2): Add "Internationalization" item.
421
4222009-09-03 Akim Demaille <demaille@gostai.com>
423
424 bootstrap: fix/improve find_tool.
425 * bootstrap (find_tool): Improve error messages.
426 Fix typo about find_tool_names.
427
4282009-08-29 Joel E. Denny <jdenny@clemson.edu>
429
430 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
431 See
432 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
433 * src/scan-code.h (code_props_rule_action_init): Rename
434 named_ref arg to name so it doesn't shadow named_ref type. This
435 makes it consistent with the function definition in scan-code.l
436 anyway.
437
4382009-08-28 Joel E. Denny <jdenny@clemson.edu>
439
440 %define: accept unquoted values.
441 * NEWS (2.5): Group all %define changes together, and document
442 this one. Remove quotes in IELR and canonical LR entry.
443 * doc/bison.texinfo: Remove quotes in most examples throughout.
444 (Decl Summary): Update %define documentation.
445 (Table of Symbols): Likewise.
446 * src/ielr.c (LrType): Update documentation.
447 * src/parse-gram.y (content.opt): Add production for ID.
448 * tests/actions.at: Remove quotes in most tests.
449 * tests/calc.at: Likewise.
450 * tests/existing.at: Likewise.
451 * tests/input.at: Likewise.
452 * tests/local.at: Likewise.
453 * tests/push.at: Likewise.
454 * tests/reduce.at: Likewise.
455 * tests/torture.at: Likewise.
456
4572009-08-28 Joel E. Denny <jdenny@clemson.edu>
458
459 %define lr.type: make values lowercase IDs.
460 That is, "LALR" => "lalr", "IELR" => "ielr", and
461 "canonical LR" => "canonical-lr".
462 * NEWS (2.5): Update documentation.
463 * doc/bison.texinfo (Decl Summary): Likewise.
464 * src/ielr.c (ielr): Use new values.
465 * src/ielr.h (ielr): Update documentation.
466 * src/reader.c (prepare_percent_define_front_end_variables): Use
467 and validate new values.
468 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
469 grammars.
470 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
471
4722009-08-27 Eric Blake <ebb9@byu.net>
473
474 scan-gram: avoid portability trap with ctype usage.
475 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
476 Avoid compiler warning.
477
4782009-08-27 Joel E. Denny <jdenny@clemson.edu>
479
480 tests: use perl for printing special sequences to files.
481 And skip tests if perl is not available. This is better than
482 playing tricks with shell portability. Suggested by Akim
483 Demaille.
484 * tests/input.at (Bad character literals): Use it here for
485 omitting final newlines.
486 (Bad escapes in literals): Use it here for special characters.
487
4882009-08-26 Joel E. Denny <jdenny@clemson.edu>
489
490 tests: show a use of %define lr.default-reductions "consistent"
491 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
492 prevents the omission of expected tokens for %error-verbose.
493
4942009-08-26 Akim Demaille <demaille@gostai.com>
495
496 tests: portability fix.
497 * tests/input.at (Bad escapes in literals): Don't expect "echo
498 '\0'" to output \ then 0.
499
5002009-08-26 Joel E. Denny <jdenny@clemson.edu>
501
502 Actually handle the yytable zero value correctly this time.
503 * data/bison.m4 (b4_integral_parser_tables_map): Don't mention
504 zero values in the YYTABLE comments.
505 * data/glr.c (yytable_value_is_error): Don't check for zero
506 value.
507 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
508 * data/yacc.c (yytable_value_is_error): Likewise.
509 * data/lalr1.java (yy_table_value_is_error_): Likewise.
510 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
511 * src/tables.h: In header comments, explain why it's useless to
512 check for a zero value in yytable.
513
5142009-08-25 Joel E. Denny <jdenny@clemson.edu>
515
516 More fixes related to last two patches.
517 * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE
518 comments: zero indicates syntax error not default action.
519 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
520 defined.
521 * data/glr.c (yyis_pact_ninf): Rename to...
522 (yypact_value_is_default): ... this.
523 (yyisDefaultedState): Update for rename.
524 (yyis_table_ninf): Rename to...
525 (yytable_value_is_error): ... this, and check for value zero
526 besides just YYTABLE_NINF.
527 (yygetLRActions): Check for default value from yypact. It
528 appears that this check is always performed before this function
529 is invoked, and so adding the check here is probably redundant.
530 However, the code may evolve after this subtlety is forgotten.
531 Also, update for rename to yytable_value_is_error. Because that
532 macro now checks for zero, a different but equivalent branch of
533 the if-then-else here is evaluated.
534 (yyreportSyntaxError): Update for rename to
535 yytable_value_is_error. The zero condition was mishandled
536 before.
537 (yyrecoverSyntaxError): Update for renames. No behavioral
538 changes.
539 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
540 New function.
541 (yy_table_value_is_error_): New function.
542 (parse): Use new functions where possible. No behavioral
543 changes.
544 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
545 The zero condition was mishandled before.
546 * data/yacc.c (yyis_pact_ninf): Rename to...
547 (yypact_value_is_default): ... this.
548 (yyis_table_ninf): Rename to...
549 (yytable_value_is_error): ... this, and check for value zero
550 besides just YYTABLE_NINF.
551 (yysyntax_error): Update for rename to yytable_value_is_error.
552 The zero condition was mishandled before.
553 (yyparse): Update for renames. No behavioral changes.
554 * src/tables.h: Improve comments about yypact, yytable, etc.
555 more. Most importantly, say yytable value of zero means syntax
556 error not default action.
557
5582009-08-25 Joel E. Denny <jdenny@clemson.edu>
559
560 Fix %error-verbose for conflicts resolved by %nonassoc.
561 * NEWS (2.5): Document.
562 * data/glr.c (yyreportSyntaxError): Fix this by checking
563 yyis_table_ninf.
564 * data/yacc.c (yysyntax_error): Likewise.
565 * data/lalr1.cc (yysyntax_error_): Fix this by checking
566 yytable_ninf_.
567 * data/lalr1.java (yysyntax_error): Likewise.
568 * tests/conflicts.at (%nonassoc and eof): Update expected output
569 and remove FIXME.
570
5712009-08-25 Joel E. Denny <jdenny@clemson.edu>
572
573 Some code and documentation improvements.
574 * data/c.m4 (b4_table_value_equals): New macro to capture
575 some repeated code.
576 * data/glr.c (yyis_pact_ninf): Use it here.
577 (yyis_table_ninf): Likewise.
578 (yyreportSyntaxError): Improve internal comments.
579 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
580 Use it everywhere possible.
581 (yyis_table_ninf): Likewise.
582 (yysyntax_error): Improve internal comments.
583 * data/lalr1.cc (yysyntax_error_): Likewise.
584 * data/lalr1.java (yysyntax_error): Likewise.
585 * src/tables.h: Improve comments about yypact, yytable, etc.
586
5872009-08-21 Joel E. Denny <jdenny@clemson.edu>
588
589 Use locale when quoting.
590 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
591 quote rather than implementing quoting here.
592
5932009-08-20 Eric Blake <ebb9@byu.net>
594
595 Make previous patch more robust.
596 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
597 argmatch.h.
598 (output_skeleton): Use it.
599 Suggested by Akim Demaille.
600
601 Import latest m4/m4.m4.
602 * submodules/autoconf: Update to autoconf 2.64.
603 * configure.ac (M4_GNU_OPTION): New define.
604 * src/output.c (output_skeleton): Use it to resolve FIXME.
605 * NEWS: Mention this.
606
6072009-08-19 Joel E. Denny <jdenny@clemson.edu>
608
609 Fix complaints about escape sequences.
610 Discussed starting at
611 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
612 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
613 For a \0 and similar escape sequences meaning the null
614 character, report an invalid escape sequence instead of an
615 invalid null character because the latter does not actually
616 appear in the user's input.
617 In all escape sequence complaints, don't escape the initial
618 backslash, and don't quote when the sequence appears at the end
619 of the complaint line unless there's whitespace that quotearg
620 won't escape.
621 Consistently say "invalid" not "unrecognized".
622 Consistently prefer "empty character literal" over "extra
623 characters in character literal" warning for invalid escape
624 sequences; that is, consistently discard those sequences.
625 * tests/input.at (Bad escapes in literals): New.
626
6272009-08-19 Akim Demaille <demaille@gostai.com>
628
629 doc: fixes.
630 * doc/bison.texinfo: Fix minor Texinfo errors.
631
6322009-08-19 Akim Demaille <demaille@gostai.com>
633
634 tests: distcc compliance.
635 * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's
636 error messages from the output.
637
6382009-08-19 Akim Demaille <demaille@gostai.com>
639
640 variables: simplify the upgrade of namespace into api.namespace.
641
642 This patch simplifies "variables: rename namespace as
643 api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c.
644 Suggested by Joel E. Denny in
645 http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html
646
647 * src/muscle-tab.c (muscle_percent_variable_update): New.
648 (muscle_percent_define_insert): Use it in replacement of the
649 previous tr invocation.
650 Remove variable_tr, no longer needed.
651 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
652 Remove.
653 * data/c++.m4: No longer handle namespace -> api.namespace.
654 * tests/input.at (%define backward compatibility): Check that
655 namespace is treated as api.namespace.
656
6572009-08-19 Akim Demaille <demaille@gostai.com>
658
659 doc: %initial-action to initialize yylloc.
660 Reported by Bill Allombert.
661 * doc/bison.texinfo: Set fill-column to 76.
662 (Location Type): Document the use of %initial-action to initialize
663 yylloc.
664
6652009-08-19 Akim Demaille <demaille@gostai.com>
666
667 lalr1.cc: use state_type.
668 * data/lalr1.cc (yysyntax_error_): Use state_type.
669 Move argument names into yy*.
670
6712009-08-19 Akim Demaille <demaille@gostai.com>
672
673 lalr1.cc: get rid of yyparse's yystate.
674 yystate and yystack_[0].state are equal, keep only the latter.
675 The former was also used as a temporary variable to compute the
676 post-reduction state. Move this computation into an auxiliary
677 function.
678
679 * data/glr.c (yyLRgotoState): Fuse variable definition and first
680 assignment.
681 * data/lalr1.cc (yy_lr_goto_state_): New.
682 (yyparse): Use it.
683 Replace remaining uses of yystate by yystate_[0].state.
684 Remove the former.
685
6862009-08-19 Akim Demaille <demaille@gostai.com>
687
688 lalr1.cc: destroy $$ when YYERROR is called.
689 * data/lalr1.cc (yyreduce): Compute the resulting state before
690 running the user action so that yylhs is a valid symbol.
691 (yyerrorlab): Since yylhs is complete (it knows its type), we can
692 simply call yy_destroy_ to destroy $$ on YYERROR invocations.
693 * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants.
694
6952009-08-18 Joel E. Denny <jdenny@clemson.edu>
696
697 maint: update for gnulib's recent update-copyright changes
698 * gnulib: Update.
699 * .x-update-copyright (COPYING): Add as it's no longer implied
700 when .x-update-copyright is present.
701 * cfg.mk (update-copyright-local): Remove, now ignored.
702 (update-copyright): Declare update-b4-copyright as a dependency.
703
7042009-08-17 Akim Demaille <demaille@gostai.com>
705
706 build: require gettext 0.17.
707
708 Suggested by Bruno Haible.
709 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
710 * configure.ac: require gettext 0.17 to ensure compatibility with
711 gnulib.
712
7132009-08-17 Akim Demaille <demaille@gostai.com>
714
715 build: lower gettext requirements.
716
717 Bison was uselessly requiring the formatstring macros from
718 gettext, which resulted in mo files not being installed on systems
719 that perfectly supported Bison mo files. Lower the requirement.
720 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
721
722 * configure.ac: Require need-ngettext instead of
723 need-formatstring-macros.
724 Reported by Martin Jabocs.
725 Suggested by Bruno Haible.
726 * INSTALL: Restructure.
727 (Internationalization): New.
728
7292009-08-14 Joel E. Denny <jdenny@clemson.edu>
730
731 maint: fix use of copyright year intervals.
732 * gnulib: Update.
733 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
734 as now recommended in gnulib/NEWS.
735 * build-aux/update-b4-copyright: Fix.
736 * cfg.mk (update-copyright-env): Configure update-copyright.
737
7382009-08-13 Joel E. Denny <jdenny@clemson.edu>
739
740 Make it easier to write deterministic tests.
741 Continues Akim's work from his 2009-06-10 commits.
742 * src/reader.c (check_and_convert_grammar): Don't add any
743 symbols after the first symbols_do invocation.
744 * src/symtab.c (symbols_sorted): New static global.
745 (user_token_number_redeclaration): Update comments.
746 (symbol_from_uniqstr): If a new symbol is being created, assert
747 that symbols_sorted hasn't been allocated yet.
748 (symbols_free): Free symbols_sorted.
749 (symbols_cmp, symbols_cmp_qsort): New functions.
750 (symbols_do): Sort symbol_table into symbols_sorted on first
751 invocation.
752 * tests/input.at (Numbered tokens): Recombine tests now that the
753 output should be deterministic across multiple numbers.
754
7552009-08-12 Akim Demaille <demaille@gostai.com>
756
757 tests: GCC 4.5 compliance.
758 * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's
759 messages about #error.
760
7612009-08-12 Akim Demaille <demaille@gostai.com>
762
763 build: fix the generation of the documentation.
764 Some of our targets use "bison --help", but they can't depend on
765 "bison" itself (to avoid additional requirements on the user), so
766 they used to call "make src/bison" in the commands. Then
767 concurrent builds may fail: one make might be aiming one of its
768 jobs at compiling src/bison, and another job at generating the man
769 page. If the latter is faster than the former, then we have two
770 makes that concurrently try to compile src/bison.
771
772 This might also be a more convincing explanation for the failure
773 described in the patch "build: fix paths".
774
775 * Makefile.am (SUFFIXES): Initialize.
776 * build-aux/move-if-change: New, symlink to gnulib's.
777 * build-aux/local.mk: Ship it.
778 * doc/common.x: Remove, merged into...
779 * doc/bison.x: here.
780 * doc/local.mk (doc/bison.help): New.
781 ($(CROSS_OPTIONS_TEXI)): Depend on it.
782 Use src/bison.
783 (.x.1): Replace with...
784 (doc/bison.1): this explicit, simpler, target.
785 (common_dep): Remove, inlined where appropriate.
786 (SUFFIXES, PREPATH): Remove, unused.
787
7882009-08-12 Akim Demaille <demaille@gostai.com>
789
790 gnulib: improve prefixing.
791 * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather,
792 change the value of...
793 (gl_LIBOBJS): this.
794 Adjust more variables.
795 * etc/prefix-gnulib-mk (prefix_assignment): Don't rename
796 gl_LIBOBJS.
797 (prefix): Also transform rules whose targets have slashes.
798 Use $prefix liberally.
799 Map @MKDIR_P@ to $(MKDIR_P).
800 Prefix directories that are mkdir'd.
801
8022009-08-12 Akim Demaille <demaille@gostai.com>
803
804 build: fix paths.
805 When using $(top_builddir) inconsistently, Make (including GNU
806 Make) is sometimes confused. As a result it may want to build
807 lib/libbison.la and $(top_builddir)/lib/libbison.la (the same
808 file, different names) concurrently, which, amusingly enough,
809 might end with:
810
811 ranlib lib/libbison.a
812 ranlib lib/libbison.a
813 make[2]: *** [lib/libbison.a] Segmentation fault
814
815 on OS X.
816
817 * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not
818 needed.
819
8202009-08-12 Akim Demaille <demaille@gostai.com>
821
822 distcheck: fix.
823
824 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
825
8262009-08-10 Joel E. Denny <jdenny@clemson.edu>
827
828 * tests/local.mk (TESTSUITE_AT): Add named-refs.at.
829
8302009-08-10 Joel E. Denny <jdenny@clemson.edu>
831
832 Miscellaneous code readability improvements.
833
834 * src/reader.c (reader): Move %define front-end variable
835 defaults and checking into...
836 (prepare_percent_define_front_end_variables): ... this new
837 function.
838
839 * src/scan-gram.l (INITIAL): For consistency with string
840 literals, don't store open quote on character literal. It's
841 discarded before returning anyway.
842 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
843 Make length test more readable, and make the character stored
844 for an empty literal more obvious while consistent with the
845 previous behavior.
846
847 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
848 USER_NUMBER_HAS_STRING_ALIAS throughout.
849 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
850 that is repeated in symtab.h. Improve argument names to make it
851 clear which side of the symbol-string alias pair is which.
852 (symbol_check_alias_consistency): Improve local variable names
853 for the same purpose.
854 * src/symtab.h (struct symbol): Make comments about aliases
855 clearer.
856 (symbol_make_alias): Improve comments and argument name.
857 * src/output.c (token_definitions_output): Update for rename to
858 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
859
8602009-08-08 Alex Rozenman <rozenman@gmail.com>
861
862 Convert "misleading reference" messages to warnings.
863 * src/scan-code.l: New function 'show_sub_messages', more
864 factoring.
865 * tests/named-ref.at: Adjust tests.
866
8672009-08-06 Joel E. Denny <jdenny@clemson.edu>
868
869 maint: run "make update-copyright"
870
8712009-08-06 Joel E. Denny <jdenny@clemson.edu>
872
873 maint: make update-b4-copyright easier to use
874 * build-aux/update-b4-copyright: In warnings, report line
875 numbers rather than character positions.
876 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
877 that update-copyright runs it.
878 * gnulib: Update.
879
8802009-08-05 Joel E. Denny <jdenny@clemson.edu>
881
882 maint: clean up update-b4-copyright code
883 * build-aux/update-b4-copyright: Do not accept 2-digit
884 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
885 Don't accept a `[' in a b4_copyright argument.
886 Format code more consistently.
887 Don't assume b4*copyright never occurs.
888
8892009-08-04 Joel E. Denny <jdenny@clemson.edu>
890
891 maint: automate b4_copyright updates.
892 * Makefile.am (update-b4-copyright): New target rule.
893 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
894 * build-aux/update-b4-copyright: New.
895 * data/yacc.c: Remove stray characters around b4_copyright
896 invocations.
897
8982009-08-04 Joel E. Denny <jdenny@clemson.edu>
899
900 maint: automate annual package-wide copyright-year update.
901 * .x-update-copyright: New.
902 * Makefile.am (EXTRA_DIST): Remove maint.mk.
903 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
904 update-copyright. Remove gnumakefile, which is implied by
905 maintainer-makefile.
906 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
907 * gnulib: Update.
908 * maint.mk: Remove, now copied from gnulib.
909 * examples/extexi: Add missing "(C)" in copyright statement so
910 update-copyright can recognize it.
911 * src/LR0.h: Likewise.
912 * src/print.h: Likewise.
913 * src/print_graph.h: Likewise.
914 * src/gram.c: Add missing comma in copyright statement.
915 * src/gram.h: Likewise.
916
9172009-08-04 Joel E. Denny <jdenny@clemson.edu>
918
919 Fix "make distcheck".
920 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
921 of just calc.stamp.
922
9232009-08-01 Joel E. Denny <jdenny@clemson.edu>
924
925 Pacify "gcc -Wunused" for the input function from Flex.
926 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
927 and later.
928 * src/scan-code.l: Add "%option noinput", which I cannot find in
929 the Flex manual, but which Flex has supported since at least as
930 far back as 2.5.4. However, if any of our developers still use
931 Flex 2.5.4, they'll need to stop configuring with
932 --enable-gcc-warnings because "%option noinput" didn't work
933 correctly until Flex 2.5.6.
934 * src/scan-gram.l: Likewise.
935 * src/scan-skel.l: Likewise.
936
9372009-07-31 Alex Rozenman <rozenman@gmail.com>
938
939 Fix --enable-gcc-warnings problems.
940 * src/reader.c: Adjust variable names.
941 * src/scan-code.l: Fix prototypes and adjust names.
942 * src/named-ref.c: Remove redundant "if".
943
9442009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
945
946 Fix a --enable-gcc-warnings problem.
947 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
948 variable.
949
9502009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
951
952 Warn about character literals not of length one.
953 * NEWS (2.5): Document.
954 * src/scan-gram.l (INITIAL): Remove comment that we don't check
955 the length.
956 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
957 * tests/input.at (Bad character literals): New test group.
958
9592009-07-24 Alex Rozenman <rozenman@gmail.com>
960
961 Fix some memory leaks.
962 * src/named-ref.c: Add a pointer check (named_ref_free).
963 * src/scan-code.l: New function (variant_table_free). Called in
964 code_scanner_free.
965 * src/symlist.c: Call to named_ref_free (symbol_list_free).
966
9672009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
968
969 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
970
9712009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
972
973 Some M4 cleanup in the testsuite.
974 Suggested by Eric Blake at
975 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
976 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
977 complicate the code by distinguishing between a missing value
978 and an empty string value for an optional argument. This fix is
979 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
980 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
981 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
982 arguments are not needed because of the following changes.
983 Fix stale comments.
984 Bison developers should use GNU M4 and should not use
985 POSIXLY_CORRECT when building the test suite, so do not
986 complicate the code by avoiding $10 and above.
987 Do not quote an empty string value for an optional argument, and
988 do not distinguish between a missing value and an empty string
989 value.
990
9912009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
992
993 Revert unnecessary column realignment in --help output.
994 Reported by Akim Demaille at
995 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
996 * src/getargs.c (usage): Here.
997
9982009-07-04 Alex Rozenman <rozenman@gmail.com>
999
1000 Alphabetical order in src/local.mk.
1001 * src/local.mk: Adjust.
1002
10032009-07-04 Alex Rozenman <rozenman@gmail.com>
1004
1005 Style changes and factoring.
1006 * src/named-ref.h: Add comments.
1007 * src/parse-gram.y: Readability and style changes.
1008 * src/reader.c: Factoring: assign_named_ref function.
1009 * src/scan-code.l: Factoring and style changes. Rename
1010 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
1011 Use "unsigned" type for variant index. Improve readablity.
1012 * src/scan-gram.l: Change error messages and add comments.
1013 * src/symlist.h: symbol_list_null: New function decl.
1014 * src/symlist.c: symbol_list_null: Implement here.
1015 * tests/named-refs.at: Adjust for new error messages.
1016
10172009-06-29 Eric Blake <ebb9@byu.net>
1018
1019 scan-code: avoid compiler warnings
1020 * src/scan-code.l (parse_named_ref): Use correct specifiers.
1021
10222009-06-29 Akim Demaille <demaille@gostai.com>
1023
1024 build: avoid concurrent extraction of calc++.
1025 * examples/calc++/Makefile.am (calc.stamp): New.
1026 Depend on it to create the sources of calc++ so that concurrent
1027 builds don't launch several "extexi" in parallel.
1028 Not only this is inefficient, this also builds incorrect sources
1029 with several extractions mixed together.
1030
10312009-06-29 Akim Demaille <demaille@gostai.com>
1032
1033 parse.error: fix.
1034 * data/bison.m4: Move code related to specific variables after the
1035 definition of the variable-maintaining macros so that we don't
1036 "invoke" b4_percent_define_check_values before it is defined.
1037
10382009-06-29 Akim Demaille <demaille@gostai.com>
1039
1040 variables: parse.error
1041
1042 Implement, document, and test the replacement of %error-verbose
1043 by %define parse.error "verbose".
1044 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
1045 values of the parse.error variable.
1046 Make "simple" its default value.
1047 Check the valid values.
1048 * src/parse-gram.y: Use %define parse.error.
1049 (PERCENT_ERROR_VERBOSE): New token.
1050 Support it.
1051 * src/scan-gram.l: Support %error-verbose.
1052
1053 * doc/bison.texinfo (Decl Summary): Replace the documentation of
1054 %define error-verbose by that of %define parse.error.
1055 * NEWS: Document it.
1056
1057 * tests/actions.at, tests/calc.at: Use parse.error instead of
1058 %error-verbose.
1059
10602009-06-27 Alex Rozenman <rozenman@gmail.com>
1061
1062 Implement support for named symbol references.
1063 * src/parse-gram.y: Add new syntax (named_ref.opt).
1064 * src/reader.c: Store named refs in symbol lists.
1065 * src/reader.h: New argument for symbol_append and
1066 action_append functions.
1067 * src/scan-code.h: Add new field (named_ref) into
1068 code_props data structure. Keeps named ref of midrule
1069 actions.
1070 * src/scan-code.l: Support for named refs in semantic
1071 action code. New function 'parse_named_ref'.
1072 * src/scan-gram.l: Support bracketed id.
1073 * src/symlist.c: Store named refs in symbol lists.
1074 * src/symlist.h: New field in symbol list: named_ref.
1075 * src/named-ref.h: New file, a struct for named_ref.
1076 * src/named-ref.cp: New file, named_ref_new function.
1077 * src/local.mk: Add two new files.
1078 * tests/testsuite.at: Include new test group:
1079 * tests/named-refs.at: this new file.
1080
10812009-06-25 Akim Demaille <demaille@gostai.com>
1082
1083 hash: check insertion for memory exhaustion.
1084 * src/uniqstr.c (uniqstr_new): New.
1085
10862009-06-24 Akim Demaille <demaille@gostai.com>
1087
1088 variables: rename namespace as api.namespace.
1089 Discussed in
1090 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
1091
1092 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1093 New.
1094 (b4_percent_define_use): New.
1095 Use it where applicable.
1096 * data/c++.m4: Replace uses of the variable "namespace" by
1097 "api.namespace".
1098 Default the latter to the former.
1099 * doc/bison.texinfo (Decl Summary): Document "namespace" as
1100 obsolete.
1101 Document api.namespace.
1102 Use @samp to document %define uses, keep @code for identifiers.
1103 * NEWS: Likewise.
1104 * tests/c++.at, tests/input.at: Test api.namespace instead of
1105 namespace. (The tests passed with namespace.)
1106
11072009-06-11 Akim Demaille <demaille@gostai.com>
1108
1109 style changes.
1110 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
1111 * src/print-xml.c: Style changes.
1112 * tests/conflicts.at: Comment changes.
1113
11142009-06-11 Akim Demaille <demaille@gostai.com>
1115
1116 xml: beware of user strings used to give a %prec to rules.
1117 * tests/conflicts.at (%prec with user strings): New.
1118 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
1119 XML output.
1120
11212009-06-11 Akim Demaille <demaille@gostai.com>
1122
1123 hash: check insertion for memory exhaustion.
1124 * src/muscle-tab.c (muscle_insert, muscle_grow)
1125 * src/state.c (state_hash_insert): Check the return value of
1126 hash_insert.
1127
11282009-06-11 Akim Demaille <demaille@gostai.com>
1129
1130 tests: honor TESTSUITEFLAGS in every check target.
1131 * tests/local.mk (RUN_TESTSUITE): New.
1132 (check-local, installcheck-local, maintainer-check-g++)
1133 (maintainer-check-posix, maintainer-check-valgrind): Use it.
1134
11352009-06-10 Akim Demaille <demaille@gostai.com>
1136
1137 deterministic test suite.
1138 Some consistency checks on symbols are performed after all the
1139 symbols were read, by an iteration over the symbol table. This
1140 traversal is nondeterministic, which can be a problem for test
1141 cases.
1142 Avoid this.
1143 Addresses another form of nondeterminism reported by Joel E. Denny.
1144 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1145
1146 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
1147 test in two.
1148 Use different file names for the three tests to make the
1149 maintenance easier.
1150
11512009-06-10 Akim Demaille <demaille@gostai.com>
1152
1153 gnulib: update.
1154 * gnulib: Update to latest.
1155 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
1156 * m4/.gitignore: Regen.
1157 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
1158 Call xalloc_die on hash_insert failures.
1159 Requested by the new __warn_unused_result__ attribute of
1160 hash_insert.
1161
11622009-06-10 Akim Demaille <demaille@gostai.com>
1163
1164 deterministic user-token-number redeclaration errors.
1165 Address nondeterminism reported by Joel E. Denny.
1166 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1167
1168 * src/uniqstr.h: Comment changes.
1169 * src/location.h (boundary_cmp, location_cmp): New.
1170 * src/symtab.c (user_token_number_redeclaration): New.
1171 (symbol_translation): Use it.
1172 * tests/input.at (Numbered tokens): Adjust the expected output.
1173
11742009-05-25 Akim Demaille <demaille@gostai.com>
1175
1176 build: avoid ignored errors.
1177 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
1178 errors, they pollute the output.
1179
11802009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1181
1182 Convert multiple variable definition warnings to complaints.
1183 * NEWS (2.5): Add a new entry for that change.
1184 * doc/bison.texinfo (Decl Summary): Update %define entry.
1185 (Bison Options): Update -D/--define/-F/--force-define entry.
1186 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
1187 * src/muscle-tab.h (muscle_percent_define_insert): Update
1188 comments.
1189 * tests/input.at (`%define errors'): Update.
1190 (`%define, --define, --force-define'): Update.
1191
11922009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1193
1194 -F/--force-define and relative %define/-D/--define priorities.
1195 * NEWS (2.5): Add documentation to -D/--define entry.
1196 * build-aux/cross-options.pl: Hard-code association of
1197 --force-define with %define.
1198 * doc/bison.texinfo (Decl Summary): In %define entry,
1199 cross-reference command-line options.
1200 (Bison Options): Add documentation to -D/--define entry.
1201 (Option Cross Key): Widen column for --force-define row.
1202 * src/getargs.c (usage): Document -F/--force-define. Realign
1203 options in output.
1204 (short_options, long_options, getargs): Parse -F/--force-define,
1205 and update muscle_percent_define_insert invocations.
1206 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
1207 (muscle_percent_define_insert): Add argument with that type.
1208 * src/muscle-tab.c (muscle_percent_define_insert): Implement
1209 -F/--force-define behavior and priorities.
1210 (muscle_percent_define_ensure): Update
1211 muscle_percent_define_insert invocation.
1212 * src/parse-gram.y (prologue_declaration): Update
1213 muscle_percent_define_insert invocations.
1214 * tests/input.at (`%define, --define'): Rename to...
1215 (`%define, --define, --force-define'): ... this and extend.
1216
12172009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1218
1219 Update some comments to make sense for -D.
1220 * data/bison.m4 (b4_check_user_names): In header comments, say
1221 "user occurrence" instead of "grammar occurrence".
1222 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
1223 (muscle_percent_code_grow): Likewise just for consistency.
1224
12252009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1226
1227 * data/c++.m4 (b4_namespace_close): Simplify slightly.
1228
12292009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
1230
1231 Handle a trailing `:' in a user-supplied C++ namespace better.
1232 * data/c++.m4 (b4_namespace_close): Don't let it be printed
1233 among the closing braces here. This fix might make the
1234 generated code easier to debug, but otherwise it should be
1235 insignificant because a trailing `:' is a C++ error already.
1236
12372009-05-19 Akim Demaille <demaille@gostai.com>
1238
1239 remove useless variable.
1240 * src/getargs.c (skeleton_arg): Remove now useless variable.
1241 Should help the compiler see that this printf-like call is sane.
1242
12432009-05-15 Akim Demaille <demaille@gostai.com>
1244
1245 Rename token.prefix as api.tokens.prefix.
1246 Discussed here.
1247 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
1248
1249 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
1250 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
1251 (token.prefix): Rename as...
1252 (api.tokens.prefix): this.
1253
12542009-05-11 Akim Demaille <demaille@gostai.com>
1255
1256 doc: use C++ headers.
1257 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
1258 headers.
1259
12602009-05-11 Akim Demaille <demaille@gostai.com>
1261
1262 doc: token.prefix
1263 * doc/bison.simple (Decl Summary): Document token.prefix.
1264 (Calc++ Parser): Various fixes.
1265 Formatting changes.
1266 Use token.prefix.
1267 Introduce a macro TOKEN to shorten the code and make it more
1268 readable.
1269 (Calc++ Scanner): Adjust.
1270 * NEWS (Variable token.prefix): New.
1271
12722009-05-04 Akim Demaille <demaille@gostai.com>
1273
1274 bison: catch bad symbol names.
1275 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
1276 * tests/input.at: Adjust.
1277
12782009-05-04 Akim Demaille <demaille@gostai.com>
1279
1280 identifiers: dashes are letters.
1281 Dashes can now start identifiers (symbols and directives).
1282
1283 * src/scan-gram.l ({letter}): Add dash.
1284 ({id}): Remove it.
1285 * tests/input.at (Symbols): Adjust.
1286 Remove stray comment.
1287 * tests/regression.at (Invalid inputs): Adjust error message.
1288 * doc/bison.texinfo (Symbols): Update.
1289
12902009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
1291
1292 Declare %code to be a permanent feature.
1293 * NEWS (2.4.2): Here.
1294 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
1295 experimental.
1296 (Decl Summary): Likewise.
1297
12982009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1299
1300 Convert underscores to dashes in some %define variable names.
1301 For now, just api.push-pull and lr.keep-unreachable-states.
1302 Maintain old names for backward compatibility.
1303 * NEWS (2.5): Document.
1304 * data/c.m4 (b4_identification): Update comment.
1305 * data/yacc.c: Update access.
1306 * doc/bison.texinfo: Update.
1307 * etc/bench.pl.in (bench_push_parser): Update use.
1308 * src/files.c (tr): Move to...
1309 * src/getargs.c, src/getargs.h (tr): ... here because I can't
1310 think of a better place to expose it. My logic is that, for all
1311 uses of tr so far, command-line arguments can be involved, and
1312 getargs.h is already included.
1313 * src/main.c (main): Update access.
1314 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
1315 variable names to new variable names before assigning value.
1316 * src/reader.c (reader): Update setting default.
1317 * tests/calc.at: Update uses.
1318 * tests/conflicts.at (Unreachable States After Conflict
1319 Resolution): Update use.
1320 * tests/input.at (%define enum variables): Update use.
1321 (%define backward compatibility): New test group.
1322 * tests/push.at: Update uses.
1323 * tests/reduce.at: Update uses.
1324 * tests/torture.at: Update uses.
1325
13262009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1327
1328 Set all front-end %define defaults in one place.
1329 * src/main.c (main): Move lr.keep_unreachable_states default...
1330 * src/reader.c (reader): ... to here.
1331
13322009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1333
1334 Rename lr.default_reductions to lr.default-reductions.
1335 * NEWS (2.5): Here.
1336 * doc/bison.texinfo: Here.
1337 * src/lalr.c (initialize_LA): Here.
1338 * src/print.c (print_reductions): Here.
1339 * src/reader.c (reader): Here.
1340 * src/tables.c (action_row): Here.
1341 * tests/input.at (%define enum variables): Here.
1342 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
1343
13442009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1345
1346 Pacify ./configure --enable-gcc-warnings.
1347 * tests/input.at (Symbols): Prototype yyerror and yylex.
1348
13492009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1350
1351 Document how `%define "var" "value"' is not M4-friendly.
1352 * src/parse-gram.y (variable): In comments here.
1353
13542009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1355
1356 Clean up recent patches a little.
1357 Reported by Akim Demaille.
1358 * doc/bison.texinfo (Understanding): Fix typos.
1359 * src/print.c (print_reductions): Don't use negated variable.
1360
13612009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1362
1363 List accepted values for a %define enum variable with an invalid value.
1364 Suggested by Akim Demaille at
1365 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
1366 * data/bison.m4 (_b4_percent_define_check_values): Implement.
1367 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
1368 * tests/input.at (%define lr.default_reductions invalid values): Merge
1369 into...
1370 (%define enum variables): ... here, and update output.
1371
13722009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
1373
1374 Rename "default rule" to "default reduction".
1375 This includes changing variable names in code, changing
1376 comments, and renaming %define lr.default_rules to %define
1377 lr.default_reductions.
1378 * NEWS (2.5): Update IELR documentation.
1379 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
1380 documentation.
1381 * data/glr.c, data/lalr1.java: Sync copyright dates.
1382 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
1383 and lr.type documentation. Make some other wording
1384 improvements.
1385 (Glossary): Adjust cross-references and Default Reduction
1386 definition.
1387 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
1388 Remove a confusing comment pointed out by Akim Demaille.
1389 (initialize_LA): Adjust code.
1390 * src/print-xml.c (print_reductions): Adjust code.
1391 * src/print.c (print_reductions): Adjust code.
1392 * src/reader.c (reader): Adjust code.
1393 * src/tables.c (action_row): Adjust code.
1394 (token_actions): Adjust code.
1395 * src/tables.h: Adjust YYDEFACT documentation.
1396 * tests/input.at (%define lr.default_rules invalid values):
1397 Rename test group to...
1398 (%define lr.default_reductions invalid values): ... this, and
1399 update grammar file and expected output.
1400 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
1401 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
1402
14032009-04-21 Akim Demaille <demaille@gostai.com>
1404
1405 tests: check the use of dashes and periods in symbols.
1406 * tests/input.at (Symbol): New test group.
1407
14082009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1409
1410 Document %define lr.type and lr.default_rules.
1411 * NEWS (2.5): Add an entry.
1412 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
1413 besides just LALR(1) and GLR(1).
1414 * doc/bison.texinfo (Introduction): Likewise.
1415 (Language and Grammar): Bison is no longer limited to LALR(1)
1416 restrictions.
1417 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
1418 when trying to distinguish from GLR. Talk about LR(1) grammars
1419 rather than LALR(1) grammars.
1420 (Decl Summary): In %define api.push_pull entry, say it applies
1421 to deterministic parsers in C rather than LALR(1) parsers in C.
1422 Add lr.default_rules entry.
1423 Add lr.type entry.
1424 (Mystery Conflicts): Bison is no longer limited to LALR(1)
1425 restrictions.
1426 (Generalized LR Parsing): Same changes as for the previous GLR
1427 section.
1428 (Memory Management): Say deterministic rather than LALR(1).
1429 (Understanding): Correct some bison output.
1430 Index discussion of "accepting state".
1431 Say deterministic rather than LALR(1).
1432 (Bison Options): In --yacc entry, say deterministic rather than
1433 LALR(1).
1434 In --report, --graph, and --xml entries, just don't mention
1435 LALR(1).
1436 (C++ Parsers): Say deterministic rather than LALR(1).
1437 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
1438 (Glossary): Add Accepting State, Consistent State, Default Rule,
1439 and IELR(1) definitions.
1440 In Generalized LR (GLR) definition, make same changes as in
1441 previous GLR sections.
1442 In LALR(1) definition, say Bison uses LALR(1) by default rather
1443 than implying Bison is limited to LALR(1).
1444 (LocalWords): Add IELR.
1445
14462009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1447
1448 Finish implementing %define lr.type.
1449 Its value can be "LALR", "IELR", or "canonical LR".
1450 * lib/timevar.def (TV_IELR_PHASE1): New var.
1451 (TV_IELR_PHASE2): New var.
1452 (TV_IELR_PHASE3): New var.
1453 (TV_IELR_PHASE4): New var.
1454 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
1455 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
1456 Sbitset.h, ielr.h, and ielr.c.
1457 * src/getargs.h, src/getargs.c (enum trace, trace_args,
1458 trace_types): Add trace_ielr.
1459 * src/lalr.h, src/lalr.c (ngotos): Export it.
1460 (F): Rename to...
1461 (goto_follows): ... this, update all uses, and export it.
1462 (set_goto_map): Export it.
1463 (map_goto): Export it.
1464 (compute_lookahead_tokens): Don't free goto_follows yet. Now
1465 handled in ielr.
1466 (initialize_LA): Export it. Move lookback allocation to...
1467 (lalr): ... here because, for canonical LR, initialize_LA must
1468 be invoked but lookback and much of the rest of LALR isn't
1469 needed.
1470 * main.c (main): Instead of lalr, invoke ielr, which invokes
1471 lalr.
1472 * src/reader.c (reader): Default lr.type to "LALR".
1473 Default lr.default_rules to "accepting" if lr.type is "canonical
1474 LR". Leave the default as "all" otherwise.
1475 Check for a valid lr.type value.
1476 * src/state.h, src/state.c (struct state_list): Add state_list
1477 member.
1478 (state_new): Initialize state_list member to NULL.
1479 (state_new_isocore): New function, exported.
1480 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
1481 exercises all values of lr.type.
1482 (GNU AWK Grammar): Rename test group to...
1483 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
1484 AT_TEST_EXISTING_GRAMMAR.
1485 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
1486 (GNU pic Grammar): Rename test group to...
1487 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
1488 AT_TEST_EXISTING_GRAMMAR.
1489 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
1490 all values of lr.type.
1491 (Single State Split): New test groups using AT_TEST_LR_TYPE.
1492 (Lane Split): Likewise.
1493 (Complex Lane Split): Likewise.
1494 (Split During Added Lookahead Propagation): Likewise.
1495
14962009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1497
1498 Add new files for IELR and canonical LR implementation.
1499 * src/AnnotationList.c: New.
1500 * src/AnnotationList.h: New.
1501 * src/InadequacyList.c: New.
1502 * src/InadequacyList.h: New.
1503 * src/Sbitset.c: New.
1504 * src/Sbitset.h: New.
1505 * src/ielr.c: New.
1506 * src/ielr.h: New.
1507
15082009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1509
1510 Implement %define lr.default_rules.
1511 Its value describes the states that are permitted to contain
1512 default rules: "all", "consistent", or "accepting".
1513 * src/reader.c (reader): Default lr.default_rules to "all".
1514 Check for a valid lr.default_rules value.
1515 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
1516 is "accepting", then only mark the accepting state as
1517 consistent.
1518 (initialize_LA): Tell state_lookahead_tokens_count whether
1519 lr.default_rules is "accepting".
1520 * src/tables.c (action_row): If lr.default_rules is not "all",
1521 then disable default rules in inconsistent states.
1522 * src/print.c (print_reductions): Use this opportunity to
1523 perform some assertions about whether lr.default_rules was
1524 obeyed correctly.
1525 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
1526 helps with checking the parser tables for a grammar.
1527 * tests/input.at (%define lr.default_rules invalid values): New
1528 test group.
1529 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
1530 AT_TEST_TABLES_AND_PARSE.
1531 (`no %define lr.default_rules'): New test group generated by
1532 AT_TEST_LR_DEFAULT_RULES.
1533 (`%define lr.default_rules "all"'): Likewise.
1534 (`%define lr.default_rules "consistent"'): Likewise.
1535 (`%define lr.default_rules "accepting"'): Likewise.
1536
15372009-04-20 Akim Demaille <demaille@gostai.com>
1538
1539 Formatting change.
1540
15412009-04-20 Akim Demaille <demaille@gostai.com>
1542
1543 bison: factoring.
1544 * src/output.c (token_definitions_output): Use symbol_id_get
1545 instead of duplicating its logic.
1546 * TODO (YYERRCODE): Extend.
1547
15482009-04-20 Akim Demaille <demaille@gostai.com>
1549
1550 variables: prefer error-verbose to error_verbose.
1551 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
1552 instead of error_verbose.
1553 * src/scan-gram.l (%error-verbose): Map to the error-verbose
1554 variable.
1555 * doc/bison.texinfo: Promote %define error-verbose instead of
1556 %error-verbose.
1557 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
1558
15592009-04-15 Akim Demaille <demaille@gostai.com>
1560
1561 variables: accept dashes.
1562 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
1563 underscores.
1564 * src/scan-gram.l ({id}): Also accept dashes after the initial
1565 letter.
1566 ({directive}): Use {id}.
1567 * src/parse-gram.y: Comment and formatting changes.
1568 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
1569 symbols.
1570 * src/complain.h, src/complain.c (yacc_at): New.
1571 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
1572 symbol names.
1573 * src/output.c (token_definitions_output): Do not #define token
1574 names with dashes.
1575
15762009-04-20 Akim Demaille <demaille@gostai.com>
1577
1578 Consistently refer to Yacc, not YACC.
1579 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
1580
15812009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
1582
1583 Pacify make maintainer-check-posix.
1584 * tests/input.at (%define, --define): Move bison command-line
1585 options before grammar file name.
1586
15872009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1588
1589 Document semicolon warnings.
1590 * NEWS (2.5): Here.
1591
15922009-04-14 Akim Demaille <demaille@gostai.com>
1593
1594 variables: use `parse.assert' instead of `assert'.
1595 * TODO (assert): Remove.
1596 * data/bison.m4 (b4_assert_if): Replace with...
1597 (b4_parse_assert_if): this.
1598 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
1599 * doc/bison.texinfo (Decl Summary): Document parse.assert.
1600
16012009-04-14 Akim Demaille <demaille@gostai.com>
1602
1603 variables: use `parse.trace' instead of `debug'.
1604 * src/getargs.c (getargs): Map -t to %define trace.parse.
1605 * src/scan-gram.l (%debug): Map to %define trace.parse.
1606 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
1607 names to `_' in macro names.
1608 (b4_debug_if): Replace with...
1609 (b4_parse_trace_if): this.
1610 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1611 * data/yacc.c: Adjust.
1612 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
1613 Use @code to label the variable list.
1614 Document the variable parse.trace.
1615 (Tracing): Promote the parse.trace variable.
1616 * TODO: %printer is not documented.
1617
16182009-04-14 Akim Demaille <demaille@gostai.com>
1619
1620 doc: minor fixes.
1621 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
1622 (Table of Symbols): Remove duplicate entry for %debug.
1623
16242009-04-10 Eric Blake <ebb9@byu.net>
1625
1626 submodules: update to latest
1627 * submodules/autoconf: Use latest upstream Autoconf.
1628
16292009-04-06 Eric Blake <ebb9@byu.net>
1630
1631 Work around autoconf 2.63b bug in testsuite.
1632 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
1633 autoconf bug related to # in test.
1634
16352009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1636
1637 * NEWS (2.5): New section. Describe new -D/--define feature.
1638
16392009-04-06 Akim Demaille <demaille@gostai.com>
1640
1641 Regen.
1642 * src/parse-gram.h, src/parse-gram.c: Regen.
1643
16442009-04-06 Akim Demaille <demaille@gostai.com>
1645
1646 rename muscle_tab.* as muscle-tab.* for consistency.
1647 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
1648 * src/muscle-tab.h, src/muscle-tab.c: these.
1649 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
1650 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
1651
16522009-04-06 Akim Demaille <demaille@gostai.com>
1653
1654 Makefile: introduce $(BISON).
1655 * src/local.mk (BISON): New.
1656 (YACC): Use it.
1657
16582009-04-06 Akim Demaille <demaille@gostai.com>
1659
1660 parser: handle %locations as %define locations.
1661 * src/getargs.h, src/getargs.c (locations_flag): Remove.
1662 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
1663 to set "locations" to true.
1664 * src/output.c (prepare): Don't output "locations".
1665 * src/scan-gram.l (%locations): Handle it as a %<flag>.
1666 * src/parse-gram.y: It's no longer a token.
1667 Don't handle it.
1668 * data/bison.m4 (b4_locations_if): Define it with
1669 b4_percent_define_if_define.
1670 * data/c.m4, data/glr.cc: Adjust.
1671
16722009-04-06 Akim Demaille <demaille@gostai.com>
1673
1674 Regen.
1675 * src/parse-gram.c: Regen.
1676
16772009-04-06 Akim Demaille <demaille@gostai.com>
1678
1679 muscle: factor the handling of obsolete of obsolete directives.
1680 Suggested by Joel E. Denny.
1681
1682 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
1683 New, extracted from...
1684 * src/parse-gram.y (prologue_declaration: pure-parser): here.
1685 Remove it.
1686 (prologue_declaration: "%<flag>"): Use
1687 muscle_percent_define_ensure.
1688 (%error-verbose, %pure-parser): No longer tokens.
1689 * src/scan-gram.l (pure-parser): Return as a %<flag>.
1690
16912009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1692
1693 Fix options documentation.
1694 * build-aux/cross-options.pl: As in --help output, write optional
1695 arguments as [=ARG] not =[ARG].
1696 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
1697
16982009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1699
1700 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
1701 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
1702 requirements for a correct m4 are stricter.
1703 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
1704 * configure.ac: Update to use AC_PROG_GNU_M4.
1705 Reported by Eric Blake.
1706
17072009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1708
1709 Help with updating web manual.
1710 * HACKING: Incorporate instructions from gnulib/doc/README.
1711 * bootstrap.conf (gnulib_modules): Add gendocs.
1712
17132009-04-03 Akim Demaille <demaille@gostai.com>
1714
1715 Regen.
1716 * src/parse-gram.h, src/parse-gram.c: Regen.
1717
17182009-04-03 Akim Demaille <demaille@gostai.com>
1719
1720 Factor %FLAG at scan level.
1721 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
1722 definitions and associated rules, replaced by....
1723 (PERCENT_FLAG): this new token type, and rule.
1724 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
1725 Use it for %debug and %error-verbose.
1726
17272009-04-03 Akim Demaille <demaille@gostai.com>
1728
1729 Regen.
1730 * src/parse-gram.h, src/parse-gram.c: Regen.
1731
17322009-04-03 Akim Demaille <demaille@gostai.com>
1733
1734 Treat %debug as %define debug.
1735 * data/bison.m4 (b4_debug_if): New.
1736 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
1737 * data/lalr1.java: Use it instead of b4_debug_flag.
1738 * src/getargs.h, src/getargs.c (debug_flag): Remove.
1739 * src/output.c (prepare): Don't output it.
1740 * src/parse-gram.y: Treat %debug as %define debug.
1741
17422009-04-03 Akim Demaille <demaille@gostai.com>
1743
1744 Treat %error-verbose as %define error_verbose.
1745 This allows to pass -Derror_verbose on the command line. Better
1746 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
1747 ERROR_VERBOSE being defined as false or true.
1748 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
1749 on b4_percent_define_ifdef, for does not check the defined value,
1750 but only whether the symbol is defined, rely on
1751 b4_percent_define_flag_if, so that a value of "false" is processed
1752 as a false.
1753 If not defined, define the flag to "false".
1754 (b4_error_verbose_if): New.
1755 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
1756 b4_error_verbose_flag.
1757 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
1758 * src/output.c (prepare): Don't output it.
1759 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
1760
17612009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1762
1763 Fix strange %define locations for default values.
1764 Reported by Akim Demaille at
1765 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
1766 and discussed again starting at
1767 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
1768 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
1769 because location information is bogus.
1770 Use angle brackets to delimit fake file name because square brackets
1771 look like underexpanded m4. Choose a better fake file name.
1772 Use negative line numbers.
1773 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
1774 * src/location.c (location_print): If line for a boundary is negative,
1775 only print that boundary's file name.
1776 * src/location.h: Document that.
1777 * tests/skeletons.at (%define Boolean variables: invalid skeleton
1778 defaults): Update output.
1779
17802009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1781
1782 Pacify ./configure --enable-gcc-warnings.
1783 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
1784 in lib won't compile with it.
1785 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
1786
17872009-03-31 Akim Demaille <demaille@gostai.com>
1788
1789 bootstrap: --help to stdout.
1790 * bootstrap (usage): Don't send --help to stderr.
1791 Use a here doc instead of a long string.
1792
17932009-03-31 Akim Demaille <demaille@gostai.com>
1794
1795 bootstrap: README-hacking no longer exists
1796 * bootstrap (checkout_only_file): Set to HACKING.
1797
17982009-03-26 Akim Demaille <demaille@gostai.com>
1799
1800 doc: merge HACKING and README-hacking.
1801 Two files is confusing.
1802 Reported by Alexandre Duret-Lutz.
1803
1804 * README-hacking: Merge into...
1805 * HACKING (Working from the repository): here.
1806
18072009-03-26 Akim Demaille <demaille@gostai.com>
1808
1809 doc: update README-hacking.
1810 * README-hacking: We now use git and git submodules.
1811 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
1812
18132009-03-26 Akim Demaille <demaille@gostai.com>
1814
1815 lalr1.cc: avoid GCC 4.3 warnings.
1816 GCC 4.3 now warns about "a || b && c" and asks for explicit
1817 parentheses.
1818 Reported by Alexandre Duret-Lutz.
1819 * data/location.cc: Update copyright years.
1820 (Position::operator==): Use parens to make precedence explicit.
1821 Compare lines and columns first, as they are more likely to be
1822 different, and they are faster to compare.
1823
18242009-03-26 Akim Demaille <demaille@gostai.com>
1825
1826 gnulib: update.
1827 * gnulib: Update to latest.
1828 * src/local.mk (AM_CFLAGS): Move to...
1829 * Makefile.am: here.
1830 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
1831 AM_CFLAGS.
1832
18332009-03-02 Akim Demaille <demaille@gostai.com>
1834
1835 Comment changes.
1836
18372009-03-02 Akim Demaille <demaille@gostai.com>
1838
1839 Share b4_yytranslate_define.
1840 * data/lalr1.cc (b4_yytranslate_define): Move to...
1841 * data/c++.m4: here.
1842
18432009-03-02 Akim Demaille <demaille@gostai.com>
1844
1845 Use locations in the variant example.
1846 Yes, this obfuscates the point of this example, variants only.
1847 But glr.cc cannot work (yet?) without locations. This change
1848 makes it easier to use this example with glr.cc.
1849
1850 * examples/variant.yy (assert): %define it.
1851 (locations): Request them.
1852 (yylex): Bind the location to the stage.
1853
18542009-03-02 Akim Demaille <demaille@gostai.com>
1855
1856 Dub make_TOKEN as a public type interface.
1857 * data/c++.m4 (b4_symbol_constructor_declare)
1858 (b4_symbol_constructor_define): New empty stubs.
1859 (b4_public_types_declare, b4_public_types_define): Use them.
1860 * data/lalr1.cc (b4_symbol_constructor_declare)
1861 (b4_symbol_constructor_declare_)
1862 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
1863 Move to...
1864 * data/variant.hh: here.
1865 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
1866 needed.
1867 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
1868 b4_symbol_constructor_declare, as it is now done by
1869 b4_public_types_define and b4_public_types_declare.
1870
18712009-03-02 Akim Demaille <demaille@gostai.com>
1872
1873 Coding style changes.
1874 * data/lalr1.cc (b4_symbol_constructor_declaration_)
1875 (b4_symbol_constructor_declarations)
1876 (b4_symbol_constructor_definition_)
1877 (b4_symbol_constructor_definitions)
1878 (b4_yytranslate_definition): Rename as...
1879 (b4_symbol_constructor_declare_)
1880 (b4_symbol_constructor_declare)
1881 (b4_symbol_constructor_define_)
1882 (b4_symbol_constructor_define)
1883 (b4_yytranslate_define): these.
1884 * data/variant.hh (b4_variant_definition): Rename as...
1885 (b4_variant_define): this.
1886
18872009-03-02 Akim Demaille <demaille@gostai.com>
1888
1889 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
1890 * data/bison.m4 (b4_percent_define_if_define): New.
1891 * data/c++.m4 (b4_variant_if): Move to...
1892 * data/bison.m4: Here, using b4_percent_define_if_define.
1893 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
1894 * data/bison.m4: Here, using b4_percent_define_if_define.
1895
18962009-03-02 Akim Demaille <demaille@gostai.com>
1897
1898 Dub symbol_type_base as a public type.
1899 * data/c++.m4 (b4_public_types_declare): Now define
1900 symbol_type_base and symbol_type.
1901 (b4_public_types_define): New.
1902 In both cases, the definitions are taken verbatim from lalr1.cc.
1903 * data/lalr1.cc: Adjust.
1904
19052009-03-02 Akim Demaille <demaille@gostai.com>
1906
1907 b4_public_types_declare.
1908 * data/c++.m4 (b4_public_types_declare): New.
1909 * data/glr.cc, data/lalr1.cc: Use it.
1910
19112009-03-02 Akim Demaille <demaille@gostai.com>
1912
1913 b4_semantic_type_declare.
1914 * data/c++.m4 (b4_semantic_type_declare): New.
1915 Factors and generalizes what was in glr.cc and lalr1.cc.
1916 * data/variant.hh (b4_semantic_type_declare): Redefine it for
1917 variants.
1918 * data/lalr1.cc, data/glr.cc: Use it.
1919
19202009-02-26 Akim Demaille <demaille@gostai.com>
1921
1922 Upgrade gnulib.
1923 * gnulib: Upgrade from master.
1924 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
1925 Regen.
1926
19272009-02-25 Akim Demaille <demaille@gostai.com>
1928
1929 Remove useless arguments.
1930 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
1931 relevant.
1932
19332009-02-25 Akim Demaille <demaille@gostai.com>
1934
1935 Comment changes.
1936 * data/lalr1.cc: here.
1937
19382009-02-25 Akim Demaille <demaille@gostai.com>
1939
1940 Fix glr.cc's debug level handling.
1941 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
1942 glr.c which is used.
1943 (debug_level, set_debug_level): Adjust.
1944
19452009-02-25 Akim Demaille <demaille@gostai.com>
1946
1947 Copyright years.
1948 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
1949
19502009-02-25 Akim Demaille <demaille@gostai.com>
1951
1952 Style changes.
1953 * etc/bench.pl.in (generate_grammar_list): Consitently use
1954 location_type, not yy::location.
1955
19562009-02-25 Akim Demaille <demaille@gostai.com>
1957
1958 Comment change.
1959 * data/lalr1.cc: here.
1960
19612009-02-19 Akim Demaille <demaille@gostai.com>
1962
1963 Make yyparser::error public.
1964 * data/lalr1.cc: here.
1965 There is no good reason to keep it private (and it is convenient
1966 to use it from the scanner for instance). It is already public in
1967 glr.cc.
1968
19692009-02-19 Akim Demaille <demaille@gostai.com>
1970
1971 Comment changes.
1972 * data/glr.cc: here.
1973
19742009-02-19 Akim Demaille <demaille@gostai.com>
1975
1976 Remove trailing blanks.
1977 The epilogue has its own ending \n, no need to add another.
1978
1979 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
1980 epilogue.
1981 * data/glr.cc: dnl when extending the epilogue.
1982 Remove stray "private:".
1983
19842009-02-19 Akim Demaille <demaille@gostai.com>
1985
1986 Use b4_c_modern.
1987 * data/c.m4 (b4_c_function_decl): Here.
1988
19892009-02-19 Akim Demaille <demaille@gostai.com>
1990
1991 Comment changes.
1992 * data/lalr1.cc: here.
1993
19942009-02-19 Akim Demaille <demaille@gostai.com>
1995
1996 Extract variant.hh
1997 * data/variant.hh: New, extracted from...
1998 * data/lalr1.cc: here.
1999 Adjust.
2000 * data/local.mk: Adjust.
2001
20022009-02-19 Akim Demaille <demaille@gostai.com>
2003
2004 Extract stack.hh from lalr1.cc.
2005 * data/stack.hh: New.
2006 * data/lalr1.cc: Extract from here.
2007 * data/local.mk: Adjust.
2008
20092009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
2010
2011 Add reminder about uploading public key to keys.gnupg.net.
2012 * HACKING (Release Procedure): Here.
2013
20142009-01-28 Akim Demaille <demaille@gostai.com>
2015
2016 * NEWS: Update information about 2.4.1 and 2.4.2.
2017
20182008-11-04 Akim Demaille <demaille@gostai.com>
2019
2020 Reformat NEWS.
2021 * NEWS: Use more outline-mode markup.
2022 Suggested by Jim Meyering.
2023
20242009-01-08 Akim Demaille <demaille@gostai.com>
2025
2026 Fix grep portability issues.
2027 Grep on Solaris does not support -q.
2028 Reported by Summum Bonum.
2029
2030 * NEWS: Add a stub for 2.4.2.
2031 * THANKS: Add Summum Bonum.
2032 * tests/atlocal.in (EGREP): New.
2033 (CC, CXX, XSLTPROC): Make it possible to override them via
2034 envvars.
2035 * tests/java.at: Use $EGREP instead of egrep.
2036 Use AT_CHECK's ignore instead of grep's -q.
2037
20382008-12-11 Akim Demaille <demaille@gostai.com>
2039
2040 Pass the token type to yysyntax_error.
2041 * data/yacc.c (yysyntax_error): Take the transated token instead
2042 of the raw number.
2043 Adjust callers.
2044 * TODO: Update.
2045
20462008-12-11 Akim Demaille <demaille@gostai.com>
2047
2048 Formatting changes.
2049 * data/glr.c: Formatting changes.
2050
20512008-12-11 Akim Demaille <demaille@gostai.com>
2052
2053 Propagate i18n changes into glr.c.
2054 * TODO: Update.
2055 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
2056 building the error message format dynamically.
2057 * data/lalr1.java: Formatting changes.
2058
20592008-12-11 Akim Demaille <demaille@gostai.com>
2060
2061 Use testsuite -C.
2062 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
2063 Solves problems when top_srcdir is an absolute path.
2064 Suggested by Eric Blake.
2065 * configure.ac: Require Autoconf 2.62.
2066
20672008-12-11 Akim Demaille <demaille@gostai.com>
2068
2069 Simplify the i18n of the error messages.
2070 * data/lalr1.cc: Comment changes.
2071 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
2072 lalr1.cc instead of building dynamically the format string.
2073
20742008-12-08 Akim Demaille <demaille@gostai.com>
2075
2076 Fix portability issue in the test suite.
2077 * tests/local.at (AT_MATCHES_CHECK): New.
2078 Based on Perl instead of Sed. Sed has too many portability
2079 pitfalls, not ever Sed is GNU Sed.
2080 * tests/actions.at (Fix user actions without a trailing semicolon):
2081 Use it.
2082
20832008-12-08 Akim Demaille <demaille@gostai.com>
2084
2085 Update data/README.
2086 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
2087
20882008-12-08 Akim Demaille <demaille@gostai.com>
2089
2090 Install autoconf as a submodule to get m4sugar.
2091 * .gitmodules: Add submodules/autoconf.
2092 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
2093 submodules/autoconf.
2094
20952008-12-08 Akim Demaille <demaille@gostai.com>
2096
2097 Test token.prefix in all the skeletons.
2098 * data/java.m4 (b4_token_enum): Use the token.prefix.
2099 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
2100 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
2101 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
2102 * tests/java.at: Comment changes.
2103 (AT_CHECK_JAVA_MINIMAL): Define the END token.
2104 (Java parser class and package names): Add token.prefix check.
2105
21062008-12-08 Akim Demaille <demaille@gostai.com>
2107
2108 Fix regeneration of atconfig.
2109 * tests/local.mk (tests/atconfig): The rule was incorrect, but
2110 remove it: now that there is no tests/Makefile.am, the top-level
2111 Makefile properly updates atconfig when needed.
2112
21132008-12-07 Di-an Jan <dianj@freeshell.org>
2114
2115 Implement the FIXME that ends an user action with a semicolon
2116 if it seems necessary.
2117 * src/scan-code.l (flex rules section): Flag cpp directive from
2118 any `#' to the first unescaped end-of-line. Semicolon is not
2119 needed after `;', `{', '}', or cpp directives and is needed after
2120 any other token (whitespaces and comments have no effect).
2121 * tests/actions.at (Fix user actions without a trailing semicolon):
2122 New test.
2123 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
2124 to make user actions complete statements.
2125 Adjust column numbers in error messages.
2126 * tests/regression.at (Fix user actions without a trailing semicolon):
2127 Remove. Covered by new test.
2128
21292008-12-07 Akim Demaille <demaille@gostai.com>
2130
2131 Update gnulib.
2132 * gnulib: Update from master.
2133
21342008-12-05 Eric Blake <ebb9@byu.net>
2135
2136 Avoid compiler warning.
2137 * src/output.c (muscle_insert_item_number_table): Delete unused
2138 function.
2139
21402008-12-02 Eric Blake <ebb9@byu.net>
2141
2142 Build testsuite with newer autoconf.
2143 * tests/output.at (m4_expand): Don't override in newer autoconf,
2144 where the underlying implementation changed.
2145 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
2146 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
2147 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
2148 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
2149 since some of them contain unbalanced ')'.
2150
21512008-12-01 Akim Demaille <demaille@gostai.com>
2152
2153 Use b4_symbol for printers and destructors everywhere.
2154 * data/bison.m4 (b4_symbol_action_location): New.
2155 * data/c.m4 (b4_symbol_actions): Remove.
2156 Adjust all callers to use by b4_symbol_foreach and the corresponding
2157 b4_symbol_printer/destructor macro.
2158 * data/glr.cc: Adjust.
2159 * data/lalr1.java: Adjust the %destructor sanity check.
2160 * src/output.c (symbol_code_props_output): Remove, we no longer
2161 need the b4_symbol_printers/destructors tables.
2162
21632008-12-01 Akim Demaille <demaille@gostai.com>
2164
2165 Use b4_symbol_case_.
2166 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
2167 b4_symbol_case_.
2168
21692008-12-01 Akim Demaille <demaille@gostai.com>
2170
2171 Move b4_symbol based macro to bison.m4.
2172 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
2173 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
2174 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
2175 (b4_type_foreach): Move to...
2176 * data/bison.m4: Here.
2177 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
2178 b4_symbol_value_template instead of b4_symbol_value.
2179
21802008-12-01 Akim Demaille <demaille@gostai.com>
2181
2182 b4_symbol/type_foreach.
2183 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
2184 Use them.
2185
21862008-12-01 Akim Demaille <demaille@gostai.com>
2187
2188 Use the symbol properties to output the printer/destructor for lalr1.cc.
2189 Instead of defining complex list of tuples to define various
2190 properties of the symbols, we now prefer to define symbols as
2191 "structs" in m4: using the symbol key (its number), and the
2192 property name, b4_symbol gives it value. Use this to handle
2193 destructors and printers.
2194
2195 * src/output.c (CODE_PROP): New.
2196 (prepare_symbol_definitions): Use it to define the printer and
2197 destructor related attributes of the symbols.
2198 * data/lalr1.cc (b4_symbol_actions): Rename as...
2199 (b4_symbol_action): this.
2200 Use b4_symbol instead of 6 arguments.
2201 (b4_symbol_printer, b4_symbol_destructor): New.
2202 Use them instead of b4_symbol_actions.
2203
22042008-12-01 Akim Demaille <demaille@gostai.com>
2205
2206 Avoid capturing variables too easily.
2207 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
2208 v__ and p__ instead of v and p.
2209
22102008-12-01 Akim Demaille <demaille@gostai.com>
2211
2212 Remove spurious empty line before syncline.
2213 * data/bison.m4 (b4_syncline): Don't output an empty line before
2214 the output.
2215
22162008-11-26 Akim Demaille <demaille@gostai.com>
2217
2218 Convert lib/Makefile.am into lib/local.mk.
2219 The real problem is rather gnulib.mk, which itself is extracted
2220 from a Makefile.am that gnulib expects to the "recursive". The
2221 tool prefix-gnulib-mk converts such a gnulib.mk to be
2222 non-recursive. Also, some AC_SUBST variables need to be adjusted.
2223
2224 * etc/prefix-gnulib-mk: New.
2225 * bootstrap (slurp): Use it to convert further gnulib.mk.
2226 No longer try to avoid re-creation of lib/gnulib.mk as the changes
2227 are deeper.
2228 * lib/Makefile.am: Rename as...
2229 * lib/local.mk: this.
2230 Adjust to be prefixed.
2231 * Makefile.am, configure.ac: Adjust.
2232 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
2233
22342008-11-26 Akim Demaille <demaille@gostai.com>
2235
2236 s/_FLAGS/FLAGS/.
2237 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
2238 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
2239 Reported by Eric Blake.
2240
22412008-11-26 Akim Demaille <demaille@gostai.com>
2242
2243 Use b4_parser_tables_define in glr.cc.
2244 * data/glr.c: Use b4_parser_tables_define instead of defining the
2245 (deterministic integral) tables by hand.
2246
22472008-11-26 Akim Demaille <demaille@gostai.com>
2248
2249 Use b4_parser_tables_define in Java.
2250 * data/java.m4 (b4_typed_parser_table): Rename as...
2251 (b4_typed_parser_table_define): this, for consistency.
2252 Accept a comment as $4.
2253 Move $2 into yy*_.
2254 (b4_integral_parser_table): Rename as...
2255 (b4_integral_parser_table_define): this.
2256 * data/lalr1.java: Adjust all uses.
2257 Use b4_parser_tables_define instead of generation by hand.
2258
22592008-11-26 Akim Demaille <demaille@gostai.com>
2260
2261 Prepare the convergence bw C style and Java table generation.
2262 * data/bison.m4 (b4_tables_map, b4_tables_declare)
2263 (b4_tables_define): Rename as...
2264 (b4_integral_parser_tables_map, b4_parser_tables_declare)
2265 (b4_parser_tables_define): these.
2266 * data/c.m4 (b4_table_define): Rename as...
2267 (b4_integral_parser_table_define): this.
2268 * data/lalr1.cc: Adjust.
2269 (b4_table_define, b4_table_declare): Rename as...
2270 (b4_integral_parser_table_define)
2271 (b4_integral_parser_table_declare): these.
2272 (yyrline_): Move the comment where it is actually used.
2273 * data/yacc.c: Adjust.
2274 (yyrline): Use b4_integral_parser_table_define.
2275
22762008-11-26 Akim Demaille <demaille@gostai.com>
2277
2278 Regen.
2279 * src/parse-gram.h, src/parse-gram.c: Regen.
2280
22812008-11-26 Akim Demaille <demaille@gostai.com>
2282
2283 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
2284 * data/lalr1.cc (b4_tables_map): Move to...
2285 * data/bison.m4: here.
2286 Update the comment for yytable during the flight.
2287 (b4_tables_declare, b4_tables_define): New.
2288 * data/lalr1.cc: Use them.
2289 * data/c.m4 (b4_table_define): New.
2290 * data/yacc.c: Use b4_tables_define instead of output the tables
2291 by hand.
2292 * tests/regression.at (Web2c Actions): Adjust the expected output,
2293 the order of the tables changed.
2294
22952008-11-26 Akim Demaille <demaille@gostai.com>
2296
2297 Get rid of (yy)rhs and (yy)prhs.
2298 These tables are no longer needed in the parsers, and they don't seem to
2299 be useful. They are not documented either.
2300
2301 * src/output.c (prepare_rules): Get rid of rhs and prhs.
2302 Adjust the computation of (yy)r2.
2303
23042008-11-26 Akim Demaille <demaille@gostai.com>
2305
2306 Rule length is unsigned.
2307 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
2308
23092008-11-26 Akim Demaille <demaille@gostai.com>
2310
2311 Get rid of lalr1-split.cc.
2312 It was no longer maintainer.
2313
2314 * data/lalr1-split.cc: Remove.
2315 * etc/bench.pl.in (bench_fusion_parser): Remove.
2316 Adjust.
2317
23182008-11-26 Akim Demaille <demaille@gostai.com>
2319
2320 Use yy* consistently.
2321 * data/glr.c: Now that yyrhs no longer exists as a global
2322 variable, rename local "rhs" variables into "yyrhs" for
2323 consistency.
2324
23252008-11-25 Akim Demaille <demaille@gostai.com>
2326
2327 Get rid of yyrhs and yyprhs in glr.c.
2328 * data/glr.c (yyrhs, yyprhs): Remove.
2329 Instead, use the state stack and yystos.
2330
23312008-11-25 Akim Demaille <demaille@gostai.com>
2332
2333 Flag glr tests.
2334 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
2335 as an Autotest keyword.
2336
23372008-11-25 Akim Demaille <demaille@gostai.com>
2338
2339 Prefer TESTSUITE_FLAGS.
2340 TESTSUITEFLAGS is barely readable.
2341
2342 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
2343 for backward compatibility.
2344 Use the former instead of the latter.
2345
23462008-11-25 Akim Demaille <demaille@gostai.com>
2347
2348 Get rid of yyrhs and yyprhs in larl1.java.
2349 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
2350 (yy_reduce_print): Rather, use yystos_ and the state stack.
2351
23522008-11-25 Akim Demaille <demaille@gostai.com>
2353
2354 Formatting changes.
2355
23562008-11-25 Akim Demaille <demaille@gostai.com>
2357
2358 Get rid of yyrhs and yyprhs in yacc.c.
2359 They were used to get the symbol types, given a rule number, when
2360 displaying the top of the stack before a reduction. But the
2361 symbol type is available from the state stack. This has two be
2362 benefits: two tables less in the parser (making it smaller), and a
2363 more consistent use of the three stacks which will help to fuse
2364 them.
2365
2366 * data/yacc.c (yyprhs, yyrhs): Remove.
2367 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
2368 (yy_reduce_print): Take yyssp as argument.
2369 Use it, together with yystos, to get the symbol type.
2370 * tests/regression.at (Web2c Report): Remove these tables from the
2371 expected output.
2372
23732008-11-25 Akim Demaille <demaille@gostai.com>
2374
2375 b4_tables_map.
2376 The point is to factor the generation of the tables across skeletons.
2377 This is language dependant.
2378
2379 * data/c.m4 (b4_comment_): New.
2380 Should be usable to define how to generate tables independently of
2381 the language.
2382 (b4_c_comment): New.
2383 (b4_comment): Bounce to b4_c_comment.
2384 Now support $2 = [PREFIX] for indentation.
2385 * data/lalr1.cc (b4_table_declare): Don't output a comment if
2386 there is no comment.
2387 Indent it properly when there is one.
2388 Output the ending semicolon.
2389 (b4_table_define): Space changes.
2390 Output the ending semicolon.
2391 (b4_tables_map): New.
2392 Use it twice instead of declaring and defining the (integral)
2393 tables by hand.
2394
23952008-11-25 Akim Demaille <demaille@gostai.com>
2396
2397 b4_table_declare.
2398 * data/lalr1.cc (b4_table_declare): New.
2399 Use it to declare the tables defined with b4_table_define.
2400 (b4_table_define): Declare a third arg to match b4_table_declare
2401 signature.
2402 Move all the comments around invocations of b4_table_define into
2403 the invocations itselves.
2404 Move things around to have the order for declarations and
2405 definitions.
2406
24072008-11-25 Akim Demaille <demaille@gostai.com>
2408
2409 Formatting changes.
2410 * data/lalr1.java: here.
2411
24122008-11-25 Akim Demaille <demaille@gostai.com>
2413
2414 b4_args is more general than only C++.
2415 * data/lalr1.cc (b4_args, _b4_args): Move to...
2416 * data/bison.m4: here.
2417
24182008-11-21 Di-an Jan <dianj@freeshell.org>
2419
2420 Implement no-XXX arguments for --warnings, --report, --trace.
2421 * src/getargs.c (flags_argmatch): Handles no-XXX.
2422 Fix typo in doxygen comment.
2423
24242008-11-21 Akim Demaille <demaille@gostai.com>
2425
2426 Display the changes in cross-options.texi.
2427 * build-aux/cross-options.pl ($sep): New, to separate items.
2428 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
2429 changes.
2430
24312008-11-20 Di-an Jan <dianj@freeshell.org>
2432
2433 Improves options in the manual.
2434 * doc/bison.texinfo (-g, -x): Add space before argument.
2435 (Option Cross Key): Implement FIXME: listing directives also.
2436 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
2437 (Short Option): Special case -d. Put arguments inside @option.
2438 (Bison Directive): Add column, automatically extracted from
2439 src/scan-gram.l (actual name passed as the first argument)
2440 with special case for %define.
2441 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
2442 to build-aux/cross-options.pl.
2443 * src/getargs.c (usage): Document limitations of cross-options.pl.
2444 * src/scan-gram.l: Likewise.
2445
24462008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2447
2448 Fix unexpanded macros in GLR defines file.
2449 Reported by Csaba Raduly at
2450 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
2451 * THANKS (Csaba Raduly): Add.
2452 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
2453 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
2454 lexer in a separate module that includes the defines file.
2455 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
2456 source.
2457 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
2458 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
2459 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
2460 (AT_DATA_SOURCE_PROLOGUE): New.
2461 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
2462 (AT_DATA_SOURCE): New.
2463 (AT_FULL_COMPILE): Extend to support an additional source file.
2464
24652008-11-18 Akim Demaille <demaille@gostai.com>
2466
2467 More TODO.
2468 * TODO: More short term issues.
2469
24702008-11-18 Akim Demaille <demaille@gostai.com>
2471
2472 Regen.
2473 * src/parse-gram.h, src/parse-gram.c: Regen.
2474
24752008-11-18 Akim Demaille <demaille@gostai.com>
2476
2477 Use b4_subtract where possible.
2478 * data/lalr1.cc (b4_subtract): Move to...
2479 * data/bison.m4: here.
2480 * data/glr.c (b4_rhs_data): Use it.
2481 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
2482
24832008-11-18 Akim Demaille <demaille@gostai.com>
2484
2485 Remove incorrect mode specification.
2486 * data/glr.cc: Don't pretend it's C code.
2487
24882008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2489
2490 Simplify last patch slightly.
2491 * src/getargs.c (getargs): Here.
2492
24932008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2494
2495 Fix last warning from --enable-gcc-warnings.
2496 * src/getargs.c (getargs): Don't assign const address to non-const
2497 pointer.
2498
24992008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2500
2501 Don't let maintainer-*-check targets force a version update.
2502 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
2503 handled.
2504
25052008-11-17 Di-an Jan <dianj@freeshell.org>
2506
2507 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
2508 Align menus. Adjust word wrapping. Use node names for menu names.
2509 (Examples): Don't abbreviate node names.
2510 (LocalWords): Remove abbreviations.
2511 (Copying): Make description a sentence.
2512 (Java Action Features): Remove period to match the rest of menu.
2513
25142008-11-17 Di-an Jan <dianj@freeshell.org>
2515
2516 Handles several --enable-gcc-warnings.
2517 * src/getargs.c (command_line_location): Set parameters to void.
2518 * src/output.c (symbol_type_name_cmp): Make static.
2519 (symbols_by_type_name): Set parameters to void.
2520 (symbol_definitions_output): Remove unused parameter. Rename as...
2521 (prepare_symbol_definitions): this.
2522 (muscles_output): Move symbol_definitions_output to...
2523 (output): here as prepare_symbol_definitions.
2524 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
2525 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
2526
25272008-11-17 Di-an Jan <dianj@freeshell.org>
2528
2529 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
2530 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
2531
25322008-11-16 Akim Demaille <demaille@gostai.com>
2533
2534 Add missing $(EXEEXT).
2535 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
2536 "src/bison$(EXEEXT)".
2537 Reported by Di-an Jan.
2538
25392008-11-15 Akim Demaille <demaille@gostai.com>
2540
2541 * TODO: Update.
2542
25432008-11-15 Akim Demaille <demaille@gostai.com>
2544
2545 Formatting changes.
2546 * tests/input.at: here.
2547
25482008-11-15 Akim Demaille <demaille@gostai.com>
2549
2550 Remove duplicate header inclusion.
2551 * src/LR0.c: here.
2552
25532008-11-15 Akim Demaille <demaille@gostai.com>
2554
2555 * src/parse-gram.h, src/parse-gram.c: Regen.
2556
25572008-11-15 Akim Demaille <demaille@gostai.com>
2558
2559 Support parametric types.
2560
2561 There are two issues to handle: first scanning nested angle
2562 bracket pairs to support types such as std::pair< std::string,
2563 std::list<std::string> > >.
2564
2565 Another issue is to address idiosyncracies of C++: do not glue two
2566 closing angle brackets together (otherwise it's operator>>), and
2567 avoid sticking blindly a TYPE to the opening <, as it can result
2568 in '<:' which is a digraph for '['.
2569
2570 * src/scan-gram.l (brace_level): Rename as...
2571 (nesting): this.
2572 (SC_TAG): New.
2573 Implement support for complex tags.
2574 (tag): Accept
2575 , but not <.
2576 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
2577 (b4_symbol_variant): Leave space around types as parameters.
2578 * examples/variant.yy: Use nested template types and leading ::.
2579 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
2580 Rename as...
2581 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
2582 * tests/c++.at: Test parametric types.
2583
25842008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2585
2586 Test token.prefix.
2587 This is not sufficient, but we test at least that the make_SYMBOL
2588 interface is not affected by token.prefix. A more general test
2589 will be implemented when the support of token.prefix is generalized
2590 to more skeletons.
2591
2592 * tests/c++.at: One more variant test, using token.prefix.
2593
25942008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2595
2596 Test the make_TOKEN interface.
2597 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
2598 Factor the common code in yylex.
2599 Use it to test "%define lex_symbol".
2600
26012008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2602
2603 Formatting change.
2604
26052008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2606
2607 Simplify code for variants bench marks.
2608 * etc/bench.pl.in (&generate_grammar_list): Define and use
2609 location_type.
2610 Factor the common code in yylex.
2611
26122008-11-15 Akim Demaille <demaille@gostai.com>
2613
2614 Better error message.
2615 * bootstrap (find_tool): Fix the error message.
2616
26172008-11-15 Akim Demaille <demaille@gostai.com>
2618
2619 Update variant.yy to newest interface.
2620 * examples/variant.yy: Define lex_symbol.
2621 Adjust.
2622
26232008-11-15 Akim Demaille <demaille@gostai.com>
2624
2625 Don't use locations in variant.yy.
2626 * examples/variant.yy: Adjust to not using locations.
2627
26282008-11-15 Akim Demaille <demaille@gostai.com>
2629
2630 Comment changes.
2631 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
2632 comments for the license.
2633
26342008-11-15 Akim Demaille <demaille@gostai.com>
2635
2636 Remove tests/Makefile.am.
2637 * tests/Makefile.am: Rename as...
2638 * tests/local.mk: this.
2639 * Makefile.am, configure.ac: Adjust.
2640 * Makefile.am (DISTCLEANFILES): Define.
2641 (maintainer-check, maintainer-xml-check, maintainer-push-check):
2642 Remove, we no longer need to bounce to the real targets.
2643
26442008-11-15 Akim Demaille <demaille@gostai.com>
2645
2646 Comment changes.
2647
26482008-11-15 Akim Demaille <demaille@gostai.com>
2649
2650 djgpp/local.mk.
2651 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
2652 * djgpp/local.mk: this new file.
2653
26542008-11-15 Akim Demaille <demaille@gostai.com>
2655
2656 Remove doc/Makefile.am.
2657 * doc/Makefile.am: Rename as...
2658 * doc/local.mk: this.
2659 Adjust paths
2660 * Makefile.am, configure.ac: Adjust.
2661 * Makefile.am (MOSTLYCLEANFILES): New.
2662 * src/local.mk: Adjust.
2663
26642008-11-15 Akim Demaille <demaille@gostai.com>
2665
2666 Move sc_tight_scope into maint.mk.
2667 It does not work, and I don't know how it was supposed to work: it
2668 seems to be looking for sources in the build tree. I just moved
2669 it at a better place, fixing it is still required.
2670
2671 * src/local.mk (echo): Remove.
2672 (sc_tight_scope): Move to...
2673 * maint.mk: here.
2674
26752008-11-15 Akim Demaille <demaille@gostai.com>
2676
2677 Regen.
2678 * src/parse-gram.h, src/parse-gram.h: Regen.
2679
26802008-11-15 Akim Demaille <demaille@gostai.com>
2681
2682 Remove src/Makefile.am.
2683 * src/Makefile.am: Rename as...
2684 * src/local.mk: this.
2685 Prefix all the paths with src/.
2686 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
2687 (AM_CPPFLAGS): Find find in builddir/src.
2688 (YACC): Move the flags into...
2689 (AM_YFLAGS): here.
2690 * maint.mk (sc_tight_scope): Disable.
2691 It used to bounce to the version in src/Makefile.am which is now
2692 part of this very Makefile.
2693 * Makefile.am, configure.ac: Adjust.
2694 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
2695 include "..." to find files "here": we are no longer in src/, so
2696 qualify the includes with src/.
2697 * doc/Makefile.am (PREPATH): No longer include the top_builddir
2698 prefix.
2699 (.x.1): Adjust to be able to create src/foo from the top level
2700 Makefile, instead of going bounce to src/Makefile the creation of
2701 foo.
2702
27032008-11-15 Akim Demaille <demaille@gostai.com>
2704
2705 Remove useless variable.
2706 * doc/Makefile.am (srcsrcdir): Remove.
2707
27082008-11-15 Akim Demaille <demaille@gostai.com>
2709
2710 Remove data/Makefile.am.
2711 * data/Makefile.am: Rename as...
2712 * data/local.mk: this.
2713 Adjust paths.
2714 * Makefile.am, configure.ac: Adjust.
2715
27162008-11-15 Akim Demaille <demaille@gostai.com>
2717
2718 Remove etc/Makefile.am.
2719 * etc/Makefile.am: Rename as...
2720 * etc/local.mk: this.
2721 Adjust.
2722 * Makefile.am, configure.ac: Adjust.
2723
27242008-11-15 Akim Demaille <demaille@gostai.com>
2725
2726 Remove examples/local.mk.
2727 examples/calc++/Makefile.am might be interesting to keep as is, since
2728 it is an example in itself.
2729
2730 * examples/Makefile.am: Rename as...
2731 * examples/local.mk: this.
2732 Adjust.
2733 * Makefile.am, configure.ac: Adjust.
2734
27352008-11-15 Akim Demaille <demaille@gostai.com>
2736
2737 Remove build-aux/Makefile.am.
2738 Recursive Makefiles are really way too slow, let's get rid of some of
2739 them.
2740
2741 * build-aux/Makefile.am: Rename as...
2742 * build-aux/local.mk: this.
2743 Adjust paths.
2744 * Makefile.am, configure.ac: Adjust.
2745
27462008-11-15 Akim Demaille <demaille@gostai.com>
2747
2748 Provide convenience constructors for locations and positions.
2749 * data/location.cc (position::position): Accept file, line and
2750 column as arguments with default values.
2751 Always qualify initial line and column literals as unsigned.
2752 (location::location): Provide convenience constructors.
2753
27542008-11-15 Akim Demaille <demaille@gostai.com>
2755
2756 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
2757 token type.
2758 Using template buys us nothing, and makes it uselessly complex to
2759 construct a symbol. Besides, it could not be generalized to other
2760 languages, while make_FOO would work in C/Java etc.
2761
2762 * data/lalr1.cc (b4_symbol_): New.
2763 (b4_symbol): Use it.
2764 (b4_symbol_constructor_declaration_)
2765 (b4_symbol_constructor_definition_): Instead of generating
2766 specializations of an overloaded template function, just generate
2767 several functions whose names are forged from the token names
2768 without the token.prefix.
2769 (b4_symbol_constructor_declarations): Generate them for all the
2770 symbols, not just by class of symbol type, now that instead of
2771 specializing a function template by the token, we generate a
2772 function named after the token.
2773 (b4_symbol_constructor_specialization_)
2774 (b4_symbol_constructor_specializations): Remove.
2775 * etc/bench.pl.in: Adjust to this new API.
2776
27772008-11-13 Akim Demaille <demaille@gostai.com>
2778
2779 %define token.prefix.
2780 Provide a means to add a prefix to the name of the tokens as
2781 output in the generated files. Because of name clashes, it is
2782 good to have such a prefix such as TOK_ that protects from names
2783 such as EOF, FILE etc. But it clutters the grammar itself.
2784
2785 * data/bison.m4 (token.prefix): Empty by default.
2786 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
2787 * data/lalr1.cc (b4_symbol): Ditto.
2788
27892008-11-13 Akim Demaille <demaille@gostai.com>
2790
2791 Compute at M4 time some of the subtractions.
2792 * data/lalr1.cc (b4_subtract): New.
2793 (b4_rhs_data): Use it.
2794
27952008-11-13 Akim Demaille <demaille@gostai.com>
2796
2797 symbol::token.
2798 This allows the user to get the type of a token returned by yylex.
2799
2800 * data/lalr1.cc (symbol::token): New.
2801 (yytoknum_): Define when %define lex_symbol, independently of
2802 %debug.
2803 (yytoken_number_): Move into...
2804 (symbol::token): here, since that's the only use.
2805 The other one is YYPRINT which was not officially supported
2806 by lalr1.cc, and anyway it did not work since YYPRINT uses this
2807 array under a different name (yytoknum).
2808
28092008-11-13 Akim Demaille <demaille@gostai.com>
2810
2811 YYERRCODE.
2812 * TODO (YYERRCODE): Mention the case of $undef.
2813
28142008-11-13 Akim Demaille <demaille@gostai.com>
2815
2816 TODO: YYPRINT.
2817 * TODO (YYPRINT): New.
2818
28192008-11-13 Akim Demaille <demaille@gostai.com>
2820
2821 Comment changes.
2822 * data/lalr1.cc, data/yacc.c: Fix the description of the
2823 yytranslate and yytoknum tables.
2824
28252008-11-13 Akim Demaille <demaille@gostai.com>
2826
2827 Define make_symbol in the header.
2828 To reach good performances these functions should be inlined (yet
2829 this is to measure precisely). To this end they must be available
2830 to the caller.
2831
2832 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
2833 location_type with the class name.
2834 Since will now be output in the header, declare "inline".
2835 No longer use b4_symbol_constructor_specializations, but
2836 b4_symbol_constructor_definitions in the header.
2837 Don't call it in the *.cc file.
2838
28392008-11-13 Akim Demaille <demaille@gostai.com>
2840
2841 Define yytranslate in the header for lex_symbol.
2842 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
2843 into the header file when using %define lex_symbol.
2844 (yytranslate_): Declare inline.
2845
28462008-11-13 Akim Demaille <demaille@gostai.com>
2847
2848 Define the constructors of symbol_type in
2849 b4_symbol_constructor_definitions.
2850 The constructors are called by the make_symbol functions, which a
2851 forthcoming patch will move elsewhere. Hence the interest of
2852 putting them together.
2853
2854 The stack_symbol_type does not need to be moved, it is used only
2855 by the parser.
2856
2857 * data/lalr1.cc: Move symbol_type and symbol_base_type
2858 constructors into...
2859 (b4_symbol_constructor_definitions): here.
2860 Adjust.
2861
28622008-11-13 Akim Demaille <demaille@gostai.com>
2863
2864 Make it easier to move the definition of yytranslate_.
2865 Forthcoming changes will make it possible to use yytranslate_
2866 from outside the parser implementation file.
2867
2868 * data/lalr1.cc (b4_yytranslate_definition): New.
2869 Use it.
2870
28712008-11-13 Akim Demaille <demaille@gostai.com>
2872
2873 Remove useless class specification.
2874 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
2875 to refer to the class name to use a type defined by the class for
2876 arguments of member functions.
2877
28782008-11-13 Akim Demaille <demaille@gostai.com>
2879
2880 Finer input type for yytranslate.
2881 This patch is debatable: the tradition expects yylex to return an int
2882 which happens to correspond to token_number (which is an enum). This
2883 allows for instance to return characters (such as '*' etc.). But this
2884 goes against the stronger typing I am trying to have with the new
2885 lex interface which return a symbol_type. So in this case, feed
2886 yytranslate_ with a token_type.
2887
2888 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
2889 expect a token_type.
2890
28912008-11-13 Akim Demaille <demaille@gostai.com>
2892
2893 Honor lex-params in %define lex_symbol mode.
2894 * data/lalr1.cc: Use b4_lex_param.
2895
28962008-11-13 Akim Demaille <demaille@gostai.com>
2897
2898 Simplify names.
2899 * src/output.c (symbol_definitions_output): Rename symbol
2900 attributes type_name and has_type_name as type and has_type.
2901 * data/lalr1.cc: Adjust uses.
2902
29032008-11-13 Akim Demaille <demaille@gostai.com>
2904
2905 Use b4_type_names for the union type.
2906 The union used to compute the size of the variant used to iterate
2907 over the type of all the symbols, with a lot of redundancy. Now
2908 iterate over the lists of symbols having the same type-name.
2909
2910 * data/lalr1.cc (b4_char_sizeof_): New.
2911 (b4_char_sizeof): Use it.
2912 Adjust to be called with a list of numbers instead of a single
2913 number.
2914 Adjust its caller for new-line issues.
2915
29162008-11-13 Akim Demaille <demaille@gostai.com>
2917
2918 Define the "identifier" of a symbol.
2919 Symbols may have several string representations, for instance if
2920 they have an alias. What I call its "id" is a string that can be
2921 used as an identifier. May not exist.
2922
2923 Currently the symbols which have the "tag_is_id" flag set are
2924 those that don't have an alias. Look harder for the id.
2925
2926 * src/output.c (is_identifier): Move to...
2927 * src/symtab.c (is_identifier): here.
2928 * src/symtab.h, src/symtab.c (symbol_id_get): New.
2929 * src/output.c (symbol_definitions_output): Use it to define "id"
2930 and "has_id".
2931 Remove the definition of "tag_is_id".
2932 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
2933 "tag_is_id" were used to produce code.
2934 We still use "tag" for documentation.
2935
29362008-11-11 Akim Demaille <demaille@gostai.com>
2937
2938 Locations are no longer required by lalr1.cc.
2939 * data/lalr1.cc (_b4_args, b4_args): New.
2940 Adjust all uses of locations to make them optional.
2941 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
2942 (AT_CHECK_NAMESPACE): Check the use of locations.
2943 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
2944 without locations with lalr1.cc.
2945 Test these cases.
2946 * tests/output.at: Check lalr1.cc with and without location
2947 support.
2948 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
2949 Don't use locations.
2950
29512008-11-11 Akim Demaille <demaille@gostai.com>
2952
2953 AT_FULL_COMPILE.
2954 * tests/local.at (AT_FULL_COMPILE): New.
2955 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
2956
29572008-11-11 Akim Demaille <demaille@gostai.com>
2958
2959 Support parens in calc++.
2960 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
2961 * examples/calc++/test (run): Check the expected output.
2962 Adjust callers.
2963 Check parens too.
2964
29652008-11-11 Akim Demaille <demaille@gostai.com>
2966
2967 Simplify lalr1.cc since %defines is mandatory.
2968 * data/lalr1.cc: Remove useless calls to b4_defines_if.
2969
29702008-11-11 Akim Demaille <demaille@gostai.com>
2971
2972 TODO: yyfmt.
2973 * TODO (yysyntax_error): New item.
2974
29752008-11-11 Akim Demaille <demaille@gostai.com>
2976
2977 Prefer M4 to CPP.
2978 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
2979 YYERROR_VERBOSE.
2980
29812008-11-11 Akim Demaille <demaille@gostai.com>
2982
2983 Support i18n of the parse error messages.
2984 * TODO (lalr1.cc/I18n): Remove.
2985 * data/lalr1.cc (yysyntax_error_): Support the translation of the
2986 error messages, as done in yacc.c.
2987 Stay within the yy* pseudo namespace.
2988
29892008-11-11 Akim Demaille <demaille@gostai.com>
2990
2991 More TODO.
2992 * TODO (single stack, yysyntax_error): New.
2993
29942008-11-11 Akim Demaille <demaille@gostai.com>
2995
2996 Make it possible to return a symbol_type from yylex.
2997 * data/lalr1.cc (b4_lex_symbol_if): New.
2998 (parse): When lex_symbol is defined, expected yylex to return the
2999 complete lookahead.
3000 * etc/bench.pl.in (generate_grammar_list): Extend to support this
3001 yylex interface.
3002 (bench_variant_parser): Exercise it.
3003
30042008-11-11 Akim Demaille <demaille@gostai.com>
3005
3006 Remove useless bench case.
3007 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
3008 no longer used.
3009
30102008-11-11 Akim Demaille <demaille@gostai.com>
3011
3012 Improve display of directives.
3013 * etc/bench.pl.in (parse_term): Don't add useless eol.
3014
30152008-11-11 Akim Demaille <demaille@gostai.com>
3016
3017 Use string_cast in the bench.
3018 * etc/bench.pl.in (generate_grammar_list): Define and use
3019 string_cast.
3020
30212008-11-11 Akim Demaille <demaille@gostai.com>
3022
3023 Replace yychar with a Boolean.
3024 * data/lalr1.cc (parse::yychar): Replace by...
3025 (parse::yyempty): this.
3026
30272008-11-11 Akim Demaille <demaille@gostai.com>
3028
3029 Factor the tables.
3030 * TODO: New item.
3031
30322008-11-11 Akim Demaille <demaille@gostai.com>
3033
3034 Let yytranslate handle the eof case.
3035 * data/lalr1.cc (yytranslate_): Handle the EOF case.
3036 Adjust callers.
3037 No longer expect yychar to be equal to yyeof_, rather, test the
3038 lookahead's (translated) kind.
3039
30402008-11-11 Akim Demaille <demaille@gostai.com>
3041
3042 yychar cannot be empty in yyerrlab.
3043 * TODO (yychar == yyempty_): New.
3044 * data/lalr1.cc: Remove the handling of this case.
3045 This eases forthcoming changes related to yychar and yytranslate.
3046
30472008-11-11 Akim Demaille <demaille@gostai.com>
3048
3049 Bench: syntactic sugar for %define/#define.
3050 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
3051 (&bench_push_parser, bench_variant_parser): Use this feature.
3052 (&eat): New.
3053 Use it.
3054
30552008-11-11 Akim Demaille <demaille@gostai.com>
3056
3057 Less memory pressure on the "list" bench.
3058 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
3059 the values, to limit memory pressure.
3060
30612008-11-11 Akim Demaille <demaille@gostai.com>
3062
3063 Introduce make_symbol.
3064 make_symbol provides a means to construct a full symbol (kind,
3065 value, location) in a single shot. It is meant to be a Symbol
3066 constructor, parameterized by the symbol kind so that overloading
3067 would prevent incorrect kind/value pairs. Unfortunately
3068 parameterized constructors do not work well in C++ (unless the
3069 parameter also appears as an argument, which is not acceptable),
3070 hence the use of a function instead of a constructor.
3071
3072 * data/lalr1.cc (b4_symbol_constructor_declaration_)
3073 (b4_symbol_constructor_declarations)
3074 (b4_symbol_constructor_specialization_)
3075 (b4_symbol_constructor_specializations)
3076 (b4_symbol_constructor_definition_)
3077 (b4_symbol_constructor_definitions): New.
3078 Use them where appropriate to generate declaration, declaration of
3079 the specializations, and implementations of the templated
3080 overloaded function "make_symbol".
3081 (variant::variant): Always define a default ctor.
3082 Also provide a copy ctor.
3083 (symbol_base_type, symbol_type): New ctor overloads for value-less
3084 symbols.
3085 (symbol_type): Now public, so that functions such as yylex can use
3086 it.
3087
30882008-11-11 Akim Demaille <demaille@gostai.com>
3089
3090 Inform m4 whether a tag is a valid id.
3091 * src/output.c (is_identifier): New.
3092 (symbol_definitions_output): Use it to define tag_is_id.
3093 But maybe this should be done at m4 level?
3094
30952008-11-11 Akim Demaille <demaille@gostai.com>
3096
3097 Test 214 was failing: it greps with a pattern containing [ ]*
3098 which obviously meant to catch spaces and tabs, but contained only
3099 spaces. Tabulations in sources are a nuisance, so to simplify the
3100 matter, get rid of all the tabulations in the Java sources. The
3101 other skeletons will be treated equally later.
3102
3103 * data/java.m4, data/lalr1.java: Untabify.
3104 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
3105 tabulations are no longer generated.
3106
31072008-11-11 Paolo Bonzini <bonzini@gnu.org>
3108
3109 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
3110 * configure.ac: Adjust usage.
3111 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3112 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3113 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
3114
31152008-11-10 Di-an Jan <dianj@freeshell.org>
3116
3117 Workaround Java's ``code too large'' problem for parser tables
3118 in most cases, by using one function per initialization.
3119 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
3120 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
3121 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
3122 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
3123 (yytname_): Use b4_typed_parser_table.
3124 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
3125 ``code too large'' error.
3126
31272008-11-10 Di-an Jan <dianj@freeshell.org>
3128
3129 * NEWS: Document them.
3130
3131 General Java skeleton improvements.
3132 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
3133 using gcj < 4.3 in the testsuite, according to comments in
3134 gnulib/m4/javacomp.m4.
3135 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
3136 location_type, position_type): Remove extraneous brackets from
3137 b4_percent_define_default.
3138 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
3139 m4_define and m4_define_default.
3140 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
3141 which marks the end of user code with appropriate syncline, like all
3142 the other skeletons.
3143 (b4_user_post_prologue): Add. Don't silently drop.
3144 (yylex): Remove.
3145 (parse): Inline yylex.
3146 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
3147 (%{...%}): Fix typo of %code imports.
3148 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
3149
3150 Support annotations on parser class with %define annotations.
3151 * data/lalr1.java (annotations): Add to parser class modifier.
3152 * doc/bison.texinfo (Java Parser Interface): Document
3153 %define annotations.
3154 (Java Declarations Summary): Document %define annotations.
3155 * tests/java.at (Java parser class modifiers): Test annotations.
3156
3157 Do not generate code for %error-verbose unless requested.
3158 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
3159 Make private. Make conditional on %error-verbose.
3160 (getErrorVerbose, setErrorVerbose): New.
3161 (yytnamerr_): Make conditional on %error-verbose.
3162 (yysyntax_error): Make some code conditional on %error-verbose.
3163 * doc/bison.texinfo (Java Bison Interface): Remove the parts
3164 about %error-verbose having no effect.
3165 (getErrorVerbose, setErrorVerbose): Document.
3166
3167 Move constants for token names to Lexer interface.
3168 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
3169 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
3170 (parse): Qualify EOF to Lexer.EOF.
3171 * doc/bison.texinfo (Java Parser Interface): Move documentation of
3172 EOF and token names to Java Lexer Interface.
3173 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
3174
3175 Make yyerror public.
3176 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
3177 (yyerror): Change to public. Add Javadoc comments. Use longer
3178 parameter names. Make the body rather than the declarator
3179 conditional on %locations.
3180 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
3181
3182 Allow user to add code to the constructor with %code init.
3183 * data/java.m4 (b4_init_throws): New, for %define init_throws.
3184 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
3185 Add %code init to the front of the constructor body.
3186 * doc/bison.texinfo (YYParser.YYParser): Document %code init
3187 and %define init_throws.
3188 (Java Declarations Summary): Document %code init and
3189 %define init_throws.
3190 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
3191 (Java constructor init and init_throws): Add tests.
3192
31932008-11-10 Akim Demaille <demaille@gostai.com>
3194
3195 Update TODO.
3196 * TODO (-D): is implemented.
3197 (associativity): Same precedence must have the same associativity.
3198 For instance, how can a * b / c be parsed if * is %left and / is
3199 %right?
3200 (YYERRORCODE, YYFAIL, YYBACKUP): New.
3201
32022008-11-10 Akim Demaille <demaille@gostai.com>
3203
3204 Formatting changes.
3205
32062008-11-10 Akim Demaille <demaille@gostai.com>
3207
3208 More information about the symbols.
3209 * src/output.c (type_names_output): Document all the symbols,
3210 including those that don't have a type-name.
3211 (symbol_definitions_output): Define "is_token" and
3212 "has_type_name".
3213 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
3214 type-name, now that they are defined too in b4_type_names.
3215
32162008-11-10 Akim Demaille <demaille@gostai.com>
3217
3218 Regen.
3219
32202008-11-10 Akim Demaille <demaille@gostai.com>
3221
3222 Make parser::yytranslate static.
3223 Small speedup (1%) on the list grammar. And makes yytranslate_
3224 available in non member functions.
3225
3226 * data/lalr1.cc (yytranslate_): Does not need to be a instance
3227 function.
3228
32292008-11-10 Akim Demaille <demaille@gostai.com>
3230
3231 Avoid trailing spaces.
3232 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
3233 * data/lalr1.cc: Don't indent before rule and symbol actions, as
3234 they can be empty, and anyway this incorrectly indents the first
3235 action.
3236
32372008-11-10 Akim Demaille <demaille@gostai.com>
3238
3239 Comment changes.
3240
32412008-11-10 Akim Demaille <demaille@gostai.com>
3242
3243 Use "enum" for integral constants.
3244 This is just nicer to read, I observed no speedup.
3245
3246 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
3247 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
3248 (yyuser_token_number_max_, yyundef_token_): Move into...
3249 (yytranslate_): here.
3250
32512008-11-10 Akim Demaille <demaille@gostai.com>
3252
3253 Shortcuts in bench directives.
3254 * etc/bench.pl.in (parse_dirs): New.
3255 Use it.
3256 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
3257 Create the benches in "benches/".
3258
32592008-11-10 Akim Demaille <demaille@gostai.com>
3260
3261 Formatting changes.
3262 * data/lalr1.cc: here.
3263
32642008-11-10 Akim Demaille <demaille@gostai.com>
3265
3266 Adjust verbose message to using emacs.
3267 * etc/bench.pl.in: Inform compilation-mode when we change the
3268 directory.
3269 (generate_grammar_list): Recognize %define "variant" in addition
3270 to %define variant.
3271
32722008-11-10 Akim Demaille <demaille@gostai.com>
3273
3274 Classify symbols by type-name.
3275 * src/uniqstr.h (UNIQSTR_CMP): New.
3276 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
3277 (type_names_output): New.
3278 (muscles_output): Use it.
3279 * data/lalr1.cc (b4_symbol_action_): Remove.
3280 (b4_symbol_case_, b4_type_action_): New.
3281 Adjust uses of b4_symbol_action_ to use b4_type_action_.
3282
32832008-11-10 Akim Demaille <demaille@gostai.com>
3284
3285 Change the handling of the symbols in the skeletons.
3286 Before we were using tables which lines were the symbols and which
3287 columns were things like number, tag, type-name etc. It is was
3288 difficult to extend: each time a column was added, all the numbers had
3289 to be updated (you asked for colon $2, not for "tag"). Also, it was
3290 hard to filter these tables when only a subset of the symbols (say the
3291 tokens, or the nterms, or the tokens that have and external number
3292 *and* a type-name) was of interest.
3293
3294 Now instead of monolithic tables, we define one macro per cell. For
3295 instance "b4_symbol(0, tag)" is a macro name which contents is
3296 self-decriptive. The macro "b4_symbol" provides easier access to
3297 these cells.
3298
3299 * src/output.c (type_names_output): Remove.
3300 (symbol_numbers_output, symbol_definitions_output): New.
3301 (muscles_output): Call them.
3302 (prepare_symbols): Define b4_symbols_number.
3303
33042008-11-10 Akim Demaille <demaille@gostai.com>
3305
3306 --trace=muscles
3307 * src/getargs.h, src/getargs.c (trace_muscle): New.
3308 (trace_types, trace_args): Support it.
3309 * src/output.c (output_skeleton): Use it.
3310
33112008-11-10 Akim Demaille <demaille@gostai.com>
3312
3313 muscles_output.
3314 * src/output.c (muscles_output): New, extracted from...
3315 (output_skeleton): here.
3316 Adjust.
3317
33182008-11-10 Akim Demaille <demaille@gostai.com>
3319
3320 Formatting changes.
3321
33222008-11-10 Akim Demaille <demaille@gostai.com>
3323
3324 Update the variant example.
3325 * examples/variant.yy: Formatting changes.
3326 One stage build.
3327
33282008-11-10 Akim Demaille <demaille@gostai.com>
3329
3330 Support constructor with an argument.
3331 This improves the "list" bench by 2%.
3332
3333 * data/lalr1.cc (variant::build): Add an overloaded version with
3334 an argument.
3335 * tests/c++.at (AT_CHECK_VARIANT): Check it.
3336
33372008-11-10 Akim Demaille <demaille@gostai.com>
3338
3339 Test variants.
3340 * tests/c++.at (AT_CHECK_VARIANTS): New.
3341 Use it with and without %define assert.
3342
33432008-11-10 Akim Demaille <demaille@gostai.com>
3344
3345 Add %precedence support.
3346 Unfortunately it is not possible to reuse the %prec directive. This
3347 is because to please POSIX, we do not require to end the rules with a
3348 semicolon. As a result,
3349
3350 foo: bar %prec baz
3351
3352 is ambiguous: either a rule which precedence is that of baz, or a rule,
3353 and then a declaration of the precedence of the token baz.
3354
3355 * doc/bison.texinfo: Document %precedence.
3356 (Precedence Only): New.
3357 * src/assoc.h, src/assoc.c (precedence_assoc): New.
3358 * src/conflicts.c (resolve_sr_conflict): Support it.
3359 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
3360 Parse it.
3361 * tests/calc.at: Use %precedence for NEG.
3362 * tests/conflicts.at (%precedence does not suffice)
3363 (%precedence suffices): New tests.
3364
33652008-11-09 Akim Demaille <demaille@gostai.com>
3366
3367 Make benches in a sub dirs.
3368 * etc/bench.pl.in ($dir): New.
3369 Use it.
3370 Check the use of constructors with an argument.
3371 (bench_variant_parser): Fix.
3372
33732008-11-09 Akim Demaille <demaille@gostai.com>
3374
3375 fix eof condition
3376
33772008-11-09 Akim Demaille <demaille@gostai.com>
3378
3379 Fix --help.
3380
33812008-11-09 Akim Demaille <demaille@gostai.com>
3382
3383 Require the generation of parse-gram.output.
3384 * src/Makefile.am (YACC): Pass --report=all.
3385
33862008-11-09 Akim Demaille <demaille@gostai.com>
3387
3388 Formatting changes.
3389
33902008-11-09 Akim Demaille <demaille@gostai.com>
3391
3392 Update TODO.
3393 * TODO: Remove obsolete items.
3394 Update others.
3395
33962008-11-09 Akim Demaille <demaille@gostai.com>
3397
3398 Enhance bench.pl.
3399 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
3400 (@token, $grammar, $bench): New.
3401 (generate_grammar_variant): Rename as...
3402 (generate_grammar_list): this.
3403 (generate_grammar): Adjust.
3404 (bench_grammar): Rename as...
3405 (bench): this.
3406 Use it in the various bench-marking routines.
3407 (-b, -g): New options.
3408
34092008-11-09 Akim Demaille <demaille@gostai.com>
3410
3411 Use a static hierarchy for symbols in the C++ parser.
3412 * data/lalr1.cc (symbol_base_type, symbol_type)
3413 (stack_symbol_type): Make it a static hierarchy.
3414 Adjust dependencies.
3415
34162008-11-09 Akim Demaille <demaille@gostai.com>
3417
3418 bench.pl -d, --directive.
3419 * etc/bench.pl.in (@directive): New.
3420 (&bench_grammar): Use it.
3421 (&bench_list_grammar): New, to provide access to the "variant"
3422 grammar.
3423 Use it.
3424 (getopts): Support -d, --directive.
3425
34262008-11-09 Akim Demaille <demaille@gostai.com>
3427
3428 Use inline for small operations.
3429 * data/lalr1.cc (symbol_base_type, symbol_type)
3430 (stack_symbol_type): Declare constructor and other operations as
3431 inline.
3432 (yy_destroy_): Inline.
3433
34342008-11-09 Akim Demaille <demaille@gostai.com>
3435
3436 Introduce a hierarchy for symbols.
3437 * data/lalr1.cc (symbol_base_type, symbol_type): New.
3438 (data_type): Rename as...
3439 (stack_symbol_type): this.
3440 Derive from symbol_base_type.
3441 (yy_symbol_value_print_): Merge into...
3442 (yy_symbol_print_): this.
3443 Rename as...
3444 (yy_print_): this.
3445 (yydestruct_): Rename as...
3446 (yy_destroy_): this.
3447 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
3448 (parser::parse): yyla is now of symbol_type.
3449 Use its type member instead of yytoken.
3450
34512008-11-09 Akim Demaille <demaille@gostai.com>
3452
3453 Rename data_type and stack_symbol_type.
3454 * data/lalr1.cc (data_type): Rename as...
3455 (stack_symbol_type): this.
3456
34572008-11-09 Akim Demaille <demaille@gostai.com>
3458
3459 Handle semantic value and location together.
3460 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
3461 yydata.value and yydata.location.
3462 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
3463 (YY_SYMBOL_PRINT): Now take semantic value and location as a
3464 single arg.
3465 Adjust all callers.
3466 (yydestruct_): New overload for a stack symbol.
3467
34682008-11-09 Akim Demaille <demaille@gostai.com>
3469
3470 Push a complete symbol, not connected parts.
3471 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
3472 state, value and location.
3473 Adjust callers.
3474
34752008-11-09 Akim Demaille <demaille@gostai.com>
3476
3477 Agregate yylval and yylloc.
3478 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
3479 (parser::yyla): this.
3480
34812008-11-09 Akim Demaille <demaille@gostai.com>
3482
3483 Rely on the state stack to display reduction traces.
3484 To display rhs symbols before a reduction, we used information
3485 about the rule reduced, which required the tables yyrhs and
3486 yyprhs. Now use rely only on the state stack to get the same
3487 information.
3488
3489 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
3490 Use them.
3491 (parser::yyrhs_, parser::yyprhs_): Remove.
3492 (parser::yy_reduce_print_): Use the state stack.
3493
34942008-11-09 Akim Demaille <demaille@gostai.com>
3495
3496 Fuse yyval and yyloc into yylhs.
3497 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
3498 yylhs.
3499 (parse): Replace yyval and yyloc with yylhs.value and
3500 yylhs.location.
3501 After a user action, compute yylhs.state earlier.
3502 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
3503 fresh error_token.
3504
35052008-11-09 Di-an Jan <dianj@freeshell.org>
3506
3507 Remove unused variable.
3508 * src/output.c (type_names_output): Remove unused variable sep.
3509
35102008-11-09 Paolo Bonzini <bonzini@gnu.org>
3511
3512 Change tests/output.at quoting.
3513 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
3514 expanding arguments.
3515
35162008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3517
3518 Don't add a semicolon to actions for %skeleton or %language.
3519 It breaks Java test cases as reported by Akim Demaille.
3520 * src/scan-code.l: Implement.
3521
35222008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3523
3524 Clean up %skeleton and %language priority implementation.
3525 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
3526 remove static qualifier because others will soon need to see it.
3527 (language_prio): Likewise.
3528 (getargs): Use command_line_prio rather than 0.
3529 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
3530 enum fields.
3531 (skeleton_prio): Extern it.
3532 (language_prio): Extern it.
3533 * src/parse-gram.y: Use grammar_prio rather than 1.
3534
35352008-11-07 Akim Demaille <demaille@gostai.com>
3536
3537 Moving push traces into yypush_.
3538 * data/lalr1.cc (yypush_): Now takes a optional trace message.
3539 Adjust all uses.
3540
35412008-11-07 Akim Demaille <demaille@gostai.com>
3542
3543 The single-stack C++ parser is now the standard one.
3544 * data/lalr1.cc: Rename as...
3545 * data/lalr1-split.cc: this.
3546 * data/lalr1-fusion.cc: Rename as...
3547 * data/lalr1.cc: this.
3548 * etc/bench.pl.in: Adjust.
3549
35502008-11-07 Akim Demaille <demaille@gostai.com>
3551
3552 Avoid empty-if warnings.
3553 Reported by Quentin Hocquet.
3554
3555 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
3556 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
3557
35582008-11-07 Akim Demaille <demaille@gostai.com>
3559
3560 Pass command line location to skeleton_arg and language_argmatch.
3561 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
3562 The location argument is now mandatory.
3563 Adjust all dependencies.
3564 (getargs): Use command_line_location.
3565
35662008-11-07 Akim Demaille <demaille@gostai.com>
3567
3568 -D, --define.
3569 * src/getargs.c (usage): Document -D.
3570 Fix help string for --locations.
3571 (command_line_location): New.
3572 (short_options, long_options, getargs): Support -D, --define.
3573 (getargs): Move -d support at the right place.
3574 * doc/bison.texinfo (Bison Options): Update.
3575 * tests/input.at (%define, --define): New.
3576
35772008-11-07 Akim Demaille <demaille@gostai.com>
3578
3579 Initialize the muscle table before parsing the command line.
3580 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
3581 (getargs): Define file_name.
3582 * src/main.c (main): Initialize muscle_tab before calling
3583 getargs.
3584 * src/muscle_tab.c (muscle_init): No longer define file_name, as
3585 its value is not available yet.
3586
35872008-11-07 Akim Demaille <demaille@gostai.com>
3588
3589 Locations without columns for command line arguments.
3590 * src/location.c (location_print): Don't display negative columns.
3591 * src/location.h: Document this.
3592
35932008-11-07 Akim Demaille <demaille@gostai.com>
3594
3595 Fix --help.
3596 * src/getargs.c (usage): Fix help string for -W.
3597
35982008-11-07 Akim Demaille <demaille@gostai.com>
3599
3600 Handle more general types of option arguments.
3601 * build-aux/cross-options.pl: The argument ends at the first
3602 space, not the first non-symbol character.
3603 Use @var for each word appearing the argument description.
3604
36052008-11-07 Akim Demaille <demaille@gostai.com>
3606
3607 Destroy the variants that remain on the stack in case of error.
3608 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
3609 destructor.
3610 Display the value only if yymsg is nonnull.
3611 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
3612
36132008-11-07 Akim Demaille <demaille@gostai.com>
3614
3615 Add "%define assert" to variants.
3616 This is used to help the user catch cases where some value gets
3617 ovewritten by a new one. This should not happen, as this will
3618 probably leak.
3619
3620 Unfortunately this uncovered a bug in the C++ parser itself: the
3621 lookahead value was not destroyed between two calls to yylex. For
3622 instance if the previous lookahead was a std::string, and then an int,
3623 then the value of the std::string was correctly taken (i.e., the
3624 lookahead was now an empty string), but std::string structure itself
3625 was not reclaimed.
3626
3627 This is now done in variant::build(other&) (which is used to take the
3628 value of the lookahead): other is not only stolen from its value, it
3629 is also destroyed. This incurs a new performance penalty of a few
3630 percent, and union becomes faster again.
3631
3632 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
3633 (b4_variant_if): New.
3634 (variant::built): New.
3635 Use it whereever the status of the variant changes.
3636 * etc/bench.pl.in: Check the penalty of %define assert.
3637
36382008-11-07 Akim Demaille <demaille@gostai.com>
3639
3640 Use "%define variant" in bench.pl.
3641 * etc/bench.pl.in: No longer use the pseudo directive %variants,
3642 just use %define variants.
3643
36442008-11-07 Akim Demaille <demaille@gostai.com>
3645
3646 Regen.
3647 * src/parse-gram.h, src/parse-gram.c: Regen.
3648
36492008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
3650
3651 Fix user actions without a trailing semicolon.
3652 Reported by Sergei Steshenko at
3653 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
3654 * THANKS (Sergei Steshenko): Add.
3655 * src/scan-code.l (SC_RULE_ACTION): Fix it.
3656 * tests/regression.at (Fix user actions without a trailing semicolon):
3657 New test case.
3658
36592008-11-04 Akim Demaille <demaille@gostai.com>
3660
3661 Use b4_copyright_years.
3662 * data/yacc.c (b4_copyright_years): New.
3663 Fix its value according to the comments in the file.
3664 Use it and undefine it.
3665
36662008-11-04 Akim Demaille <demaille@gostai.com>
3667
3668 Formatting changes.
3669 * data/lalr1-fusion.cc, src/parse-gram.y: here.
3670
36712008-11-04 Akim Demaille <demaille@gostai.com>
3672
3673 Formatting changes.
3674 * data/lalr1-fusion.cc: here.
3675
36762008-11-04 Akim Demaille <demaille@gostai.com>
3677
3678 Use strict on bench.pl.
3679 * etc/bench.pl.in (&run, &generate_grammar): New.
3680 Rename the grammar generating functions for consistency.
3681 Change the interface so that the list of benches to run is passed
3682 as (optionless) arguments.
3683 (&compile): Use &run.
3684
36852008-11-04 Akim Demaille <demaille@gostai.com>
3686
3687 Remove spurious initial empty lines.
3688 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
3689 * data/yacc.c: End the @output lines with an @.
3690
36912008-11-04 Akim Demaille <demaille@gostai.com>
3692
3693 Improve the display of sizes.
3694 * etc/bench.p.in: Higher precision.
3695 Sort by decreasing size.
3696
36972008-11-04 Akim Demaille <demaille@gostai.com>
3698
3699 Don't memcpy C++ structures.
3700 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
3701 arguments.
3702 (variant::build): New overload for
3703 copy-construction-that-destroys.
3704 (variant::swap): New.
3705 (parser::yypush_): Use it in variant mode.
3706
37072008-11-04 Akim Demaille <demaille@gostai.com>
3708
3709 Better defaults for bench.pl.
3710 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
3711 default values.
3712 Adjust &verbose uses.
3713 (-q, --quiet): New.
3714
37152008-11-04 Akim Demaille <demaille@gostai.com>
3716
3717 Make variant.yy more complex.
3718 std::list cannot be copied via memcpy, they are more demanding than
3719 std::string. Use one std::list to strengthen the test.
3720
3721 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
3722 Adjust.
3723 Create a list of strings, instead of a single large string.
3724
37252008-11-04 Akim Demaille <demaille@gostai.com>
3726
3727 bench.pl --bench.
3728 * etc/bench.pl.in (--bench, $bench): New.
3729
37302008-11-04 Akim Demaille <demaille@gostai.com>
3731
3732 Sort methods.
3733 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
3734 Define it after as().
3735
37362008-11-04 Akim Demaille <demaille@gostai.com>
3737
3738 Useless parens.
3739 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
3740
37412008-11-04 Akim Demaille <demaille@gostai.com>
3742
3743 Issue missing synclines after user actions.
3744 * data/c.m4 (b4_case): Issue synclines on the output file.
3745
37462008-11-04 Akim Demaille <demaille@gostai.com>
3747
3748 Remove trailing empty line.
3749 * data/lalr1-fusion.cc: Don't add an empty line after the user's
3750 epilogue.
3751
37522008-11-04 Akim Demaille <demaille@gostai.com>
3753
3754 Fix output of copyright years.
3755 * data/bison.m4 (b4_copyright): Fix the indentation of the
3756 copyright year paragraph.
3757 Use b4_copyright_years when no years are given.
3758 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
3759 (b4_copyright_years): New.
3760 Use it.
3761
37622008-11-04 Akim Demaille <demaille@gostai.com>
3763
3764 Avoid the spurious initial empty line.
3765 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
3766 the end of @output request to suppress the empty line that
3767 results.
3768
37692008-11-04 Akim Demaille <demaille@gostai.com>
3770
3771 Remove parser::rhs_number_type.
3772 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
3773 (yyrhs_): Use b4_table_define.
3774
37752008-11-04 Akim Demaille <demaille@gostai.com>
3776
3777 Fix iteration type.
3778 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
3779
37802008-11-04 Akim Demaille <demaille@gostai.com>
3781
3782 Factor the declaration of the integer tables.
3783 * data/lalr1-fusion.cc (b4_table_define): New.
3784 Use it.
3785
37862008-11-03 Akim Demaille <demaille@gostai.com>
3787
3788 Fix indentation of tables in lalr1.cc
3789 * data/lalr1-fusion.cc: Fix the indentation.
3790
37912008-11-03 Akim Demaille <demaille@gostai.com>
3792
3793 Destroy the lhs symbols after reduction.
3794 * data/lalr1-fusion.cc (parse): After the user action, when in
3795 variant mode, destroy the lhs symbols.
3796
37972008-11-03 Akim Demaille <demaille@gostai.com>
3798
3799 Simplify yysyntax_error_ use.
3800 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
3801 type, but make it unnamed in the declaration when it is not used.
3802
38032008-11-03 Akim Demaille <demaille@gostai.com>
3804
3805 Let yy::variant::build return an lvalue.
3806 * data/lalr1-fusion.cc (variant::build): Return a reference to the
3807 object.
3808
38092008-11-03 Akim Demaille <demaille@gostai.com>
3810
3811 Define yy::variant only when needed.
3812 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
3813 used.
3814
38152008-11-03 Akim Demaille <demaille@gostai.com>
3816
3817 Bench the three-stack lalr1.cc.
3818 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
3819 one-stack one.
3820
38212008-11-03 Akim Demaille <demaille@gostai.com>
3822
3823 Fail on parse error in calc++.
3824 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
3825 status.
3826 * examples/calc++/test ($me, $number, $exit, run): New.
3827 Use them to propagate errors to the exit status.
3828
38292008-11-03 Akim Demaille <demaille@gostai.com>
3830
3831 Don't specify the skeleton twice in the example.
3832 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
3833 file does what is needed.
3834
38352008-11-03 Akim Demaille <demaille@gostai.com>
3836
3837 bench: Improve output.
3838 * etc/bench.pl.in (bench_grammar): Tune the printf format.
3839
38402008-11-03 Akim Demaille <demaille@gostai.com>
3841
3842 bench: check impact of %debug on variants.
3843 * etc/bench.pl.in (variant_grammar): Fix the computation of
3844 $variant.
3845 Generate a grammar file that can work with or without %debug.
3846 Do use the @directive.
3847 (bench_variant_parser): Check impact of %debug.
3848 (@directives): Rename all the occurrences to...
3849 (@directive): this, for consistency.
3850
38512008-11-03 Akim Demaille <demaille@gostai.com>
3852
3853 bench: report the size too.
3854 * etc/bench.pl.in ($iterations): Defaults to -3.
3855 (&bench_grammar): Require hireswallclock.
3856 Compute and display the size of the result.
3857 More comments.
3858
38592008-11-03 Akim Demaille <demaille@gostai.com>
3860
3861 bench: More use of the verbosity level.
3862 * etc/bench.pl.in ($verbose, &verbose): New.
3863 Use them.
3864 More POD documentation.
3865
38662008-11-03 Akim Demaille <demaille@gostai.com>
3867
3868 bench.pl: a command line interface
3869 * etc/bench.pl.in: More doc.
3870 Some fixes in the documentation.
3871 ($cflags, $iterations, &help, &getopt): New.
3872 Use them.
3873 (&variant_grammar): Let the number of stages be 10 times what is
3874 specified.
3875
38762008-11-03 Akim Demaille <demaille@gostai.com>
3877
3878 Bench the use of Boost.Variants.
3879 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
3880 New.
3881 (&compile): Be ready to compile C++ parsers.
3882 (&bench_push_parser): Move debug information to the outermost
3883 level.
3884 * THANKS: Add Michiel De Wilde.
3885
38862008-11-03 Akim Demaille <demaille@gostai.com>
3887
3888 bench.pl: Pass directives as a list instead of as a string.
3889 * etc/bench.pl.in (&directives): New.
3890 (&triangular_grammar, &calc_grammar): Use it to format the Bison
3891 directives.
3892 (&triangular_grammar): Do use the directives (were ignored).
3893 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
3894 directives.
3895
38962008-11-03 Akim Demaille <demaille@gostai.com>
3897
3898 Improve genericity of bench.pl.
3899 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
3900 argument.
3901 (&bench_push_parser): New.
3902 Call it.
3903
39042008-11-03 Akim Demaille <demaille@gostai.com>
3905
3906 Add documentation to bench.pl.
3907 * etc/bench.pl.in: Comment changes.
3908
39092008-11-03 Akim Demaille <demaille@gostai.com>
3910
3911 Fuse the three stacks into a single one.
3912
3913 In order to make it easy to perform benchmarks to ensure that
3914 there are no performance loss, lalr1.cc is forked into
3915 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
3916 lalr1.cc.
3917
3918 Meanwhile, to make sure that lalr1-fusion.cc is correctly
3919 exercized by the test suite, the user must install a symbolic link
3920 from lalr1.cc to it.
3921
3922 Instead of having three stacks (state, value, location), use a
3923 stack of triples. This considerably simplifies the code (and it
3924 will be easier not to require locations as currently does the C++
3925 parser), and also gives a 10% speedup according to
3926 etc/bench (probably mainly since memory allocation is done once
3927 instead of three times).
3928
3929 Another motivation is to make it easier to destruct properly
3930 semantic values: now that they are bound to their state (hence
3931 symbol type) it will be easier to call the appropriate destructor.
3932
3933 These changes should probably benefit the C parser too.
3934
3935 * data/lalr1.cc: Copy as...
3936 * data/lalr1-fusion.cc: this new file.
3937 (b4_rhs_value, b4_rhs_location): New definitions overriding those
3938 from c++.m4.
3939 (state_stack_type, semantic_stack_type, location_stack_type)
3940 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
3941 (data_type, stack_type, yystack_): New.
3942 (YYLLOC_DEFAULT, yypush_): Adjust.
3943 (yyerror_range): Now based on data_type, not location_type.
3944
39452008-11-03 Akim Demaille <demaille@gostai.com>
3946
3947 Push the state, value, and location at the same time.
3948 This is needed to prepare a forthcoming patch that fuses the three
3949 stacks into one.
3950
3951 * data/lalr1.cc (parser::yypush_): New.
3952 (parser::yynewstate): Change the semantics: instead of arriving to
3953 this label when value and location have been pushed, but yystate
3954 is to be pushed on the state stack, now the three of them must
3955 have been pushed before. yystate still must be the new state.
3956 This allows to use yypush_ everywhere instead of individual
3957 handling of the stacks.
3958
39592008-11-03 Akim Demaille <demaille@gostai.com>
3960
3961 Prefer references to pointers.
3962 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
3963 definition to use references instead of pointers.
3964 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
3965 Take the value and location as references.
3966 Adjust callers.
3967
39682008-11-03 Akim Demaille <demaille@gostai.com>
3969
3970 stack::size instead of stack::height.
3971 * data/lalr1.cc (stack::height): Rename as...
3972 (stack::size): this.
3973 Fix the output type.
3974 Comment changes.
3975
39762008-11-03 Akim Demaille <demaille@gostai.com>
3977
3978 Use variants to support objects as semantic values.
3979 This patch was inspired by work by Michiel De Wilde. But he used
3980 Boost variants which (i) requires Boost on the user side, (ii) is
3981 slow, and (iii) has useless overhead (the parser knows the type of
3982 the semantic value there is no reason to duplicate this
3983 information as Boost.Variants do).
3984
3985 This implementation reserves a buffer large enough to store the
3986 largest objects. yy::variant implements this buffer. It was
3987 implemented with Quentin Hocquet.
3988
3989 * src/output.c (type_names_output): New.
3990 (output_skeleton): Invoke it.
3991 * data/c++.m4 (b4_variant_if): New.
3992 (b4_symbol_value): If needed, provide a definition for variants.
3993 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
3994 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
3995 (b4_char_sizeof, yy::variant): New.
3996 (parser::parse): If variants are requested, define
3997 parser::union_type, parser::variant, change the definition of
3998 semantic_type, construct $$ before running the user action instead
3999 of performing a default $$ = $1.
4000 * examples/variant.yy: New.
4001 Based on an example by Michiel De Wilde.
4002
40032008-11-03 Akim Demaille <demaille@gostai.com>
4004
4005 Parameterize the extraction of semantic values.
4006 To make future changes easier, no longer rely on ".TYPE" being the
4007 way to get a semantic value.
4008
4009 * data/c.m4 (b4_symbol_value): New.
4010 Use it.
4011 * data/c++.m4, data/yacc.c: Use it.
4012 * data/glr.c: Use b4_symbol_value.
4013 (b4_rhs_data): New.
4014 Use it.
4015
40162008-11-03 Akim Demaille <demaille@gostai.com>
4017
4018 Prepare easier M4 changes.
4019 * data/lalr1.cc: Use escaped [] instead of literals to prepare
4020 future changes.
4021
40222008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4023
4024 Initiate further development.
4025 * NEWS: Create an empty section for new entries.
4026 * gnulib: Update submodule to HEAD.
4027
40282008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4029
4030 * NEWS: Version 2.4.
4031
40322008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4033
4034 Prepare for next release.
4035 * NEWS: Briefly mention changes since 2.3b.
4036 * README: Say GNU m4 1.4.6, which we've been requiring in release
4037 announcements already, not 1.4.3, which breaks the build.
4038
40392008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4040
4041 Say %language is experimental.
4042 We're thinking of extending it's effect on output file naming. See the
4043 thread at
4044 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
4045 * NEWS: Say it's experimental.
4046 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
4047 recommend it over %skeleton for now.
4048 (Bison Options): Likewise.
4049 (C++ Bison Interface): Use %skeleton not %language.
4050 (Calc++ Parser): Use %skeleton not %language.
4051 * src/getargs.c (usage): Say it's experimental.
4052
40532008-11-01 Di-an Jan <dianj@freeshell.org>
4054 Paolo Bonzini <bonzini@gnu.org>
4055
4056 Support all Java parser class modifiers.
4057 * data/java.m4 (b4_percent_define_get3): New.
4058 (b4_final_if, b4_strictfp_if): New.
4059 * data/lalr1.java (final, strictfp, extends, implements): Support.
4060 * doc/bison.texinfo (final, strictfp, extends, implements): Add
4061 documentation.
4062 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
4063 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
4064 (AT_CHECK_JAVA_GREP): New.
4065 (Java parser class modifiers): New test.
4066 (Java parser class extends and implements): New test.
4067
4068 Model exception propagation better with throws and lex_throws.
4069 * data/java.m4 (b4_list2): New.
4070 (throws): Change default.
4071 * data/lalr1.java (yyaction): Add throws.
4072 (parse): Add lex_throws in addition to throws.
4073 * doc/bison.texinfo (throws, lex_throws): Add documentation.
4074 * tests/java.at (Java throws specifications): New test.
4075
4076 Improve documentation for Java parsers.
4077 * doc/bison.texinfo (Java Parsers): Add subsections.
4078 Don't quote first argument of %define.
4079 (Java Bison Interface): Document output files. Move documentation
4080 of parser class and merge into Java Parser Interface. Document
4081 features that error out. Document directives with no effect.
4082 Move note about Javadoc higher.
4083 (Java Semantic Values): Explicitly mention stype.
4084 Document that generic types cannot be used.
4085 (Java Location Values): Use @deftypeivar. Document constructors.
4086 Correct return value for toString.
4087 (Java Parser Interface): List undocumented constants/fields.
4088 Move documentation of fields added by %parse-param closer to list
4089 of members. Document that token names are added as fields.
4090 Document constructors accurately. Remove error method.
4091 (Java Scanner Interface): Move note on %pure-parser to Java Bison
4092 Interface. Describe %code lexer and yylex accutately.
4093 Remove documentation that does not match the code.
4094 (Java Action Features): New.
4095 (Java Differences): Add reference. Add item on semantic values.
4096 Add note about @{ ... @}. Clarify %% epilogue placement.
4097 (Java Declarations Summary): New.
4098
4099 Fix Java skeleton.
4100 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
4101 (b4_remove_comma): Quote test argument.
4102 (b4_identification): Remove "bison" field.
4103 * tests/java.at (Java parser class and package names): New test.
4104 (Java %parse-param and %lex-param): New test.
4105 (Java stype, position_class and location_class): New test.
4106
41072008-10-31 Di-an Jan <dianj@freeshell.org>
4108
4109 * data/lalr1.jave: Update copyright years.
4110 (YYParser): Correct name of "generated from" file in Javadoc:
4111 use b4_file_name instead of @ofile@.
4112 (Location constructor): Correct Javadoc parameter name.
4113 (yylloc): Add missing opening m4 quote after b4_location_if.
4114 This removes a stray [ in the Javadoc of Lexer.getStartPos.
4115 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
4116 (YYParser constructor): Correct Javadoc parameter name.
4117
41182008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
4119
4120 Always put auxiliary code files in the same dir as other output files.
4121 * src/files.c (compute_file_name_parts): When the user specifies
4122 --output but not --file-prefix, extract the directory prefix from the
4123 file prefix not from the grammar file name. This affects the location
4124 of files like location.hh generated by the C++ skeleton. The includes
4125 in the other output files require this fix.
4126 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
4127 for expected output files.
4128 (Output files): Add a test for the above.
4129
41302008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
4131
4132 * gnulib: Update submodule to HEAD.
4133
41342008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4135
4136 Update copyright year.
4137 * src/files.c: Here.
4138
41392008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
4140
4141 Don't overwrite the input file.
4142 * src/files.c (output_file_name_check): Fatal error if using input file
4143 for output.
4144 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
4145 argument.
4146 (Conflicting output files): Add test.
4147
41482008-10-28 Akim Demaille <demaille@gostai.com>
4149
4150 Space changes.
4151 * data/lalr1.cc: Formatting changes.
4152
41532008-10-28 Akim Demaille <demaille@gostai.com>
4154
4155 Don't define debugging functions when !YYDEBUG.
4156 * data/lalr1.cc (debug_stream, set_debug_stream)
4157 (debug_level_type, debug_level, set_debug_level): Don't
4158 declare them when YYDEBUG is not defined.
4159 The implementation are already YYDEBUG-aware.
4160
41612008-10-28 Akim Demaille <demaille@gostai.com>
4162
4163 Prefer "continue" for empty loop bodies.
4164 * etc/bench.pl.in: Use "continue" instead of {}.
4165
41662008-10-28 Akim Demaille <demaille@gostai.com>
4167
4168 Space and comments changes.
4169 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
4170 * data/c.m4, data/lalr1.cc: Space changes.
4171
41722008-10-28 Akim Demaille <demaille@gostai.com>
4173
4174 Make gnulib a submodule.
4175 * gnulib: New.
4176 * .gitmodules (gnulib): New.
4177
41782008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4179
4180 Fix yyerror_range for user-defined location type in C++. Reported by
4181 Georg Sauthoff at
4182 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
4183 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
4184 * THANKS (Georg Sauthoff): Add.
4185
41862008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4187
4188 Update several administrative files mainly to facilitate releasing.
4189 * HACKING (Administrivia): Make the git-merge-changelog notes more
4190 helpful.
4191 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
4192 (Release Procedure): Update for git and add numerous details that were
4193 previously missing.
4194 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
4195 * maint.mk (announcement): Don't list bison as a bootstrap tool so
4196 that announcements don't claim we bootstrapped with whatever bison
4197 happened to be in PATH. Add flex as a bootstrap tool.
4198 * Makefile.maint: Remove, previously replaced by maint.mk.
4199 * Makefile.cfg: Remove, and migrate settings to...
4200 * cfg.mk: ... here for the sake of `make announcement'.
4201 * bootstrap.conf (gnulib_modules): Add announce-gen.
4202 * README: Say GNU Bison instead of just Bison. Suggested by Karl
4203 Berry.
4204
42052008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
4206
4207 Small but important bugfixes for the Java skeleton.
4208 * data/lalr1.java (yyerror): Change Location to b4_location_type.
4209 (yy_symbol_print): Call toString on yyvaluep.
4210
42112008-08-29 Akim Demaille <demaille@gostai.com>
4212
4213 Clarify UPDATED use.
4214 * doc/bison.texinfo: It refers to the last edition of this file,
4215 not to the release date of Bison.
4216 Reported by Joel E. Denny.
4217
42182008-08-29 Akim Demaille <demaille@gostai.com>
4219
4220 * README: Update FAQ pointer.
4221 Reported by Joel E. Denny.
4222
42232008-08-27 Eric Blake <ebb9@byu.net>
4224
4225 Resync m4sugar from autoconf.
4226 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
4227 (m4_init): Adjust to latest m4.git changes.
4228 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
4229 effects.
4230 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
4231 (_m4_list_cmp): Reduce side effects.
4232
42332008-08-27 Akim Demaille <demaille@gostai.com>
4234
4235 Check yyerrok in calc.at.
4236 * tests/calc.at (calc.y): Use yyerrok on "( error )".
4237 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
4238 expected.
4239
42402008-08-27 Akim Demaille <demaille@gostai.com>
4241
4242 Support yyerrok in lalr1.cc.
4243 YYBACKUP is still to import back into lalr1.cc.
4244 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
4245
42462008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4247
4248 For maintainer-check*, don't recompile for a $(VERSION) update.
4249 * cfg.mk: New file.
4250 (_is-dist-target): Override the one in GNUmakefile.
4251 * Makefile.am (EXTRA_DIST): Add cfg.mk.
4252
42532008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4254
4255 Update for recent change to gnulib.
4256 * src/parse-gram.y: Don't include strverscmp.h. It comes from
4257 string.h now.
4258
42592008-08-15 Eric Blake <ebb9@byu.net>
4260
4261 Remaining m4sugar merge from autoconf.
4262 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
4263 * data/m4sugar/foreach.m4: New file, copied from autoconf.
4264 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
4265 * src/output.c (output_skeleton): Tell m4 how to find it.
4266
4267 Partial m4sugar merge from autoconf: m4_map.
4268 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
4269 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
4270 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
4271 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
4272 for empty list.
4273 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
4274 Likewise.
4275 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
4276 declares it.
4277
42782008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
4279
4280 Keep .version and PACKAGE_VERSION in sync.
4281 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
4282 dependency, and add comments justifying this in more detail. Discussed
4283 starting at
4284 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
4285
42862008-08-06 Eric Blake <ebb9@byu.net>
4287
4288 Partial m4sugar merge from autoconf: m4_shiftn.
4289 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
4290 (m4_shift2, m4_shift3): New macros.
4291 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
4292 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
4293 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
4294 * data/java.m4 (b4_remove_comma): Likewise.
4295
4296 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
4297 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
4298 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
4299 (m4_init): Consolidate wrapped text into single m4_wrap.
4300 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
4301 in wrapped text.
4302
43032008-08-05 Eric Blake <ebb9@byu.net>
4304
4305 Partial m4sugar merge from autoconf: builtins, version.m4.
4306 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
4307 (m4_prepend): Remove, as it is unused and inherently quadratic,
4308 whereas m4_append is linear in newer m4.
4309 (m4_mkstemp): New builtin.
4310 (m4_symbols): Make rename conditional.
4311 (m4_version_prereq): Ensure fatal error if used in bison, which
4312 intentionally lacks version.m4.
4313
4314 Fix comments in m4sugar.
4315 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
4316
43172008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
4318
4319 Update for recent .gitignore fix in Gnulib.
4320 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
4321 anchored .gitignore entries.
4322
43232008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
4324
4325 Set gnu or gnits strictness.
4326 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
4327 development and gnits strictness for releases. Based on Eric Blake's
4328 suggestion at
4329 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
4330
43312008-07-31 Paolo Bonzini <bonzini@gnu.org>
4332
4333 * NEWS: Clarify documentation of %language.
4334
43352008-07-31 Paolo Bonzini <bonzini@gnu.org>
4336
4337 Support usage of git-merge-changelog.
4338 * .gitattributes: New.
4339 * HACKING: Document usage of git-merge-changelog.
4340 * bootstrap: Install git-merge-changelog entries in .git/config
4341 if appropriate.
4342
43432008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4344
4345 Remove remaining dependence on CVS Id keyword.
4346 * ChangeLog: For the sake of people still using CVS, don't use dollars
4347 when mentioning Id.
4348 * data/xslt/bison.xsl: Remove Id from header comments, where it was
4349 unusual anyway.
4350 * data/xslt/xml2dot.xsl: Likewise.
4351 * data/xslt/xml2text.xsl: Likewise.
4352 * data/xslt/xml2xhtml.xsl: Likewise.
4353 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
4354 * doc/Makefile.am (neutralize): Remove, no longer needed.
4355 (.x.1): Don't use neutralize.
4356 (edit): Don't substitute for ID.
4357 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
4358
43592008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4360
4361 Fix dependence on computed configure variables.
4362 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
4363 $(top_srcdir)/configure.ac so that changes to computed variables, such
4364 as PACKAGE_VERSION, are seen.
4365 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
4366
43672008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
4368
4369 Update copyright dates for recent changes.
4370 * Makefile.am: Here.
4371 * src/Makefile.am: Here.
4372 * src/reduce.c: Here.
4373 * tests/reduce.at: Here.
4374
43752008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
4376
4377 Use git-version-gen for version names between releases.
4378 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
4379 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
4380 * .prev-version: New.
4381 * .version.in: Remove.
4382 * ChangeLog: Remove the Id previously used for capturing the CVS
4383 revision.
4384 * GNUmakefile: Remove, now copied from Gnulib.
4385 * Makefile.am: Add code suggested by comments in
4386 build-aux/git-version-gen.
4387 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
4388 .prev-version, and .version.
4389 * NEWS (2.3b+): Rename to...
4390 (?.?): ... this because we're dropping the "+" version naming scheme,
4391 but, in general, we still can't be sure of our next release name.
4392 * bootstrap: Add a quick hack to remove from .gitignore the
4393 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
4394 entry. This should really be fixed in gnulib instead.
4395 * bootstrap.conf (gnulib_modules): Add gnumakefile.
4396 * configure.ac (AC_INIT): Set version name by invoking
4397 build-aux/git-version-gen.
4398 (AC_CONFIG_FILES): Remove .version, now generated by
4399 build-aux/git-version-gen.
4400 * maint.mk: New, copied from coreutils.
4401 * doc/.cvsignore (bison.1): Add.
4402 * doc/.gitignore (/bison.1): Add.
4403 * doc/bison.1: Remove, generated.
4404 * src/.cvsignore (revision.c): Remove.
4405 * src/.gitignore (/revision.c): Remove.
4406 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
4407 (BUILT_SOURCES): Remove revision.c.
4408 (revision.c): Remove.
4409 * src/getargs.c (version): Don't print revision after the VERSION.
4410 * src/revision.h: Remove.
4411
44122008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4413
4414 Fix untranslatable composition of sentences. Reported by Goran
4415 Uddeborg at
4416 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
4417 * THANKS (Goran Uddeborg): Add.
4418 * src/reduce.c (reduce_print): Report the number of nonterminals and
4419 rules useless in the grammar in separate sentences.
4420 * tests/reduce.at (Useless Rules): Update output.
4421 (Reduced Automaton): Likewise.
4422 (Underivable Rules): Likewise.
4423 (Empty Language): Likewise.
4424
44252008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4426
4427 Fix some .gitignore and .cvsignore problems.
4428 * bootstrap (insert_sorted_if_absent): Replace all uses with...
4429 (insert_vc_ignore): ... this new function, which prepends `/' to all
4430 .gitignore entries before passing them to insert_sorted_if_absent.
4431 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
4432 .cvsignore files are maintained even though Bison developers run
4433 bootstrap while using Git.
4434 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
4435 unneeded by Bison.
4436 (gnulib): Add.
4437 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
4438 unneeded. Reported by Eric Blake.
4439 * lib/.gitignore (/*~): Add.
4440 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
4441 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
4442 Blake.
4443 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
4444
44452008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4446
4447 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
4448 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
4449 * bootstrap.conf (gnulib_modules): Add unsetenv.
4450 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
4451 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
4452 (/setenv.m4): Add.
4453 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
4454 the first argument because it may become position-dependent, and unset
4455 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
4456 Add comments explaining these issues in more detail.
4457
44582008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
4459
4460 Add .gitignore everywhere based on .cvsignore.
4461 * .gitignore: New.
4462 * build-aux/.gitignore: New.
4463 * data/.gitignore: New.
4464 * doc/.gitignore: New.
4465 * etc/.gitignore: New.
4466 * examples/.gitignore: New.
4467 * examples/calc++/.gitignore: New.
4468 * lib/.gitignore: New.
4469 * m4/.gitignore: New.
4470 * po/.gitignore: New.
4471 * runtime-po/.gitignore: New.
4472 * src/.gitignore: New.
4473 * tests/.gitignore: New.
4474
44752008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4476
4477 * NEWS (2.3b+): New section, empty for now.
4478 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
4479
44802008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4481
4482 * NEWS (2.3b): Update release date since there has been a delay in
4483 getting the announcements and tarballs out.
4484
44852008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
4486
4487 * NEWS: Version 2.3b.
4488 * configure.ac (AC_INIT): Likewise.
4489 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
4490
44912008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
4492
4493 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
4494 been doing it for years.
4495 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
4496 (Release Procedure): Add FIXME about make alpha being unmaintained.
4497
44982008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
4499
4500 * data/yacc.c: Reformat m4 a little for readability.
4501 * src/lalr.c (build_relations): Correct comment.
4502
45032008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4504
4505 DJGPP specific issue.
4506 * djgpp/config.sed: Fixes required to run configure scripts generated
4507 by autoconf 2.62.
4508
45092008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4510
4511 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
4512 coordinator@translationproject.org.
4513
45142008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4515
4516 * THANKS: Add Eric Blake.
4517
45182008-04-23 Eric Blake <ebb9@byu.net>
4519
4520 Revert prior patch, by working around autoconf regression.
4521 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
4522 ("Output file name: ("): Uncomment test.
4523 ("Output file name: )"): Likewise.
4524 Based on an idea from Noah Misch.
4525
45262008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4527
4528 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
4529 2.61. Reported by Juan Manuel Guerrero at
4530 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
4531 * tests/output.at ("Output file name: ("): Comment out test case for
4532 now.
4533 ("Output file name: )"): Likewise.
4534
45352008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4536
4537 * GNUmakefile: Update git-version-gen invocation so make dist
4538 succeeds.
4539
45402008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4541
4542 Update to the current gnulib CVS repository, and fix trigraph handling
4543 in Bison.
4544 * bootstrap: Update gnulib CVS repository URL.
4545 (symlink_to_dir): Encapsulate the code that guarantees the destination
4546 directory exists into...
4547 (check_dst_dir): ... this new function, and...
4548 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
4549 fail when copying files into lib/uniwidth/.
4550 * src/output.c (prepare_symbols): When writing yytname muscles, where
4551 symbol names will be encoded in C-string literals, tell quotearg to
4552 escape trigraphs. This used to be the default in gnulib.
4553 * tests/regression.at (Token definitions): Because of the change in
4554 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
4555 escapes trigraphs in symbol names. Thus, yytname no longer has
4556 trigraphs unnecessarily doubly escaped. Update test case output.
4557 Extend test case to be sure Bison's own error messages will no longer
4558 have trigraphs in symbol names unnecessarily escaped once.
4559
45602008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
4561
4562 Fix make dist infinite loop reported by Juan Manuel Guerrero at
4563 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
4564 * .cvsignore: Add .version.
4565 * .version.in: New.
4566 * bootstrap.conf (gnulib_modules): Add git-version-gen.
4567 * configure.ac (AC_CONFIG_FILES): Add .version.
4568 * build-aux/.cvsignore: Add git-version-gen.
4569
45702008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4571
4572 * NEWS (2.3a+): Mention that -g now takes an argument.
4573 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
4574 consistency. Update the -g and -x entries now that they take
4575 arguments. Use brackets to indicate optional arguments.
4576 * src/getargs.c (usage): Explain the relationship between arguments of
4577 long and short options more completely. Document --defines and -d
4578 separately since the former takes an argument but, for POSIX Yacc, the
4579 latter does not.
4580 (short_options): Let -W take an optional argument like --warnings.
4581 (getargs): Sort cases.
4582
45832008-02-28 Akim Demaille <demaille@gostai.com>
4584
4585 * doc/bison.texinfo: Fix a few typos.
4586
45872008-02-28 Akim Demaille <akim@epita.fr>
4588
4589 * doc/bison.texinfo (Bison Options): Document -W.
4590 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
4591
45922008-02-28 Akim Demaille <akim@epita.fr>
4593
4594 * src/getargs.c (short_options): Split and sort for readability.
4595 -g and -x take optional arguments, just like their long options.
4596 * build-aux/cross-options.pl: Use /x to make the regexp easier to
4597 understand.
4598 Fix the handling of $opt which resulted in all the argument to be
4599 considered as optional.
4600
46012008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
4602
4603 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
4604 say its interface is experimental.
4605 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4606 Java.
4607 (Bison Options): In the -L and --language entry, mention Java.
4608 (Java Bison Interface): Say the interface is experimental.
4609 * src/getargs.c (usage): Mention -L and --language.
4610
4611 * NEWS (2.3a+): Say the push parsing interface is experimental.
4612 * doc/bison.texinfo (Push Decl): Likewise.
4613 (Decl Summary): Likewise in the "%define api.push_pull" entry.
4614 (Push Parser Function): Likewise.
4615 (Pull Parser Function): Likewise.
4616 (Parser Create Function): Likewise.
4617 (Parser Delete Function): Likewise.
4618 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
4619 yypull_parse, and yypush_parse entries.
4620
4621 * NEWS (2.3a+): Mention XML support, and say the schema is
4622 experimental.
4623 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
4624 * src/getargs.c (usage): Say the XML schema is experimental.
4625
4626 * NEWS (2.3a+): Say option instead of flag.
4627
46282008-02-21 Wojciech Polak <polak@gnu.org>
4629
4630 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
4631 text.
4632
46332008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
4634
4635 Fix impure push parser compile error reported by Bob Rossi at
4636 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
4637 * data/yacc.c: Clean up whitespace in the output a little.
4638 (yypstate_allocated): Define for impure push parsers regardless of
4639 whether the pull interface is also requested.
4640 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
4641 check impure push parsers without the pull interface.
4642
4643 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
4644 yyerror takes arguments specified by %parse-param while yypstate_new
4645 does not.
4646 * doc/bison.texinfo (Parser Create Function): Document that
4647 yypstate_new returns 0 for multiple impure parser instances.
4648 * tests/push.at (Push Parsing: Multiple impure instances): Update
4649 expected stderr output.
4650
46512008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
4652
4653 * runtime-po/POTFILES.in (push.c): Remove.
4654
46552008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
4656
4657 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
4658 * data/push.c: Rename to...
4659 * data/yacc.c: ... this, overwriting it.
4660 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
4661 `%push-pull-parser' -> `%define api.push_pull "both"'.
4662 Remove old yacc.c tests, and update push.c tests to yacc.c.
4663
46642008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
4665
4666 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
4667 `"%code top" blocks' instead of `%code "top" blocks'.
4668 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
4669 Clean up whitespace in the output a little.
4670
46712008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
4672
4673 Fix documentation problems reported by Tim Josling at
4674 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
4675 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
4676 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
4677 integers. Explain the effect of literal string aliases on error
4678 messages. Copy token 0 documentation from the C++ skeleton
4679 documentation.
4680
46812008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
4682
4683 Accept a token number in a %left, %right, or %nonassoc for POSIX
4684 conformance. Reported by Tim Josling at
4685 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
4686 * NEWS (2.3a+): Mention.
4687 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
4688 and code numbers are treated by precedence declarations.
4689 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
4690 of symbols.1.
4691 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
4692 of symbol.
4693 (symbol.prec): New, just like symbol but allows INT.
4694 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
4695 longer holds.
4696 * tests/regression.at (Token number in precedence declaration): New
4697 test case.
4698
46992008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4700
4701 DJGPP specific issues.
4702 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
4703 be changed. Copyright timestamp adjusted.
4704 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
4705 be changed. Copyright timestamp adjusted.
4706 * djgpp/config.site: Copyright timestamp adjusted.
4707 * djgpp/config_h.sed: Copyright timestamp adjusted.
4708 * djgpp/djunpack.bat: Copyright timestamp adjusted.
4709 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
4710 filename translation list.
4711 * djgpp/subpipe.c (init_subpipe): Check the environment variables
4712 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
4713 files shall be created. Before trying to use the temp dir where the
4714 environment variable points to check that the dir really exists. If
4715 not default to the cwd as temp dir. Copyright timestamp adjusted.
4716 * djgpp/subpipe.h: Copyright timestamp adjusted.
4717 * djgpp/testsuite.sed: Copyright timestamp adjusted.
4718
47192008-01-30 Paul Eggert <eggert@cs.ucla.edu>
4720
4721 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
4722
47232008-01-09 Paul Eggert <eggert@cs.ucla.edu>
4724
4725 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
4726 Problem reported by Claudio Saavedra in
4727 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
4728
47292008-01-05 Wojciech Polak <polak@gnu.org>
4730
4731 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
4732 document's title with the input grammar file name.
4733
47342007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
4735
4736 Automate regression testing of the XML/XSLT implementation. Discussed
4737 starting at
4738 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
4739 * configure.ac (XSLTPROC): New substitution.
4740 * Makefile.am (maintainer-xml-check): New phony target invoking...
4741 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
4742 invoking make maintainer-check with BISON_TEST_XML=1.
4743 * tests/atlocal.in (XSLTPROC): New.
4744 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
4745 not to report reachable memory when Bison is expected to have a
4746 non-zero exit status and (2) to compare XML/XSLT output with --graph
4747 and --report=all output for every working grammar when
4748 BISON_TEST_XML=1.
4749 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
4750 (AT_BISON_CHECK_XML): New.
4751 (AT_QUELL_VALGRIND): New.
4752 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
4753 (AT_CHECK): ... don't redefine this since this was the old way to
4754 quell Valgrind.
4755 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
4756 AT_BISON_CHECK invocations.
4757 * tests/c++.at: Likewise.
4758 * tests/calc.at: Likewise.
4759 * tests/conflicts.at: Likewise.
4760 * tests/cxx-type.at: Likewise.
4761 * tests/existing.at: Likewise.
4762 * tests/glr-regression.at: Likewise.
4763 * tests/headers.at: Likewise.
4764 * tests/input.at: Likewise.
4765 * tests/java.at: Likewise.
4766 * tests/output.at: Likewise.
4767 * tests/push.at: Likewise.
4768 * tests/reduce.at: Likewise.
4769 * tests/regression.at: Likewise.
4770 * tests/sets.at: Likewise.
4771 * tests/skeletons.at: Likewise.
4772 * tests/synclines.at: Likewise.
4773 * tests/torture.at: Likewise.
4774 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
4775 tends to hang xsltproc.
4776 (Big horizontal): Likewise.
4777
47782007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
4779
4780 In XML output, remove redundant class attribute on symbol element.
4781 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
4782 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
4783 look up a symbol to determine whether it's a nonterminal or terminal.
4784 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
4785 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
4786
4787 Add prec/assoc information to XML output.
4788 * src/gram.c (grammar_rules_print_xml): For each rule that has a
4789 %prec, add a percent_prec attribute.
4790 * src/print-xml.c (print_grammar): For each terminal that has a
4791 precedence or associativity, add a prec or assoc attribute.
4792 (xml_indent): New.
4793 (xml_puts): Use xml_indent.
4794 (xml_printf): Use xml_indent.
4795 * src/print-xml.h (xml_indent): Prototype.
4796
4797 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
4798 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
4799
48002007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
4801
4802 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
4803 (bison:ruleByNumber): ... this for clarity.
4804 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
4805 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
4806 (xsl:template match="reduction"): Update.
4807 (xsl:template match="item"): Update.
4808 (xsl:template match="reduction"): Update.
4809
4810 In the XML output, don't print the list of rules where symbols appear.
4811 Compute it in XSLT instead. Discussed at
4812 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
4813 * data/xslt/bison.xsl (bison:ruleByLhs): New.
4814 (bison:ruleByRhs): New.
4815 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
4816 bison:ruleByRhs.
4817 (xsl:template match="terminal/rule"): Remove.
4818 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
4819 bison:ruleByRhs.
4820 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
4821 Remove.
4822 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
4823 bison:ruleByRhs and mode="number-link" for rule template.
4824 (xsl:template match="terminal/rule"): Remove.
4825 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
4826 bison:ruleByRhs and mode="number-link" for rule template.
4827 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
4828 Rewrite as...
4829 (xsl:template match="rule" mode="number-link"): ... this.
4830 * src/print-xml.c (print_grammar): Don't print the list of rules.
4831
48322007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4833
4834 Don't let --report affect XML output; always print all information.
4835 Discussed at
4836 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
4837 * src/conflicts.c (log_resolution): Implement.
4838 * src/print-xml.c (print_core): Implement.
4839 (print_state): Implement.
4840 (print_xml): Implement.
4841
4842 * NEWS (2.3a+): Fix quotes.
4843 * src/parse-gram.y (prologue_declaration): For consistency with -v,
4844 don't let %verbose clear the list specified by --report.
4845
48462007-11-26 Akim Demaille <akim@epita.fr>
4847
4848 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
4849
48502007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
4851
4852 In the XML output, list useless and unused symbols and rules with the
4853 useful ones and add a "usefulness" attribute. Discussed starting at
4854 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
4855 * src/gram.c (grammar_rules_partial_print_xml): Remove.
4856 (grammar_rules_print_xml): Print all rules instead of just those
4857 useful in the grammar, and add a "usefulness" attribute.
4858 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
4859 * src/print-xml.c (print_rules_useless_in_parser): Remove.
4860 (print_grammar): Print all nonterminals instead of just useful ones,
4861 and add a "usefulness" attribute to nonterminals and terminals.
4862 (print_xml): Don't print a separate "reductions" or
4863 "rules-useless-in-parser" element.
4864 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
4865 (reduce_xml): Remove.
4866 (reduce_token_unused_in_grammar): New.
4867 (reduce_nonterminal_useless_in_grammar): New.
4868 * src/reduce.h (reduce_xml): Remove prototype.
4869 (reduce_token_unused_in_grammar): Add prototype.
4870 (reduce_nonterminal_useless_in_grammar): Add prototype.
4871 * data/xslt/xml2text.xsl: Update for XML changes.
4872 * data/xslt/xml2xhtml.xsl: Update for XML changes.
4873 * tests/reduce.at (Useless Terminals): Update output.
4874 (Useless Rules): Update output.
4875 (Reduced Automaton): Update output.
4876
4877 Say "Terminals unused in grammar" instead of "Unused terminals".
4878 * NEWS (2.3a+): Update.
4879 * doc/bison.texinfo (Understanding): Update example output.
4880 * src/reduce.c (reduce_output): Implement.
4881 * data/xslt/xml2text.xsl: Implement.
4882 * data/xslt/xml2xhtml.xsl: Implement.
4883
48842007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
4885
4886 Accept --report-file=FILE to override the default `.output' filename.
4887 * NEWS (2.3a+): Mention.
4888 * doc/bison.texinfo (Bison Options): Add an entry.
4889 * src/files.c (compute_output_file_names): Don't override
4890 spec_verbose_file if already set.
4891 * src/getargs.c (usage): Document --report-file.
4892 (REPORT_FILE_OPTION): New anonymous enum member.
4893 (long_options): Add entry for it.
4894 (getargs): Add case for it setting spec_verbose_file.
4895
4896 * build-aux/cross-options.pl: Don't record a short option just because
4897 there's an arg.
4898 * doc/.cvsignore: Add yacc.1.
4899
49002007-11-14 Akim Demaille <akim@epita.fr>
4901
4902 * doc/yacc.1.in: New.
4903 * configure.ac, doc/Makefile.am: Adjust.
4904 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
4905 config.h symbol.
4906 Use AC_SUBST for assignments too.
4907 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
4908
49092007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4910
4911 * src/gram.c: Remove comments that duplicate comments in gram.h.
4912
4913 When reporting useless rules and nonterminals, say "useless in grammar"
4914 instead of "useless", and say "useless in parser" instead of "never
4915 reduced". Discussed starting at
4916 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
4917 * NEWS (2.3a+): Mention this change.
4918 * data/xslt/xml2text.xsl: Update output text and expected input XML
4919 element names to match changes below.
4920 * data/xslt/xml2xhtml.xsl: Likewise.
4921 (xsl:template match="bison-xml-report"): Add missing entry in Table of
4922 Contents: "Rules useless in parser due to conflicts".
4923 * doc/bison.texinfo (Decl Summary): Reword a little.
4924 (Understanding): Update example output for changes below.
4925 * src/gram.c: (rule_useful_p): Rename to...
4926 (rule_useful_in_grammar_p): ... this.
4927 (rule_useless_p): Rename to...
4928 (rule_useless_in_grammar_p): ... this.
4929 (rule_never_reduced_p): Rename to...
4930 (rule_useless_in_parser_p): ... this.
4931 (grammar_rules_print): Update for renames.
4932 (grammar_rules_print_xml): Update for renames.
4933 (grammar_rules_never_reduced_report): Rename to...
4934 (grammar_rules_useless_report): ... this since it is used for either
4935 kind of useless rule.
4936 * src/gram.h: Reword comments and update function names in prototypes.
4937 * src/main.c (main): Say "rule useless in parser due to conflicts".
4938 * src/print-xml.c (print_rules_never_reduced): Rename to...
4939 (print_rules_useless_in_parser): ... this, and rename output XML
4940 element "rules-never-reduced" to "rules-useless-in-parser".
4941 (print_xml): Update for rename.
4942 * src/print.c (print_results): Say "Rules useless in parser due to
4943 conflicts".
4944 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
4945 (nonterminals_reduce): Say "nonterminal useless in grammar".
4946 (reduce_output): Say "Nonterminals useless in grammar".
4947 Say "Rules useless in grammar".
4948 (reduce_xml): Rename output XML element "useless" to
4949 "useless-in-grammar".
4950 (reduce_print): Don't report the count of grammatically useless rules
4951 as "rules never reduced" just because %yacc is specified.
4952 In the correct report of this count, say nonterminal(s) and rule(s)
4953 "useless in grammar".
4954 * tests/conflicts.at (S/R in initial): Update expected output.
4955 (Defaulted Conflicted Reduction): Likewise.
4956 (Unreachable States After Conflict Resolution): Likewise.
4957 * tests/existing.at (GNU pic Grammar): Likewise.
4958 * tests/reduce.at (Useless Nonterminals): Likewise.
4959 (Useless Rules): Likewise.
4960 (Reduced Automaton): Likewise.
4961 (Underivable Rules): Likewise.
4962 (Empty Language): Likewise.
4963
49642007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4965
4966 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
4967 here document and before the EOF so that BSD's implementation of Bourne
4968 shell doesn't parse the delimiter as part of the here document.
4969 * doc/.cvsignore: Add cross-options.texi.
4970 * src/getargs.c (usage): Add a blank line after the warning categories.
4971
49722007-11-08 Paolo Bonzini <bonzini@gnu.org>
4973
4974 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
4975
49762007-11-05 Akim Demaille <akim@epita.fr>
4977
4978 Remove Id: from bison.1.
4979 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
4980 (perl -0777 -pi -e 's/\.PP\nId): New.
4981 (.x.1): Use it to ignore the version control revision.
4982
49832007-11-05 Akim Demaille <demaille@gostai.com>
4984
4985 * build-aux/Makefile.am: Ship cross-options.pl.
4986 * doc/Makefile.am: Always refer to cross-options.texi with
4987 $(srcdir).
4988 (MAINTAINERCLEANFILES): Add it.
4989
49902007-11-04 Akim Demaille <demaille@gostai.com>
4991
4992 Generate the long/short option cross-table.
4993 * build-aux/cross-options.pl: New.
4994 * doc/Makefile.am (cross-options.texi): New.
4995 * doc/bison.texinfo: Use it.
4996
49972007-11-04 Akim Demaille <demaille@gostai.com>
4998
4999 Generate bison.1 using help2man.
5000 * doc/common.x, doc/bison.x: New.
5001 * doc/Makefile.am (bison.1, .x.1): New.
5002 The code is taken from autoconf-2.61/man/Makefile.am.
5003 * configure.ac: Look for help2man.
5004
50052007-11-04 Akim Demaille <demaille@gostai.com>
5006
5007 Complete --help.
5008 * src/getargs.c (usage): Document -W, make it clear that -d,
5009 -g and -x have optional arguments.
5010
50112007-11-04 Akim Demaille <demaille@gostai.com>
5012
5013 Find sha1sum when named gsha1sum.
5014 * bootstrap (find_tool): New.
5015 ($SHA1SUM): New.
5016
50172007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5018
5019 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
5020 at
5021 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
5022 * NEWS (2.3a+): Mention.
5023 * data/bison.m4 (b4_pure_if): Don't define it here.
5024 * data/c.m4 (b4_identification): Depend on individual skeletons to
5025 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
5026 values of the %define variables api.pure or api.push_pull. Define
5027 YYPURE, YYPUSH, and YYPULL accordingly.
5028 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
5029 glr.cc has already defined b4_pure_flag.
5030 * data/push.c: Define b4_pure_if based on `%define api.pure'.
5031 Remove YYPUSH and YYPULL since they're back in b4_identification again.
5032 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
5033 * doc/bison.texinfo (Pure Decl): Update.
5034 (Push Decl): Update.
5035 (Decl Summary): Add api.pure to %define entry.
5036 In %pure-parser entry, say it's deprecated and reference %define.
5037 (Pure Calling): Update.
5038 (Error Reporting): Update.
5039 (C++ Scanner Interface): Update.
5040 (How Can I Reset the Parser): Update.
5041 (Table of Symbols): In %pure-parser entry, say it's deprecated and
5042 reference %define.
5043 * src/getargs.c (pure_parser): Remove global variable.
5044 * src/getargs.h (pure_parser): Remove extern.
5045 * src/output.c (prepare): Don't define pure_flag muscle.
5046 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
5047 wrapper around `%define api.pure'.
5048 * tests/calc.at (Simple LALR Calculator): Update.
5049 (Simple GLR Calculator): Update.
5050 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
5051 Update.
5052 (GLR: Resolve ambiguity, pure, locations): Update.
5053 (GLR: Merge conflicting parses, pure, no locations): Update.
5054 (GLR: Merge conflicting parses, pure, locations): Update.
5055 * tests/glr-regression.at (Uninitialized location when reporting
5056 ambiguity): Update
5057 * tests/input.at (Unused %define api.pure): New test case.
5058 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
5059 AT_PURE_IF and AT_PURE_AND_LOC_IF.
5060 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5061
50622007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5063
5064 %define push_pull -> %define api.push_pull. Discussed starting at
5065 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
5066 * data/push.c: Expect the new name.
5067 * data/yacc.c: Likewise.
5068 * doc/bison.texinfo (Push Decl): Update.
5069 (Decl Summary): Update %define entry.
5070 (Push Parser Function): Update.
5071 (Pull Parser Function): Update.
5072 (Parser Create Function): Update.
5073 (Parser Delete Function): Update.
5074 * tests/calc.at (Simple LALR Calculator): Update.
5075 * tests/input.at (%define enum variables): Update.
5076 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5077 (Push Parsing: Multiple impure instances): Update.
5078 (Push Parsing: Unsupported Skeletons): Update.
5079 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
5080 (Exploding the Stack Size with Malloc): Update.
5081
5082 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
5083 other entries some.
5084
50852007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
5086
5087 For the XML output's terminal element, rename @number to @token-number,
5088 and add @symbol-number. In the nonterminal element, rename @number to
5089 @symbol-number. Discussed starting at
5090 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
5091 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
5092 renames.
5093 (xsl:template match="nonterminal"): Likewise.
5094 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
5095 (xsl:template match="nonterminal"): Likewise.
5096 * src/print-xml.c (print_grammar): Implement.
5097
50982007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5099
5100 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
5101 2007-10-11 change, the child elements here are items not rules.
5102 (xsl:template match="item"): New.
5103 (xsl:template match="rule"): Update for new reduced itemset.
5104 (xsl:template match="point"): Remove.
5105 (xsl:template match="empty"): For consistency with --graph, don't
5106 output "/* empty */".
5107 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
5108 line-wrap, don't pass a negative value as first-line-length since this
5109 won't work with the following changes.
5110 (xsl:template name="line-wrap"): Simplify slightly.
5111 (xsl:template name="ws-search"): Eliminate recursion.
5112 * src/print_graph.c (print_core): Don't print a reduction's lookahead
5113 set next to an item whose dot is not at the end of the RHS even if it
5114 happens to be associated with the same rule.
5115
51162007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5117
5118 Add %define lr.keep_unreachable_states.
5119 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
5120 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
5121 * src/main.c (main): Implement it.
5122 * tests/conflicts.at (Unreachable States After Conflict Resolution):
5123 Extend to test it, and fix a typo.
5124
51252007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5126
5127 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
5128 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
5129 the example .output text.
5130 * tests/regression.at (Extra lookahead sets in report): Improve wording
5131 of comments.
5132
51332007-10-17 Wojciech Polak <polak@gnu.org>
5134
5135 * src/print-xml.c (print_grammar): Renamed
5136 <terminal> and <nonterminal> attributes:
5137 "type" to "number" and "symbol" to "name".
5138 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
5139 Use new attribute names.
5140 (xsl:template match="nonterminal"): Likewise.
5141 * data/xslt/xml2xhtml.xsl: Likewise.
5142
51432007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
5144
5145 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
5146 (Option Cross Key): Likewise.
5147
5148 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
5149 next to an item whose dot is not at the end of the RHS even if it
5150 happens to be associated with the same rule.
5151 * src/print.c (print_core): Likewise.
5152 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
5153 (Resolved SR Conflicts): Update output.
5154 * tests/regression.at (Extra lookahead sets in report): New test case.
5155
51562007-10-11 Wojciech Polak <polak@gnu.org>
5157
5158 * src/print-xml.c (print_core): Remove item set
5159 redundancy.
5160 * data/xslt/bison.xsl (bison:ruleNumber): New key.
5161 Improve processing time. Suggested by Joel E. Denny.
5162 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
5163 Write xsl:param "required" attribute as comment.
5164 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
5165 (xsl:template match="rule"): Support new reduced itemset.
5166 (xsl:template match="point"): Remove.
5167 * data/xslt/xml2xhtml.xsl: Likewise.
5168
51692007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5170
5171 * src/getargs.c (version): Update copyright year.
5172
51732007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5174
5175 Make xml2dot.xsl and --graph produce the same output.
5176 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
5177 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
5178 escaped later.
5179 (xsl:template name="output-node"): Use the new escape template instead
5180 of the string-replace template directly.
5181 (xsl:template name="output-edge"): Likewise.
5182 (xsl:template name="escape"): New, escapes backslashes and newlines in
5183 addition to quotation marks.
5184 * src/graphviz.c (start_graph, output_node, output_edge): Add
5185 whitespace to output for legibility.
5186
5187 Make xml2text.xsl and --report produce the same output, and remove the
5188 XML "conflicts" element since a conflict summary is easily extracted
5189 from the automaton.
5190 * data/xslt/bison.xsl: New.
5191 (xsl:template match="state" mode="bison:count-conflicts): New.
5192 * data/xslt/xml2text.xsl: Import bison.xsl.
5193 (xsl:template match="bison-xml-report"): Instead of styling the
5194 "conflicts" element, style the "automaton" element with mode
5195 "conflicts". Unlike the former, the latter lists S/R and R/R
5196 conflicts for a state on the same line.
5197 (xsl:template match="conflicts"): Remove.
5198 (xsl:template match="conflict"): Remove.
5199 (xsl:template match="terminal"): Line-wrap the list of rules in which
5200 the terminal is used.
5201 (xsl:template match="nonterminal"): Likewise for nonterminals.
5202 (xsl:template match="automaton" mode="conflicts"): New.
5203 (xsl:template match="state" mode="conflicts"): New.
5204 (xsl:template name="line-wrap"): New.
5205 (xsl:template name="ws-search"): New.
5206 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
5207 (xsl:template match="bison-xml-report"): Instead of styling the
5208 "conflicts" element, style the "automaton" element with mode
5209 "conflicts."
5210 (xsl:template match="conflicts"): Remove.
5211 (xsl:template match="conflict"): Remove.
5212 (xsl:template match="automaton" mode="conflicts"): New.
5213 (xsl:template match="state" mode="conflicts): New.
5214 * src/conflicts.c (conflicts_output_xml): Remove.
5215 * src/conflicts.h (conflicts_output_xml): Remove prototype.
5216 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
5217 * src/print.c (print_grammar): Consistently wrap at the 66th column so
5218 the corresponding XSLT is easier. Also, never wrap between a word and
5219 the comma that follows it.
5220
52212007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5222
5223 Improve C++ namespace support. Discussed starting at
5224 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
5225 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
5226 b4_namespace_close): New macros that interpret the %define variable
5227 "namespace" so its value can contain "::" to indicate nested
5228 namespaces.
5229 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
5230 the above macros.
5231 * data/lalr1.cc (b4_namespace): Likewise.
5232 * data/location.cc (b4_namespace): Likewise.
5233 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
5234 inside a new table in the general %define entry. Document `%define
5235 namespace' there as well. Point the %name-prefix entry to it since it
5236 explains it more completely in the case of C++.
5237 (C++ Bison Interface): Mention `%define namespace' instead of
5238 %name-prefix.
5239 (Table of Symbols): Remove the `%define push_pull' entry. The %define
5240 entry suffices.
5241 * tests/c++.at (Relative namespace references): New test case.
5242 (Absolute namespace references): New test case.
5243 (Syntactically invalid namespace references): New test case.
5244 * tests/input.at (C++ namespace reference errors): New test case.
5245
52462007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5247
5248 Add syncline support and location accessor to internal %define
5249 interfaces.
5250 * data/bison.m4 (b4_percent_define_get_loc): New.
5251 (b4_percent_define_get_syncline): New.
5252 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
5253 (b4_percent_define_default): Record defining location as line 1 rather
5254 than 0 for the sake of synchronizing #line's, and define
5255 b4_percent_define_syncline(VARIABLE).
5256 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
5257 * src/muscle_tab.c (muscle_syncline_grow): New.
5258 (muscle_code_grow): Use muscle_syncline_grow.
5259 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
5260 define b4_percent_define_syncline(VARIABLE).
5261 (muscle_percent_define_get_loc): New.
5262 (muscle_percent_define_get_syncline): New.
5263 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
5264 remove some unused variables.
5265 (muscle_percent_define_default): Record defining location as line 1
5266 rather than 0 for the sake of synchronizing #line's, and define
5267 b4_percent_define_syncline(VARIABLE).
5268 (muscle_percent_define_check_values): Use
5269 muscle_percent_define_get_loc.
5270 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
5271 (muscle_percent_define_get_syncline): Prototype.
5272 * tests/skeletons.at (%define Boolean variables: invalid skeleton
5273 defaults): Update output for location change.
5274 (Complaining during macro argument expansion): Extend to test
5275 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
5276
52772007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
5278
5279 Fix some error-reporting macro bugs.
5280 * data/bison.m4 (b4_cat): New.
5281 (b4_error, b4_error_at): Use b4_cat to send error directives directly
5282 to stdout so they don't become arguments to other macros. Update
5283 comments and add examples.
5284 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
5285 add examples.
5286 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
5287 after printing the error directive so that M4 doesn't report subsequent
5288 problems that are induced by this problem.
5289 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
5290 instead of just in them. Recognize @\n in both places. Both expand to
5291 the empty string. Needed by b4_cat.
5292 * tests/skeletons.at (Complaining during macro argument expansion):
5293 New test case.
5294 (Fatal errors make M4 exit immediately): New test case.
5295
52962007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
5297
5298 Implement --print-datadir.
5299 * src/getargs.c (usage): Mention.
5300 (PRINT_DATADIR_OPTION): New anonymous enum member.
5301 (long_options): Add entry for it.
5302 (getargs): Add case for it calling compute_pkgdatadir.
5303 * src/output.c (output_skeleton): Encapsulate data directory
5304 computation from here...
5305 (prepare): ... and from here...
5306 (compute_pkgdatadir): ... into this new function.
5307 * src/output.h (compute_pkgdatadir): Prototype.
5308
53092007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
5310
5311 * src/print-xml.c (escape_bufs): New static global variable
5312 replacing...
5313 (xml_escape_n): ... the static local variable buf here.
5314 (print_xml): Free memory for escape_bufs.
5315 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
5316
53172007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
5318
5319 Replace `%push-parser' and `%push-pull-parser' with
5320 `%define push_pull "push"' and `%define push_pull "both"'.
5321 `%define push_pull "pull"' is the default.
5322 * doc/bison.texinfo (Push Decl, Push Parser Function,
5323 Pull Parser Function, Parser Create Function, Parser Delete Function):
5324 Update declarations.
5325 (Decl Summary, Table of Symbols): Replace %push-parser and
5326 %push-pull-parser entries with a %define push_pull entry.
5327 * data/bison.m4 (b4_percent_define_check_values): New macro.
5328 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
5329 definitions...
5330 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
5331 definitions...
5332 * data/push.c: ... to here and compute them from the value of the
5333 %define variable push_pull.
5334 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
5335 parsing requests here...
5336 * data/yacc.c: ... hack this to switch to push.c any time
5337 b4_use_push_pull_flag or the %define variable push_pull is set. This
5338 will go away when we mv push.c yacc.c.
5339 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
5340 push parsing is not supported since unused %define variables are
5341 reported anyway.
5342 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
5343 * src/muscle_tab.h (muscle_percent_define_check_values): Update
5344 comments for consistency with b4_percent_define_check_values.
5345 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
5346 muscles.
5347 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
5348 Remove.
5349 (prologue_declaration): Remove %push-parser and %push-pull-parser
5350 rules.
5351 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
5352 * tests/calc.at: Update declarations.
5353 * tests/input.at (%define enum variables): New test case.
5354 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
5355 declaration.
5356 (Push Parsing: Multiple impure instances): Update declaration.
5357 (Push Parsing: Unsupported Skeletons): New test case.
5358 * tests/torture.at (Exploding the Stack Size with Alloca): Update
5359 declaration.
5360 (Exploding the Stack Size with Malloc): Update declaration.
5361
53622007-09-24 Wojciech Polak <polak@gnu.org>
5363
5364 Add XSLT transformations.
5365
5366 * data/xslt/xml2dot.xsl: Transform XML into DOT.
5367 * data/xslt/xml2text.xsl: Transform XML into plain text.
5368 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
5369 * data/Makefile.am (xsltdir): New variable.
5370 (dist_xslt_DATA): Add xslt/*.xsl files.
5371
53722007-09-23 Paul Eggert <eggert@cs.ucla.edu>
5373
5374 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
5375 Problem reported by Wojciech Polak.
5376 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
5377 (xml_printf): Undo change I made on 21 September; that is,
5378 indent 2 spaces, not 1.
5379
53802007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
5381
5382 Pacify ./configure --enable-gcc-warnings.
5383 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
5384 `char const *' instead of `char *'.
5385 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
5386 local variable `sep'.
5387
53882007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5389
5390 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
5391 elsewhere.
5392 * src/print-xml.c: Prefer "const" after types; that's more consistent.
5393 (xml_printf): Indent just 1 space for level.
5394 (e_char, xlate_char): Remove.
5395 (xml_escape_string): Rewrite to avoid undefined behavior (used
5396 storage that was freed from the stack).
5397 (xml_escape_n): Don't bother checking for subscript error.
5398
53992007-09-21 Wojciech Polak <polak@gnu.org>
5400
5401 Add Bison XML Automaton Report.
5402
5403 Add support for an -x option to generate an XML report.
5404 It is not documented yet.
5405 * src/print-xml.c: New file.
5406 * src/print-xml.h: Likewise.
5407 * lib/timevar.def (TV_XML): New var.
5408 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
5409 * src/conflicts.c: Include print-xml.h.
5410 (solved_conflicts_xml_obstack): New var.
5411 (log_resolution, conflicts_solve, conflicts_free):
5412 Add support for XML report.
5413 (conflicts_output_val): New function.
5414 * src/conflicts.h (conflicts_output_val): New decl.
5415 * src/files.c (spec_xml_file): New var.
5416 (compute_output_file_names, output_file_names_free): Add XML support.
5417 * src/files.h (spec_xml_file): New decl.
5418 * src/getargs.c (xml_flag): New var.
5419 (usage, short_options, long_options, getargs): Add XML support.
5420 * src/getargs.h (xml_flag): New decl.
5421 * src/gram.c: Include print-xml.h.
5422 (rule_lhs_print_xml, rule_rhs_print_xml):
5423 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
5424 New functions.
5425 * src/gram.h: Declare external ones.
5426 * src/main.c: Include print-xml.h.
5427 (main): Add XML support.
5428 * src/reduce.c: Include print-xml.h.
5429 (reduce_xml): New function.
5430 * src/reduce.h: Declare it.
5431 * src/state.c: Include print-xml.h.
5432 (state_new): Add XML support.
5433 (state_rule_lookahead_tokens_print_xml): New function.
5434 * src/state.h: Declare it.
5435 (struct state): New member solved_conflicts_xml.
5436 * src/symtab.c (symbol_class_get_string): New function.
5437 * src/symtab.h: Declare it.
5438
54392007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5440
5441 * GNUmakefile: Switch to coreutils's version.
5442 * bootstrap: Likewise.
5443 * Makefile.cfg: Adjust to new GNUmakefile.
5444 * README-hacking: Likewise.
5445
5446 Import from gnulib:
5447
5448 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
5449 Bruno Haible <bruno@clisp.org>
5450
5451 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
5452 and is a script that invokes bison. Tighten the code. Add comments.
5453
54542007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
5455
5456 Spell "boolean" as "Boolean". Reported by Akim Demaille.
5457 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
5458 * doc/bison.texinfo (Decl Summary): Fix.
5459 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
5460 * tests/input.at (Boolean %define variables): Update output.
5461 * tests/skeletons.at (%define boolean variables: invalid skeleton
5462 defaults): Rename to...
5463 (%define Boolean variables: invalid skeleton defaults): ... this and
5464 update output.
5465
54662007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
5467
5468 In impure push mode, don't allow more than one yypstate to be allocated
5469 since multiple impure parsers would corrupt yynerrs.
5470 * data/push.c (yypstate_allocated): New static global variable
5471 initialized to 0.
5472 (yypull_parse): If yypstate_new returns 0, don't report it as memory
5473 exhaustion if yypstate_allocated is 1, but still return 2.
5474 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
5475 already 1. Otherwise, set it to 1.
5476 (yypstate_delete): Set it to 0.
5477 * tests/push.at (Push Parsing: Multiple impure instances): New test
5478 case.
5479
54802007-08-17 Bob Rossi <bob@brasko.net>
5481
5482 * doc/bison.texinfo (Push Decl): Document the push parser.
5483 (Table of Symbols): Ditto.
5484 (Pure Decl): Ditto.
5485 (Decl Summary): Ditto.
5486 (Multiple Parsers, Push Parser Function, Pull Parser Function,
5487 Parser Create Function, Parser Delete Function):
5488 Add new push parser symbols.
5489 (Table of Symbols): Document push-parser, push-pull-parser,
5490 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
5491
54922007-08-15 Paul Eggert <eggert@cs.ucla.edu>
5493
5494 Update to GPLv3.
5495 * doc/gpl-3.0.texi: New file.
5496 * doc/gpl.texi: Remove.
5497 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
5498 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
5499 * README-hacking, TODO, bootstrap, bootstrap.conf:
5500 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
5501 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
5502 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
5503 * data/lalr1.cc, data/lalr1.java, data/location.cc:
5504 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
5505 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
5506 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
5507 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
5508 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
5509 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
5510 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
5511 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
5512 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
5513 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
5514 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
5515 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
5516 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
5517 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
5518 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
5519 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
5520 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
5521 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
5522 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
5523 * src/complain.c, src/complain.h, src/conflicts.c:
5524 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
5525 * src/files.h, src/flex-scanner.h, src/getargs.c:
5526 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
5527 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
5528 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
5529 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
5530 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
5531 * src/print.c, src/print.h, src/print_graph.c:
5532 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
5533 * src/reduce.h, src/relation.c, src/relation.h:
5534 * src/revision.h, src/scan-code.h, src/scan-code.l:
5535 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
5536 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
5537 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
5538 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
5539 * tests/Makefile.am, tests/actions.at, tests/c++.at:
5540 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
5541 * tests/existing.at, tests/glr-regression.at:
5542 * tests/headers.at, tests/input.at, tests/java.at:
5543 * tests/local.at, tests/output.at, tests/push.at:
5544 * tests/reduce.at, tests/regression.at, tests/sets.at:
5545 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
5546 * tests/torture.at:
5547 Update to GPLv3.
5548
55492007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
5550
5551 Get rid of broken %no-parser, -n, and --no-parser implementation and
5552 documentation.
5553 * TODO: Don't mention them.
5554 * doc/bison.1: Likewise.
5555 * doc/bison.texinfo (Decl Summary): Likewise.
5556 (Bison Options): Likewise.
5557 (Option Cross Key): Likewise.
5558 * src/getargs.c (no_parser_flag): Remove global variable.
5559 (usage): Don't print description of -n and --no-parser.
5560 (long_options): Remove --no-parser entry here.
5561 (getargs): Remove -n case in the switch here.
5562 * src/getargs.h (no_parser_flag): Remove extern.
5563 * tests/regression.at (Web2c Actions): Remove comment that mentions
5564 --no-parser.
5565
55662007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
5567
5568 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
5569 name user variables starting with `yy'. Just pass NULL instead of a
5570 dummy local &yylval to yypush_parse.
5571 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
5572 starting with `yy'.
5573
55742007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
5575
5576 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
5577 true since it's then always used regardless of whether yyoverflow is
5578 defined. Reported by Christian Burger at
5579 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
5580 * THANKS: Add Christian Burger.
5581
5582 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
5583 node names: say "Decl Summary" not "Bison Declaration Summary".
5584
55852007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
5586
5587 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
5588 determine whether this function has already complained about an invalid
5589 value for a %define boolean variable, don't check whether Bison has
5590 ever examined the value. As written, the check was a tautology.
5591 Instead, record and check for this complaint using a separate muscle.
5592
55932007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
5594
5595 Fix push parsing memory leak reported by Brandon Lucia at
5596 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
5597 * THANKS: Add Brandon Lucia.
5598 * data/push.c (yypstate_delete): Free the stack if it was reallocated
5599 but the parse never completed and thus freed it.
5600 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
5601 * tests/testsuite.at: Include push.at.
5602 * test/push.at: New.
5603 (Push Parsing: Memory Leak for Early Deletion): New test case.
5604
56052007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
5606
5607 Improve handling of multiple S/R conflicts in the same state and of S/R
5608 conflicts involving multiple reductions.
5609 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
5610 set for a state here or Bison will abort if it is reassigned on a
5611 later conflicted reduction in the same state.
5612 Similarly, don't finalize and assign the solved conflicts report here
5613 or it will be lost if it is reassigned on a later conflicted reduction
5614 in the same state.
5615 (set_conflicts): Instead, assign them both here after all S/R conflicts
5616 in the state have been fully examined.
5617 * src/print.c (shift_set): Rename to...
5618 (no_reduce_set): ... this.
5619 (print_reductions): Update for rename, and add %nonassoc error action
5620 tokens to no_reduce_set so that, when printing the first remaining
5621 reduction on an error action token, the reduction is enclosed in
5622 brackets.
5623 (print_results): Update for rename.
5624 * tests/conflicts.at (Solved conflicts report for multiple reductions
5625 in a state): New test case.
5626 (%nonassoc error actions for multiple reductions in a state): New test
5627 case.
5628
5629 * src/main.c (main): Don't depend on C99 features.
5630
56312007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
5632
5633 * build-aux/.cvsignore: Add compile.
5634 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
5635 uniwidth.
5636
56372007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
5638
5639 * bootstrap (slurp): Create target directories that don't exist.
5640 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
5641
56422007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5643
5644 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
5645 than item number.
5646 * closure.c (closure): Likewise.
5647 * state.h (reductions): Comment sorting of rules.
5648 (state): Comment sorting of items.
5649
56502007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
5651
5652 Fix C++ test cases after recent Gnulib changes. Discussed starting at
5653 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
5654 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
5655 definition in order to avoid Gnulib headers since we don't use config.h
5656 here.
5657 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
5658 rather than AT_DATA so that config.h is included.
5659
56602007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
5661
5662 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
5663 instead of fprintf. Guard these functions with #if YYDEBUG instead of
5664 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
5665 and so that YYFPRINTF is guaranteed to be defined here.
5666
56672007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
5668
5669 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
5670 with...
5671 (muscle_percent_define_check_values): ... this more helpful function.
5672 Again, it's not used yet, but it will be.
5673 * src/muscle_tab.h: Likewise.
5674
5675 Improve some comments in parser table construction.
5676 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
5677 (generate_states): Don't mention ruleset, which is internal to closure.
5678 * src/closure.c (closure): Explain sorting of core and itemset, which
5679 is required for this function to behave correctly.
5680 * src/closure.h (closure): Mention sorting.
5681
56822007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
5683
5684 * src/lalr.c (state_lookahead_tokens_count): For code readability,
5685 move the check for disabled transitions to an aver since conflict
5686 resolution hasn't happened yet.
5687
5688 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
5689 labels a state as inconsistent just because it has error transitions.
5690 The original form of this check appeared in revision 1.1 of lalr.c,
5691 which was committed on 1991-12-21. Now (at least), changing the
5692 consistency label on such a state appears to have no useful effect in
5693 any of the places it is examined, which I enumerate below. The key
5694 point to understanding each item in this enumeration is that a state
5695 with an error transition is labelled consistent in the first place only
5696 if it has no rules, so the check cannot matter for states that have
5697 rules. (1) Labelling a state as inconsistent will cause set_conflicts
5698 to try to identify its conflicts, and a state must have *rules* to have
5699 conflicts. (2) Labelling a state as inconsistent will affect how
5700 action_row sets the default *rule* for the state. (3) Labelling a
5701 state as inconsistent will cause build_relations to add lookback edges
5702 to *rules* in that state.
5703 * src/state.h (struct state): Word the comment for member consistent
5704 more carefully.
5705
57062007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5707
5708 Don't depend on C99 features.
5709 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
5710 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
5711 * src/reader.c (check_and_convert_grammar): Fix for-loop.
5712 * src/state.c (state_mark_reachable_states): Fix for-loop.
5713 (state_remove_unreachable_states): Fix for-loop.
5714
5715 Don't widen struct state with member reachable just to temporarily
5716 record reachability. Instead, use a local bitset.
5717 * src/state.h (struct state): Remove member.
5718 * src/state.c (state_new): Don't initialize it.
5719 (state_mark_reachable_states): Rename to...
5720 (state_record_reachable_states): ... this, and use bitset.
5721 (state_remove_unreachable_states): Use bitset.
5722
57232007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
5724
5725 * src/Makefile.am (yacc): Quote target action commands properly so
5726 that the yacc script isn't corrupt. Reported by Hans Aberg at
5727 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
5728
5729 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
5730 the case of pure parsers. Reported by Frans Englich at
5731 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
5732 * THANKS: Add Frans Englich.
5733
5734 * NEWS (2.3a+): In the %code entry, reference section `Bison
5735 Declaration Summary' from the manual now since the %code summary has
5736 moved there.
5737 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
5738 in the rules section must be terminated by semicolons.
5739
57402007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
5741
5742 Extend the front-end API for %define variables to more completely
5743 mirror the back-end. This will be useful in the future.
5744 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
5745 Update comments to mention the new front-end counterparts of these
5746 macros.
5747 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
5748 for muscle_string_decode and muscle_location_decode.
5749 (muscle_string_decode): New static function.
5750 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
5751 (muscle_percent_define_get, muscle_percent_define_ifdef): New
5752 functions.
5753 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
5754 muscle_percent_define_get to mimic the b4_percent_define_flag_if
5755 implementation more closely.
5756 (muscle_percent_define_invalid_value): New function.
5757 * src/muscle_tab.h (muscle_percent_define_get,
5758 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
5759 Prototype.
5760
57612007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
5762
5763 * NEWS (2.3a+): Mention yesterday's state-removal change.
5764 (2.3a): Remove the %language entry, which was added after 2.3a.
5765 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
5766 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
5767 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
5768 tests/existing.at: Update copyright date.
5769
57702007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5771
5772 If conflict resolution makes states unreachable, remove those states,
5773 report rules that are then unused, and don't report conflicts in those
5774 states.
5775 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
5776 New global function.
5777 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
5778 function.
5779 * src/main.c (main): After conflict resolution, remove the unreachable
5780 states and update all data structures that reference states by number.
5781 * src/state.c (state_new): Initialize each state's reachable member to
5782 false.
5783 (state_mark_reachable_states): New static function.
5784 (state_remove_unreachable_states): New global function.
5785 * src/state.h (struct state): Add member bool reachable.
5786 (state_remove_unreachable_states): Prototype.
5787 * tests/conflicts.at (Unreachable States After Conflict Resolution):
5788 New test case.
5789 * tests/existing.at (GNU pic Grammar): Update test case output now that
5790 an unused rule is discovered.
5791
57922007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5793
5794 Minor code cleanup in parser table construction.
5795 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
5796 (new_itemsets, save_reductions): Update for rename to nitemset.
5797 * src/closure.c (nritemset): Rename to...
5798 (nitemset): ... this since the "r" appears to meaningless and isn't
5799 used in the comments.
5800 (closure): Update for rename.
5801 * src/closure.h (nritemset): Update extern to...
5802 (nitemset): ... this.
5803 * src/lalr.c (LA): Fix a typo in comments.
5804 * src/print.c (print_core): Update for rename to nitemset.
5805 * src/print_graph.c (print_graph): Likewise.
5806 * src/state.h: Fix some typos in header comments.
5807
58082007-04-04 Paul Eggert <eggert@cs.ucla.edu>
5809
5810 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
5811 still sticks to ASCII. Sorry!
5812
5813 * README-hacking: New file, taken mostly from coreutils, with changes
5814 for Bison. Contains much of the contents of:
5815 * README-cvs: Remove.
5816 * bootstrap: Sync from gnulib.
5817 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
5818 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
5819
58202007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
5821
5822 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
5823 Setzer.
5824 (Java Differences): Fix some typos.
5825 * THANKS: Add Sebastian Setzer.
5826
58272007-03-07 Paolo Bonzini <bonzini@gnu.org>
5828
5829 * data/java.m4 (b4_single_class_if): Remove.
5830 (b4_abstract_if): Look at "%define abstract".
5831 (b4_lexer_if): New.
5832 (b4_union_name): Rename...
5833 (b4_yystype): ... to this. Map to "%define stype".
5834 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
5835 b4_maybe_throws): Fix quoting.
5836 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
5837 * data/lalr1.java (Lexer interface): Always define.
5838 (Lexer interface within parser class): Remove.
5839 (YYLexer class): New, used when "%code lexer" is present.
5840 (constructor): When "%code lexer" is used, pass %lex-param
5841 to the lexer constructor.
5842 (yylex, yyparse): Remove %lex-param from method invocations
5843 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
5844
5845 * doc/bison.texinfo (Java Bison Interface): Mention "%define
5846 abstract". Rename "%define union_name" to "%define stype".
5847 Rename method names according to previous patch.
5848 (Java Scanner Interface): Describe "%code lexer" instead of
5849 "%pure-parser" and "%define single_class".
5850 (Java Differences): Mention "%code lexer".
5851
5852 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
5853 Include scanner here, using macros from tests/local.at.
5854 (AT_DATA_CALC_Y): Remove final argument.
5855 (_AT_CHECK_JAVA_CALC): Likewise.
5856 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
5857 of %locations and %error-verbose.
5858 (main): Test with and without %lex-param.
5859 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
5860 (AT_BISON_OPTION_POPDEFS): Pop it.
5861
58622007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5863
5864 DJGPP spefic issue. Inhibit the use of disallowed characters for
5865 file name genertion on Win98, WinXP, etc. These are |<>":?*\
5866 and concern testsuite case 46.
5867 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
5868 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
5869 * djgpp/config.bat: Inhibit the use of disallowed characters.
5870
58712007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
5872
5873 Miscellaneous %define and %code cleanup.
5874 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
5875 values are interpreted.
5876 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
5877 documentation a little more.
5878 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
5879 muscle_percent_define_insert, muscle_percent_code_grow): New
5880 functions/macros.
5881 * src/muscle_tab.h (muscle_percent_define_insert,
5882 muscle_percent_code_grow): Prototype.
5883 * src/parse-gram.y (prologue_declaration): Use
5884 muscle_percent_define_insert and muscle_percent_code_grow when parsing
5885 %define and %code directives.
5886
5887 Make it easy to share %define boolean variables between the front-end
5888 and back-end. Though not used yet, this will be useful in the future.
5889 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
5890 Bison uses of names rather than just skeleton uses of names.
5891 (b4_percent_define_get, b4_percent_define_ifdef): Rename
5892 b4_percent_define_skeleton_variables(VARIABLE) to
5893 b4_percent_define_bison_variables(VARIABLE).
5894 (b4_percent_code_get, b4_percent_code_ifdef): Rename
5895 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
5896 b4_percent_code_bison_qualifiers(QUALIFIER).
5897 (b4_check_user_names_wrap): Update for renames.
5898 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
5899 muscle_percent_define_default): New functions mimicking
5900 b4_percent_define_flag_if and b4_percent_define_default.
5901
5902 For %define variables, report locations for invalid values and
5903 redefinitions.
5904 * data/bison.m4 (b4_percent_define_flag_if): Read
5905 b4_percent_define_loc(VARIABLE) to report the location of an invalid
5906 value for VARIABLE.
5907 (b4_percent_define_default): Save a special location in
5908 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
5909 must later be reported as invalid.
5910 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
5911 functions.
5912 (muscle_percent_define_insert): Record the location of VARIABLE in
5913 muscle percent_define_loc(VARIABLE), and use it to report the previous
5914 location for a redefinition.
5915 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
5916 (muscle_percent_define_default): Update like b4_percent_define_default.
5917 (muscle_grow_user_name_list): Rename to...
5918 (muscle_user_name_list_grow): ... this for consistency and use
5919 muscle_location_grow.
5920 * src/muscle_tab.h (muscle_location_grow): Prototype.
5921 * tests/input.at (%define errors): Update expected output.
5922 * tests/skeletons.at (%define boolean variables: invalid skeleton
5923 defaults): New test case.
5924
59252007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
5926
5927 * src/print.c (lookahead_set, state_default_rule): Remove.
5928 (print_reductions): Replace state_default_rule invocation with
5929 equivalent use of yydefact, which was computed in token_actions in
5930 tables.c.
5931 (print_results): Don't allocate lookahead_set.
5932
59332007-02-27 Paolo Bonzini <bonzini@gnu.org>
5934
5935 * data/lalr1.java: Prefix all private members with yy.
5936
59372007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
5938
5939 Use YYFPRINTF instead of fprintf where appropriate. Reported by
5940 Sebastien Fricker at
5941 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
5942 * THANKS: Add Sebastien Fricker.
5943 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
5944 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
5945 accept a variable number of arguments.
5946
59472007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
5948
5949 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
5950
59512007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5952
5953 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
5954 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
5955 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
5956
59572007-02-11 Paul Eggert <eggert@cs.ucla.edu>
5958
5959 Undo my 2007-02-07 change, switching back to the c-strcase module
5960 introduced in the 2007-02-03 change. Bruno Haible reported that
5961 the 2007-02-07 change would be dangerous in Turkish if we add a
5962 language whose name contains "i", since "i" is not lowercase "I"
5963 in Turkish.
5964 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
5965 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
5966 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
5967 * m4/.cvsignore: Remove strcase.m4.
5968 * src/getargs.c: Revert 2007-02-07 change, as follows.
5969 Include c-strcase.h.
5970 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
5971
59722007-02-11 Bruno Haible <bruno@clisp.org>
5973
5974 Enable the Java related testsuite tests when the only Java compiler
5975 found is a gcj < 4.3. Discussed at
5976 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
5977 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
5978
59792007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
5980
5981 * data/Makefile.am: Update copyright date.
5982 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
5983 yypstate_new returns NULL.
5984 (yypstate_new): Return NULL if malloc does.
5985 * src/reader.c (packgram): Move translation of rule actions from the
5986 beginning of packgram to...
5987 (check_and_convert_grammar): ... here right before packgram is invoked
5988 so it's easier to write more complete comments, and remove redundant
5989 code.
5990
59912007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
5992
5993 As in semantic actions, make @$ in %initial-action, %destructor, and
5994 %printer imply %locations.
5995 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
5996 scanning @$.
5997 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
5998 (@$ in %initial-action implies %locations,
5999 @$ in %destructor implies %locations,
6000 @$ in %printer implies %locations): ... these new test cases.
6001
60022007-02-07 Paul Eggert <eggert@cs.ucla.edu>
6003
6004 Undo most of the 2007-02-03 change, switching to the strcase module
6005 now that gnulib strcase has been fixed.
6006 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
6007 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
6008 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
6009 * m4/.cvsignore: Add strcase.m4.
6010 * src/getargs.c: Revert 2007-02-03 change, as follows.
6011 Don't include c-strcase.h.
6012 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
6013 strcasecmp has "unspecified behavior" outside the POSIX locale,
6014 but it works fine in practice if at least one argument is ASCII,
6015 as is the case in Bison.
6016
60172007-02-07 Paolo Bonzini <bonzini@gnu.org>
6018
6019 * tests/java.at: Skip tests if only one of javac/java is present.
6020 Reported by Joel E. Denny.
6021 * tests/atlocal.in: Adjust copyright years.
6022
60232007-02-05 Paolo Bonzini <bonzini@gnu.org>
6024
6025 * data/lalr1.java (Stack): Work around old verifiers that disallow
6026 access to the private fields of an inner class, from the outer class.
6027 We can make Stack's fields public because user code doesn't have access
6028 to the instance of Stack used by parse(). Reported by Paul Eggert.
6029
60302007-02-03 Paul Eggert <eggert@cs.ucla.edu>
6031
6032 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
6033 the right spot for these files?
6034 * bootstrap.conf (gnulib_modules): Add c-strcase.
6035 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
6036 c-strncasecmp.c.
6037 * src/getargs.c: Include c-strcase.h.
6038 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
6039 to avoid unspecified behavior.
6040
60412007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
6042
6043 * doc/bison.texinfo (Decl Summary): Correct typo.
6044
60452007-01-30 Paolo Bonzini <bonzini@gnu.org>
6046
6047 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
6048 Complain if the value does not match empty, "true" or "false".
6049 * data/c++.m4: Adjust default definitions of %define variables.
6050 * data/java.m4: Adjust default definitions of %define variables.
6051 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
6052 to above behavior.
6053 * tests/input.at (Boolean %define variables): Test new behavior.
6054
60552007-01-29 Paolo Bonzini <bonzini@gnu.org>
6056
6057 * NEWS: Mention java.
6058 * TODO: Remove things that are done.
6059 * bootstrap.conf: Add javacomp-script and javaexec-script.
6060 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
6061
6062 * data/Makefile.am: Add new files.
6063 * data/java-skel.m4: New.
6064 * data/java.m4: New.
6065 * data/lalr1.java: New.
6066
6067 * doc/bison.texinfo: Put "A Complete C++ Example" under
6068 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
6069 under Other Languages.
6070
6071 * src/getargs.c (valid_languages): Add Java.
6072 * src/getargs.h (struct bison_language): Update size of string fields.
6073
6074 * tests/Makefile.am: Add java.at.
6075 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
6076 * tests/java.at: New.
6077 * tests/testsuite.at: Include it.
6078
60792007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
6080
6081 Clean up.
6082 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
6083 at_directive_argv arguments so these no longer have to be global
6084 variables. Also, update the implementation for the following changes.
6085 (fail_for_at_directive_too_many_args,
6086 fail_for_at_directive_too_few_args): Add at_directive_name argument.
6087 (at_directive_name): Remove as at_directive_argv[0] will be used for
6088 this now.
6089 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
6090 for the directive name.
6091 (at_directive_argc, at_directive_argv): Make these local within
6092 skel_lex instead of global.
6093 (INITIAL): Update directive start action for above changes.
6094 (SC_AT_DIRECTIVE_ARG): Rename to...
6095 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
6096 (SC_AT_DIRECTIVE_SKIP_WS): Update.
6097 (scan_skel): Move yylex_destroy to...
6098 (skel_scanner_free): ... here.
6099 * tests/skeletons.at (installed skeleton file name): Rename to...
6100 (installed skeleton file names): ... this.
6101
61022007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
6103
6104 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
6105 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
6106 Summary" not "Directives".
6107 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
6108 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
6109 since the former is now the more complete one.
6110 (Prologue Alternatives): Likewise and do the same for %defines.
6111 (Table of Symbols): Add summary of %code, add summary of %define, and
6112 move full %code documentation to...
6113 (Decl Summary): ... here for consistency with other entries in these
6114 sections.
6115 Move %define entry in order to keep this list alphabetized.
6116 Reword %define entry a little to put less emphasis on the skeleton
6117 concept, which most users shouldn't have to think about.
6118
61192007-01-26 Paul Eggert <eggert@cs.ucla.edu>
6120
6121 Adjust to recent gnulib changes.
6122 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
6123 Add string.h, string_.h, unistd_.h, wchar_.h.
6124 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
6125 * src/system.h: Don't include <stpcpy.h>; this is now done by
6126 <string.h>.
6127
61282007-01-23 Paolo Bonzini <bonzini@gnu.org>
6129
6130 Simplify implementation of unqualified %code, implement macros for
6131 uniform treatment of boolean %define flags. Document %define.
6132 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
6133 b4_percent_code_ifdef): New.
6134 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
6135 * data/c++.m4: Define default value for global_tokens_and_yystype.
6136 * data/glr.cc: Likewise.
6137 * data/location.cc: Use b4_percent_define_flag_if.
6138
6139 * doc/bison.texinfo (Decl Summary): Document %define.
6140
6141 * src/parse-gram.y (Unqualified %code): Change muscle name to
6142 b4_percent_code().
6143 (content.opt): Default to empty.
6144
61452007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6146
6147 Implement support for relative and absolute skeleton file names.
6148 Discussed starting at
6149 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
6150 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
6151 (Bison Options): Document in --skeleton entry.
6152 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
6153 full_skeleton can't necessarily hold all of pkgdatadir.
6154 If the specified skeleton file name contains a `/', don't prepend
6155 pkgdatadir.
6156 * src/parse-gram.y (prologue_declaration): If the specified skeleton
6157 file name contains a `/', prepend the grammar file directory.
6158 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
6159 * skeletons.at: New file.
6160 (relative skeleton file names): New test case.
6161 (installed skeleton file names): New test case.
6162 * tests/testsuite.at: Include skeletons.at.
6163
6164 * bootstrap: Update copyright to 2007.
6165
61662007-01-17 Paolo Bonzini <bonzini@gnu.org>
6167
6168 * bootstrap: Remove occurrences of .#bootmp from the files.
6169
61702007-01-17 Akim Demaille <akim@epita.fr>
6171
6172 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
6173 nonterminals.
6174 Use per-type %printer.
6175
61762007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6177
6178 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
6179 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6180 djgpp/config.site, src/files.c, src/files.h, src/main.c,
6181 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
6182 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
6183 tests/glr-regression.at, tests/input.at, tests/local.at,
6184 tests/output.at, tests/torture.at: Update copyright to 2007.
6185
61862007-01-16 Akim Demaille <akim@epita.fr>
6187
6188 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
6189 error code.
6190 (Calc++ Scanner): Exit with failure if we can't open the input
6191 file.
6192 Accept "-" standing for stdin.
6193 (Calc++ Top Level): Print the result only if the parsing was
6194 successful.
6195
61962007-01-16 Akim Demaille <akim@epita.fr>
6197
6198 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
6199
62002007-01-15 Paolo Bonzini <bonzini@gnu.org>
6201 and Joel E. Denny <jdenny@ces.clemson.edu>
6202
6203 Clean up %define and %code implementation in M4 some. Most
6204 importantly, rename all related macros to be in the b4_percent_define
6205 and b4_percent_code namespaces. Also, complete support for `.' in
6206 %define variable names and %code qualifiers.
6207 * data/bison.m4 (b4_check_user_names): Check for special
6208 "SKELETON-NAMESPACE(name)" macros instead of using two nested
6209 m4_foreach loops.
6210 (b4_get_percent_define, b4_get_percent_code): Rename to...
6211 (b4_percent_define_get, b4_percent_code_get): ... these.
6212 Extend documentation with examples.
6213 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
6214 b4_percent_define_skeleton_variables and
6215 b4_percent_code_skeleton_qualifiers.
6216 Expect any value for the %define variable `foo' to be stored in the
6217 macro named `b4_percent_define(foo)'; expect any %code blocks for the
6218 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
6219 expect any unqualified %code blocks to be stored in a macro named
6220 `b4_percent_code_unqualified'.
6221 Use m4_indir so that %define variable names and %code qualifiers can
6222 contain `.', which is allowed by the grammar parser.
6223 (b4_percent_define_default): New macro to set a default value for a
6224 %define variable.
6225 (m4_wrap): Update wrapped code, and fix some underquoting.
6226 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
6227 Expect grammar uses of %define variables and %code qualifiers to be
6228 defined in b4_percent_define_user_variables and
6229 b4_percent_code_user_qualifiers.
6230 * data/c++.m4: Use b4_percent_define_default rather than
6231 m4_define_default. Fix some underquoting. Skeleton usage of %define
6232 variable define_location_comparison now implies skeleton usage of
6233 %define variable filename_type.
6234 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6235 data/push.c, data/yacc.c: Update macro names.
6236 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
6237 muscle names.
6238
62392007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6240
6241 DJGPP specific issues.
6242
6243 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
6244 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
6245
62462007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6247
6248 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
6249 run parsers in all tests so that Valgrind is invoked during
6250 maintainer-check-valgrind.
6251 (Duplicate representation of merged trees): Free all semantic values.
6252 (Duplicated user destructor for lookahead): Likewise.
6253
62542007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6255
6256 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
6257 command-line prefix.
6258 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
6259 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
6260 miss Valgrind messages.
6261 (Exploding the Stack Size with Malloc): Likewise.
6262
62632007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6264
6265 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
6266 locals. Reported by Juan Manuel Guerrero at
6267 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
6268 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
6269 Fix some indentation also.
6270 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
6271 explaining this issue.
6272
62732007-01-09 Paolo Bonzini <bonzini@gnu.org>
6274 and Joel E. Denny <jdenny@ces.clemson.edu>
6275
6276 Simplify union and prologue handling, and escape union and lex/parse
6277 params with digraphs.
6278 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
6279 values to the empty string since these are no longer guaranteed
6280 initialized by the front-end.
6281 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
6282 braces around b4_user_stype since this is no longer done by the
6283 front-end.
6284 * src/files.c, src/files.h (pre_prologue_obstack,
6285 post_prologue_obstack): Remove.
6286 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
6287 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
6288 with digraphs. This fixes lex params and parse params.
6289 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
6290 * src/output.c (prepare): Remove muscle insertion of the prologues.
6291 (output): Remove freeing of pre_prologue_obstack and
6292 post_prologue_obstack.
6293 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
6294 than prologue_augment for prologue parsing so you don't need prologue
6295 obstacks.
6296 (grammar_declaration): For %union RHS, use `braceless' instead of
6297 "{...}" so that braces are already stripped and code is escaped with
6298 digraphs.
6299 * src/reader.c (prologue_augment): Remove.
6300 (reader): Remove initialization of pre_prologue_obstack and
6301 post_prologue_obstack.
6302 * src/reader.h (prologue_augment): Remove.
6303
6304 * data/c.m4: Remove stray parenthesis.
6305
63062007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6307
6308 Remove quotes from variables names in %define directives and from
6309 qualifiers in %code directives, and restrict the characters that are
6310 allowed in them to M4-friendly ones. For %define, continue to support
6311 the quoted form as a deprecated feature. Discussed starting at
6312 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
6313 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
6314 %code.
6315 * doc/bison.texinfo (Prologue Alternatives): Update.
6316 (Decl Summary): In %defines entry, update mention of `%code requires'
6317 and `%code provides'.
6318 (C++ Location Values): Update %define uses.
6319 (Calc++ Parser Interface): Likewise.
6320 (Calc++ Parser): Likewise, and update `%code requires' uses.
6321 (Table of Symbols): Update %code documentation.
6322 * src/parse-gram.y (prologue_declaration): For %define variables, use
6323 `variable' instead of `STRING'.
6324 (grammar_declaration): For %code qualifiers, use `ID' instead of
6325 `STRING'.
6326 (variable): New nonterminal that takes an `ID' or a `STRING'.
6327 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
6328 and %define uses.
6329 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
6330 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
6331 (%define errors): Update %define uses.
6332
63332007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6334
6335 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
6336 instead of muscle_insert for %define values so that M4-special
6337 characters are replaced with digraphs.
6338 * tests/input.at (%define errors): Extend to check weird values.
6339
63402007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6341
6342 Instead of having skeletons declare all valid %define variables and
6343 %code qualifiers, provide macros that retrieve the associated values
6344 and build these lists automatically. Thus Bison will now warn when a
6345 variable or qualifier is not used by the skeleton in the current
6346 invocation regardless of whether it might sometimes be used by that
6347 skeleton in other invocations. Also, move all %define value macros to
6348 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
6349 form, which is replaced by %code.
6350 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
6351 (b4_check_user_names): ... this, and change the series of valid name
6352 arguments to a single list argument for names used in the skeleton
6353 similar to the existing list argument for names used in the grammar.
6354 Warn instead of complaining.
6355 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
6356 values and %code code, to format %code code properly, and to build
6357 lists of all %define variables and %code qualifiers used in the
6358 skeleton: b4_skeleton_percent_define_variables and
6359 b4_skeleton_percent_code_qualifiers.
6360 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
6361 Remove, and...
6362 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
6363 the skeleton names lists can finish building first. In place of
6364 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
6365 expect the lists b4_user_percent_define_variables and
6366 b4_user_percent_code_qualifiers.
6367 * data/c++.m4: Where setting default values for b4_parser_class_name,
6368 b4_location_type, b4_filename_type, b4_namespace, and
6369 b4_define_location_comparison, update their names to the
6370 b4_percent_define_ namespace.
6371 * data/glr.c: Don't use b4_check_percent_define_variables and
6372 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6373 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
6374 (b4_parser_class_name, b4_namespace): Define these using
6375 b4_get_percent_define for parser_class_name and namespace.
6376 * data/location.cc: Use b4_get_percent_define.
6377 * data/push.c: Don't use b4_check_percent_define_variables and
6378 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6379 * data/yacc.c: Likewise, and don't call m4_exit in
6380 b4_use_push_for_pull_if or m4_wrap code will never execute.
6381 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
6382 Rename to...
6383 (muscle_grow_user_name_list): ... this for consistency with the
6384 terminology used in bison.m4.
6385 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
6386 %define variable names, and rename muscle used_percent_define_variables
6387 to user_percent_define_variables.
6388 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
6389 user_percent_code_qualifiers.
6390 (content): Remove.
6391 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
6392 {CODE} form is no longer accepted.
6393 * tests/input.at (Reject bad %code qualifiers): Rename to...
6394 (Reject unused %code qualifiers): ... this, and update test output.
6395 (%define error): Update test output.
6396
63972007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
6398
6399 Check for unrecognized %define variables similar to checking for
6400 unrecognized %code qualifiers. Check for redefined %define variables.
6401 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
6402 generalizes...
6403 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
6404 (b4_check_percent_define_variables): New, also wraps it.
6405 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
6406 variables using b4_check_percent_define_variables.
6407 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
6408 all those exercised in the test suite and all those listed in the
6409 `Default values' section of c++.m4. Are there others?
6410 * data/push.c, data/yacc.c: Declare no valid %define variables.
6411 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
6412 similar to muscle_find, but it works even when the muscle stores a
6413 const value.
6414 (muscle_grow_used_name_list): New function for constructing the used
6415 name list muscles that b4_check_for_unrecognized_names requires.
6416 * src/parse-gram.y (prologue_declaration): Warn if a variable is
6417 %define'd more than once. Define the b4_used_percent_define_variables
6418 muscle with muscle_grow_used_name_list.
6419 (grammar_declaration): Abbreviate %code code with
6420 muscle_grow_used_name_list.
6421 * tests/input.at (%define errors): New.
6422
64232007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6424
6425 Provide warn_at, complain_at, and fatal_at function callbacks to the
6426 skeletons, and use this for %code qualifier complaints.
6427 * data/bison.m4 (b4_error_at): New, invoked by...
6428 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
6429 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
6430 @fatal_at(...@) directives.
6431 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
6432 qualifiers in b4_used_percent_code_qualifiers and to use
6433 b4_complain_at.
6434 * src/location.c, src/location.h (boundary_set_from_string): New global
6435 function.
6436 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
6437 function.
6438 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
6439 to b4_used_percent_code_qualifiers.
6440 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
6441 function.
6442 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
6443 (lineno): Rename to...
6444 (out_lineno): ... this so I don't misunderstand it again.
6445 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
6446 here; these newlines are in the input but not the output file.
6447 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
6448 (at_directive_perform): ... this new static function, and add handling
6449 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
6450 directives.
6451 * tests/input.at (Reject bad %code qualifiers): Update test output with
6452 locations and extend.
6453
6454 * tests/output.at (Output file name: [, Output file name: ]): Remove
6455 bogus comment about these tests failing.
6456
64572007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6458
6459 Clean up b4_check_percent_code_qualifiers a little.
6460 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
6461 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
6462 documentation and add examples.
6463 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
6464 qualifiers here.
6465
64662007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
6467
6468 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
6469 unreliable -- especially when they're hidden inside another macro.
6470 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
6471 data/c.m4: Remove m4_divert(-1).
6472 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6473 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
6474 m4_divert_push(0) and m4_divert_pop(0).
6475 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
6476 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
6477 pushed and popped by m4sugar, should be first on the stack.
6478
6479 Provide warn, complain, and fatal function callbacks to the skeletons.
6480 This provides more flexibility than m4_fatal, improves the error
6481 message format, and captures messages for translation. Discussed
6482 starting at
6483 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
6484 * data/bison.m4 (b4_error): New, invoked by...
6485 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
6486 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
6487 directives. Because these M4 macros might be called when the current
6488 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
6489 the previous removal of uses of m4_divert, which caused trouble.
6490 (b4_check_percent_code_qualifiers): Use b4_complain instead of
6491 m4_fatal to report unrecognized %code qualifiers.
6492 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
6493 push parser requests.
6494 * data/glr.c: Use b4_complain instead of m4_fatal to report
6495 non-deterministic push parser requests.
6496 Update @output usage to @output(...@) form.
6497 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
6498 report missing %defines. Update @output usage to @output(...@) form.
6499 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
6500 @output(...@) form.
6501 * src/main.c (main): Invoke skel_scanner_free.
6502 * src/scan-skel.h (skel_scanner_free): Prototype new function.
6503 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
6504 obstack_for_string from flex-scanner.h.
6505 (YY_DECL): Use to declare skel_lex static.
6506 (decode_at_digraphs): Remove; now handled in the new
6507 SC_AT_DIRECTIVE_ARG start condition.
6508 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
6509 functions.
6510 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
6511 at_directive_argv): New static globals.
6512 (INITIAL): Use fail_for_invalid_at.
6513 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
6514 recognize the start of a generalized `@directive(...@)' form and
6515 start...
6516 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
6517 directive args (using the new obstack_for_string), to decode the
6518 contained @ diagraphs, and to perform the directive. It recognizes
6519 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
6520 @output(...@).
6521 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
6522 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
6523 `@,'.
6524 (scan_skel): Initialize obstack_for_string on the first call.
6525 (skel_scanner_free): New function to free obstack_for_string.
6526 * tests/input.at (Reject bad %code qualifiers): Update test output.
6527
65282007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
6529
6530 Consolidate the 4 prologue alternative directives (%code, %requires,
6531 %provides, and %code-top) into a single %code directive with an
6532 optional qualifier field. Discussed at
6533 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
6534 * NEWS (2.3a+): Rewrite the existing entry for the prologue
6535 alternatives.
6536 * doc/bison.texinfo (Prologue Alternatives): Update.
6537 (Decl Summary): Update to %code "requires" and %code "provides".
6538 (Calc++ Parser): Update to %code "requires".
6539 (Table of Symbols): Remove entries for %requires, %provides, and
6540 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
6541 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
6542 are replaced by b4_percent_code_provides and b4_percent_code_requires,
6543 which are skeleton-specific.
6544 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
6545 declare what %code qualifiers it supports and to complain if any other
6546 qualifiers were used in the grammar.
6547 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
6548 and b4_user_code([b4_percent_code_provides]) in place of
6549 b4_user_requires and b4_user_provides.
6550 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
6551 Add b4_user_code([b4_percent_code_top]) and
6552 b4_user_code([b4_percent_code]).
6553 Invoke b4_check_percent_code_qualifiers.
6554 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
6555 PERCENT_REQUIRES): Remove.
6556 (grammar_declaration): Remove RHS's for %code-top, %provides, and
6557 %requires. Rewrite the %code RHS as the unqualified form defining the
6558 muscle b4_percent_code. Add another RHS for the qualified %code form,
6559 which defines muscles of the form b4_percent_code_QUALIFIER and the
6560 b4_used_percent_code_qualifiers muscle.
6561 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
6562 PERCENT_REQUIRES): Remove.
6563 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
6564 %code "requires" and %code "provides".
6565 * tests/input.at (Reject bad %code qualifiers): New.
6566
65672007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
6568
6569 Use the new code_props interface for destructors and printers.
6570 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
6571 printer_location members, and change the type of the destructor and
6572 printer members to code_props.
6573 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
6574 symbol_printer_get, semantic_type_destructor_set,
6575 semantic_type_printer_set, default_tagged_destructor_set,
6576 default_tagless_destructor_set, default_tagged_printer_set,
6577 default_tagless_printer_set): Use code_props in arguments and return
6578 types in place of char const * and location.
6579 (symbol_destructor_location_get, symbol_printer_location_get): Remove
6580 since the locations are now contained in the return of
6581 symbol_destructor_get and symbol_printer_get.
6582 * src/output.c (symbol_destructors_output, symbol_printers_output):
6583 Replace with...
6584 (symbol_code_props_output): ... this to eliminate duplicate code.
6585 (output_skeleton): Update to use symbol_code_props_output.
6586 * src/reader.c (symbol_should_be_used): Update use of
6587 symbol_destructor_get.
6588 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
6589 Update uses of the various _destructor_set and _printer_set functions.
6590 * src/symtab.c: (default_tagged_destructor_location,
6591 default_tagless_destructor_location, default_tagged_printer_location,
6592 default_tagless_printer_location): Remove since we...
6593 (default_tagged_destructor, default_tagless_destructor,
6594 default_tagged_printer, default_tagless_printer): ... change the type
6595 of these to code_props.
6596 (symbol_new, semantic_type_new, symbol_destructor_set,
6597 semantic_type_destructor_set, symbol_destructor_get,
6598 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
6599 symbol_check_alias_consistency, default_tagged_destructor_set,
6600 default_tagless_destructor_set, default_tagged_printer_set,
6601 default_tagless_printer_set): Update.
6602 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
6603 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
6604 code_props members.
6605 (symbol_print): Use SYMBOL_CODE_PRINT.
6606
66072007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
6608
6609 Use the new code_props interface for rule actions.
6610 * src/symlist.h (symbol_list): Replace action, action_location, and
6611 used members with a code_props action_props member.
6612 * src/reader.c (symbol_should_be_used, grammar_rule_check,
6613 grammar_midrule_action, grammar_current_rule_merge_set,
6614 grammar_current_rule_symbol_append, packgram): Update.
6615 * src/scan-code.h (translate_rule_action): Remove, no longer used.
6616 * src/scan-code.l (handle_action_dollar): Update.
6617 (translate_rule_action): Remove, no longer used.
6618 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
6619
66202007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6621
6622 Use the new code_props interface in parse-gram.y.
6623 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
6624 Update all uses of translate_* functions to use the new code_props
6625 interface and to use gram_scanner_last_string_free and
6626 code_scanner_last_string_free where possible.
6627 (grammar_declaration): symbol_list_destructor_set and
6628 symbol_list_printer_set now perform the translation, so don't do it
6629 here. Use gram_scanner_last_string_free where possible.
6630 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
6631 translate_code): Remove, no longer used.
6632 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
6633 symbol_list_printer_set): Perform code translation here rather than
6634 depending on the caller to do so.
6635
6636 * src/symlist.h (struct symbol_list): Correct some documentation typos.
6637 * src/scan-gram.h (gram_last_string): Remove declaration.
6638 * src/scan-gram.l (last_string): Declare it static.
6639
66402007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6641
6642 Encapsulate code properties and related functionality for the various
6643 destructors, printers, and actions into a code_props structure and
6644 interface. This patch merely implements code_props in scan-code.h and
6645 scan-code.l. Future patches will rewrite other modules to use it.
6646 Discussed starting at
6647 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
6648 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
6649 consistently initialize const structs that have an empty location
6650 field.
6651 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
6652 to ensure consistency.
6653 * src/scan-code.h (code_props): New structure.
6654 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
6655 function, macro, and const global variable for initializing a
6656 code_props with no code.
6657 (code_props_plain_init, code_props_symbol_action_init,
6658 code_props_rule_action_init, code_props_translate_code): The rest of
6659 the new code_props functional interface. Among other things, the init
6660 functions set the code_props kind field so that
6661 code_props_translate_code will know whether to behave like
6662 translate_symbol_action, translate_rule_action, or translate_code.
6663 These old translate functions must remain until all other modules are
6664 updated to use the new code_props interface.
6665 (code_scanner_last_string_free): New function similar to
6666 gram_scanner_last_string_free.
6667 (code_scanner_free): Add documentation.
6668 * src/scan-code.l: Implement the new interface.
6669 (code_lex): Make it static, add a code_props* argument, and remove the
6670 rule argument.
6671 (last_string): New static global similar to the one in scan-gram.l.
6672 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
6673 instead of rule.
6674 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
6675 code_props since Bison may one day use this information for destructors
6676 and printers.
6677 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
6678 (handle_action_dollar): Use symbol_list_n_get and set used flag
6679 directly since symbol_list_n_used_set is removed.
6680 (translate_action): Add a code_props* argument and remove the rule,
6681 action, and location arguments. Pass the code_props* on to code_lex.
6682 (translate_rule_action, translate_symbol_action, translate_code):
6683 Rewrite as wrappers around the new code_props interface.
6684 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
6685 it would eventually need to break the encapsulation of code_props.
6686
66872007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
6688
6689 * etc/.cvsignore: New.
6690
66912007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
6692
6693 Add maintainer-push-check to run maintainer-check using push parsing in
6694 place of pull parsing where available.
6695 * Makefile.am (maintainer-push-check): New.
6696 * data/bison.m4 (b4_use_push_for_pull_if): New.
6697 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
6698 appropriately based on their existing values.
6699 (yypush_parse): Don't print push-parser-specific diagnostics if push
6700 parsing is being used in place of pull parsing.
6701 * data/yacc.c: If push parsing should replace pull parsing, redirect to
6702 push.c.
6703 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
6704 variable, and insert b4_use_push_for_pull_flag into muscles.
6705 * tests/Makefile.am (maintainer-push-check): New.
6706
67072006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
6708
6709 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
6710 (whether successful or failed) so that yypush_parse can be invoked
6711 again to start a new parse using the same yypstate.
6712 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
6713 check multiple yypull_parse invocations on the same yypstate. For pull
6714 mode, extend to check multiple yyparse invocations.
6715 (Exploding the Stack Size with Alloca): Extend to try with
6716 %push-pull-parser.
6717 (Exploding the Stack Size with Malloc): Likewise.
6718
6719 * tests/calc.at (Simple LALR Calculator): Don't specify
6720 %skeleton "push.c" since %push-pull-parser implies that now.
6721 * tests/headers.at (export YYLTYPE): Don't check for the push
6722 declarations. Otherwise, this test case can't be used to see if push
6723 mode can truly emulate pull mode.
6724 * tests/input.at (Torturing the Scanner): Likewise.
6725 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
6726 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
6727 AT_YACC_IF, which now includes the case of push mode since %skeleton
6728 need not be used for push mode. This will be more intuitive once
6729 push.c is renamed to yacc.c.
6730
67312006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
6732
6733 For push mode, convert yyparse from a macro to a function, invoke yylex
6734 instead of passing a yylexp argument to yypull_parse, and don't
6735 generate yypull_parse or yyparse unless %push-pull-parser is declared.
6736 Discussed starting at
6737 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
6738 * data/bison.m4 (b4_pull_if): New.
6739 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
6740 * data/push.c: Improve M4 quoting a little.
6741 (b4_generate_macro_args, b4_parenthesize): Remove.
6742 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
6743 any time a pull parser is requested.
6744 Don't #define this as a wrapper around yypull_parse. Instead, when
6745 both push and pull are requested, make it a function that does that
6746 same thing.
6747 (yypull_parse): If there's a b4_prefix, #define this to
6748 b4_prefix[pull_parse] when both push and pull are requested.
6749 Don't define this as a function unless both push and pull are
6750 requested.
6751 Remove the yylexp argument and hard-code yylex invocation instead.
6752 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
6753 %push-parser.
6754 * src/getargs.c (pull_parser): New global initialized to true.
6755 * getargs.h (pull_parser): extern it.
6756 * src/output.c (prepare): Insert pull_flag muscle.
6757 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
6758 (prologue_declaration): Set both push_parser and pull_parser = true for
6759 %push-pull-parser. Set push_parser = true and pull_parser = false for
6760 %push-parser.
6761 * src/scan-gram.l: Don't accept %push_parser as an alternative to
6762 %push-parser since there's no backward-compatibility concern here.
6763 Scan %push-pull-parser.
6764 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
6765 instead of %push-parser.
6766 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
6767 prototype it in the module that calls yyparse.
6768 * tests/input.at (Torturing the Scanner): Likewise.
6769 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
6770
67712006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
6772
6773 Update etc/bench.pl. Optimize push mode a little (the yyn change
6774 deserves most of the credit).
6775 * Makefile.am (SUBDIRS): Add etc subdirectory.
6776 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
6777 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
6778 yytoken, yyval, and yyloc declarations to...
6779 (yyparse or yypush_parse): ... here to improve performance. For
6780 yypush_parse invocations after the first, be sure to assign yyn its old
6781 value again.
6782 (yypstate_new): Don't bother initializing the yyresult field since the
6783 initial value isn't used.
6784 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
6785 remove the #define that, in push mode, set it to yyps->NAME.
6786 * etc/Makefile.am: New.
6787 * etc/bench.pl: Remove and build it instead from...
6788 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
6789 "tests/bison" from the build directory by default rather than just
6790 invoking "bison" from $PATH.
6791 (calc_grammar): Update push parser code: don't declare yylval globally,
6792 don't define yyparse_wrapper, and don't #define yyparse.
6793 (bench_grammar): Update to check all working combinations of yacc.c,
6794 push.c, impure, pure, pull, and push.
6795
67962006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
6797
6798 For push mode, add pull wrappers around yypush_parse.
6799 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
6800 (yypull_parse): New function wrapping yypush_parse.
6801 (yyparse): New #define wrapping yypull_parse.
6802 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
6803 is declared.
6804 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
6805 prototype yylex in the module that calls yyparse, and don't prototype
6806 yyparse there. Otherwise, the yyparse expansion won't compile.
6807 * tests/input.at (Torturing the Scanner): Likewise.
6808
68092006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
6810
6811 Enable push parsers to operate in impure mode. Thus, %push-parser no
6812 longer implies %pure-parser. The point of this change is to move
6813 towards being able to test the push parser code by running the entire
6814 test suite as if %push-parser had been declared.
6815 * data/push.c (yypush_parse): For impure mode, remove the
6816 yypushed_char, yypushed_val, and yypushed_loc arguments.
6817 Instead, declare these as local variables initialized to the global
6818 yychar, yylval, and yylloc.
6819 For the first yypush_parse invocation only, restore the initial values
6820 of these global variables when it's time to read a token since they
6821 have been overwritten.
6822 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
6823 %push-parser.
6824 * tests/calc.at (Simple LALR(1) Calculator): Always declare
6825 %pure-parser along with %push-parser since this test case was designed
6826 for pure push parsers.
6827 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
6828 (AT_YACC_OR_PUSH_IF): New.
6829 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
6830 add a note that it's still wrong for some cases (as it has been for a
6831 while).
6832 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
6833 %push-parser no longer implies %pure-parser.
6834
68352006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
6836
6837 Remove some unnecessary differences between the pull parser code and
6838 the push parser code. This patch enables yynerrs in push mode.
6839 * data/push.c: Reformat M4 a little.
6840 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
6841 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
6842 because push mode is on. Instead, if pure mode is on, move yynerrs
6843 to...
6844 (b4_declare_parser_state_variables): ... here.
6845 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
6846 to yyps->NAME so it can be used in yypush_parse.
6847 (yypush_parse): Don't omit uses of yynerrs in push mode.
6848
68492006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
6850
6851 Fix bug such that the first pushed token's value and location are
6852 sometimes overwritten (sometimes by %initial-action) before being used.
6853 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
6854 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
6855 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
6856 more closely mimic the pull parser logic.
6857 Don't copy the pushed token to yychar, yylval, and yylloc until it's
6858 time to read a token, which is after any initialization of yylval and
6859 yylloc.
6860 (gottoken): Rename label to...
6861 (yyread_pushed_token): ... for clarity and to avoid infringing on the
6862 user namespace.
6863
68642006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
6865
6866 Rearrange initialization of the parser state variables so that the
6867 skeleton doesn't have to have a copy for pull mode and another for push
6868 mode. This patch also fixes at least a bug such that yylloc was not
6869 initialized (with b4_location_initial_line and
6870 b4_location_initial_column) upon calling yypush_parse. However, that
6871 initialization now overwrites the first token's location;
6872 %initial-action assigning @$ already did the same thing, and both bugs
6873 will be fixed in a later patch.
6874 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
6875 (b4_declare_parser_state_variables): Remove initialization of yytoken,
6876 yyss, yyvs, yyls, and yystacksize.
6877 (yypstate_new): Remove initialization of some yypstate fields: yystate,
6878 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
6879 yylsp.
6880 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
6881 yyps->NAME so it can be used in yypush_parse.
6882 (yyparse or yypush_parse): For yypush_parse, don't print the
6883 "Starting parse" diagnostic for invocations after the first.
6884 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
6885 yypush_parse, only do it for the first invocation.
6886 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
6887 initialization to occur in yypush_parse but only on the first
6888 invocation.
6889
68902006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6891
6892 * data/push.c: Add CPP guards around push parser declarations in both
6893 the header and the code file.
6894 In the code file, move the push parser declarations to the same place
6895 they appear in the header file.
6896 Clean up the M4 some, especially the inconsistent underquoting in
6897 some b4_c_function_def and b4_c_function_decl uses.
6898
68992006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6900
6901 Encapsulate the push parser state variables into an M4 macro so the
6902 push skeleton doesn't have to list them again for pull mode's yyparse.
6903 For push mode, remove yypush_parse's local equivalents of these
6904 variables to eliminate unnecessary copying between the two sets at
6905 run-time. This patch also fixes at least a bug related to multiple
6906 %initial-action invocations in push mode.
6907 * data/push.c (b4_declare_parser_variables): Rename to...
6908 (b4_declare_scanner_communication_variables): ... this for clarity and
6909 update both uses.
6910 (b4_declare_yyparse_variables): Remove and move its contents to the one
6911 spot where it was invoked.
6912 (b4_declare_parser_state_variables): New macro containing the parser
6913 state variables required by push mode.
6914 (struct yypstate): Replace all fields but yynew with
6915 b4_declare_parser_state_variables.
6916 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
6917 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
6918 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
6919 (yyparse or yypush_parse): For yyparse in pull mode, replace local
6920 parser state variable declarations with
6921 b4_declare_parser_state_variables.
6922 Don't initialize parser state variables when calling yypush_parse since
6923 yypstate_new already does that.
6924 Invoke the user's initial action only upon the first yypush_parse
6925 invocation.
6926 Remove all code that copies between the local parser state variables
6927 and the yypstate.
6928
69292006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6930
6931 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
6932 prevent a name collision in a future patch where these names will
6933 sometimes be #define'd.
6934 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
6935 since it no longer has the same name as the existing argument.
6936 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
6937
69382006-12-19 Paolo Bonzini <bonzini@gnu.org>
6939 and Joel E. Denny <jdenny@ces.clemson.edu>
6940
6941 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
6942 that the argument is case-insensitive, and there's no `=' here.
6943 For the %skeleton entry, mention that %language is better.
6944 (Bison Options): Likewise for --language and --skeleton. Move the
6945 --skeleton entry so that the `Tuning the parser' section is sorted
6946 alphabetically on long options.
6947 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
6948 %language directive in detail here; cross-reference the %language
6949 documentation instead.
6950 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
6951 `%require "2.3b"' so that the example is always up-to-date.
6952 (Table of Symbols): Add entries for %language and %skeleton.
6953 * examples/extexi (normalize): Instead of replacing every %require
6954 argument with the current Bison version, just substitute for
6955 `@value{VERSION}'. This guarantees that we're testing what actually
6956 appears in the documentation.
6957 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
6958 rather than `@VERSION@'.
6959
69602006-12-18 Paul Eggert <eggert@cs.ucla.edu>
6961
6962 * NEWS: Reword the %language news a bit, and put it earlier.
6963
6964 * src/getargs.c (skeleton_arg): Last arg is now location const *.
6965 Rewrite to simplify the logic.
6966 (language_argmatch): Likewise.
6967 (program_name): We now own this var.
6968 * src/getargs.h (struct bison_language): Use char[] rather than
6969 const char *.
6970
6971 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
6972 Java is supported.
6973 * src/complain.c (program_name): Remove decl; no longer needed.
6974 * src/main.c (program_name): Remove; now belongs to getargs.
6975
69762006-12-18 Paolo Bonzini <bonzini@gnu.org>
6977
6978 * NEWS: Document %language.
6979
6980 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
6981
6982 * data/c-skel.m4, data/c++-skel.m4: New files.
6983 * data/glr.c: Complain on push parsers.
6984
6985 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
6986 over %skeleton.
6987 (Decl Summary): Document %language and %skeleton.
6988 (Command line): Document -L.
6989
6990 * examples/extexi: Rewrite %require directive.
6991 * examples/calc++/Makefile.am: Pass VERSION to extexi.
6992
6993 * src/files.c (compute_exts_from_gc): Look in language structure
6994 for .y extension.
6995 (compute_file_name_parts): Check whether .tab should be added.
6996 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
6997 (language, skeleton_arg, language_argmatch): New.
6998 (long_options): Add --language.
6999 (getargs): Use skeleton_arg, add -L/--language.
7000 * src/getargs.h: Include location.h.
7001 (struct bison_language, language, skeleton_arg, language_argmatch): New.
7002 * src/output.c (prepare): Pick default skeleton from struct language.
7003 Don't dispatch C skeletons here.
7004 * src/parse-gram.y (PERCENT_LANGUAGE): New.
7005 (prologue_declaration): Add "%language" rule, use skeleton_arg.
7006 * src/scan-gram.l ("%language"): New rule.
7007
7008 * tests/calc.at: Test %skeleton and %language.
7009 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
7010 (AT_GLR_IF): Look for %skeleton "glr.cc".
7011 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
7012 (AT_YACC_IF): Reject %language.
7013
70142006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7015
7016 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
7017 since it wasn't used; only the typedef name 'semantic_type' is needed.
7018 Also, omit trailing white space.
7019
7020 * bootstrap: Sync from coreutils.
7021 (gnulib_extra_files): Add build-aux/announce.gen.
7022 (slurp): Adjust .gitignore files like .cvsignore files.
7023 * build-aux/announce-gen: Remove from CVS, since bootstrap
7024 now creates this.
7025
70262006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
7027
7028 Make %push-parser imply %pure-parser. This fixes several bugs; see
7029 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
7030 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
7031 pure_parser = true.
7032 * data/push.c: Don't bother testing b4_push_if when deciding whether
7033 to expand b4_declare_parser_variables globally.
7034 (yypush_parse): Likewise in here.
7035
7036 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
7037 (yy_reduce_print): Reformat M4 for readability.
7038
70392006-12-15 Bob Rossi <bob@brasko.net>
7040 and Joel Denny <jdenny@ces.clemson.edu>
7041
7042 * data/push.c (yypstate): Add typedef, and update all uses of
7043 struct yypstate to just yypstate.
7044 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
7045
70462006-12-14 Bob Rossi <bob@brasko.net>
7047
7048 * data/push.c (yypush_parse): Declare prototype regardless of
7049 %locations option.
7050
70512006-12-14 Bob Rossi <bob@brasko.net>
7052
7053 * data/push.c (yyparse): Remove the prototype and the #define when in
7054 push-parser mode.
7055
70562006-12-13 Bob Rossi <bob@brasko.net>
7057
7058 * data/push.c (yypstate_init): Rename to...
7059 (yypstate_new): ... this and use b4_c_function_def.
7060 (yypstate_delete): New.
7061 (yypush_parse): Change parameters yynval and yynlloc to be const.
7062 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
7063 yypstate_delete functions.
7064
70652006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
7066
7067 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
7068 strange test case titles. Reported by Bob Rossi.
7069
70702006-12-13 Paul Eggert <eggert@cs.ucla.edu>
7071
7072 * TODO: Add pointer to Sylvain Schmitz's work on static detection
7073 of potential ambiguities in GLR grammers.
7074
70752006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
7076
7077 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
7078 `bison ', use m4_index instead of m4_substr since chopping up a string
7079 containing M4-special characters causes problems here.
7080
7081 Fix a couple of bugs related to special characters in user-specified
7082 file names, and make it easier for skeletons to compute output file
7083 names with the same file name prefix as Bison-computed output file
7084 names.
7085 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
7086 b4_parser_file_name and b4_spec_defines_file instead of
7087 @output_parser_name@ and @output_header_name@, which are now redundant.
7088 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
7089 b4_parser_file_name, b4_spec_defines_file, and the new
7090 @basename(FILENAME@) instead of @output_parser_name@ and
7091 @output_header_name@, which inappropriately escaped the file names as
7092 C string literals.
7093 * src/files.c (all_but_ext): Remove static qualifier.
7094 (compute_output_file_names): Move `free (all_but_ext)' to...
7095 (output_file_names_free): ... here since all_but_ext is needed later.
7096 * src/files.h (all_but_ext): Extern.
7097 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
7098 exactly what MUSCLE_INSERT_STRING used to do.
7099 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
7100 characters are escaped properly.
7101 * src/output.c (prepare): Define muscle file_name_all_but_ext as
7102 all_but_ext.
7103 For pkgdatadir muscle, maintain previous functionality by using
7104 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
7105 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
7106 digraphs would never be expanded. Hopefully no one has M4-special
7107 characters in his Bison installation path.
7108 * src/scan-skel.l: Don't parse @output_header_name@ and
7109 @output_parser_name@ anymore since they're now redundant.
7110 In @output, use decode_at_digraphs.
7111 Parse a new @basename command that invokes last_component.
7112 (decode_at_digraphs): New.
7113 (BASE_QPUTS): Remove unused.
7114 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
7115 (Output file name): New tests.
7116
71172006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
7118
7119 Warn about output files that are generated by the skeletons and that
7120 conflict with other output files.
7121 * data/glr.c: Don't generate the header file here when glr.cc does.
7122 * src/files.c (file_names, file_names_count): New static globals.
7123 (compute_output_file_names): Invoke output_file_name_check for files
7124 not generated by the skeletons and remove existing checks.
7125 (output_file_name_check): New function that warns about conflicting
7126 output file names.
7127 (output_file_names_free): Free file_names.
7128 * src/files.h (output_file_name_check): Declare.
7129 * src/scan-skel.l: Invoke output_file_name_check for files generated by
7130 the skeletons.
7131 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
7132 (Conflicting output files): New tests.
7133
71342006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7135
7136 * doc/bison.texinfo: Fix a couple of typos.
7137
71382006-12-08 Bob Rossi <bob@brasko.net>
7139
7140 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
7141 Rename to...
7142 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
7143 update all uses.
7144 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
7145 (yypush_parse): Rename yypvars argument to yyps and remove redundant
7146 local pv.
7147 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
7148 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
7149
71502006-12-07 Bob Rossi <bob@brasko.net>
7151 and Joel Denny <jdenny@ces.clemson.edu>
7152
7153 * data/push.c (yypvarsinit): Change return type from void* to struct
7154 yypvars*. No longer cast to void* on return.
7155 (struct yypvars): Remove yylen since it need not be remembered between
7156 yypushparse invocations.
7157 (yypushparse): Don't copy between yylen and pv->yylen.
7158
71592006-12-05 Bob Rossi <bob@brasko.net>
7160
7161 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
7162 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
7163 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
7164 (struct yypvars): Remove b4_declare_parser_variables.
7165 (yypvarsinit): Remove init code for removed variables.
7166 (global scope): Do not declare b4_declare_parser_variables if
7167 push or pure mode.
7168 (yypushparse): Add b4_declare_parser_variables.
7169 Init new local variables, and remove init code for removed
7170 yypvars variables.
7171 (yyparse): Delete.
7172 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
7173 and yyparse for other modes.
7174 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
7175 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
7176 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
7177 (AT_PURE_LEX_IF): True if pure or push parser.
7178
71792006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
7180
7181 Document Yacc prologue alternatives and default %destructor's and
7182 %printer's as experimental. Don't mention Java yet. Discussed at
7183 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
7184 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
7185 (2.3a): Annotate this entry to say the old forms of these features were
7186 also experimental.
7187 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
7188 Table of Symbols): Say they're experimental. Comment out any mention
7189 of Java (we'll want this back eventually).
7190
71912006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
7192
7193 Support a file name argument to %defines. Deprecate `=' in
7194 %file-prefix, %name-prefix, and %output. Discussed at
7195 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
7196 * NEWS (2.3a+): Mention.
7197 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
7198 form of %defines, and remove `=' from entries for %file-prefix,
7199 %name-prefix, and %output.
7200 * src/parse-gram.y (prologue_declaration): Implement.
7201 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
7202 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
7203 all but one occurrence of %name-prefix.
7204 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
7205 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
7206 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
7207 occurrence of each of %file-prefix and %output. Add check for %defines
7208 with argument.
7209 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
7210 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
7211 Remove the `=' from %output.
7212
72132006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
7214
7215 Don't escape $ in test case titles since Autoconf 2.61 now does that
7216 correctly.
7217 * tests/actions.at (Default %printer and %destructor are not for error
7218 or $undefined): Here.
7219 (Default %printer and %destructor are not for $accept): Here.
7220 * tests/input.at (Invalid $n and @n): Here.
7221
72222006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
7223
7224 Rename <!> to <>. Discussed starting at
7225 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
7226 * NEWS (2.3a+): Update.
7227 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
7228 Update.
7229 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
7230 * src/scan-gram.l (INITIAL): Implement.
7231 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
7232 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
7233 comment.
7234 * tests/actions.at (Default tagless %printer and %destructor,
7235 Default tagged and per-type %printer and %destructor,
7236 Default %printer and %destructor are not for error or $undefined,
7237 Default %printer and %destructor are not for $accept,
7238 Default %printer and %destructor for mid-rule values): Update.
7239 * tests/input.at (Default %printer and %destructor redeclared,
7240 Unused values with default %destructor): Update.
7241
72422006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
7243
7244 Don't let %prec take a nonterminal.
7245 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
7246 token.
7247 * tests/input.at (%prec takes a token): New test checking that %prec
7248 won't take a nonterminal.
7249
72502006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7251
7252 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
7253 it was double-quoted.
7254 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
7255 grammar is maintained with Bison's highest standards.
7256 * src/getargs.c: Fix some typos in Doxygen comments.
7257
72582006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7259
7260 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
7261 later. Reported by Paul Eggert in
7262 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
7263 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
7264 * src/scan-code.l (translate_action): Don't bother invoking
7265 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
7266 (code_scanner_free): Instead of invoking
7267 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
7268 which frees more.
7269 * src/scan-gram.l (gram_scanner_free): Likewise.
7270 * src/scan-skel.l (scan_skel): Likewise.
7271
72722006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
7273
7274 * src/files.c (tr): Change return type to void.
7275 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
7276 has been called previously for the same key.
7277 (muscle_find): Return storage instead of value so that
7278 --enable-gcc-warnings doesn't produce warnings that the return discards
7279 const. aver that the value and storage are the same since storage
7280 could potentially be NULL when value is not.
7281 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
7282 same as 0.
7283
72842006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7285
7286 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
7287 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
7288 us a slightly cleaner distribution, and also works.
7289 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
7290 gnulib changes.
7291
72922006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
7293 and Paul Eggert <eggert@cs.ucla.edu>
7294
7295 Don't let Bison leak memory except when it complains.
7296 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
7297 (spec_defines_file, dir_prefix): Now char *, not const char *,
7298 since they are freed.
7299 * src/files.c: Likewise.
7300 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
7301 Likewise.
7302 (tr): Now operates in-place. All uses changed.
7303 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
7304 values.
7305 (compute_file_name_parts, compute_output_file_names): Don't store
7306 read-only data in variables that will be freed.
7307 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
7308 src_extension, and header_extension.
7309 (output_file_names_free): New public function to free
7310 spec_verbose_file, spec_graph_file, spec_defines_file,
7311 parser_file_name, and dir_prefix.
7312 * src/getargs.c (getargs): Don't store read-only data in variables that
7313 will be freed.
7314 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
7315 (which previously existed but was unused), and quotearg_free.
7316 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
7317 * src/muscle_tab.c: Likewise.
7318 (muscle_entry): Make the value char const *,
7319 and add a new storage member that is char * and can be freed.
7320 (muscle_entry_free): New private function.
7321 (muscle_init): Use it instead of free.
7322 (muscle_insert, muscle_grow): Update and use new storage member.
7323 (muscle_code_grow): Free the string passed to muscle_grow
7324 since it's not needed anymore.
7325 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
7326 add a new `char *code' member.
7327 ("{...}"): Declare semantic type as code.
7328 * src/scan-code.h (translate_rule_action):
7329 (translate_symbol_action, translate_code, translate_action): Return
7330 `char const *' rather than `char *' since external code should not free
7331 these strings.
7332 * src/scan-code.l: Likewise.
7333 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
7334 which is "{...}" in the parser.
7335 * tests/Makefile.am (maintainer-check-valgrind): Set
7336 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
7337 Valgrind.
7338 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
7339 complain.
7340 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
7341 expecting a non-zero exit status sets --leak-check=summary and
7342 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
7343 this case, and we don't want to hear about it.
7344
73452006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7346
7347 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
7348 instead of from the template, to simplify configuration a bit.
7349 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
7350 and m4/wint_t.m4, as they are needed with the latest gnulib.
7351
73522006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7353
7354 Disable unset/unused mid-rule value warnings by default, and recognize
7355 --warnings=midrule-values to enable them. Discussed starting at
7356 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
7357 * NEWS (2.3a+): Mention.
7358 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
7359 warnings): Add entry for midrule-values subargument.
7360 * src/reader.c (symbol_should_be_used): Don't return true just because
7361 the value is a set/used mid-rule value unless
7362 --warnings=midrule-values was specified.
7363 * tests/input.at (Unused values, Unused values before symbol
7364 declarations): Run tests with and without --warnings=midrule-values.
7365
7366 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
7367 than LIST_FREE directly.
7368
73692006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7370
7371 Finish implementing --warnings=error, which should not be implied by
7372 --warnings=all (or by its synonyms -W and --warnings without
7373 subarguments).
7374 * src/complain.c (set_warning_issued): New function to report that
7375 warnings are being treated as errors and to record an error if so.
7376 Invoke...
7377 (warn_at, warn): ... here.
7378 * src/getargs.c (warnings_args, warnings_types): Reorder so that
7379 "error - warnings are errors" does not appear above "all - all of the
7380 above".
7381 (getargs): For -W and --warnings without subarguments, don't let
7382 FLAGS_ARGMATCH set warnings_error in warnings_flag.
7383 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
7384
73852006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7386
7387 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
7388 empty subargument list. For example: `bison --warnings= parser.y'.
7389
73902006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7391
7392 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
7393 the parser header file so that gcc doesn't warn.
7394
73952006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7396
7397 Split the default %destructor/%printer into two kinds: <*> and <!>.
7398 Discussed starting at
7399 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
7400 * NEWS (2.3a+): Mention.
7401 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
7402 previous change today related to mid-rules.
7403 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
7404 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
7405 (TYPE_TAG_ANY): Add as <*>.
7406 (TYPE_TAG_NONE): Add as <!>.
7407 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
7408 for <*> and <!>.
7409 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
7410 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
7411 * src/symlist.c (symbol_list_default_new): Split into tagged and
7412 tagless versions.
7413 (symbol_list_destructor_set, symbol_list_printer_set): Split
7414 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
7415 SYMLIST_DEFAULT_TAGLESS.
7416 * src/symlist.h: Update symbol_list_default*_new prototypes.
7417 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
7418 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
7419 * src/symtab.c (default_destructor, default_destructor_location,
7420 default_printer, default_printer_location): Split each into tagged and
7421 tagless versions.
7422 (symbol_destructor_get, symbol_destructor_location_get,
7423 symbol_printer_get, symbol_printer_location_get): Implement tagged
7424 default and tagless default cases.
7425 (default_destructor_set, default_printer_set): Split each into tagged
7426 and tagless versions.
7427 * src/symtab.h: Update prototypes.
7428 * tests/actions.at (Default %printer and %destructor): Rename to...
7429 (Default tagless %printer and %destructor): ... this, and extend.
7430 (Per-type %printer and %destructor): Rename to...
7431 (Default tagged and per-type %printer and %destructor): ... this, and
7432 extend.
7433 (Default %printer and %destructor for user-defined end token): Extend.
7434 (Default %printer and %destructor are not for error or $undefined):
7435 Update.
7436 (Default %printer and %destructor are not for $accept): Update.
7437 (Default %printer and %destructor for mid-rule values): Extend.
7438 * tests/input.at (Default %printer and %destructor redeclared): Extend.
7439 (Unused values with default %destructor): Extend.
7440
74412006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7442
7443 Don't apply the default %destructor/%printer to an unreferenced midrule
7444 value. Mentioned at
7445 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
7446 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
7447 like $@n instead of just @n so that the default %destructor/%printer
7448 logic doesn't see them as user-defined symbols.
7449 (symbol_is_dummy): Check for both forms of the name.
7450 * src/reader.c (packgram): Remove the `$' from each midrule symbol
7451 name for which the midrule value is referenced in any action.
7452 * tests/actions.at (Default %printer and %destructor for mid-rule
7453 values): New test.
7454 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
7455 for change to dummy symbol names.
7456
74572006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7458
7459 Warn about unset midrule $$ if the corresponding $n is used.
7460 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
7461 $n usage.
7462 (packgram): Before invoking grammar_rule_check on any rule, make sure
7463 all actions have already been scanned in order to set `used' flags.
7464 Otherwise, checking that a midrule's $$ is set will not always work
7465 properly because the midrule check must forward-reference the midrule's
7466 parent rule.
7467 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
7468 warning.
7469
74702006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7471
7472 More improvements to the documentation of the prologue alternatives:
7473 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
7474 Bison manual.
7475 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
7476 some text to clarify the relative importance of the new directives and
7477 to show how these directives may be viewed as code labels.
7478
74792006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
7480
7481 Similar to the recently removed %before-header, add %code-top as the
7482 alternative to the pre-prologue. Mentioned at
7483 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
7484 Also, let the prologue alternatives appear in the grammar section.
7485 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
7486 (prologue_declaration): Move the existing prologue alternatives to...
7487 (grammar_declaration): ... here and add %code-top.
7488 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
7489
7490 Clean up and extend documentation for the prologue alternatives.
7491 * NEWS (2.3a+): Describe prologue alternatives.
7492 * doc/bison.texinfo (Prologue): Move discussion of prologue
7493 alternatives to...
7494 (Prologue Alternatives): ... this new section, and extend it to discuss
7495 all 4 directives in detail.
7496 (Table of Symbols): Clean up discussion of prologue alternatives and
7497 add %code-top.
7498
74992006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7500
7501 DJGPP specific issues.
7502
7503 * djgpp/config.bat: config.hin has been moved to lib. Adjust
7504 config.bat accordingly.
7505 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
7506 * djgpp/config.site: Likewise.
7507
75082006-10-16 Paolo Bonzini <bonzini@gnu.org>
7509
7510 Replace %*-header with %provides, %requires, %code. See discussion at
7511 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
7512
7513 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
7514 (b4_user_start_header): Remove.
7515 * data/glr.c: Use new macros instead of b4_*start_header
7516 and b4_*end_header.
7517 * data/glr.cc: Likewise.
7518 * data/lalr1.cc: Likewise.
7519 * data/push.c: Likewise.
7520 * data/yacc.c: Likewise.
7521
7522 * doc/bison.texinfo: Remove %before-header, rename
7523 %{start,end,after}-header to %requires, %provides, %code.
7524
7525 * src/parse-gram.y: Likewise (also rename token names accordingly).
7526 * src/scan-gram.l: Likewise.
7527 * tests/actions.at: Likewise.
7528
75292006-10-14 Paul Eggert <eggert@cs.ucla.edu>
7530
7531 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
7532 Problem reported by Joel E. Denny.
7533
75342006-10-14 Jim Meyering <jim@meyering.net>
7535
7536 (Sync from coreutils.)
7537 Work also when the working directory (with e.g. coreutils sources)
7538 is version controlled with git, rather than CVS.
7539 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
7540 rather than CVS.
7541 In messages and comments, say e.g., "checked-out sources",
7542 rather than "CVS sources".
7543 (version_controlled_file): New function. Work for git as well as
7544 for CVS. Don't use grep's -q option.
7545 (slurp): Call it here, in place of CVS-specific code.
7546
75472006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
7548
7549 Fix testsuite for ./configure --enable-gcc-warnings:
7550 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
7551 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
7552 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
7553 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
7554 * test/regression.at (Diagnostic that expects two alternatives):
7555 Likewise.
7556
75572006-10-12 Paul Eggert <eggert@cs.ucla.edu>
7558
7559 * bootstrap.conf (gnulib_modules): Add config-h.
7560 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
7561 worry about HAVE_CONFIG_H.
7562 * lib/abitset.c: Likewise.
7563 * lib/bitset.c: Likewise.
7564 * lib/bitset_stats.c: Likewise.
7565 * lib/bitsetv-print.c: Likewise.
7566 * lib/bitsetv.c: Likewise.
7567 * lib/ebitset.c: Likewise.
7568 * lib/get-errno.c: Likewise.
7569 * lib/lbitset.c: Likewise.
7570 * lib/subpipe.c: Likewise.
7571 * lib/timevar.c: Likewise.
7572 * lib/vbitset.c: Likewise.
7573 * lib/bitset.c: Include "bitset.h" first, to test interface.
7574 * lib/bitset_stats.c: Include "bitset_stats.h" first.
7575 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
7576 * lib/bitsetv.c: Include "bitsetv.h" first.
7577 * lib/get-errno.c: Include "get-errno.h" first.
7578 * m4/.cvsignore: Add config-h.m4.
7579 * tests/actions.at (Default %printer and %destructor for ...):
7580 Adjust expected line numbers in output to reflect removal of #if
7581 HAVE_CONFIG_H lines.
7582 * tests/glr-regression.at (Missed %merge type warnings when ...):
7583 Likewise.
7584 * tests/regression.at (Braced code in declaration in rules section):
7585 Likewise.
7586 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
7587 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
7588 Include <config.h> unconditionally.
7589
7590 * bootstrap: Sync from coreutils, as follows:
7591
7592 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
7593
7594 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
7595 variable was sometimes used without being initialized. This
7596 messed up the installation of the INSTALL file in some cases.
7597
7598 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
7599
7600 * bootstrap (usage, main program, symlink_to_gnulib): Add option
7601 --copy. Inspired by a suggestion from Bruno Haible.
7602
7603 2006-10-03 Jim Meyering <jim@meyering.net>
7604
7605 * bootstrap: Undo last change to this file, since now gnulib-tool
7606 sticks with the automake default in generating dependencies.
7607
76082006-10-12 Paul Eggert <eggert@cs.ucla.edu>
7609
7610 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
7611 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
7612
7613 * doc/bison.1: Add copyright notice.
7614
7615 * data/glr.c: Don't include <stdarg.h>; not used.
7616
7617 * NEWS: The -g and --graph options now output graphs in Graphviz
7618 DOT format, not VCG format.
7619 * doc/bison.1: Likewise.
7620 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
7621 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
7622 of this change in
7623 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
7624 * TODO: Remove Graphviz entry.
7625 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
7626 remove vcg.c, vcg.h, vcg_defaults.h.
7627 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
7628 * src/graphviz.c, src/graphviz.h: New files.
7629 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
7630 * src/files.h: Make comment more generic.
7631 * src/main.c (main): Likewise.
7632 * src/print_graph.h: Likewise.
7633 * src/getargs.c (usage): Make usage description more generic.
7634 * src/print_graph.c: Include graphviz.h rather than vcg.h.
7635 (static_graph, fgraph): Remove. All uses changed to pass
7636 arguments instead of sharing a static var.
7637 (print_core, print_actions, print_state, print_graph):
7638 Output graphviz format rather than VCG format.
7639 * tests/.cvsignore: Remove *.vcg; add *.dot.
7640 * tests/output.at: Expect *.dot files, not *.vcg files.
7641
7642 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
7643 accommodates the 2006-10-08 change.
7644
76452006-10-11 Bob Rossi <bob@brasko.net>
7646
7647 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
7648 (b4_yyssa, b4_yyerror_range): New macros.
7649 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
7650 (yypvarsinit): Remove init of removed fields.
7651 (yypushparse): Remove use of removed fields; use new macros instead.
7652
76532006-10-11 Paul Eggert <eggert@cs.ucla.edu>
7654
7655 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
7656 in a push parser. Reindent slightly to match yacc.c better.
7657
76582006-10-11 Bob Rossi <bob@brasko.net>
7659
7660 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
7661 yymsg_alloc fields.
7662 (yypvarsinit, yypushparse): Remove init of removed fields.
7663 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
7664
76652006-10-09 Paul Eggert <eggert@cs.ucla.edu>
7666
7667 * THANKS: Add Paolo Bonzini and Bob Rossi.
7668
76692006-10-08 Paolo Bonzini <bonzini@gnu.org>
7670
7671 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
7672 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
7673 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
7674 b4_define_user_cde and uses): Remove.
7675 (b4_comment, b4_prefix, b4_sync_start): New.
7676 * data/bison.m4: New file, with most of the content removed from c.m4.
7677 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
7678 * src/output.c (output_skeleton): Pass bison.m4.
7679 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
7680 only if specified.
7681
76822006-10-05 Paul Eggert <eggert@cs.ucla.edu>
7683
7684 Fix test failure reported by Tom Lane in
7685 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
7686 and try to make such failures easier to catch in the future.
7687 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
7688 that's now the caller's responsibility.
7689 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
7690 Set yychar = YYEOF if it's negative.
7691 * tests/actions.at (yylex): Abort if asked to read past EOF.
7692 * tests/conflicts.at (yylex): Likewise.
7693 * tests/cxx-type.at (yylex): Likewise.
7694 * tests/glr-regression.at (yylex): Likewise.
7695 * tests/input.at (yylex): Likewise.
7696 * tests/regression.at (yylex): Likewise.
7697 * tests/torture.at (yylex): Likewise.
7698
76992006-10-01 Paul Eggert <eggert@cs.ucla.edu>
7700
7701 Fix problems with translating English-language diagnostics.
7702 * bootstrap: Fix bug introduced in recent bootstrap changes, with
7703 respect to bison-runtime pot generation. The YY_ stuff
7704 wasn't being captured.
7705 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
7706 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
7707 * runtime-po/POTFILES.in: Add data/push.c.
7708
77092006-09-29 Paul Eggert <eggert@cs.ucla.edu>
7710
7711 Merge bootstrap changes from coreutils.
7712
7713 2006-09-28 Jim Meyering <jim@meyering.net>
7714
7715 Automatically generated dependencies are important even
7716 when all of the sources in a directory come from gnulib.
7717 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
7718 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
7719
7720 2006-09-23 Jim Meyering <jim@meyering.net>
7721
7722 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
7723
7724 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7725
7726 * bootstrap: Add support for --force.
7727 (usage): New function. Describe usage less tersely.
7728 (CVS_only_file): New var.
7729
77302006-09-21 Paul Eggert <eggert@cs.ucla.edu>
7731
7732 * data/push.c (YYPUSH_MORE): Make it an enum instead.
7733 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
7734 Adjust white space and comments to match GNU style better.
7735
77362006-09-20 Bob Rossi <bob@brasko.net>
7737
7738 * data/push.c (yyresult_get): Remove function.
7739 (YYPUSH_MORE): Add #define.
7740 (yypushparse): Modify return value.
7741
77422006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7743
7744 * stamp-h.in: Remove; no longer needed.
7745 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
7746 Remove config.h, config.hin, intl (no longer created).
7747 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
7748 stamp-h1.
7749
7750 Sync bootstrap from coreutils, as follows:
7751
7752 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
7753
7754 * bootstrap (symlink_to_gnulib): New function.
7755 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
7756 to copies-of-gnulib.
7757 (cp_mark_as_generated, slurp, gnulib_files):
7758 Avoid making a copy if it's the same as the old version.
7759 (gnulib_files): Add support for this variable (used by Bison).
7760
77612006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7762
7763 * src/getargs.c (usage): Rework to use conventions similar to
7764 coreutils, to make translation a bit easier and the code a bit
7765 smaller. Problem reported by Tim Van Holder.
7766
77672006-09-15 Paul Eggert <eggert@cs.ucla.edu>
7768
7769 Use some of gnulib's new modules, taken from coreutils.
7770
7771 * bootstrap: Sync from coreutils, except add support for gnulib_files.
7772 * bootstrap.conf: New file.
7773 (gnulib_modules): Add configmake, inttypes, unistd.
7774 (XGETTEXT_OPTIONS): Add complain, complain_at,
7775 fatal, fatal_at, warn, warn_at, unexpected_end.
7776 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
7777 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
7778 (gl_EARLY): Add.
7779 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
7780 (gl_INIT): Add
7781 (GNULIB_AUTOCONF_SNIPPET): Remove.
7782 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
7783 the pickiest.
7784 * lib/.cvsignore: Add inttypes_.h.
7785 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
7786 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
7787 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
7788 no-longer-necessary initializations.
7789 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
7790 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
7791 use the unistd module.
7792 * src/system.h: Likewise.
7793 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
7794 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
7795 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
7796 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
7797 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
7798 * src/system.h: Include inttypes.h unconditionally, now that we
7799 use the inttypes module. Don't bother to include stdint.h, since
7800 inttypes.h now does that for us.
7801 (LOCALEDIR): Remove, now that we use the configmake module.
7802 * src/getargs.c: Include configmake.h.
7803 * src/main.c: Likewise.
7804 * src/output.c: Likewise.
7805 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
7806 not from $abs_top_builddir, since config.h moved.
7807
7808
7809 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
7810 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
7811
7812 * src/parse-gram.y (symbol_declaration): Don't put statements
7813 before declarations; it's not portable to C89.
7814 * src/scan-code.l (handle_action_at): Likewise.
7815
7816 * src/scan-code.l: Always initialize braces_level; the old code
7817 left it uninitialized and therefore had undefined behavior.
7818
7819 Don't attempt to redefine 'assert', since it runs afoul of
7820 systems where standard headers (mistakenly) include <assert.h>.
7821 Instead, define and use our own alternative, called 'aver'.
7822 * src/reader.c: Don't include assert.h, since we no longer
7823 use assert.
7824 * src/scan-code.l: Likewise.
7825 * src/system.h (assert): Remove, replacing with....
7826 (aver): New function, taking a bool arg. All uses changed.
7827 * src/tables.c (pack_vector): Ensure that aver arg is bool,
7828 not merely an integer.
7829
78302006-09-15 Bob Rossi <bob@brasko.net>
7831
7832 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
7833 * data/c.m4 (YYPUSH): New.
7834 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
7835 * src/getargs.c (push_parser): New var.
7836 * src/getargs.h (push_parser): New declaration.
7837 * src/output.c (prepare): Add macro insertion of `push_flag'.
7838 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
7839 (prologue_declaration): Parse %push-parser.
7840 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
7841 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
7842 list of removed lines from the traces observed.
7843 (AT_CHECK_CALC_LALR): Added push parser tests.
7844
78452006-09-13 Paul Eggert <eggert@cs.ucla.edu>
7846
7847 * NEWS: Version 2.3a.
7848 * configure.ac (AC_INIT): Likewise.
7849
7850 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
7851 "#define YYSTYPE int" that caused "make maintainer-check" to fail
7852 due to header ordering dependencies. I don't know why the #define
7853 was there.
7854
7855 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
7856 runtime cost when YYDEBUG is not defined, and so that some tests
7857 that used to fail now work. Problem and initial suggestion by
7858 Paolo Bonzini.
7859 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
7860 * data/glr.cc (b4_parser_class_name):
7861 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
7862 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
7863 (yydebug_) [YYDEBUG]: New member.
7864 (yycdebug_): Now defined only if YYDEBUG.
7865 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
7866 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
7867 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
7868 if YYYDEBUG.
7869 (debug_stream, set_debug_stream, debug_level, set_debug_level):
7870 Define only if YYDEBUG.
7871 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
7872 set_debug_level.
7873 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
7874 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
7875 AT_CHECK_CALC_GLR_CC that are working now.
7876
78772006-09-12 Paul Eggert <eggert@cs.ucla.edu>
7878
7879 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
7880 We don't need them in glr.cc, and glr.c defines them.
7881 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
7882 assumes that defining it to anything is the same as defining
7883 it to 1. Problem reported by Paolo Bonzini.
7884
78852006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
7886
7887 * data/c.m4 (b4_null, b4_case): Define.
7888 * src/output.c (prepare_symbols): Use b4_null.
7889 (user_actions_output): Use b4_case.
7890
78912006-09-11 Paul Eggert <eggert@cs.ucla.edu>
7892
7893 * data/glr.c (b4_shared_declarations): Put start-header first,
7894 before any #includes that we generate, so that feature-test
7895 macros work. Problem reported by Michael Deutschmann in
7896 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
7897 * data/lalr1.cc: Likewise.
7898 * doc/bison.texinfo (Prologue): Document that feature-test macros
7899 should be defined before any Bison declarations.
7900 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
7901 that depend on location.hh after, not before, Bison decls, since
7902 we now include location.hh after the first user prologue.
7903
7904 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
7905 Sander Brandenburg in
7906 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
7907 Also, fix minor white space and comment issues.
7908 (Prologue): Mention that it's better to define feature-test macros
7909 before Bison declarations. Problem reported by Michael Deutschmann.
7910
7911 * README-cvs: Fix typo: "&" should be "&&". Problem reported
7912 by Jim Meyering.
7913 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
7914 This adjusts to recent gnulib changes.
7915
79162006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
7917
7918 Finish implementation of per-type %destructor/%printer. Discussed
7919 starting at
7920 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
7921 and
7922 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
7923 * NEWS (2.3+): Add a description of this feature to the default
7924 %destructor/%printer description.
7925 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
7926 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
7927 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
7928 list node contains a semantic type.
7929 * src/symtab.c, src/symtab.h: Extend with a table that associates
7930 semantic types with their %destructor's and %printer's.
7931 (semantic_type_from_uniqstr, semantic_type_get,
7932 semantic_type_destructor_set, semantic_type_printer_set): New functions
7933 composing the public interface of that table.
7934 (symbol_destructor_get, symbol_destructor_location_get,
7935 symbol_printer_get, symbol_printer_location_get): If there's no
7936 per-symbol %destructor/%printer, look up the per-type before trying
7937 the default.
7938 * tests/actions.at (Per-type %printer and %destructor): New test case.
7939 * tests/input.at (Default %printer and %destructor redeclared):
7940 Extend to check that multiple occurrences of %symbol-default in a
7941 single %destructor/%printer declaration is an error.
7942 (Per-type %printer and %destructor redeclared, Unused values with
7943 per-type %destructor): New test cases.
7944
79452006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
7946
7947 Require default %destructor/%printer to be declared using
7948 %symbol-default instead of an empty symbol list, and start working on
7949 new per-type %destructor/%printer. Discussed at
7950 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
7951 * NEWS (2.3+): Add %symbol-default to example.
7952 * bison.texinfo (Freeing Discarded Symbols): Likewise.
7953 (Table of Symbols): Add entry for %symbol-default.
7954 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
7955 (generic_symlist, generic_symlist_item): New nonterminals for creating
7956 a list in which each item is a symbol, semantic type, or
7957 %symbol-default.
7958 (grammar_declaration): Use generic_symlist in %destructor and %printer
7959 declarations instead of symbols.1 or an empty list.
7960 (symbol_declaration, precedence_declaration, symbols.1): Update actions
7961 for changes to symbol_list.
7962 * src/reader.c: Update for changes to symbol_list.
7963 * src/scan-code.l: Likewise.
7964 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
7965 * src/symlist.c, src/symlist.h: Extend such that a list node may
7966 represent a semantic type or a %symbol-default in addition to just an
7967 ordinary symbol. Add switched functions for setting %destructor's and
7968 %printer's.
7969 * tests/actions.at, tests/input.at: Add %symbol-default to all default
7970 %destructor/%printer declarations.
7971
79722006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
7973
7974 Whether the default %destructor/%printer applies to a particular symbol
7975 isn't a question of whether the user *declares* that symbol (in %token,
7976 for example). It's a question of whether the user by any means
7977 *defines* the symbol at all (by simply using a char token, for
7978 example). $end is defined by Bison whereas any other token with token
7979 number 0 is defined by the user. The error token is always defined by
7980 Bison regardless of whether the user declares it with %token, but we
7981 may one day let the user define error as a nonterminal instead.
7982 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
7983 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
7984 the meaning of "user-defined".
7985 * tests/actions.at (Default %printer and %destructor for user-declared
7986 end token): Rename to...
7987 (Default %printer and %destructor for user-defined end token): ...
7988 this.
7989
7990 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
7991 computation of whether to apply the default, don't maintain a list of
7992 every Bison-defined symbol. Instead, just check for a first character
7993 of '$', which a user symbol cannot have, and check for the error token.
7994
79952006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
7996
7997 Don't apply the default %destructor or %printer to the error token,
7998 $undefined, or $accept. This change fits the general rule that the
7999 default %destructor and %printer are only for user-declared symbols,
8000 and it solves several difficulties that are described in the new test
8001 cases listed below.
8002 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
8003 * tests/actions.at (Default %printer and %destructor are not for error
8004 or $undefined, Default %printer and %destructor are not for $accept):
8005 New test cases.
8006
80072006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
8008
8009 Allow %start after the first rule.
8010 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
8011 when parsing the first rule.
8012 (check_and_convert_grammar): Search for it here after all grammar
8013 declarations have been parsed. Skip midrules, which have dummy LHS
8014 nonterminals.
8015 * src/symtab.c (symbol_is_dummy): New function.
8016 * src/symtab.h (symbol_is_dummy): Declare it.
8017 * tests/input.at (%start after first rule): New test.
8018
80192006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8020
8021 Redo some of the previous commit: add back the ability to use
8022 non-aliased/undeclared string literals since it might be useful to
8023 those declaring %token-table.
8024 * src/reader.c (check_and_convert_grammar): Undo changes in previous
8025 commit: don't worry about complaints from symbols_pack.
8026 * src/symtab.c (symbol_new, symbol_class_set,
8027 symbol_check_alias_consistency): Undo changes in previous commit: count
8028 each string literal as a new symbol and token, assign it a symbol
8029 number, and don't complain about non-aliased string literals.
8030 (symbols_pack): Since symbol_make_alias still does not decrement symbol
8031 and token counts but does still set aliased tokens to the same number,
8032 symbol_pack_processor now leaves empty slots in the symbols array.
8033 Remove those slots.
8034 * tests/regression.at (Undeclared string literal): Remove test case
8035 added in previous commit since non-aliased string literals are allowed
8036 again.
8037 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
8038 remove unnecessary string literal declarations.
8039 * tests/sets.at (Firsts): Likewise.
8040
80412006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8042
8043 Don't allow an undeclared string literal, but allow a string literal to
8044 be used before its declaration.
8045 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
8046 symbols_pack complained.
8047 * src/symtab.c (symbol_new): Don't count a string literal as a new
8048 symbol.
8049 (symbol_class_set): Don't count a string literal as a new token, and
8050 don't assign it a symbol number since symbol_make_alias does that.
8051 (symbol_make_alias): It's not necessary to decrement the symbol and
8052 token counts anymore. Don't assume that an alias declaration occurs
8053 before any uses of the identifier or string, and thus don't assert that
8054 one of them has the highest symbol number so far.
8055 (symbol_check_alias_consistency): Complain if there's a string literal
8056 that wasn't declared as an alias.
8057 (symbols_pack): Bail if symbol_check_alias_consistency failed since
8058 symbol_pack asserts that every token has been assigned a symbol number
8059 although undeclared string literals have not.
8060 * tests/regression.at (String alias declared after use, Undeclared
8061 string literal): New test cases.
8062 (Characters Escapes, Web2c Actions): Declare string literals as
8063 aliases.
8064 * tests/sets.at (Firsts): Likewise.
8065
80662006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
8067
8068 In the grammar scanner, STRING_FINISH unclosed constructs and return
8069 them to the parser in order to improve error messages.
8070 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
8071 SC_BRACED_CODE, SC_PROLOGUE): Implement.
8072 * tests/input.at (Unclosed constructs): New test case.
8073 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
8074 seen.
8075
8076 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
8077 unused global.
8078
80792006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
8080
8081 Handle string aliases for character tokens correctly.
8082 * src/symtab.c (symbol_user_token_number_set): If the token has an
8083 alias, check and set its alias's user token number instead of its own,
8084 which is set to indicate the alias. Previously, every occurrence of
8085 the character token in the grammar overwrote that alias indicator with
8086 the character code.
8087 * tests/input.at (String aliases for character tokens): New test.
8088
80892006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
8090
8091 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
8092
80932006-08-11 Paul Eggert <eggert@cs.ucla.edu>
8094
8095 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
8096 to prevent failures when building on older platforms.
8097 Check for autopoint failure.
8098 Set XGETTEXT_OPTIONS to values that check for C format strings,
8099 so that translators are warned about them (this also helps
8100 prevent core dumps).
8101
8102 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
8103 function, since it simplifies our code a bit.
8104
8105 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
8106 rather than -W, so we don't get bogus warnings about sign comparisons.
8107 Add -Wpointer-arith, since that warning is useful (it reports code
8108 that does not conform to C89 and that some compilers reject).
8109 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
8110 since it's no longer needed.
8111
81122006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
8113
8114 Clean up scanners a bit.
8115 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
8116 definitions so gcc won't warn when obstack_for_string is unused.
8117 * src/scan-code.l: config.h and system.h are already #include'd by
8118 scan-code-c.c, so get rid of them here.
8119 * src/scan-gram.l: Likewise.
8120 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
8121 definitions rather than duplicating the rest of it.
8122 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
8123
81242006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
8125
8126 Suppress signed/unsigned comparison warnings for yycheck.
8127 * data/c.m4 (b4_safest_int_type): New macro.
8128 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
8129 a signed int type, cast it to b4_safest_int_type first.
8130 * data/yacc.c: Likewise.
8131 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
8132 also overwritten.
8133
81342006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
8135
8136 * doc/bison.texinfo: Fix some typos.
8137
81382006-08-02 Paul Eggert <eggert@cs.ucla.edu>
8139
8140 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
8141 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
8142
8143 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
8144 the latest gnulib does this a different way.
8145 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
8146 translation was patched, so stop omitting it.
8147
81482006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8149
8150 Enable declaration of default %printer/%destructor. Make the parser
8151 use these for all user-declared grammar symbols for which the user does
8152 not declare a specific %printer/%destructor. Thus, the parser uses it
8153 for token 0 if the user declares it but not if Bison generates it as
8154 $end. Discussed starting at
8155 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
8156 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
8157 and
8158 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
8159 * NEWS (2.3+): Mention.
8160 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
8161 declare a %destructor for a mid-rule's semantic value. It's just
8162 impossible to declare one specific to it.
8163 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
8164 code. Describe default %destructor form.
8165 * src/parse-gram.y (grammar_declaration): Parse default
8166 %printer/%destructor declarations.
8167 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
8168 and symbol_destructor_location_get rather than accessing the destructor
8169 and destructor_location members of struct symbol.
8170 (symbol_printers_output): Likewise but for %printer's.
8171 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
8172 again.
8173 * src/symtab.c (default_destructor, default_destructor_location,
8174 default_printer, default_printer_location): New static global
8175 variables to record the default %destructor and %printer.
8176 (symbol_destructor_get, symbol_destructor_location_get,
8177 symbol_printer_get, symbol_printer_location_get): New functions to
8178 compute the appropriate %destructor and %printer for a symbol.
8179 (default_destructor_set, default_printer_set): New functions to set the
8180 default %destructor and %printer.
8181 * src/symtab.h: Prototype all those new functions.
8182 * tests/actions.at (Default %printer and %destructor): New test to
8183 check that the right %printer and %destructor are called, that they're
8184 not called for $end, and that $$ and @$ work correctly.
8185 (Default %printer and %destructor for user-declared end token): New
8186 test to check that the default %printer and %destructor are called for
8187 a user-declared end token.
8188 * tests/input.at (Default %printer and %destructor redeclared, Unused
8189 values with default %destructor): New tests to check related grammar
8190 warnings and errors.
8191
81922006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8193
8194 Clean up handling of %destructor for the end token (token 0).
8195 Discussed starting at
8196 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
8197 and
8198 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
8199
8200 Make the skeletons consistent in how they pop the end token and invoke
8201 its %destructor.
8202 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
8203 state, which has token number 0, since this would invoke the
8204 %destructor for the end token.
8205 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
8206 until after shifting the end token, or else it won't be popped.
8207 * data/yacc.c (yyparse): Likewise.
8208
8209 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
8210 it's the end token. Upon termination, destroy an unshifted lookahead
8211 even when it's the end token.
8212 * data/lalr1.cc (yy::parser::parse): Likewise.
8213 * data/yacc.c (yyparse): Likewise.
8214
8215 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
8216 value warnings for the end token when the user gives the end token a
8217 %destructor.
8218
8219 * tests/actions.at (Printers and Destructors): Test all the above.
8220
82212006-07-24 Paul Eggert <eggert@cs.ucla.edu>
8222
8223 Update to latest gnulib and gettext versions.
8224 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
8225 Add fopen-safer.
8226 (gnulib_files): Add m4/warning.m4. Don't worry about files
8227 overwritten by autopoint.
8228 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
8229 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
8230 rejects them.
8231 Don't use autoreconf; instead, invoke autopoint etc. by hand,
8232 so that we can remove the intl files at a better time.
8233 (intl_files_to_remove): Remove aclocal.m4, since it gets
8234 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
8235 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
8236 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
8237 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
8238 Remove datarootdir hack; no longer needed.
8239 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
8240 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
8241 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
8242 strdup.h.
8243 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
8244 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
8245
82462006-07-20 Paul Eggert <eggert@cs.ucla.edu>
8247
8248 * bootstrap: Adjust to today's change to gnulib-tool by invoking
8249 it with --assume-autoconf='latest-stable'.
8250
82512006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
8252
8253 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
8254 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
8255 YYSTYPE' and `{'.
8256 * src/muscle_tab.h (muscle_grow): Replace the header comments with
8257 those from muscle_tab.c since the old ones are misleading.
8258
82592006-07-13 Akim Demaille <akim@epita.fr>
8260
8261 Support %define "KEY" {VALUE}.
8262 * src/scan-code.h, src/scan-code.l (translate_action)
8263 (translate_rule_action, translate_symbol_action, translate_code):
8264 Return char *, not const char *.
8265 * src/parse-gram.y (declaration): Rename as...
8266 (prologue_declaration): this.
8267 (string_content): Remove this nonterminal, use STRING.
8268 (braceless, content, content.opt): New nonterminal.
8269 Use them.
8270 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
8271 as value.
8272 * src/scan-gram.l (getargs.h): Don't include it.
8273
82742006-07-12 Paul Eggert <eggert@cs.ucla.edu>
8275
8276 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
8277 rather than a for-loop that declares a local bool variable. This
8278 should work around a compatibility problem with a Cray x1e C++
8279 compiler reported by Hung Nguyen in
8280 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
8281 The for-loop was introduced in the 2004-11-17 change but I don't
8282 know why it was needed.
8283
82842006-07-12 Akim Demaille <akim@epita.fr>
8285
8286 * data/c.m4: Comment changes.
8287
82882006-07-10 Akim Demaille <akim@lrde.epita.fr>
8289
8290 * src/complain.c (error_message, ERROR_MESSAGE): New.
8291 To factor...
8292 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
8293 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
8294
82952006-07-09 Paul Eggert <eggert@cs.ucla.edu>
8296
8297 * NEWS: Instead of %union, you can define and use your own union type
8298 YYSTYPE if your grammar contains at least one <type> tag.
8299 Your YYSTYPE need not be a macro; it can be a typedef.
8300 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
8301 (Union Decl, Decl Summary): Document this.
8302 * data/glr.c (YYSTYPE): Implement this.
8303 * data/glr.cc (YYSTYPE): Likewise.
8304 * data/lalr1.cc (YYSTYPE): Likewise.
8305 * data/yacc.c (YYSTYPE): Likewise.
8306 * src/output.c (prepare): Output tag_seen_flag.
8307 * src/parse-gram.y (declaration, grammar_declaration):
8308 Use 'union_seen' rather than 'typed' to determine whether
8309 %union has been seen, since grammars can now be typed without
8310 %union.
8311 (symbol_declaration, type.opt, symbol_def):
8312 Keep track of whether a tag has been seen.
8313 * src/reader.c (union_seen, tag_seen): New vars.
8314 (typed): remove.
8315 * src/reader.h (union_seen, tag_seen, typed): Likewise.
8316 * src/scan-code.l (untyped_var_seen): New variable.
8317 (handle_action_dollar): Adjust to above changes.
8318 (handle_action_dollar, handle_action_at):
8319 Improve overflow checking for outlandish numbers.
8320 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
8321 avoid new diagnostics generated by above changes.
8322 * tests/regression.at (YYSTYPE typedef): Add test to check
8323 for type tags without %union.
8324
8325 * src/symlist.c (symbol_list_length): Return int, not unsigned
8326 int, since callers expect int. This may need to get revisited
8327 once we have proper integer overflow checking.
8328
8329 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
8330 object is now static.
8331
8332 * src/getargs.c (flags_argmatch): Return void, not int,
8333 to pacify ./configure --enable-gcc-warnings.
8334
8335 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
8336 since last_string is already defined to FLEX_PREFIX (last_string).
8337
83382006-07-09 Akim Demaille <akim@lrde.epita.fr>
8339
8340 Implement --warnings/-W.
8341 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
8342 replaced by...
8343 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
8344 Adjust callers.
8345 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
8346 (warnings_args, warnings_types): New.
8347 (getargs, short_options, long_options): Accept -W/--warnings.
8348 Sort the options by alphabetical order, upper case letter right
8349 before its lower case.
8350
83512006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
8352
8353 Change %merge result type clash warnings to errors. Discussed at
8354 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
8355 * src/reader.c (record_merge_function_type): Use complain_at.
8356 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8357 declared later): Update test case results.
8358
83592006-07-09 Akim Demaille <akim@lrde.epita.fr>
8360
8361 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
8362 to be in alphabetical order.
8363 (trace_args): Spelling fixes.
8364
83652006-07-09 Paul Eggert <eggert@cs.ucla.edu>
8366
8367 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
8368 so they don't collide with user-defined macros.
8369 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
8370 this was never guaranteed, and now that we're using gnulib stdint,
8371 which defines int_fast16_t to long int, the problem is exposed.
8372
83732006-07-08 Paul Eggert <eggert@cs.ucla.edu>
8374
8375 * data/c.m4 (b4_basename): Simplify a bit, since we don't
8376 need the full POSIX semantics (and weren't implementing them
8377 anyway).
8378
8379 Adjust to Autoconf 2.60 and today's gnulib.
8380 * bootstrap (gnulib_modules): Add stdint.
8381 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
8382 no longer copies it.
8383 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
8384 since stdint needs the former and wcwidth (which is now required
8385 by mbswidth) needs the latter.
8386 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
8387 work around a compatibility glitch between gettext 0.14.6 and
8388 Autoconf 2.60.
8389 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
8390 Do not check for uintptr_t, since new stdint module does the right
8391 thing.
8392 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
8393 Add stdint.h, stdint_.h, wcwidth.h.
8394 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
8395 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
8396 stdint.m4, wchar_t.m4, wcwidth.m4.
8397 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
8398 usual order for ../lib/*.h files.
8399 (file_name_split): Use last_component, not base_name, to adjust
8400 to gnulib changes.
8401 * src/parse-gram.h: Include <strverscmp.h> in the usual order
8402 for ../lib/*.h files.
8403 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
8404 Define unconditionally, since we now assume the stdint module.
8405 * src/scan-skel.l: Include <dirname.h>.
8406 (BASE_QPUTS): Use last_component, not base_name.
8407 * src/system.h: Include <unlocked-io.h> in the usual order
8408 for ../lib/*.h files. Include <stdint.h> unconditionally,
8409 since we now use the stdint module.
8410 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
8411 HAVE_UINTPTR_T, since we now use the stdint module.
8412 (base_name): Remove decl, since files now include <dirname.h>
8413 to get the decl.
8414
84152006-07-08 Akim Demaille <akim@lrde.epita.fr>
8416
8417 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
8418 New, default to 1.
8419 * data/yacc.c, data/glr.c, data/location.cc: Use them.
8420 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
8421 default.
8422 * tests/calc.at: Adjust.
8423
84242006-07-08 Akim Demaille <akim@lrde.epita.fr>
8425
8426 * data/c.m4 (b4_basename): New.
8427 (b4_syncline): Also output the location of its invocation (from
8428 the skeleton).
8429 (b4_user_action, b4_define_user_action, b4_user_actions)
8430 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
8431 (b4_user_stype): New.
8432 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
8433
84342006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8435
8436 In the grammar file, the first column is 1 not 0 on the first line as
8437 on every other line.
8438 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
8439 * tests/input.at (Torturing the Scanner): Update output.
8440
8441 * src/scan-gram.l (scanner_cursor): Declare it static.
8442
84432006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8444
8445 In warnings, say "previous declaration" rather than "first
8446 declaration".
8447 * src/symtab.c (redeclaration): Do that here.
8448 * src/reader.c (record_merge_function_type): In the case of a result
8449 type clash, report the previous declaration rather than the very first
8450 one in the grammar file.
8451 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8452 declared later): Add a third declaration to check this behavior.
8453 * tests/input.at (Incompatible Aliases): Update output.
8454
84552006-06-27 Akim Demaille <akim@epita.fr>
8456
8457 * doc/Doxyfile.in: New.
8458 * doc/Makefile.am: Use it.
8459 * src/lalr.h, src/symtab.h: Initial doxygenation.
8460
84612006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8462
8463 Don't miss %merge result type warnings just because the LHS types are
8464 declared after the %merge. This continues the effort of the previous
8465 patch.
8466 * src/reader.c (get_merge_function): Don't set the merger type yet.
8467 (record_merge_function_type): New function for setting the merger type
8468 and checking for clashes.
8469 (grammar_current_rule_merge_set): Set the location of the %merge for
8470 the current rule.
8471 (packgram): Invoke record_merge_function_type for each rule now that
8472 all symbol type declarations have been parsed.
8473 * src/reader.h (merger_list.type_declaration_location): New member
8474 storing the location of the first %merge from which the type for this
8475 merging function was derived.
8476 * src/symlist.h (symbol_list.merger_declaration_location): New member
8477 storing the location of a rule's %merge, if any.
8478 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8479 declared later): New test to catch the error fixed by the above patch.
8480
84812006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8482
8483 Get action warnings (grammar_rule_check) right even when symbol
8484 declarations appear after the rules. Discussed at
8485 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
8486 and
8487 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
8488 Don't mistake the type of $$ in a midrule to be that of its parent
8489 rule's $$.
8490 * src/reader.c (grammar_current_rule_end): Don't invoke
8491 grammar_rule_check yet since not all symbol declarations may have been
8492 parsed yet.
8493 (grammar_midrule_action): Likewise.
8494 Don't record whether the midrule's $$ has been used yet since actions
8495 haven't been translated yet.
8496 Record the midrule's parent rule and its RHS index within the parent
8497 rule.
8498 (grammar_current_rule_action_append): Don't translate the action yet
8499 since not all symbol declarations may have been parsed yet and, thus,
8500 warnings about types for $$, $n, @$, and @n can't be reported yet.
8501 (packgram): Translate the action and invoke grammar_rule_check now that
8502 all symbol declarations have been parsed.
8503 * src/scan-code.l (handle_action_dollar): Now that this is invoked
8504 after parsing the entire grammar file, the symbol list here in the case
8505 of a midrule is actually the midrule's empty RHS, so reference its
8506 parent rule's RHS where necessary.
8507 On the other hand, now that you can already know it's a midrule, you
8508 aren't forced to think $$ has the same type as its parent rule's $$.
8509 (handle_action_at): In the case of a midrule, reference the parent rule
8510 where necessary.
8511 * src/symlist.c (symbol_list_new): Initialize new midrule-related
8512 members.
8513 (symbol_list_length): Now that this is invoked after all rules have
8514 been parsed, a NULL symbol (rather than a NULL symbol list node)
8515 terminates a rule. symbol_list_print already does this correctly.
8516 * src/symlist.h (symbol_list.midrule_parent_rule,
8517 symbol_list.midrule_parent_rhs_index): New members so that midrules can
8518 remember their relationships with their parents.
8519 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
8520 fixed by the above patch.
8521 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
8522 implementing...
8523 (Unused values): ... this old test case and...
8524 (Unused values before symbol declarations): ... this new test case.
8525 This one is the same as `Unused values' except that all symbol
8526 declarations appear after the rules in order to catch the rest of the
8527 errors fixed by the above patch.
8528
85292006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8530
8531 More cleanup.
8532 * src/reader.c (current_rule): Declare it static since it's no longer
8533 used outside this file.
8534 (grammar_current_rule_action_append): Remove redundant arguments from
8535 translate_rule_action invocation.
8536 * src/reader.h (current_rule): Remove this unused extern.
8537 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
8538 * src/scan-code.l (translate_rule_action): Likewise.
8539
85402006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
8541
8542 Clean up yesterday's patch.
8543 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
8544 to...
8545 * src/reader.c (grammar_current_rule_action_append): ... here for
8546 consistency with grammar_current_rule_symbol_append.
8547 * tests/regression.at (Braced code in declaration in rules section):
8548 Make yyerror and yylex static as usual.
8549
85502006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
8551
8552 Fix bug that mistakes braced code in a declaration in the rules section
8553 to be a rule action. Mentioned at
8554 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
8555 * src/scan-gram.l: Move midrule action detection from the start of the
8556 scanning of any braced code to...
8557 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
8558 action. For readability, use $2 and @2 rather than the equivalent
8559 global variables.
8560 * tests/regression.at (Braced code in declaration in rules section):
8561 New test to catch the error fixed by the above patch.
8562
8563 Work on code readability some.
8564 * src/scan-code.l (current_rule): Get rid of this misleading and
8565 redundant declaration: it's actually extern'ed in reader.h.
8566 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
8567 translate_action): Add a rule argument and use it instead of the global
8568 current_rule.
8569 (translate_rule_action): This already receives current_rule through an
8570 argument, so pass it on to translate_action instead of assigning
8571 current_rule to current_rule.
8572 (translate_symbol_action, translate_code): Pass rule = NULL to
8573 translate_action.
8574
85752006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
8576
8577 Rename %before-definitions to %start-header and %after-definitions to
8578 %end-header. Don't use these declarations to separate pre-prologue
8579 blocks from post-prologue blocks. Add new order-independent
8580 declarations %before-header and %after-header as alternatives to the
8581 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
8582 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
8583 * NEWS (2.3+): Update for these changes.
8584 * data/glr.c (b4_before_definitions): Update to...
8585 (b4_start_header): ... this.
8586 (b4_after_definitions): Update to...
8587 (b4_end_header): ... this.
8588 * data/glr.cc: Likewise.
8589 * data/lalr1.cc: Likewise.
8590 * data/yacc.c: Likewise.
8591 * doc/bison.texinfo (The prologue): Update names, and replace remaining
8592 prologue blocks with %*-header declarations.
8593 (Calc++ Parser): Likewise.
8594 (Decl Summary): Update names.
8595 (Table of Symbols): Update description.
8596 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
8597 (PERCENT_END_HEADER): ... this.
8598 (PERCENT_BEFORE_DEFINITIONS): Update to...
8599 (PERCENT_START_HEADER): ... this.
8600 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
8601 (declaration): Update token names and m4 macro names.
8602 When parsing %end-header and %start-header, invoke translate_code
8603 before muscle_code_grow, and no longer set global booleans to remember
8604 whether these declarations have been seen.
8605 Parse new %after-header and %before-header.
8606 * src/reader.c (before_definitions, after_definitions): Remove.
8607 (prologue_augment): Accept a new bool argument to specify whether to
8608 augment the pre-prologue or post-prologue.
8609 * src/reader.h (before_definitions, after_definitions): Remove these
8610 extern's.
8611 (prologue_augment): Add new bool argument.
8612 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
8613 (PERCENT_END_HEADER): ... this.
8614 (PERCENT_BEFORE_DEFINITIONS): Update to...
8615 (PERCENT_START_HEADER): ... this.
8616 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
8617 * tests/actions.at (Printers and Destructors): Update names.
8618
86192006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
8620
8621 Add comparison operators for C++ location classes. Discussed at
8622 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
8623 * data/c++.m4 (b4_define_location_comparison): New boolean %define
8624 declaration indicating whether filename_type has an operator==. If
8625 filename_type is `std::string', it defaults to `1', `0' otherwise.
8626 * data/location.cc: Iff b4_define_location_comparison is `1', add
8627 operator== and operator!= for class position and for class location.
8628
8629 Some minor fixes.
8630 * src/scan-action.l: Remove unused file.
8631 * src/symtab.c (symbol_printer_set): Use printer_location not
8632 destructor_location.
8633 * src/symtab.h (struct symbol): Replace incorrect source comment for
8634 printer members.
8635 * tests/input.at (Incompatible Aliases): Update output with correct
8636 printer location.
8637
86382006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
8639
8640 Don't put the pre-prologue in the header file. For the yacc.c code
8641 file and the glr.c header and code files, move the pre-prologue before
8642 the token definitions. Add new %before-definitions and
8643 %after-definitions to declare code that will go in both the header file
8644 and code file. Discussed at
8645 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
8646 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
8647 and
8648 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
8649 * NEWS (2.3+): Describe these changes.
8650 * data/glr.c (b4_pre_prologue): Move from within to before...
8651 (b4_shared_declarations): ... this.
8652 Add new b4_before_definitions before b4_token_enums.
8653 Add new b4_after_definitions at the end.
8654 * data/glr.cc (b4_pre_prologue): Replace with...
8655 (b4_before_definitions): ... this in the header file.
8656 (b4_after_definitions): New near the end of the header file.
8657 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
8658 code file right before including the header file.
8659 (b4_before_definitions): New in the previous position of
8660 b4_pre_prologue in the header file.
8661 (b4_after_definitions): New near the end of the header file.
8662 * data/yacc.c: Clean up some m4 quoting especially in the header file.
8663 (b4_token_enums_defines): In the code file, move to right before
8664 YYSTYPE for consistency with the header file.
8665 (b4_before_definitions): New right before b4_token_enums_defines in
8666 both the header and code file.
8667 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
8668 header and code file.
8669 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
8670 of prologues for %union dependencies.
8671 (Decl Summary): In %defines description, mention the effect of
8672 %before-definitions and %after-definitions on the header file.
8673 (Calc++ Parser): Forward declare driver in a %before-definitions rather
8674 than in the pre-prologue so that make check succeeds.
8675 (Table of Symbols): Add entries for %before-definitions and
8676 %after-definitions.
8677 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
8678 %before-definitions.
8679 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
8680 (declaration): Parse those declarations and append to
8681 b4_before_definitions and b4_after_definitions, respectively.
8682 * src/reader.c (before_definitions, after_definitions): New bools to
8683 track whether those declarations have been seen.
8684 (prologue_augment): Add to the post-prologue if %union,
8685 %before-definitions, or %after-definitions has been seen.
8686 * src/reader.h (before_definitions, after_definitions): New extern's.
8687 * src/scan-gram.l: Scan the new declarations.
8688 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
8689 prologue block in a %before-definitions or a %after-definitions based
8690 on whether the %union is declared.
8691 * tests/regression.at (Early token definitions with --yacc, Early token
8692 definitions without --yacc): Move tests for token definitions into the
8693 post-prologue since token names are no longer defined in the
8694 pre-prologue.
8695
86962006-06-20 Akim Demaille <akim@epita.fr>
8697
8698 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
8699 (symbol_get): Use it.
8700 * src/parse-gram.y: Use it.
8701
87022006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
8703
8704 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
8705 build succeeds when configured with --enable-gcc-warnings.
8706
87072006-06-19 Paul Eggert <eggert@cs.ucla.edu>
8708
8709 * src/parse-gram.y (char_name): New function.
8710 (CHAR, STRING, string_content): For %printer, properly escape.
8711 (ID): Prefer fputs to fprintf.
8712 (id): Reindent to be consistent with other rules.
8713 Properly quote char.
8714
8715 The Translation Project changed its way of publishing translations
8716 to maintainers. I haven't received any responses to my request
8717 for supporting the old way, or for documenting the new way. I
8718 have modified 'bootstrap' to use screen scraping
8719 (in this case, HTML scraping). This is unreliable and inelegant,
8720 but I don't see any better way. Yuck.
8721 * bootstrap (TP_URL, WGET_COMMAND): New vars.
8722 (get_translations): New function, which uses HTML scraping to
8723 deduce locations of latest translations.
8724 Use this function to grab both bison and bison-runtime .po files.
8725 Don't bother priming the pump for the runtime-po domain any more,
8726 as it's now translated better than bison is.
8727
87282006-06-19 Akim Demaille <akim@epita.fr>
8729
8730 * src/scan-gram.l: No longer "parse" things after `%union' until
8731 `{'. Rather, return a single "%union" token.
8732 No longer make symbols: return strings, and leave the conversion
8733 to symbols to the parser.
8734 (SC_PRE_CODE, token_type): Remove.
8735 * src/parse-gram.y (%union): New field `character'.
8736 Sort tokens.
8737 (CHAR): New token.
8738 (ID, ID_COLON): Now that the scanner no longer makes them
8739 identifiers, adjust all uses to invoke symbol_get.
8740 (id_colon): New, wraps the conversion from string to symbol.
8741 (%union): Accept a possible union_name.
8742 (symbol): Now can be a char.
8743 * data/c.m4 (b4_union_name): Leave a default value.
8744 * data/glr.c, data/yacc.c: Use it.
8745
87462006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
8747
8748 For associating token numbers with token names for "yacc.c", don't use
8749 #define statements unless `--yacc' is specified; always use enum
8750 yytokentype. Most important discussions start at:
8751 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
8752 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
8753 and
8754 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
8755 * NEWS (2.3+): Mention.
8756 * data/c.m4 (b4_yacc_if): New.
8757 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
8758 token #define's.
8759 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
8760 on token name definitions.
8761 * src/getargs.c (usage): Capitalize `Yacc' in English.
8762 * src/output.c (prepare): Define b4_yacc_flag.
8763 * tests/regression.at (Early token definitions): Test that tokens names
8764 are defined before the pre-prologue not just before the post-prologue.
8765 Remove this test case and copy to...
8766 (Early token definitions with --yacc): ... this to test #define's.
8767 (Early token definitions without --yacc): ... and this to test enums.
8768
87692006-06-11 Paul Eggert <eggert@cs.ucla.edu>
8770
8771 * NEWS: Reword the post-2.3 change to not be so optimistic about
8772 removing the old "look-ahead" spelling.
8773 Update previous look-ahead/lookahead change reports.
8774 * REFERENCES: look-ahead -> lookahead (since that's
8775 what he actually wrote).
8776 * doc/refcard.tex: look ahead -> lookahead,
8777 look-ahead -> lookahead
8778
87792006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
8780
8781 For consistency, use `lookahead' instead of `look-ahead' or
8782 `look_ahead'. Discussed starting at
8783 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
8784 and then at
8785 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
8786 * NEWS: For the next release, note the change to `--report'.
8787 * TODO, doc/bison.1: Update English.
8788 * doc/bison.texinfo: Update English.
8789 (Understanding Your Parser, Bison Options): Document as
8790 `--report=lookahead' rather than `--report=look-ahead'.
8791 * src/conflicts.c: Update English in comments.
8792 (lookahead_set): Rename from look_ahead_set.
8793 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
8794 (resolve_sr_conflict): Rename local look_ahead_tokens to
8795 lookahead_tokens, and update other uses.
8796 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
8797 count_rr_conflicts, conflicts_free): Update uses.
8798 * src/getargs.c (report_args): Move "lookahead" before alternate
8799 spellings.
8800 (report_types): Update uses.
8801 (usage): For `--report' usage description, state `lookahead' spelling
8802 rather than `look-ahead'.
8803 * src/getargs.h (report.report_lookahead_tokens): Rename from
8804 report_look_ahead_tokens.
8805 * src/lalr.c: Update English in comments.
8806 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
8807 (state_lookahead_tokens_count): Rename from
8808 state_look_ahead_tokens_count.
8809 Rename local n_look_ahead_tokens to n_lookahead_tokens.
8810 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
8811 Rename local n_look_ahead_tokens to n_lookahead_tokens.
8812 Update other uses.
8813 Update English in output.
8814 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
8815 * src/print.c: Update English in comments.
8816 (lookahead_set): Rename from look_ahead_set.
8817 (print_reduction): Rename argument lookahead_token from
8818 look_ahead_token.
8819 (print_core, state_default_rule, print_reductions, print_results):
8820 Update uses.
8821 * src/print_graph.c: Update English in comments.
8822 (print_core): Update uses.
8823 * src/state.c: Update English in comments.
8824 (reductions_new): Update uses.
8825 (state_rule_lookahead_tokens_print): Rename from
8826 state_rule_look_ahead_tokens_print, and update other uses.
8827 * src/state.h: Update English in comments.
8828 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
8829 (state_rule_lookahead_tokens_print): Rename from
8830 state_rule_look_ahead_tokens_print.
8831 * src/tables.c: Update English in comments.
8832 (conflict_row, action_row): Update uses.
8833 * tests/glr-regression.at
8834 (Incorrect lookahead during deterministic GLR,
8835 Incorrect lookahead during nondeterministic GLR): Rename
8836 print_look_ahead to print_lookahead.
8837 * tests/torture.at: Update English in comments.
8838 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
8839 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
8840 (Many lookahead tokens): Update uses.
8841 * data/glr.c: Update English in comments.
8842 * lalr1.cc: Likewise.
8843 * yacc.c: Likewise.
8844 * src/conflicts.h: Likewise.
8845 * src/lalr.h: Likewise.
8846 * src/main.c: Likewise.
8847 * src/output.c: Likewise.
8848 * src/parse-gram.c: Likewise.
8849 * src/tables.h: Likewise.
8850 * tests/calc.at: Likewise.
8851
88522006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
8853
8854 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
8855
88562006-06-07 Paul Eggert <eggert@cs.ucla.edu>
8857
8858 * TODO: Add request from Nelson H. F. Beebe to be able to install
8859 Bison without installing the yacc script.
8860
88612006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
8862
8863 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
8864 and yytext if they're already #define'd.
8865 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
8866 * src/scan-code-c.c: ... here.
8867 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
8868 <config.h>.
8869
88702006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
8871
8872 Get Bison to build again when configured with --enable-gcc-warnings.
8873 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
8874 missing #include's.
8875 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
8876 loc argument as it shadows a global.
8877 * src/scan-gram.l: Remove stray comma that prevents boundary_set
8878 invocation.
8879
8880 * src/.cvsignore: Add scan-code.c.
8881
88822006-06-07 Akim Demaille <akim@epita.fr>
8883
8884 * src/scan-gram.l: Move the "add a trailing ; to actions" code
8885 to...
8886 * src/scan-code.l: here.
8887 * tests/input.at (Torturing the Scanner): Fix another location
8888 error.
8889
88902006-06-07 Akim Demaille <akim@epita.fr>
8891
8892 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
8893
88942006-06-06 Akim Demaille <akim@epita.fr>
8895
8896 Extract the parsing of user actions from the grammar scanner.
8897 As a consequence, the relation between the grammar scanner and
8898 parser is much simpler. We can also split "composite tokens" back
8899 into simple tokens.
8900 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
8901 * src/scan-gram.l (add_column_width, adjust_location): Move to and
8902 rename as...
8903 * src/location.h, src/location.c (add_column_width)
8904 (location_compute): these.
8905 Fix the column count: the initial column is 0.
8906 (location_print): Be robust to ending column being 0.
8907 * src/location.h (boundary_set): New.
8908 * src/main.c: Adjust to scanner_free being renamed as
8909 gram_scanner_free.
8910 * src/output.c: Include scan-code.h.
8911 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
8912 Use boundary_set.
8913 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
8914 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
8915 which is now, again, a separate token.
8916 Adjust all dependencies.
8917 Whereever actions with $ and @ are used, use translate_code.
8918 (action): Remove this nonterminal which is now useless.
8919 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
8920 (grammar_current_rule_action_append): Use translate_code.
8921 (packgram): Bound check ruleno, itemno, and rule_length.
8922 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
8923 (last_string, last_braced_code_loc, max_left_semantic_context)
8924 (scanner_initialize, scanner_free, scanner_last_string_free)
8925 (gram_out, gram_lineno, YY_DECL_): Move to...
8926 * src/scan-gram.h: this new file.
8927 (YY_DECL): Rename as...
8928 (GRAM_DECL): this.
8929 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
8930 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8931 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8932 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8933 Move these declarations, and...
8934 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
8935 these to...
8936 * src/flex-scanner.h: this new file.
8937 * src/scan-gram.l (rule_length, rule_length_overflow)
8938 (increment_rule_length): Remove.
8939 (last_braced_code_loc): Rename as...
8940 (gram_last_braced_code_loc): this.
8941 Adjust to the changes of the parser.
8942 Move all the handling of $ and @ into...
8943 * src/scan-code.l: here.
8944 * src/scan-gram.l (handle_dollar, handle_at): Remove.
8945 (handle_action_dollar, handle_action_at): Move to...
8946 * src/scan-code.l: here.
8947 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
8948 scan-code.h, scan-code-c.c, scan-gram.h.
8949 (EXTRA_bison_SOURCES): Add scan-code.l.
8950 (BUILT_SOURCES): Add scan-code.c.
8951 (yacc): Be robust to white spaces.
8952
8953 * tests/conflicts.at, tests/input.at, tests/reduce.at,
8954 * tests/regression.at: Adjust the column numbers.
8955 * tests/regression.at: Adjust the error message.
8956
89572006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
8958
8959 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
8960 Use Akim's wording from
8961 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
8962
89632006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
8964
8965 Between Bison releases, manually append `+' to the previous Bison
8966 release number, and use that as a signal to automatically print the
8967 ChangeLog's CVS Id keyword from --version. Discussed starting at
8968 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
8969 * ChangeLog: Add Id header.
8970 * configure.ac (AC_INIT): Append `+' to `2.3'.
8971 * src/.cvsignore: Add revision.c.
8972 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
8973 (BUILT_SOURCES): Add revision.c.
8974 (revision.c): New target rule. This file defines a new global variable
8975 named revision. It initializes it with either the Id from ChangeLog
8976 or, if VERSION doesn't contain `+', with the empty string.
8977 * src/getargs.c (version): Print the value of revision.
8978 * src/revision.h: Extern revision.
8979
89802006-06-05 Paul Eggert <eggert@cs.ucla.edu>
8981
8982 * NEWS: Version 2.3.
8983 * configure.ac (AC_INIT): Likewise.
8984
89852006-05-30 Paul Eggert <eggert@cs.ucla.edu>
8986
8987 * data/glr.c (YYRECOVERING): Define to be a function-like macro
8988 with no arguments, not as an object-like macro. This is for
8989 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
8990 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
8991 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
8992 Document this.
8993
89942006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
8995
8996 * src/getargs.c (usage): Back out yesterday's modification of the
8997 --help output so that we don't have to wait for translation before
8998 releasing 2.3.
8999
90002006-05-29 Paul Eggert <eggert@cs.ucla.edu>
9001
9002 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
9003 Problem reported by Akim Demaille.
9004
90052006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
9006
9007 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9008
90092006-05-26 Paul Eggert <eggert@cs.ucla.edu>
9010
9011 * data/yacc.c (yy_reduce_print): Omit trailing white space in
9012 generated source code. Problem reported by Frans Englich in
9013 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
9014
90152006-05-22 Paul Eggert <eggert@cs.ucla.edu>
9016
9017 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
9018 shell, not within 'make', so that 'make' by an ordinary builder
9019 (using GNU make) does not worry about configuring gzip. This also
9020 works around a bug reported independently by Keith Thompson and by
9021 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
9022 stderr rather than stdout, messing up the build logs.
9023
90242006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9025
9026 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
9027 to make sure that YYID will never be unused. This fixes a 'make
9028 maintainer-check' failure caused by the recent changes to the 'Trivial
9029 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
9030 not used.
9031 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
9032
90332006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9034
9035 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
9036 state before an empty RHS is always resolved here. Only the location
9037 of that state is guaranteed to be resolved, and that's enough. This
9038 fixes the remaining bug reported by Derek M. Jones in
9039 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9040 * tests/glr-regression.at (Uninitialized location when reporting
9041 ambiguity): Test the above case.
9042 Also, the embedded comments in this test case claim it checks the case
9043 of an empty RHS that has inherited the initial location. However, the
9044 corresponding LHS was already resolved, so yyresolveLocations didn't
9045 actually have reason to modify it. Fix this by forcing
9046 nondeterministic operation at the beginning of the parse.
9047
90482006-05-20 Paul Eggert <eggert@cs.ucla.edu>
9049
9050 * data/c.m4 (b4_yy_symbol_print_generate):
9051 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
9052 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
9053 of the bugs reported today by Derek M Jones in
9054 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9055 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
9056 defined to be a type name without parens or brackets.
9057 (Location Type): Similarly for YYLTYPE.
9058 * tests/regression.at (Trivial grammars): Put in a test for this
9059 bug that will be caught by 'make maintainer-check' (though not,
9060 alas, by 'make check' unless your compiler is picky).
9061
90622006-05-19 Paul Eggert <eggert@cs.ucla.edu>
9063
9064 * NEWS: Version 2.2.
9065 * configure.ac (AC_INIT): Likewise.
9066
90672006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
9068
9069 * data/glr.c (yyreportTree): Make room in yystates for the state
9070 preceding the RHS. This fixes the segmentation fault reported by Derek
9071 M. Jones in
9072 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
9073 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
9074 to the user. Reported for yyreportTree by Derek M. Jones later in the
9075 same thread.
9076 * THANKS: Add Derek M. Jones.
9077 Update my email address.
9078 Fix typo in Steve Murphy's name.
9079
90802006-05-14 Paul Eggert <eggert@cs.ucla.edu>
9081
9082 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
9083 checking against YYLAST that caused the parser to miss a potential
9084 alternative in its diagnostic.
9085 Problem reported by Maria Jose Moron Fernandez in
9086 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
9087 * data/lalr1.cc (yysyntax_error_): Likewise.
9088 * data/yacc.c (yysyntax_error): Likewise.
9089 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
9090 tokens, in case we run into an older C compiler.
9091 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
9092 Use them to check for the off-by-one error fixed above.
9093
9094 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
9095 YYSIZE_T, not size_t.
9096 * tests/regression.at (Trivial grammars): New test, to catch
9097 the error fixed by the above patch.
9098
90992006-05-14 Akim Demaille <akim@lrde.epita.fr>
9100
9101 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
9102 scheme.
9103 Reported by Steve Murphy.
9104
91052006-05-14 Akim Demaille <akim@lrde.epita.fr>
9106
9107 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
9108 * data/glr.cc: b4_location_flag is now b4_locations_flag.
9109
91102006-05-14 Akim Demaille <akim@lrde.epita.fr>
9111
9112 Implement --trace=m4.
9113 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
9114 * src/output.c (output_skeleton): When set, pass -dV to m4.
9115
9116 Factor the handling of flags in m4.
9117 * src/output.c (prepare): Rename the muscle names debug, defines,
9118 error_verbose to debug_flag, defines_flag, error_verbose_flag.
9119 * data/c.m4: Adjust.
9120 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
9121 Use b4_define_flag_if to define other b4_FLAG_if macros.
9122 (b4_location_if): As a consequence, rename as...
9123 (b4_locations_if): this, for consistency.
9124 Adjust all the skeletons.
9125
91262006-05-14 Akim Demaille <akim@lrde.epita.fr>
9127
9128 * etc/bench.pm: Shorten bench names.
9129
91302006-05-14 Akim Demaille <akim@lrde.epita.fr>
9131
9132 * src/output.h, src/output.c (error_verbose): Move to...
9133 * src/getargs.h, src/getargs.c: here.
9134 Sort the flags.
9135 Adjust dependencies.
9136
91372006-05-13 Paul Eggert <eggert@cs.ucla.edu>
9138
9139 * data/c.m4 (b4_copyright): Put the special exception for Bison
9140 skeletons here, so we don't have to put it in each skeleton. All
9141 uses changed. Suggested by Akim Demaille. Also, wrap the
9142 copyright notice, in case it is longer than 80 columns. Replace
9143 comma by newline after title.
9144
91452006-05-11 Paul Eggert <eggert@cs.ucla.edu>
9146
9147 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
9148 incompatibility, not a bug. Mention that it wasn't fixed as of
9149 flex 2.5.33.
9150
91512006-05-11 Akim Demaille <akim@lrde.epita.fr>
9152
9153 * examples/extexi: Enforce the precedence of concatenation over
9154 >>.
9155 Reported by Tommy Nordgren.
9156
91572006-05-11 Akim Demaille <akim@lrde.epita.fr>
9158
9159 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
9160 with the member "token".
9161 Reported by Martin Nylin.
9162
91632006-05-08 Paul Eggert <eggert@cs.ucla.edu>
9164
9165 * data/glr.c: Switch to Bison 2.2 special-exception language in
9166 the copyright notice. Use more-regular format for titles and
9167 copyright notices.
9168 * data/glr.cc: Likewise.
9169 * data/location.cc: Likewise.
9170 * data/yacc.cc: Likewise.
9171 * doc/bison.texinfo (Conditions): Document this.
9172 * NEWS: likewise. Upgrade version to 2.2.
9173
91742006-04-27 Akim Demaille <akim@lrde.epita.fr>
9175
9176 * data/glr.cc: Remove dead code.
9177
91782006-04-25 Paul Eggert <eggert@cs.ucla.edu>
9179
9180 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
9181 that variable and the line breaks the bootstrap. Problem reported
9182 by Juan M. Guerrero.
9183
91842006-04-24 Akim Demaille <akim@lrde.epita.fr>
9185
9186 * doc/bison.texinfo (Multiple start-symbols): New.
9187
91882006-04-24 Akim Demaille <akim@lrde.epita.fr>
9189
9190 * etc/README, etc/bench.pl: New.
9191
91922006-04-03 Akim Demaille <akim@lrde.epita.fr>
9193
9194 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
9195 rule.
9196 Reported by Mickael Labau.
9197 * tests/input.at (Torturing the Scanner): Test it.
9198
91992006-03-16 Paul Eggert <eggert@cs.ucla.edu>
9200
9201 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
9202 Problem reported by Bob Rossi.
9203
92042006-03-13 Paul Eggert <eggert@cs.ucla.edu>
9205
9206 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
9207 and didn't really work.
9208 For the index, use @ifnotinfo, not @iftex.
9209 Minor cleanups of spacing and terminology.
9210
92112006-03-12 Akim Demaille <akim@lrde.epita.fr>
9212
9213 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
9214 of AT_NAME_PREFIX when %name-prefix is not used.
9215
92162006-03-12 Akim Demaille <akim@lrde.epita.fr>
9217
9218 Apply --prefix to C++ skeletons too: they change the namespace.
9219 The test suite already exercize these cases.
9220 * data/c++.m4 (b4_namespace): New.
9221 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
9222 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
9223 * data/yacc.c, data/glr.c: Remove a useless `[]'.
9224 * doc/bison.texinfo: Document it.
9225 (Option Cross Key): Use @multitable in all formats. It looks
9226 nicer, even in TeX outputs.
9227 (Rules): Use the same code whatever the output type is.
9228 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
9229 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
9230 * tests/calc.at: Use it, instead of hard coding `yy'.
9231
92322006-03-10 Akim Demaille <akim@lrde.epita.fr>
9233
9234 * TODO: Remove dead items.
9235
92362006-03-10 Akim Demaille <akim@lrde.epita.fr>
9237
9238 * doc/FAQ: Remove, merged into...
9239 * doc/bison.texinfo (FAQ): this.
9240 * doc/Makefile.am (EXTRA_DIST): Adjust.
9241
92422006-03-10 Akim Demaille <akim@lrde.epita.fr>
9243
9244 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
9245 even if empty.
9246 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
9247 * doc/bison.texinfo (Calc++ Scanner): Use it.
9248
92492006-03-09 Paul Eggert <eggert@cs.ucla.edu>
9250
9251 Fix two nits reported by twlevo, plus one more that I discovered.
9252
9253 * src/assoc.h (assoc_to_string): Give a name to the arg, as
9254 this is the usual Bison style.
9255 * src/location.h (location_print): Likewise.
9256
9257 * src/reader.h (token_name): Likewise.
9258
92592006-03-08 Paul Eggert <eggert@cs.ucla.edu>
9260
9261 Fix some nits reported by twlevo.
9262 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
9263 and "POSIX". Use more-modern syntax for URLs. Mention C++
9264 and ask for Java. Don't hardwire OS version numbers. Add
9265 copyright notice.
9266 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
9267 * src/conflicts.c (solved_conflicts_obstack): Now static.
9268
92692006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
9270
9271 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
9272 page. Say "you can use it" not "you may use it" as on the web page;
9273 we're describing capabilities not granting permission.
9274
92752006-03-06 Paul Eggert <eggert@cs.ucla.edu>
9276
9277 * data/glr.c (yyresolveLocations): Rename local variables to avoid
9278 shadowing warnings. Use usual patter for iterating through RHS.
9279 * tests/glr-regression.at
9280 (Uninitialized location when reporting ambiguity):
9281 Modify yylex so that it uses its argument, rather than trying
9282 to rely on ARGSUSED (which doesn't work for gcc with warnings).
9283 const char -> char const.
9284
9285 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
9286 Don't use tabs inside commands; it messes up 'ps'.
9287 Problem reported by twlevo.
9288
92892006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
9290
9291 * tests/glr-regression.at (Uninitialized location when reporting
9292 ambiguity): New test case.
9293 * data/glr.c (yyresolveLocations): New function, which uses
9294 YYLLOC_DEFAULT.
9295 (yyresolveValue): Invoke yyresolveLocations before reporting an
9296 ambiguity.
9297 * doc/bison.texinfo (Default Action for Locations): Note
9298 YYLLOC_DEFAULT's usage for ambiguity locations.
9299 (GLR Semantic Actions): Cross-reference those notes.
9300
93012006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
9302
9303 * tests/glr-regression.at (Leaked semantic values when reporting
9304 ambiguity): Remove unnecessary union and type declarations.
9305 (Leaked lookahead after nondeterministic parse syntax error): New test
9306 case.
9307 * data/glr.c (yyparse): Check for zero stacks remaining before
9308 attempting to shift the lookahead so that you don't lose it.
9309
93102006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
9311
9312 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
9313 * tests/glr-regression.at (Leaked semantic values when reporting
9314 ambiguity): New test case.
9315 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
9316 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
9317 now unnecessary yystackp parameter.
9318 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
9319 destructors can be called.
9320
9321 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
9322 in existing testcases.
9323
93242006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
9325
9326 Don't leak semantic values for parent RHS when a user action cuts the
9327 parser, and clean up related code a bit.
9328 * tests/glr-regression.at (Leaked merged semantic value if user action
9329 cuts parse): Rename to...
9330 (Leaked semantic values if user action cuts parse): ... this. Add check
9331 for leaked parent RHS values.
9332 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
9333 between an unresolved state (non-empty chain of semantic options) and
9334 an incomplete one (signaled by an empty chain).
9335 (yyresolveStates): Document the interface. Move all manipulation of a
9336 successfully or unsuccessfully resolved yyGLRState to...
9337 (yyresolveValue): ... here so that yyresolveValue always leaves a
9338 yyGLRState with consistent data and thus is easier to understand.
9339 Remove the yyvalp and yylocp parameters since they are always just
9340 taken from the yys parameter. When reporting a discarded merged value
9341 in debugging output, note that it is incompletely merged. Document the
9342 interface.
9343 (yyresolveAction): If resolving any of the RHS states fails, destroy
9344 them all rather than leaking them. Thus, as long as user actions are
9345 written to clean up the RHS correctly, yyresolveAction always cleans up
9346 the RHS of a semantic option. Document the interface.
9347
93482006-02-27 Paul Eggert <eggert@cs.ucla.edu>
9349
9350 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
9351 led to a segmentation fault in GNU Pascal. Problem reported
9352 by Waldek Hebisch.
9353
93542006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
9355
9356 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
9357 mid-rule action inside a nonterminal symbol in order to declare a
9358 destructor for its semantic value.
9359
93602006-02-16 Paul Eggert <eggert@cs.ucla.edu>
9361
9362 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
9363 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
9364 __cplusplus && ! defined _STDLIB_H && !
9365 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
9366 defined free))]: Include <stdlib.h> rather than rolling our own
9367 declarations of malloc and free, to avoid problems with
9368 incompatible declarations (using 'throw') C++'s stdlib.h. This
9369 should fix Debian bug 340012
9370 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
9371 reported by Guillaume Melquiond.
9372
93732006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9374
9375 * NEWS: Clarify symbols versus types in unused-value warnings.
9376
9377 * configure.ac (AC_INIT): Bump version number.
9378
93792006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9380
9381 * NEWS: Version 2.1a.
9382 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
9383 since C99 requires this.
9384
93852006-02-11 Paul Eggert <eggert@cs.ucla.edu>
9386
9387 * m4/c-working.m4: New file.
9388 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
9389
93902006-02-10 Paul Eggert <eggert@cs.ucla.edu>
9391
9392 * Makefile.maint: Merge from coreutils.
9393
93942006-02-09 Paul Eggert <eggert@cs.ucla.edu>
9395
9396 More portability fixes for problems summarized by Nelson H. F. Beebe.
9397
9398 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
9399 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
9400 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
9401 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
9402 messes up because C++ code is compiled in 32-bit mode but linked
9403 in 64-bit mode.
9404
94052006-02-08 Paul Eggert <eggert@cs.ucla.edu>
9406
9407 More portability fixes for problems summarized by Nelson H. F. Beebe.
9408
9409 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
9410 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
9411
9412 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
9413 nodist_PROGRAMS, since we don't need to actually compile the
9414 example if we're just doing a plain 'make'. This avoids bothering
9415 the installer unnecessarily about problems due to weird C++
9416 compilers.
9417
94182006-02-06 Paul Eggert <eggert@cs.ucla.edu>
9419
9420 More portability fixes for problems summarized by Nelson H. F. Beebe.
9421
9422 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
9423 than #include "...", and compile with -I'.'. The old method was
9424 not portable, according to Posix and the C standard, and it does
9425 not work with Sun C 5.7, where previous #line directives affect
9426 the working directory used in later #include "..." directives.
9427
94282006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9429
9430 Various DJGGP specific issues in /djgpp
9431
94322006-02-02 Paul Eggert <eggert@cs.ucla.edu>
9433
9434 More portability fixes for problems summarized by Nelson H. F. Beebe.
9435
9436 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
9437 '#include <map>' works and that you can apply ++ to iterators.
9438
94392006-02-01 Paul Eggert <eggert@cs.ucla.edu>
9440
9441 Work around portability problems summarized by Nelson H. F. Beebe in
9442 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
9443
9444 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
9445 that '#include <string>' works.
9446
9447 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
9448 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
9449 "warning: sorry: semantics of inline function static data `const
9450 unsigned char translate_table[262]' are wrong (you'll wind up with
9451 multiple copies)".
9452
9453 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
9454 or, xor to not_, and_, or_, and xor_, respectively. This works
9455 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
9456 random system header somewhere that includes the equivalent of
9457 <iso646.h>.
9458
9459 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
9460 -E" works; it apparently doesn't work with PathScale EKO Compiler
9461 Suite Version 2.0.
9462
94632006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
9464
9465 During deterministic GLR operation, user actions should be able to
9466 influence the parse by changing yychar. To make this easier to fix and
9467 to make glr.c easier to evolve in general, don't maintain yytoken in
9468 parallel with yychar; just compute yytoken when needed.
9469 * tests/glr-regression.at (Incorrect lookahead during deterministic
9470 GLR): Check that setting yychar in a user action has the intended
9471 effect.
9472 * data/glr.c (yyGLRStack): Remove yytokenp member.
9473 (yyclearin): Don't set *yytokenp.
9474 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
9475 yychar rather than *yytokenp to determine the current lookahead.
9476 Compute yytoken locally when needed.
9477 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
9478 point to.
9479
9480 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
9481 after `--report' documentation.
9482
94832006-01-30 Paul Eggert <eggert@cs.ucla.edu>
9484
9485 * src/parse-gram.y (grammar_declaration): Location of printer
9486 symbol is @1, not list->location. Bug reported by twlevo.
9487 * tests/input.at (Incompatible Aliases): Adjust to above change.
9488
94892006-01-29 Paul Eggert <eggert@cs.ucla.edu>
9490
9491 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
9492 all the test at once. This makes the output easier to read in the
9493 normal case.
9494
9495 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
9496 got from <http://bro-ids.org/download.html>. The bug is that
9497 when two actions appeared in succession, the second one was
9498 scanned before the first one was added to the grammar rule
9499 as a midrule action. Bison then output the incorrect warning
9500 "parse.y:905.17-906.36: warning: unused value: $3".
9501 * src/parse-gram.y (BRACED_CODE, action): These are no longer
9502 associated with a value.
9503 (rhs): Don't invoke grammar_current_rule_action_append.
9504 (action): Invoke it here instead.
9505 * src/reader.c (grammar_midrule_action): Now extern.
9506 (grammar_current_rule_action_append): Don't invoke
9507 grammar_midrule_action; that is now the scanner's job.
9508 * src/reader.h (last_string, last_braced_code_loc):
9509 (grammar_midrule_action): New decls.
9510 * src/scan-gram.l (last_string): Now extern, sigh.
9511 (last_braced_code_loc): New extern variable.
9512 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
9513 rule already has an action.
9514 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
9515 * tests/input.at (AT_CHECK_UNUSED_VALUES):
9516 Add some tests to check that the above changes fixed the bug.
9517
95182006-01-27 Paul Eggert <eggert@cs.ucla.edu>
9519
9520 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
9521 All used changed. Check whether the symbol has a destructor,
9522 not whether it is typed.
9523 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
9524 that the values are still reported as unused. All line numbers
9525 adjusted.
9526
95272006-01-23 Paul Eggert <eggert@cs.ucla.edu>
9528
9529 Work around a bug in bro 0.8, which underparenthesizes its
9530 definition of YYLLOC_DEFAULT.
9531 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
9532 their arguments.
9533 * data/lalr1.cc: Likewise.
9534 * data/yacc.cc: Likewise.
9535
95362006-01-22 Paul Eggert <eggert@cs.ucla.edu>
9537
9538 Work around a bug in Pike 7.0, and give the Pike folks a
9539 better way to override the usual int widths.
9540 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
9541 user can override the types.
9542 (short): #undef, to work around a bug in Pike 7.0.
9543 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
9544 (union yyalloc.yyss): Use yytype_int16 rather than short.
9545 All uses changed.
9546 (yysigned_char): Remove.
9547 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
9548 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
9549 * tests/regression.at (Web2c Actions): Adjust to above changes.
9550
9551 * src/reader.c (check_and_convert_grammar): New function.
9552 (reader): Close the input file even if something went wrong during
9553 parsing. Minor file descriptor leak reported by twlevo.
9554
9555 * src/assoc.c (assoc_to_string): Use a default: abort (); case
9556 to pacify gcc -Wswitch-default.
9557 * src/scan-gram.l (adjust_location): Use a default: break; case
9558 to pacify gcc -Wswitch-default.
9559 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
9560 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
9561 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
9562 Move these decls to scan-skel.l, since they don't need to be
9563 visible elsewhere.
9564 * src/scan-skel.l: Accept the above decls.
9565 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
9566 is used.
9567
95682006-01-21 Paul Eggert <eggert@cs.ucla.edu>
9569
9570 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
9571 since we don't want to insist on a version number at the start
9572 of the changelog every time.
9573 * Makefile.maint: Sync from coreutils a bit better.
9574 (sc_trailing_blank): Renamed from sc_trailing_space.
9575 All uses changed.
9576 (sc_no_if_have_config_h, sc_require_config_h):
9577 (sc_prohibit_assert_without_use): New rules.
9578 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
9579 (sc_dd_max_sym_length): Fix leading spaces in rule.
9580 (sc_system_h_headers): Prefix with @.
9581 (sc_useless_cpp_parens, m4-check): Output line numbers.
9582 (changelog-check): Allow version only in head.
9583 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
9584 satisfy new Makefile.maint rule.
9585 * data/glr.c: Likewise.
9586 * data/glr.cc: Likewise.
9587 * data/lalr1.cc: Likewise.
9588 * data/yacc.c: Likewise.
9589 * lib/ebitsetv.c: Likewise.
9590 * lib/lbitset.c: Likewise.
9591 * lib/subpipe.c: Likewise.
9592 * lib/timevar.c: Likewise.
9593 * src/system.h: Likewise.
9594 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
9595 * djgpp/Makefile.maint: Add copyright notice.
9596 * djgpp/README.in: Likewise.
9597 * djgpp/config.bat: Likewise.
9598 * djgpp/config.site: Likewise.
9599 * djgpp/config_h.sed: Likewise.
9600 * djgpp/djunpack.bat: Likewise.
9601 * djgpp/config.sed: Fix copyright notice to match standard format.
9602 * djgpp/subpipe.h: Likewise.
9603 * lib/bitsetv-print.c: Likewise.
9604 * lib/bitsetv.c: Likewise.
9605 * lib/subpipe.h: Likewise.
9606 * lib/timevar.c: Likewise.
9607 * lib/timevar.h: Likewise.
9608 * djgpp/subpipe.c: Use standard recipe for config.h.
9609 * lib/abitset.c: Likewise.
9610 * lib/bitset.c: Likewise.
9611 * lib/bitset_stats.c: Likewise.
9612 * lib/bitsetv-print.c: Likewise.
9613 * lib/bitsetv.c: Likewise.
9614 * lib/ebitsetv.c: Likewise.
9615 * lib/get-errno.c: Likewise.
9616 * lib/lbitset.c: Likewise.
9617 * lib/subpipe.c: Likewise.
9618 * lib/timevar.c: Likewise.
9619 * lib/vbitset.c: Likewise.
9620 * tests/local.at: Likewise.
9621 * src/scan-gram.l: Don't include verify.h, since system.h does
9622 that for us.
9623 * .x-sc_require_config_h: New file.
9624 * .x-sc_unmarked_diagnostics: New file.
9625
96262006-01-20 Paul Eggert <eggert@cs.ucla.edu>
9627
9628 Be a bit more systematic about using 'abort'.
9629 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
9630 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
9631 Put 'default: abort ();' before some other case, to satisfy older
9632 pedantic compilers.
9633 * lib/bitset_stats.c (bitset_stats_init): Likewise.
9634 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
9635 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
9636 * src/conflicts.c (resolve_sr_conflict): Likewise.
9637 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
9638 (get_decision_str, get_orientation_str, get_node_alignment_str):
9639 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
9640 (get_linestyle_str, get_arrowstyle_str): Likewise.
9641 * src/conflicts.c (resolve_sr_conflict):
9642 Use a default case rather than one for the one remaining enum
9643 value, to catch invalid enum values as well.
9644 * src/lalr.c (set_goto_map, map_goto):
9645 Prefer "assert (FOO);" to "if (!FOO) abort ();".
9646 * src/nullable.c (nullable_compute, token_definitions_output):
9647 Likewise.
9648 * src/reader.c (packgram, reader): Likewise.
9649 * src/state.c (transitions_to, state_new, state_reduction_find):
9650 Likewise.
9651 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
9652 (symbol_pack): Likewise.
9653 * src/tables.c (conflict_row, pack_vector): Likewise.
9654 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
9655 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
9656 * src/system.h: Don't include <assert.h>.
9657 (assert): New macro.
9658
9659 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
9660 (Destructor Decl, Parser Function, Pure Calling):
9661 Describe rules for braces inside C code more carefully.
9662
96632006-01-19 Paul Eggert <eggert@cs.ucla.edu>
9664
9665 Fix some porting glitches found by Nelson H. F. Beebe.
9666 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
9667 compilers that don't understand that abort () does not return.
9668 * src/state.c (transitions_to): Likewise.
9669 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
9670 that '#include <cstdlib>' works.
9671 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
9672 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
9673 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
9674 for the benefit of some pre-C99 compilers.
9675
9676 * bootstrap: Undo changes to gnulib files that autoreconf made.
9677
9678 Minor fixups to get 'make maintainer-check' to work.
9679 * configure.ac: Don't use -Wnested-externs, as it's incompatible
9680 with the new verify.h implementation.
9681 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
9682 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
9683 * data/yacc.c (YYUSE): Likewise.
9684 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
9685 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
9686 * src/parse-gram.y (declaration): Don't pass a string constant
9687 to a function that expects char *, since GCC might complain
9688 about the constant value.
9689 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
9690 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
9691 before #defining them.
9692 * tests/glr-regression.at
9693 (Incorrectly initialized location for empty right-hand side in GLR):
9694 In yyerror, use the msg arg.
9695 (Corrupted semantic options if user action cuts parse):
9696 (Incorrect lookahead during deterministic GLR):
9697 (Incorrect lookahead during nondeterministic GLR):
9698 Don't name a local var 'index'; it shadows string.h's 'index'.
9699
97002006-01-19 Akim Demaille <akim@epita.fr>
9701
9702 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
9703 location, not just parts of it.
9704
97052006-01-18 Paul Eggert <eggert@cs.ucla.edu>
9706
9707 * NEWS: Document the fact that multiple %unions are now allowed.
9708 * doc/bison.texinfo (Union Decl): Likewise.
9709 * TODO: This feature is now implemented, so remove it from
9710 the wishlist.
9711
9712 * Makefile.maint: Merge with coreutils Makefile.maint.
9713 (CVS_LIST): Use build-aux version if available.
9714 (VERSION_REGEXP): New macro.
9715 (syntax-check-rules): Add sc_no_if_have_config_h,
9716 sc_prohibit_assert_without_use, sc_require_config_h,
9717 sc_useless_cpp_parens.
9718 (sc_obsolete_symbols): Check for O_NDELAY.
9719 (sc_dd_max_sym_length): Track coreutils.
9720 (sc_unmarked_diagnostics): Look in all files, not just *.c.
9721 (sc_useless_cpp_parens): New rule.
9722 (news-date-check): Look for version or today's date.
9723 (changelog-check): Don't require version number near head.
9724 (copyright-check): Use current year instead of hardwiring 2005.
9725 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
9726 (announcement): Add --gpg-key-ID.
9727
9728 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
9729 with "file system".
9730
9731 Avoid undefined behavior that addressed just before the start of an
9732 array. Problem reported by twlevo.
9733 * src/reader.c (packgram): Prepend a new sentinel before ritem.
9734 * src/lalr.c (build_relations): Rely on new sentinel.
9735 * src/gram.c (gram_free): Adjust to new sentinel.
9736
97372006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
9738
9739 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
9740 yylookaheadNeeds. All uses updated.
9741 (yysplitStack): Rename local yynewLookaheadStatuses to
9742 yynewLookaheadNeeds.
9743 * data/glr-regression.at (Incorrect lookahead during nondeterministic
9744 GLR): In comments, change `lookahead status' to `lookahead need'.
9745
97462006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9747
9748 * data/glr.c (yysplitStack): A little stylistic rewrite.
9749
97502006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9751
9752 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
9753
97542006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
9755
9756 * doc/bison.texinfo: Fix some typos.
9757 (GLR Semantic Actions): New subsection discussing special
9758 considerations because GLR semantic actions might be deferred.
9759 (Actions): Mention look-ahead usage of yylval.
9760 (Actions and Locations): Mention look-ahead usage of yylloc.
9761 (Special Features for Use in Actions): Add YYEOF entry and mention it
9762 in the yychar entry.
9763 In the yychar entry, remove mention of the local yychar case (pure
9764 parser) since this is irrelevant information when writing semantic
9765 actions and since it's already discussed in `Table of Symbols' where
9766 yychar is otherwise described as an external variable.
9767 In the yychar entry, don't call it the `current' look-ahead since it
9768 isn't when semantic actions are deferred.
9769 In the yychar and yyclearin entries, add note about deferred semantic
9770 actions.
9771 Add yylloc and yylval entries discussing look-ahead usage.
9772 (Look-Ahead Tokens): When discussing yychar, don't call it the
9773 `current' look-ahead, and do mention yylval and yylloc.
9774 (Error Recovery): Cross-reference `Action Features' when mentioning
9775 yyclearin.
9776 (Table of Symbols): In the yychar entry, don't call it the `current'
9777 look-ahead.
9778 In the yylloc and yylval entries, mention look-ahead usage.
9779
97802006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
9781
9782 * tests/glr-regression.at: Update copyright year to 2006.
9783
97842006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
9785
9786 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
9787 use during nondeterministic operation to track which stacks have
9788 actually needed the current lookahead.
9789 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
9790 Allocate, deallocate, resize, and otherwise shuffle space for
9791 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
9792 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
9793 appropriately during nondeterministic operation.
9794 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
9795 members to store the current lookahead to be used by the deferred
9796 user action.
9797 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
9798 from which the RHS is taken. Set the lookahead members of the new
9799 yySemanticOption according to the lookahead status for stack yyk.
9800 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
9801 yyaddDeferredAction.
9802 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
9803 members of yySemanticOption before invoking yyuserAction, and then set
9804 them back to their current values afterward.
9805 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
9806 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
9807 * tests/glr-regression.at: Remove `.' from the ends of recent test case
9808 titles for consistency.
9809 (Leaked merged semantic value if user action cuts parse): In order to
9810 suppress lint warnings, use arguments in merge function, and assign
9811 char value < 128 in main.
9812 (Incorrect lookahead during deterministic GLR): New test case.
9813 (Incorrect lookahead during nondeterministic GLR): New test case.
9814
98152006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
9816
9817 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
9818 !yyvaluep as signal that no semantic value is available to print.
9819 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
9820 to print a semantic value.
9821
98222006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
9823
9824 * tests/glr-regression.at: For consistency with my newer test cases,
9825 don't thank myself.
9826
98272006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
9828
9829 * data/glr.c (yyresolveValue): When merging semantic options, if at
9830 least one user action succeeds but a later one cuts the parse, then
9831 destroy the semantic value before returning rather than leaking it.
9832 (yyresolveStates): If a user action cuts the parse and thus
9833 yyresolveValue fails, ignore the (unset) semantic value rather than
9834 corrupting the yyGLRState, and empty the semantic options list since
9835 the user actions should have called all necessary destructors.
9836 Simplify code with YYCHK.
9837 * tests/glr-regression.at (Corrupted semantic options if user action
9838 cuts parse): New test case.
9839 (Undesirable destructors if user action cuts parse): New test case.
9840 Before applying any of this patch, this test case never actually failed
9841 for me... but only because the corrupted semantic options usually
9842 masked this bug.
9843 (Leaked merged semantic value if user action cuts parse): New test
9844 case.
9845
98462006-01-05 Akim Demaille <akim@epita.fr>
9847
9848 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
9849
98502006-01-04 Paul Eggert <eggert@cs.ucla.edu>
9851
9852 * data/c.m4 (b4_c_modern): New macro, with a new provision for
9853 _MSC_VER. Problem reported by Cenzato Marco.
9854 (b4_c_function_def): Use it.
9855 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
9856 b4_c_modern.
9857 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
9858 than rolling our own.
9859
98602006-01-04 Akim Demaille <akim@epita.fr>
9861
9862 Also warn about non-used mid-rule values.
9863 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
9864 member.
9865 (symbol_list_new): Adjust.
9866 * src/reader.c (symbol_typed_p): New.
9867 (grammar_rule_check): Use it.
9868 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
9869 Check its rule.
9870 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
9871 Use it.
9872 * tests/actions.at (Exotic Dollars): Adjust.
9873
98742006-01-04 Akim Demaille <akim@epita.fr>
9875
9876 * src/reader.c (grammar_midrule_action): If $$ is set in a
9877 mid-rule, move the `used' bit to its lhs.
9878 * tests/input.at (Unused values): New.
9879 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
9880
98812006-01-03 Paul Eggert <eggert@cs.ucla.edu>
9882
9883 * doc/bison.texinfo (Bison Options): Say more accurately what
9884 --yacc does.
9885 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
9886 about declarations in the grammar when in Yacc mode, as POSIX does
9887 not require a diagnostic when the grammar uses extensions.
9888
9889 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
9890
9891 Warn about dubious constructions like "%token T T".
9892 Reported by twlevo.
9893 * src/symtab.h (struct symbol.declared): New member.
9894 * src/symtab.c (symbol_new): Initialize it to false.
9895 (symbol_class_set): New arg DECLARING, specifying whether
9896 this is a declaration that we want to warn about, if there
9897 is more than one of them. All uses changed.
9898
9899 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
9900 Allow multiple %union directives, whose contents concatenate.
9901 * src/parse-gram.y (grammar_declaration): Likewise.
9902 Use muscle_code_grow, so that we don't need stype_line any more.
9903 All uses changed.
9904
9905 * src/muscle_tab.c (muscle_grow): Fix comment.
9906
9907 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
9908 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
9909 Update copyright year to 2006.
9910
99112006-01-03 Akim Demaille <akim@epita.fr>
9912
9913 Have glr.cc pass (some of) the calc.at tests.
9914 * data/glr.cc (b4_parse_param_orig): New.
9915 (b4_parse_param): Improve its definition, and bound it more
9916 clearly in the skeleton.
9917 (b4_epilogue): Append, instead of prepending, in order to keep
9918 #line consistency.
9919 Simplify the generation of auxiliary functions: locations and
9920 purity are mandated.
9921 (b4_global_tokens_and_yystype): Honor it.
9922 * data/location.cc (c++.m4): Don't include it.
9923 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
9924 and AT_SKEL_CC_IF.
9925 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
9926 AT_LALR1_CC_IF.
9927 Be sure to initialize the first position's filename.
9928 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
9929 mandated anyway.
9930 (AT_CHECK_CALC_GLR_CC): New.
9931 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
9932
99332006-01-02 Akim Demaille <akim@epita.fr>
9934
9935 * src/output.c (output_skeleton): Don't hard wire the inclusion of
9936 c.m4.
9937 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
9938 * data/glr.cc: Do not include stack.hh.
9939
99402006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
9941
9942 * data/glr.c: Reformat whitespace with tabs.
9943 (b4_lpure_formals): Remove this unused m4 macro.
9944 * tests/cxx-type.at: Reformat whitespace with tabs.
9945 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
9946 since it's a member. Rename type to isNterm for clarity.
9947
99482005-12-29 Akim <akim@sulaco.local>
9949
9950 Let glr.cc catch up with symbol_value_print.
9951 * data/glr.cc (b4_yysymprint_generate): Replace by...
9952 (b4_yy_symbol_print_generate): this.
9953 (yy_symbol_print, yy_symbol_value_print): Declare them.
9954
99552005-12-28 Paul Eggert <eggert@cs.ucla.edu>
9956
9957 * src/location.h (boundary): Note that a line or column equal
9958 to INT_MAX indicates an overflow.
9959 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
9960 (rule_length_overflow, increment_rule_length, add_column_width):
9961 New functions.
9962 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
9963 (<SC_BRACED_CODE>"}"):
9964 Use increment_rule_length rather than incrementing it by hand.
9965 (adjust_location, handle_syncline): Diagnose overflow.
9966 (handle_action_dollar, handle_action_at):
9967 Fix bug with monstrosities like $-2147483648.
9968 Remove now-unnecessary checks.
9969 (scan_integer): Verify assumptions and remove now-unnecessary checks.
9970 (convert_ucn_to_byte): Verify assumptions.
9971 (handle_syncline): New arg LOC. All callers changed.
9972 Don't store through a value derived from char const * pointer.
9973
9974 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
9975 GCC warnings.
9976
99772005-12-27 Paul Eggert <eggert@cs.ucla.edu>
9978
9979 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
9980 Remove unnecessary forward static decls.
9981
99822005-12-27 Akim Demaille <akim@epita.fr>
9983
9984 * src/reader.c (grammar_current_rule_check): Also check that $$
9985 is used.
9986 Take the rule to check as argument, hence rename as...
9987 (grammar_rule_check): this.
9988 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
9989 Rename as...
9990 (grammar_rule_begin, grammar_rule_end): these, for consistency.
9991 (grammar_midrule_action, grammar_symbol_append): Now static.
9992 * tests/torture.at (input): Don't rely on the default action
9993 being always performed.
9994 * tests/calc.at: "Set" $$ even when the action is "cut" with
9995 YYERROR or other.
9996 * tests/actions.at (Exotic Dollars): Instead of using unused
9997 values, check that the warning is issued.
9998
99992005-12-22 Paul Eggert <eggert@cs.ucla.edu>
10000
10001 * NEWS: Improve wording for unused-value warnings.
10002
100032005-12-22 Akim Demaille <akim@epita.fr>
10004
10005 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
10006 (b4_yysymprint_generate): Rename as...
10007 (b4_yy_symbol_print_generate): this.
10008 Generate yy_symbol_print instead of yysymprint.
10009 Generate also yy_symbol_value_print, and use it.
10010
100112005-12-22 Akim Demaille <akim@epita.fr>
10012
10013 * NEWS: Warn about unused values.
10014 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
10015 a `used' member.
10016 (symbol_list_n_get, symbol_list_n_used_set): New.
10017 (symbol_list_n_type_name_get): Use symbol_list_n_get.
10018 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
10019 * src/reader.c (grammar_current_rule_check): Check that values are
10020 used.
10021 * src/symtab.c (symbol_print): Accept 0.
10022 * tests/existing.at: Remove the type information.
10023 Empty the actions.
10024 Remove useless actions (beware of mid-rule actions: perl -000
10025 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
10026 * tests/actions.at (Exotic Dollars): Use unused values.
10027 * tests/calc.at: Likewise.
10028 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10029 Likewise.
10030
10031 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
10032 rule_useful_p.
10033
100342005-12-21 Paul Eggert <eggert@cs.ucla.edu>
10035
10036 Undo 2005-12-01 tentative license wording change. The wording is
10037 still being reviewed by the lawyers, and we don't want to wait for
10038 them before publishing a test release. For now, revert to the
10039 previous wording.
10040 * NEWS: Undo 2005-12-01 change.
10041 * data/glr.c: Revert to previous license wording.
10042 * data/glr.cc: Likewise.
10043 * data/lalr1.cc: Likewise.
10044 * data/location.cc: Likewise.
10045 * data/yacc.c: Likewise.
10046
10047 * NEWS: Reword %destructor vs YYABORT etc.
10048 * data/glr.c: Use American spacing, for consistency.
10049 * data/glr.cc: Likewise.
10050 * data/lalr1.cc: Likewise.
10051 * data/yacc.c: Likewise.
10052 * data/yacc.c: Reformat comments slightly.
10053 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
10054 for consistency. Fix some spelling errors and reword recently-included
10055 text slightly.
10056 * tests/cxx-type.at: Cast results of malloc, for C++.
10057
100582005-12-21 Joel E. Denny <address@hidden>
10059
10060 * tests/cxx-type.at: Construct a tree, count the parents of shared
10061 nodes, and free each node once and only once. Previously, the memory
10062 for semantic values was leaked instead.
10063
100642005-12-21 Joel E. Denny <address@hidden>
10065
10066 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
10067 (yylval, yylloc): If pure, #define to yystackp->yyval and
10068 yystackp->yyloc similar to yychar and yynerrs.
10069 (yyparse): If pure, remove local yylval and yylloc. Add local
10070 yystackp to accommodate pure definitions of yylval and yylloc.
10071 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
10072 yylvalp and yyllocp to &yylval and &yylloc.
10073 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
10074 namespace. Previously, nerrs and char were missing, but lval and lloc
10075 weren't necessary.
10076 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
10077 yylvalp and yyllocp parameters since, if pure, these are now always
10078 accessible through yystackp. If not pure, they are still accessible
10079 globally.
10080 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
10081 `if (YYID (N))' to pacify lint.
10082
100832005-12-21 Akim Demaille <akim@epita.fr>
10084
10085 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
10086 destroy the RHS symbols of a rule.
10087 * data/yacc.c (yylen): Initialize to 0.
10088 Keep its value to the number of items to possibly shift.
10089 In particular, a regular successful parse that ends on YYFINAL by
10090 a (internal) YYACCEPT must not have yylen != 0.
10091 (yyerrorlab, yyreturn): Pop the RHS.
10092 Reorder a bit to emphasize the `shifting' bits of code.
10093 (YYPOPSTACK): Now accept a number of items to pop.
10094 * data/lalr1.cc: Likewise.
10095 * data/glr.c: Formatting changes.
10096 Use goto instead of fall through.
10097 * doc/bison.texinfo (Destructor Decl): Complete.
10098
100992005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10100
10101 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10102 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
10103 * djgpp/config.bat: Replace every occurence of the file name
10104 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10105 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10106 * djgpp/config.sed: Replace every occurence of the file name
10107 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10108 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10109 * djgpp/djunpack.bat: DJGPP specific file.
10110 * djgpp/fnchange.lst: DJGPP specific file.
10111 * djgpp/README.in: Add new information about how to unpack the bison
10112 source on MSDOS and other systems which have 8.3 file name restrictions
10113 using djunpack.bat and fnchange.lst.
10114
101152005-12-12 Paul Eggert <eggert@cs.ucla.edu>
10116
10117 * bootstrap (build_cvs_prefix): Remove; unused.
10118 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
10119 when getting gnulib.
10120
101212005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
10122
10123 * data/glr.c: Reorder typedef declarations for structs to match order
10124 of struct declarations.
10125 Rename yystack everywhere to yystackp except in yyparse where it's not
10126 a pointer.
10127 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
10128 consistency.
10129 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
10130 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
10131 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
10132 lint.
10133
101342005-12-09 Paul Eggert <eggert@cs.ucla.edu>
10135
10136 * tests/sets.at (Accept): Fix typos in regular expression used to
10137 sed out the final state number.
10138
10139 Work around portability problem on Solaris 10: flex-generated
10140 files include <stdio.h> before <config.h>, which messes up
10141 because the latter defines __EXTENSIONS__. Address the problem
10142 by creating two new little files that include <config.h> first,
10143 then include the flex-generated files. Rewrite everyone else
10144 to include <config.h> first, as well.
10145 * lib/timevar.c: Always include "config.h".
10146 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
10147 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
10148 (EXTRA_bison_SOURCES): New macro.
10149 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
10150 * src/system.h: Don't include config.h.
10151 * src/LR0.c: Include <config.h> first.
10152 * src/assoc.c: Likewise.
10153 * src/closure.c: Likewise.
10154 * src/complain.c: Likewise.
10155 * src/conflicts.c: Likewise.
10156 * src/derives.c: Likewise.
10157 * src/files.c: Likewise.
10158 * src/getargs.c: Likewise.
10159 * src/gram.c: Likewise.
10160 * src/lalr.c: Likewise.
10161 * src/location.c: Likewise.
10162 * src/main.c: Likewise.
10163 * src/muscle_tab.c: Likewise.
10164 * src/nullable.c: Likewise.
10165 * src/output.c: Likewise.
10166 * src/parse-gram.y: Likewise.
10167 * src/print.c: Likewise.
10168 * src/print_graph.c: Likewise.
10169 * src/reader.c: Likewise.
10170 * src/reduce.c: Likewise.
10171 * src/relation.c: Likewise.
10172 * src/state.c: Likewise.
10173 * src/symlist.c: Likewise.
10174 * src/symtab.c: Likewise.
10175 * src/tables.c: Likewise.
10176 * src/uniqstr.c: Likewise.
10177 * src/vcg.c: Likewise.
10178
10179 * src/parse-gram.y: Fix minor problems uncovered by lint.
10180 (current_lhs, current_lhs_location): Now static.
10181 (current_assoc): Remove unused variable.
10182
10183 Cleanups so that Bison-generated parsers have less lint.
10184 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
10185 Prepend /*ARGSUSED*/, for lint's sake.
10186 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
10187 definition if 'lint' is defined.
10188 (YYID): New macro (or function, if lint).
10189 All uses of /*CONSTCOND*/0 replaced by YYID(0).
10190 * data/yacc.c: Likewise.
10191 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
10192 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
10193 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
10194 is C++ only.
10195 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
10196 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
10197 Use YYID(0) rather than 0, for lint.
10198 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
10199 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
10200
102012005-12-07 Paul Eggert <eggert@cs.ucla.edu>
10202
10203 * tests/glr-regression.at
10204 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10205 Close memory leak reported by twlevo.
10206
102072005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
10208
10209 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
10210 all stacks.
10211 (yyparse): Iterate another stack in order to call user destructors.
10212 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10213 New test case.
10214 (Duplicated user destructor for lookahead): This test now is expected
10215 to succeed.
10216
102172005-12-01 Paul Eggert <eggert@cs.ucla.edu>
10218
10219 * NEWS: Document the following change.
10220 * data/yacc.c: Say "parser skeleton" rather than "file", since
10221 it's no longer just a file.
10222 * data/glr.c: Grant a special exception for C GLR parsers, that
10223 reads like the already-existing exception for C LALR(1) parsers.
10224 * data/glr.cc: Likewise.
10225 * data/lalr1.cc: Likewise.
10226 * data/location.cc: Likewise.
10227 * data/yacc.c: Reword the "written by" statement to clarify that
10228 it was the parser skeleton, not the entire output file.
10229 * data/glr.c: Written by Paul Hilfinger.
10230 * data/glr.cc: Written by Akim Demaille.
10231 * data/lalr1.cc: Likewise.
10232
102332005-11-18 Paul Eggert <eggert@cs.ucla.edu>
10234
10235 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
10236 Fix typos in previous change that broke 'make check'.
10237 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
10238 supported in C.
10239 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
10240 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
10241 We can revert this once things settle down.
10242
10243 * src/conflicts.c (conflicts_print): Don't print file name twice
10244 when %expect fails because there were no conflicts.
10245 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
10246 change.
10247 * tests/conflicts.at (%expect not enough, %expect too much):
10248 (%expect with reduce conflicts): Adjust to new behavior.
10249
102502005-11-18 Akim Demaille <akim@epita.fr>
10251
10252 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
10253 errors.
10254 * NEWS: Document this.
10255 * doc/bison.texinfo (Expect Decl): Likewise.
10256
102572005-11-16 Akim Demaille <akim@epita.fr>
10258
10259 Generalize the display of semantic values and locations in traces.
10260 * data/glr.c (yy_reduce_print): Fix indices (again).
10261 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
10262 literal integers.
10263 * data/lalr1.cc (yyreduce_print): Rename as...
10264 (yy_reduce_print): this.
10265 Display values and locations.
10266 * data/yacc.c (yy_reduce_print): Likewise.
10267 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
10268 (yysymprint): Move higher to be visible from yy_reduce_print).
10269 (yyparse): Adjust.
10270 * tests/calc.at: Adjust the expected length of the traces.
10271
102722005-11-14 Akim Demaille <akim@epita.fr>
10273
10274 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
10275 from 1 to N, while values and location start at 0.
10276 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
10277
102782005-11-14 Akim Demaille <akim@epita.fr>
10279
10280 * data/glr.c (yy_reduce_print): Fix the $ number.
10281
102822005-11-14 Akim Demaille <akim@epita.fr>
10283
10284 "Use" parse parameters.
10285 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
10286 * data/glr.c, data/glr.cc: Use them.
10287 * data/glr.c (YYUSE): Have a C++ definition that supports
10288 non-pointer types.
10289
102902005-11-14 Akim Demaille <akim@epita.fr>
10291
10292 * data/glr.c (yyexpandGLRStack): Declare only if defined.
10293
102942005-11-14 Akim Demaille <akim@epita.fr>
10295
10296 * data/glr.cc: New.
10297 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
10298
102992005-11-12 Akim Demaille <akim@epita.fr>
10300
10301 Let position and location be PODs.
10302 * data/location.cc (position::initialize, location::initialize): New.
10303 (position::position, location::location): Define only if
10304 b4_location_constructors is defined.
10305 * data/lalr1.cc (b4_location_constructors): Define it for backward
10306 compatibility.
10307 * doc/bison.texinfo (Initial Action Decl): Use initialize.
10308
103092005-11-12 Akim Demaille <akim@epita.fr>
10310
10311 * data/lalr1.cc: Move the body of the ctor and dtor into the
10312 parser file (instead of the header).
10313 Wrap the implementations in a "namespace yy".
10314
103152005-11-12 Akim Demaille <akim@epita.fr>
10316
10317 Have glr.c include its header file when created.
10318 * data/glr.c (b4_shared_declarations): New.
10319 Output them verbatim in the parser if !%defines, otherwise
10320 output then in the header file, and include it instead.
10321
103222005-11-11 Akim Demaille <akim@epita.fr>
10323
10324 * data/glr.c: Comment changes.
10325
103262005-11-11 Akim Demaille <akim@epita.fr>
10327
10328 When yydebug, report semantic and location values for reductions.
10329 * data/glr.c (yy_reduce_print): Report the semantic values and the
10330 locations.
10331 (YY_REDUCE_PRINT): Adjust.
10332 (yyglrReduce): Use them.
10333 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
10334 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
10335 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
10336 traces.
10337
103382005-11-10 Akim Demaille <akim@epita.fr>
10339
10340 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
10341 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
10342 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
10343
103442005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
10345
10346 * m4/cxx.m4, examples/Makefile.am: Don't build
10347 examples/calc++ if no C++ compiler is available. (trivial change)
10348
103492005-11-09 Akim Demaille <akim@epita.fr>
10350
10351 * src/scan-skel.l: Use a couple of asserts.
10352
103532005-11-03 Akim Demaille <akim@epita.fr>
10354
10355 In some (weird) cases, the final state number is incorrect.
10356 Reported by Alexandre Duret-Lutz.
10357 * src/LR0.c (state_list_append): Remove the computation of
10358 final_state.
10359 (save_reductions): Do it here.
10360 (get_state): Alpha conversion.
10361 (generate_states): Use a for loop.
10362 * src/gram.h (item_number_is_rule_number)
10363 (item_number_is_symbol_number): New.
10364 * src/state.c: Use assert.
10365 * src/system.h: Include assert.h.
10366 * tests/sets.at (Accept): New.
10367
103682005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10369
10370 * data/glr.c (yyfill): Adjust comment.
10371 (yyresolveAction): Initialize default location properly
10372 for empty right-hand sides.
10373 (yydoAction): Ditto.
10374 Add comment explaining apparently dead code.
10375 * tests/glr-regression.at
10376 (Incorrectly initialized location for empty right-hand side in GLR):
10377 New test.
10378
103792005-10-30 Paul Eggert <eggert@cs.ucla.edu>
10380
10381 * bootstrap (cleanup_gnulib): New function. Use it to clean up
10382 gnulib when interrupted. This fixes some race conditions and
10383 works around some portability problems (one noted by Paul
10384 Hilfinger).
10385
103862005-10-22 Akim <akim@epita.fr>
10387
10388 * Makefile.cfg: Adjust to config -> build-aux.
10389 Reported by twledo.
10390
103912005-10-21 Akim Demaille <akim@epita.fr>
10392
10393 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
10394 the %parse-params.
10395 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
10396 * data/yacc.c (b4_Pure_if): Rename as...
10397 (b4_yacc_pure_if): this.
10398 (YY_SYMBOL_PRINT, yyparse): Adjust.
10399 * doc/bison.texinfo: Formatting changes.
10400
104012005-10-21 Akim Demaille <akim@epita.fr>
10402
10403 Finish the transition config -> build-aux.
10404 * configure.ac, Makefile.am: Use build-aux.
10405 * config/prev-version, config/announce-gen, config/Makefile.am:
10406 Move to...
10407 * build-aux/prev-version, build-aux/announce-gen,
10408 * build-aux/Makefile.am: here.
10409
104102005-10-14 Akim Demaille <akim@epita.fr>
10411
10412 * examples/calc++/test: Use set -x only when VERBOSE.
10413
104142005-10-13 Paul Eggert <eggert@cs.ucla.edu>
10415
10416 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
10417 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
10418
104192005-10-13 Akim Demaille <akim@epita.fr>
10420
10421 * src/scan-skel.l: Output the base name parts of the parser and
10422 header file names.
10423 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
10424 additional checks.
10425 Use this to exercise C++ outputs in subdirs.
10426 Reported by Oleg Smolsky.
10427
104282005-10-12 Paul Eggert <eggert@cs.ucla.edu>
10429
10430 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
10431 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
10432 Problem reported by John P. Hartmann.
10433 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
10434 already defined it.
10435
104362005-10-12 Akim Demaille <akim@epita.fr>
10437
10438 * src/parse-gram.y (version_check): Exit 63 to please missing
10439 (stands for "version mismatch).
10440 * tests/input.at, doc/bison.texinfo: Adjust.
10441
104422005-10-10 Paul Eggert <eggert@cs.ucla.edu>
10443
10444 Work around portability problems with Visual Age C compiler
10445 (xlc and xlC_r) reported by John P. Hartmann.
10446 * data/location.cc (initial_column, initial_line): Remove.
10447 All uses replaced by 0 and 1.
10448 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
10449 that xlc complains about.
10450 * src/scan-skel.l (skel_wrap): Likewise.
10451 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
10452 as __STDC__.
10453 * data/yacc.c (YYMODERN_C): New macro, which also looks at
10454 __STDC_VERSION__. Use it everywhere instead of looking at
10455 __STDC__ and __cplusplus.
10456
104572005-10-10 Akim Demaille <akim@epita.fr>
10458
10459 * examples/calc++/test: Be quiet unless VERBOSE.
10460
104612005-10-05 Paul Eggert <eggert@cs.ucla.edu>
10462
10463 * data/c.m4 (yydestruct, yysymprint):
10464 Use YYUSE instead of casting to void.
10465 * data/glr.c (YYUSE): New macro.
10466 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10467 Use it instead of rolling our own.
10468 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10469 (YYCHK1):
10470 Use /*CONSTCOND*/ to suppress lint warnings.
10471 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10472 (YY_STACK_PRINT): Use 'false' not '0'.
10473 (YYUSE): New macro.
10474 (yysymprint_, yydestruct_): Use it instead of rolling our own.
10475 * data/yacc.c (YYUSE): New macro.
10476 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
10477 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
10478 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
10479
10480
10481 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
10482 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
10483
104842005-10-04 Paul Eggert <eggert@cs.ucla.edu>
10485
10486 Undo the parts of the unlocked-I/O change that substituted
10487 putc or puts for printf. This might hurt performance a bit,
10488 but some people prefer the printf style.
10489 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
10490 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
10491 All uses replaced by YYFPRINTF and YYDPRINTF.
10492 * data/yacc.c: Likewise.
10493 * lib/bitset.c (bitset_print): Likewise.
10494 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
10495 putc and puts.
10496 * lib/lbitset.c (debug_lbitset): Likewise.
10497 * src/closure.c (print_firsts, print_fderives): Likewise.
10498 * src/gram.c (grammar_dump): Likewise.
10499 * src/lalr.c (look_ahead_tokens_print): Likewise.
10500 * src/output.c (escaped_output): Likewise.
10501 (user_actions_output): Break apart two printfs.
10502 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
10503 * src/reduce.c (reduce_print): Likewise.
10504 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
10505 * src/system.h: Include unlocked-io.h rathe than stdio.h.
10506
10507 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10508 Use assignments rather than casts-to-void to suppress
10509 unused-variable warnings. This pacifies 'lint'.
10510 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
10511 unused-variable warnings.
10512
105132005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10514
10515 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10516
105172005-10-02 Paul Eggert <eggert@cs.ucla.edu>
10518
10519 Use unlocked I/O for a minor performance improvement on hosts like
10520 GNU/Linux and Solaris that support unlocked I/O. The basic idea
10521 is to use the gnlib unlocked-io module, and to prefer putc and
10522 puts to printf when either will work (since the latter doesn't
10523 come in an unlocked flavor).
10524 * bootstrap (gnulib_modules): Add unlocked-io.
10525 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
10526 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
10527 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
10528 and similarly for puts and putc and printf.
10529 * data/yacc.c: Likewise.
10530 * lib/bitset.c (bitset_print): Likewise.
10531 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
10532 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
10533 to printf.
10534 * lib/lbitset.c (debug_lbitset): Likewise.
10535 * src/closure.c (print_firsts, print_fderives): Likewise.
10536 * src/gram.c (grammar_dump): Likewise.
10537 * src/lalr.c (look_ahead_tokens_print): Likewise.
10538 * src/output.c (escaped_output): Likewise.
10539 (user_actions_output): Coalesce two printfs.
10540 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
10541 * src/reduce.c (reduce_print): Likewise.
10542 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
10543 * src/system.h: Include unlocked-io.h rather than stdio.h.
10544
10545 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
10546 this confuses xgettext.
10547
105482005-10-02 Akim Demaille <akim@epita.fr>
10549
10550 * bootstrap (gnulib_modules): Add strverscmp.
10551 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
10552 * m4/.cvsignore: Add strverscmp.m4.
10553 * src/parse-gram.y (%require): New token, new rule.
10554 (version_check): New.
10555 * src/scan-gram.l (%require): Adjust.
10556 * tests/input.at (AT_REQUIRE): New.
10557 Use it.
10558 * doc/bison.texinfo (Require Decl): New.
10559 (Calc++ Parser): Use %require.
10560
105612005-10-02 Akim Demaille <akim@epita.fr>
10562
10563 * data/location.cc: New.
10564
105652005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
10566 Akim Demaille <akim@epita.fr>
10567
10568 Make sure -odir/foo.cc creates dir/location.hh etc.
10569 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
10570 (spec_file_prefix, spec_verbose_file, spec_graph_file)
10571 (spec_defines_file): Now const.
10572 (dir_prefix): New.
10573 (short_base_name): Remove.
10574 * src/files.c: Adjust.
10575 (dirname.h): Include.
10576 (base_name): Don't prototype it.
10577 (finput): Remove, duplicates gram_in.
10578 (full_base_name, short_base_name): Replace by...
10579 (all_but_ext, all_but_tab_ext): these.
10580 (compute_base_names): Rename as...
10581 (compute_file_name_parts): this.
10582 Update to compute the new variables, including dir_prefix.
10583 Adjust dependencies.
10584 * src/output.c (prepare): Output them.
10585 * src/reader.c: Adjust to use gram_in, not finput.
10586 * src/scan-skel.l (@dir_prefix@): New.
10587
105882005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10589
10590 * lib/subpipe.c: New function end_of_output_subpipe() added
10591 to allow support for non-posix systems. This is a no-op function
10592 for posix systems.
10593
10594 * lib/subpipe.h: New function end_of_output_subpipe() added
10595 to allow support for non-posix systems. This is a no-op function
10596 for posix systems.
10597
10598 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
10599 handle the lack of pipe/fork functionality on non-posix systems.
10600
10601 * djgpp/Makefile.maint: DJGPP specific file.
10602
10603 * djgpp/README.in: DJGPP specific file.
10604
10605 * djgpp/config.bat: DJGPP specific configuration file.
10606
10607 * djgpp/config.sed: DJGPP specific configuration file.
10608
10609 * djgpp/config.site: DJGPP specific configuration file.
10610
10611 * djgpp/config_h.sed: DJGPP specific configuration file.
10612
10613 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
10614
10615 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
10616
106172005-10-02 Akim Demaille <akim@epita.fr>
10618
10619 * data/location.cc: New, extract from...
10620 * data/lalr1.cc: here.
10621 (location.hh): Include it after the user prologue, in case the
10622 filename type is defined by the user.
10623 Forward declation location and position before the pre-prologue.
10624 (yyresult_): Rename as...
10625 (yyresult): this, it's a local variable, not an attribute.
10626 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
10627
106282005-10-01 Akim Demaille <akim@epita.fr>
10629
10630 * examples/extexi: Restore the #line generation.
10631
106322005-09-30 Akim Demaille <akim@epita.fr>,
10633 Alexandre Duret-Lutz <adl@gnu.org>
10634
10635 Move the token type and YYSTYPE in the parser class.
10636 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
10637 (parser::token): New, from the moved free definition of tokens.
10638 (parser::semantic_value): Now a full definition instead of an
10639 indirection to YYSTYPE.
10640 (b4_post_prologue): No longer included in the header file, but
10641 in the implementation file.
10642 * doc/bison.texi (C+ Language Interface): Update.
10643 * src/parse-gram.y: Support unary %define.
10644 * tests/actions.at: Define global_tokens_and_yystype for backward
10645 compatibility until we update the tests.
10646 * tests/calc.at: Idem.
10647 (first_line, first_column, last_line, last_column): Define for lalr1.cc
10648 to simplify the code.
10649
106502005-09-29 Paul Eggert <eggert@cs.ucla.edu>
10651
10652 Port to SunOS 4.1.4, which lacks strtoul and strerror.
10653 Ah, the good old days! Problem reported by Peter Klein.
10654 * bootstrap (gnulib_modules): Add strerror, strtoul.
10655 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
10656 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
10657
106582005-09-29 Akim Demaille <akim@epita.fr>
10659
10660 * data/c.m4 (b4_error_verbose_if): New.
10661 * data/lalr1.cc: Use it.
10662 (YYERROR_VERBOSE_IF): Remove.
10663 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
10664 parser members, replaced by...
10665 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
10666 local variables.
10667 (yysyntax_error_): Takes the state number as argument.
10668 (yyreduce_print_): Use the argument yyrule, not the former
10669 attribute yyn_.
10670
106712005-09-26 Paul Eggert <eggert@cs.ucla.edu>
10672
10673 * bootstrap (gnulib_modules): Add verify.
10674 * lib/.cvsignore: Add verify.h.
10675 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
10676 * src/system.h (verify): Remove.
10677 Include verify.h instead.
10678 * src/tables.c (tables_generate): Use new API for 'verify'.
10679
106802005-09-21 Paul Eggert <eggert@cs.ucla.edu>
10681
10682 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
10683 local variables whose names begin with 'yy'.
10684 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
10685 Trivial changes from Joel E. Denny.
10686
10687 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
10688 it itself.
10689 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
10690 don't use alloca any more.
10691
10692 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
10693 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
10694 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
10695 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
10696 to match yacc.c, to test more hosts.
10697
106982005-09-20 Paul Eggert <eggert@cs.ucla.edu>
10699
10700 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
10701 doesn't affect behavior.
10702 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
10703 Solaris, AIX, MSC.
10704 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
10705 This works a bit better with glibc, if user code has already included
10706 stdlib.h.
10707 * doc/bison.texinfo (Bison Parser): Document that users can't
10708 arbitrarily use malloc and free for other purposes. Document
10709 that <alloca.h> and <malloc.h> might be included.
10710 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
10711 user must declare alloca.
10712
10713 * HACKING (release): Forwarn the Translation Project about
10714 stable releses.
10715
107162005-09-20 Akim Demaille <akim@epita.fr>
10717
10718 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
10719
107202005-09-19 Paul Eggert <eggert@cs.ucla.edu>
10721
10722 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
10723 (YYSTACK_ALLOC_MAXIMUM): Use it.
10724 (yysyntax_error): New function.
10725 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
10726 multiple syntax errors are reported, and alloca is being used.
10727 Instead, reallocate buffers twice as big each time, so that
10728 we waste at most half the allocated memory. Start with a small
10729 (128-byte) buffer that will suffice in most cases anyway.
10730 Use yysyntax_error to do most of the work.
10731
10732 * doc/bison.texinfo (Error Reporting, Table of Symbols):
10733 yynerrs is the number of errors reported, not the number of
10734 errors encountered.
10735
10736 * tests/glr-regression.at (Duplicated user destructor for lookahead):
10737 Mark it as expected to fail.
10738 Cast result of malloc; problem reported by twlevo@xs4all.nl.
10739 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
10740 Don't start user-code symbols with "yy", to avoid name space problems.
10741
107422005-09-19 Akim Demaille <akim@epita.fr>
10743
10744 Remove the traits, failed experiment.
10745 It never proved useful, and anyway because of the current
10746 definition, it was not possible to have several specialization of
10747 this traits, making it useless.
10748 * data/lalr1.cc (yy:traits): Remove.
10749 Inline its definitions in the parser class.
10750
107512005-09-19 Akim Demaille <akim@epita.fr>
10752
10753 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
10754 least Mac OSX with a /usr/local install of gettext.
10755
107562005-09-19 Akim Demaille <akim@epita.fr>
10757
10758 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
10759 and yytoken for similarity with the other skeletons.
10760
107612005-09-19 Akim Demaille <akim@epita.fr>
10762
10763 * NEWS, configure.ac: update version number to 2.1a.
10764
107652005-09-16 Paul Eggert <eggert@cs.ucla.edu>
10766
10767 * NEWS: Version 2.1.
10768
10769 * NEWS: Remove notice of yytname change, since it was never in an
10770 official release.
10771 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
10772 diagnostic.
10773 * src/output.c (prepare): Likewise.
10774 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
10775 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
10776 is not defined. This is an awful hack, but it's enough for now.
10777 All callers changed.
10778 * tests/glr-regression-at (make_value): Args are const pointers now,
10779 to avoid GCC warning.
10780 (Duplicated user destructor for lookahead): New test. Currently
10781 skipped. It fails on my host but I'm not sure it'll always fail.
10782
107832005-09-16 Akim Demaille <akim@epita.fr>
10784
10785 * src/symtab.h (struct symbol): Declare the printer and destructor
10786 as const, to avoid accidental calls to free.
10787 (symbol_destructor_set, symbol_printer_set): Adjust.
10788 * src/symtab.c: Adjust.
10789
107902005-09-16 Akim Demaille <akim@epita.fr>
10791
10792 * data/c.m4 (b4_token_enums): New.
10793 (b4_token_defines): Rename as...
10794 (b4_token_enums_defines): this.
10795 (b4_token_defines): New, output only the #defines.
10796 * data/yacc.c, data/glr.c: Adjust.
10797 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
10798 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
10799 as default values.
10800
108012005-09-16 Akim Demaille <akim@epita.fr>
10802
10803 * data/lalr1.cc (yylex_): Remove, inline its code.
10804 (yyreport_syntax_error_): Remove, replaced by...
10805 (yysyntax_error_): this which returns a string and leaves to the
10806 caller the call to the users' error function.
10807 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
10808 Move from members of the parser object...
10809 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
10810 to local variables of the parse function.
10811
108122005-09-16 Akim Demaille <akim@epita.fr>
10813
10814 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
10815 since it's in Bison's name space.
10816
108172005-09-15 Paul Eggert <eggert@cs.ucla.edu>
10818
10819 * data/glr.c (yyresolveValue): Add default case to pacify
10820 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
10821
10822 * NEWS: Document when yyparse started to return 2.
10823 * doc/bison.texinfo (Parser Function): Document when yyparse
10824 returns 2.
10825
10826 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
10827 (b4_filename_type): Renamed back from b4_file_name_type. All uses
10828 changed.
10829 (class position): file_name -> filename (reverting). All uses changed.
10830
108312005-09-14 Paul Eggert <eggert@cs.ucla.edu>
10832
10833 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
10834 do anything if $@ exists. This reverts part of the 2005-07-07
10835 patch.
10836
108372005-09-11 Paul Eggert <eggert@cs.ucla.edu>
10838
10839 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
10840 contains obsolete information and isn't worth distributing as a
10841 separate file anyway.
10842 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
10843 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
10844 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
10845 (yyparse): Abort if user code uses longjmp to throw an unexpected
10846 value.
10847
108482005-09-09 Paul Eggert <eggert@cs.ucla.edu>
10849
10850 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
10851 Suggested by twlevo@xs4all.nl.
10852
10853 * data/glr.c (YYCHK1): Do not assume YYE is in range.
10854 This avoids a diagnostic from gcc -Wswitch-enum.
10855 Problem reported by twlevo@xs4all.nl.
10856
10857 * doc/bison.texinfo: Don't use "filename", as per GNU coding
10858 standards. Use "file name" or "file" or "name", depending on
10859 the context.
10860 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
10861 not to hack/foo.tab.c.
10862 (Calc++ Top Level): 2nd arg of main is not const.
10863 * data/glr.c: b4_filename -> b4_file_name.
10864 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
10865 All uses changed.
10866 (class position): filename -> file_name. All uses changed.
10867 * data/yacc.c: b4_filename -> b4_file_name.
10868 * lib/bitset.h: filename -> file_name in local vars.
10869 * lib/bitset_stats.c: Likewise.
10870 * src/files.c: Likewise.
10871 * src/scan-skel.l ("@output ".*\n): Likewise.
10872 * src/files.c (file_name_split): Renamed from filename_split.
10873 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
10874
108752005-09-08 Paul Eggert <eggert@cs.ucla.edu>
10876
10877 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
10878 to accommodate latest gnulib.
10879
10880 * tests/glr-regression.at (Duplicate representation of merged trees):
10881 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
10882
10883 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
10884 needed.
10885
108862005-08-26 Paul Eggert <eggert@cs.ucla.edu>
10887
10888 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
10889 All uses changed. Invoke user destructor after an error during a
10890 split parse (trivial change from Joel E. Denny).
10891
10892 * tests/glr-regression.at
10893 (User destructor after an error during a split parse): New test case.
10894 Problem reported by Joel E. Denny in:
10895 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
10896
108972005-08-25 Paul Eggert <eggert@cs.ucla.edu>
10898
10899 * README-cvs: Give URLs for recommended tools.
10900 Mention Gzip version problem, and bootstrapping issues.
10901 Remove troubleshooting section, as it's somewhat obsolete.
10902
10903 * bootstrap (no_cache): New var, to accommodate different wget
10904 variants. Use it instead of '-C off'. Problem reported by
10905 twlevo@xs4all.nl.
10906
10907 * data/glr.c (yydestroyStackItem): New function.
10908 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
10909 debugging information. Problem reported by Joel E. Denny.
10910
109112005-08-25 Akim Demaille <akim@epita.fr>
10912
10913 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
10914
109152005-08-24 Paul Eggert <eggert@cs.ucla.edu>
10916
10917 * data/glr.c (yyrecoverSyntaxError, yyreturn):
10918 Don't invoke destructor on unresolved entries.
10919 * tests/glr-regression.at
10920 (User destructor for unresolved GLR semantic value): New test case.
10921 Problem reported by Joel E. Denny in:
10922 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
10923
109242005-08-21 Paul Eggert <eggert@cs.ucla.edu>
10925
10926 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
10927 Add strnlen.c.
10928 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
10929 lib-prefix.m4, po.m4.
10930
10931 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
10932 in yydestruct diagnostic, since it might not be an error.
10933 Problem reported by Joel Denny near end of
10934 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
10935 * data/lalr1.cc (yyerturn): Likewise.
10936 * data/yacc.c (yyreturn): Likewise.
10937 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
10938
10939 * src/files.c: Remove obsolete FIXME comment.
10940
10941 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
10942 with the other templates, and to fix bogus run-on messages such
10943 as the one reported at the end of
10944 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
10945 All callers changed to avoid the newline.
10946 (yyprocessOneStack): Output two lines rather than one, to accommodate
10947 the above change. This changes the debug output format slightly.
10948
10949 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
10950 reported by Joel E. Denny in
10951 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
10952 (trivial change).
10953 * tests/glr-regression.at (Duplicate representation of merged trees):
10954 New test, from Joel E. Denny in:
10955 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
10956 * THANKS: Add Joel E. Denny.
10957
10958 * configure.ac (AC_INIT): Bump to 2.0c.
10959
109602005-07-24 Paul Eggert <eggert@cs.ucla.edu>
10961
10962 * NEWS: Version 2.0b.
10963
10964 * Makefile.am (SUBDIRS): Put examples before tests, so that
10965 "make check" doesn't finish with "All 1 tests passed".
10966
10967 * tests/regression.at (Token definitions): Don't rely on
10968 AT_PARSER_CHECK for data that contains backslashes. It currently
10969 uses 'echo', and 'echo' isn't portable if its argument contains
10970 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
10971 that the byte '\0xff' is not printable in the C locale; it is,
10972 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
10973 not printable, so use '\0x81' to test.
10974
10975 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
10976 version of GCC, since the macro is used with non-GCC compilers.
10977
10978 Fix core dump reported by Pablo De Napoli in
10979 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
10980 * tests/regression.at (Invalid inputs with {}): New test.
10981 * src/parse-gram.y (token_name): Translate type before using
10982 it as an index.
10983
10984 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
10985 the user's name space. All uses changed to __attribute__
10986 ((__unused__)).
10987 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
10988 Add __attribute__ ((__noreturn__)).
10989
10990 * etc/clcommit: Remove. We weren't using it, and it failed
10991 "make maintainer-distcheck".
10992 * Makefile.maint: Merge from coreutils.
10993 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
10994 (syntax-check-rules): Change list of rules as described below.
10995 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
10996 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
10997 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
10998 (sc_trailing_space): New rules.
10999 (sc_xalloc_h_in_src): Remove.
11000 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
11001 (sc_space_tab, sc_error_exit_success, sc_changelog):
11002 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
11003 (makefile-check, po-check, author_mark_check):
11004 (makefile_path_separator_check, copyright-check):
11005 Use grep -n, to make it easier to find violations.
11006 Use CVS_LIST and CVS_LIST_EXCEPT.
11007 (header_regexp, h_re): Remove.
11008 (dd_c): New macro.
11009 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
11010 (my-distcheck): Use more-modern GCC flags.
11011 (signatures, %.asc): Remove.
11012 (rel-files, announcement): Remove signatures.
11013 Restore old updating code, even though we don't use it, so
11014 that we're the same as coreutils.
11015 (alpha, beta, major): Depend on news-date-check.
11016 Make the upload commands.
11017
11018 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
11019 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
11020 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
11021 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
11022 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
11023 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
11024 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
11025 * tests/sets.at: Likewise.
11026
11027 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
11028 we comment out the Autoconf version number.
11029 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
11030 it's error-prone and "make maintainer-distcheck" rejects it.
11031
11032 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
11033 Indent calls to "error" to pacify "make maintainer-distcheck",
11034 when the calls are not intended to be translated.
11035 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
11036
11037 * src/Makefile.am (DEFS): Use +=, to pacify
11038 "make maintainer-distcheck".
11039 (bison_SOURCES): Add scan-skel.h.
11040 (sc_tight_scope): New rule, from coreutils.
11041
11042 * src/files.c (src_extension, header_extension):
11043 Now static, not extern.
11044 * src/getargs.c (short_options): Likewise.
11045 * src/muscle_tab.c (muscle_table): Likewise.
11046 * src/parse-gram.y (current_class, current_type, current_prec):
11047 Likewise.
11048 * src/reader.c (grammar_end, previous_rule_end): Likewise.
11049 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
11050 * src/main.c (main): Cast bindtextdomain and textdomain calls to
11051 void, to avoid warning when NLS is disabled.
11052 * src/output.c: Include scan-skel.h.
11053 (scan_skel): Remove decl, since scan-skel.h does this.
11054 (output_skeleton):
11055 Indent calls to "error" to pacify "make maintainer-distcheck".
11056 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
11057 * src/reader.h (gram_end, gram_lineno): New decls to pacify
11058 "make maintainer-distcheck".
11059 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
11060 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
11061 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
11062 (skel_lex_destroy, scan_skel): Move these decls to...
11063 * src/scan-skel.h: New file.
11064 * src/uniqstr.c (uniqstr_assert):
11065 Indent calls to "error" to pacify "make maintainer-distcheck".
11066
11067 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
11068 not @VAR@.
11069
11070 * tests/torture.at: Revamp to avoid misuse of atoi that
11071 "make maintainer-distcheck" complained about.
11072
11073 * examples/extexi (message): Don't print a message more than once,
11074 and omit line-number decoration that makes Emacs compile think
11075 that informative messages are worth worrying about.
11076
110772005-07-22 Paul Eggert <eggert@cs.ucla.edu>
11078
11079 * configure.ac: Update version number.
11080
11081 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
11082 accidentally.
11083 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
11084 autogenerated by the maintainer.
11085 * examples/calc++/.cvsignore: Add *.yy.
11086
11087 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
11088 * lib/bitset_stats.c (bitset_stats_init): Likewise.
11089 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11090
11091 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
11092
11093 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
11094 from maintainer-distcheck about casting the argument of 'free'.
11095
11096 * NEWS: Mention recent yytname changes.
11097 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
11098
11099 * bootstrap: For translations that have not yet been upgraded to
11100 the new runtime-po domain, prime the pump by extracting the
11101 relevant strings from the obsolete translations. This code can be
11102 removed once the bison-runtime domain has been translated by each
11103 team.
11104
11105 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
11106 now that token names are already quoted.
11107
11108 Fix problem reported by Anthony Heading.
11109 * data/glr.c (YYTOKEN_TABLE): New macro.
11110 (yytname): Define if YYTOKEN_TABLE.
11111 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
11112 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
11113 (YYERROR_VERBOSE): Define the same way the other skeletons do.
11114 * src/output.c (prepare_symbols): Output token_table_flag.
11115
111162005-07-21 Paul Eggert <eggert@cs.ucla.edu>
11117
11118 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
11119 again if the first call fails.
11120
11121 * data/glr.c (yytnamerr): New function.
11122 (yyreportSyntaxError): Use it to dequote most string literals.
11123 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
11124 with other skeletons. All uses changed.
11125 (yytnameerr_): New function.
11126 (yyreport_syntax_error): Use it to dequote most string literals.
11127 * data/yacc.c (yytnamerr): New function.
11128 (yyerrlab): Use it to decode most string literals.
11129 * doc/bison.texinfo (Decl Summary, Calling Convention):
11130 Clarify quoting convention of yytname.
11131 * src/output.c (prepare_symbols): Quote all names. This undoes
11132 the 2005-04-17 change, which is now accomplished (mostly) via
11133 changes in the parsers as described above.
11134 * tests/regression.at (Token definitions, Web2c Actions):
11135 Undo most 2005-04-17 change here, too.
11136
111372005-07-20 Paul Eggert <eggert@cs.ucla.edu>
11138
11139 Fix more problems reported by twlevo@xs4all.nl.
11140 * tests/cxx-type.at: Don't pipe output of ./types through sed to
11141 remove trailing spaces. This loses the exit status of ./types,
11142 and isn't needed since ./types shouldn't be emitting trailing
11143 spaces.
11144 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
11145 as the stack isn't valid in that case.
11146
11147 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
11148 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
11149 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
11150 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
11151 is used.
11152 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
11153 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
11154 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
11155 Likewise.
11156
11157 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
11158 overly-picky compilers that reject 'char *foo = "bar";'.
11159
11160 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
11161 to FILE * parameter, not to stderr. This fixes a typo introduced
11162 in the 2005-07-12 change.
11163
11164 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
11165 warnings from GCC 4.
11166
11167 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
11168 (yyglrShiftDefer, yysplitStack):
11169 Remove unused parameters b4_pure_formals. All uses changed.
11170 (yyglrShift): Remove unused parameters b4_user_formals.
11171 All uses changed.
11172 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
11173
111742005-07-18 Paul Eggert <eggert@cs.ucla.edu>
11175
11176 Destructor cleanups and regularization among the three skeletons.
11177 * NEWS: Document the behavior changes.
11178 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
11179 stack before failing, as the cleanup code will do it for us now.
11180 * data/lalr1.cc (yyerrlab): Likewise.
11181 * data/glr.c (yyparse): Pop everything off the stack before
11182 freeing it, so that destructors get called properly.
11183 * data/lalr1.cc (yyreturn): Likewise.
11184 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
11185 This is more consistent.
11186 * doc/bison.texinfo (Destructor Decl): Mention more reasons
11187 why destructors might be called. 1.875 -> 2.1.
11188 (Destructor Decl, Decl Summary, Table of Symbols):
11189 Some English-language cleanups for %destructor.
11190 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11191 Add output line for destructor of start symbol.
11192 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
11193 because of that same extra output line.
11194
11195 * NEWS: Document minor wording changes in diagnostics of
11196 Bison-generated parsers.
11197 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
11198 Remove unused formals. All uses changed.
11199 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
11200 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
11201 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
11202 Rename yyoverflowab to yyexhaustedlab.
11203 When memory exhaustion occurs during syntax-error reporting,
11204 report it separately rather than in a single diagnostic; this
11205 eases translation.
11206 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
11207 (Memory Exhausted): Renamed from Parser Stack Overflow.
11208 Revamp wording slightly to prefer "memory exhaustion".
11209 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
11210
11211 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
11212
11213 Add i18n support to the GLR skeleton. Partially fix the C++
11214 skeleton; a C++ expert needs to finish this. Remove debugging
11215 msgids; there's little point to having them translated, since they
11216 can be understood only by someone who can read the
11217 (English-language) source code.
11218
11219 Generate runtime-po/bison-runtime.pot automatically, so that we
11220 don't have to worry about garbage getting in that file. We'll
11221 make sure after the next official release that old msgids don't
11222 get lost. See
11223 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
11224
11225 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
11226 Now auto-generated.
11227 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
11228 Fix typos in explanations of the runtime file.
11229 * bootstrap: Change gettext keyword from YYI18N to YY_.
11230 Use standard Makefile.in.in in runtime-po, since we'll arrange
11231 for backward-compatible bison-runtime.po files in a different way.
11232 * data/glr.c (YY_): New macro, from yacc.c.
11233 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
11234 Translate messages intended for users.
11235 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
11236 the wording in the other skeletons. We don't know that the memory
11237 is virtual.
11238 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
11239 Use same method that yacc.c uses.
11240 Don't translate debugging messages.
11241 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
11242 it doesn't work (yet), and requires C++ expertise to fix.
11243 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
11244 Move defn to a more logical place, to be consistent with other
11245 skeletons.
11246 Don't translate debugging messages.
11247 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
11248 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
11249 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
11250 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
11251
11252 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
11253 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
11254 void, not int.
11255 * tests/glr-regression.at (Badly Collapsed GLR States):
11256 Likewise.
11257 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
11258 yylex should return 0 at EOF rather than aborting.
11259
11260 Improve tests for stack overflow in GLR parser.
11261 Problem reported by twlevo@xs4all.nl.
11262 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
11263 All uses removed.
11264 (yyStackOverflow): Just longjmp, but with value 2 so that caller
11265 can handle the problem.
11266 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
11267 (yyparse): New local variable yyresult to record the result.
11268 Use result of setjmp to set it, rather than storing itinto
11269 struct.
11270 (yyDone): Remove label.
11271 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
11272 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
11273 if YYABORT is used).
11274 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
11275 yyparse status; put status > 1 into diagnostic.
11276 Check that status==2 works.
11277 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
11278 Use exit status 3 for failure to open (which shouldn't happen).
11279
112802005-07-17 Paul Eggert <eggert@cs.ucla.edu>
11281
11282 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
11283 1 on syntax error; just let yyparse do its thing.
11284 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
11285 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
11286 (Exploding the Stack Size with Alloca):
11287 (Exploding the Stack Size with Malloc):
11288 Expect exit status 2, not 1, since the parser is supposed to blow
11289 its stack. Problem reported by twlevo@xs4all.nl.
11290
11291 * data/glr.c (yyparse): Don't assume that the initial calls
11292 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
11293 Print a stack-overflow message and fail instead.
11294 Initialize the line-number information before creating the stack,
11295 so that the stack-overflow message can report line zero safely.
11296
112972005-07-14 Paul Eggert <eggert@cs.ucla.edu>
11298
11299 Fix problems reported by twlevo@xs4all.nl.
11300 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
11301 (yyuserMerge): Provide a default case if b4_mergers is empty.
11302 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
11303 * tests/glr-regression.at
11304 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
11305 Add casts to pacify C++ compilers.
11306 * tests/glr-regression.at (Improper merging of GLR delayed action
11307 sets): Declare yylex before using it.
11308 * tests/Makefile.am (maintainer-check-g++): Fix a stray
11309 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
11310 test for valgrind; valgrind is independent of g++.
11311 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
11312 for compatibility with POSIX 1003.1-2001 (if running coreutils).
11313 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
11314 Use a destructor, so that we can expand the stack. Change
11315 YYSTYPE to char * so that we can free it. Cast result of malloc.
11316
113172005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11318
11319 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
11320 a valgrind failure. Problem reported by twlevo@xs4all.nl.
11321
113222005-07-13 Paul Eggert <eggert@cs.ucla.edu>
11323
11324 * PACKAGING: New file, suggested by Bruno Haible and taken from
11325 similar wording in gettext's PACKAGING file.
11326 * NEWS: Mention PACKAGING.
11327 * Makefile.am (EXTRA_DIST): Add PACKAGING.
11328
113292005-07-12 Paul Eggert <eggert@cs.ucla.edu>
11330
11331 * NEWS: Document recent i18n improvements.
11332 * bootstrap: Get runtime translations into runtime-po.
11333 Create runtime-po files automatically, if possible.
11334 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
11335 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
11336 does not infringe on the user's name space.
11337 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
11338 * doc/bison.texinfo (Internationalization): Revamp the English
11339 and Texinfo syntax a bit, to try to make it clearer.
11340 (Bison Options, Option Cross Key): Mention --print-localedir.
11341 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
11342 YYENABLE_NLS. Quote a bit more.
11343 * runtime-po/.cvsignore: New file.
11344 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
11345 * runtime-po/Rules-quot: Remove; now created by bootstrap.
11346 * runtime-po/quot.sed: Likewise.
11347 * runtime-po/boldquot.sed: Likewise.
11348 * runtime-po/en@quot.header: Likewise.
11349 * runtime-po/en@boldquot.header: Likewise.
11350 * runtime-po/insert-header.sin: Likewise.
11351 * runtime-po/remove-potcdate.sin: Likewise.
11352 * runtime-po/Makevars: Likewise.
11353 * runtime-po/LINGUAS: Likewise.
11354 * runtime-po/de.po: Likewise; we will rely on the translation project
11355 to maintain this, so "bootstrap" should get it.
11356 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
11357 its value.
11358 * src/main.c (main): Bind the bison-runtime domain, too.
11359
113602005-07-12 Bruno Haible <bruno@clisp.org>
11361
11362 * data/yacc.c: Include <libintl.h> when NLS is enabled.
11363 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
11364 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
11365 * runtime-po: New directory.
11366 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
11367 $(DOMAIN).pot-update rule, so that old messages are never dropped.
11368 * runtime-po/Rules-quot: New file, copied from po/.
11369 * runtime-po/quot.sed: Likewise.
11370 * runtime-po/boldquot.sed: Likewise.
11371 * runtime-po/en@quot.header: Likewise.
11372 * runtime-po/en@boldquot.header: Likewise.
11373 * runtime-po/insert-header.sin: Likewise.
11374 * runtime-po/remove-potcdate.sin: Likewise.
11375 * runtime-po/Makevars: New file.
11376 * runtime-po/POTFILES.in: New file.
11377 * runtime-po/LINGUAS: New file.
11378 * runtime-po/bison-runtime.pot: New file.
11379 * runtime-po/de.po: New file.
11380 * m4/bison.m4: New file.
11381 * Makefile.am (SUBDIRS): Add runtime-po.
11382 (aclocaldir, aclocal_DATA): New variables.
11383 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
11384 Define aclocaldir.
11385 * src/getargs.c (usage): Document --print-localedir option.
11386 (PRINT_LOCALEDIR_OPTION): New enum item.
11387 (long_options): Add --print-localedir option.
11388 (getargs): Handle --print-localedir option.
11389 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
11390 (Internationalization): New section.
11391
113922005-07-12 Akim Demaille <akim@epita.fr>
11393
11394 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
11395 for consistency with the rest of the code.
11396 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
11397 Add separators.
11398
113992005-07-12 Akim Demaille <akim@epita.fr>
11400
11401 * src/parse-gram.y: Use %printer instead of YYPRINT.
11402
114032005-07-12 Akim Demaille <akim@epita.fr>
11404
11405 * src/symtab.h, src/symtab.c (symbol_print): New.
11406 * src/symlist.h, src/symlist.c (symbol_list_print): New.
11407 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
11408
114092005-07-12 Akim Demaille <akim@epita.fr>
11410
11411 * data/glr.c (b4_syncline): Fix (swap) the definitions of
11412 b4_at_dollar and b4_dollar_dollar.
11413
114142005-07-11 Paul Eggert <eggert@cs.ucla.edu>
11415
11416 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
11417 and Pennello's paper.
11418
114192005-07-09 Paul Eggert <eggert@cs.ucla.edu>
11420
11421 * data/yacc.c (yyparse): Undo previous patch. Instead,
11422 set yylsp[0] and yyvsp[0] only if the initial action
11423 sets yylloc and yylval, respectively.
11424
11425 * data/yacc.c (yyparse): In the initial action, set
11426 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
11427 This avoids the use of undefined variables if the initial
11428 action does not set yylloc and/or yylval.
11429
114302005-07-07 Paul Eggert <eggert@cs.ucla.edu>
11431
11432 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
11433 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
11434 Remove from CVS. These files are automatically generated.
11435 * examples/extexi: Clarify that this file is now part of Bison,
11436 not GNU M4, and that it works with any POSIX-compatible Awk.
11437 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
11438 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
11439 so that we also get calc++-parser.yy. Geneate it.
11440 Use $(AWK), not gawk, since any conforming Awk will do.
11441 Put comment before action, since older 'make' can't handle comment
11442 in action.
11443 $(BUILT_SOURCES): List all built sources, not just some of them.
11444 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
11445 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
11446 $($(calc_sources_generated)): Remove unnecessary test for existence
11447 of target. (This had a shell syntax error anyway; a stray "x".)
11448 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
11449 calc++-parser.yy.
11450 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
11451
11452 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
11453 implied by the other modules.
11454
114552005-07-06 Akim Demaille <akim@epita.fr>
11456
11457 Bind examples/calc++ to the package.
11458 * examples/calc++/Makefile: Remove, replaced by...
11459 * examples/calc++/Makefile.am: ... this new file.
11460 * examples/calc++/test: Remove input.
11461 * examples/calc++/compile: Remove.
11462 * examples/Makefile.am: New.
11463 * configure.ac, Makefile.am: Adjust.
11464 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
11465
114662005-07-05 Paul Eggert <eggert@cs.ucla.edu>
11467
11468 * data/glr.c (yyFail): Drastically simplify; since the format argument
11469 never had any % directives, we can simply pass it to yyerror.
11470 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
11471 be modified later, as that is the usual style in glr.c.
11472 Problems reported by Paul Hilfinger.
11473
11474 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
11475 and size overflow errors.
11476 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
11477 in case the user prolog sets feature-test macros like _GNU_SOURCE.
11478 (YYSIZEMAX): New macro.
11479 (yystpcpy): New function, taken from yacc.c.
11480 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
11481 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
11482 so that we don't have to maintain their signatures.
11483 (yyFail): Check for buffer overflow, by using vsnprintf rather
11484 than vsprintf. Allocate a bigger buffer if possible.
11485 Report an error if buffer allocation fails.
11486 (yyStackOverflow): New function.
11487 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
11488 the initialization was successful. It might fail if storage was
11489 exhausted.
11490 (yyexpandGLRStack): Add more checks for storage allocation failure.
11491 Use yyStackOverflow to report failures.
11492 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
11493 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
11494 Don't assume stack number fits in int.
11495 (yysplitStack): Check for storage allocation failure.
11496 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
11497 can print diagnostics on storage allocation failure. All callers
11498 changed.
11499 (yyresolveValue): Use yybool for boolean.
11500 (yyreportSyntaxError): Check for size-calculation overflow.
11501 This code is taken from yacc.c.
11502 (yyparse): Check for storage allocation errors when allocating
11503 the initial stack.
11504
115052005-07-05 Akim Demaille <akim@epita.fr>
11506
11507 Extract calc++ from the documentation.
11508 * doc/bison.texinfo (Calc++): Add the extraction marks.
11509 * examples/extexi: New, from the aborted GNU Programming 2E.
11510 Separate the different paragraph of a file with empty lines.
11511 * examples/Makefile: Use it to extract the whole calc++ example.
11512
115132005-06-24 Akim Demaille <akim@epita.fr>
11514
11515 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
11516 class typedefs.
11517
115182005-06-22 Akim Demaille <akim@epita.fr>
11519
11520 * doc/bison.texinfo (C++ Language Interface): First stab.
11521 (C++ Parsers): Remove.
11522
115232005-06-22 Akim Demaille <akim@epita.fr>
11524
11525 * data/lalr1.cc (yylex_): Honor %lex-param.
11526
115272005-06-22 Akim Demaille <akim@epita.fr>
11528
11529 Start a set of simple examples.
11530 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
11531 * examples/calc++/calc++-driver.hh,
11532 * examples/calc++/calc++-parser.yy,
11533 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
11534 * examples/calc++/compile, examples/calc++/test: New.
11535
115362005-06-09 Paul Eggert <eggert@cs.ucla.edu>
11537
11538 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
11539 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
11540 which stems from the 2005-05-27 patch.
11541
115422005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11543
11544 * data/glr.c: Modify treatment of unused parameters to permit use
11545 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
11546
115472005-05-30 Paul Eggert <eggert@cs.ucla.edu>
11548
11549 Fix infringement on user name space reported by Janos Zoltan Szabo.
11550 * data/yacc.c (yyparse): strlen -> yystrlen.
11551
115522005-05-30 Akim Demaille <akim@epita.fr>
11553
11554 * data/lalr1.cc (_): New.
11555 Translate the various messages.
11556
115572005-05-27 Paul Eggert <eggert@cs.ucla.edu>
11558
11559 Fix infringement on user name space reported by Bruno Haible.
11560 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
11561 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
11562 the user's name space.
11563 (alloca): Include <stdlib.h> to get it, if it's not built in.
11564 (YYMALLOC, YYFREE): Define only if needed.
11565 (malloc, free): Declare, but only if needed, as this infringes on
11566 the user name space.
11567
115682005-05-25 Paul Eggert <eggert@cs.ucla.edu>
11569
11570 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
11571 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
11572 with %d format.
11573 * lib/ebitset.c (min, max): Undef before defining.
11574 * lib/vbitset.c (min, max): Likewise.
11575 * lib/subpipe.c (create_subpipe): Save local variables in case
11576 vfork clobbers them.
11577
115782005-05-24 Bruno Haible <bruno@clisp.org>
11579
11580 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
11581 error message syntax used by gcc-4.0.
11582
115832005-05-23 Paul Eggert <eggert@cs.ucla.edu>
11584
11585 * README: Mention m4 1.4.3. Remove obsolete advice about
11586 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
11587
11588 * bootstrap: Remove workaround for problem I encountered with
11589 gettext 0.14.1; it seems to be fixed now.
11590
115912005-05-22 Paul Eggert <eggert@cs.ucla.edu>
11592
11593 * NEWS: Version 2.0a.
11594
11595 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
11596 the previous change.
11597
11598 Various maintainer cleanups.
11599 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
11600 conftest*, for benefit of CVS commands run at the same time as
11601 "configure". Add build-aux, since "bootstrap" now creates it and
11602 its subfiles.
11603 * Makefile.cfg (move_if_change): Remove.
11604 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
11605 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
11606 (po_repo, do-po-update, po-update, wget_files, get-targets):
11607 (config.guess-url_prefix, config.sub-url_prefix):
11608 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
11609 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
11610 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
11611 Remove.
11612 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
11613 this is now the recommended name.
11614 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
11615 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
11616 ylwrap. These files now go into build-aux.
11617 * config/move-if-change: Remove.
11618 * config/prev-version.txt: Bump from 1.75 to 2.0.
11619
11620 * bootstrap: Add stdio-safer, unistd-safer modules.
11621 Remove m4/glibc2.m4 (introduced by latest gnulib, but
11622 we don't need it).
11623 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
11624 fopen-safer.c, stdio-safer.h, unistd-safer.h.
11625 * lib/subpipe.c: Include "unistd-safer.h".
11626 (create_subpipe): Make sure all the newly-created
11627 file descriptors are > 2, so that diagnostics don't
11628 get sent down them (which might cause Bison to hang, in theory).
11629 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
11630 * src/files.c (xfopen): Use fopen_safer, not fopen.
11631
11632 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
11633 yesterday's yacc.c fix.
11634
116352005-05-21 Paul Eggert <eggert@cs.ucla.edu>
11636
11637 * data/glr.c, data/lalr1.cc: Update copyright date.
11638
11639 Fix a destructor bug reported by Wolfgang Spraul in
11640 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
11641 * data/yacc.c (yyabortlab): Don't call destructor, and
11642 don't set yychar to EMPTY.
11643 (yyoverflowlab): Don't call destructor.
11644 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
11645 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
11646 since we no longer output the message "discarding lookahead token
11647 end of input ()".
11648
116492005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11650
11651 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
11652 fix a small glitch in debugging output.
11653 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
11654 after YY_SYMBOL_PRINT where needed.
11655
11656 (struct yyGLRState): Add some comments.
11657 (struct yySemanticOption): Add some comments.
11658 (union yyGLRStackItem): Add comment.
11659
11660 (yymergeOptionSets): Correct this to properly perform the union,
11661 avoiding infinite reported by Michael Rosien.
11662 Update comment.
11663
11664 * tests/glr-regression.at: Add test for GLR merging error reported
11665 by M. Rosien.
11666
116672005-05-13 Paul Eggert <eggert@cs.ucla.edu>
11668
11669 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
11670 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
11671 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
11672 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
11673 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
11674 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
11675 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
11676 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
11677 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
11678 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
11679 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
11680 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
11681 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
11682 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
11683 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
11684 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
11685 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
11686 src/derives.h, src/files.c, src/files.h, src/getargs.c,
11687 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
11688 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
11689 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
11690 src/output.h, src/parse-gram.c, src/parse-gram.h,
11691 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
11692 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
11693 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
11694 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
11695 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
11696 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
11697 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
11698 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
11699 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
11700 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
11701 tests/reduce.at, tests/regression.at, tests/sets.at,
11702 tests/synclines.at, tests/testsuite.at, tests/torture.at:
11703 Update FSF postal mail address.
11704
117052005-05-11 Paul Eggert <eggert@cs.ucla.edu>
11706
11707 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
11708 Problem reported by Ralf Menzel.
11709
117102005-05-01 Paul Eggert <eggert@cs.ucla.edu>
11711
11712 * tests/actions.at: Test that stack overflow invokes destructors.
11713 From Marcus Holland-Moritz.
11714 * data/yacc.c (yyerrlab): Move the code that destroys the stack
11715 from here....
11716 (yyreturn): to here. That way, destructors are called properly
11717 even if the stack overflows, or the user calls YYACCEPT or
11718 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
11719 (yyoverflowlab): Destroy the lookahead.
11720
117212005-04-24 Paul Eggert <eggert@cs.ucla.edu>
11722
11723 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
11724
117252005-04-17 Paul Eggert <eggert@cs.ucla.edu>
11726
11727 * NEWS: Bison-generated C parsers no longer quote literal strings
11728 associated with tokens.
11729 * src/output.c (prepare_symbols): Don't escape strings,
11730 since users don't want to see C escapes.
11731 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
11732 in diagnostics.
11733 * tests/input.at (Torturing the Scanner): Likewise.
11734 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
11735
117362005-04-16 Paul Eggert <eggert@cs.ucla.edu>
11737
11738 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
11739 the data size is known to be too small and we can't increase it.
11740 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
11741
117422005-04-15 Paul Eggert <eggert@cs.ucla.edu>
11743
11744 * src/parse-gram.y: Include quotearg.h.
11745 (string_as_id): Quote $1 before using it as a key, since the
11746 lexer no longer quotes it for us.
11747 (string_content): Don't strip quotes, since lexer no longer
11748 quotes it for us.
11749 * src/scan-gram.l: Include quotearg.h.
11750 ("\""): Omit quote.
11751 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
11752 a key, since the rest of the lexer doesn't quote it.
11753 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
11754 * tests/regression.at (Token definitions): Check for backslashes
11755 in token strings.
11756
11757 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
11758 (YYSIZE_T): Define to unsigned long int when using an older compiler.
11759 (yyparse): Revamp code to generate long syntax error message, to
11760 make it easier to translate, and to avoid problems with arithmetic
11761 overflow. Change "virtual memory" to "memory" in diagnostic, since
11762 we don't know whether the memory is virtual.
11763
117642005-04-13 Paul Eggert <eggert@cs.ucla.edu>
11765
11766 * NEWS: Bison-generated C parsers now use the _ macro to
11767 translate strings.
11768 * data/yacc.c (_) [!defined _]: New macro.
11769 All English strings wrapped inside this macro.
11770 * doc/bison.texinfo (Bison Parser): Document _.
11771 * po/POTFILES.in: Include src/parse-gram.c, since it now
11772 includes translateable strings that parse-gram.y doesn't.
11773
117742005-04-12 Paul Eggert <eggert@cs.ucla.edu>
11775
11776 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
11777 reverting the 2004-10-11 change to this function.
11778 (symbol_check_alias_consistency): Don't call symbol_type_set
11779 if the type name is already correct.
11780 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
11781
117822005-03-25 Paul Eggert <eggert@cs.ucla.edu>
11783
11784 * tests/regression.at (Token definitions): Don't use a token named
11785 c, as that generates a "#define c ..." that runs afoul of buggy
11786 stdlib.h that uses the identifier c as a member of struct
11787 drand48_data. Problem reported by Horst Wente.
11788
117892005-03-21 Paul Eggert <eggert@cs.ucla.edu>
11790
11791 * bootstrap: Change translation URL from
11792 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
11793 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
11794 redirection glitches. Problem reported by twlevo@xs4all.nl.
11795
117962005-03-20 Paul Eggert <eggert@cs.ucla.edu>
11797
11798 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
11799 after operands; POSIX says this isn't portable for the c99 command.
11800
118012005-03-18 Paul Eggert <eggert@cs.ucla.edu>
11802
11803 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
11804 immediately if a data overrun has occurred; this may help us track
11805 down what may be a spurious failure on MacOS.
11806
118072005-03-17 Paul Eggert <eggert@cs.ucla.edu>
11808
11809 Respond to problems reported by twlevo@xs4all.nl.
11810
11811 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
11812
11813 * src/vcg.h: Comment fix.
11814 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
11815 (G_CMAX): Change to -1 instead of INT_MAX.
11816
11817 * data/yacc.c (yyparse): Omit spaces before #line.
11818
118192005-03-15 Paul Eggert <eggert@cs.ucla.edu>
11820
11821 * src/tables.c (state_number_to_vector_number): Put it inside an
11822 "#if 0", since it's not currently used. Problem reported by
11823 Roland McGrath.
11824
118252005-03-06 Paul Eggert <eggert@cs.ucla.edu>
11826
11827 * src/output.c (escaped_output): Renamed from
11828 escaped_file_name_output, since we now use it for symbol tags as
11829 well. All uses changed.
11830 (symbol_destructors_output, symbol_printers_output):
11831 Escape symbol tags too.
11832 Problem reported by Matyas Forstner in
11833 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
11834
11835 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
11836 not needed.
11837 * src/output.c (user_actions_output, token_definitions_output,
11838 symbol_destructors_output, symbol_printers_output): Likewise.
11839 * src/reader.c (prologue_augment): Likewise.
11840 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
11841
11842 * src/vcg.c (output_edge): Don't quote linestyle arg.
11843 Problem reported by twlevo@xs4all.nl.
11844
118452005-02-28 Paul Eggert <eggert@cs.ucla.edu>
11846
11847 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
11848 example, reported by Derek M Jones. Also, make the example even
11849 more outrageous, to better illustrate how bad the problem is.
11850
118512005-02-24 Paul Eggert <eggert@cs.ucla.edu>
11852
11853 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
11854 putsym. Typo reported by Sebastian Piping.
11855
118562005-02-23 Paul Eggert <eggert@cs.ucla.edu>
11857
11858 * doc/bison.texinfo (Language and Grammar): some -> same
11859 (Epilogue): int he -> in the
11860 Typos reported by Sebastian Piping via Justin Pence.
11861
118622005-02-07 Paul Eggert <eggert@cs.ucla.edu>
11863
11864 * tests/glr-regression.at (Improper handling of embedded actions
11865 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
11866 embedded actions and $-N in GLR parsers", work around an Autoconf bug
11867 with dollar signs in test names.
11868 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
11869 for a similar reason.
11870
118712005-01-28 Paul Eggert <eggert@cs.ucla.edu>
11872
11873 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
11874 wants to redefine G_VIEW.
11875
118762005-01-27 Paul Eggert <eggert@cs.ucla.edu>
11877
11878 * src/vcg.c (get_view_str): Remove case for normal_view.
11879 Problem reported by twlevo@xs4all.nl.
11880
118812005-01-24 Paul Eggert <eggert@cs.ucla.edu>
11882
11883 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
11884 Problem reported by twlevo@xs4all.nl.
11885
11886 * doc/bison.texinfo: Change @dircategory from "GNU programming
11887 tools" to "Software development". Requested by Richard Stallman
11888 via Karl Berry.
11889
118902005-01-23 Paul Eggert <eggert@cs.ucla.edu>
11891
11892 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
11893 Problem reported by twlevo@xs4all.nl.
11894
118952005-01-21 Paul Eggert <eggert@cs.ucla.edu>
11896
11897 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
11898 keyword; it's not needed with modern compilers, and it doesn't
11899 affect correctness with older compilers. Suggested by
11900 twlevo@xs4all.nl.
11901
119022005-01-17 Paul Eggert <eggert@cs.ucla.edu>
11903
11904 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
11905 gcc -Wswitch-default.
11906 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11907 * data/yacc.c (yyparse): Likewise.
11908
119092005-01-12 Paul Eggert <eggert@cs.ucla.edu>
11910
11911 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
11912 already. Let config.h define any nonstandard values.
11913
119142005-01-10 Paul Eggert <eggert@cs.ucla.edu>
11915
11916 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
11917 for the benefit of slower hosts. Problem reported by
11918 Nelson H. F. Beebe.
11919
119202005-01-07 Paul Eggert <eggert@cs.ucla.edu>
11921
11922 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
11923 being defined and not used.
11924 * data/lalr1.cc (yyparse): Likewise.
11925 Use "if (false)" rather than "if (0)".
11926
119272005-01-05 Paul Eggert <eggert@cs.ucla.edu>
11928
11929 * TODO: Mention that we should allow NUL bytes in tokens.
11930
119312005-01-02 Paul Eggert <eggert@cs.ucla.edu>
11932
11933 * src/scan-skel.l (<<EOF>>): Don't close standard output.
11934 Problem reported by Hans Aberg.
11935
119362005-01-01 Paul Eggert <eggert@cs.ucla.edu>
11937
11938 * src/getargs.c (version): Happy new year; update overall
11939 program copyright date from 2004 to 2005.
11940
11941 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
11942 Problem reported by Hans Aberg.
11943 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
11944 (Output file names.): Add a test for the case when standard output
11945 is closed.
11946
119472004-12-26 Paul Eggert <eggert@cs.ucla.edu>
11948
11949 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
11950 to fix an oversight in the Bison 2.0 manual.
11951
119522004-12-25 Paul Eggert <eggert@cs.ucla.edu>
11953
11954 * NEWS: Version 2.0. Reformat the existing news items since
11955 1.875, so that related items are grouped together.
11956 * configure.ac (AC_INIT): Bump version to 2.0.
11957 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
11958
11959 * tests/torture.at (Exploding the Stack Size with Alloca): Set
11960 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
11961 otherwise, we're not testing alloca. Unfortunately there's no
11962 simple way to consult HAVE_ALLOCA here.
11963
11964 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
11965 for yymsg, too.
11966
11967 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
11968 hand. This avoids a warning about comparing int to size_t when
11969 GCC warnings are enabled.
11970
119712004-12-22 Paul Eggert <eggert@cs.ucla.edu>
11972
11973 * NEWS: Bison-generated parsers no longer default to using the
11974 alloca function (when available) to extend the parser stack, due
11975 to widespread problems in unchecked stack-overflow detection.
11976 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
11977 responsibility to set it to a positive value. This lets the user
11978 specify a value that is not a preprocessor constant.
11979 * data/yacc.c (YYMAXDEPTH): Likewise.
11980 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
11981 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
11982 to be a compile-time constant. However, explain the constraints on it.
11983 Also, explain the constraints on YYINITDEPTH.
11984 (Table of Symbols): Explain that alloca is no longer the default.
11985 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
11986 to 1.
11987
11988 * doc/bison.texinfo (Location Default Action): Mention that n must
11989 be zero when k is zero. Suggested by Frank Heckenbach.
11990
119912004-12-22 Akim Demaille <akim@epita.fr>
11992
11993 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
11994 (parser::state_type, parser::semantic_type, parser::location_type):
11995 Private, not public.
11996 (parser::parse): Return ints, not bool.
11997 Returning a bool introduces a problem: 0 corresponds to false, and
11998 it seems weird to return false on success. Returning true changes
11999 the conventions for yyparse.
12000 Alternatively we could return void and send an exception.
12001 There is no clear consensus (yet?).
12002 (state_stack, semantic_stack, location_stack): Rename as...
12003 (state_stack_type, semantic_stack_type, location_stack_type): these.
12004 Private, not public.
12005 * tests/c++.at: New.
12006 * tests/testsuite.at, tests/Makefile.am: Adjust.
12007
120082004-12-21 Akim Demaille <akim@epita.fr>
12009
12010 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
12011
120122004-12-21 Akim Demaille <akim@epita.fr>
12013
12014 Don't impose std::string for filenames.
12015
12016 * data/lalr1.cc (b4_filename_type): New.
12017 (position::filename): Use it.
12018 (parser.hh): Move the inclusion of stack.hh and location.hh below
12019 the user code, so that needed headers for the filename type can be
12020 included first.
12021 Forward declare them before the user code.
12022 * tests/Makefile.am (check-local, installcheck-local): Pass
12023 TESTSUITEFLAGS to the TESTSUITE.
12024
120252004-12-20 Akim Demaille <akim@epita.fr>
12026
12027 Use more STL like names: my_class instead of MyClass.
12028
12029 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
12030 (SemanticStack, SemanticType, StateStack, StateType)
12031 (TokenNumberType, Stack, Slice, Traits, Parser::location)
12032 (Parser::value): Rename as...
12033 (location_stack, location_type, rhs_number_type, semantic_stack)
12034 (semantic_type, state_stack, state_type, token_number_type, stack)
12035 (slice, traits, parser::yylloc, parser::yylval): these.
12036
12037 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
12038
120392004-12-19 Paul Eggert <eggert@cs.ucla.edu>
12040
12041 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
12042 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12043
120442004-12-17 Paul Eggert <eggert@cs.ucla.edu>
12045
12046 Remove uses of 'short int' and 'unsigned short int'. This raises
12047 some arbitrary limits. It uses more memory but nowadays that's
12048 not much of an issue.
12049
12050 This change does not affect the generated parsers; that's a different
12051 task, as some users will want to conserve memory there.
12052
12053 Ideally we should use size_t to represent all object counts, and
12054 something like ptrdiff_t to represent signed differences of object
12055 counts; but that will require more code-cleanup than I have the
12056 time to do right now.
12057
12058 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
12059 Use size_t, not int or short int, to count objects.
12060 * src/closure.c (nritemset, closure): Likewise.
12061 * src/closure.h (nritemset, closure): Likewise.
12062 * src/nullable.c (nullable_compute): Likewise.
12063 * src/print.c (print_core): Likewise.
12064 * src/print_graph.c (print_core): Likewise.
12065 * src/state.c (state_compare, state_hash): Likewise.
12066 * src/state.h (struct state): Likewise.
12067 * src/tables.c (default_goto, goto_actions): Likewise.
12068
12069 * src/gram.h (rule_number, rule): Use int, not short int.
12070 * src/output.c (prepare_rules): Likewise.
12071 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
12072 errs, reductions): Likewise.
12073 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
12074 Likewise.
12075 * src/tables.c (vector_number, tally, action_number,
12076 ACTION_NUMBER_MINIMUM): Likewise.
12077 * src/output.c (muscle_insert_short_int_table): Remove.
12078
120792004-12-17 Akim Demaille <akim@epita.fr>
12080
12081 * data/lalr1.cc: Extensive Doxygenation.
12082 (error_): Rename as...
12083 (error): this, since it is visible to the user.
12084 Adjust callers.
12085 (Parser::message): Now an automatic variable from...
12086 (Parser::yyreport_syntax_error_): here.
12087 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
12088 Parser::error.
12089 * tests/input.at: Escape $.
12090
120912004-12-16 Paul Eggert <eggert@cs.ucla.edu>
12092
12093 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
12094 Parenthesize rhs to avoid obscure problems with mistakes like
12095 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
12096 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12097 b4_rhs_location): Likewise.
12098 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12099 b4_rhs_location): Likewise.
12100
121012004-12-16 Akim Demaille <akim@epita.fr>
12102
12103 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
12104 yacc.c: be sure to stay within yycheck_.
12105 * tests/actions.at: Re-enable C++ tests.
12106
121072004-12-16 Akim Demaille <akim@epita.fr>
12108
12109 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
12110 real.
12111
121122004-12-16 Akim Demaille <akim@epita.fr>
12113
12114 Use #define to handle the %name-prefix.
12115
12116 * data/glr.c, data/yacc.c: Comment changes.
12117 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
12118 so that one can refer to yylex in the parser file, and have it
12119 renamed, as is the case with other skeletons.
12120
121212004-12-16 Akim Demaille <akim@epita.fr>
12122
12123 Move lalr1.cc internals into yy*.
12124
12125 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
12126 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
12127 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
12128 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
12129 (empty_, final_, terror_, errcode_, ntokens_)
12130 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
12131 (looka_, ilooka_, error_range_, nerrs_):
12132 Rename as...
12133 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
12134 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
12135 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
12136 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
12137 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
12138 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
12139 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
12140 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
12141 these.
12142
121432004-12-15 Paul Eggert <eggert@cs.ucla.edu>
12144
12145 Fix some problems reported by twlevo at xs4all.
12146 * src/symtab.c (symbol_new): Report an error if the input grammar
12147 contains too many symbols. This is better than calling abort() later.
12148 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
12149 (struct node, struct graph):
12150 Rename member expand to stretch. All uses changed.
12151 (struct graph): Remove member layoutalgorithm. All uses removed.
12152 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
12153 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
12154 All uses changed.
12155 (N_STRETCH): Rename from N_EXPAND. All uses changed.
12156
121572004-12-15 Akim Demaille <akim@epita.fr>
12158
12159 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
12160 Add more Doxygen comments.
12161 (symprint_, stack_print_, reduce_print_, destruct_, pop)
12162 (report_syntax_error_, translate_): Rename as...
12163 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
12164 (yypop_, yyreport_syntax_error_, yytranslate_): this.
12165
121662004-12-15 Akim Demaille <akim@epita.fr>
12167
12168 * data/lalr1.cc (lex_): Rename as...
12169 (yylex_): this.
12170 Move the trace here.
12171 Take the %name-prefix into account.
12172 Reported by Alexandre Duret-Lutz.
12173
121742004-12-15 Akim Demaille <akim@epita.fr>
12175
12176 Simplify the C++ parser constructor.
12177
12178 * data/lalr1.cc (debug_): Rename as...
12179 (yydebug_): so that the parser's internals are always in the yy*
12180 pseudo namespace.
12181 Adjust uses.
12182 (b4_parse_param_decl): Remove the leading comma as it is now only
12183 called as unique argument list.
12184 (Parser::Parser): Remove the constructor accepting a location and
12185 an initial debugging level.
12186 Remove from the other ctor the argument for the debugging level.
12187 (debug_level_type, debug_level, set_debug_level): New.
12188
12189 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
12190 constructor calls.
12191
121922004-12-15 Akim Demaille <akim@epita.fr>
12193
12194 Remove b4_root related material: failure experiment
12195 (which goal was to allow to derive from a class).
12196
12197 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
12198 definitions and uses.
12199
122002004-12-14 Paul Eggert <eggert@cs.ucla.edu>
12201
12202 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
12203 not 2, since it's not portable to subtract 1 from the start of an
12204 array. The new item 0 is never set or used. All uses changed.
12205
12206 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
12207 the default definition of YYLLOC_DEFAULT. Problem reported
12208 by Frank Heckenbach.
12209
122102004-12-12 Paul Eggert <eggert@cs.ucla.edu>
12211
12212 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
12213 the normal case and one for the error case. Just use the
12214 first one uniformly. Problem reported by Frank Heckenbach.
12215 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
12216 use exactly the same macro in both places.
12217 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
12218 so that the normal-case YYRHSLOC works for the error case too.
12219 All uses changed.
12220 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
12221 (YYLLOC_DEFAULT): Use the same macro as glr.c.
12222 * doc/bison.texinfo (Location Default Action): Don't claim that
12223 we have an array of locations. Use the same macro for both glr
12224 and lalr parsers. Mention YYRHSLOC. Mention what happens when
12225 the index is 0.
12226
122272004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12228
12229 * HACKING: Update email addresses to send announcements to.
12230
12231 * configure.ac (AC_INIT): Bump version to 1.875f.
12232
122332004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12234
12235 * NEWS: Version 1.875e.
12236 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
12237
12238 * src/scan-skel.l: Include "complain.h", for "fatal".
12239
12240 * src/relation.h (relation_print, relation_digraph):
12241 Relation sizes are of type relation_node, not size_t (this is
12242 merely a doc fix, since the two types are equivalent).
12243 (relation_transpose): Relation sizes are of type relation_node,
12244 not int.
12245 * src/relation.c: Likewise.
12246 (top, infinity): Now of type relation_node, not int.
12247 (traverse, relation_transpose): Use relation_node, not int.
12248
12249 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
12250 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
12251 (yyparse): Remove unused local introduced in 2004-10-25 patch.
12252
12253 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
12254 specifying whether the test should be skipped. Use it tp
12255 specify that the [%defines %skeleton "lalr1.cc"] tests currently
12256 fail on some hosts, and should be skipped.
12257
122582004-12-08 Paul Eggert <eggert@cs.ucla.edu>
12259
12260 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
12261 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
12262 unless otherwise specified below.
12263
12264 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
12265 to allocate kernel_base, kernel_items, kernel_size, since
12266 they needn't be initialized to 0.
12267 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
12268 * src/closure.c (new_closure): Likewise, for itemset.
12269 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
12270 * src/lalr.c (set_goto_map): Likewise, for temp_map.
12271 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
12272 (build_relations): Likewise for edge, states1, includes.
12273 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
12274 * src/reader.c (packgram): Likewise, for ritem, rules.
12275 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
12276 * src/relation.c (relation_digraph): Likewise for VERTICES.
12277 (relation_transpose): Likewise for new_R, end_R.
12278 * src/symtab.c (symbols_token_translations_init): Likewise for
12279 token_translations.
12280 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
12281 (token_actions): Likewise for yydefact, actrow, conflrow,
12282 conflict_list.
12283 (save_column): Likewise for froms[symno], tos[symno].
12284 (goto_actions): Likewise for state_count.
12285 (pack_table): Likewise for base, pos, check.
12286 (tables_generate): Likewise for width.
12287
12288 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
12289 for initial core. Just have a separate core, so we needn't worry
12290 about whether kernel_size and kernel_base are initialized.
12291
12292 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
12293 kernel_size, kernel_items): Remove unnecessary initialization.
12294 * src/conflicts.c (conflicts): Likewise.
12295 * src/derives.c (derives): Likewise.
12296 * src/muscle_tablc (muscle_insert): Likewise.
12297 * src/relation.c (relation_digraph): Likewise.
12298 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
12299 conflrow, conflict_table, conflict_list, table, check):
12300 Likewise.
12301
12302 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
12303 This is because all callers pass unsigned int.
12304 * src/closure.h (new_closure): Likewise.
12305
12306 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
12307 (build_relations): Initialize includes[i] in all cases.
12308 * src/reader.c (packgram): Always initialize rules[ruleno].prec
12309 and rules[ruleno].precsym. Initialize members in order.
12310 * src/relation.c (relation_transpose): Always initialize new_R[i]
12311 and end_R[i].
12312 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
12313
12314 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
12315 conflict_list[0] was always 0, but now it isn't initialized.
12316
12317 * src/table.c (table_grow): When conflict_table grew, the grown
12318 area wasn't cleared. Fix this.
12319
12320 * lib/.cvsignore: Add strdup.c, strdup.h.
12321 * m4/.cvsignore: Add strdup.m4.
12322
123232004-12-07 Paul Eggert <eggert@cs.ucla.edu>
12324
12325 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
12326 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
12327 GOTO_NUMBER_MAXIMUM, since we occasionally compute
12328 ngotos + 1 without checking for overflow.
12329 (build_relations): Use END_NODE, not -1, to denote end of edges.
12330 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
12331 build_relations): Use goto_number, not int, for goto numbers.
12332 * src/tables.c (save_column, default_goto): Likewise.
12333
123342004-11-23 Akim Demaille <akim@epita.fr>
12335
12336 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
12337 of #defining from yystype.
12338 Don't typedef yystype, C++ does not need it.
12339 This lets it possible to forward declare it as union.
12340
123412004-11-23 Paul Eggert <eggert@cs.ucla.edu>
12342
12343 * bootstrap (gnulib_modules): Add extensions.
12344 Problem reported by Jim Meyering.
12345
123462004-11-22 Paul Eggert <eggert@cs.ucla.edu>
12347
12348 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
12349 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
12350 src/system.h, src/tables.c: XFREE -> free, to accommodate
12351 recent change to gnulib xalloc.h.
12352 Problem reported by Jim Meyering.
12353
123542004-11-17 Akim Demaille <akim@epita.fr>
12355
12356 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
12357
123582004-11-17 Akim Demaille <akim@epita.fr>,
12359 Alexandre Duret-Lutz <adl@gnu.org>
12360
12361 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
12362 changes.
12363 (YYCDEBUG): Adjust.
12364 Use it instead of cdebug_.
12365 (Parser::debug_stream, Parser::set_debug_stream): New.
12366 (Parser::symprint_): Define cdebug_ for temporary backward
12367 compatibility.
12368 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
12369 debug_stream ().
12370
123712004-11-17 Akim Demaille <akim@epita.fr>
12372
12373 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
12374 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
12375 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
12376 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12377
123782004-10-27 Paul Eggert <eggert@cs.ucla.edu>
12379
12380 * data/glr.c (yyloc_default): Remove; not used.
12381 Problem reported by Frank Heckenbach.
12382
123832004-10-25 Akim Demaille <akim@epita.fr>
12384
12385 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
12386 Introduce another definition to address simple location arrays.
12387 (yyGLRStack): New member: yyerror_range.
12388 (yyrecoverSyntaxError, yyparse): Update it.
12389 (yyrecoverSyntaxError): Use it when shifting the error token to
12390 have an accurate range, equivalent to the one computed by both
12391 yacc.c and lalr1.cc.
12392 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
12393 that column numbers start at column 0, as per GNU Coding
12394 Standards, the others tests, and the doc.
12395 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
12396 Adjust to the above change (first column is 0).
12397 And adjust the location of the "<error>", now covering the whole
12398 line.
12399
124002004-10-22 Akim Demaille <akim@epita.fr>
12401 and Paul Eggert <eggert@cs.ucla.edu>
12402
12403 Remove some arbitrary limits on goto numbers and relations.
12404 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
12405 initial values, since they're never used.
12406 (set_goto_map): ngotos is now unsigned, so test for overflow
12407 by seeing whether it wraps around to zero.
12408 * src/lalr.h (goto_number): Now size_t, not short int.
12409 (GOTO_NUMBER_MAXIMUM): Remove.
12410 * src/relation.c (relation_print, traverse, relation_transpose):
12411 Check for END_NODE rather than looking at sign.
12412 * src/relation.h (END_NODE): New macro.
12413 (relation_node): Now size_t, not short int.
12414
124152004-10-22 Paul Eggert <eggert@cs.ucla.edu>
12416
12417 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
12418 keyword, not an identifier. Problem reported by Baron Schwartz in
12419 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
12420
124212004-10-11 Akim Demaille <akim@epita.fr>
12422
12423 * src/symtab.c (symbol_check_alias_consistency): Also check
12424 type names, destructors, and printers.
12425 Reported by Alexandre Duret-Lutz.
12426 Recode the handling of associativity and precedence in terms
12427 of symbol_precedence_set.
12428 Accept no redeclaration at all, not even equal to the previous
12429 value.
12430 (redeclaration): New.
12431 Use it to factor redeclaration complaints.
12432 (symbol_make_alias): Don't set the type of the alias, let
12433 symbol_check_alias_consistency do it as for other features.
12434 * src/symtab.h (symbol): Add new member prec_location, and
12435 type_location.
12436 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
12437 * tests/input.at (Incompatible Aliases): New.
12438
124392004-10-09 Paul Eggert <eggert@cs.ucla.edu>
12440
12441 .cvsignore fixes to accommodate gnulib changes,
12442 and the practice of naming build directories "_build".
12443 * .cvsignore: Add "_*". Sort.
12444 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
12445 * m4/.cvsignore: Add "*_gl.m4".
12446
124472004-10-06 Akim Demaille <akim@epita.fr>
12448
12449 * src/parse-gram.y (add_param): Fix the truncation of trailing
12450 spaces.
12451
124522004-10-05 Akim Demaille <akim@epita.fr>
12453
12454 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
12455 whether the reducion was empty or not. This leaves room to
12456 improve the use of YYLLOC_DEFAULT in such a case.
12457 lalr1.cc is still experimental, so changing this is acceptable.
12458 And finally, there are probably not many users who changed the
12459 handling of locations in GLR, so changing is admissible too.
12460
12461 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
12462 empty reduction, set @$ to an empty location ending the previously
12463 stacked symbol.
12464 Adjust uses to make sure the code is triggered on empty
12465 reductions.
12466 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
12467 expected output: empty reductions have empty locations.
12468
124692004-09-29 Akim Demaille <akim@epita.fr>
12470
12471 * data/lalr1.cc: Move towards a more standard C++ coding style
12472 for templates: Class < T > -> Class<T>.
12473
124742004-09-29 Akim Demaille <akim@epita.fr>
12475
12476 * data/lalr1.cc: Reinstall the former ctor, for sake of
12477 compatibility, but warn it will be removed.
12478 Move towards a more standard C++ coding style (i.e., type *var ->
12479 type* var).
12480
124812004-09-27 Paul Eggert <eggert@cs.ucla.edu>
12482
12483 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
12484 since it's less likely to work if NULs are involved in the future.
12485
124862004-09-27 Akim Demaille <akim@epita.fr>
12487
12488 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
12489
124902004-09-27 Akim Demaille <akim@epita.fr>
12491
12492 * data/lalr1.cc (b4_parse_param_decl_1): New.
12493 (b4_parse_param_decl): Use it to have different names between attribute
12494 and argument names.
12495 (b4_cc_constructor_call): Likewise.
12496
124972004-09-24 Akim Demaille <akim@epita.fr>
12498
12499 * src/parse-gram.y (add_param): Strip the leading and trailing
12500 blanks from a formal argument declaration.
12501 (YY_LOCATION_PRINT): New.
12502
125032004-09-24 Akim Demaille <akim@epita.fr>
12504
12505 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
12506 after the location.
12507
125082004-09-24 Akim Demaille <akim@epita.fr>
12509
12510 * doc/bison.texinfo (Table of Symbols): Sort.
12511
125122004-09-21 Akim Demaille <akim@epita.fr>
12513
12514 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
12515 the useless parentheses.
12516 Suggested by Paul Eggert.
12517
125182004-09-20 Akim Demaille <akim@epita.fr>
12519
12520 Let the initial-action act on the look-ahead, and use it for the
12521 "initial push" (corresponding to an hypothetical beginning-of-file).
12522 And let lalr1.cc honor %initial-action.
12523
12524 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
12525 example.
12526 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
12527 (Parser::Parser): Remove the ctor that used to initialize it.
12528 (Parser::parse): Like in the other skeletons, issue the "starting
12529 parse" message before any action.
12530 Honor %initial-action.
12531 Initialize the stacks with the lookahead.
12532 * data/yacc.c: Let $$ and @$ in %initial-action designate the
12533 look-ahead.
12534 Push them in the stacks.
12535 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
12536
125372004-09-20 Akim Demaille <akim@epita.fr>
12538
12539 * doc/bison.texinfo (Initial Action Decl): New.
12540
125412004-09-20 Akim Demaille <akim@epita.fr>
12542
12543 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
12544 clearer criterion to define it.
12545 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
12546 When reducing on an empty RHS, use the latest stacked location as
12547 location.
12548 yylloc is not always available.
12549 * data/glr.c: Likewise.
12550 Also, honor initial-actions.
12551
125522004-09-20 Akim Demaille <akim@epita.fr>
12553
12554 * data/yacc.c (YY_LOCATION_PRINT): New.
12555 Define when we know YYLTYPE's structure, i.e., when the default
12556 YYLLOC_DEFAULT is used.
12557 * data/c.m4 (b4_yysymprint_generate): Use it.
12558 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
12559 value of the result.
12560 (error_start_): Replace with...
12561 (error_range_): this location array.
12562 This allows to replace code relying on the implementation of
12563 locations by portable code.
12564 * data/yacc.c (yylerrsp): Replace with...
12565 (yyerror_range): this.
12566 Every time a token is popped, update yyerror_range[0], to have an
12567 accurate location for the error token.
12568 * data/glr.c (YY_LOCATION_PRINT): New.
12569 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
12570 deference a pointer.
12571 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
12572 report the location in %printers.
12573
12574 * src/scan-skel.l: Instead of abort, report error messages to ease
12575 understanding skeleton scanning failures.
12576
125772004-09-16 Akim Demaille <akim@epita.fr>
12578
12579 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
12580 (iterator, const_iterator): these, to be more in the C++ spirit.
12581 Also, return reverse iterators so that when displaying the stack
12582 we display its bottom first.
12583 (Parser::stack_print_, Parser::reduce_print_): Match the messages
12584 from yacc.c.
12585 We should probably use vector here though.
12586
125872004-09-16 Akim Demaille <akim@epita.fr>
12588
12589 Have more complete shift traces.
12590
12591 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
12592 to report Shifts instead of ad hoc YYDPRINTF invocations,
12593 including for the error token.
12594 * data/lalr1.cc (symprint_): Output the location.
12595 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
12596 output the location within the %printer.
12597 Activate GLR tests, at least to make sure they compile properly.
12598 They still don't pass though.
12599 * tests/calc.at: Adjust expect verbose output, since now "Entering
12600 state..." is on a different line than the "Shifting" message.
12601
126022004-09-08 Akim Demaille <akim@epita.fr>
12603
12604 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
12605 Bison directive from the Bison file to the invocation of this
12606 macro, so that these directives are passed to
12607 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
12608 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
12609 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
12610 the extra Bison directives instead of the whole series.
12611 Change the grammar so that there are recoverable errors, and
12612 unrecoverable errors. Now we can have the parser give up before
12613 consuming the whole input. As a result we now can observe that
12614 the lookahead is freed when needed.
12615 Change the parser source to parse argv[1] instead of a hard coded
12616 string.
12617 Simplify yylex, and give a value and location to EOF.
12618 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
12619 passed directives already coded in the file.
12620 Add some tests to check the location of "error".
12621 For some tests, the C++ parser is correct, and not yacc.c.
12622 For other tests, they provide different, but unsatisfying, values,
12623 so keep the C++ value so that at least one parser is "correct"
12624 according to the test suite.
12625 (Actions after errors): Remove, this is subsumed by the
12626 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
12627
126282004-09-06 Akim Demaille <akim@epita.fr>
12629
12630 * data/lalr1.cc: Adjust the indentation of the labels.
12631 (Parser::pop): New.
12632 Use it.
12633
126342004-09-06 Akim Demaille <akim@epita.fr>
12635
12636 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
12637 argument, an informative message.
12638 Call YY_SYMBOL_PRINT.
12639 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
12640 * data/lalr1.cc (destruct_): Likewise.
12641 In addition, no longer depend on b4_yysymprint_generate and
12642 b4_yydestruct_generate to generate these functions, do it "by
12643 hand".
12644
126452004-09-03 Akim Demaille <akim@epita.fr>
12646
12647 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
12648 invoked, yydestruct the lookahead.
12649 * tests/calc.at (Calculator $1): Update the expected lengths of
12650 traces: there is an added line for the discarded lookahead.
12651 * doc/bison.texinfo (Destructor Decl): Some rewording.
12652 Define "discarded" symbols.
12653
126542004-09-02 Akim Demaille <akim@epita.fr>
12655
12656 * data/lalr1.cc (translate_, destruct_): No reason to be static.
12657
126582004-09-02 Akim Demaille <akim@epita.fr>
12659
12660 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
12661 (YYDSYMPRINTF): Rename as...
12662 (YY_SYMBOL_PRINT): this.
12663 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
12664 two.
12665 Use it instead of direct symprint_ calls.
12666 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
12667 one.
12668
126692004-09-02 Akim Demaille <akim@epita.fr>
12670
12671 * data/lalr1.cc (b4_yysymprint_generate): New.
12672 (symprint_): New member function, defined when YYDEBUG.
12673 Use it consistently instead of token/nterm debugging output by
12674 hand.
12675 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
12676 %printer calls to use cdebug_ when using lalr1.cc.
12677
126782004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
12679
12680 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
12681 with #ifdef YYDEBUG.
12682
126832004-08-26 Akim Demaille <akim@epita.fr>
12684
12685 * doc/bison.texinfo (Implementing Loops): Rename as...
12686 (Implementing Gotos/Loops): this.
12687
126882004-08-13 Paul Eggert <eggert@cs.ucla.edu>
12689
12690 Adjust to latest gnulib.
12691 * bootstrap (gnulib_modules): Add xalloc-die.
12692 Set LC_ALL=C so that file names sort consistently.
12693 Prefer the gnulib copies of gettext.m4, glibc21.m4,
12694 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
12695 uintmax_t.m4, ulonglong.m4.
12696 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
12697 po.m4 since we are now using _gl.m4 instead.
12698
126992004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
12700
12701 * src/scan-action.l: Remove. Scanning of semantic actions is
12702 handled in scan-gram.l.
12703
127042004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
12705
12706 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
12707
12708 * src/location.h (struct): The file member is a uniqstr.
12709 (equal_boundaries): Use UNIQSTR_EQ for comparison.
12710
127112004-07-22 Paul Eggert <eggert@cs.ucla.edu>
12712
12713 Fix bug with non-%union parsers that have printers or destructors,
12714 which led to a Bison core dump. Reported by Peter Fales in
12715 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
12716
12717 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
12718 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
12719 not to our own type.
12720 * src/output.c (symbol_destructors_output, symbol_printers_output):
12721 Don't assume %union.
12722 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
12723 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
12724 UNION-FLAG. All callers changed.
12725 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
12726 Use type char, not unsigned int, when declaring an array of char;
12727 this lets us remove a cast.
12728 (Printers and Destructors): Add non-%union test cases.
12729
127302004-06-21 Paul Eggert <eggert@cs.ucla.edu>
12731
12732 * doc/bison.texinfo: Minor editorial changes, mostly to the new
12733 GLR writeups. E.g., avoid frenchspacing and the future tense,
12734 change "lookahead" to "look-ahead", and change "wrt" to "with
12735 respect to".
12736
127372004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12738
12739 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
12740 New sections, split off from the GLR Parsers section. Put the new
12741 Simple GLR Parser near the start of the GLR section, for clarity.
12742 Rewrite connective text.
12743
127442004-06-21 Frank Heckenbach <frank@g-n-u.de>
12745
12746 * doc/bison.texinfo (Simple GLR Parsers): New section.
12747
127482004-06-21 Paul Eggert <eggert@cs.ucla.edu>
12749
12750 * NEWS, TODO, doc/bison.texinfo:
12751 Use "look-ahead" instead of "lookahead", to be consistent.
12752 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
12753 while we're fixing "look-ahead".
12754 * src/conflicts.c (shift_set): Renamed from shiftset.
12755 (look_ahead_set): Renamed from lookaheadset.
12756 * src/print.c: Likewise.
12757 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
12758 name for "lookahead".
12759 (report_types, usage): Likewise.
12760 * src/getargs.h (report_look_ahead_tokens): Renamed from
12761 report_lookaheads.
12762 * src/lalr.c (compute_look_ahead_tokens): Renamed from
12763 compute_lookaheads.
12764 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
12765 (look_ahead_tokens_print): Renamed from lookaheads_print.
12766 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
12767 state_rule_lookaheads_print.
12768 * src/state.h: Likewise.
12769 (reductions.look_ahead_tokens): Renamed from lookaheads.
12770 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
12771 AT_DATA_LOOKAHEADS_GRAMMAR.
12772
127732004-06-03 Paul Eggert <eggert@cs.ucla.edu>
12774
12775 * README: Update location of patched M4 distribution.
12776
127772004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
12778
12779 Don't assume the C++ compiler takes the same arguments as the C compiler
12780 (trivial change).
12781 * configure.ac (O0CXXFLAGS): New var.
12782 * tests/atlocal.in (CXXFLAGS): Use it.
12783
127842004-05-29 Paul Eggert <eggert@cs.ucla.edu>
12785
12786 Fix some "make check" problems with C++ reported by
12787 Albert Chin-A-Young for Tru64 C++ in this thread:
12788 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
12789
12790 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
12791 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12792 Output to a .cc file for C++, not to a .c file.
12793 * tests/calc.at (AT_CHECK_CALC): Likewise.
12794 * tests/regression.at (AT_CHECK_DANCER): Likewise.
12795 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
12796
127972004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
12798
12799 * tests/calc.at, tests/actions.at: Workaround for SGI
12800 C++ compiler. (trivial change)
12801
128022004-05-27 Paul Eggert <eggert@cs.ucla.edu>
12803
12804 Spent a few hours checking out which prerequisite versions the
12805 current sources actually require. I went all the way back to
12806 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
12807 a seemingly endless set of combinations of versions more recent
12808 than that. The bottom line is that the current sources require
12809 fairly recent versions of the build tools, and it'll be some work
12810 to change this.
12811 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
12812 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
12813 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
12814 Add comments explaining why those particular versions are
12815 currently needed.
12816
12817 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
12818 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
12819 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
12820
12821 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
12822 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
12823
128242004-05-26 Paul Eggert <eggert@cs.ucla.edu>
12825
12826 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
12827 0.11.5. Suggested by Bruno Haible.
12828 * bootstrap: Remove gettext version checking.
12829
12830 * doc/bison.texinfo (Decl Summary): Also mention that %union
12831 can depend on prerequisite types. Problem reported by Tim
12832 Van Holder.
12833
128342004-05-25 Paul Eggert <eggert@cs.ucla.edu>
12835
12836 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
12837 * README-alpha: Don't tell people not to package this.
12838
12839 * bootstrap: Don't assume $(...) works; use `...` instead.
12840 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
12841 gettext better.
12842
12843 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
12844 put into the -d output file, and mention what to do if YYSTYPE is
12845 defined as a macro.
12846
128472004-05-24 Paul Eggert <eggert@cs.ucla.edu>
12848
12849 Undo change made earlier today: it caused autopoint to not bring
12850 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
12851 autopoint's.
12852
12853 * bootstrap: Check that gettext version matches what's in
12854 configure.ac. Warn users to ignore robots.txt ERROR 404.
12855 * bootstrap: Undo today's earlier change (logged below).
12856 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
12857
12858 The gettext version checking is causing more trouble than it's
12859 curing; remove it. Problem reported by Paul Hilfinger.
12860
12861 * bootstrap: Issue a warning that one can expect a message
12862 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
12863 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
12864
128652004-05-23 Paul Eggert <eggert@cs.ucla.edu>
12866
12867 Ensure that the C++ compiler used for testing actually works on a
12868 simple test program; if not, skip the C++-related tests. Problem
12869 reported by Vin Shelton in:
12870 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
12871
12872 * m4/cxx.m4: New file.
12873 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
12874 * tests/atlocal.in (BISON_CXX_WORKS): Add.
12875 * tests/local.at (AT_COMPILE_CXX): Use it.
12876
128772004-05-21 Paul Eggert <eggert@cs.ucla.edu>
12878
12879 * data/glr.c (yylloc): Output this macro even if locations are not
12880 being generated, as the GLR parser needs it even in that case.
12881 Problem reported by Troy A. Johnson
12882 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
12883
12884 * configure.ac (AC_INIT): Update to 1.875e.
12885
128862004-05-21 Paul Eggert <eggert@cs.ucla.edu>
12887
12888 * NEWS: Version 1.875d.
12889 * configure.ac (AC_INIT): Likewise.
12890 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
12891
12892 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
12893 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
12894 lalr1.cc runs afoul of the first, and the last two are no longer
12895 supported by GCC 3.4.0.
12896 * README: Mention GNU m4 1.4 or later; mention m4 patches.
12897 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
12898
128992004-05-06 Paul Eggert <eggert@cs.ucla.edu>
12900
12901 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
12902 unsigned int, for compatibility with latest gnulib hash module.
12903 * src/state.c (state_hash, state_hasher): Likewise.
12904 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
12905 * src/uniqstr.c (hash_uniqstr): Likewise.
12906
129072004-05-03 Paul Eggert <eggert@cs.ucla.edu>
12908
12909 * NEWS: Unescaped newlines are no longer allowed in char & strings.
12910
12911 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
12912 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
12913 character and string literals.
12914 (unexpected_end): New function.
12915 (unexpected_eof): Use it.
12916 (unexpected_newline): New function.
12917 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
12918 actions.
12919
12920 * NEWS: Document %expect-rr.
12921
12922 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
12923 Fix typo by replacing $1 with $option.
12924 Remove more 'intl'-related files.
12925 Don't DEFUN AM_INTL_SUBDIR twice.
12926
12927 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
12928 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
12929 strtoul.c.
12930 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
12931 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
12932 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
12933 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
12934 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
12935 * src/.cvsignore: Add *.output.
12936
12937 * src/parse-gram.y: Put copyright notice inside %{ %} so it
12938 gets copied to the output file.
12939
129402004-04-28 Paul Eggert <eggert@twinsun.com>
12941
12942 Get files from the gnulib and po repositories, instead of relying
12943 on them being in our CVS. Upgrade to latest versions of gnulib
12944 and Automake.
12945
12946 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
12947 * bootstrap: Bootstrap from gnulib and po repositories.
12948 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
12949 * README-cvs: Document these changes. Remove version numbers from
12950 mentions of build tools, since they change so often. Mention Flex.
12951
12952 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
12953 (gl_USE_SYSTEM_EXTENSIONS): Add.
12954 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
12955 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
12956 does this for us.
12957 (AC_ISC_POSIX): Remove; we no longer support this
12958 ancient OS, as it gets in the way of latest Autoconf & gnulib.
12959 (AC_HEADER_STDC): Remove: we now assume C89 or better.
12960 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
12961 Do not check for C89 headers, except for locale.h which is used
12962 by the Yacc library and must port to K&R hosts.
12963 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
12964 Do not check for C89 functions, except for setlocale which is
12965 used by the Yacc library.
12966 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
12967 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
12968 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
12969 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
12970 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
12971 AM_GNU_GETTEXT): Remove; now done by:
12972 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
12973 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
12974 for us.
12975
12976 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
12977 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
12978 Define to empty, as gnulib.mk will do the rest for us.
12979 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
12980 for us.
12981 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
12982 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
12983
12984 * src/files.c: Include gnulib's xstrndup.h.
12985
12986 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
12987 (REALLOC): Use xnrealloc, for likewise.
12988 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
12989 (strnlen, memrchr): Remove decls; functions no longer used.
12990 Include <stpcpy.h>.
12991
12992 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
12993 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
12994 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
12995 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
12996 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
12997 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
12998 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
12999 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
13000 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
13001 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
13002 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
13003 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13004 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
13005 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
13006 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
13007 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
13008 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
13009 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
13010 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
13011 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
13012 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
13013 Remove, as these files are now generated automatically
13014 by bootstrap or automake.
13015
13016 * po/ChangeLog: Remove: all but one entry was a duplicate
13017 of this file, and I moved that 2000-11-02 entry here.
13018
13019 * config/.cvsignore: Add Makefile, depcomp, install-sh.
13020 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
13021 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
13022 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
13023 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
13024 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
13025 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
13026 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
13027 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
13028 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
13029 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
13030 xstrndup.h.
13031 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
13032 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
13033 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
13034 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
13035 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
13036 * src/.cvsignore: Remove *_.c.
13037
13038
13039 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
13040 support it. (The latest stable gzip doesn't.)
13041
130422004-04-27 Paul Eggert <eggert@twinsun.com>
13043
13044 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
13045 case, as stos_ is now used by destructors due to the 2004-02-09
13046 change.
13047
13048 Remove more K&R C support.
13049 * lib/libiberty.y (PARAMS): Remove. All uses removed.
13050 * lib/subpipe.c (errno): Remove decl.
13051 Include <stdlib.h> unconditionally.
13052 (EXIT_FAILURE): Remove macro.
13053 * src/complain.c (vfprintf, strerror): Remove.
13054 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
13055 unconditionally.
13056 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
13057 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
13058 (strchr, strspn, memchr): Remove decls.
13059 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
13060 unconditionally. Do not declare perror.
13061 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
13062 unconditionally.
13063
13064 * src/complain.c (_): Remove useless defn, as system.h defines this.
13065
13066 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
13067 with latest obstack.h.
13068 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
13069 to procedure types, as obstack.h now does that for us.
13070 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
13071
13072 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
13073 so that this include file can stand alone.
13074 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
13075 does this now. Include subpipe.h first after config.h, to
13076 test whether it can stand alone.
13077
13078 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
13079 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
13080 unused declaration.
13081
13082 * tests/synclines.at (%union synch line): Put a dummy member in
13083 the union, because empty unions aren't allowed in C. Caught
13084 by GCC 3.4.0.
13085
130862004-04-13 Jim Meyering <jim@meyering.net>
13087
13088 * src/conflicts.c (conflicts_print): Correct format string typo:
13089 use `%%' to produce literal `%'. (trivial change)
13090
130912004-03-30 Paul Eggert <eggert@twinsun.com>
13092
13093 * src/getargs.c (version): Update copyright year to 2004.
13094
13095 * data/c.m4 (b4_int_type): Use 'short int' rather than
13096 'short', and similarly for 'long', 'unsigned', etc.
13097 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
13098 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
13099 yy_yypstack, yydumpstack): Likewise.
13100 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
13101 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
13102 Likewise.
13103 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
13104 yy_stack_print, yyparse): Likewise.
13105 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
13106 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
13107 * lib/bitset.c (bitset_print): Likewise.
13108 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
13109 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13110 * lib/bitsetv.c (bitsetv_dump): Likewise.
13111 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
13112 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
13113 Likewise.
13114 * src/LR0.c (allocate_itemsets): Likewise.
13115 * src/gram.h (rule_number, rule): Likewise.
13116 * src/lalr.h (goto_number): Likewise.
13117 * src/nullable.c (nullable_compute): Likewise.
13118 * src/output.c (prepare_rules): Likewise.
13119 * src/relation.c (relation_print, relation_digraph): Likewise.
13120 * src/relation.h (relation_node): Likewise.
13121 * src/state.h (state_number, transitions, errs, reductions,
13122 struct state): Likewise.
13123 * src/symtab.h (symbol_number, struct symbol): Likewise.
13124 * src/tables.c (vector_number, tally, action_number,
13125 default_goto, goto_actions): Likewise.
13126 * tests/existing.at (GNU Cim Grammar): Likewise.
13127 * tests/regression.at (Web2c Actions): Likewise.
13128
13129 * src/output.c (muscle_insert_short_int_table): Renamed from
13130 muscle_insert_short_table. All uses changed.
13131
131322004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
13133
13134 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
13135 (declaration): Replace expected_conflicts with expected_sr_conflicts.
13136 Add %expect-rr rule.
13137
13138 * src/scan-gram.l: Recognize %expect-rr.
13139
13140 * src/conflicts.h (expected_sr_conflicts): Rename from
13141 expected_conflicts.
13142 (expected_rr_conflicts): Declare.
13143
13144 * src/conflicts.c (expected_sr_conflicts): Rename from
13145 expected_conflicts.
13146 (expected_rr_conflicts): Define.
13147 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
13148 for GLR parsers.
13149 Use expected_sr_conflicts in place of expected_conflicts.
13150 Warn if expected_rr_conflicts used in non-GLR parser.
13151
13152 * doc/bison.texinfo: Add documentation for %expect-rr.
13153
131542004-03-08 Paul Eggert <eggert@gnu.org>
13155
13156 Add support for hex token numbers. Suggested by Odd Arild Olsen in
13157 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
13158
13159 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
13160 in lalr1.cc.
13161 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
13162 * src/scan-gram.l (scan_integer): New function.
13163 ({int}): Use it.
13164 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
13165 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
13166 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
13167 Say "long int", not "long", for uniformity with GNU style.
13168
131692004-02-25 Paul Eggert <eggert@twinsun.com>
13170
13171 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
13172 compilers. This fixes a problem with Intel's C++ compiler being
13173 chatty, reported by Guido Trentalancia in
13174 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
13175
131762004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
13177
13178 Support %destructor and merge error locations in lalr1.cc.
13179
13180 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
13181 (Parser::stos_): Define unconditionally.
13182 (Parser::destruct_): New method. Generate its body with
13183 b4_yydestruct_generate.
13184 (Parser::error_start_): New attribute.
13185 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
13186 token which are discarded.
13187 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
13188 error_start_ when erroneous token are discarded.
13189 (Parser::parse) <yyerrlab1>: Compute the location of the error
13190 token so that it covers all the discarded tokens.
13191 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
13192 it can be called with `%skeleton "lalr1.cc"', and do that.
13193
131942004-02-02 Paul Eggert <eggert@twinsun.com>
13195
13196 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
13197 $(top_srcdir)/lib and ../lib. This fixes a bug reported
13198 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
13199 There's no need to mention top_builddir since Automake does that
13200 for us.
13201 (INCLUDES): Remove, as Automake says it's obsolescent.
13202 Contents migrated into AM_CPPFLAGS as described above.
13203 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
13204
132052004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
13206
13207 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
13208 (yyreportSyntaxError): Handle case where lookahead token is
13209 YYEMPTY.
13210
132112004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13212
13213 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
13214 resulting parsers are compilable with C++.
13215
132162003-12-23 Paul Eggert <eggert@twinsun.com>
13217
13218 * config/depcomp, config/install-sh: Sync with Automake 1.8.
13219 * src/output.c (output_skeleton): Rename local var.
13220 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
13221 Bison tokens, as this runs afoul of the 2003-10-07 change that
13222 disallowed NUL bytes in character constants or string literals.
13223
13224 * tests/local.at: Require Autoconf 2.59's Autotest.
13225 * tests/testsuite.at: Don't include local.at, since we now assume
13226 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
13227 including it.
13228 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
13229 multiple inclusion warnings.
13230
132312003-12-02 Akim Demaille <akim@epita.fr>
13232
13233 * doc/bison.texinfo (How Can I Reset the Parser): More about start
13234 conditions.
13235 From Bruno Haible.
13236
132372003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
13238
13239 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
13240
132412003-10-07 Paul Eggert <eggert@twinsun.com>
13242
13243 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
13244 if testsuite doesn't exist.
13245
13246 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
13247 literals, unfortunately.
13248 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
13249 Complain about NUL bytes in character constants or string literals.
13250
132512003-10-05 Paul Eggert <eggert@twinsun.com>
13252
13253 * NEWS: Don't document %no-default-prec, as it's still
13254 too experimental.
13255 * doc/bison.texinfo: Document %no-default-prec only if
13256 the defaultprec flag is set. Normally it's not.
13257
132582003-10-04 Paul Eggert <eggert@twinsun.com>
13259
13260 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
13261 non-modifiable lvalue, instead of a modifiable one.
13262 * doc/bison.texinfo (Actions): Document that $$ can
13263 be assigned to. Do not claim that $$ and $N are
13264 array element references: user code should not rely on this.
13265
132662003-10-01 Paul Eggert <eggert@twinsun.com>
13267
13268 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
13269 (grammar_declaration): Use it.
13270 * src/scan-gram.l: New token %no-default-prec.
13271 * tests/conflicts.at: Revamp tests to use %no-default-prec.
13272 * NEWS, doc/bison.texinfo: Document the above.
13273
132742003-10-01 Akim Demaille <akim@epita.fr>
13275
13276 VCG no longer supports long_straight_phase.
13277
13278 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
13279 * src/print_graph.c (print_graph): Adjust.
13280
132812003-09-30 Frank Heckenbach <frank@g-n-u.de>
13282 and Paul Eggert <eggert@twinsun.com>
13283
13284 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
13285 Table of Symbols): Document %default-prec.
13286 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
13287 (grammar_declaration): Set default_prec on %default-prec.
13288 * src/scan-gram.l (%default-prec): New token.
13289 * src/reader.h (default_prec): New flag.
13290 * src/reader.c: Likewise.
13291 (packgram): Handle it.
13292 * tests/conflicts.at (%default-prec without %prec,
13293 %default-prec with %prec, %default-prec 1): New tests.
13294
132952003-09-30 Paul Eggert <eggert@twinsun.com>
13296
13297 * tests/testsuite.at: Include local.at, not input.at, fixing
13298 a typo in the 2003-08-25 patch.
13299
133002003-08-27 Akim Demaille <akim@epita.fr>
13301
13302 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
13303 GCC warnings.
13304
133052003-08-26 Akim Demaille <akim@epita.fr>
13306
13307 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
13308 "<\#" to avoid magic from Gnus when posting parts of this script.
13309
133102003-08-26 Akim Demaille <akim@epita.fr>
13311
13312 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
13313 (Parser::parse): here.
13314 Adjust: nerrs and errstatus is now replaced by...
13315 (Parser::nerrs_, Parser::errstatus_): New.
13316
133172003-08-25 Akim Demaille <akim@epita.fr>
13318
13319 * config/announce-gen, Makefile.cfg: New.
13320 * Makefile.am: Adjust.
13321 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
13322 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
13323
133242003-08-25 Akim Demaille <akim@epita.fr>
13325
13326 When reducing initial empty rules, Bison parser read an initial
13327 location that is not defined. This results in garbage, and that
13328 affects Bison's own parser. Therefore we need (i) to extend Bison
13329 to support a means to initialize this location, and (ii) to use
13330 this CVS Bison to fix CVS Bison's parser.
13331
13332 * src/reader.h, reader.c (epilogue_augment): Remove, replace
13333 with...
13334 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
13335 * src/parse-gram.y: Adjust.
13336 (%initial-action): New.
13337 (%error-verbose): Since we require CVS Bison, there is no reason
13338 not to use it.
13339 * src/scan-gram.l: Adjust.
13340 * src/Makefile.am (YACC): New, to make sure we use our own parser.
13341 * data/yacc.c (yyparse): Use b4_initial_action.
13342
133432003-08-25 Akim Demaille <akim@epita.fr>
13344
13345 * doc/bison.texinfo: Don't promote stdout for error messages.
13346
133472003-08-25 Akim Demaille <akim@epita.fr>
13348
13349 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
13350 From Alexandre Duret-Lutz.
13351
133522003-08-25 Akim Demaille <akim@epita.fr>
13353
13354 Version 1.875c.
13355
133562003-08-25 Akim Demaille <akim@epita.fr>
13357
13358 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
13359 Use them.
13360
133612003-08-25 Akim Demaille <akim@epita.fr>
13362
13363 * data/lalr1.cc (Parser::reduce_print_): New.
13364 Use it.
13365
133662003-08-25 Akim Demaille <akim@epita.fr>
13367
13368 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
13369 error recovery loops. This patch is based on
13370 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
13371 Also, augment the similarity between lalr1.cc and yacc.c.
13372 Note: the locations of error recovery rules are not correct yet.
13373
13374 * data/lalr1.cc: Comment changes to augment the similarity between
13375 lalr1.cc and yacc.c.
13376 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
13377 (yyerrlab1): Remove, but where it used to be (now the bottom part of
13378 yyerrlab), when hitting EOF, pop the whole stack here instead of
13379 merely falling thru the default error handling mechanism.
13380 (yyerrorlab): New label, with the old contents of YYERROR,
13381 plus the following change: pop the stack of rhs corresponding
13382 to the production that invoked YYERROR. That is how Yacc
13383 behaves (required by POSIX).
13384 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
13385 fail.
13386
133872003-08-25 Akim Demaille <akim@epita.fr>
13388
13389 Tune local.at so that people can "autom4te -l autotest calc.at -o
13390 calc" for instance, to extract a sub test suite.
13391
13392 * tests/testsuite.at: Move the initialization, Autotest version
13393 requirement, and AT_TESTED invocation into...
13394 * tests/local.at: here.
13395 * tests/testsuite.at: Include it for compatibility with Autoconf
13396 2.57.
13397 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
13398 be ignore.
13399
134002003-08-04 Paul Eggert <eggert@twinsun.com>
13401
13402 Rework code slightly to avoid gcc -Wtraditional warnings.
13403 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
13404 The returned value is now stored in *YY0. All callers changed.
13405 * src/output.c (merge_output): Adjust to the above change.
13406
134072003-07-26 Paul Eggert <eggert@twinsun.com>
13408
13409 * data/glr.c (YYASSERT): New macro.
13410 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
13411 yyresolveStates, yyprocessOneStack):
13412 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
13413 Derived from a suggestion by Frank Heckenbach.
13414
134152003-07-25 Paul Eggert <eggert@twinsun.com>
13416
13417 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
13418 for portability to K&R C (after ansi2knr, presumably). See
13419 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
13420 by Frank Heckenbach, though I have omitted the structure-initialization
13421 part of his glr-knr.diff patch since I recall that the Portable
13422 C Compiler didn't require that change.
13423
13424 Let the user specify how to allocate and free memory.
13425 Derived from a suggestion by Frank Heckenbach in
13426 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
13427 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
13428 All uses of free, malloc, realloc changed to use these macros,
13429 and unnecessary casts removed.
13430 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
13431
134322003-07-06 Matthias Mann <MatthiasMann@gmx.de>
13433
13434 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
13435 use s.empty() rather than s == "" to test for empty string; see
13436 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
13437 (trivial change)
13438
134392003-06-25 Akim Demaille <akim@epita.fr>
13440
13441 * config/depcomp, config/install-sh: Update from masters.
13442
134432003-06-20 Paul Eggert <eggert@twinsun.com>
13444
13445 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
13446 and return properly parenthesized result.
13447 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
13448 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
13449 Remove unnecessary parentheses from uses.
13450 * doc/bison.texinfo (Location Default Action): Describe the
13451 conventions for parentheses.
13452
134532003-06-19 Paul Eggert <eggert@twinsun.com>
13454
13455 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
13456 yyreportTree): Do not assume that size_t is the same width as int,
13457 when printing sizes. Print sizes using an unsigned format.
13458 Problem reported by Frank Heckenbach in
13459 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
13460
13461 Port to Forte Developer 7 C compiler.
13462 * data/glr.c (struct YYLTYPE): If locations are not being used,
13463 declare a single dummy member, as empty structs do not conform
13464 to the C standard.
13465 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
13466 the Forte Developer 7 C compiler complains that end-of-loop
13467 code is not reached.
13468
134692003-06-17 Paul Eggert <eggert@twinsun.com>
13470
13471 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
13472 avoid warnings from picky compilers about redefinition of PARAMS.
13473
134742003-06-17 Paul Eggert <eggert@twinsun.com>
13475
13476 Version 1.875b.
13477
13478 * NEWS: Document 1.875b.
13479
13480 * lib/bbitset.h: Do not include config.h; that's the includer's job.
13481 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
13482 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
13483 Don't use 'index' in comments, as it's a builtin fn on some hosts.
13484 * lib/bitset_stats.c: Include gettext.h unconditionally, as
13485 per recent gettext manual's suggestion.
13486 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
13487 Use prototypes, not old-style definitions.
13488 * lib/lbitset.c (lbitset_unused_clear): Likewise.
13489 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
13490 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
13491 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
13492 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
13493 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
13494 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
13495 vbitset_or_and_cmp, vbitset_copy): Likewise.
13496
13497 * lib/libiberty.h: Do not include config.h; that's the includer's job.
13498 Do not include <stdlib.h>.
13499 (PARAMS): Define unconditionally for C89.
13500 (ATTRIBUTE_NORETURN): Remove.
13501 (ATTRIBUTE_UNUSED): Define unconditionally.
13502
13503 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
13504 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
13505 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
13506 * lib/vbitset.c, lib/vbitset.h: New files.
13507 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13508 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
13509 from libbitset.
13510
13511 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
13512 `How Can I Reset @code{yyparse}', since texinfo does not allow
13513 arbitrary @ in node names.
13514
13515 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
13516 shouldn't be needed according to the gettext 0.12.1 documentation
13517 but which seem to be needed anyway: codeset.m4 glibc21.m4
13518 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
13519 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
13520 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
13521
13522 * lib/.cvsignore: Add stdbool.h.
13523 * m4/.cvsignore: Add nls.m4, po.m4.
13524
13525 Upgrade to CVS gnulib.
13526 * stdbool_.h: File renamed from stdbool.h.in.
13527 * configure.ac (AM_STDBOOL_H): Invoke this instead of
13528 AC_HEADER_STDBOOL.
13529 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
13530 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
13531 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
13532 (MOSTLYCLEANFILES): New var.
13533 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
13534 (stdbool.h): New rule.
13535 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
13536 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
13537 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
13538 m4/quote.m4: Upgrade to today's gnulib.
13539
13540 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
13541 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
13542 the tests right now.
13543 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
13544 yyerror are declared before use; C99 requires this.
13545
135462003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13547
13548 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
13549 first.
13550 (yyrecoverSyntaxError): Correct the logic for setting and testing
13551 yyerrState.
13552 Correct comment on handling EOF.
13553 Allow states with only a default reduction, rather than failing
13554 (I can't quite reconstruct why these were not allowed before).
13555
13556 Fixes to avoid problem that $-N rules in GLR parsers can cause
13557 buffer overruns, corrupting state.
13558
13559 * src/output.c (prepare_rules): Output max_left_semantic_context
13560 definition.
13561 * src/reader.h (max_left_semantic_context): New variable declaration.
13562 * src/scan-gram.l (max_left_semantic_context): Define.
13563 (handle_action_dollar): Update max_left_semantic_context.
13564 * data/glr.c (YYMAXLEFT): New definition.
13565 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
13566 (yyresolveAction): Ditto.
13567
13568 Fixes to problems with location handling in GLR parsers reported by
13569 Frank Heckenbach (2003/06/05).
13570
13571 * data/glr.c (YYLTYPE): Make trivial if locations not used.
13572 (YYRHSLOC): Add parentheses, and define only if locations used.
13573 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
13574 locations not used.
13575 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
13576 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
13577
13578 * tests/cxx-type.at: Exercise location information; update tests
13579 to differentiate output with and without locations.
13580 Remove forward declarations of yylex and yyerror---caused errors
13581 because default YYLTYPE not yet defined.
13582 Change semantic actions to compute strings, rather than printing
13583 them directly (to test proper passing of semantics values). Change
13584 output to prefix notation and update test data and expected results.
13585 (yylex): Track locations.
13586 (stmtMerge): Return value rather than printing, and include arguments
13587 in value.
13588
135892003-06-03 Paul Eggert <eggert@twinsun.com>
13590
13591 Avoid warnings generated by GCC 2.95.4 when Bison is
13592 configured with --enable-gcc-warnings.
13593 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
13594 yy::]b4_parser_class_name[::translate_,
13595 yy::Stack::operator[] (unsigned),
13596 yy::Stack::operator[] (unsigned) const,
13597 yy::Slice::operator[] (unsigned),
13598 yy::Slice::operator[] (unsigned) const):
13599 Rename local vars to avoid warnings.
13600 * tests/glr-regression.at (Improper handling of embedded actions
13601 and $-N in GLR parsers): Remove unused local variable from yylex.
13602 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
13603 (void) as arg when not pure, since we now assume C89 when building
13604 Bison. Pacify GCC by using parameter.
13605
136062003-06-02 Paul Eggert <eggert@twinsun.com>
13607
13608 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
13609 yy::Location::lines, yy::Location::columns): Rename arguments
13610 to avoid shadowing; this removes a warning generated by GCC 3.3.
13611
136122003-06-01 Paul Eggert <eggert@twinsun.com>
13613
13614 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
13615 to g++, as GCC 3.3 complains if you do it.
13616 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
13617 everything that WARNING_CFLAGS has, except omit warnings
13618 not suitable for C++.
13619 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
13620 * tests/atlocal.in (CXXFLAGS): New var.
13621 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
13622
13623 Fix a GLR parser bug I reported in February; see
13624 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
13625 The problem was that GLR parsers did not conform to the C standard,
13626 because actions like { $1 = $2 + $3; } expanded to expressions
13627 that invoked YYFILL in separate subexpressions, and YYFILL assigned
13628 to a local variable. The C standard says that expressions
13629 like (var = f ()) + (var = f ()) have undefined behavior.
13630 Another problem was that GCC sometimes issues warnings that
13631 yyfill and its parameters are unused.
13632
13633 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
13634 as possibly unused.
13635 (yyfill): New function.
13636 (YYFILL): Use it.
13637 (yyuserAction): Change type of yynormal to bool, so that it matches
13638 the new yyfill signature. Mark it as possibly unused.
13639
13640
13641 Follow up on a bug I reported in February, where a Bison-generated
13642 parser can loop. Provide a test case and a fix for yacc.c. I
13643 don't have a fix for lalr1.cc or for glr.c, unfortunately.
13644 The original bug report is in:
13645 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
13646
13647 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
13648 macro's size was becoming unwieldy.
13649 (yyerrlab): Do not discard an empty lookahead symbol, as this
13650 might destroy garbage.
13651 (yyerrorlab): New label, with the old contents of YYERROR,
13652 plus the following change: pop the stack of rhs corresponding
13653 to the production that invoked YYERROR. That is how Yacc
13654 behaves, and POSIX requires this behavior.
13655 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
13656 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
13657 Define 'alarm' to do nothing if unistd.h is not available.
13658 Add a new rule "exp: '-' error;" to test the above change to
13659 data/yacc.c. Use 'alarm' to abort any test taking longer than
13660 10 seconds, as it's probably looping.
13661 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
13662 Also, the new yacc.c generates two fewer diagnostics for an
13663 existing test.
13664
136652003-05-24 Paul Eggert <eggert@twinsun.com>
13666
13667 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
13668 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
13669 This fixes a problem reported by John Bowman when the Compaq/HP
13670 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
13671 -ansi -Wall -gall).
13672 * data/yacc.c (union yyalloc): Likewise.
13673 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
13674
13675 Switch from 'int' to 'bool' where that makes sense.
13676
13677 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
13678 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
13679 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
13680 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
13681 Return or accept bool, not int. All callers changed.
13682 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
13683 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
13684 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
13685 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
13686 bitset_or_and_cmp_): Likewise.
13687 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
13688 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
13689 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
13690 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
13691 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
13692 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
13693 bitset_stats_or_and_cmp): Likewise.
13694 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
13695 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
13696 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
13697 ebitset_xor_cmp): Likewise.
13698 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
13699 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
13700 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
13701 lbitset_xor_cmp): Likewise.
13702 * lib/bbitset.h: Include <stdbool.h>.
13703 (struct bitset_vtable): The following members now return bool, not
13704 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
13705 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
13706 or_and_cmp).
13707 * src/conflicts.c (count_rr_conflicts): Likewise.
13708 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
13709 All uses changed.
13710 * lib/ebitset.c (ebitset_obstack_init): Likewise.
13711 * lib/lbitset.c (lbitset_obstack_init): Likewise.
13712 * src/getargs.c (debug_flag, defines_flag, locations_flag,
13713 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
13714 graph_flag): Likewise.
13715 * src/getargs.h (debug_flag, defines_flag, locations_flag,
13716 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
13717 graph_flag): Likewise.
13718 * src/output.c (error_verbose): Likewise.
13719 * src/output.h (error_verbose): Likewise.
13720 * src/reader.c (start_flag, typed): Likewise.
13721 * src/reader.h (typed): Likewise.
13722 * src/getargs.c (LOCATIONS_OPTION): New constant.
13723 (long_options, getargs): Use it.
13724 * src/lalr.c (build_relations): Use bool, not int.
13725 * src/nullable.c (nullable_compute): Likewise.
13726 * src/print.c (print_reductions): Likewise.
13727 * src/tables.c (action_row, pack_vector): Likewise.
13728 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
13729 * src/output.c (prepare): Use it.
13730 * src/output.c (token_definitions_output,
13731 symbol_destructors_output, symbol_destructors_output): Use string,
13732 not boolean integer, to keep track of whether to output separator.
13733 * src/print_graph.c (print_core): Likewise.
13734 * src/state.c (state_rule_lookaheads_print): Likewise.
13735
13736 * config/install-sh: Sync from automake 1.7.5.
13737
137382003-05-14 Paul Eggert <eggert@twinsun.com>
13739
13740 * src/parse-gram.y (rules_or_grammar_declaration): Require a
13741 semicolon after a grammar declaration, in the interest of possible
13742 future changes to the Bison input language.
13743 Do not allow a stray semicolon at the start of the grammar.
13744 (rhses.1): Allow one or more semicolons after any rule, including
13745 just before "|" as required by POSIX.
13746 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
13747 grammar.
13748
137492003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
13750
13751 %parse-param support for lalr1.cc.
13752
13753 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
13754 b4_cc_constructor_calls, b4_cc_constructor_call,
13755 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
13756 definitions.
13757 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
13758 parse-param arguments.
13759 (yy::b4_parser_class_name): Declare instance variables to
13760 hold parse-param arguments.
13761 * tests/calc.at: s/value/semantic_value/ because value clashes
13762 with a member of yy::b4_parser_class_name. Adjust C++ code
13763 to handle %parse-param. Enable %parse-param test in C++.
13764
137652003-05-12 Paul Eggert <eggert@twinsun.com>
13766
13767 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
13768 English a bit. Fix fclose typo. Change "const char" to "char
13769 const", and use ANSI C rather than K&R for "main". Suggest
13770 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
13771 and suggest yy_switch_to_buffer.
13772
137732003-05-05 Paul Eggert <eggert@twinsun.com>
13774
13775 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
13776 C89. This avoids a diagnostic on compilers that define __STDC__
13777 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
13778 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
13779
137802003-05-03 Paul Eggert <eggert@twinsun.com>
13781
13782 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
13783 Do not overrun array bounds.
13784 This should fix a bug reported today by Olatunji Oluwabukunmi in
13785 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
13786
137872003-04-29 Akim Demaille <akim@epita.fr>
13788
13789 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
13790 * src/getargs.c, src/getargs.h: here, as bool, not int.
13791 (nondeterministic_parser): New.
13792 * src/parse-gram.y, src/scan-gram.l: Support
13793 %nondeterministic-parser.
13794 * src/output.c (prepare): Use nondeterministic_parser instead
13795 of glr_parser where appropriate.
13796 * src/tables.c (conflict_row, action_row, save_row)
13797 (token_actions, token_actions, pack_vector): Ditto.
13798
137992003-04-29 Akim Demaille <akim@epita.fr>
13800
13801 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
13802
138032003-04-29 Akim Demaille <akim@epita.fr>
13804
13805 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
13806 with %pure-parser and %locations to exercise the patch from Yakov
13807 Markovitch below.
13808
138092003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
13810
13811 * data/yacc.c: (b4_lex_param): Corrected for the case where
13812 %lex-param is provided and %pure-parser isn't.
13813
138142003-04-27 Paul Eggert <eggert@twinsun.com>
13815
13816 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
13817 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
13818 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
13819 if it is not defined.
13820 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
13821
138222003-04-26 Paul Eggert <eggert@twinsun.com>
13823
13824 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
13825 Declare to be of type suitable for the ninf value itself, not of
13826 type suitable for the corresponding table, since the latter might
13827 be unsigned but the ninf value might be negative. This fixes a
13828 bug reported by Alexandre Duret-Lutz in
13829 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
13830
13831 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
13832 invokes it. We shouldn't invoke it twice because it will attempt
13833 to put error.o in the archive twice. This fixes a glitch reported
13834 by Martin Mokrejs in
13835 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
13836
138372003-04-21 Paul Eggert <eggert@twinsun.com>
13838
13839 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
13840 to gnulib.
13841
138422003-04-21 Yakov Markovitch <Markovitch@iso.ru>
13843
13844 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
13845 Fix obvious typo that results in uncompilable GLR parsers
13846 when both %pure-parser and %locations are used. (trivial change)
13847
138482003-04-17 Paul Eggert <eggert@twinsun.com>
13849
13850 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
13851 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
13852 Do not insert the expected token via unput, as this runs afoul
13853 of a POSIX-compatibility bug in flex 2.5.31.
13854 All uses changed to BEGIN the parent state,
13855 since we no longer insert the expected token via unput.
13856 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
13857 that is no longer emitted after the above change.
13858
13859 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
13860 the first one. This change is from Paul Hilfinger, and it fixes
13861 regression reported by Werner Lemberg in
13862 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
13863
13864 (resolve_sr_conflict): Don't invoke state_errs_set
13865 unless one or more tokens have been explicitly made errors.
13866 Otherwise, the above change causes Bison to abort.
13867
13868 * tests/existing.at (GNU pic Grammar): New test case, taken from
13869 Lemberg's email.
13870
138712003-03-31 Akim Demaille <akim@epita.fr>
13872
13873 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
13874
138752003-03-31 Akim Demaille <akim@epita.fr>
13876
13877 * src/output.c (prepare_symbols): Avoid trailing spaces in the
13878 output.
13879
138802003-03-31 Akim Demaille <akim@epita.fr>
13881
13882 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
13883 From Paul Hilfinger.
13884
138852003-03-29 Akim Demaille <akim@epita.fr>
13886
13887 * m4/error.m4: Do not put under dynamic conditions some code which
13888 expansion is under static control.
13889
138902003-03-29 Akim Demaille <akim@epita.fr>
13891
13892 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
13893
138942003-03-29 Akim Demaille <akim@epita.fr>
13895
13896 * doc/bison.texinfo (Strings are Destroyed): New.
13897
138982003-03-13 Paul Eggert <eggert@twinsun.com>
13899
13900 * .cvsignore: Add configure.lineno.
13901 * src/.cvsignore: Add yacc.
13902 * tests/.cvsignore: Add testsuite.log.
13903 * doc/fdl.texi: Sync with latest FSF version.
13904
139052003-03-12 Paul Eggert <eggert@twinsun.com>
13906
13907 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
13908 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
13909 cursor, instead of leaving it undefined. This fixes a bug
13910 reported by Tim Van Holder in
13911 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
13912 * tests/input.at (Torturing the Scanner): Test the scanner on
13913 an empty input file, which was Tim Van Holder's test case.
13914
13915 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
13916 <sys/resource.h> can be included, include sys/time.h and
13917 sys/times.h first, if available. This works around the SunOS
13918 4.1.4 porting bug reported by Bruce Becker in
13919 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
13920
13921 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
13922 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
13923 AC_HEADER_SYS_WAIT.
13924
13925 Merge changes from gnulib. This was prompted because the CVS
13926 snapshot didn't build on Solaris 7 due to strnlen problems.
13927
13928 These changes need to be merged back into gnulib:
13929 * lib/hash.c: Include <stdbool.h> unconditionally.
13930 * m4/onceonly.m4 (m4_quote): New macro.
13931 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
13932 Quote AC_FOREACH variable-expansions properly.
13933 The 2003-01-03 obstack.h change also needs merging.
13934 {end of changes requiring merging}
13935
13936 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13937 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
13938 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
13939 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
13940 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
13941 New files, imported from gnulib.
13942 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
13943 above.
13944
13945 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
13946 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
13947 gnulib sources.
13948
13949 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
13950 Add.
13951 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
13952 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
13953 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
13954 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
13955 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
13956 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
13957 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
13958 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
13959 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
13960 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
13961 (jm_PREREQ_ARGMATCH): Remove.
13962 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
13963 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
13964
13965 * src/system.h: Include <stdbool.h> unconditionally.
13966
13967 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
13968 assuming at least C89 in the bitset code for some time now.
13969
139702003-03-03 Akim Demaille <akim@epita.fr>
13971
13972 * ro.po: New.
13973
139742003-03-02 Akim Demaille <akim@epita.fr>
13975
13976 * doc/bison.texinfo (Table of Symbols): Reactivate the
13977 documentation for %lex-param, and %parse-param.
13978
139792003-03-02 Akim Demaille <akim@epita.fr>
13980
13981 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
13982 generate verbose error messages.
13983 Use the number of tokens as an upper bound in yytname, as it
13984 cannot be a non terminal.
13985
139862003-03-02 Akim Demaille <akim@epita.fr>
13987
13988 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
13989 message.
13990
139912003-03-02 Akim Demaille <akim@epita.fr>
13992
13993 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
13994 Use them to exercise yycheck overrun.
13995 Based on Andrew Suffield's grammar.
13996
139972003-03-02 Akim Demaille <akim@epita.fr>
13998
13999 Create tests/local.at for Bison generic testing macros.
14000
14001 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
14002 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
14003 This new file.
14004 * tests/calc.at (AT_CHECK_CALC): Adjust.
14005 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
14006 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
14007 * tests/local.at: here.
14008 (AT_COMPILE_CXX): Tags the tests using it as c++.
14009 Ignore the test if CXX is not functional.
14010
140112003-03-01 Paul Eggert <eggert@twinsun.com>
14012
14013 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
14014 not loc->end, since loc->end might contain garbage and this leads
14015 to undefined behavior on some platforms.
14016 (id_loc, token_start): Use (IF_LINTed) initial values that do not
14017 depend on *loc, so that the reader doesn't give the the false
14018 impression that *loc is initialized.
14019 (<INITIAL>"%%"): Do not bother setting code_start, since its value
14020 does not survive the return.
14021
140222003-03-01 Akim Demaille <akim@epita.fr>
14023
14024 * src/scan-gram.l (code_start): Always initialize it when entering
14025 into yylex, as SC_EPILOGUE is activated *before* the corresponding
14026 yylex invocation. An alternative would be making it static, but
14027 then it starts with the second %%'s beginning, instead of its end.
14028
140292003-02-28 Paul Eggert <eggert@twinsun.com>
14030
14031 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
14032 around a UnixWare 7.1.1 porting bug reported by John Hughes in
14033 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
14034
140352003-02-26 Paul Eggert <eggert@twinsun.com>
14036
14037 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
14038 Remove Sequent/Pyramid discussion (nobody uses them any more).
14039 Merge VMS and MS-DOS discussion; these ports may well be dead
14040 but let's keep mentioning them for now. Put <> around email
14041 addresses. Add copyright notice.
14042
140432003-02-24 Paul Eggert <eggert@twinsun.com>
14044
14045 * data/glr.c (yy_reduce_print): yylineno -> yylno,
14046 to avoid collision with flex use of yylineno.
14047 Problem reported by Bruce Lilly in
14048 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
14049 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
14050 * data/yacc.c (yy_reduce_print): Likewise.
14051
14052 * config/depcomp: Sync with Automake 1.7.3.
14053
140542003-02-21 Akim Demaille <akim@epita.fr>
14055
14056 * data/lalr1.cc: Use temporary variables instead of casts to
14057 change integer types.
14058 Suggested by Paul Eggert.
14059
140602003-02-21 Akim Demaille <akim@epita.fr>
14061
14062 * doc/bison.texinfo: Use "location" consistently to refer to @n,
14063 to avoid confusions with lalr1.cc's notion of Position.
14064 Suggested by Paul Eggert.
14065
140662003-02-20 Akim Demaille <akim@epita.fr>
14067
14068 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
14069 before initial_columns.
14070 (location.hh): Use consistent variable names when defining the
14071 operator<<.
14072 Use "last" so that we subtract from Positions, not from unsigned.
14073
140742003-02-20 Akim Demaille <akim@epita.fr>
14075
14076 * data/lalr1.cc (position.hh): New subfile, including the extended
14077 and Doxygen'ed documentation of class Position.
14078 (location.hh): Use it.
14079 Document a` la Doxygen.
14080 With the help of Benoit Perrot.
14081
140822003-02-20 Akim Demaille <akim@epita.fr>
14083
14084 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
14085 AT_YACC_IF.
14086 Redefine AT_YYERROR_SEES_LOC_IF using it.
14087 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
14088 not defined.
14089 Don't use the location in yy::Parser::error_ and
14090 yy::Parser::print_ when not %locations.
14091 Activate more lalr1.cc tests.
14092
140932003-02-19 Akim Demaille <akim@epita.fr>
14094
14095 * data/lalr1.cc: When displaying a line number, be sure to make it
14096 an int.
14097
140982003-02-19 Akim Demaille <akim@epita.fr>
14099
14100 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
14101 Remove, useless.
14102 (YYABORT, YYACCEPT, YYERROR): New.
14103 * tests/calc.at: Renable the lalr1.cc test.
14104
141052003-02-19 Akim Demaille <akim@epita.fr>
14106
14107 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
14108 error recovery, mixing with/without pops and discarding of the
14109 lookahead.
14110 Exercise YYERROR.
14111 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
14112
141132003-02-17 Paul Eggert <eggert@twinsun.com>
14114
14115 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
14116 * tests/testsuite.at (AT_COMPILE): Use them.
14117 This fixes the testsuite problem reported by Robert Lentz in
14118 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
14119
141202003-02-12 Paul Eggert <eggert@twinsun.com>
14121
14122 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
14123 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
14124 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
14125 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
14126 Check for malloc failure, for consistency with yacc.c.
14127 (yytname_size): Remove, for consistency with yacc.c.
14128
14129 The bug still remains in data/lalr1.cc, as I didn't have time
14130 to fix it there.
14131
141322003-02-06 Akim Demaille <akim@epita.fr>
14133
14134 * configure.ac (GXX): Rename as...
14135 (CXX): this, to keep the original Autoconf semantics.
14136 Require 2.57.
14137 * data/lalr1.cc: Fix b4_copyright invocations.
14138 If YYDEBUG is not defined, don't depend upon name_ being defined.
14139 (location.hh): Include string and iostream.
14140 (Position::filename): New member.
14141 (Position::Position ()): New.
14142 (operator<< (Position)): New.
14143 (operator- (Position, int)): New.
14144 (Location::first, Location::last): Rename as...
14145 (Location::begin, Location::end): these, to mock the conventional
14146 iterator names.
14147 (operator<< (Location)): New.
14148 * tests/atlocal.in (CXX): New.
14149 * tests/testsuite.at (AT_COMPILE_CXX): New.
14150 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
14151 locations in a more synthetic way.
14152 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
14153 lalr1.cc is used.
14154 Adjust the C locations to match those from Emacs: first column is
14155 column 0.
14156 Change all the expected results.
14157 Conform to the GCS: simplify the locations when applicable.
14158 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
14159 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
14160 these CPP macros with the m4 macros new defined by...
14161 (AT_CHECK_PUSHDEFS): this, i.e.:
14162 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
14163 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
14164 New macros.
14165 (AT_CHECK_POPDEFS): Undefine them.
14166 (AT_CHECK_CALC_LALR1_CC): New.
14167 Use it for the first lalr1.cc test.
14168
141692003-02-04 Akim Demaille <akim@epita.fr>
14170
14171 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
14172 Location as is defined.
14173
141742003-02-04 Akim Demaille <akim@epita.fr>
14175
14176 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
14177 name_ being defined.
14178
141792003-02-03 Paul Eggert <eggert@twinsun.com>
14180
14181 * src/gram.h (start_symbol): Remove unused decl.
14182
14183 Use more-consistent naming conventions for local vars.
14184
14185 * src/derives.c (derives_compute): Change type of local var from
14186 int to rule_number.
14187 * src/gram.c (grammar_rules_partial_print): Likewise.
14188 * src/print.c (print_core): Likewise.
14189 * src/reduce.c (reduce_grammar_tables): Likewise.
14190
14191 * src/gram.c (grammar_dump): Change name of item_number *
14192 local var from r to rp.
14193 * src/nullable.c (nullable_compute): Likewise.
14194
14195 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
14196
14197 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
14198 for symbol or symbol_number var.
14199 * src/reader.c (grammar_start_symbol_set): Likewise.
14200 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
14201 Likewise.
14202 * src/state.c (transitions_to): Likewise.
14203 * src/state.h: Likewise.
14204 * src/tables.c (symbol_number_to_vector_number): Likewise.
14205
14206 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
14207 char * var.
14208
14209 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
14210 var.
14211
14212 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
14213 var.
14214
14215 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
14216 Use str, not s, for char * var. Use ch, not c, for character var.
14217 Use size for size var.
14218
14219 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
14220 char * var.
14221 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
14222 uniqstr var.
14223 * src/uniqstr.h: Likewise.
14224
14225 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
14226 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
14227 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
14228 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
14229 param to have same name as that of enum, so that we don't use
14230 "s" to stand for a non-state.
14231
142322003-02-02 Akim Demaille <akim@epita.fr>
14233
14234 * src/scan-skel.l: Scan more than one inert character per yylex
14235 invocation.
14236
142372003-02-01 Paul Eggert <eggert@twinsun.com>
14238
14239 Version 1.875a.
14240
14241 * po/LINGUAS: Add ms.
14242
142432003-01-30 Akim Demaille <akim@epita.fr>
14244
14245 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
14246
142472003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14248
14249 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
14250 of $1.
14251
14252 Changes in response to error report by S. Eken: GLR mode does not
14253 handle negative $ indices or $ indices in embedded rules correctly.
14254 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
14255
14256 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
14257 (b4_rhs_location): Ditto.
14258 (yyfill): New function to copy from stack tree into array
14259 incrementally.
14260 (yyuserAction): Modify to allow incremental move of semantic values
14261 to rhs array when in GLR mode.
14262 Define YYFILL to use in user-defined actions to fill semantic array
14263 as needed.
14264 Remove dummy use of yystack, as there is now a guaranteed use.
14265 (yydoAction): Modify to allow incremental move of semantic values
14266 to rhs array when in GLR mode.
14267 (yyresolveAction): Ditto.
14268 (yyglrShiftDefer): Update comment.
14269 (yyresolveStates): Use X == NULL for pointers, not !X.
14270 (yyglrReduce): Ditto.
14271 (yydoAction): Ditto
14272
14273 * tests/glr-regr1.at: Rename to ...
14274 * tests/glr-regression.at: Add new regression test for the problems
14275 described above (adapted from S. Eken).
14276 Update copyright notice.
14277 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
14278 * tests/Makefile.am: Ditto.
14279
142802003-01-28 Paul Eggert <eggert@twinsun.com>
14281
14282 * data/lalr1.cc: Do not use @output_header_name@ unless
14283 b4_defines_flag is set. This fixes two bugs reported by
14284 Tim Van Holder in
14285 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
14286 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
14287
142882003-01-21 Paul Eggert <eggert@twinsun.com>
14289
14290 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
14291 we don't need to worry about yyerrlab1 being reported as an
14292 "unused label" by non-GCC C compilers. The downside is that if
14293 locations are used then a couple of statements are duplicated each
14294 time YYERROR is invoked, but the upside is that the warnings
14295 should vanish.
14296 (yyerrlab1): Move code to YERROR.
14297 (yyerrlab2): Remove. Change uses back to yyerrlab1.
14298 This reverts some of the 2002-12-27 change.
14299
143002003-01-17 Paul Eggert <eggert@twinsun.com>
14301
14302 * src/output.c (symbol_printers_output): Fix typo that led
14303 to core dump. Problem reported by Antonio Rus in
14304 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
14305
143062003-01-13 Akim Demaille <akim@epita.fr>,
14307 Quoc Peyrot <chojin@lrde.epita.fr>,
14308 Robert Anisko <anisko_r@lrde.epita.fr>
14309
14310 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
14311 when the stacks contain one element, as the loop would otherwise
14312 free the last state, and then use the top state (the one we just
14313 popped). This means that the initial elements will not be freed
14314 explicitly, as is the case in yacc.c; it is not a problem, as
14315 these elements have fake values.
14316
143172003-01-11 Paul Eggert <eggert@twinsun.com>
14318
14319 * NEWS: %expect-violations are now just warnings, reverting
14320 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
14321 bootstrapping problem reported by Matthias Klose; see
14322 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
14323 * src/conflicts.c (conflicts_print): Likewise.
14324 * tests/conflicts.at (%expect not enough, %expect too much,
14325 %expect with reduce conflicts): Likewise.
14326 * doc/bison.texinfo (Expect Decl): Document this. Also mention
14327 that the warning is enabled if the number of conflicts changes
14328 (not necessarily increases).
14329
14330 * src/getargs.c (version): Update copyright year.
14331
143322003-01-09 Akim Demaille <akim@epita.fr>
14333
14334 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
14335
143362003-01-08 Paul Eggert <eggert@twinsun.com>
14337
14338 * Makefile.maint (WGETFLAGS):
14339 New macro, containing "-C off" to disable proxy caches.
14340 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
14341 (rel-check): Use $(WGET) instead of wget.
14342
143432003-01-06 Paul Eggert <eggert@twinsun.com>
14344
14345 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
14346 the GLR paper of Scott, Johnstone and Hussain.
14347
143482003-01-04 Paul Eggert <eggert@twinsun.com>
14349
14350 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
14351 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
14352 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
14353 (EXTRA_LIBRARIES): New var, for liby.a.
14354 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
14355 (EXTRA_SCRIPTS): New var, for yacc.
14356
14357 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
14358 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
14359 Problem reported by Nelson H. F. Beebe.
14360
143612003-01-03 Paul Eggert <eggert@twinsun.com>
14362
14363 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
14364 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
14365 when compiling Bison 1.875's `bitset bset = obstack_alloc
14366 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
14367
14368 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
14369 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
14370 grow to a huge size with typical invocation.
14371
14372 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
14373 Use the pattern recommended by Autoconf 2.57, except also protect
14374 against double-definition.
14375 * src/system.h: Likewise.
14376 Portability issues reported by Nelson H. F. Beebe.
14377
14378 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
14379 All uses changed. Provide a definition in both C and C++.
14380 (yytrue, yyfalse): Define even if defined (__cplusplus).
14381
14382 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
14383 Reported by Nelson H. F. Beebe.
14384
14385 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
14386
143872003-01-02 Paul Eggert <eggert@twinsun.com>
14388
14389 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
14390 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
14391 Bug reported by Nelson H. F. Beebe.
14392
143932003-01-01 Paul Eggert <eggert@twinsun.com>
14394
14395 * Version 1.875.
14396
143972002-12-30 Paul Eggert <eggert@twinsun.com>
14398
14399 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
14400 Moved here from...
14401 (<INITIAL>","): Here. This causes stray "," to be treated
14402 more uniformly.
14403
14404 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
14405 last brace in braced code when not in Yacc mode, for compatibility
14406 with Bison 1.35. This resurrects the 2001-12-15 patch to
14407 src/reader.c.
14408
14409 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
14410 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
14411
144122002-12-28 Paul Eggert <eggert@twinsun.com>
14413
14414 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
14415 that of SYM's type. This fixes Debian bug 168069, reported by
14416 Thomas Olsson.
14417
144182002-12-28 Paul Eggert <eggert@twinsun.com>
14419
14420 Version 1.75f.
14421
14422 Switch back to the Yacc style of conflict reports, undoing some
14423 of the 2002-07-30 change.
14424 * doc/bison.texinfo (Understanding): Use Yacc style for
14425 conflict reports. Also, use new way of locating rules.
14426 * src/conflicts.c (conflict_report):
14427 Renamed from conflict_report_yacc, removing the old
14428 'conflict_report'. Translate the entire conflict report at once,
14429 so that we don't assume that "," has the same interpretation in
14430 all languages.
14431 (conflicts_output): Use Yacc-style conflict report for each state,
14432 instead of our more-complicated style.
14433 (conflicts_print): Use Yacc-style conflict report, except print
14434 the input file name when not emulating Yacc.
14435 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
14436 Conflicted Reduction, %expect not enough, %expect too much,
14437 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
14438 * tests/existing.at (GNU Cim Grammar): Likewise.
14439 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
14440
14441 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
14442 fatal): Don't invoke fflush; it's not needed and it might even be
14443 harmful for stdout, as stdout might not be open.
14444 * src/reduce.c (reduce_print): Likewise.
14445
144462002-12-27 Paul Eggert <eggert@twinsun.com>
14447
14448 Fix a bug where error locations were not being recorded correctly.
14449 This problem was originally reported by Paul Hilfinger in
14450 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
14451
14452 * data/yacc.c (yyparse): New local var yylerrsp, to record the
14453 top of the location stack's error locations.
14454 (yyerrlab): Set it. When discarding a token, push its location
14455 onto yylerrsp so that we don't lose track of the error's end.
14456 (yyerrlab1): Now is only the target of YYERROR, so that we can
14457 properly record the location of the action that failed. For GCC
14458 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
14459 GCC warning about yyerrlab1 being unused if YYERROR is unused.
14460 (yyerrlab2): New label, which yyerrlab now falls through to.
14461 Compute the error's location by applying YYLLOC_DEFAULT to
14462 the locations of all the symbols that went into the error.
14463 * doc/bison.texinfo (Location Default Action): Mention that
14464 YYLLOC_DEFAULT is also invoked for syntax errors.
14465 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
14466 Error locations include the locations of all the tokens that were
14467 discarded, not just the last token.
14468
144692002-12-26 Paul Eggert <eggert@twinsun.com>
14470
14471 * src/files.c: Include quote.h.
14472 (compute_output_file_names): Warn if we detect conflicting
14473 outputs to the same file. This should catch the misunderstanding
14474 exemplified by Debian Bug 165349, reported by Bruce Stephens..
14475
14476 * src/conflicts.c (conflicts_print): If the user specifies
14477 "%expect N", report an error if there are any reduce/reduce
14478 conflicts. This is what the manual says should happen.
14479 This fixes Debian bug 130890, reported by Anthony DeRobertis.
14480 * tests/conflicts.at (%expect with reduce conflicts): New test.
14481
14482 Don't use m4_include on relative file names, as it doesn't work as
14483 desired if there happens to be a file with that name under ".".
14484
14485 * m4sugar/version.m4: Remove; it was included but it wasn't used.
14486 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
14487 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
14488 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
14489 * src/output.c (output_skeleton): Use full path names when
14490 specifying a file to include; don't rely on include path, as
14491 it's unreliable when the working file contains a file with
14492 that name.
14493
144942002-12-25 Paul Eggert <eggert@twinsun.com>
14495
14496 Remove obsolete references to bison.simple and bison.hairy.
14497 Problem mentioned by Aubin Mahe in
14498 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
14499 * data/glr.c: Comment fix.
14500 * doc/bison.1: Remove references. Also, mention "yacc".
14501
14502 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
14503 with -g option.
14504
14505 * src/parse-gram.y (declaration): Use enum "report_states" rather
14506 than its numeric value 1.
14507
14508 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
14509 opening a new one. This fixes Debian bug 165349, reported by
14510 Bruce Stephens.
14511
145122002-12-24 Paul Eggert <eggert@twinsun.com>
14513
14514 Version 1.75e.
14515
14516 * Makefile.maint (cvs-update): Don't assume that the shell
14517 supports $(...), as Solaris sh doesn't.
14518
14519 * src/parse-gram.y (lloc_default): Remove test for empty
14520 nonterminals at the end, since it didn't change the result.
14521
145222002-12-24 Paul Eggert <eggert@twinsun.com>
14523
14524 If the user does not define YYSTYPE as a macro, Bison now declares it
14525 using typedef instead of defining it as a macro. POSIX requires this.
14526 For consistency, YYLTYPE is also declared instead of defined.
14527
14528 %union directives can now have a tag before the `{', e.g., the
14529 directive `%union foo {...}' now generates the C code
14530 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
14531 The default union tag is `YYSTYPE', for compatibility with Solaris 9
14532 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
14533 instead of `yyltype'.
14534
14535 `yystype' and `yyltype' are now obsolescent macros instead of being
14536 typedefs or tags; they are no longer documented and will be
14537 withdrawn in a future release.
14538
14539 * data/glr.c (b4_location_type): Remove.
14540 (YYSTYPE): Renamed from yystype.
14541 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
14542 (struct YYLTYPE): Renamed from struct yyltype.
14543 (YYLTYPE): Renamed from yyltype.
14544 (yyltype, yystype): New (and obsolescent) macros,
14545 for backward compatibility.
14546 * data/yacc.c: Likewise.
14547
14548 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
14549 does not specify a union tag. This is for compatibility with
14550 Solaris 9 yacc.
14551
14552 * src/parse-gram.y (add_param): 2nd arg is now char * not char
14553 const *, since it is now modified by stripping surrounding { }.
14554 (current_braced_code): Remove.
14555 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
14556 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
14557 trailing " {...}". Now of type <chars>.
14558 (grammar_declaration): Adjust to bundled tokens.
14559 (code_content): Remove; stripping is now done by add_param.
14560 (print_token_value): Print contents of bundled tokens.
14561 (token_name): New function.
14562
14563 * src/reader.h (braced_code, current_braced_code): Remove.
14564 (token_name): New decl.
14565
14566 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
14567 token_type, not braced_code code_kind. All uses changed.
14568 (SC_PRE_CODE): New state, for scanning after a keyword that
14569 has (or usually has) an immediately-following braced code.
14570 (token_type): New local var, to keep track of which token type
14571 to return when scanning braced code.
14572 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
14573 <INITIAL>"%parse-param", <INITIAL>"%printer",
14574 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
14575 instead of returning a token type immediately.
14576 (<INITIAL>"{"): Set token type.
14577 (<SC_BRACED_CODE>"}"): Use it.
14578 (handle_action_dollar, handle_action_at): Now returns bool
14579 indicating success. Fail if ! current_rule; this prevents a core dump.
14580 (handle_symbol_code_dollar, handle_symbol_code_at):
14581 Remove; merge body into caller.
14582 (handle_dollar, handle_at): Complain in invalid contexts.
14583
14584 * NEWS, doc/bison.texinfo: Document the above.
14585 * NEWS: Fix years and program names in copyright notice.
14586
145872002-12-17 Paul Eggert <eggert@twinsun.com>
14588
14589 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
14590 Reporting, Table of Symbols): Omit mentions of %lex-param and
14591 %parse-param from the documentation for now.
14592
145932002-12-15 Paul Eggert <eggert@twinsun.com>
14594
14595 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
14596 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
14597 lookahead symbol, and which sets yychar in parser actions) and it
14598 disagreed with the Bison documentation. Bug
14599 reported by Andrew Walrond.
14600
14601 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
14602 as the caller now does that.
14603 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
14604 (YYEMPTY): Parenthesize right hand side, since others use it.
14605 (yyparse): Don't assume that our generated code is the only code
14606 that sets yychar.
14607
146082002-12-13 Paul Eggert <eggert@twinsun.com>
14609
14610 Version 1.75d.
14611
14612 POSIX requires a "yacc" command.
14613 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
14614 (MOSTLYCLEANFILES): Add yacc.
14615 (yacc): New rule.
14616 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
14617 as an alias for bison y.
14618
14619 * po/LINGUAS: Add da.
14620
14621 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
14622 problem with latest <getopt.h>.
14623 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
14624
14625 * doc/fdl.texi: Upgrade to 1.2.
14626 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
14627 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
14628 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
14629 gnulib.
14630 * config/install-sh: Sync with autotools.
14631
14632 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
14633 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
14634 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
14635 locations are requested.
14636 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
14637 locations are requested.
14638
146392002-12-12 Paul Eggert <eggert@twinsun.com>
14640
14641 Remove unportable casts and storage allocation tricks.
14642 While we're at it, remove almost all casts, since they
14643 usually aren't needed and are a sign of trouble.
14644
14645 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
14646
14647 * src/derives.c (derives_compute): Do not subtract NTOKENS from
14648 the pointer DSET returned by malloc; this isn't portable.
14649 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
14650 Similarly for DERIVES.
14651 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
14652 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
14653 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
14654
14655 * src/derives.c (derives_compute): Do not bother invoking
14656 int_of_rule_number, since rule numbers are integers.
14657
14658 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
14659 rather than XMALLOC (char, N).
14660
14661 * src/files.c (filename_split): Rewrite to avoid cast.
14662
14663 * src/gram.h (symbol_number_as_item_number,
14664 item_number_as_symbol_number, rule_number_as_item_number,
14665 item_number_as_rule_number):
14666 Now inline functions rather than macros, to avoid casts.
14667 * src/state.h (state_number_as_int): Likewise.
14668 * src/tables.c (state_number_to_vector_number,
14669 symbol_number_to_vector_number): Likewise.
14670
14671 * src/gram.h (int_of_rule_number): Remove; no longer used.
14672
14673 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
14674 since the resulting storage is always stored into.
14675
14676 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
14677 where it's needed.
14678
14679 * src/muscle_tab.c (muscle_m4_output):
14680 Now inline. Return bool, not int.
14681 * src/state.c (state_compare): Likewise.
14682 * src/symtab.c (symbol_check_defined,
14683 symbol_check_alias_consistency, symbol_pack, symbol_translation,
14684 hash_compare_symbol, hash_symbol):
14685 Likewise.
14686 * src/uniqstr.c (uniqstr_print): Likewise.
14687 * src/muscle_tab.c (muscle_m4_output_processor):
14688 New function, to avoid casts.
14689 * src/state.c (state_comparator, stage_hasher): Likewise.
14690 * src/symtab.c (symbol_check_defined_processor,
14691 symbol_check_alias_consistency_processor, symbol_pack_processor,
14692 symbol_translation_processor, hash_symbol_comparator,
14693 hash_symbol_hasher): Likewise.
14694 * src/uniqstr.c (uniqstr_print_processor): Likewise.
14695 * src/muscle_tab.c (muscles_m4_output):
14696 Use new functions instead of casting old functions unportably.
14697 * src/state.c (state_hash_new): Likewise.
14698 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
14699 symbols_token_translations_init):
14700 Likewise.
14701 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
14702
14703 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
14704 var instead of casting to long, to avoid casts.
14705 (prepare_states): Use MALLOC rather than alloca, so that we don't
14706 have to worry about alloca.
14707 * src/state.c (state_hash_lookup): Likewise.
14708
14709 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
14710 local var instead of casting to unsigned char, to avoid casts.
14711
14712 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
14713 STATE_ALLOC): Remove.
14714 (transitions_new, errs_new, reductions_new, state_new): Use malloc
14715 rather than calloc, and use offsetof to avoid allocating slightly
14716 too much storage.
14717 (state_new): Initialize all members.
14718
14719 * src/state.c (state_hash): Use unsigned accumulator, not signed.
14720
14721 * src/symtab.c (symbol_free): Remove; unused.
14722 (symbol_get): Remove cast in lhs of assignment.
14723 (symbols_do): Now static. Accept generic arguments, not
14724 hashing-related ones.
14725
14726 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
14727 (symbol_processor): Remove.
14728 (symbols_do): Remove decl; now static.
14729
14730 * src/system.h (alloca): Remove; decl no longer needed.
14731 (<stddef.h>): Include, for offsetof.
14732 (<inttypes.>, <stdint.h>): Include if available.
14733 (uintptr_t): New type, if system lacks it.
14734 (CALLOC, MALLOC, REALLOC): New macros.
14735 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
14736 new macros.
14737
14738 * src/tables.c (table_size): Now int, to pacify GCC.
14739 (table_grow, table_ninf_remap): Use signed table size.
14740 (save_row): Don't bother initializing locals when not needed.
14741 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
14742 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
14743
14744 * src/vcg.h: Correct misspellings.
14745
14746 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
14747
14748
14749 * src/getargs.c (getargs): Don't assume EOF == -1.
14750
147512002-12-09 Paul Eggert <eggert@twinsun.com>
14752
14753 Change identifier spellings to avoid collisions with names
14754 that are reserved by POSIX.
14755
14756 Don't use names ending in _t, since POSIX reserves them.
14757 For consistency, remove _e and _s endings -- they're weren't
14758 needed to remove ambiguity. All uses changed.
14759 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
14760 turn was just renamed from struniq_t.
14761 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
14762 which in turn was just renamed from struniq_processor_t.
14763 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
14764 in turn was renamed from hash_compare_struniq_t.
14765 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
14766 (state_list): Renamed from state_list_t.
14767 * src/assoc.h (assoc): Renamed from assoc_t.
14768 * src/conflicts.c (enum conflict_resolution): Renamed from
14769 enum conflict_resolution_e.
14770 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
14771 (rule_list): Renamed from rule_list_t.
14772 * src/getargs.h (enum trace): Renamed from enum trace_e.
14773 (enum report): Renamed from enum report_e.
14774 * src/gram.h (item_number): Renamed from item_number_t.
14775 (rule_number): Renamed from rule_number_t.
14776 (struct rule_s): Remove the "rule_s" part; not used.
14777 (rule): Renamed from rule_t.
14778 (rule_filter): Renamed from rule_filter_t.
14779 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
14780 (goto_list): Renamed from goto_list_t.
14781 * src/lalr.h (goto_number): Renamed from goto_number_t.
14782 * src/location.h (location): Renamed from location_t.
14783 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
14784 and moved here from:
14785 * src/muscle_tab.h (muscle_entry_t): here.
14786 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
14787 (rule_list): Renamed from rule_list_t.
14788 * src/print_graph.c (static_graph): Renamed from graph.
14789 * src/reader.h (braced_code): Renamed from braced_code_t.
14790 Remove brace_code_e tag.
14791 * src/relation.h (relation_node): Renamed from relation_node_t.
14792 (relation_nodes): Renamed from relation_nodes_t.
14793 (relation): Renamed from relation_t.
14794 * src/state.h (state_number): Renamed from state_number_t.
14795 (struct state): Renamed from struct state_s.
14796 (state): Renamed from state_t.
14797 (transitions): Renamed from transitions_t. Unused (and
14798 misspelled) transtion_s tag removed.
14799 (errs): Renamed from errs_t. Unused errs_s tag removed.
14800 (reductions): Renamed from reductions_t. Unused tag
14801 reductions_s removed.
14802 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
14803 (struct symbol_list): Renamed from struct symbol_list_s.
14804 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
14805 (struct symbol): Renamed from struct symbol_s.
14806 (symbol): Renamed from symbol_t.
14807 * src/tables.c (vector_number): Renamed from vector_number_t.
14808 (action_number): Renamed from action_t.
14809 * src/tables.h (base_number): Renamed from base_t.
14810 * src/vcg.h (enum color): Renamed from enum color_e.
14811 (enum textmode): Renamed from enum textmode_e.
14812 (enum shape): Renamed from enum shape_e.
14813 (struct colorentry): Renamed from struct colorentry_s.
14814 (struct classname): Renamed from struct classname_s.
14815 (struct infoname): Renamed from struct infoname_s.
14816 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
14817 (enum decision): Renamed from enum decision_e.
14818 (enum orientation): Renamed from enum orientation_e.
14819 (enum alignment): Renamed from enum alignment_e.
14820 (enum arrow_mode): Renamed from enum arrow_mode_e.
14821 (enum crossing_type): Renamed from enum crossing_type_e.
14822 (enum view): Renamed from enum view_e.
14823 (struct node): Renamed from struct node_s.
14824 (node): Renamed from node_t.
14825 (enum linestyle): Renamed from enum linestyle_e.
14826 (enum arrowstyle): Renamed from enum arrowstyle_e.
14827 (struct edge): Renamed from struct edge.
14828 (edge): Renamed from edge_t.
14829 (struct graph): Renamed from struct graph_s.
14830 (graph): Renamed from graph_t.
14831 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
14832 Rename value_t -> value.
14833 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
14834 value_t_as_yystype -> value_as_yystype.
14835
14836 Don't include <errno.h> in the mainstream code, since it
14837 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
14838 * lib/get-errno.c, lib/get-errno.h: New files.
14839 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
14840 get-errno.c.
14841 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
14842 * src/output.c (output_skeleton): Likewise.
14843 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
14844 instead of errno.
14845 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
14846 Likewise.
14847 (handle_action_dollar, handle_action_at): Likewise.
14848 * src/system.h: Do not include <errno.h>.
14849 (TAB_EXT): Renamed from EXT_TAB.
14850 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
14851
14852 Avoid str[a-z]*, since <string.h> reserves that name space.
14853 Change all instances of "struniq" in names to "uniqstr", and
14854 likewise for "STRUNIQ" and "UNIQSTR".
14855 * src/uniqstr.c: Renamed from src/struniq.c.
14856 * src/uniqstr.h: Renamed from src/struniq.h.
14857 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
14858 * src/files.c (strsuffix): Remove; unused.
14859 (concat2): Renamed from stringappend. Now static.
14860 * src/files.h (strsuffix, stringappend): Remove; unused.
14861 * src/parse-gram.y (<chars>): Renamed from <string>.
14862 (<uniqstr>): Renamed from <struniq>.
14863 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
14864 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
14865 (struct graph_s.expand): Renamed from struct graph_s.stretch.
14866 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
14867 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
14868 (N_EXPAND): Renamed from N_STRETCH.
14869
14870 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
14871 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
14872 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
14873 Remove; unused.
14874 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
14875 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
14876 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
14877 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
14878 (BASE_MAXIMUM): Renamed from BASE_MAX.
14879 (BASE_MINIMUM): Renamed from BASE_MIN.
14880 (ACTION_MAX): Remove; unused.
14881 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
14882 Unnecessary casts removed from above defines.
14883
14884
14885 Fix misspelling in names.
14886 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
14887 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
14888 G_NODE_ALIGNEMENT.
14889
14890
14891 * lib/timevar.c (timevar_report): Renamed from time_report,
14892 for consistency with other names.
14893 * lib/timevar.h (timevar_report): New decl.
14894 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
14895
14896
14897 Sort include-file uses.
14898
14899 Reorder all include files under src to be in the order "system.h".
14900 then the ../lib include files in angle brackets (alphabetized),
14901 then the . include files in double-quotes (alphabetized). Fix
14902 dependency breakages encountered in this process, as follows:
14903 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
14904 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
14905 * src/state.h: Include "symtab.h".
14906
149072002-12-08 Paul Eggert <eggert@twinsun.com>
14908
14909 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
14910 since this causes problems when __file__ contains character
14911 sequences like "@" that are treated specially by src/scan-skel.l.
14912 Instead, just use the file's basename. This fixes the bug
14913 reported by Martin Mokrejs in
14914 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
14915
149162002-12-06 Paul Eggert <eggert@twinsun.com>
14917
14918 Add support for rules that do not have trailing semicolons, as
14919 POSIX requires. Improve the quality of locations in Bison
14920 diagnostics.
14921
14922 * src/location.c: Include <quotearg.h>.
14923 (empty_location): Now const.
14924 (location_print): New function. Follow the recommendation of the
14925 GNU Coding Standards for locations that span file boundaries.
14926 * src/location.h: Do not include <quotearg.h>; no longer needed.
14927 (boundary): New type.
14928 (location_t): Use it. This allows locations to span file boundaries.
14929 All member uses changed: file -> start.file or end.file (as needed),
14930 first_line -> start.line, first_column -> start.column,
14931 last_line -> end.line, last_column -> end.column.
14932 (equal_boundaries): New function.
14933 (LOCATION_RESET, LOCATION_STEP): Remove.
14934 (LOCATION_PRINT): Remove. All callers changed to use location_print.
14935 (empty_location): Now const.
14936 (location_print): New decl.
14937 * src/parse-gram.y (lloc_default): New function, which handles
14938 empty locations more accurately.
14939 (YYLLOC_DEFAULT): Use it.
14940 (%token COLON): Remove.
14941 (%token ID_COLON): New token.
14942 (rules): Use it.
14943 (declarations, rules): Remove trailing semicolon.
14944 (declaration, rules_or_grammar_declaration):
14945 Allow empty (";") declaration.
14946 (symbol_def): Remove empty actions; no longer needed.
14947 (rules_or_grammar_declaration): Remove trailing semicolon.
14948 (semi_colon.opt): Remove.
14949 * src/reader.h: Include location.h.
14950 (scanner_cursor): New decl.
14951 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
14952 rolling our own.
14953 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
14954 of *loc.
14955 (STEP): Remove. No longer needed, now that adjust_location does
14956 the work. All uses removed.
14957 (scanner_cursor): New var.
14958 (adjust_location): Renamed from extend_location. It now sets
14959 *loc and adjusts the scanner cursor. All uses changed.
14960 Don't bother testing for CR.
14961 (handle_syncline): Remove location arg; now updates scanner cursor.
14962 All callers changed.
14963 (unexpected_end_of_file): Now accepts start boundary of token or
14964 comment, not location. All callers changed. Update scanner cursor,
14965 not the location.
14966 (SC_AFTER_IDENTIFIER): New state.
14967 (context_state): Renamed from c_context. All uses changed.
14968 (id_loc, code_start, token_start): New local vars.
14969 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
14970 processing of Yacc white space and equivalents here.
14971 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
14972 instead of returning ID immediately, since we need to search for
14973 a subsequent colon.
14974 (<INITIAL>"'", "\""): Save token_start.
14975 (<INITIAL>"%{", "{", "%%"): Save code_start.
14976 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
14977 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
14978 BEGIN context_state at end, not INITIAL.
14979 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
14980 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
14981 Return correct token start.
14982 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
14983 the start of a character, string or multiline comment is found.
14984 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
14985 Reduction): Adjust reported locations to match the more-precise
14986 results now expected.
14987 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
14988 * tests/reduce.at (Useless Rules, Reduced Automaton,
14989 Underivable Rules): Likewise.
14990 * tests/regression.at (Invalid inputs): No longer `expecting ";"
14991 or "|"' now that so many other tokens are allowed by the new grammar.
14992
14993 * src/complain.h (current_file): Remove duplicate decl;
14994 current_file is now owned by files.h.
14995 * src/complain.c, src/scan-gram.l: Include files.h.
14996
149972002-12-06 Paul Eggert <eggert@twinsun.com>
14998
14999 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
15000 promotes to int; it might be unsigned int.
15001 * data/yacc.c (yy_reduce_print): Likewise.
15002
15003 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
15004 be #defined in the prologue, not in the Bison declarations.
15005 This fixes Debian Bug 102878, reported by Shaul Karl.
15006
150072002-12-02 Paul Eggert <eggert@twinsun.com>
15008
15009 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
15010 * lib/strtoul.c: New file, from gnulib.
15011 This fixes a porting bug reported by Peter Klein in
15012 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
15013
150142002-11-30 Paul Eggert <eggert@twinsun.com>
15015
15016 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
15017 and put only a forward declaration in the prologue. This is for
15018 consistency with the other scanner helper functions.
15019
15020 Type clashes now generate warnings, not errors, since it
15021 appears that POSIX may allow some grammars with type clashes.
15022 * src/reader.c (grammar_current_rule_check): Warn about
15023 type clashes instead of complaining.
15024 * tests/input.at (Type Clashes): Expect warnings, not complaints.
15025
15026 Add Yacc library, since POSIX requires it.
15027 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
15028 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
15029 * lib/main.c, lib/yyerror.c: New files.
15030
15031 gram_error can be static; it need not be extern.
15032 * src/reader.h (gram_error): Remove decl.
15033 * src/parse-gram.y (gram_error): Now static. Add static decl.
15034 (print_token_value): Omit parameter names from forward decl,
15035 for consistency.
15036
150372002-11-29 Paul Eggert <eggert@twinsun.com>
15038
15039 * doc/bison.texinfo: Emphasize that yylex and yyerror must
15040 be declared before being used. E.g., one should typically
15041 declare them in the prologue. Use GNU coding style in examples.
15042 Put "const" consistently after the type it modifies. Mention
15043 that C99 supports "inline". Mention that yyerror traditionally
15044 returns "int".
15045
15046 %parse-param and %lex-param now take just one argument, the
15047 declaration; the argument name is deduced from the declaration.
15048
15049 * doc/bison.texinfo (Parser Function, Pure Calling, Error
15050 Reporting, Table of Symbols): Document this.
15051 * src/parse-gram.y (add_param): New function.
15052 (COMMA): Remove.
15053 (declaration): Implement new rule for %parse-param and %lex-param.
15054 * src/scan-gram.l: "," now elicits a warning, rather than being
15055 a token; this is more compatible with byacc.
15056 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
15057
150582002-11-27 Paul Eggert <eggert@twinsun.com>
15059
15060 Rename identifiers to avoid real and potential collisions.
15061
15062 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
15063 to avoid collision with lex macro described by Bruce Lilly in
15064 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
15065 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
15066 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
15067 * src/parse-gram.y (print_token_value): Renamed from yyprint.
15068 All uses changed.
15069 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
15070 The name "yycontrol" violates the name space rules, and this stuff
15071 wasn't being used anyway.
15072 (input): Remove action; this stuff wasn't being used.
15073 (gram_error): Rename local variable yylloc -> loc.
15074 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
15075 (YY_DECL): Don't use "yy" at start of local variables.
15076 All uses changed, e.g., yylloc -> loc.
15077 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
15078 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
15079 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
15080 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
15081
15082 * src/parse-gram.y (gram_error): loc is now const *.
15083 * src/reader.h (gram_error): Likewise.
15084
150852002-11-24 Paul Eggert <eggert@twinsun.com>
15086
15087 Version 1.75c.
15088
15089 * tests/actions.at (Actions after errors): Use an output format
15090 more similar to that of the Printers and Destructors test.
15091 Test the position of the ';' token too.
15092 (Printers and Destructors): Likewise.
15093 (Printers and Destructors: %glr-parser): Remove for now, to avoid
15094 unnecessarily alarming people when the test fails.
15095
15096 * data/yacc.c (yyerrlab1): Move this label down, so that the
15097 parser does not discard the lookahead token if the user code
15098 invokes YYERROR. This change is required for POSIX conformance.
15099
15100 * lib/error.c: Sync with gnulib.
15101
151022002-11-22 Paul Eggert <eggert@twinsun.com>
15103
15104 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
15105 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
15106 * lib/xmalloc.c: Likewise.
15107
151082002-11-20 Paul Eggert <eggert@twinsun.com>
15109
15110 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
15111
151122002-11-20 Paul Eggert <eggert@twinsun.com>
15113
15114 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
15115 should use `if (! x) abort ();' rather than `assert (x);', and
15116 anyway it's one less thing to worry about configuring.
15117
15118 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
15119 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
15120 and replace all instances of assert with abort.
15121 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
15122 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
15123
15124 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
15125 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
15126 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
15127 hash_find_entry, hash_rehash, hash_insert): Likewise.
15128 * src/conflicts.c (resolve_sr_conflict): Likewise.
15129 * src/lalr.c (set_goto_map, map_goto): Likewise.
15130 * src/nullable.c (nullable_compute): Likewise.
15131 * src/output.c (prepare_rules, token_definitions_output): Likewise.
15132 * src/reader.c (packgram, reader): Likewise.
15133 * src/state.c (state_new, state_free, state_transitions_set,
15134 state_reduction_find): Likewise.
15135 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
15136 symbol_pack): Likewise.
15137 * src/tables.c (conflict_row, pack_vector): Likewise.
15138 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
15139 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
15140 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
15141 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
15142
15143 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
15144 (ARGMATCH_CONSTRAINT): New macro.
15145 (ARGMATCH_ASSERT): Use it.
15146
15147 * src/system.h (verify): New macro.
15148 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
15149 rather than assert.
15150 * src/tables.c (tables_generate): Likewise.
15151
15152 * src/struniq.c (struniq_assert): Now returns void, and aborts
15153 if the assertion is false.
15154 (struniq_assert_p): Remove.
15155 * src/struniq.h: Likewise.
15156
151572002-11-18 Paul Eggert <eggert@twinsun.com>
15158
15159 * data/glr.c (yygetLRActions): Replace `yyindex' with
15160 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
15161 This fixes the regression with Sun ONE Studio 7 cc that I reported in
15162 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
15163
151642002-11-18 Akim Demaille <akim@epita.fr>
15165
15166 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
15167 space.
15168 From Tim Van Holder.
15169
151702002-11-17 Paul Eggert <eggert@twinsun.com>
15171
15172 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
15173 to "SyntaxError" for consistency with my 2002-11-15 change.
15174
15175 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
15176 not define to {}, since this breaks the common use of `YYDPRINTF
15177 ((...));' if a single statement is desired (e.g. before `else').
15178 Work around GCC warnings by surrounding corresponding calls with
15179 {} if needed.
15180 (yyhasResolvedValue): Remove unused function.
15181 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
15182 loop body.
15183 (yyreportSyntaxError): Renamed from yyreportParseError.
15184 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
15185 All uses changed.
15186 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
15187 extern when possible. Remove unused initializations.
15188
151892002-11-16 Akim Demaille <akim@epita.fr>
15190
15191 Augment the similarity between GLR and LALR traces.
15192
15193 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
15194 (YY_REDUCE_PRINT): New.
15195 (yyparse): Use them.
15196 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
15197 YYDPRINT here.
15198 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
15199 state reached after the reduction/recovery, since...
15200 (yyparse, yyprocessOneStack): Report the state we are entering in.
15201
152022002-11-16 Akim Demaille <akim@epita.fr>
15203
15204 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
15205 Add support for --trace=skeleton.
15206 * src/scan-skel.l: %option debug.
15207 Scan strings of non-@ or \n instead of character by character.
15208 (scan_skel): Handle trace_skeleton.
15209 (QPUTS): New.
15210 (@output_parser_name@, @output_header_name@): ``Restore'' their
15211 support (used to be M4 macros).
15212 * data/yacc.c: Quote larger chunks, a la glr.c.
15213 * data/lalr1.cc: Likewise.
15214 The header guards are no longer available, so use some other
15215 string than `YYLSP_NEEDED'.
15216
152172002-11-16 Akim Demaille <akim@epita.fr>
15218
15219 Make the ``Printers and Destructors'' test more verbose, taking
15220 `yacc.c''s behavior as (possibly wrong) reference.
15221
15222 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
15223 instead of fprint on stdout.
15224 Set and report the last_line of the symbols.
15225 Consistently display values and locations.
15226
152272002-11-16 Paul Eggert <eggert@twinsun.com>
15228
15229 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
15230
152312002-11-15 Paul Eggert <eggert@twinsun.com>
15232
15233 * tests/actions.at (Actions after errors): New test case.
15234
15235 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
15236 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
15237 tests/action.at, tests/calc.at, tests/conflicts.at,
15238 tests/cxx-type.at, tests/regression.at:
15239 "parse error" -> "syntax error" for POSIX compatibility.
15240 "parsing stack overflow..." -> "parser stack overflow" so
15241 that code matches Bison documentation.
15242
152432002-11-15 Akim Demaille <akim@epita.fr>
15244
15245 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
15246 take two BRACED_CODE, not two string_content.
15247 Free the scanner's obstack when we are done.
15248 (code_content): New.
15249 * tests/calc.at: Adjust.
15250 * doc/bison.texinfo: Adjust.
15251 Also, make sure to include the `,' for these declarations.
15252
152532002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
15254
15255 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
15256 definition; avoids potential autoreconf problems.
15257
152582002-11-15 Akim Demaille <akim@epita.fr>
15259
15260 Always check the value returned by yyparse.
15261
15262 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
15263 returned by yyparse.
15264 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
15265 Adjust calls.
15266 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
15267 returned by yyparse.
15268
152692002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15270
15271 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
15272 on input.at test.
15273
152742002-11-14 Paul Eggert <eggert@twinsun.com>
15275
15276 * src/output.c (output_skeleton): Call xfopen instead of
15277 duplicating xfopen's body.
15278
15279 Fix bugs reported by Nelson H. F. Beebe in
15280 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
15281
15282 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
15283 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
15284 Group compiler. Instead, use "$CC -E bar.c". Include the .h
15285 file twice in the grammar, as an extra check.
15286
15287 * tests/input.at (Torturing the Scanner): Surround the
15288 backslash-newline tests with "#if 0", to make it less likely that
15289 we'll run into compiler bugs. Bring back solitary \ inside
15290 comment, but add a closing comment to work around HP C bug. Don't
15291 test backslash-newline in C character constant.
15292
152932002-11-14 Akim Demaille <akim@epita.fr>
15294
15295 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
15296 status of the compiler.
15297 Calling `exit 1' is no longer needed.
15298 Reported by Nelson H. F. Beebe.
15299
153002002-11-14 Akim Demaille <akim@epita.fr>
15301
15302 * tests/atlocal.in (CPPFLAGS): We have config.h.
15303 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
15304 New.
15305 * tests/actions.at, tests/calc.at, tests/conflicts.at,
15306 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
15307 * tests/regression.at, tests/torture.at: Use them for all the
15308 grammars that are to be compiled.
15309 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
15310 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
15311 * doc/bison.texinfo (GLR Parsers): Document `inline'.
15312
153132002-11-14 Akim Demaille <akim@epita.fr>
15314
15315 * doc/bison.texinfo: Various formatting changes (alignments in
15316 samples, additional @group/@end group, GCS in samples.
15317 Use @deffn instead of simple @table to define the directives,
15318 macros, variables etc.
15319
153202002-11-13 Paul Eggert <eggert@twinsun.com>
15321
15322 Fix some bugs reported by Albert Chin-A-Young in
15323 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
15324
15325 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
15326 -o c"; the HP C compiler chatters during compilation.
15327 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
15328 * tests/headers.at (export YYLTYPE): Likewise.
15329
15330 * tests/input.at (Torturing the Scanner): Remove lines containing
15331 solitary backslashes, as they tickle a bug in the HP C compiler.
15332
15333 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
15334 comments, since they're not portable. Use GNU coding style.
15335
153362002-11-13 Akim Demaille <akim@epita.fr>
15337
15338 * data/yacc.c: Leave bigger chunks of quoted text.
15339 (YYDSYMPRINTF): New.
15340 Use it to report symbol activities.
15341 * data/glr.c (YYDSYMPRINTF): New.
15342 Use it.
15343
153442002-11-12 Paul Eggert <eggert@twinsun.com>
15345
15346 Version 1.75b.
15347
15348 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
15349 (yyglrReduce): Return yyok, not 0.
15350 This should avoid the enumerated-type warnings reported
15351 by Nelson H. F. Beebe in
15352 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
15353
15354 * lib/bbitset.h (BITSET_INLINE): Remove.
15355 * lib/bitset.h [! BITSET_INLINE]: Remove.
15356 (bitset_set, bitset_reset, bitset_test): Rename local vars
15357 to avoid shadowing warnings by GCC.
15358
15359 * data/glr.c (inline): Remove #define. It's the user's
15360 responsibility to #define it away, just like 'const'.
15361 This fixes one of the bugs reported by Nelson H. F. Beebe in
15362 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
15363
15364 * Makefile.maint (po-check): Scan .l and .y files instead of the
15365 .c and the .h files that they generate. This fixes the bug
15366 reported by Tim Van Holder in:
15367 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
15368 Look for N_ as well as for _. Try to avoid matching #define for
15369 N_ and _.
15370 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
15371 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
15372 * src/scan-gram.l: Revamp regular expressions so that " and '
15373 do not confuse xgettext.
15374
15375 * src/struniq.h (struniq_new): Do not declare the return type
15376 to be 'const'; this violates the C standard.
15377 * src/struniq.c (struniq_new): Likewise.
15378
153792002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
15380
15381 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
15382 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
15383 linker.
15384
153852002-11-12 Akim Demaille <akim@epita.fr>
15386
15387 * Makefile.maint: Sync with Autoconf:
15388 (local_updates): New.
15389
153902002-11-12 Akim Demaille <akim@epita.fr>
15391
15392 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
15393
153942002-11-12 Akim Demaille <akim@epita.fr>
15395
15396 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
15397 locations.
15398
153992002-11-12 Akim Demaille <akim@epita.fr>
15400
15401 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
15402 not yyvalue.
15403
154042002-11-12 Akim Demaille <akim@epita.fr>
15405
15406 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
15407 Use it to test the GLR parser.
15408
154092002-11-12 Akim Demaille <akim@epita.fr>
15410
15411 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
15412 defines it.
15413 * data/glr.c (yystos): New.
15414 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
15415 (YYDSYMPRINT): New.
15416 (yyval): Don't define it, it is handled via M4.
15417 (yyrecoverParseError): Free verbosely the discarded symbols.
15418 * data/yacc.c (yysymprint): Remove, rather...
15419 (b4_yysymprint_generate): invoke.
15420 * data/c.m4 (b4_yysymprint_generate): New.
15421 Accept pointers as arguments, as opposed to the version from
15422 yacc.c.
15423 (b4_yydestruct_generate): Likewise.
15424 * tests/cations.at (Printers and Destructors): Use Bison directives
15425 instead of CPP macros.
15426 Don't rely on internal details.
15427
154282002-11-12 Akim Demaille <akim@epita.fr>
15429
15430 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
15431 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
15432 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
15433 it against YYEMPTY and so forth), work on yytoken (i.e., set
15434 it to YYEMPTY etc.).
15435 (yydestruct): Replace with a b4_yydestruct_generate invocation.
15436 (b4_symbol_actions): Remove.
15437 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
15438 for 0, end-of-input.
15439
154402002-11-12 Akim Demaille <akim@epita.fr>
15441
15442 * doc/bison.texinfo (Destructor Decl): New.
15443
154442002-11-12 Akim Demaille <akim@epita.fr>
15445
15446 * src/tables.c (tables_generate): Use free for pointers that
15447 cannot be NULL, not XFREE.
15448 (pack_vector): Use assert, not fatal, for bound violations.
15449 * src/state.c (state_new): Likewise.
15450 * src/reader.c (reader): Likewise.
15451 * src/lalr.c (set_goto_map): Likewise.
15452 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
15453 the file name.
15454
154552002-11-12 Akim Demaille <akim@epita.fr>
15456
15457 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
15458 Restore.
15459 * src/scan-gram.l (last_string): Is global to the file, not to
15460 yylex.
15461 * src/parse-gram.y (input): Don't append the epilogue here,
15462 (epilogue.opt): do it here, and free the scanner's obstack.
15463 * src/reader.c (epilogue_set): Rename as...
15464 (epilogue_augment): this.
15465 * data/c.m4 (b4_epilogue): Defaults to empty.
15466
154672002-11-12 Akim Demaille <akim@epita.fr>
15468
15469 * src/getargs.c (long_options): Remove duplicates.
15470 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
15471 Remove.
15472 * doc/bison.rnh: Remove.
15473 * doc/bison.texinfo (VMS Invocation): Remove.
15474
154752002-11-12 Akim Demaille <akim@epita.fr>
15476
15477 * src/struniq.h, src/struniq.c (struniq_t): Is const.
15478 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
15479
15480 Use struniq for symbols.
15481
15482 * src/symtab.h (symbol_t): The tag member is a struniq.
15483 (symbol_type_set): Adjust.
15484 * src/symtab.c (symbol_new): Takes a struniq.
15485 (symbol_free): Don't free the tag member.
15486 (hash_compare_symbol_t, hash_symbol_t): Rename as...
15487 (hash_compare_symbol, hash_symbol): these.
15488 Use the fact that tags as struniqs.
15489 (symbol_get): Use struniq_new.
15490 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
15491 Returns a strniq.
15492 * src/reader.h (merger_list, grammar_currentmerge_set): The name
15493 and type members are struniqs.
15494 * src/reader.c (get_merge_function)
15495 (grammar_current_rule_merge_set): Adjust.
15496 (TYPE, current_type): Are struniq.
15497
15498 Use struniq for file names.
15499
15500 * src/files.h, src/files.c (infile): Split into...
15501 (grammar_file, current_file): these.
15502 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
15503 * src/reduce.c (reduce_print): Likewise.
15504 * src/getargs.c (getargs): Likewise.
15505 * src/complain.h, src/complain.c: Likewise.
15506 * src/main.c (main): Call struniqs_new early enough to use it for
15507 file names.
15508 Don't free the input file name.
15509
155102002-11-12 Akim Demaille <akim@epita.fr>
15511
15512 * src/symtab.c (symbol_free): Remove dead deactivated code:
15513 type_name are properly removed.
15514 Don't use XFREE to free items that cannot be NULL.
15515 * src/struniq.h, src/struniq.c: New.
15516 * src/main.c (main): Initialize/free struniqs.
15517 * src/parse-gram.y (%union): Add astruniq member.
15518 (yyprint): Adjust.
15519 * src/scan-gram.l (<{tag}>): Return a struniq.
15520 Free the obstack bit that used to store it.
15521 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
15522
155232002-11-11 Paul Eggert <eggert@twinsun.com>
15524
15525 Revamp to fix many (but not all) of the C- and M4-related quoting
15526 problems. Among other things, this fixes the Bison bug reported
15527 by Jan Hubicka when processing the Bash grammar; see:
15528 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
15529
15530 Use new @ escapes consistently. Represent brackets with @{ and @}
15531 rather than @<:@ and @:>@, since this works a bit better with dumb
15532 editors like vi. Represent @ with @@, since @ is now consistently
15533 an escape. Use @oline@ and @ofile@ rather than __oline__ and
15534 __ofile__, to avoid unexpected expansions. Similarly, use @output
15535 rather than #output.
15536
15537 * data/c.m4 (b4_copyright): Omit file name from comment, since
15538 the file name could contain "*/".
15539 (b4_synclines_flag): Don't quote the 2nd argument; it should already
15540 be quoted. All uses changed.
15541
15542 * data/glr.c: Use new @ escapes consistently.
15543 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
15544 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
15545 Remove, since they couldn't handle arbitrary characters in file
15546 names.
15547 * data/lalr1.cc: Likewise.
15548 * data/yacc.c: Likewise.
15549
15550 * src/files.c (output_infix): Remove; all uses removed.
15551 * src/files.h: Likewise.
15552
15553 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
15554 mishandled funny characters in file names, and anyway it isn't
15555 needed any more.
15556 * data/yacc.c: Likewise.
15557 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
15558
15559 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
15560 * data/yacc.c: Likewise.
15561
15562 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
15563 strings now.
15564 (muscle_init): Quote filename as a C string.
15565 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
15566 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
15567 * src/output.c (escaped_file_name_output): New function.
15568 (prepare_symbols): Quote tokens for M4.
15569 (prepare): Don't insert output_infix, output_prefix,
15570 output_parser_name, output_header_name; this is now down by scan-skel.
15571 Insert skeleton as a C string.
15572
15573 * src/output.c (user_actions_output, symbol_destructors_output,
15574 symbol_printers_output): Quote filenames for C and M4.
15575 * src/reader.c (prologue_augment, epilogue_set): Likewise.
15576
15577 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
15578 escapes other than \\ and \'; this simplifies the code.
15579 (<SC_STRING>): Likewise, for \\ and \".
15580 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
15581 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
15582 Use new escapes @{ and @} for [ and ].
15583
15584 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
15585 them with auto vars.
15586 Switch to new escape scheme, where @ is the escape character uniformly.
15587 Abort if a stray escape character is found. Avoid unbounded input
15588 buffer when parsing non-escaped text.
15589
15590 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
15591 __oline__, #output, $@, and @{ do not have unintended meanings.
15592
155932002-11-09 Paul Eggert <eggert@twinsun.com>
15594
15595 Fix the test failure due to GCC warnings described in
15596 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
15597 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
15598 evaluate to 0 if it's impossible for NINF to be in the respective
15599 table.
15600 (yygetLRActions, yyrecoverParseError): Use them.
15601
15602 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
15603 counted in the token inserted at end of file. Now takes
15604 location_t *, not location_t, so that the location can be
15605 adjusted. All uses changed.
15606
15607 * tests/regression.at (Invalid inputs): Adjust wording in
15608 diagnostic to match the new behavior.
15609
15610 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
15611 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
15612 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
15613 abort ();'. This reduces the runtime of the "Many lookaheads"
15614 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
15615 GCC 3.2.
15616
156172002-11-07 Paul Eggert <eggert@twinsun.com>
15618
15619 * src/parse-gram.y (CHARACTER): Remove unused token.
15620 All uses removed.
15621
15622 * src/scan-gram.l: Remove stack option. We no longer use the
15623 stack, since the stack was never deeper than 1; instead, use the
15624 new auto var c_context to record the stacked value.
15625
15626 Remove nounput option. At an unexpected end of file, we now unput
15627 the minimal input necessary to end cleanly; this simplifies the
15628 code.
15629
15630 Avoid unbounded token sizes where this is easy.
15631
15632 (unexpected_end_of_file): New function.
15633 Use it to systematize the error message on unexpected EOF.
15634 (last-string): Now auto, not static.
15635 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
15636 (scanner_last_string_free): Remove; not used.
15637 (percent_percent_count): Move decl to just before use.
15638 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
15639 not the (never otherwised-used) CHARACTER.
15640
156412002-11-07 Akim Demaille <akim@epita.fr>
15642
15643 Let yyerror always receive the msg as last argument, so that
15644 yyerror can be variadic.
15645
15646 * data/yacc.c (b4_yyerror_args): New.
15647 Use it when calling yyerror.
15648 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
15649 Use it when calling yyerror.
15650 * doc/bison.texinfo (Error Reporting): Adjust.
15651 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
15652 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
15653
156542002-11-06 Akim Demaille <akim@epita.fr>
15655
15656 #line should have quoted strings.
15657 Ideally, this should be done by m4_quotearg.
15658
15659 * src/scan-skel.l: Include quotearg.h.
15660 Quote __ofile__.
15661 * src/output.c (symbol_printers_output)
15662 (symbol_destructors_output): Quote the file name.
15663
156642002-11-06 Akim Demaille <akim@epita.fr>
15665
15666 * tests/regression.at (Invalid inputs): Adjust to the recent
15667 messages.
15668
156692002-11-06 Akim Demaille <akim@epita.fr>
15670
15671 Restore --no-lines.
15672 Reported by Jim Kent.
15673
15674 * data/c.m4 (b4_syncline): New.
15675 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
15676 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
15677 * src/output.c (user_actions_output): Likewise.
15678 (prepare): Define 'b4_synclines_flag'.
15679 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
15680
156812002-11-06 Akim Demaille <akim@epita.fr>
15682
15683 * src/main.c (main): Free `infile'.
15684 * src/scan-gram.l (handle_syncline): New.
15685 Recognize `#line'.
15686 * src/output.c (user_actions_output, symbol_destructors_output)
15687 (symbol_printers_output): Use the location's file name, not
15688 infile.
15689 * src/reader.c (prologue_augment, epilogue_set): Likewise.
15690
156912002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15692
15693 * src/tables.c (matching_state): Don't allow states to match if
15694 either has GLR conflict entries.
15695
156962002-11-05 Paul Eggert <eggert@twinsun.com>
15697
15698 * src/scan-gram.l: Use more accurate diagnostics, e.g.
15699 "integer out of range" rather than "invalid value".
15700 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
15701 accordingly.
15702
15703 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
15704 Also, remove one static variable in the scanner.
15705
15706 * src/scan-gram.l (braces_level): Now auto, not static.
15707 Initialize to zero if the compiler is being picky.
15708 (INITIAL): Clear braces_level instead of incrementing it.
15709 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
15710 as POSIX 1003.1-2001 requires.
15711 * src/system.h (IF_LINT): New macro, taken from coreutils.
15712 * configure.ac: Define "lint" if --enable-gcc-warnings.
15713
157142002-11-05 Akim Demaille <akim@epita.fr>
15715
15716 * src/scan-gram.l: When it starts with `%', complain about the
15717 whole directive, not just that `invalid character: %'.
15718
157192002-11-04 Akim Demaille <akim@epita.fr>
15720
15721 * Makefile.maint: Update from Autoconf.
15722 (update, cvs-update, po-update, do-po-update): New.
15723
157242002-11-04 Akim Demaille <akim@epita.fr>
15725
15726 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
15727 and yyerror.
15728 Have yyerror `use' its arguments.
15729 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
15730 returns true when location & yacc & pure & parse-param.
15731 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
15732
157332002-11-04 Akim Demaille <akim@epita.fr>
15734
15735 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
15736 clashes.
15737 * src/scan-gram.l: Use [\'] instead of ['] to pacify
15738 font-lock-mode.
15739 Use complain_at.
15740 Use quote, not quote_n since LOCATION_PRINT no longer uses the
15741 slot 0.
15742
157432002-11-03 Paul Eggert <eggert@twinsun.com>
15744
15745 * src/reader.c (get_merge_function, grammar_current_rule_check):
15746 Use consistent diagnostics for reporting type name clashes.
15747 Quote the types with <>, for consistency with Yacc.
15748 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
15749
157502002-11-03 Akim Demaille <akim@epita.fr>
15751
15752 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
15753 New.
15754 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
15755 (b4_parse_param): Remove.
15756 Use b4_identification.
15757 Propagate b4_pure_args where needed to pass them to yyerror.
15758 * data/glr.m4 (b4_parse_param): Remove.
15759 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
15760 (b4_lpure_formals): New.
15761 Use b4_identification.
15762 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
15763 b4_user_formals and b4_user_args.
15764 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
15765 (yyreportAmbiguity): When using a pure parser, also need
15766 the location, and the parse-params.
15767 Adjust callers.
15768 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
15769 When using a pure parser, also need the parse-params.
15770 Adjust callers.
15771 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
15772 (%pure-parser + %parse-param) LALR and GLR parsers.
15773 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
15774 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
15775 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
15776 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
15777 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
15778 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
15779 * doc/bison.texinfo: Untabify the whole file.
15780 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
15781 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
15782 (Error Reporting): Adjust to these new directives.
15783 Document %error-verbose, deprecate YYERROR_VERBOSE.
15784
157852002-11-03 Akim Demaille <akim@epita.fr>
15786
15787 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
15788 AT_CHECK_CALC_GLR invocations to use % directives, instead of
15789 command line options.
15790 * tests/cxx-type.at: Formatting changes.
15791
157922002-11-03 Paul Eggert <eggert@twinsun.com>
15793
15794 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
15795 to count columns correctly, and to check for invalid inputs.
15796
15797 Use mbsnwidth to count columns correctly. Account for tabs, too.
15798 Include mbswidth.h.
15799 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
15800 (extend_location): New function.
15801 (YY_LINES): Remove.
15802
15803 Handle CRLF in C code rather than in Lex code.
15804 (YY_INPUT): New macro.
15805 (no_cr_read): New function.
15806
15807 Scan UCNs, even though we don't fully handle them yet.
15808 (convert_ucn_to_byte): New function.
15809
15810 Handle backslash-newline correctly in C code.
15811 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
15812 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
15813 all uses changed.
15814 (tag, splice): New EREs. Do not allow NUL or newline in tags.
15815 Use {splice} wherever C allows backslash-newline.
15816 YY_STEP after space, newline, vertical-tab.
15817 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
15818
15819 (letter, id): Don't assume ASCII; e.g., spell out a-z.
15820
15821 ({int}, handle_action_dollar, handle_action_at): Check for integer
15822 overflow.
15823
15824 (YY_STEP): Omit trailing semicolon, so that it's more like C.
15825
15826 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
15827 as well as \000. Check for UCHAR_MAX, not 255.
15828 Allow \x with an arbitrary positive number of digits, as in C.
15829 Check for overflow here.
15830 Allow \? and UCNs, for compatibility with C.
15831
15832 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
15833 with quote slot used by complain_at.
15834
15835 * tests/input.at: Add tests for backslash-newline, m4 quotes
15836 in symbols, long literals, and funny escapes in strings.
15837
15838 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
15839 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
15840 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
15841 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
15842 * m4/mbswidth.m4: New file, from GNU coreutils.
15843
15844 * doc/bison.texinfo (Grammar Outline): Document // comments.
15845 (Symbols): Document that trigraphs have no special meaning in Bison,
15846 nor is backslash-newline allowed.
15847 (Actions): Document that trigraphs have no special meaning.
15848
15849 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
15850 no longer used.
15851
158522002-11-02 Paul Eggert <eggert@twinsun.com>
15853
15854 * src/reader.c: Don't include quote.h; not needed.
15855 (get_merge_function): Reword warning to be consistent with
15856 type clash diagnostic in grammar_current_rule_check.
15857
15858 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
15859 bug in trigraph handling.
15860
15861 * src/output.c (prepare_symbols): When printing token names,
15862 escape "[" as "@<:@" and likewise for "]".
15863
15864 * src/system.h (errno): Remove declaration, as we are now
15865 assuming C89 or better, and C89 guarantees errno.
15866
158672002-10-30 Paul Eggert <eggert@twinsun.com>
15868
15869 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
15870 Check for close failures.
15871 * src/files.h (xfclose): Return void, not int, since it always
15872 returned zero.
15873 * src/files.c (xfclose): Likewise. Report I/O error if ferror
15874 indicates one.
15875 * src/output.c (output_skeleton): Use xfclose rather than fclose
15876 and ferror. xfclose now checks ferror.
15877
15878 * data/glr.c (YYLEFTMOST_STATE): Remove.
15879 (yyreportTree): Use a stack-based leftmost state. This avoids
15880 our continuing battles with bogus warnings about initializers.
15881
158822002-10-30 Akim Demaille <akim@epita.fr>
15883
15884 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
15885 #if.
15886
158872002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15888
15889 * tests/glr-regr1.at: New test for reported regressions.
15890 * tests/testsuite.at: Add glr-regr1.at test.
15891 * tests/Makefile.am: Add glr-regr1.at test.
15892
158932002-10-24 Paul Eggert <eggert@twinsun.com>
15894
15895 Version 1.75a.
15896
15897 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
15898 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
15899 we use malloc. Don't assume 'A' through 'Z' are contiguous.
15900 Don't assume strdup exists; POSIX says its an XSI extension.
15901 Check for buffer overflow on input.
15902
159032002-10-24 Akim Demaille <akim@epita.fr>
15904
15905 * src/output.c (output_skeleton): Don't disable M4sugar comments
15906 too soon: it results in comments being expanded.
15907 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
15908 first output.
15909
159102002-10-24 Akim Demaille <akim@epita.fr>
15911
15912 * data/yacc.c (m4_int_type): New.
15913 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
15914 char' as only yacc.c wants K&R portability.
15915 * data/glr.c (yysigned_char): Remove.
15916 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
15917 Reported by Quoc Peyrot.
15918
159192002-10-23 Paul Eggert <eggert@twinsun.com>
15920
15921 * src/main.c (main): With --trace=time, report times even if a
15922 non-fatal error occurs. Formerly, the times were reported in some
15923 such cases but not in others.
15924 * src/reader.c (reader): Just return if a complaint has been issued,
15925 instead of exiting, so that 'main' can report times.
15926
159272002-10-22 Akim Demaille <akim@epita.fr>
15928
15929 * src/system.h: Include sys/types.
15930 Reported by Bert Deknuydt.
15931
159322002-10-23 Paul Eggert <eggert@twinsun.com>
15933
15934 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
15935 Suggested by Art Haas.
15936
159372002-10-22 Paul Eggert <eggert@twinsun.com>
15938
15939 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
15940 decl; not needed any more.
15941 * src/main.c (main): Use return to exit, undoing yesterday's change.
15942 The last OS that we could find where this wouldn't work is
15943 SunOS 3.5, and that's too old to worry about now.
15944
15945 * data/glr.c (struct yyltype): Define members even when not
15946 doing locations. This is more consistent with yacc.c, and it
15947 works around the following bug reports:
15948 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
15949 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
15950
15951 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
15952 @acronym consistently. Standardize on "Yacc" instead of "YACC",
15953 "Algol" instead of "ALGOL". Give a bit more history about BNF.
15954
159552002-10-22 Akim Demaille <akim@epita.fr>
15956
15957 * data/README: New.
15958
159592002-10-21 Paul Eggert <eggert@twinsun.com>
15960
15961 Be consistent about 'bool'; the old code used an enum in one
15962 module and an int in another, and this violates the C standard.
15963 * m4/stdbool.m4: New file, from coreutils 4.5.3.
15964 * configure.ac (AC_HEADER_STDBOOL): Add.
15965 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
15966 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
15967 * src/symtab.c (hash_compare_symbol_t): Likewise.
15968 * src/system.h (bool, false, true): Use a definition consistent
15969 with ../lib/hash.c. All uses changed.
15970
15971 * src/complain.c (warning_issued): Renamed from warn_message_count,
15972 so that we needn't worry about integer overflow (!).
15973 Now of type bool. All uses changed.
15974 (complaint_issued): Renamed from complain_message_count; likewise.
15975
15976 * src/main.c (main): Use exit to exit with failure.
15977
15978 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
15979 rather than 1 and 0.
15980 * src/main.c (main): Likewise.
15981 * src/getargs.c (getargs): Likewise.
15982 * src/reader.c (reader): Likewise.
15983
15984 * src/getarg.c (getargs): Remove duplicate code for
15985 "Try `bison --help'".
15986
15987 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
15988 What was that "2" for?
15989
15990 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
15991 * src/getargs.c (usage): Likewise.
15992
15993 * src/getargs.c (getargs): When there are too few operands, report
15994 the last one. When there are too many, report the first extra
15995 one. This is how diffutils does it.
15996
159972002-10-20 Paul Eggert <eggert@twinsun.com>
15998
15999 Remove K&R vestiges.
16000 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
16001 * src/complain.c (VA_START): Remove. Assume prototypes.
16002 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
16003 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
16004 fatal): Assume prototypes.
16005 * src/complain.h: Assume prototypes.
16006 * src/system.h (PARAMS): Remove.
16007 Include <limits.h> unconditionally, since it's guaranteeed even
16008 for a freestanding C89 compiler.
16009 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
16010 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
16011
160122002-10-20 Akim Demaille <akim@epita.fr>
16013
16014 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
16015 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
16016 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
16017 (yyresolveStates, yyresolveAction, yyresolveStack)
16018 (yyprocessOneStack): Use them.
16019 (yy_reduce_print): New.
16020 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
16021
160222002-10-20 Akim Demaille <akim@epita.fr>
16023
16024 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
16025 arguments and output `void'.
16026 (b4_c_function): Rename as...
16027 (b4_c_function_def): this.
16028 (b4_c_function_decl, b4_c_ansi_function_def)
16029 (b4_c_ansi_function_decl): New.
16030 Change the interpretation of the arguments: before `int, foo', now
16031 `int foo, foo'.
16032 * data/yacc.c (yyparse): Prototype and define thanks to these.
16033 Adjust b4_c_function_def uses.
16034 * data/glr.c (yyparse): Likewise, but ANSI only.
16035
160362002-10-20 Akim Demaille <akim@epita.fr>
16037
16038 * src/output.c (prepare): Move the definition of `tokens_number',
16039 `nterms_number', `undef_token_number', `user_token_number_max'
16040 to...
16041 (prepare_tokens): Here.
16042 (prepare_tokens): Rename as...
16043 (prepare_symbols): this.
16044 (prepare): Move the definition of `rules_number' to...
16045 (prepare_rules): here.
16046 (prepare): Move the definition of `last', `final_state_number',
16047 `states_number' to...
16048 (prepare_states): here.
16049 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
16050
160512002-10-20 Akim Demaille <akim@epita.fr>
16052
16053 * src/tables.h, src/tables.c, src/output.c: Comment changes.
16054
160552002-10-20 Akim Demaille <akim@epita.fr>
16056
16057 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
16058 * data/c.m4: here.
16059
160602002-10-20 Akim Demaille <akim@epita.fr>
16061
16062 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
16063 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
16064 `pair'.
16065 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
16066 `name' to...
16067 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
16068 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
16069 These.
16070
160712002-10-19 Paul Eggert <eggert@twinsun.com>
16072
16073 Do not create a temporary file, as that involves security and
16074 cleanup headaches. Instead, use a pair of pipes.
16075 Derived from a suggestion by Florian Krohm.
16076 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
16077 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
16078 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
16079 (BISON_PREREQ_SUBPIPE): Add.
16080 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
16081 Add subpipe.h, subpipe.c.
16082 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
16083 * po/POTFILES.in: Add lib/subpipe.c.
16084 * src/output.c: Include "subpipe.h".
16085 (m4_invoke): Remove decl.
16086 (scan_skel): New decl.
16087 (output_skeleton): Use pipe rather than temporary file for m4 input.
16088 Check that m4sugar.m4 is readable, to avoid deadlock.
16089 Check for pipe I/O error.
16090 * src/scan-skel.l (readpipe): Remove decl.
16091 (scan_skel): New function, to be used in place of m4_invoke.
16092 Read from stream rather than file.
16093
16094 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
16095 float, as this generates a warning on Solaris 8 + GCC 3.2 with
16096 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
16097 this generates a more-accurate value anyway.
16098
16099 * lib/timevar.c (timervar_accumulate): Rename locals to
16100 avoid confusion with similarly-named more-global.
16101 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
16102
16103 * src/output.c (prepare): Use xstrdup to convert char const *
16104 to char *, to avoid GCC warning.
16105
161062002-10-19 Akim Demaille <akim@epita.fr>
16107
16108 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
16109 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
16110 Use them to have `calc.y' ready for %pure-parser.
16111 * data/yacc.c (YYLEX): Pass a yylex return type to
16112 b4_c_function_call.
16113
161142002-10-19 Akim Demaille <akim@epita.fr>
16115
16116 Prototype support of %lex-param and %parse-param.
16117
16118 * src/parse-gram.y: Add the definition of the %lex-param and
16119 %parse-param tokens, plus their rules.
16120 Drop the `_' version of %glr-parser.
16121 Add the "," token.
16122 * src/scan-gram.l (INITIAL): Scan them.
16123 * src/muscle_tab.c: Comment changes.
16124 (muscle_insert, muscle_find): Rename `pair' as `probe'.
16125 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
16126 (muscle_entry_s): The `value' member is no longer const.
16127 Adjust all dependencies.
16128 * src/muscle_tab.c (muscle_init): Adjust: use
16129 MUSCLE_INSERT_STRING.
16130 Initialize the obstack earlier.
16131 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
16132 (muscle_pair_list_grow): New.
16133 * data/c.m4 (b4_c_function_call, b4_c_args): New.
16134 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
16135 * tests/calc.at: Use %locations, not --locations.
16136 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
16137
161382002-10-19 Akim Demaille <akim@epita.fr>
16139
16140 * src/getargs.c (usage): Take status as argument and exit
16141 accordingly.
16142 Report the traditional `Try ... --help' message when status != 0.
16143 (usage, version): Don't take a FILE * as arg, it is pointless.
16144 (getargs): When there is an incorrect number of arguments, make it
16145 an error, and report it GNUlically thanks to `usage ()'.
16146
161472002-10-18 Paul Eggert <eggert@twinsun.com>
16148
16149 * data/glr.c (yyreportParseError): Don't assume that sprintf
16150 yields the length of the printed string, as this is not true
16151 on SunOS 4.1.4. Reported by Peter Klein.
16152
16153 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
16154 * tests/conflicts.at (%nonassoc and eof): Likewise.
16155 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
16156
161572002-10-17 Akim Demaille <akim@epita.fr>
16158
16159 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
16160 * src/getargs.c (trace_types, trace_args): Adjust.
16161 * src/reader.c (grammar_current_rule_prec_set)
16162 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
16163 Standardize error messages.
16164 And s/@prec/%prec/!
16165 (reader): Use trace_flag to enable scanner/parser debugging,
16166 instead of an adhoc scheme.
16167 * src/scan-gram.l: Remove trailing debugging code.
16168
161692002-10-16 Paul Eggert <eggert@twinsun.com>
16170
16171 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
16172 MUSCLE_TAB_H.
16173
16174 * NEWS: Officially drop support for building Bison with K&R C,
16175 since it didn't work anyway and it's not worth worrying about.
16176 * Makefile.maint (wget_files): Remove ansi2knr.c.
16177 (ansi2knr.c-url_prefix): Remove.
16178 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
16179 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16180 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16181
161822002-10-15 Paul Eggert <eggert@twinsun.com>
16183
16184 Stop using the "enum_" trick for K&R-style function definitions;
16185 it confused me, and I was the author! Instead, assume that people
16186 who want to use K&R C compilers (when using these modules in GCC,
16187 perhaps?) will run ansi2knr.
16188
16189 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
16190 All uses of "enum_" changed to "enum ".
16191 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
16192 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
16193
16194 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
16195 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
16196 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
16197 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
16198 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
16199 abitset_not, abitset_ones, abitset_or, abitset_or_and,
16200 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
16201 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
16202 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
16203 Use function prototypes; this removes the need for declaring
16204 static functions simply to provide their prototypes.
16205 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
16206 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
16207 bitset_count_, bitset_create, bitset_dump, bitset_first,
16208 bitset_free, bitset_init, bitset_last, bitset_next,
16209 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
16210 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
16211 bitset_print, bitset_release_memory, bitset_toggle_,
16212 bitset_type_choose, bitset_type_get, bitset_type_name_get,
16213 debug_bitset): Likewise.
16214 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
16215 * lib/bitset_stats.c (bitset_log_histogram_print,
16216 bitset_percent_histogram_print, bitset_stats_and,
16217 bitset_stats_and_cmp, bitset_stats_and_or,
16218 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
16219 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
16220 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
16221 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
16222 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
16223 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
16224 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
16225 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
16226 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
16227 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
16228 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
16229 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
16230 bitset_stats_zero): Likewise.
16231 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
16232 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
16233 bitsetv_dump, debug_bitsetv): Likewise.
16234 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
16235 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
16236 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
16237 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
16238 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
16239 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
16240 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
16241 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
16242 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
16243 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
16244 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
16245 Likewise.
16246 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
16247 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
16248 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
16249 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
16250 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
16251 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
16252 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
16253 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
16254 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
16255 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
16256 lbitset_xor_cmp, lbitset_zero): Likewise.
16257
162582002-10-14 Akim Demaille <akim@epita.fr>
16259
16260 Version 1.75.
16261
162622002-10-14 Akim Demaille <akim@epita.fr>
16263
16264 * tests/Makefile.am (maintainer-check-posix): New.
16265
162662002-10-14 Akim Demaille <akim@epita.fr>
16267
16268 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
16269 member.
16270
162712002-10-14 Akim Demaille <akim@epita.fr>
16272
16273 * src/tables.c (table_ninf_remap): base -> tab.
16274 Reported by Matt Rosing.
16275
162762002-10-14 Paul Eggert <eggert@twinsun.com>
16277
16278 * tests/action.at, tests/calc.at, tests/conflicts.at,
16279 tests/cxx-type.at, tests/headers.at, tests/input.at,
16280 tests/regression.at, tests/synclines.at, tests/torture.at:
16281 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
16282 so that the tests still work even if POSIXLY_CORRECT is set.
16283 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
16284
16285 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
16286 for portability to K&R hosts. Fix typo: signed char is guaranteed
16287 only to 127, not to 128.
16288 * data/glr.c (yysigned_char): New type.
16289 * data/yacc.c (yysigned_char): Likewise.
16290 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
16291
162922002-10-13 Paul Eggert <eggert@twinsun.com>
16293
16294 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
16295 true due to limited range of data type" warning from GCC.
16296
16297 * data/c.m4 (b4_token_defines): Protect against double-inclusion
16298 by wrapping enum yytokentype's definition inside #ifndef
16299 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
16300
163012002-10-13 Akim Demaille <akim@epita.fr>
16302
16303 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
16304 Un yy- yyrhs to avoid the name clash with the global YYRHS.
16305
163062002-10-13 Akim Demaille <akim@epita.fr>
16307
16308 * Makefile.maint: Update from Autoconf 2.54.
16309 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
16310
163112002-10-13 Akim Demaille <akim@epita.fr>
16312
16313 * src/print.c (print_state): Separate the list of solved conflicts
16314 from the other items.
16315 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
16316
163172002-10-13 Akim Demaille <akim@epita.fr>
16318
16319 Let nondeterministic skeletons be usable with deterministic
16320 tables.
16321
16322 With the patch, GAWK compiled by GCC without -O2 passes its test
16323 suite using a GLR parser driven by LALR tables. It fails with -O2
16324 because `struct stat' gives two different answers on my machine:
16325 88 (definition of an auto var) and later 96 (memset on this var).
16326 Hence the stack is badly corrumpted. The headers inclusion is to
16327 blame: if I move the awk.h inclusion before GLR's system header
16328 inclusion, the two struct stat have the same size.
16329
16330 * src/tables.c (pack_table): Always create conflict_table.
16331 (token_actions): Always create conflict_list.
16332 * data/glr.c (YYFLAG): Remove, unused.
16333
163342002-10-13 Akim Demaille <akim@epita.fr>
16335
16336 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
16337 (O0FLAGS): New.
16338 (VALGRIND, GXX): New.
16339 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
16340 * tests/bison.in: Run $PREBISON a pre-command.
16341 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
16342 (maintainer-check-g++): New.
16343 * Makefile.am (maintainer-check): New.
16344
163452002-10-13 Akim Demaille <akim@epita.fr>
16346
16347 * data/glr.c: Formatting changes.
16348 Tweak some trace messages to match yacc.c's.
16349
163502002-10-13 Akim Demaille <akim@epita.fr>
16351
16352 GLR parsers sometimes raise parse errors instead of performing the
16353 default reduction.
16354 Reported by Charles-Henry de Boysson.
16355
16356 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
16357 check the length of the traces when %glr.
16358 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
16359 GLR's traces.
16360 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
16361 Test GLR parsers.
16362 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
16363 (yyltype): Remove the yy prefix from the member names.
16364 (yytable): Complete its comment.
16365 (yygetLRActions): Map error action number from YYTABLE from
16366 YYTABLE_NINF to 0.
16367 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
16368 (which was a bug: it should have been YYTABEL_NINF, and yet it was
16369 not satisfying as we could compare an YYACTION computed from
16370 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
16371 only value for error actions.
16372 (yyreportParseError): In verbose parse error messages, don't issue
16373 `error' in the list of expected tokens.
16374 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
16375 next action to perform to match glr.c's decoding.
16376 (yytable): Complete its comment.
16377
163782002-10-13 Paul Eggert <eggert@twinsun.com>
16379
16380 Fix problem reported by Henrik Grubbstroem in
16381 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
16382 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
16383 because the Bison parser reads the second action before reducing
16384 the first one.
16385 * src/scan-gram.l (rule_length): New static var.
16386 Use it to keep track of the rule length in the scanner, since
16387 we can't expect the parser to be in lock-step sync with the scanner.
16388 (handle_action_dollar, handle_action_at): Use this var.
16389 * tests/actions.at (Exotic Dollars): Test for the problem.
16390
163912002-10-12 Paul Eggert <eggert@twinsun.com>
16392
16393 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
16394 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
16395 Include <sys/time.h> when checking for clock_t and struct tms.
16396 Use same include order as source.
16397 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
16398 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
16399
16400 * lib/timevar.c: Update copyright date and clarify comments.
16401 (get_time) [IN_GCC]: Keep the GCC version for reference.
16402
16403 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
16404 GCC version as of today, then merge Bison's changes.
16405 Change "GCC" to "Bison" in copyright notice. timevar.def's
16406 author is Akim, so change that too.
16407
16408 * src/reader.c (grammar_current_rule_check):
16409 Don't worry about the default action if $$ is untyped.
16410 Prevents bogus warnings reported by Jim Gifford in
16411 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
16412
16413 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
16414 * data/glr.c, data/lalr1.cc, data/yacc.c:
16415 Output token definitions before the first part of user declarations.
16416 Fixes compatibility problem reported by Jim Gifford for kbd in
16417 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
16418
164192002-10-11 Paul Eggert <eggert@twinsun.com>
16420
16421 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
16422 (yyparse): here. This undoes some of the 2002-07-25 change.
16423 Compatibility problem reported by Ralf S. Engelschall with
16424 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
16425
164262002-10-11 Akim Demaille <akim@epita.fr>
16427
16428 * tests/regression.at Characters Escapes): New.
16429 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
16430 characters.
16431 Reported by Jan Nieuwenhuizen.
16432
164332002-10-11 Akim Demaille <akim@epita.fr>
16434
16435 * po/id.po: New.
16436
164372002-10-10 Paul Eggert <eggert@twinsun.com>
16438
16439 Portability fixes for bitsets; this also avoids several GCC
16440 warnings.
16441
16442 * lib/abitset.c: Include <stddef.h>, for offsetof.
16443 * lib/lbitset.c: Likewise.
16444
16445 * lib/abitset.c (abitset_bytes): Return a size that is aligned
16446 properly for vectors of objects. Do not assume that adding a
16447 header size to a multiple of a word size yields a value that is
16448 properly aligned for the whole union.
16449 * lib/bitsetv.c (bitsetv_alloc): Likewise.
16450
16451 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
16452 unique names for structures.
16453 * lib/ebitset.c (ebitset_bytes): Likewise.
16454 * lib/lbitset.c (lbitset_bytes): Likewise.
16455
16456 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
16457 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
16458 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
16459 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
16460 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
16461 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
16462 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
16463 to improve the type-checking that GCC can do.
16464 * lib/bitset.c (bitset_op4_cmp): Likewise.
16465 * lib/bitset_stats.c (bitset_stats_count,
16466 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
16467 bitset_stats_copy, bitset_stats_disjoint_p,
16468 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
16469 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
16470 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
16471 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
16472 bitset_stats_and_or_cmp, bitset_stats_andn_or,
16473 bitset_stats_andn_or_cmp, bitset_stats_or_and,
16474 bitset_stats_or_and_cmp): Likewise.
16475 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
16476 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
16477 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
16478 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
16479
16480 * lib/abitset.h: Include bitset.h, not bbitset.h.
16481 * lib/ebitset.h: Likewise.
16482 * lib/lbitset.h: Likewise.
16483
16484 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
16485 All instances of parameters of type enum bitset_opts are now of
16486 type enum_bitset_opts, to conform to the C Standard, and similarly
16487 for enum_bitset_type.
16488 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
16489 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
16490
16491 Do not use "struct bitset_struct" to mean different things in
16492 different modules. Not only is this confusing, it violates
16493 the C Standard, which requires that structure types in different
16494 modules must be compatible if one is to be passed to the other.
16495 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
16496 All instances of "struct bitset_struct *" replaced with "bitset".
16497 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
16498 (union bitset_union, struct abitset_struct, struct ebitset_struct,
16499 struct lbitset_struct, struct bitset_stats_struct): New types.
16500 All uses of struct bitset_struct changed to union bitset_union,
16501 etc.
16502 * lib/abitset.c (struct abitset_struct, abitset,
16503 struct bitset_struct): Remove.
16504 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
16505 struct bitset_struct): Remove.
16506 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
16507 bitset_struct): Remove.
16508 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
16509 Likewise.
16510
16511 Do not call a function of type T using a call that assumes the
16512 function is of a different type U. Standard C requires that a
16513 function must be called with a type that is compatible with its
16514 definition.
16515 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
16516 New decls.
16517 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
16518 New functions.
16519 * lib/ebitset.c (PFV): Remove.
16520 * lib/lbitset.c (PFV): Likewise.
16521 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
16522 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
16523 decls.
16524 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
16525 (ebitset_vtable): Use them.
16526 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
16527 lbitset_xor): New functions.
16528 (lbitset_vtable): Use them.
16529
16530 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
16531 Declare.
16532
16533 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
16534 GCC warning.
16535 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
16536 Use offsetof, for simplicity.
16537
165382002-10-06 Paul Eggert <eggert@twinsun.com>
16539
16540 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
16541 the same width as int. This reapplies a hunk of the 2002-08-12 patch
16542 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
16543 which was inadvertently undone by the 2002-09-30 patch.
16544 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
16545 the same width as int.
16546
165472002-10-04 Paul Eggert <eggert@twinsun.com>
16548
16549 Version 1.50.
16550
16551 * configure.ac (AC_INIT), NEWS: Increment version number.
16552
16553 * doc/bison.texinfo: Minor spelling, grammar, and white space
16554 fixes.
16555 (Symbols): Mention that any negative value returned from yylex
16556 signifies end-of-input. Warn about negative chars. Mention
16557 the portable Standard C character set.
16558
16559 The GNU coding standard says CFLAGS and YFLAGS are reserved
16560 for the installer to set.
16561 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
16562 * src/Makefile.am (AM_CFLAGS): Likewise.
16563 (AM_YFLAGS): Renamed from YFLAGS.
16564
16565 Fix some MAX and MIN problems.
16566 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
16567 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
16568 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
16569 * src/reader.c (reader): Use it.
16570
16571 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
16572 POSIX 1003.1-2001 has removed fgrep.
16573
165742002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
16575
16576 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
16577 interpreted as signed.
16578 * lib/ebitset.c (ebitset_list): Fix bug.
16579
165802002-10-01 Paul Eggert <eggert@twinsun.com>
16581
16582 More fixes for 64-bit hosts and large bitsets.
16583
16584 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
16585 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
16586 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
16587 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
16588 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
16589 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
16590 bitset_count_): Likewise.
16591 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
16592 bitset_first, bitset_last): Likewise.
16593 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
16594 bitset_stats_list_reverse, bitset_stats_size,
16595 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
16596 Likewise.
16597 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
16598 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
16599 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
16600 bitsetv_reflexive_transitive_closure): Likewise.
16601 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
16602 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
16603 Likewise.
16604 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
16605 Likewise.
16606
16607 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
16608 Use size_t, not unsigned int, to count bytes.
16609 * lib/abitset.h (abitset_bytes): Likewise.
16610 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
16611 Likewise.
16612 * lib/bitset.h (bitset_bytes): Likewise.
16613 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
16614 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
16615 * lib/bitsetv.c (bitsetv_alloc): Likewise.
16616 * lib/ebitset.c (ebitset_bytes): Likewise.
16617 * lib/ebitset.h (ebitset_bytes): Likewise.
16618 * lib/lbitset.c (lbitset_bytes): Likewise.
16619 * lib/lbitset.h (lbitset_bytes): Likewise.
16620
16621 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
16622 abitset_subset_p, abitset_disjoint_p, abitset_and,
16623 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
16624 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
16625 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
16626 abitset_or_and, abitset_or_and_cmp):
16627 Use bitset_windex instead of unsigned int.
16628 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
16629 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
16630 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
16631 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
16632 Likewise.
16633 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
16634
16635 * lib/bitset.c (bitset_print):
16636 Use proper printf formats for widths of integer types.
16637 * lib/bitset_stats.c (bitset_percent_histogram_print,
16638 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
16639 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
16640 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
16641 * lib/lbitset.c (lbitset_bytes): Likewise.
16642
16643 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
16644 BITSET_SIZE_MAX): New macros.
16645 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
16646 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
16647 to BITSET_WINDEX_MAX.
16648
16649 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
16650 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
16651 since we now return the bitset_bindex type (not int).
16652
16653 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
16654 when computing sizes.
16655 * lib/ebitset.c (ebitset_elts_grow): Likewise.
16656
16657 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
16658 and avoid cast to unsigned.
16659
166602002-09-30 Akim Demaille <akim@epita.fr>
16661
16662 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
16663 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
16664 Updates from Michael Hayes.
16665
166662002-09-30 Art Haas <ahaas@neosoft.com>
16667
16668 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
16669 invocations.
16670 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
16671 defined.
16672
166732002-09-27 Akim Demaille <akim@epita.fr>
16674
16675 Version 1.49c.
16676
166772002-09-27 Akim Demaille <akim@epita.fr>
16678
16679 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
16680 (Because of AC_LIBSOURCE).
16681
166822002-09-27 Akim Demaille <akim@epita.fr>
16683
16684 Playing with Autoscan.
16685
16686 * configure.ac: Remove the old LIBOBJ tweaks.
16687 (AC_REPLACE_FUNCS): Add strrchr and strtol.
16688 * lib/strrchr.c: New.
16689 * lib/strtol.c: New, from the Coreutils 4.5.1.
16690
166912002-09-27 Akim Demaille <akim@epita.fr>
16692
16693 Playing with Autoscan.
16694
16695 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
16696 * lib/Makefile.am (libbison_a_SOURCES): No longer include
16697 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
16698 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
16699 Coreutils 4.5.1.
16700
167012002-09-24 Akim Demaille <akim@epita.fr>
16702
16703 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
16704 (Frequently Asked Questions, Parser Stack Overflow): New.
16705
167062002-09-13 Akim Demaille <akim@epita.fr>
16707
16708 Playing with autoscan.
16709
16710 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
16711 * src/files.c (skeleton_find): Remove, unused.
16712 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
16713 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
16714
167152002-09-13 Akim Demaille <akim@epita.fr>
16716
16717 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
16718 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
16719
167202002-09-13 Akim Demaille <akim@epita.fr>
16721
16722 * configure.ac: Require 2.54.
16723 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
16724 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
16725 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
16726 Remove, provided by Autoconf macros.
16727
167282002-09-12 Akim Demaille <akim@epita.fr>
16729
16730 * m4/prereq.m4: Update, from Coreutils 4.5.1.
16731
167322002-09-12 Akim Demaille <akim@epita.fr>
16733
16734 * m4/prereq.m4: Update, from Fileutils 4.1.5.
16735 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
16736 Reported by Martin Mokrejs.
16737
167382002-09-10 Akim Demaille <akim@epita.fr>
16739
16740 * src/parse-gram.y: Associate a human readable string to each
16741 token type.
16742 * tests/regression.at (Invalid inputs): Adjust.
16743
167442002-09-10 Gary V. Vaughan <gary@gnu.org>
16745
16746 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
16747 with an Autoconf-2.5x style configure.ac.
16748
167492002-09-06 Paul Eggert <eggert@twinsun.com>
16750
16751 * doc/bison.texinfo (Conditions): Make explicit that the GPL
16752 exception applies only to yacc.c. This is a modification of a
16753 patch originally suggested by Akim Demaille.
16754
167552002-09-06 Akim Demaille <akim@epita.fr>
16756
16757 * data/c.m4 (b4_copyright): Move the GPL exception comment from
16758 here to...
16759 * data/yacc.c: here.
16760
16761 * data/lalr1.cc (struct yyltype): Don't define it, since we use
16762 LocationType.
16763 (b4_ltype): Default to yy::Location from location.hh.
16764
167652002-09-04 Jim Meyering <jim@meyering.net>
16766
16767 * data/yacc.c: Guard the declaration of yytoknum also with
16768 `#ifdef YYPRINT', so it is declared only when used.
16769
167702002-09-04 Akim Demaille <akim@epita.fr>
16771
16772 * configure.in: Rename as...
16773 * configure.ac: this.
16774 Bump to 1.49c.
16775
167762002-09-04 Akim Demaille <akim@epita.fr>
16777
16778 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
16779 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
16780 translate maintainer only messages.
16781
167822002-08-12 Paul Eggert <eggert@twinsun.com>
16783
16784 Version 1.49b.
16785
16786 * Makefile.am (SUBDIRS): Remove intl.
16787 (DISTCLEANFILES): Remove.
16788 * NEWS: Mention that GNU M4 is now required. Clarify what is
16789 meant by "larger grammars". Mention the pt_BR translation.
16790 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
16791 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
16792 Bump version from 0.11.2 to 0.11.5.
16793 (BISON_PREREQ_STAGE): Remove.
16794 (AM_GNU_GETTEXT): Use external gettext.
16795 (AC_OUTPUT): Remove intl/Makefile.
16796
16797 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
16798
16799 * data/glr.c: Include string.h, for strlen.
16800 (yyreportParseError): Use size_t for yysize.
16801 (yy_yypstack): No longer nested inside yypstates, as nested
16802 functions are not portable. Do not assume size_t is the
16803 same width as int.
16804 (yypstates): Do not assume that ptrdiff_t is the same width
16805 as int, and similarly for yyposn and YYINDEX.
16806
16807 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
16808
16809 * lib/Makefile.am (INCLUDES): Do not include from the intl
16810 directory, which has been removed.
16811 * src/Makefile.am (INCLUDES): Likewise.
16812
16813 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
16814 (bitsets_sources, additional_bitsets_sources, timevars_sources):
16815 New vars.
16816
16817 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
16818 * tests/Makefile.am (EXTRA_DIST): Likewise.
16819
16820 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
16821 Do not assume that bitset_windex is the same width as unsigned.
16822
16823 * lib/abitset.c (abitset_unused_clear): Do not assume that
16824 bitset_word is the same width as int.
16825 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
16826 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
16827 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
16828 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
16829 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
16830
16831 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
16832 portability to one's complement hosts!).
16833 * lib/ebitset.c (ebitset_op1): Likewise.
16834 * lib/lbitset.c (lbitset_op1): Likewise.
16835
16836 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
16837 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
16838 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
16839 Sync with fileutils.
16840 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
16841 lib/gettext.h: Sync with diffutils.
16842
16843 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
16844 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
16845
16846 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
16847 PROTOTYPES to check for prototypes, and "defined __STDC__" to
16848 check for void *.
16849
16850 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
16851 size_t; the old version tried to do this but casted improperly.
16852 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
16853 (bitset_test): Now returns int, not unsigned long.
16854
16855 * lib/bitset_stats.c: Include "gettext.h".
16856 (_): New macro.
16857 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
16858 name locals "index", as it generates unnecessary warnings on some
16859 hosts that have an "index" function.
16860
16861 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
16862 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
16863 they need translation.
16864 * src/LR0.c (state_list_append, new_itemsets, get_state,
16865 append_states, generate_states): Likewise.
16866 * src/assoc.c (assoc_to_string): Likewise.
16867 * src/closure.c (print_closure, set_firsts, closure): Likewise.
16868 * src/gram.c (grammar_dump): Likewise.
16869 * src/injections.c (injections_compute): Likewise.
16870 * src/lalr.c (lookaheads_print): Likewise.
16871 * src/relation.c (relation_transpose): Likewise.
16872 * src/scan-gram.l: Likewise.
16873 * src/tables.c (table_grow, pack_vector): Likewise.
16874
16875 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
16876 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
16877 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
16878 * m4/mbstate_t.m4: Sync with fileutils.
16879 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
16880
16881 * po/LINGUAS: Add pt_BR.
16882 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
16883 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
16884 lib/timevar.c.
16885 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
16886 manual recommends.
16887 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
16888
16889 * src/complain.c (strerror_r): Remove decl; not needed.
16890 (strerror): Use same pattern as ../lib/error.c.
16891
16892 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
16893
16894 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
16895
16896 * src/main.c (main): Cast result of bindtextdomain and textdomain
16897 to void, to avoid a GCC warning when --disable-nls is in effect.
16898
16899 * src/scan-gram.l: Use strings rather than escapes when possible,
16900 to minimize the number of warnings from xgettext.
16901 (handle_action_dollar, handle_action_at): Don't use isdigit,
16902 as it mishandles negative chars and it may not work as expected
16903 outside the C locale.
16904
16905 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
16906 this is a GCC extension and is not portable to other compilers.
16907
16908 * src/system.h (alloca): Use same pattern as ../lib/error.c.
16909 Do not include <ctype.h>; no longer needed.
16910 Do not include <malloc.h>; no longer needed (and generates
16911 warnings on OpenBSD 3.0).
16912
16913 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
16914 it's not portable.
16915
16916 * tests/regression.at: Do not use 'cc -c input.c -o input';
16917 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
16918
16919 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
16920 exit status as failure, not just exit status 1. Sun C exits
16921 with status 2 sometimes.
16922
16923 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
16924 Use it for the two large tests.
16925
169262002-08-02 Akim Demaille <akim@epita.fr>
16927
16928 * src/conflicts.c (conflicts_output): Don't output rules never
16929 reduced here, since anyway that computation doesn't work.
16930 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
16931 (rule_useless_p, rule_never_reduced_p): New.
16932 (grammar_rules_partial_print): Use a filter instead of a range.
16933 Display the title only if needed.
16934 (grammar_rules_print): Adjust.
16935 (grammar_rules_never_reduced_report): New.
16936 * src/tables.c (action_row): Move the computation of rules never
16937 reduced to...
16938 (token_actions): here.
16939 * src/main.c (main): Make the parser before making the report, so
16940 that rules never reduced are computed.
16941 Call grammar_rules_never_reduced_report.
16942 * src/print.c (print_results): Report rules never reduced.
16943 * tests/conflicts.at, tests/reduce.at: Adjust.
16944
169452002-08-01 Akim Demaille <akim@epita.fr>
16946
16947 Instead of attaching lookaheads and duplicating the rules being
16948 reduced by a state, attach the lookaheads to the reductions.
16949
16950 * src/state.h (state_t): Remove the `lookaheads',
16951 `lookaheads_rule' member.
16952 (reductions_t): Add a `lookaheads' member.
16953 Use a regular array for the `rules'.
16954 * src/state.c (reductions_new): Initialize the lookaheads member
16955 to 0.
16956 (state_rule_lookaheads_print): Adjust.
16957 * src/state.h, src/state.c (state_reductions_find): New.
16958 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
16959 (count_rr_conflicts): Adjust.
16960 * src/lalr.c (LArule): Remove.
16961 (add_lookback_edge): Adjust.
16962 (state_lookaheads_count): New.
16963 (states_lookaheads_initialize): Merge into...
16964 (initialize_LA): this.
16965 (lalr_free): Adjust.
16966 * src/main.c (main): Don't free nullable and derives too early: it
16967 is used by --verbose.
16968 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
16969
169702002-08-01 Akim Demaille <akim@epita.fr>
16971
16972 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
16973 `rule_number_t**'.
16974 (set_derives, free_derives): Rename as...
16975 (derives_compute, derives_free): this.
16976 Adjust all dependencies.
16977 * src/nullable.c (set_nullable, free_nullable): Rename as...
16978 (nullable_compute, nullable_free): these.
16979 (rule_list_t): Store rule_t *, not rule_number_t.
16980 * src/state.c (state_rule_lookaheads_print): Directly compare rule
16981 pointers, instead of their numbers.
16982 * src/main.c (main): Call nullable_free, and derives_free earlier,
16983 as they were lo longer used.
16984
169852002-08-01 Akim Demaille <akim@epita.fr>
16986
16987 * lib/timevar.c (get_time): Include children time.
16988 * src/lalr.h (LA, LArule): Don't export them: used with the
16989 state_t.
16990 * src/lalr.c (LA, LArule): Static.
16991 * src/lalr.h, src/lalr.c (lalr_free): New.
16992 * src/main.c (main): Call it.
16993 * src/tables.c (pack_vector): Check whether loc is >= to the
16994 table_size, not >.
16995 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
16996 (tables_generate): do it, since that's also it which allocates
16997 them.
16998 Don't free LA and LArule, main does.
16999
170002002-07-31 Akim Demaille <akim@epita.fr>
17001
17002 Separate parser tables computation and output.
17003
17004 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
17005 (conflict_list, conflict_list_cnt, table, check, table_ninf)
17006 (yydefgoto, yydefact, high): Move to...
17007 * src/tables.h, src/tables.c: here.
17008 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17009 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17010 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
17011 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
17012 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
17013 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
17014 (action_row, save_row, token_actions, save_column, default_goto)
17015 (goto_actions, sort_actions, matching_state, pack_vector)
17016 (table_ninf_remap, pack_table, prepare_actions): Move to...
17017 * src/tables.c: here.
17018 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
17019 * src/output.c (token_actions, output_base, output_conflicts)
17020 (output_check): Merge into...
17021 (prepare_actions): this.
17022 (actions_output): Rename as...
17023 (user_actions_output): this.
17024 * src/main.c (main): Call tables_generate and tables_free.
17025
170262002-07-31 Akim Demaille <akim@epita.fr>
17027
17028 Steal GCC's --time-report support.
17029
17030 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
17031 stolen/adjusted from GCC.
17032 * m4/stage.m4: Remove time related checks.
17033 * m4/timevar.m4: New.
17034 * configure.in: Adjust.
17035 * src/system.h: Adjust to using timevar.h.
17036 * src/getargs.h, src/getargs.c: Support trace_time for
17037 --trace=time.
17038 * src/main.c (stage): Remove.
17039 (main): Replace `stage' invocations with timevar calls.
17040 * src/output.c: Insert pertinent timevar calls.
17041
170422002-07-31 Akim Demaille <akim@epita.fr>
17043
17044 Let --trace have arguments.
17045
17046 * src/getargs.h (enum trace_e): New.
17047 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
17048 (long_options, short_options): --trace/-T takes an optional
17049 argument.
17050 Change all the uses of trace_flag to reflect the new flags.
17051 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
17052
17053 Strengthen `stage' portability.
17054
17055 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
17056 * configure.in: Use it.
17057 Don't check for malloc.h and sys/times.h.
17058 * src/system.h: Include them when appropriate.
17059 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
17060 times and struct tms are available.
17061
170622002-07-30 Akim Demaille <akim@epita.fr>
17063
17064 In verbose parse error message, don't report `error' as an
17065 expected token.
17066 * tests/actions.at (Printers and Destructors): Adjust.
17067 * tests/calc.at (Calculator $1): Adjust.
17068 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
17069 error message, do not report the parser accepts the error token in
17070 that state.
17071
170722002-07-30 Akim Demaille <akim@epita.fr>
17073
17074 Normalize conflict related messages.
17075
17076 * src/complain.h, src/complain.c (warn, complain): New.
17077 * src/conflicts.c (conflicts_print): Use them.
17078 (conflict_report_yacc): New, extracted from...
17079 (conflicts_print): here.
17080 * tests/conflicts.at, tests/existing.at: Adjust.
17081
170822002-07-30 Akim Demaille <akim@epita.fr>
17083
17084 Report rules which are never reduced by the parser: those hidden
17085 by conflicts.
17086
17087 * src/LR0.c (save_reductions): Don't make the final state too
17088 different: save its reduction (accept) instead of having a state
17089 without any action (no shift or goto, no reduce).
17090 Note: the final state is now a ``regular'' state, i.e., the
17091 parsers now contain `reduce 0' as default reduction.
17092 Nevertheless, since they decide to `accept' when yystate =
17093 final_state, they still will not reduce rule 0.
17094 * src/print.c (print_actions, print_reduction): Adjust.
17095 * src/output.c (action_row): Track reduced rules.
17096 (token_actions): Report rules never reduced.
17097 * tests/conflicts.at, tests/regression.at: Adjust.
17098
170992002-07-30 Akim Demaille <akim@epita.fr>
17100
17101 `stage' was accidently included in a previous patch.
17102 Initiate its autoconfiscation.
17103
17104 * configure.in: Look for malloc.h and sys/times.h.
17105 * src/main.c (stage): Adjust.
17106 Report only when trace_flag.
17107
171082002-07-29 Akim Demaille <akim@epita.fr>
17109
17110 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
17111 state_number_t.
17112 (errs_t): symbol_t*, not symbol_number_t.
17113 (reductions_t): rule_t*, not rule_number_t.
17114 (FOR_EACH_SHIFT): New.
17115 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
17116 * src/print.c, src/print_graph.c: Adjust.
17117
171182002-07-29 Akim Demaille <akim@epita.fr>
17119
17120 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
17121
17122 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
17123 (endtoken, accept): these.
17124 * src/reader.c (reader): Set endtoken's default tag to "$end".
17125 Set undeftoken's tag to "$undefined" instead of "$undefined.".
17126 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
17127 Adjust.
17128
171292002-07-29 Akim Demaille <akim@epita.fr>
17130
17131 * src/reduce.c (reduce_grammar): When the language is empty,
17132 complain about the start symbol, not the axiom.
17133 Use its location.
17134 * tests/reduce.at (Empty Language): New.
17135
171362002-07-26 Akim Demaille <akim@epita.fr>
17137
17138 * src/reader.h, src/reader.c (gram_error): ... can't get
17139 yycontrol without making too strong assumptions on the parser
17140 itself.
17141 * src/output.c (prepare_tokens): Use the real 0th value of
17142 token_translations instead of `0'.
17143 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
17144 visible here.
17145 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
17146 for the time being: %locations ought to provide it to yyerror.
17147
171482002-07-25 Akim Demaille <akim@epita.fr>
17149
17150 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
17151 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
17152 * tests/regression.at (Web2c Actions): Adjust.
17153
171542002-07-25 Akim Demaille <akim@epita.fr>
17155
17156 Stop storing rules from 1 to nrules + 1.
17157
17158 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
17159 * src/nullable.c, src/output.c, src/print.c, src/reader.c
17160 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
17161 Iterate from 0 to nrules.
17162 Use rule_number_as_item_number and item_number_as_rule_number.
17163 Adjust to `derive' now containing possibly 0.
17164 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
17165 Handle the `- 1' part in rule numbers from/to item numbers.
17166 * src/conflicts.c (log_resolution): Fix the message which reversed
17167 shift and reduce.
17168 * src/output.c (action_row): Initialize default_rule to -1.
17169 (token_actions): Adjust.
17170 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
17171 expected output.
17172 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
17173
171742002-07-25 Akim Demaille <akim@epita.fr>
17175
17176 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
17177 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
17178 (b4_c_knr_arg_decl): New.
17179 * data/yacc.c: Use it to define yysymprint, yydestruct, and
17180 yyreport_parse_error.
17181
171822002-07-25 Akim Demaille <akim@epita.fr>
17183
17184 * data/yacc.c (yyreport_parse_error): New, extracted from...
17185 (yyparse): here.
17186 (yydestruct, yysymprint): Move above yyparse.
17187 Be K&R compliant.
17188
171892002-07-25 Akim Demaille <akim@epita.fr>
17190
17191 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
17192 replace...
17193 (b4_sint_type, b4_uint_type): these.
17194 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
17195 * tests/regression.at (Web2c Actions): Adjust.
17196
171972002-07-25 Akim Demaille <akim@epita.fr>
17198
17199 * src/gram.h (TIEM_NUMBER_MAX): New.
17200 (item_number_of_rule_number, rule_number_of_item_number): Rename
17201 as...
17202 (rule_number_as_item_number, item_number_as_rule_number): these.
17203 Adjust dependencies.
17204 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17205 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17206 (symbol_number_to_vector_number): New.
17207 (order): Of vector_number_t* type.
17208 (base_t, BASE_MAX, BASE_MIN): New.
17209 (froms, tos, width, pos, check): Of base_t type.
17210 (action_number_t, ACTION_MIN, ACTION_MAX): New.
17211 (actrow): Of action_number_t type.
17212 (conflrow): Of unsigned int type.
17213 (table_ninf, base_ninf): New.
17214 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
17215 (muscle_insert_int_table, muscle_insert_base_table)
17216 (muscle_insert_rule_number_table): New.
17217 (prepare_tokens): Output `toknum' as int_table.
17218 (action_row): Returns a rule_number_t.
17219 Use ACTION_MIN, not SHRT_MIN.
17220 (token_actions): yydefact is rule_number_t*.
17221 (table_ninf_remap): New.
17222 (pack_table): Use it for `base' and `table'.
17223 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
17224 replaced with...
17225 (YYPACT_NINF, YYTABLE_NINF): these.
17226 (yypact, yytable): Compute their types instead of hard-coded
17227 `short'.
17228 * tests/regression.at (Web2c Actions): Adjust.
17229
172302002-07-19 Akim Demaille <akim@epita.fr>
17231
17232 * src/scan-gram.l (id): Can start with an underscore.
17233
172342002-07-16 Akim Demaille <akim@epita.fr>
17235
17236 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
17237 Adjust all former `associativity' dependencies.
17238 * src/symtab.c (symbol_new): Default associativity is `undef', not
17239 `right'.
17240 (symbol_check_alias_consistence): Adjust.
17241
172422002-07-09 Akim Demaille <akim@epita.fr>
17243
17244 * doc/bison.texinfo: Properly set the ``header'' part.
17245 Use @dircategory ``GNU programming tools'' as per Texinfo's
17246 documentation.
17247 Use @copying.
17248
172492002-07-09 Akim Demaille <akim@epita.fr>
17250
17251 * lib/quotearg.h: Protect against multiple inclusions.
17252 * src/location.h (location_t): Add a `file' member.
17253 (LOCATION_RESET, LOCATION_PRINT): Adjust.
17254 * src/complain.c (warn_at, complain_at, fatal_at): Drop
17255 `error_one_per_line' support.
17256
172572002-07-09 Akim Demaille <akim@epita.fr>
17258
17259 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
17260 * src/reader.c (lineno): Remove.
17261 Adjust all dependencies.
17262 (get_merge_function): Take a location and use complain_at.
17263 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
17264 * tests/regression.at (Invalid inputs, Mixing %token styles):
17265 Adjust.
17266
172672002-07-09 Akim Demaille <akim@epita.fr>
17268
17269 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
17270 recovery rule, and forbid extensions when --yacc.
17271 (gram_error): Use complain_at.
17272 * src/reader.c (reader): Exit if there were parse errors.
17273
172742002-07-09 Akim Demaille <akim@epita.fr>
17275
17276 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
17277 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
17278 Reported by R Blake <blakers@mac.com>.
17279
172802002-07-09 Akim Demaille <akim@epita.fr>
17281
17282 * data/yacc.c: Output the copyright notive in the header.
17283
172842002-07-03 Akim Demaille <akim@epita.fr>
17285
17286 * src/output.c (froms, tos): Are state_number_t.
17287 (save_column): sp, sp1, and sp2 are state_number_t.
17288 (prepare): Rename `final' as `final_state_number', `nnts' as
17289 `nterms_number', `nrules' as `rules_number', `nstates' as
17290 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
17291 unused.
17292 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
17293 * data/lalr1.cc (nsym_): Remove, unused.
17294
172952002-07-03 Akim Demaille <akim@epita.fr>
17296
17297 * src/lalr.h, src/lalr.c (goto_number_t): New.
17298 * src/lalr.c (goto_list_t): New.
17299 Propagate them.
17300 * src/nullable.c (rule_list_t): New.
17301 Propagate.
17302 * src/types.h: Remove.
17303
173042002-07-03 Akim Demaille <akim@epita.fr>
17305
17306 * src/closure.c (print_fderives): Use rule_rhs_print.
17307 * src/derives.c (print_derives): Use rule_rhs_print.
17308 (rule_list_t): New, replaces `shorts'.
17309 (set_derives): Add comments.
17310 * tests/sets.at (Nullable, Firsts): Adjust.
17311
173122002-07-03 Akim Demaille <akim@epita.fr>
17313
17314 * src/output.c (prepare_actions): Free `tally' and `width'.
17315 (prepare_actions): Allocate and free `order'.
17316 * src/symtab.c (symbols_free): Free `symbols'.
17317 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
17318 * src/output.c (m4_invoke): Move to...
17319 * src/scan-skel.l: here.
17320 (<<EOF>>): Close yyout, and free its name.
17321
173222002-07-03 Akim Demaille <akim@epita.fr>
17323
17324 Fix some memory leaks, and fix a bug: state 0 was examined twice.
17325
17326 * src/LR0.c (new_state): Merge into...
17327 (state_list_append): this.
17328 (new_states): Merge into...
17329 (generate_states): here.
17330 (set_states): Don't ensure a proper `errs' state member here, do it...
17331 * src/conflicts.c (conflicts_solve): here.
17332 * src/state.h, src/state.c: Comment changes.
17333 (state_t): Rename member `shifts' as `transitions'.
17334 Adjust all dependencies.
17335 (errs_new): For consistency, also take the values as argument.
17336 (errs_dup): Remove.
17337 (state_errs_set): New.
17338 (state_reductions_set, state_transitions_set): Assert that no
17339 previous value was assigned.
17340 (state_free): New.
17341 (states_free): Use it.
17342 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
17343 temporary storage: use `errs' and `nerrs' as elsewhere.
17344 (set_conflicts): Allocate and free this `errs'.
17345
173462002-07-02 Akim Demaille <akim@epita.fr>
17347
17348 * lib/libiberty.h: New.
17349 * lib: Update the bitset implementation from upstream.
17350 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
17351 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
17352 * src/main.c: Adjust bitset stats calls.
17353
173542002-07-01 Paul Eggert <eggert@twinsun.com>
17355
17356 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
17357 char, so that negative chars don't collide with $.
17358
173592002-06-30 Akim Demaille <akim@epita.fr>
17360
17361 Have the GLR tests be `warning' checked, and fix the warnings.
17362
17363 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
17364 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
17365 (yyremoveDeletes): `yyi' and `yyj' are size_t.
17366 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
17367 (yyaddDeferredAction): static.
17368 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
17369 (yyreportParseError): yyprefix is const.
17370 yytokenp is used only when verbose.
17371 (yy__GNUC__): Replace with __GNUC__.
17372 (yypdumpstack): yyi is size_t.
17373 (yypreference): Un-yy local variables and arguments, to avoid
17374 clashes with `yyr1'. Anyway, we are not in the user name space.
17375 (yytname_size): be an int, as is compared with ints.
17376 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
17377 Use them.
17378 * tests/cxx-gram.at: Use quotation to protect $1.
17379 Use AT_COMPILE to enable warnings hunts.
17380 Prototype yylex and yyerror.
17381 `Use' argc.
17382 Include `string.h', not `strings.h'.
17383 Produce and prototype stmtMerge only when used.
17384 yylex takes a location.
17385
173862002-06-30 Akim Demaille <akim@epita.fr>
17387
17388 We spend a lot of time in quotearg, in particular when --verbose.
17389
17390 * src/symtab.c (symbol_get): Store a quoted version of the key.
17391 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
17392 Adjust all callers.
17393
173942002-06-30 Akim Demaille <akim@epita.fr>
17395
17396 * src/state.h (reductions_t): Rename member `nreds' as num.
17397 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
17398 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
17399
174002002-06-30 Akim Demaille <akim@epita.fr>
17401
17402 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
17403 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
17404 (shifts_to): Rename as...
17405 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
17406 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
17407 (TRANSITION_IS_DISABLED, transitions_to): these.
17408
174092002-06-30 Akim Demaille <akim@epita.fr>
17410
17411 * src/print.c (print_shifts, print_gotos): Merge into...
17412 (print_transitions): this.
17413 (print_transitions, print_errs, print_reductions): Align the
17414 lookaheads columns.
17415 (print_core, print_transitions, print_errs, print_state,
17416 print_grammar): Output empty lines separator before, not after.
17417 (state_default_rule_compute): Rename as...
17418 (state_default_rule): this.
17419 * tests/conflicts.at (Defaulted Conflicted Reduction),
17420 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
17421 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
17422
174232002-06-30 Akim Demaille <akim@epita.fr>
17424
17425 Display items as we display rules.
17426
17427 * src/gram.h, src/gram.c (rule_lhs_print): New.
17428 * src/gram.c (grammar_rules_partial_print): Use it.
17429 * src/print.c (print_core): Likewise.
17430 * tests/conflicts.at (Defaulted Conflicted Reduction),
17431 (Unresolved SR Conflicts): Adjust.
17432 (Unresolved SR Conflicts): Adjust and rename as...
17433 (Resolved SR Conflicts): this, as was meant.
17434 * tests/regression.at (Web2c Report): Adjust.
17435
174362002-06-30 Akim Demaille <akim@epita.fr>
17437
17438 * src/print.c (state_default_rule_compute): New, extracted from...
17439 (print_reductions): here.
17440 Pessimize, but clarify the code.
17441 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
17442
174432002-06-30 Akim Demaille <akim@epita.fr>
17444
17445 * src/output.c (action_row): Let default_rule be always a rule
17446 number.
17447
174482002-06-30 Akim Demaille <akim@epita.fr>
17449
17450 * src/closure.c (print_firsts, print_fderives, closure):
17451 Use BITSET_EXECUTE.
17452 * src/lalr.c (lookaheads_print): Likewise.
17453 * src/state.c (state_rule_lookaheads_print): Likewise.
17454 * src/print_graph.c (print_core): Likewise.
17455 * src/print.c (print_reductions): Likewise.
17456 * src/output.c (action_row): Likewise.
17457 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
17458
174592002-06-30 Akim Demaille <akim@epita.fr>
17460
17461 * src/print_graph.c: Use report_flag.
17462
174632002-06-30 Akim Demaille <akim@epita.fr>
17464
17465 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
17466 to...
17467 * src/relation.h, src/relation.c (traverse, relation_digraph)
17468 (relation_print, relation_transpose): New.
17469
174702002-06-30 Akim Demaille <akim@epita.fr>
17471
17472 * src/state.h, src/state.c (shifts_to): New.
17473 * src/lalr.c (build_relations): Use it.
17474
174752002-06-30 Akim Demaille <akim@epita.fr>
17476
17477 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
17478 (item_number_of_rule_number, rule_number_of_item_number): New.
17479 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
17480 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
17481 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
17482 Propagate their use.
17483 Much remains to be done, in particular wrt `shorts' from types.h.
17484
174852002-06-30 Akim Demaille <akim@epita.fr>
17486
17487 * src/symtab.c (symbol_new): Initialize the `printer' member.
17488
174892002-06-30 Akim Demaille <akim@epita.fr>
17490
17491 * src/LR0.c (save_reductions): Remove, replaced by...
17492 * src/state.h, src/state.c (state_reductions_set): New.
17493 (reductions, errs): Rename as...
17494 (reductions_t, errs_t): these.
17495 Adjust all dependencies.
17496
174972002-06-30 Akim Demaille <akim@epita.fr>
17498
17499 * src/LR0.c (state_list_t, state_list_append): New.
17500 (first_state, last_state): Now symbol_list_t.
17501 (this_state): Remove.
17502 (new_itemsets, append_states, save_reductions): Take a state_t as
17503 argument.
17504 (set_states, generate_states): Adjust.
17505 (save_shifts): Remove, replaced by...
17506 * src/state.h, src/state.c (state_shifts_set): New.
17507 (shifts): Rename as...
17508 (shifts_t): this.
17509 Adjust all dependencies.
17510 * src/state.h (state_t): Remove the `next' member.
17511
175122002-06-30 Akim Demaille <akim@epita.fr>
17513
17514 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
17515 escaped in slot 0.
17516
175172002-06-30 Akim Demaille <akim@epita.fr>
17518
17519 Use hash.h for the state hash table.
17520
17521 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
17522 (allocate_storage): Use state_hash_new.
17523 (free_storage): Use state_hash_free.
17524 (new_state, get_state): Adjust.
17525 * src/lalr.h, src/lalr.c (states): Move to...
17526 * src/states.h (state_t): Remove the `link' member, no longer
17527 used.
17528 * src/states.h, src/states.c: here.
17529 (state_hash_new, state_hash_free, state_hash_lookup)
17530 (state_hash_insert, states_free): New.
17531 * src/states.c (state_table, state_compare, state_hash): New.
17532 * src/output.c (output_actions): Do not free states now, since we
17533 still need to know the final_state number in `prepare', called
17534 afterwards. Do it...
17535 * src/main.c (main): here: call states_free after `output'.
17536
175372002-06-30 Akim Demaille <akim@epita.fr>
17538
17539 * src/state.h, src/state.c (state_new): New, extracted from...
17540 * src/LR0.c (new_state): here.
17541 * src/state.h (STATE_ALLOC): Move to...
17542 * src/state.c: here.
17543 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
17544 * src/state.h, src/state.c: here.
17545
175462002-06-30 Akim Demaille <akim@epita.fr>
17547
17548 * src/reader.c (gensym): Rename as...
17549 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
17550 (getsym): Rename as...
17551 (symbol_get): this.
17552
175532002-06-30 Akim Demaille <akim@epita.fr>
17554
17555 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
17556 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
17557 * src/output.c, src/print.c, src/print_graph.c: Propagate.
17558 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
17559
175602002-06-30 Akim Demaille <akim@epita.fr>
17561
17562 Make the test suite pass with warnings checked.
17563
17564 * tests/actions.at (Printers and Destructors): Improve.
17565 Avoid unsigned vs. signed issues.
17566 * tests/calc.at: Don't exercise the scanner here, do it...
17567 * tests/input.at (Torturing the Scanner): here.
17568
175692002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17570
17571 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
17572 reorganize first lines parallel to yacc.c.
17573
175742002-06-28 Akim Demaille <akim@epita.fr>
17575
17576 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
17577 (b4_token_enum, b4_token_defines): New, factored from...
17578 * data/lalr1.cc, data/yacc.c, glr.c: here.
17579
175802002-06-28 Akim Demaille <akim@epita.fr>
17581
17582 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
17583 unused variables.
17584 * src/output.c (merger_output): static.
17585
175862002-06-28 Akim Demaille <akim@epita.fr>
17587
17588 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
17589 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
17590 pacify GCC.
17591 * src/output.c (save_row): Initialize all the variables to pacify GCC.
17592
175932002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17594
17595 Accumulated changelog for new GLR parsing features.
17596
17597 * src/conflicts.c (count_total_conflicts): Change name to
17598 conflicts_total_count.
17599 * src/conflicts.h: Ditto.
17600 * src/output.c (token_actions): Use the new name.
17601 (output_conflicts): Change conflp => conflict_list_heads, and
17602 confl => conflict_list for better readability.
17603 * data/glr.c: Use the new names.
17604 * NEWS: Add self to GLR announcement.
17605
17606 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
17607
17608 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
17609 Akim Demaille.
17610
17611 * data/bison.glr: Change name to glr.c
17612 * data/glr.c: Renamed from bison.glr.
17613 * data/Makefile.am: Add glr.c
17614
17615 * src/getargs.c:
17616
17617 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
17618 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
17619
17620 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17621
17622 * data/bison.glr: Be sure to restore the
17623 current #line when returning to the skeleton contents after having
17624 exposed the input file's #line.
17625
17626 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17627
17628 * data/bison.glr: Bring up to date with changes to bison.simple.
17629
17630 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17631
17632 * data/bison.glr: Correct definitions that use b4_prefix.
17633 Various reformatting.
17634 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
17635 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
17636 yytokenp argument; now part of stack.
17637 (yychar): Define to behave as documented.
17638 (yyclearin): Ditto.
17639
17640 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17641
17642 * src/reader.h: Add declaration for free_merger_functions.
17643
17644 * src/reader.c (merge_functions): New variable.
17645 (get_merge_function): New function.
17646 (free_merger_functions): New function.
17647 (readgram): Check for %prec that is not followed by a symbol.
17648 Handle %dprec and %merge declarations.
17649 (packgram): Initialize dprec and merger fields in rules array.
17650
17651 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
17652 conflict_list_cnt, conflict_list_free): New variables.
17653 (table_grow): Also grow conflict_table.
17654 (prepare_rules): Output dprec and merger tables.
17655 (conflict_row): New function.
17656 (action_row): Output conflict lists for GLR parser. Don't use
17657 default reduction in conflicted states for GLR parser so that there
17658 are spaces for the conflict lists.
17659 (save_row): Also save conflict information.
17660 (token_actions): Allocate conflict list.
17661 (merger_output): New function.
17662 (pack_vector): Pack conflict table, too.
17663 (output_conflicts): New function to output yyconflp and yyconfl.
17664 (output_check): Allocate conflict_tos.
17665 (output_actions): Output conflict tables, also.
17666 (output_skeleton): Output b4_mergers definition.
17667 (prepare): Output b4_max_rhs_length definition.
17668 Use 'bison.glr' as default skeleton for GLR parsers.
17669
17670 * src/gram.c (glr_parser): New flag.
17671 (grammar_free): Call free_merger_functions.
17672
17673 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
17674 all pairs of conflicting reductions, rather than just all tokens
17675 causing conflicts. Needed to size conflict tables.
17676 (conflicts_output): Modify call to count_rr_conflicts for new
17677 interface.
17678 (conflicts_print): Ditto.
17679 (count_total_conflicts): New function.
17680
17681 * src/reader.h (merger_list): New type.
17682 (merge_functions): New variable.
17683
17684 * src/lex.h (tok_dprec, tok_merge): New token types.
17685
17686 * src/gram.h (rule_s): Add dprec and merger fields.
17687 (glr_parser): New flag.
17688
17689 * src/conflicts.h (count_total_conflicts): New function.
17690
17691 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
17692
17693 * doc/bison.texinfo (Generalized LR Parsing): New section.
17694 (GLR Parsers): New section.
17695 (Language and Grammar): Mention GLR parsing.
17696 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
17697 Correct typo ("tge" -> "the").
17698
17699 * data/bison.glr: New skeleton for GLR parsing.
17700
17701 * tests/cxx-gram.at: New tests for GLR parsing.
17702
17703 * tests/testsuite.at: Include cxx-gram.at.
17704
17705 * tests/Makefile.am: Add cxx-gram.at.
17706
17707 * src/parse-gram.y:
17708
17709 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
17710
17711 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
17712
177132002-06-27 Akim Demaille <akim@epita.fr>
17714
17715 * src/options.h, src/options.c: Remove.
17716 * src/getargs.c (short_options, long_options): New.
17717
177182002-06-27 Akim Demaille <akim@epita.fr>
17719
17720 * data/bison.simple, data/bison.c++: Rename as...
17721 * data/yacc.c, data/lalr1.cc: these.
17722 * doc/bison.texinfo (Environment Variables): Remove.
17723
177242002-06-25 Raja R Harinath <harinath@cs.umn.edu>
17725
17726 * src/getargs.c (report_argmatch): Initialize strtok().
17727
177282002-06-20 Akim Demaille <akim@epita.fr>
17729
17730 * data/bison.simple (b4_symbol_actions): New, replaces...
17731 (b4_symbol_destructor, b4_symbol_printer): these.
17732 (yysymprint): Be sure to call YYPRINT only for tokens, and using
17733 user token numbers.
17734
177352002-06-20 Akim Demaille <akim@epita.fr>
17736
17737 * data/bison.simple (yydestructor): Rename as...
17738 (yydestruct): this.
17739
177402002-06-20 Akim Demaille <akim@epita.fr>
17741
17742 * src/symtab.h, src/symtab.c (symbol_type_set)
17743 (symbol_destructor_set, symbol_precedence_set): The location is
17744 the last argument.
17745 Adjust all callers.
17746
177472002-06-20 Akim Demaille <akim@epita.fr>
17748
17749 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
17750 internals.
17751 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
17752 Takes a location.
17753 * src/symtab.h, src/symtab.c (symbol_class_set)
17754 (symbol_user_token_number_set): Likewise.
17755 Adjust all callers.
17756 Promote complain_at.
17757 * tests/input.at (Type Clashes): Adjust.
17758
177592002-06-20 Akim Demaille <akim@epita.fr>
17760
17761 * data/bison.simple (YYLEX): Fix the declaration when
17762 %pure-parser.
17763
177642002-06-20 Akim Demaille <akim@epita.fr>
17765
17766 * data/bison.simple (yysymprint): Don't print the token number,
17767 just its name.
17768 * tests/actions.at (Destructors): Rename as...
17769 (Printers and Destructors): this.
17770 Also exercise %printer.
17771
177722002-06-20 Akim Demaille <akim@epita.fr>
17773
17774 * data/bison.simple (YYDSYMPRINT): New.
17775 Use it to remove many of the #if YYDEBUG/if (yydebug).
17776
177772002-06-20 Akim Demaille <akim@epita.fr>
17778
17779 * src/symtab.h, src/symtab.c (symbol_t): printer and
17780 printer_location are new members.
17781 (symbol_printer_set): New.
17782 * src/parse-gram.y (PERCENT_PRINTER): New token.
17783 Handle its associated rule.
17784 * src/scan-gram.l: Adjust.
17785 (handle_destructor_at, handle_destructor_dollar): Rename as...
17786 (handle_symbol_code_at, handle_symbol_code_dollar): these.
17787 * src/output.c (symbol_printers_output): New.
17788 (output_skeleton): Call it.
17789 * data/bison.simple (yysymprint): New. Cannot be named yyprint
17790 since there are already many grammar files with a user `yyprint'.
17791 Replace the calls to YYPRINT to calls to yysymprint.
17792 * tests/calc.at: Adjust.
17793 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
17794 taking advantage of parser very internal details (stack size!).
17795
177962002-06-20 Akim Demaille <akim@epita.fr>
17797
17798 * src/scan-gram.l: Complete the scanner with the missing patterns
17799 to pacify Flex.
17800 Use `quote' and `symbol_tag_get' where appropriate.
17801
178022002-06-19 Akim Demaille <akim@epita.fr>
17803
17804 * tests/actions.at (Destructors): Augment to test locations.
17805 * data/bison.simple (yydestructor): Pass it the current location
17806 if locations are enabled.
17807 Prototype only when __STDC__ or C++.
17808 Change the argument names to move into the yy name space: there is
17809 user code here.
17810
178112002-06-19 Akim Demaille <akim@epita.fr>
17812
17813 * data/bison.simple (b4_pure_if): New.
17814 Use it instead of #ifdef YYPURE.
17815
178162002-06-19 Akim Demaille <akim@epita.fr>
17817
17818 * data/bison.simple (b4_location_if): New.
17819 Use it instead of #ifdef YYLSP_NEEDED.
17820
178212002-06-19 Akim Demaille <akim@epita.fr>
17822
17823 Prepare @$ in %destructor, but currently don't bind it in the
17824 skeleton, as %location use is not cleaned up yet.
17825
17826 * src/scan-gram.l (handle_dollar, handle_destructor_at)
17827 (handle_action_at): New.
17828 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
17829 a braced_code_t and a location as additional arguments.
17830 (handle_destructor_dollar): Instead of requiring `b4_eval', just
17831 unquote one when outputting `b4_dollar_dollar'.
17832 Adjust callers.
17833 * data/bison.simple (b4_eval): Remove.
17834 (b4_symbol_destructor): Adjust.
17835 * tests/input.at (Invalid @n): Adjust.
17836
178372002-06-19 Zack Weinberg <zack@codesourcery.com>
17838
17839 * doc/bison.texinfo: Document ability to have multiple
17840 prologue sections.
17841
178422002-06-18 Akim Demaille <akim@epita.fr>
17843
17844 * src/files.c (compute_base_names): When computing the output file
17845 names from the input file name, strip the directory part.
17846
178472002-06-18 Akim Demaille <akim@epita.fr>
17848
17849 * data/bison.simple.new: Comment changes.
17850 Reported by Andreas Schwab.
17851
178522002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
17853
17854 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
17855 there are no `label `yyoverflowlab' defined but not used' warnings
17856 when yyoverflow is defined.
17857
178582002-06-18 Akim Demaille <akim@epita.fr>
17859
17860 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
17861 new member.
17862 (symbol_destructor_set): Adjust.
17863 * src/output.c (symbol_destructors_output): Output the destructor
17864 locations.
17865 Output the symbol name.
17866 * data/bison.simple (b4_symbol_destructor): Adjust.
17867
178682002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
17869 and Akim Demaille <akim@epita.fr>
17870
17871 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
17872 what's left on the stack when the error recovery hits EOF.
17873 * tests/actions.at (Destructors): Complete to exercise this case.
17874
178752002-06-17 Akim Demaille <akim@epita.fr>
17876
17877 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
17878 arguments is really empty, not only equal to `[]'.
17879 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
17880 member.
17881 (symbol_destructor_set): New.
17882 * src/output.c (symbol_destructors_output): New.
17883 * src/reader.h (brace_code_t, current_braced_code): New.
17884 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
17885 (handle_dollar): Rename as...
17886 (handle_action_dollar): this.
17887 (handle_destructor_dollar): New.
17888 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
17889 (grammar_declaration): Use it.
17890 * data/bison.simple (yystos): Is always defined.
17891 (yydestructor): New.
17892 * tests/actions.at (Destructors): New.
17893 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
17894
178952002-06-17 Akim Demaille <akim@epita.fr>
17896
17897 * src/symlist.h, src/symlist.c (symbol_list_length): New.
17898 * src/scan-gram.l (handle_dollar, handle_at): Compute the
17899 rule_length only when needed.
17900 * src/output.c (actions_output, token_definitions_output): Output
17901 the full M4 block.
17902 * src/symtab.c: Don't access directly to the symbol tag, use
17903 symbol_tag_get.
17904 * src/parse-gram.y: Use symbol_list_free.
17905
179062002-06-17 Akim Demaille <akim@epita.fr>
17907
17908 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
17909 (symbol_list_prepend, get_type_name): Move to...
17910 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
17911 (symbol_list_prepend, symbol_list_n_type_name_get): here.
17912 Adjust all callers.
17913 (symbol_list_free): New.
17914 * src/scan-gram.l (handle_dollar): Takes a location.
17915 * tests/input.at (Invalid $n): Adjust.
17916
179172002-06-17 Akim Demaille <akim@epita.fr>
17918
17919 * src/reader.h, src/reader.c (symbol_list_new): Export it.
17920 (symbol_list_prepend): New.
17921 * src/parse-gram.y (%union): `list' is a new member.
17922 (symbols.1): New, replaces...
17923 (terms_to_prec.1, nterms_to_type.1): these.
17924 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
17925 Take a location as additional argument.
17926 Adjust all callers.
17927
179282002-06-15 Akim Demaille <akim@epita.fr>
17929
17930 * src/parse-gram.y: Move %token in the declaration section so that
17931 we don't depend upon CVS Bison.
17932
179332002-06-15 Akim Demaille <akim@epita.fr>
17934
17935 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
17936 * src/print.c (print_core): Use it.
17937
179382002-06-15 Akim Demaille <akim@epita.fr>
17939
17940 * src/conflicts.c (log_resolution): Accept the rule involved in
17941 the sr conflicts instead of the lookahead number that points to
17942 that rule.
17943 (flush_reduce): Accept the current lookahead vector as argument,
17944 instead of the index in LA.
17945 (resolve_sr_conflict): Accept the current number of lookahead
17946 bitset to consider for the STATE, instead of the index in LA.
17947 (set_conflicts): Adjust.
17948 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
17949
179502002-06-15 Akim Demaille <akim@epita.fr>
17951
17952 * src/state.h (state_t): Replace the `lookaheadsp' member, a
17953 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
17954 Adjust all dependencies.
17955 * src/lalr.c (initialize_lookaheads): Split into...
17956 (states_lookaheads_count, states_lookaheads_initialize): these.
17957 (lalr): Adjust.
17958
179592002-06-15 Akim Demaille <akim@epita.fr>
17960
17961 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
17962 out of...
17963 (grammar_rules_print): here.
17964 * src/reduce.c (reduce_output): Use it.
17965 * tests/reduce.at (Useless Rules, Reduced Automaton)
17966 (Underivable Rules): Adjust.
17967
179682002-06-15 Akim Demaille <akim@epita.fr>
17969
17970 Copy BYacc's nice way to report the grammar.
17971
17972 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
17973 New.
17974 Don't print the rules' location, it is confusing and useless.
17975 (rule_print): Use grammar_rhs_print.
17976 * src/print.c (print_grammar): Use grammar_rules_print.
17977
179782002-06-15 Akim Demaille <akim@epita.fr>
17979
17980 Complete and rationalize `useless thing' warnings.
17981
17982 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
17983 (symbol_tag_print): New.
17984 Use them everywhere in place of accessing directly the tag member.
17985 * src/gram.h, src/gram.c (rule_print): New.
17986 Use it where a rule used to be printed `by hand'.
17987 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
17988 (reduce_grammar_tables): Report the useless rules.
17989 (reduce_print): Useless things are a warning, not an error.
17990 Report it as such.
17991 * tests/reduce.at (Useless Nonterminals, Useless Rules):
17992 (Reduced Automaton, Underivable Rules): Adjust.
17993 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
17994 * tests/conflicts.at (Unresolved SR Conflicts)
17995 (Solved SR Conflicts): Adjust.
17996
179972002-06-15 Akim Demaille <akim@epita.fr>
17998
17999 Let symbols have a location.
18000
18001 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
18002 (getsym): Adjust.
18003 Adjust all callers.
18004 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
18005 Use location_t, not int.
18006 * src/symtab.c (symbol_check_defined): Take advantage of the
18007 location.
18008 * tests/regression.at (Invalid inputs): Adjust.
18009
180102002-06-15 Akim Demaille <akim@epita.fr>
18011
18012 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
18013 (input): Don't try to initialize yylloc here, do it in the
18014 scanner.
18015 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
18016 * src/gram.h (rule_t): Change line and action_line into location
18017 and action_location, of location_t type.
18018 Adjust all dependencies.
18019 * src/location.h, src/location.c (empty_location): New.
18020 * src/reader.h, src/reader.c (grammar_start_symbol_set)
18021 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
18022 (grammar_current_rule_symbol_append)
18023 (grammar_current_rule_action_append): Expect a location as argument.
18024 * src/reader.c (grammar_midrule_action): Adjust to attach an
18025 action's location as dummy symbol location.
18026 * src/symtab.h, src/symtab.c (startsymbol_location): New.
18027 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
18028 the line numbers.
18029
180302002-06-14 Akim Demaille <akim@epita.fr>
18031
18032 Grammar declarations may be found in the grammar section.
18033
18034 * src/parse-gram.y (rules_or_grammar_declaration): New.
18035 (declarations): Each declaration may end with a semicolon, not
18036 just...
18037 (grammar_declaration): `"%union"'.
18038 (grammar): Branch to rules_or_grammar_declaration.
18039
180402002-06-14 Akim Demaille <akim@epita.fr>
18041
18042 * src/main.c (main): Invoke scanner_free.
18043
180442002-06-14 Akim Demaille <akim@epita.fr>
18045
18046 * src/output.c (m4_invoke): Extracted from...
18047 (output_skeleton): here.
18048 Free tempfile.
18049
180502002-06-14 Akim Demaille <akim@epita.fr>
18051
18052 * src/parse-gram.y (directives, directive, gram)
18053 (grammar_directives, precedence_directives, precedence_directive):
18054 Rename as...
18055 (declarations, declaration, grammar, grammar_declaration)
18056 (precedence_declaration, precedence_declarator): these.
18057 (symbol_declaration): New.
18058
180592002-06-14 Akim Demaille <akim@epita.fr>
18060
18061 * src/files.c (action_obstack): Remove, unused.
18062 (output_obstack): Remove it, and all its dependencies, as it is no
18063 longer needed.
18064 * src/reader.c (epilogue_set): Build the epilogue in the
18065 muscle_obstack.
18066 * src/output.h, src/output.c (muscle_obstack): Move to...
18067 * src/muscle_tab.h, src/muscle_tab.h: here.
18068 (muscle_init): Initialize muscle_obstack.
18069 (muscle_free): New.
18070 * src/main.c (main): Call it.
18071
180722002-06-14 Akim Demaille <akim@epita.fr>
18073
18074 * src/location.h: New, extracted from...
18075 * src/reader.h: here.
18076 * src/Makefile.am (noinst_HEADERS): Merge into
18077 (bison_SOURCES): this.
18078 Add location.h.
18079 * src/parse-gram.y: Use location_t instead of Bison's.
18080 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
18081 Use location_t instead of ints.
18082
180832002-06-14 Akim Demaille <akim@epita.fr>
18084
18085 * data/bison.simple, data/bison.c++: Be sure to restore the
18086 current #line when returning to the skeleton contents after having
18087 exposed the input file's #line.
18088
180892002-06-12 Akim Demaille <akim@epita.fr>
18090
18091 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
18092 eager.
18093 * tests/actions.at (Exotic Dollars): New.
18094
180952002-06-12 Akim Demaille <akim@epita.fr>
18096
18097 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
18098 ['"/] too eagerly.
18099 * tests/input.at (Torturing the Scanner): New.
18100
181012002-06-11 Akim Demaille <akim@epita.fr>
18102
18103 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
18104 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
18105 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
18106 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
18107 * src/reader.c (reader): Use it.
18108
181092002-06-11 Akim Demaille <akim@epita.fr>
18110
18111 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
18112 Adjust all callers.
18113 (scanner_last_string_free): New.
18114
181152002-06-11 Akim Demaille <akim@epita.fr>
18116
18117 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
18118 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
18119 (last_string, YY_OBS_FREE): New.
18120 Use them when returning an ID.
18121
181222002-06-11 Akim Demaille <akim@epita.fr>
18123
18124 Have Bison grammars parsed by a Bison grammar.
18125
18126 * src/reader.c, src/reader.h (prologue_augment): New.
18127 * src/reader.c (copy_definition): Remove.
18128
18129 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
18130 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
18131 (grammar_current_rule_prec_set, grammar_current_rule_check)
18132 (grammar_current_rule_symbol_append)
18133 (grammar_current_rule_action_append): Export.
18134 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
18135 (symbol_list_action_append): Remove.
18136 Hook the routines from reader.
18137 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
18138 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
18139
18140 * src/reader.c (read_declarations): Remove, unused.
18141
18142 * src/parse-gram.y: Handle the epilogue.
18143 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
18144 (grammar_start_symbol_set): this.
18145 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
18146 * src/reader.c (readgram): Remove, unused.
18147 (reader): Adjust to insert eoftoken and axiom where appropriate.
18148
18149 * src/reader.c (copy_dollar): Replace with...
18150 * src/scan-gram.h (handle_dollar): this.
18151 * src/parse-gram.y: Remove `%thong'.
18152
18153 * src/reader.c (copy_at): Replace with...
18154 * src/scan-gram.h (handle_at): this.
18155
18156 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
18157 New.
18158
18159 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
18160 time being.
18161
18162 * src/reader.h, src/reader.c (grammar_rule_end): New.
18163
18164 * src/parse.y (current_type, current_class): New.
18165 Implement `%nterm', `%token' support.
18166 Merge `%term' into `%token'.
18167 (string_as_id): New.
18168 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
18169 type name.
18170
18171 * src/parse-gram.y: Be sure to handle properly the beginning of
18172 rules.
18173
18174 * src/parse-gram.y: Handle %type.
18175 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
18176
18177 * src/parse-gram.y: More directives support.
18178 * src/options.c: No longer handle source directives.
18179
18180 * src/parse-gram.y: Fix %output.
18181
18182 * src/parse-gram.y: Handle %union.
18183 Use the prologue locations.
18184 * src/reader.c (parse_union_decl): Remove.
18185
18186 * src/reader.h, src/reader.c (epilogue_set): New.
18187 * src/parse-gram.y: Use it.
18188
18189 * data/bison.simple, data/bison.c++: b4_stype is now either not
18190 defined, then default to int, or to the contents of %union,
18191 without `union' itself.
18192 Adjust.
18193 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
18194
18195 * src/output.c (actions_output): Don't output braces, as they are
18196 already handled by the scanner.
18197
18198 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
18199 characters to themselves.
18200
18201 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
18202 that the epilogue has a proper #line.
18203
18204 * src/parse-gram.y: Handle precedence/associativity.
18205
18206 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
18207 a terminal.
18208 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
18209 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
18210 at all to define terminals that cannot be emitted.
18211
18212 * src/scan-gram.l: Escape M4 characters.
18213
18214 * src/scan-gram.l: Working properly with escapes in user
18215 strings/characters.
18216
18217 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
18218 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
18219 grammar.
18220 Use more modest sizes, as for the time being the parser does not
18221 release memory, and therefore the process swallows a huge amount
18222 of memory.
18223
18224 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
18225 stricter %token grammar.
18226
18227 * src/symtab.h (associativity): Add `undef_assoc'.
18228 (symbol_precedence_set): Do nothing when passed an undef_assoc.
18229 * src/symtab.c (symbol_check_alias_consistence): Adjust.
18230
18231 * tests/regression.at (Invalid %directive): Remove, as it is now
18232 meaningless.
18233 (Invalid inputs): Adjust to the new error messages.
18234 (Token definitions): The new grammar doesn't allow too many
18235 eccentricities.
18236
18237 * src/lex.h, src/lex.c: Remove.
18238 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
18239 (copy_character, copy_string2, copy_string, copy_identifier)
18240 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
18241 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
18242 (parse_action): Remove.
18243 * po/POTFILES.in: Adjust.
18244
182452002-06-11 Akim Demaille <akim@epita.fr>
18246
18247 * src/reader.c (parse_action): Don't store directly into the
18248 rule's action member: return the action as a string.
18249 Don't require `rule_length' as an argument: compute it.
18250 (grammar_current_rule_symbol_append)
18251 (grammar_current_rule_action_append): New, eved out from
18252 (readgram): here.
18253 Remove `action_flag', `rulelength', unused now.
18254
182552002-06-11 Akim Demaille <akim@epita.fr>
18256
18257 * src/reader.c (grammar_current_rule_prec_set).
18258 (grammar_current_rule_check): New, eved out from...
18259 (readgram): here.
18260 Remove `xaction', `first_rhs': useless.
18261 * tests/input.at (Type clashes): New.
18262 * tests/existing.at (GNU Cim Grammar): Adjust.
18263
182642002-06-11 Akim Demaille <akim@epita.fr>
18265
18266 * src/reader.c (grammar_midrule_action): New, Eved out from
18267 (readgram): here.
18268
182692002-06-11 Akim Demaille <akim@epita.fr>
18270
18271 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
18272 New.
18273 (readgram): Use them as replacement of inlined code, crule and
18274 crule1.
18275
182762002-06-11 Akim Demaille <akim@epita.fr>
18277
18278 * src/reader.c (grammar_end, grammar_symbol_append): New.
18279 (readgram): Use them.
18280 Make the use of `p' as local as possible.
18281
182822002-06-10 Akim Demaille <akim@epita.fr>
18283
18284 GCJ's parser requires the tokens to be defined before the prologue.
18285
18286 * data/bison.simple: Output the token definition before the user's
18287 prologue.
18288 * tests/regression.at (Braces parsing, Duplicate string)
18289 (Mixing %token styles): Check the output from bison.
18290 (Early token definitions): New.
18291
182922002-06-10 Akim Demaille <akim@epita.fr>
18293
18294 * src/symtab.c (symbol_user_token_number_set): Don't complain when
18295 assigning twice the same user number to a token, so that we can
18296 use it in...
18297 * src/lex.c (lex): here.
18298 Also use `symbol_class_set' instead of hand written code.
18299 * src/reader.c (parse_assoc_decl): Likewise.
18300
183012002-06-10 Akim Demaille <akim@epita.fr>
18302
18303 * src/symtab.c, src/symtab.c (symbol_class_set)
18304 (symbol_user_token_number_set): New.
18305 * src/reader.c (parse_token_decl): Use them.
18306 Use a switch instead of ifs.
18307 Use a single argument.
18308
183092002-06-10 Akim Demaille <akim@epita.fr>
18310
18311 Remove `%thong' support as it is undocumented, unused, duplicates
18312 `%token's job, and creates useless e-mail traffic with people who
18313 want to know what it is, why it is undocumented, unused, and
18314 duplicates `%token's job.
18315
18316 * src/reader.c (parse_thong_decl): Remove.
18317 * src/options.c (option_table): Remove "thong".
18318 * src/lex.h (tok_thong): Remove.
18319
183202002-06-10 Akim Demaille <akim@epita.fr>
18321
18322 * src/symtab.c, src/symtab.c (symbol_type_set)
18323 (symbol_precedence_set): New.
18324 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
18325 (value_components_used): Remove, unused.
18326
183272002-06-09 Akim Demaille <akim@epita.fr>
18328
18329 Move symbols handling code out of the reader.
18330
18331 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
18332 (axiom): Move to...
18333 * src/symtab.h, src/symtab.c: here.
18334
18335 * src/gram.c (start_symbol): Remove: use startsymbol->number.
18336 * src/reader.c (startval): Rename as...
18337 * src/symtab.h, src/symtab.c (startsymbol): this.
18338 * src/reader.c: Adjust.
18339
18340 * src/reader.c (symbol_check_defined, symbol_make_alias)
18341 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
18342 (token_translations_init)
18343 Move to...
18344 * src/symtab.c: here.
18345 * src/reader.c (packsymbols): Move to...
18346 * src/symtab.h, src/symtab.c (symbols_pack): here.
18347 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
18348 argument.
18349
183502002-06-03 Akim Demaille <akim@epita.fr>
18351
18352 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
18353 then statements.
18354
183552002-06-03 Akim Demaille <akim@epita.fr>
18356
18357 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
18358 structs with non literals.
18359 * src/scan-skel.l: never-interactive.
18360 * src/conflicts.c (enum conflict_resolution_e): No trailing
18361 comma.
18362 * src/getargs.c (usage): Split long literal strings.
18363 Reported by Hans Aberg.
18364
183652002-05-28 Akim Demaille <akim@epita.fr>
18366
18367 * data/bison.c++: Use C++ ostreams.
18368 (cdebug_): New member.
18369
183702002-05-28 Akim Demaille <akim@epita.fr>
18371
18372 * src/output.c (output_skeleton): Be sure to allocate enough room
18373 for `/' _and_ for `\0' in full_skeleton.
18374
183752002-05-28 Akim Demaille <akim@epita.fr>
18376
18377 * data/bison.c++: Catch up with bison.simple:
18378 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18379 and Paul Eggert <eggert@twinsun.com>: `error' handing.
18380 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
18381 and popping traces.
18382
183832002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18384
18385 * src/output.c (output_skeleton): Put an explicit path in front of
18386 the skeleton file name, rather than relying on the -I directory,
18387 to partially alleviate effects of having a skeleton file lying around
18388 in the current directory.
18389
183902002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18391
18392 * src/conflicts.c (log_resolution): Correct typo:
18393 obstack_printf should be obstack_fgrow1.
18394
183952002-05-26 Akim Demaille <akim@epita.fr>
18396
18397 * src/state.h (state_t): `solved_conflicts' is a new member.
18398 * src/LR0.c (new_state): Set it to 0.
18399 * src/conflicts.h, src/conflicts.c (print_conflicts)
18400 (free_conflicts, solve_conflicts): Rename as...
18401 (conflicts_print, conflicts_free, conflicts_solve): these.
18402 Adjust callers.
18403 * src/conflicts.c (enum conflict_resolution_e)
18404 (solved_conflicts_obstack): New, used by...
18405 (log_resolution): this.
18406 Adjust to attach the conflict resolution to each state.
18407 Complete the description with the precedence/associativity
18408 information.
18409 (resolve_sr_conflict): Adjust.
18410 * src/print.c (print_state): Output its solved_conflicts.
18411 * tests/conflicts.at (Unresolved SR Conflicts)
18412 (Solved SR Conflicts): Exercise --report=all.
18413
184142002-05-26 Akim Demaille <akim@epita.fr>
18415
18416 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
18417 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
18418 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
18419 (token_number_t, item_number_as_token_number)
18420 (token_number_as_item_number, muscle_insert_token_number_table):
18421 Rename as...
18422 (symbol_number_t, item_number_as_symbol_number)
18423 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
18424 these, since it is more appropriate.
18425
184262002-05-26 Akim Demaille <akim@epita.fr>
18427
18428 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
18429 `Error:' lines.
18430 * data/bison.simple (yystos) [YYDEBUG]: New.
18431 (yyparse) [YYDEBUG]: Display the symbols which are popped during
18432 error recovery.
18433 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
18434
184352002-05-25 Akim Demaille <akim@epita.fr>
18436
18437 * doc/bison.texinfo (Debugging): Split into...
18438 (Tracing): this new section, its former contents, and...
18439 (Understanding): this new section.
18440 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
18441 by...
18442 (report_flag): this.
18443 Adjust all dependencies.
18444 (report_args, report_types, report_argmatch): New.
18445 (usage, getargs): Report/support -r, --report.
18446 * src/options.h
18447 (struct option_table_struct): Rename as..,
18448 (struct option_table_s): this.
18449 Rename the `set_flag' member to `flag' to match with getopt_long's
18450 struct.
18451 * src/options.c (option_table): Split verbose into an entry for
18452 %verbose, and another for --verbose.
18453 Support --report/-r, so remove -r from the obsolete --raw.
18454 * src/print.c: Attach full item sets and lookaheads reports to
18455 report_flag instead of trace_flag.
18456 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
18457
184582002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18459 and Paul Eggert <eggert@twinsun.com>
18460
18461 * data/bison.simple (yyparse): Correct error handling to conform to
18462 POSIX and yacc. Specifically, after syntax error is discovered,
18463 do not reduce further before shifting the error token.
18464 Clean up the code a bit by removing the labels yyerrdefault,
18465 yyerrhandle, yyerrpop.
18466 * NEWS: Document the above.
18467
184682002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18469
18470 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
18471 type; it isn't always big enough, since it doesn't necessarily
18472 include non-terminals.
18473 (yytranslate): Expand definition of yy_token_number_type, so that
18474 the latter can be removed.
18475 (yy_token_number_type): Remove, only one use.
18476 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
18477 don't use TokenNumberType as element type.
18478
18479 * tests/regression.at: Modify expected output to agree with change
18480 to yyr1 and yytranslate.
18481
184822002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
18483
18484 * src/reader.c (parse_action): Use copy_character instead of
18485 obstack_1grow.
18486
184872002-05-13 Akim Demaille <akim@epita.fr>
18488
18489 * tests/regression.at (Token definitions): Prototype yylex and
18490 yyerror.
18491
184922002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18493
18494 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
18495 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
18496 32-bit arithmetic.
18497 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
18498
184992002-05-07 Akim Demaille <akim@epita.fr>
18500
18501 * tests/synclines.at: Be sure to prototype yylex and yyerror to
18502 avoid GCC warnings.
18503
185042002-05-07 Akim Demaille <akim@epita.fr>
18505
18506 Kill GCC warnings.
18507
18508 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
18509 over the RHS of each rule.
18510 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
18511 * src/state.h (state_t): Member `nitems' is unsigned short.
18512 * src/LR0.c (get_state): Adjust.
18513 * src/reader.c (packgram): Likewise.
18514 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
18515 `Type'.
18516 (muscle_insert_int_table): Remove, unused.
18517 (prepare_rules): Remove `max'.
18518
185192002-05-06 Akim Demaille <akim@epita.fr>
18520
18521 * src/closure.c (print_firsts): Display of the symbol tags.
18522 (bitmatrix_print): Move to...
18523 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
18524 here.
18525 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
18526
185272002-05-06 Akim Demaille <akim@epita.fr>
18528
18529 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
18530 hash_do_for_each.
18531
185322002-05-06 Akim Demaille <akim@epita.fr>
18533
18534 * src/LR0.c (new_state, get_state): Instead of using the global
18535 `kernel_size' and `kernel_base', have two new arguments:
18536 `core_size' and `core'.
18537 Adjust callers.
18538
185392002-05-06 Akim Demaille <akim@epita.fr>
18540
18541 * src/reader.c (packgram): No longer end `ritem' with a 0
18542 sentinel: it is not used.
18543
185442002-05-05 Akim Demaille <akim@epita.fr>
18545
18546 New experimental feature: display the lookaheads in the report and
18547 graph.
18548
18549 * src/print (print_core): When --trace-flag, display the rules
18550 lookaheads.
18551 * src/print_graph.c (print_core): Likewise.
18552 Swap the arguments.
18553 Adjust caller.
18554
185552002-05-05 Akim Demaille <akim@epita.fr>
18556
18557 * tests/torture.at (Many lookaheads): New test.
18558
185592002-05-05 Akim Demaille <akim@epita.fr>
18560
18561 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
18562 (GENERATE_MUSCLE_INSERT_TABLE): this.
18563 (output_int_table, output_unsigned_int_table, output_short_table)
18564 (output_token_number_table, output_item_number_table): Replace with...
18565 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
18566 (muscle_insert_short_table, muscle_insert_token_number_table)
18567 (muscle_insert_item_number_table): these.
18568 Adjust all callers.
18569 (prepare_tokens): Don't free `translations', since...
18570 * src/reader.h, src/reader.c (grammar_free): do it.
18571 Move to...
18572 * src/gram.h, src/gram.c (grammar_free): here.
18573 * data/bison.simple, data/bison.c++: b4_token_number_max is now
18574 b4_translate_max.
18575
185762002-05-05 Akim Demaille <akim@epita.fr>
18577
18578 * src/output.c (output_unsigned_int_table): New.
18579 (prepare_rules): `i' is unsigned.
18580 `prhs', `rline', `r2' are unsigned int.
18581 Rename muscle `rhs_number_max' as `rhs_max'.
18582 Output muscles `prhs_max', `rline_max', and `r2_max'.
18583 Free rline and r1.
18584 * data/bison.simple, data/bison.c++: Adjust to use these muscles
18585 to compute types instead of constant types.
18586 * tests/regression.at (Web2c Actions): Adjust.
18587
185882002-05-04 Akim Demaille <akim@epita.fr>
18589
18590 * src/symtab.h (SALIAS, SUNDEF): Rename as...
18591 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
18592 Adjust dependencies.
18593 * src/output.c (token_definitions_output): Be sure not to output a
18594 `#define 'a'' when fed with `%token 'a' "a"'.
18595 * tests/regression.at (Token definitions): New.
18596
185972002-05-03 Paul Eggert <eggert@twinsun.com>
18598
18599 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
18600 for K&R C.
18601
186022002-05-03 gettextize <bug-gnu-gettext@gnu.org>
18603
18604 * Makefile.am (SUBDIRS): Remove intl.
18605 (EXTRA_DIST): Add config/config.rpath.
18606
186072002-05-03 Akim Demaille <akim@epita.fr>
18608
18609 * data/bison.simple (m4_if): Don't output empty enums.
18610 And actually, output valid enum definitions :(.
18611
186122002-05-03 Akim Demaille <akim@epita.fr>
18613
18614 * configure.bat: Remove, completely obsolete.
18615 * Makefile.am (EXTRA_DIST): Adjust.
18616 Don't distribute config.rpath...
18617 * config/Makefile.am (EXTRA_DIST): Do it.
18618
186192002-05-03 Akim Demaille <akim@epita.fr>
18620
18621 * configure.in (GETTEXT_VERSION): New.
18622 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
18623
186242002-05-03 Akim Demaille <akim@epita.fr>
18625
18626 * data/bison.simple (b4_token_enum): New.
18627 (b4_token_defines): Use it to output tokens both as #define and
18628 enums.
18629 Suggested by Paul Eggert.
18630 * src/output.c (token_definitions_output): Don't output spurious
18631 white spaces.
18632
186332002-05-03 Akim Demaille <akim@epita.fr>
18634
18635 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
18636
186372002-05-02 Robert Anisko <robert@lrde.epita.fr>
18638
18639 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
18640 Update the stack class, give a try to deque as the default container.
18641
186422002-05-02 Akim Demaille <akim@epita.fr>
18643
18644 * data/bison.simple (yyparse): Do not implement @$ = @1.
18645 (YYLLOC_DEFAULT): Adjust to do it.
18646 * doc/bison.texinfo (Location Default Action): Fix.
18647
186482002-05-02 Akim Demaille <akim@epita.fr>
18649
18650 * src/reader.c (parse_braces): Merge into...
18651 (parse_action): this.
18652
186532002-05-02 Akim Demaille <akim@epita.fr>
18654
18655 * configure.in (ALL_LINGUAS): Remove.
18656 * po/LINGUAS, hr.po: New.
18657
186582002-05-02 Akim Demaille <akim@epita.fr>
18659
18660 Remove the so called hairy (semantic) parsers.
18661
18662 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
18663 * src/gram.h, src/gram.c (semantic_parser): Remove.
18664 (rule_t): Remove the guard and guard_line members.
18665 * src/lex.h (token_t): remove tok_guard.
18666 * src/options.c (option_table): Remove %guard and %semantic_parser
18667 support.
18668 * src/output.c, src/output.h (guards_output): Remove.
18669 (prepare): Adjust.
18670 (token_definitions_output): Don't output the `T'
18671 tokens (???).
18672 (output_skeleton): Don't output the guards.
18673 * src/files.c, src/files.c (attrsfile): Remove.
18674 * src/reader.c (symbol_list): Remove the guard and guard_line
18675 members.
18676 Adjust dependencies.
18677 (parse_guard): Remove.
18678 * data/bison.hairy: Remove.
18679 * doc/bison.texinfo (Environment Variables): Remove occurrences of
18680 BISON_HAIRY.
18681
186822002-05-02 Akim Demaille <akim@epita.fr>
18683
18684 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
18685 (parse_guard): Rename the formal argument `stack_offset' as
18686 `rule_length', which is more readable.
18687 Adjust callers.
18688 (copy_at, copy_dollar): Instead of outputting the hard coded
18689 values of $$, $n and so forth, output invocation to b4_lhs_value,
18690 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
18691 Note: this patch partially drops `semantic-parser' support: it
18692 always does `rule_length - n', where semantic parsers ought to
18693 always use `-n'.
18694 * data/bison.simple, data/bison.c++ (b4_lhs_value)
18695 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
18696
186972002-05-02 Akim Demaille <akim@epita.fr>
18698
18699 * configure.in (AC_INIT): Bump to 1.49b.
18700 (AM_INIT_AUTOMAKE): Short invocation.
18701
187022002-05-02 Akim Demaille <akim@epita.fr>
18703
18704 Version 1.49a.
18705
187062002-05-01 Akim Demaille <akim@epita.fr>
18707
18708 * src/skeleton.h: Remove.
18709
187102002-05-01 Akim Demaille <akim@epita.fr>
18711
18712 * src/skeleton.h: Fix the #endif.
18713 Reported by Magnus Fromreide.
18714
187152002-04-26 Paul Eggert <eggert@twinsun.com>
18716
18717 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
18718 Define if we define YYSTYPE and YYLTYPE, respectively.
18719 (YYCOPY): Fix [] quoting problem in the non-GCC case.
18720
187212002-04-25 Robert Anisko <robert@lrde.epita.fr>
18722
18723 * src/scan-skel.l: Postprocess quadrigraphs.
18724
18725 * src/reader.c (copy_character): New function, used to output
18726 single characters while replacing `[' and `]' with quadrigraphs, to
18727 avoid troubles with M4 quotes.
18728 (copy_comment): Output characters with copy_character.
18729 (read_additionnal_code): Likewise.
18730 (copy_string2): Likewise.
18731 (copy_definition): Likewise.
18732
18733 * tests/calc.at: Exercise M4 quoting.
18734
187352002-04-25 Akim Demaille <akim@epita.fr>
18736
18737 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
18738 between `!' and the command.
18739 Reported by Paul Eggert.
18740
187412002-04-24 Robert Anisko <robert@lrde.epita.fr>
18742
18743 * tests/calc.at: Exercise prologue splitting.
18744
18745 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
18746 `b4_post_prologue' instead of `b4_prologue'.
18747
18748 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
18749 muscles.
18750 (output): Free pre_prologue_obstack and post_prologue_obstack.
18751 * src/files.h, src/files.c (attrs_obstack): Remove.
18752 (pre_prologue_obstack, post_prologue_obstack): New.
18753 * src/reader.c (copy_definition): Add a parameter to specify the
18754 obstack to fill, instead of using attrs_obstack unconditionally.
18755 (read_declarations): Pass pre_prologue_obstack to copy_definition if
18756 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
18757
187582002-04-23 Paul Eggert <eggert@twinsun.com>
18759
18760 * data/bison.simple: Remove unnecessary commentary and white
18761 space differences from 1_29-branch.
18762 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
18763
18764 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
18765 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
18766 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
18767 constructors or destructors.
18768
18769 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
18770
187712002-04-23 Akim Demaille <akim@epita.fr>
18772
18773 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
18774 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
18775 location with columns.
18776 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
18777 All reported by Paul Eggert.
18778
187792002-04-22 Akim Demaille <akim@epita.fr>
18780
18781 * src/reduce.c (dump_grammar): Move to...
18782 * src/gram.h, src/gram.c (grammar_dump): here.
18783 Be sure to separate long item numbers.
18784 Don't read the members of a rule's prec if its nil.
18785
187862002-04-22 Akim Demaille <akim@epita.fr>
18787
18788 * src/output.c (table_size, table_grow): New.
18789 (MAXTABLE): Remove, replace uses with table_size.
18790 (pack_vector): Instead of dying when the table is too big, grow it.
18791
187922002-04-22 Akim Demaille <akim@epita.fr>
18793
18794 * data/bison.simple (yyr1): Its type is that of a token number.
18795 * data/bison.c++ (r1_): Likewise.
18796 * tests/regression.at (Web2c Actions): Adjust.
18797
187982002-04-22 Akim Demaille <akim@epita.fr>
18799
18800 * src/reader.c (token_translations_init): 256 is now the default
18801 value for the error token, i.e., it will be assigned another
18802 number if the user assigned 256 to one of her tokens.
18803 (reader): Don't force 256 to error.
18804 * doc/bison.texinfo (Symbols): Adjust.
18805 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
18806 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
18807 etc. instead of 10, 20, 30 (which was used to `jump' over error
18808 (256) and undefined (2)).
18809
188102002-04-22 Akim Demaille <akim@epita.fr>
18811
18812 Propagate more token_number_t.
18813
18814 * src/gram.h (token_number_as_item_number)
18815 (item_number_as_token_number): New.
18816 * src/output.c (GENERATE_OUTPUT_TABLE): New.
18817 Use it to create output_item_number_table and
18818 output_token_number_table.
18819 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
18820 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
18821 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
18822 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
18823
188242002-04-22 Akim Demaille <akim@epita.fr>
18825
18826 * src/output.h, src/output.c (get_lines_number): Remove.
18827
188282002-04-19 Akim Demaille <akim@epita.fr>
18829
18830 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
18831 as Lex/Flex'.
18832 (Debugging): More details about enabling the debugging features.
18833 (Table of Symbols): Describe $$, $n, @$, and @n.
18834 Suggested by Tim Josling.
18835
188362002-04-19 Akim Demaille <akim@epita.fr>
18837
18838 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
18839
188402002-04-10 Akim Demaille <akim@epita.fr>
18841
18842 * src/system.h: Rely on HAVE_LIMITS_H.
18843 Suggested by Paul Eggert.
18844
188452002-04-09 Akim Demaille <akim@epita.fr>
18846
18847 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
18848 full stderr, and strip it according to the bison options, instead
18849 of composing the error message from different bits.
18850 This makes it easier to check for several error messages.
18851 Adjust all the invocations.
18852 Add an invocation exercising the error token.
18853 Add an invocation demonstrating a stupid error message.
18854 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
18855 Adjust the tests.
18856 Error message are for stderr, not stdout.
18857
188582002-04-09 Akim Demaille <akim@epita.fr>
18859
18860 * src/gram.h, src/gram.c (error_token_number): Remove, use
18861 errtoken->number.
18862 * src/reader.c (reader): Don't specify the user token number (2)
18863 for $undefined, as it uselessly prevents using it.
18864 * src/gram.h (token_number_t): Move to...
18865 * src/symtab.h: here.
18866 (state_t.number): Is a token_number_t.
18867 * src/print.c, src/reader.c: Use undeftoken->number instead of
18868 hard coded 2.
18869 (Even though this 2 is not the same as above: the number of the
18870 undeftoken remains being 2, it is its user token number which
18871 might not be 2).
18872 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
18873 `user_token_number_max'.
18874 Output `undef_token_number'.
18875 * data/bison.simple, data/bison.c++: Use them.
18876 Be sure to map invalid yylex return values to
18877 `undef_token_number'. This saves us from gratuitous SEGV.
18878
18879 * tests/conflicts.at (Solved SR Conflicts)
18880 (Unresolved SR Conflicts): Adjust.
18881 * tests/regression.at (Web2c Actions): Adjust.
18882
188832002-04-08 Akim Demaille <akim@epita.fr>
18884
18885 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
18886 Adding #line.
18887 Remove the duplicate `typedefs'.
18888 (RhsNumberType): Fix the declaration and various other typos.
18889 Use __ofile__.
18890 * data/bison.simple: Use __ofile__.
18891 * src/scan-skel.l: Handle __ofile__.
18892
188932002-04-08 Akim Demaille <akim@epita.fr>
18894
18895 * src/gram.h (item_number_t): New, the type of item numbers in
18896 RITEM. Note that it must be able to code symbol numbers as
18897 positive number, and the negation of rule numbers as negative
18898 numbers.
18899 Adjust all dependencies (pretty many).
18900 * src/reduce.c (rule): Remove this `short *' pointer: use
18901 item_number_t.
18902 * src/system.h (MINSHORT, MAXSHORT): Remove.
18903 Include `limits.h'.
18904 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
18905 (shortcpy): Remove.
18906 (MAXTABLE): Move to...
18907 * src/output.c (MAXTABLE): here.
18908 (prepare_rules): Use output_int_table to output rhs.
18909 * data/bison.simple, data/bison.c++: Adjust.
18910 * tests/torture.at (Big triangle): Move the limit from 254 to
18911 500.
18912 * tests/regression.at (Web2c Actions): Ajust.
18913
18914 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
18915 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
18916 passes, but produces negative #line number, once fixed, GCC is
18917 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
18918 C), it passes.
18919 * src/state.h (state_h): Code input lines on ints, not shorts.
18920
189212002-04-08 Akim Demaille <akim@epita.fr>
18922
18923 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
18924 and then the grammar.
18925
189262002-04-08 Akim Demaille <akim@epita.fr>
18927
18928 * src/system.h: No longer using strndup.
18929
189302002-04-07 Akim Demaille <akim@epita.fr>
18931
18932 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
18933 * src/output.c (output_table_data): Return the longest number.
18934 (prepare_tokens): Output `token_number_max').
18935 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
18936 New.
18937 Use them to define yy_token_number_type/TokenNumberType.
18938 Use this type for yytranslate.
18939 * tests/torture.at (Big triangle): Push the limit from 124 to
18940 253.
18941 * tests/regression.at (Web2c Actions): Adjust.
18942
189432002-04-07 Akim Demaille <akim@epita.fr>
18944
18945 * tests/torture.at (Big triangle): New.
18946 (GNU AWK Grammar, GNU Cim Grammar): Move to...
18947 * tests/existing.at: here.
18948
189492002-04-07 Akim Demaille <akim@epita.fr>
18950
18951 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
18952 nritems.
18953 Adjust dependencies.
18954
189552002-04-07 Akim Demaille <akim@epita.fr>
18956
18957 * src/reader.c: Normalize increments to prefix form.
18958
189592002-04-07 Akim Demaille <akim@epita.fr>
18960
18961 * src/reader.c, symtab.c: Remove debugging code.
18962
189632002-04-07 Akim Demaille <akim@epita.fr>
18964
18965 Rename all the `bucket's as `symbol_t'.
18966
18967 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
18968 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
18969 * src/symtab.c, src/symtab.h (bucket): Rename as...
18970 (symbol_t): this.
18971 (symbol_list_new, bucket_check_defined, bucket_make_alias)
18972 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
18973 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
18974 (buckets_new, buckets_free, buckets_do): Rename as...
18975 (symbol_list_new, symbol_check_defined, symbol_make_alias)
18976 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
18977 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
18978 (symbols_new, symbols_free, symbols_do): these.
18979
189802002-04-07 Akim Demaille <akim@epita.fr>
18981
18982 Use lib/hash for the symbol table.
18983
18984 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
18985 EOF.
18986 * src/lex.c (lex): Set the `number' member of new terminals.
18987 * src/reader.c (bucket_check_defined, bucket_make_alias)
18988 (bucket_check_alias_consistence, bucket_translation): New.
18989 (reader, grammar_free, readgram, token_translations_init)
18990 (packsymbols): Adjust.
18991 (reader): Number the predefined tokens.
18992 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
18993 for predefined tokens.
18994 * src/symtab.h (bucket): Remove all the hash table related
18995 members.
18996 * src/symtab.c (symtab): Replace by...
18997 (bucket_table): this.
18998 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
18999 (buckets_new, buckets_do): New.
19000
190012002-04-07 Akim Demaille <akim@epita.fr>
19002
19003 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
19004 (start_symbol, max_user_token_number, semantic_parser)
19005 (error_token_number): Initialize.
19006 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
19007 Initialize.
19008 (reader): Don't.
19009 (errtoken, eoftoken, undeftoken, axiom): Extern.
19010
190112002-04-07 Akim Demaille <akim@epita.fr>
19012
19013 * src/gram.h (rule_s): prec and precsym are now pointers
19014 to the bucket giving the priority/associativity.
19015 Member `associativity' removed: useless.
19016 * src/reduce.c, src/conflicts.c: Adjust.
19017
190182002-04-07 Akim Demaille <akim@epita.fr>
19019
19020 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
19021 Properly escape the symbols' TAG when outputting them.
19022
190232002-04-07 Akim Demaille <akim@epita.fr>
19024
19025 * src/lalr.h (LA): Is a bitsetv, not bitset*.
19026
190272002-04-07 Akim Demaille <akim@epita.fr>
19028
19029 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
19030 (LArule): this, which is an array to rule_t*.
19031 * src/print.c, src/conflicts.c: Adjust.
19032
190332002-04-07 Akim Demaille <akim@epita.fr>
19034
19035 * src/gram.h (rule_t): Rename `number' as `user_number'.
19036 `number' is a new member.
19037 Adjust dependencies.
19038 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
19039
190402002-04-07 Akim Demaille <akim@epita.fr>
19041
19042 As a result of the previous patch, it is no longer needed
19043 to reorder ritem itself.
19044
19045 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
19046
190472002-04-07 Akim Demaille <akim@epita.fr>
19048
19049 Be sure never to walk through RITEMS, but use only data related to
19050 the rules themselves. RITEMS should be banished.
19051
19052 * src/output.c (output_token_translations): Rename as...
19053 (prepare_tokens): this.
19054 In addition to `translate', prepare the muscles `tname' and
19055 `toknum', which were handled by...
19056 (output_rule_data): this.
19057 Remove, and move the remainder of its outputs into...
19058 (prepare_rules): this new routines, which also merges content from
19059 (output_gram): this.
19060 (prepare_rules): Be sure never to walk through RITEMS.
19061 (output_stos): Rename as...
19062 (prepare_stos): this.
19063 (output): Always invoke prepare_states, after all, just don't use it
19064 in the output if you don't need it.
19065
190662002-04-07 Akim Demaille <akim@epita.fr>
19067
19068 * src/LR0.c (new_state): Display `nstates' as the name of the
19069 newly created state.
19070 Adjust to initialize first_state and last_state if needed.
19071 Be sure to distinguish the initial from the final state.
19072 (new_states): Create the itemset of the initial state, and use
19073 new_state.
19074 * src/closure.c (closure): Now that the initial state has its
19075 items properly set, there is no need for a special case when
19076 creating `ruleset'.
19077
19078 As a result, now the rule 0, reducing to $axiom, is visible in the
19079 outputs. Adjust the test suite.
19080
19081 * tests/conflicts.at (Solved SR Conflicts)
19082 (Unresolved SR Conflicts): Adjust.
19083 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
19084 * tests/conflicts.at (S/R in initial): New.
19085
190862002-04-07 Akim Demaille <akim@epita.fr>
19087
19088 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
19089 the RHS of the rules.
19090 * src/output.c (output_gram): Likewise.
19091
190922002-04-07 Akim Demaille <akim@epita.fr>
19093
19094 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
19095 bucket.
19096 Adjust all dependencies.
19097 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
19098 `number' of the buckets too.
19099 * src/gram.h: Include `symtab.h'.
19100 (associativity): Move to...
19101 * src/symtab.h: here.
19102 No longer include `gram.h'.
19103
191042002-04-07 Akim Demaille <akim@epita.fr>
19105
19106 * src/gram.h, src/gram.c (rules_rhs_length): New.
19107 (ritem_longest_rhs): Use it.
19108 * src/gram.h (rule_t): `number' is a new member.
19109 * src/reader.c (packgram): Set it.
19110 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
19111 the end of `rules', and count them out of `nrules'.
19112 (reduce_output, dump_grammar): Adjust.
19113 * src/print.c (print_grammar): It is no longer needed to check for
19114 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
19115 * tests/reduce.at (Reduced Automaton): New test.
19116
191172002-04-07 Akim Demaille <akim@epita.fr>
19118
19119 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
19120 lacking `+ 1' to nrules, Bison reported as useless a token if it
19121 was used solely to set the precedence of the last rule...
19122
191232002-04-07 Akim Demaille <akim@epita.fr>
19124
19125 * data/bison.c++, data/bison.simple: Don't output the current file
19126 name in #line, to avoid useless diffs between two identical
19127 outputs under different names.
19128
191292002-04-07 Akim Demaille <akim@epita.fr>
19130
19131 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
19132 Normalize loops to using `< nrules + 1', not `<= nrules'.
19133
191342002-04-07 Akim Demaille <akim@epita.fr>
19135
19136 * TODO: Update.
19137
191382002-04-07 Akim Demaille <akim@epita.fr>
19139
19140 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
19141 bucket.value as bucket.number.
19142
191432002-04-07 Akim Demaille <akim@epita.fr>
19144
19145 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
19146 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
19147 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
19148 RHS, instead of being an index in RITEMS.
19149
191502002-04-04 Paul Eggert <eggert@twinsun.com>
19151
19152 * doc/bison.texinfo: Update copyright date.
19153 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
19154 (Symbols): Warn about running Bison in one character set,
19155 but compiling and/or running in an incompatible one.
19156 Warn about character code 256, too.
19157
191582002-04-03 Paul Eggert <eggert@twinsun.com>
19159
19160 * src/bison.data (YYSTACK_ALLOC): Depend on whether
19161 YYERROR_VERBOSE is nonzero, not whether it is defined.
19162
19163 Merge changes from bison-1_29-branch.
19164
191652002-03-20 Paul Eggert <eggert@twinsun.com>
19166
19167 Merge fixes from Debian bison_1.34-1.diff.
19168
19169 * configure.in (AC_PREREQ): 2.53.
19170
191712002-03-20 Akim Demaille <akim@epita.fr>
19172
19173 * src/conflicts.c (log_resolution): Argument `resolution' is const.
19174
191752002-03-19 Paul Eggert <eggert@twinsun.com>
19176
19177 * src/bison.simple (YYCOPY): New macro.
19178 (YYSTACK_RELOCATE): Use it.
19179 Remove Type arg; no longer needed. All callers changed.
19180 (yymemcpy): Remove; no longer needed.
19181
19182 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
19183 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
19184
191852002-03-19 Akim Demaille <akim@epita.fr>
19186
19187 Test and fix the #line outputs.
19188
19189 * tests/atlocal.at (GCC): New.
19190 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
19191 (Prologue synch line, %union synch line, Postprologue synch line)
19192 (Action synch line, Epilogue synch line): New tests.
19193 * src/reader.c (parse_union_decl): Define the muscle stype_line.
19194 * data/bison.simple, data/bison.c++: Use it.
19195
191962002-03-19 Akim Demaille <akim@epita.fr>
19197
19198 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
19199 (Solved SR Conflicts, %expect not enough, %expect right)
19200 (%expect too much): Move to...
19201 * tests/conflicts.at: this new file.
19202
192032002-03-19 Akim Demaille <akim@epita.fr>
19204
19205 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19206 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
19207 that we can move to enums for instance.
19208 * src/output.c (token_definitions_output): Output a list of
19209 `token-name, token-number' instead of the #define.
19210 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
19211
192122002-03-14 Akim Demaille <akim@epita.fr>
19213
19214 Use Gettext 0.11.1.
19215
192162002-03-09 Robert Anisko <robert@lrde.epita.fr>
19217
19218 * data/bison.c++: Make the user able to add members to the generated
19219 parser by subclassing.
19220
192212002-03-05 Robert Anisko <robert@lrde.epita.fr>
19222
19223 * src/reader.c (read_additionnal_code): `c' should be an integer, not
19224 a character.
19225 Reported by Nicolas Tisserand and Nicolas Burrus.
19226
192272002-03-04 Robert Anisko <robert@lrde.epita.fr>
19228
19229 * src/reader.c: Warn about lacking semi-colons, do not complain.
19230
192312002-03-04 Robert Anisko <robert@lrde.epita.fr>
19232
19233 * data/bison.c++: Remove a debug line.
19234
192352002-03-04 Robert Anisko <robert@lrde.epita.fr>
19236
19237 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
19238 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
19239 provide a default implementation.
19240
192412002-03-04 Akim Demaille <akim@epita.fr>
19242
19243 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
19244 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
19245 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
19246 * tests/semantic.at (Parsing Guards): Similarly.
19247 * src/reader.at (readgram): Complain if the last rule is not ended
19248 with a semi-colon.
19249
192502002-03-04 Akim Demaille <akim@epita.fr>
19251
19252 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
19253 * src/closure.c: here.
19254 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
19255 RTC.
19256 * src/warshall.h, src/warshall.c: Remove.
19257 * tests/sets.at (Broken Closure): Adjust.
19258
192592002-03-04 Akim Demaille <akim@epita.fr>
19260
19261 * src/output.c (output_skeleton): tempdir is const.
19262 bytes_read is unused.
19263
192642002-03-04 Akim Demaille <akim@epita.fr>
19265
19266 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19267 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
19268 Update.
19269 From Michael Hayes.
19270
192712002-03-04 Akim Demaille <akim@epita.fr>
19272
19273 * src/closure.c (closure): `r' is unused.
19274
192752002-03-04 Akim Demaille <akim@epita.fr>
19276
19277 * tests/sets.at (Broken Closure): Add the ending `;'.
19278 * src/reader.at (readgram): Complain if a rule is not ended with a
19279 semi-colon.
19280
192812002-03-04 Akim Demaille <akim@epita.fr>
19282
19283 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
19284 (count_sr_conflicts): Use bitset_count.
19285 * src/reduce.c (inaccessable_symbols): Ditto.
19286 (bits_size): Remove.
19287 * src/warshall.h, src/warshall.c: Convert to bitsetv.
19288
192892002-03-04 Akim Demaille <akim@epita.fr>
19290
19291 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
19292 * src/reduce.c: Remove the `bitset_zero's following the
19293 `bitset_create's, as now it is performed by the latter.
19294
192952002-03-04 Akim Demaille <akim@epita.fr>
19296
19297 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
19298 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
19299 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
19300 latest sources from Michael.
19301
193022002-03-04 Akim Demaille <akim@epita.fr>
19303
19304 * src/output.c (output): Don't free the grammar.
19305 * src/reader.c (grammar_free): New.
19306 * src/main.c (main): Call it and don't free symtab here.
19307
193082002-03-04 Akim Demaille <akim@epita.fr>
19309
19310 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
19311 before returning.
19312 Reported by Benoit Perrot.
19313
193142002-03-04 Akim Demaille <akim@epita.fr>
19315
19316 Use bitset operations when possible, not loops over bits.
19317
19318 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
19319 bitset_or.
19320 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
19321 * src/reduce.c (useless_nonterminals): Formatting changes.
19322 * src/warshall.c (TC): Use bitset_or.
19323
193242002-03-04 Akim Demaille <akim@epita.fr>
19325
19326 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
19327 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
19328 Ditto.
19329
193302002-03-04 Akim Demaille <akim@epita.fr>
19331
19332 * src/lalr.c (F): Now a bitset*.
19333 Adjust all dependencies.
19334
193352002-03-04 Akim Demaille <akim@epita.fr>
19336
19337 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
19338 Adjust all dependencies.
19339
193402002-03-04 Akim Demaille <akim@epita.fr>
19341
19342 * src/L0.c, src/LR0.h (nstates): Be size_t.
19343 Adjust comparisons (signed vs unsigned).
19344 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
19345 bitset*.
19346 Adjust all dependencies.
19347
193482002-03-04 Akim Demaille <akim@epita.fr>
19349
19350 * src/closure.c (firsts): Now, also a bitset.
19351 Adjust all dependencies.
19352 (varsetsize): Remove, now unused.
19353 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
19354
193552002-03-04 Akim Demaille <akim@epita.fr>
19356
19357 * src/print.c: Convert to use bitset.h, not hand coded iterations
19358 over ints.
19359
193602002-03-04 Akim Demaille <akim@epita.fr>
19361
19362 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
19363
193642002-03-04 Akim Demaille <akim@epita.fr>
19365
19366 * src/closure.c (ruleset): Be a bitset.
19367 (rulesetsize): Remove.
19368
193692002-03-04 Akim Demaille <akim@epita.fr>
19370
19371 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19372 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
19373 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
19374 * src/closure.c (fderives): Be an array of bitsets.
19375
193762002-02-28 Robert Anisko <robert@lrde.epita.fr>
19377
19378 * data/bison.c++: Merge the two generated headers. Insert a copyright
19379 notice in each output file.
19380
193812002-02-28 Akim Demaille <akim@epita.fr>
19382
19383 * data/bison.c++: Copy the prologue of bison.simple to fetch
19384 useful M4 definitions, such as b4_header_guard.
19385
193862002-02-25 Akim Demaille <akim@epita.fr>
19387
19388 * src/getargs.c (version): Give the name of the authors, and use a
19389 translator friendly scheme for the bgr
19390 copyright notice.
19391
193922002-02-25 Akim Demaille <akim@epita.fr>
19393
19394 * src/output.c (header_output): Remove, now handled completely via
19395 M4.
19396
193972002-02-25 Akim Demaille <akim@epita.fr>
19398
19399 * m4/m4.m4: New, from CVS Autoconf.
19400 * configure.in: Invoke it.
19401 * src/output.c (output_skeleton): Use its result instead of the
19402 hard coded name.
19403
194042002-02-25 Akim Demaille <akim@epita.fr>
19405
19406 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
19407 Fileutils 4.1.5.
19408 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
19409 * src/output.c (output_skeleton): Use mkstemp to create a real
19410 temporary file.
19411 Move the filling of `skeleton' and its muscle to...
19412 (prepare): here.
19413 (output): Move the definition of the prologue muscle to...
19414 (prepare): here.
19415 * src/system.h (DEFAULT_TMPDIR): New.
19416
194172002-02-14 Paul Eggert <eggert@twinsun.com>
19418
19419 Remove the support for C++ namespace cleanliness; it was
19420 causing more problems than it was curing, since it didn't work
19421 properly on some nonstandard C++ compilers. This can wait
19422 for a proper C++ parser.
19423
19424 * NEWS: Document this.
19425 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
19426 of C++, as it's treated like C now.
19427 * src/bison.simple (YYSTD): Remove.
19428 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
19429 Treat C++ just like Standard C instead of trying to support
19430 namespace cleanliness.
19431
194322002-02-14 Akim Demaille <akim@epita.fr>
19433
19434 * tests/regression.at (else): Adjust to Andreas' change.
19435
194362002-02-14 Akim Demaille <akim@epita.fr>
19437
19438 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
19439
194402002-02-13 Andreas Schwab <schwab@suse.de>
19441
19442 * src/output.c (output_rule_data): Don't output NULL, it might
19443 not be defined yet.
19444
194452002-02-11 Robert Anisko <robert@lrde.epita.fr>
19446
19447 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
19448 (Copyright notice): Update.
19449
194502002-02-11 Akim Demaille <akim@epita.fr>
19451
19452 * tests/regression.at (%nonassoc and eof): Don't include
19453 nonportable headers.
19454
194552002-02-08 Robert Anisko <robert@lrde.epita.fr>
19456
19457 * data/bison.c++: Correct error recovery. Make the user able to
19458 initialize the starting location.
19459
194602002-02-07 Akim Demaille <akim@epita.fr>
19461
19462 * tests/input.at: New.
19463
194642002-02-07 Robert Anisko <robert@lrde.epita.fr>
19465
19466 * data/bison.c++: Replace some direct m4 expansions by constants. Be
19467 more consistent when naming methods and variables. Put preprocessor
19468 directives around tables only needed for debugging.
19469
194702002-02-07 Robert Anisko <robert@lrde.epita.fr>
19471
19472 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
19473 C++ parsers.
19474 (yy::b4_name::parse): Use print_.
19475
194762002-02-07 Robert Anisko <robert@lrde.epita.fr>
19477
19478 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
19479
194802002-02-07 Robert Anisko <robert@lrde.epita.fr>
19481
19482 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
19483 C++ parsers.
19484 (yy::b4_name::parse): Build verbose error messages, and use error_.
19485
194862002-02-06 Robert Anisko <robert@lrde.epita.fr>
19487
19488 * data/bison.c++: Fix m4 quoting in comments.
19489
194902002-02-06 Robert Anisko <robert@lrde.epita.fr>
19491
19492 * data/bison.c++: Adjust the parser code. Fix some muscles that were
19493 not expanded by m4.
19494
194952002-02-05 Akim Demaille <akim@epita.fr>
19496
19497 * data/bison.c++: Adjust to the M4 back end.
19498 More is certainly needed.
19499
195002002-02-05 Akim Demaille <akim@epita.fr>
19501
19502 Give a try to M4 as a back end.
19503
19504 * lib/readpipe.c: New, from wdiff.
19505 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
19506 BISON_HAIRY.
19507 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
19508 specific values. Now it is m4 that performs the lookup.
19509 * src/parse-skel.y: Remove.
19510 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
19511 * src/output.c (actions_output, guards_output)
19512 (token_definitions_output): No longer keeps track of the output
19513 line number, hence remove the second argument.
19514 (guards_output): Check against the guard member of a rule, not the
19515 action member.
19516 Adjust callers.
19517 (output_skeleton): Don't look for the skeleton location, let m4 do
19518 that.
19519 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
19520 file will be used.
19521 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
19522 (prepare): Given that for the time being changesyntax is not
19523 usable in M4, rename the muscles using `-' to `_'.
19524 Define `defines_flag', `output_parser_name' and `output_header_name'.
19525 * src/output.h (actions_output, guards_output)
19526 (token_definitions_output): Adjust prototypes.
19527 * src/scan-skel.l: Instead of scanning the skeletons, it now
19528 processes the output of m4: `__oline__' and `#output'.
19529 * data/bison.simple: Adjust to be used by M4(sugar).
19530 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
19531 to date.
19532 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
19533 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
19534 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
19535 shamelessly stolen from CVS Autoconf.
19536
195372002-02-05 Akim Demaille <akim@epita.fr>
19538
19539 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
19540 * configure.in: Check for the declarations of free and malloc.
19541 * src/muscle_tab.c: Adjust.
19542
195432002-02-05 Akim Demaille <akim@epita.fr>
19544
19545 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
19546 which have no values.
19547
195482002-02-05 Akim Demaille <akim@epita.fr>
19549
19550 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
19551 * data/: here.
19552
195532002-01-29 Paul Eggert <eggert@twinsun.com>
19554
19555 * src/bison.simple (YYSIZE_T): Do not define merely because
19556 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
19557 On some platforms, <alloca.h> does not declare YYSTD (size_t).
19558
195592002-01-27 Akim Demaille <akim@epita.fr>
19560
19561 Fix `%nonassoc and eof'.
19562
19563 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
19564 which were not properly copied! Replace
19565 memcpy (res->errs, src->errs, src->nerrs);
19566 with
19567 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
19568 !!!
19569 * tests/regression.at (%nonassoc and eof): Adjust to newest
19570 Autotest: `.' is not in the PATH.
19571
195722002-01-27 Akim Demaille <akim@epita.fr>
19573
19574 * tests/sets.at (AT_EXTRACT_SETS): New.
19575 (Nullable): Use it.
19576 (Firsts): New.
19577
195782002-01-26 Akim Demaille <akim@epita.fr>
19579
19580 * tests/actions.at, tests/calc.at, tests/headers.at,
19581 * tests/torture.at: Adjust to the newest Autotest which no longer
19582 forces `.' in the PATH.
19583
195842002-01-25 Akim Demaille <akim@epita.fr>
19585
19586 * tests/regression.at (%nonassoc and eof): New.
19587 Suggested by Robert Anisko.
19588
195892002-01-24 Akim Demaille <akim@epita.fr>
19590
19591 Bison dumps core when trying to complain about broken input files.
19592 Reported by Cris van Pelt.
19593
19594 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
19595 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
19596 into...
19597 (Invalid inputs): Strengthen: exercise parse_percent_token.
19598
195992002-01-24 Robert Anisko <robert.anisko@epita.fr>
19600
19601 * src/Makefile.am: Add bison.c++.
19602 * src/bison.c++: New skeleton.
19603
196042002-01-21 Paolo Bonzini <bonzini@gnu.org>
19605
19606 * po/it.po: New.
19607
196082002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
19609
19610 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
19611
196122002-01-20 Marc Autret <marc@gnu.org>
19613
19614 * src/files.c (compute_output_file_names): Fix
19615
196162002-01-20 Marc Autret <marc@gnu.org>
19617
19618 * tests/output.at: New test.
19619 * src/files.c (compute_base_names): Don't map extensions when
19620 the YACC flag is set, use defaults.
19621 Reported by Evgeny Stambulchik.
19622
196232002-01-20 Marc Autret <marc@gnu.org>
19624
19625 * src/system.h: Need to define __attribute__ away for non-GCC
19626 compilers as well (i.e., the vendor C compiler).
19627 Suggested by Albert Chin-A-Young.
19628
196292002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
19630
19631 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
19632 canonical definition.
19633 * src/system.h: Use the canonical definition for PARAMS (avoids
19634 a conflict with the macro from lib/hash.h).
19635
196362002-01-11 Akim Demaille <akim@epita.fr>
19637
19638 * configure.in: Use AC_FUNC_STRNLEN.
19639 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
19640
196412002-01-09 Akim Demaille <akim@epita.fr>
19642
19643 * src/files.c, src/files.h (output_infix): New.
19644 (tab_extension): Remove.
19645 (compute_base_names): Compute the former, drop the latter.
19646 * src/output.c (prepare): Insert the muscles `output-infix', and
19647 `output-suffix'.
19648 * src/parse-skel.y (string, string.1): New.
19649 (section.header): Use it.
19650 (section.yacc): Remove.
19651 (prefix): Remove too.
19652 * src/scan-skel.l: Adjust.
19653 * src/bison.simple, src/bison.hairy: Adjust.
19654
196552002-01-09 Akim Demaille <akim@epita.fr>
19656
19657 * configure.in (WERROR_CFLAGS): Compute it.
19658 * src/Makefile.am (CFLAGS): Pass it.
19659 * tests/atlocal.in (CFLAGS): Idem.
19660 * src/files.c: Fix a few warnings.
19661 (get_extension_index): Remove, unused.
19662
196632002-01-08 Akim Demaille <akim@epita.fr>
19664
19665 * src/getargs.c (AS_FILE_NAME): New.
19666 (getargs): Use it to convert DOSish file names.
19667 * src/files.c (base_name): Rename as full_base_name to avoid
19668 clashes with `base_name ()'.
19669 (filename_split): New.
19670 (compute_base_names): N-th rewrite, using filename_split.
19671
196722002-01-08 Akim Demaille <akim@epita.fr>
19673
19674 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
19675 New, stolen from the Fileutils 4.1.
19676 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
19677 * configure.in: Check for the presence of memrchr, and of its
19678 prototype.
19679
196802002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
19681
19682 * lib/hash.h (__P): Added definition for this macro.
19683 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
19684 BUILT_SOURCES, to ensure they are generated first.
19685 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
19686 %error-verbose to allow bootstrapping with bison 1.30x.
19687
196882002-01-06 Akim Demaille <akim@epita.fr>
19689
19690 * src/reader.c (parse_braces): Don't fetch the next char, the
19691 convention is to fetch on entry.
19692 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
19693 'switch' without a following semicolon.
19694 * tests/regression.at (braces parsing): New.
19695
196962002-01-06 Akim Demaille <akim@epita.fr>
19697
19698 Bison is dead wrong in its RR conflict reports.
19699
19700 * tests/torture.at (GNU Cim Grammar): New.
19701 * src/conflicts.c (count_rr_conflicts): Fix.
19702
197032002-01-06 Akim Demaille <akim@epita.fr>
19704
19705 Creating package.m4 from configure.ac causes too many problems.
19706
19707 * tests/Makefile.am (package.m4): Create it by hand,
19708 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
19709
197102002-01-06 Akim Demaille <akim@epita.fr>
19711
19712 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
19713 skeleton.h.
19714
197152002-01-04 Paul Eggert <eggert@twinsun.com>
19716
19717 * doc/bison.texinfo (Debugging):
19718 Remove YYSTDERR; it's no longer defined or used.
19719 Also, s/cstdio.h/cstdio/.
19720
197212002-01-03 Akim Demaille <akim@epita.fr>
19722
19723 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
19724
197252002-01-03 Akim Demaille <akim@epita.fr>
19726
19727 * src/parse-skel.y (process_skeleton): Don't bind the parser's
19728 tracing code to --trace, wait for a better --trace option, with
19729 args.
19730
197312002-01-03 Akim Demaille <akim@epita.fr>
19732
19733 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
19734 The ISO C++ standard is extremely clear about it: stderr is
19735 considered a macro, not a regular symbol (see table 94 `Header
19736 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
19737 Therefore std:: does not apply to it. It still does with fprintf.
19738 Also, s/cstdio.h/cstdio/.
19739
197402002-01-03 Akim Demaille <akim@epita.fr>
19741
19742 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
19743 for non system headers.
19744
197452002-01-02 Akim Demaille <akim@epita.fr>
19746
19747 Equip the skeleton chain with location tracking, runtime trace,
19748 pure parser and scanner.
19749
19750 * src/parse-skel.y: Request a pure parser, locations, and prefix
19751 renaming.
19752 (%union): Having several members with the same type does not help
19753 type mismatches, simplify.
19754 (YYPRINT, yyprint): New.
19755 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
19756 (skel_error): this.
19757 Handle locations.
19758 * src/scan-skel.l: Adjust to these changes.
19759 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
19760 (LOCATION_PRINT, skel_control_t): New.
19761
197622001-12-30 Akim Demaille <akim@epita.fr>
19763
19764 * src/parse-skel.y: Get rid of the shift/reduce conflict:
19765 replace `gb' with BLANKS.
19766 * src/scan-skel.l: Adjust.
19767
197682001-12-30 Akim Demaille <akim@epita.fr>
19769
19770 * src/system.h: We don't need nor want bcopy.
19771 Throw away MS-DOS crap: we don't need getpid.
19772 * configure.in: We don't need strndup. It was even causing
19773 problems: because Flex includes the headers *before* us,
19774 _GNU_SOURCE is not defined by config.h, and therefore strndup was
19775 not visible.
19776 * lib/xstrndup.c: New.
19777 * src/scan-skel.l: Use it.
19778 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
19779 * src/parse-skel.y: Use %directives instead of #defines.
19780
197812001-12-30 Akim Demaille <akim@epita.fr>
19782
19783 * src/skeleton.h: New.
19784 * src/output.c (output_parser, output_master_parser): Remove, dead
19785 code.
19786 * src/output.h (get_lines_number, actions_output, guards_output)
19787 (token_definitions_output): Prototype them.
19788 * src/parse-skel.y: Add the license notice.
19789 Include output.h and skeleton.h.
19790 (process_skeleton): Returns void, and takes a single parameter.
19791 * src/scan-skel.l: Add the license notice.
19792 Include skeleton.h.
19793 Don't use %option yylineno: it seems that then Flex imagines
19794 REJECT has been used, and therefore it won't reallocate its
19795 buffers (which makes no other sense to me than a bug). It results
19796 in warnings for `unused: yy_flex_realloc'.
19797
197982001-12-30 Robert Anisko <robert.anisko@epita.fr>
19799
19800 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
19801 (MUSCLE_INSERT_PREFIX): ...to there.
19802 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
19803 (MUSCLE_INSERT_PREFIX): Move from here...
19804
19805 * src/bison.hairy: Add a section directive. Put braces around muscle
19806 names. This parser skeleton is still broken, but Bison should not
19807 choke on a bad muscle 'syntax'.
19808 * src/bison.simple: Add a section directive. Put braces around muscle
19809 names.
19810
19811 * src/files.h (strsuffix, stringappend): Add declarations.
19812 (tab_extension): Add declaration.
19813 (short_base_name): Add declaration.
19814
19815 * src/files.c (strsuffix, stringappend): No longer static. These
19816 functions are used in the skeleton parser.
19817 (tab_extension): New.
19818 (compute_base_names): Use the computations done in this function
19819 to guess if the generated parsers should have '.tab' in their
19820 names.
19821 (short_base_name): No longer static.
19822
19823 * src/output.c (output_skeleton): New.
19824 (output): Disable call to output_master_parser, and give a try to
19825 a new skeleton handling system.
19826 (guards_output, actions_output): No longer static.
19827 (token_definitions_output, get_lines_number): No longer static.
19828
19829 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
19830
19831 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
19832 parse-skel.y.
19833
19834 * src/parse-skel.y: New file.
19835 * src/scan-skel.l: New file.
19836
198372001-12-29 Akim Demaille <akim@epita.fr>
19838
19839 %name-prefix is broken.
19840
19841 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
19842 Adjust all dependencies.
19843 * tests/headers.at (export YYLTYPE): Strengthen this test: use
19844 %name-prefix.
19845
19846 Renaming yylval but not yylloc is not consistent. Now we do.
19847
19848 * src/bison.simple: Prefix yylloc if used.
19849 * doc/bison.texinfo (Decl Summary): Document that.
19850
198512001-12-29 Akim Demaille <akim@epita.fr>
19852
19853 * doc/bison.texinfo: Promote `%long-directive' over
19854 `%long_directive'.
19855 Remove all references to fixed-output-files, yacc is enough.
19856
198572001-12-29 Akim Demaille <akim@epita.fr>
19858
19859 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
19860 user prologue. These are defaults.
19861 * tests/actions.at (Mid-rule actions): Make sure the user can
19862 define YYDEBUG and YYERROR_VERBOSE.
19863
198642001-12-29 Akim Demaille <akim@epita.fr>
19865
19866 * src/output.c (header_output): Don't forget to export YYLTYPE and
19867 yylloc.
19868 * tests/headers.at (export YYLTYPE): New, make sure it does.
19869 * tests/regression.at (%union and --defines, Invalid CPP headers):
19870 Move to...
19871 * tests/headers.at: here.
19872
198732001-12-29 Akim Demaille <akim@epita.fr>
19874
19875 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
19876
198772001-12-29 Akim Demaille <akim@epita.fr>
19878
19879 * tests/actions.at (Mid-rule actions): Output on a single line
19880 instead of several.
19881
198822001-12-29 Akim Demaille <akim@epita.fr>
19883
19884 * doc/bison.texinfo: Formatting changes.
19885
198862001-12-29 Akim Demaille <akim@epita.fr>
19887
19888 Don't store the token defs in a muscle, just be ready to output it
19889 on command. Now possible via `symbols'. Fixes a memory leak.
19890
19891 * src/output.c (token_definitions_output): New.
19892 (output_parser, header_output): Use it.
19893 * src/reader.c (symbols_save): Remove.
19894
198952001-12-29 Akim Demaille <akim@epita.fr>
19896
19897 * src/bison.simple: Do not provide a default for YYSTYPE and
19898 YYLTYPE before the user's prologue. Otherwise it's hardly... a
19899 default.
19900
199012001-12-29 Akim Demaille <akim@epita.fr>
19902
19903 Mid-rule actions are simply... ignored!
19904
19905 * src/reader.c (readgram): Be sure to attach mid-rule actions to
19906 the empty-rule associated to the dummy symbol, not to the host
19907 rule.
19908 * tests/actions.at (Mid-rule actions): New.
19909
199102001-12-29 Akim Demaille <akim@epita.fr>
19911
19912 Memory leak.
19913
19914 * src/reader.c (reader): Free grammar.
19915
199162001-12-29 Akim Demaille <akim@epita.fr>
19917
19918 Memory leak.
19919
19920 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
19921 since it allocates it for each state, although only one is needed.
19922 (allocate_storage): Do it here.
19923
199242001-12-29 Akim Demaille <akim@epita.fr>
19925
19926 * src/options.h, src/options.c (create_long_option_table): Rename
19927 as...
19928 (long_option_table_new): this, with a clearer prototype.
19929 (percent_table): Remove, unused,
19930 * src/getargs.c (getargs): Adjust.
19931
199322001-12-29 Akim Demaille <akim@epita.fr>
19933
19934 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
19935 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
19936 as states.
19937
199382001-12-29 Akim Demaille <akim@epita.fr>
19939
19940 * src/lalr.c (build_relations): Rename `states' as `states1'.
19941 Sorry, I don't understand exactly what it is, no better name...
19942
199432001-12-29 Akim Demaille <akim@epita.fr>
19944
19945 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
19946 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
19947 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
19948 as rules.
19949
199502001-12-29 Akim Demaille <akim@epita.fr>
19951
19952 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
19953 ago.
19954
199552001-12-29 Akim Demaille <akim@epita.fr>
19956
19957 * src/reader.c, src/reader.h (user_toknums): Remove.
19958 Adjust all users to use symbols[i]->user_token_number.
19959
199602001-12-29 Akim Demaille <akim@epita.fr>
19961
19962 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
19963 Adjust all users to use symbols[i]->prec or ->assoc.
19964
199652001-12-29 Akim Demaille <akim@epita.fr>
19966
19967 * src/reader.c, src/reader.h (tags): Remove.
19968 Adjust all users to use symbols[i]->tag.
19969
199702001-12-29 Akim Demaille <akim@epita.fr>
19971
19972 * src/gram.h, src/gram.c (symbols): New, similar to state_table
19973 and rule_table.
19974 * src/reader.c (packsymbols): Fill this table.
19975 Drop sprec.
19976 * src/conflicts.c (resolve_sr_conflict): Adjust.
19977 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
19978 single table.
19979 Use symbols[i]->tag instead of tags[i].
19980
199812001-12-29 Akim Demaille <akim@epita.fr>
19982
19983 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
19984 In addition, put a comment in there, to replace...
19985 * tests/regression.at (%union and C comments): Remove.
19986
199872001-12-29 Akim Demaille <akim@epita.fr>
19988
19989 * tests/regression.at (Web2c Actions): Blindly move the actual
19990 output as expected output. The contents *seem* right to me, but I
19991 can't pretend reading perfectly parser tables... Nonetheless, all
19992 the other tests pass correctly, the table look OK, even though the
19993 presence of `$axiom' is to be noted: AFAICS it is useless (but
19994 harmless).
19995
199962001-12-29 Akim Demaille <akim@epita.fr>
19997
19998 * src/reader.c (readgram): Don't add the rule 0 if there were no
19999 rules read. In other words, add it _after_ having performed
20000 grammar sanity checks.
20001 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
20002
200032001-12-29 Akim Demaille <akim@epita.fr>
20004
20005 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
20006 visible, and some states have now a different number.
20007
200082001-12-29 Akim Demaille <akim@epita.fr>
20009
20010 * src/reader.c (readgram): Bind the initial rule's lineno to that
20011 of the first rule.
20012 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
20013 (Solved SR Conflicts): Adjust rule 0's line number.
20014
200152001-12-29 Akim Demaille <akim@epita.fr>
20016
20017 Fix the `GAWK Grammar' failure.
20018
20019 * src/LR0.c (final_state): Initialize to -1 so that we do compute
20020 the reductions of the first state which was mistakenly confused
20021 with the final state because precisely final_state was initialized
20022 to 0.
20023 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
20024 now noticed by Bison.
20025 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
20026 have a reduction on $default.
20027
200282001-12-29 Akim Demaille <akim@epita.fr>
20029
20030 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
20031 rule line numbers.
20032 * src/closure.c (print_closure): Likewise.
20033 * src/derives.c (print_derives): Likewise.
20034 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
20035 now.
20036
200372001-12-29 Akim Demaille <akim@epita.fr>
20038
20039 * src/lalr.c (lookaheads_print): New.
20040 (lalr): Call it when --trace-flag.
20041 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
20042 are dumped.
20043
200442001-12-29 Akim Demaille <akim@epita.fr>
20045
20046 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
20047 when walking through ritem, even via rule->rhs.
20048 * src/reduce.c (dump_grammar, useful_production, reduce_output)
20049 (useful_production, useless_nonterminals): Likewise.
20050 (reduce_grammar_tables): Likewise, plus update nritems.
20051 * src/nullable.c (set_nullable): Likewise.
20052 * src/lalr.c (build_relations): Likewise.
20053 * tests/sets.at (Nullable): Adjust.
20054 Fortunately, now, the $axiom is no longer nullable.
20055
200562001-12-29 Akim Demaille <akim@epita.fr>
20057
20058 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
20059 the 0-sentinel.
20060 * src/gram.c (ritem_longest_rhs): Likewise.
20061 * src/reduce.c (nonterminals_reduce): Likewise.
20062 * src/print_graph.c (print_graph): Likewise.
20063 * src/output.c (output_rule_data): Likewise.
20064 * src/nullable.c (set_nullable): Likewise.
20065
200662001-12-29 Akim Demaille <akim@epita.fr>
20067
20068 * src/output.c: Comment changes.
20069
200702001-12-27 Paul Eggert <eggert@twinsun.com>
20071
20072 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
20073 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
20074 Sparc, as they were causing more porting problems than the
20075 (minor) performance improvement was worth.
20076
20077 Also, catch up with 1.31's YYSTD.
20078
200792001-12-27 Akim Demaille <akim@epita.fr>
20080
20081 * src/output.c (output_gram): Rely on nritems, not the
20082 0-sentinel. See below.
20083 Use -1 as separator, not 0.
20084 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
20085 Rely on -1 as separator in yyrhs, instead of 0.
20086 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
20087 twice `Now at end of input', therefore there are two lines less to
20088 expect.
20089
200902001-12-27 Akim Demaille <akim@epita.fr>
20091
20092 * tests/regression.at (Unresolved SR Conflicts):
20093 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
20094 below.
20095
200962001-12-27 Akim Demaille <akim@epita.fr>
20097
20098 * src/LR0.c (new_state): Recognize the final state by the fact it
20099 is reached by eoftoken.
20100 (insert_start_shifting_state, insert_eof_shifting_state)
20101 (insert_accepting_state, augment_automaton): Remove, since now
20102 these states are automatically computed from the initial state.
20103 (generate_states): Adjust.
20104 * src/print.c: When reporting a rule number to the user, substract
20105 1, so that the axiom rule is rule 0, and the first user rule is 1.
20106 * src/reduce.c: Likewise.
20107 * src/print_graph.c (print_core): For the time being, just as for
20108 the report, depend upon --trace-flags to dump the full set of
20109 items.
20110 * src/reader.c (readgram): Once the grammar read, insert the rule
20111 0: `$axiom: START-SYMBOL $'.
20112 * tests/set.at: Adjust: rule 0 is now displayed, and since the
20113 number of the states has changed (the final state is no longer
20114 necessarily the last), catch up.
20115
201162001-12-27 Akim Demaille <akim@epita.fr>
20117
20118 Try to make the use of the eoftoken valid. Given that its value
20119 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
20120 is used instead of > 0 where appropriate, (ii), depend upon nritems
20121 instead of the 0-sentinel.
20122
20123 * src/gram.h, src/gram.c (nritems): New.
20124 Expected to be duplication of nitems, but for the time being...
20125 * src/reader.c (packgram): Assert nritems and nitems are equal.
20126 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
20127 * src/closure.c (print_closure, print_fderives): Likewise.
20128 * src/gram.c (ritem_print): Likewise.
20129 * src/print.c (print_core, print_grammar): Likewise.
20130 * src/print_graph.c: Likewise.
20131
201322001-12-27 Akim Demaille <akim@epita.fr>
20133
20134 * src/main.c (main): If there are complains after grammar
20135 reductions, then output the report anyway if requested, then die.
20136 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
20137 * src/reader.c (eoftoken): New.
20138 (parse_token_decl): If the token being defined has value `0', it
20139 is the eoftoken.
20140 (packsymbols): No longer hack `tags' to insert `$' by hand.
20141 Be sure to preserve the value of the eoftoken.
20142 (reader): Make sure eoftoken is defined.
20143 Initialize nsyms to 0: now eoftoken is created just like the others.
20144 * src/print.c (print_grammar): Don't special case the eof token.
20145 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
20146 lie anyway, albeit pleasant.
20147 * tests/calc.at: Exercise error messages with eoftoken.
20148 Change the grammar so that empty input is invalid.
20149 Adjust expectations.
20150 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
20151
201522001-12-27 Akim Demaille <akim@epita.fr>
20153
20154 * configure.in: Check the protos of strchr ans strspn.
20155 Replace strchr if needed.
20156 * src/system.h: Provide the protos of strchr, strspn and memchr if
20157 missing.
20158 * lib/strchr.c: New.
20159 * src/reader.c (symbols_save): Use strchr.
20160
201612001-12-27 Akim Demaille <akim@epita.fr>
20162
20163 * src/print.c, src/print_graph.c (escape): New.
20164 Use it to quote the TAGS outputs.
20165 * src/print_graph.c (print_state): Now errors are in red, and
20166 reductions in green.
20167 Prefer high to wide: output the state number on a line of its own.
20168
201692001-12-27 Akim Demaille <akim@epita.fr>
20170
20171 * src/state.h, src/state.c (reductions_new): New.
20172 * src/LR0.c (set_state_table): Let all the states have a
20173 `reductions', even if reduced to 0.
20174 (save_reductions): Adjust.
20175 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
20176 * src/print.c (print_reductions, print_actions): Adjust.
20177 * src/output.c (action_row): Adjust.
20178
201792001-12-27 Akim Demaille <akim@epita.fr>
20180
20181 * src/state.h, src/state.c (errs_new, errs_dup): New.
20182 * src/LR0.c (set_state_table): Let all the states have an errs,
20183 even if reduced to 0.
20184 * src/print.c (print_errs, print_reductions): Adjust.
20185 * src/output.c (output_actions, action_row): Adjust.
20186 * src/conflicts.c (resolve_sr_conflict): Adjust.
20187
201882001-12-27 Akim Demaille <akim@epita.fr>
20189
20190 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
20191
201922001-12-27 Akim Demaille <akim@epita.fr>
20193
20194 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
20195 * src/print.c: here.
20196 (lookaheadset, shiftset): New, used as additional storage by
20197 print_reductions.
20198 (print_results): Adjust.
20199 (print_shifts, print_gotos, print_errs): New, extracted from...
20200 (print_actions): here.
20201 * src/print_graph.c (print_actions): Remove dead code.
20202
202032001-12-27 Akim Demaille <akim@epita.fr>
20204
20205 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
20206 `$n' and `@n'.
20207
202082001-12-27 Akim Demaille <akim@epita.fr>
20209
20210 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
20211 (build_relations): Adjust.
20212
202132001-12-27 Akim Demaille <akim@epita.fr>
20214
20215 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
20216 duplication.
20217
202182001-12-27 Akim Demaille <akim@epita.fr>
20219
20220 * src/reader.c (packgram): Catch nitems overflows.
20221
202222001-12-27 Akim Demaille <akim@epita.fr>
20223
20224 * src/files.c, src/files.h (guard_obstack): Remove.
20225 * src/output.c (output): Adjust.
20226 * src/reader.c (parse_braces): New, factoring...
20227 (copy_action, copy_guard): these two which are renamed as...
20228 (parse_action, parse_guard): these.
20229 As a voluntary consequence, using braces around guards is now
20230 mandatory.
20231
202322001-12-27 Akim Demaille <akim@epita.fr>
20233
20234 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
20235 * src/reader.c (symbol_list): `guard' and `guard_line' are new
20236 members.
20237 (symbol_list_new): Adjust.
20238 (copy_action): action_line is the first line, not the last.
20239 (copy_guard): Just as for actions, store the `action' only, not
20240 the switch/case/break flesh.
20241 Don't parse the user action that might follow the guard, let...
20242 (readgram): do it, i.e., now, there can be an action after a
20243 guard.
20244 In other words the guard is just explicitly optional.
20245 (packgram): Adjust.
20246 * src/output.c (guards_output): New.
20247 (output_parser): Call it when needed.
20248 (output): Also free the guard and attrs obstacks.
20249 * src/files.c, src/files.h (obstack_save): Remove.
20250 (output_files): Remove.
20251 As a result, if one needs the former `.act' file, using an
20252 appropriate skeleton which requires actions and guards is now
20253 required.
20254 * src/main.c (main): Adjust.
20255 * tests/semantic.at: New.
20256 * tests/regression.at: Use `input.y' as input file name.
20257 Avoid 8+3 problems by requiring input.c when the test needs the
20258 parser.
20259
202602001-12-27 Akim Demaille <akim@epita.fr>
20261
20262 * src/reader.c (symbol_list_new): Be sure to initialize all the
20263 fields.
20264
202652001-12-27 Akim Demaille <akim@epita.fr>
20266
20267 All the hacks using a final pseudo state are now useless.
20268
20269 * src/LR0.c (set_state_table): state_table holds exactly nstates.
20270 * src/lalr.c (nLA): New.
20271 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
20272 instead of lookaheadsp from the pseudo state (nstate + 1).
20273
202742001-12-27 Akim Demaille <akim@epita.fr>
20275
20276 * src/output.c (action_row, token_actions): Use a state_t instead
20277 of a integer, and nlookaheads instead of the following state's
20278 lookaheadsp.
20279
202802001-12-27 Akim Demaille <akim@epita.fr>
20281
20282 * src/conflicts.c (log_resolution, flush_shift)
20283 (resolve_sr_conflict, set_conflicts, solve_conflicts)
20284 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
20285 (conflicts_print, print_reductions): Use a state_t instead of an
20286 integer when referring to a state.
20287 As much as possible, depend upon nlookaheads, instead of the
20288 `lookaheadsp' member of the following state (since lookaheads of
20289 successive states are successive, the difference between state n + 1
20290 and n served as the number of lookaheads for state n).
20291 * src/lalr.c (add_lookback_edge): Likewise.
20292 * src/print.c (print_core, print_actions, print_state)
20293 (print_results): Likewise.
20294 * src/print_graph.c (print_core, print_actions, print_state)
20295 (print_graph): Likewise.
20296 * src/conflicts.h: Adjust.
20297
202982001-12-27 Akim Demaille <akim@epita.fr>
20299
20300 * src/bison.hairy: Formatting/comment changes.
20301 ANSIfy.
20302 Remove `register' indications.
20303 Add plenty of `static'.
20304
203052001-12-27 Akim Demaille <akim@epita.fr>
20306
20307 * src/output.c (prepare): Drop the muscle `ntbase' which
20308 duplicates ntokens.
20309 * src/bison.simple: Formatting/comment changes.
20310 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
20311 is an undocumented synonym.
20312
203132001-12-22 Akim Demaille <akim@epita.fr>
20314
20315 * src/output.c (output_table_data): Change the prototype to use
20316 `int' for array ranges: some invocations do pass an int, not a
20317 short.
20318 Reported by Wayne Green.
20319
203202001-12-22 Akim Demaille <akim@epita.fr>
20321
20322 Some actions of web2c.y are improperly triggered.
20323 Reported by Mike Castle.
20324
20325 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
20326 * tests/regression.at (Web2c): Rename as...
20327 (Web2c Report): this.
20328 (Web2c Actions): New.
20329
203302001-12-22 Akim Demaille <akim@epita.fr>
20331
20332 Reductions in web2c.y are improperly reported.
20333 Reported by Mike Castle.
20334
20335 * src/conflicts.c (print_reductions): Fix.
20336 * tests/regression.at (Web2c): New.
20337
203382001-12-18 Akim Demaille <akim@epita.fr>
20339
20340 Some host fail on `assert (!"foo")', which expands to
20341 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
20342 Reported by Nelson Beebee.
20343
20344 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
20345 `#define it_succeeded 0' and `assert (it_succeeded)'.
20346
203472001-12-17 Marc Autret <autret_m@epita.fr>
20348
20349 * src/bison.simple: Don't hard code the skeleton line and filename.
20350 * src/output.c (output_parser): Rename 'line' as 'output_line'.
20351 New line counter 'skeleton_line' (skeleton-line muscle).
20352
203532001-12-17 Paul Eggert <eggert@twinsun.com>
20354
20355 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
20356 YYDEBUG must be defined to a nonzero value.
20357
20358 * src/bison.simple (yytname): Do not assume that the user defines
20359 YYDEBUG to a properly parenthesized expression.
20360
203612001-12-17 Akim Demaille <akim@epita.fr>
20362
20363 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
20364 nlookaheads is a new member.
20365 Adjust all users.
20366 * src/lalr.h (nlookaheads): Remove this orphan declaration.
20367 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
20368 state.
20369
203702001-12-17 Akim Demaille <akim@epita.fr>
20371
20372 * src/files.h, src/files.c (open_files, close_files): Remove.
20373 * src/main.c (main): Don't open/close files, nor invoke lex_free,
20374 let...
20375 * src/reader.c (reader): Do it.
20376
203772001-12-17 Akim Demaille <akim@epita.fr>
20378
20379 * src/conflicts.c (print_reductions): Formatting changes.
20380
203812001-12-17 Akim Demaille <akim@epita.fr>
20382
20383 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
20384 (flush_reduce): New.
20385 (resolve_sr_conflict): Adjust.
20386
203872001-12-17 Akim Demaille <akim@epita.fr>
20388
20389 * src/output.c (output_obstack): Be static and rename as...
20390 (format_obstack): this, to avoid any confusion with files.c's
20391 output_obstack.
20392 * src/reader.h (muscle_obstack): Move to...
20393 * src/output.h: here, since it's defined in output.c.
20394
203952001-12-17 Akim Demaille <akim@epita.fr>
20396
20397 * src/output.c (action_row, save_column, default_goto)
20398 (sort_actions, matching_state, pack_vector): Better variable
20399 locality.
20400
204012001-12-17 Akim Demaille <akim@epita.fr>
20402
20403 * src/output.c: Various formatting changes.
20404
204052001-12-17 Akim Demaille <akim@epita.fr>
20406
20407 * src/files.c (output_files): Free the output_obstack.
20408 * src/main.c (main): Call print and print_graph conditionally.
20409 * src/print.c (print): Work unconditionally.
20410 * src/print_graph.c (print_graph): Work unconditionally.
20411 * src/conflicts.c (log_resolution): Output only if verbose_flag.
20412
204132001-12-16 Marc Autret <autret_m@epita.fr>
20414
20415 * src/output.c (actions_output): Fix. When we use %no-lines,
20416 there is one less line per action.
20417
204182001-12-16 Marc Autret <autret_m@epita.fr>
20419
20420 * src/bison.simple: Remove a useless #line directive.
20421 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
20422 * src/output.c (get_lines_number): New.
20423 (output_parser): Adjust, now takes care about the lines of a
20424 output muscles.
20425 Fix line numbering.
20426 (actions_output): Computes the number of lines taken by actions.
20427 (output_master_parser): Insert new skeleton which is the name of
20428 the output parser file name.
20429
204302001-12-15 Marc Autret <autret_m@epita.fr>
20431
20432 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
20433
204342001-12-15 Marc Autret <autret_m@epita.fr>
20435
20436 * src/output.c (output_gram): Keep track of the hairy one.
20437
204382001-12-15 Akim Demaille <akim@epita.fr>
20439
20440 Make `make distcheck' work.
20441
20442 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
20443 system.h which uses libgettext.h.
20444
204452001-12-15 Akim Demaille <akim@epita.fr>
20446
20447 * src/nullable.c (set_nullable): Useless rules must be skipped,
20448 otherwise, since we range over their symbols, we might look at a
20449 nonterminal which no longer ``exists'', i.e., it is not counted in
20450 `nvars', hence we overflow our arrays.
20451
204522001-12-15 Akim Demaille <akim@epita.fr>
20453
20454 The header can also be produced directly, without any obstack!
20455 Yahoo!
20456
20457 * src/files.c, src/files.h (defines_obstack): Remove.
20458 (compute_header_macro): Global.
20459 (defines_obstack_save): Remove.
20460 * src/reader.c (parse_union_decl): No longer output to
20461 defines_obstack: its content can be found in the `stype' muscle
20462 anyway.
20463 (output_token_translations): Merge into...
20464 (symbols_output): this.
20465 Rename as...
20466 (symbols_save): this.
20467 (reader): Adjust.
20468 * src/output.c (header_output): New.
20469 (output): Call it.
20470
204712001-12-15 Akim Demaille <akim@epita.fr>
20472
20473 * src/reader.c (parse_union_decl): Instead of handling two obstack
20474 simultaneously, use one to define the `stype' muscle, and use the
20475 value of the latter to fill defines_obstack.
20476 (copy_comment): Remove.
20477 (copy_comment2): Work for a single obstack.
20478 Rename as...
20479 (copy_comment): this.
20480
204812001-12-15 Akim Demaille <akim@epita.fr>
20482
20483 * src/lex.c, src/lex.h (xgetc): No longer static.
20484 * src/reader.c (parse_union_decl): Revamp.
20485
204862001-12-15 Akim Demaille <akim@epita.fr>
20487
20488 Still making progress in separating Bison into (i) input, (ii)
20489 process, (iii) output: now we can directly output the parser file
20490 without using table_obstack at all.
20491
20492 * src/files.c, src/files.h (table_obstack): Bye bye.
20493 (parser_file_name): New.
20494 * src/files.c (compute_output_file_names): Compute it.
20495 * src/output.c (actions_output, output_parser)
20496 (output_master_parser): To a file instead of an obstack.
20497
204982001-12-15 Akim Demaille <akim@epita.fr>
20499
20500 Attach actions to rules, instead of pre-outputting them to
20501 actions_obstack.
20502
20503 * src/gram.h (rule_t): action and action_line are new members.
20504 * src/reader.c (symbol_list): Likewise.
20505 (copy_action): Save the actions within the rule.
20506 (packgram): Save them in rule_table.
20507 * src/output.c (actions_output): New.
20508 (output_parser): Use it on `%%actions'.
20509 (output_rule_data): Don't free rule_table.
20510 (output): Do it.
20511 (prepare): Don't save the `action' muscle.
20512 * src/bison.simple: s/%%action/%%actions/.
20513
205142001-12-15 Akim Demaille <akim@epita.fr>
20515
20516 * src/reader.c (copy_action): When --yacc, don't append a `;'
20517 to the user action: let it fail if lacking.
20518 Suggested by Arnold Robbins and Tom Tromey.
20519
205202001-12-14 Akim Demaille <akim@epita.fr>
20521
20522 * src/lex.c (literalchar): Simply return the char you decoded, non
20523 longer mess around with obstacks and int pointers.
20524 Adjust all callers.
20525
205262001-12-14 Akim Demaille <akim@epita.fr>
20527
20528 * src/lex.c (literalchar): Don't escape the special characters,
20529 just decode them, and keep them as char (before, eol was output as
20530 the 2 char string `\n' etc.).
20531 * src/output.c (output_rule_data): Use quotearg to output the
20532 token strings.
20533
205342001-12-13 Paul Eggert <eggert@twinsun.com>
20535
20536 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
20537 Do not infringe on the global user namespace when using C++.
20538 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
20539 All uses of `fprintf' and `stderr' changed.
20540
20541 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
20542
205432001-12-13 Akim Demaille <akim@epita.fr>
20544
20545 The computation of nullable is broken: it doesn't handle empty
20546 RHS's properly.
20547
20548 * tests/torture.at (GNU AWK Grammar): New.
20549 * tests/sets.at (Nullable): New.
20550 * src/nullable.c (set_nullable): Instead of blindly looping over
20551 `ritems', loop over the rules, and then over their rhs's.
20552
20553 Work around Autotest bugs.
20554
20555 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
20556 frame, because Autotest understand lines starting with a `+' as
20557 traces from the shell. Then, they are not processed properly.
20558 Admittedly an Autotest bug, but we don't have time to wait for
20559 Autotest to catch up.
20560 * tests/regression.at (Broken Closure): Adjust to the new table
20561 frames.
20562 Move to...
20563 * tests/sets.at: here.
20564
205652001-12-13 Akim Demaille <akim@epita.fr>
20566
20567 * src/closure.c (closure): Use nrules instead of playing tricks
20568 with BITS_PER_WORD.
20569
205702001-12-13 Akim Demaille <akim@epita.fr>
20571
20572 * src/print.c (print_actions): Output the handling of `$' as the
20573 traces do: shifting the token EOF. Before EOF was treated as a
20574 nonterminal.
20575 * tests/regression.at: Adjust some tests.
20576 * src/print_graph.c (print_core): Complete the set of items via
20577 closure. The next-to-final and final states are still unsatisfying,
20578 but that's to be addressed elsewhere.
20579 No longer output the rule numbers, but do output the state number.
20580 A single loop for the shifts + gotos is enough, but picked a
20581 distinct color for each.
20582 (print_graph): Initialize and finalize closure.
20583
205842001-12-13 Akim Demaille <akim@epita.fr>
20585
20586 * src/reader.c (readgram): Remove dead code, an strip useless
20587 braces.
20588 (get_type): Remove, unused.
20589
205902001-12-12 Akim Demaille <akim@epita.fr>
20591
20592 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
20593 on that of lib/error.c.
20594
205952001-12-12 Akim Demaille <akim@epita.fr>
20596
20597 Some hosts don't like `/' in includes.
20598
20599 * src/system.h: Include libgettext.h without qualifying the path.
20600 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
20601 $(top_srcdir).
20602
206032001-12-11 Marc Autret <autret_m@epita.fr>
20604
20605 * src/output.c (output_parser): Remove useless muscle.
20606
206072001-12-11 Marc Autret <autret_m@epita.fr>
20608
20609 * src/bison.simple: Remove #line just before %%epilogue. It
20610 is now handled in ...
20611 * src/reader.c (read_additionnal_code): Add the output of a
20612 #line for the epilogue.
20613
206142001-12-10 Marc Autret <autret_m@epita.fr>
20615
20616 * src/reader.c (copy_definition): Re-use CPP-outed code which
20617 replace precedent remove.
20618 * src/bison.simple: Remove #line before %%prologue because
20619 %%input-line is wrong at this time.
20620
206212001-12-10 Marc Autret <autret_m@epita.fr>
20622
20623 * src/reader.c (symbols_output): Clean up.
20624 * src/output.c (output_gram, output): Clean up.
20625
206262001-12-10 Akim Demaille <akim@epita.fr>
20627
20628 * src/lalr.c (initialize_lookaheads): New. Extracted from...
20629 * src/LR0.c (set_state_table): here.
20630 * src/lalr.c (lalr): Call it.
20631
206322001-12-10 Akim Demaille <akim@epita.fr>
20633
20634 * src/state.h (shifts): Remove the `number' member: shifts are
20635 attached to state, hence no longer need to be labelled with a
20636 state number.
20637
206382001-12-10 Akim Demaille <akim@epita.fr>
20639
20640 Now that states have a complete set of members, the linked list of
20641 shifts is useless: just fill directly the state's shifts member.
20642
20643 * src/state.h (shifts): Remove the `next' member.
20644 * src/LR0.c (first_state, last_state): Remove.
20645 Adjust the callers.
20646 (augment_automaton): Don't look for the shifts that must be added
20647 a shift on EOF: it is those of the state we looked for! But now,
20648 since shifts are attached, it is no longer needed to looking
20649 merely by its id: its number.
20650
206512001-12-10 Akim Demaille <akim@epita.fr>
20652
20653 * src/LR0.c (augment_automaton): Better variable locality.
20654 Remove an impossible branch: if there is a state corresponding to
20655 the start symbol being shifted, then there is shift for the start
20656 symbol from the initial state.
20657
206582001-12-10 Akim Demaille <akim@epita.fr>
20659
20660 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
20661 only when appropriate: when insert_start_shifting_state' is not
20662 invoked.
20663 * tests/regression.at (Rule Line Numbers): Adjust.
20664
206652001-12-10 Akim Demaille <akim@epita.fr>
20666
20667 * src/LR0.c (augment_automaton): Now that all states have shifts,
20668 merge the two cases addition shifts to the initial state.
20669
206702001-12-10 Akim Demaille <akim@epita.fr>
20671
20672 * src/lalr.c (set_state_table): Move to...
20673 * src/LR0.c: here.
20674 * src/lalr.c (lalr): Don't call it...
20675 * src/LR0.c (generate_states): do it.
20676 * src/LR0.h (first_state): Remove, only the table is used.
20677
206782001-12-10 Akim Demaille <akim@epita.fr>
20679
20680 * src/LR0.h (first_shift, first_reduction): Remove.
20681 * src/lalr.c: Don't use first_shift: find shifts through the
20682 states.
20683
206842001-12-10 Akim Demaille <akim@epita.fr>
20685
20686 * src/LR0.c: Attach shifts to states as soon as they are
20687 computed.
20688 * src/lalr.c (set_state_table): Instead of assigning shifts to
20689 state, just assert that the mapping was properly done.
20690
206912001-12-10 Akim Demaille <akim@epita.fr>
20692
20693 * src/LR0.c (insert_start_shift): Rename as...
20694 (insert_start_shifting_state): this.
20695 (insert_eof_shifting_state, insert_accepting_state): New.
20696 (augment_automaton): Adjust.
20697 Better locality of the variables.
20698 When looking if the start_symbol is shifted from the initial
20699 state, using `while (... symbol != start_symbol ...)' sounds
20700 better than `while (... symbol < start_symbol ...)': If fail
20701 to see how the order between symbols could be relevant!
20702
207032001-12-10 Akim Demaille <akim@epita.fr>
20704
20705 * src/getargs.h: Don't declare `spec_name_prefix' and
20706 `spec_file_prefix', declared by src/files.h.
20707 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
20708 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
20709 * src/output.c (prepare): Adjust.
20710 * src/reader.c (symbols_output): Likewise.
20711 * src/vmsgetargs.c: Vaguely adjust, but who cares?
20712
207132001-12-10 Akim Demaille <akim@epita.fr>
20714
20715 * src/muscle_tab.c (muscle_init): NULL is a better default than
20716 `"0"'.
20717
207182001-12-10 Akim Demaille <akim@epita.fr>
20719
20720 * src/reader.c (reader): Calling symbols_output once is enough.
20721
207222001-12-10 Akim Demaille <akim@epita.fr>
20723
20724 Now that states have a complete set of members, the linked list of
20725 reductions is useless: just fill directly the state's reductions
20726 member.
20727
20728 * src/state.h (struct reductions): Remove member `number' and
20729 `next'.
20730 * src/LR0.c (first_reduction, last_reduction): Remove.
20731 (save_reductions): Don't link the new reductions, store them in
20732 this_state.
20733 * src/lalr.c (set_state_table): No need to attach reductions to
20734 states, it's already done.
20735 * src/output.c (output_actions): No longer free the shifts, then
20736 the reductions, then the states: free all the states and their
20737 members.
20738
207392001-12-10 Akim Demaille <akim@epita.fr>
20740
20741 * src/options.c (OPTN, DRTV, BOTH): New.
20742 (option_table): Use them.
20743
20744 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
20745 the job of system.h.
20746 * src/options.c: Don't include stdio.h and xalloc.h for the same
20747 reasons.
20748
207492001-12-10 Akim Demaille <akim@epita.fr>
20750
20751 * src/output.c (output, prepare): Make sure the values of the
20752 muscles `action' and `prologue' are 0-terminated.
20753
207542001-12-10 Akim Demaille <akim@epita.fr>
20755
20756 Clean up GCC warnings.
20757
20758 * src/reader.c (copy_action): `buf' is not used.
20759 (parse_skel_decl): Be static.
20760 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
20761 * src/options.h (create_long_option_table): Have a real prototype.
20762 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
20763 (hash_delete_at): Return const void *.
20764 Adjust casts to preserve the const.
20765
207662001-12-10 Akim Demaille <akim@epita.fr>
20767
20768 * configure.in: Require 2.52g.
20769 M4 is not needed, but AUTOM4TE is.
20770 * m4/m4.m4: Remove.
20771 * tests/Makefile.am: Adjust.
20772
207732001-12-10 Akim Demaille <akim@epita.fr>
20774
20775 One structure for states is enough, even though theoretically
20776 there are LR(0) states and LALR(1) states.
20777
20778 * src/lalr.h (state_t): Remove.
20779 (state_table): Be state_t **, not state_t *.
20780 * src/state.h (core, CORE_ALLOC): Rename as...
20781 (state_t, STATE_ALLOC): this.
20782 Add the LALR(1) members: shifts, reductions, errs.
20783 * src/LR0.c (state_table): Rename as...
20784 (state_hash): this, to avoid name clashes with the global
20785 `state_table'.
20786 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
20787 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
20788
207892001-12-10 Akim Demaille <akim@epita.fr>
20790
20791 Bison dumps core on bash.y.
20792 Reported by Pascal Bart.
20793
20794 * src/warshall.c (bitmatrix_print): New.
20795 (TC): Use it.
20796 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
20797 j must be the outer loop.
20798 * tests/regression.at (Broken Closure): New.
20799
208002001-12-05 Akim Demaille <akim@epita.fr>
20801
20802 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
20803 its argument.
20804 Reported by Peter Hamorsky.
20805
208062001-12-05 Akim Demaille <akim@epita.fr>
20807
20808 * src/conflicts.c (err_table): Remove.
20809 (resolve_sr_conflict): Adjust.
20810 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
20811 Rename as...
20812 (state_t.reductions, state_t.shifts): this.
20813
208142001-12-05 Akim Demaille <akim@epita.fr>
20815
20816 * src/reduce.c (reduce_grammar_tables): No longer disable the
20817 removal of useless rules via CPP but via `if (0)', so that the
20818 compiler still check the code is valid.
20819 For instance, it should have noticed `rline' no longer exists: use
20820 the `line' member of rule_t.
20821 * src/gram.c (dummy, rline): Remove, unused.
20822
208232001-12-05 Akim Demaille <akim@epita.fr>
20824
20825 * src/output.c (pack_vector): Use assert, not berror.
20826 * src/main.c (berror): Remove, unused.
20827
208282001-12-05 Akim Demaille <akim@epita.fr>
20829
20830 New experimental feature: if --verbose --trace output all the
20831 items of a state, not only its kernel.
20832
20833 * src/print.c (print_core): If `trace_flag', then invoke closure
20834 before outputting the items of the state (print_core is no longer
20835 a correct name them).
20836 (print_results): Invoke new_closure/free_closure if needed.
20837
208382001-12-05 Akim Demaille <akim@epita.fr>
20839
20840 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
20841 * src/closure.c, src/closure.h (itemsetsize): Rename as...
20842 (nitemset): for consistency with the rest of the project.
20843
208442001-12-05 Akim Demaille <akim@epita.fr>
20845
20846 * src/closure.c (print_closure): Improve.
20847 (closure): Use it for printing input and output.
20848
208492001-12-05 Akim Demaille <akim@epita.fr>
20850
20851 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
20852 indexed by nonterminals.
20853
208542001-12-05 Akim Demaille <akim@epita.fr>
20855
20856 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
20857 what it was!).
20858 * src/warshall.h: Remove accidental duplication of the content.
20859
208602001-12-05 Akim Demaille <akim@epita.fr>
20861
20862 * src/closure.c (set_fderives): De-obfuscate.
20863
208642001-12-05 Akim Demaille <akim@epita.fr>
20865
20866 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
20867
208682001-12-05 Akim Demaille <akim@epita.fr>
20869
20870 * src/closure.c (set_firsts): De-obfuscate.
20871
208722001-12-05 Akim Demaille <akim@epita.fr>
20873
20874 * src/output.c (action_row): De-obfuscate
20875 using the good o' techniques: arrays not pointers, variable
20876 locality, BITISSET, RESETBIT etc.
20877
208782001-12-05 Akim Demaille <akim@epita.fr>
20879
20880 Pessimize the code to simplify it: from now on, all the states
20881 have a valid SHIFTS, which NSHIFTS is possibly 0.
20882
20883 * src/LR0.c (shifts_new): Be global and move to..
20884 * src/state.c, src/state.h: here.
20885 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
20886 * src/print_graph: Adjust.
20887
208882001-12-05 Akim Demaille <akim@epita.fr>
20889
20890 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
20891 * src/conflicts.c: Use it.
20892 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
20893 incorrectly ``simplified''.
20894
208952001-12-05 Akim Demaille <akim@epita.fr>
20896
20897 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
20898 using the good o' techniques: arrays not pointers, variable
20899 locality, BITISSET, RESETBIT etc.
20900
209012001-12-05 Akim Demaille <akim@epita.fr>
20902
20903 * src/state.h (SHIFT_SYMBOL): New.
20904 * src/conflicts.c: Use it to deobfuscate.
20905
209062001-12-05 Akim Demaille <akim@epita.fr>
20907
20908 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
20909 (print_reductions): De-obfuscate using the good o' techniques:
20910 arrays not pointers, variable locality, BITISSET.
20911
209122001-12-05 Akim Demaille <akim@epita.fr>
20913
20914 * src/conflicts.c (print_reductions): Arrays, not pointers.
20915 Use BITISSET.
20916
209172001-12-05 Akim Demaille <akim@epita.fr>
20918
20919 * src/conflicts.c (print_reductions): Pessimize, but clarify.
20920
209212001-12-05 Akim Demaille <akim@epita.fr>
20922
20923 * src/conflicts.c (print_reductions): Improve variable locality.
20924
209252001-12-05 Akim Demaille <akim@epita.fr>
20926
20927 * src/conflicts.c (print_reductions): Pessimize, but clarify.
20928
209292001-12-05 Akim Demaille <akim@epita.fr>
20930
20931 * src/conflicts.c (print_reductions): Improve variable locality.
20932
209332001-12-05 Akim Demaille <akim@epita.fr>
20934
20935 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
20936 * src/lalr.c: Use them.
20937
209382001-12-05 Akim Demaille <akim@epita.fr>
20939
20940 * src/LR0.c (augment_automaton): Formatting changes.
20941 Better variable locality.
20942
209432001-12-05 Akim Demaille <akim@epita.fr>
20944
20945 * src/lalr.c (matrix_print): New.
20946 (transpose): Use it.
20947 Use arrays instead of pointers.
20948
209492001-12-05 Akim Demaille <akim@epita.fr>
20950
20951 * src/lalr.c (maxrhs): Move to...
20952 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
20953 * src/lalr.c (build_relations): Adjust.
20954
209552001-12-05 Akim Demaille <akim@epita.fr>
20956
20957 * src/lalr.c (transpose): Free the memory allocated to the
20958 argument, as it is replaced by the results by the unique caller.
20959 (build_relations): Merely invoke transpose: it handles the memory
20960 deallocation.
20961 Improve variable locality.
20962 Avoid variables used as mere abbreviations.
20963 (compute_lookaheads): Use arrays instead of pointers.
20964
209652001-12-05 Akim Demaille <akim@epita.fr>
20966
20967 * src/lalr.c (initialize_F): Improve variable locality.
20968 Avoid variables used as mere abbreviations.
20969
209702001-12-05 Akim Demaille <akim@epita.fr>
20971
20972 * src/derives.c (print_derives): Display the ruleno.
20973 * src/lalr.c (initialize_F, transpose): Better variable locality
20974 to improve readability.
20975 Avoid variables used as mere abbreviations.
20976
209772001-12-05 Akim Demaille <akim@epita.fr>
20978
20979 * src/lalr.c (traverse): Use arrays instead of pointers.
20980
209812001-12-05 Akim Demaille <akim@epita.fr>
20982
20983 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
20984 the handling of squeue.
20985 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
20986
209872001-12-05 Akim Demaille <akim@epita.fr>
20988
20989 Because useless nonterminals are now kept alive (instead of being
20990 `destroyed'), we now sometimes examine them, and store information
20991 related to them. Hence we need to know their number, and adjust
20992 memory allocations.
20993
20994 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
20995 static.
20996 * src/LR0.c (allocate_itemsets): The memory allocated to
20997 `symbol_count' was used for two different purpose: once to count
20998 the number of occurrences of each symbol, and later reassigned to
20999 `shift_symbol', containing the symbol that can be shifted from a
21000 given state.
21001 Deobfuscate, i.e., allocate, use and free `symbol_count' here
21002 only, and...
21003 (new_itemsets): Allocate `shift_symbol' here.
21004 (allocate_itemsets): symbol_count includes useless nonterminals.
21005 Make room for them.
21006 (free_storage): Use `free', not `XFREE', for pointers that cannot
21007 be null.
21008
210092001-12-05 Akim Demaille <akim@epita.fr>
21010
21011 * src/nullable.c (set_nullable): Deobfuscate the handling of
21012 ritem.
21013 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21014
210152001-12-05 Akim Demaille <akim@epita.fr>
21016
21017 * src/gram.c, src/gram.h (ritem_print): New.
21018 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
21019 (This useless function was defined only to work around VMS linkers
21020 that can't handle compilation units with variables only).
21021 * src/reduce.c (dump_grammar): Use it to trace the construction of
21022 ritem.
21023
210242001-12-04 Paul Eggert <eggert@twinsun.com>
21025
21026 * src/bison.simple (union yyalloc): Change member names
21027 to be the same as the stack names.
21028 (yyparse): yyptr is now union yyalloc *, not char *.
21029 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
21030 and may generate better code on some machines.
21031 (yystpcpy): Use prototype if __STDC__ is defined, not just
21032 if __cplusplus is defined.
21033
210342001-11-30 Akim Demaille <akim@epita.fr>
21035
21036 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
21037 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
21038 Gettext doesn't compile cleanly, and dies with -Werror.
21039 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
21040 Include WARNING_CFLAGS here.
21041 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
21042 before being defined.
21043
210442001-11-27 Paul Eggert <eggert@twinsun.com>
21045
21046 * lib/quotearg.h (quotearg_n, quotearg_n_style):
21047 First arg is int, not unsigned.
21048 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
21049 (SIZE_MAX, UINT_MAX): New macros.
21050 (quotearg_n_options): Abort if N is negative.
21051 Avoid overflow check on hosts where size_t is 64 bits and int
21052 is 32 bits, as overflow is impossible there.
21053 Fix off-by-one typo that caused unnecessary reallocation.
21054
210552001-11-29 Paul Eggert <eggert@twinsun.com>
21056
21057 Name space cleanup in generated parser.
21058
21059 * doc/bison.texinfo (Bison Parser): Discuss system headers
21060 and their effect on the user name space.
21061
21062 * src/bison.simple:
21063 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
21064 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
21065 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
21066
21067 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
21068 on user names when possible.
21069
21070 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
21071 Simplify test for whather <alloca.h> exists.
21072
21073 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
21074
21075 (<stdio.h>): Include if YYDEBUG.
21076
21077 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
21078 ! defined (yyoverflow) && ! defined (yymemcpy).
21079
21080 (yymemcpy, yyparse): Rename local variables as needed so that
21081 they all begin with 'yy'.
21082
21083 (yystrlen, yystpcpy): New functions.
21084
21085 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
21086 All uses changed.
21087
21088 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
21089 instead of relying on string.h functions. Use YYSTACK_ALLOC
21090 and YYSTACK_FREE instead of malloc and free.
21091
210922001-11-30 Akim Demaille <akim@epita.fr>
21093
21094 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
21095 before their first uses.
21096 (YYBISON, YYPURE): Move to the top of the output.
21097
210982001-11-30 Akim Demaille <akim@epita.fr>
21099
21100 * tests/reduce.at (Useless Nonterminals): Fix.
21101
211022001-11-30 Akim Demaille <akim@epita.fr>
21103
21104 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
21105 if body instead of `;' to pacify GCC's warnings.
21106
211072001-11-30 Akim Demaille <akim@epita.fr>
21108
21109 Instead of mapping the LHS of unused rules to -1, keep the LHS
21110 valid, but flag the rules as invalid.
21111
21112 * src/gram.h (rule_t): `useful' is a new member.
21113 * src/print.c (print_grammar): Adjust.
21114 * src/derives.c (set_derives): Likewise.
21115 * src/reader.c (packgram, reduce_output): Likewise.
21116 * src/reduce.c (reduce_grammar_tables): Likewise.
21117 * tests/reduce.at (Underivable Rules, Useless Rules): New.
21118
211192001-11-30 Akim Demaille <akim@epita.fr>
21120
21121 * src/reduce.c (reduce_output): Formatting changes.
21122 * src/print.c (print_results, print_grammar): Likewise.
21123 * tests/regression.at (Rule Line Numbers)
21124 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
21125
211262001-11-30 Akim Demaille <akim@epita.fr>
21127
21128 * src/reduce.c (nonterminals_reduce): Instead of throwing away
21129 useless nonterminals, move them at the end of the symbol arrays.
21130 (reduce_output): Adjust.
21131 * tests/reduce.at (Useless Nonterminals): Adjust.
21132
211332001-11-30 Akim Demaille <akim@epita.fr>
21134
21135 * src/reduce.c: Various comment/formatting changes.
21136 (nonterminals_reduce): New, extracted from...
21137 (reduce_grammar_tables): here.
21138 (reduce_grammar): Call nonterminals_reduce.
21139
211402001-11-29 Paul Eggert <eggert@twinsun.com>
21141
21142 * src/bison.simple (YYSTACK_REALLOC): Remove.
21143 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
21144 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
21145 New macros.
21146 (union yyalloc): New type.
21147 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
21148 an arbitrary restriction on hosts where size_t is wider than int.
21149
21150 (yyparse): Don't dump core if alloca or malloc fails; instead, report
21151 a parser stack overflow. Allocate just one block of memory for all
21152 three stacks, instead of allocating three blocks; this typically is
21153 faster and reduces fragmentation.
21154
21155 Do not limit the number of items in the stack to a value that fits
21156 in 'int', as this is an arbitrary limit on hosts with 64-bit
21157 size_t and 32-bit int.
21158
211592001-11-29 Marc Autret <autret_m@epita.fr>
21160
21161 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
21162 of defining YYERROR_VERBOSE.
21163 [AT_DATA]: $4 is now out of C declarations in the prologue.
21164
211652001-11-28 Marc Autret <autret_m@epita.fr>
21166
21167 * src/reader.c (parse_dquoted_param): New.
21168 (parse_skel_decl): Use it.
21169 * src/lex.h: Add its prototype.
21170 * src/lex.c (literalchar): Become not static.
21171
211722001-11-28 Marc Autret <autret_m@epita.fr>
21173
21174 * src/output.h: And put its extern declaration here.
21175 * src/output.c (error_verbose): Define here.
21176 (prepare): Echo name modification.
21177 * src/getargs.h: Clean its extern declaration.
21178 * src/getargs.c (error_verbose_flag): Remove.
21179 (getargs): Remove case 'e'.
21180 * src/options.c (option_table): 'error-verbose' is now seen as simple
21181 percent option.
21182 Include output.h.
21183
21184 * src/reader.c (read_declarations): Remove case tok_include.
21185 (parse_include_decl): Remove.
21186 * src/lex.h (token_t): Remove tok_include.
21187 * src/options.c (option_table): 'include' is now a simple command line
21188 option.
21189
211902001-11-28 Marc Autret <autret_m@epita.fr>
21191
21192 * src/bison.simple: Adjust muscle names.
21193 * src/muscle_tab.c (muscle_init): Also rename the muscles.
21194 * src/output.c (prepare): s/_/-/ for the muscles names.
21195 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
21196
211972001-11-28 Marc Autret <autret_m@epita.fr>
21198
21199 * src/bison.simple: Fix debug.
21200 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
21201
212022001-11-28 Akim Demaille <akim@epita.fr>
21203
21204 * src/LR0.c (shifts_new): New.
21205 (save_shifts, insert_start_shift, augment_automaton): Use it.
21206
212072001-11-28 Akim Demaille <akim@epita.fr>
21208
21209 * src/closure.c (closure): `b' and `ruleno' denote the same value:
21210 keep ruleno only.
21211
212122001-11-28 Akim Demaille <akim@epita.fr>
21213
21214 * src/closure.c (closure): Instead of looping over word in array
21215 then bits in words, loop over bits in array.
21216
212172001-11-28 Akim Demaille <akim@epita.fr>
21218
21219 * src/closure.c (closure): No longer optimize the special case
21220 where all the bits of `ruleset[r]' are set to 0, to make the code
21221 clearer.
21222
212232001-11-28 Akim Demaille <akim@epita.fr>
21224
21225 * src/closure.c (closure): `r' and `c' are new variables, used to
21226 de-obfuscate accesses to RULESET and CORE.
21227
212282001-11-28 Akim Demaille <akim@epita.fr>
21229
21230 * src/reduce.c (reduce_print): Use ngettext.
21231 (dump_grammar): Improve the trace accuracy.
21232
212332001-11-28 Akim Demaille <akim@epita.fr>
21234
21235 * src/reduce.c (dump_grammar): Don't translate trace messages.
21236
212372001-11-28 Akim Demaille <akim@epita.fr>
21238
21239 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
21240 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
21241 as all tags are free'ed afterwards.
21242 From Enrico Scholz.
21243
212442001-11-27 Paul Eggert <eggert@twinsun.com>
21245
21246 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
21247 use alloca when we didn't want to, and vice versa.
21248
212492001-11-27 Marc Autret <autret_m@epita.fr>
21250
21251 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
21252 initialization.
21253 * src/output.c (prepare): Remove its update.
21254
212552001-11-27 Marc Autret <autret_m@epita.fr>
21256
21257 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
21258 Use %error-verbose.
21259
212602001-11-27 Marc Autret <autret_m@epita.fr>
21261
21262 * src/bison.simple: Remove YYERROR_VERBOSE using.
21263 Use %%error_verbose.
21264 (yyparse): Likewise.
21265 * src/output.c (prepare): Give its final value.
21266 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
21267 * src/getargs.h: Add its extern declaration.
21268 * src/getargs.c (error_verbose_flag): New int.
21269 (getargs): Update to catch new case.
21270 * src/options.c (option_table): 'error-verbose' is a new option.
21271 (shortopts): Update.
21272
212732001-11-27 Akim Demaille <akim@epita.fr>
21274
21275 * src/system.h: Use intl/libgettext.h.
21276 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
21277
212782001-11-27 Akim Demaille <akim@epita.fr>
21279
21280 * tests/torture.at (Exploding the Stack Size with Malloc):
21281 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
21282
212832001-11-27 Akim Demaille <akim@epita.fr>
21284
21285 * src/files.c: Include error.h.
21286 Reported by Hans Aberg.
21287
212882001-11-26 Marc Autret <autret_m@epita.fr>
21289
21290 * src/reader.c (parse_include_decl): New, not yet implemented.
21291 (read_declarations): Add case tok_include.
21292 * src/getargs.h (include): Add its extern definition.
21293 * src/getargs.c (include): New const char *.
21294 (getargs): Add case '-I'.
21295 * src/options.c (option_table): Add include as command line and
21296 percent option.
21297 * src/lex.h (token_t): Add tok_include.
21298
212992001-11-26 Akim Demaille <akim@epita.fr>
21300
21301 * src/reader.c (readgram): Make sure rules for mid-rule actions
21302 have a lineno equal to that of their host rule.
21303 Reported by Hans Aberg.
21304 * tests/regression.at (Rule Line Numbers): New.
21305
213062001-11-26 Akim Demaille <akim@epita.fr>
21307
21308 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
21309 size_ts.
21310
213112001-11-26 Akim Demaille <akim@epita.fr>
21312
21313 * src/complain.c, src/complain.h (error): Remove, provided by
21314 lib/error.[ch].
21315
213162001-11-26 Akim Demaille <akim@epita.fr>
21317
21318 * src/reader.c (read_declarations): Don't abort on tok_illegal,
21319 issue an error message.
21320 * tests/regression.at (Invalid %directive): New.
21321 Reported by Hans Aberg.
21322
213232001-11-26 Akim Demaille <akim@epita.fr>
21324
21325 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
21326 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
21327
213282001-11-26 Akim Demaille <akim@epita.fr>
21329
21330 * src/conflicts.c (conflicts_print): Don't complain at all when
21331 there are no reduce/reduce conflicts, and as many shift/reduce
21332 conflicts as expected.
21333 * tests/regression.at (%expect right): Adjust.
21334
213352001-11-23 Akim Demaille <akim@epita.fr>
21336
21337 * lib/alloca.c: Update, from fileutils.
21338
213392001-11-23 Akim Demaille <akim@epita.fr>
21340
21341 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
21342
213432001-11-23 Akim Demaille <akim@epita.fr>
21344
21345 * src/system.h: Include alloca.h.
21346 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
21347
213482001-11-23 Akim Demaille <akim@epita.fr>
21349
21350 * src/print_graph.c (print_actions): Remove `rule', unused.
21351 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
21352 pacify GCC's signed < unsigned warnings.
21353 * src/closure.c (itemsetsize): Likewise.
21354 * src/reader.c (symbol_list_new): Static.
21355
213562001-11-23 Akim Demaille <akim@epita.fr>
21357
21358 Attaching lineno to buckets is stupid, since only one copy of each
21359 symbol is kept, only the line of the first occurrence is kept too.
21360
21361 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
21362 * src/reader.c (rline_allocated): Remove, unused.
21363 (symbol_list): Have a `line' member.
21364 (symbol_list_new): New.
21365 (readgram): Use it.
21366 * src/print.c (print_grammar): Output the rule line numbers.
21367 * tests/regression.at (Solved SR Conflicts)
21368 (Unresolved SR Conflicts): Adjust.
21369 Reported by Hans Aberg.
21370
213712001-11-22 Marc Autret <autret_m@epita.fr>
21372
21373 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
21374
213752001-11-22 Marc Autret <autret_m@epita.fr>
21376
21377 * src/muscle_tab.c (muscle_init): Remove initialization of
21378 skeleton muscle.
21379 * src/output.c (output_master_parser): Do it here.
21380
213812001-11-20 Akim Demaille <akim@epita.fr>
21382
21383 * po/sv.po: New.
21384 * configure.in (ALL_LINGUAS): Adjust.
21385 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
21386 longer contains strings to translate.
21387
213882001-11-19 Akim Demaille <akim@epita.fr>
21389
21390 * src/conflicts.c (conflicts_print): Add a missing \n.
21391
213922001-11-19 Akim Demaille <akim@epita.fr>
21393
21394 * src/nullable.c (nullable_print): New.
21395 (set_nullable): Call it when tracing.
21396 Better locality of variables.
21397
213982001-11-19 Akim Demaille <akim@epita.fr>
21399
21400 * src/print.c (print_actions): Better locality of variables.
21401
214022001-11-19 Akim Demaille <akim@epita.fr>
21403
21404 * src/derives.c (print_derives): Fix and enrich.
21405 * src/closure.c (print_fderives): Likewise.
21406
214072001-11-19 Akim Demaille <akim@epita.fr>
21408
21409 * src/closure.c (itemsetend): Remove, replaced with...
21410 (itemsetsize): new.
21411
214122001-11-19 Akim Demaille <akim@epita.fr>
21413
21414 * src/LR0.c (kernel_end): Remove, replaced with...
21415 (kernel_size): new.
21416
214172001-11-19 Akim Demaille <akim@epita.fr>
21418
21419 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
21420 to clarify.
21421
214222001-11-19 Akim Demaille <akim@epita.fr>
21423
21424 * src/closure.c (closure): Use arrays instead of pointers to clarify.
21425
214262001-11-19 Akim Demaille <akim@epita.fr>
21427
21428 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
21429 trace messages.
21430 * src/LR0.c: Likewise.
21431 (allocate_itemsets): Use arrays instead of pointers to clarify.
21432
214332001-11-19 Akim Demaille <akim@epita.fr>
21434
21435 * src/getargs.c (statistics_flag): Replace with...
21436 (trace_flag): New.
21437 (longopts): Accept --trace instead of --statistics.
21438 * src/getargs.h, src/options.c: Adjust.
21439 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
21440 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
21441
214422001-11-19 Akim Demaille <akim@epita.fr>
21443
21444 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
21445 pointers to clarify the code.
21446 (save_reductions, save_shifts): Factor common parts of alternatives.
21447
214482001-11-19 Akim Demaille <akim@epita.fr>
21449
21450 * src/LR0.c (new_state, get_state): Complete TRACE code.
21451 * src/closure.c: Include `reader.h' to get `tags', needed by the
21452 trace code.
21453 Rename the conditional DEBUG as TRACE.
21454 Output consistently TRACEs to stderr, not stdout.
21455 * src/derives.c: Likewise.
21456 * src/reduce.c: (inaccessable_symbols): Using if is better style
21457 than goto.
21458 Use `#if TRACE' instead of `#if 0' for tracing code.
21459
214602001-11-19 Akim Demaille <akim@epita.fr>
21461
21462 * src/system.h (LIST_FREE, shortcpy): New.
21463 * src/LR0.c: Use them.
21464 * src/output.c (free_itemsets, free_reductions, free_shifts):
21465 Remove, replaced by LIST_FREE.
21466
214672001-11-19 Akim Demaille <akim@epita.fr>
21468
21469 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
21470 (REDUCTIONS_ALLOC): New.
21471 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
21472 allocation.
21473
214742001-11-19 Akim Demaille <akim@epita.fr>
21475
21476 * src/LR0.c (new_state): Complete trace code.
21477 * src/nullable.c (set_nullable): Don't translate traces.
21478
214792001-11-19 Akim Demaille <akim@epita.fr>
21480
21481 * src/print_graph.c (print_core): Better locality of variables.
21482 * src/print.c (print_core): Likewise.
21483
214842001-11-19 Akim Demaille <akim@epita.fr>
21485
21486 * src/vcg.c: You do the output, so you are responsible of the
21487 handling of VCG syntax, in particular: use quotearg.
21488 * src/print_graph.c: Don't.
21489 (print_actions): Don't output the actions as part of the nodes,
21490 since that's the job of the edges.
21491 (print_state): Don't output by hand: fill the node description,
21492 and ask for its output.
21493
214942001-11-19 Akim Demaille <akim@epita.fr>
21495
21496 * src/bison.simple (yyparse): When verbosely reporting an error,
21497 no longer put additional quotes around token names.
21498 * tests/calc.at: Adjust.
21499
215002001-11-19 Akim Demaille <akim@epita.fr>
21501
21502 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
21503 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
21504 * src/output.c: Adjust.
21505
215062001-11-19 Akim Demaille <akim@epita.fr>
21507
21508 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
21509 (rule_t): this.
21510 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
21511
215122001-11-19 Akim Demaille <akim@epita.fr>
21513
21514 * src/gram.h (rule_t): New.
21515 (rule_table): New.
21516 (rrhs, rlhs): Remove, part of state_t.
21517 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
21518 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
21519 * src/reader.c, src/reduce.c: Adjust.
21520
215212001-11-19 Akim Demaille <akim@epita.fr>
21522
21523 * src/reader.c (symbols_output): New, extracted from...
21524 (packsymbols): Here.
21525 (reader): Call it.
21526
215272001-11-19 Akim Demaille <akim@epita.fr>
21528
21529 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
21530 (maxrhs): this new function.
21531
215322001-11-19 Akim Demaille <akim@epita.fr>
21533
21534 * src/lalr.c (F): New macro to access the variable F.
21535 Adjust.
21536
215372001-11-19 Akim Demaille <akim@epita.fr>
21538
21539 * src/lalr.h (LA): New macro to access the variable LA.
21540 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21541 * src/lalr.c: Adjust.
21542
215432001-11-19 Akim Demaille <akim@epita.fr>
21544
21545 * src/lalr.c (initialize_LA): Only initialize LA. Let...
21546 (set_state_table): handle the `lookaheads' members.
21547
215482001-11-19 Akim Demaille <akim@epita.fr>
21549
21550 * src/lalr.h (lookaheads): Removed array, whose contents is now
21551 a member of...
21552 (state_t): this structure.
21553 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21554 Adjust.
21555
215562001-11-19 Akim Demaille <akim@epita.fr>
21557
21558 * src/lalr.h (consistent): Removed array, whose contents is now
21559 a member of...
21560 (state_t): this structure.
21561 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21562 Adjust.
21563
215642001-11-19 Akim Demaille <akim@epita.fr>
21565
21566 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
21567 contents are now members of...
21568 (state_t): this structure.
21569 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21570 Adjust.
21571
215722001-11-19 Akim Demaille <akim@epita.fr>
21573
21574 * src/lalr.h (state_t): New.
21575 (state_table): Be a state_t * instead of a core **.
21576 (accessing_symbol): Remove, part of state_t.
21577 * src/lalr.c: Adjust.
21578 (set_accessing_symbol): Merge into...
21579 (set_state_table): this.
21580 * src/print_graph.c, src/conflicts.c: Adjust.
21581
215822001-11-14 Akim Demaille <akim@epita.fr>
21583
21584 * tests/calc.at, tests/output.at, tests/regression.at,
21585 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
21586 now the tests are run in private dirs, therefore AC_CLEANUP and
21587 family can be simplified to 0-ary.
21588 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
21589 use abs. path to find config.h.
21590 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
21591 stderr, there can be way too much random noise.
21592 Instead pass -Werror to GCC and rely on the exit status.
21593 Reported by Wolfram Wagner.
21594
215952001-11-14 Akim Demaille <akim@epita.fr>
21596
21597 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
21598 defined only if yyoverflow is defined, to avoid `warning: unused
21599 variable `yyvs1''.
21600 Reported by The Test Suite.
21601
216022001-11-14 Akim Demaille <akim@epita.fr>
21603
21604 * src/print.c: Include reduce.h.
21605 Reported by Hans Aberg.
21606
216072001-11-14 Akim Demaille <akim@epita.fr>
21608
21609 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
21610 Revert a previous patch: these are really const.
21611 * src/conflicts.c (conflict_report): Additional useless pair of
21612 braces to pacify GCC's warnings for `if () if () {} else {}'.
21613 * src/lex.c (parse_percent_token): Replace equal_offset with
21614 arg_offset.
21615 arg is const.
21616 Be sure to strdup `arg' when used, since there is no reason for
21617 token_buffer not to change.
21618
216192001-11-14 Akim Demaille <akim@epita.fr>
21620
21621 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
21622 definition.
21623 * src/main.c (main): Use them.
21624 Suggested by Hans Aberg.
21625
216262001-11-12 Akim Demaille <akim@epita.fr>
21627
21628 * src/system.h (ngettext): Now that we use ngettext, be sure to
21629 provide a default definition when NLS are not used.
21630
216312001-11-12 Akim Demaille <akim@epita.fr>
21632
21633 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
21634 Use @kbd to denote user input.
21635 (Language and Grammar): ANSIfy the example.
21636 Adjust its layout for info/notinfo.
21637 (Location Tracking Calc): Output error messages to stderr.
21638 Output locations in a more GNUtically correct way.
21639 Fix a couple of Englishos.
21640 Adjust @group/@end group pairs.
21641
216422001-11-12 Akim Demaille <akim@epita.fr>
21643
21644 %expect was not functioning at all.
21645
21646 * src/conflicts.c (expected_conflicts): Set to -1.
21647 (conflict_report): Use ngettext.
21648 (conflicts_print): Check %expect and make its violation an error.
21649 * doc/bison.texinfo (Expect Decl): Adjust.
21650 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
21651 * tests/regression.at (%expect not enough, %expect right)
21652 (%expect too much): New.
21653
216542001-11-12 Akim Demaille <akim@epita.fr>
21655
21656 * tests/regression.at (Conflicts): Rename as...
21657 (Unresolved SR Conflicts): this.
21658 (Solved SR Conflicts): New.
21659
216602001-11-12 Akim Demaille <akim@epita.fr>
21661
21662 * src/reduce.c (print_results): Rename as...
21663 (reduce_output): This.
21664 Output to OUT, passed as argument, instead of output_obstack.
21665 (dump_grammar): Likewise.
21666 (reduce_free): New.
21667 Also free V1.
21668 (reduce_grammar): No longer call reduce_output, since...
21669 * src/print.c (print_results): do it.
21670 * src/main.c (main): Call reduce_free;
21671
216722001-11-12 Akim Demaille <akim@epita.fr>
21673
21674 * src/conflicts.c (print_reductions): Accept OUT as argument.
21675 Output to it, not to output_obstack.
21676 * src/print.c (print_actions): Adjust.
21677
216782001-11-12 Akim Demaille <akim@epita.fr>
21679
21680 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
21681 the result instead of using...
21682 (src_total, rrc_total, src_count, rrc_count): Remove.
21683 (any_conflicts): Remove.
21684 (print_conflicts): Split into...
21685 (conflicts_print, conflicts_output): New.
21686 * src/conflicts.h: Adjust.
21687 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
21688 * src/print.c (print_grammar): Issue `\n' between two rules.
21689 * tests/regression.at (Conflicts): New.
21690 Reported by Tom Lane.
21691
216922001-11-12 Akim Demaille <akim@epita.fr>
21693
21694 * tests/regression.at (Invalid input): Remove, duplicate with
21695 ``Invalid input: 1''.
21696
216972001-11-12 Akim Demaille <akim@epita.fr>
21698
21699 * tests/torture.at (AT_DATA_STACK_TORTURE)
21700 (Exploding the Stack Size with Alloca)
21701 (Exploding the Stack Size with Malloc): New.
21702
217032001-11-12 Akim Demaille <akim@epita.fr>
21704
21705 * src/bison.simple (YYSTACK_REALLOC): New.
21706 (yyparse) [!yyoverflow]: Use it and free the old stack.
21707 Reported by Per Allansson.
21708
217092001-11-12 Pascal Bart <pascal.bart@epita.fr>
21710
21711 * src/bison.simple: Define type yystype instead of YYSTYPE, and
21712 define CPP macro, which substitute YYSTYPE by yystype.
21713 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
21714 with yyltype/YYLTYPE. This allows inclusion of the generated
21715 header within the parser if the compiler, such as GGC, accepts
21716 multiple equivalent #defines.
21717 From Akim.
21718
217192001-11-05 Akim Demaille <akim@epita.fr>
21720
21721 * src/reader.c (symbols_output): New, extracted from...
21722 (packsymbols): here.
21723 (reader): Adjust.
21724
217252001-11-05 Akim Demaille <akim@epita.fr>
21726
21727 * src/lex.c (parse_percent_token): s/quotearg/quote/.
21728
217292001-11-05 Akim Demaille <akim@epita.fr>
21730
21731 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
21732 pattern.
21733
217342001-11-05 Akim Demaille <akim@epita.fr>
21735
21736 * src/options.h (struct option_table_struct): set_flags is void*.
21737 * src/options.c (longopts): Support `--output' and `%output'.
21738 (usage): Adjust.
21739 * src/lex.h (tok_setopt): Remove, replaced with...
21740 (tok_intopt, tok_stropt): these new guys.
21741 * src/lex.c (getopt.h): Not needed.
21742 (token_buffer, unlexed_token_buffer): Not const.
21743 (percent_table): Promote `-' over `_' in directive names.
21744 Active `%name-prefix', `file-prefix', and `output'.
21745 (parse_percent_token): Accept possible arguments to directives.
21746 Promote `-' over `_' in directive names.
21747
217482001-11-04 Akim Demaille <akim@epita.fr>
21749
21750 * doc/bison.texinfo (Decl Summary): Split the list into
21751 `directives for grammars' and `directives for bison'.
21752 Sort'em.
21753 Add description of `%name-prefix', `file-prefix', and `output'.
21754 Promote `-' over `_' in directive names.
21755 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
21756 Simplify the description of `--name-prefix'.
21757 Promote `-' over `_' in directive names.
21758 Promote `--output' over `--output-file'.
21759 Fix the description of `--defines'.
21760 * tests/output.at: Exercise %file-prefix and %output.
21761
217622001-11-02 Akim Demaille <akim@epita.fr>
21763
21764 * doc/refcard.tex: Update.
21765
217662001-11-02 Akim Demaille <akim@epita.fr>
21767
21768 * src/symtab.h (SUNDEF): New.
21769 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
21770 stand for `uninitialized', instead of 0.
21771 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
21772 * src/lex.c (lex): Adjust.
21773
21774 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
21775 Number it 0.
21776 Let yylex return it instead of a plain 0.
21777 Reported by Dick Streefland.
21778
217792001-11-02 Akim Demaille <akim@epita.fr>
21780
21781 * tests/regression.at (Mixing %token styles): New test.
21782
217832001-11-02 Akim Demaille <akim@epita.fr>
21784
21785 * src/reader.c (parse_thong_decl): Formatting changes.
21786 (token_translations_init): New, extracted from...
21787 (packsymbols): Here.
21788 Adjust.
21789
217902001-11-01 Akim Demaille <akim@epita.fr>
21791
21792 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
21793 Check that `9foo.y' produces correct cpp guards.
21794 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
21795 guards.
21796 Reported by Wwp.
21797
217982001-11-01 Akim Demaille <akim@epita.fr>
21799
21800 * tests/regression.at (Invalid input: 2): New.
21801 * src/lex.c (unlexed_token_buffer): New.
21802 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
21803 too.
21804 Reported by Wwp.
21805
218062001-11-01 Akim Demaille <akim@epita.fr>
21807
21808 * tests/calc.at: Catch up with 1.30.
21809 * configure.in: Bump to 1.49a.
21810 Adjust to newer Autotest.
21811
218122001-10-19 Pascal Bart <pascal.bart@epita.fr>
21813
21814 * src/conflicts.c: Move global variables rrc_total and src_total ...
21815 (print_conflicts): here.
21816 * src/output.c (output): Free global variable user_toknums.
21817 * src/lex.c (token_obstack): Become static.
21818
218192001-10-18 Akim Demaille <akim@epita.fr>
21820
21821 * tests/atlocal.in (GCC): Add.
21822 * tests/calc.at: s/m4_match/m4_bmatch/.
21823 s/m4_patsubst/m4_bpatsubst/.
21824 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
21825 * configure.in: AC_SUBST(GCC).
21826
218272001-10-14 Marc Autret <autret_m@epita.fr>
21828
21829 * src/options.c (create_long_option_table): Fix.
21830
218312001-10-10 Akim Demaille <akim@epita.fr>
21832
21833 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
21834
218352001-10-04 Akim Demaille <akim@epita.fr>
21836
21837 * src/reader.c (parse_union_decl): Push the caracters in
21838 union_obstack, not attrs_obstack.
21839
218402001-10-04 Akim Demaille <akim@epita.fr>
21841
21842 Merge in the branch 1.29.
21843
21844 * src/reader.c (packsymbols): Use a temporary obstack for
21845 `%%tokendef', since output_stack is already used elsewhere.
21846
21847 2001-10-02 Akim Demaille <akim@epita.fr>
21848
21849 Bump 1.29d.
21850
21851 2001-10-02 Akim Demaille <akim@epita.fr>
21852
21853 Version 1.29c.
21854
21855 2001-10-02 Akim Demaille <akim@epita.fr>
21856
21857 * tests/regression.at (Invalid CPP headers): New.
21858 From Alexander Belopolsky.
21859 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
21860
21861 2001-10-02 Akim Demaille <akim@epita.fr>
21862
21863 * tests/regression.at (Invalid input): New.
21864 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
21865 Reported by Shura.
21866
21867 2001-10-02 Akim Demaille <akim@epita.fr>
21868
21869 * tests/calc.at: Now that --debug works, the tests must be adjusted.
21870
21871 2001-10-02 Akim Demaille <akim@epita.fr>
21872
21873 * src/output.c (output_parser): Assert `skeleton'.
21874 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
21875 systems.
21876 From Shura.
21877
21878 2001-10-01 Marc Autret <autret_m@epita.fr>
21879
21880 * src/lex.h: Echo modifications.
21881 * src/lex.c (unlex): Parameter is now token_t.
21882 From Hans Aberg.
21883
21884 2001-10-01 Marc Autret <autret_m@epita.fr>
21885
21886 * src/main.c: Include lex.h.
21887 From Hans Aberg.
21888
21889 2001-09-29 Akim Demaille <akim@epita.fr>
21890
21891 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
21892
21893 2001-09-28 Akim Demaille <akim@epita.fr>
21894
21895 * tests/testsuite.at: Update to newer Autotest.
21896 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
21897
21898 2001-09-27 Akim Demaille <akim@epita.fr>
21899
21900 Position independent wrapper.
21901
21902 * tests/bison: Remove.
21903 * tests/bison.in: New.
21904 * configure.in: Adjust.
21905
21906 2001-09-27 Paul Eggert <eggert@twinsun.com>
21907
21908 Port quotearg fixes from tar 1.13.24.
21909
21910 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
21911 tm to be declared.
21912 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
21913 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
21914
21915 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
21916 * m4/mbrtowc.m4: New file.
21917 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
21918 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
21919
21920 2001-09-27 Akim Demaille <akim@epita.fr>
21921
21922 Bump to 1.29c.
21923
21924 2001-09-27 Akim Demaille <akim@epita.fr>
21925
21926 Version 1.29b.
21927
21928 2001-09-25 Akim Demaille <akim@epita.fr>
21929
21930 * src/system.h: Include `xalloc.h'.
21931 Remove it from the C files.
21932 * src/files.c (output_files): Free the obstacks.
21933 * src/lex.c (init_lex): Rename as...
21934 (lex_init): this.
21935 (lex_free): New.
21936 * src/main.c (main): Use it.
21937
21938 2001-09-24 Marc Autret <autret_m@epita.fr>
21939
21940 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
21941 to output informations in fout (FILE*).
21942 (open_graph, close_graph): Likewise.
21943 (output_graph, output_edge, output_node): Likewise.
21944 * src/vcg.h: Update function prototypes.
21945 * src/print_graph.c (print_graph): Open output graph file.
21946 (print_actions): Adjust.
21947 * src/files.h: Remove extern declaration.
21948 * src/files.c: Remove graph_obstack declaration.
21949 (open_files): Remove graph_obstack initialization.
21950 (output_files): Remove graph_obstack saving.
21951
21952 2001-09-24 Marc Autret <autret_m@epita.fr>
21953
21954 * src/files.c (compute_output_file_names): Fix.
21955
21956 2001-09-24 Marc Autret <autret_m@epita.fr>,
21957 Akim Demaille <akim@epita.fr>
21958
21959 * src/reader.c (reader): Remove call to free_symtab ().
21960 * src/main.c (main): Call it here.
21961 Include symtab.h.
21962 * src/conflicts.c (initialize_conflicts): Rename as...
21963 (solve_conflicts): this.
21964 * src/print.c (print_core, print_actions, print_state)
21965 (print_grammar): Dump to a file instead a `output_obstack'.
21966 (print_results): Dump `output_obstack', and then proceed with the
21967 FILE *.
21968 * src/files.c (compute_output_file_names, close_files): New.
21969 (output_files): Adjust.
21970 * src/main.c (main): Adjust.
21971
21972 2001-09-23 Marc Autret <autret_m@epita.fr>
21973
21974 * src/files.c (compute_header_macro): Computes header macro name
21975 from spec_defines_file when given.
21976
21977 2001-09-23 Marc Autret <autret_m@epita.fr>
21978
21979 * src/files.c (output_files): Add default extensions.
21980
21981 2001-09-22 Akim Demaille <akim@epita.fr>
21982
21983 * src/conflicts.c (finalize_conflicts): Rename as...
21984 (free_conflicts): this.
21985
21986 2001-09-22 Akim Demaille <akim@epita.fr>
21987
21988 * src/gram.c (gram_free): Rename back as...
21989 (dummy): this.
21990 (output_token_translations): Free `token_translations'.
21991 * src/symtab.c (free_symtab): Free the tag field.
21992
21993 2001-09-22 Akim Demaille <akim@epita.fr>
21994
21995 Remove `translations' as it is always set to true.
21996
21997 * src/gram.h: Adjust.
21998 * src/reader.c (packsymbols, parse_token_decl): Adjust
21999 * src/print.c (print_grammar): Adjust.
22000 * src/output.c (output_token_translations): Adjust.
22001 * src/lex.c (lex): Adjust.
22002 * src/gram.c: Be sure the set pointers to NULL.
22003 (dummy): Rename as...
22004 (gram_free): this.
22005
22006 2001-09-22 Akim Demaille <akim@epita.fr>
22007
22008 * configure.in: Invoke AM_LIB_DMALLOC.
22009 * src/system.h: Use dmalloc.
22010 * src/LR0.c: Be sure to have pointers initialized to NULL.
22011 (allocate_itemsets): Allocate kernel_items only if needed.
22012
22013 2001-09-22 Akim Demaille <akim@epita.fr>
22014
22015 * configure.in: Bump to 1.29b.
22016 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
22017 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
22018 need xmalloc.c in calc.y.
22019 From Pascal Bart.
22020
22021 2001-09-21 Akim Demaille <akim@epita.fr>
22022
22023 Version 1.29a.
22024 * Makefile.maint, config/config.guess, config/config.sub,
22025 * config/missing: Update from masters.
22026 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
22027 upon package.m4.
22028 * configure.in (ALL_LINGUAS): Add `tr'.
22029
22030 2001-09-21 Akim Demaille <akim@epita.fr>
22031
22032 * tests/Makefile.am (package.m4): Move to...
22033 ($(srcdir)/$(TESTSUITE)): here.
22034
22035 2001-09-20 Akim Demaille <akim@epita.fr>
22036
22037 * src/complain.c: No longer try to be standalone: use system.h.
22038 Don't assume __STDC__ is defined to 1. Just test if it is defined.
22039 * src/complain.h: Likewise.
22040 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
22041 Remove the unused variable `n'.
22042 From Albert Chin-A-Young.
22043
22044 2001-09-18 Marc Autret <autret_m@epita.fr>
22045
22046 * doc/bison.1: Update.
22047 * doc/bison.texinfo (Bison Options): Update --defines and --graph
22048 descriptions.
22049 (Option Cross Key): Update.
22050 Add --graph.
22051
22052 2001-09-18 Marc Autret <autret_m@epita.fr>
22053
22054 * tests/regression.at: New test (comment in %union).
22055
22056 2001-09-18 Marc Autret <autret_m@epita.fr>
22057
22058 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
22059 do that.
22060 Reported by Keith Browne.
22061
22062 2001-09-18 Marc Autret <autret_m@epita.fr>
22063
22064 * tests/output.at: Add tests for --defines and --graph.
22065
22066 2001-09-18 Marc Autret <autret_m@epita.fr>
22067
22068 * tests/output.at: Removes tests of %{header,src}_extension features.
22069
22070 2001-09-18 Akim Demaille <akim@epita.fr>
22071
22072 * tests/Makefile.am (package.m4): New.
22073 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
22074 (_AT_CHECK_CALC_ERROR): Likewise.
22075 Factor the `, ' part of verbose error messages.
22076
22077 2001-09-18 Marc Autret <autret_m@epita.fr>
22078
22079 * src/getargs.c (longopts): Declare --defines and --graph as options
22080 with optional arguments.
22081 * src/files.h: Add extern declarations.
22082 * src/files.c (spec_graph_file, spec_defines_file): New.
22083 (output_files): Update.
22084 Remove CPP-outed code.
22085
22086 2001-09-18 Marc Autret <autret_m@epita.fr>
22087
22088 Turn off %{source,header}_extension feature.
22089
22090 * src/files.c (compute_exts_from_gf): Update.
22091 (compute_exts_from_src): Update.
22092 (output_files): CPP-out useless code.
22093 * src/files.h: Remove {header,source}_extension extern declarations.
22094 * src/reader.c (parse_dquoted_param): CPP-out.
22095 (parse_header_extension_decl): Remove.
22096 (parse_source_extension_decl): Remove.
22097 (read_declarations): Remove cases tok_{hdrext,srcext}.
22098 * src/lex.c (percent_table): Remove {header,source}_extension entries.
22099 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
22100
22101 2001-09-10 Akim Demaille <akim@epita.fr>
22102
22103 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
22104 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
22105 (AT_CHECK_OUTPUT): this.
22106 Merely check ls' exit status, its output is useless.
22107
22108 2001-09-10 Akim Demaille <akim@epita.fr>
22109
22110 * tests/calc.at: Use m4_match.
22111 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
22112
22113 2001-09-10 Marc Autret <autret_m@epita.fr>,
22114 Akim Demaille <akim@epita.fr>
22115
22116 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
22117 enum color_e.
22118 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
22119 to `normal'.
22120 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
22121 * src/lex.h: Adjust prototype.
22122 (token_t): Add `tok_undef'.
22123 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
22124 (parse_percent_token): Now returns token_t.
22125 Add default statement in switch.
22126 (lex): Separate `c' as an input variable, from the token_t result
22127 part.
22128 (unlexed): Is a token_t.
22129
22130 2001-09-10 Akim Demaille <akim@epita.fr>
22131
22132 * configure.in: Bump to 1.29a.
22133
22134 2001-09-07 Akim Demaille <akim@epita.fr>
22135
22136 Version 1.29.
22137
22138 2001-08-30 Akim Demaille <akim@epita.fr>
22139
22140 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
22141 * m4/atconfig.m4: Remove.
22142 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
22143 * tests/bison: New.
22144 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
22145 m4_if, m4_patsubst, and m4_regexp.
22146 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
22147 `input' file instead of echo.
22148
22149 2001-08-29 Akim Demaille <akim@epita.fr>
22150
22151 Bump to 1.28e.
22152
22153 2001-08-29 Akim Demaille <akim@epita.fr>
22154
22155 Version 1.28d.
22156
22157 2001-08-29 Paul Eggert <eggert@twinsun.com>
22158
22159 * src/bison.simple (yyparse): Don't take the address of an
22160 item before the start of an array, as that doesn't conform to
22161 the C Standard.
22162
22163 2001-08-29 Robert Anisko <anisko_r@epita.fr>
22164
22165 * doc/bison.texinfo (Location Tracking Calc): New node.
22166
22167 2001-08-29 Paul Eggert <eggert@twinsun.com>
22168
22169 * src/output.c (output): Do not define const, as this now
22170 causes more problems than it cures.
22171
22172 2001-08-29 Akim Demaille <akim@epita.fr>
22173
22174 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
22175 the nodes.
22176 Be sure to tag the `detailmenu'.
22177
22178 2001-08-29 Akim Demaille <akim@epita.fr>
22179
22180 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
22181 download in a tmp dir.
22182
22183 2001-08-28 Marc Autret <autret_m@epita.fr>
22184
22185 * config/depcomp: New file.
22186
22187 2001-08-28 Marc Autret <autret_m@epita.fr>
22188
22189 * doc/bison.1 (mandoc): Adjust.
22190 From Juan Manuel Guerrero.
22191
22192 2001-08-28 Marc Autret <autret_m@epita.fr>
22193
22194 * src/print_graph.c (print_state): Fix.
22195
22196 2001-08-27 Marc Autret <autret_m@epita.fr>
22197
22198 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
22199 char * members.
22200 Echo modifications to the functions prototypes.
22201 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
22202
22203 2001-08-27 Marc Autret <autret_m@epita.fr>
22204
22205 * src/vcg.c: Include `xalloc.h'.
22206 (add_colorentry): New.
22207 (add_classname): New.
22208 (add_infoname): New.
22209 * src/vcg.h: Add new prototypes.
22210
22211 2001-08-27 Akim Demaille <akim@epita.fr>
22212
22213 * Makefile.maint: Sync. again with CVS Autoconf.
22214
22215 2001-08-27 Akim Demaille <akim@epita.fr>
22216
22217 * Makefile.maint: Formatting changes.
22218 (po-update, cvs-update, update): New targets.
22219 (AMTAR): Remove.
22220
22221 2001-08-27 Akim Demaille <akim@epita.fr>
22222
22223 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
22224 * Makefile.maint: Sync. with CVS Autoconf.
22225
22226 2001-08-27 Marc Autret <autret_m@epita.fr>
22227
22228 * src/vcg.h (struct infoname_s): New.
22229 (struct colorentry_s): New.
22230 (graph_s): New fields {vertical,horizontal}_order in structure.
22231 Add `infoname' field.
22232 Add `colorentry' field;
22233 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
22234 (G_HORIZONTAL_ORDER): New.
22235 (G_INFONAME): New.
22236 (G_COLORENTRY): New.
22237 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
22238 Add output of `infoname'.
22239 Add output of `colorentry'.
22240
22241 2001-08-27 Marc Autret <autret_m@epita.fr>
22242
22243 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
22244 This one shadowed a global parameter.
22245
22246 2001-08-24 Marc Autret <autret_m@epita.fr>
22247
22248 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
22249 instead of `unsigned'.
22250 (print_state): Do not call obstack_object_size () in obstack_grow ()
22251 to avoid macro variables shadowing.
22252
22253 2001-08-23 Marc Autret <autret_m@epita.fr>
22254
22255 * src/lex.c (percent_table): Typo: s/naem/name/.
22256 Add graph option.
22257 Normalize new options declarations.
22258
22259 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
22260
22261 * tests/suite.at: Exercise %header_extension and %source_extension.
22262
22263 2001-08-16 Marc Autret <autret_m@epita.fr>
22264
22265 * src/reader.c (parse_dquoted_param): New.
22266 (parse_header_extension_decl): Use it.
22267 (parse_source_extension_decl): Likewise.
22268
22269 2001-08-16 Marc Autret <autret_m@epita.fr>
22270
22271 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
22272 (get_xxxx_str): Use assert () instead of complain ().
22273 Remove return invokations in default cases.
22274 (get_decision_str): Modify default behaviour. Remove second argument.
22275 Echo modifications on calls.
22276 (output_graph): Fix.
22277
22278 2001-08-16 Marc Autret <autret_m@epita.fr>
22279
22280 * src/getargs.c (usage): Update with ``-g, --graph''.
22281
22282 2001-08-16 Marc Autret <autret_m@epita.fr>
22283
22284 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
22285 (Option Cross Key): Likewise.
22286 * doc/bison.1: Update.
22287
222882001-09-25 Pascal Bart <pascal.bart@epita.fr>
22289
22290 * src/output.c (output_master_parser): Don't finish action_obstack.
22291 (output_parser): Don't care about the muscle action, here.
22292 (prepare): Copy the action_obstack in the action muscle.
22293 (output): Free action_obstack.
22294
222952001-09-23 Pascal Bart <pascal.bart@epita.fr>
22296
22297 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
22298 will contain `%union' declaration.
22299 (parse_union_decl): Delete #line directive output.
22300 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
22301 informations about %union.
22302 (parse_union_decl): Copy the union_obstack in the muscle stype.
22303 * src/bison.simple: Add new #line directive.
22304 Add typdef %%stype YYSTYPE.
22305
223062001-09-23 Pascal Bart <pascal.bart@epita.fr>
22307
22308 * src/bison.simple: Add new `#line' directive.
22309
223102001-09-22 Pascal Bart <pascal.bart@epita.fr>
22311
22312 * src/bison.simple: New `#line' directive.
22313 * src/output.c (output_parser): Support new dynamic muscle input_line.
22314
223152001-09-22 Marc Autret <autret_m@epita.fr>
22316
22317 * src/output.c (output_master_parser): New.
22318 (output_parser): Be more re-entrant.
22319
223202001-09-21 Marc Autret <autret_m@epita.fr>
22321
22322 * src/reader.c (copy_definition, parse_union_decl): Update and use
22323 `linef' muscle.
22324 (copy_action): Likewise.
22325 Use obstack_1grow ().
22326 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
22327
223282001-09-21 Marc Autret <autret_m@epita.fr>
22329
22330 * src/options.c (option_table): Adjust.
22331 * src/lex.c (parse_percent_token): Fix.
22332
223332001-09-20 Pascal Bart <pascal.bart@epita.fr>
22334
22335 * src/options.c (symtab.h): Include it, need by lex.h.
22336
223372001-09-20 Pascal Bart <pascal.bart@epita.fr>
22338
22339 * src/lex.c (parse_percent_token): Change type of variable `tx', which
22340 is now an option_table_struct*.
22341 (option_strcmp): New function option_strcmp.
22342 (parse_percent_token): Call option_strcmp.
22343 * src/getargs.c (xalloc.h, options.h): Include it.
22344 (getargs): Call create_long_option_table.
22345 (getargs): Free longopts at the end of the function.
22346 (shortopts): Move in options.c.
22347 * src/options.c (create_long_option_table): New function. Convert
22348 information from option_table to option structure.
22349 * src/reader.c (options.h): Include it.
22350
22351 * src/Makefile.am: Adjust.
22352 * src/options.c (option_table): Create from longopts and percent_table.
22353 * src/getargs.c (longopts): Delete.
22354 * src/lex.c (struct percent_table_struct): Delete.
22355 (percent_table): Delete.
22356 (options.h): Include it.
22357 * src/options.c: Create.
22358 * src/options.h: Create.
22359 Declare enum opt_access_e.
22360 Define struct option_table_struct.
22361
223622001-09-20 Marc Autret <autret_m@epita.fr>
22363
22364 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
22365 sections of Bison.
22366
223672001-09-19 Pascal Bart <pascal.bart@epita.fr>
22368
22369 * src/bison.simple: s/%%filename/%%skeleton.
22370 * src/muscle_tab.c (getargs.h): Include it.
22371 (muscle_init): Insert new muscle skeleton.
22372
223732001-09-18 Pascal Bart <pascal.bart@epita.fr>
22374
22375 * src/output.c (output_parser): Delete unused variable actions_dumped.
22376
223772001-09-07 Pascal Bart <pascal.bart@epita.fr>
22378
22379 * src/output.c (output): Delete call to reader_output_yylsp.
22380 * src/reader.c (reader): Likewise.
22381 * src/reader.h: Delete declaration of reader_output_yylsp.
22382
223832001-09-02 Marc Autret <autret_m@epita.fr>
22384
22385 * src/reader.c: Include muscle_tab.h.
22386 (parse_union_decl): Update.
22387 (parse_macro_decl): Rename parse_muscle_decl.
22388 Update to use renamed functions and variable.
22389 (read_declarations, copy_action, read_additionnal_code, : Updated
22390 with correct variables and functions names.
22391 (packsymbols, reader): Likewise.
22392
22393 * src/reader.h (muscle_obstack): Extern declaration update.
22394
22395 * src/output.c: Include muscle_tab.h
22396 In all functions using macro_insert, change by using muscle_insert ().
22397 (macro_obstack): Rename muscle_obstack.
22398 Echo modifications in the whole file.
22399 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
22400 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
22401 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
22402
22403 * src/muscle_tab.h: Update double inclusion macros.
22404 (macro_entry_s): Rename muscle_entry_s.
22405 Update prototypes.
22406
22407 * src/muscle_tab.c: Include muscle_tab.h.
22408 Rename macro_tabble to muscle_table.
22409 (mhash1, mhash2, mcmp): Use muscle_entry.
22410 (macro_init): Rename muscle_init. Update.
22411 (macro_insert): Rename muscle_insert. Update.
22412 (macro_find): Rename muscle_find. Update.
22413
22414 * src/main.c: Include muscle_tab.h.
22415 (main): Call muscle_init ().
22416 * src/Makefile.am (bison_SOURCES): Echo modifications.
22417
224182001-09-02 Marc Autret <autret_m@epita.fr>
22419
22420 Now the files macro_tab.[ch] are named muscle_tab.[ch].
22421
22422 * src/muscle_tab.c, src/muscle_tab.h: Add files.
22423
224242001-09-02 Marc Autret <autret_m@epita.fr>
22425
22426 * src/macrotab.c, src/macrotab.h: Remove.
22427
224282001-09-01 Pascal Bart <pascal.bart@epita.fr>
22429
22430 * src/reader.c (copy_guard): Use muscle to specify the `#line'
22431 filename.
22432
224332001-09-01 Marc Autret <autret_m@epita.fr>
22434
22435 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
22436 to an explicit value to activate the feature. We do it here.
22437
224382001-08-31 Pascal Bart <pascal.bart@epita.fr>
22439
22440 * src/output.c (prepare): Delete the `filename' muscule insertion.
22441 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
22442 (parse_union_decl): Likewise.
22443 * src/macrotab.c (macro_init): Initialize filename by infile.
22444
224452001-08-31 Marc Autret <autret_m@epita.fr>
22446
22447 * src/bison.simple (YYLSP_NEEDED): New definition.
22448 * src/output.c (prepare): Add macro insertion of `locations_flag'
22449
224502001-08-31 Pascal Bart <pascal.bart@epita.fr>
22451
22452 * src/output.c (prepare): Delete insertion of previous muscles,
22453 and insert the `prefix' muscles.
22454 * src/macrotab.c (macro_init): Likewise.
22455 (macro_init): Initialization prefix directive by `yy'.
22456 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
22457 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
22458 yylval, yydebug, yyerror, yynerrs and yyparse.
22459 New directive `#define' to substitute yydebug, ... with option
22460 name_prefix.
22461
224622001-08-31 Pascal Bart <pascal.bart@epita.fr>
22463
22464 * src/main.c (main): Standardize.
22465 * src/output.c (output_table_data, output_parser): Likewise.
22466 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
22467
224682001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
22469
22470 * src/reader.c (read_additionnal_code): Rename %%user_code to
22471 %%epilogue.
22472 * src/output.c (output): Rename %%declarations to %%prologue.
22473 * src/bison.simple: Echo modifications.
22474
224752001-08-31 Marc Autret <autret_m@epita.fr>
22476
22477 * src/reader.c (readgram): CleanUp.
22478 (output_token_defines): Likewise.
22479 (packsymbols): Likewise.
22480 (reader): Likewise.
22481 * src/output.c (output): CPP-out useless code.
22482
224832001-08-31 Pascal Bart <pascal.bart@epita.fr>
22484
22485 * src/reader.c (reader): Delete obsolete call to function
22486 output_trailers and output_headers.
22487 * src/output.h: Remove obsolete functions prototypes of output_headers
22488 and output_trailers.
22489
224902001-08-30 Pascal Bart <pascal.bart@epita.fr>
22491
22492 * src/main.c: Include macrotab.h.
22493 * src/macrotab.h (macro_entry_s): Constify fields.
22494 Adjust functions prototypes.
22495 * src/macrotab.c (macro_insert): Constify key and value.
22496 (macro_find): Constify key.
22497 (macro_insert): Include 'xalloc.h'
22498 (macro_insert): Use XMALLOC.
22499 (macro_find): Constify return value.
22500 * src/output.c (output_table_data): Rename table to table_data.
22501 (output_parser): Constify macro_key, macro_value.
22502
225032001-08-30 Marc Autret <autret_m@epita.fr>
22504
22505 * src/reader.c (parse_skel_decl): New.
22506 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
22507 * src/lex.h (token_t): New token `tok_skel'.
22508 * src/lex.c (percent_table): Add skeleton option entry.
22509 Standardize.
22510
225112001-08-29 Marc Autret <autret_m@epita.fr>
22512
22513 * src/bison.simple: Add %%user_code directive at the end.
22514 * src/reader.c (read_additionnal_code): New.
22515 (reader): Use it.
22516 * src/output.c (output_program): Remove.
22517 (output): Update.
22518
225192001-08-28 Marc Autret <autret_m@epita.fr>
22520
22521 * src/output.c (output_actions): Clean up.
22522 (output_gram): CPP-out useless code.
22523 * src/reader.c (reader): Clean up, CPP-out useless code.
22524
225252001-08-28 Pascal Bart <pascal.bart@epita.fr>
22526
22527 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
22528 directive.
22529 * src/bison.simple: Add `%%definitions'.
22530
225312001-08-28 Marc Autret <autret_m@epita.fr>
22532
22533 * config/depcomp: New file.
22534
225352001-08-27 Paul Eggert <eggert@twinsun.com>
22536
22537 * src/bison.simple (yyparse): Don't take the address of an
22538 item before the start of an array, as that doesn't conform to
22539 the C Standard.
22540
225412001-08-27 Robert Anisko <robert.anisko@epita.fr>
22542
22543 * src/output.c (output): Remove the initialization of the macro
22544 obstack. It was done too late here.
22545
22546 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
22547 completely wrong.
22548 (reader): Initialize the macro obstack here, since we need it to grow
22549 '%define' directives.
22550
22551 * src/reader.h: Declare the macro obstack as extern.
22552
225532001-08-27 Robert Anisko <robert.anisko@epita.fr>
22554
22555 * src/output.c (output_parser): Fix. Store single '%' characters in
22556 the output obstack instead of throwing them away.
22557
225582001-08-27 Akim Demaille <akim@epita.fr>
22559
22560 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
22561
225622001-08-25 Robert Anisko <robert.anisko@epita.fr>
22563
22564 * lib/Makefile.am: Adjust.
22565
225662001-08-25 Robert Anisko <robert.anisko@epita.fr>
22567
22568 * src/bison.simple: Update and add '%%' directives.
22569
225702001-08-25 Robert Anisko <robert.anisko@epita.fr>
22571
22572 * src/reader.c (reader): Remove calls to 'output_headers' and
22573 'output_trailers'. Remove some C output.
22574 (readgram): Disable a piece of code that was writing a default
22575 definition for 'YYSTYPE'.
22576 (reader_output_yylsp): Remove.
22577 (packsymbols): Output token defintions to a macro.
22578 (copy_definition): Disable C output.
22579
22580 * src/reader.c (parse_macro_decl): New function used to parse macro
22581 declarations.
22582 (copy_string2): Put the body of copy_string into this new function.
22583 Add a parameter to let the caller choose whether he wants to copy the
22584 string delimiters or not.
22585 (copy_string): Be a simple call to copy_string2 with the last argument
22586 bound to true.
22587 (read_declarations): Add case for macro definition.
22588 (copy_identifier): New.
22589 (parse_macro_decl): Read macro identifiers using copy_identifier
22590 rather than lex.
22591
225922001-08-25 Robert Anisko <robert.anisko@epita.fr>
22593
22594 * src/output.c (prepare): Add prefixed names.
22595 (output_parser): Output semantic actions.
22596 (output_parser): Fix bug on '%%line' directives.
22597
22598 * src/output.c (output_headers): Remove. The C code printed by this
22599 function should now be in the skeletons.
22600 (output_trailers): Remove.
22601 (output): Disable call to 'reader_output_yylsp'.
22602 (output_rule_data): Do not output tables to the table obstack.
22603
22604 * src/output.c: Remove some C dedicated output.
22605 Improve the use of macro and output obstacks.
22606 (output_defines): Remove.
22607
22608 * src/output.c (output_token_translations): Associate 'translate'
22609 table with a macro. No output to the table obstack.
22610 (output_gram): Same for 'rhs' and 'prhs'.
22611 (output_stos): Same for 'stos'.
22612 (output_rule_data): Same for 'r1' and 'r2'.
22613 (token_actions): Same for 'defact'.
22614 (goto_actions): Same for 'defgoto'.
22615 (output_base): Same for 'pact' and 'pgoto'.
22616 (output_table): Same for 'table'.
22617 (output_check): Same for 'check'.
22618
22619 * src/output.c (output_table_data): New function.
22620 (output_short_table): Remove.
22621 (output_short_or_char_table): Remove.
22622
22623 * src/output.c (output_parser): Replace most of the skeleton copy code
22624 with something new. Skeletons are now processed character by character
22625 rather than line by line, and Bison looks for '%%' macros. This is the
22626 first step in making Bison's output process (a lot) more flexible.
22627 (output_parser): Use the macro table.
22628
226292001-08-25 Robert Anisko <robert.anisko@epita.fr>
22630
22631 * src/main.c (main): Initialize the macro table.
22632
226332001-08-25 Robert Anisko <robert.anisko@epita.fr>
22634
22635 * src/lex.c (percent_table): Add tok_define.
22636 * src/lex.h: Add tok_define.
22637
226382001-08-25 Robert Anisko <robert.anisko@epita.fr>
22639
22640 * src/macrotab.c: New file.
22641 * src/macrotab.h: New file.
22642 * src/Makefile.am: Update.
22643
226442001-08-25 Robert Anisko <robert.anisko@epita.fr>
22645
22646 * lib/hash.c: New file.
22647 * lib/hash.h: New file.
22648 * lib/Makefile.am: Update.
22649
226502001-08-15 Akim Demaille <akim@epita.fr>
22651
22652 Version 1.28c.
22653
226542001-08-15 Marc Autret <autret_m@epita.fr>
22655
22656 * src/reader.c (readgram): Indent output macro YYSTYPE.
22657 (packsymbols): Likewise.
22658 (output_token_defines): Likewise.
22659 * src/files.c: Standardize.
22660 (compute_header_macro): New.
22661 (defines_obstack_save): New. Use compute_header_macro.
22662 (output_files): Update. Use defines_obstack_save.
22663
226642001-08-15 Akim Demaille <akim@epita.fr>
22665
22666 * doc/bison.texinfo (Table of Symbols): Document
22667 YYSTACK_USE_ALLOCA.
22668
226692001-08-15 Akim Demaille <akim@epita.fr>
22670
22671 * missing: Update from CVS Automake.
22672 * config/config.guess, config/config.sub, config/texinfo.tex:
22673 Update from gnu.org.
22674
226752001-08-15 Akim Demaille <akim@epita.fr>
22676
22677 * Makefile.maint: Sync with CVS Autoconf.
22678
226792001-08-14 Pascal Bart <pascal.bart@epita.fr>
22680
22681 * doc/bison.texinfo: Include GNU Free Documentation License from
22682 `fdl.texi'.
22683 * doc/fdl.texi: Add to package.
22684
226852001-08-14 Marc Autret <autret_m@epita.fr>
22686
22687 Turn on %{source,header}_extension features.
22688
22689 * src/lex.c (percent_table): Un-CPP out header_extension and
22690 source_extension.
22691 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
22692 (compute_exts_from_src): Remove conditions. It restores priorities
22693 between options.
22694
226952001-08-14 Marc Autret <autret_m@epita.fr>
22696
22697 * src/files.c (compute_base_names): Add extensions computing when
22698 `--file-prefix' used.
22699 Standardize function calls.
22700
227012001-08-13 Marc Autret <autret_m@epita.fr>
22702
22703 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
22704 defining it (defined but null disables alloca).
22705
227062001-08-13 Marc Autret <autret_m@epita.fr>
22707
22708 * src/bison.simple (_yy_memcpy): CPP reformat.
22709
227102001-08-13 Pascal Bart <pascal.bart@epita.fr>
22711
22712 * tests/atconfig.in (CPPFLAGS): Fix.
22713
227142001-08-10 Pascal Bart <pascal.bart@epita.fr>
22715
22716 * doc/bison.texinfo: Include GNU General Public License from
22717 `gpl.texi'.
22718 * doc/gpl.texi: Add to package.
22719
227202001-08-10 Marc Autret <autret_m@epita.fr>
22721
22722 * src/print_graph.h: Fix.
22723 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
22724
227252001-08-10 Akim Demaille <akim@epita.fr>
22726
22727 * src/system.h: Provide default declarations for stpcpy, strndup,
22728 and strnlen.
22729
227302001-08-10 Robert Anisko <anisko_r@epita.fr>
22731
22732 * doc/bison.texinfo (Locations): Update @$ stuff.
22733
227342001-08-09 Robert Anisko <anisko_r@epita.fr>
22735
22736 * src/bison.simple (YYLLOC_DEFAULT): Update.
22737 (yyparse): Adjust.
22738
227392001-08-08 Marc Autret <autret_m@epita.fr>
22740
22741 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
22742 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
22743 Reported by Fabrice Bauzac.
22744
227452001-08-08 Marc Autret <autret_m@epita.fr>
22746
22747 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
22748 * src/vcg.c (output_node): Fix.
22749 * src/vcg.h: Cleanup.
22750 * src/print_graph.c: Add comments.
22751 (node_output_size): New global variable. Simplify the formatting of
22752 the VCG graph output.
22753 (print_actions): Unused code is now used. It notifies the final state
22754 and no action states in the VCG graph. It also give the reduce actions.
22755 The `shift and goto' edges are red and the `go to state' edges are
22756 blue.
22757 Get the current node name and node_obstack by argument.
22758 (node_obstack): New variable.
22759 (print_state): Manage node_obstack.
22760 (print_core): Use node_obstack given by argument.
22761 A node is not only computed here but in print_actions also.
22762 (print_graph): CPP out useless code instead of commenting it.
22763
227642001-08-07 Pascal Bart <pascal.bart@epita.fr>
22765
22766 * tests/atconfig.in (CPPFLAGS): Fix.
22767
227682001-08-07 Akim Demaille <akim@epita.fr>
22769
22770 * src/print_graph.c (quote): New.
22771 (print_core): Use it.
22772
227732001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
22774
22775 * src/vcg.c (complain.h): Include it.
22776 Unepitaize `return' invocations.
22777 [NDEBUG] (main): Remove.
22778 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
22779 * src/files.c (open_files): Initialize graph_obstack.
22780 * src/print_graph.c (print_actions): CPP out useless code.
22781 (print_core): Don't output the last `\n' in labels.
22782 Use `quote'.
22783 * src/files.c (output_files): Output the VCG file.
22784 * src/main.c (main): Invoke print_graph ();
22785
227862001-08-06 Marc Autret <autret_m@epita.fr>
22787
22788 Automaton VCG graph output.
22789 Using option ``-g'' or long option ``--graph'', you can generate
22790 a gram_filename.vcg file containing a VCG description of the LALR (1)
22791 automaton of your grammar.
22792
22793 * src/main.c: Call to print_graph() function.
22794 * src/getargs.h: Update.
22795 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
22796 (graph_flag): New flag.
22797 (longopts): Update.
22798 (getargs): Add case `g'.
22799 * src/files.c (graph_obstack): New obstack struct.
22800 (open_files): Initialize new obstack.
22801 (output_files): Saves graph_obstack if required.
22802 * src/files.h (graph_obstack): New extern declaration.
22803 * src/Makefile.am: Add new source files.
22804
228052001-08-06 Marc Autret <autret_m@epita.fr>
22806
22807 * src/print_graph.c, src/print_graph.h (graph): New.
22808 * src/vcg.h: New file.
22809 * src/vcg.c: New file, VCG graph handling.
22810
228112001-08-06 Marc Autret <autret_m@epita.fr>
22812
22813 Add of %source_extension and %header_extension which specify
22814 the source or/and the header output file extension.
22815
22816 * src/files.c (compute_base_names): Remove initialisation of
22817 src_extension and header_extension.
22818 (compute_exts_from_gf): Update.
22819 (compute_exts_from_src): Update.
22820 (output_files): Update.
22821 * src/reader.c (parse_header_extension_decl): New.
22822 (parse_source_extension_decl): New.
22823 (read_declarations): New case statements for the new tokens.
22824 * src/lex.c (percent_table): Add entries for %source_extension
22825 and %header_extension.
22826 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
22827
228282001-08-06 Marc Autret <autret_m@epita.fr>
22829
22830 * configure.in: Bump to 1.28c.
22831 * doc/bison.texinfo: Texinfo thingies.
22832
228332001-08-04 Pascal Bart <pascal.bart@epita.fr>
22834
22835 * tests/atconfig.in (CPPFLAGS): Add.
22836 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
22837
228382001-08-03 Akim Demaille <akim@epita.fr>
22839
22840 Version 1.28b.
22841
228422001-08-03 Akim Demaille <akim@epita.fr>
22843
22844 * tests/Makefile.am (check-local): Ship testsuite.
22845 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
22846 Include `string.h'.
22847
228482001-08-03 Akim Demaille <akim@epita.fr>
22849
22850 * configure.in: Try using -Wformat when compiling.
22851
228522001-08-03 Akim Demaille <akim@epita.fr>
22853
22854 * configure.in: Bump to 1.28b.
22855
228562001-08-03 Akim Demaille <akim@epita.fr>
22857
22858 * src/complain.c: Adjust strerror_r portability issues.
22859
228602001-08-03 Akim Demaille <akim@epita.fr>
22861
22862 Version 1.28a.
22863
228642001-08-03 Akim Demaille <akim@epita.fr>
22865
22866 * src/getargs.c, src/getarg.h (skeleton)): Constify.
22867 * src/lex.c (literalchar): Avoid name clashes on `buf'.
22868 * src/getargs.c: Include complain.h.
22869 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
22870 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
22871
228722001-08-03 Akim Demaille <akim@epita.fr>
22873
22874 * src/reader.c (readgram): Display hidden chars in error messages.
22875
228762001-08-03 Akim Demaille <akim@epita.fr>
22877
22878 Update to gettext 0.10.39.
22879
228802001-08-03 Akim Demaille <akim@epita.fr>
22881
22882 * lib/strspn.c: New.
22883
228842001-08-01 Marc Autret <autret_m@epita.fr>
22885
22886 * doc/bison.texinfo: Update.
22887 * doc/bison.1 (mandoc): Update.
22888 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
22889 * src/files.c: Support output files extensions computing.
22890 (src_extension): New static variable.
22891 (header_extension): New static variable.
22892 (tr): New function.
22893 (get_extension_index): New function, gets the index of an extension
22894 filename in a string.
22895 (compute_exts_from_gf): New function, computes extensions from the
22896 grammar file extension.
22897 (compute_exts_from_src): New functions, computes extensions from the
22898 C source file extension, file given by ``-o'' option.
22899 (compute_base_names): Update.
22900 (output_files): Update.
22901
229022001-08-01 Robert Anisko <anisko_r@epita.fr>
22903
22904 * doc/bison.texi: Document @$.
22905 (Locations): New section.
22906
229072001-07-18 Akim Demaille <akim@epita.fr>
22908
22909 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
22910 * config/prev-version.txt, config/move-if-change: New.
22911 * Makefile.am: Adjust.
22912
229132001-07-08 Pascal Bart <pascal.bart@epita.fr>
22914
22915 * src/bison.simple (yyparse): Suppress warning `comparaison
22916 between signed and unsigned'.
22917
229182001-07-05 Pascal Bart <pascal.bart@epita.fr>
22919
22920 * src/getargs.h (raw_flag): Remove.
22921 * src/getargs.c: Die on `-r'/`--raw'.
22922 * src/lex.c (parse_percent_token): Die on `%raw'.
22923 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
22924 * tests/calc.at: Suppress test with option `--raw'.
22925
229262001-07-14 Akim Demaille <akim@epita.fr>
22927
22928 * config/: New.
22929 * configure.in: Require Autoconf 2.50.
22930 Update to gettext 0.10.38.
22931
229322001-03-16 Akim Demaille <akim@epita.fr>
22933
22934 * doc/bison.texinfo: ANSIfy the examples.
22935
229362001-03-16 Akim Demaille <akim@epita.fr>
22937
22938 * getargs.c (skeleton): New variable.
22939 (longopts): --skeleton is a new option.
22940 (shortopts, getargs): -S is a new option.
22941 * getargs.h: Declare skeleton.
22942 * output.c (output_parser): Use it.
22943
229442001-03-16 Akim Demaille <akim@epita.fr>
22945
22946 * m4/strerror_r.m4: New.
22947 * m4/error.m4: Run AC_FUNC_STRERROR_R.
22948 * lib/error.h, lib/error.c: Update.
22949
229502001-03-16 Akim Demaille <akim@epita.fr>
22951
22952 * src/getargs.c (longopts): Clean up.
22953
229542001-02-21 Akim Demaille <akim@epita.fr>
22955
22956 * src/reader.c (gensym): `gensym_count' is your own.
22957 Use a static buf to create the symbol name, as token_buffer is no
22958 longer a buffer.
22959
229602001-02-08 Akim Demaille <akim@epita.fr>
22961
22962 * src/conflicts.c (conflict_report): Be sure not to append to res
22963 between two calls, which could happen if both first sprintf were
22964 skipped, but not the first cp += strlen.
22965
229662001-02-08 Akim Demaille <akim@epita.fr>
22967
22968 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
22969 New, from fileutils 4.0.37.
22970 * configure.in: Require Autoconf 2.49c. I took some time before
22971 making this decision. This is the only way out for portability
22972 issues in Bison, it would mean way too much duplicate effort to
22973 import in Bison features implemented in 2.49c since 2.13.
22974 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
22975
229762001-02-02 Akim Demaille <akim@epita.fr>
22977
22978 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
22979 * lib/xalloc.h, lib/xmalloc.c: Update.
22980
229812001-01-19 Akim Demaille <akim@epita.fr>
22982
22983 Get rid of the ad hoc handling of token_buffer in the scanner: use
22984 the obstacks.
22985
22986 * src/lex.c (token_obstack): New.
22987 (init_lex): Initialize it. No longer call...
22988 (grow_token_buffer): this. Remove it.
22989 Adjust all the places which used it to use the obstack.
22990
229912001-01-19 Akim Demaille <akim@epita.fr>
22992
22993 * src/lex.h: Rename all the tokens:
22994 s/\bENDFILE\b/tok_eof/g;
22995 s/\bIDENTIFIER\b/tok_identifier/g;
22996 etc.
22997 Let them be enums, not #define, to ease debugging.
22998 Adjust all the code.
22999
230002001-01-18 Akim Demaille <akim@epita.fr>
23001
23002 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
23003 * src/lex.c (maxtoken, grow_token_buffer): Static.
23004
230052001-01-18 Akim Demaille <akim@epita.fr>
23006
23007 Since we now use obstacks, more % directives can be enabled.
23008
23009 * src/lex.c (percent_table): Also accept `%yacc',
23010 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
23011 `%debug'.
23012 Handle the actions for `%semantic_parser' and `%pure_parser' here,
23013 instead of returning a token.
23014 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
23015 * src/reader.c (read_declarations): Adjust.
23016 * src/files.c (open_files): Don't call `compute_base_names', don't
23017 compute `attrsfile' since they depend upon data which might be
23018 *in* the input file now.
23019 (output_files): Do it here.
23020 * src/output.c (output_headers): Document the fact that this patch
23021 introduces a guaranteed SEGV for semantic parsers.
23022 * doc/bison.texinfo: Document them.
23023 * tests/suite.at: Exercise these %options.
23024
230252000-12-20 Akim Demaille <akim@epita.fr>
23026
23027 Also handle the output file (--verbose) with obstacks.
23028
23029 * files.c (foutput): Remove.
23030 (output_obstack): New.
23031 Adjust all dependencies.
23032 * src/conflicts.c: Return a string.
23033 * src/system.h (obstack_grow_string): Rename as...
23034 (obstack_sgrow): this. Be ready to work with non literals.
23035 (obstack_fgrow4): New.
23036
230372000-12-20 Akim Demaille <akim@epita.fr>
23038
23039 * src/files.c (open_files): Fix the computation of short_base_name
23040 in the case of `-o foo.tab.c'.
23041
230422000-12-20 Akim Demaille <akim@epita.fr>
23043
23044 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
23045 (copy_dollar): Now that everything uses obstacks, get rid of the
23046 FILE * parameters.
23047
230482000-12-20 Akim Demaille <akim@epita.fr>
23049
23050 * src/files.c (open_files): Actually the `.output' file is based
23051 on the short_base_name, not base_name.
23052 * tests/suite.at (Checking output file names): Adjust.
23053
230542000-12-20 Akim Demaille <akim@epita.fr>
23055
23056 * src/bison.s1: Remove, we now use directly...
23057 * src/bison.simple: this.
23058 * src/Makefile.am: Use pkgdata instead of data.
23059
230602000-12-20 Akim Demaille <akim@epita.fr>
23061
23062 * src/files.c (guard_obstack): New.
23063 (open_files): Initialize it.
23064 (output_files): Dump it...
23065 * src/files.h: Export it.
23066 * src/reader.c (copy_guard): Use it.
23067
230682000-12-19 Akim Demaille <akim@epita.fr>
23069
23070 * src/files.c (outfile, defsfile, actfile): Removed as global
23071 vars.
23072 (open_files): Don't compute them.
23073 (output_files): Adjust.
23074 (base_name, short_base_name): Be global.
23075 Adjust dependencies.
23076
230772000-12-19 Akim Demaille <akim@epita.fr>
23078
23079 * src/files.c (strsuffix): New.
23080 (stringappend): Be just like strcat but allocate.
23081 (base_names): Eve out from open_files.
23082 Try to simplify the rather hairy computation of base_name and
23083 short_base_name.
23084 (open_files): Use it.
23085 * tests/suite.at (Checking output file names): New test.
23086
230872000-12-19 Akim Demaille <akim@epita.fr>
23088
23089 * src/system.h (obstack_grow_literal_string): Rename as...
23090 (obstack_grow_string): this.
23091 * src/output.c (output_parser): Recognize `%% actions' instead of
23092 `$'.
23093 * src/bison.s1: s/$/%% actions/.
23094 * src/bison.hairy: Likewise.
23095
230962000-12-19 Akim Demaille <akim@epita.fr>
23097
23098 * src/output.c (output_parser): Compute the `#line' lines when
23099 there are.
23100 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
23101 Suggested by Hans Aberg.
23102
231032000-12-19 Akim Demaille <akim@epita.fr>
23104
23105 Let the handling of the skeleton files be local to the procedures
23106 that use it.
23107
23108 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
23109 longer static.
23110 (fparser, open_extra_files): Remove.
23111 (open_files, output_files): Don't take care of fparser.
23112 * src/files.h: Adjust.
23113 * src/output.c (output_parser): Open and close the file to the
23114 skeleton.
23115 * src/reader.c (read_declarations): When %semantic_parser, open
23116 fguard.
23117
231182000-12-19 Akim Demaille <akim@epita.fr>
23119
23120 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
23121 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
23122
231232000-12-19 Akim Demaille <akim@epita.fr>
23124
23125 * src/files.c (open_files): Yipee! We no longer need all the code
23126 looking for `/tmp' since we have no tmp file.
23127
231282000-12-19 Akim Demaille <akim@epita.fr>
23129
23130 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
23131 New macros.
23132 * src/files.c (open_files): Less dependency on MSDOS etc.
23133
231342000-12-14 Akim Demaille <akim@epita.fr>
23135
23136 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
23137 Provide a default definition.
23138 Use it when executing the default @ action.
23139 * src/reader.c (reader_output_yylsp): No longer include
23140 `timestamp' and `text' in the default YYLTYPE.
23141
231422000-12-12 Akim Demaille <akim@epita.fr>
23143
23144 * src/reader.c (copy_definition, parse_union_decl, copy_action)
23145 (copy_guard): Quote the file names.
23146 Reported by Laurent Mascherpa.
23147
231482000-12-12 Akim Demaille <akim@epita.fr>
23149
23150 * src/output.c (output_headers, output_program, output): Be sure
23151 to escape special characters when outputting filenames.
23152 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
23153 (output_headers): Don't depend on them, Use ACTSTR.
23154
231552000-11-17 Akim Demaille <akim@epita.fr>
23156
23157 * lib/obstack.h: Formatting changes.
23158 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
23159 prevents type checking.
23160 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
23161 cast the value to (void *): assigning a `foo *' to a `void *'
23162 variable is valid.
23163 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
23164 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
23165 append characters.
23166
231672000-11-17 Akim Demaille <akim@epita.fr>
23168
23169 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
23170 as...
23171 (suite.m4, regression.m4, calc.m4): these.
23172 * tests/atgeneral.m4: Update from CVS Autoconf.
23173
231742000-11-17 Akim Demaille <akim@epita.fr>
23175
23176 * tests/regression.m4 (%union and --defines): New test,
23177 demonstrating a current bug in the obstack implementation.
23178
231792000-11-17 Akim Demaille <akim@epita.fr>
23180
23181 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
23182 macros.
23183 Use them to declare the variables which are global or local to
23184 `yyparse'.
23185
231862000-11-17 Akim Demaille <akim@epita.fr>
23187
23188 * acconfig.h: Remove, no longer used.
23189
231902000-11-07 Akim Demaille <akim@epita.fr>
23191
23192 * src: s/Copyright (C)/Copyright/g.
23193
231942000-11-07 Akim Demaille <akim@epita.fr>
23195
23196 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
23197 defining.
23198 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
23199
232002000-11-07 Akim Demaille <akim@epita.fr>
23201
23202 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
23203 Merge in a single CPP if/else.
23204
232052000-11-07 Akim Demaille <akim@epita.fr>
23206
23207 * src/output.c (output): Remove useless variables.
23208 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
23209 argument `data' for consistency with the prototypes.
23210 Qualify it `const'.
23211 (obstack_copy, obstack_copy0): Rename the second argument as
23212 `address' for consistency. Qualify it `const'.
23213 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
23214 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
23215 `const' their input argument (`data' or `address').
23216 Adjust the corresponding macros to include `const' in casts.
23217
232182000-11-03 Akim Demaille <akim@epita.fr>
23219
23220 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
23221 s/PFILE1/BISON_HAIRY/.
23222 Adjust dependencies.
23223
232242000-11-03 Akim Demaille <akim@epita.fr>
23225
23226 For some reason, this was not applied.
23227
23228 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23229 `unlink': it's no longer used.
23230
232312000-11-03 Akim Demaille <akim@epita.fr>
23232
23233 * src/files.c (skeleton_find): New function, eved out of...
23234 (open_files, open_extra_files): here.
23235
232362000-11-03 Akim Demaille <akim@epita.fr>
23237
23238 Don't use `atexit'.
23239
23240 * src/files.c (obstack_save): New function.
23241 (done): Rename as...
23242 (output_files): this.
23243 Use `obstack_save'.
23244 * src/main.c (main): Don't use `atexit' to register `done', since
23245 it no longer has to remove tmp files, just call `output_files'
23246 when there are no errors.
23247
232482000-11-02 Akim Demaille <akim@epita.fr>
23249
23250 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23251 `unlink': it's no longer used.
23252 * src/files.h: Formatting changes.
23253
232542000-11-02 Akim Demaille <akim@epita.fr>
23255
23256 Remove the last uses of mktemp and unlink/delete.
23257
23258 * src/files.c (fdefines, ftable): Removed.
23259 (defines_ostack, table_obstack): New.
23260 Adjust dependencies of the former into uses of the latter.
23261 * src/output.c (output_short_or_char_table, output_short_table):
23262 Convert to using obstacks.
23263 * src/reader.c (copy_comment2): Accept one FILE * and two
23264 obstacks.
23265 (output_token_defines, reader_output_yylsp): Use obstacks.
23266 * src/system.h (obstack_fgrow3): New.
23267 * po/POTFILES.in: Adjust.
23268
232692000-11-01 Akim Demaille <akim@epita.fr>
23270
23271 Change each use of `fattrs' into a use of `attrs_obstack'.
23272
23273 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
23274 * src/files.c (fattrs): Remove.
23275 (attrs_obstack): New.
23276 Adjust all dependencies.
23277 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
23278
232792000-11-01 Akim Demaille <akim@epita.fr>
23280
23281 Introduce obstacks.
23282 Change each use of `faction' into a use of `action_obstack'.
23283
23284 * lib/obstack.h, lib/obstack.c: New files.
23285 * src/files.c (faction): Remove.
23286 (action_obstack): New.
23287 Adjust all dependencies.
23288
232892000-10-20 Akim Demaille <akim@epita.fr>
23290
23291 * lib/quote.h (PARAMS): New macro. Use it.
23292
232932000-10-16 Akim Demaille <akim@epita.fr>
23294
23295 * src/output.c (output_short_or_char_table): New function.
23296 (output_short_table, output_token_translations): Use it.
23297 (goto_actions): Use output_short_table.
23298
232992000-10-16 Akim Demaille <akim@epita.fr>
23300
23301 * src/symtab.c (bucket_new): New function.
23302 (getsym): Use it.
23303
23304 * src/output.c (output_short_table): New argument to display the
23305 comment associated with the table.
23306 Adjust dependencies.
23307 (output_gram): Use it.
23308 (output_rule_data): Nicer output layout for YYTNAME.
23309
233102000-10-16 Akim Demaille <akim@epita.fr>
23311
23312 * src/lex.c (read_typename): New function.
23313 (lex): Use it.
23314 * src/reader.c (copy_dollar): Likewise.
23315
233162000-10-16 Akim Demaille <akim@epita.fr>
23317
23318 * src/reader.c (copy_comment2): Expect the input stream to be on
23319 the `/' which is suspected to open a comment, instead of being
23320 called after `//' or `/*' was read.
23321 (copy_comment, copy_definition, parse_union_decl, copy_action)
23322 (copy_guard): Adjust.
23323
233242000-10-16 Akim Demaille <akim@epita.fr>
23325
23326 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
23327 `read_signed_integer'.
23328
233292000-10-16 Akim Demaille <akim@epita.fr>
23330
23331 * src/reader.c (copy_dollar): New function.
23332 (copy_guard, copy_action): Use it.
23333
233342000-10-16 Akim Demaille <akim@epita.fr>
23335
23336 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
23337 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
23338 New files, from Fileutils 4.0.27.
23339 * src/main.c (printable_version): Remove.
23340 * src/lex.c, src/reader.c: Use `quote'.
23341
233422000-10-04 Akim Demaille <akim@epita.fr>
23343
23344 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
23345
233462000-10-04 Akim Demaille <akim@epita.fr>
23347
23348 * doc/bison.texinfo: Various typos spotted by Neil Booth.
23349
233502000-10-04 Akim Demaille <akim@epita.fr>
23351
23352 When a literal string is used to define two different tokens,
23353 `bison -v' segfaults.
23354 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
23355
23356 * tests/regression.m4: New file.
23357 Include the core of the sample provided by Piotr Gackiewicz.
23358 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
23359 properly.
23360
233612000-10-04 Akim Demaille <akim@epita.fr>
23362
23363 * src/reader.c (parse_expect_decl): Keep `count' within the size
23364 of `buffer'.
23365 From Neil Booth.
23366
233672000-10-02 Paul Eggert <eggert@twinsun.com>
23368
23369 * bison.s1 (yyparse): Assign the default value
23370 unconditionally, to avoid a GCC warning and make the parser a
23371 tad smaller.
23372
233732000-10-02 Akim Demaille <akim@epita.fr>
23374
23375 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
23376 options.
23377
233782000-10-02 Akim Demaille <akim@epita.fr>
23379
23380 * src/derives.c, src/print.c, src/reduce.c: To ease the
23381 translation, move some `\n' out of the translated strings.
23382
233832000-10-02 Akim Demaille <akim@epita.fr>
23384
23385 The location tracking mechanism is precious for parse error
23386 messages. Nevertheless, it is enabled only when `@n' is used in
23387 the grammar, which is a different issue (you can use it in error
23388 message, but not in the grammar per se). Therefore, there should
23389 be another means to enable it.
23390
23391 * src/getargs.c (getargs): Support `--locations'.
23392 (usage): Report it.
23393 * src/getargs.h (locationsflag): Export it.
23394 * src/lex.c (percent_table): Support `%locations'.
23395 * src/reader.c (yylsp_needed): Remove this variable, now replaced
23396 with `locationsflag'.
23397 * doc/bison.texinfo: Document `--locations' and `%locations'.
23398 Sort the options.
23399 * tests/calc.m4: Test it.
23400
23401 For regularity of the names, replace each
23402 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
23403 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
23404 In addition replace each `flag' with `_flag'.
23405
234062000-10-02 Akim Demaille <akim@epita.fr>
23407
23408 Also test parse error messages, including with YYERROR_VERBOSE.
23409
23410 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
23411 associative).
23412 Use it to check the computations.
23413 Use it to check `nonassoc' is honored.
23414 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
23415 `--yyerror-verbose'.
23416 (_AT_CHECK_CALC): Adjust to this option.
23417 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
23418
234192000-10-02 Akim Demaille <akim@epita.fr>
23420
23421 Test also `--verbose', `--defines' and `--name-prefix'. Testing
23422 the latter demonstrates a flaw in the handling of non debugging
23423 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
23424 was used in order to simplify:
23425
23426 #if YYDEBUG
23427 if (yydebug)
23428 {
23429 ...
23430 }
23431 #endif
23432
23433 into
23434
23435 if (yydebug)
23436 {
23437 ...
23438 }
23439
23440 unfortunately this leads to a CPP conflict when
23441 `--name-prefix=foo' is used since it produces `#define yydebug
23442 foodebug'.
23443
23444 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
23445 (YYDPRINTF): New macro.
23446 Spread its use.
23447 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
23448 the bison options.
23449 Also test `--verbose', `--defines' and `--name-prefix'.
23450
234512000-10-02 Akim Demaille <akim@epita.fr>
23452
23453 Improve the readability of the produced parsers.
23454
23455 * src/bison.s1: Formatting changes.
23456 Improve the comment related to the `$' mark.
23457 (yydefault): Don't fall through to `yyresume': `goto' there.
23458 * src/output.c (output_parser): When the `$' is met, skip the end
23459 of its line.
23460 New variable, `number_of_dollar_signs', to check there's exactly
23461 one `$' in the parser skeleton.
23462
234632000-10-02 Akim Demaille <akim@epita.fr>
23464
23465 * lib/xstrdup.c: New file, from the fileutils.
23466 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
23467 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
23468 instead of strlen + xmalloc + strcpy.
23469 * src/symtab.c (copys): Remove, use xstrdup instead.
23470
234712000-10-02 Akim Demaille <akim@epita.fr>
23472
23473 * src/gram.h (associativity): New enum type which replaces the
23474 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
23475 `right_assoc', `left_assoc' and `non_assoc'.
23476 Adjust all dependencies.
23477 * src/reader.c: Formatting changes.
23478 (LTYPESTR): Don't define it, use it as a literal in
23479 `reader_output_yylsp'.
23480 * src/symtab.h (symbol_class): New enum type which replaces the
23481 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
23482 `sunknown', `stoken and `snterm'.
23483
234842000-10-02 Akim Demaille <akim@epita.fr>
23485
23486 * src/getargs.c (fixed_outfiles): Rename as...
23487 (yaccflag): for consistency and accuracy.
23488 Adjust dependencies.
23489
234902000-10-02 Akim Demaille <akim@epita.fr>
23491
23492 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
23493 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
23494 difficult and introduced a lot of core dump. It turns out that
23495 Bison used an implementation of `xmalloc' based on `calloc', and
23496 at various places it does depend upon the initialization to 0. I
23497 have not tried to isolate the pertinent places, and all the former
23498 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
23499 someone should address this issue.
23500
23501 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
23502 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
23503 files.
23504 Adjust dependencies.
23505 * src/warshall.h: New file.
23506 Propagate.
23507
235082000-10-02 Akim Demaille <akim@epita.fr>
23509
23510 Various anti-`extern in *.c' changes.
23511
23512 * src/system.h: Include `assert.h'.
23513
235142000-10-02 Akim Demaille <akim@epita.fr>
23515
23516 * src/state.h (nstates, final_state, first_state, first_shift)
23517 (first_reduction): Move their exportation from here...
23518 * src/LR0.h: to here.
23519 Adjust dependencies.
23520 * src/getargs.c (statisticsflag): New variable.
23521 Add support for `--statistics'.
23522 Adjust dependencies.
23523
23524 Remove a lot of now useless `extern' statements in most files.
23525
235262000-10-02 Akim Demaille <akim@epita.fr>
23527
23528 * src/LR0.h: New file.
23529 Propagate its use.
23530
235312000-10-02 Akim Demaille <akim@epita.fr>
23532
23533 * src/print.h: New file.
23534 Propagate its use.
23535 * src/print.c: Formatting and ordering changes.
23536 (verbose, terse): Replace with...
23537 (print_results): this new function.
23538 Adjust dependencies.
23539
235402000-10-02 Akim Demaille <akim@epita.fr>
23541
23542 * src/conflicts.c (conflict_report): New function.
23543 (conflict_log, verbose_conflict_log): Replace with...
23544 (print_conflicts): this function.
23545 Adjust dependencies.
23546 * src/conflicts.h: New file.
23547 Propagate its inclusion.
23548
235492000-10-02 Akim Demaille <akim@epita.fr>
23550
23551 * src/nullable.h: New file.
23552 Propagate its inclusion.
23553 * src/nullable.c: Formatting changes.
23554
235552000-10-02 Akim Demaille <akim@epita.fr>
23556
23557 * src/reduce.h: New file.
23558 Propagate its inclusion.
23559 * src/reduce.c: Topological sort and other formatting changes.
23560 (bool, TRUE, FALSE): Move their definition to...
23561 * src/system.h: here.
23562
235632000-10-02 Akim Demaille <akim@epita.fr>
23564
23565 * src/files.c: Formatting changes.
23566 (tryopen, tryclose, openfiles): Rename as...
23567 (xfopen, xfclose, open_files): this.
23568 (stringappend): static.
23569 * src/files.h: Complete the list of exported symbols.
23570 Propagate its use.
23571
235722000-10-02 Akim Demaille <akim@epita.fr>
23573
23574 * src/reader.h: New file.
23575 Propagate its use instead of tedious list of `extern' and
23576 prototypes.
23577 * src/reader.c: Formatting changes, topological sort,
23578 s/register//.
23579
235802000-10-02 Akim Demaille <akim@epita.fr>
23581
23582 * src/lex.h: Prototype `lex.c' exported functions.
23583 * src/reader.c: Adjust.
23584 * src/lex.c: Formatting changes.
23585 (safegetc): Rename as...
23586 (xgetc): this.
23587
235882000-10-02 Akim Demaille <akim@epita.fr>
23589
23590 * src/lalr.h: New file.
23591 Propagate its inclusion instead of prototypes and `extern'.
23592 * src/lalr.c: Formatting changes, topological sorting etc.
23593
235942000-10-02 Akim Demaille <akim@epita.fr>
23595
23596 * src/output.c (token_actions): Introduce a temporary array,
23597 YYDEFACT, that makes it possible for this function to use
23598 output_short_table.
23599
236002000-10-02 Akim Demaille <akim@epita.fr>
23601
23602 `user_toknums' is output as a `short[]' in `output.c', while it is
23603 defined as a `int[]' in `reader.c'. For consistency with the
23604 other output tables, `user_toknums' is now defined as a table of
23605 shorts.
23606
23607 * src/reader.c (user_toknums): Be a short table instead of an int
23608 table.
23609 Adjust dependencies.
23610
23611 Factor the short table outputs.
23612
23613 * src/output.c (output_short_table): New function.
23614 * src/output.c (output_gram, output_stos, output_rule_data)
23615 (output_base, output_table, output_check): Use it.
23616
236172000-10-02 Akim Demaille <akim@epita.fr>
23618
23619 * src/output.c (output): Topological sort of the functions, in
23620 order to get rid of the `static' prototypes.
23621 No longer use `register'.
23622 * src/output.h: New file.
23623 Propagate its inclusion in files explicitly prototyping functions
23624 from output.c.
23625
236262000-09-21 Akim Demaille <akim@epita.fr>
23627
23628 * src/atgeneral.m4: Update from Autoconf.
23629
236302000-09-21 Akim Demaille <akim@epita.fr>
23631
23632 * src/closure.h: New file.
23633 * src/closure.c: Formatting changes, topological sort over the
23634 functions, use of closure.h.
23635 (initialize_closure, finalize_closure): Rename as...
23636 (new_closure, free_closure): these. Adjust dependencies.
23637 * src/LR0.c: Formatting changes, topological sort, use of
23638 cloture.h.
23639 (initialize_states): Rename as...
23640 (new_states): this.
23641 * src/Makefile.am (noinst_HEADERS): Adjust.
23642
236432000-09-20 Akim Demaille <akim@epita.fr>
23644
23645 * src/acconfig.h: Don't protect config.h against multiple
23646 inclusion.
23647 Don't define PARAMS.
23648 * src/system.h: Define PARAMS.
23649 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
23650 purpose of config.h. system.h must not try to fix wrong
23651 definitions in config.h.
23652
236532000-09-20 Akim Demaille <akim@epita.fr>
23654
23655 * src/derives.h: New file.
23656 * src/main.c, src/derives.h: Use it.
23657 Formatting changes.
23658 * src/Makefile.am (noinst_HEADERS): Adjust.
23659
236602000-09-20 Akim Demaille <akim@epita.fr>
23661
23662 * tests/atgeneral.m4: Update from Autoconf.
23663 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
23664 (AT_CHECK_CALC): New macros.
23665 Use these macros to test bison with options `', `--raw',
23666 `--debug', `--yacc', `--yacc --debug'.
23667
236682000-09-19 Akim Demaille <akim@epita.fr>
23669
23670 * src/output.c: Formatting changes.
23671 * src/machine.h: Remove, leaving its contents in...
23672 * src/system.h: here.
23673 Include stdio.h.
23674 Adjust all dependencies on stdio.h and machine.h.
23675 * src/getargs.h: New file.
23676 Let all `extern' declarations about getargs.c be replaced with
23677 inclusion of `getargs.h'.
23678 * src/Makefile.am (noinst_HEADERS): Adjust.
23679
23680 * tests/calc.m4 (yyin): Be initialized in main, not on the global
23681 scope.
23682 (yyerror): Returns void, not int.
23683 * doc/bison.texinfo: Formatting changes.
23684
236852000-09-19 Akim Demaille <akim@epita.fr>
23686
23687 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
23688 portable.
23689
236902000-09-18 Akim Demaille <akim@epita.fr>
23691
23692 * configure.in: Append WARNING_CFLAGS to CFLAGS.
23693 * src/Makefile.am (INCLUDES): Don't.
23694 Be ready to fetch headers in lib/.
23695
236962000-09-18 Akim Demaille <akim@epita.fr>
23697
23698 * doc/bison.texinfo: Update the copyright.
23699 ANSIfy and GNUify the examples.
23700 Remove the old menu.
23701
237022000-09-18 Akim Demaille <akim@epita.fr>
23703
23704 First set of tests: use the `calc' example from the documentation.
23705
23706 * src/bison.s1 (yyparse): Condition the code using `yytname' which
23707 is defined only when YYDEBUG is.
23708 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
23709 * src/files.c (tryopen, tryclose): Formatting changes.
23710 Move to the top and be static.
23711 * src/reader.c (read_signed_integer): Likewise.
23712 * tests/calc.m4: New file.
23713 * Makefile.am, suite.m4: Adjust.
23714 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
23715
237162000-09-18 Akim Demaille <akim@epita.fr>
23717
23718 Add support for an Autotest test suite for Bison.
23719
23720 * m4/m4.m4, m4/atconfig.m4: New files.
23721 * m4/Makefile.am (EXTRA_DIST): Adjust.
23722 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
23723 files.
23724 * src/getargs.c: Display a more standard --version message.
23725 * src/reader.c (reader): Formatting changes.
23726 No longer depend upon VERSION_STRING.
23727 * configure.in: No longer use `dnl'.
23728 Set up the test suite and the new directory `tests/.
23729 (VERSION_STRING): Remove.
23730
237312000-04-14 Akim Demaille <akim@epita.fr>
23732
23733 * src/reader.c (copy_comment2): New function, same as former
23734 `copy_comment', but outputs into two FILE *.
23735 (copy_comment): Use it.
23736 (parse_union_decl): Use it.
23737 (get_type, parse_start_decl): Use the same `invalid' message.
23738 (parse_start_decl, parse_union_decl): Use the same `multiple'
23739 message.
23740 (parse_union_decl, copy_guard, copy_action): Use the same
23741 `unmatched' message.
23742 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
23743
237442000-03-31 Akim Demaille <akim@epita.fr>
23745
23746 * src/files.c (tryopen, tryclose): Move to the top.
23747 Be static.
23748
237492000-03-31 Akim Demaille <akim@epita.fr>
23750
23751 * src/main.c (main): Don't call `done', exit does it.
23752
237532000-03-31 Akim Demaille <akim@epita.fr>
23754
23755 * allocate.c: s/return (foo)/return foo/.
23756 * lalr.c: Likewise.
23757 * LR0.c: Likewise.
23758 * output.c: Likewise.
23759 * reader.c: Likewise.
23760 * symtab.c: Likewise.
23761 * vmsgetargs.c: Likewise.
23762
237632000-03-31 Akim Demaille <akim@epita.fr>
23764
23765 Clean up the error reporting functions.
23766
23767 * src/report.c: New file.
23768 * src/report.h: Likewise.
23769 * src/Makefile.am: Adjust.
23770 * m4/error.m4: New file.
23771 * m4/Makefile.am: Adjust.
23772 * configure.in (jm_PREREQ_ERROR): Call it.
23773 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
23774 Remove.
23775 (fatal, fatals): Remove. All callers use complain.c::fatal.
23776 (warn, warni, warns, warnss, warnss): Remove. All callers use
23777 complain.c::complain.
23778 (toomany): Remove, use fatal instead.
23779 * src/files.c (done): No argument, use complain_message_count.
23780 * src/main.c (main): Register `done' to `atexit'.
23781
23782 * src/getargs.c (usage): More `fputs', less `fprintf'.
23783
237842000-03-28 Akim Demaille <akim@epita.fr>
23785
23786 * lib/: New directory.
23787 * Makefile.am (SUBDIRS): Adjust.
23788 * configure.in: Adjust.
23789 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
23790 useless.
23791 * src/alloca.c: Moved to lib/.
23792 * src/getopt.c: Likewise.
23793 * src/getopt1.c: Likewise.
23794 * src/getopt.h: Likewise.
23795 * src/ansi2knr.c: Likewise.
23796 * src/ansi2knr.1: Likewise.
23797 * src/Makefile.am: Adjust.
23798 * lib/Makefile.am: New file.
23799
238002000-03-28 Akim Demaille <akim@epita.fr>
23801
23802 * src/getargs.c (usage): Refresh the help message.
23803
238042000-03-17 Akim Demaille <akim@epita.fr>
23805
23806 * src/getopt1.c: Updated from textutils 2.0e
23807 * src/getopt.c: Likewise.
23808 * src/getopt.h: Likewise.
23809
238102000-03-17 Akim Demaille <akim@epita.fr>
23811
23812 * src/Makefile.am (bison.simple): Fix the awk program: quote only
23813 the file name, not the whole `#line LINE FILE'.
23814
238152000-03-17 Akim Demaille <akim@epita.fr>
23816
23817 On syntax errors, report the token on which we choked.
23818
23819 * src/bison.s1 (yyparse): In the label yyerrlab, when
23820 YYERROR_VERBOSE, add yychar in msg.
23821
238222000-03-17 Akim Demaille <akim@epita.fr>
23823
23824 * src/reader.c (copy_at): New function.
23825 (copy_guard): Use it.
23826 (copy_action): Use it.
23827
238282000-03-17 Akim Demaille <akim@epita.fr>
23829
23830 Be kind to translators, save some useless translations.
23831
23832 * src/main.c (banner): New function.
23833 (fatal_banner): Use it.
23834 (warn_banner): Use it.
23835
238362000-03-17 Akim Demaille <akim@epita.fr>
23837
23838 * src/reader.c (copy_definition): Use copy_string and
23839 copy_comment. Removed now unused `match', `ended',
23840 `cplus_comment'.
23841 (copy_comment, copy_string): Moved, to be visible from
23842 copy_definition.
23843
238442000-03-17 Akim Demaille <akim@epita.fr>
23845
23846 * src/reader.c (copy_string): Declare `static inline'. No
23847 problems with inline, since it is checked by configure.
23848 (copy_comment): Likewise.
23849
238502000-03-17 Akim Demaille <akim@epita.fr>
23851
23852 * src/reader.c (packsymbols): Formatting changes.
23853
238542000-03-17 Akim Demaille <akim@epita.fr>
23855
23856 * src/reader.c (copy_comment): New function, factored out from:
23857 (copy_action): Use it. Removed now unused `match', `ended',
23858 `cplus_comment'.
23859 (copy_guard): Likewise.
23860
238612000-03-17 Akim Demaille <akim@epita.fr>
23862
23863 * src/reader.c (copy_string): New function, factored out from:
23864 (copy_action): Use it.
23865 (copy_guard): Likewise.
23866
238672000-03-17 Akim Demaille <akim@epita.fr>
23868
23869 Change the handling of @s so that they behave exactly like $s.
23870 There is now a pseudo variable @$ (readble and writable), location
23871 of the lhs of the rule (by default ranging from the location of
23872 the first symbol of the rhs, to the location of the last symbol,
23873 or, if the rhs is empty, YYLLOC).
23874
23875 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
23876 yyval.
23877 (yyparse): When providing a default semantic action, provide a
23878 default location action.
23879 (after the $): No longer change `*YYLSP', just stack YYLOC the
23880 same way you stack YYVAL.
23881 * src/reader.c (read_declarations): Use warns.
23882 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
23883 (copy_action, case '@'): Likewise.
23884 Use a standard error message, to save useless work from
23885 translators.
23886
238872000-03-17 Akim Demaille <akim@epita.fr>
23888
23889 * src/bison.s1: Formatting and cosmetics changes.
23890 * src/reader.c: Likewise.
23891 Update the Copyright notice.
23892
238932000-03-17 Akim Demaille <akim@epita.fr>
23894
23895 * src/bison.s1 (#line): All set to `#line' only, since the
23896 Makefile now handles them.
23897
238982000-03-16 Akim Demaille <akim@epita.fr>
23899
23900 * src/output.c (output_rule_data): Output the documentation of
23901 some of the tables.
23902 (Copyright notice): Update.
23903 Formatting changes.
23904
239052000-03-16 Akim Demaille <akim@epita.fr>
23906
23907 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
23908 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
23909 One `#if YYDEBUG' remains, since it uses variables which are
23910 defined only if `YYDEBUG != 0'.
23911
239122000-03-16 Akim Demaille <akim@epita.fr>
23913
23914 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
23915 and related variables so that the similarities are highlighted.
23916
239172000-03-16 Akim Demaille <akim@epita.fr>
23918
23919 * src/bison.s1: Properly indent CPP directives.
23920
239212000-03-16 Akim Demaille <akim@epita.fr>
23922
23923 * src/bison.s1: Properly indent the `alloca' CPP section.
23924
239252000-03-16 Akim Demaille <akim@epita.fr>
23926
23927 Do not hard code values of directories in `configure.in'.
23928 Update the `configure' tool chain.
23929
23930 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
23931 src/makefile.am.
23932 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
23933 (AC_OUTPUT): Add m4/Makefile.
23934 Bump to bison 1.28a, 1.29 has never been released.
23935 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
23936 handled via src/Makefile.am.
23937 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
23938 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
23939 autoheader.
23940 * Makefile.am (SUBDIRS): Add m4.
23941 (ACLOCAL_AM_FLAGS): New variable.
23942 (AUTOMAKE_OPTIONS): Add check-news.
23943 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
23944 the proper line number and file name.
23945 (DEFS): Propagate the location of bison library files and of the
23946 locale files.
23947 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
23948 builddir.
23949 * acinclude.m4: Remove, replaced by the directory m4.
23950 * m4/Makefile.am (EXTRA_DIST): New variable.
23951 * m4/gettext.m4: New file, from the fileutils.
23952 * m4/lcmessage.m4: Likewise
23953 * m4/progtest.m4: Likewise.
23954 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
23955
239562000-03-10 Akim Demaille <akim@epita.fr>
23957
23958 * src/closure.c:
23959 Formatting changes of various comments.
23960 Respect the GNU coding standards at various places.
23961 Don't use `_()' when no translation is needed.
23962
239631999-12-13 Jesse Thilo <jthilo@gnu.org>
23964
23965 * src/files.c:
23966 OS/2 honors TMPDIR environment variable.
23967
239681999-12-13 Jesse Thilo <jthilo@gnu.org>
23969
23970 * doc/bison.texinfo: Tweaked spelling and grammar.
23971 Updated ISBN.
23972 Removed reference to price of printed copy.
23973 Mention BISON_SIMPLE and BISON_HAIRY.
23974
239751999-12-13 Jesse Thilo <jthilo@gnu.org>
23976
23977 * configure.in, NEWS:
23978 Bison 1.29 released.
23979
239801999-10-27 Jesse Thilo <jthilo@gnu.org>
23981
23982 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
23983 Added reference card.
23984
239851999-07-26 Jesse Thilo <jthilo@gnu.org>
23986
23987 * po/ru.po: Added Russian translation.
23988
239891999-07-26 Jesse Thilo <jthilo@gnu.org>
23990
23991 * configure.in: Added Russian translation.
23992
239931999-07-06 Jesse Thilo <jthilo@gnu.org>
23994
23995 * configure.in, NEWS, README:
23996 Released version 1.28.
23997
239981999-06-14 Jesse Thilo <jthilo@gnu.org>
23999
24000 * src/system.h:
24001 Squashed redefinition warning on some systems.
24002
24003 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
24004 Have configure build version string instead of relying on ANSI string
24005 concatentation.
24006
240071999-06-14 Jesse Thilo <jthilo@gnu.org>
24008
24009 * po/POTFILES.in: Got rid of version.c.
24010
240111999-06-14 Jesse Thilo <jthilo@gnu.org>
24012
24013 * acconfig.h, configure.in:
24014 Have configure build version string instead of relying on ANSI string
24015 concatentation.
24016
240171999-06-08 Jesse Thilo <jthilo@gnu.org>
24018
24019 * doc/bison.1:
24020 Dropped mention of `+' for long-named options.
24021
240221999-05-30 Jesse Thilo <jthilo@gnu.org>
24023
24024 * src/files.c: Added <unistd.h> for unlink().
24025
24026 * src/Makefile.am, src/system.h:
24027 I18n fixes.
24028
240291999-05-30 Jesse Thilo <jthilo@gnu.org>
24030
24031 * README: Added a FAQ list.
24032
24033 * configure.in, acconfig.h:
24034 I18n fixes.
24035
240361999-05-30 Jesse Thilo <jthilo@gnu.org>
24037
24038 * doc/FAQ, doc/Makefile.am:
24039 Added a FAQ list.
24040
240411999-05-19 Jesse Thilo <jthilo@gnu.org>
24042
24043 * src/alloc.h, src/symtab.h, src/version.c:
24044 Protected inclusion of "config.h" with HAVE_CONFIG_H.
24045
240461999-04-18 Jesse Thilo <jthilo@gnu.org>
24047
24048 * src/.cvsignore, src/Makefile.am:
24049 Reorganized: sources in `src', documentation in `doc'.
24050
24051 * src/lex.c (literalchar):
24052 fixed the code for escaping double quotes (thanks
24053 Jonathan Czisny.)
24054
240551999-04-18 Jesse Thilo <jthilo@gnu.org>
24056
24057 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
24058 Adjusted paths to reflect directory reorganization.
24059
240601999-04-18 Jesse Thilo <jthilo@gnu.org>
24061
24062 * doc/.cvsignore, doc/Makefile.am:
24063 Reorganized: sources in `src', documentation in `doc'.
24064
240651999-04-18 Jesse Thilo <jthilo@gnu.org>
24066
24067 * configure.in:
24068 Updated AC_INIT file to reflect directory reorganization.
24069
24070 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
24071 Reorganized: sources in `src', documentation in `doc'.
24072
240731999-04-13 Jesse Thilo <jthilo@gnu.org>
24074
24075 * src/allocate.c:
24076 Don't declare calloc() and realloc() if not necessary.
24077
240781999-04-13 Jesse Thilo <jthilo@gnu.org>
24079
24080 * configure.in, acconfig.h, acinclude.m4:
24081 Don't declare calloc() and realloc() if not necessary.
24082
240831999-03-23 Jesse Thilo <jthilo@gnu.org>
24084
24085 * po/.cvsignore: Added i18n support.
24086
240871999-03-23 Jesse Thilo <jthilo@gnu.org>
24088
24089 * acconfig.h, configure.in, Makefile.am:
24090 Added i18n support.
24091
240921999-03-22 Jesse Thilo <jthilo@gnu.org>
24093
24094 * src/bison.s1: Fixed #line numbers.
24095
240961999-03-15 Jesse Thilo <jthilo@gnu.org>
24097
24098 * po/es.po, po/fr.po, po/nl.po, po/de.po:
24099 Added PO files from Translation Project.
24100
241011999-03-03 Jesse Thilo <jthilo@gnu.org>
24102
24103 * Makefile.am:
24104 Added support for non-ANSI compilers (ansi2knr).
24105
241061999-02-16 Jesse Thilo <jthilo@gnu.org>
24107
24108 * configure.in: Bumped version number to 1.27.
24109
24110 * Makefile.am:
24111 Added `bison.simple' to list of files removed by `make distclean'.
24112
241131999-02-12 Jesse Thilo <jthilo@gnu.org>
24114
24115 * src/files.c, src/files.h:
24116 Defined locations of parser files in config.h instead of Makefile.
24117
241181999-02-12 Jesse Thilo <jthilo@gnu.org>
24119
24120 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
24121 Defined locations of parser files in config.h instead of Makefile.
24122
241231999-02-09 Jesse Thilo <jthilo@gnu.org>
24124
24125 * Makefile.am:
24126 Removed inappropriate use of $< macro.
24127
241281999-02-05 Jesse Thilo <jthilo@gnu.org>
24129
24130 * po/Makefile.in.in, po/POTFILES.in:
24131 Add `po' directory skeleton.
24132
241331999-01-27 Jesse Thilo <jthilo@gnu.org>
24134
24135 * README: Document help-bison list.
24136
24137 * configure.in: Add check for mkstemp().
24138
241391999-01-20 Jesse Thilo <jthilo@gnu.org>
24140
24141 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
24142 Hush a few compiler warnings.
24143
24144 * src/files.c:
24145 Add tryclose(), which verifies that fclose was successful.
24146 Hush a couple of compiler warnings.
24147
241481999-01-20 Jesse Thilo <jthilo@gnu.org>
24149
24150 * Makefile.am, OChangeLog:
24151 ChangeLog is now automatically generated. Include the old version as
24152 OChangeLog.
24153
241541999-01-14 Jesse Thilo <jthilo@gnu.org>
24155
24156 * 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:
24157 Update FSF address.
24158
241591999-01-14 Jesse Thilo <jthilo@gnu.org>
24160
24161 * doc/bison.texinfo: Fix formatting glitch.
24162
24163 * doc/bison.texinfo: Update FSF address.
24164
241651999-01-14 Jesse Thilo <jthilo@gnu.org>
24166
24167 * acconfig.h: Update FSF address.
24168
241691999-01-08 Jesse Thilo <jthilo@gnu.org>
24170
24171 * src/system.h:
24172 Don't define PACKAGE here, since config.h defines it.
24173
241741998-12-30 Jesse Thilo <jthilo@gnu.org>
24175
24176 * src/reader.c: Update copyright date.
24177
24178 * src/main.c:
24179 Ditch sprintf to statically-sized buffers in fatal/warn functions in
24180 favor of output directly to stderr (avoids buffer overruns).
24181
24182 * src/reader.c: Some checks for premature EOF.
24183
24184 * 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:
24185 Use prototypes if the compiler understands them.
24186
24187 * src/files.c: Honor TMPDIR on Unix hosts.
24188 Use prototypes if the compiler understands them.
24189
24190 * src/reader.c:
24191 Fix a couple of buffer overrun bugs.
24192 Use prototypes if the compiler understands them.
24193
24194 * src/system.h: Include unistd.h and ctype.h.
24195 Use #ifdef instead of #if for NLS symbols.
24196
241971998-12-30 Jesse Thilo <jthilo@gnu.org>
24198
24199 * doc/bison.texinfo:
24200 Delete comment "consider using @set for edition number, etc..." since
24201 we now are doing so.
24202
242031998-12-30 Jesse Thilo <jthilo@gnu.org>
24204
24205 * configure.in:
24206 Use prototypes if the compiler understands them.
24207
24208 * NEWS: Document 1.26 highlights.
24209
24210 * Makefile.am: Require Automake 1.3 or later.
24211
24212 * acconfig.h:
24213 Use prototypes if the compiler understands them.
24214
242151998-12-29 Jesse Thilo <jthilo@gnu.org>
24216
24217 * src/version.c:
24218 Use VERSION symbol from automake for version number.
24219
242201998-12-29 Jesse Thilo <jthilo@gnu.org>
24221
24222 * acconfig.h, configure.in, version.cin:
24223 Use VERSION symbol from automake for version number.
24224
242251998-11-28 Jesse Thilo <jthilo@gnu.org>
24226
24227 * Makefile.am:
24228 Distribute original version of simple parser (bison.s1), not built
24229 version (bison.simple).
24230
242311998-11-28 Jesse Thilo <jthilo@gnu.org>
24232
24233 * doc/bison.texinfo: Add info dir entry.
24234
24235 * doc/bison.texinfo:
24236 Let automake put version number into documentation.
24237
242381998-11-26 Jesse Thilo <jthilo@gnu.org>
24239
24240 * src/bison.cld, src/build.com, src/vmshlp.mar:
24241 Add non-RCS files from /gd/gnu/bison.
24242
242431998-11-26 Jesse Thilo <jthilo@gnu.org>
24244
24245 * doc/bison.1:
24246 Document the BISON_HAIRY and BISON_SIMPLE variables.
24247
242481998-11-25 Jesse Thilo <jthilo@gnu.org>
24249
24250 * src/version.c: Build version.c automatically.
24251
24252 * src/reader.c:
24253 Fix token numbering (used to start at 258, not 257).
24254
24255 * src/system.h: Include config.h.
24256
24257 * src/getargs.c: Update bug report address.
24258
24259 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
24260 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
24261
242621998-11-25 Jesse Thilo <jthilo@gnu.org>
24263
24264 * Makefile.am:
24265 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24266
24267 * configure.in, version.cin:
24268 Build version.c automatically.
24269
24270 * AUTHORS: Add AUTHORS file.
24271
24272 * README: Update bug report address.
24273
24274 * bison.simple:
24275 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24276
24277 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
24278 Add automake stuff.
24279
242801998-11-25 Jesse Thilo <jthilo@gnu.org>
24281
24282 * doc/bison.texinfo: Clean up some formatting.
24283
242841998-05-05 Richard Stallman <rms@gnu.org>
24285
24286 * doc/bison.texinfo:
24287 Explain better why to make a pure parser.
24288
242891998-01-05 Richard Stallman <rms@gnu.org>
24290
24291 * src/files.c (openfiles):
24292 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
24293 find a temporary directory, if possible. Do not unlink files while
24294 they are open.
24295
242961997-08-25 Richard Stallman <rms@gnu.org>
24297
24298 * src/reader.c (stack_offset;):
24299 Change some warni to warns.
24300
24301 * src/lex.c (literalchar): Use warns, not warni.
24302
243031997-06-28 Richard Stallman <rms@gnu.org>
24304
24305 * src/bison.s1: Add a Bison version comment.
24306
24307 * src/main.c (fatal, warn, berror):
24308 Use program_name.
24309
243101997-06-28 Richard Stallman <rms@gnu.org>
24311
24312 * Makefile.in (bison_version): New variable.
24313 (dist): Use that variable.
24314 (bison.s1): Substitute the Bison version into bison.simple.
24315
24316 * bison.simple: Add a Bison version comment.
24317
243181997-06-18 Richard Stallman <rms@gnu.org>
24319
24320 * src/main.c (fatal, warn, berror):
24321 Make error messages standard.
24322 (toomany): Improve error message text.
24323
24324 * 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:
24325 new.h renamed to alloc.h.
24326
243271997-06-18 Richard Stallman <rms@gnu.org>
24328
24329 * Makefile.in: new.h renamed to alloc.h.
24330
243311997-05-24 Richard Stallman <rms@gnu.org>
24332
24333 * src/lex.c (literalchar):
24334 Fix the code for escaping \, " and '.
24335
24336 (lex): Avoid trouble when there are many chars
24337 to discard in a char literal with just several chars in it.
24338
243391997-05-17 Richard Stallman <rms@gnu.org>
24340
24341 * src/bison.s1:
24342 Use malloc, if using alloca is troublesome.
24343 (YYSTACK_USE_ALLOCA): New flag macro.
24344 Define it for some systems and compilers.
24345 (YYSTACK_ALLOC): New macro.
24346 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24347 If it was malloc'd, free it.
24348
243491997-05-17 Richard Stallman <rms@gnu.org>
24350
24351 * bison.simple:
24352 Use malloc, if using alloca is troublesome.
24353 (YYSTACK_USE_ALLOCA): New flag macro.
24354 Define it for some systems and compilers.
24355 (YYSTACK_ALLOC): New macro.
24356 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24357 If it was malloc'd, free it.
24358
243591997-04-23 Richard Stallman <rms@gnu.org>
24360
24361 * src/bison.s1:
24362 (alloca) [__hpux]: Always define as __builtin_alloca.
24363
243641997-04-23 Richard Stallman <rms@gnu.org>
24365
24366 * bison.simple:
24367 (alloca) [__hpux]: Always define as __builtin_alloca.
24368
243691997-04-22 Richard Stallman <rms@gnu.org>
24370
24371 * src/bison.s1:
24372 [__hpux]: Include alloca.h (right for HPUX 10)
24373 instead of declaring alloca (right for HPUX 9).
24374
24375 * src/bison.s1 (__yy_memcpy):
24376 Declare arg `count' as unsigned int.
24377 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24378
243791997-04-22 Richard Stallman <rms@gnu.org>
24380
24381 * bison.simple:
24382 [__hpux]: Include alloca.h (right for HPUX 10)
24383 instead of declaring alloca (right for HPUX 9).
24384
24385 * bison.simple (__yy_memcpy):
24386 Declare arg `count' as unsigned int.
24387 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24388
243891997-01-03 Richard Stallman <rms@gnu.org>
24390
24391 * src/allocate.c: [__STDC__ or _MSC_VER]:
24392 Declare calloc and realloc to return void *.
24393
243941997-01-02 Richard Stallman <rms@gnu.org>
24395
24396 * src/system.h:
24397 [_MSC_VER]: Include stdlib.h and process.h.
24398 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
24399
24400 * src/main.c (main): Return FAILURE as a value.
24401 (printable_version): Declare arg as int, not char.
24402
244031997-01-02 Richard Stallman <rms@gnu.org>
24404
24405 * Makefile.in (dist):
24406 Explicitly check for symlinks, and copy them.
24407
244081996-12-19 Richard Stallman <rms@gnu.org>
24409
24410 * src/files.c:
24411 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
24412
244131996-12-18 Paul Eggert <eggert@gnu.org>
24414
24415 * src/bison.s1 (yyparse):
24416 If __GNUC__ and YYPARSE_PARAM are both defined,
24417 declare yyparse to have a void * argument.
24418
244191996-12-18 Paul Eggert <eggert@gnu.org>
24420
24421 * bison.simple (yyparse):
24422 If __GNUC__ and YYPARSE_PARAM are both defined,
24423 declare yyparse to have a void * argument.
24424
244251996-12-17 Richard Stallman <rms@gnu.org>
24426
24427 * src/reduce.c (nbits): Add some casts.
24428
244291996-08-12 Richard Stallman <rms@gnu.org>
24430
24431 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
24432
244331996-08-12 Richard Stallman <rms@gnu.org>
24434
24435 * bison.simple: Test _MSDOS as well as _MSDOS_.
24436
244371996-07-31 Richard Stallman <rms@gnu.org>
24438
24439 * src/bison.s1:
24440 [__sun && __i386]: Include alloca.h.
24441
244421996-07-31 Richard Stallman <rms@gnu.org>
24443
24444 * bison.simple:
24445 [__sun && __i386]: Include alloca.h.
24446
244471996-07-30 Richard Stallman <rms@gnu.org>
24448
24449 * src/bison.s1: Comment change.
24450
24451 * src/bison.s1: Test _MSDOS_, not MSDOS.
24452
244531996-07-30 Richard Stallman <rms@gnu.org>
24454
24455 * bison.simple: Comment change.
24456
24457 * bison.simple: Test _MSDOS_, not MSDOS.
24458
244591996-06-01 Richard Stallman <rms@gnu.org>
24460
24461 * 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:
24462 Insert `_' macro around many string constants.
24463
24464 * src/main.c:
24465 Insert `_' macro around many string constants.
24466
24467 (main): Call setlocale, bindtextdomain and textdomain.
24468
24469 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
24470 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
24471 [ENABLE_NLS]: Include libintl.h.
24472 [ENABLE_NLS] (gettext): Define.
24473 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
24474 (N_, PACKAGE, LOCALEDIR): New macros.
24475
244761996-06-01 Richard Stallman <rms@gnu.org>
24477
24478 * POTFILES.in: New file.
24479
24480 * Makefile.in (allocate.o):
24481 Define target explicitly.
24482
24483 * Makefile.in (CFLAGS): Set to @CFLAGS@.
24484 (LDFLAGS): Set to @LDFLAGS@.
24485 (configure): Run autoconf only if preceding `cd' succeeds.
24486 (bison.s1): Redirect output to temporary file then move the
24487 temporary to the target, rather than redirecting directly to bison.s1.
24488 (clean): Remove config.status and config.log.
24489 (distclean): Don't remove config.status here.
24490
244911996-05-12 Richard Stallman <rms@gnu.org>
24492
24493 * src/bison.s1:
24494 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24495
244961996-05-12 Richard Stallman <rms@gnu.org>
24497
24498 * bison.simple:
24499 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24500
245011996-05-11 Richard Stallman <rms@gnu.org>
24502
24503 * src/bison.s1 (__yy_memcpy):
24504 Really reorder the args, as was supposedly done on Feb 14 1995.
24505 (yyparse): Calls changed accordingly.
24506
245071996-05-11 Richard Stallman <rms@gnu.org>
24508
24509 * Makefile.in (dist): Don't use $(srcdir).
24510
24511 * bison.simple (__yy_memcpy):
24512 Really reorder the args, as was supposedly done on Feb 14 1995.
24513 (yyparse): Calls changed accordingly.
24514
245151996-01-27 Richard Stallman <rms@gnu.org>
24516
24517 * src/output.c (output_rule_data):
24518 Test YYERROR_VERBOSE in the conditional
24519 around the definition of ttyname.
24520
245211995-12-29 Richard Stallman <rms@gnu.org>
24522
24523 * src/bison.s1:
24524 Fix line numbers in #line commands.
24525
245261995-12-29 Richard Stallman <rms@gnu.org>
24527
24528 * bison.simple:
24529 Fix line numbers in #line commands.
24530
245311995-12-27 Richard Stallman <rms@gnu.org>
24532
24533 * src/bison.s1 (YYPARSE_PARAM_DECL):
24534 In C++, make it always null.
24535 (YYPARSE_PARAM_ARG): New macro.
24536 (yyparse): Use YYPARSE_PARAM_ARG.
24537
245381995-12-27 Richard Stallman <rms@gnu.org>
24539
24540 * bison.simple (YYPARSE_PARAM_DECL):
24541 In C++, make it always null.
24542 (YYPARSE_PARAM_ARG): New macro.
24543 (yyparse): Use YYPARSE_PARAM_ARG.
24544
245451995-11-29 Richard Stallman <rms@gnu.org>
24546
24547 * doc/bison.texinfo:
24548 Describe literal string tokens, %raw, %no_lines, %token_table.
24549
245501995-11-29 Daniel Hagerty <hag@gnu.org>
24551
24552 * doc/bison.texinfo: Fixed update date
24553
245541995-10-16 Richard Stallman <rms@gnu.org>
24555
24556 * src/version.c: Version 1.25.
24557
245581995-10-16 Richard Stallman <rms@gnu.org>
24559
24560 * NEWS: *** empty log message ***
24561
245621995-10-16 Richard Stallman <rms@gnu.org>
24563
24564 * doc/bison.1, doc/bison.rnh:
24565 Add new options.
24566
245671995-10-15 Richard Stallman <rms@gnu.org>
24568
24569 * src/vmsgetargs.c, src/getargs.c:
24570 Added -n, -k, and -raw switches.
24571 (noparserflag, toknumflag, rawtoknumflag): New variables.
24572
24573 * src/symtab.h (SALIAS):
24574 New #define for adding aliases to %token.
24575 (struct bucket): Added `alias' field.
24576
24577 * src/reduce.c (reduce_grammar):
24578 Revise error message.
24579 (print_notices): Remove final `.' from error message.
24580
24581 * src/reader.c (reader_output_yylsp):
24582 New function.
24583 (readgram): Use `#if 0' around code that accepted %command
24584 inside grammar rules: The documentation doesn't allow it,
24585 and it will fail since the %command processors scan for the next %.
24586 (parse_token_decl): Extended the %token
24587 declaration to allow a multi-character symbol as an alias.
24588 (parse_thong_decl): New function.
24589 (read_declarations): Added %thong declarations.
24590 (read_declarations): Handle NOOP to deal with allowing
24591 % declarations as another means to specify the flags.
24592 (readgram): Allow %prec prior to semantics embedded in a rule.
24593 (skip_to_char, read_declarations, copy_definition)
24594 (parse_token_decl, parse_start_decl, parse_type_decl)
24595 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
24596 (get_type_name, copy_guard, copy_action, readgram)
24597 (get_type, packsymbols): Revised most error messages.
24598 Changed `fatal' to `warnxxx' to avoid aborting for error.
24599 Revised and use multiple warnxxx functions to avoid using VARARGS1.
24600 (read_declarations): Improve the error message for
24601 an invalid character. Do not abort.
24602 (read_declarations, copy_guard, copy_action): Use
24603 printable_version to avoid unprintable characters in printed output.
24604 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
24605 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
24606 Allow the type of a non-terminal can be given
24607 more than once, as long as all specifications give the same type.
24608
24609 * src/output.c:
24610 (output_headers, output_trailers, output, output_gram)
24611 (output_rule_data): Implement noparserflag variable.
24612 Implement toknumflag variable.
24613 (output): Call reader_output_yylsp to output LTYPESTR.
24614
24615 * src/main.c (main):
24616 If reader sees an error, don't process the grammar.
24617 (fatals): Updated to not use VARARGS1.
24618 (printable_version, int_to_string, warn, warni, warns, warnss)
24619 (warnsss): New error reporting functions. Avoid abort for error.
24620
24621 * src/lex.h:
24622 Added THONG and NOOP for alias processing.
24623 Added SETOPT for the new code that allows setting options with %flags.
24624
24625 * src/lex.c:
24626 Include getopt.h. Add some extern decls.
24627 (safegetc): New function to deal with EOF gracefully.
24628 (literalchar); new function to deal with reading \ escapes.
24629 (lex): Use literalchar.
24630 (lex): Implemented "..." tokens.
24631 (literalchar, lex, parse_percent_token): Made tokenbuffer
24632 always contain the token. This includes growing the token
24633 buffer while reading an integer.
24634 (parse_percent_token): Replaced if-else statement with percent_table.
24635 (parse_percent_token): Added % declarations as another
24636 way to specify the flags -n, -l, and -r. Also added hooks for
24637 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
24638 major changes to files.c.
24639 (lex) Retain in the incoming stream a character following
24640 an incorrect '/'.
24641 (skip_white_space, lex): Revised most error messages
24642 and changed fatal to warn to avoid aborting.
24643 (percent_table): Added %thong declarations.
24644
24645 * src/gram.h: Comment changes.
24646
24647 * src/files.c (openfiles, open_extra_files, done):
24648 Add faction flag
24649 and actfile file. Handle noparserflag. Both for -n switch.
24650
24651 * src/conflicts.c (resolve_sr_conflict):
24652 Remove use of alloca.
24653
246541995-06-01 Jim Meyering <meyering@gnu.org>
24655
24656 * doc/bison.texinfo: *** empty log message ***
24657
246581995-05-06 Richard Stallman <rms@gnu.org>
24659
24660 * src/bison.s1: Comment change.
24661
246621995-05-06 Richard Stallman <rms@gnu.org>
24663
24664 * bison.simple: Comment change.
24665
246661995-05-03 Richard Stallman <rms@gnu.org>
24667
24668 * src/version.c: Version now 1.24.
24669
24670 * src/bison.s1: Change distribution terms.
24671
24672 * src/version.c: Version now 1.23.
24673
246741995-05-03 Richard Stallman <rms@gnu.org>
24675
24676 * doc/bison.texinfo:
24677 Rewrite "Conditions for Using Bison".
24678 Update version to 1.24.
24679
246801995-05-03 Richard Stallman <rms@gnu.org>
24681
24682 * bison.simple: Change distribution terms.
24683
246841995-02-23 Richard Stallman <rms@gnu.org>
24685
24686 * src/files.c: Test __VMS_POSIX as well as VMS.
24687
246881995-02-14 Jim Meyering <meyering@gnu.org>
24689
24690 * src/bison.s1 (__yy_memcpy):
24691 Renamed from __yy_bcopy to avoid
24692 confusion. Reverse FROM and TO arguments to be consistent with
24693 those of memcpy.
24694
246951995-02-14 Jim Meyering <meyering@gnu.org>
24696
24697 * bison.simple (__yy_memcpy):
24698 Renamed from __yy_bcopy to avoid
24699 confusion. Reverse FROM and TO arguments to be consistent with
24700 those of memcpy.
24701
247021994-11-10 David J. MacKenzie <djm@gnu.org>
24703
24704 * NEWS: reformat
24705
24706 * NEWS: New file.
24707
24708 * Makefile.in (DISTFILES): Include NEWS.
24709
24710 * Makefile.in (DISTFILES):
24711 Include install-sh, not install.sh.
24712
24713 * configure.in: Update to Autoconf v2 macro names.
24714
247151994-10-05 David J. MacKenzie <djm@gnu.org>
24716
24717 * Makefile.in: fix typo
24718
24719 * Makefile.in (prefix, exec_prefix):
24720 Let configure set them.
24721
247221994-09-28 David J. MacKenzie <djm@gnu.org>
24723
24724 * Makefile.in: Set datadir to $(prefix)/share.
24725
247261994-09-15 Richard Stallman <rms@gnu.org>
24727
24728 * src/bison.s1:
24729 Update copyright notice and GPL version.
24730
247311994-09-15 Richard Stallman <rms@gnu.org>
24732
24733 * bison.simple:
24734 Update copyright notice and GPL version.
24735
247361994-07-12 Richard Stallman <rms@gnu.org>
24737
24738 * src/reduce.c, src/reader.c:
24739 entered into RCS
24740
247411994-05-05 David J. MacKenzie <djm@gnu.org>
24742
24743 * Makefile.in: entered into RCS
24744
247451994-03-26 Richard Stallman <rms@gnu.org>
24746
24747 * src/bison.s1: entered into RCS
24748
247491994-03-26 Richard Stallman <rms@gnu.org>
24750
24751 * bison.simple: entered into RCS
24752
247531994-03-25 Richard Stallman <rms@gnu.org>
24754
24755 * src/main.c: entered into RCS
24756
247571994-03-24 Richard Stallman <rms@gnu.org>
24758
24759 * src/conflicts.c: entered into RCS
24760
247611994-01-02 Richard Stallman <rms@gnu.org>
24762
24763 * Makefile.in: *** empty log message ***
24764
247651993-11-21 Richard Stallman <rms@gnu.org>
24766
24767 * src/bison.s1: *** empty log message ***
24768
247691993-11-21 Richard Stallman <rms@gnu.org>
24770
24771 * doc/bison.texinfo: entered into RCS
24772
24773 * doc/bison.texinfo: *** empty log message ***
24774
247751993-11-21 Richard Stallman <rms@gnu.org>
24776
24777 * bison.simple: *** empty log message ***
24778
247791993-10-25 David J. MacKenzie <djm@gnu.org>
24780
24781 * doc/bison.texinfo: *** empty log message ***
24782
247831993-10-19 Richard Stallman <rms@gnu.org>
24784
24785 * src/bison.s1: *** empty log message ***
24786
247871993-10-19 Richard Stallman <rms@gnu.org>
24788
24789 * bison.simple: *** empty log message ***
24790
247911993-10-14 Richard Stallman <rms@gnu.org>
24792
24793 * src/bison.s1: *** empty log message ***
24794
247951993-10-14 Richard Stallman <rms@gnu.org>
24796
24797 * bison.simple: *** empty log message ***
24798
247991993-09-14 David J. MacKenzie <djm@gnu.org>
24800
24801 * doc/bison.texinfo: *** empty log message ***
24802
248031993-09-13 Noah Friedman <friedman@gnu.org>
24804
24805 * Makefile.in: *** empty log message ***
24806
248071993-09-10 Richard Stallman <rms@gnu.org>
24808
24809 * src/conflicts.c: *** empty log message ***
24810
24811 * src/system.h: entered into RCS
24812
248131993-09-10 Richard Stallman <rms@gnu.org>
24814
24815 * doc/bison.1: entered into RCS
24816
248171993-09-06 Noah Friedman <friedman@gnu.org>
24818
24819 * src/version.c: entered into RCS
24820
248211993-09-06 Noah Friedman <friedman@gnu.org>
24822
24823 * Makefile.in: *** empty log message ***
24824
248251993-07-30 David J. MacKenzie <djm@gnu.org>
24826
24827 * Makefile.in: *** empty log message ***
24828
248291993-07-24 Richard Stallman <rms@gnu.org>
24830
24831 * src/bison.s1: *** empty log message ***
24832
248331993-07-24 Richard Stallman <rms@gnu.org>
24834
24835 * bison.simple: *** empty log message ***
24836
248371993-07-08 David J. MacKenzie <djm@gnu.org>
24838
24839 * Makefile.in: *** empty log message ***
24840
248411993-07-04 Richard Stallman <rms@gnu.org>
24842
24843 * src/bison.s1: *** empty log message ***
24844
248451993-07-04 Richard Stallman <rms@gnu.org>
24846
24847 * bison.simple: *** empty log message ***
24848
248491993-06-26 David J. MacKenzie <djm@gnu.org>
24850
24851 * src/getargs.c: entered into RCS
24852
248531993-06-26 David J. MacKenzie <djm@gnu.org>
24854
24855 * doc/bison.texinfo: *** empty log message ***
24856
24857 * doc/bison.1: New file.
24858
248591993-06-25 Richard Stallman <rms@gnu.org>
24860
24861 * src/getargs.c: New file.
24862
248631993-06-16 Richard Stallman <rms@gnu.org>
24864
24865 * src/bison.s1: *** empty log message ***
24866
248671993-06-16 Richard Stallman <rms@gnu.org>
24868
24869 * bison.simple: *** empty log message ***
24870
248711993-06-03 Richard Stallman <rms@gnu.org>
24872
24873 * src/bison.s1: New file.
24874
248751993-06-03 Richard Stallman <rms@gnu.org>
24876
24877 * doc/bison.texinfo: *** empty log message ***
24878
248791993-06-03 Richard Stallman <rms@gnu.org>
24880
24881 * bison.simple: New file.
24882
248831993-05-19 Richard Stallman <rms@gnu.org>
24884
24885 * doc/bison.texinfo: New file.
24886
248871993-05-07 Noah Friedman <friedman@gnu.org>
24888
24889 * Makefile.in: *** empty log message ***
24890
248911993-04-28 Noah Friedman <friedman@gnu.org>
24892
24893 * src/reader.c: *** empty log message ***
24894
248951993-04-23 Noah Friedman <friedman@gnu.org>
24896
24897 * src/alloc.h: entered into RCS
24898
248991993-04-20 David J. MacKenzie <djm@gnu.org>
24900
24901 * src/version.c: *** empty log message ***
24902
24903 * src/files.c, src/allocate.c:
24904 entered into RCS
24905
24906 * src/reader.c: *** empty log message ***
24907
24908 * src/lex.c: entered into RCS
24909
24910 * src/conflicts.c: New file.
24911
24912 * src/symtab.c: entered into RCS
24913
24914 * src/alloc.h: New file.
24915
24916 * src/LR0.c: entered into RCS
24917
249181993-04-18 Noah Friedman <friedman@gnu.org>
24919
24920 * src/reader.c: New file.
24921
24922 * src/version.c: *** empty log message ***
24923
249241993-04-18 Noah Friedman <friedman@gnu.org>
24925
24926 * Makefile.in: *** empty log message ***
24927
249281993-04-17 Noah Friedman <friedman@gnu.org>
24929
24930 * Makefile.in: *** empty log message ***
24931
249321993-04-15 Richard Stallman <rms@gnu.org>
24933
24934 * src/main.c, src/files.c:
24935 New file.
24936
249371993-04-15 Noah Friedman <friedman@gnu.org>
24938
24939 * configure.in: entered into RCS
24940
24941 * configure.in: *** empty log message ***
24942
24943 * configure.in: New file.
24944
249451993-04-14 Richard Stallman <rms@gnu.org>
24946
24947 * Makefile.in: New file.
24948
249491993-04-13 Richard Stallman <rms@gnu.org>
24950
24951 * src/version.c: New file.
24952
249531993-03-25 Richard Stallman <rms@gnu.org>
24954
24955 * src/output.c: entered into RCS
24956
249571992-09-25 Richard Stallman <rms@gnu.org>
24958
24959 * configure.bat: entered into RCS
24960
249611992-06-22 Richard Stallman <rms@gnu.org>
24962
24963 * src/vmsgetargs.c: entered into RCS
24964
249651992-06-22 Richard Stallman <rms@gnu.org>
24966
24967 * doc/bison.rnh: entered into RCS
24968
249691992-04-20 David J. MacKenzie <djm@gnu.org>
24970
24971 * README: entered into RCS
24972
249731992-01-22 Richard Stallman <rms@gnu.org>
24974
24975 * src/machine.h: entered into RCS
24976
249771991-12-21 Richard Stallman <rms@gnu.org>
24978
24979 * src/lalr.c, src/closure.c:
24980 entered into RCS
24981
249821991-12-20 Richard Stallman <rms@gnu.org>
24983
24984 * src/state.h: entered into RCS
24985
249861991-12-18 Richard Stallman <rms@gnu.org>
24987
24988 * src/print.c, src/nullable.c, src/derives.c:
24989 entered into RCS
24990
249911991-11-03 David J. MacKenzie <djm@gnu.org>
24992
24993 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
24994 entered into RCS
24995
249961988-09-09 Richard Stallman <rms@gnu.org>
24997
24998 * src/bison.hairy: entered into RCS
24999
250001987-12-16 Richard Stallman <rms@gnu.org>
25001
25002 * REFERENCES: entered into RCS
25003
25004
25005 -----
25006
25007 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
25008 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
25009 2008, 2009 Free Software Foundation, Inc.
25010
25011 Copying and distribution of this file, with or without
25012 modification, are permitted provided the copyright notice and this
25013 notice are preserved.