]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
cleanup.
[bison.git] / ChangeLog
... / ...
CommitLineData
12009-10-16 Joel E. Denny <jdenny@clemson.edu>
2
3 cleanup.
4 * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead
5 of char*.
6 (Sbitset__isEmpty): Use Sbitset instead of char*.
7 * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char
8 instead of char. This helps to avoid casting errors.
9 (Sbitset__or): Use Sbitset instead of char*.
10
112009-10-16 Joel E. Denny <jdenny@clemson.edu>
12
13 portability: don't assume 8-bit bytes.
14 That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff.
15 * src/Sbitset.h (Sbitset__nbytes): Here.
16 (Sbitset__byteAddress): Here.
17 (Sbitset__bit_mask): Here.
18 (Sbitset__last_byte_mask): Here.
19 (Sbitset__ones): Here.
20 (SBITSET__FOR_EACH): Here.
21
222009-10-11 Joel E. Denny <jdenny@clemson.edu>
23
24 portability: use va_start and va_end in the same function.
25 * src/complain.c (error_message): Move va_end from here...
26 (ERROR_MESSAGE): ... to here.
27
282009-10-08 Joel E. Denny <jdenny@clemson.edu>
29
30 * data/bison.m4: Update comments for rename to muscle-tab.h.
31
322009-10-07 Joel E. Denny <jdenny@clemson.edu>
33
34 Minor code cleanup.
35 * src/muscle-tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and
36 replace all uses with UNIQSTR_CONCAT.
37 * src/uniqstr.c (uniqstr_vsprintf): New function.
38 * src/uniqstr.h (uniqstr_vsprintf): Add prototype.
39 (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New
40 macros.
41
422009-10-06 Joel E. Denny <jdenny@clemson.edu>
43
44 * TODO (Complaint submessage indentation): New.
45
462009-10-04 Joel E. Denny <jdenny@clemson.edu>
47
48 Minor code cleanup.
49 * src/parse-gram.y: Clean up sorting of declarations.
50 Use types to simplify %printer declarations where possible.
51 Provide %printer for BRACKETED_ID and symbol.prec.
52 * src/symtab.c: Whitespace change.
53
542009-10-04 Joel E. Denny <jdenny@clemson.edu>
55
56 tests: skip tests of file names that platform does not support.
57 Reported by Michael Raskin at
58 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
59 * THANKS (Michael Raskin): Add.
60 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
61 to fail at least for file names containing ":" or "\".
62
632009-09-23 Joel E. Denny <jdenny@clemson.edu>
64
65 yysyntax_error: avoid duplicate lookahead collection.
66 Except when memory reallocation is required, this change
67 eliminates the need to invoke yysyntax_error twice and thus to
68 repeat the collection of lookaheads. It also prepares for
69 future extensions that will make those repetitions more
70 expensive and that will require additional memory management in
71 yysyntax_error. Finally, it fixes an obscure bug already
72 exercised in the test suite.
73 * data/yacc.c (yysyntax_error): Add arguments for message
74 buffer variables stored in the parser. Instead of size, return
75 status similar to yyparse status but indicating success of
76 message creation. Other than the actual reallocation of the
77 message buffer, import and clean up memory management code
78 from...
79 (yyparse, yypush_parse): ... here.
80 * tests/regression.at (parse.error=verbose overflow): No longer
81 an expected failure.
82
832009-09-23 Joel E. Denny <jdenny@clemson.edu>
84
85 yysyntax_error: test memory management more.
86 * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro.
87 * tests/regression.at (parse.error=verbose and
88 YYSTACK_USE_ALLOCA): New test group.
89 (parse.error=verbose overflow): New test group that reveals an
90 obscure bug. Expected fail for now.
91
922009-10-04 Joel E. Denny <jdenny@clemson.edu>
93
94 benchmarks: use %debug consistently among grammars.
95 * etc/bench.pl.in (generate_grammar_triangular): Do not activate
96 %debug by default. It can affect the timings even if yydebug=0.
97 (generate_grammar_calc): For consistency with other grammars,
98 use YYDEBUG environment variable to set yydebug.
99
1002009-10-03 Joel E. Denny <jdenny@clemson.edu>
101
102 Remove dead code.
103 * src/symtab.c (symbol_pack): Here because every symbol's number
104 is always defined by this time.
105
1062009-10-03 Alex Rozenman <rozenman@gmail.com>
107
108 Add additional space after periods in NEWS.
109 * NEWS (2.5): here.
110
1112009-09-29 Joel E. Denny <jdenny@clemson.edu>
112
113 Use the correct conversion specifier for size_t.
114 Reported by Jim Meyering.
115 * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu"
116 because Sbitset__Index is size_t.
117 * src/Sbitset.c (Sbitset__fprint): Use it instead of %d.
118
1192009-09-27 Joel E. Denny <jdenny@clemson.edu>
120
121 tests: don't abuse AT_BISON_CHECK.
122 * tests/regression.at (parse-gram.y: LALR = IELR): Move
123 additional shell commands outside of AT_BISON_CHECK.
124
1252009-09-26 Joel E. Denny <jdenny@clemson.edu>
126
127 tests: check that parse-gram.y's IELR and LALR are identical.
128 * tests/atlocal.in (abs_top_srcdir): New shell variable.
129 * tests/regression.at (parse-gram.y: LALR = IELR): New test
130 group.
131
1322009-09-19 Alex Rozenman <rozenman@gmail.com>
133
134 Keep sub-messages aligned. Fix strings for translation.
135 * src/location.h (location_print): Add return value.
136 * src/location.c (location_print): Return number of printed
137 characters.
138 * src/complain.h (complain_at_indent, warn_at_indent): Prototype
139 new functions.
140 * src/complain.cpp (indent_ptr): New static variable.
141 (error_message, complain_at_indent, warn_at_indent): Implement
142 the alignment mechanism.
143 * src/scan-code.l (parse_ref, show_sub_messages): Fix strings
144 for translations. Use new alignment mechanism.
145 * tests/named-ref.at: Adjust test-cases.
146 * NEWS (2.5): Add an announcement about named references.
147
1482009-09-17 Akim Demaille <demaille@gostai.com>
149
150 doc: fixes.
151 * doc/bison.texinfo: here.
152 Reported by Alex Rozenman.
153
1542009-09-16 Akim Demaille <demaille@gostai.com>
155
156 doc: lalr1.cc and variants.
157 * doc/bison.texinfo (Decl Summary): Document the "lex_symbol" and
158 "variant" %define variables.
159 (C++ Semantic Values): Split into...
160 (C++ Unions, C++ Variants): these.
161 The latter is new.
162 (C++ Parser Interface): Fix type names.
163 Document parser::syntax_error.
164 Document the fact that locations are not mandatory.
165 (C++ Scanner Interface): Split into...
166 (Split Symbols, Complete Symbols): these.
167 The later is new.
168 (Calc++ Parsing Driver): Use variants.
169 Add more comments.
170 Adjust style.
171 (Calc++ Parser): Declare all the tokens, no
172 longer accept raw characters.
173 Remove %union.
174 Adjust types and printers.
175 Remove destructors.
176 (Calc++ Scanner): Use make_<SYMBOL> functions.
177 Use strerror in error message.
178
1792009-09-16 Akim Demaille <demaille@gostai.com>
180
181 doc: spell checking.
182 * doc/bison.texinfo: here.
183
1842009-09-16 Akim Demaille <demaille@gostai.com>
185
186 doc: comment changes.
187 * doc/bison.texinfo: Comment changes.
188
1892009-09-16 Akim Demaille <demaille@gostai.com>
190
191 lalr1.cc: factor the yytranslate_ invocation in make_SYMBOLS.
192 * data/c++.m4, data/lalr1.cc (parser::symbol_type): Change the
193 constructor to take a token_type instead of the (internal) symbol
194 number.
195 Call yytranslate_.
196 * data/variant.hh (b4_symbol_constructor_define_): Therefore,
197 don't call yytranslate_ here.
198
1992009-09-16 Akim Demaille <demaille@gostai.com>
200
201 TODO: statistics.
202 * TODO (Figures): New.
203
2042009-09-13 Joel E. Denny <jdenny@clemson.edu>
205
206 tests: clean up push.at test group titles.
207 * tests/push.at: Remove "Push Parsing: " from test group titles
208 because these are already under the banner "Push Parsing Tests".
209
2102009-09-12 Alex Rozenman <rozenman@gmail.com>
211
212 Provide an additional sub-message for clarity.
213 Add "symbol not found in production" error message when
214 an "invalid reference" is detected in named references
215 resolution.
216 * src/scan-code.l: Update "invalid reference" case.
217 * tests/named-ref.at: Adjust test-cases.
218
2192009-09-10 Joel E. Denny <jdenny@clemson.edu>
220
221 Clean up yacc.c a little.
222 * data/yacc.c: Clean up M4 for readability, and make output
223 whitespace more consistent. For the main parse function
224 comment, instead of saying "yyparse or yypush_parse", say either
225 "yyparse" or "yypush_parse" depending on which it actually is.
226
2272009-09-10 Joel E. Denny <jdenny@clemson.edu>
228
229 Fix --enable-gcc-warnings.
230 * src/parse-gram.y (%printer <param>): Handle param_none.
231
2322009-09-09 Akim Demaille <demaille@gostai.com>
233
234 lalr1.cc: syntax_error as exceptions.
235 It is common to use sort of factories in the user actions. These
236 factories may check some "syntactic" constraints that are not
237 enforced by the grammar itself. This is possible using YYERROR
238 within the action itself. Provide the user with a means to throw
239 a syntax_error exception.
240
241 * data/c++.m4 (b4_public_types_declare, b4_public_types_define):
242 Declare and define yy::parser::syntax_error.
243 * data/lalr1.cc: Include stdexcept.
244 (yy::parser::parse): Wrap the user action within a try/catch.
245 * data/glr.cc: Include stdexcept.
246
2472009-09-09 Akim Demaille <demaille@gostai.com>
248
249 lalr1.cc: add missing "inline".
250 * data/c++.m4 (b4_public_types_define): Add missing inline to
251 implementations provided in headers.
252
2532009-09-09 Akim Demaille <demaille@gostai.com>
254
255 %param: documentation.
256 * NEWS (2.6): Document %param, %lex-param, and %parse-param
257 changes.
258 * doc/bison.texinfo: Document that %lex-param and %parse-param
259 are n-ary.
260 Changes some examples to demonstrate it.
261 (Calc++ Parser): Use %param.
262
2632009-09-09 Akim Demaille <demaille@gostai.com>
264
265 Regen.
266
2672009-09-09 Akim Demaille <demaille@gostai.com>
268
269 style changes.
270 * src/parse-gram.y (add_param): Scope changes.
271
2722009-09-09 Akim Demaille <demaille@gostai.com>
273
274 %parse: support several arguments.
275 * src/parse-gram.y (current_param): New.
276 (param_type): Add param_none.
277 (params): New nonterminal.
278 Use it.
279
2802009-09-09 Akim Demaille <demaille@gostai.com>
281
282 Regen.
283
2842009-09-09 Akim Demaille <demaille@gostai.com>
285
286 %param.
287 Provide a means to factor lex-param and parse-param common
288 declarations.
289
290 * src/parse-gram.y (param_type): New.
291 Define a %printer for it.
292 (add_param): Use it.
293 (%parse-param, %lex-param): Merge into...
294 (%parse): this new token.
295 Adjust the grammar to use it.
296 * src/scan-gram.l (RETURN_VALUE): New.
297 (RETURN_PERCENT_FLAG): Use it.
298 (RETURN_PERCENT_PARAM): New.
299 Use it to support %parse-param, %lex-param and %param.
300
3012009-09-03 Joel E. Denny <jdenny@clemson.edu>
302
303 Use aver not assert.
304 * src/output.c: Don't include assert.h.
305 (output_skeleton): Use aver not assert.
306 * src/system.h (aver): In documentation of why, add links to
307 Paul Eggert's explanations in the mailing lists.
308
3092009-09-05 Alex Rozenman <rozenman@gmail.com>
310
311 Use "Unresolved reference" error message when no symbols were found
312 in a symbolic reference resolution. Remove .expr and -expr from
313 the shown reference when the reference is unresolved.
314 * src/scan-code.l: Change the error message, adjust location columns,
315 rename variable "exact_mode" to "explicit_bracketing".
316 * tests/named-ref.at: Adjust existing tests and add a new one.
317
3182009-09-04 Akim Demaille <demaille@gostai.com>
319
320 Adjust synclines in src/parse-gram.[ch].
321 * tests/bison.in: Do some magic (including working around issues
322 with ylwrap) when this wrapper is used to compile
323 src/parse-gram.y.
324
3252009-09-03 Joel E. Denny <jdenny@clemson.edu>
326
327 Complain about unused %define variables and %code qualifiers.
328 * NEWS (2.5): Document.
329 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
330 * doc/bison.texinfo (Decl Summary): Document complaint, and
331 improve %define documentation a little otherwise.
332 * tests/input.at (Reject unused %code qualifiers): Update.
333 (%define errors): Update.
334 (%define, --define, --force-define): Update.
335 (%define backward compatibility): Update.
336 (Unused %define api.pure): Update.
337 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
338
3392009-09-03 Joel E. Denny <jdenny@clemson.edu>
340
341 Don't suppress warnings about unused parse.error.
342 * data/bison.m4 (b4_error_verbose_flag): Don't examine value of
343 %define variable parse.error unless b4_error_verbose_flag is
344 actually expanded in a skeleton.
345
3462009-09-03 Akim Demaille <demaille@gostai.com>
347
348 * NEWS (2.4.2): Add "Internationalization" item.
349
3502009-09-03 Akim Demaille <demaille@gostai.com>
351
352 bootstrap: fix/improve find_tool.
353 * bootstrap (find_tool): Improve error messages.
354 Fix typo about find_tool_names.
355
3562009-08-29 Joel E. Denny <jdenny@clemson.edu>
357
358 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
359 See
360 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
361 * src/scan-code.h (code_props_rule_action_init): Rename
362 named_ref arg to name so it doesn't shadow named_ref type. This
363 makes it consistent with the function definition in scan-code.l
364 anyway.
365
3662009-08-28 Joel E. Denny <jdenny@clemson.edu>
367
368 %define: accept unquoted values.
369 * NEWS (2.5): Group all %define changes together, and document
370 this one. Remove quotes in IELR and canonical LR entry.
371 * doc/bison.texinfo: Remove quotes in most examples throughout.
372 (Decl Summary): Update %define documentation.
373 (Table of Symbols): Likewise.
374 * src/ielr.c (LrType): Update documentation.
375 * src/parse-gram.y (content.opt): Add production for ID.
376 * tests/actions.at: Remove quotes in most tests.
377 * tests/calc.at: Likewise.
378 * tests/existing.at: Likewise.
379 * tests/input.at: Likewise.
380 * tests/local.at: Likewise.
381 * tests/push.at: Likewise.
382 * tests/reduce.at: Likewise.
383 * tests/torture.at: Likewise.
384
3852009-08-28 Joel E. Denny <jdenny@clemson.edu>
386
387 %define lr.type: make values lowercase IDs.
388 That is, "LALR" => "lalr", "IELR" => "ielr", and
389 "canonical LR" => "canonical-lr".
390 * NEWS (2.5): Update documentation.
391 * doc/bison.texinfo (Decl Summary): Likewise.
392 * src/ielr.c (ielr): Use new values.
393 * src/ielr.h (ielr): Update documentation.
394 * src/reader.c (prepare_percent_define_front_end_variables): Use
395 and validate new values.
396 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
397 grammars.
398 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
399
4002009-08-27 Eric Blake <ebb9@byu.net>
401
402 scan-gram: avoid portability trap with ctype usage.
403 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
404 Avoid compiler warning.
405
4062009-08-27 Joel E. Denny <jdenny@clemson.edu>
407
408 tests: use perl for printing special sequences to files.
409 And skip tests if perl is not available. This is better than
410 playing tricks with shell portability. Suggested by Akim
411 Demaille.
412 * tests/input.at (Bad character literals): Use it here for
413 omitting final newlines.
414 (Bad escapes in literals): Use it here for special characters.
415
4162009-08-26 Joel E. Denny <jdenny@clemson.edu>
417
418 tests: show a use of %define lr.default-reductions "consistent"
419 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
420 prevents the omission of expected tokens for %error-verbose.
421
4222009-08-26 Akim Demaille <demaille@gostai.com>
423
424 tests: portability fix.
425 * tests/input.at (Bad escapes in literals): Don't expect "echo
426 '\0'" to output \ then 0.
427
4282009-08-26 Joel E. Denny <jdenny@clemson.edu>
429
430 Actually handle the yytable zero value correctly this time.
431 * data/bison.m4 (b4_integral_parser_tables_map): Don't mention
432 zero values in the YYTABLE comments.
433 * data/glr.c (yytable_value_is_error): Don't check for zero
434 value.
435 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
436 * data/yacc.c (yytable_value_is_error): Likewise.
437 * data/lalr1.java (yy_table_value_is_error_): Likewise.
438 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
439 * src/tables.h: In header comments, explain why it's useless to
440 check for a zero value in yytable.
441
4422009-08-25 Joel E. Denny <jdenny@clemson.edu>
443
444 More fixes related to last two patches.
445 * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE
446 comments: zero indicates syntax error not default action.
447 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
448 defined.
449 * data/glr.c (yyis_pact_ninf): Rename to...
450 (yypact_value_is_default): ... this.
451 (yyisDefaultedState): Update for rename.
452 (yyis_table_ninf): Rename to...
453 (yytable_value_is_error): ... this, and check for value zero
454 besides just YYTABLE_NINF.
455 (yygetLRActions): Check for default value from yypact. It
456 appears that this check is always performed before this function
457 is invoked, and so adding the check here is probably redundant.
458 However, the code may evolve after this subtlety is forgotten.
459 Also, update for rename to yytable_value_is_error. Because that
460 macro now checks for zero, a different but equivalent branch of
461 the if-then-else here is evaluated.
462 (yyreportSyntaxError): Update for rename to
463 yytable_value_is_error. The zero condition was mishandled
464 before.
465 (yyrecoverSyntaxError): Update for renames. No behavioral
466 changes.
467 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
468 New function.
469 (yy_table_value_is_error_): New function.
470 (parse): Use new functions where possible. No behavioral
471 changes.
472 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
473 The zero condition was mishandled before.
474 * data/yacc.c (yyis_pact_ninf): Rename to...
475 (yypact_value_is_default): ... this.
476 (yyis_table_ninf): Rename to...
477 (yytable_value_is_error): ... this, and check for value zero
478 besides just YYTABLE_NINF.
479 (yysyntax_error): Update for rename to yytable_value_is_error.
480 The zero condition was mishandled before.
481 (yyparse): Update for renames. No behavioral changes.
482 * src/tables.h: Improve comments about yypact, yytable, etc.
483 more. Most importantly, say yytable value of zero means syntax
484 error not default action.
485
4862009-08-25 Joel E. Denny <jdenny@clemson.edu>
487
488 Fix %error-verbose for conflicts resolved by %nonassoc.
489 * NEWS (2.5): Document.
490 * data/glr.c (yyreportSyntaxError): Fix this by checking
491 yyis_table_ninf.
492 * data/yacc.c (yysyntax_error): Likewise.
493 * data/lalr1.cc (yysyntax_error_): Fix this by checking
494 yytable_ninf_.
495 * data/lalr1.java (yysyntax_error): Likewise.
496 * tests/conflicts.at (%nonassoc and eof): Update expected output
497 and remove FIXME.
498
4992009-08-25 Joel E. Denny <jdenny@clemson.edu>
500
501 Some code and documentation improvements.
502 * data/c.m4 (b4_table_value_equals): New macro to capture
503 some repeated code.
504 * data/glr.c (yyis_pact_ninf): Use it here.
505 (yyis_table_ninf): Likewise.
506 (yyreportSyntaxError): Improve internal comments.
507 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
508 Use it everywhere possible.
509 (yyis_table_ninf): Likewise.
510 (yysyntax_error): Improve internal comments.
511 * data/lalr1.cc (yysyntax_error_): Likewise.
512 * data/lalr1.java (yysyntax_error): Likewise.
513 * src/tables.h: Improve comments about yypact, yytable, etc.
514
5152009-08-21 Joel E. Denny <jdenny@clemson.edu>
516
517 Use locale when quoting.
518 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
519 quote rather than implementing quoting here.
520
5212009-08-20 Eric Blake <ebb9@byu.net>
522
523 Make previous patch more robust.
524 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
525 argmatch.h.
526 (output_skeleton): Use it.
527 Suggested by Akim Demaille.
528
529 Import latest m4/m4.m4.
530 * submodules/autoconf: Update to autoconf 2.64.
531 * configure.ac (M4_GNU_OPTION): New define.
532 * src/output.c (output_skeleton): Use it to resolve FIXME.
533 * NEWS: Mention this.
534
5352009-08-19 Joel E. Denny <jdenny@clemson.edu>
536
537 Fix complaints about escape sequences.
538 Discussed starting at
539 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
540 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
541 For a \0 and similar escape sequences meaning the null
542 character, report an invalid escape sequence instead of an
543 invalid null character because the latter does not actually
544 appear in the user's input.
545 In all escape sequence complaints, don't escape the initial
546 backslash, and don't quote when the sequence appears at the end
547 of the complaint line unless there's whitespace that quotearg
548 won't escape.
549 Consistently say "invalid" not "unrecognized".
550 Consistently prefer "empty character literal" over "extra
551 characters in character literal" warning for invalid escape
552 sequences; that is, consistently discard those sequences.
553 * tests/input.at (Bad escapes in literals): New.
554
5552009-08-19 Akim Demaille <demaille@gostai.com>
556
557 doc: fixes.
558 * doc/bison.texinfo: Fix minor Texinfo errors.
559
5602009-08-19 Akim Demaille <demaille@gostai.com>
561
562 tests: distcc compliance.
563 * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's
564 error messages from the output.
565
5662009-08-19 Akim Demaille <demaille@gostai.com>
567
568 variables: simplify the upgrade of namespace into api.namespace.
569
570 This patch simplifies "variables: rename namespace as
571 api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c.
572 Suggested by Joel E. Denny in
573 http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html
574
575 * src/muscle-tab.c (muscle_percent_variable_update): New.
576 (muscle_percent_define_insert): Use it in replacement of the
577 previous tr invocation.
578 Remove variable_tr, no longer needed.
579 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
580 Remove.
581 * data/c++.m4: No longer handle namespace -> api.namespace.
582 * tests/input.at (%define backward compatibility): Check that
583 namespace is treated as api.namespace.
584
5852009-08-19 Akim Demaille <demaille@gostai.com>
586
587 doc: %initial-action to initialize yylloc.
588 Reported by Bill Allombert.
589 * doc/bison.texinfo: Set fill-column to 76.
590 (Location Type): Document the use of %initial-action to initialize
591 yylloc.
592
5932009-08-19 Akim Demaille <demaille@gostai.com>
594
595 lalr1.cc: use state_type.
596 * data/lalr1.cc (yysyntax_error_): Use state_type.
597 Move argument names into yy*.
598
5992009-08-19 Akim Demaille <demaille@gostai.com>
600
601 lalr1.cc: get rid of yyparse's yystate.
602 yystate and yystack_[0].state are equal, keep only the latter.
603 The former was also used as a temporary variable to compute the
604 post-reduction state. Move this computation into an auxiliary
605 function.
606
607 * data/glr.c (yyLRgotoState): Fuse variable definition and first
608 assignment.
609 * data/lalr1.cc (yy_lr_goto_state_): New.
610 (yyparse): Use it.
611 Replace remaining uses of yystate by yystate_[0].state.
612 Remove the former.
613
6142009-08-19 Akim Demaille <demaille@gostai.com>
615
616 lalr1.cc: destroy $$ when YYERROR is called.
617 * data/lalr1.cc (yyreduce): Compute the resulting state before
618 running the user action so that yylhs is a valid symbol.
619 (yyerrorlab): Since yylhs is complete (it knows its type), we can
620 simply call yy_destroy_ to destroy $$ on YYERROR invocations.
621 * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants.
622
6232009-08-18 Joel E. Denny <jdenny@clemson.edu>
624
625 maint: update for gnulib's recent update-copyright changes
626 * gnulib: Update.
627 * .x-update-copyright (COPYING): Add as it's no longer implied
628 when .x-update-copyright is present.
629 * cfg.mk (update-copyright-local): Remove, now ignored.
630 (update-copyright): Declare update-b4-copyright as a dependency.
631
6322009-08-17 Akim Demaille <demaille@gostai.com>
633
634 build: require gettext 0.17.
635
636 Suggested by Bruno Haible.
637 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
638 * configure.ac: require gettext 0.17 to ensure compatibility with
639 gnulib.
640
6412009-08-17 Akim Demaille <demaille@gostai.com>
642
643 build: lower gettext requirements.
644
645 Bison was uselessly requiring the formatstring macros from
646 gettext, which resulted in mo files not being installed on systems
647 that perfectly supported Bison mo files. Lower the requirement.
648 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
649
650 * configure.ac: Require need-ngettext instead of
651 need-formatstring-macros.
652 Reported by Martin Jabocs.
653 Suggested by Bruno Haible.
654 * INSTALL: Restructure.
655 (Internationalization): New.
656
6572009-08-14 Joel E. Denny <jdenny@clemson.edu>
658
659 maint: fix use of copyright year intervals.
660 * gnulib: Update.
661 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
662 as now recommended in gnulib/NEWS.
663 * build-aux/update-b4-copyright: Fix.
664 * cfg.mk (update-copyright-env): Configure update-copyright.
665
6662009-08-13 Joel E. Denny <jdenny@clemson.edu>
667
668 Make it easier to write deterministic tests.
669 Continues Akim's work from his 2009-06-10 commits.
670 * src/reader.c (check_and_convert_grammar): Don't add any
671 symbols after the first symbols_do invocation.
672 * src/symtab.c (symbols_sorted): New static global.
673 (user_token_number_redeclaration): Update comments.
674 (symbol_from_uniqstr): If a new symbol is being created, assert
675 that symbols_sorted hasn't been allocated yet.
676 (symbols_free): Free symbols_sorted.
677 (symbols_cmp, symbols_cmp_qsort): New functions.
678 (symbols_do): Sort symbol_table into symbols_sorted on first
679 invocation.
680 * tests/input.at (Numbered tokens): Recombine tests now that the
681 output should be deterministic across multiple numbers.
682
6832009-08-12 Akim Demaille <demaille@gostai.com>
684
685 tests: GCC 4.5 compliance.
686 * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's
687 messages about #error.
688
6892009-08-12 Akim Demaille <demaille@gostai.com>
690
691 build: fix the generation of the documentation.
692 Some of our targets use "bison --help", but they can't depend on
693 "bison" itself (to avoid additional requirements on the user), so
694 they used to call "make src/bison" in the commands. Then
695 concurrent builds may fail: one make might be aiming one of its
696 jobs at compiling src/bison, and another job at generating the man
697 page. If the latter is faster than the former, then we have two
698 makes that concurrently try to compile src/bison.
699
700 This might also be a more convincing explanation for the failure
701 described in the patch "build: fix paths".
702
703 * Makefile.am (SUFFIXES): Initialize.
704 * build-aux/move-if-change: New, symlink to gnulib's.
705 * build-aux/local.mk: Ship it.
706 * doc/common.x: Remove, merged into...
707 * doc/bison.x: here.
708 * doc/local.mk (doc/bison.help): New.
709 ($(CROSS_OPTIONS_TEXI)): Depend on it.
710 Use src/bison.
711 (.x.1): Replace with...
712 (doc/bison.1): this explicit, simpler, target.
713 (common_dep): Remove, inlined where appropriate.
714 (SUFFIXES, PREPATH): Remove, unused.
715
7162009-08-12 Akim Demaille <demaille@gostai.com>
717
718 gnulib: improve prefixing.
719 * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather,
720 change the value of...
721 (gl_LIBOBJS): this.
722 Adjust more variables.
723 * etc/prefix-gnulib-mk (prefix_assignment): Don't rename
724 gl_LIBOBJS.
725 (prefix): Also transform rules whose targets have slashes.
726 Use $prefix liberally.
727 Map @MKDIR_P@ to $(MKDIR_P).
728 Prefix directories that are mkdir'd.
729
7302009-08-12 Akim Demaille <demaille@gostai.com>
731
732 build: fix paths.
733 When using $(top_builddir) inconsistently, Make (including GNU
734 Make) is sometimes confused. As a result it may want to build
735 lib/libbison.la and $(top_builddir)/lib/libbison.la (the same
736 file, different names) concurrently, which, amusingly enough,
737 might end with:
738
739 ranlib lib/libbison.a
740 ranlib lib/libbison.a
741 make[2]: *** [lib/libbison.a] Segmentation fault
742
743 on OS X.
744
745 * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not
746 needed.
747
7482009-08-12 Akim Demaille <demaille@gostai.com>
749
750 distcheck: fix.
751
752 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
753
7542009-08-10 Joel E. Denny <jdenny@clemson.edu>
755
756 * tests/local.mk (TESTSUITE_AT): Add named-refs.at.
757
7582009-08-10 Joel E. Denny <jdenny@clemson.edu>
759
760 Miscellaneous code readability improvements.
761
762 * src/reader.c (reader): Move %define front-end variable
763 defaults and checking into...
764 (prepare_percent_define_front_end_variables): ... this new
765 function.
766
767 * src/scan-gram.l (INITIAL): For consistency with string
768 literals, don't store open quote on character literal. It's
769 discarded before returning anyway.
770 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
771 Make length test more readable, and make the character stored
772 for an empty literal more obvious while consistent with the
773 previous behavior.
774
775 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
776 USER_NUMBER_HAS_STRING_ALIAS throughout.
777 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
778 that is repeated in symtab.h. Improve argument names to make it
779 clear which side of the symbol-string alias pair is which.
780 (symbol_check_alias_consistency): Improve local variable names
781 for the same purpose.
782 * src/symtab.h (struct symbol): Make comments about aliases
783 clearer.
784 (symbol_make_alias): Improve comments and argument name.
785 * src/output.c (token_definitions_output): Update for rename to
786 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
787
7882009-08-08 Alex Rozenman <rozenman@gmail.com>
789
790 Convert "misleading reference" messages to warnings.
791 * src/scan-code.l: New function 'show_sub_messages', more
792 factoring.
793 * tests/named-ref.at: Adjust tests.
794
7952009-08-06 Joel E. Denny <jdenny@clemson.edu>
796
797 maint: run "make update-copyright"
798
7992009-08-06 Joel E. Denny <jdenny@clemson.edu>
800
801 maint: make update-b4-copyright easier to use
802 * build-aux/update-b4-copyright: In warnings, report line
803 numbers rather than character positions.
804 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
805 that update-copyright runs it.
806 * gnulib: Update.
807
8082009-08-05 Joel E. Denny <jdenny@clemson.edu>
809
810 maint: clean up update-b4-copyright code
811 * build-aux/update-b4-copyright: Do not accept 2-digit
812 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
813 Don't accept a `[' in a b4_copyright argument.
814 Format code more consistently.
815 Don't assume b4*copyright never occurs.
816
8172009-08-04 Joel E. Denny <jdenny@clemson.edu>
818
819 maint: automate b4_copyright updates.
820 * Makefile.am (update-b4-copyright): New target rule.
821 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
822 * build-aux/update-b4-copyright: New.
823 * data/yacc.c: Remove stray characters around b4_copyright
824 invocations.
825
8262009-08-04 Joel E. Denny <jdenny@clemson.edu>
827
828 maint: automate annual package-wide copyright-year update.
829 * .x-update-copyright: New.
830 * Makefile.am (EXTRA_DIST): Remove maint.mk.
831 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
832 update-copyright. Remove gnumakefile, which is implied by
833 maintainer-makefile.
834 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
835 * gnulib: Update.
836 * maint.mk: Remove, now copied from gnulib.
837 * examples/extexi: Add missing "(C)" in copyright statement so
838 update-copyright can recognize it.
839 * src/LR0.h: Likewise.
840 * src/print.h: Likewise.
841 * src/print_graph.h: Likewise.
842 * src/gram.c: Add missing comma in copyright statement.
843 * src/gram.h: Likewise.
844
8452009-08-04 Joel E. Denny <jdenny@clemson.edu>
846
847 Fix "make distcheck".
848 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
849 of just calc.stamp.
850
8512009-08-01 Joel E. Denny <jdenny@clemson.edu>
852
853 Pacify "gcc -Wunused" for the input function from Flex.
854 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
855 and later.
856 * src/scan-code.l: Add "%option noinput", which I cannot find in
857 the Flex manual, but which Flex has supported since at least as
858 far back as 2.5.4. However, if any of our developers still use
859 Flex 2.5.4, they'll need to stop configuring with
860 --enable-gcc-warnings because "%option noinput" didn't work
861 correctly until Flex 2.5.6.
862 * src/scan-gram.l: Likewise.
863 * src/scan-skel.l: Likewise.
864
8652009-07-31 Alex Rozenman <rozenman@gmail.com>
866
867 Fix --enable-gcc-warnings problems.
868 * src/reader.c: Adjust variable names.
869 * src/scan-code.l: Fix prototypes and adjust names.
870 * src/named-ref.c: Remove redundant "if".
871
8722009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
873
874 Fix a --enable-gcc-warnings problem.
875 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
876 variable.
877
8782009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
879
880 Warn about character literals not of length one.
881 * NEWS (2.5): Document.
882 * src/scan-gram.l (INITIAL): Remove comment that we don't check
883 the length.
884 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
885 * tests/input.at (Bad character literals): New test group.
886
8872009-07-24 Alex Rozenman <rozenman@gmail.com>
888
889 Fix some memory leaks.
890 * src/named-ref.c: Add a pointer check (named_ref_free).
891 * src/scan-code.l: New function (variant_table_free). Called in
892 code_scanner_free.
893 * src/symlist.c: Call to named_ref_free (symbol_list_free).
894
8952009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
896
897 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
898
8992009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
900
901 Some M4 cleanup in the testsuite.
902 Suggested by Eric Blake at
903 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
904 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
905 complicate the code by distinguishing between a missing value
906 and an empty string value for an optional argument. This fix is
907 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
908 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
909 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
910 arguments are not needed because of the following changes.
911 Fix stale comments.
912 Bison developers should use GNU M4 and should not use
913 POSIXLY_CORRECT when building the test suite, so do not
914 complicate the code by avoiding $10 and above.
915 Do not quote an empty string value for an optional argument, and
916 do not distinguish between a missing value and an empty string
917 value.
918
9192009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
920
921 Revert unnecessary column realignment in --help output.
922 Reported by Akim Demaille at
923 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
924 * src/getargs.c (usage): Here.
925
9262009-07-04 Alex Rozenman <rozenman@gmail.com>
927
928 Alphabetical order in src/local.mk.
929 * src/local.mk: Adjust.
930
9312009-07-04 Alex Rozenman <rozenman@gmail.com>
932
933 Style changes and factoring.
934 * src/named-ref.h: Add comments.
935 * src/parse-gram.y: Readability and style changes.
936 * src/reader.c: Factoring: assign_named_ref function.
937 * src/scan-code.l: Factoring and style changes. Rename
938 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
939 Use "unsigned" type for variant index. Improve readablity.
940 * src/scan-gram.l: Change error messages and add comments.
941 * src/symlist.h: symbol_list_null: New function decl.
942 * src/symlist.c: symbol_list_null: Implement here.
943 * tests/named-refs.at: Adjust for new error messages.
944
9452009-06-29 Eric Blake <ebb9@byu.net>
946
947 scan-code: avoid compiler warnings
948 * src/scan-code.l (parse_named_ref): Use correct specifiers.
949
9502009-06-29 Akim Demaille <demaille@gostai.com>
951
952 build: avoid concurrent extraction of calc++.
953 * examples/calc++/Makefile.am (calc.stamp): New.
954 Depend on it to create the sources of calc++ so that concurrent
955 builds don't launch several "extexi" in parallel.
956 Not only this is inefficient, this also builds incorrect sources
957 with several extractions mixed together.
958
9592009-06-29 Akim Demaille <demaille@gostai.com>
960
961 parse.error: fix.
962 * data/bison.m4: Move code related to specific variables after the
963 definition of the variable-maintaining macros so that we don't
964 "invoke" b4_percent_define_check_values before it is defined.
965
9662009-06-29 Akim Demaille <demaille@gostai.com>
967
968 variables: parse.error
969
970 Implement, document, and test the replacement of %error-verbose
971 by %define parse.error "verbose".
972 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
973 values of the parse.error variable.
974 Make "simple" its default value.
975 Check the valid values.
976 * src/parse-gram.y: Use %define parse.error.
977 (PERCENT_ERROR_VERBOSE): New token.
978 Support it.
979 * src/scan-gram.l: Support %error-verbose.
980
981 * doc/bison.texinfo (Decl Summary): Replace the documentation of
982 %define error-verbose by that of %define parse.error.
983 * NEWS: Document it.
984
985 * tests/actions.at, tests/calc.at: Use parse.error instead of
986 %error-verbose.
987
9882009-06-27 Alex Rozenman <rozenman@gmail.com>
989
990 Implement support for named symbol references.
991 * src/parse-gram.y: Add new syntax (named_ref.opt).
992 * src/reader.c: Store named refs in symbol lists.
993 * src/reader.h: New argument for symbol_append and
994 action_append functions.
995 * src/scan-code.h: Add new field (named_ref) into
996 code_props data structure. Keeps named ref of midrule
997 actions.
998 * src/scan-code.l: Support for named refs in semantic
999 action code. New function 'parse_named_ref'.
1000 * src/scan-gram.l: Support bracketed id.
1001 * src/symlist.c: Store named refs in symbol lists.
1002 * src/symlist.h: New field in symbol list: named_ref.
1003 * src/named-ref.h: New file, a struct for named_ref.
1004 * src/named-ref.cp: New file, named_ref_new function.
1005 * src/local.mk: Add two new files.
1006 * tests/testsuite.at: Include new test group:
1007 * tests/named-refs.at: this new file.
1008
10092009-06-25 Akim Demaille <demaille@gostai.com>
1010
1011 hash: check insertion for memory exhaustion.
1012 * src/uniqstr.c (uniqstr_new): New.
1013
10142009-06-24 Akim Demaille <demaille@gostai.com>
1015
1016 variables: rename namespace as api.namespace.
1017 Discussed in
1018 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
1019
1020 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1021 New.
1022 (b4_percent_define_use): New.
1023 Use it where applicable.
1024 * data/c++.m4: Replace uses of the variable "namespace" by
1025 "api.namespace".
1026 Default the latter to the former.
1027 * doc/bison.texinfo (Decl Summary): Document "namespace" as
1028 obsolete.
1029 Document api.namespace.
1030 Use @samp to document %define uses, keep @code for identifiers.
1031 * NEWS: Likewise.
1032 * tests/c++.at, tests/input.at: Test api.namespace instead of
1033 namespace. (The tests passed with namespace.)
1034
10352009-06-11 Akim Demaille <demaille@gostai.com>
1036
1037 style changes.
1038 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
1039 * src/print-xml.c: Style changes.
1040 * tests/conflicts.at: Comment changes.
1041
10422009-06-11 Akim Demaille <demaille@gostai.com>
1043
1044 xml: beware of user strings used to give a %prec to rules.
1045 * tests/conflicts.at (%prec with user strings): New.
1046 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
1047 XML output.
1048
10492009-06-11 Akim Demaille <demaille@gostai.com>
1050
1051 hash: check insertion for memory exhaustion.
1052 * src/muscle-tab.c (muscle_insert, muscle_grow)
1053 * src/state.c (state_hash_insert): Check the return value of
1054 hash_insert.
1055
10562009-06-11 Akim Demaille <demaille@gostai.com>
1057
1058 tests: honor TESTSUITEFLAGS in every check target.
1059 * tests/local.mk (RUN_TESTSUITE): New.
1060 (check-local, installcheck-local, maintainer-check-g++)
1061 (maintainer-check-posix, maintainer-check-valgrind): Use it.
1062
10632009-06-10 Akim Demaille <demaille@gostai.com>
1064
1065 deterministic test suite.
1066 Some consistency checks on symbols are performed after all the
1067 symbols were read, by an iteration over the symbol table. This
1068 traversal is nondeterministic, which can be a problem for test
1069 cases.
1070 Avoid this.
1071 Addresses another form of nondeterminism reported by Joel E. Denny.
1072 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1073
1074 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
1075 test in two.
1076 Use different file names for the three tests to make the
1077 maintenance easier.
1078
10792009-06-10 Akim Demaille <demaille@gostai.com>
1080
1081 gnulib: update.
1082 * gnulib: Update to latest.
1083 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
1084 * m4/.gitignore: Regen.
1085 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
1086 Call xalloc_die on hash_insert failures.
1087 Requested by the new __warn_unused_result__ attribute of
1088 hash_insert.
1089
10902009-06-10 Akim Demaille <demaille@gostai.com>
1091
1092 deterministic user-token-number redeclaration errors.
1093 Address nondeterminism reported by Joel E. Denny.
1094 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1095
1096 * src/uniqstr.h: Comment changes.
1097 * src/location.h (boundary_cmp, location_cmp): New.
1098 * src/symtab.c (user_token_number_redeclaration): New.
1099 (symbol_translation): Use it.
1100 * tests/input.at (Numbered tokens): Adjust the expected output.
1101
11022009-05-25 Akim Demaille <demaille@gostai.com>
1103
1104 build: avoid ignored errors.
1105 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
1106 errors, they pollute the output.
1107
11082009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1109
1110 Convert multiple variable definition warnings to complaints.
1111 * NEWS (2.5): Add a new entry for that change.
1112 * doc/bison.texinfo (Decl Summary): Update %define entry.
1113 (Bison Options): Update -D/--define/-F/--force-define entry.
1114 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
1115 * src/muscle-tab.h (muscle_percent_define_insert): Update
1116 comments.
1117 * tests/input.at (`%define errors'): Update.
1118 (`%define, --define, --force-define'): Update.
1119
11202009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1121
1122 -F/--force-define and relative %define/-D/--define priorities.
1123 * NEWS (2.5): Add documentation to -D/--define entry.
1124 * build-aux/cross-options.pl: Hard-code association of
1125 --force-define with %define.
1126 * doc/bison.texinfo (Decl Summary): In %define entry,
1127 cross-reference command-line options.
1128 (Bison Options): Add documentation to -D/--define entry.
1129 (Option Cross Key): Widen column for --force-define row.
1130 * src/getargs.c (usage): Document -F/--force-define. Realign
1131 options in output.
1132 (short_options, long_options, getargs): Parse -F/--force-define,
1133 and update muscle_percent_define_insert invocations.
1134 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
1135 (muscle_percent_define_insert): Add argument with that type.
1136 * src/muscle-tab.c (muscle_percent_define_insert): Implement
1137 -F/--force-define behavior and priorities.
1138 (muscle_percent_define_ensure): Update
1139 muscle_percent_define_insert invocation.
1140 * src/parse-gram.y (prologue_declaration): Update
1141 muscle_percent_define_insert invocations.
1142 * tests/input.at (`%define, --define'): Rename to...
1143 (`%define, --define, --force-define'): ... this and extend.
1144
11452009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1146
1147 Update some comments to make sense for -D.
1148 * data/bison.m4 (b4_check_user_names): In header comments, say
1149 "user occurrence" instead of "grammar occurrence".
1150 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
1151 (muscle_percent_code_grow): Likewise just for consistency.
1152
11532009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1154
1155 * data/c++.m4 (b4_namespace_close): Simplify slightly.
1156
11572009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
1158
1159 Handle a trailing `:' in a user-supplied C++ namespace better.
1160 * data/c++.m4 (b4_namespace_close): Don't let it be printed
1161 among the closing braces here. This fix might make the
1162 generated code easier to debug, but otherwise it should be
1163 insignificant because a trailing `:' is a C++ error already.
1164
11652009-05-19 Akim Demaille <demaille@gostai.com>
1166
1167 remove useless variable.
1168 * src/getargs.c (skeleton_arg): Remove now useless variable.
1169 Should help the compiler see that this printf-like call is sane.
1170
11712009-05-15 Akim Demaille <demaille@gostai.com>
1172
1173 Rename token.prefix as api.tokens.prefix.
1174 Discussed here.
1175 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
1176
1177 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
1178 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
1179 (token.prefix): Rename as...
1180 (api.tokens.prefix): this.
1181
11822009-05-11 Akim Demaille <demaille@gostai.com>
1183
1184 doc: use C++ headers.
1185 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
1186 headers.
1187
11882009-05-11 Akim Demaille <demaille@gostai.com>
1189
1190 doc: token.prefix
1191 * doc/bison.simple (Decl Summary): Document token.prefix.
1192 (Calc++ Parser): Various fixes.
1193 Formatting changes.
1194 Use token.prefix.
1195 Introduce a macro TOKEN to shorten the code and make it more
1196 readable.
1197 (Calc++ Scanner): Adjust.
1198 * NEWS (Variable token.prefix): New.
1199
12002009-05-04 Akim Demaille <demaille@gostai.com>
1201
1202 bison: catch bad symbol names.
1203 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
1204 * tests/input.at: Adjust.
1205
12062009-05-04 Akim Demaille <demaille@gostai.com>
1207
1208 identifiers: dashes are letters.
1209 Dashes can now start identifiers (symbols and directives).
1210
1211 * src/scan-gram.l ({letter}): Add dash.
1212 ({id}): Remove it.
1213 * tests/input.at (Symbols): Adjust.
1214 Remove stray comment.
1215 * tests/regression.at (Invalid inputs): Adjust error message.
1216 * doc/bison.texinfo (Symbols): Update.
1217
12182009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
1219
1220 Declare %code to be a permanent feature.
1221 * NEWS (2.4.2): Here.
1222 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
1223 experimental.
1224 (Decl Summary): Likewise.
1225
12262009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1227
1228 Convert underscores to dashes in some %define variable names.
1229 For now, just api.push-pull and lr.keep-unreachable-states.
1230 Maintain old names for backward compatibility.
1231 * NEWS (2.5): Document.
1232 * data/c.m4 (b4_identification): Update comment.
1233 * data/yacc.c: Update access.
1234 * doc/bison.texinfo: Update.
1235 * etc/bench.pl.in (bench_push_parser): Update use.
1236 * src/files.c (tr): Move to...
1237 * src/getargs.c, src/getargs.h (tr): ... here because I can't
1238 think of a better place to expose it. My logic is that, for all
1239 uses of tr so far, command-line arguments can be involved, and
1240 getargs.h is already included.
1241 * src/main.c (main): Update access.
1242 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
1243 variable names to new variable names before assigning value.
1244 * src/reader.c (reader): Update setting default.
1245 * tests/calc.at: Update uses.
1246 * tests/conflicts.at (Unreachable States After Conflict
1247 Resolution): Update use.
1248 * tests/input.at (%define enum variables): Update use.
1249 (%define backward compatibility): New test group.
1250 * tests/push.at: Update uses.
1251 * tests/reduce.at: Update uses.
1252 * tests/torture.at: Update uses.
1253
12542009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1255
1256 Set all front-end %define defaults in one place.
1257 * src/main.c (main): Move lr.keep_unreachable_states default...
1258 * src/reader.c (reader): ... to here.
1259
12602009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1261
1262 Rename lr.default_reductions to lr.default-reductions.
1263 * NEWS (2.5): Here.
1264 * doc/bison.texinfo: Here.
1265 * src/lalr.c (initialize_LA): Here.
1266 * src/print.c (print_reductions): Here.
1267 * src/reader.c (reader): Here.
1268 * src/tables.c (action_row): Here.
1269 * tests/input.at (%define enum variables): Here.
1270 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
1271
12722009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1273
1274 Pacify ./configure --enable-gcc-warnings.
1275 * tests/input.at (Symbols): Prototype yyerror and yylex.
1276
12772009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1278
1279 Document how `%define "var" "value"' is not M4-friendly.
1280 * src/parse-gram.y (variable): In comments here.
1281
12822009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1283
1284 Clean up recent patches a little.
1285 Reported by Akim Demaille.
1286 * doc/bison.texinfo (Understanding): Fix typos.
1287 * src/print.c (print_reductions): Don't use negated variable.
1288
12892009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1290
1291 List accepted values for a %define enum variable with an invalid value.
1292 Suggested by Akim Demaille at
1293 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
1294 * data/bison.m4 (_b4_percent_define_check_values): Implement.
1295 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
1296 * tests/input.at (%define lr.default_reductions invalid values): Merge
1297 into...
1298 (%define enum variables): ... here, and update output.
1299
13002009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
1301
1302 Rename "default rule" to "default reduction".
1303 This includes changing variable names in code, changing
1304 comments, and renaming %define lr.default_rules to %define
1305 lr.default_reductions.
1306 * NEWS (2.5): Update IELR documentation.
1307 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
1308 documentation.
1309 * data/glr.c, data/lalr1.java: Sync copyright dates.
1310 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
1311 and lr.type documentation. Make some other wording
1312 improvements.
1313 (Glossary): Adjust cross-references and Default Reduction
1314 definition.
1315 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
1316 Remove a confusing comment pointed out by Akim Demaille.
1317 (initialize_LA): Adjust code.
1318 * src/print-xml.c (print_reductions): Adjust code.
1319 * src/print.c (print_reductions): Adjust code.
1320 * src/reader.c (reader): Adjust code.
1321 * src/tables.c (action_row): Adjust code.
1322 (token_actions): Adjust code.
1323 * src/tables.h: Adjust YYDEFACT documentation.
1324 * tests/input.at (%define lr.default_rules invalid values):
1325 Rename test group to...
1326 (%define lr.default_reductions invalid values): ... this, and
1327 update grammar file and expected output.
1328 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
1329 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
1330
13312009-04-21 Akim Demaille <demaille@gostai.com>
1332
1333 tests: check the use of dashes and periods in symbols.
1334 * tests/input.at (Symbol): New test group.
1335
13362009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1337
1338 Document %define lr.type and lr.default_rules.
1339 * NEWS (2.5): Add an entry.
1340 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
1341 besides just LALR(1) and GLR(1).
1342 * doc/bison.texinfo (Introduction): Likewise.
1343 (Language and Grammar): Bison is no longer limited to LALR(1)
1344 restrictions.
1345 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
1346 when trying to distinguish from GLR. Talk about LR(1) grammars
1347 rather than LALR(1) grammars.
1348 (Decl Summary): In %define api.push_pull entry, say it applies
1349 to deterministic parsers in C rather than LALR(1) parsers in C.
1350 Add lr.default_rules entry.
1351 Add lr.type entry.
1352 (Mystery Conflicts): Bison is no longer limited to LALR(1)
1353 restrictions.
1354 (Generalized LR Parsing): Same changes as for the previous GLR
1355 section.
1356 (Memory Management): Say deterministic rather than LALR(1).
1357 (Understanding): Correct some bison output.
1358 Index discussion of "accepting state".
1359 Say deterministic rather than LALR(1).
1360 (Bison Options): In --yacc entry, say deterministic rather than
1361 LALR(1).
1362 In --report, --graph, and --xml entries, just don't mention
1363 LALR(1).
1364 (C++ Parsers): Say deterministic rather than LALR(1).
1365 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
1366 (Glossary): Add Accepting State, Consistent State, Default Rule,
1367 and IELR(1) definitions.
1368 In Generalized LR (GLR) definition, make same changes as in
1369 previous GLR sections.
1370 In LALR(1) definition, say Bison uses LALR(1) by default rather
1371 than implying Bison is limited to LALR(1).
1372 (LocalWords): Add IELR.
1373
13742009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1375
1376 Finish implementing %define lr.type.
1377 Its value can be "LALR", "IELR", or "canonical LR".
1378 * lib/timevar.def (TV_IELR_PHASE1): New var.
1379 (TV_IELR_PHASE2): New var.
1380 (TV_IELR_PHASE3): New var.
1381 (TV_IELR_PHASE4): New var.
1382 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
1383 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
1384 Sbitset.h, ielr.h, and ielr.c.
1385 * src/getargs.h, src/getargs.c (enum trace, trace_args,
1386 trace_types): Add trace_ielr.
1387 * src/lalr.h, src/lalr.c (ngotos): Export it.
1388 (F): Rename to...
1389 (goto_follows): ... this, update all uses, and export it.
1390 (set_goto_map): Export it.
1391 (map_goto): Export it.
1392 (compute_lookahead_tokens): Don't free goto_follows yet. Now
1393 handled in ielr.
1394 (initialize_LA): Export it. Move lookback allocation to...
1395 (lalr): ... here because, for canonical LR, initialize_LA must
1396 be invoked but lookback and much of the rest of LALR isn't
1397 needed.
1398 * main.c (main): Instead of lalr, invoke ielr, which invokes
1399 lalr.
1400 * src/reader.c (reader): Default lr.type to "LALR".
1401 Default lr.default_rules to "accepting" if lr.type is "canonical
1402 LR". Leave the default as "all" otherwise.
1403 Check for a valid lr.type value.
1404 * src/state.h, src/state.c (struct state_list): Add state_list
1405 member.
1406 (state_new): Initialize state_list member to NULL.
1407 (state_new_isocore): New function, exported.
1408 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
1409 exercises all values of lr.type.
1410 (GNU AWK Grammar): Rename test group to...
1411 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
1412 AT_TEST_EXISTING_GRAMMAR.
1413 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
1414 (GNU pic Grammar): Rename test group to...
1415 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
1416 AT_TEST_EXISTING_GRAMMAR.
1417 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
1418 all values of lr.type.
1419 (Single State Split): New test groups using AT_TEST_LR_TYPE.
1420 (Lane Split): Likewise.
1421 (Complex Lane Split): Likewise.
1422 (Split During Added Lookahead Propagation): Likewise.
1423
14242009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1425
1426 Add new files for IELR and canonical LR implementation.
1427 * src/AnnotationList.c: New.
1428 * src/AnnotationList.h: New.
1429 * src/InadequacyList.c: New.
1430 * src/InadequacyList.h: New.
1431 * src/Sbitset.c: New.
1432 * src/Sbitset.h: New.
1433 * src/ielr.c: New.
1434 * src/ielr.h: New.
1435
14362009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1437
1438 Implement %define lr.default_rules.
1439 Its value describes the states that are permitted to contain
1440 default rules: "all", "consistent", or "accepting".
1441 * src/reader.c (reader): Default lr.default_rules to "all".
1442 Check for a valid lr.default_rules value.
1443 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
1444 is "accepting", then only mark the accepting state as
1445 consistent.
1446 (initialize_LA): Tell state_lookahead_tokens_count whether
1447 lr.default_rules is "accepting".
1448 * src/tables.c (action_row): If lr.default_rules is not "all",
1449 then disable default rules in inconsistent states.
1450 * src/print.c (print_reductions): Use this opportunity to
1451 perform some assertions about whether lr.default_rules was
1452 obeyed correctly.
1453 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
1454 helps with checking the parser tables for a grammar.
1455 * tests/input.at (%define lr.default_rules invalid values): New
1456 test group.
1457 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
1458 AT_TEST_TABLES_AND_PARSE.
1459 (`no %define lr.default_rules'): New test group generated by
1460 AT_TEST_LR_DEFAULT_RULES.
1461 (`%define lr.default_rules "all"'): Likewise.
1462 (`%define lr.default_rules "consistent"'): Likewise.
1463 (`%define lr.default_rules "accepting"'): Likewise.
1464
14652009-04-20 Akim Demaille <demaille@gostai.com>
1466
1467 Formatting change.
1468
14692009-04-20 Akim Demaille <demaille@gostai.com>
1470
1471 bison: factoring.
1472 * src/output.c (token_definitions_output): Use symbol_id_get
1473 instead of duplicating its logic.
1474 * TODO (YYERRCODE): Extend.
1475
14762009-04-20 Akim Demaille <demaille@gostai.com>
1477
1478 variables: prefer error-verbose to error_verbose.
1479 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
1480 instead of error_verbose.
1481 * src/scan-gram.l (%error-verbose): Map to the error-verbose
1482 variable.
1483 * doc/bison.texinfo: Promote %define error-verbose instead of
1484 %error-verbose.
1485 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
1486
14872009-04-15 Akim Demaille <demaille@gostai.com>
1488
1489 variables: accept dashes.
1490 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
1491 underscores.
1492 * src/scan-gram.l ({id}): Also accept dashes after the initial
1493 letter.
1494 ({directive}): Use {id}.
1495 * src/parse-gram.y: Comment and formatting changes.
1496 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
1497 symbols.
1498 * src/complain.h, src/complain.c (yacc_at): New.
1499 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
1500 symbol names.
1501 * src/output.c (token_definitions_output): Do not #define token
1502 names with dashes.
1503
15042009-04-20 Akim Demaille <demaille@gostai.com>
1505
1506 Consistently refer to Yacc, not YACC.
1507 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
1508
15092009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
1510
1511 Pacify make maintainer-check-posix.
1512 * tests/input.at (%define, --define): Move bison command-line
1513 options before grammar file name.
1514
15152009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1516
1517 Document semicolon warnings.
1518 * NEWS (2.5): Here.
1519
15202009-04-14 Akim Demaille <demaille@gostai.com>
1521
1522 variables: use `parse.assert' instead of `assert'.
1523 * TODO (assert): Remove.
1524 * data/bison.m4 (b4_assert_if): Replace with...
1525 (b4_parse_assert_if): this.
1526 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
1527 * doc/bison.texinfo (Decl Summary): Document parse.assert.
1528
15292009-04-14 Akim Demaille <demaille@gostai.com>
1530
1531 variables: use `parse.trace' instead of `debug'.
1532 * src/getargs.c (getargs): Map -t to %define trace.parse.
1533 * src/scan-gram.l (%debug): Map to %define trace.parse.
1534 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
1535 names to `_' in macro names.
1536 (b4_debug_if): Replace with...
1537 (b4_parse_trace_if): this.
1538 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1539 * data/yacc.c: Adjust.
1540 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
1541 Use @code to label the variable list.
1542 Document the variable parse.trace.
1543 (Tracing): Promote the parse.trace variable.
1544 * TODO: %printer is not documented.
1545
15462009-04-14 Akim Demaille <demaille@gostai.com>
1547
1548 doc: minor fixes.
1549 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
1550 (Table of Symbols): Remove duplicate entry for %debug.
1551
15522009-04-10 Eric Blake <ebb9@byu.net>
1553
1554 submodules: update to latest
1555 * submodules/autoconf: Use latest upstream Autoconf.
1556
15572009-04-06 Eric Blake <ebb9@byu.net>
1558
1559 Work around autoconf 2.63b bug in testsuite.
1560 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
1561 autoconf bug related to # in test.
1562
15632009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1564
1565 * NEWS (2.5): New section. Describe new -D/--define feature.
1566
15672009-04-06 Akim Demaille <demaille@gostai.com>
1568
1569 Regen.
1570 * src/parse-gram.h, src/parse-gram.c: Regen.
1571
15722009-04-06 Akim Demaille <demaille@gostai.com>
1573
1574 rename muscle_tab.* as muscle-tab.* for consistency.
1575 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
1576 * src/muscle-tab.h, src/muscle-tab.c: these.
1577 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
1578 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
1579
15802009-04-06 Akim Demaille <demaille@gostai.com>
1581
1582 Makefile: introduce $(BISON).
1583 * src/local.mk (BISON): New.
1584 (YACC): Use it.
1585
15862009-04-06 Akim Demaille <demaille@gostai.com>
1587
1588 parser: handle %locations as %define locations.
1589 * src/getargs.h, src/getargs.c (locations_flag): Remove.
1590 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
1591 to set "locations" to true.
1592 * src/output.c (prepare): Don't output "locations".
1593 * src/scan-gram.l (%locations): Handle it as a %<flag>.
1594 * src/parse-gram.y: It's no longer a token.
1595 Don't handle it.
1596 * data/bison.m4 (b4_locations_if): Define it with
1597 b4_percent_define_if_define.
1598 * data/c.m4, data/glr.cc: Adjust.
1599
16002009-04-06 Akim Demaille <demaille@gostai.com>
1601
1602 Regen.
1603 * src/parse-gram.c: Regen.
1604
16052009-04-06 Akim Demaille <demaille@gostai.com>
1606
1607 muscle: factor the handling of obsolete of obsolete directives.
1608 Suggested by Joel E. Denny.
1609
1610 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
1611 New, extracted from...
1612 * src/parse-gram.y (prologue_declaration: pure-parser): here.
1613 Remove it.
1614 (prologue_declaration: "%<flag>"): Use
1615 muscle_percent_define_ensure.
1616 (%error-verbose, %pure-parser): No longer tokens.
1617 * src/scan-gram.l (pure-parser): Return as a %<flag>.
1618
16192009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1620
1621 Fix options documentation.
1622 * build-aux/cross-options.pl: As in --help output, write optional
1623 arguments as [=ARG] not =[ARG].
1624 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
1625
16262009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1627
1628 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
1629 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
1630 requirements for a correct m4 are stricter.
1631 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
1632 * configure.ac: Update to use AC_PROG_GNU_M4.
1633 Reported by Eric Blake.
1634
16352009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1636
1637 Help with updating web manual.
1638 * HACKING: Incorporate instructions from gnulib/doc/README.
1639 * bootstrap.conf (gnulib_modules): Add gendocs.
1640
16412009-04-03 Akim Demaille <demaille@gostai.com>
1642
1643 Regen.
1644 * src/parse-gram.h, src/parse-gram.c: Regen.
1645
16462009-04-03 Akim Demaille <demaille@gostai.com>
1647
1648 Factor %FLAG at scan level.
1649 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
1650 definitions and associated rules, replaced by....
1651 (PERCENT_FLAG): this new token type, and rule.
1652 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
1653 Use it for %debug and %error-verbose.
1654
16552009-04-03 Akim Demaille <demaille@gostai.com>
1656
1657 Regen.
1658 * src/parse-gram.h, src/parse-gram.c: Regen.
1659
16602009-04-03 Akim Demaille <demaille@gostai.com>
1661
1662 Treat %debug as %define debug.
1663 * data/bison.m4 (b4_debug_if): New.
1664 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
1665 * data/lalr1.java: Use it instead of b4_debug_flag.
1666 * src/getargs.h, src/getargs.c (debug_flag): Remove.
1667 * src/output.c (prepare): Don't output it.
1668 * src/parse-gram.y: Treat %debug as %define debug.
1669
16702009-04-03 Akim Demaille <demaille@gostai.com>
1671
1672 Treat %error-verbose as %define error_verbose.
1673 This allows to pass -Derror_verbose on the command line. Better
1674 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
1675 ERROR_VERBOSE being defined as false or true.
1676 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
1677 on b4_percent_define_ifdef, for does not check the defined value,
1678 but only whether the symbol is defined, rely on
1679 b4_percent_define_flag_if, so that a value of "false" is processed
1680 as a false.
1681 If not defined, define the flag to "false".
1682 (b4_error_verbose_if): New.
1683 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
1684 b4_error_verbose_flag.
1685 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
1686 * src/output.c (prepare): Don't output it.
1687 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
1688
16892009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1690
1691 Fix strange %define locations for default values.
1692 Reported by Akim Demaille at
1693 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
1694 and discussed again starting at
1695 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
1696 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
1697 because location information is bogus.
1698 Use angle brackets to delimit fake file name because square brackets
1699 look like underexpanded m4. Choose a better fake file name.
1700 Use negative line numbers.
1701 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
1702 * src/location.c (location_print): If line for a boundary is negative,
1703 only print that boundary's file name.
1704 * src/location.h: Document that.
1705 * tests/skeletons.at (%define Boolean variables: invalid skeleton
1706 defaults): Update output.
1707
17082009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1709
1710 Pacify ./configure --enable-gcc-warnings.
1711 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
1712 in lib won't compile with it.
1713 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
1714
17152009-03-31 Akim Demaille <demaille@gostai.com>
1716
1717 bootstrap: --help to stdout.
1718 * bootstrap (usage): Don't send --help to stderr.
1719 Use a here doc instead of a long string.
1720
17212009-03-31 Akim Demaille <demaille@gostai.com>
1722
1723 bootstrap: README-hacking no longer exists
1724 * bootstrap (checkout_only_file): Set to HACKING.
1725
17262009-03-26 Akim Demaille <demaille@gostai.com>
1727
1728 doc: merge HACKING and README-hacking.
1729 Two files is confusing.
1730 Reported by Alexandre Duret-Lutz.
1731
1732 * README-hacking: Merge into...
1733 * HACKING (Working from the repository): here.
1734
17352009-03-26 Akim Demaille <demaille@gostai.com>
1736
1737 doc: update README-hacking.
1738 * README-hacking: We now use git and git submodules.
1739 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
1740
17412009-03-26 Akim Demaille <demaille@gostai.com>
1742
1743 lalr1.cc: avoid GCC 4.3 warnings.
1744 GCC 4.3 now warns about "a || b && c" and asks for explicit
1745 parentheses.
1746 Reported by Alexandre Duret-Lutz.
1747 * data/location.cc: Update copyright years.
1748 (Position::operator==): Use parens to make precedence explicit.
1749 Compare lines and columns first, as they are more likely to be
1750 different, and they are faster to compare.
1751
17522009-03-26 Akim Demaille <demaille@gostai.com>
1753
1754 gnulib: update.
1755 * gnulib: Update to latest.
1756 * src/local.mk (AM_CFLAGS): Move to...
1757 * Makefile.am: here.
1758 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
1759 AM_CFLAGS.
1760
17612009-03-02 Akim Demaille <demaille@gostai.com>
1762
1763 Comment changes.
1764
17652009-03-02 Akim Demaille <demaille@gostai.com>
1766
1767 Share b4_yytranslate_define.
1768 * data/lalr1.cc (b4_yytranslate_define): Move to...
1769 * data/c++.m4: here.
1770
17712009-03-02 Akim Demaille <demaille@gostai.com>
1772
1773 Use locations in the variant example.
1774 Yes, this obfuscates the point of this example, variants only.
1775 But glr.cc cannot work (yet?) without locations. This change
1776 makes it easier to use this example with glr.cc.
1777
1778 * examples/variant.yy (assert): %define it.
1779 (locations): Request them.
1780 (yylex): Bind the location to the stage.
1781
17822009-03-02 Akim Demaille <demaille@gostai.com>
1783
1784 Dub make_TOKEN as a public type interface.
1785 * data/c++.m4 (b4_symbol_constructor_declare)
1786 (b4_symbol_constructor_define): New empty stubs.
1787 (b4_public_types_declare, b4_public_types_define): Use them.
1788 * data/lalr1.cc (b4_symbol_constructor_declare)
1789 (b4_symbol_constructor_declare_)
1790 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
1791 Move to...
1792 * data/variant.hh: here.
1793 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
1794 needed.
1795 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
1796 b4_symbol_constructor_declare, as it is now done by
1797 b4_public_types_define and b4_public_types_declare.
1798
17992009-03-02 Akim Demaille <demaille@gostai.com>
1800
1801 Coding style changes.
1802 * data/lalr1.cc (b4_symbol_constructor_declaration_)
1803 (b4_symbol_constructor_declarations)
1804 (b4_symbol_constructor_definition_)
1805 (b4_symbol_constructor_definitions)
1806 (b4_yytranslate_definition): Rename as...
1807 (b4_symbol_constructor_declare_)
1808 (b4_symbol_constructor_declare)
1809 (b4_symbol_constructor_define_)
1810 (b4_symbol_constructor_define)
1811 (b4_yytranslate_define): these.
1812 * data/variant.hh (b4_variant_definition): Rename as...
1813 (b4_variant_define): this.
1814
18152009-03-02 Akim Demaille <demaille@gostai.com>
1816
1817 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
1818 * data/bison.m4 (b4_percent_define_if_define): New.
1819 * data/c++.m4 (b4_variant_if): Move to...
1820 * data/bison.m4: Here, using b4_percent_define_if_define.
1821 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
1822 * data/bison.m4: Here, using b4_percent_define_if_define.
1823
18242009-03-02 Akim Demaille <demaille@gostai.com>
1825
1826 Dub symbol_type_base as a public type.
1827 * data/c++.m4 (b4_public_types_declare): Now define
1828 symbol_type_base and symbol_type.
1829 (b4_public_types_define): New.
1830 In both cases, the definitions are taken verbatim from lalr1.cc.
1831 * data/lalr1.cc: Adjust.
1832
18332009-03-02 Akim Demaille <demaille@gostai.com>
1834
1835 b4_public_types_declare.
1836 * data/c++.m4 (b4_public_types_declare): New.
1837 * data/glr.cc, data/lalr1.cc: Use it.
1838
18392009-03-02 Akim Demaille <demaille@gostai.com>
1840
1841 b4_semantic_type_declare.
1842 * data/c++.m4 (b4_semantic_type_declare): New.
1843 Factors and generalizes what was in glr.cc and lalr1.cc.
1844 * data/variant.hh (b4_semantic_type_declare): Redefine it for
1845 variants.
1846 * data/lalr1.cc, data/glr.cc: Use it.
1847
18482009-02-26 Akim Demaille <demaille@gostai.com>
1849
1850 Upgrade gnulib.
1851 * gnulib: Upgrade from master.
1852 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
1853 Regen.
1854
18552009-02-25 Akim Demaille <demaille@gostai.com>
1856
1857 Remove useless arguments.
1858 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
1859 relevant.
1860
18612009-02-25 Akim Demaille <demaille@gostai.com>
1862
1863 Comment changes.
1864 * data/lalr1.cc: here.
1865
18662009-02-25 Akim Demaille <demaille@gostai.com>
1867
1868 Fix glr.cc's debug level handling.
1869 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
1870 glr.c which is used.
1871 (debug_level, set_debug_level): Adjust.
1872
18732009-02-25 Akim Demaille <demaille@gostai.com>
1874
1875 Copyright years.
1876 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
1877
18782009-02-25 Akim Demaille <demaille@gostai.com>
1879
1880 Style changes.
1881 * etc/bench.pl.in (generate_grammar_list): Consitently use
1882 location_type, not yy::location.
1883
18842009-02-25 Akim Demaille <demaille@gostai.com>
1885
1886 Comment change.
1887 * data/lalr1.cc: here.
1888
18892009-02-19 Akim Demaille <demaille@gostai.com>
1890
1891 Make yyparser::error public.
1892 * data/lalr1.cc: here.
1893 There is no good reason to keep it private (and it is convenient
1894 to use it from the scanner for instance). It is already public in
1895 glr.cc.
1896
18972009-02-19 Akim Demaille <demaille@gostai.com>
1898
1899 Comment changes.
1900 * data/glr.cc: here.
1901
19022009-02-19 Akim Demaille <demaille@gostai.com>
1903
1904 Remove trailing blanks.
1905 The epilogue has its own ending \n, no need to add another.
1906
1907 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
1908 epilogue.
1909 * data/glr.cc: dnl when extending the epilogue.
1910 Remove stray "private:".
1911
19122009-02-19 Akim Demaille <demaille@gostai.com>
1913
1914 Use b4_c_modern.
1915 * data/c.m4 (b4_c_function_decl): Here.
1916
19172009-02-19 Akim Demaille <demaille@gostai.com>
1918
1919 Comment changes.
1920 * data/lalr1.cc: here.
1921
19222009-02-19 Akim Demaille <demaille@gostai.com>
1923
1924 Extract variant.hh
1925 * data/variant.hh: New, extracted from...
1926 * data/lalr1.cc: here.
1927 Adjust.
1928 * data/local.mk: Adjust.
1929
19302009-02-19 Akim Demaille <demaille@gostai.com>
1931
1932 Extract stack.hh from lalr1.cc.
1933 * data/stack.hh: New.
1934 * data/lalr1.cc: Extract from here.
1935 * data/local.mk: Adjust.
1936
19372009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
1938
1939 Add reminder about uploading public key to keys.gnupg.net.
1940 * HACKING (Release Procedure): Here.
1941
19422009-01-28 Akim Demaille <demaille@gostai.com>
1943
1944 * NEWS: Update information about 2.4.1 and 2.4.2.
1945
19462008-11-04 Akim Demaille <demaille@gostai.com>
1947
1948 Reformat NEWS.
1949 * NEWS: Use more outline-mode markup.
1950 Suggested by Jim Meyering.
1951
19522009-01-08 Akim Demaille <demaille@gostai.com>
1953
1954 Fix grep portability issues.
1955 Grep on Solaris does not support -q.
1956 Reported by Summum Bonum.
1957
1958 * NEWS: Add a stub for 2.4.2.
1959 * THANKS: Add Summum Bonum.
1960 * tests/atlocal.in (EGREP): New.
1961 (CC, CXX, XSLTPROC): Make it possible to override them via
1962 envvars.
1963 * tests/java.at: Use $EGREP instead of egrep.
1964 Use AT_CHECK's ignore instead of grep's -q.
1965
19662008-12-11 Akim Demaille <demaille@gostai.com>
1967
1968 Pass the token type to yysyntax_error.
1969 * data/yacc.c (yysyntax_error): Take the transated token instead
1970 of the raw number.
1971 Adjust callers.
1972 * TODO: Update.
1973
19742008-12-11 Akim Demaille <demaille@gostai.com>
1975
1976 Formatting changes.
1977 * data/glr.c: Formatting changes.
1978
19792008-12-11 Akim Demaille <demaille@gostai.com>
1980
1981 Propagate i18n changes into glr.c.
1982 * TODO: Update.
1983 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
1984 building the error message format dynamically.
1985 * data/lalr1.java: Formatting changes.
1986
19872008-12-11 Akim Demaille <demaille@gostai.com>
1988
1989 Use testsuite -C.
1990 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
1991 Solves problems when top_srcdir is an absolute path.
1992 Suggested by Eric Blake.
1993 * configure.ac: Require Autoconf 2.62.
1994
19952008-12-11 Akim Demaille <demaille@gostai.com>
1996
1997 Simplify the i18n of the error messages.
1998 * data/lalr1.cc: Comment changes.
1999 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
2000 lalr1.cc instead of building dynamically the format string.
2001
20022008-12-08 Akim Demaille <demaille@gostai.com>
2003
2004 Fix portability issue in the test suite.
2005 * tests/local.at (AT_MATCHES_CHECK): New.
2006 Based on Perl instead of Sed. Sed has too many portability
2007 pitfalls, not ever Sed is GNU Sed.
2008 * tests/actions.at (Fix user actions without a trailing semicolon):
2009 Use it.
2010
20112008-12-08 Akim Demaille <demaille@gostai.com>
2012
2013 Update data/README.
2014 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
2015
20162008-12-08 Akim Demaille <demaille@gostai.com>
2017
2018 Install autoconf as a submodule to get m4sugar.
2019 * .gitmodules: Add submodules/autoconf.
2020 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
2021 submodules/autoconf.
2022
20232008-12-08 Akim Demaille <demaille@gostai.com>
2024
2025 Test token.prefix in all the skeletons.
2026 * data/java.m4 (b4_token_enum): Use the token.prefix.
2027 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
2028 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
2029 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
2030 * tests/java.at: Comment changes.
2031 (AT_CHECK_JAVA_MINIMAL): Define the END token.
2032 (Java parser class and package names): Add token.prefix check.
2033
20342008-12-08 Akim Demaille <demaille@gostai.com>
2035
2036 Fix regeneration of atconfig.
2037 * tests/local.mk (tests/atconfig): The rule was incorrect, but
2038 remove it: now that there is no tests/Makefile.am, the top-level
2039 Makefile properly updates atconfig when needed.
2040
20412008-12-07 Di-an Jan <dianj@freeshell.org>
2042
2043 Implement the FIXME that ends an user action with a semicolon
2044 if it seems necessary.
2045 * src/scan-code.l (flex rules section): Flag cpp directive from
2046 any `#' to the first unescaped end-of-line. Semicolon is not
2047 needed after `;', `{', '}', or cpp directives and is needed after
2048 any other token (whitespaces and comments have no effect).
2049 * tests/actions.at (Fix user actions without a trailing semicolon):
2050 New test.
2051 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
2052 to make user actions complete statements.
2053 Adjust column numbers in error messages.
2054 * tests/regression.at (Fix user actions without a trailing semicolon):
2055 Remove. Covered by new test.
2056
20572008-12-07 Akim Demaille <demaille@gostai.com>
2058
2059 Update gnulib.
2060 * gnulib: Update from master.
2061
20622008-12-05 Eric Blake <ebb9@byu.net>
2063
2064 Avoid compiler warning.
2065 * src/output.c (muscle_insert_item_number_table): Delete unused
2066 function.
2067
20682008-12-02 Eric Blake <ebb9@byu.net>
2069
2070 Build testsuite with newer autoconf.
2071 * tests/output.at (m4_expand): Don't override in newer autoconf,
2072 where the underlying implementation changed.
2073 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
2074 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
2075 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
2076 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
2077 since some of them contain unbalanced ')'.
2078
20792008-12-01 Akim Demaille <demaille@gostai.com>
2080
2081 Use b4_symbol for printers and destructors everywhere.
2082 * data/bison.m4 (b4_symbol_action_location): New.
2083 * data/c.m4 (b4_symbol_actions): Remove.
2084 Adjust all callers to use by b4_symbol_foreach and the corresponding
2085 b4_symbol_printer/destructor macro.
2086 * data/glr.cc: Adjust.
2087 * data/lalr1.java: Adjust the %destructor sanity check.
2088 * src/output.c (symbol_code_props_output): Remove, we no longer
2089 need the b4_symbol_printers/destructors tables.
2090
20912008-12-01 Akim Demaille <demaille@gostai.com>
2092
2093 Use b4_symbol_case_.
2094 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
2095 b4_symbol_case_.
2096
20972008-12-01 Akim Demaille <demaille@gostai.com>
2098
2099 Move b4_symbol based macro to bison.m4.
2100 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
2101 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
2102 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
2103 (b4_type_foreach): Move to...
2104 * data/bison.m4: Here.
2105 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
2106 b4_symbol_value_template instead of b4_symbol_value.
2107
21082008-12-01 Akim Demaille <demaille@gostai.com>
2109
2110 b4_symbol/type_foreach.
2111 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
2112 Use them.
2113
21142008-12-01 Akim Demaille <demaille@gostai.com>
2115
2116 Use the symbol properties to output the printer/destructor for lalr1.cc.
2117 Instead of defining complex list of tuples to define various
2118 properties of the symbols, we now prefer to define symbols as
2119 "structs" in m4: using the symbol key (its number), and the
2120 property name, b4_symbol gives it value. Use this to handle
2121 destructors and printers.
2122
2123 * src/output.c (CODE_PROP): New.
2124 (prepare_symbol_definitions): Use it to define the printer and
2125 destructor related attributes of the symbols.
2126 * data/lalr1.cc (b4_symbol_actions): Rename as...
2127 (b4_symbol_action): this.
2128 Use b4_symbol instead of 6 arguments.
2129 (b4_symbol_printer, b4_symbol_destructor): New.
2130 Use them instead of b4_symbol_actions.
2131
21322008-12-01 Akim Demaille <demaille@gostai.com>
2133
2134 Avoid capturing variables too easily.
2135 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
2136 v__ and p__ instead of v and p.
2137
21382008-12-01 Akim Demaille <demaille@gostai.com>
2139
2140 Remove spurious empty line before syncline.
2141 * data/bison.m4 (b4_syncline): Don't output an empty line before
2142 the output.
2143
21442008-11-26 Akim Demaille <demaille@gostai.com>
2145
2146 Convert lib/Makefile.am into lib/local.mk.
2147 The real problem is rather gnulib.mk, which itself is extracted
2148 from a Makefile.am that gnulib expects to the "recursive". The
2149 tool prefix-gnulib-mk converts such a gnulib.mk to be
2150 non-recursive. Also, some AC_SUBST variables need to be adjusted.
2151
2152 * etc/prefix-gnulib-mk: New.
2153 * bootstrap (slurp): Use it to convert further gnulib.mk.
2154 No longer try to avoid re-creation of lib/gnulib.mk as the changes
2155 are deeper.
2156 * lib/Makefile.am: Rename as...
2157 * lib/local.mk: this.
2158 Adjust to be prefixed.
2159 * Makefile.am, configure.ac: Adjust.
2160 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
2161
21622008-11-26 Akim Demaille <demaille@gostai.com>
2163
2164 s/_FLAGS/FLAGS/.
2165 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
2166 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
2167 Reported by Eric Blake.
2168
21692008-11-26 Akim Demaille <demaille@gostai.com>
2170
2171 Use b4_parser_tables_define in glr.cc.
2172 * data/glr.c: Use b4_parser_tables_define instead of defining the
2173 (deterministic integral) tables by hand.
2174
21752008-11-26 Akim Demaille <demaille@gostai.com>
2176
2177 Use b4_parser_tables_define in Java.
2178 * data/java.m4 (b4_typed_parser_table): Rename as...
2179 (b4_typed_parser_table_define): this, for consistency.
2180 Accept a comment as $4.
2181 Move $2 into yy*_.
2182 (b4_integral_parser_table): Rename as...
2183 (b4_integral_parser_table_define): this.
2184 * data/lalr1.java: Adjust all uses.
2185 Use b4_parser_tables_define instead of generation by hand.
2186
21872008-11-26 Akim Demaille <demaille@gostai.com>
2188
2189 Prepare the convergence bw C style and Java table generation.
2190 * data/bison.m4 (b4_tables_map, b4_tables_declare)
2191 (b4_tables_define): Rename as...
2192 (b4_integral_parser_tables_map, b4_parser_tables_declare)
2193 (b4_parser_tables_define): these.
2194 * data/c.m4 (b4_table_define): Rename as...
2195 (b4_integral_parser_table_define): this.
2196 * data/lalr1.cc: Adjust.
2197 (b4_table_define, b4_table_declare): Rename as...
2198 (b4_integral_parser_table_define)
2199 (b4_integral_parser_table_declare): these.
2200 (yyrline_): Move the comment where it is actually used.
2201 * data/yacc.c: Adjust.
2202 (yyrline): Use b4_integral_parser_table_define.
2203
22042008-11-26 Akim Demaille <demaille@gostai.com>
2205
2206 Regen.
2207 * src/parse-gram.h, src/parse-gram.c: Regen.
2208
22092008-11-26 Akim Demaille <demaille@gostai.com>
2210
2211 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
2212 * data/lalr1.cc (b4_tables_map): Move to...
2213 * data/bison.m4: here.
2214 Update the comment for yytable during the flight.
2215 (b4_tables_declare, b4_tables_define): New.
2216 * data/lalr1.cc: Use them.
2217 * data/c.m4 (b4_table_define): New.
2218 * data/yacc.c: Use b4_tables_define instead of output the tables
2219 by hand.
2220 * tests/regression.at (Web2c Actions): Adjust the expected output,
2221 the order of the tables changed.
2222
22232008-11-26 Akim Demaille <demaille@gostai.com>
2224
2225 Get rid of (yy)rhs and (yy)prhs.
2226 These tables are no longer needed in the parsers, and they don't seem to
2227 be useful. They are not documented either.
2228
2229 * src/output.c (prepare_rules): Get rid of rhs and prhs.
2230 Adjust the computation of (yy)r2.
2231
22322008-11-26 Akim Demaille <demaille@gostai.com>
2233
2234 Rule length is unsigned.
2235 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
2236
22372008-11-26 Akim Demaille <demaille@gostai.com>
2238
2239 Get rid of lalr1-split.cc.
2240 It was no longer maintainer.
2241
2242 * data/lalr1-split.cc: Remove.
2243 * etc/bench.pl.in (bench_fusion_parser): Remove.
2244 Adjust.
2245
22462008-11-26 Akim Demaille <demaille@gostai.com>
2247
2248 Use yy* consistently.
2249 * data/glr.c: Now that yyrhs no longer exists as a global
2250 variable, rename local "rhs" variables into "yyrhs" for
2251 consistency.
2252
22532008-11-25 Akim Demaille <demaille@gostai.com>
2254
2255 Get rid of yyrhs and yyprhs in glr.c.
2256 * data/glr.c (yyrhs, yyprhs): Remove.
2257 Instead, use the state stack and yystos.
2258
22592008-11-25 Akim Demaille <demaille@gostai.com>
2260
2261 Flag glr tests.
2262 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
2263 as an Autotest keyword.
2264
22652008-11-25 Akim Demaille <demaille@gostai.com>
2266
2267 Prefer TESTSUITE_FLAGS.
2268 TESTSUITEFLAGS is barely readable.
2269
2270 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
2271 for backward compatibility.
2272 Use the former instead of the latter.
2273
22742008-11-25 Akim Demaille <demaille@gostai.com>
2275
2276 Get rid of yyrhs and yyprhs in larl1.java.
2277 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
2278 (yy_reduce_print): Rather, use yystos_ and the state stack.
2279
22802008-11-25 Akim Demaille <demaille@gostai.com>
2281
2282 Formatting changes.
2283
22842008-11-25 Akim Demaille <demaille@gostai.com>
2285
2286 Get rid of yyrhs and yyprhs in yacc.c.
2287 They were used to get the symbol types, given a rule number, when
2288 displaying the top of the stack before a reduction. But the
2289 symbol type is available from the state stack. This has two be
2290 benefits: two tables less in the parser (making it smaller), and a
2291 more consistent use of the three stacks which will help to fuse
2292 them.
2293
2294 * data/yacc.c (yyprhs, yyrhs): Remove.
2295 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
2296 (yy_reduce_print): Take yyssp as argument.
2297 Use it, together with yystos, to get the symbol type.
2298 * tests/regression.at (Web2c Report): Remove these tables from the
2299 expected output.
2300
23012008-11-25 Akim Demaille <demaille@gostai.com>
2302
2303 b4_tables_map.
2304 The point is to factor the generation of the tables across skeletons.
2305 This is language dependant.
2306
2307 * data/c.m4 (b4_comment_): New.
2308 Should be usable to define how to generate tables independently of
2309 the language.
2310 (b4_c_comment): New.
2311 (b4_comment): Bounce to b4_c_comment.
2312 Now support $2 = [PREFIX] for indentation.
2313 * data/lalr1.cc (b4_table_declare): Don't output a comment if
2314 there is no comment.
2315 Indent it properly when there is one.
2316 Output the ending semicolon.
2317 (b4_table_define): Space changes.
2318 Output the ending semicolon.
2319 (b4_tables_map): New.
2320 Use it twice instead of declaring and defining the (integral)
2321 tables by hand.
2322
23232008-11-25 Akim Demaille <demaille@gostai.com>
2324
2325 b4_table_declare.
2326 * data/lalr1.cc (b4_table_declare): New.
2327 Use it to declare the tables defined with b4_table_define.
2328 (b4_table_define): Declare a third arg to match b4_table_declare
2329 signature.
2330 Move all the comments around invocations of b4_table_define into
2331 the invocations itselves.
2332 Move things around to have the order for declarations and
2333 definitions.
2334
23352008-11-25 Akim Demaille <demaille@gostai.com>
2336
2337 Formatting changes.
2338 * data/lalr1.java: here.
2339
23402008-11-25 Akim Demaille <demaille@gostai.com>
2341
2342 b4_args is more general than only C++.
2343 * data/lalr1.cc (b4_args, _b4_args): Move to...
2344 * data/bison.m4: here.
2345
23462008-11-21 Di-an Jan <dianj@freeshell.org>
2347
2348 Implement no-XXX arguments for --warnings, --report, --trace.
2349 * src/getargs.c (flags_argmatch): Handles no-XXX.
2350 Fix typo in doxygen comment.
2351
23522008-11-21 Akim Demaille <demaille@gostai.com>
2353
2354 Display the changes in cross-options.texi.
2355 * build-aux/cross-options.pl ($sep): New, to separate items.
2356 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
2357 changes.
2358
23592008-11-20 Di-an Jan <dianj@freeshell.org>
2360
2361 Improves options in the manual.
2362 * doc/bison.texinfo (-g, -x): Add space before argument.
2363 (Option Cross Key): Implement FIXME: listing directives also.
2364 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
2365 (Short Option): Special case -d. Put arguments inside @option.
2366 (Bison Directive): Add column, automatically extracted from
2367 src/scan-gram.l (actual name passed as the first argument)
2368 with special case for %define.
2369 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
2370 to build-aux/cross-options.pl.
2371 * src/getargs.c (usage): Document limitations of cross-options.pl.
2372 * src/scan-gram.l: Likewise.
2373
23742008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2375
2376 Fix unexpanded macros in GLR defines file.
2377 Reported by Csaba Raduly at
2378 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
2379 * THANKS (Csaba Raduly): Add.
2380 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
2381 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
2382 lexer in a separate module that includes the defines file.
2383 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
2384 source.
2385 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
2386 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
2387 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
2388 (AT_DATA_SOURCE_PROLOGUE): New.
2389 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
2390 (AT_DATA_SOURCE): New.
2391 (AT_FULL_COMPILE): Extend to support an additional source file.
2392
23932008-11-18 Akim Demaille <demaille@gostai.com>
2394
2395 More TODO.
2396 * TODO: More short term issues.
2397
23982008-11-18 Akim Demaille <demaille@gostai.com>
2399
2400 Regen.
2401 * src/parse-gram.h, src/parse-gram.c: Regen.
2402
24032008-11-18 Akim Demaille <demaille@gostai.com>
2404
2405 Use b4_subtract where possible.
2406 * data/lalr1.cc (b4_subtract): Move to...
2407 * data/bison.m4: here.
2408 * data/glr.c (b4_rhs_data): Use it.
2409 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
2410
24112008-11-18 Akim Demaille <demaille@gostai.com>
2412
2413 Remove incorrect mode specification.
2414 * data/glr.cc: Don't pretend it's C code.
2415
24162008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2417
2418 Simplify last patch slightly.
2419 * src/getargs.c (getargs): Here.
2420
24212008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2422
2423 Fix last warning from --enable-gcc-warnings.
2424 * src/getargs.c (getargs): Don't assign const address to non-const
2425 pointer.
2426
24272008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2428
2429 Don't let maintainer-*-check targets force a version update.
2430 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
2431 handled.
2432
24332008-11-17 Di-an Jan <dianj@freeshell.org>
2434
2435 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
2436 Align menus. Adjust word wrapping. Use node names for menu names.
2437 (Examples): Don't abbreviate node names.
2438 (LocalWords): Remove abbreviations.
2439 (Copying): Make description a sentence.
2440 (Java Action Features): Remove period to match the rest of menu.
2441
24422008-11-17 Di-an Jan <dianj@freeshell.org>
2443
2444 Handles several --enable-gcc-warnings.
2445 * src/getargs.c (command_line_location): Set parameters to void.
2446 * src/output.c (symbol_type_name_cmp): Make static.
2447 (symbols_by_type_name): Set parameters to void.
2448 (symbol_definitions_output): Remove unused parameter. Rename as...
2449 (prepare_symbol_definitions): this.
2450 (muscles_output): Move symbol_definitions_output to...
2451 (output): here as prepare_symbol_definitions.
2452 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
2453 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
2454
24552008-11-17 Di-an Jan <dianj@freeshell.org>
2456
2457 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
2458 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
2459
24602008-11-16 Akim Demaille <demaille@gostai.com>
2461
2462 Add missing $(EXEEXT).
2463 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
2464 "src/bison$(EXEEXT)".
2465 Reported by Di-an Jan.
2466
24672008-11-15 Akim Demaille <demaille@gostai.com>
2468
2469 * TODO: Update.
2470
24712008-11-15 Akim Demaille <demaille@gostai.com>
2472
2473 Formatting changes.
2474 * tests/input.at: here.
2475
24762008-11-15 Akim Demaille <demaille@gostai.com>
2477
2478 Remove duplicate header inclusion.
2479 * src/LR0.c: here.
2480
24812008-11-15 Akim Demaille <demaille@gostai.com>
2482
2483 * src/parse-gram.h, src/parse-gram.c: Regen.
2484
24852008-11-15 Akim Demaille <demaille@gostai.com>
2486
2487 Support parametric types.
2488
2489 There are two issues to handle: first scanning nested angle
2490 bracket pairs to support types such as std::pair< std::string,
2491 std::list<std::string> > >.
2492
2493 Another issue is to address idiosyncracies of C++: do not glue two
2494 closing angle brackets together (otherwise it's operator>>), and
2495 avoid sticking blindly a TYPE to the opening <, as it can result
2496 in '<:' which is a digraph for '['.
2497
2498 * src/scan-gram.l (brace_level): Rename as...
2499 (nesting): this.
2500 (SC_TAG): New.
2501 Implement support for complex tags.
2502 (tag): Accept
2503 , but not <.
2504 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
2505 (b4_symbol_variant): Leave space around types as parameters.
2506 * examples/variant.yy: Use nested template types and leading ::.
2507 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
2508 Rename as...
2509 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
2510 * tests/c++.at: Test parametric types.
2511
25122008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2513
2514 Test token.prefix.
2515 This is not sufficient, but we test at least that the make_SYMBOL
2516 interface is not affected by token.prefix. A more general test
2517 will be implemented when the support of token.prefix is generalized
2518 to more skeletons.
2519
2520 * tests/c++.at: One more variant test, using token.prefix.
2521
25222008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2523
2524 Test the make_TOKEN interface.
2525 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
2526 Factor the common code in yylex.
2527 Use it to test "%define lex_symbol".
2528
25292008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2530
2531 Formatting change.
2532
25332008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2534
2535 Simplify code for variants bench marks.
2536 * etc/bench.pl.in (&generate_grammar_list): Define and use
2537 location_type.
2538 Factor the common code in yylex.
2539
25402008-11-15 Akim Demaille <demaille@gostai.com>
2541
2542 Better error message.
2543 * bootstrap (find_tool): Fix the error message.
2544
25452008-11-15 Akim Demaille <demaille@gostai.com>
2546
2547 Update variant.yy to newest interface.
2548 * examples/variant.yy: Define lex_symbol.
2549 Adjust.
2550
25512008-11-15 Akim Demaille <demaille@gostai.com>
2552
2553 Don't use locations in variant.yy.
2554 * examples/variant.yy: Adjust to not using locations.
2555
25562008-11-15 Akim Demaille <demaille@gostai.com>
2557
2558 Comment changes.
2559 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
2560 comments for the license.
2561
25622008-11-15 Akim Demaille <demaille@gostai.com>
2563
2564 Remove tests/Makefile.am.
2565 * tests/Makefile.am: Rename as...
2566 * tests/local.mk: this.
2567 * Makefile.am, configure.ac: Adjust.
2568 * Makefile.am (DISTCLEANFILES): Define.
2569 (maintainer-check, maintainer-xml-check, maintainer-push-check):
2570 Remove, we no longer need to bounce to the real targets.
2571
25722008-11-15 Akim Demaille <demaille@gostai.com>
2573
2574 Comment changes.
2575
25762008-11-15 Akim Demaille <demaille@gostai.com>
2577
2578 djgpp/local.mk.
2579 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
2580 * djgpp/local.mk: this new file.
2581
25822008-11-15 Akim Demaille <demaille@gostai.com>
2583
2584 Remove doc/Makefile.am.
2585 * doc/Makefile.am: Rename as...
2586 * doc/local.mk: this.
2587 Adjust paths
2588 * Makefile.am, configure.ac: Adjust.
2589 * Makefile.am (MOSTLYCLEANFILES): New.
2590 * src/local.mk: Adjust.
2591
25922008-11-15 Akim Demaille <demaille@gostai.com>
2593
2594 Move sc_tight_scope into maint.mk.
2595 It does not work, and I don't know how it was supposed to work: it
2596 seems to be looking for sources in the build tree. I just moved
2597 it at a better place, fixing it is still required.
2598
2599 * src/local.mk (echo): Remove.
2600 (sc_tight_scope): Move to...
2601 * maint.mk: here.
2602
26032008-11-15 Akim Demaille <demaille@gostai.com>
2604
2605 Regen.
2606 * src/parse-gram.h, src/parse-gram.h: Regen.
2607
26082008-11-15 Akim Demaille <demaille@gostai.com>
2609
2610 Remove src/Makefile.am.
2611 * src/Makefile.am: Rename as...
2612 * src/local.mk: this.
2613 Prefix all the paths with src/.
2614 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
2615 (AM_CPPFLAGS): Find find in builddir/src.
2616 (YACC): Move the flags into...
2617 (AM_YFLAGS): here.
2618 * maint.mk (sc_tight_scope): Disable.
2619 It used to bounce to the version in src/Makefile.am which is now
2620 part of this very Makefile.
2621 * Makefile.am, configure.ac: Adjust.
2622 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
2623 include "..." to find files "here": we are no longer in src/, so
2624 qualify the includes with src/.
2625 * doc/Makefile.am (PREPATH): No longer include the top_builddir
2626 prefix.
2627 (.x.1): Adjust to be able to create src/foo from the top level
2628 Makefile, instead of going bounce to src/Makefile the creation of
2629 foo.
2630
26312008-11-15 Akim Demaille <demaille@gostai.com>
2632
2633 Remove useless variable.
2634 * doc/Makefile.am (srcsrcdir): Remove.
2635
26362008-11-15 Akim Demaille <demaille@gostai.com>
2637
2638 Remove data/Makefile.am.
2639 * data/Makefile.am: Rename as...
2640 * data/local.mk: this.
2641 Adjust paths.
2642 * Makefile.am, configure.ac: Adjust.
2643
26442008-11-15 Akim Demaille <demaille@gostai.com>
2645
2646 Remove etc/Makefile.am.
2647 * etc/Makefile.am: Rename as...
2648 * etc/local.mk: this.
2649 Adjust.
2650 * Makefile.am, configure.ac: Adjust.
2651
26522008-11-15 Akim Demaille <demaille@gostai.com>
2653
2654 Remove examples/local.mk.
2655 examples/calc++/Makefile.am might be interesting to keep as is, since
2656 it is an example in itself.
2657
2658 * examples/Makefile.am: Rename as...
2659 * examples/local.mk: this.
2660 Adjust.
2661 * Makefile.am, configure.ac: Adjust.
2662
26632008-11-15 Akim Demaille <demaille@gostai.com>
2664
2665 Remove build-aux/Makefile.am.
2666 Recursive Makefiles are really way too slow, let's get rid of some of
2667 them.
2668
2669 * build-aux/Makefile.am: Rename as...
2670 * build-aux/local.mk: this.
2671 Adjust paths.
2672 * Makefile.am, configure.ac: Adjust.
2673
26742008-11-15 Akim Demaille <demaille@gostai.com>
2675
2676 Provide convenience constructors for locations and positions.
2677 * data/location.cc (position::position): Accept file, line and
2678 column as arguments with default values.
2679 Always qualify initial line and column literals as unsigned.
2680 (location::location): Provide convenience constructors.
2681
26822008-11-15 Akim Demaille <demaille@gostai.com>
2683
2684 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
2685 token type.
2686 Using template buys us nothing, and makes it uselessly complex to
2687 construct a symbol. Besides, it could not be generalized to other
2688 languages, while make_FOO would work in C/Java etc.
2689
2690 * data/lalr1.cc (b4_symbol_): New.
2691 (b4_symbol): Use it.
2692 (b4_symbol_constructor_declaration_)
2693 (b4_symbol_constructor_definition_): Instead of generating
2694 specializations of an overloaded template function, just generate
2695 several functions whose names are forged from the token names
2696 without the token.prefix.
2697 (b4_symbol_constructor_declarations): Generate them for all the
2698 symbols, not just by class of symbol type, now that instead of
2699 specializing a function template by the token, we generate a
2700 function named after the token.
2701 (b4_symbol_constructor_specialization_)
2702 (b4_symbol_constructor_specializations): Remove.
2703 * etc/bench.pl.in: Adjust to this new API.
2704
27052008-11-13 Akim Demaille <demaille@gostai.com>
2706
2707 %define token.prefix.
2708 Provide a means to add a prefix to the name of the tokens as
2709 output in the generated files. Because of name clashes, it is
2710 good to have such a prefix such as TOK_ that protects from names
2711 such as EOF, FILE etc. But it clutters the grammar itself.
2712
2713 * data/bison.m4 (token.prefix): Empty by default.
2714 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
2715 * data/lalr1.cc (b4_symbol): Ditto.
2716
27172008-11-13 Akim Demaille <demaille@gostai.com>
2718
2719 Compute at M4 time some of the subtractions.
2720 * data/lalr1.cc (b4_subtract): New.
2721 (b4_rhs_data): Use it.
2722
27232008-11-13 Akim Demaille <demaille@gostai.com>
2724
2725 symbol::token.
2726 This allows the user to get the type of a token returned by yylex.
2727
2728 * data/lalr1.cc (symbol::token): New.
2729 (yytoknum_): Define when %define lex_symbol, independently of
2730 %debug.
2731 (yytoken_number_): Move into...
2732 (symbol::token): here, since that's the only use.
2733 The other one is YYPRINT which was not officially supported
2734 by lalr1.cc, and anyway it did not work since YYPRINT uses this
2735 array under a different name (yytoknum).
2736
27372008-11-13 Akim Demaille <demaille@gostai.com>
2738
2739 YYERRCODE.
2740 * TODO (YYERRCODE): Mention the case of $undef.
2741
27422008-11-13 Akim Demaille <demaille@gostai.com>
2743
2744 TODO: YYPRINT.
2745 * TODO (YYPRINT): New.
2746
27472008-11-13 Akim Demaille <demaille@gostai.com>
2748
2749 Comment changes.
2750 * data/lalr1.cc, data/yacc.c: Fix the description of the
2751 yytranslate and yytoknum tables.
2752
27532008-11-13 Akim Demaille <demaille@gostai.com>
2754
2755 Define make_symbol in the header.
2756 To reach good performances these functions should be inlined (yet
2757 this is to measure precisely). To this end they must be available
2758 to the caller.
2759
2760 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
2761 location_type with the class name.
2762 Since will now be output in the header, declare "inline".
2763 No longer use b4_symbol_constructor_specializations, but
2764 b4_symbol_constructor_definitions in the header.
2765 Don't call it in the *.cc file.
2766
27672008-11-13 Akim Demaille <demaille@gostai.com>
2768
2769 Define yytranslate in the header for lex_symbol.
2770 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
2771 into the header file when using %define lex_symbol.
2772 (yytranslate_): Declare inline.
2773
27742008-11-13 Akim Demaille <demaille@gostai.com>
2775
2776 Define the constructors of symbol_type in
2777 b4_symbol_constructor_definitions.
2778 The constructors are called by the make_symbol functions, which a
2779 forthcoming patch will move elsewhere. Hence the interest of
2780 putting them together.
2781
2782 The stack_symbol_type does not need to be moved, it is used only
2783 by the parser.
2784
2785 * data/lalr1.cc: Move symbol_type and symbol_base_type
2786 constructors into...
2787 (b4_symbol_constructor_definitions): here.
2788 Adjust.
2789
27902008-11-13 Akim Demaille <demaille@gostai.com>
2791
2792 Make it easier to move the definition of yytranslate_.
2793 Forthcoming changes will make it possible to use yytranslate_
2794 from outside the parser implementation file.
2795
2796 * data/lalr1.cc (b4_yytranslate_definition): New.
2797 Use it.
2798
27992008-11-13 Akim Demaille <demaille@gostai.com>
2800
2801 Remove useless class specification.
2802 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
2803 to refer to the class name to use a type defined by the class for
2804 arguments of member functions.
2805
28062008-11-13 Akim Demaille <demaille@gostai.com>
2807
2808 Finer input type for yytranslate.
2809 This patch is debatable: the tradition expects yylex to return an int
2810 which happens to correspond to token_number (which is an enum). This
2811 allows for instance to return characters (such as '*' etc.). But this
2812 goes against the stronger typing I am trying to have with the new
2813 lex interface which return a symbol_type. So in this case, feed
2814 yytranslate_ with a token_type.
2815
2816 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
2817 expect a token_type.
2818
28192008-11-13 Akim Demaille <demaille@gostai.com>
2820
2821 Honor lex-params in %define lex_symbol mode.
2822 * data/lalr1.cc: Use b4_lex_param.
2823
28242008-11-13 Akim Demaille <demaille@gostai.com>
2825
2826 Simplify names.
2827 * src/output.c (symbol_definitions_output): Rename symbol
2828 attributes type_name and has_type_name as type and has_type.
2829 * data/lalr1.cc: Adjust uses.
2830
28312008-11-13 Akim Demaille <demaille@gostai.com>
2832
2833 Use b4_type_names for the union type.
2834 The union used to compute the size of the variant used to iterate
2835 over the type of all the symbols, with a lot of redundancy. Now
2836 iterate over the lists of symbols having the same type-name.
2837
2838 * data/lalr1.cc (b4_char_sizeof_): New.
2839 (b4_char_sizeof): Use it.
2840 Adjust to be called with a list of numbers instead of a single
2841 number.
2842 Adjust its caller for new-line issues.
2843
28442008-11-13 Akim Demaille <demaille@gostai.com>
2845
2846 Define the "identifier" of a symbol.
2847 Symbols may have several string representations, for instance if
2848 they have an alias. What I call its "id" is a string that can be
2849 used as an identifier. May not exist.
2850
2851 Currently the symbols which have the "tag_is_id" flag set are
2852 those that don't have an alias. Look harder for the id.
2853
2854 * src/output.c (is_identifier): Move to...
2855 * src/symtab.c (is_identifier): here.
2856 * src/symtab.h, src/symtab.c (symbol_id_get): New.
2857 * src/output.c (symbol_definitions_output): Use it to define "id"
2858 and "has_id".
2859 Remove the definition of "tag_is_id".
2860 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
2861 "tag_is_id" were used to produce code.
2862 We still use "tag" for documentation.
2863
28642008-11-11 Akim Demaille <demaille@gostai.com>
2865
2866 Locations are no longer required by lalr1.cc.
2867 * data/lalr1.cc (_b4_args, b4_args): New.
2868 Adjust all uses of locations to make them optional.
2869 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
2870 (AT_CHECK_NAMESPACE): Check the use of locations.
2871 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
2872 without locations with lalr1.cc.
2873 Test these cases.
2874 * tests/output.at: Check lalr1.cc with and without location
2875 support.
2876 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
2877 Don't use locations.
2878
28792008-11-11 Akim Demaille <demaille@gostai.com>
2880
2881 AT_FULL_COMPILE.
2882 * tests/local.at (AT_FULL_COMPILE): New.
2883 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
2884
28852008-11-11 Akim Demaille <demaille@gostai.com>
2886
2887 Support parens in calc++.
2888 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
2889 * examples/calc++/test (run): Check the expected output.
2890 Adjust callers.
2891 Check parens too.
2892
28932008-11-11 Akim Demaille <demaille@gostai.com>
2894
2895 Simplify lalr1.cc since %defines is mandatory.
2896 * data/lalr1.cc: Remove useless calls to b4_defines_if.
2897
28982008-11-11 Akim Demaille <demaille@gostai.com>
2899
2900 TODO: yyfmt.
2901 * TODO (yysyntax_error): New item.
2902
29032008-11-11 Akim Demaille <demaille@gostai.com>
2904
2905 Prefer M4 to CPP.
2906 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
2907 YYERROR_VERBOSE.
2908
29092008-11-11 Akim Demaille <demaille@gostai.com>
2910
2911 Support i18n of the parse error messages.
2912 * TODO (lalr1.cc/I18n): Remove.
2913 * data/lalr1.cc (yysyntax_error_): Support the translation of the
2914 error messages, as done in yacc.c.
2915 Stay within the yy* pseudo namespace.
2916
29172008-11-11 Akim Demaille <demaille@gostai.com>
2918
2919 More TODO.
2920 * TODO (single stack, yysyntax_error): New.
2921
29222008-11-11 Akim Demaille <demaille@gostai.com>
2923
2924 Make it possible to return a symbol_type from yylex.
2925 * data/lalr1.cc (b4_lex_symbol_if): New.
2926 (parse): When lex_symbol is defined, expected yylex to return the
2927 complete lookahead.
2928 * etc/bench.pl.in (generate_grammar_list): Extend to support this
2929 yylex interface.
2930 (bench_variant_parser): Exercise it.
2931
29322008-11-11 Akim Demaille <demaille@gostai.com>
2933
2934 Remove useless bench case.
2935 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
2936 no longer used.
2937
29382008-11-11 Akim Demaille <demaille@gostai.com>
2939
2940 Improve display of directives.
2941 * etc/bench.pl.in (parse_term): Don't add useless eol.
2942
29432008-11-11 Akim Demaille <demaille@gostai.com>
2944
2945 Use string_cast in the bench.
2946 * etc/bench.pl.in (generate_grammar_list): Define and use
2947 string_cast.
2948
29492008-11-11 Akim Demaille <demaille@gostai.com>
2950
2951 Replace yychar with a Boolean.
2952 * data/lalr1.cc (parse::yychar): Replace by...
2953 (parse::yyempty): this.
2954
29552008-11-11 Akim Demaille <demaille@gostai.com>
2956
2957 Factor the tables.
2958 * TODO: New item.
2959
29602008-11-11 Akim Demaille <demaille@gostai.com>
2961
2962 Let yytranslate handle the eof case.
2963 * data/lalr1.cc (yytranslate_): Handle the EOF case.
2964 Adjust callers.
2965 No longer expect yychar to be equal to yyeof_, rather, test the
2966 lookahead's (translated) kind.
2967
29682008-11-11 Akim Demaille <demaille@gostai.com>
2969
2970 yychar cannot be empty in yyerrlab.
2971 * TODO (yychar == yyempty_): New.
2972 * data/lalr1.cc: Remove the handling of this case.
2973 This eases forthcoming changes related to yychar and yytranslate.
2974
29752008-11-11 Akim Demaille <demaille@gostai.com>
2976
2977 Bench: syntactic sugar for %define/#define.
2978 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
2979 (&bench_push_parser, bench_variant_parser): Use this feature.
2980 (&eat): New.
2981 Use it.
2982
29832008-11-11 Akim Demaille <demaille@gostai.com>
2984
2985 Less memory pressure on the "list" bench.
2986 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
2987 the values, to limit memory pressure.
2988
29892008-11-11 Akim Demaille <demaille@gostai.com>
2990
2991 Introduce make_symbol.
2992 make_symbol provides a means to construct a full symbol (kind,
2993 value, location) in a single shot. It is meant to be a Symbol
2994 constructor, parameterized by the symbol kind so that overloading
2995 would prevent incorrect kind/value pairs. Unfortunately
2996 parameterized constructors do not work well in C++ (unless the
2997 parameter also appears as an argument, which is not acceptable),
2998 hence the use of a function instead of a constructor.
2999
3000 * data/lalr1.cc (b4_symbol_constructor_declaration_)
3001 (b4_symbol_constructor_declarations)
3002 (b4_symbol_constructor_specialization_)
3003 (b4_symbol_constructor_specializations)
3004 (b4_symbol_constructor_definition_)
3005 (b4_symbol_constructor_definitions): New.
3006 Use them where appropriate to generate declaration, declaration of
3007 the specializations, and implementations of the templated
3008 overloaded function "make_symbol".
3009 (variant::variant): Always define a default ctor.
3010 Also provide a copy ctor.
3011 (symbol_base_type, symbol_type): New ctor overloads for value-less
3012 symbols.
3013 (symbol_type): Now public, so that functions such as yylex can use
3014 it.
3015
30162008-11-11 Akim Demaille <demaille@gostai.com>
3017
3018 Inform m4 whether a tag is a valid id.
3019 * src/output.c (is_identifier): New.
3020 (symbol_definitions_output): Use it to define tag_is_id.
3021 But maybe this should be done at m4 level?
3022
30232008-11-11 Akim Demaille <demaille@gostai.com>
3024
3025 Test 214 was failing: it greps with a pattern containing [ ]*
3026 which obviously meant to catch spaces and tabs, but contained only
3027 spaces. Tabulations in sources are a nuisance, so to simplify the
3028 matter, get rid of all the tabulations in the Java sources. The
3029 other skeletons will be treated equally later.
3030
3031 * data/java.m4, data/lalr1.java: Untabify.
3032 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
3033 tabulations are no longer generated.
3034
30352008-11-11 Paolo Bonzini <bonzini@gnu.org>
3036
3037 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
3038 * configure.ac: Adjust usage.
3039 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3040 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3041 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
3042
30432008-11-10 Di-an Jan <dianj@freeshell.org>
3044
3045 Workaround Java's ``code too large'' problem for parser tables
3046 in most cases, by using one function per initialization.
3047 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
3048 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
3049 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
3050 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
3051 (yytname_): Use b4_typed_parser_table.
3052 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
3053 ``code too large'' error.
3054
30552008-11-10 Di-an Jan <dianj@freeshell.org>
3056
3057 * NEWS: Document them.
3058
3059 General Java skeleton improvements.
3060 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
3061 using gcj < 4.3 in the testsuite, according to comments in
3062 gnulib/m4/javacomp.m4.
3063 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
3064 location_type, position_type): Remove extraneous brackets from
3065 b4_percent_define_default.
3066 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
3067 m4_define and m4_define_default.
3068 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
3069 which marks the end of user code with appropriate syncline, like all
3070 the other skeletons.
3071 (b4_user_post_prologue): Add. Don't silently drop.
3072 (yylex): Remove.
3073 (parse): Inline yylex.
3074 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
3075 (%{...%}): Fix typo of %code imports.
3076 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
3077
3078 Support annotations on parser class with %define annotations.
3079 * data/lalr1.java (annotations): Add to parser class modifier.
3080 * doc/bison.texinfo (Java Parser Interface): Document
3081 %define annotations.
3082 (Java Declarations Summary): Document %define annotations.
3083 * tests/java.at (Java parser class modifiers): Test annotations.
3084
3085 Do not generate code for %error-verbose unless requested.
3086 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
3087 Make private. Make conditional on %error-verbose.
3088 (getErrorVerbose, setErrorVerbose): New.
3089 (yytnamerr_): Make conditional on %error-verbose.
3090 (yysyntax_error): Make some code conditional on %error-verbose.
3091 * doc/bison.texinfo (Java Bison Interface): Remove the parts
3092 about %error-verbose having no effect.
3093 (getErrorVerbose, setErrorVerbose): Document.
3094
3095 Move constants for token names to Lexer interface.
3096 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
3097 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
3098 (parse): Qualify EOF to Lexer.EOF.
3099 * doc/bison.texinfo (Java Parser Interface): Move documentation of
3100 EOF and token names to Java Lexer Interface.
3101 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
3102
3103 Make yyerror public.
3104 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
3105 (yyerror): Change to public. Add Javadoc comments. Use longer
3106 parameter names. Make the body rather than the declarator
3107 conditional on %locations.
3108 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
3109
3110 Allow user to add code to the constructor with %code init.
3111 * data/java.m4 (b4_init_throws): New, for %define init_throws.
3112 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
3113 Add %code init to the front of the constructor body.
3114 * doc/bison.texinfo (YYParser.YYParser): Document %code init
3115 and %define init_throws.
3116 (Java Declarations Summary): Document %code init and
3117 %define init_throws.
3118 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
3119 (Java constructor init and init_throws): Add tests.
3120
31212008-11-10 Akim Demaille <demaille@gostai.com>
3122
3123 Update TODO.
3124 * TODO (-D): is implemented.
3125 (associativity): Same precedence must have the same associativity.
3126 For instance, how can a * b / c be parsed if * is %left and / is
3127 %right?
3128 (YYERRORCODE, YYFAIL, YYBACKUP): New.
3129
31302008-11-10 Akim Demaille <demaille@gostai.com>
3131
3132 Formatting changes.
3133
31342008-11-10 Akim Demaille <demaille@gostai.com>
3135
3136 More information about the symbols.
3137 * src/output.c (type_names_output): Document all the symbols,
3138 including those that don't have a type-name.
3139 (symbol_definitions_output): Define "is_token" and
3140 "has_type_name".
3141 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
3142 type-name, now that they are defined too in b4_type_names.
3143
31442008-11-10 Akim Demaille <demaille@gostai.com>
3145
3146 Regen.
3147
31482008-11-10 Akim Demaille <demaille@gostai.com>
3149
3150 Make parser::yytranslate static.
3151 Small speedup (1%) on the list grammar. And makes yytranslate_
3152 available in non member functions.
3153
3154 * data/lalr1.cc (yytranslate_): Does not need to be a instance
3155 function.
3156
31572008-11-10 Akim Demaille <demaille@gostai.com>
3158
3159 Avoid trailing spaces.
3160 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
3161 * data/lalr1.cc: Don't indent before rule and symbol actions, as
3162 they can be empty, and anyway this incorrectly indents the first
3163 action.
3164
31652008-11-10 Akim Demaille <demaille@gostai.com>
3166
3167 Comment changes.
3168
31692008-11-10 Akim Demaille <demaille@gostai.com>
3170
3171 Use "enum" for integral constants.
3172 This is just nicer to read, I observed no speedup.
3173
3174 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
3175 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
3176 (yyuser_token_number_max_, yyundef_token_): Move into...
3177 (yytranslate_): here.
3178
31792008-11-10 Akim Demaille <demaille@gostai.com>
3180
3181 Shortcuts in bench directives.
3182 * etc/bench.pl.in (parse_dirs): New.
3183 Use it.
3184 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
3185 Create the benches in "benches/".
3186
31872008-11-10 Akim Demaille <demaille@gostai.com>
3188
3189 Formatting changes.
3190 * data/lalr1.cc: here.
3191
31922008-11-10 Akim Demaille <demaille@gostai.com>
3193
3194 Adjust verbose message to using emacs.
3195 * etc/bench.pl.in: Inform compilation-mode when we change the
3196 directory.
3197 (generate_grammar_list): Recognize %define "variant" in addition
3198 to %define variant.
3199
32002008-11-10 Akim Demaille <demaille@gostai.com>
3201
3202 Classify symbols by type-name.
3203 * src/uniqstr.h (UNIQSTR_CMP): New.
3204 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
3205 (type_names_output): New.
3206 (muscles_output): Use it.
3207 * data/lalr1.cc (b4_symbol_action_): Remove.
3208 (b4_symbol_case_, b4_type_action_): New.
3209 Adjust uses of b4_symbol_action_ to use b4_type_action_.
3210
32112008-11-10 Akim Demaille <demaille@gostai.com>
3212
3213 Change the handling of the symbols in the skeletons.
3214 Before we were using tables which lines were the symbols and which
3215 columns were things like number, tag, type-name etc. It is was
3216 difficult to extend: each time a column was added, all the numbers had
3217 to be updated (you asked for colon $2, not for "tag"). Also, it was
3218 hard to filter these tables when only a subset of the symbols (say the
3219 tokens, or the nterms, or the tokens that have and external number
3220 *and* a type-name) was of interest.
3221
3222 Now instead of monolithic tables, we define one macro per cell. For
3223 instance "b4_symbol(0, tag)" is a macro name which contents is
3224 self-decriptive. The macro "b4_symbol" provides easier access to
3225 these cells.
3226
3227 * src/output.c (type_names_output): Remove.
3228 (symbol_numbers_output, symbol_definitions_output): New.
3229 (muscles_output): Call them.
3230 (prepare_symbols): Define b4_symbols_number.
3231
32322008-11-10 Akim Demaille <demaille@gostai.com>
3233
3234 --trace=muscles
3235 * src/getargs.h, src/getargs.c (trace_muscle): New.
3236 (trace_types, trace_args): Support it.
3237 * src/output.c (output_skeleton): Use it.
3238
32392008-11-10 Akim Demaille <demaille@gostai.com>
3240
3241 muscles_output.
3242 * src/output.c (muscles_output): New, extracted from...
3243 (output_skeleton): here.
3244 Adjust.
3245
32462008-11-10 Akim Demaille <demaille@gostai.com>
3247
3248 Formatting changes.
3249
32502008-11-10 Akim Demaille <demaille@gostai.com>
3251
3252 Update the variant example.
3253 * examples/variant.yy: Formatting changes.
3254 One stage build.
3255
32562008-11-10 Akim Demaille <demaille@gostai.com>
3257
3258 Support constructor with an argument.
3259 This improves the "list" bench by 2%.
3260
3261 * data/lalr1.cc (variant::build): Add an overloaded version with
3262 an argument.
3263 * tests/c++.at (AT_CHECK_VARIANT): Check it.
3264
32652008-11-10 Akim Demaille <demaille@gostai.com>
3266
3267 Test variants.
3268 * tests/c++.at (AT_CHECK_VARIANTS): New.
3269 Use it with and without %define assert.
3270
32712008-11-10 Akim Demaille <demaille@gostai.com>
3272
3273 Add %precedence support.
3274 Unfortunately it is not possible to reuse the %prec directive. This
3275 is because to please POSIX, we do not require to end the rules with a
3276 semicolon. As a result,
3277
3278 foo: bar %prec baz
3279
3280 is ambiguous: either a rule which precedence is that of baz, or a rule,
3281 and then a declaration of the precedence of the token baz.
3282
3283 * doc/bison.texinfo: Document %precedence.
3284 (Precedence Only): New.
3285 * src/assoc.h, src/assoc.c (precedence_assoc): New.
3286 * src/conflicts.c (resolve_sr_conflict): Support it.
3287 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
3288 Parse it.
3289 * tests/calc.at: Use %precedence for NEG.
3290 * tests/conflicts.at (%precedence does not suffice)
3291 (%precedence suffices): New tests.
3292
32932008-11-09 Akim Demaille <demaille@gostai.com>
3294
3295 Make benches in a sub dirs.
3296 * etc/bench.pl.in ($dir): New.
3297 Use it.
3298 Check the use of constructors with an argument.
3299 (bench_variant_parser): Fix.
3300
33012008-11-09 Akim Demaille <demaille@gostai.com>
3302
3303 fix eof condition
3304
33052008-11-09 Akim Demaille <demaille@gostai.com>
3306
3307 Fix --help.
3308
33092008-11-09 Akim Demaille <demaille@gostai.com>
3310
3311 Require the generation of parse-gram.output.
3312 * src/Makefile.am (YACC): Pass --report=all.
3313
33142008-11-09 Akim Demaille <demaille@gostai.com>
3315
3316 Formatting changes.
3317
33182008-11-09 Akim Demaille <demaille@gostai.com>
3319
3320 Update TODO.
3321 * TODO: Remove obsolete items.
3322 Update others.
3323
33242008-11-09 Akim Demaille <demaille@gostai.com>
3325
3326 Enhance bench.pl.
3327 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
3328 (@token, $grammar, $bench): New.
3329 (generate_grammar_variant): Rename as...
3330 (generate_grammar_list): this.
3331 (generate_grammar): Adjust.
3332 (bench_grammar): Rename as...
3333 (bench): this.
3334 Use it in the various bench-marking routines.
3335 (-b, -g): New options.
3336
33372008-11-09 Akim Demaille <demaille@gostai.com>
3338
3339 Use a static hierarchy for symbols in the C++ parser.
3340 * data/lalr1.cc (symbol_base_type, symbol_type)
3341 (stack_symbol_type): Make it a static hierarchy.
3342 Adjust dependencies.
3343
33442008-11-09 Akim Demaille <demaille@gostai.com>
3345
3346 bench.pl -d, --directive.
3347 * etc/bench.pl.in (@directive): New.
3348 (&bench_grammar): Use it.
3349 (&bench_list_grammar): New, to provide access to the "variant"
3350 grammar.
3351 Use it.
3352 (getopts): Support -d, --directive.
3353
33542008-11-09 Akim Demaille <demaille@gostai.com>
3355
3356 Use inline for small operations.
3357 * data/lalr1.cc (symbol_base_type, symbol_type)
3358 (stack_symbol_type): Declare constructor and other operations as
3359 inline.
3360 (yy_destroy_): Inline.
3361
33622008-11-09 Akim Demaille <demaille@gostai.com>
3363
3364 Introduce a hierarchy for symbols.
3365 * data/lalr1.cc (symbol_base_type, symbol_type): New.
3366 (data_type): Rename as...
3367 (stack_symbol_type): this.
3368 Derive from symbol_base_type.
3369 (yy_symbol_value_print_): Merge into...
3370 (yy_symbol_print_): this.
3371 Rename as...
3372 (yy_print_): this.
3373 (yydestruct_): Rename as...
3374 (yy_destroy_): this.
3375 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
3376 (parser::parse): yyla is now of symbol_type.
3377 Use its type member instead of yytoken.
3378
33792008-11-09 Akim Demaille <demaille@gostai.com>
3380
3381 Rename data_type and stack_symbol_type.
3382 * data/lalr1.cc (data_type): Rename as...
3383 (stack_symbol_type): this.
3384
33852008-11-09 Akim Demaille <demaille@gostai.com>
3386
3387 Handle semantic value and location together.
3388 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
3389 yydata.value and yydata.location.
3390 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
3391 (YY_SYMBOL_PRINT): Now take semantic value and location as a
3392 single arg.
3393 Adjust all callers.
3394 (yydestruct_): New overload for a stack symbol.
3395
33962008-11-09 Akim Demaille <demaille@gostai.com>
3397
3398 Push a complete symbol, not connected parts.
3399 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
3400 state, value and location.
3401 Adjust callers.
3402
34032008-11-09 Akim Demaille <demaille@gostai.com>
3404
3405 Agregate yylval and yylloc.
3406 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
3407 (parser::yyla): this.
3408
34092008-11-09 Akim Demaille <demaille@gostai.com>
3410
3411 Rely on the state stack to display reduction traces.
3412 To display rhs symbols before a reduction, we used information
3413 about the rule reduced, which required the tables yyrhs and
3414 yyprhs. Now use rely only on the state stack to get the same
3415 information.
3416
3417 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
3418 Use them.
3419 (parser::yyrhs_, parser::yyprhs_): Remove.
3420 (parser::yy_reduce_print_): Use the state stack.
3421
34222008-11-09 Akim Demaille <demaille@gostai.com>
3423
3424 Fuse yyval and yyloc into yylhs.
3425 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
3426 yylhs.
3427 (parse): Replace yyval and yyloc with yylhs.value and
3428 yylhs.location.
3429 After a user action, compute yylhs.state earlier.
3430 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
3431 fresh error_token.
3432
34332008-11-09 Di-an Jan <dianj@freeshell.org>
3434
3435 Remove unused variable.
3436 * src/output.c (type_names_output): Remove unused variable sep.
3437
34382008-11-09 Paolo Bonzini <bonzini@gnu.org>
3439
3440 Change tests/output.at quoting.
3441 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
3442 expanding arguments.
3443
34442008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3445
3446 Don't add a semicolon to actions for %skeleton or %language.
3447 It breaks Java test cases as reported by Akim Demaille.
3448 * src/scan-code.l: Implement.
3449
34502008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3451
3452 Clean up %skeleton and %language priority implementation.
3453 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
3454 remove static qualifier because others will soon need to see it.
3455 (language_prio): Likewise.
3456 (getargs): Use command_line_prio rather than 0.
3457 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
3458 enum fields.
3459 (skeleton_prio): Extern it.
3460 (language_prio): Extern it.
3461 * src/parse-gram.y: Use grammar_prio rather than 1.
3462
34632008-11-07 Akim Demaille <demaille@gostai.com>
3464
3465 Moving push traces into yypush_.
3466 * data/lalr1.cc (yypush_): Now takes a optional trace message.
3467 Adjust all uses.
3468
34692008-11-07 Akim Demaille <demaille@gostai.com>
3470
3471 The single-stack C++ parser is now the standard one.
3472 * data/lalr1.cc: Rename as...
3473 * data/lalr1-split.cc: this.
3474 * data/lalr1-fusion.cc: Rename as...
3475 * data/lalr1.cc: this.
3476 * etc/bench.pl.in: Adjust.
3477
34782008-11-07 Akim Demaille <demaille@gostai.com>
3479
3480 Avoid empty-if warnings.
3481 Reported by Quentin Hocquet.
3482
3483 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
3484 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
3485
34862008-11-07 Akim Demaille <demaille@gostai.com>
3487
3488 Pass command line location to skeleton_arg and language_argmatch.
3489 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
3490 The location argument is now mandatory.
3491 Adjust all dependencies.
3492 (getargs): Use command_line_location.
3493
34942008-11-07 Akim Demaille <demaille@gostai.com>
3495
3496 -D, --define.
3497 * src/getargs.c (usage): Document -D.
3498 Fix help string for --locations.
3499 (command_line_location): New.
3500 (short_options, long_options, getargs): Support -D, --define.
3501 (getargs): Move -d support at the right place.
3502 * doc/bison.texinfo (Bison Options): Update.
3503 * tests/input.at (%define, --define): New.
3504
35052008-11-07 Akim Demaille <demaille@gostai.com>
3506
3507 Initialize the muscle table before parsing the command line.
3508 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
3509 (getargs): Define file_name.
3510 * src/main.c (main): Initialize muscle_tab before calling
3511 getargs.
3512 * src/muscle_tab.c (muscle_init): No longer define file_name, as
3513 its value is not available yet.
3514
35152008-11-07 Akim Demaille <demaille@gostai.com>
3516
3517 Locations without columns for command line arguments.
3518 * src/location.c (location_print): Don't display negative columns.
3519 * src/location.h: Document this.
3520
35212008-11-07 Akim Demaille <demaille@gostai.com>
3522
3523 Fix --help.
3524 * src/getargs.c (usage): Fix help string for -W.
3525
35262008-11-07 Akim Demaille <demaille@gostai.com>
3527
3528 Handle more general types of option arguments.
3529 * build-aux/cross-options.pl: The argument ends at the first
3530 space, not the first non-symbol character.
3531 Use @var for each word appearing the argument description.
3532
35332008-11-07 Akim Demaille <demaille@gostai.com>
3534
3535 Destroy the variants that remain on the stack in case of error.
3536 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
3537 destructor.
3538 Display the value only if yymsg is nonnull.
3539 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
3540
35412008-11-07 Akim Demaille <demaille@gostai.com>
3542
3543 Add "%define assert" to variants.
3544 This is used to help the user catch cases where some value gets
3545 ovewritten by a new one. This should not happen, as this will
3546 probably leak.
3547
3548 Unfortunately this uncovered a bug in the C++ parser itself: the
3549 lookahead value was not destroyed between two calls to yylex. For
3550 instance if the previous lookahead was a std::string, and then an int,
3551 then the value of the std::string was correctly taken (i.e., the
3552 lookahead was now an empty string), but std::string structure itself
3553 was not reclaimed.
3554
3555 This is now done in variant::build(other&) (which is used to take the
3556 value of the lookahead): other is not only stolen from its value, it
3557 is also destroyed. This incurs a new performance penalty of a few
3558 percent, and union becomes faster again.
3559
3560 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
3561 (b4_variant_if): New.
3562 (variant::built): New.
3563 Use it whereever the status of the variant changes.
3564 * etc/bench.pl.in: Check the penalty of %define assert.
3565
35662008-11-07 Akim Demaille <demaille@gostai.com>
3567
3568 Use "%define variant" in bench.pl.
3569 * etc/bench.pl.in: No longer use the pseudo directive %variants,
3570 just use %define variants.
3571
35722008-11-07 Akim Demaille <demaille@gostai.com>
3573
3574 Regen.
3575 * src/parse-gram.h, src/parse-gram.c: Regen.
3576
35772008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
3578
3579 Fix user actions without a trailing semicolon.
3580 Reported by Sergei Steshenko at
3581 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
3582 * THANKS (Sergei Steshenko): Add.
3583 * src/scan-code.l (SC_RULE_ACTION): Fix it.
3584 * tests/regression.at (Fix user actions without a trailing semicolon):
3585 New test case.
3586
35872008-11-04 Akim Demaille <demaille@gostai.com>
3588
3589 Use b4_copyright_years.
3590 * data/yacc.c (b4_copyright_years): New.
3591 Fix its value according to the comments in the file.
3592 Use it and undefine it.
3593
35942008-11-04 Akim Demaille <demaille@gostai.com>
3595
3596 Formatting changes.
3597 * data/lalr1-fusion.cc, src/parse-gram.y: here.
3598
35992008-11-04 Akim Demaille <demaille@gostai.com>
3600
3601 Formatting changes.
3602 * data/lalr1-fusion.cc: here.
3603
36042008-11-04 Akim Demaille <demaille@gostai.com>
3605
3606 Use strict on bench.pl.
3607 * etc/bench.pl.in (&run, &generate_grammar): New.
3608 Rename the grammar generating functions for consistency.
3609 Change the interface so that the list of benches to run is passed
3610 as (optionless) arguments.
3611 (&compile): Use &run.
3612
36132008-11-04 Akim Demaille <demaille@gostai.com>
3614
3615 Remove spurious initial empty lines.
3616 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
3617 * data/yacc.c: End the @output lines with an @.
3618
36192008-11-04 Akim Demaille <demaille@gostai.com>
3620
3621 Improve the display of sizes.
3622 * etc/bench.p.in: Higher precision.
3623 Sort by decreasing size.
3624
36252008-11-04 Akim Demaille <demaille@gostai.com>
3626
3627 Don't memcpy C++ structures.
3628 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
3629 arguments.
3630 (variant::build): New overload for
3631 copy-construction-that-destroys.
3632 (variant::swap): New.
3633 (parser::yypush_): Use it in variant mode.
3634
36352008-11-04 Akim Demaille <demaille@gostai.com>
3636
3637 Better defaults for bench.pl.
3638 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
3639 default values.
3640 Adjust &verbose uses.
3641 (-q, --quiet): New.
3642
36432008-11-04 Akim Demaille <demaille@gostai.com>
3644
3645 Make variant.yy more complex.
3646 std::list cannot be copied via memcpy, they are more demanding than
3647 std::string. Use one std::list to strengthen the test.
3648
3649 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
3650 Adjust.
3651 Create a list of strings, instead of a single large string.
3652
36532008-11-04 Akim Demaille <demaille@gostai.com>
3654
3655 bench.pl --bench.
3656 * etc/bench.pl.in (--bench, $bench): New.
3657
36582008-11-04 Akim Demaille <demaille@gostai.com>
3659
3660 Sort methods.
3661 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
3662 Define it after as().
3663
36642008-11-04 Akim Demaille <demaille@gostai.com>
3665
3666 Useless parens.
3667 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
3668
36692008-11-04 Akim Demaille <demaille@gostai.com>
3670
3671 Issue missing synclines after user actions.
3672 * data/c.m4 (b4_case): Issue synclines on the output file.
3673
36742008-11-04 Akim Demaille <demaille@gostai.com>
3675
3676 Remove trailing empty line.
3677 * data/lalr1-fusion.cc: Don't add an empty line after the user's
3678 epilogue.
3679
36802008-11-04 Akim Demaille <demaille@gostai.com>
3681
3682 Fix output of copyright years.
3683 * data/bison.m4 (b4_copyright): Fix the indentation of the
3684 copyright year paragraph.
3685 Use b4_copyright_years when no years are given.
3686 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
3687 (b4_copyright_years): New.
3688 Use it.
3689
36902008-11-04 Akim Demaille <demaille@gostai.com>
3691
3692 Avoid the spurious initial empty line.
3693 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
3694 the end of @output request to suppress the empty line that
3695 results.
3696
36972008-11-04 Akim Demaille <demaille@gostai.com>
3698
3699 Remove parser::rhs_number_type.
3700 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
3701 (yyrhs_): Use b4_table_define.
3702
37032008-11-04 Akim Demaille <demaille@gostai.com>
3704
3705 Fix iteration type.
3706 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
3707
37082008-11-04 Akim Demaille <demaille@gostai.com>
3709
3710 Factor the declaration of the integer tables.
3711 * data/lalr1-fusion.cc (b4_table_define): New.
3712 Use it.
3713
37142008-11-03 Akim Demaille <demaille@gostai.com>
3715
3716 Fix indentation of tables in lalr1.cc
3717 * data/lalr1-fusion.cc: Fix the indentation.
3718
37192008-11-03 Akim Demaille <demaille@gostai.com>
3720
3721 Destroy the lhs symbols after reduction.
3722 * data/lalr1-fusion.cc (parse): After the user action, when in
3723 variant mode, destroy the lhs symbols.
3724
37252008-11-03 Akim Demaille <demaille@gostai.com>
3726
3727 Simplify yysyntax_error_ use.
3728 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
3729 type, but make it unnamed in the declaration when it is not used.
3730
37312008-11-03 Akim Demaille <demaille@gostai.com>
3732
3733 Let yy::variant::build return an lvalue.
3734 * data/lalr1-fusion.cc (variant::build): Return a reference to the
3735 object.
3736
37372008-11-03 Akim Demaille <demaille@gostai.com>
3738
3739 Define yy::variant only when needed.
3740 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
3741 used.
3742
37432008-11-03 Akim Demaille <demaille@gostai.com>
3744
3745 Bench the three-stack lalr1.cc.
3746 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
3747 one-stack one.
3748
37492008-11-03 Akim Demaille <demaille@gostai.com>
3750
3751 Fail on parse error in calc++.
3752 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
3753 status.
3754 * examples/calc++/test ($me, $number, $exit, run): New.
3755 Use them to propagate errors to the exit status.
3756
37572008-11-03 Akim Demaille <demaille@gostai.com>
3758
3759 Don't specify the skeleton twice in the example.
3760 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
3761 file does what is needed.
3762
37632008-11-03 Akim Demaille <demaille@gostai.com>
3764
3765 bench: Improve output.
3766 * etc/bench.pl.in (bench_grammar): Tune the printf format.
3767
37682008-11-03 Akim Demaille <demaille@gostai.com>
3769
3770 bench: check impact of %debug on variants.
3771 * etc/bench.pl.in (variant_grammar): Fix the computation of
3772 $variant.
3773 Generate a grammar file that can work with or without %debug.
3774 Do use the @directive.
3775 (bench_variant_parser): Check impact of %debug.
3776 (@directives): Rename all the occurrences to...
3777 (@directive): this, for consistency.
3778
37792008-11-03 Akim Demaille <demaille@gostai.com>
3780
3781 bench: report the size too.
3782 * etc/bench.pl.in ($iterations): Defaults to -3.
3783 (&bench_grammar): Require hireswallclock.
3784 Compute and display the size of the result.
3785 More comments.
3786
37872008-11-03 Akim Demaille <demaille@gostai.com>
3788
3789 bench: More use of the verbosity level.
3790 * etc/bench.pl.in ($verbose, &verbose): New.
3791 Use them.
3792 More POD documentation.
3793
37942008-11-03 Akim Demaille <demaille@gostai.com>
3795
3796 bench.pl: a command line interface
3797 * etc/bench.pl.in: More doc.
3798 Some fixes in the documentation.
3799 ($cflags, $iterations, &help, &getopt): New.
3800 Use them.
3801 (&variant_grammar): Let the number of stages be 10 times what is
3802 specified.
3803
38042008-11-03 Akim Demaille <demaille@gostai.com>
3805
3806 Bench the use of Boost.Variants.
3807 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
3808 New.
3809 (&compile): Be ready to compile C++ parsers.
3810 (&bench_push_parser): Move debug information to the outermost
3811 level.
3812 * THANKS: Add Michiel De Wilde.
3813
38142008-11-03 Akim Demaille <demaille@gostai.com>
3815
3816 bench.pl: Pass directives as a list instead of as a string.
3817 * etc/bench.pl.in (&directives): New.
3818 (&triangular_grammar, &calc_grammar): Use it to format the Bison
3819 directives.
3820 (&triangular_grammar): Do use the directives (were ignored).
3821 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
3822 directives.
3823
38242008-11-03 Akim Demaille <demaille@gostai.com>
3825
3826 Improve genericity of bench.pl.
3827 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
3828 argument.
3829 (&bench_push_parser): New.
3830 Call it.
3831
38322008-11-03 Akim Demaille <demaille@gostai.com>
3833
3834 Add documentation to bench.pl.
3835 * etc/bench.pl.in: Comment changes.
3836
38372008-11-03 Akim Demaille <demaille@gostai.com>
3838
3839 Fuse the three stacks into a single one.
3840
3841 In order to make it easy to perform benchmarks to ensure that
3842 there are no performance loss, lalr1.cc is forked into
3843 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
3844 lalr1.cc.
3845
3846 Meanwhile, to make sure that lalr1-fusion.cc is correctly
3847 exercized by the test suite, the user must install a symbolic link
3848 from lalr1.cc to it.
3849
3850 Instead of having three stacks (state, value, location), use a
3851 stack of triples. This considerably simplifies the code (and it
3852 will be easier not to require locations as currently does the C++
3853 parser), and also gives a 10% speedup according to
3854 etc/bench (probably mainly since memory allocation is done once
3855 instead of three times).
3856
3857 Another motivation is to make it easier to destruct properly
3858 semantic values: now that they are bound to their state (hence
3859 symbol type) it will be easier to call the appropriate destructor.
3860
3861 These changes should probably benefit the C parser too.
3862
3863 * data/lalr1.cc: Copy as...
3864 * data/lalr1-fusion.cc: this new file.
3865 (b4_rhs_value, b4_rhs_location): New definitions overriding those
3866 from c++.m4.
3867 (state_stack_type, semantic_stack_type, location_stack_type)
3868 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
3869 (data_type, stack_type, yystack_): New.
3870 (YYLLOC_DEFAULT, yypush_): Adjust.
3871 (yyerror_range): Now based on data_type, not location_type.
3872
38732008-11-03 Akim Demaille <demaille@gostai.com>
3874
3875 Push the state, value, and location at the same time.
3876 This is needed to prepare a forthcoming patch that fuses the three
3877 stacks into one.
3878
3879 * data/lalr1.cc (parser::yypush_): New.
3880 (parser::yynewstate): Change the semantics: instead of arriving to
3881 this label when value and location have been pushed, but yystate
3882 is to be pushed on the state stack, now the three of them must
3883 have been pushed before. yystate still must be the new state.
3884 This allows to use yypush_ everywhere instead of individual
3885 handling of the stacks.
3886
38872008-11-03 Akim Demaille <demaille@gostai.com>
3888
3889 Prefer references to pointers.
3890 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
3891 definition to use references instead of pointers.
3892 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
3893 Take the value and location as references.
3894 Adjust callers.
3895
38962008-11-03 Akim Demaille <demaille@gostai.com>
3897
3898 stack::size instead of stack::height.
3899 * data/lalr1.cc (stack::height): Rename as...
3900 (stack::size): this.
3901 Fix the output type.
3902 Comment changes.
3903
39042008-11-03 Akim Demaille <demaille@gostai.com>
3905
3906 Use variants to support objects as semantic values.
3907 This patch was inspired by work by Michiel De Wilde. But he used
3908 Boost variants which (i) requires Boost on the user side, (ii) is
3909 slow, and (iii) has useless overhead (the parser knows the type of
3910 the semantic value there is no reason to duplicate this
3911 information as Boost.Variants do).
3912
3913 This implementation reserves a buffer large enough to store the
3914 largest objects. yy::variant implements this buffer. It was
3915 implemented with Quentin Hocquet.
3916
3917 * src/output.c (type_names_output): New.
3918 (output_skeleton): Invoke it.
3919 * data/c++.m4 (b4_variant_if): New.
3920 (b4_symbol_value): If needed, provide a definition for variants.
3921 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
3922 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
3923 (b4_char_sizeof, yy::variant): New.
3924 (parser::parse): If variants are requested, define
3925 parser::union_type, parser::variant, change the definition of
3926 semantic_type, construct $$ before running the user action instead
3927 of performing a default $$ = $1.
3928 * examples/variant.yy: New.
3929 Based on an example by Michiel De Wilde.
3930
39312008-11-03 Akim Demaille <demaille@gostai.com>
3932
3933 Parameterize the extraction of semantic values.
3934 To make future changes easier, no longer rely on ".TYPE" being the
3935 way to get a semantic value.
3936
3937 * data/c.m4 (b4_symbol_value): New.
3938 Use it.
3939 * data/c++.m4, data/yacc.c: Use it.
3940 * data/glr.c: Use b4_symbol_value.
3941 (b4_rhs_data): New.
3942 Use it.
3943
39442008-11-03 Akim Demaille <demaille@gostai.com>
3945
3946 Prepare easier M4 changes.
3947 * data/lalr1.cc: Use escaped [] instead of literals to prepare
3948 future changes.
3949
39502008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3951
3952 Initiate further development.
3953 * NEWS: Create an empty section for new entries.
3954 * gnulib: Update submodule to HEAD.
3955
39562008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3957
3958 * NEWS: Version 2.4.
3959
39602008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3961
3962 Prepare for next release.
3963 * NEWS: Briefly mention changes since 2.3b.
3964 * README: Say GNU m4 1.4.6, which we've been requiring in release
3965 announcements already, not 1.4.3, which breaks the build.
3966
39672008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3968
3969 Say %language is experimental.
3970 We're thinking of extending it's effect on output file naming. See the
3971 thread at
3972 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
3973 * NEWS: Say it's experimental.
3974 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
3975 recommend it over %skeleton for now.
3976 (Bison Options): Likewise.
3977 (C++ Bison Interface): Use %skeleton not %language.
3978 (Calc++ Parser): Use %skeleton not %language.
3979 * src/getargs.c (usage): Say it's experimental.
3980
39812008-11-01 Di-an Jan <dianj@freeshell.org>
3982 Paolo Bonzini <bonzini@gnu.org>
3983
3984 Support all Java parser class modifiers.
3985 * data/java.m4 (b4_percent_define_get3): New.
3986 (b4_final_if, b4_strictfp_if): New.
3987 * data/lalr1.java (final, strictfp, extends, implements): Support.
3988 * doc/bison.texinfo (final, strictfp, extends, implements): Add
3989 documentation.
3990 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
3991 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
3992 (AT_CHECK_JAVA_GREP): New.
3993 (Java parser class modifiers): New test.
3994 (Java parser class extends and implements): New test.
3995
3996 Model exception propagation better with throws and lex_throws.
3997 * data/java.m4 (b4_list2): New.
3998 (throws): Change default.
3999 * data/lalr1.java (yyaction): Add throws.
4000 (parse): Add lex_throws in addition to throws.
4001 * doc/bison.texinfo (throws, lex_throws): Add documentation.
4002 * tests/java.at (Java throws specifications): New test.
4003
4004 Improve documentation for Java parsers.
4005 * doc/bison.texinfo (Java Parsers): Add subsections.
4006 Don't quote first argument of %define.
4007 (Java Bison Interface): Document output files. Move documentation
4008 of parser class and merge into Java Parser Interface. Document
4009 features that error out. Document directives with no effect.
4010 Move note about Javadoc higher.
4011 (Java Semantic Values): Explicitly mention stype.
4012 Document that generic types cannot be used.
4013 (Java Location Values): Use @deftypeivar. Document constructors.
4014 Correct return value for toString.
4015 (Java Parser Interface): List undocumented constants/fields.
4016 Move documentation of fields added by %parse-param closer to list
4017 of members. Document that token names are added as fields.
4018 Document constructors accurately. Remove error method.
4019 (Java Scanner Interface): Move note on %pure-parser to Java Bison
4020 Interface. Describe %code lexer and yylex accutately.
4021 Remove documentation that does not match the code.
4022 (Java Action Features): New.
4023 (Java Differences): Add reference. Add item on semantic values.
4024 Add note about @{ ... @}. Clarify %% epilogue placement.
4025 (Java Declarations Summary): New.
4026
4027 Fix Java skeleton.
4028 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
4029 (b4_remove_comma): Quote test argument.
4030 (b4_identification): Remove "bison" field.
4031 * tests/java.at (Java parser class and package names): New test.
4032 (Java %parse-param and %lex-param): New test.
4033 (Java stype, position_class and location_class): New test.
4034
40352008-10-31 Di-an Jan <dianj@freeshell.org>
4036
4037 * data/lalr1.jave: Update copyright years.
4038 (YYParser): Correct name of "generated from" file in Javadoc:
4039 use b4_file_name instead of @ofile@.
4040 (Location constructor): Correct Javadoc parameter name.
4041 (yylloc): Add missing opening m4 quote after b4_location_if.
4042 This removes a stray [ in the Javadoc of Lexer.getStartPos.
4043 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
4044 (YYParser constructor): Correct Javadoc parameter name.
4045
40462008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
4047
4048 Always put auxiliary code files in the same dir as other output files.
4049 * src/files.c (compute_file_name_parts): When the user specifies
4050 --output but not --file-prefix, extract the directory prefix from the
4051 file prefix not from the grammar file name. This affects the location
4052 of files like location.hh generated by the C++ skeleton. The includes
4053 in the other output files require this fix.
4054 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
4055 for expected output files.
4056 (Output files): Add a test for the above.
4057
40582008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
4059
4060 * gnulib: Update submodule to HEAD.
4061
40622008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4063
4064 Update copyright year.
4065 * src/files.c: Here.
4066
40672008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
4068
4069 Don't overwrite the input file.
4070 * src/files.c (output_file_name_check): Fatal error if using input file
4071 for output.
4072 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
4073 argument.
4074 (Conflicting output files): Add test.
4075
40762008-10-28 Akim Demaille <demaille@gostai.com>
4077
4078 Space changes.
4079 * data/lalr1.cc: Formatting changes.
4080
40812008-10-28 Akim Demaille <demaille@gostai.com>
4082
4083 Don't define debugging functions when !YYDEBUG.
4084 * data/lalr1.cc (debug_stream, set_debug_stream)
4085 (debug_level_type, debug_level, set_debug_level): Don't
4086 declare them when YYDEBUG is not defined.
4087 The implementation are already YYDEBUG-aware.
4088
40892008-10-28 Akim Demaille <demaille@gostai.com>
4090
4091 Prefer "continue" for empty loop bodies.
4092 * etc/bench.pl.in: Use "continue" instead of {}.
4093
40942008-10-28 Akim Demaille <demaille@gostai.com>
4095
4096 Space and comments changes.
4097 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
4098 * data/c.m4, data/lalr1.cc: Space changes.
4099
41002008-10-28 Akim Demaille <demaille@gostai.com>
4101
4102 Make gnulib a submodule.
4103 * gnulib: New.
4104 * .gitmodules (gnulib): New.
4105
41062008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4107
4108 Fix yyerror_range for user-defined location type in C++. Reported by
4109 Georg Sauthoff at
4110 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
4111 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
4112 * THANKS (Georg Sauthoff): Add.
4113
41142008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4115
4116 Update several administrative files mainly to facilitate releasing.
4117 * HACKING (Administrivia): Make the git-merge-changelog notes more
4118 helpful.
4119 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
4120 (Release Procedure): Update for git and add numerous details that were
4121 previously missing.
4122 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
4123 * maint.mk (announcement): Don't list bison as a bootstrap tool so
4124 that announcements don't claim we bootstrapped with whatever bison
4125 happened to be in PATH. Add flex as a bootstrap tool.
4126 * Makefile.maint: Remove, previously replaced by maint.mk.
4127 * Makefile.cfg: Remove, and migrate settings to...
4128 * cfg.mk: ... here for the sake of `make announcement'.
4129 * bootstrap.conf (gnulib_modules): Add announce-gen.
4130 * README: Say GNU Bison instead of just Bison. Suggested by Karl
4131 Berry.
4132
41332008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
4134
4135 Small but important bugfixes for the Java skeleton.
4136 * data/lalr1.java (yyerror): Change Location to b4_location_type.
4137 (yy_symbol_print): Call toString on yyvaluep.
4138
41392008-08-29 Akim Demaille <demaille@gostai.com>
4140
4141 Clarify UPDATED use.
4142 * doc/bison.texinfo: It refers to the last edition of this file,
4143 not to the release date of Bison.
4144 Reported by Joel E. Denny.
4145
41462008-08-29 Akim Demaille <demaille@gostai.com>
4147
4148 * README: Update FAQ pointer.
4149 Reported by Joel E. Denny.
4150
41512008-08-27 Eric Blake <ebb9@byu.net>
4152
4153 Resync m4sugar from autoconf.
4154 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
4155 (m4_init): Adjust to latest m4.git changes.
4156 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
4157 effects.
4158 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
4159 (_m4_list_cmp): Reduce side effects.
4160
41612008-08-27 Akim Demaille <demaille@gostai.com>
4162
4163 Check yyerrok in calc.at.
4164 * tests/calc.at (calc.y): Use yyerrok on "( error )".
4165 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
4166 expected.
4167
41682008-08-27 Akim Demaille <demaille@gostai.com>
4169
4170 Support yyerrok in lalr1.cc.
4171 YYBACKUP is still to import back into lalr1.cc.
4172 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
4173
41742008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4175
4176 For maintainer-check*, don't recompile for a $(VERSION) update.
4177 * cfg.mk: New file.
4178 (_is-dist-target): Override the one in GNUmakefile.
4179 * Makefile.am (EXTRA_DIST): Add cfg.mk.
4180
41812008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4182
4183 Update for recent change to gnulib.
4184 * src/parse-gram.y: Don't include strverscmp.h. It comes from
4185 string.h now.
4186
41872008-08-15 Eric Blake <ebb9@byu.net>
4188
4189 Remaining m4sugar merge from autoconf.
4190 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
4191 * data/m4sugar/foreach.m4: New file, copied from autoconf.
4192 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
4193 * src/output.c (output_skeleton): Tell m4 how to find it.
4194
4195 Partial m4sugar merge from autoconf: m4_map.
4196 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
4197 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
4198 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
4199 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
4200 for empty list.
4201 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
4202 Likewise.
4203 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
4204 declares it.
4205
42062008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
4207
4208 Keep .version and PACKAGE_VERSION in sync.
4209 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
4210 dependency, and add comments justifying this in more detail. Discussed
4211 starting at
4212 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
4213
42142008-08-06 Eric Blake <ebb9@byu.net>
4215
4216 Partial m4sugar merge from autoconf: m4_shiftn.
4217 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
4218 (m4_shift2, m4_shift3): New macros.
4219 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
4220 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
4221 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
4222 * data/java.m4 (b4_remove_comma): Likewise.
4223
4224 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
4225 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
4226 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
4227 (m4_init): Consolidate wrapped text into single m4_wrap.
4228 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
4229 in wrapped text.
4230
42312008-08-05 Eric Blake <ebb9@byu.net>
4232
4233 Partial m4sugar merge from autoconf: builtins, version.m4.
4234 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
4235 (m4_prepend): Remove, as it is unused and inherently quadratic,
4236 whereas m4_append is linear in newer m4.
4237 (m4_mkstemp): New builtin.
4238 (m4_symbols): Make rename conditional.
4239 (m4_version_prereq): Ensure fatal error if used in bison, which
4240 intentionally lacks version.m4.
4241
4242 Fix comments in m4sugar.
4243 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
4244
42452008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
4246
4247 Update for recent .gitignore fix in Gnulib.
4248 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
4249 anchored .gitignore entries.
4250
42512008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
4252
4253 Set gnu or gnits strictness.
4254 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
4255 development and gnits strictness for releases. Based on Eric Blake's
4256 suggestion at
4257 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
4258
42592008-07-31 Paolo Bonzini <bonzini@gnu.org>
4260
4261 * NEWS: Clarify documentation of %language.
4262
42632008-07-31 Paolo Bonzini <bonzini@gnu.org>
4264
4265 Support usage of git-merge-changelog.
4266 * .gitattributes: New.
4267 * HACKING: Document usage of git-merge-changelog.
4268 * bootstrap: Install git-merge-changelog entries in .git/config
4269 if appropriate.
4270
42712008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4272
4273 Remove remaining dependence on CVS Id keyword.
4274 * ChangeLog: For the sake of people still using CVS, don't use dollars
4275 when mentioning Id.
4276 * data/xslt/bison.xsl: Remove Id from header comments, where it was
4277 unusual anyway.
4278 * data/xslt/xml2dot.xsl: Likewise.
4279 * data/xslt/xml2text.xsl: Likewise.
4280 * data/xslt/xml2xhtml.xsl: Likewise.
4281 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
4282 * doc/Makefile.am (neutralize): Remove, no longer needed.
4283 (.x.1): Don't use neutralize.
4284 (edit): Don't substitute for ID.
4285 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
4286
42872008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4288
4289 Fix dependence on computed configure variables.
4290 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
4291 $(top_srcdir)/configure.ac so that changes to computed variables, such
4292 as PACKAGE_VERSION, are seen.
4293 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
4294
42952008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
4296
4297 Update copyright dates for recent changes.
4298 * Makefile.am: Here.
4299 * src/Makefile.am: Here.
4300 * src/reduce.c: Here.
4301 * tests/reduce.at: Here.
4302
43032008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
4304
4305 Use git-version-gen for version names between releases.
4306 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
4307 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
4308 * .prev-version: New.
4309 * .version.in: Remove.
4310 * ChangeLog: Remove the Id previously used for capturing the CVS
4311 revision.
4312 * GNUmakefile: Remove, now copied from Gnulib.
4313 * Makefile.am: Add code suggested by comments in
4314 build-aux/git-version-gen.
4315 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
4316 .prev-version, and .version.
4317 * NEWS (2.3b+): Rename to...
4318 (?.?): ... this because we're dropping the "+" version naming scheme,
4319 but, in general, we still can't be sure of our next release name.
4320 * bootstrap: Add a quick hack to remove from .gitignore the
4321 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
4322 entry. This should really be fixed in gnulib instead.
4323 * bootstrap.conf (gnulib_modules): Add gnumakefile.
4324 * configure.ac (AC_INIT): Set version name by invoking
4325 build-aux/git-version-gen.
4326 (AC_CONFIG_FILES): Remove .version, now generated by
4327 build-aux/git-version-gen.
4328 * maint.mk: New, copied from coreutils.
4329 * doc/.cvsignore (bison.1): Add.
4330 * doc/.gitignore (/bison.1): Add.
4331 * doc/bison.1: Remove, generated.
4332 * src/.cvsignore (revision.c): Remove.
4333 * src/.gitignore (/revision.c): Remove.
4334 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
4335 (BUILT_SOURCES): Remove revision.c.
4336 (revision.c): Remove.
4337 * src/getargs.c (version): Don't print revision after the VERSION.
4338 * src/revision.h: Remove.
4339
43402008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4341
4342 Fix untranslatable composition of sentences. Reported by Goran
4343 Uddeborg at
4344 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
4345 * THANKS (Goran Uddeborg): Add.
4346 * src/reduce.c (reduce_print): Report the number of nonterminals and
4347 rules useless in the grammar in separate sentences.
4348 * tests/reduce.at (Useless Rules): Update output.
4349 (Reduced Automaton): Likewise.
4350 (Underivable Rules): Likewise.
4351 (Empty Language): Likewise.
4352
43532008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4354
4355 Fix some .gitignore and .cvsignore problems.
4356 * bootstrap (insert_sorted_if_absent): Replace all uses with...
4357 (insert_vc_ignore): ... this new function, which prepends `/' to all
4358 .gitignore entries before passing them to insert_sorted_if_absent.
4359 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
4360 .cvsignore files are maintained even though Bison developers run
4361 bootstrap while using Git.
4362 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
4363 unneeded by Bison.
4364 (gnulib): Add.
4365 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
4366 unneeded. Reported by Eric Blake.
4367 * lib/.gitignore (/*~): Add.
4368 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
4369 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
4370 Blake.
4371 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
4372
43732008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4374
4375 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
4376 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
4377 * bootstrap.conf (gnulib_modules): Add unsetenv.
4378 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
4379 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
4380 (/setenv.m4): Add.
4381 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
4382 the first argument because it may become position-dependent, and unset
4383 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
4384 Add comments explaining these issues in more detail.
4385
43862008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
4387
4388 Add .gitignore everywhere based on .cvsignore.
4389 * .gitignore: New.
4390 * build-aux/.gitignore: New.
4391 * data/.gitignore: New.
4392 * doc/.gitignore: New.
4393 * etc/.gitignore: New.
4394 * examples/.gitignore: New.
4395 * examples/calc++/.gitignore: New.
4396 * lib/.gitignore: New.
4397 * m4/.gitignore: New.
4398 * po/.gitignore: New.
4399 * runtime-po/.gitignore: New.
4400 * src/.gitignore: New.
4401 * tests/.gitignore: New.
4402
44032008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4404
4405 * NEWS (2.3b+): New section, empty for now.
4406 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
4407
44082008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4409
4410 * NEWS (2.3b): Update release date since there has been a delay in
4411 getting the announcements and tarballs out.
4412
44132008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
4414
4415 * NEWS: Version 2.3b.
4416 * configure.ac (AC_INIT): Likewise.
4417 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
4418
44192008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
4420
4421 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
4422 been doing it for years.
4423 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
4424 (Release Procedure): Add FIXME about make alpha being unmaintained.
4425
44262008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
4427
4428 * data/yacc.c: Reformat m4 a little for readability.
4429 * src/lalr.c (build_relations): Correct comment.
4430
44312008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4432
4433 DJGPP specific issue.
4434 * djgpp/config.sed: Fixes required to run configure scripts generated
4435 by autoconf 2.62.
4436
44372008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4438
4439 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
4440 coordinator@translationproject.org.
4441
44422008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4443
4444 * THANKS: Add Eric Blake.
4445
44462008-04-23 Eric Blake <ebb9@byu.net>
4447
4448 Revert prior patch, by working around autoconf regression.
4449 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
4450 ("Output file name: ("): Uncomment test.
4451 ("Output file name: )"): Likewise.
4452 Based on an idea from Noah Misch.
4453
44542008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4455
4456 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
4457 2.61. Reported by Juan Manuel Guerrero at
4458 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
4459 * tests/output.at ("Output file name: ("): Comment out test case for
4460 now.
4461 ("Output file name: )"): Likewise.
4462
44632008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4464
4465 * GNUmakefile: Update git-version-gen invocation so make dist
4466 succeeds.
4467
44682008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4469
4470 Update to the current gnulib CVS repository, and fix trigraph handling
4471 in Bison.
4472 * bootstrap: Update gnulib CVS repository URL.
4473 (symlink_to_dir): Encapsulate the code that guarantees the destination
4474 directory exists into...
4475 (check_dst_dir): ... this new function, and...
4476 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
4477 fail when copying files into lib/uniwidth/.
4478 * src/output.c (prepare_symbols): When writing yytname muscles, where
4479 symbol names will be encoded in C-string literals, tell quotearg to
4480 escape trigraphs. This used to be the default in gnulib.
4481 * tests/regression.at (Token definitions): Because of the change in
4482 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
4483 escapes trigraphs in symbol names. Thus, yytname no longer has
4484 trigraphs unnecessarily doubly escaped. Update test case output.
4485 Extend test case to be sure Bison's own error messages will no longer
4486 have trigraphs in symbol names unnecessarily escaped once.
4487
44882008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
4489
4490 Fix make dist infinite loop reported by Juan Manuel Guerrero at
4491 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
4492 * .cvsignore: Add .version.
4493 * .version.in: New.
4494 * bootstrap.conf (gnulib_modules): Add git-version-gen.
4495 * configure.ac (AC_CONFIG_FILES): Add .version.
4496 * build-aux/.cvsignore: Add git-version-gen.
4497
44982008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4499
4500 * NEWS (2.3a+): Mention that -g now takes an argument.
4501 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
4502 consistency. Update the -g and -x entries now that they take
4503 arguments. Use brackets to indicate optional arguments.
4504 * src/getargs.c (usage): Explain the relationship between arguments of
4505 long and short options more completely. Document --defines and -d
4506 separately since the former takes an argument but, for POSIX Yacc, the
4507 latter does not.
4508 (short_options): Let -W take an optional argument like --warnings.
4509 (getargs): Sort cases.
4510
45112008-02-28 Akim Demaille <demaille@gostai.com>
4512
4513 * doc/bison.texinfo: Fix a few typos.
4514
45152008-02-28 Akim Demaille <akim@epita.fr>
4516
4517 * doc/bison.texinfo (Bison Options): Document -W.
4518 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
4519
45202008-02-28 Akim Demaille <akim@epita.fr>
4521
4522 * src/getargs.c (short_options): Split and sort for readability.
4523 -g and -x take optional arguments, just like their long options.
4524 * build-aux/cross-options.pl: Use /x to make the regexp easier to
4525 understand.
4526 Fix the handling of $opt which resulted in all the argument to be
4527 considered as optional.
4528
45292008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
4530
4531 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
4532 say its interface is experimental.
4533 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4534 Java.
4535 (Bison Options): In the -L and --language entry, mention Java.
4536 (Java Bison Interface): Say the interface is experimental.
4537 * src/getargs.c (usage): Mention -L and --language.
4538
4539 * NEWS (2.3a+): Say the push parsing interface is experimental.
4540 * doc/bison.texinfo (Push Decl): Likewise.
4541 (Decl Summary): Likewise in the "%define api.push_pull" entry.
4542 (Push Parser Function): Likewise.
4543 (Pull Parser Function): Likewise.
4544 (Parser Create Function): Likewise.
4545 (Parser Delete Function): Likewise.
4546 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
4547 yypull_parse, and yypush_parse entries.
4548
4549 * NEWS (2.3a+): Mention XML support, and say the schema is
4550 experimental.
4551 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
4552 * src/getargs.c (usage): Say the XML schema is experimental.
4553
4554 * NEWS (2.3a+): Say option instead of flag.
4555
45562008-02-21 Wojciech Polak <polak@gnu.org>
4557
4558 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
4559 text.
4560
45612008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
4562
4563 Fix impure push parser compile error reported by Bob Rossi at
4564 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
4565 * data/yacc.c: Clean up whitespace in the output a little.
4566 (yypstate_allocated): Define for impure push parsers regardless of
4567 whether the pull interface is also requested.
4568 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
4569 check impure push parsers without the pull interface.
4570
4571 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
4572 yyerror takes arguments specified by %parse-param while yypstate_new
4573 does not.
4574 * doc/bison.texinfo (Parser Create Function): Document that
4575 yypstate_new returns 0 for multiple impure parser instances.
4576 * tests/push.at (Push Parsing: Multiple impure instances): Update
4577 expected stderr output.
4578
45792008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
4580
4581 * runtime-po/POTFILES.in (push.c): Remove.
4582
45832008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
4584
4585 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
4586 * data/push.c: Rename to...
4587 * data/yacc.c: ... this, overwriting it.
4588 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
4589 `%push-pull-parser' -> `%define api.push_pull "both"'.
4590 Remove old yacc.c tests, and update push.c tests to yacc.c.
4591
45922008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
4593
4594 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
4595 `"%code top" blocks' instead of `%code "top" blocks'.
4596 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
4597 Clean up whitespace in the output a little.
4598
45992008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
4600
4601 Fix documentation problems reported by Tim Josling at
4602 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
4603 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
4604 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
4605 integers. Explain the effect of literal string aliases on error
4606 messages. Copy token 0 documentation from the C++ skeleton
4607 documentation.
4608
46092008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
4610
4611 Accept a token number in a %left, %right, or %nonassoc for POSIX
4612 conformance. Reported by Tim Josling at
4613 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
4614 * NEWS (2.3a+): Mention.
4615 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
4616 and code numbers are treated by precedence declarations.
4617 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
4618 of symbols.1.
4619 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
4620 of symbol.
4621 (symbol.prec): New, just like symbol but allows INT.
4622 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
4623 longer holds.
4624 * tests/regression.at (Token number in precedence declaration): New
4625 test case.
4626
46272008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4628
4629 DJGPP specific issues.
4630 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
4631 be changed. Copyright timestamp adjusted.
4632 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
4633 be changed. Copyright timestamp adjusted.
4634 * djgpp/config.site: Copyright timestamp adjusted.
4635 * djgpp/config_h.sed: Copyright timestamp adjusted.
4636 * djgpp/djunpack.bat: Copyright timestamp adjusted.
4637 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
4638 filename translation list.
4639 * djgpp/subpipe.c (init_subpipe): Check the environment variables
4640 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
4641 files shall be created. Before trying to use the temp dir where the
4642 environment variable points to check that the dir really exists. If
4643 not default to the cwd as temp dir. Copyright timestamp adjusted.
4644 * djgpp/subpipe.h: Copyright timestamp adjusted.
4645 * djgpp/testsuite.sed: Copyright timestamp adjusted.
4646
46472008-01-30 Paul Eggert <eggert@cs.ucla.edu>
4648
4649 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
4650
46512008-01-09 Paul Eggert <eggert@cs.ucla.edu>
4652
4653 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
4654 Problem reported by Claudio Saavedra in
4655 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
4656
46572008-01-05 Wojciech Polak <polak@gnu.org>
4658
4659 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
4660 document's title with the input grammar file name.
4661
46622007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
4663
4664 Automate regression testing of the XML/XSLT implementation. Discussed
4665 starting at
4666 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
4667 * configure.ac (XSLTPROC): New substitution.
4668 * Makefile.am (maintainer-xml-check): New phony target invoking...
4669 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
4670 invoking make maintainer-check with BISON_TEST_XML=1.
4671 * tests/atlocal.in (XSLTPROC): New.
4672 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
4673 not to report reachable memory when Bison is expected to have a
4674 non-zero exit status and (2) to compare XML/XSLT output with --graph
4675 and --report=all output for every working grammar when
4676 BISON_TEST_XML=1.
4677 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
4678 (AT_BISON_CHECK_XML): New.
4679 (AT_QUELL_VALGRIND): New.
4680 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
4681 (AT_CHECK): ... don't redefine this since this was the old way to
4682 quell Valgrind.
4683 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
4684 AT_BISON_CHECK invocations.
4685 * tests/c++.at: Likewise.
4686 * tests/calc.at: Likewise.
4687 * tests/conflicts.at: Likewise.
4688 * tests/cxx-type.at: Likewise.
4689 * tests/existing.at: Likewise.
4690 * tests/glr-regression.at: Likewise.
4691 * tests/headers.at: Likewise.
4692 * tests/input.at: Likewise.
4693 * tests/java.at: Likewise.
4694 * tests/output.at: Likewise.
4695 * tests/push.at: Likewise.
4696 * tests/reduce.at: Likewise.
4697 * tests/regression.at: Likewise.
4698 * tests/sets.at: Likewise.
4699 * tests/skeletons.at: Likewise.
4700 * tests/synclines.at: Likewise.
4701 * tests/torture.at: Likewise.
4702 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
4703 tends to hang xsltproc.
4704 (Big horizontal): Likewise.
4705
47062007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
4707
4708 In XML output, remove redundant class attribute on symbol element.
4709 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
4710 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
4711 look up a symbol to determine whether it's a nonterminal or terminal.
4712 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
4713 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
4714
4715 Add prec/assoc information to XML output.
4716 * src/gram.c (grammar_rules_print_xml): For each rule that has a
4717 %prec, add a percent_prec attribute.
4718 * src/print-xml.c (print_grammar): For each terminal that has a
4719 precedence or associativity, add a prec or assoc attribute.
4720 (xml_indent): New.
4721 (xml_puts): Use xml_indent.
4722 (xml_printf): Use xml_indent.
4723 * src/print-xml.h (xml_indent): Prototype.
4724
4725 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
4726 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
4727
47282007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
4729
4730 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
4731 (bison:ruleByNumber): ... this for clarity.
4732 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
4733 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
4734 (xsl:template match="reduction"): Update.
4735 (xsl:template match="item"): Update.
4736 (xsl:template match="reduction"): Update.
4737
4738 In the XML output, don't print the list of rules where symbols appear.
4739 Compute it in XSLT instead. Discussed at
4740 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
4741 * data/xslt/bison.xsl (bison:ruleByLhs): New.
4742 (bison:ruleByRhs): New.
4743 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
4744 bison:ruleByRhs.
4745 (xsl:template match="terminal/rule"): Remove.
4746 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
4747 bison:ruleByRhs.
4748 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
4749 Remove.
4750 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
4751 bison:ruleByRhs and mode="number-link" for rule template.
4752 (xsl:template match="terminal/rule"): Remove.
4753 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
4754 bison:ruleByRhs and mode="number-link" for rule template.
4755 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
4756 Rewrite as...
4757 (xsl:template match="rule" mode="number-link"): ... this.
4758 * src/print-xml.c (print_grammar): Don't print the list of rules.
4759
47602007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4761
4762 Don't let --report affect XML output; always print all information.
4763 Discussed at
4764 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
4765 * src/conflicts.c (log_resolution): Implement.
4766 * src/print-xml.c (print_core): Implement.
4767 (print_state): Implement.
4768 (print_xml): Implement.
4769
4770 * NEWS (2.3a+): Fix quotes.
4771 * src/parse-gram.y (prologue_declaration): For consistency with -v,
4772 don't let %verbose clear the list specified by --report.
4773
47742007-11-26 Akim Demaille <akim@epita.fr>
4775
4776 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
4777
47782007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
4779
4780 In the XML output, list useless and unused symbols and rules with the
4781 useful ones and add a "usefulness" attribute. Discussed starting at
4782 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
4783 * src/gram.c (grammar_rules_partial_print_xml): Remove.
4784 (grammar_rules_print_xml): Print all rules instead of just those
4785 useful in the grammar, and add a "usefulness" attribute.
4786 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
4787 * src/print-xml.c (print_rules_useless_in_parser): Remove.
4788 (print_grammar): Print all nonterminals instead of just useful ones,
4789 and add a "usefulness" attribute to nonterminals and terminals.
4790 (print_xml): Don't print a separate "reductions" or
4791 "rules-useless-in-parser" element.
4792 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
4793 (reduce_xml): Remove.
4794 (reduce_token_unused_in_grammar): New.
4795 (reduce_nonterminal_useless_in_grammar): New.
4796 * src/reduce.h (reduce_xml): Remove prototype.
4797 (reduce_token_unused_in_grammar): Add prototype.
4798 (reduce_nonterminal_useless_in_grammar): Add prototype.
4799 * data/xslt/xml2text.xsl: Update for XML changes.
4800 * data/xslt/xml2xhtml.xsl: Update for XML changes.
4801 * tests/reduce.at (Useless Terminals): Update output.
4802 (Useless Rules): Update output.
4803 (Reduced Automaton): Update output.
4804
4805 Say "Terminals unused in grammar" instead of "Unused terminals".
4806 * NEWS (2.3a+): Update.
4807 * doc/bison.texinfo (Understanding): Update example output.
4808 * src/reduce.c (reduce_output): Implement.
4809 * data/xslt/xml2text.xsl: Implement.
4810 * data/xslt/xml2xhtml.xsl: Implement.
4811
48122007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
4813
4814 Accept --report-file=FILE to override the default `.output' filename.
4815 * NEWS (2.3a+): Mention.
4816 * doc/bison.texinfo (Bison Options): Add an entry.
4817 * src/files.c (compute_output_file_names): Don't override
4818 spec_verbose_file if already set.
4819 * src/getargs.c (usage): Document --report-file.
4820 (REPORT_FILE_OPTION): New anonymous enum member.
4821 (long_options): Add entry for it.
4822 (getargs): Add case for it setting spec_verbose_file.
4823
4824 * build-aux/cross-options.pl: Don't record a short option just because
4825 there's an arg.
4826 * doc/.cvsignore: Add yacc.1.
4827
48282007-11-14 Akim Demaille <akim@epita.fr>
4829
4830 * doc/yacc.1.in: New.
4831 * configure.ac, doc/Makefile.am: Adjust.
4832 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
4833 config.h symbol.
4834 Use AC_SUBST for assignments too.
4835 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
4836
48372007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4838
4839 * src/gram.c: Remove comments that duplicate comments in gram.h.
4840
4841 When reporting useless rules and nonterminals, say "useless in grammar"
4842 instead of "useless", and say "useless in parser" instead of "never
4843 reduced". Discussed starting at
4844 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
4845 * NEWS (2.3a+): Mention this change.
4846 * data/xslt/xml2text.xsl: Update output text and expected input XML
4847 element names to match changes below.
4848 * data/xslt/xml2xhtml.xsl: Likewise.
4849 (xsl:template match="bison-xml-report"): Add missing entry in Table of
4850 Contents: "Rules useless in parser due to conflicts".
4851 * doc/bison.texinfo (Decl Summary): Reword a little.
4852 (Understanding): Update example output for changes below.
4853 * src/gram.c: (rule_useful_p): Rename to...
4854 (rule_useful_in_grammar_p): ... this.
4855 (rule_useless_p): Rename to...
4856 (rule_useless_in_grammar_p): ... this.
4857 (rule_never_reduced_p): Rename to...
4858 (rule_useless_in_parser_p): ... this.
4859 (grammar_rules_print): Update for renames.
4860 (grammar_rules_print_xml): Update for renames.
4861 (grammar_rules_never_reduced_report): Rename to...
4862 (grammar_rules_useless_report): ... this since it is used for either
4863 kind of useless rule.
4864 * src/gram.h: Reword comments and update function names in prototypes.
4865 * src/main.c (main): Say "rule useless in parser due to conflicts".
4866 * src/print-xml.c (print_rules_never_reduced): Rename to...
4867 (print_rules_useless_in_parser): ... this, and rename output XML
4868 element "rules-never-reduced" to "rules-useless-in-parser".
4869 (print_xml): Update for rename.
4870 * src/print.c (print_results): Say "Rules useless in parser due to
4871 conflicts".
4872 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
4873 (nonterminals_reduce): Say "nonterminal useless in grammar".
4874 (reduce_output): Say "Nonterminals useless in grammar".
4875 Say "Rules useless in grammar".
4876 (reduce_xml): Rename output XML element "useless" to
4877 "useless-in-grammar".
4878 (reduce_print): Don't report the count of grammatically useless rules
4879 as "rules never reduced" just because %yacc is specified.
4880 In the correct report of this count, say nonterminal(s) and rule(s)
4881 "useless in grammar".
4882 * tests/conflicts.at (S/R in initial): Update expected output.
4883 (Defaulted Conflicted Reduction): Likewise.
4884 (Unreachable States After Conflict Resolution): Likewise.
4885 * tests/existing.at (GNU pic Grammar): Likewise.
4886 * tests/reduce.at (Useless Nonterminals): Likewise.
4887 (Useless Rules): Likewise.
4888 (Reduced Automaton): Likewise.
4889 (Underivable Rules): Likewise.
4890 (Empty Language): Likewise.
4891
48922007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4893
4894 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
4895 here document and before the EOF so that BSD's implementation of Bourne
4896 shell doesn't parse the delimiter as part of the here document.
4897 * doc/.cvsignore: Add cross-options.texi.
4898 * src/getargs.c (usage): Add a blank line after the warning categories.
4899
49002007-11-08 Paolo Bonzini <bonzini@gnu.org>
4901
4902 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
4903
49042007-11-05 Akim Demaille <akim@epita.fr>
4905
4906 Remove Id: from bison.1.
4907 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
4908 (perl -0777 -pi -e 's/\.PP\nId): New.
4909 (.x.1): Use it to ignore the version control revision.
4910
49112007-11-05 Akim Demaille <demaille@gostai.com>
4912
4913 * build-aux/Makefile.am: Ship cross-options.pl.
4914 * doc/Makefile.am: Always refer to cross-options.texi with
4915 $(srcdir).
4916 (MAINTAINERCLEANFILES): Add it.
4917
49182007-11-04 Akim Demaille <demaille@gostai.com>
4919
4920 Generate the long/short option cross-table.
4921 * build-aux/cross-options.pl: New.
4922 * doc/Makefile.am (cross-options.texi): New.
4923 * doc/bison.texinfo: Use it.
4924
49252007-11-04 Akim Demaille <demaille@gostai.com>
4926
4927 Generate bison.1 using help2man.
4928 * doc/common.x, doc/bison.x: New.
4929 * doc/Makefile.am (bison.1, .x.1): New.
4930 The code is taken from autoconf-2.61/man/Makefile.am.
4931 * configure.ac: Look for help2man.
4932
49332007-11-04 Akim Demaille <demaille@gostai.com>
4934
4935 Complete --help.
4936 * src/getargs.c (usage): Document -W, make it clear that -d,
4937 -g and -x have optional arguments.
4938
49392007-11-04 Akim Demaille <demaille@gostai.com>
4940
4941 Find sha1sum when named gsha1sum.
4942 * bootstrap (find_tool): New.
4943 ($SHA1SUM): New.
4944
49452007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4946
4947 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
4948 at
4949 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
4950 * NEWS (2.3a+): Mention.
4951 * data/bison.m4 (b4_pure_if): Don't define it here.
4952 * data/c.m4 (b4_identification): Depend on individual skeletons to
4953 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
4954 values of the %define variables api.pure or api.push_pull. Define
4955 YYPURE, YYPUSH, and YYPULL accordingly.
4956 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
4957 glr.cc has already defined b4_pure_flag.
4958 * data/push.c: Define b4_pure_if based on `%define api.pure'.
4959 Remove YYPUSH and YYPULL since they're back in b4_identification again.
4960 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
4961 * doc/bison.texinfo (Pure Decl): Update.
4962 (Push Decl): Update.
4963 (Decl Summary): Add api.pure to %define entry.
4964 In %pure-parser entry, say it's deprecated and reference %define.
4965 (Pure Calling): Update.
4966 (Error Reporting): Update.
4967 (C++ Scanner Interface): Update.
4968 (How Can I Reset the Parser): Update.
4969 (Table of Symbols): In %pure-parser entry, say it's deprecated and
4970 reference %define.
4971 * src/getargs.c (pure_parser): Remove global variable.
4972 * src/getargs.h (pure_parser): Remove extern.
4973 * src/output.c (prepare): Don't define pure_flag muscle.
4974 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
4975 wrapper around `%define api.pure'.
4976 * tests/calc.at (Simple LALR Calculator): Update.
4977 (Simple GLR Calculator): Update.
4978 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
4979 Update.
4980 (GLR: Resolve ambiguity, pure, locations): Update.
4981 (GLR: Merge conflicting parses, pure, no locations): Update.
4982 (GLR: Merge conflicting parses, pure, locations): Update.
4983 * tests/glr-regression.at (Uninitialized location when reporting
4984 ambiguity): Update
4985 * tests/input.at (Unused %define api.pure): New test case.
4986 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
4987 AT_PURE_IF and AT_PURE_AND_LOC_IF.
4988 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
4989
49902007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4991
4992 %define push_pull -> %define api.push_pull. Discussed starting at
4993 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
4994 * data/push.c: Expect the new name.
4995 * data/yacc.c: Likewise.
4996 * doc/bison.texinfo (Push Decl): Update.
4997 (Decl Summary): Update %define entry.
4998 (Push Parser Function): Update.
4999 (Pull Parser Function): Update.
5000 (Parser Create Function): Update.
5001 (Parser Delete Function): Update.
5002 * tests/calc.at (Simple LALR Calculator): Update.
5003 * tests/input.at (%define enum variables): Update.
5004 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5005 (Push Parsing: Multiple impure instances): Update.
5006 (Push Parsing: Unsupported Skeletons): Update.
5007 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
5008 (Exploding the Stack Size with Malloc): Update.
5009
5010 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
5011 other entries some.
5012
50132007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
5014
5015 For the XML output's terminal element, rename @number to @token-number,
5016 and add @symbol-number. In the nonterminal element, rename @number to
5017 @symbol-number. Discussed starting at
5018 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
5019 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
5020 renames.
5021 (xsl:template match="nonterminal"): Likewise.
5022 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
5023 (xsl:template match="nonterminal"): Likewise.
5024 * src/print-xml.c (print_grammar): Implement.
5025
50262007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5027
5028 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
5029 2007-10-11 change, the child elements here are items not rules.
5030 (xsl:template match="item"): New.
5031 (xsl:template match="rule"): Update for new reduced itemset.
5032 (xsl:template match="point"): Remove.
5033 (xsl:template match="empty"): For consistency with --graph, don't
5034 output "/* empty */".
5035 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
5036 line-wrap, don't pass a negative value as first-line-length since this
5037 won't work with the following changes.
5038 (xsl:template name="line-wrap"): Simplify slightly.
5039 (xsl:template name="ws-search"): Eliminate recursion.
5040 * src/print_graph.c (print_core): Don't print a reduction's lookahead
5041 set next to an item whose dot is not at the end of the RHS even if it
5042 happens to be associated with the same rule.
5043
50442007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5045
5046 Add %define lr.keep_unreachable_states.
5047 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
5048 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
5049 * src/main.c (main): Implement it.
5050 * tests/conflicts.at (Unreachable States After Conflict Resolution):
5051 Extend to test it, and fix a typo.
5052
50532007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5054
5055 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
5056 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
5057 the example .output text.
5058 * tests/regression.at (Extra lookahead sets in report): Improve wording
5059 of comments.
5060
50612007-10-17 Wojciech Polak <polak@gnu.org>
5062
5063 * src/print-xml.c (print_grammar): Renamed
5064 <terminal> and <nonterminal> attributes:
5065 "type" to "number" and "symbol" to "name".
5066 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
5067 Use new attribute names.
5068 (xsl:template match="nonterminal"): Likewise.
5069 * data/xslt/xml2xhtml.xsl: Likewise.
5070
50712007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
5072
5073 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
5074 (Option Cross Key): Likewise.
5075
5076 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
5077 next to an item whose dot is not at the end of the RHS even if it
5078 happens to be associated with the same rule.
5079 * src/print.c (print_core): Likewise.
5080 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
5081 (Resolved SR Conflicts): Update output.
5082 * tests/regression.at (Extra lookahead sets in report): New test case.
5083
50842007-10-11 Wojciech Polak <polak@gnu.org>
5085
5086 * src/print-xml.c (print_core): Remove item set
5087 redundancy.
5088 * data/xslt/bison.xsl (bison:ruleNumber): New key.
5089 Improve processing time. Suggested by Joel E. Denny.
5090 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
5091 Write xsl:param "required" attribute as comment.
5092 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
5093 (xsl:template match="rule"): Support new reduced itemset.
5094 (xsl:template match="point"): Remove.
5095 * data/xslt/xml2xhtml.xsl: Likewise.
5096
50972007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5098
5099 * src/getargs.c (version): Update copyright year.
5100
51012007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5102
5103 Make xml2dot.xsl and --graph produce the same output.
5104 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
5105 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
5106 escaped later.
5107 (xsl:template name="output-node"): Use the new escape template instead
5108 of the string-replace template directly.
5109 (xsl:template name="output-edge"): Likewise.
5110 (xsl:template name="escape"): New, escapes backslashes and newlines in
5111 addition to quotation marks.
5112 * src/graphviz.c (start_graph, output_node, output_edge): Add
5113 whitespace to output for legibility.
5114
5115 Make xml2text.xsl and --report produce the same output, and remove the
5116 XML "conflicts" element since a conflict summary is easily extracted
5117 from the automaton.
5118 * data/xslt/bison.xsl: New.
5119 (xsl:template match="state" mode="bison:count-conflicts): New.
5120 * data/xslt/xml2text.xsl: Import bison.xsl.
5121 (xsl:template match="bison-xml-report"): Instead of styling the
5122 "conflicts" element, style the "automaton" element with mode
5123 "conflicts". Unlike the former, the latter lists S/R and R/R
5124 conflicts for a state on the same line.
5125 (xsl:template match="conflicts"): Remove.
5126 (xsl:template match="conflict"): Remove.
5127 (xsl:template match="terminal"): Line-wrap the list of rules in which
5128 the terminal is used.
5129 (xsl:template match="nonterminal"): Likewise for nonterminals.
5130 (xsl:template match="automaton" mode="conflicts"): New.
5131 (xsl:template match="state" mode="conflicts"): New.
5132 (xsl:template name="line-wrap"): New.
5133 (xsl:template name="ws-search"): New.
5134 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
5135 (xsl:template match="bison-xml-report"): Instead of styling the
5136 "conflicts" element, style the "automaton" element with mode
5137 "conflicts."
5138 (xsl:template match="conflicts"): Remove.
5139 (xsl:template match="conflict"): Remove.
5140 (xsl:template match="automaton" mode="conflicts"): New.
5141 (xsl:template match="state" mode="conflicts): New.
5142 * src/conflicts.c (conflicts_output_xml): Remove.
5143 * src/conflicts.h (conflicts_output_xml): Remove prototype.
5144 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
5145 * src/print.c (print_grammar): Consistently wrap at the 66th column so
5146 the corresponding XSLT is easier. Also, never wrap between a word and
5147 the comma that follows it.
5148
51492007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5150
5151 Improve C++ namespace support. Discussed starting at
5152 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
5153 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
5154 b4_namespace_close): New macros that interpret the %define variable
5155 "namespace" so its value can contain "::" to indicate nested
5156 namespaces.
5157 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
5158 the above macros.
5159 * data/lalr1.cc (b4_namespace): Likewise.
5160 * data/location.cc (b4_namespace): Likewise.
5161 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
5162 inside a new table in the general %define entry. Document `%define
5163 namespace' there as well. Point the %name-prefix entry to it since it
5164 explains it more completely in the case of C++.
5165 (C++ Bison Interface): Mention `%define namespace' instead of
5166 %name-prefix.
5167 (Table of Symbols): Remove the `%define push_pull' entry. The %define
5168 entry suffices.
5169 * tests/c++.at (Relative namespace references): New test case.
5170 (Absolute namespace references): New test case.
5171 (Syntactically invalid namespace references): New test case.
5172 * tests/input.at (C++ namespace reference errors): New test case.
5173
51742007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5175
5176 Add syncline support and location accessor to internal %define
5177 interfaces.
5178 * data/bison.m4 (b4_percent_define_get_loc): New.
5179 (b4_percent_define_get_syncline): New.
5180 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
5181 (b4_percent_define_default): Record defining location as line 1 rather
5182 than 0 for the sake of synchronizing #line's, and define
5183 b4_percent_define_syncline(VARIABLE).
5184 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
5185 * src/muscle_tab.c (muscle_syncline_grow): New.
5186 (muscle_code_grow): Use muscle_syncline_grow.
5187 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
5188 define b4_percent_define_syncline(VARIABLE).
5189 (muscle_percent_define_get_loc): New.
5190 (muscle_percent_define_get_syncline): New.
5191 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
5192 remove some unused variables.
5193 (muscle_percent_define_default): Record defining location as line 1
5194 rather than 0 for the sake of synchronizing #line's, and define
5195 b4_percent_define_syncline(VARIABLE).
5196 (muscle_percent_define_check_values): Use
5197 muscle_percent_define_get_loc.
5198 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
5199 (muscle_percent_define_get_syncline): Prototype.
5200 * tests/skeletons.at (%define Boolean variables: invalid skeleton
5201 defaults): Update output for location change.
5202 (Complaining during macro argument expansion): Extend to test
5203 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
5204
52052007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
5206
5207 Fix some error-reporting macro bugs.
5208 * data/bison.m4 (b4_cat): New.
5209 (b4_error, b4_error_at): Use b4_cat to send error directives directly
5210 to stdout so they don't become arguments to other macros. Update
5211 comments and add examples.
5212 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
5213 add examples.
5214 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
5215 after printing the error directive so that M4 doesn't report subsequent
5216 problems that are induced by this problem.
5217 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
5218 instead of just in them. Recognize @\n in both places. Both expand to
5219 the empty string. Needed by b4_cat.
5220 * tests/skeletons.at (Complaining during macro argument expansion):
5221 New test case.
5222 (Fatal errors make M4 exit immediately): New test case.
5223
52242007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
5225
5226 Implement --print-datadir.
5227 * src/getargs.c (usage): Mention.
5228 (PRINT_DATADIR_OPTION): New anonymous enum member.
5229 (long_options): Add entry for it.
5230 (getargs): Add case for it calling compute_pkgdatadir.
5231 * src/output.c (output_skeleton): Encapsulate data directory
5232 computation from here...
5233 (prepare): ... and from here...
5234 (compute_pkgdatadir): ... into this new function.
5235 * src/output.h (compute_pkgdatadir): Prototype.
5236
52372007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
5238
5239 * src/print-xml.c (escape_bufs): New static global variable
5240 replacing...
5241 (xml_escape_n): ... the static local variable buf here.
5242 (print_xml): Free memory for escape_bufs.
5243 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
5244
52452007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
5246
5247 Replace `%push-parser' and `%push-pull-parser' with
5248 `%define push_pull "push"' and `%define push_pull "both"'.
5249 `%define push_pull "pull"' is the default.
5250 * doc/bison.texinfo (Push Decl, Push Parser Function,
5251 Pull Parser Function, Parser Create Function, Parser Delete Function):
5252 Update declarations.
5253 (Decl Summary, Table of Symbols): Replace %push-parser and
5254 %push-pull-parser entries with a %define push_pull entry.
5255 * data/bison.m4 (b4_percent_define_check_values): New macro.
5256 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
5257 definitions...
5258 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
5259 definitions...
5260 * data/push.c: ... to here and compute them from the value of the
5261 %define variable push_pull.
5262 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
5263 parsing requests here...
5264 * data/yacc.c: ... hack this to switch to push.c any time
5265 b4_use_push_pull_flag or the %define variable push_pull is set. This
5266 will go away when we mv push.c yacc.c.
5267 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
5268 push parsing is not supported since unused %define variables are
5269 reported anyway.
5270 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
5271 * src/muscle_tab.h (muscle_percent_define_check_values): Update
5272 comments for consistency with b4_percent_define_check_values.
5273 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
5274 muscles.
5275 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
5276 Remove.
5277 (prologue_declaration): Remove %push-parser and %push-pull-parser
5278 rules.
5279 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
5280 * tests/calc.at: Update declarations.
5281 * tests/input.at (%define enum variables): New test case.
5282 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
5283 declaration.
5284 (Push Parsing: Multiple impure instances): Update declaration.
5285 (Push Parsing: Unsupported Skeletons): New test case.
5286 * tests/torture.at (Exploding the Stack Size with Alloca): Update
5287 declaration.
5288 (Exploding the Stack Size with Malloc): Update declaration.
5289
52902007-09-24 Wojciech Polak <polak@gnu.org>
5291
5292 Add XSLT transformations.
5293
5294 * data/xslt/xml2dot.xsl: Transform XML into DOT.
5295 * data/xslt/xml2text.xsl: Transform XML into plain text.
5296 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
5297 * data/Makefile.am (xsltdir): New variable.
5298 (dist_xslt_DATA): Add xslt/*.xsl files.
5299
53002007-09-23 Paul Eggert <eggert@cs.ucla.edu>
5301
5302 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
5303 Problem reported by Wojciech Polak.
5304 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
5305 (xml_printf): Undo change I made on 21 September; that is,
5306 indent 2 spaces, not 1.
5307
53082007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
5309
5310 Pacify ./configure --enable-gcc-warnings.
5311 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
5312 `char const *' instead of `char *'.
5313 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
5314 local variable `sep'.
5315
53162007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5317
5318 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
5319 elsewhere.
5320 * src/print-xml.c: Prefer "const" after types; that's more consistent.
5321 (xml_printf): Indent just 1 space for level.
5322 (e_char, xlate_char): Remove.
5323 (xml_escape_string): Rewrite to avoid undefined behavior (used
5324 storage that was freed from the stack).
5325 (xml_escape_n): Don't bother checking for subscript error.
5326
53272007-09-21 Wojciech Polak <polak@gnu.org>
5328
5329 Add Bison XML Automaton Report.
5330
5331 Add support for an -x option to generate an XML report.
5332 It is not documented yet.
5333 * src/print-xml.c: New file.
5334 * src/print-xml.h: Likewise.
5335 * lib/timevar.def (TV_XML): New var.
5336 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
5337 * src/conflicts.c: Include print-xml.h.
5338 (solved_conflicts_xml_obstack): New var.
5339 (log_resolution, conflicts_solve, conflicts_free):
5340 Add support for XML report.
5341 (conflicts_output_val): New function.
5342 * src/conflicts.h (conflicts_output_val): New decl.
5343 * src/files.c (spec_xml_file): New var.
5344 (compute_output_file_names, output_file_names_free): Add XML support.
5345 * src/files.h (spec_xml_file): New decl.
5346 * src/getargs.c (xml_flag): New var.
5347 (usage, short_options, long_options, getargs): Add XML support.
5348 * src/getargs.h (xml_flag): New decl.
5349 * src/gram.c: Include print-xml.h.
5350 (rule_lhs_print_xml, rule_rhs_print_xml):
5351 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
5352 New functions.
5353 * src/gram.h: Declare external ones.
5354 * src/main.c: Include print-xml.h.
5355 (main): Add XML support.
5356 * src/reduce.c: Include print-xml.h.
5357 (reduce_xml): New function.
5358 * src/reduce.h: Declare it.
5359 * src/state.c: Include print-xml.h.
5360 (state_new): Add XML support.
5361 (state_rule_lookahead_tokens_print_xml): New function.
5362 * src/state.h: Declare it.
5363 (struct state): New member solved_conflicts_xml.
5364 * src/symtab.c (symbol_class_get_string): New function.
5365 * src/symtab.h: Declare it.
5366
53672007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5368
5369 * GNUmakefile: Switch to coreutils's version.
5370 * bootstrap: Likewise.
5371 * Makefile.cfg: Adjust to new GNUmakefile.
5372 * README-hacking: Likewise.
5373
5374 Import from gnulib:
5375
5376 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
5377 Bruno Haible <bruno@clisp.org>
5378
5379 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
5380 and is a script that invokes bison. Tighten the code. Add comments.
5381
53822007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
5383
5384 Spell "boolean" as "Boolean". Reported by Akim Demaille.
5385 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
5386 * doc/bison.texinfo (Decl Summary): Fix.
5387 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
5388 * tests/input.at (Boolean %define variables): Update output.
5389 * tests/skeletons.at (%define boolean variables: invalid skeleton
5390 defaults): Rename to...
5391 (%define Boolean variables: invalid skeleton defaults): ... this and
5392 update output.
5393
53942007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
5395
5396 In impure push mode, don't allow more than one yypstate to be allocated
5397 since multiple impure parsers would corrupt yynerrs.
5398 * data/push.c (yypstate_allocated): New static global variable
5399 initialized to 0.
5400 (yypull_parse): If yypstate_new returns 0, don't report it as memory
5401 exhaustion if yypstate_allocated is 1, but still return 2.
5402 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
5403 already 1. Otherwise, set it to 1.
5404 (yypstate_delete): Set it to 0.
5405 * tests/push.at (Push Parsing: Multiple impure instances): New test
5406 case.
5407
54082007-08-17 Bob Rossi <bob@brasko.net>
5409
5410 * doc/bison.texinfo (Push Decl): Document the push parser.
5411 (Table of Symbols): Ditto.
5412 (Pure Decl): Ditto.
5413 (Decl Summary): Ditto.
5414 (Multiple Parsers, Push Parser Function, Pull Parser Function,
5415 Parser Create Function, Parser Delete Function):
5416 Add new push parser symbols.
5417 (Table of Symbols): Document push-parser, push-pull-parser,
5418 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
5419
54202007-08-15 Paul Eggert <eggert@cs.ucla.edu>
5421
5422 Update to GPLv3.
5423 * doc/gpl-3.0.texi: New file.
5424 * doc/gpl.texi: Remove.
5425 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
5426 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
5427 * README-hacking, TODO, bootstrap, bootstrap.conf:
5428 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
5429 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
5430 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
5431 * data/lalr1.cc, data/lalr1.java, data/location.cc:
5432 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
5433 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
5434 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
5435 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
5436 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
5437 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
5438 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
5439 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
5440 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
5441 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
5442 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
5443 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
5444 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
5445 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
5446 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
5447 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
5448 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
5449 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
5450 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
5451 * src/complain.c, src/complain.h, src/conflicts.c:
5452 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
5453 * src/files.h, src/flex-scanner.h, src/getargs.c:
5454 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
5455 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
5456 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
5457 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
5458 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
5459 * src/print.c, src/print.h, src/print_graph.c:
5460 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
5461 * src/reduce.h, src/relation.c, src/relation.h:
5462 * src/revision.h, src/scan-code.h, src/scan-code.l:
5463 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
5464 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
5465 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
5466 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
5467 * tests/Makefile.am, tests/actions.at, tests/c++.at:
5468 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
5469 * tests/existing.at, tests/glr-regression.at:
5470 * tests/headers.at, tests/input.at, tests/java.at:
5471 * tests/local.at, tests/output.at, tests/push.at:
5472 * tests/reduce.at, tests/regression.at, tests/sets.at:
5473 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
5474 * tests/torture.at:
5475 Update to GPLv3.
5476
54772007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
5478
5479 Get rid of broken %no-parser, -n, and --no-parser implementation and
5480 documentation.
5481 * TODO: Don't mention them.
5482 * doc/bison.1: Likewise.
5483 * doc/bison.texinfo (Decl Summary): Likewise.
5484 (Bison Options): Likewise.
5485 (Option Cross Key): Likewise.
5486 * src/getargs.c (no_parser_flag): Remove global variable.
5487 (usage): Don't print description of -n and --no-parser.
5488 (long_options): Remove --no-parser entry here.
5489 (getargs): Remove -n case in the switch here.
5490 * src/getargs.h (no_parser_flag): Remove extern.
5491 * tests/regression.at (Web2c Actions): Remove comment that mentions
5492 --no-parser.
5493
54942007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
5495
5496 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
5497 name user variables starting with `yy'. Just pass NULL instead of a
5498 dummy local &yylval to yypush_parse.
5499 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
5500 starting with `yy'.
5501
55022007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
5503
5504 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
5505 true since it's then always used regardless of whether yyoverflow is
5506 defined. Reported by Christian Burger at
5507 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
5508 * THANKS: Add Christian Burger.
5509
5510 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
5511 node names: say "Decl Summary" not "Bison Declaration Summary".
5512
55132007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
5514
5515 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
5516 determine whether this function has already complained about an invalid
5517 value for a %define boolean variable, don't check whether Bison has
5518 ever examined the value. As written, the check was a tautology.
5519 Instead, record and check for this complaint using a separate muscle.
5520
55212007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
5522
5523 Fix push parsing memory leak reported by Brandon Lucia at
5524 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
5525 * THANKS: Add Brandon Lucia.
5526 * data/push.c (yypstate_delete): Free the stack if it was reallocated
5527 but the parse never completed and thus freed it.
5528 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
5529 * tests/testsuite.at: Include push.at.
5530 * test/push.at: New.
5531 (Push Parsing: Memory Leak for Early Deletion): New test case.
5532
55332007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
5534
5535 Improve handling of multiple S/R conflicts in the same state and of S/R
5536 conflicts involving multiple reductions.
5537 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
5538 set for a state here or Bison will abort if it is reassigned on a
5539 later conflicted reduction in the same state.
5540 Similarly, don't finalize and assign the solved conflicts report here
5541 or it will be lost if it is reassigned on a later conflicted reduction
5542 in the same state.
5543 (set_conflicts): Instead, assign them both here after all S/R conflicts
5544 in the state have been fully examined.
5545 * src/print.c (shift_set): Rename to...
5546 (no_reduce_set): ... this.
5547 (print_reductions): Update for rename, and add %nonassoc error action
5548 tokens to no_reduce_set so that, when printing the first remaining
5549 reduction on an error action token, the reduction is enclosed in
5550 brackets.
5551 (print_results): Update for rename.
5552 * tests/conflicts.at (Solved conflicts report for multiple reductions
5553 in a state): New test case.
5554 (%nonassoc error actions for multiple reductions in a state): New test
5555 case.
5556
5557 * src/main.c (main): Don't depend on C99 features.
5558
55592007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
5560
5561 * build-aux/.cvsignore: Add compile.
5562 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
5563 uniwidth.
5564
55652007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
5566
5567 * bootstrap (slurp): Create target directories that don't exist.
5568 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
5569
55702007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5571
5572 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
5573 than item number.
5574 * closure.c (closure): Likewise.
5575 * state.h (reductions): Comment sorting of rules.
5576 (state): Comment sorting of items.
5577
55782007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
5579
5580 Fix C++ test cases after recent Gnulib changes. Discussed starting at
5581 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
5582 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
5583 definition in order to avoid Gnulib headers since we don't use config.h
5584 here.
5585 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
5586 rather than AT_DATA so that config.h is included.
5587
55882007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
5589
5590 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
5591 instead of fprintf. Guard these functions with #if YYDEBUG instead of
5592 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
5593 and so that YYFPRINTF is guaranteed to be defined here.
5594
55952007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
5596
5597 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
5598 with...
5599 (muscle_percent_define_check_values): ... this more helpful function.
5600 Again, it's not used yet, but it will be.
5601 * src/muscle_tab.h: Likewise.
5602
5603 Improve some comments in parser table construction.
5604 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
5605 (generate_states): Don't mention ruleset, which is internal to closure.
5606 * src/closure.c (closure): Explain sorting of core and itemset, which
5607 is required for this function to behave correctly.
5608 * src/closure.h (closure): Mention sorting.
5609
56102007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
5611
5612 * src/lalr.c (state_lookahead_tokens_count): For code readability,
5613 move the check for disabled transitions to an aver since conflict
5614 resolution hasn't happened yet.
5615
5616 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
5617 labels a state as inconsistent just because it has error transitions.
5618 The original form of this check appeared in revision 1.1 of lalr.c,
5619 which was committed on 1991-12-21. Now (at least), changing the
5620 consistency label on such a state appears to have no useful effect in
5621 any of the places it is examined, which I enumerate below. The key
5622 point to understanding each item in this enumeration is that a state
5623 with an error transition is labelled consistent in the first place only
5624 if it has no rules, so the check cannot matter for states that have
5625 rules. (1) Labelling a state as inconsistent will cause set_conflicts
5626 to try to identify its conflicts, and a state must have *rules* to have
5627 conflicts. (2) Labelling a state as inconsistent will affect how
5628 action_row sets the default *rule* for the state. (3) Labelling a
5629 state as inconsistent will cause build_relations to add lookback edges
5630 to *rules* in that state.
5631 * src/state.h (struct state): Word the comment for member consistent
5632 more carefully.
5633
56342007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5635
5636 Don't depend on C99 features.
5637 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
5638 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
5639 * src/reader.c (check_and_convert_grammar): Fix for-loop.
5640 * src/state.c (state_mark_reachable_states): Fix for-loop.
5641 (state_remove_unreachable_states): Fix for-loop.
5642
5643 Don't widen struct state with member reachable just to temporarily
5644 record reachability. Instead, use a local bitset.
5645 * src/state.h (struct state): Remove member.
5646 * src/state.c (state_new): Don't initialize it.
5647 (state_mark_reachable_states): Rename to...
5648 (state_record_reachable_states): ... this, and use bitset.
5649 (state_remove_unreachable_states): Use bitset.
5650
56512007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
5652
5653 * src/Makefile.am (yacc): Quote target action commands properly so
5654 that the yacc script isn't corrupt. Reported by Hans Aberg at
5655 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
5656
5657 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
5658 the case of pure parsers. Reported by Frans Englich at
5659 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
5660 * THANKS: Add Frans Englich.
5661
5662 * NEWS (2.3a+): In the %code entry, reference section `Bison
5663 Declaration Summary' from the manual now since the %code summary has
5664 moved there.
5665 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
5666 in the rules section must be terminated by semicolons.
5667
56682007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
5669
5670 Extend the front-end API for %define variables to more completely
5671 mirror the back-end. This will be useful in the future.
5672 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
5673 Update comments to mention the new front-end counterparts of these
5674 macros.
5675 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
5676 for muscle_string_decode and muscle_location_decode.
5677 (muscle_string_decode): New static function.
5678 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
5679 (muscle_percent_define_get, muscle_percent_define_ifdef): New
5680 functions.
5681 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
5682 muscle_percent_define_get to mimic the b4_percent_define_flag_if
5683 implementation more closely.
5684 (muscle_percent_define_invalid_value): New function.
5685 * src/muscle_tab.h (muscle_percent_define_get,
5686 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
5687 Prototype.
5688
56892007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
5690
5691 * NEWS (2.3a+): Mention yesterday's state-removal change.
5692 (2.3a): Remove the %language entry, which was added after 2.3a.
5693 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
5694 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
5695 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
5696 tests/existing.at: Update copyright date.
5697
56982007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5699
5700 If conflict resolution makes states unreachable, remove those states,
5701 report rules that are then unused, and don't report conflicts in those
5702 states.
5703 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
5704 New global function.
5705 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
5706 function.
5707 * src/main.c (main): After conflict resolution, remove the unreachable
5708 states and update all data structures that reference states by number.
5709 * src/state.c (state_new): Initialize each state's reachable member to
5710 false.
5711 (state_mark_reachable_states): New static function.
5712 (state_remove_unreachable_states): New global function.
5713 * src/state.h (struct state): Add member bool reachable.
5714 (state_remove_unreachable_states): Prototype.
5715 * tests/conflicts.at (Unreachable States After Conflict Resolution):
5716 New test case.
5717 * tests/existing.at (GNU pic Grammar): Update test case output now that
5718 an unused rule is discovered.
5719
57202007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5721
5722 Minor code cleanup in parser table construction.
5723 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
5724 (new_itemsets, save_reductions): Update for rename to nitemset.
5725 * src/closure.c (nritemset): Rename to...
5726 (nitemset): ... this since the "r" appears to meaningless and isn't
5727 used in the comments.
5728 (closure): Update for rename.
5729 * src/closure.h (nritemset): Update extern to...
5730 (nitemset): ... this.
5731 * src/lalr.c (LA): Fix a typo in comments.
5732 * src/print.c (print_core): Update for rename to nitemset.
5733 * src/print_graph.c (print_graph): Likewise.
5734 * src/state.h: Fix some typos in header comments.
5735
57362007-04-04 Paul Eggert <eggert@cs.ucla.edu>
5737
5738 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
5739 still sticks to ASCII. Sorry!
5740
5741 * README-hacking: New file, taken mostly from coreutils, with changes
5742 for Bison. Contains much of the contents of:
5743 * README-cvs: Remove.
5744 * bootstrap: Sync from gnulib.
5745 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
5746 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
5747
57482007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
5749
5750 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
5751 Setzer.
5752 (Java Differences): Fix some typos.
5753 * THANKS: Add Sebastian Setzer.
5754
57552007-03-07 Paolo Bonzini <bonzini@gnu.org>
5756
5757 * data/java.m4 (b4_single_class_if): Remove.
5758 (b4_abstract_if): Look at "%define abstract".
5759 (b4_lexer_if): New.
5760 (b4_union_name): Rename...
5761 (b4_yystype): ... to this. Map to "%define stype".
5762 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
5763 b4_maybe_throws): Fix quoting.
5764 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
5765 * data/lalr1.java (Lexer interface): Always define.
5766 (Lexer interface within parser class): Remove.
5767 (YYLexer class): New, used when "%code lexer" is present.
5768 (constructor): When "%code lexer" is used, pass %lex-param
5769 to the lexer constructor.
5770 (yylex, yyparse): Remove %lex-param from method invocations
5771 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
5772
5773 * doc/bison.texinfo (Java Bison Interface): Mention "%define
5774 abstract". Rename "%define union_name" to "%define stype".
5775 Rename method names according to previous patch.
5776 (Java Scanner Interface): Describe "%code lexer" instead of
5777 "%pure-parser" and "%define single_class".
5778 (Java Differences): Mention "%code lexer".
5779
5780 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
5781 Include scanner here, using macros from tests/local.at.
5782 (AT_DATA_CALC_Y): Remove final argument.
5783 (_AT_CHECK_JAVA_CALC): Likewise.
5784 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
5785 of %locations and %error-verbose.
5786 (main): Test with and without %lex-param.
5787 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
5788 (AT_BISON_OPTION_POPDEFS): Pop it.
5789
57902007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5791
5792 DJGPP spefic issue. Inhibit the use of disallowed characters for
5793 file name genertion on Win98, WinXP, etc. These are |<>":?*\
5794 and concern testsuite case 46.
5795 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
5796 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
5797 * djgpp/config.bat: Inhibit the use of disallowed characters.
5798
57992007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
5800
5801 Miscellaneous %define and %code cleanup.
5802 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
5803 values are interpreted.
5804 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
5805 documentation a little more.
5806 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
5807 muscle_percent_define_insert, muscle_percent_code_grow): New
5808 functions/macros.
5809 * src/muscle_tab.h (muscle_percent_define_insert,
5810 muscle_percent_code_grow): Prototype.
5811 * src/parse-gram.y (prologue_declaration): Use
5812 muscle_percent_define_insert and muscle_percent_code_grow when parsing
5813 %define and %code directives.
5814
5815 Make it easy to share %define boolean variables between the front-end
5816 and back-end. Though not used yet, this will be useful in the future.
5817 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
5818 Bison uses of names rather than just skeleton uses of names.
5819 (b4_percent_define_get, b4_percent_define_ifdef): Rename
5820 b4_percent_define_skeleton_variables(VARIABLE) to
5821 b4_percent_define_bison_variables(VARIABLE).
5822 (b4_percent_code_get, b4_percent_code_ifdef): Rename
5823 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
5824 b4_percent_code_bison_qualifiers(QUALIFIER).
5825 (b4_check_user_names_wrap): Update for renames.
5826 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
5827 muscle_percent_define_default): New functions mimicking
5828 b4_percent_define_flag_if and b4_percent_define_default.
5829
5830 For %define variables, report locations for invalid values and
5831 redefinitions.
5832 * data/bison.m4 (b4_percent_define_flag_if): Read
5833 b4_percent_define_loc(VARIABLE) to report the location of an invalid
5834 value for VARIABLE.
5835 (b4_percent_define_default): Save a special location in
5836 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
5837 must later be reported as invalid.
5838 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
5839 functions.
5840 (muscle_percent_define_insert): Record the location of VARIABLE in
5841 muscle percent_define_loc(VARIABLE), and use it to report the previous
5842 location for a redefinition.
5843 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
5844 (muscle_percent_define_default): Update like b4_percent_define_default.
5845 (muscle_grow_user_name_list): Rename to...
5846 (muscle_user_name_list_grow): ... this for consistency and use
5847 muscle_location_grow.
5848 * src/muscle_tab.h (muscle_location_grow): Prototype.
5849 * tests/input.at (%define errors): Update expected output.
5850 * tests/skeletons.at (%define boolean variables: invalid skeleton
5851 defaults): New test case.
5852
58532007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
5854
5855 * src/print.c (lookahead_set, state_default_rule): Remove.
5856 (print_reductions): Replace state_default_rule invocation with
5857 equivalent use of yydefact, which was computed in token_actions in
5858 tables.c.
5859 (print_results): Don't allocate lookahead_set.
5860
58612007-02-27 Paolo Bonzini <bonzini@gnu.org>
5862
5863 * data/lalr1.java: Prefix all private members with yy.
5864
58652007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
5866
5867 Use YYFPRINTF instead of fprintf where appropriate. Reported by
5868 Sebastien Fricker at
5869 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
5870 * THANKS: Add Sebastien Fricker.
5871 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
5872 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
5873 accept a variable number of arguments.
5874
58752007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
5876
5877 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
5878
58792007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5880
5881 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
5882 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
5883 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
5884
58852007-02-11 Paul Eggert <eggert@cs.ucla.edu>
5886
5887 Undo my 2007-02-07 change, switching back to the c-strcase module
5888 introduced in the 2007-02-03 change. Bruno Haible reported that
5889 the 2007-02-07 change would be dangerous in Turkish if we add a
5890 language whose name contains "i", since "i" is not lowercase "I"
5891 in Turkish.
5892 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
5893 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
5894 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
5895 * m4/.cvsignore: Remove strcase.m4.
5896 * src/getargs.c: Revert 2007-02-07 change, as follows.
5897 Include c-strcase.h.
5898 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
5899
59002007-02-11 Bruno Haible <bruno@clisp.org>
5901
5902 Enable the Java related testsuite tests when the only Java compiler
5903 found is a gcj < 4.3. Discussed at
5904 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
5905 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
5906
59072007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
5908
5909 * data/Makefile.am: Update copyright date.
5910 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
5911 yypstate_new returns NULL.
5912 (yypstate_new): Return NULL if malloc does.
5913 * src/reader.c (packgram): Move translation of rule actions from the
5914 beginning of packgram to...
5915 (check_and_convert_grammar): ... here right before packgram is invoked
5916 so it's easier to write more complete comments, and remove redundant
5917 code.
5918
59192007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
5920
5921 As in semantic actions, make @$ in %initial-action, %destructor, and
5922 %printer imply %locations.
5923 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
5924 scanning @$.
5925 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
5926 (@$ in %initial-action implies %locations,
5927 @$ in %destructor implies %locations,
5928 @$ in %printer implies %locations): ... these new test cases.
5929
59302007-02-07 Paul Eggert <eggert@cs.ucla.edu>
5931
5932 Undo most of the 2007-02-03 change, switching to the strcase module
5933 now that gnulib strcase has been fixed.
5934 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
5935 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
5936 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
5937 * m4/.cvsignore: Add strcase.m4.
5938 * src/getargs.c: Revert 2007-02-03 change, as follows.
5939 Don't include c-strcase.h.
5940 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
5941 strcasecmp has "unspecified behavior" outside the POSIX locale,
5942 but it works fine in practice if at least one argument is ASCII,
5943 as is the case in Bison.
5944
59452007-02-07 Paolo Bonzini <bonzini@gnu.org>
5946
5947 * tests/java.at: Skip tests if only one of javac/java is present.
5948 Reported by Joel E. Denny.
5949 * tests/atlocal.in: Adjust copyright years.
5950
59512007-02-05 Paolo Bonzini <bonzini@gnu.org>
5952
5953 * data/lalr1.java (Stack): Work around old verifiers that disallow
5954 access to the private fields of an inner class, from the outer class.
5955 We can make Stack's fields public because user code doesn't have access
5956 to the instance of Stack used by parse(). Reported by Paul Eggert.
5957
59582007-02-03 Paul Eggert <eggert@cs.ucla.edu>
5959
5960 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
5961 the right spot for these files?
5962 * bootstrap.conf (gnulib_modules): Add c-strcase.
5963 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
5964 c-strncasecmp.c.
5965 * src/getargs.c: Include c-strcase.h.
5966 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
5967 to avoid unspecified behavior.
5968
59692007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
5970
5971 * doc/bison.texinfo (Decl Summary): Correct typo.
5972
59732007-01-30 Paolo Bonzini <bonzini@gnu.org>
5974
5975 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
5976 Complain if the value does not match empty, "true" or "false".
5977 * data/c++.m4: Adjust default definitions of %define variables.
5978 * data/java.m4: Adjust default definitions of %define variables.
5979 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
5980 to above behavior.
5981 * tests/input.at (Boolean %define variables): Test new behavior.
5982
59832007-01-29 Paolo Bonzini <bonzini@gnu.org>
5984
5985 * NEWS: Mention java.
5986 * TODO: Remove things that are done.
5987 * bootstrap.conf: Add javacomp-script and javaexec-script.
5988 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
5989
5990 * data/Makefile.am: Add new files.
5991 * data/java-skel.m4: New.
5992 * data/java.m4: New.
5993 * data/lalr1.java: New.
5994
5995 * doc/bison.texinfo: Put "A Complete C++ Example" under
5996 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
5997 under Other Languages.
5998
5999 * src/getargs.c (valid_languages): Add Java.
6000 * src/getargs.h (struct bison_language): Update size of string fields.
6001
6002 * tests/Makefile.am: Add java.at.
6003 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
6004 * tests/java.at: New.
6005 * tests/testsuite.at: Include it.
6006
60072007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
6008
6009 Clean up.
6010 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
6011 at_directive_argv arguments so these no longer have to be global
6012 variables. Also, update the implementation for the following changes.
6013 (fail_for_at_directive_too_many_args,
6014 fail_for_at_directive_too_few_args): Add at_directive_name argument.
6015 (at_directive_name): Remove as at_directive_argv[0] will be used for
6016 this now.
6017 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
6018 for the directive name.
6019 (at_directive_argc, at_directive_argv): Make these local within
6020 skel_lex instead of global.
6021 (INITIAL): Update directive start action for above changes.
6022 (SC_AT_DIRECTIVE_ARG): Rename to...
6023 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
6024 (SC_AT_DIRECTIVE_SKIP_WS): Update.
6025 (scan_skel): Move yylex_destroy to...
6026 (skel_scanner_free): ... here.
6027 * tests/skeletons.at (installed skeleton file name): Rename to...
6028 (installed skeleton file names): ... this.
6029
60302007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
6031
6032 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
6033 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
6034 Summary" not "Directives".
6035 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
6036 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
6037 since the former is now the more complete one.
6038 (Prologue Alternatives): Likewise and do the same for %defines.
6039 (Table of Symbols): Add summary of %code, add summary of %define, and
6040 move full %code documentation to...
6041 (Decl Summary): ... here for consistency with other entries in these
6042 sections.
6043 Move %define entry in order to keep this list alphabetized.
6044 Reword %define entry a little to put less emphasis on the skeleton
6045 concept, which most users shouldn't have to think about.
6046
60472007-01-26 Paul Eggert <eggert@cs.ucla.edu>
6048
6049 Adjust to recent gnulib changes.
6050 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
6051 Add string.h, string_.h, unistd_.h, wchar_.h.
6052 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
6053 * src/system.h: Don't include <stpcpy.h>; this is now done by
6054 <string.h>.
6055
60562007-01-23 Paolo Bonzini <bonzini@gnu.org>
6057
6058 Simplify implementation of unqualified %code, implement macros for
6059 uniform treatment of boolean %define flags. Document %define.
6060 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
6061 b4_percent_code_ifdef): New.
6062 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
6063 * data/c++.m4: Define default value for global_tokens_and_yystype.
6064 * data/glr.cc: Likewise.
6065 * data/location.cc: Use b4_percent_define_flag_if.
6066
6067 * doc/bison.texinfo (Decl Summary): Document %define.
6068
6069 * src/parse-gram.y (Unqualified %code): Change muscle name to
6070 b4_percent_code().
6071 (content.opt): Default to empty.
6072
60732007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6074
6075 Implement support for relative and absolute skeleton file names.
6076 Discussed starting at
6077 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
6078 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
6079 (Bison Options): Document in --skeleton entry.
6080 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
6081 full_skeleton can't necessarily hold all of pkgdatadir.
6082 If the specified skeleton file name contains a `/', don't prepend
6083 pkgdatadir.
6084 * src/parse-gram.y (prologue_declaration): If the specified skeleton
6085 file name contains a `/', prepend the grammar file directory.
6086 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
6087 * skeletons.at: New file.
6088 (relative skeleton file names): New test case.
6089 (installed skeleton file names): New test case.
6090 * tests/testsuite.at: Include skeletons.at.
6091
6092 * bootstrap: Update copyright to 2007.
6093
60942007-01-17 Paolo Bonzini <bonzini@gnu.org>
6095
6096 * bootstrap: Remove occurrences of .#bootmp from the files.
6097
60982007-01-17 Akim Demaille <akim@epita.fr>
6099
6100 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
6101 nonterminals.
6102 Use per-type %printer.
6103
61042007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6105
6106 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
6107 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6108 djgpp/config.site, src/files.c, src/files.h, src/main.c,
6109 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
6110 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
6111 tests/glr-regression.at, tests/input.at, tests/local.at,
6112 tests/output.at, tests/torture.at: Update copyright to 2007.
6113
61142007-01-16 Akim Demaille <akim@epita.fr>
6115
6116 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
6117 error code.
6118 (Calc++ Scanner): Exit with failure if we can't open the input
6119 file.
6120 Accept "-" standing for stdin.
6121 (Calc++ Top Level): Print the result only if the parsing was
6122 successful.
6123
61242007-01-16 Akim Demaille <akim@epita.fr>
6125
6126 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
6127
61282007-01-15 Paolo Bonzini <bonzini@gnu.org>
6129 and Joel E. Denny <jdenny@ces.clemson.edu>
6130
6131 Clean up %define and %code implementation in M4 some. Most
6132 importantly, rename all related macros to be in the b4_percent_define
6133 and b4_percent_code namespaces. Also, complete support for `.' in
6134 %define variable names and %code qualifiers.
6135 * data/bison.m4 (b4_check_user_names): Check for special
6136 "SKELETON-NAMESPACE(name)" macros instead of using two nested
6137 m4_foreach loops.
6138 (b4_get_percent_define, b4_get_percent_code): Rename to...
6139 (b4_percent_define_get, b4_percent_code_get): ... these.
6140 Extend documentation with examples.
6141 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
6142 b4_percent_define_skeleton_variables and
6143 b4_percent_code_skeleton_qualifiers.
6144 Expect any value for the %define variable `foo' to be stored in the
6145 macro named `b4_percent_define(foo)'; expect any %code blocks for the
6146 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
6147 expect any unqualified %code blocks to be stored in a macro named
6148 `b4_percent_code_unqualified'.
6149 Use m4_indir so that %define variable names and %code qualifiers can
6150 contain `.', which is allowed by the grammar parser.
6151 (b4_percent_define_default): New macro to set a default value for a
6152 %define variable.
6153 (m4_wrap): Update wrapped code, and fix some underquoting.
6154 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
6155 Expect grammar uses of %define variables and %code qualifiers to be
6156 defined in b4_percent_define_user_variables and
6157 b4_percent_code_user_qualifiers.
6158 * data/c++.m4: Use b4_percent_define_default rather than
6159 m4_define_default. Fix some underquoting. Skeleton usage of %define
6160 variable define_location_comparison now implies skeleton usage of
6161 %define variable filename_type.
6162 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6163 data/push.c, data/yacc.c: Update macro names.
6164 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
6165 muscle names.
6166
61672007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6168
6169 DJGPP specific issues.
6170
6171 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
6172 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
6173
61742007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6175
6176 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
6177 run parsers in all tests so that Valgrind is invoked during
6178 maintainer-check-valgrind.
6179 (Duplicate representation of merged trees): Free all semantic values.
6180 (Duplicated user destructor for lookahead): Likewise.
6181
61822007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6183
6184 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
6185 command-line prefix.
6186 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
6187 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
6188 miss Valgrind messages.
6189 (Exploding the Stack Size with Malloc): Likewise.
6190
61912007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6192
6193 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
6194 locals. Reported by Juan Manuel Guerrero at
6195 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
6196 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
6197 Fix some indentation also.
6198 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
6199 explaining this issue.
6200
62012007-01-09 Paolo Bonzini <bonzini@gnu.org>
6202 and Joel E. Denny <jdenny@ces.clemson.edu>
6203
6204 Simplify union and prologue handling, and escape union and lex/parse
6205 params with digraphs.
6206 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
6207 values to the empty string since these are no longer guaranteed
6208 initialized by the front-end.
6209 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
6210 braces around b4_user_stype since this is no longer done by the
6211 front-end.
6212 * src/files.c, src/files.h (pre_prologue_obstack,
6213 post_prologue_obstack): Remove.
6214 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
6215 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
6216 with digraphs. This fixes lex params and parse params.
6217 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
6218 * src/output.c (prepare): Remove muscle insertion of the prologues.
6219 (output): Remove freeing of pre_prologue_obstack and
6220 post_prologue_obstack.
6221 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
6222 than prologue_augment for prologue parsing so you don't need prologue
6223 obstacks.
6224 (grammar_declaration): For %union RHS, use `braceless' instead of
6225 "{...}" so that braces are already stripped and code is escaped with
6226 digraphs.
6227 * src/reader.c (prologue_augment): Remove.
6228 (reader): Remove initialization of pre_prologue_obstack and
6229 post_prologue_obstack.
6230 * src/reader.h (prologue_augment): Remove.
6231
6232 * data/c.m4: Remove stray parenthesis.
6233
62342007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6235
6236 Remove quotes from variables names in %define directives and from
6237 qualifiers in %code directives, and restrict the characters that are
6238 allowed in them to M4-friendly ones. For %define, continue to support
6239 the quoted form as a deprecated feature. Discussed starting at
6240 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
6241 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
6242 %code.
6243 * doc/bison.texinfo (Prologue Alternatives): Update.
6244 (Decl Summary): In %defines entry, update mention of `%code requires'
6245 and `%code provides'.
6246 (C++ Location Values): Update %define uses.
6247 (Calc++ Parser Interface): Likewise.
6248 (Calc++ Parser): Likewise, and update `%code requires' uses.
6249 (Table of Symbols): Update %code documentation.
6250 * src/parse-gram.y (prologue_declaration): For %define variables, use
6251 `variable' instead of `STRING'.
6252 (grammar_declaration): For %code qualifiers, use `ID' instead of
6253 `STRING'.
6254 (variable): New nonterminal that takes an `ID' or a `STRING'.
6255 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
6256 and %define uses.
6257 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
6258 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
6259 (%define errors): Update %define uses.
6260
62612007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6262
6263 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
6264 instead of muscle_insert for %define values so that M4-special
6265 characters are replaced with digraphs.
6266 * tests/input.at (%define errors): Extend to check weird values.
6267
62682007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6269
6270 Instead of having skeletons declare all valid %define variables and
6271 %code qualifiers, provide macros that retrieve the associated values
6272 and build these lists automatically. Thus Bison will now warn when a
6273 variable or qualifier is not used by the skeleton in the current
6274 invocation regardless of whether it might sometimes be used by that
6275 skeleton in other invocations. Also, move all %define value macros to
6276 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
6277 form, which is replaced by %code.
6278 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
6279 (b4_check_user_names): ... this, and change the series of valid name
6280 arguments to a single list argument for names used in the skeleton
6281 similar to the existing list argument for names used in the grammar.
6282 Warn instead of complaining.
6283 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
6284 values and %code code, to format %code code properly, and to build
6285 lists of all %define variables and %code qualifiers used in the
6286 skeleton: b4_skeleton_percent_define_variables and
6287 b4_skeleton_percent_code_qualifiers.
6288 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
6289 Remove, and...
6290 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
6291 the skeleton names lists can finish building first. In place of
6292 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
6293 expect the lists b4_user_percent_define_variables and
6294 b4_user_percent_code_qualifiers.
6295 * data/c++.m4: Where setting default values for b4_parser_class_name,
6296 b4_location_type, b4_filename_type, b4_namespace, and
6297 b4_define_location_comparison, update their names to the
6298 b4_percent_define_ namespace.
6299 * data/glr.c: Don't use b4_check_percent_define_variables and
6300 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6301 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
6302 (b4_parser_class_name, b4_namespace): Define these using
6303 b4_get_percent_define for parser_class_name and namespace.
6304 * data/location.cc: Use b4_get_percent_define.
6305 * data/push.c: Don't use b4_check_percent_define_variables and
6306 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6307 * data/yacc.c: Likewise, and don't call m4_exit in
6308 b4_use_push_for_pull_if or m4_wrap code will never execute.
6309 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
6310 Rename to...
6311 (muscle_grow_user_name_list): ... this for consistency with the
6312 terminology used in bison.m4.
6313 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
6314 %define variable names, and rename muscle used_percent_define_variables
6315 to user_percent_define_variables.
6316 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
6317 user_percent_code_qualifiers.
6318 (content): Remove.
6319 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
6320 {CODE} form is no longer accepted.
6321 * tests/input.at (Reject bad %code qualifiers): Rename to...
6322 (Reject unused %code qualifiers): ... this, and update test output.
6323 (%define error): Update test output.
6324
63252007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
6326
6327 Check for unrecognized %define variables similar to checking for
6328 unrecognized %code qualifiers. Check for redefined %define variables.
6329 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
6330 generalizes...
6331 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
6332 (b4_check_percent_define_variables): New, also wraps it.
6333 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
6334 variables using b4_check_percent_define_variables.
6335 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
6336 all those exercised in the test suite and all those listed in the
6337 `Default values' section of c++.m4. Are there others?
6338 * data/push.c, data/yacc.c: Declare no valid %define variables.
6339 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
6340 similar to muscle_find, but it works even when the muscle stores a
6341 const value.
6342 (muscle_grow_used_name_list): New function for constructing the used
6343 name list muscles that b4_check_for_unrecognized_names requires.
6344 * src/parse-gram.y (prologue_declaration): Warn if a variable is
6345 %define'd more than once. Define the b4_used_percent_define_variables
6346 muscle with muscle_grow_used_name_list.
6347 (grammar_declaration): Abbreviate %code code with
6348 muscle_grow_used_name_list.
6349 * tests/input.at (%define errors): New.
6350
63512007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6352
6353 Provide warn_at, complain_at, and fatal_at function callbacks to the
6354 skeletons, and use this for %code qualifier complaints.
6355 * data/bison.m4 (b4_error_at): New, invoked by...
6356 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
6357 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
6358 @fatal_at(...@) directives.
6359 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
6360 qualifiers in b4_used_percent_code_qualifiers and to use
6361 b4_complain_at.
6362 * src/location.c, src/location.h (boundary_set_from_string): New global
6363 function.
6364 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
6365 function.
6366 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
6367 to b4_used_percent_code_qualifiers.
6368 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
6369 function.
6370 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
6371 (lineno): Rename to...
6372 (out_lineno): ... this so I don't misunderstand it again.
6373 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
6374 here; these newlines are in the input but not the output file.
6375 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
6376 (at_directive_perform): ... this new static function, and add handling
6377 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
6378 directives.
6379 * tests/input.at (Reject bad %code qualifiers): Update test output with
6380 locations and extend.
6381
6382 * tests/output.at (Output file name: [, Output file name: ]): Remove
6383 bogus comment about these tests failing.
6384
63852007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6386
6387 Clean up b4_check_percent_code_qualifiers a little.
6388 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
6389 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
6390 documentation and add examples.
6391 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
6392 qualifiers here.
6393
63942007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
6395
6396 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
6397 unreliable -- especially when they're hidden inside another macro.
6398 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
6399 data/c.m4: Remove m4_divert(-1).
6400 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6401 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
6402 m4_divert_push(0) and m4_divert_pop(0).
6403 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
6404 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
6405 pushed and popped by m4sugar, should be first on the stack.
6406
6407 Provide warn, complain, and fatal function callbacks to the skeletons.
6408 This provides more flexibility than m4_fatal, improves the error
6409 message format, and captures messages for translation. Discussed
6410 starting at
6411 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
6412 * data/bison.m4 (b4_error): New, invoked by...
6413 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
6414 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
6415 directives. Because these M4 macros might be called when the current
6416 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
6417 the previous removal of uses of m4_divert, which caused trouble.
6418 (b4_check_percent_code_qualifiers): Use b4_complain instead of
6419 m4_fatal to report unrecognized %code qualifiers.
6420 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
6421 push parser requests.
6422 * data/glr.c: Use b4_complain instead of m4_fatal to report
6423 non-deterministic push parser requests.
6424 Update @output usage to @output(...@) form.
6425 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
6426 report missing %defines. Update @output usage to @output(...@) form.
6427 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
6428 @output(...@) form.
6429 * src/main.c (main): Invoke skel_scanner_free.
6430 * src/scan-skel.h (skel_scanner_free): Prototype new function.
6431 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
6432 obstack_for_string from flex-scanner.h.
6433 (YY_DECL): Use to declare skel_lex static.
6434 (decode_at_digraphs): Remove; now handled in the new
6435 SC_AT_DIRECTIVE_ARG start condition.
6436 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
6437 functions.
6438 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
6439 at_directive_argv): New static globals.
6440 (INITIAL): Use fail_for_invalid_at.
6441 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
6442 recognize the start of a generalized `@directive(...@)' form and
6443 start...
6444 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
6445 directive args (using the new obstack_for_string), to decode the
6446 contained @ diagraphs, and to perform the directive. It recognizes
6447 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
6448 @output(...@).
6449 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
6450 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
6451 `@,'.
6452 (scan_skel): Initialize obstack_for_string on the first call.
6453 (skel_scanner_free): New function to free obstack_for_string.
6454 * tests/input.at (Reject bad %code qualifiers): Update test output.
6455
64562007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
6457
6458 Consolidate the 4 prologue alternative directives (%code, %requires,
6459 %provides, and %code-top) into a single %code directive with an
6460 optional qualifier field. Discussed at
6461 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
6462 * NEWS (2.3a+): Rewrite the existing entry for the prologue
6463 alternatives.
6464 * doc/bison.texinfo (Prologue Alternatives): Update.
6465 (Decl Summary): Update to %code "requires" and %code "provides".
6466 (Calc++ Parser): Update to %code "requires".
6467 (Table of Symbols): Remove entries for %requires, %provides, and
6468 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
6469 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
6470 are replaced by b4_percent_code_provides and b4_percent_code_requires,
6471 which are skeleton-specific.
6472 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
6473 declare what %code qualifiers it supports and to complain if any other
6474 qualifiers were used in the grammar.
6475 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
6476 and b4_user_code([b4_percent_code_provides]) in place of
6477 b4_user_requires and b4_user_provides.
6478 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
6479 Add b4_user_code([b4_percent_code_top]) and
6480 b4_user_code([b4_percent_code]).
6481 Invoke b4_check_percent_code_qualifiers.
6482 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
6483 PERCENT_REQUIRES): Remove.
6484 (grammar_declaration): Remove RHS's for %code-top, %provides, and
6485 %requires. Rewrite the %code RHS as the unqualified form defining the
6486 muscle b4_percent_code. Add another RHS for the qualified %code form,
6487 which defines muscles of the form b4_percent_code_QUALIFIER and the
6488 b4_used_percent_code_qualifiers muscle.
6489 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
6490 PERCENT_REQUIRES): Remove.
6491 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
6492 %code "requires" and %code "provides".
6493 * tests/input.at (Reject bad %code qualifiers): New.
6494
64952007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
6496
6497 Use the new code_props interface for destructors and printers.
6498 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
6499 printer_location members, and change the type of the destructor and
6500 printer members to code_props.
6501 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
6502 symbol_printer_get, semantic_type_destructor_set,
6503 semantic_type_printer_set, default_tagged_destructor_set,
6504 default_tagless_destructor_set, default_tagged_printer_set,
6505 default_tagless_printer_set): Use code_props in arguments and return
6506 types in place of char const * and location.
6507 (symbol_destructor_location_get, symbol_printer_location_get): Remove
6508 since the locations are now contained in the return of
6509 symbol_destructor_get and symbol_printer_get.
6510 * src/output.c (symbol_destructors_output, symbol_printers_output):
6511 Replace with...
6512 (symbol_code_props_output): ... this to eliminate duplicate code.
6513 (output_skeleton): Update to use symbol_code_props_output.
6514 * src/reader.c (symbol_should_be_used): Update use of
6515 symbol_destructor_get.
6516 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
6517 Update uses of the various _destructor_set and _printer_set functions.
6518 * src/symtab.c: (default_tagged_destructor_location,
6519 default_tagless_destructor_location, default_tagged_printer_location,
6520 default_tagless_printer_location): Remove since we...
6521 (default_tagged_destructor, default_tagless_destructor,
6522 default_tagged_printer, default_tagless_printer): ... change the type
6523 of these to code_props.
6524 (symbol_new, semantic_type_new, symbol_destructor_set,
6525 semantic_type_destructor_set, symbol_destructor_get,
6526 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
6527 symbol_check_alias_consistency, default_tagged_destructor_set,
6528 default_tagless_destructor_set, default_tagged_printer_set,
6529 default_tagless_printer_set): Update.
6530 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
6531 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
6532 code_props members.
6533 (symbol_print): Use SYMBOL_CODE_PRINT.
6534
65352007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
6536
6537 Use the new code_props interface for rule actions.
6538 * src/symlist.h (symbol_list): Replace action, action_location, and
6539 used members with a code_props action_props member.
6540 * src/reader.c (symbol_should_be_used, grammar_rule_check,
6541 grammar_midrule_action, grammar_current_rule_merge_set,
6542 grammar_current_rule_symbol_append, packgram): Update.
6543 * src/scan-code.h (translate_rule_action): Remove, no longer used.
6544 * src/scan-code.l (handle_action_dollar): Update.
6545 (translate_rule_action): Remove, no longer used.
6546 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
6547
65482007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6549
6550 Use the new code_props interface in parse-gram.y.
6551 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
6552 Update all uses of translate_* functions to use the new code_props
6553 interface and to use gram_scanner_last_string_free and
6554 code_scanner_last_string_free where possible.
6555 (grammar_declaration): symbol_list_destructor_set and
6556 symbol_list_printer_set now perform the translation, so don't do it
6557 here. Use gram_scanner_last_string_free where possible.
6558 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
6559 translate_code): Remove, no longer used.
6560 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
6561 symbol_list_printer_set): Perform code translation here rather than
6562 depending on the caller to do so.
6563
6564 * src/symlist.h (struct symbol_list): Correct some documentation typos.
6565 * src/scan-gram.h (gram_last_string): Remove declaration.
6566 * src/scan-gram.l (last_string): Declare it static.
6567
65682007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6569
6570 Encapsulate code properties and related functionality for the various
6571 destructors, printers, and actions into a code_props structure and
6572 interface. This patch merely implements code_props in scan-code.h and
6573 scan-code.l. Future patches will rewrite other modules to use it.
6574 Discussed starting at
6575 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
6576 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
6577 consistently initialize const structs that have an empty location
6578 field.
6579 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
6580 to ensure consistency.
6581 * src/scan-code.h (code_props): New structure.
6582 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
6583 function, macro, and const global variable for initializing a
6584 code_props with no code.
6585 (code_props_plain_init, code_props_symbol_action_init,
6586 code_props_rule_action_init, code_props_translate_code): The rest of
6587 the new code_props functional interface. Among other things, the init
6588 functions set the code_props kind field so that
6589 code_props_translate_code will know whether to behave like
6590 translate_symbol_action, translate_rule_action, or translate_code.
6591 These old translate functions must remain until all other modules are
6592 updated to use the new code_props interface.
6593 (code_scanner_last_string_free): New function similar to
6594 gram_scanner_last_string_free.
6595 (code_scanner_free): Add documentation.
6596 * src/scan-code.l: Implement the new interface.
6597 (code_lex): Make it static, add a code_props* argument, and remove the
6598 rule argument.
6599 (last_string): New static global similar to the one in scan-gram.l.
6600 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
6601 instead of rule.
6602 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
6603 code_props since Bison may one day use this information for destructors
6604 and printers.
6605 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
6606 (handle_action_dollar): Use symbol_list_n_get and set used flag
6607 directly since symbol_list_n_used_set is removed.
6608 (translate_action): Add a code_props* argument and remove the rule,
6609 action, and location arguments. Pass the code_props* on to code_lex.
6610 (translate_rule_action, translate_symbol_action, translate_code):
6611 Rewrite as wrappers around the new code_props interface.
6612 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
6613 it would eventually need to break the encapsulation of code_props.
6614
66152007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
6616
6617 * etc/.cvsignore: New.
6618
66192007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
6620
6621 Add maintainer-push-check to run maintainer-check using push parsing in
6622 place of pull parsing where available.
6623 * Makefile.am (maintainer-push-check): New.
6624 * data/bison.m4 (b4_use_push_for_pull_if): New.
6625 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
6626 appropriately based on their existing values.
6627 (yypush_parse): Don't print push-parser-specific diagnostics if push
6628 parsing is being used in place of pull parsing.
6629 * data/yacc.c: If push parsing should replace pull parsing, redirect to
6630 push.c.
6631 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
6632 variable, and insert b4_use_push_for_pull_flag into muscles.
6633 * tests/Makefile.am (maintainer-push-check): New.
6634
66352006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
6636
6637 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
6638 (whether successful or failed) so that yypush_parse can be invoked
6639 again to start a new parse using the same yypstate.
6640 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
6641 check multiple yypull_parse invocations on the same yypstate. For pull
6642 mode, extend to check multiple yyparse invocations.
6643 (Exploding the Stack Size with Alloca): Extend to try with
6644 %push-pull-parser.
6645 (Exploding the Stack Size with Malloc): Likewise.
6646
6647 * tests/calc.at (Simple LALR Calculator): Don't specify
6648 %skeleton "push.c" since %push-pull-parser implies that now.
6649 * tests/headers.at (export YYLTYPE): Don't check for the push
6650 declarations. Otherwise, this test case can't be used to see if push
6651 mode can truly emulate pull mode.
6652 * tests/input.at (Torturing the Scanner): Likewise.
6653 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
6654 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
6655 AT_YACC_IF, which now includes the case of push mode since %skeleton
6656 need not be used for push mode. This will be more intuitive once
6657 push.c is renamed to yacc.c.
6658
66592006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
6660
6661 For push mode, convert yyparse from a macro to a function, invoke yylex
6662 instead of passing a yylexp argument to yypull_parse, and don't
6663 generate yypull_parse or yyparse unless %push-pull-parser is declared.
6664 Discussed starting at
6665 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
6666 * data/bison.m4 (b4_pull_if): New.
6667 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
6668 * data/push.c: Improve M4 quoting a little.
6669 (b4_generate_macro_args, b4_parenthesize): Remove.
6670 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
6671 any time a pull parser is requested.
6672 Don't #define this as a wrapper around yypull_parse. Instead, when
6673 both push and pull are requested, make it a function that does that
6674 same thing.
6675 (yypull_parse): If there's a b4_prefix, #define this to
6676 b4_prefix[pull_parse] when both push and pull are requested.
6677 Don't define this as a function unless both push and pull are
6678 requested.
6679 Remove the yylexp argument and hard-code yylex invocation instead.
6680 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
6681 %push-parser.
6682 * src/getargs.c (pull_parser): New global initialized to true.
6683 * getargs.h (pull_parser): extern it.
6684 * src/output.c (prepare): Insert pull_flag muscle.
6685 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
6686 (prologue_declaration): Set both push_parser and pull_parser = true for
6687 %push-pull-parser. Set push_parser = true and pull_parser = false for
6688 %push-parser.
6689 * src/scan-gram.l: Don't accept %push_parser as an alternative to
6690 %push-parser since there's no backward-compatibility concern here.
6691 Scan %push-pull-parser.
6692 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
6693 instead of %push-parser.
6694 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
6695 prototype it in the module that calls yyparse.
6696 * tests/input.at (Torturing the Scanner): Likewise.
6697 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
6698
66992006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
6700
6701 Update etc/bench.pl. Optimize push mode a little (the yyn change
6702 deserves most of the credit).
6703 * Makefile.am (SUBDIRS): Add etc subdirectory.
6704 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
6705 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
6706 yytoken, yyval, and yyloc declarations to...
6707 (yyparse or yypush_parse): ... here to improve performance. For
6708 yypush_parse invocations after the first, be sure to assign yyn its old
6709 value again.
6710 (yypstate_new): Don't bother initializing the yyresult field since the
6711 initial value isn't used.
6712 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
6713 remove the #define that, in push mode, set it to yyps->NAME.
6714 * etc/Makefile.am: New.
6715 * etc/bench.pl: Remove and build it instead from...
6716 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
6717 "tests/bison" from the build directory by default rather than just
6718 invoking "bison" from $PATH.
6719 (calc_grammar): Update push parser code: don't declare yylval globally,
6720 don't define yyparse_wrapper, and don't #define yyparse.
6721 (bench_grammar): Update to check all working combinations of yacc.c,
6722 push.c, impure, pure, pull, and push.
6723
67242006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
6725
6726 For push mode, add pull wrappers around yypush_parse.
6727 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
6728 (yypull_parse): New function wrapping yypush_parse.
6729 (yyparse): New #define wrapping yypull_parse.
6730 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
6731 is declared.
6732 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
6733 prototype yylex in the module that calls yyparse, and don't prototype
6734 yyparse there. Otherwise, the yyparse expansion won't compile.
6735 * tests/input.at (Torturing the Scanner): Likewise.
6736
67372006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
6738
6739 Enable push parsers to operate in impure mode. Thus, %push-parser no
6740 longer implies %pure-parser. The point of this change is to move
6741 towards being able to test the push parser code by running the entire
6742 test suite as if %push-parser had been declared.
6743 * data/push.c (yypush_parse): For impure mode, remove the
6744 yypushed_char, yypushed_val, and yypushed_loc arguments.
6745 Instead, declare these as local variables initialized to the global
6746 yychar, yylval, and yylloc.
6747 For the first yypush_parse invocation only, restore the initial values
6748 of these global variables when it's time to read a token since they
6749 have been overwritten.
6750 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
6751 %push-parser.
6752 * tests/calc.at (Simple LALR(1) Calculator): Always declare
6753 %pure-parser along with %push-parser since this test case was designed
6754 for pure push parsers.
6755 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
6756 (AT_YACC_OR_PUSH_IF): New.
6757 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
6758 add a note that it's still wrong for some cases (as it has been for a
6759 while).
6760 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
6761 %push-parser no longer implies %pure-parser.
6762
67632006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
6764
6765 Remove some unnecessary differences between the pull parser code and
6766 the push parser code. This patch enables yynerrs in push mode.
6767 * data/push.c: Reformat M4 a little.
6768 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
6769 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
6770 because push mode is on. Instead, if pure mode is on, move yynerrs
6771 to...
6772 (b4_declare_parser_state_variables): ... here.
6773 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
6774 to yyps->NAME so it can be used in yypush_parse.
6775 (yypush_parse): Don't omit uses of yynerrs in push mode.
6776
67772006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
6778
6779 Fix bug such that the first pushed token's value and location are
6780 sometimes overwritten (sometimes by %initial-action) before being used.
6781 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
6782 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
6783 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
6784 more closely mimic the pull parser logic.
6785 Don't copy the pushed token to yychar, yylval, and yylloc until it's
6786 time to read a token, which is after any initialization of yylval and
6787 yylloc.
6788 (gottoken): Rename label to...
6789 (yyread_pushed_token): ... for clarity and to avoid infringing on the
6790 user namespace.
6791
67922006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
6793
6794 Rearrange initialization of the parser state variables so that the
6795 skeleton doesn't have to have a copy for pull mode and another for push
6796 mode. This patch also fixes at least a bug such that yylloc was not
6797 initialized (with b4_location_initial_line and
6798 b4_location_initial_column) upon calling yypush_parse. However, that
6799 initialization now overwrites the first token's location;
6800 %initial-action assigning @$ already did the same thing, and both bugs
6801 will be fixed in a later patch.
6802 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
6803 (b4_declare_parser_state_variables): Remove initialization of yytoken,
6804 yyss, yyvs, yyls, and yystacksize.
6805 (yypstate_new): Remove initialization of some yypstate fields: yystate,
6806 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
6807 yylsp.
6808 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
6809 yyps->NAME so it can be used in yypush_parse.
6810 (yyparse or yypush_parse): For yypush_parse, don't print the
6811 "Starting parse" diagnostic for invocations after the first.
6812 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
6813 yypush_parse, only do it for the first invocation.
6814 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
6815 initialization to occur in yypush_parse but only on the first
6816 invocation.
6817
68182006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6819
6820 * data/push.c: Add CPP guards around push parser declarations in both
6821 the header and the code file.
6822 In the code file, move the push parser declarations to the same place
6823 they appear in the header file.
6824 Clean up the M4 some, especially the inconsistent underquoting in
6825 some b4_c_function_def and b4_c_function_decl uses.
6826
68272006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6828
6829 Encapsulate the push parser state variables into an M4 macro so the
6830 push skeleton doesn't have to list them again for pull mode's yyparse.
6831 For push mode, remove yypush_parse's local equivalents of these
6832 variables to eliminate unnecessary copying between the two sets at
6833 run-time. This patch also fixes at least a bug related to multiple
6834 %initial-action invocations in push mode.
6835 * data/push.c (b4_declare_parser_variables): Rename to...
6836 (b4_declare_scanner_communication_variables): ... this for clarity and
6837 update both uses.
6838 (b4_declare_yyparse_variables): Remove and move its contents to the one
6839 spot where it was invoked.
6840 (b4_declare_parser_state_variables): New macro containing the parser
6841 state variables required by push mode.
6842 (struct yypstate): Replace all fields but yynew with
6843 b4_declare_parser_state_variables.
6844 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
6845 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
6846 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
6847 (yyparse or yypush_parse): For yyparse in pull mode, replace local
6848 parser state variable declarations with
6849 b4_declare_parser_state_variables.
6850 Don't initialize parser state variables when calling yypush_parse since
6851 yypstate_new already does that.
6852 Invoke the user's initial action only upon the first yypush_parse
6853 invocation.
6854 Remove all code that copies between the local parser state variables
6855 and the yypstate.
6856
68572006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6858
6859 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
6860 prevent a name collision in a future patch where these names will
6861 sometimes be #define'd.
6862 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
6863 since it no longer has the same name as the existing argument.
6864 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
6865
68662006-12-19 Paolo Bonzini <bonzini@gnu.org>
6867 and Joel E. Denny <jdenny@ces.clemson.edu>
6868
6869 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
6870 that the argument is case-insensitive, and there's no `=' here.
6871 For the %skeleton entry, mention that %language is better.
6872 (Bison Options): Likewise for --language and --skeleton. Move the
6873 --skeleton entry so that the `Tuning the parser' section is sorted
6874 alphabetically on long options.
6875 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
6876 %language directive in detail here; cross-reference the %language
6877 documentation instead.
6878 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
6879 `%require "2.3b"' so that the example is always up-to-date.
6880 (Table of Symbols): Add entries for %language and %skeleton.
6881 * examples/extexi (normalize): Instead of replacing every %require
6882 argument with the current Bison version, just substitute for
6883 `@value{VERSION}'. This guarantees that we're testing what actually
6884 appears in the documentation.
6885 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
6886 rather than `@VERSION@'.
6887
68882006-12-18 Paul Eggert <eggert@cs.ucla.edu>
6889
6890 * NEWS: Reword the %language news a bit, and put it earlier.
6891
6892 * src/getargs.c (skeleton_arg): Last arg is now location const *.
6893 Rewrite to simplify the logic.
6894 (language_argmatch): Likewise.
6895 (program_name): We now own this var.
6896 * src/getargs.h (struct bison_language): Use char[] rather than
6897 const char *.
6898
6899 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
6900 Java is supported.
6901 * src/complain.c (program_name): Remove decl; no longer needed.
6902 * src/main.c (program_name): Remove; now belongs to getargs.
6903
69042006-12-18 Paolo Bonzini <bonzini@gnu.org>
6905
6906 * NEWS: Document %language.
6907
6908 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
6909
6910 * data/c-skel.m4, data/c++-skel.m4: New files.
6911 * data/glr.c: Complain on push parsers.
6912
6913 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
6914 over %skeleton.
6915 (Decl Summary): Document %language and %skeleton.
6916 (Command line): Document -L.
6917
6918 * examples/extexi: Rewrite %require directive.
6919 * examples/calc++/Makefile.am: Pass VERSION to extexi.
6920
6921 * src/files.c (compute_exts_from_gc): Look in language structure
6922 for .y extension.
6923 (compute_file_name_parts): Check whether .tab should be added.
6924 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
6925 (language, skeleton_arg, language_argmatch): New.
6926 (long_options): Add --language.
6927 (getargs): Use skeleton_arg, add -L/--language.
6928 * src/getargs.h: Include location.h.
6929 (struct bison_language, language, skeleton_arg, language_argmatch): New.
6930 * src/output.c (prepare): Pick default skeleton from struct language.
6931 Don't dispatch C skeletons here.
6932 * src/parse-gram.y (PERCENT_LANGUAGE): New.
6933 (prologue_declaration): Add "%language" rule, use skeleton_arg.
6934 * src/scan-gram.l ("%language"): New rule.
6935
6936 * tests/calc.at: Test %skeleton and %language.
6937 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
6938 (AT_GLR_IF): Look for %skeleton "glr.cc".
6939 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
6940 (AT_YACC_IF): Reject %language.
6941
69422006-12-18 Paul Eggert <eggert@cs.ucla.edu>
6943
6944 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
6945 since it wasn't used; only the typedef name 'semantic_type' is needed.
6946 Also, omit trailing white space.
6947
6948 * bootstrap: Sync from coreutils.
6949 (gnulib_extra_files): Add build-aux/announce.gen.
6950 (slurp): Adjust .gitignore files like .cvsignore files.
6951 * build-aux/announce-gen: Remove from CVS, since bootstrap
6952 now creates this.
6953
69542006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
6955
6956 Make %push-parser imply %pure-parser. This fixes several bugs; see
6957 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
6958 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
6959 pure_parser = true.
6960 * data/push.c: Don't bother testing b4_push_if when deciding whether
6961 to expand b4_declare_parser_variables globally.
6962 (yypush_parse): Likewise in here.
6963
6964 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
6965 (yy_reduce_print): Reformat M4 for readability.
6966
69672006-12-15 Bob Rossi <bob@brasko.net>
6968 and Joel Denny <jdenny@ces.clemson.edu>
6969
6970 * data/push.c (yypstate): Add typedef, and update all uses of
6971 struct yypstate to just yypstate.
6972 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
6973
69742006-12-14 Bob Rossi <bob@brasko.net>
6975
6976 * data/push.c (yypush_parse): Declare prototype regardless of
6977 %locations option.
6978
69792006-12-14 Bob Rossi <bob@brasko.net>
6980
6981 * data/push.c (yyparse): Remove the prototype and the #define when in
6982 push-parser mode.
6983
69842006-12-13 Bob Rossi <bob@brasko.net>
6985
6986 * data/push.c (yypstate_init): Rename to...
6987 (yypstate_new): ... this and use b4_c_function_def.
6988 (yypstate_delete): New.
6989 (yypush_parse): Change parameters yynval and yynlloc to be const.
6990 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
6991 yypstate_delete functions.
6992
69932006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
6994
6995 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
6996 strange test case titles. Reported by Bob Rossi.
6997
69982006-12-13 Paul Eggert <eggert@cs.ucla.edu>
6999
7000 * TODO: Add pointer to Sylvain Schmitz's work on static detection
7001 of potential ambiguities in GLR grammers.
7002
70032006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
7004
7005 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
7006 `bison ', use m4_index instead of m4_substr since chopping up a string
7007 containing M4-special characters causes problems here.
7008
7009 Fix a couple of bugs related to special characters in user-specified
7010 file names, and make it easier for skeletons to compute output file
7011 names with the same file name prefix as Bison-computed output file
7012 names.
7013 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
7014 b4_parser_file_name and b4_spec_defines_file instead of
7015 @output_parser_name@ and @output_header_name@, which are now redundant.
7016 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
7017 b4_parser_file_name, b4_spec_defines_file, and the new
7018 @basename(FILENAME@) instead of @output_parser_name@ and
7019 @output_header_name@, which inappropriately escaped the file names as
7020 C string literals.
7021 * src/files.c (all_but_ext): Remove static qualifier.
7022 (compute_output_file_names): Move `free (all_but_ext)' to...
7023 (output_file_names_free): ... here since all_but_ext is needed later.
7024 * src/files.h (all_but_ext): Extern.
7025 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
7026 exactly what MUSCLE_INSERT_STRING used to do.
7027 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
7028 characters are escaped properly.
7029 * src/output.c (prepare): Define muscle file_name_all_but_ext as
7030 all_but_ext.
7031 For pkgdatadir muscle, maintain previous functionality by using
7032 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
7033 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
7034 digraphs would never be expanded. Hopefully no one has M4-special
7035 characters in his Bison installation path.
7036 * src/scan-skel.l: Don't parse @output_header_name@ and
7037 @output_parser_name@ anymore since they're now redundant.
7038 In @output, use decode_at_digraphs.
7039 Parse a new @basename command that invokes last_component.
7040 (decode_at_digraphs): New.
7041 (BASE_QPUTS): Remove unused.
7042 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
7043 (Output file name): New tests.
7044
70452006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
7046
7047 Warn about output files that are generated by the skeletons and that
7048 conflict with other output files.
7049 * data/glr.c: Don't generate the header file here when glr.cc does.
7050 * src/files.c (file_names, file_names_count): New static globals.
7051 (compute_output_file_names): Invoke output_file_name_check for files
7052 not generated by the skeletons and remove existing checks.
7053 (output_file_name_check): New function that warns about conflicting
7054 output file names.
7055 (output_file_names_free): Free file_names.
7056 * src/files.h (output_file_name_check): Declare.
7057 * src/scan-skel.l: Invoke output_file_name_check for files generated by
7058 the skeletons.
7059 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
7060 (Conflicting output files): New tests.
7061
70622006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7063
7064 * doc/bison.texinfo: Fix a couple of typos.
7065
70662006-12-08 Bob Rossi <bob@brasko.net>
7067
7068 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
7069 Rename to...
7070 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
7071 update all uses.
7072 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
7073 (yypush_parse): Rename yypvars argument to yyps and remove redundant
7074 local pv.
7075 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
7076 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
7077
70782006-12-07 Bob Rossi <bob@brasko.net>
7079 and Joel Denny <jdenny@ces.clemson.edu>
7080
7081 * data/push.c (yypvarsinit): Change return type from void* to struct
7082 yypvars*. No longer cast to void* on return.
7083 (struct yypvars): Remove yylen since it need not be remembered between
7084 yypushparse invocations.
7085 (yypushparse): Don't copy between yylen and pv->yylen.
7086
70872006-12-05 Bob Rossi <bob@brasko.net>
7088
7089 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
7090 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
7091 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
7092 (struct yypvars): Remove b4_declare_parser_variables.
7093 (yypvarsinit): Remove init code for removed variables.
7094 (global scope): Do not declare b4_declare_parser_variables if
7095 push or pure mode.
7096 (yypushparse): Add b4_declare_parser_variables.
7097 Init new local variables, and remove init code for removed
7098 yypvars variables.
7099 (yyparse): Delete.
7100 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
7101 and yyparse for other modes.
7102 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
7103 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
7104 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
7105 (AT_PURE_LEX_IF): True if pure or push parser.
7106
71072006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
7108
7109 Document Yacc prologue alternatives and default %destructor's and
7110 %printer's as experimental. Don't mention Java yet. Discussed at
7111 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
7112 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
7113 (2.3a): Annotate this entry to say the old forms of these features were
7114 also experimental.
7115 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
7116 Table of Symbols): Say they're experimental. Comment out any mention
7117 of Java (we'll want this back eventually).
7118
71192006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
7120
7121 Support a file name argument to %defines. Deprecate `=' in
7122 %file-prefix, %name-prefix, and %output. Discussed at
7123 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
7124 * NEWS (2.3a+): Mention.
7125 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
7126 form of %defines, and remove `=' from entries for %file-prefix,
7127 %name-prefix, and %output.
7128 * src/parse-gram.y (prologue_declaration): Implement.
7129 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
7130 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
7131 all but one occurrence of %name-prefix.
7132 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
7133 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
7134 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
7135 occurrence of each of %file-prefix and %output. Add check for %defines
7136 with argument.
7137 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
7138 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
7139 Remove the `=' from %output.
7140
71412006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
7142
7143 Don't escape $ in test case titles since Autoconf 2.61 now does that
7144 correctly.
7145 * tests/actions.at (Default %printer and %destructor are not for error
7146 or $undefined): Here.
7147 (Default %printer and %destructor are not for $accept): Here.
7148 * tests/input.at (Invalid $n and @n): Here.
7149
71502006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
7151
7152 Rename <!> to <>. Discussed starting at
7153 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
7154 * NEWS (2.3a+): Update.
7155 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
7156 Update.
7157 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
7158 * src/scan-gram.l (INITIAL): Implement.
7159 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
7160 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
7161 comment.
7162 * tests/actions.at (Default tagless %printer and %destructor,
7163 Default tagged and per-type %printer and %destructor,
7164 Default %printer and %destructor are not for error or $undefined,
7165 Default %printer and %destructor are not for $accept,
7166 Default %printer and %destructor for mid-rule values): Update.
7167 * tests/input.at (Default %printer and %destructor redeclared,
7168 Unused values with default %destructor): Update.
7169
71702006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
7171
7172 Don't let %prec take a nonterminal.
7173 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
7174 token.
7175 * tests/input.at (%prec takes a token): New test checking that %prec
7176 won't take a nonterminal.
7177
71782006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7179
7180 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
7181 it was double-quoted.
7182 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
7183 grammar is maintained with Bison's highest standards.
7184 * src/getargs.c: Fix some typos in Doxygen comments.
7185
71862006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7187
7188 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
7189 later. Reported by Paul Eggert in
7190 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
7191 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
7192 * src/scan-code.l (translate_action): Don't bother invoking
7193 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
7194 (code_scanner_free): Instead of invoking
7195 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
7196 which frees more.
7197 * src/scan-gram.l (gram_scanner_free): Likewise.
7198 * src/scan-skel.l (scan_skel): Likewise.
7199
72002006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
7201
7202 * src/files.c (tr): Change return type to void.
7203 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
7204 has been called previously for the same key.
7205 (muscle_find): Return storage instead of value so that
7206 --enable-gcc-warnings doesn't produce warnings that the return discards
7207 const. aver that the value and storage are the same since storage
7208 could potentially be NULL when value is not.
7209 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
7210 same as 0.
7211
72122006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7213
7214 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
7215 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
7216 us a slightly cleaner distribution, and also works.
7217 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
7218 gnulib changes.
7219
72202006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
7221 and Paul Eggert <eggert@cs.ucla.edu>
7222
7223 Don't let Bison leak memory except when it complains.
7224 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
7225 (spec_defines_file, dir_prefix): Now char *, not const char *,
7226 since they are freed.
7227 * src/files.c: Likewise.
7228 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
7229 Likewise.
7230 (tr): Now operates in-place. All uses changed.
7231 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
7232 values.
7233 (compute_file_name_parts, compute_output_file_names): Don't store
7234 read-only data in variables that will be freed.
7235 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
7236 src_extension, and header_extension.
7237 (output_file_names_free): New public function to free
7238 spec_verbose_file, spec_graph_file, spec_defines_file,
7239 parser_file_name, and dir_prefix.
7240 * src/getargs.c (getargs): Don't store read-only data in variables that
7241 will be freed.
7242 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
7243 (which previously existed but was unused), and quotearg_free.
7244 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
7245 * src/muscle_tab.c: Likewise.
7246 (muscle_entry): Make the value char const *,
7247 and add a new storage member that is char * and can be freed.
7248 (muscle_entry_free): New private function.
7249 (muscle_init): Use it instead of free.
7250 (muscle_insert, muscle_grow): Update and use new storage member.
7251 (muscle_code_grow): Free the string passed to muscle_grow
7252 since it's not needed anymore.
7253 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
7254 add a new `char *code' member.
7255 ("{...}"): Declare semantic type as code.
7256 * src/scan-code.h (translate_rule_action):
7257 (translate_symbol_action, translate_code, translate_action): Return
7258 `char const *' rather than `char *' since external code should not free
7259 these strings.
7260 * src/scan-code.l: Likewise.
7261 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
7262 which is "{...}" in the parser.
7263 * tests/Makefile.am (maintainer-check-valgrind): Set
7264 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
7265 Valgrind.
7266 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
7267 complain.
7268 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
7269 expecting a non-zero exit status sets --leak-check=summary and
7270 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
7271 this case, and we don't want to hear about it.
7272
72732006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7274
7275 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
7276 instead of from the template, to simplify configuration a bit.
7277 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
7278 and m4/wint_t.m4, as they are needed with the latest gnulib.
7279
72802006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7281
7282 Disable unset/unused mid-rule value warnings by default, and recognize
7283 --warnings=midrule-values to enable them. Discussed starting at
7284 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
7285 * NEWS (2.3a+): Mention.
7286 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
7287 warnings): Add entry for midrule-values subargument.
7288 * src/reader.c (symbol_should_be_used): Don't return true just because
7289 the value is a set/used mid-rule value unless
7290 --warnings=midrule-values was specified.
7291 * tests/input.at (Unused values, Unused values before symbol
7292 declarations): Run tests with and without --warnings=midrule-values.
7293
7294 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
7295 than LIST_FREE directly.
7296
72972006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7298
7299 Finish implementing --warnings=error, which should not be implied by
7300 --warnings=all (or by its synonyms -W and --warnings without
7301 subarguments).
7302 * src/complain.c (set_warning_issued): New function to report that
7303 warnings are being treated as errors and to record an error if so.
7304 Invoke...
7305 (warn_at, warn): ... here.
7306 * src/getargs.c (warnings_args, warnings_types): Reorder so that
7307 "error - warnings are errors" does not appear above "all - all of the
7308 above".
7309 (getargs): For -W and --warnings without subarguments, don't let
7310 FLAGS_ARGMATCH set warnings_error in warnings_flag.
7311 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
7312
73132006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7314
7315 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
7316 empty subargument list. For example: `bison --warnings= parser.y'.
7317
73182006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7319
7320 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
7321 the parser header file so that gcc doesn't warn.
7322
73232006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7324
7325 Split the default %destructor/%printer into two kinds: <*> and <!>.
7326 Discussed starting at
7327 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
7328 * NEWS (2.3a+): Mention.
7329 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
7330 previous change today related to mid-rules.
7331 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
7332 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
7333 (TYPE_TAG_ANY): Add as <*>.
7334 (TYPE_TAG_NONE): Add as <!>.
7335 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
7336 for <*> and <!>.
7337 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
7338 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
7339 * src/symlist.c (symbol_list_default_new): Split into tagged and
7340 tagless versions.
7341 (symbol_list_destructor_set, symbol_list_printer_set): Split
7342 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
7343 SYMLIST_DEFAULT_TAGLESS.
7344 * src/symlist.h: Update symbol_list_default*_new prototypes.
7345 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
7346 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
7347 * src/symtab.c (default_destructor, default_destructor_location,
7348 default_printer, default_printer_location): Split each into tagged and
7349 tagless versions.
7350 (symbol_destructor_get, symbol_destructor_location_get,
7351 symbol_printer_get, symbol_printer_location_get): Implement tagged
7352 default and tagless default cases.
7353 (default_destructor_set, default_printer_set): Split each into tagged
7354 and tagless versions.
7355 * src/symtab.h: Update prototypes.
7356 * tests/actions.at (Default %printer and %destructor): Rename to...
7357 (Default tagless %printer and %destructor): ... this, and extend.
7358 (Per-type %printer and %destructor): Rename to...
7359 (Default tagged and per-type %printer and %destructor): ... this, and
7360 extend.
7361 (Default %printer and %destructor for user-defined end token): Extend.
7362 (Default %printer and %destructor are not for error or $undefined):
7363 Update.
7364 (Default %printer and %destructor are not for $accept): Update.
7365 (Default %printer and %destructor for mid-rule values): Extend.
7366 * tests/input.at (Default %printer and %destructor redeclared): Extend.
7367 (Unused values with default %destructor): Extend.
7368
73692006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7370
7371 Don't apply the default %destructor/%printer to an unreferenced midrule
7372 value. Mentioned at
7373 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
7374 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
7375 like $@n instead of just @n so that the default %destructor/%printer
7376 logic doesn't see them as user-defined symbols.
7377 (symbol_is_dummy): Check for both forms of the name.
7378 * src/reader.c (packgram): Remove the `$' from each midrule symbol
7379 name for which the midrule value is referenced in any action.
7380 * tests/actions.at (Default %printer and %destructor for mid-rule
7381 values): New test.
7382 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
7383 for change to dummy symbol names.
7384
73852006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7386
7387 Warn about unset midrule $$ if the corresponding $n is used.
7388 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
7389 $n usage.
7390 (packgram): Before invoking grammar_rule_check on any rule, make sure
7391 all actions have already been scanned in order to set `used' flags.
7392 Otherwise, checking that a midrule's $$ is set will not always work
7393 properly because the midrule check must forward-reference the midrule's
7394 parent rule.
7395 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
7396 warning.
7397
73982006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7399
7400 More improvements to the documentation of the prologue alternatives:
7401 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
7402 Bison manual.
7403 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
7404 some text to clarify the relative importance of the new directives and
7405 to show how these directives may be viewed as code labels.
7406
74072006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
7408
7409 Similar to the recently removed %before-header, add %code-top as the
7410 alternative to the pre-prologue. Mentioned at
7411 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
7412 Also, let the prologue alternatives appear in the grammar section.
7413 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
7414 (prologue_declaration): Move the existing prologue alternatives to...
7415 (grammar_declaration): ... here and add %code-top.
7416 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
7417
7418 Clean up and extend documentation for the prologue alternatives.
7419 * NEWS (2.3a+): Describe prologue alternatives.
7420 * doc/bison.texinfo (Prologue): Move discussion of prologue
7421 alternatives to...
7422 (Prologue Alternatives): ... this new section, and extend it to discuss
7423 all 4 directives in detail.
7424 (Table of Symbols): Clean up discussion of prologue alternatives and
7425 add %code-top.
7426
74272006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7428
7429 DJGPP specific issues.
7430
7431 * djgpp/config.bat: config.hin has been moved to lib. Adjust
7432 config.bat accordingly.
7433 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
7434 * djgpp/config.site: Likewise.
7435
74362006-10-16 Paolo Bonzini <bonzini@gnu.org>
7437
7438 Replace %*-header with %provides, %requires, %code. See discussion at
7439 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
7440
7441 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
7442 (b4_user_start_header): Remove.
7443 * data/glr.c: Use new macros instead of b4_*start_header
7444 and b4_*end_header.
7445 * data/glr.cc: Likewise.
7446 * data/lalr1.cc: Likewise.
7447 * data/push.c: Likewise.
7448 * data/yacc.c: Likewise.
7449
7450 * doc/bison.texinfo: Remove %before-header, rename
7451 %{start,end,after}-header to %requires, %provides, %code.
7452
7453 * src/parse-gram.y: Likewise (also rename token names accordingly).
7454 * src/scan-gram.l: Likewise.
7455 * tests/actions.at: Likewise.
7456
74572006-10-14 Paul Eggert <eggert@cs.ucla.edu>
7458
7459 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
7460 Problem reported by Joel E. Denny.
7461
74622006-10-14 Jim Meyering <jim@meyering.net>
7463
7464 (Sync from coreutils.)
7465 Work also when the working directory (with e.g. coreutils sources)
7466 is version controlled with git, rather than CVS.
7467 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
7468 rather than CVS.
7469 In messages and comments, say e.g., "checked-out sources",
7470 rather than "CVS sources".
7471 (version_controlled_file): New function. Work for git as well as
7472 for CVS. Don't use grep's -q option.
7473 (slurp): Call it here, in place of CVS-specific code.
7474
74752006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
7476
7477 Fix testsuite for ./configure --enable-gcc-warnings:
7478 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
7479 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
7480 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
7481 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
7482 * test/regression.at (Diagnostic that expects two alternatives):
7483 Likewise.
7484
74852006-10-12 Paul Eggert <eggert@cs.ucla.edu>
7486
7487 * bootstrap.conf (gnulib_modules): Add config-h.
7488 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
7489 worry about HAVE_CONFIG_H.
7490 * lib/abitset.c: Likewise.
7491 * lib/bitset.c: Likewise.
7492 * lib/bitset_stats.c: Likewise.
7493 * lib/bitsetv-print.c: Likewise.
7494 * lib/bitsetv.c: Likewise.
7495 * lib/ebitset.c: Likewise.
7496 * lib/get-errno.c: Likewise.
7497 * lib/lbitset.c: Likewise.
7498 * lib/subpipe.c: Likewise.
7499 * lib/timevar.c: Likewise.
7500 * lib/vbitset.c: Likewise.
7501 * lib/bitset.c: Include "bitset.h" first, to test interface.
7502 * lib/bitset_stats.c: Include "bitset_stats.h" first.
7503 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
7504 * lib/bitsetv.c: Include "bitsetv.h" first.
7505 * lib/get-errno.c: Include "get-errno.h" first.
7506 * m4/.cvsignore: Add config-h.m4.
7507 * tests/actions.at (Default %printer and %destructor for ...):
7508 Adjust expected line numbers in output to reflect removal of #if
7509 HAVE_CONFIG_H lines.
7510 * tests/glr-regression.at (Missed %merge type warnings when ...):
7511 Likewise.
7512 * tests/regression.at (Braced code in declaration in rules section):
7513 Likewise.
7514 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
7515 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
7516 Include <config.h> unconditionally.
7517
7518 * bootstrap: Sync from coreutils, as follows:
7519
7520 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
7521
7522 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
7523 variable was sometimes used without being initialized. This
7524 messed up the installation of the INSTALL file in some cases.
7525
7526 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
7527
7528 * bootstrap (usage, main program, symlink_to_gnulib): Add option
7529 --copy. Inspired by a suggestion from Bruno Haible.
7530
7531 2006-10-03 Jim Meyering <jim@meyering.net>
7532
7533 * bootstrap: Undo last change to this file, since now gnulib-tool
7534 sticks with the automake default in generating dependencies.
7535
75362006-10-12 Paul Eggert <eggert@cs.ucla.edu>
7537
7538 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
7539 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
7540
7541 * doc/bison.1: Add copyright notice.
7542
7543 * data/glr.c: Don't include <stdarg.h>; not used.
7544
7545 * NEWS: The -g and --graph options now output graphs in Graphviz
7546 DOT format, not VCG format.
7547 * doc/bison.1: Likewise.
7548 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
7549 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
7550 of this change in
7551 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
7552 * TODO: Remove Graphviz entry.
7553 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
7554 remove vcg.c, vcg.h, vcg_defaults.h.
7555 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
7556 * src/graphviz.c, src/graphviz.h: New files.
7557 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
7558 * src/files.h: Make comment more generic.
7559 * src/main.c (main): Likewise.
7560 * src/print_graph.h: Likewise.
7561 * src/getargs.c (usage): Make usage description more generic.
7562 * src/print_graph.c: Include graphviz.h rather than vcg.h.
7563 (static_graph, fgraph): Remove. All uses changed to pass
7564 arguments instead of sharing a static var.
7565 (print_core, print_actions, print_state, print_graph):
7566 Output graphviz format rather than VCG format.
7567 * tests/.cvsignore: Remove *.vcg; add *.dot.
7568 * tests/output.at: Expect *.dot files, not *.vcg files.
7569
7570 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
7571 accommodates the 2006-10-08 change.
7572
75732006-10-11 Bob Rossi <bob@brasko.net>
7574
7575 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
7576 (b4_yyssa, b4_yyerror_range): New macros.
7577 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
7578 (yypvarsinit): Remove init of removed fields.
7579 (yypushparse): Remove use of removed fields; use new macros instead.
7580
75812006-10-11 Paul Eggert <eggert@cs.ucla.edu>
7582
7583 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
7584 in a push parser. Reindent slightly to match yacc.c better.
7585
75862006-10-11 Bob Rossi <bob@brasko.net>
7587
7588 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
7589 yymsg_alloc fields.
7590 (yypvarsinit, yypushparse): Remove init of removed fields.
7591 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
7592
75932006-10-09 Paul Eggert <eggert@cs.ucla.edu>
7594
7595 * THANKS: Add Paolo Bonzini and Bob Rossi.
7596
75972006-10-08 Paolo Bonzini <bonzini@gnu.org>
7598
7599 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
7600 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
7601 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
7602 b4_define_user_cde and uses): Remove.
7603 (b4_comment, b4_prefix, b4_sync_start): New.
7604 * data/bison.m4: New file, with most of the content removed from c.m4.
7605 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
7606 * src/output.c (output_skeleton): Pass bison.m4.
7607 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
7608 only if specified.
7609
76102006-10-05 Paul Eggert <eggert@cs.ucla.edu>
7611
7612 Fix test failure reported by Tom Lane in
7613 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
7614 and try to make such failures easier to catch in the future.
7615 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
7616 that's now the caller's responsibility.
7617 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
7618 Set yychar = YYEOF if it's negative.
7619 * tests/actions.at (yylex): Abort if asked to read past EOF.
7620 * tests/conflicts.at (yylex): Likewise.
7621 * tests/cxx-type.at (yylex): Likewise.
7622 * tests/glr-regression.at (yylex): Likewise.
7623 * tests/input.at (yylex): Likewise.
7624 * tests/regression.at (yylex): Likewise.
7625 * tests/torture.at (yylex): Likewise.
7626
76272006-10-01 Paul Eggert <eggert@cs.ucla.edu>
7628
7629 Fix problems with translating English-language diagnostics.
7630 * bootstrap: Fix bug introduced in recent bootstrap changes, with
7631 respect to bison-runtime pot generation. The YY_ stuff
7632 wasn't being captured.
7633 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
7634 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
7635 * runtime-po/POTFILES.in: Add data/push.c.
7636
76372006-09-29 Paul Eggert <eggert@cs.ucla.edu>
7638
7639 Merge bootstrap changes from coreutils.
7640
7641 2006-09-28 Jim Meyering <jim@meyering.net>
7642
7643 Automatically generated dependencies are important even
7644 when all of the sources in a directory come from gnulib.
7645 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
7646 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
7647
7648 2006-09-23 Jim Meyering <jim@meyering.net>
7649
7650 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
7651
7652 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7653
7654 * bootstrap: Add support for --force.
7655 (usage): New function. Describe usage less tersely.
7656 (CVS_only_file): New var.
7657
76582006-09-21 Paul Eggert <eggert@cs.ucla.edu>
7659
7660 * data/push.c (YYPUSH_MORE): Make it an enum instead.
7661 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
7662 Adjust white space and comments to match GNU style better.
7663
76642006-09-20 Bob Rossi <bob@brasko.net>
7665
7666 * data/push.c (yyresult_get): Remove function.
7667 (YYPUSH_MORE): Add #define.
7668 (yypushparse): Modify return value.
7669
76702006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7671
7672 * stamp-h.in: Remove; no longer needed.
7673 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
7674 Remove config.h, config.hin, intl (no longer created).
7675 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
7676 stamp-h1.
7677
7678 Sync bootstrap from coreutils, as follows:
7679
7680 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
7681
7682 * bootstrap (symlink_to_gnulib): New function.
7683 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
7684 to copies-of-gnulib.
7685 (cp_mark_as_generated, slurp, gnulib_files):
7686 Avoid making a copy if it's the same as the old version.
7687 (gnulib_files): Add support for this variable (used by Bison).
7688
76892006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7690
7691 * src/getargs.c (usage): Rework to use conventions similar to
7692 coreutils, to make translation a bit easier and the code a bit
7693 smaller. Problem reported by Tim Van Holder.
7694
76952006-09-15 Paul Eggert <eggert@cs.ucla.edu>
7696
7697 Use some of gnulib's new modules, taken from coreutils.
7698
7699 * bootstrap: Sync from coreutils, except add support for gnulib_files.
7700 * bootstrap.conf: New file.
7701 (gnulib_modules): Add configmake, inttypes, unistd.
7702 (XGETTEXT_OPTIONS): Add complain, complain_at,
7703 fatal, fatal_at, warn, warn_at, unexpected_end.
7704 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
7705 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
7706 (gl_EARLY): Add.
7707 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
7708 (gl_INIT): Add
7709 (GNULIB_AUTOCONF_SNIPPET): Remove.
7710 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
7711 the pickiest.
7712 * lib/.cvsignore: Add inttypes_.h.
7713 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
7714 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
7715 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
7716 no-longer-necessary initializations.
7717 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
7718 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
7719 use the unistd module.
7720 * src/system.h: Likewise.
7721 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
7722 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
7723 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
7724 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
7725 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
7726 * src/system.h: Include inttypes.h unconditionally, now that we
7727 use the inttypes module. Don't bother to include stdint.h, since
7728 inttypes.h now does that for us.
7729 (LOCALEDIR): Remove, now that we use the configmake module.
7730 * src/getargs.c: Include configmake.h.
7731 * src/main.c: Likewise.
7732 * src/output.c: Likewise.
7733 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
7734 not from $abs_top_builddir, since config.h moved.
7735
7736
7737 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
7738 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
7739
7740 * src/parse-gram.y (symbol_declaration): Don't put statements
7741 before declarations; it's not portable to C89.
7742 * src/scan-code.l (handle_action_at): Likewise.
7743
7744 * src/scan-code.l: Always initialize braces_level; the old code
7745 left it uninitialized and therefore had undefined behavior.
7746
7747 Don't attempt to redefine 'assert', since it runs afoul of
7748 systems where standard headers (mistakenly) include <assert.h>.
7749 Instead, define and use our own alternative, called 'aver'.
7750 * src/reader.c: Don't include assert.h, since we no longer
7751 use assert.
7752 * src/scan-code.l: Likewise.
7753 * src/system.h (assert): Remove, replacing with....
7754 (aver): New function, taking a bool arg. All uses changed.
7755 * src/tables.c (pack_vector): Ensure that aver arg is bool,
7756 not merely an integer.
7757
77582006-09-15 Bob Rossi <bob@brasko.net>
7759
7760 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
7761 * data/c.m4 (YYPUSH): New.
7762 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
7763 * src/getargs.c (push_parser): New var.
7764 * src/getargs.h (push_parser): New declaration.
7765 * src/output.c (prepare): Add macro insertion of `push_flag'.
7766 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
7767 (prologue_declaration): Parse %push-parser.
7768 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
7769 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
7770 list of removed lines from the traces observed.
7771 (AT_CHECK_CALC_LALR): Added push parser tests.
7772
77732006-09-13 Paul Eggert <eggert@cs.ucla.edu>
7774
7775 * NEWS: Version 2.3a.
7776 * configure.ac (AC_INIT): Likewise.
7777
7778 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
7779 "#define YYSTYPE int" that caused "make maintainer-check" to fail
7780 due to header ordering dependencies. I don't know why the #define
7781 was there.
7782
7783 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
7784 runtime cost when YYDEBUG is not defined, and so that some tests
7785 that used to fail now work. Problem and initial suggestion by
7786 Paolo Bonzini.
7787 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
7788 * data/glr.cc (b4_parser_class_name):
7789 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
7790 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
7791 (yydebug_) [YYDEBUG]: New member.
7792 (yycdebug_): Now defined only if YYDEBUG.
7793 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
7794 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
7795 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
7796 if YYYDEBUG.
7797 (debug_stream, set_debug_stream, debug_level, set_debug_level):
7798 Define only if YYDEBUG.
7799 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
7800 set_debug_level.
7801 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
7802 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
7803 AT_CHECK_CALC_GLR_CC that are working now.
7804
78052006-09-12 Paul Eggert <eggert@cs.ucla.edu>
7806
7807 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
7808 We don't need them in glr.cc, and glr.c defines them.
7809 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
7810 assumes that defining it to anything is the same as defining
7811 it to 1. Problem reported by Paolo Bonzini.
7812
78132006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
7814
7815 * data/c.m4 (b4_null, b4_case): Define.
7816 * src/output.c (prepare_symbols): Use b4_null.
7817 (user_actions_output): Use b4_case.
7818
78192006-09-11 Paul Eggert <eggert@cs.ucla.edu>
7820
7821 * data/glr.c (b4_shared_declarations): Put start-header first,
7822 before any #includes that we generate, so that feature-test
7823 macros work. Problem reported by Michael Deutschmann in
7824 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
7825 * data/lalr1.cc: Likewise.
7826 * doc/bison.texinfo (Prologue): Document that feature-test macros
7827 should be defined before any Bison declarations.
7828 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
7829 that depend on location.hh after, not before, Bison decls, since
7830 we now include location.hh after the first user prologue.
7831
7832 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
7833 Sander Brandenburg in
7834 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
7835 Also, fix minor white space and comment issues.
7836 (Prologue): Mention that it's better to define feature-test macros
7837 before Bison declarations. Problem reported by Michael Deutschmann.
7838
7839 * README-cvs: Fix typo: "&" should be "&&". Problem reported
7840 by Jim Meyering.
7841 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
7842 This adjusts to recent gnulib changes.
7843
78442006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
7845
7846 Finish implementation of per-type %destructor/%printer. Discussed
7847 starting at
7848 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
7849 and
7850 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
7851 * NEWS (2.3+): Add a description of this feature to the default
7852 %destructor/%printer description.
7853 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
7854 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
7855 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
7856 list node contains a semantic type.
7857 * src/symtab.c, src/symtab.h: Extend with a table that associates
7858 semantic types with their %destructor's and %printer's.
7859 (semantic_type_from_uniqstr, semantic_type_get,
7860 semantic_type_destructor_set, semantic_type_printer_set): New functions
7861 composing the public interface of that table.
7862 (symbol_destructor_get, symbol_destructor_location_get,
7863 symbol_printer_get, symbol_printer_location_get): If there's no
7864 per-symbol %destructor/%printer, look up the per-type before trying
7865 the default.
7866 * tests/actions.at (Per-type %printer and %destructor): New test case.
7867 * tests/input.at (Default %printer and %destructor redeclared):
7868 Extend to check that multiple occurrences of %symbol-default in a
7869 single %destructor/%printer declaration is an error.
7870 (Per-type %printer and %destructor redeclared, Unused values with
7871 per-type %destructor): New test cases.
7872
78732006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
7874
7875 Require default %destructor/%printer to be declared using
7876 %symbol-default instead of an empty symbol list, and start working on
7877 new per-type %destructor/%printer. Discussed at
7878 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
7879 * NEWS (2.3+): Add %symbol-default to example.
7880 * bison.texinfo (Freeing Discarded Symbols): Likewise.
7881 (Table of Symbols): Add entry for %symbol-default.
7882 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
7883 (generic_symlist, generic_symlist_item): New nonterminals for creating
7884 a list in which each item is a symbol, semantic type, or
7885 %symbol-default.
7886 (grammar_declaration): Use generic_symlist in %destructor and %printer
7887 declarations instead of symbols.1 or an empty list.
7888 (symbol_declaration, precedence_declaration, symbols.1): Update actions
7889 for changes to symbol_list.
7890 * src/reader.c: Update for changes to symbol_list.
7891 * src/scan-code.l: Likewise.
7892 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
7893 * src/symlist.c, src/symlist.h: Extend such that a list node may
7894 represent a semantic type or a %symbol-default in addition to just an
7895 ordinary symbol. Add switched functions for setting %destructor's and
7896 %printer's.
7897 * tests/actions.at, tests/input.at: Add %symbol-default to all default
7898 %destructor/%printer declarations.
7899
79002006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
7901
7902 Whether the default %destructor/%printer applies to a particular symbol
7903 isn't a question of whether the user *declares* that symbol (in %token,
7904 for example). It's a question of whether the user by any means
7905 *defines* the symbol at all (by simply using a char token, for
7906 example). $end is defined by Bison whereas any other token with token
7907 number 0 is defined by the user. The error token is always defined by
7908 Bison regardless of whether the user declares it with %token, but we
7909 may one day let the user define error as a nonterminal instead.
7910 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
7911 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
7912 the meaning of "user-defined".
7913 * tests/actions.at (Default %printer and %destructor for user-declared
7914 end token): Rename to...
7915 (Default %printer and %destructor for user-defined end token): ...
7916 this.
7917
7918 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
7919 computation of whether to apply the default, don't maintain a list of
7920 every Bison-defined symbol. Instead, just check for a first character
7921 of '$', which a user symbol cannot have, and check for the error token.
7922
79232006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
7924
7925 Don't apply the default %destructor or %printer to the error token,
7926 $undefined, or $accept. This change fits the general rule that the
7927 default %destructor and %printer are only for user-declared symbols,
7928 and it solves several difficulties that are described in the new test
7929 cases listed below.
7930 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
7931 * tests/actions.at (Default %printer and %destructor are not for error
7932 or $undefined, Default %printer and %destructor are not for $accept):
7933 New test cases.
7934
79352006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
7936
7937 Allow %start after the first rule.
7938 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
7939 when parsing the first rule.
7940 (check_and_convert_grammar): Search for it here after all grammar
7941 declarations have been parsed. Skip midrules, which have dummy LHS
7942 nonterminals.
7943 * src/symtab.c (symbol_is_dummy): New function.
7944 * src/symtab.h (symbol_is_dummy): Declare it.
7945 * tests/input.at (%start after first rule): New test.
7946
79472006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
7948
7949 Redo some of the previous commit: add back the ability to use
7950 non-aliased/undeclared string literals since it might be useful to
7951 those declaring %token-table.
7952 * src/reader.c (check_and_convert_grammar): Undo changes in previous
7953 commit: don't worry about complaints from symbols_pack.
7954 * src/symtab.c (symbol_new, symbol_class_set,
7955 symbol_check_alias_consistency): Undo changes in previous commit: count
7956 each string literal as a new symbol and token, assign it a symbol
7957 number, and don't complain about non-aliased string literals.
7958 (symbols_pack): Since symbol_make_alias still does not decrement symbol
7959 and token counts but does still set aliased tokens to the same number,
7960 symbol_pack_processor now leaves empty slots in the symbols array.
7961 Remove those slots.
7962 * tests/regression.at (Undeclared string literal): Remove test case
7963 added in previous commit since non-aliased string literals are allowed
7964 again.
7965 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
7966 remove unnecessary string literal declarations.
7967 * tests/sets.at (Firsts): Likewise.
7968
79692006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
7970
7971 Don't allow an undeclared string literal, but allow a string literal to
7972 be used before its declaration.
7973 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
7974 symbols_pack complained.
7975 * src/symtab.c (symbol_new): Don't count a string literal as a new
7976 symbol.
7977 (symbol_class_set): Don't count a string literal as a new token, and
7978 don't assign it a symbol number since symbol_make_alias does that.
7979 (symbol_make_alias): It's not necessary to decrement the symbol and
7980 token counts anymore. Don't assume that an alias declaration occurs
7981 before any uses of the identifier or string, and thus don't assert that
7982 one of them has the highest symbol number so far.
7983 (symbol_check_alias_consistency): Complain if there's a string literal
7984 that wasn't declared as an alias.
7985 (symbols_pack): Bail if symbol_check_alias_consistency failed since
7986 symbol_pack asserts that every token has been assigned a symbol number
7987 although undeclared string literals have not.
7988 * tests/regression.at (String alias declared after use, Undeclared
7989 string literal): New test cases.
7990 (Characters Escapes, Web2c Actions): Declare string literals as
7991 aliases.
7992 * tests/sets.at (Firsts): Likewise.
7993
79942006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
7995
7996 In the grammar scanner, STRING_FINISH unclosed constructs and return
7997 them to the parser in order to improve error messages.
7998 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
7999 SC_BRACED_CODE, SC_PROLOGUE): Implement.
8000 * tests/input.at (Unclosed constructs): New test case.
8001 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
8002 seen.
8003
8004 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
8005 unused global.
8006
80072006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
8008
8009 Handle string aliases for character tokens correctly.
8010 * src/symtab.c (symbol_user_token_number_set): If the token has an
8011 alias, check and set its alias's user token number instead of its own,
8012 which is set to indicate the alias. Previously, every occurrence of
8013 the character token in the grammar overwrote that alias indicator with
8014 the character code.
8015 * tests/input.at (String aliases for character tokens): New test.
8016
80172006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
8018
8019 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
8020
80212006-08-11 Paul Eggert <eggert@cs.ucla.edu>
8022
8023 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
8024 to prevent failures when building on older platforms.
8025 Check for autopoint failure.
8026 Set XGETTEXT_OPTIONS to values that check for C format strings,
8027 so that translators are warned about them (this also helps
8028 prevent core dumps).
8029
8030 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
8031 function, since it simplifies our code a bit.
8032
8033 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
8034 rather than -W, so we don't get bogus warnings about sign comparisons.
8035 Add -Wpointer-arith, since that warning is useful (it reports code
8036 that does not conform to C89 and that some compilers reject).
8037 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
8038 since it's no longer needed.
8039
80402006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
8041
8042 Clean up scanners a bit.
8043 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
8044 definitions so gcc won't warn when obstack_for_string is unused.
8045 * src/scan-code.l: config.h and system.h are already #include'd by
8046 scan-code-c.c, so get rid of them here.
8047 * src/scan-gram.l: Likewise.
8048 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
8049 definitions rather than duplicating the rest of it.
8050 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
8051
80522006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
8053
8054 Suppress signed/unsigned comparison warnings for yycheck.
8055 * data/c.m4 (b4_safest_int_type): New macro.
8056 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
8057 a signed int type, cast it to b4_safest_int_type first.
8058 * data/yacc.c: Likewise.
8059 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
8060 also overwritten.
8061
80622006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
8063
8064 * doc/bison.texinfo: Fix some typos.
8065
80662006-08-02 Paul Eggert <eggert@cs.ucla.edu>
8067
8068 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
8069 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
8070
8071 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
8072 the latest gnulib does this a different way.
8073 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
8074 translation was patched, so stop omitting it.
8075
80762006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8077
8078 Enable declaration of default %printer/%destructor. Make the parser
8079 use these for all user-declared grammar symbols for which the user does
8080 not declare a specific %printer/%destructor. Thus, the parser uses it
8081 for token 0 if the user declares it but not if Bison generates it as
8082 $end. Discussed starting at
8083 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
8084 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
8085 and
8086 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
8087 * NEWS (2.3+): Mention.
8088 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
8089 declare a %destructor for a mid-rule's semantic value. It's just
8090 impossible to declare one specific to it.
8091 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
8092 code. Describe default %destructor form.
8093 * src/parse-gram.y (grammar_declaration): Parse default
8094 %printer/%destructor declarations.
8095 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
8096 and symbol_destructor_location_get rather than accessing the destructor
8097 and destructor_location members of struct symbol.
8098 (symbol_printers_output): Likewise but for %printer's.
8099 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
8100 again.
8101 * src/symtab.c (default_destructor, default_destructor_location,
8102 default_printer, default_printer_location): New static global
8103 variables to record the default %destructor and %printer.
8104 (symbol_destructor_get, symbol_destructor_location_get,
8105 symbol_printer_get, symbol_printer_location_get): New functions to
8106 compute the appropriate %destructor and %printer for a symbol.
8107 (default_destructor_set, default_printer_set): New functions to set the
8108 default %destructor and %printer.
8109 * src/symtab.h: Prototype all those new functions.
8110 * tests/actions.at (Default %printer and %destructor): New test to
8111 check that the right %printer and %destructor are called, that they're
8112 not called for $end, and that $$ and @$ work correctly.
8113 (Default %printer and %destructor for user-declared end token): New
8114 test to check that the default %printer and %destructor are called for
8115 a user-declared end token.
8116 * tests/input.at (Default %printer and %destructor redeclared, Unused
8117 values with default %destructor): New tests to check related grammar
8118 warnings and errors.
8119
81202006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8121
8122 Clean up handling of %destructor for the end token (token 0).
8123 Discussed starting at
8124 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
8125 and
8126 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
8127
8128 Make the skeletons consistent in how they pop the end token and invoke
8129 its %destructor.
8130 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
8131 state, which has token number 0, since this would invoke the
8132 %destructor for the end token.
8133 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
8134 until after shifting the end token, or else it won't be popped.
8135 * data/yacc.c (yyparse): Likewise.
8136
8137 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
8138 it's the end token. Upon termination, destroy an unshifted lookahead
8139 even when it's the end token.
8140 * data/lalr1.cc (yy::parser::parse): Likewise.
8141 * data/yacc.c (yyparse): Likewise.
8142
8143 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
8144 value warnings for the end token when the user gives the end token a
8145 %destructor.
8146
8147 * tests/actions.at (Printers and Destructors): Test all the above.
8148
81492006-07-24 Paul Eggert <eggert@cs.ucla.edu>
8150
8151 Update to latest gnulib and gettext versions.
8152 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
8153 Add fopen-safer.
8154 (gnulib_files): Add m4/warning.m4. Don't worry about files
8155 overwritten by autopoint.
8156 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
8157 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
8158 rejects them.
8159 Don't use autoreconf; instead, invoke autopoint etc. by hand,
8160 so that we can remove the intl files at a better time.
8161 (intl_files_to_remove): Remove aclocal.m4, since it gets
8162 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
8163 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
8164 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
8165 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
8166 Remove datarootdir hack; no longer needed.
8167 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
8168 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
8169 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
8170 strdup.h.
8171 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
8172 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
8173
81742006-07-20 Paul Eggert <eggert@cs.ucla.edu>
8175
8176 * bootstrap: Adjust to today's change to gnulib-tool by invoking
8177 it with --assume-autoconf='latest-stable'.
8178
81792006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
8180
8181 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
8182 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
8183 YYSTYPE' and `{'.
8184 * src/muscle_tab.h (muscle_grow): Replace the header comments with
8185 those from muscle_tab.c since the old ones are misleading.
8186
81872006-07-13 Akim Demaille <akim@epita.fr>
8188
8189 Support %define "KEY" {VALUE}.
8190 * src/scan-code.h, src/scan-code.l (translate_action)
8191 (translate_rule_action, translate_symbol_action, translate_code):
8192 Return char *, not const char *.
8193 * src/parse-gram.y (declaration): Rename as...
8194 (prologue_declaration): this.
8195 (string_content): Remove this nonterminal, use STRING.
8196 (braceless, content, content.opt): New nonterminal.
8197 Use them.
8198 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
8199 as value.
8200 * src/scan-gram.l (getargs.h): Don't include it.
8201
82022006-07-12 Paul Eggert <eggert@cs.ucla.edu>
8203
8204 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
8205 rather than a for-loop that declares a local bool variable. This
8206 should work around a compatibility problem with a Cray x1e C++
8207 compiler reported by Hung Nguyen in
8208 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
8209 The for-loop was introduced in the 2004-11-17 change but I don't
8210 know why it was needed.
8211
82122006-07-12 Akim Demaille <akim@epita.fr>
8213
8214 * data/c.m4: Comment changes.
8215
82162006-07-10 Akim Demaille <akim@lrde.epita.fr>
8217
8218 * src/complain.c (error_message, ERROR_MESSAGE): New.
8219 To factor...
8220 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
8221 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
8222
82232006-07-09 Paul Eggert <eggert@cs.ucla.edu>
8224
8225 * NEWS: Instead of %union, you can define and use your own union type
8226 YYSTYPE if your grammar contains at least one <type> tag.
8227 Your YYSTYPE need not be a macro; it can be a typedef.
8228 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
8229 (Union Decl, Decl Summary): Document this.
8230 * data/glr.c (YYSTYPE): Implement this.
8231 * data/glr.cc (YYSTYPE): Likewise.
8232 * data/lalr1.cc (YYSTYPE): Likewise.
8233 * data/yacc.c (YYSTYPE): Likewise.
8234 * src/output.c (prepare): Output tag_seen_flag.
8235 * src/parse-gram.y (declaration, grammar_declaration):
8236 Use 'union_seen' rather than 'typed' to determine whether
8237 %union has been seen, since grammars can now be typed without
8238 %union.
8239 (symbol_declaration, type.opt, symbol_def):
8240 Keep track of whether a tag has been seen.
8241 * src/reader.c (union_seen, tag_seen): New vars.
8242 (typed): remove.
8243 * src/reader.h (union_seen, tag_seen, typed): Likewise.
8244 * src/scan-code.l (untyped_var_seen): New variable.
8245 (handle_action_dollar): Adjust to above changes.
8246 (handle_action_dollar, handle_action_at):
8247 Improve overflow checking for outlandish numbers.
8248 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
8249 avoid new diagnostics generated by above changes.
8250 * tests/regression.at (YYSTYPE typedef): Add test to check
8251 for type tags without %union.
8252
8253 * src/symlist.c (symbol_list_length): Return int, not unsigned
8254 int, since callers expect int. This may need to get revisited
8255 once we have proper integer overflow checking.
8256
8257 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
8258 object is now static.
8259
8260 * src/getargs.c (flags_argmatch): Return void, not int,
8261 to pacify ./configure --enable-gcc-warnings.
8262
8263 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
8264 since last_string is already defined to FLEX_PREFIX (last_string).
8265
82662006-07-09 Akim Demaille <akim@lrde.epita.fr>
8267
8268 Implement --warnings/-W.
8269 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
8270 replaced by...
8271 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
8272 Adjust callers.
8273 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
8274 (warnings_args, warnings_types): New.
8275 (getargs, short_options, long_options): Accept -W/--warnings.
8276 Sort the options by alphabetical order, upper case letter right
8277 before its lower case.
8278
82792006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
8280
8281 Change %merge result type clash warnings to errors. Discussed at
8282 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
8283 * src/reader.c (record_merge_function_type): Use complain_at.
8284 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8285 declared later): Update test case results.
8286
82872006-07-09 Akim Demaille <akim@lrde.epita.fr>
8288
8289 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
8290 to be in alphabetical order.
8291 (trace_args): Spelling fixes.
8292
82932006-07-09 Paul Eggert <eggert@cs.ucla.edu>
8294
8295 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
8296 so they don't collide with user-defined macros.
8297 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
8298 this was never guaranteed, and now that we're using gnulib stdint,
8299 which defines int_fast16_t to long int, the problem is exposed.
8300
83012006-07-08 Paul Eggert <eggert@cs.ucla.edu>
8302
8303 * data/c.m4 (b4_basename): Simplify a bit, since we don't
8304 need the full POSIX semantics (and weren't implementing them
8305 anyway).
8306
8307 Adjust to Autoconf 2.60 and today's gnulib.
8308 * bootstrap (gnulib_modules): Add stdint.
8309 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
8310 no longer copies it.
8311 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
8312 since stdint needs the former and wcwidth (which is now required
8313 by mbswidth) needs the latter.
8314 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
8315 work around a compatibility glitch between gettext 0.14.6 and
8316 Autoconf 2.60.
8317 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
8318 Do not check for uintptr_t, since new stdint module does the right
8319 thing.
8320 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
8321 Add stdint.h, stdint_.h, wcwidth.h.
8322 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
8323 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
8324 stdint.m4, wchar_t.m4, wcwidth.m4.
8325 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
8326 usual order for ../lib/*.h files.
8327 (file_name_split): Use last_component, not base_name, to adjust
8328 to gnulib changes.
8329 * src/parse-gram.h: Include <strverscmp.h> in the usual order
8330 for ../lib/*.h files.
8331 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
8332 Define unconditionally, since we now assume the stdint module.
8333 * src/scan-skel.l: Include <dirname.h>.
8334 (BASE_QPUTS): Use last_component, not base_name.
8335 * src/system.h: Include <unlocked-io.h> in the usual order
8336 for ../lib/*.h files. Include <stdint.h> unconditionally,
8337 since we now use the stdint module.
8338 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
8339 HAVE_UINTPTR_T, since we now use the stdint module.
8340 (base_name): Remove decl, since files now include <dirname.h>
8341 to get the decl.
8342
83432006-07-08 Akim Demaille <akim@lrde.epita.fr>
8344
8345 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
8346 New, default to 1.
8347 * data/yacc.c, data/glr.c, data/location.cc: Use them.
8348 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
8349 default.
8350 * tests/calc.at: Adjust.
8351
83522006-07-08 Akim Demaille <akim@lrde.epita.fr>
8353
8354 * data/c.m4 (b4_basename): New.
8355 (b4_syncline): Also output the location of its invocation (from
8356 the skeleton).
8357 (b4_user_action, b4_define_user_action, b4_user_actions)
8358 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
8359 (b4_user_stype): New.
8360 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
8361
83622006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8363
8364 In the grammar file, the first column is 1 not 0 on the first line as
8365 on every other line.
8366 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
8367 * tests/input.at (Torturing the Scanner): Update output.
8368
8369 * src/scan-gram.l (scanner_cursor): Declare it static.
8370
83712006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8372
8373 In warnings, say "previous declaration" rather than "first
8374 declaration".
8375 * src/symtab.c (redeclaration): Do that here.
8376 * src/reader.c (record_merge_function_type): In the case of a result
8377 type clash, report the previous declaration rather than the very first
8378 one in the grammar file.
8379 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8380 declared later): Add a third declaration to check this behavior.
8381 * tests/input.at (Incompatible Aliases): Update output.
8382
83832006-06-27 Akim Demaille <akim@epita.fr>
8384
8385 * doc/Doxyfile.in: New.
8386 * doc/Makefile.am: Use it.
8387 * src/lalr.h, src/symtab.h: Initial doxygenation.
8388
83892006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8390
8391 Don't miss %merge result type warnings just because the LHS types are
8392 declared after the %merge. This continues the effort of the previous
8393 patch.
8394 * src/reader.c (get_merge_function): Don't set the merger type yet.
8395 (record_merge_function_type): New function for setting the merger type
8396 and checking for clashes.
8397 (grammar_current_rule_merge_set): Set the location of the %merge for
8398 the current rule.
8399 (packgram): Invoke record_merge_function_type for each rule now that
8400 all symbol type declarations have been parsed.
8401 * src/reader.h (merger_list.type_declaration_location): New member
8402 storing the location of the first %merge from which the type for this
8403 merging function was derived.
8404 * src/symlist.h (symbol_list.merger_declaration_location): New member
8405 storing the location of a rule's %merge, if any.
8406 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8407 declared later): New test to catch the error fixed by the above patch.
8408
84092006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8410
8411 Get action warnings (grammar_rule_check) right even when symbol
8412 declarations appear after the rules. Discussed at
8413 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
8414 and
8415 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
8416 Don't mistake the type of $$ in a midrule to be that of its parent
8417 rule's $$.
8418 * src/reader.c (grammar_current_rule_end): Don't invoke
8419 grammar_rule_check yet since not all symbol declarations may have been
8420 parsed yet.
8421 (grammar_midrule_action): Likewise.
8422 Don't record whether the midrule's $$ has been used yet since actions
8423 haven't been translated yet.
8424 Record the midrule's parent rule and its RHS index within the parent
8425 rule.
8426 (grammar_current_rule_action_append): Don't translate the action yet
8427 since not all symbol declarations may have been parsed yet and, thus,
8428 warnings about types for $$, $n, @$, and @n can't be reported yet.
8429 (packgram): Translate the action and invoke grammar_rule_check now that
8430 all symbol declarations have been parsed.
8431 * src/scan-code.l (handle_action_dollar): Now that this is invoked
8432 after parsing the entire grammar file, the symbol list here in the case
8433 of a midrule is actually the midrule's empty RHS, so reference its
8434 parent rule's RHS where necessary.
8435 On the other hand, now that you can already know it's a midrule, you
8436 aren't forced to think $$ has the same type as its parent rule's $$.
8437 (handle_action_at): In the case of a midrule, reference the parent rule
8438 where necessary.
8439 * src/symlist.c (symbol_list_new): Initialize new midrule-related
8440 members.
8441 (symbol_list_length): Now that this is invoked after all rules have
8442 been parsed, a NULL symbol (rather than a NULL symbol list node)
8443 terminates a rule. symbol_list_print already does this correctly.
8444 * src/symlist.h (symbol_list.midrule_parent_rule,
8445 symbol_list.midrule_parent_rhs_index): New members so that midrules can
8446 remember their relationships with their parents.
8447 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
8448 fixed by the above patch.
8449 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
8450 implementing...
8451 (Unused values): ... this old test case and...
8452 (Unused values before symbol declarations): ... this new test case.
8453 This one is the same as `Unused values' except that all symbol
8454 declarations appear after the rules in order to catch the rest of the
8455 errors fixed by the above patch.
8456
84572006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8458
8459 More cleanup.
8460 * src/reader.c (current_rule): Declare it static since it's no longer
8461 used outside this file.
8462 (grammar_current_rule_action_append): Remove redundant arguments from
8463 translate_rule_action invocation.
8464 * src/reader.h (current_rule): Remove this unused extern.
8465 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
8466 * src/scan-code.l (translate_rule_action): Likewise.
8467
84682006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
8469
8470 Clean up yesterday's patch.
8471 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
8472 to...
8473 * src/reader.c (grammar_current_rule_action_append): ... here for
8474 consistency with grammar_current_rule_symbol_append.
8475 * tests/regression.at (Braced code in declaration in rules section):
8476 Make yyerror and yylex static as usual.
8477
84782006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
8479
8480 Fix bug that mistakes braced code in a declaration in the rules section
8481 to be a rule action. Mentioned at
8482 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
8483 * src/scan-gram.l: Move midrule action detection from the start of the
8484 scanning of any braced code to...
8485 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
8486 action. For readability, use $2 and @2 rather than the equivalent
8487 global variables.
8488 * tests/regression.at (Braced code in declaration in rules section):
8489 New test to catch the error fixed by the above patch.
8490
8491 Work on code readability some.
8492 * src/scan-code.l (current_rule): Get rid of this misleading and
8493 redundant declaration: it's actually extern'ed in reader.h.
8494 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
8495 translate_action): Add a rule argument and use it instead of the global
8496 current_rule.
8497 (translate_rule_action): This already receives current_rule through an
8498 argument, so pass it on to translate_action instead of assigning
8499 current_rule to current_rule.
8500 (translate_symbol_action, translate_code): Pass rule = NULL to
8501 translate_action.
8502
85032006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
8504
8505 Rename %before-definitions to %start-header and %after-definitions to
8506 %end-header. Don't use these declarations to separate pre-prologue
8507 blocks from post-prologue blocks. Add new order-independent
8508 declarations %before-header and %after-header as alternatives to the
8509 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
8510 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
8511 * NEWS (2.3+): Update for these changes.
8512 * data/glr.c (b4_before_definitions): Update to...
8513 (b4_start_header): ... this.
8514 (b4_after_definitions): Update to...
8515 (b4_end_header): ... this.
8516 * data/glr.cc: Likewise.
8517 * data/lalr1.cc: Likewise.
8518 * data/yacc.c: Likewise.
8519 * doc/bison.texinfo (The prologue): Update names, and replace remaining
8520 prologue blocks with %*-header declarations.
8521 (Calc++ Parser): Likewise.
8522 (Decl Summary): Update names.
8523 (Table of Symbols): Update description.
8524 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
8525 (PERCENT_END_HEADER): ... this.
8526 (PERCENT_BEFORE_DEFINITIONS): Update to...
8527 (PERCENT_START_HEADER): ... this.
8528 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
8529 (declaration): Update token names and m4 macro names.
8530 When parsing %end-header and %start-header, invoke translate_code
8531 before muscle_code_grow, and no longer set global booleans to remember
8532 whether these declarations have been seen.
8533 Parse new %after-header and %before-header.
8534 * src/reader.c (before_definitions, after_definitions): Remove.
8535 (prologue_augment): Accept a new bool argument to specify whether to
8536 augment the pre-prologue or post-prologue.
8537 * src/reader.h (before_definitions, after_definitions): Remove these
8538 extern's.
8539 (prologue_augment): Add new bool argument.
8540 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
8541 (PERCENT_END_HEADER): ... this.
8542 (PERCENT_BEFORE_DEFINITIONS): Update to...
8543 (PERCENT_START_HEADER): ... this.
8544 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
8545 * tests/actions.at (Printers and Destructors): Update names.
8546
85472006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
8548
8549 Add comparison operators for C++ location classes. Discussed at
8550 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
8551 * data/c++.m4 (b4_define_location_comparison): New boolean %define
8552 declaration indicating whether filename_type has an operator==. If
8553 filename_type is `std::string', it defaults to `1', `0' otherwise.
8554 * data/location.cc: Iff b4_define_location_comparison is `1', add
8555 operator== and operator!= for class position and for class location.
8556
8557 Some minor fixes.
8558 * src/scan-action.l: Remove unused file.
8559 * src/symtab.c (symbol_printer_set): Use printer_location not
8560 destructor_location.
8561 * src/symtab.h (struct symbol): Replace incorrect source comment for
8562 printer members.
8563 * tests/input.at (Incompatible Aliases): Update output with correct
8564 printer location.
8565
85662006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
8567
8568 Don't put the pre-prologue in the header file. For the yacc.c code
8569 file and the glr.c header and code files, move the pre-prologue before
8570 the token definitions. Add new %before-definitions and
8571 %after-definitions to declare code that will go in both the header file
8572 and code file. Discussed at
8573 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
8574 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
8575 and
8576 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
8577 * NEWS (2.3+): Describe these changes.
8578 * data/glr.c (b4_pre_prologue): Move from within to before...
8579 (b4_shared_declarations): ... this.
8580 Add new b4_before_definitions before b4_token_enums.
8581 Add new b4_after_definitions at the end.
8582 * data/glr.cc (b4_pre_prologue): Replace with...
8583 (b4_before_definitions): ... this in the header file.
8584 (b4_after_definitions): New near the end of the header file.
8585 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
8586 code file right before including the header file.
8587 (b4_before_definitions): New in the previous position of
8588 b4_pre_prologue in the header file.
8589 (b4_after_definitions): New near the end of the header file.
8590 * data/yacc.c: Clean up some m4 quoting especially in the header file.
8591 (b4_token_enums_defines): In the code file, move to right before
8592 YYSTYPE for consistency with the header file.
8593 (b4_before_definitions): New right before b4_token_enums_defines in
8594 both the header and code file.
8595 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
8596 header and code file.
8597 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
8598 of prologues for %union dependencies.
8599 (Decl Summary): In %defines description, mention the effect of
8600 %before-definitions and %after-definitions on the header file.
8601 (Calc++ Parser): Forward declare driver in a %before-definitions rather
8602 than in the pre-prologue so that make check succeeds.
8603 (Table of Symbols): Add entries for %before-definitions and
8604 %after-definitions.
8605 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
8606 %before-definitions.
8607 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
8608 (declaration): Parse those declarations and append to
8609 b4_before_definitions and b4_after_definitions, respectively.
8610 * src/reader.c (before_definitions, after_definitions): New bools to
8611 track whether those declarations have been seen.
8612 (prologue_augment): Add to the post-prologue if %union,
8613 %before-definitions, or %after-definitions has been seen.
8614 * src/reader.h (before_definitions, after_definitions): New extern's.
8615 * src/scan-gram.l: Scan the new declarations.
8616 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
8617 prologue block in a %before-definitions or a %after-definitions based
8618 on whether the %union is declared.
8619 * tests/regression.at (Early token definitions with --yacc, Early token
8620 definitions without --yacc): Move tests for token definitions into the
8621 post-prologue since token names are no longer defined in the
8622 pre-prologue.
8623
86242006-06-20 Akim Demaille <akim@epita.fr>
8625
8626 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
8627 (symbol_get): Use it.
8628 * src/parse-gram.y: Use it.
8629
86302006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
8631
8632 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
8633 build succeeds when configured with --enable-gcc-warnings.
8634
86352006-06-19 Paul Eggert <eggert@cs.ucla.edu>
8636
8637 * src/parse-gram.y (char_name): New function.
8638 (CHAR, STRING, string_content): For %printer, properly escape.
8639 (ID): Prefer fputs to fprintf.
8640 (id): Reindent to be consistent with other rules.
8641 Properly quote char.
8642
8643 The Translation Project changed its way of publishing translations
8644 to maintainers. I haven't received any responses to my request
8645 for supporting the old way, or for documenting the new way. I
8646 have modified 'bootstrap' to use screen scraping
8647 (in this case, HTML scraping). This is unreliable and inelegant,
8648 but I don't see any better way. Yuck.
8649 * bootstrap (TP_URL, WGET_COMMAND): New vars.
8650 (get_translations): New function, which uses HTML scraping to
8651 deduce locations of latest translations.
8652 Use this function to grab both bison and bison-runtime .po files.
8653 Don't bother priming the pump for the runtime-po domain any more,
8654 as it's now translated better than bison is.
8655
86562006-06-19 Akim Demaille <akim@epita.fr>
8657
8658 * src/scan-gram.l: No longer "parse" things after `%union' until
8659 `{'. Rather, return a single "%union" token.
8660 No longer make symbols: return strings, and leave the conversion
8661 to symbols to the parser.
8662 (SC_PRE_CODE, token_type): Remove.
8663 * src/parse-gram.y (%union): New field `character'.
8664 Sort tokens.
8665 (CHAR): New token.
8666 (ID, ID_COLON): Now that the scanner no longer makes them
8667 identifiers, adjust all uses to invoke symbol_get.
8668 (id_colon): New, wraps the conversion from string to symbol.
8669 (%union): Accept a possible union_name.
8670 (symbol): Now can be a char.
8671 * data/c.m4 (b4_union_name): Leave a default value.
8672 * data/glr.c, data/yacc.c: Use it.
8673
86742006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
8675
8676 For associating token numbers with token names for "yacc.c", don't use
8677 #define statements unless `--yacc' is specified; always use enum
8678 yytokentype. Most important discussions start at:
8679 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
8680 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
8681 and
8682 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
8683 * NEWS (2.3+): Mention.
8684 * data/c.m4 (b4_yacc_if): New.
8685 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
8686 token #define's.
8687 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
8688 on token name definitions.
8689 * src/getargs.c (usage): Capitalize `Yacc' in English.
8690 * src/output.c (prepare): Define b4_yacc_flag.
8691 * tests/regression.at (Early token definitions): Test that tokens names
8692 are defined before the pre-prologue not just before the post-prologue.
8693 Remove this test case and copy to...
8694 (Early token definitions with --yacc): ... this to test #define's.
8695 (Early token definitions without --yacc): ... and this to test enums.
8696
86972006-06-11 Paul Eggert <eggert@cs.ucla.edu>
8698
8699 * NEWS: Reword the post-2.3 change to not be so optimistic about
8700 removing the old "look-ahead" spelling.
8701 Update previous look-ahead/lookahead change reports.
8702 * REFERENCES: look-ahead -> lookahead (since that's
8703 what he actually wrote).
8704 * doc/refcard.tex: look ahead -> lookahead,
8705 look-ahead -> lookahead
8706
87072006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
8708
8709 For consistency, use `lookahead' instead of `look-ahead' or
8710 `look_ahead'. Discussed starting at
8711 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
8712 and then at
8713 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
8714 * NEWS: For the next release, note the change to `--report'.
8715 * TODO, doc/bison.1: Update English.
8716 * doc/bison.texinfo: Update English.
8717 (Understanding Your Parser, Bison Options): Document as
8718 `--report=lookahead' rather than `--report=look-ahead'.
8719 * src/conflicts.c: Update English in comments.
8720 (lookahead_set): Rename from look_ahead_set.
8721 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
8722 (resolve_sr_conflict): Rename local look_ahead_tokens to
8723 lookahead_tokens, and update other uses.
8724 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
8725 count_rr_conflicts, conflicts_free): Update uses.
8726 * src/getargs.c (report_args): Move "lookahead" before alternate
8727 spellings.
8728 (report_types): Update uses.
8729 (usage): For `--report' usage description, state `lookahead' spelling
8730 rather than `look-ahead'.
8731 * src/getargs.h (report.report_lookahead_tokens): Rename from
8732 report_look_ahead_tokens.
8733 * src/lalr.c: Update English in comments.
8734 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
8735 (state_lookahead_tokens_count): Rename from
8736 state_look_ahead_tokens_count.
8737 Rename local n_look_ahead_tokens to n_lookahead_tokens.
8738 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
8739 Rename local n_look_ahead_tokens to n_lookahead_tokens.
8740 Update other uses.
8741 Update English in output.
8742 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
8743 * src/print.c: Update English in comments.
8744 (lookahead_set): Rename from look_ahead_set.
8745 (print_reduction): Rename argument lookahead_token from
8746 look_ahead_token.
8747 (print_core, state_default_rule, print_reductions, print_results):
8748 Update uses.
8749 * src/print_graph.c: Update English in comments.
8750 (print_core): Update uses.
8751 * src/state.c: Update English in comments.
8752 (reductions_new): Update uses.
8753 (state_rule_lookahead_tokens_print): Rename from
8754 state_rule_look_ahead_tokens_print, and update other uses.
8755 * src/state.h: Update English in comments.
8756 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
8757 (state_rule_lookahead_tokens_print): Rename from
8758 state_rule_look_ahead_tokens_print.
8759 * src/tables.c: Update English in comments.
8760 (conflict_row, action_row): Update uses.
8761 * tests/glr-regression.at
8762 (Incorrect lookahead during deterministic GLR,
8763 Incorrect lookahead during nondeterministic GLR): Rename
8764 print_look_ahead to print_lookahead.
8765 * tests/torture.at: Update English in comments.
8766 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
8767 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
8768 (Many lookahead tokens): Update uses.
8769 * data/glr.c: Update English in comments.
8770 * lalr1.cc: Likewise.
8771 * yacc.c: Likewise.
8772 * src/conflicts.h: Likewise.
8773 * src/lalr.h: Likewise.
8774 * src/main.c: Likewise.
8775 * src/output.c: Likewise.
8776 * src/parse-gram.c: Likewise.
8777 * src/tables.h: Likewise.
8778 * tests/calc.at: Likewise.
8779
87802006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
8781
8782 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
8783
87842006-06-07 Paul Eggert <eggert@cs.ucla.edu>
8785
8786 * TODO: Add request from Nelson H. F. Beebe to be able to install
8787 Bison without installing the yacc script.
8788
87892006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
8790
8791 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
8792 and yytext if they're already #define'd.
8793 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
8794 * src/scan-code-c.c: ... here.
8795 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
8796 <config.h>.
8797
87982006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
8799
8800 Get Bison to build again when configured with --enable-gcc-warnings.
8801 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
8802 missing #include's.
8803 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
8804 loc argument as it shadows a global.
8805 * src/scan-gram.l: Remove stray comma that prevents boundary_set
8806 invocation.
8807
8808 * src/.cvsignore: Add scan-code.c.
8809
88102006-06-07 Akim Demaille <akim@epita.fr>
8811
8812 * src/scan-gram.l: Move the "add a trailing ; to actions" code
8813 to...
8814 * src/scan-code.l: here.
8815 * tests/input.at (Torturing the Scanner): Fix another location
8816 error.
8817
88182006-06-07 Akim Demaille <akim@epita.fr>
8819
8820 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
8821
88222006-06-06 Akim Demaille <akim@epita.fr>
8823
8824 Extract the parsing of user actions from the grammar scanner.
8825 As a consequence, the relation between the grammar scanner and
8826 parser is much simpler. We can also split "composite tokens" back
8827 into simple tokens.
8828 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
8829 * src/scan-gram.l (add_column_width, adjust_location): Move to and
8830 rename as...
8831 * src/location.h, src/location.c (add_column_width)
8832 (location_compute): these.
8833 Fix the column count: the initial column is 0.
8834 (location_print): Be robust to ending column being 0.
8835 * src/location.h (boundary_set): New.
8836 * src/main.c: Adjust to scanner_free being renamed as
8837 gram_scanner_free.
8838 * src/output.c: Include scan-code.h.
8839 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
8840 Use boundary_set.
8841 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
8842 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
8843 which is now, again, a separate token.
8844 Adjust all dependencies.
8845 Whereever actions with $ and @ are used, use translate_code.
8846 (action): Remove this nonterminal which is now useless.
8847 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
8848 (grammar_current_rule_action_append): Use translate_code.
8849 (packgram): Bound check ruleno, itemno, and rule_length.
8850 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
8851 (last_string, last_braced_code_loc, max_left_semantic_context)
8852 (scanner_initialize, scanner_free, scanner_last_string_free)
8853 (gram_out, gram_lineno, YY_DECL_): Move to...
8854 * src/scan-gram.h: this new file.
8855 (YY_DECL): Rename as...
8856 (GRAM_DECL): this.
8857 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
8858 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8859 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8860 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8861 Move these declarations, and...
8862 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
8863 these to...
8864 * src/flex-scanner.h: this new file.
8865 * src/scan-gram.l (rule_length, rule_length_overflow)
8866 (increment_rule_length): Remove.
8867 (last_braced_code_loc): Rename as...
8868 (gram_last_braced_code_loc): this.
8869 Adjust to the changes of the parser.
8870 Move all the handling of $ and @ into...
8871 * src/scan-code.l: here.
8872 * src/scan-gram.l (handle_dollar, handle_at): Remove.
8873 (handle_action_dollar, handle_action_at): Move to...
8874 * src/scan-code.l: here.
8875 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
8876 scan-code.h, scan-code-c.c, scan-gram.h.
8877 (EXTRA_bison_SOURCES): Add scan-code.l.
8878 (BUILT_SOURCES): Add scan-code.c.
8879 (yacc): Be robust to white spaces.
8880
8881 * tests/conflicts.at, tests/input.at, tests/reduce.at,
8882 * tests/regression.at: Adjust the column numbers.
8883 * tests/regression.at: Adjust the error message.
8884
88852006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
8886
8887 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
8888 Use Akim's wording from
8889 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
8890
88912006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
8892
8893 Between Bison releases, manually append `+' to the previous Bison
8894 release number, and use that as a signal to automatically print the
8895 ChangeLog's CVS Id keyword from --version. Discussed starting at
8896 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
8897 * ChangeLog: Add Id header.
8898 * configure.ac (AC_INIT): Append `+' to `2.3'.
8899 * src/.cvsignore: Add revision.c.
8900 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
8901 (BUILT_SOURCES): Add revision.c.
8902 (revision.c): New target rule. This file defines a new global variable
8903 named revision. It initializes it with either the Id from ChangeLog
8904 or, if VERSION doesn't contain `+', with the empty string.
8905 * src/getargs.c (version): Print the value of revision.
8906 * src/revision.h: Extern revision.
8907
89082006-06-05 Paul Eggert <eggert@cs.ucla.edu>
8909
8910 * NEWS: Version 2.3.
8911 * configure.ac (AC_INIT): Likewise.
8912
89132006-05-30 Paul Eggert <eggert@cs.ucla.edu>
8914
8915 * data/glr.c (YYRECOVERING): Define to be a function-like macro
8916 with no arguments, not as an object-like macro. This is for
8917 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
8918 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
8919 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
8920 Document this.
8921
89222006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
8923
8924 * src/getargs.c (usage): Back out yesterday's modification of the
8925 --help output so that we don't have to wait for translation before
8926 releasing 2.3.
8927
89282006-05-29 Paul Eggert <eggert@cs.ucla.edu>
8929
8930 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
8931 Problem reported by Akim Demaille.
8932
89332006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
8934
8935 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
8936
89372006-05-26 Paul Eggert <eggert@cs.ucla.edu>
8938
8939 * data/yacc.c (yy_reduce_print): Omit trailing white space in
8940 generated source code. Problem reported by Frans Englich in
8941 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
8942
89432006-05-22 Paul Eggert <eggert@cs.ucla.edu>
8944
8945 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
8946 shell, not within 'make', so that 'make' by an ordinary builder
8947 (using GNU make) does not worry about configuring gzip. This also
8948 works around a bug reported independently by Keith Thompson and by
8949 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
8950 stderr rather than stdout, messing up the build logs.
8951
89522006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
8953
8954 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
8955 to make sure that YYID will never be unused. This fixes a 'make
8956 maintainer-check' failure caused by the recent changes to the 'Trivial
8957 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
8958 not used.
8959 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
8960
89612006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
8962
8963 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
8964 state before an empty RHS is always resolved here. Only the location
8965 of that state is guaranteed to be resolved, and that's enough. This
8966 fixes the remaining bug reported by Derek M. Jones in
8967 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
8968 * tests/glr-regression.at (Uninitialized location when reporting
8969 ambiguity): Test the above case.
8970 Also, the embedded comments in this test case claim it checks the case
8971 of an empty RHS that has inherited the initial location. However, the
8972 corresponding LHS was already resolved, so yyresolveLocations didn't
8973 actually have reason to modify it. Fix this by forcing
8974 nondeterministic operation at the beginning of the parse.
8975
89762006-05-20 Paul Eggert <eggert@cs.ucla.edu>
8977
8978 * data/c.m4 (b4_yy_symbol_print_generate):
8979 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
8980 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
8981 of the bugs reported today by Derek M Jones in
8982 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
8983 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
8984 defined to be a type name without parens or brackets.
8985 (Location Type): Similarly for YYLTYPE.
8986 * tests/regression.at (Trivial grammars): Put in a test for this
8987 bug that will be caught by 'make maintainer-check' (though not,
8988 alas, by 'make check' unless your compiler is picky).
8989
89902006-05-19 Paul Eggert <eggert@cs.ucla.edu>
8991
8992 * NEWS: Version 2.2.
8993 * configure.ac (AC_INIT): Likewise.
8994
89952006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
8996
8997 * data/glr.c (yyreportTree): Make room in yystates for the state
8998 preceding the RHS. This fixes the segmentation fault reported by Derek
8999 M. Jones in
9000 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
9001 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
9002 to the user. Reported for yyreportTree by Derek M. Jones later in the
9003 same thread.
9004 * THANKS: Add Derek M. Jones.
9005 Update my email address.
9006 Fix typo in Steve Murphy's name.
9007
90082006-05-14 Paul Eggert <eggert@cs.ucla.edu>
9009
9010 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
9011 checking against YYLAST that caused the parser to miss a potential
9012 alternative in its diagnostic.
9013 Problem reported by Maria Jose Moron Fernandez in
9014 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
9015 * data/lalr1.cc (yysyntax_error_): Likewise.
9016 * data/yacc.c (yysyntax_error): Likewise.
9017 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
9018 tokens, in case we run into an older C compiler.
9019 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
9020 Use them to check for the off-by-one error fixed above.
9021
9022 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
9023 YYSIZE_T, not size_t.
9024 * tests/regression.at (Trivial grammars): New test, to catch
9025 the error fixed by the above patch.
9026
90272006-05-14 Akim Demaille <akim@lrde.epita.fr>
9028
9029 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
9030 scheme.
9031 Reported by Steve Murphy.
9032
90332006-05-14 Akim Demaille <akim@lrde.epita.fr>
9034
9035 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
9036 * data/glr.cc: b4_location_flag is now b4_locations_flag.
9037
90382006-05-14 Akim Demaille <akim@lrde.epita.fr>
9039
9040 Implement --trace=m4.
9041 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
9042 * src/output.c (output_skeleton): When set, pass -dV to m4.
9043
9044 Factor the handling of flags in m4.
9045 * src/output.c (prepare): Rename the muscle names debug, defines,
9046 error_verbose to debug_flag, defines_flag, error_verbose_flag.
9047 * data/c.m4: Adjust.
9048 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
9049 Use b4_define_flag_if to define other b4_FLAG_if macros.
9050 (b4_location_if): As a consequence, rename as...
9051 (b4_locations_if): this, for consistency.
9052 Adjust all the skeletons.
9053
90542006-05-14 Akim Demaille <akim@lrde.epita.fr>
9055
9056 * etc/bench.pm: Shorten bench names.
9057
90582006-05-14 Akim Demaille <akim@lrde.epita.fr>
9059
9060 * src/output.h, src/output.c (error_verbose): Move to...
9061 * src/getargs.h, src/getargs.c: here.
9062 Sort the flags.
9063 Adjust dependencies.
9064
90652006-05-13 Paul Eggert <eggert@cs.ucla.edu>
9066
9067 * data/c.m4 (b4_copyright): Put the special exception for Bison
9068 skeletons here, so we don't have to put it in each skeleton. All
9069 uses changed. Suggested by Akim Demaille. Also, wrap the
9070 copyright notice, in case it is longer than 80 columns. Replace
9071 comma by newline after title.
9072
90732006-05-11 Paul Eggert <eggert@cs.ucla.edu>
9074
9075 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
9076 incompatibility, not a bug. Mention that it wasn't fixed as of
9077 flex 2.5.33.
9078
90792006-05-11 Akim Demaille <akim@lrde.epita.fr>
9080
9081 * examples/extexi: Enforce the precedence of concatenation over
9082 >>.
9083 Reported by Tommy Nordgren.
9084
90852006-05-11 Akim Demaille <akim@lrde.epita.fr>
9086
9087 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
9088 with the member "token".
9089 Reported by Martin Nylin.
9090
90912006-05-08 Paul Eggert <eggert@cs.ucla.edu>
9092
9093 * data/glr.c: Switch to Bison 2.2 special-exception language in
9094 the copyright notice. Use more-regular format for titles and
9095 copyright notices.
9096 * data/glr.cc: Likewise.
9097 * data/location.cc: Likewise.
9098 * data/yacc.cc: Likewise.
9099 * doc/bison.texinfo (Conditions): Document this.
9100 * NEWS: likewise. Upgrade version to 2.2.
9101
91022006-04-27 Akim Demaille <akim@lrde.epita.fr>
9103
9104 * data/glr.cc: Remove dead code.
9105
91062006-04-25 Paul Eggert <eggert@cs.ucla.edu>
9107
9108 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
9109 that variable and the line breaks the bootstrap. Problem reported
9110 by Juan M. Guerrero.
9111
91122006-04-24 Akim Demaille <akim@lrde.epita.fr>
9113
9114 * doc/bison.texinfo (Multiple start-symbols): New.
9115
91162006-04-24 Akim Demaille <akim@lrde.epita.fr>
9117
9118 * etc/README, etc/bench.pl: New.
9119
91202006-04-03 Akim Demaille <akim@lrde.epita.fr>
9121
9122 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
9123 rule.
9124 Reported by Mickael Labau.
9125 * tests/input.at (Torturing the Scanner): Test it.
9126
91272006-03-16 Paul Eggert <eggert@cs.ucla.edu>
9128
9129 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
9130 Problem reported by Bob Rossi.
9131
91322006-03-13 Paul Eggert <eggert@cs.ucla.edu>
9133
9134 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
9135 and didn't really work.
9136 For the index, use @ifnotinfo, not @iftex.
9137 Minor cleanups of spacing and terminology.
9138
91392006-03-12 Akim Demaille <akim@lrde.epita.fr>
9140
9141 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
9142 of AT_NAME_PREFIX when %name-prefix is not used.
9143
91442006-03-12 Akim Demaille <akim@lrde.epita.fr>
9145
9146 Apply --prefix to C++ skeletons too: they change the namespace.
9147 The test suite already exercize these cases.
9148 * data/c++.m4 (b4_namespace): New.
9149 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
9150 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
9151 * data/yacc.c, data/glr.c: Remove a useless `[]'.
9152 * doc/bison.texinfo: Document it.
9153 (Option Cross Key): Use @multitable in all formats. It looks
9154 nicer, even in TeX outputs.
9155 (Rules): Use the same code whatever the output type is.
9156 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
9157 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
9158 * tests/calc.at: Use it, instead of hard coding `yy'.
9159
91602006-03-10 Akim Demaille <akim@lrde.epita.fr>
9161
9162 * TODO: Remove dead items.
9163
91642006-03-10 Akim Demaille <akim@lrde.epita.fr>
9165
9166 * doc/FAQ: Remove, merged into...
9167 * doc/bison.texinfo (FAQ): this.
9168 * doc/Makefile.am (EXTRA_DIST): Adjust.
9169
91702006-03-10 Akim Demaille <akim@lrde.epita.fr>
9171
9172 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
9173 even if empty.
9174 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
9175 * doc/bison.texinfo (Calc++ Scanner): Use it.
9176
91772006-03-09 Paul Eggert <eggert@cs.ucla.edu>
9178
9179 Fix two nits reported by twlevo, plus one more that I discovered.
9180
9181 * src/assoc.h (assoc_to_string): Give a name to the arg, as
9182 this is the usual Bison style.
9183 * src/location.h (location_print): Likewise.
9184
9185 * src/reader.h (token_name): Likewise.
9186
91872006-03-08 Paul Eggert <eggert@cs.ucla.edu>
9188
9189 Fix some nits reported by twlevo.
9190 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
9191 and "POSIX". Use more-modern syntax for URLs. Mention C++
9192 and ask for Java. Don't hardwire OS version numbers. Add
9193 copyright notice.
9194 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
9195 * src/conflicts.c (solved_conflicts_obstack): Now static.
9196
91972006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
9198
9199 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
9200 page. Say "you can use it" not "you may use it" as on the web page;
9201 we're describing capabilities not granting permission.
9202
92032006-03-06 Paul Eggert <eggert@cs.ucla.edu>
9204
9205 * data/glr.c (yyresolveLocations): Rename local variables to avoid
9206 shadowing warnings. Use usual patter for iterating through RHS.
9207 * tests/glr-regression.at
9208 (Uninitialized location when reporting ambiguity):
9209 Modify yylex so that it uses its argument, rather than trying
9210 to rely on ARGSUSED (which doesn't work for gcc with warnings).
9211 const char -> char const.
9212
9213 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
9214 Don't use tabs inside commands; it messes up 'ps'.
9215 Problem reported by twlevo.
9216
92172006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
9218
9219 * tests/glr-regression.at (Uninitialized location when reporting
9220 ambiguity): New test case.
9221 * data/glr.c (yyresolveLocations): New function, which uses
9222 YYLLOC_DEFAULT.
9223 (yyresolveValue): Invoke yyresolveLocations before reporting an
9224 ambiguity.
9225 * doc/bison.texinfo (Default Action for Locations): Note
9226 YYLLOC_DEFAULT's usage for ambiguity locations.
9227 (GLR Semantic Actions): Cross-reference those notes.
9228
92292006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
9230
9231 * tests/glr-regression.at (Leaked semantic values when reporting
9232 ambiguity): Remove unnecessary union and type declarations.
9233 (Leaked lookahead after nondeterministic parse syntax error): New test
9234 case.
9235 * data/glr.c (yyparse): Check for zero stacks remaining before
9236 attempting to shift the lookahead so that you don't lose it.
9237
92382006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
9239
9240 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
9241 * tests/glr-regression.at (Leaked semantic values when reporting
9242 ambiguity): New test case.
9243 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
9244 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
9245 now unnecessary yystackp parameter.
9246 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
9247 destructors can be called.
9248
9249 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
9250 in existing testcases.
9251
92522006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
9253
9254 Don't leak semantic values for parent RHS when a user action cuts the
9255 parser, and clean up related code a bit.
9256 * tests/glr-regression.at (Leaked merged semantic value if user action
9257 cuts parse): Rename to...
9258 (Leaked semantic values if user action cuts parse): ... this. Add check
9259 for leaked parent RHS values.
9260 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
9261 between an unresolved state (non-empty chain of semantic options) and
9262 an incomplete one (signaled by an empty chain).
9263 (yyresolveStates): Document the interface. Move all manipulation of a
9264 successfully or unsuccessfully resolved yyGLRState to...
9265 (yyresolveValue): ... here so that yyresolveValue always leaves a
9266 yyGLRState with consistent data and thus is easier to understand.
9267 Remove the yyvalp and yylocp parameters since they are always just
9268 taken from the yys parameter. When reporting a discarded merged value
9269 in debugging output, note that it is incompletely merged. Document the
9270 interface.
9271 (yyresolveAction): If resolving any of the RHS states fails, destroy
9272 them all rather than leaking them. Thus, as long as user actions are
9273 written to clean up the RHS correctly, yyresolveAction always cleans up
9274 the RHS of a semantic option. Document the interface.
9275
92762006-02-27 Paul Eggert <eggert@cs.ucla.edu>
9277
9278 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
9279 led to a segmentation fault in GNU Pascal. Problem reported
9280 by Waldek Hebisch.
9281
92822006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
9283
9284 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
9285 mid-rule action inside a nonterminal symbol in order to declare a
9286 destructor for its semantic value.
9287
92882006-02-16 Paul Eggert <eggert@cs.ucla.edu>
9289
9290 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
9291 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
9292 __cplusplus && ! defined _STDLIB_H && !
9293 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
9294 defined free))]: Include <stdlib.h> rather than rolling our own
9295 declarations of malloc and free, to avoid problems with
9296 incompatible declarations (using 'throw') C++'s stdlib.h. This
9297 should fix Debian bug 340012
9298 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
9299 reported by Guillaume Melquiond.
9300
93012006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9302
9303 * NEWS: Clarify symbols versus types in unused-value warnings.
9304
9305 * configure.ac (AC_INIT): Bump version number.
9306
93072006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9308
9309 * NEWS: Version 2.1a.
9310 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
9311 since C99 requires this.
9312
93132006-02-11 Paul Eggert <eggert@cs.ucla.edu>
9314
9315 * m4/c-working.m4: New file.
9316 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
9317
93182006-02-10 Paul Eggert <eggert@cs.ucla.edu>
9319
9320 * Makefile.maint: Merge from coreutils.
9321
93222006-02-09 Paul Eggert <eggert@cs.ucla.edu>
9323
9324 More portability fixes for problems summarized by Nelson H. F. Beebe.
9325
9326 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
9327 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
9328 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
9329 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
9330 messes up because C++ code is compiled in 32-bit mode but linked
9331 in 64-bit mode.
9332
93332006-02-08 Paul Eggert <eggert@cs.ucla.edu>
9334
9335 More portability fixes for problems summarized by Nelson H. F. Beebe.
9336
9337 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
9338 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
9339
9340 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
9341 nodist_PROGRAMS, since we don't need to actually compile the
9342 example if we're just doing a plain 'make'. This avoids bothering
9343 the installer unnecessarily about problems due to weird C++
9344 compilers.
9345
93462006-02-06 Paul Eggert <eggert@cs.ucla.edu>
9347
9348 More portability fixes for problems summarized by Nelson H. F. Beebe.
9349
9350 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
9351 than #include "...", and compile with -I'.'. The old method was
9352 not portable, according to Posix and the C standard, and it does
9353 not work with Sun C 5.7, where previous #line directives affect
9354 the working directory used in later #include "..." directives.
9355
93562006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9357
9358 Various DJGGP specific issues in /djgpp
9359
93602006-02-02 Paul Eggert <eggert@cs.ucla.edu>
9361
9362 More portability fixes for problems summarized by Nelson H. F. Beebe.
9363
9364 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
9365 '#include <map>' works and that you can apply ++ to iterators.
9366
93672006-02-01 Paul Eggert <eggert@cs.ucla.edu>
9368
9369 Work around portability problems summarized by Nelson H. F. Beebe in
9370 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
9371
9372 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
9373 that '#include <string>' works.
9374
9375 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
9376 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
9377 "warning: sorry: semantics of inline function static data `const
9378 unsigned char translate_table[262]' are wrong (you'll wind up with
9379 multiple copies)".
9380
9381 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
9382 or, xor to not_, and_, or_, and xor_, respectively. This works
9383 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
9384 random system header somewhere that includes the equivalent of
9385 <iso646.h>.
9386
9387 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
9388 -E" works; it apparently doesn't work with PathScale EKO Compiler
9389 Suite Version 2.0.
9390
93912006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
9392
9393 During deterministic GLR operation, user actions should be able to
9394 influence the parse by changing yychar. To make this easier to fix and
9395 to make glr.c easier to evolve in general, don't maintain yytoken in
9396 parallel with yychar; just compute yytoken when needed.
9397 * tests/glr-regression.at (Incorrect lookahead during deterministic
9398 GLR): Check that setting yychar in a user action has the intended
9399 effect.
9400 * data/glr.c (yyGLRStack): Remove yytokenp member.
9401 (yyclearin): Don't set *yytokenp.
9402 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
9403 yychar rather than *yytokenp to determine the current lookahead.
9404 Compute yytoken locally when needed.
9405 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
9406 point to.
9407
9408 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
9409 after `--report' documentation.
9410
94112006-01-30 Paul Eggert <eggert@cs.ucla.edu>
9412
9413 * src/parse-gram.y (grammar_declaration): Location of printer
9414 symbol is @1, not list->location. Bug reported by twlevo.
9415 * tests/input.at (Incompatible Aliases): Adjust to above change.
9416
94172006-01-29 Paul Eggert <eggert@cs.ucla.edu>
9418
9419 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
9420 all the test at once. This makes the output easier to read in the
9421 normal case.
9422
9423 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
9424 got from <http://bro-ids.org/download.html>. The bug is that
9425 when two actions appeared in succession, the second one was
9426 scanned before the first one was added to the grammar rule
9427 as a midrule action. Bison then output the incorrect warning
9428 "parse.y:905.17-906.36: warning: unused value: $3".
9429 * src/parse-gram.y (BRACED_CODE, action): These are no longer
9430 associated with a value.
9431 (rhs): Don't invoke grammar_current_rule_action_append.
9432 (action): Invoke it here instead.
9433 * src/reader.c (grammar_midrule_action): Now extern.
9434 (grammar_current_rule_action_append): Don't invoke
9435 grammar_midrule_action; that is now the scanner's job.
9436 * src/reader.h (last_string, last_braced_code_loc):
9437 (grammar_midrule_action): New decls.
9438 * src/scan-gram.l (last_string): Now extern, sigh.
9439 (last_braced_code_loc): New extern variable.
9440 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
9441 rule already has an action.
9442 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
9443 * tests/input.at (AT_CHECK_UNUSED_VALUES):
9444 Add some tests to check that the above changes fixed the bug.
9445
94462006-01-27 Paul Eggert <eggert@cs.ucla.edu>
9447
9448 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
9449 All used changed. Check whether the symbol has a destructor,
9450 not whether it is typed.
9451 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
9452 that the values are still reported as unused. All line numbers
9453 adjusted.
9454
94552006-01-23 Paul Eggert <eggert@cs.ucla.edu>
9456
9457 Work around a bug in bro 0.8, which underparenthesizes its
9458 definition of YYLLOC_DEFAULT.
9459 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
9460 their arguments.
9461 * data/lalr1.cc: Likewise.
9462 * data/yacc.cc: Likewise.
9463
94642006-01-22 Paul Eggert <eggert@cs.ucla.edu>
9465
9466 Work around a bug in Pike 7.0, and give the Pike folks a
9467 better way to override the usual int widths.
9468 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
9469 user can override the types.
9470 (short): #undef, to work around a bug in Pike 7.0.
9471 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
9472 (union yyalloc.yyss): Use yytype_int16 rather than short.
9473 All uses changed.
9474 (yysigned_char): Remove.
9475 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
9476 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
9477 * tests/regression.at (Web2c Actions): Adjust to above changes.
9478
9479 * src/reader.c (check_and_convert_grammar): New function.
9480 (reader): Close the input file even if something went wrong during
9481 parsing. Minor file descriptor leak reported by twlevo.
9482
9483 * src/assoc.c (assoc_to_string): Use a default: abort (); case
9484 to pacify gcc -Wswitch-default.
9485 * src/scan-gram.l (adjust_location): Use a default: break; case
9486 to pacify gcc -Wswitch-default.
9487 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
9488 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
9489 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
9490 Move these decls to scan-skel.l, since they don't need to be
9491 visible elsewhere.
9492 * src/scan-skel.l: Accept the above decls.
9493 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
9494 is used.
9495
94962006-01-21 Paul Eggert <eggert@cs.ucla.edu>
9497
9498 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
9499 since we don't want to insist on a version number at the start
9500 of the changelog every time.
9501 * Makefile.maint: Sync from coreutils a bit better.
9502 (sc_trailing_blank): Renamed from sc_trailing_space.
9503 All uses changed.
9504 (sc_no_if_have_config_h, sc_require_config_h):
9505 (sc_prohibit_assert_without_use): New rules.
9506 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
9507 (sc_dd_max_sym_length): Fix leading spaces in rule.
9508 (sc_system_h_headers): Prefix with @.
9509 (sc_useless_cpp_parens, m4-check): Output line numbers.
9510 (changelog-check): Allow version only in head.
9511 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
9512 satisfy new Makefile.maint rule.
9513 * data/glr.c: Likewise.
9514 * data/glr.cc: Likewise.
9515 * data/lalr1.cc: Likewise.
9516 * data/yacc.c: Likewise.
9517 * lib/ebitsetv.c: Likewise.
9518 * lib/lbitset.c: Likewise.
9519 * lib/subpipe.c: Likewise.
9520 * lib/timevar.c: Likewise.
9521 * src/system.h: Likewise.
9522 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
9523 * djgpp/Makefile.maint: Add copyright notice.
9524 * djgpp/README.in: Likewise.
9525 * djgpp/config.bat: Likewise.
9526 * djgpp/config.site: Likewise.
9527 * djgpp/config_h.sed: Likewise.
9528 * djgpp/djunpack.bat: Likewise.
9529 * djgpp/config.sed: Fix copyright notice to match standard format.
9530 * djgpp/subpipe.h: Likewise.
9531 * lib/bitsetv-print.c: Likewise.
9532 * lib/bitsetv.c: Likewise.
9533 * lib/subpipe.h: Likewise.
9534 * lib/timevar.c: Likewise.
9535 * lib/timevar.h: Likewise.
9536 * djgpp/subpipe.c: Use standard recipe for config.h.
9537 * lib/abitset.c: Likewise.
9538 * lib/bitset.c: Likewise.
9539 * lib/bitset_stats.c: Likewise.
9540 * lib/bitsetv-print.c: Likewise.
9541 * lib/bitsetv.c: Likewise.
9542 * lib/ebitsetv.c: Likewise.
9543 * lib/get-errno.c: Likewise.
9544 * lib/lbitset.c: Likewise.
9545 * lib/subpipe.c: Likewise.
9546 * lib/timevar.c: Likewise.
9547 * lib/vbitset.c: Likewise.
9548 * tests/local.at: Likewise.
9549 * src/scan-gram.l: Don't include verify.h, since system.h does
9550 that for us.
9551 * .x-sc_require_config_h: New file.
9552 * .x-sc_unmarked_diagnostics: New file.
9553
95542006-01-20 Paul Eggert <eggert@cs.ucla.edu>
9555
9556 Be a bit more systematic about using 'abort'.
9557 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
9558 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
9559 Put 'default: abort ();' before some other case, to satisfy older
9560 pedantic compilers.
9561 * lib/bitset_stats.c (bitset_stats_init): Likewise.
9562 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
9563 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
9564 * src/conflicts.c (resolve_sr_conflict): Likewise.
9565 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
9566 (get_decision_str, get_orientation_str, get_node_alignment_str):
9567 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
9568 (get_linestyle_str, get_arrowstyle_str): Likewise.
9569 * src/conflicts.c (resolve_sr_conflict):
9570 Use a default case rather than one for the one remaining enum
9571 value, to catch invalid enum values as well.
9572 * src/lalr.c (set_goto_map, map_goto):
9573 Prefer "assert (FOO);" to "if (!FOO) abort ();".
9574 * src/nullable.c (nullable_compute, token_definitions_output):
9575 Likewise.
9576 * src/reader.c (packgram, reader): Likewise.
9577 * src/state.c (transitions_to, state_new, state_reduction_find):
9578 Likewise.
9579 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
9580 (symbol_pack): Likewise.
9581 * src/tables.c (conflict_row, pack_vector): Likewise.
9582 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
9583 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
9584 * src/system.h: Don't include <assert.h>.
9585 (assert): New macro.
9586
9587 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
9588 (Destructor Decl, Parser Function, Pure Calling):
9589 Describe rules for braces inside C code more carefully.
9590
95912006-01-19 Paul Eggert <eggert@cs.ucla.edu>
9592
9593 Fix some porting glitches found by Nelson H. F. Beebe.
9594 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
9595 compilers that don't understand that abort () does not return.
9596 * src/state.c (transitions_to): Likewise.
9597 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
9598 that '#include <cstdlib>' works.
9599 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
9600 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
9601 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
9602 for the benefit of some pre-C99 compilers.
9603
9604 * bootstrap: Undo changes to gnulib files that autoreconf made.
9605
9606 Minor fixups to get 'make maintainer-check' to work.
9607 * configure.ac: Don't use -Wnested-externs, as it's incompatible
9608 with the new verify.h implementation.
9609 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
9610 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
9611 * data/yacc.c (YYUSE): Likewise.
9612 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
9613 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
9614 * src/parse-gram.y (declaration): Don't pass a string constant
9615 to a function that expects char *, since GCC might complain
9616 about the constant value.
9617 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
9618 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
9619 before #defining them.
9620 * tests/glr-regression.at
9621 (Incorrectly initialized location for empty right-hand side in GLR):
9622 In yyerror, use the msg arg.
9623 (Corrupted semantic options if user action cuts parse):
9624 (Incorrect lookahead during deterministic GLR):
9625 (Incorrect lookahead during nondeterministic GLR):
9626 Don't name a local var 'index'; it shadows string.h's 'index'.
9627
96282006-01-19 Akim Demaille <akim@epita.fr>
9629
9630 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
9631 location, not just parts of it.
9632
96332006-01-18 Paul Eggert <eggert@cs.ucla.edu>
9634
9635 * NEWS: Document the fact that multiple %unions are now allowed.
9636 * doc/bison.texinfo (Union Decl): Likewise.
9637 * TODO: This feature is now implemented, so remove it from
9638 the wishlist.
9639
9640 * Makefile.maint: Merge with coreutils Makefile.maint.
9641 (CVS_LIST): Use build-aux version if available.
9642 (VERSION_REGEXP): New macro.
9643 (syntax-check-rules): Add sc_no_if_have_config_h,
9644 sc_prohibit_assert_without_use, sc_require_config_h,
9645 sc_useless_cpp_parens.
9646 (sc_obsolete_symbols): Check for O_NDELAY.
9647 (sc_dd_max_sym_length): Track coreutils.
9648 (sc_unmarked_diagnostics): Look in all files, not just *.c.
9649 (sc_useless_cpp_parens): New rule.
9650 (news-date-check): Look for version or today's date.
9651 (changelog-check): Don't require version number near head.
9652 (copyright-check): Use current year instead of hardwiring 2005.
9653 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
9654 (announcement): Add --gpg-key-ID.
9655
9656 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
9657 with "file system".
9658
9659 Avoid undefined behavior that addressed just before the start of an
9660 array. Problem reported by twlevo.
9661 * src/reader.c (packgram): Prepend a new sentinel before ritem.
9662 * src/lalr.c (build_relations): Rely on new sentinel.
9663 * src/gram.c (gram_free): Adjust to new sentinel.
9664
96652006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
9666
9667 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
9668 yylookaheadNeeds. All uses updated.
9669 (yysplitStack): Rename local yynewLookaheadStatuses to
9670 yynewLookaheadNeeds.
9671 * data/glr-regression.at (Incorrect lookahead during nondeterministic
9672 GLR): In comments, change `lookahead status' to `lookahead need'.
9673
96742006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9675
9676 * data/glr.c (yysplitStack): A little stylistic rewrite.
9677
96782006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9679
9680 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
9681
96822006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
9683
9684 * doc/bison.texinfo: Fix some typos.
9685 (GLR Semantic Actions): New subsection discussing special
9686 considerations because GLR semantic actions might be deferred.
9687 (Actions): Mention look-ahead usage of yylval.
9688 (Actions and Locations): Mention look-ahead usage of yylloc.
9689 (Special Features for Use in Actions): Add YYEOF entry and mention it
9690 in the yychar entry.
9691 In the yychar entry, remove mention of the local yychar case (pure
9692 parser) since this is irrelevant information when writing semantic
9693 actions and since it's already discussed in `Table of Symbols' where
9694 yychar is otherwise described as an external variable.
9695 In the yychar entry, don't call it the `current' look-ahead since it
9696 isn't when semantic actions are deferred.
9697 In the yychar and yyclearin entries, add note about deferred semantic
9698 actions.
9699 Add yylloc and yylval entries discussing look-ahead usage.
9700 (Look-Ahead Tokens): When discussing yychar, don't call it the
9701 `current' look-ahead, and do mention yylval and yylloc.
9702 (Error Recovery): Cross-reference `Action Features' when mentioning
9703 yyclearin.
9704 (Table of Symbols): In the yychar entry, don't call it the `current'
9705 look-ahead.
9706 In the yylloc and yylval entries, mention look-ahead usage.
9707
97082006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
9709
9710 * tests/glr-regression.at: Update copyright year to 2006.
9711
97122006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
9713
9714 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
9715 use during nondeterministic operation to track which stacks have
9716 actually needed the current lookahead.
9717 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
9718 Allocate, deallocate, resize, and otherwise shuffle space for
9719 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
9720 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
9721 appropriately during nondeterministic operation.
9722 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
9723 members to store the current lookahead to be used by the deferred
9724 user action.
9725 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
9726 from which the RHS is taken. Set the lookahead members of the new
9727 yySemanticOption according to the lookahead status for stack yyk.
9728 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
9729 yyaddDeferredAction.
9730 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
9731 members of yySemanticOption before invoking yyuserAction, and then set
9732 them back to their current values afterward.
9733 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
9734 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
9735 * tests/glr-regression.at: Remove `.' from the ends of recent test case
9736 titles for consistency.
9737 (Leaked merged semantic value if user action cuts parse): In order to
9738 suppress lint warnings, use arguments in merge function, and assign
9739 char value < 128 in main.
9740 (Incorrect lookahead during deterministic GLR): New test case.
9741 (Incorrect lookahead during nondeterministic GLR): New test case.
9742
97432006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
9744
9745 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
9746 !yyvaluep as signal that no semantic value is available to print.
9747 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
9748 to print a semantic value.
9749
97502006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
9751
9752 * tests/glr-regression.at: For consistency with my newer test cases,
9753 don't thank myself.
9754
97552006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
9756
9757 * data/glr.c (yyresolveValue): When merging semantic options, if at
9758 least one user action succeeds but a later one cuts the parse, then
9759 destroy the semantic value before returning rather than leaking it.
9760 (yyresolveStates): If a user action cuts the parse and thus
9761 yyresolveValue fails, ignore the (unset) semantic value rather than
9762 corrupting the yyGLRState, and empty the semantic options list since
9763 the user actions should have called all necessary destructors.
9764 Simplify code with YYCHK.
9765 * tests/glr-regression.at (Corrupted semantic options if user action
9766 cuts parse): New test case.
9767 (Undesirable destructors if user action cuts parse): New test case.
9768 Before applying any of this patch, this test case never actually failed
9769 for me... but only because the corrupted semantic options usually
9770 masked this bug.
9771 (Leaked merged semantic value if user action cuts parse): New test
9772 case.
9773
97742006-01-05 Akim Demaille <akim@epita.fr>
9775
9776 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
9777
97782006-01-04 Paul Eggert <eggert@cs.ucla.edu>
9779
9780 * data/c.m4 (b4_c_modern): New macro, with a new provision for
9781 _MSC_VER. Problem reported by Cenzato Marco.
9782 (b4_c_function_def): Use it.
9783 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
9784 b4_c_modern.
9785 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
9786 than rolling our own.
9787
97882006-01-04 Akim Demaille <akim@epita.fr>
9789
9790 Also warn about non-used mid-rule values.
9791 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
9792 member.
9793 (symbol_list_new): Adjust.
9794 * src/reader.c (symbol_typed_p): New.
9795 (grammar_rule_check): Use it.
9796 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
9797 Check its rule.
9798 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
9799 Use it.
9800 * tests/actions.at (Exotic Dollars): Adjust.
9801
98022006-01-04 Akim Demaille <akim@epita.fr>
9803
9804 * src/reader.c (grammar_midrule_action): If $$ is set in a
9805 mid-rule, move the `used' bit to its lhs.
9806 * tests/input.at (Unused values): New.
9807 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
9808
98092006-01-03 Paul Eggert <eggert@cs.ucla.edu>
9810
9811 * doc/bison.texinfo (Bison Options): Say more accurately what
9812 --yacc does.
9813 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
9814 about declarations in the grammar when in Yacc mode, as POSIX does
9815 not require a diagnostic when the grammar uses extensions.
9816
9817 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
9818
9819 Warn about dubious constructions like "%token T T".
9820 Reported by twlevo.
9821 * src/symtab.h (struct symbol.declared): New member.
9822 * src/symtab.c (symbol_new): Initialize it to false.
9823 (symbol_class_set): New arg DECLARING, specifying whether
9824 this is a declaration that we want to warn about, if there
9825 is more than one of them. All uses changed.
9826
9827 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
9828 Allow multiple %union directives, whose contents concatenate.
9829 * src/parse-gram.y (grammar_declaration): Likewise.
9830 Use muscle_code_grow, so that we don't need stype_line any more.
9831 All uses changed.
9832
9833 * src/muscle_tab.c (muscle_grow): Fix comment.
9834
9835 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
9836 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
9837 Update copyright year to 2006.
9838
98392006-01-03 Akim Demaille <akim@epita.fr>
9840
9841 Have glr.cc pass (some of) the calc.at tests.
9842 * data/glr.cc (b4_parse_param_orig): New.
9843 (b4_parse_param): Improve its definition, and bound it more
9844 clearly in the skeleton.
9845 (b4_epilogue): Append, instead of prepending, in order to keep
9846 #line consistency.
9847 Simplify the generation of auxiliary functions: locations and
9848 purity are mandated.
9849 (b4_global_tokens_and_yystype): Honor it.
9850 * data/location.cc (c++.m4): Don't include it.
9851 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
9852 and AT_SKEL_CC_IF.
9853 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
9854 AT_LALR1_CC_IF.
9855 Be sure to initialize the first position's filename.
9856 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
9857 mandated anyway.
9858 (AT_CHECK_CALC_GLR_CC): New.
9859 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
9860
98612006-01-02 Akim Demaille <akim@epita.fr>
9862
9863 * src/output.c (output_skeleton): Don't hard wire the inclusion of
9864 c.m4.
9865 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
9866 * data/glr.cc: Do not include stack.hh.
9867
98682006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
9869
9870 * data/glr.c: Reformat whitespace with tabs.
9871 (b4_lpure_formals): Remove this unused m4 macro.
9872 * tests/cxx-type.at: Reformat whitespace with tabs.
9873 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
9874 since it's a member. Rename type to isNterm for clarity.
9875
98762005-12-29 Akim <akim@sulaco.local>
9877
9878 Let glr.cc catch up with symbol_value_print.
9879 * data/glr.cc (b4_yysymprint_generate): Replace by...
9880 (b4_yy_symbol_print_generate): this.
9881 (yy_symbol_print, yy_symbol_value_print): Declare them.
9882
98832005-12-28 Paul Eggert <eggert@cs.ucla.edu>
9884
9885 * src/location.h (boundary): Note that a line or column equal
9886 to INT_MAX indicates an overflow.
9887 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
9888 (rule_length_overflow, increment_rule_length, add_column_width):
9889 New functions.
9890 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
9891 (<SC_BRACED_CODE>"}"):
9892 Use increment_rule_length rather than incrementing it by hand.
9893 (adjust_location, handle_syncline): Diagnose overflow.
9894 (handle_action_dollar, handle_action_at):
9895 Fix bug with monstrosities like $-2147483648.
9896 Remove now-unnecessary checks.
9897 (scan_integer): Verify assumptions and remove now-unnecessary checks.
9898 (convert_ucn_to_byte): Verify assumptions.
9899 (handle_syncline): New arg LOC. All callers changed.
9900 Don't store through a value derived from char const * pointer.
9901
9902 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
9903 GCC warnings.
9904
99052005-12-27 Paul Eggert <eggert@cs.ucla.edu>
9906
9907 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
9908 Remove unnecessary forward static decls.
9909
99102005-12-27 Akim Demaille <akim@epita.fr>
9911
9912 * src/reader.c (grammar_current_rule_check): Also check that $$
9913 is used.
9914 Take the rule to check as argument, hence rename as...
9915 (grammar_rule_check): this.
9916 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
9917 Rename as...
9918 (grammar_rule_begin, grammar_rule_end): these, for consistency.
9919 (grammar_midrule_action, grammar_symbol_append): Now static.
9920 * tests/torture.at (input): Don't rely on the default action
9921 being always performed.
9922 * tests/calc.at: "Set" $$ even when the action is "cut" with
9923 YYERROR or other.
9924 * tests/actions.at (Exotic Dollars): Instead of using unused
9925 values, check that the warning is issued.
9926
99272005-12-22 Paul Eggert <eggert@cs.ucla.edu>
9928
9929 * NEWS: Improve wording for unused-value warnings.
9930
99312005-12-22 Akim Demaille <akim@epita.fr>
9932
9933 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
9934 (b4_yysymprint_generate): Rename as...
9935 (b4_yy_symbol_print_generate): this.
9936 Generate yy_symbol_print instead of yysymprint.
9937 Generate also yy_symbol_value_print, and use it.
9938
99392005-12-22 Akim Demaille <akim@epita.fr>
9940
9941 * NEWS: Warn about unused values.
9942 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
9943 a `used' member.
9944 (symbol_list_n_get, symbol_list_n_used_set): New.
9945 (symbol_list_n_type_name_get): Use symbol_list_n_get.
9946 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
9947 * src/reader.c (grammar_current_rule_check): Check that values are
9948 used.
9949 * src/symtab.c (symbol_print): Accept 0.
9950 * tests/existing.at: Remove the type information.
9951 Empty the actions.
9952 Remove useless actions (beware of mid-rule actions: perl -000
9953 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
9954 * tests/actions.at (Exotic Dollars): Use unused values.
9955 * tests/calc.at: Likewise.
9956 * tests/glr-regression.at (No users destructors if stack 0 deleted):
9957 Likewise.
9958
9959 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
9960 rule_useful_p.
9961
99622005-12-21 Paul Eggert <eggert@cs.ucla.edu>
9963
9964 Undo 2005-12-01 tentative license wording change. The wording is
9965 still being reviewed by the lawyers, and we don't want to wait for
9966 them before publishing a test release. For now, revert to the
9967 previous wording.
9968 * NEWS: Undo 2005-12-01 change.
9969 * data/glr.c: Revert to previous license wording.
9970 * data/glr.cc: Likewise.
9971 * data/lalr1.cc: Likewise.
9972 * data/location.cc: Likewise.
9973 * data/yacc.c: Likewise.
9974
9975 * NEWS: Reword %destructor vs YYABORT etc.
9976 * data/glr.c: Use American spacing, for consistency.
9977 * data/glr.cc: Likewise.
9978 * data/lalr1.cc: Likewise.
9979 * data/yacc.c: Likewise.
9980 * data/yacc.c: Reformat comments slightly.
9981 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
9982 for consistency. Fix some spelling errors and reword recently-included
9983 text slightly.
9984 * tests/cxx-type.at: Cast results of malloc, for C++.
9985
99862005-12-21 Joel E. Denny <address@hidden>
9987
9988 * tests/cxx-type.at: Construct a tree, count the parents of shared
9989 nodes, and free each node once and only once. Previously, the memory
9990 for semantic values was leaked instead.
9991
99922005-12-21 Joel E. Denny <address@hidden>
9993
9994 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
9995 (yylval, yylloc): If pure, #define to yystackp->yyval and
9996 yystackp->yyloc similar to yychar and yynerrs.
9997 (yyparse): If pure, remove local yylval and yylloc. Add local
9998 yystackp to accommodate pure definitions of yylval and yylloc.
9999 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
10000 yylvalp and yyllocp to &yylval and &yylloc.
10001 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
10002 namespace. Previously, nerrs and char were missing, but lval and lloc
10003 weren't necessary.
10004 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
10005 yylvalp and yyllocp parameters since, if pure, these are now always
10006 accessible through yystackp. If not pure, they are still accessible
10007 globally.
10008 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
10009 `if (YYID (N))' to pacify lint.
10010
100112005-12-21 Akim Demaille <akim@epita.fr>
10012
10013 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
10014 destroy the RHS symbols of a rule.
10015 * data/yacc.c (yylen): Initialize to 0.
10016 Keep its value to the number of items to possibly shift.
10017 In particular, a regular successful parse that ends on YYFINAL by
10018 a (internal) YYACCEPT must not have yylen != 0.
10019 (yyerrorlab, yyreturn): Pop the RHS.
10020 Reorder a bit to emphasize the `shifting' bits of code.
10021 (YYPOPSTACK): Now accept a number of items to pop.
10022 * data/lalr1.cc: Likewise.
10023 * data/glr.c: Formatting changes.
10024 Use goto instead of fall through.
10025 * doc/bison.texinfo (Destructor Decl): Complete.
10026
100272005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10028
10029 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10030 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
10031 * djgpp/config.bat: Replace every occurence of the file name
10032 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10033 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10034 * djgpp/config.sed: Replace every occurence of the file name
10035 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10036 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10037 * djgpp/djunpack.bat: DJGPP specific file.
10038 * djgpp/fnchange.lst: DJGPP specific file.
10039 * djgpp/README.in: Add new information about how to unpack the bison
10040 source on MSDOS and other systems which have 8.3 file name restrictions
10041 using djunpack.bat and fnchange.lst.
10042
100432005-12-12 Paul Eggert <eggert@cs.ucla.edu>
10044
10045 * bootstrap (build_cvs_prefix): Remove; unused.
10046 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
10047 when getting gnulib.
10048
100492005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
10050
10051 * data/glr.c: Reorder typedef declarations for structs to match order
10052 of struct declarations.
10053 Rename yystack everywhere to yystackp except in yyparse where it's not
10054 a pointer.
10055 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
10056 consistency.
10057 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
10058 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
10059 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
10060 lint.
10061
100622005-12-09 Paul Eggert <eggert@cs.ucla.edu>
10063
10064 * tests/sets.at (Accept): Fix typos in regular expression used to
10065 sed out the final state number.
10066
10067 Work around portability problem on Solaris 10: flex-generated
10068 files include <stdio.h> before <config.h>, which messes up
10069 because the latter defines __EXTENSIONS__. Address the problem
10070 by creating two new little files that include <config.h> first,
10071 then include the flex-generated files. Rewrite everyone else
10072 to include <config.h> first, as well.
10073 * lib/timevar.c: Always include "config.h".
10074 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
10075 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
10076 (EXTRA_bison_SOURCES): New macro.
10077 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
10078 * src/system.h: Don't include config.h.
10079 * src/LR0.c: Include <config.h> first.
10080 * src/assoc.c: Likewise.
10081 * src/closure.c: Likewise.
10082 * src/complain.c: Likewise.
10083 * src/conflicts.c: Likewise.
10084 * src/derives.c: Likewise.
10085 * src/files.c: Likewise.
10086 * src/getargs.c: Likewise.
10087 * src/gram.c: Likewise.
10088 * src/lalr.c: Likewise.
10089 * src/location.c: Likewise.
10090 * src/main.c: Likewise.
10091 * src/muscle_tab.c: Likewise.
10092 * src/nullable.c: Likewise.
10093 * src/output.c: Likewise.
10094 * src/parse-gram.y: Likewise.
10095 * src/print.c: Likewise.
10096 * src/print_graph.c: Likewise.
10097 * src/reader.c: Likewise.
10098 * src/reduce.c: Likewise.
10099 * src/relation.c: Likewise.
10100 * src/state.c: Likewise.
10101 * src/symlist.c: Likewise.
10102 * src/symtab.c: Likewise.
10103 * src/tables.c: Likewise.
10104 * src/uniqstr.c: Likewise.
10105 * src/vcg.c: Likewise.
10106
10107 * src/parse-gram.y: Fix minor problems uncovered by lint.
10108 (current_lhs, current_lhs_location): Now static.
10109 (current_assoc): Remove unused variable.
10110
10111 Cleanups so that Bison-generated parsers have less lint.
10112 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
10113 Prepend /*ARGSUSED*/, for lint's sake.
10114 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
10115 definition if 'lint' is defined.
10116 (YYID): New macro (or function, if lint).
10117 All uses of /*CONSTCOND*/0 replaced by YYID(0).
10118 * data/yacc.c: Likewise.
10119 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
10120 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
10121 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
10122 is C++ only.
10123 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
10124 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
10125 Use YYID(0) rather than 0, for lint.
10126 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
10127 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
10128
101292005-12-07 Paul Eggert <eggert@cs.ucla.edu>
10130
10131 * tests/glr-regression.at
10132 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10133 Close memory leak reported by twlevo.
10134
101352005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
10136
10137 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
10138 all stacks.
10139 (yyparse): Iterate another stack in order to call user destructors.
10140 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10141 New test case.
10142 (Duplicated user destructor for lookahead): This test now is expected
10143 to succeed.
10144
101452005-12-01 Paul Eggert <eggert@cs.ucla.edu>
10146
10147 * NEWS: Document the following change.
10148 * data/yacc.c: Say "parser skeleton" rather than "file", since
10149 it's no longer just a file.
10150 * data/glr.c: Grant a special exception for C GLR parsers, that
10151 reads like the already-existing exception for C LALR(1) parsers.
10152 * data/glr.cc: Likewise.
10153 * data/lalr1.cc: Likewise.
10154 * data/location.cc: Likewise.
10155 * data/yacc.c: Reword the "written by" statement to clarify that
10156 it was the parser skeleton, not the entire output file.
10157 * data/glr.c: Written by Paul Hilfinger.
10158 * data/glr.cc: Written by Akim Demaille.
10159 * data/lalr1.cc: Likewise.
10160
101612005-11-18 Paul Eggert <eggert@cs.ucla.edu>
10162
10163 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
10164 Fix typos in previous change that broke 'make check'.
10165 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
10166 supported in C.
10167 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
10168 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
10169 We can revert this once things settle down.
10170
10171 * src/conflicts.c (conflicts_print): Don't print file name twice
10172 when %expect fails because there were no conflicts.
10173 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
10174 change.
10175 * tests/conflicts.at (%expect not enough, %expect too much):
10176 (%expect with reduce conflicts): Adjust to new behavior.
10177
101782005-11-18 Akim Demaille <akim@epita.fr>
10179
10180 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
10181 errors.
10182 * NEWS: Document this.
10183 * doc/bison.texinfo (Expect Decl): Likewise.
10184
101852005-11-16 Akim Demaille <akim@epita.fr>
10186
10187 Generalize the display of semantic values and locations in traces.
10188 * data/glr.c (yy_reduce_print): Fix indices (again).
10189 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
10190 literal integers.
10191 * data/lalr1.cc (yyreduce_print): Rename as...
10192 (yy_reduce_print): this.
10193 Display values and locations.
10194 * data/yacc.c (yy_reduce_print): Likewise.
10195 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
10196 (yysymprint): Move higher to be visible from yy_reduce_print).
10197 (yyparse): Adjust.
10198 * tests/calc.at: Adjust the expected length of the traces.
10199
102002005-11-14 Akim Demaille <akim@epita.fr>
10201
10202 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
10203 from 1 to N, while values and location start at 0.
10204 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
10205
102062005-11-14 Akim Demaille <akim@epita.fr>
10207
10208 * data/glr.c (yy_reduce_print): Fix the $ number.
10209
102102005-11-14 Akim Demaille <akim@epita.fr>
10211
10212 "Use" parse parameters.
10213 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
10214 * data/glr.c, data/glr.cc: Use them.
10215 * data/glr.c (YYUSE): Have a C++ definition that supports
10216 non-pointer types.
10217
102182005-11-14 Akim Demaille <akim@epita.fr>
10219
10220 * data/glr.c (yyexpandGLRStack): Declare only if defined.
10221
102222005-11-14 Akim Demaille <akim@epita.fr>
10223
10224 * data/glr.cc: New.
10225 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
10226
102272005-11-12 Akim Demaille <akim@epita.fr>
10228
10229 Let position and location be PODs.
10230 * data/location.cc (position::initialize, location::initialize): New.
10231 (position::position, location::location): Define only if
10232 b4_location_constructors is defined.
10233 * data/lalr1.cc (b4_location_constructors): Define it for backward
10234 compatibility.
10235 * doc/bison.texinfo (Initial Action Decl): Use initialize.
10236
102372005-11-12 Akim Demaille <akim@epita.fr>
10238
10239 * data/lalr1.cc: Move the body of the ctor and dtor into the
10240 parser file (instead of the header).
10241 Wrap the implementations in a "namespace yy".
10242
102432005-11-12 Akim Demaille <akim@epita.fr>
10244
10245 Have glr.c include its header file when created.
10246 * data/glr.c (b4_shared_declarations): New.
10247 Output them verbatim in the parser if !%defines, otherwise
10248 output then in the header file, and include it instead.
10249
102502005-11-11 Akim Demaille <akim@epita.fr>
10251
10252 * data/glr.c: Comment changes.
10253
102542005-11-11 Akim Demaille <akim@epita.fr>
10255
10256 When yydebug, report semantic and location values for reductions.
10257 * data/glr.c (yy_reduce_print): Report the semantic values and the
10258 locations.
10259 (YY_REDUCE_PRINT): Adjust.
10260 (yyglrReduce): Use them.
10261 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
10262 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
10263 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
10264 traces.
10265
102662005-11-10 Akim Demaille <akim@epita.fr>
10267
10268 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
10269 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
10270 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
10271
102722005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
10273
10274 * m4/cxx.m4, examples/Makefile.am: Don't build
10275 examples/calc++ if no C++ compiler is available. (trivial change)
10276
102772005-11-09 Akim Demaille <akim@epita.fr>
10278
10279 * src/scan-skel.l: Use a couple of asserts.
10280
102812005-11-03 Akim Demaille <akim@epita.fr>
10282
10283 In some (weird) cases, the final state number is incorrect.
10284 Reported by Alexandre Duret-Lutz.
10285 * src/LR0.c (state_list_append): Remove the computation of
10286 final_state.
10287 (save_reductions): Do it here.
10288 (get_state): Alpha conversion.
10289 (generate_states): Use a for loop.
10290 * src/gram.h (item_number_is_rule_number)
10291 (item_number_is_symbol_number): New.
10292 * src/state.c: Use assert.
10293 * src/system.h: Include assert.h.
10294 * tests/sets.at (Accept): New.
10295
102962005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10297
10298 * data/glr.c (yyfill): Adjust comment.
10299 (yyresolveAction): Initialize default location properly
10300 for empty right-hand sides.
10301 (yydoAction): Ditto.
10302 Add comment explaining apparently dead code.
10303 * tests/glr-regression.at
10304 (Incorrectly initialized location for empty right-hand side in GLR):
10305 New test.
10306
103072005-10-30 Paul Eggert <eggert@cs.ucla.edu>
10308
10309 * bootstrap (cleanup_gnulib): New function. Use it to clean up
10310 gnulib when interrupted. This fixes some race conditions and
10311 works around some portability problems (one noted by Paul
10312 Hilfinger).
10313
103142005-10-22 Akim <akim@epita.fr>
10315
10316 * Makefile.cfg: Adjust to config -> build-aux.
10317 Reported by twledo.
10318
103192005-10-21 Akim Demaille <akim@epita.fr>
10320
10321 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
10322 the %parse-params.
10323 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
10324 * data/yacc.c (b4_Pure_if): Rename as...
10325 (b4_yacc_pure_if): this.
10326 (YY_SYMBOL_PRINT, yyparse): Adjust.
10327 * doc/bison.texinfo: Formatting changes.
10328
103292005-10-21 Akim Demaille <akim@epita.fr>
10330
10331 Finish the transition config -> build-aux.
10332 * configure.ac, Makefile.am: Use build-aux.
10333 * config/prev-version, config/announce-gen, config/Makefile.am:
10334 Move to...
10335 * build-aux/prev-version, build-aux/announce-gen,
10336 * build-aux/Makefile.am: here.
10337
103382005-10-14 Akim Demaille <akim@epita.fr>
10339
10340 * examples/calc++/test: Use set -x only when VERBOSE.
10341
103422005-10-13 Paul Eggert <eggert@cs.ucla.edu>
10343
10344 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
10345 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
10346
103472005-10-13 Akim Demaille <akim@epita.fr>
10348
10349 * src/scan-skel.l: Output the base name parts of the parser and
10350 header file names.
10351 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
10352 additional checks.
10353 Use this to exercise C++ outputs in subdirs.
10354 Reported by Oleg Smolsky.
10355
103562005-10-12 Paul Eggert <eggert@cs.ucla.edu>
10357
10358 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
10359 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
10360 Problem reported by John P. Hartmann.
10361 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
10362 already defined it.
10363
103642005-10-12 Akim Demaille <akim@epita.fr>
10365
10366 * src/parse-gram.y (version_check): Exit 63 to please missing
10367 (stands for "version mismatch).
10368 * tests/input.at, doc/bison.texinfo: Adjust.
10369
103702005-10-10 Paul Eggert <eggert@cs.ucla.edu>
10371
10372 Work around portability problems with Visual Age C compiler
10373 (xlc and xlC_r) reported by John P. Hartmann.
10374 * data/location.cc (initial_column, initial_line): Remove.
10375 All uses replaced by 0 and 1.
10376 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
10377 that xlc complains about.
10378 * src/scan-skel.l (skel_wrap): Likewise.
10379 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
10380 as __STDC__.
10381 * data/yacc.c (YYMODERN_C): New macro, which also looks at
10382 __STDC_VERSION__. Use it everywhere instead of looking at
10383 __STDC__ and __cplusplus.
10384
103852005-10-10 Akim Demaille <akim@epita.fr>
10386
10387 * examples/calc++/test: Be quiet unless VERBOSE.
10388
103892005-10-05 Paul Eggert <eggert@cs.ucla.edu>
10390
10391 * data/c.m4 (yydestruct, yysymprint):
10392 Use YYUSE instead of casting to void.
10393 * data/glr.c (YYUSE): New macro.
10394 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10395 Use it instead of rolling our own.
10396 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10397 (YYCHK1):
10398 Use /*CONSTCOND*/ to suppress lint warnings.
10399 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10400 (YY_STACK_PRINT): Use 'false' not '0'.
10401 (YYUSE): New macro.
10402 (yysymprint_, yydestruct_): Use it instead of rolling our own.
10403 * data/yacc.c (YYUSE): New macro.
10404 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
10405 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
10406 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
10407
10408
10409 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
10410 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
10411
104122005-10-04 Paul Eggert <eggert@cs.ucla.edu>
10413
10414 Undo the parts of the unlocked-I/O change that substituted
10415 putc or puts for printf. This might hurt performance a bit,
10416 but some people prefer the printf style.
10417 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
10418 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
10419 All uses replaced by YYFPRINTF and YYDPRINTF.
10420 * data/yacc.c: Likewise.
10421 * lib/bitset.c (bitset_print): Likewise.
10422 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
10423 putc and puts.
10424 * lib/lbitset.c (debug_lbitset): Likewise.
10425 * src/closure.c (print_firsts, print_fderives): Likewise.
10426 * src/gram.c (grammar_dump): Likewise.
10427 * src/lalr.c (look_ahead_tokens_print): Likewise.
10428 * src/output.c (escaped_output): Likewise.
10429 (user_actions_output): Break apart two printfs.
10430 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
10431 * src/reduce.c (reduce_print): Likewise.
10432 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
10433 * src/system.h: Include unlocked-io.h rathe than stdio.h.
10434
10435 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10436 Use assignments rather than casts-to-void to suppress
10437 unused-variable warnings. This pacifies 'lint'.
10438 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
10439 unused-variable warnings.
10440
104412005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10442
10443 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10444
104452005-10-02 Paul Eggert <eggert@cs.ucla.edu>
10446
10447 Use unlocked I/O for a minor performance improvement on hosts like
10448 GNU/Linux and Solaris that support unlocked I/O. The basic idea
10449 is to use the gnlib unlocked-io module, and to prefer putc and
10450 puts to printf when either will work (since the latter doesn't
10451 come in an unlocked flavor).
10452 * bootstrap (gnulib_modules): Add unlocked-io.
10453 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
10454 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
10455 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
10456 and similarly for puts and putc and printf.
10457 * data/yacc.c: Likewise.
10458 * lib/bitset.c (bitset_print): Likewise.
10459 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
10460 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
10461 to printf.
10462 * lib/lbitset.c (debug_lbitset): Likewise.
10463 * src/closure.c (print_firsts, print_fderives): Likewise.
10464 * src/gram.c (grammar_dump): Likewise.
10465 * src/lalr.c (look_ahead_tokens_print): Likewise.
10466 * src/output.c (escaped_output): Likewise.
10467 (user_actions_output): Coalesce two printfs.
10468 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
10469 * src/reduce.c (reduce_print): Likewise.
10470 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
10471 * src/system.h: Include unlocked-io.h rather than stdio.h.
10472
10473 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
10474 this confuses xgettext.
10475
104762005-10-02 Akim Demaille <akim@epita.fr>
10477
10478 * bootstrap (gnulib_modules): Add strverscmp.
10479 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
10480 * m4/.cvsignore: Add strverscmp.m4.
10481 * src/parse-gram.y (%require): New token, new rule.
10482 (version_check): New.
10483 * src/scan-gram.l (%require): Adjust.
10484 * tests/input.at (AT_REQUIRE): New.
10485 Use it.
10486 * doc/bison.texinfo (Require Decl): New.
10487 (Calc++ Parser): Use %require.
10488
104892005-10-02 Akim Demaille <akim@epita.fr>
10490
10491 * data/location.cc: New.
10492
104932005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
10494 Akim Demaille <akim@epita.fr>
10495
10496 Make sure -odir/foo.cc creates dir/location.hh etc.
10497 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
10498 (spec_file_prefix, spec_verbose_file, spec_graph_file)
10499 (spec_defines_file): Now const.
10500 (dir_prefix): New.
10501 (short_base_name): Remove.
10502 * src/files.c: Adjust.
10503 (dirname.h): Include.
10504 (base_name): Don't prototype it.
10505 (finput): Remove, duplicates gram_in.
10506 (full_base_name, short_base_name): Replace by...
10507 (all_but_ext, all_but_tab_ext): these.
10508 (compute_base_names): Rename as...
10509 (compute_file_name_parts): this.
10510 Update to compute the new variables, including dir_prefix.
10511 Adjust dependencies.
10512 * src/output.c (prepare): Output them.
10513 * src/reader.c: Adjust to use gram_in, not finput.
10514 * src/scan-skel.l (@dir_prefix@): New.
10515
105162005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10517
10518 * lib/subpipe.c: New function end_of_output_subpipe() added
10519 to allow support for non-posix systems. This is a no-op function
10520 for posix systems.
10521
10522 * lib/subpipe.h: New function end_of_output_subpipe() added
10523 to allow support for non-posix systems. This is a no-op function
10524 for posix systems.
10525
10526 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
10527 handle the lack of pipe/fork functionality on non-posix systems.
10528
10529 * djgpp/Makefile.maint: DJGPP specific file.
10530
10531 * djgpp/README.in: DJGPP specific file.
10532
10533 * djgpp/config.bat: DJGPP specific configuration file.
10534
10535 * djgpp/config.sed: DJGPP specific configuration file.
10536
10537 * djgpp/config.site: DJGPP specific configuration file.
10538
10539 * djgpp/config_h.sed: DJGPP specific configuration file.
10540
10541 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
10542
10543 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
10544
105452005-10-02 Akim Demaille <akim@epita.fr>
10546
10547 * data/location.cc: New, extract from...
10548 * data/lalr1.cc: here.
10549 (location.hh): Include it after the user prologue, in case the
10550 filename type is defined by the user.
10551 Forward declation location and position before the pre-prologue.
10552 (yyresult_): Rename as...
10553 (yyresult): this, it's a local variable, not an attribute.
10554 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
10555
105562005-10-01 Akim Demaille <akim@epita.fr>
10557
10558 * examples/extexi: Restore the #line generation.
10559
105602005-09-30 Akim Demaille <akim@epita.fr>,
10561 Alexandre Duret-Lutz <adl@gnu.org>
10562
10563 Move the token type and YYSTYPE in the parser class.
10564 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
10565 (parser::token): New, from the moved free definition of tokens.
10566 (parser::semantic_value): Now a full definition instead of an
10567 indirection to YYSTYPE.
10568 (b4_post_prologue): No longer included in the header file, but
10569 in the implementation file.
10570 * doc/bison.texi (C+ Language Interface): Update.
10571 * src/parse-gram.y: Support unary %define.
10572 * tests/actions.at: Define global_tokens_and_yystype for backward
10573 compatibility until we update the tests.
10574 * tests/calc.at: Idem.
10575 (first_line, first_column, last_line, last_column): Define for lalr1.cc
10576 to simplify the code.
10577
105782005-09-29 Paul Eggert <eggert@cs.ucla.edu>
10579
10580 Port to SunOS 4.1.4, which lacks strtoul and strerror.
10581 Ah, the good old days! Problem reported by Peter Klein.
10582 * bootstrap (gnulib_modules): Add strerror, strtoul.
10583 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
10584 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
10585
105862005-09-29 Akim Demaille <akim@epita.fr>
10587
10588 * data/c.m4 (b4_error_verbose_if): New.
10589 * data/lalr1.cc: Use it.
10590 (YYERROR_VERBOSE_IF): Remove.
10591 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
10592 parser members, replaced by...
10593 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
10594 local variables.
10595 (yysyntax_error_): Takes the state number as argument.
10596 (yyreduce_print_): Use the argument yyrule, not the former
10597 attribute yyn_.
10598
105992005-09-26 Paul Eggert <eggert@cs.ucla.edu>
10600
10601 * bootstrap (gnulib_modules): Add verify.
10602 * lib/.cvsignore: Add verify.h.
10603 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
10604 * src/system.h (verify): Remove.
10605 Include verify.h instead.
10606 * src/tables.c (tables_generate): Use new API for 'verify'.
10607
106082005-09-21 Paul Eggert <eggert@cs.ucla.edu>
10609
10610 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
10611 local variables whose names begin with 'yy'.
10612 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
10613 Trivial changes from Joel E. Denny.
10614
10615 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
10616 it itself.
10617 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
10618 don't use alloca any more.
10619
10620 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
10621 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
10622 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
10623 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
10624 to match yacc.c, to test more hosts.
10625
106262005-09-20 Paul Eggert <eggert@cs.ucla.edu>
10627
10628 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
10629 doesn't affect behavior.
10630 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
10631 Solaris, AIX, MSC.
10632 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
10633 This works a bit better with glibc, if user code has already included
10634 stdlib.h.
10635 * doc/bison.texinfo (Bison Parser): Document that users can't
10636 arbitrarily use malloc and free for other purposes. Document
10637 that <alloca.h> and <malloc.h> might be included.
10638 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
10639 user must declare alloca.
10640
10641 * HACKING (release): Forwarn the Translation Project about
10642 stable releses.
10643
106442005-09-20 Akim Demaille <akim@epita.fr>
10645
10646 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
10647
106482005-09-19 Paul Eggert <eggert@cs.ucla.edu>
10649
10650 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
10651 (YYSTACK_ALLOC_MAXIMUM): Use it.
10652 (yysyntax_error): New function.
10653 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
10654 multiple syntax errors are reported, and alloca is being used.
10655 Instead, reallocate buffers twice as big each time, so that
10656 we waste at most half the allocated memory. Start with a small
10657 (128-byte) buffer that will suffice in most cases anyway.
10658 Use yysyntax_error to do most of the work.
10659
10660 * doc/bison.texinfo (Error Reporting, Table of Symbols):
10661 yynerrs is the number of errors reported, not the number of
10662 errors encountered.
10663
10664 * tests/glr-regression.at (Duplicated user destructor for lookahead):
10665 Mark it as expected to fail.
10666 Cast result of malloc; problem reported by twlevo@xs4all.nl.
10667 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
10668 Don't start user-code symbols with "yy", to avoid name space problems.
10669
106702005-09-19 Akim Demaille <akim@epita.fr>
10671
10672 Remove the traits, failed experiment.
10673 It never proved useful, and anyway because of the current
10674 definition, it was not possible to have several specialization of
10675 this traits, making it useless.
10676 * data/lalr1.cc (yy:traits): Remove.
10677 Inline its definitions in the parser class.
10678
106792005-09-19 Akim Demaille <akim@epita.fr>
10680
10681 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
10682 least Mac OSX with a /usr/local install of gettext.
10683
106842005-09-19 Akim Demaille <akim@epita.fr>
10685
10686 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
10687 and yytoken for similarity with the other skeletons.
10688
106892005-09-19 Akim Demaille <akim@epita.fr>
10690
10691 * NEWS, configure.ac: update version number to 2.1a.
10692
106932005-09-16 Paul Eggert <eggert@cs.ucla.edu>
10694
10695 * NEWS: Version 2.1.
10696
10697 * NEWS: Remove notice of yytname change, since it was never in an
10698 official release.
10699 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
10700 diagnostic.
10701 * src/output.c (prepare): Likewise.
10702 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
10703 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
10704 is not defined. This is an awful hack, but it's enough for now.
10705 All callers changed.
10706 * tests/glr-regression-at (make_value): Args are const pointers now,
10707 to avoid GCC warning.
10708 (Duplicated user destructor for lookahead): New test. Currently
10709 skipped. It fails on my host but I'm not sure it'll always fail.
10710
107112005-09-16 Akim Demaille <akim@epita.fr>
10712
10713 * src/symtab.h (struct symbol): Declare the printer and destructor
10714 as const, to avoid accidental calls to free.
10715 (symbol_destructor_set, symbol_printer_set): Adjust.
10716 * src/symtab.c: Adjust.
10717
107182005-09-16 Akim Demaille <akim@epita.fr>
10719
10720 * data/c.m4 (b4_token_enums): New.
10721 (b4_token_defines): Rename as...
10722 (b4_token_enums_defines): this.
10723 (b4_token_defines): New, output only the #defines.
10724 * data/yacc.c, data/glr.c: Adjust.
10725 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
10726 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
10727 as default values.
10728
107292005-09-16 Akim Demaille <akim@epita.fr>
10730
10731 * data/lalr1.cc (yylex_): Remove, inline its code.
10732 (yyreport_syntax_error_): Remove, replaced by...
10733 (yysyntax_error_): this which returns a string and leaves to the
10734 caller the call to the users' error function.
10735 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
10736 Move from members of the parser object...
10737 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
10738 to local variables of the parse function.
10739
107402005-09-16 Akim Demaille <akim@epita.fr>
10741
10742 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
10743 since it's in Bison's name space.
10744
107452005-09-15 Paul Eggert <eggert@cs.ucla.edu>
10746
10747 * data/glr.c (yyresolveValue): Add default case to pacify
10748 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
10749
10750 * NEWS: Document when yyparse started to return 2.
10751 * doc/bison.texinfo (Parser Function): Document when yyparse
10752 returns 2.
10753
10754 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
10755 (b4_filename_type): Renamed back from b4_file_name_type. All uses
10756 changed.
10757 (class position): file_name -> filename (reverting). All uses changed.
10758
107592005-09-14 Paul Eggert <eggert@cs.ucla.edu>
10760
10761 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
10762 do anything if $@ exists. This reverts part of the 2005-07-07
10763 patch.
10764
107652005-09-11 Paul Eggert <eggert@cs.ucla.edu>
10766
10767 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
10768 contains obsolete information and isn't worth distributing as a
10769 separate file anyway.
10770 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
10771 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
10772 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
10773 (yyparse): Abort if user code uses longjmp to throw an unexpected
10774 value.
10775
107762005-09-09 Paul Eggert <eggert@cs.ucla.edu>
10777
10778 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
10779 Suggested by twlevo@xs4all.nl.
10780
10781 * data/glr.c (YYCHK1): Do not assume YYE is in range.
10782 This avoids a diagnostic from gcc -Wswitch-enum.
10783 Problem reported by twlevo@xs4all.nl.
10784
10785 * doc/bison.texinfo: Don't use "filename", as per GNU coding
10786 standards. Use "file name" or "file" or "name", depending on
10787 the context.
10788 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
10789 not to hack/foo.tab.c.
10790 (Calc++ Top Level): 2nd arg of main is not const.
10791 * data/glr.c: b4_filename -> b4_file_name.
10792 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
10793 All uses changed.
10794 (class position): filename -> file_name. All uses changed.
10795 * data/yacc.c: b4_filename -> b4_file_name.
10796 * lib/bitset.h: filename -> file_name in local vars.
10797 * lib/bitset_stats.c: Likewise.
10798 * src/files.c: Likewise.
10799 * src/scan-skel.l ("@output ".*\n): Likewise.
10800 * src/files.c (file_name_split): Renamed from filename_split.
10801 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
10802
108032005-09-08 Paul Eggert <eggert@cs.ucla.edu>
10804
10805 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
10806 to accommodate latest gnulib.
10807
10808 * tests/glr-regression.at (Duplicate representation of merged trees):
10809 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
10810
10811 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
10812 needed.
10813
108142005-08-26 Paul Eggert <eggert@cs.ucla.edu>
10815
10816 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
10817 All uses changed. Invoke user destructor after an error during a
10818 split parse (trivial change from Joel E. Denny).
10819
10820 * tests/glr-regression.at
10821 (User destructor after an error during a split parse): New test case.
10822 Problem reported by Joel E. Denny in:
10823 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
10824
108252005-08-25 Paul Eggert <eggert@cs.ucla.edu>
10826
10827 * README-cvs: Give URLs for recommended tools.
10828 Mention Gzip version problem, and bootstrapping issues.
10829 Remove troubleshooting section, as it's somewhat obsolete.
10830
10831 * bootstrap (no_cache): New var, to accommodate different wget
10832 variants. Use it instead of '-C off'. Problem reported by
10833 twlevo@xs4all.nl.
10834
10835 * data/glr.c (yydestroyStackItem): New function.
10836 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
10837 debugging information. Problem reported by Joel E. Denny.
10838
108392005-08-25 Akim Demaille <akim@epita.fr>
10840
10841 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
10842
108432005-08-24 Paul Eggert <eggert@cs.ucla.edu>
10844
10845 * data/glr.c (yyrecoverSyntaxError, yyreturn):
10846 Don't invoke destructor on unresolved entries.
10847 * tests/glr-regression.at
10848 (User destructor for unresolved GLR semantic value): New test case.
10849 Problem reported by Joel E. Denny in:
10850 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
10851
108522005-08-21 Paul Eggert <eggert@cs.ucla.edu>
10853
10854 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
10855 Add strnlen.c.
10856 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
10857 lib-prefix.m4, po.m4.
10858
10859 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
10860 in yydestruct diagnostic, since it might not be an error.
10861 Problem reported by Joel Denny near end of
10862 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
10863 * data/lalr1.cc (yyerturn): Likewise.
10864 * data/yacc.c (yyreturn): Likewise.
10865 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
10866
10867 * src/files.c: Remove obsolete FIXME comment.
10868
10869 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
10870 with the other templates, and to fix bogus run-on messages such
10871 as the one reported at the end of
10872 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
10873 All callers changed to avoid the newline.
10874 (yyprocessOneStack): Output two lines rather than one, to accommodate
10875 the above change. This changes the debug output format slightly.
10876
10877 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
10878 reported by Joel E. Denny in
10879 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
10880 (trivial change).
10881 * tests/glr-regression.at (Duplicate representation of merged trees):
10882 New test, from Joel E. Denny in:
10883 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
10884 * THANKS: Add Joel E. Denny.
10885
10886 * configure.ac (AC_INIT): Bump to 2.0c.
10887
108882005-07-24 Paul Eggert <eggert@cs.ucla.edu>
10889
10890 * NEWS: Version 2.0b.
10891
10892 * Makefile.am (SUBDIRS): Put examples before tests, so that
10893 "make check" doesn't finish with "All 1 tests passed".
10894
10895 * tests/regression.at (Token definitions): Don't rely on
10896 AT_PARSER_CHECK for data that contains backslashes. It currently
10897 uses 'echo', and 'echo' isn't portable if its argument contains
10898 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
10899 that the byte '\0xff' is not printable in the C locale; it is,
10900 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
10901 not printable, so use '\0x81' to test.
10902
10903 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
10904 version of GCC, since the macro is used with non-GCC compilers.
10905
10906 Fix core dump reported by Pablo De Napoli in
10907 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
10908 * tests/regression.at (Invalid inputs with {}): New test.
10909 * src/parse-gram.y (token_name): Translate type before using
10910 it as an index.
10911
10912 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
10913 the user's name space. All uses changed to __attribute__
10914 ((__unused__)).
10915 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
10916 Add __attribute__ ((__noreturn__)).
10917
10918 * etc/clcommit: Remove. We weren't using it, and it failed
10919 "make maintainer-distcheck".
10920 * Makefile.maint: Merge from coreutils.
10921 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
10922 (syntax-check-rules): Change list of rules as described below.
10923 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
10924 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
10925 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
10926 (sc_trailing_space): New rules.
10927 (sc_xalloc_h_in_src): Remove.
10928 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
10929 (sc_space_tab, sc_error_exit_success, sc_changelog):
10930 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
10931 (makefile-check, po-check, author_mark_check):
10932 (makefile_path_separator_check, copyright-check):
10933 Use grep -n, to make it easier to find violations.
10934 Use CVS_LIST and CVS_LIST_EXCEPT.
10935 (header_regexp, h_re): Remove.
10936 (dd_c): New macro.
10937 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
10938 (my-distcheck): Use more-modern GCC flags.
10939 (signatures, %.asc): Remove.
10940 (rel-files, announcement): Remove signatures.
10941 Restore old updating code, even though we don't use it, so
10942 that we're the same as coreutils.
10943 (alpha, beta, major): Depend on news-date-check.
10944 Make the upload commands.
10945
10946 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
10947 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
10948 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
10949 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
10950 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
10951 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
10952 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
10953 * tests/sets.at: Likewise.
10954
10955 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
10956 we comment out the Autoconf version number.
10957 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
10958 it's error-prone and "make maintainer-distcheck" rejects it.
10959
10960 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
10961 Indent calls to "error" to pacify "make maintainer-distcheck",
10962 when the calls are not intended to be translated.
10963 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
10964
10965 * src/Makefile.am (DEFS): Use +=, to pacify
10966 "make maintainer-distcheck".
10967 (bison_SOURCES): Add scan-skel.h.
10968 (sc_tight_scope): New rule, from coreutils.
10969
10970 * src/files.c (src_extension, header_extension):
10971 Now static, not extern.
10972 * src/getargs.c (short_options): Likewise.
10973 * src/muscle_tab.c (muscle_table): Likewise.
10974 * src/parse-gram.y (current_class, current_type, current_prec):
10975 Likewise.
10976 * src/reader.c (grammar_end, previous_rule_end): Likewise.
10977 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
10978 * src/main.c (main): Cast bindtextdomain and textdomain calls to
10979 void, to avoid warning when NLS is disabled.
10980 * src/output.c: Include scan-skel.h.
10981 (scan_skel): Remove decl, since scan-skel.h does this.
10982 (output_skeleton):
10983 Indent calls to "error" to pacify "make maintainer-distcheck".
10984 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
10985 * src/reader.h (gram_end, gram_lineno): New decls to pacify
10986 "make maintainer-distcheck".
10987 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
10988 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
10989 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
10990 (skel_lex_destroy, scan_skel): Move these decls to...
10991 * src/scan-skel.h: New file.
10992 * src/uniqstr.c (uniqstr_assert):
10993 Indent calls to "error" to pacify "make maintainer-distcheck".
10994
10995 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
10996 not @VAR@.
10997
10998 * tests/torture.at: Revamp to avoid misuse of atoi that
10999 "make maintainer-distcheck" complained about.
11000
11001 * examples/extexi (message): Don't print a message more than once,
11002 and omit line-number decoration that makes Emacs compile think
11003 that informative messages are worth worrying about.
11004
110052005-07-22 Paul Eggert <eggert@cs.ucla.edu>
11006
11007 * configure.ac: Update version number.
11008
11009 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
11010 accidentally.
11011 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
11012 autogenerated by the maintainer.
11013 * examples/calc++/.cvsignore: Add *.yy.
11014
11015 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
11016 * lib/bitset_stats.c (bitset_stats_init): Likewise.
11017 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11018
11019 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
11020
11021 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
11022 from maintainer-distcheck about casting the argument of 'free'.
11023
11024 * NEWS: Mention recent yytname changes.
11025 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
11026
11027 * bootstrap: For translations that have not yet been upgraded to
11028 the new runtime-po domain, prime the pump by extracting the
11029 relevant strings from the obsolete translations. This code can be
11030 removed once the bison-runtime domain has been translated by each
11031 team.
11032
11033 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
11034 now that token names are already quoted.
11035
11036 Fix problem reported by Anthony Heading.
11037 * data/glr.c (YYTOKEN_TABLE): New macro.
11038 (yytname): Define if YYTOKEN_TABLE.
11039 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
11040 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
11041 (YYERROR_VERBOSE): Define the same way the other skeletons do.
11042 * src/output.c (prepare_symbols): Output token_table_flag.
11043
110442005-07-21 Paul Eggert <eggert@cs.ucla.edu>
11045
11046 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
11047 again if the first call fails.
11048
11049 * data/glr.c (yytnamerr): New function.
11050 (yyreportSyntaxError): Use it to dequote most string literals.
11051 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
11052 with other skeletons. All uses changed.
11053 (yytnameerr_): New function.
11054 (yyreport_syntax_error): Use it to dequote most string literals.
11055 * data/yacc.c (yytnamerr): New function.
11056 (yyerrlab): Use it to decode most string literals.
11057 * doc/bison.texinfo (Decl Summary, Calling Convention):
11058 Clarify quoting convention of yytname.
11059 * src/output.c (prepare_symbols): Quote all names. This undoes
11060 the 2005-04-17 change, which is now accomplished (mostly) via
11061 changes in the parsers as described above.
11062 * tests/regression.at (Token definitions, Web2c Actions):
11063 Undo most 2005-04-17 change here, too.
11064
110652005-07-20 Paul Eggert <eggert@cs.ucla.edu>
11066
11067 Fix more problems reported by twlevo@xs4all.nl.
11068 * tests/cxx-type.at: Don't pipe output of ./types through sed to
11069 remove trailing spaces. This loses the exit status of ./types,
11070 and isn't needed since ./types shouldn't be emitting trailing
11071 spaces.
11072 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
11073 as the stack isn't valid in that case.
11074
11075 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
11076 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
11077 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
11078 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
11079 is used.
11080 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
11081 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
11082 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
11083 Likewise.
11084
11085 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
11086 overly-picky compilers that reject 'char *foo = "bar";'.
11087
11088 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
11089 to FILE * parameter, not to stderr. This fixes a typo introduced
11090 in the 2005-07-12 change.
11091
11092 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
11093 warnings from GCC 4.
11094
11095 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
11096 (yyglrShiftDefer, yysplitStack):
11097 Remove unused parameters b4_pure_formals. All uses changed.
11098 (yyglrShift): Remove unused parameters b4_user_formals.
11099 All uses changed.
11100 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
11101
111022005-07-18 Paul Eggert <eggert@cs.ucla.edu>
11103
11104 Destructor cleanups and regularization among the three skeletons.
11105 * NEWS: Document the behavior changes.
11106 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
11107 stack before failing, as the cleanup code will do it for us now.
11108 * data/lalr1.cc (yyerrlab): Likewise.
11109 * data/glr.c (yyparse): Pop everything off the stack before
11110 freeing it, so that destructors get called properly.
11111 * data/lalr1.cc (yyreturn): Likewise.
11112 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
11113 This is more consistent.
11114 * doc/bison.texinfo (Destructor Decl): Mention more reasons
11115 why destructors might be called. 1.875 -> 2.1.
11116 (Destructor Decl, Decl Summary, Table of Symbols):
11117 Some English-language cleanups for %destructor.
11118 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11119 Add output line for destructor of start symbol.
11120 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
11121 because of that same extra output line.
11122
11123 * NEWS: Document minor wording changes in diagnostics of
11124 Bison-generated parsers.
11125 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
11126 Remove unused formals. All uses changed.
11127 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
11128 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
11129 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
11130 Rename yyoverflowab to yyexhaustedlab.
11131 When memory exhaustion occurs during syntax-error reporting,
11132 report it separately rather than in a single diagnostic; this
11133 eases translation.
11134 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
11135 (Memory Exhausted): Renamed from Parser Stack Overflow.
11136 Revamp wording slightly to prefer "memory exhaustion".
11137 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
11138
11139 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
11140
11141 Add i18n support to the GLR skeleton. Partially fix the C++
11142 skeleton; a C++ expert needs to finish this. Remove debugging
11143 msgids; there's little point to having them translated, since they
11144 can be understood only by someone who can read the
11145 (English-language) source code.
11146
11147 Generate runtime-po/bison-runtime.pot automatically, so that we
11148 don't have to worry about garbage getting in that file. We'll
11149 make sure after the next official release that old msgids don't
11150 get lost. See
11151 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
11152
11153 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
11154 Now auto-generated.
11155 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
11156 Fix typos in explanations of the runtime file.
11157 * bootstrap: Change gettext keyword from YYI18N to YY_.
11158 Use standard Makefile.in.in in runtime-po, since we'll arrange
11159 for backward-compatible bison-runtime.po files in a different way.
11160 * data/glr.c (YY_): New macro, from yacc.c.
11161 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
11162 Translate messages intended for users.
11163 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
11164 the wording in the other skeletons. We don't know that the memory
11165 is virtual.
11166 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
11167 Use same method that yacc.c uses.
11168 Don't translate debugging messages.
11169 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
11170 it doesn't work (yet), and requires C++ expertise to fix.
11171 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
11172 Move defn to a more logical place, to be consistent with other
11173 skeletons.
11174 Don't translate debugging messages.
11175 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
11176 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
11177 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
11178 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
11179
11180 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
11181 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
11182 void, not int.
11183 * tests/glr-regression.at (Badly Collapsed GLR States):
11184 Likewise.
11185 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
11186 yylex should return 0 at EOF rather than aborting.
11187
11188 Improve tests for stack overflow in GLR parser.
11189 Problem reported by twlevo@xs4all.nl.
11190 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
11191 All uses removed.
11192 (yyStackOverflow): Just longjmp, but with value 2 so that caller
11193 can handle the problem.
11194 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
11195 (yyparse): New local variable yyresult to record the result.
11196 Use result of setjmp to set it, rather than storing itinto
11197 struct.
11198 (yyDone): Remove label.
11199 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
11200 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
11201 if YYABORT is used).
11202 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
11203 yyparse status; put status > 1 into diagnostic.
11204 Check that status==2 works.
11205 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
11206 Use exit status 3 for failure to open (which shouldn't happen).
11207
112082005-07-17 Paul Eggert <eggert@cs.ucla.edu>
11209
11210 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
11211 1 on syntax error; just let yyparse do its thing.
11212 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
11213 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
11214 (Exploding the Stack Size with Alloca):
11215 (Exploding the Stack Size with Malloc):
11216 Expect exit status 2, not 1, since the parser is supposed to blow
11217 its stack. Problem reported by twlevo@xs4all.nl.
11218
11219 * data/glr.c (yyparse): Don't assume that the initial calls
11220 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
11221 Print a stack-overflow message and fail instead.
11222 Initialize the line-number information before creating the stack,
11223 so that the stack-overflow message can report line zero safely.
11224
112252005-07-14 Paul Eggert <eggert@cs.ucla.edu>
11226
11227 Fix problems reported by twlevo@xs4all.nl.
11228 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
11229 (yyuserMerge): Provide a default case if b4_mergers is empty.
11230 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
11231 * tests/glr-regression.at
11232 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
11233 Add casts to pacify C++ compilers.
11234 * tests/glr-regression.at (Improper merging of GLR delayed action
11235 sets): Declare yylex before using it.
11236 * tests/Makefile.am (maintainer-check-g++): Fix a stray
11237 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
11238 test for valgrind; valgrind is independent of g++.
11239 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
11240 for compatibility with POSIX 1003.1-2001 (if running coreutils).
11241 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
11242 Use a destructor, so that we can expand the stack. Change
11243 YYSTYPE to char * so that we can free it. Cast result of malloc.
11244
112452005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11246
11247 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
11248 a valgrind failure. Problem reported by twlevo@xs4all.nl.
11249
112502005-07-13 Paul Eggert <eggert@cs.ucla.edu>
11251
11252 * PACKAGING: New file, suggested by Bruno Haible and taken from
11253 similar wording in gettext's PACKAGING file.
11254 * NEWS: Mention PACKAGING.
11255 * Makefile.am (EXTRA_DIST): Add PACKAGING.
11256
112572005-07-12 Paul Eggert <eggert@cs.ucla.edu>
11258
11259 * NEWS: Document recent i18n improvements.
11260 * bootstrap: Get runtime translations into runtime-po.
11261 Create runtime-po files automatically, if possible.
11262 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
11263 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
11264 does not infringe on the user's name space.
11265 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
11266 * doc/bison.texinfo (Internationalization): Revamp the English
11267 and Texinfo syntax a bit, to try to make it clearer.
11268 (Bison Options, Option Cross Key): Mention --print-localedir.
11269 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
11270 YYENABLE_NLS. Quote a bit more.
11271 * runtime-po/.cvsignore: New file.
11272 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
11273 * runtime-po/Rules-quot: Remove; now created by bootstrap.
11274 * runtime-po/quot.sed: Likewise.
11275 * runtime-po/boldquot.sed: Likewise.
11276 * runtime-po/en@quot.header: Likewise.
11277 * runtime-po/en@boldquot.header: Likewise.
11278 * runtime-po/insert-header.sin: Likewise.
11279 * runtime-po/remove-potcdate.sin: Likewise.
11280 * runtime-po/Makevars: Likewise.
11281 * runtime-po/LINGUAS: Likewise.
11282 * runtime-po/de.po: Likewise; we will rely on the translation project
11283 to maintain this, so "bootstrap" should get it.
11284 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
11285 its value.
11286 * src/main.c (main): Bind the bison-runtime domain, too.
11287
112882005-07-12 Bruno Haible <bruno@clisp.org>
11289
11290 * data/yacc.c: Include <libintl.h> when NLS is enabled.
11291 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
11292 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
11293 * runtime-po: New directory.
11294 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
11295 $(DOMAIN).pot-update rule, so that old messages are never dropped.
11296 * runtime-po/Rules-quot: New file, copied from po/.
11297 * runtime-po/quot.sed: Likewise.
11298 * runtime-po/boldquot.sed: Likewise.
11299 * runtime-po/en@quot.header: Likewise.
11300 * runtime-po/en@boldquot.header: Likewise.
11301 * runtime-po/insert-header.sin: Likewise.
11302 * runtime-po/remove-potcdate.sin: Likewise.
11303 * runtime-po/Makevars: New file.
11304 * runtime-po/POTFILES.in: New file.
11305 * runtime-po/LINGUAS: New file.
11306 * runtime-po/bison-runtime.pot: New file.
11307 * runtime-po/de.po: New file.
11308 * m4/bison.m4: New file.
11309 * Makefile.am (SUBDIRS): Add runtime-po.
11310 (aclocaldir, aclocal_DATA): New variables.
11311 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
11312 Define aclocaldir.
11313 * src/getargs.c (usage): Document --print-localedir option.
11314 (PRINT_LOCALEDIR_OPTION): New enum item.
11315 (long_options): Add --print-localedir option.
11316 (getargs): Handle --print-localedir option.
11317 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
11318 (Internationalization): New section.
11319
113202005-07-12 Akim Demaille <akim@epita.fr>
11321
11322 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
11323 for consistency with the rest of the code.
11324 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
11325 Add separators.
11326
113272005-07-12 Akim Demaille <akim@epita.fr>
11328
11329 * src/parse-gram.y: Use %printer instead of YYPRINT.
11330
113312005-07-12 Akim Demaille <akim@epita.fr>
11332
11333 * src/symtab.h, src/symtab.c (symbol_print): New.
11334 * src/symlist.h, src/symlist.c (symbol_list_print): New.
11335 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
11336
113372005-07-12 Akim Demaille <akim@epita.fr>
11338
11339 * data/glr.c (b4_syncline): Fix (swap) the definitions of
11340 b4_at_dollar and b4_dollar_dollar.
11341
113422005-07-11 Paul Eggert <eggert@cs.ucla.edu>
11343
11344 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
11345 and Pennello's paper.
11346
113472005-07-09 Paul Eggert <eggert@cs.ucla.edu>
11348
11349 * data/yacc.c (yyparse): Undo previous patch. Instead,
11350 set yylsp[0] and yyvsp[0] only if the initial action
11351 sets yylloc and yylval, respectively.
11352
11353 * data/yacc.c (yyparse): In the initial action, set
11354 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
11355 This avoids the use of undefined variables if the initial
11356 action does not set yylloc and/or yylval.
11357
113582005-07-07 Paul Eggert <eggert@cs.ucla.edu>
11359
11360 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
11361 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
11362 Remove from CVS. These files are automatically generated.
11363 * examples/extexi: Clarify that this file is now part of Bison,
11364 not GNU M4, and that it works with any POSIX-compatible Awk.
11365 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
11366 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
11367 so that we also get calc++-parser.yy. Geneate it.
11368 Use $(AWK), not gawk, since any conforming Awk will do.
11369 Put comment before action, since older 'make' can't handle comment
11370 in action.
11371 $(BUILT_SOURCES): List all built sources, not just some of them.
11372 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
11373 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
11374 $($(calc_sources_generated)): Remove unnecessary test for existence
11375 of target. (This had a shell syntax error anyway; a stray "x".)
11376 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
11377 calc++-parser.yy.
11378 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
11379
11380 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
11381 implied by the other modules.
11382
113832005-07-06 Akim Demaille <akim@epita.fr>
11384
11385 Bind examples/calc++ to the package.
11386 * examples/calc++/Makefile: Remove, replaced by...
11387 * examples/calc++/Makefile.am: ... this new file.
11388 * examples/calc++/test: Remove input.
11389 * examples/calc++/compile: Remove.
11390 * examples/Makefile.am: New.
11391 * configure.ac, Makefile.am: Adjust.
11392 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
11393
113942005-07-05 Paul Eggert <eggert@cs.ucla.edu>
11395
11396 * data/glr.c (yyFail): Drastically simplify; since the format argument
11397 never had any % directives, we can simply pass it to yyerror.
11398 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
11399 be modified later, as that is the usual style in glr.c.
11400 Problems reported by Paul Hilfinger.
11401
11402 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
11403 and size overflow errors.
11404 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
11405 in case the user prolog sets feature-test macros like _GNU_SOURCE.
11406 (YYSIZEMAX): New macro.
11407 (yystpcpy): New function, taken from yacc.c.
11408 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
11409 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
11410 so that we don't have to maintain their signatures.
11411 (yyFail): Check for buffer overflow, by using vsnprintf rather
11412 than vsprintf. Allocate a bigger buffer if possible.
11413 Report an error if buffer allocation fails.
11414 (yyStackOverflow): New function.
11415 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
11416 the initialization was successful. It might fail if storage was
11417 exhausted.
11418 (yyexpandGLRStack): Add more checks for storage allocation failure.
11419 Use yyStackOverflow to report failures.
11420 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
11421 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
11422 Don't assume stack number fits in int.
11423 (yysplitStack): Check for storage allocation failure.
11424 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
11425 can print diagnostics on storage allocation failure. All callers
11426 changed.
11427 (yyresolveValue): Use yybool for boolean.
11428 (yyreportSyntaxError): Check for size-calculation overflow.
11429 This code is taken from yacc.c.
11430 (yyparse): Check for storage allocation errors when allocating
11431 the initial stack.
11432
114332005-07-05 Akim Demaille <akim@epita.fr>
11434
11435 Extract calc++ from the documentation.
11436 * doc/bison.texinfo (Calc++): Add the extraction marks.
11437 * examples/extexi: New, from the aborted GNU Programming 2E.
11438 Separate the different paragraph of a file with empty lines.
11439 * examples/Makefile: Use it to extract the whole calc++ example.
11440
114412005-06-24 Akim Demaille <akim@epita.fr>
11442
11443 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
11444 class typedefs.
11445
114462005-06-22 Akim Demaille <akim@epita.fr>
11447
11448 * doc/bison.texinfo (C++ Language Interface): First stab.
11449 (C++ Parsers): Remove.
11450
114512005-06-22 Akim Demaille <akim@epita.fr>
11452
11453 * data/lalr1.cc (yylex_): Honor %lex-param.
11454
114552005-06-22 Akim Demaille <akim@epita.fr>
11456
11457 Start a set of simple examples.
11458 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
11459 * examples/calc++/calc++-driver.hh,
11460 * examples/calc++/calc++-parser.yy,
11461 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
11462 * examples/calc++/compile, examples/calc++/test: New.
11463
114642005-06-09 Paul Eggert <eggert@cs.ucla.edu>
11465
11466 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
11467 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
11468 which stems from the 2005-05-27 patch.
11469
114702005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11471
11472 * data/glr.c: Modify treatment of unused parameters to permit use
11473 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
11474
114752005-05-30 Paul Eggert <eggert@cs.ucla.edu>
11476
11477 Fix infringement on user name space reported by Janos Zoltan Szabo.
11478 * data/yacc.c (yyparse): strlen -> yystrlen.
11479
114802005-05-30 Akim Demaille <akim@epita.fr>
11481
11482 * data/lalr1.cc (_): New.
11483 Translate the various messages.
11484
114852005-05-27 Paul Eggert <eggert@cs.ucla.edu>
11486
11487 Fix infringement on user name space reported by Bruno Haible.
11488 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
11489 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
11490 the user's name space.
11491 (alloca): Include <stdlib.h> to get it, if it's not built in.
11492 (YYMALLOC, YYFREE): Define only if needed.
11493 (malloc, free): Declare, but only if needed, as this infringes on
11494 the user name space.
11495
114962005-05-25 Paul Eggert <eggert@cs.ucla.edu>
11497
11498 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
11499 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
11500 with %d format.
11501 * lib/ebitset.c (min, max): Undef before defining.
11502 * lib/vbitset.c (min, max): Likewise.
11503 * lib/subpipe.c (create_subpipe): Save local variables in case
11504 vfork clobbers them.
11505
115062005-05-24 Bruno Haible <bruno@clisp.org>
11507
11508 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
11509 error message syntax used by gcc-4.0.
11510
115112005-05-23 Paul Eggert <eggert@cs.ucla.edu>
11512
11513 * README: Mention m4 1.4.3. Remove obsolete advice about
11514 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
11515
11516 * bootstrap: Remove workaround for problem I encountered with
11517 gettext 0.14.1; it seems to be fixed now.
11518
115192005-05-22 Paul Eggert <eggert@cs.ucla.edu>
11520
11521 * NEWS: Version 2.0a.
11522
11523 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
11524 the previous change.
11525
11526 Various maintainer cleanups.
11527 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
11528 conftest*, for benefit of CVS commands run at the same time as
11529 "configure". Add build-aux, since "bootstrap" now creates it and
11530 its subfiles.
11531 * Makefile.cfg (move_if_change): Remove.
11532 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
11533 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
11534 (po_repo, do-po-update, po-update, wget_files, get-targets):
11535 (config.guess-url_prefix, config.sub-url_prefix):
11536 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
11537 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
11538 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
11539 Remove.
11540 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
11541 this is now the recommended name.
11542 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
11543 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
11544 ylwrap. These files now go into build-aux.
11545 * config/move-if-change: Remove.
11546 * config/prev-version.txt: Bump from 1.75 to 2.0.
11547
11548 * bootstrap: Add stdio-safer, unistd-safer modules.
11549 Remove m4/glibc2.m4 (introduced by latest gnulib, but
11550 we don't need it).
11551 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
11552 fopen-safer.c, stdio-safer.h, unistd-safer.h.
11553 * lib/subpipe.c: Include "unistd-safer.h".
11554 (create_subpipe): Make sure all the newly-created
11555 file descriptors are > 2, so that diagnostics don't
11556 get sent down them (which might cause Bison to hang, in theory).
11557 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
11558 * src/files.c (xfopen): Use fopen_safer, not fopen.
11559
11560 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
11561 yesterday's yacc.c fix.
11562
115632005-05-21 Paul Eggert <eggert@cs.ucla.edu>
11564
11565 * data/glr.c, data/lalr1.cc: Update copyright date.
11566
11567 Fix a destructor bug reported by Wolfgang Spraul in
11568 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
11569 * data/yacc.c (yyabortlab): Don't call destructor, and
11570 don't set yychar to EMPTY.
11571 (yyoverflowlab): Don't call destructor.
11572 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
11573 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
11574 since we no longer output the message "discarding lookahead token
11575 end of input ()".
11576
115772005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11578
11579 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
11580 fix a small glitch in debugging output.
11581 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
11582 after YY_SYMBOL_PRINT where needed.
11583
11584 (struct yyGLRState): Add some comments.
11585 (struct yySemanticOption): Add some comments.
11586 (union yyGLRStackItem): Add comment.
11587
11588 (yymergeOptionSets): Correct this to properly perform the union,
11589 avoiding infinite reported by Michael Rosien.
11590 Update comment.
11591
11592 * tests/glr-regression.at: Add test for GLR merging error reported
11593 by M. Rosien.
11594
115952005-05-13 Paul Eggert <eggert@cs.ucla.edu>
11596
11597 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
11598 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
11599 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
11600 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
11601 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
11602 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
11603 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
11604 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
11605 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
11606 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
11607 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
11608 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
11609 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
11610 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
11611 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
11612 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
11613 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
11614 src/derives.h, src/files.c, src/files.h, src/getargs.c,
11615 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
11616 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
11617 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
11618 src/output.h, src/parse-gram.c, src/parse-gram.h,
11619 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
11620 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
11621 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
11622 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
11623 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
11624 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
11625 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
11626 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
11627 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
11628 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
11629 tests/reduce.at, tests/regression.at, tests/sets.at,
11630 tests/synclines.at, tests/testsuite.at, tests/torture.at:
11631 Update FSF postal mail address.
11632
116332005-05-11 Paul Eggert <eggert@cs.ucla.edu>
11634
11635 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
11636 Problem reported by Ralf Menzel.
11637
116382005-05-01 Paul Eggert <eggert@cs.ucla.edu>
11639
11640 * tests/actions.at: Test that stack overflow invokes destructors.
11641 From Marcus Holland-Moritz.
11642 * data/yacc.c (yyerrlab): Move the code that destroys the stack
11643 from here....
11644 (yyreturn): to here. That way, destructors are called properly
11645 even if the stack overflows, or the user calls YYACCEPT or
11646 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
11647 (yyoverflowlab): Destroy the lookahead.
11648
116492005-04-24 Paul Eggert <eggert@cs.ucla.edu>
11650
11651 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
11652
116532005-04-17 Paul Eggert <eggert@cs.ucla.edu>
11654
11655 * NEWS: Bison-generated C parsers no longer quote literal strings
11656 associated with tokens.
11657 * src/output.c (prepare_symbols): Don't escape strings,
11658 since users don't want to see C escapes.
11659 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
11660 in diagnostics.
11661 * tests/input.at (Torturing the Scanner): Likewise.
11662 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
11663
116642005-04-16 Paul Eggert <eggert@cs.ucla.edu>
11665
11666 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
11667 the data size is known to be too small and we can't increase it.
11668 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
11669
116702005-04-15 Paul Eggert <eggert@cs.ucla.edu>
11671
11672 * src/parse-gram.y: Include quotearg.h.
11673 (string_as_id): Quote $1 before using it as a key, since the
11674 lexer no longer quotes it for us.
11675 (string_content): Don't strip quotes, since lexer no longer
11676 quotes it for us.
11677 * src/scan-gram.l: Include quotearg.h.
11678 ("\""): Omit quote.
11679 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
11680 a key, since the rest of the lexer doesn't quote it.
11681 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
11682 * tests/regression.at (Token definitions): Check for backslashes
11683 in token strings.
11684
11685 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
11686 (YYSIZE_T): Define to unsigned long int when using an older compiler.
11687 (yyparse): Revamp code to generate long syntax error message, to
11688 make it easier to translate, and to avoid problems with arithmetic
11689 overflow. Change "virtual memory" to "memory" in diagnostic, since
11690 we don't know whether the memory is virtual.
11691
116922005-04-13 Paul Eggert <eggert@cs.ucla.edu>
11693
11694 * NEWS: Bison-generated C parsers now use the _ macro to
11695 translate strings.
11696 * data/yacc.c (_) [!defined _]: New macro.
11697 All English strings wrapped inside this macro.
11698 * doc/bison.texinfo (Bison Parser): Document _.
11699 * po/POTFILES.in: Include src/parse-gram.c, since it now
11700 includes translateable strings that parse-gram.y doesn't.
11701
117022005-04-12 Paul Eggert <eggert@cs.ucla.edu>
11703
11704 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
11705 reverting the 2004-10-11 change to this function.
11706 (symbol_check_alias_consistency): Don't call symbol_type_set
11707 if the type name is already correct.
11708 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
11709
117102005-03-25 Paul Eggert <eggert@cs.ucla.edu>
11711
11712 * tests/regression.at (Token definitions): Don't use a token named
11713 c, as that generates a "#define c ..." that runs afoul of buggy
11714 stdlib.h that uses the identifier c as a member of struct
11715 drand48_data. Problem reported by Horst Wente.
11716
117172005-03-21 Paul Eggert <eggert@cs.ucla.edu>
11718
11719 * bootstrap: Change translation URL from
11720 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
11721 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
11722 redirection glitches. Problem reported by twlevo@xs4all.nl.
11723
117242005-03-20 Paul Eggert <eggert@cs.ucla.edu>
11725
11726 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
11727 after operands; POSIX says this isn't portable for the c99 command.
11728
117292005-03-18 Paul Eggert <eggert@cs.ucla.edu>
11730
11731 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
11732 immediately if a data overrun has occurred; this may help us track
11733 down what may be a spurious failure on MacOS.
11734
117352005-03-17 Paul Eggert <eggert@cs.ucla.edu>
11736
11737 Respond to problems reported by twlevo@xs4all.nl.
11738
11739 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
11740
11741 * src/vcg.h: Comment fix.
11742 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
11743 (G_CMAX): Change to -1 instead of INT_MAX.
11744
11745 * data/yacc.c (yyparse): Omit spaces before #line.
11746
117472005-03-15 Paul Eggert <eggert@cs.ucla.edu>
11748
11749 * src/tables.c (state_number_to_vector_number): Put it inside an
11750 "#if 0", since it's not currently used. Problem reported by
11751 Roland McGrath.
11752
117532005-03-06 Paul Eggert <eggert@cs.ucla.edu>
11754
11755 * src/output.c (escaped_output): Renamed from
11756 escaped_file_name_output, since we now use it for symbol tags as
11757 well. All uses changed.
11758 (symbol_destructors_output, symbol_printers_output):
11759 Escape symbol tags too.
11760 Problem reported by Matyas Forstner in
11761 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
11762
11763 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
11764 not needed.
11765 * src/output.c (user_actions_output, token_definitions_output,
11766 symbol_destructors_output, symbol_printers_output): Likewise.
11767 * src/reader.c (prologue_augment): Likewise.
11768 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
11769
11770 * src/vcg.c (output_edge): Don't quote linestyle arg.
11771 Problem reported by twlevo@xs4all.nl.
11772
117732005-02-28 Paul Eggert <eggert@cs.ucla.edu>
11774
11775 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
11776 example, reported by Derek M Jones. Also, make the example even
11777 more outrageous, to better illustrate how bad the problem is.
11778
117792005-02-24 Paul Eggert <eggert@cs.ucla.edu>
11780
11781 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
11782 putsym. Typo reported by Sebastian Piping.
11783
117842005-02-23 Paul Eggert <eggert@cs.ucla.edu>
11785
11786 * doc/bison.texinfo (Language and Grammar): some -> same
11787 (Epilogue): int he -> in the
11788 Typos reported by Sebastian Piping via Justin Pence.
11789
117902005-02-07 Paul Eggert <eggert@cs.ucla.edu>
11791
11792 * tests/glr-regression.at (Improper handling of embedded actions
11793 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
11794 embedded actions and $-N in GLR parsers", work around an Autoconf bug
11795 with dollar signs in test names.
11796 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
11797 for a similar reason.
11798
117992005-01-28 Paul Eggert <eggert@cs.ucla.edu>
11800
11801 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
11802 wants to redefine G_VIEW.
11803
118042005-01-27 Paul Eggert <eggert@cs.ucla.edu>
11805
11806 * src/vcg.c (get_view_str): Remove case for normal_view.
11807 Problem reported by twlevo@xs4all.nl.
11808
118092005-01-24 Paul Eggert <eggert@cs.ucla.edu>
11810
11811 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
11812 Problem reported by twlevo@xs4all.nl.
11813
11814 * doc/bison.texinfo: Change @dircategory from "GNU programming
11815 tools" to "Software development". Requested by Richard Stallman
11816 via Karl Berry.
11817
118182005-01-23 Paul Eggert <eggert@cs.ucla.edu>
11819
11820 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
11821 Problem reported by twlevo@xs4all.nl.
11822
118232005-01-21 Paul Eggert <eggert@cs.ucla.edu>
11824
11825 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
11826 keyword; it's not needed with modern compilers, and it doesn't
11827 affect correctness with older compilers. Suggested by
11828 twlevo@xs4all.nl.
11829
118302005-01-17 Paul Eggert <eggert@cs.ucla.edu>
11831
11832 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
11833 gcc -Wswitch-default.
11834 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11835 * data/yacc.c (yyparse): Likewise.
11836
118372005-01-12 Paul Eggert <eggert@cs.ucla.edu>
11838
11839 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
11840 already. Let config.h define any nonstandard values.
11841
118422005-01-10 Paul Eggert <eggert@cs.ucla.edu>
11843
11844 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
11845 for the benefit of slower hosts. Problem reported by
11846 Nelson H. F. Beebe.
11847
118482005-01-07 Paul Eggert <eggert@cs.ucla.edu>
11849
11850 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
11851 being defined and not used.
11852 * data/lalr1.cc (yyparse): Likewise.
11853 Use "if (false)" rather than "if (0)".
11854
118552005-01-05 Paul Eggert <eggert@cs.ucla.edu>
11856
11857 * TODO: Mention that we should allow NUL bytes in tokens.
11858
118592005-01-02 Paul Eggert <eggert@cs.ucla.edu>
11860
11861 * src/scan-skel.l (<<EOF>>): Don't close standard output.
11862 Problem reported by Hans Aberg.
11863
118642005-01-01 Paul Eggert <eggert@cs.ucla.edu>
11865
11866 * src/getargs.c (version): Happy new year; update overall
11867 program copyright date from 2004 to 2005.
11868
11869 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
11870 Problem reported by Hans Aberg.
11871 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
11872 (Output file names.): Add a test for the case when standard output
11873 is closed.
11874
118752004-12-26 Paul Eggert <eggert@cs.ucla.edu>
11876
11877 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
11878 to fix an oversight in the Bison 2.0 manual.
11879
118802004-12-25 Paul Eggert <eggert@cs.ucla.edu>
11881
11882 * NEWS: Version 2.0. Reformat the existing news items since
11883 1.875, so that related items are grouped together.
11884 * configure.ac (AC_INIT): Bump version to 2.0.
11885 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
11886
11887 * tests/torture.at (Exploding the Stack Size with Alloca): Set
11888 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
11889 otherwise, we're not testing alloca. Unfortunately there's no
11890 simple way to consult HAVE_ALLOCA here.
11891
11892 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
11893 for yymsg, too.
11894
11895 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
11896 hand. This avoids a warning about comparing int to size_t when
11897 GCC warnings are enabled.
11898
118992004-12-22 Paul Eggert <eggert@cs.ucla.edu>
11900
11901 * NEWS: Bison-generated parsers no longer default to using the
11902 alloca function (when available) to extend the parser stack, due
11903 to widespread problems in unchecked stack-overflow detection.
11904 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
11905 responsibility to set it to a positive value. This lets the user
11906 specify a value that is not a preprocessor constant.
11907 * data/yacc.c (YYMAXDEPTH): Likewise.
11908 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
11909 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
11910 to be a compile-time constant. However, explain the constraints on it.
11911 Also, explain the constraints on YYINITDEPTH.
11912 (Table of Symbols): Explain that alloca is no longer the default.
11913 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
11914 to 1.
11915
11916 * doc/bison.texinfo (Location Default Action): Mention that n must
11917 be zero when k is zero. Suggested by Frank Heckenbach.
11918
119192004-12-22 Akim Demaille <akim@epita.fr>
11920
11921 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
11922 (parser::state_type, parser::semantic_type, parser::location_type):
11923 Private, not public.
11924 (parser::parse): Return ints, not bool.
11925 Returning a bool introduces a problem: 0 corresponds to false, and
11926 it seems weird to return false on success. Returning true changes
11927 the conventions for yyparse.
11928 Alternatively we could return void and send an exception.
11929 There is no clear consensus (yet?).
11930 (state_stack, semantic_stack, location_stack): Rename as...
11931 (state_stack_type, semantic_stack_type, location_stack_type): these.
11932 Private, not public.
11933 * tests/c++.at: New.
11934 * tests/testsuite.at, tests/Makefile.am: Adjust.
11935
119362004-12-21 Akim Demaille <akim@epita.fr>
11937
11938 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
11939
119402004-12-21 Akim Demaille <akim@epita.fr>
11941
11942 Don't impose std::string for filenames.
11943
11944 * data/lalr1.cc (b4_filename_type): New.
11945 (position::filename): Use it.
11946 (parser.hh): Move the inclusion of stack.hh and location.hh below
11947 the user code, so that needed headers for the filename type can be
11948 included first.
11949 Forward declare them before the user code.
11950 * tests/Makefile.am (check-local, installcheck-local): Pass
11951 TESTSUITEFLAGS to the TESTSUITE.
11952
119532004-12-20 Akim Demaille <akim@epita.fr>
11954
11955 Use more STL like names: my_class instead of MyClass.
11956
11957 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
11958 (SemanticStack, SemanticType, StateStack, StateType)
11959 (TokenNumberType, Stack, Slice, Traits, Parser::location)
11960 (Parser::value): Rename as...
11961 (location_stack, location_type, rhs_number_type, semantic_stack)
11962 (semantic_type, state_stack, state_type, token_number_type, stack)
11963 (slice, traits, parser::yylloc, parser::yylval): these.
11964
11965 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
11966
119672004-12-19 Paul Eggert <eggert@cs.ucla.edu>
11968
11969 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
11970 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
11971
119722004-12-17 Paul Eggert <eggert@cs.ucla.edu>
11973
11974 Remove uses of 'short int' and 'unsigned short int'. This raises
11975 some arbitrary limits. It uses more memory but nowadays that's
11976 not much of an issue.
11977
11978 This change does not affect the generated parsers; that's a different
11979 task, as some users will want to conserve memory there.
11980
11981 Ideally we should use size_t to represent all object counts, and
11982 something like ptrdiff_t to represent signed differences of object
11983 counts; but that will require more code-cleanup than I have the
11984 time to do right now.
11985
11986 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
11987 Use size_t, not int or short int, to count objects.
11988 * src/closure.c (nritemset, closure): Likewise.
11989 * src/closure.h (nritemset, closure): Likewise.
11990 * src/nullable.c (nullable_compute): Likewise.
11991 * src/print.c (print_core): Likewise.
11992 * src/print_graph.c (print_core): Likewise.
11993 * src/state.c (state_compare, state_hash): Likewise.
11994 * src/state.h (struct state): Likewise.
11995 * src/tables.c (default_goto, goto_actions): Likewise.
11996
11997 * src/gram.h (rule_number, rule): Use int, not short int.
11998 * src/output.c (prepare_rules): Likewise.
11999 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
12000 errs, reductions): Likewise.
12001 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
12002 Likewise.
12003 * src/tables.c (vector_number, tally, action_number,
12004 ACTION_NUMBER_MINIMUM): Likewise.
12005 * src/output.c (muscle_insert_short_int_table): Remove.
12006
120072004-12-17 Akim Demaille <akim@epita.fr>
12008
12009 * data/lalr1.cc: Extensive Doxygenation.
12010 (error_): Rename as...
12011 (error): this, since it is visible to the user.
12012 Adjust callers.
12013 (Parser::message): Now an automatic variable from...
12014 (Parser::yyreport_syntax_error_): here.
12015 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
12016 Parser::error.
12017 * tests/input.at: Escape $.
12018
120192004-12-16 Paul Eggert <eggert@cs.ucla.edu>
12020
12021 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
12022 Parenthesize rhs to avoid obscure problems with mistakes like
12023 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
12024 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12025 b4_rhs_location): Likewise.
12026 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12027 b4_rhs_location): Likewise.
12028
120292004-12-16 Akim Demaille <akim@epita.fr>
12030
12031 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
12032 yacc.c: be sure to stay within yycheck_.
12033 * tests/actions.at: Re-enable C++ tests.
12034
120352004-12-16 Akim Demaille <akim@epita.fr>
12036
12037 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
12038 real.
12039
120402004-12-16 Akim Demaille <akim@epita.fr>
12041
12042 Use #define to handle the %name-prefix.
12043
12044 * data/glr.c, data/yacc.c: Comment changes.
12045 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
12046 so that one can refer to yylex in the parser file, and have it
12047 renamed, as is the case with other skeletons.
12048
120492004-12-16 Akim Demaille <akim@epita.fr>
12050
12051 Move lalr1.cc internals into yy*.
12052
12053 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
12054 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
12055 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
12056 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
12057 (empty_, final_, terror_, errcode_, ntokens_)
12058 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
12059 (looka_, ilooka_, error_range_, nerrs_):
12060 Rename as...
12061 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
12062 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
12063 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
12064 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
12065 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
12066 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
12067 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
12068 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
12069 these.
12070
120712004-12-15 Paul Eggert <eggert@cs.ucla.edu>
12072
12073 Fix some problems reported by twlevo at xs4all.
12074 * src/symtab.c (symbol_new): Report an error if the input grammar
12075 contains too many symbols. This is better than calling abort() later.
12076 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
12077 (struct node, struct graph):
12078 Rename member expand to stretch. All uses changed.
12079 (struct graph): Remove member layoutalgorithm. All uses removed.
12080 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
12081 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
12082 All uses changed.
12083 (N_STRETCH): Rename from N_EXPAND. All uses changed.
12084
120852004-12-15 Akim Demaille <akim@epita.fr>
12086
12087 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
12088 Add more Doxygen comments.
12089 (symprint_, stack_print_, reduce_print_, destruct_, pop)
12090 (report_syntax_error_, translate_): Rename as...
12091 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
12092 (yypop_, yyreport_syntax_error_, yytranslate_): this.
12093
120942004-12-15 Akim Demaille <akim@epita.fr>
12095
12096 * data/lalr1.cc (lex_): Rename as...
12097 (yylex_): this.
12098 Move the trace here.
12099 Take the %name-prefix into account.
12100 Reported by Alexandre Duret-Lutz.
12101
121022004-12-15 Akim Demaille <akim@epita.fr>
12103
12104 Simplify the C++ parser constructor.
12105
12106 * data/lalr1.cc (debug_): Rename as...
12107 (yydebug_): so that the parser's internals are always in the yy*
12108 pseudo namespace.
12109 Adjust uses.
12110 (b4_parse_param_decl): Remove the leading comma as it is now only
12111 called as unique argument list.
12112 (Parser::Parser): Remove the constructor accepting a location and
12113 an initial debugging level.
12114 Remove from the other ctor the argument for the debugging level.
12115 (debug_level_type, debug_level, set_debug_level): New.
12116
12117 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
12118 constructor calls.
12119
121202004-12-15 Akim Demaille <akim@epita.fr>
12121
12122 Remove b4_root related material: failure experiment
12123 (which goal was to allow to derive from a class).
12124
12125 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
12126 definitions and uses.
12127
121282004-12-14 Paul Eggert <eggert@cs.ucla.edu>
12129
12130 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
12131 not 2, since it's not portable to subtract 1 from the start of an
12132 array. The new item 0 is never set or used. All uses changed.
12133
12134 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
12135 the default definition of YYLLOC_DEFAULT. Problem reported
12136 by Frank Heckenbach.
12137
121382004-12-12 Paul Eggert <eggert@cs.ucla.edu>
12139
12140 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
12141 the normal case and one for the error case. Just use the
12142 first one uniformly. Problem reported by Frank Heckenbach.
12143 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
12144 use exactly the same macro in both places.
12145 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
12146 so that the normal-case YYRHSLOC works for the error case too.
12147 All uses changed.
12148 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
12149 (YYLLOC_DEFAULT): Use the same macro as glr.c.
12150 * doc/bison.texinfo (Location Default Action): Don't claim that
12151 we have an array of locations. Use the same macro for both glr
12152 and lalr parsers. Mention YYRHSLOC. Mention what happens when
12153 the index is 0.
12154
121552004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12156
12157 * HACKING: Update email addresses to send announcements to.
12158
12159 * configure.ac (AC_INIT): Bump version to 1.875f.
12160
121612004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12162
12163 * NEWS: Version 1.875e.
12164 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
12165
12166 * src/scan-skel.l: Include "complain.h", for "fatal".
12167
12168 * src/relation.h (relation_print, relation_digraph):
12169 Relation sizes are of type relation_node, not size_t (this is
12170 merely a doc fix, since the two types are equivalent).
12171 (relation_transpose): Relation sizes are of type relation_node,
12172 not int.
12173 * src/relation.c: Likewise.
12174 (top, infinity): Now of type relation_node, not int.
12175 (traverse, relation_transpose): Use relation_node, not int.
12176
12177 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
12178 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
12179 (yyparse): Remove unused local introduced in 2004-10-25 patch.
12180
12181 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
12182 specifying whether the test should be skipped. Use it tp
12183 specify that the [%defines %skeleton "lalr1.cc"] tests currently
12184 fail on some hosts, and should be skipped.
12185
121862004-12-08 Paul Eggert <eggert@cs.ucla.edu>
12187
12188 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
12189 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
12190 unless otherwise specified below.
12191
12192 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
12193 to allocate kernel_base, kernel_items, kernel_size, since
12194 they needn't be initialized to 0.
12195 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
12196 * src/closure.c (new_closure): Likewise, for itemset.
12197 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
12198 * src/lalr.c (set_goto_map): Likewise, for temp_map.
12199 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
12200 (build_relations): Likewise for edge, states1, includes.
12201 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
12202 * src/reader.c (packgram): Likewise, for ritem, rules.
12203 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
12204 * src/relation.c (relation_digraph): Likewise for VERTICES.
12205 (relation_transpose): Likewise for new_R, end_R.
12206 * src/symtab.c (symbols_token_translations_init): Likewise for
12207 token_translations.
12208 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
12209 (token_actions): Likewise for yydefact, actrow, conflrow,
12210 conflict_list.
12211 (save_column): Likewise for froms[symno], tos[symno].
12212 (goto_actions): Likewise for state_count.
12213 (pack_table): Likewise for base, pos, check.
12214 (tables_generate): Likewise for width.
12215
12216 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
12217 for initial core. Just have a separate core, so we needn't worry
12218 about whether kernel_size and kernel_base are initialized.
12219
12220 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
12221 kernel_size, kernel_items): Remove unnecessary initialization.
12222 * src/conflicts.c (conflicts): Likewise.
12223 * src/derives.c (derives): Likewise.
12224 * src/muscle_tablc (muscle_insert): Likewise.
12225 * src/relation.c (relation_digraph): Likewise.
12226 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
12227 conflrow, conflict_table, conflict_list, table, check):
12228 Likewise.
12229
12230 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
12231 This is because all callers pass unsigned int.
12232 * src/closure.h (new_closure): Likewise.
12233
12234 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
12235 (build_relations): Initialize includes[i] in all cases.
12236 * src/reader.c (packgram): Always initialize rules[ruleno].prec
12237 and rules[ruleno].precsym. Initialize members in order.
12238 * src/relation.c (relation_transpose): Always initialize new_R[i]
12239 and end_R[i].
12240 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
12241
12242 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
12243 conflict_list[0] was always 0, but now it isn't initialized.
12244
12245 * src/table.c (table_grow): When conflict_table grew, the grown
12246 area wasn't cleared. Fix this.
12247
12248 * lib/.cvsignore: Add strdup.c, strdup.h.
12249 * m4/.cvsignore: Add strdup.m4.
12250
122512004-12-07 Paul Eggert <eggert@cs.ucla.edu>
12252
12253 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
12254 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
12255 GOTO_NUMBER_MAXIMUM, since we occasionally compute
12256 ngotos + 1 without checking for overflow.
12257 (build_relations): Use END_NODE, not -1, to denote end of edges.
12258 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
12259 build_relations): Use goto_number, not int, for goto numbers.
12260 * src/tables.c (save_column, default_goto): Likewise.
12261
122622004-11-23 Akim Demaille <akim@epita.fr>
12263
12264 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
12265 of #defining from yystype.
12266 Don't typedef yystype, C++ does not need it.
12267 This lets it possible to forward declare it as union.
12268
122692004-11-23 Paul Eggert <eggert@cs.ucla.edu>
12270
12271 * bootstrap (gnulib_modules): Add extensions.
12272 Problem reported by Jim Meyering.
12273
122742004-11-22 Paul Eggert <eggert@cs.ucla.edu>
12275
12276 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
12277 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
12278 src/system.h, src/tables.c: XFREE -> free, to accommodate
12279 recent change to gnulib xalloc.h.
12280 Problem reported by Jim Meyering.
12281
122822004-11-17 Akim Demaille <akim@epita.fr>
12283
12284 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
12285
122862004-11-17 Akim Demaille <akim@epita.fr>,
12287 Alexandre Duret-Lutz <adl@gnu.org>
12288
12289 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
12290 changes.
12291 (YYCDEBUG): Adjust.
12292 Use it instead of cdebug_.
12293 (Parser::debug_stream, Parser::set_debug_stream): New.
12294 (Parser::symprint_): Define cdebug_ for temporary backward
12295 compatibility.
12296 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
12297 debug_stream ().
12298
122992004-11-17 Akim Demaille <akim@epita.fr>
12300
12301 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
12302 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
12303 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
12304 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12305
123062004-10-27 Paul Eggert <eggert@cs.ucla.edu>
12307
12308 * data/glr.c (yyloc_default): Remove; not used.
12309 Problem reported by Frank Heckenbach.
12310
123112004-10-25 Akim Demaille <akim@epita.fr>
12312
12313 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
12314 Introduce another definition to address simple location arrays.
12315 (yyGLRStack): New member: yyerror_range.
12316 (yyrecoverSyntaxError, yyparse): Update it.
12317 (yyrecoverSyntaxError): Use it when shifting the error token to
12318 have an accurate range, equivalent to the one computed by both
12319 yacc.c and lalr1.cc.
12320 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
12321 that column numbers start at column 0, as per GNU Coding
12322 Standards, the others tests, and the doc.
12323 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
12324 Adjust to the above change (first column is 0).
12325 And adjust the location of the "<error>", now covering the whole
12326 line.
12327
123282004-10-22 Akim Demaille <akim@epita.fr>
12329 and Paul Eggert <eggert@cs.ucla.edu>
12330
12331 Remove some arbitrary limits on goto numbers and relations.
12332 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
12333 initial values, since they're never used.
12334 (set_goto_map): ngotos is now unsigned, so test for overflow
12335 by seeing whether it wraps around to zero.
12336 * src/lalr.h (goto_number): Now size_t, not short int.
12337 (GOTO_NUMBER_MAXIMUM): Remove.
12338 * src/relation.c (relation_print, traverse, relation_transpose):
12339 Check for END_NODE rather than looking at sign.
12340 * src/relation.h (END_NODE): New macro.
12341 (relation_node): Now size_t, not short int.
12342
123432004-10-22 Paul Eggert <eggert@cs.ucla.edu>
12344
12345 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
12346 keyword, not an identifier. Problem reported by Baron Schwartz in
12347 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
12348
123492004-10-11 Akim Demaille <akim@epita.fr>
12350
12351 * src/symtab.c (symbol_check_alias_consistency): Also check
12352 type names, destructors, and printers.
12353 Reported by Alexandre Duret-Lutz.
12354 Recode the handling of associativity and precedence in terms
12355 of symbol_precedence_set.
12356 Accept no redeclaration at all, not even equal to the previous
12357 value.
12358 (redeclaration): New.
12359 Use it to factor redeclaration complaints.
12360 (symbol_make_alias): Don't set the type of the alias, let
12361 symbol_check_alias_consistency do it as for other features.
12362 * src/symtab.h (symbol): Add new member prec_location, and
12363 type_location.
12364 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
12365 * tests/input.at (Incompatible Aliases): New.
12366
123672004-10-09 Paul Eggert <eggert@cs.ucla.edu>
12368
12369 .cvsignore fixes to accommodate gnulib changes,
12370 and the practice of naming build directories "_build".
12371 * .cvsignore: Add "_*". Sort.
12372 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
12373 * m4/.cvsignore: Add "*_gl.m4".
12374
123752004-10-06 Akim Demaille <akim@epita.fr>
12376
12377 * src/parse-gram.y (add_param): Fix the truncation of trailing
12378 spaces.
12379
123802004-10-05 Akim Demaille <akim@epita.fr>
12381
12382 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
12383 whether the reducion was empty or not. This leaves room to
12384 improve the use of YYLLOC_DEFAULT in such a case.
12385 lalr1.cc is still experimental, so changing this is acceptable.
12386 And finally, there are probably not many users who changed the
12387 handling of locations in GLR, so changing is admissible too.
12388
12389 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
12390 empty reduction, set @$ to an empty location ending the previously
12391 stacked symbol.
12392 Adjust uses to make sure the code is triggered on empty
12393 reductions.
12394 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
12395 expected output: empty reductions have empty locations.
12396
123972004-09-29 Akim Demaille <akim@epita.fr>
12398
12399 * data/lalr1.cc: Move towards a more standard C++ coding style
12400 for templates: Class < T > -> Class<T>.
12401
124022004-09-29 Akim Demaille <akim@epita.fr>
12403
12404 * data/lalr1.cc: Reinstall the former ctor, for sake of
12405 compatibility, but warn it will be removed.
12406 Move towards a more standard C++ coding style (i.e., type *var ->
12407 type* var).
12408
124092004-09-27 Paul Eggert <eggert@cs.ucla.edu>
12410
12411 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
12412 since it's less likely to work if NULs are involved in the future.
12413
124142004-09-27 Akim Demaille <akim@epita.fr>
12415
12416 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
12417
124182004-09-27 Akim Demaille <akim@epita.fr>
12419
12420 * data/lalr1.cc (b4_parse_param_decl_1): New.
12421 (b4_parse_param_decl): Use it to have different names between attribute
12422 and argument names.
12423 (b4_cc_constructor_call): Likewise.
12424
124252004-09-24 Akim Demaille <akim@epita.fr>
12426
12427 * src/parse-gram.y (add_param): Strip the leading and trailing
12428 blanks from a formal argument declaration.
12429 (YY_LOCATION_PRINT): New.
12430
124312004-09-24 Akim Demaille <akim@epita.fr>
12432
12433 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
12434 after the location.
12435
124362004-09-24 Akim Demaille <akim@epita.fr>
12437
12438 * doc/bison.texinfo (Table of Symbols): Sort.
12439
124402004-09-21 Akim Demaille <akim@epita.fr>
12441
12442 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
12443 the useless parentheses.
12444 Suggested by Paul Eggert.
12445
124462004-09-20 Akim Demaille <akim@epita.fr>
12447
12448 Let the initial-action act on the look-ahead, and use it for the
12449 "initial push" (corresponding to an hypothetical beginning-of-file).
12450 And let lalr1.cc honor %initial-action.
12451
12452 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
12453 example.
12454 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
12455 (Parser::Parser): Remove the ctor that used to initialize it.
12456 (Parser::parse): Like in the other skeletons, issue the "starting
12457 parse" message before any action.
12458 Honor %initial-action.
12459 Initialize the stacks with the lookahead.
12460 * data/yacc.c: Let $$ and @$ in %initial-action designate the
12461 look-ahead.
12462 Push them in the stacks.
12463 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
12464
124652004-09-20 Akim Demaille <akim@epita.fr>
12466
12467 * doc/bison.texinfo (Initial Action Decl): New.
12468
124692004-09-20 Akim Demaille <akim@epita.fr>
12470
12471 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
12472 clearer criterion to define it.
12473 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
12474 When reducing on an empty RHS, use the latest stacked location as
12475 location.
12476 yylloc is not always available.
12477 * data/glr.c: Likewise.
12478 Also, honor initial-actions.
12479
124802004-09-20 Akim Demaille <akim@epita.fr>
12481
12482 * data/yacc.c (YY_LOCATION_PRINT): New.
12483 Define when we know YYLTYPE's structure, i.e., when the default
12484 YYLLOC_DEFAULT is used.
12485 * data/c.m4 (b4_yysymprint_generate): Use it.
12486 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
12487 value of the result.
12488 (error_start_): Replace with...
12489 (error_range_): this location array.
12490 This allows to replace code relying on the implementation of
12491 locations by portable code.
12492 * data/yacc.c (yylerrsp): Replace with...
12493 (yyerror_range): this.
12494 Every time a token is popped, update yyerror_range[0], to have an
12495 accurate location for the error token.
12496 * data/glr.c (YY_LOCATION_PRINT): New.
12497 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
12498 deference a pointer.
12499 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
12500 report the location in %printers.
12501
12502 * src/scan-skel.l: Instead of abort, report error messages to ease
12503 understanding skeleton scanning failures.
12504
125052004-09-16 Akim Demaille <akim@epita.fr>
12506
12507 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
12508 (iterator, const_iterator): these, to be more in the C++ spirit.
12509 Also, return reverse iterators so that when displaying the stack
12510 we display its bottom first.
12511 (Parser::stack_print_, Parser::reduce_print_): Match the messages
12512 from yacc.c.
12513 We should probably use vector here though.
12514
125152004-09-16 Akim Demaille <akim@epita.fr>
12516
12517 Have more complete shift traces.
12518
12519 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
12520 to report Shifts instead of ad hoc YYDPRINTF invocations,
12521 including for the error token.
12522 * data/lalr1.cc (symprint_): Output the location.
12523 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
12524 output the location within the %printer.
12525 Activate GLR tests, at least to make sure they compile properly.
12526 They still don't pass though.
12527 * tests/calc.at: Adjust expect verbose output, since now "Entering
12528 state..." is on a different line than the "Shifting" message.
12529
125302004-09-08 Akim Demaille <akim@epita.fr>
12531
12532 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
12533 Bison directive from the Bison file to the invocation of this
12534 macro, so that these directives are passed to
12535 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
12536 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
12537 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
12538 the extra Bison directives instead of the whole series.
12539 Change the grammar so that there are recoverable errors, and
12540 unrecoverable errors. Now we can have the parser give up before
12541 consuming the whole input. As a result we now can observe that
12542 the lookahead is freed when needed.
12543 Change the parser source to parse argv[1] instead of a hard coded
12544 string.
12545 Simplify yylex, and give a value and location to EOF.
12546 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
12547 passed directives already coded in the file.
12548 Add some tests to check the location of "error".
12549 For some tests, the C++ parser is correct, and not yacc.c.
12550 For other tests, they provide different, but unsatisfying, values,
12551 so keep the C++ value so that at least one parser is "correct"
12552 according to the test suite.
12553 (Actions after errors): Remove, this is subsumed by the
12554 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
12555
125562004-09-06 Akim Demaille <akim@epita.fr>
12557
12558 * data/lalr1.cc: Adjust the indentation of the labels.
12559 (Parser::pop): New.
12560 Use it.
12561
125622004-09-06 Akim Demaille <akim@epita.fr>
12563
12564 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
12565 argument, an informative message.
12566 Call YY_SYMBOL_PRINT.
12567 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
12568 * data/lalr1.cc (destruct_): Likewise.
12569 In addition, no longer depend on b4_yysymprint_generate and
12570 b4_yydestruct_generate to generate these functions, do it "by
12571 hand".
12572
125732004-09-03 Akim Demaille <akim@epita.fr>
12574
12575 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
12576 invoked, yydestruct the lookahead.
12577 * tests/calc.at (Calculator $1): Update the expected lengths of
12578 traces: there is an added line for the discarded lookahead.
12579 * doc/bison.texinfo (Destructor Decl): Some rewording.
12580 Define "discarded" symbols.
12581
125822004-09-02 Akim Demaille <akim@epita.fr>
12583
12584 * data/lalr1.cc (translate_, destruct_): No reason to be static.
12585
125862004-09-02 Akim Demaille <akim@epita.fr>
12587
12588 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
12589 (YYDSYMPRINTF): Rename as...
12590 (YY_SYMBOL_PRINT): this.
12591 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
12592 two.
12593 Use it instead of direct symprint_ calls.
12594 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
12595 one.
12596
125972004-09-02 Akim Demaille <akim@epita.fr>
12598
12599 * data/lalr1.cc (b4_yysymprint_generate): New.
12600 (symprint_): New member function, defined when YYDEBUG.
12601 Use it consistently instead of token/nterm debugging output by
12602 hand.
12603 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
12604 %printer calls to use cdebug_ when using lalr1.cc.
12605
126062004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
12607
12608 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
12609 with #ifdef YYDEBUG.
12610
126112004-08-26 Akim Demaille <akim@epita.fr>
12612
12613 * doc/bison.texinfo (Implementing Loops): Rename as...
12614 (Implementing Gotos/Loops): this.
12615
126162004-08-13 Paul Eggert <eggert@cs.ucla.edu>
12617
12618 Adjust to latest gnulib.
12619 * bootstrap (gnulib_modules): Add xalloc-die.
12620 Set LC_ALL=C so that file names sort consistently.
12621 Prefer the gnulib copies of gettext.m4, glibc21.m4,
12622 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
12623 uintmax_t.m4, ulonglong.m4.
12624 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
12625 po.m4 since we are now using _gl.m4 instead.
12626
126272004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
12628
12629 * src/scan-action.l: Remove. Scanning of semantic actions is
12630 handled in scan-gram.l.
12631
126322004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
12633
12634 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
12635
12636 * src/location.h (struct): The file member is a uniqstr.
12637 (equal_boundaries): Use UNIQSTR_EQ for comparison.
12638
126392004-07-22 Paul Eggert <eggert@cs.ucla.edu>
12640
12641 Fix bug with non-%union parsers that have printers or destructors,
12642 which led to a Bison core dump. Reported by Peter Fales in
12643 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
12644
12645 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
12646 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
12647 not to our own type.
12648 * src/output.c (symbol_destructors_output, symbol_printers_output):
12649 Don't assume %union.
12650 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
12651 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
12652 UNION-FLAG. All callers changed.
12653 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
12654 Use type char, not unsigned int, when declaring an array of char;
12655 this lets us remove a cast.
12656 (Printers and Destructors): Add non-%union test cases.
12657
126582004-06-21 Paul Eggert <eggert@cs.ucla.edu>
12659
12660 * doc/bison.texinfo: Minor editorial changes, mostly to the new
12661 GLR writeups. E.g., avoid frenchspacing and the future tense,
12662 change "lookahead" to "look-ahead", and change "wrt" to "with
12663 respect to".
12664
126652004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12666
12667 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
12668 New sections, split off from the GLR Parsers section. Put the new
12669 Simple GLR Parser near the start of the GLR section, for clarity.
12670 Rewrite connective text.
12671
126722004-06-21 Frank Heckenbach <frank@g-n-u.de>
12673
12674 * doc/bison.texinfo (Simple GLR Parsers): New section.
12675
126762004-06-21 Paul Eggert <eggert@cs.ucla.edu>
12677
12678 * NEWS, TODO, doc/bison.texinfo:
12679 Use "look-ahead" instead of "lookahead", to be consistent.
12680 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
12681 while we're fixing "look-ahead".
12682 * src/conflicts.c (shift_set): Renamed from shiftset.
12683 (look_ahead_set): Renamed from lookaheadset.
12684 * src/print.c: Likewise.
12685 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
12686 name for "lookahead".
12687 (report_types, usage): Likewise.
12688 * src/getargs.h (report_look_ahead_tokens): Renamed from
12689 report_lookaheads.
12690 * src/lalr.c (compute_look_ahead_tokens): Renamed from
12691 compute_lookaheads.
12692 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
12693 (look_ahead_tokens_print): Renamed from lookaheads_print.
12694 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
12695 state_rule_lookaheads_print.
12696 * src/state.h: Likewise.
12697 (reductions.look_ahead_tokens): Renamed from lookaheads.
12698 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
12699 AT_DATA_LOOKAHEADS_GRAMMAR.
12700
127012004-06-03 Paul Eggert <eggert@cs.ucla.edu>
12702
12703 * README: Update location of patched M4 distribution.
12704
127052004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
12706
12707 Don't assume the C++ compiler takes the same arguments as the C compiler
12708 (trivial change).
12709 * configure.ac (O0CXXFLAGS): New var.
12710 * tests/atlocal.in (CXXFLAGS): Use it.
12711
127122004-05-29 Paul Eggert <eggert@cs.ucla.edu>
12713
12714 Fix some "make check" problems with C++ reported by
12715 Albert Chin-A-Young for Tru64 C++ in this thread:
12716 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
12717
12718 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
12719 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12720 Output to a .cc file for C++, not to a .c file.
12721 * tests/calc.at (AT_CHECK_CALC): Likewise.
12722 * tests/regression.at (AT_CHECK_DANCER): Likewise.
12723 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
12724
127252004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
12726
12727 * tests/calc.at, tests/actions.at: Workaround for SGI
12728 C++ compiler. (trivial change)
12729
127302004-05-27 Paul Eggert <eggert@cs.ucla.edu>
12731
12732 Spent a few hours checking out which prerequisite versions the
12733 current sources actually require. I went all the way back to
12734 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
12735 a seemingly endless set of combinations of versions more recent
12736 than that. The bottom line is that the current sources require
12737 fairly recent versions of the build tools, and it'll be some work
12738 to change this.
12739 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
12740 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
12741 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
12742 Add comments explaining why those particular versions are
12743 currently needed.
12744
12745 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
12746 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
12747 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
12748
12749 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
12750 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
12751
127522004-05-26 Paul Eggert <eggert@cs.ucla.edu>
12753
12754 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
12755 0.11.5. Suggested by Bruno Haible.
12756 * bootstrap: Remove gettext version checking.
12757
12758 * doc/bison.texinfo (Decl Summary): Also mention that %union
12759 can depend on prerequisite types. Problem reported by Tim
12760 Van Holder.
12761
127622004-05-25 Paul Eggert <eggert@cs.ucla.edu>
12763
12764 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
12765 * README-alpha: Don't tell people not to package this.
12766
12767 * bootstrap: Don't assume $(...) works; use `...` instead.
12768 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
12769 gettext better.
12770
12771 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
12772 put into the -d output file, and mention what to do if YYSTYPE is
12773 defined as a macro.
12774
127752004-05-24 Paul Eggert <eggert@cs.ucla.edu>
12776
12777 Undo change made earlier today: it caused autopoint to not bring
12778 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
12779 autopoint's.
12780
12781 * bootstrap: Check that gettext version matches what's in
12782 configure.ac. Warn users to ignore robots.txt ERROR 404.
12783 * bootstrap: Undo today's earlier change (logged below).
12784 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
12785
12786 The gettext version checking is causing more trouble than it's
12787 curing; remove it. Problem reported by Paul Hilfinger.
12788
12789 * bootstrap: Issue a warning that one can expect a message
12790 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
12791 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
12792
127932004-05-23 Paul Eggert <eggert@cs.ucla.edu>
12794
12795 Ensure that the C++ compiler used for testing actually works on a
12796 simple test program; if not, skip the C++-related tests. Problem
12797 reported by Vin Shelton in:
12798 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
12799
12800 * m4/cxx.m4: New file.
12801 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
12802 * tests/atlocal.in (BISON_CXX_WORKS): Add.
12803 * tests/local.at (AT_COMPILE_CXX): Use it.
12804
128052004-05-21 Paul Eggert <eggert@cs.ucla.edu>
12806
12807 * data/glr.c (yylloc): Output this macro even if locations are not
12808 being generated, as the GLR parser needs it even in that case.
12809 Problem reported by Troy A. Johnson
12810 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
12811
12812 * configure.ac (AC_INIT): Update to 1.875e.
12813
128142004-05-21 Paul Eggert <eggert@cs.ucla.edu>
12815
12816 * NEWS: Version 1.875d.
12817 * configure.ac (AC_INIT): Likewise.
12818 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
12819
12820 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
12821 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
12822 lalr1.cc runs afoul of the first, and the last two are no longer
12823 supported by GCC 3.4.0.
12824 * README: Mention GNU m4 1.4 or later; mention m4 patches.
12825 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
12826
128272004-05-06 Paul Eggert <eggert@cs.ucla.edu>
12828
12829 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
12830 unsigned int, for compatibility with latest gnulib hash module.
12831 * src/state.c (state_hash, state_hasher): Likewise.
12832 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
12833 * src/uniqstr.c (hash_uniqstr): Likewise.
12834
128352004-05-03 Paul Eggert <eggert@cs.ucla.edu>
12836
12837 * NEWS: Unescaped newlines are no longer allowed in char & strings.
12838
12839 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
12840 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
12841 character and string literals.
12842 (unexpected_end): New function.
12843 (unexpected_eof): Use it.
12844 (unexpected_newline): New function.
12845 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
12846 actions.
12847
12848 * NEWS: Document %expect-rr.
12849
12850 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
12851 Fix typo by replacing $1 with $option.
12852 Remove more 'intl'-related files.
12853 Don't DEFUN AM_INTL_SUBDIR twice.
12854
12855 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
12856 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
12857 strtoul.c.
12858 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
12859 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
12860 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
12861 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
12862 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
12863 * src/.cvsignore: Add *.output.
12864
12865 * src/parse-gram.y: Put copyright notice inside %{ %} so it
12866 gets copied to the output file.
12867
128682004-04-28 Paul Eggert <eggert@twinsun.com>
12869
12870 Get files from the gnulib and po repositories, instead of relying
12871 on them being in our CVS. Upgrade to latest versions of gnulib
12872 and Automake.
12873
12874 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
12875 * bootstrap: Bootstrap from gnulib and po repositories.
12876 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
12877 * README-cvs: Document these changes. Remove version numbers from
12878 mentions of build tools, since they change so often. Mention Flex.
12879
12880 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
12881 (gl_USE_SYSTEM_EXTENSIONS): Add.
12882 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
12883 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
12884 does this for us.
12885 (AC_ISC_POSIX): Remove; we no longer support this
12886 ancient OS, as it gets in the way of latest Autoconf & gnulib.
12887 (AC_HEADER_STDC): Remove: we now assume C89 or better.
12888 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
12889 Do not check for C89 headers, except for locale.h which is used
12890 by the Yacc library and must port to K&R hosts.
12891 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
12892 Do not check for C89 functions, except for setlocale which is
12893 used by the Yacc library.
12894 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
12895 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
12896 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
12897 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
12898 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
12899 AM_GNU_GETTEXT): Remove; now done by:
12900 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
12901 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
12902 for us.
12903
12904 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
12905 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
12906 Define to empty, as gnulib.mk will do the rest for us.
12907 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
12908 for us.
12909 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
12910 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
12911
12912 * src/files.c: Include gnulib's xstrndup.h.
12913
12914 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
12915 (REALLOC): Use xnrealloc, for likewise.
12916 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
12917 (strnlen, memrchr): Remove decls; functions no longer used.
12918 Include <stpcpy.h>.
12919
12920 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
12921 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
12922 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
12923 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
12924 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
12925 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
12926 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
12927 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
12928 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
12929 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
12930 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
12931 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
12932 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
12933 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
12934 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
12935 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
12936 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
12937 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
12938 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
12939 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
12940 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
12941 Remove, as these files are now generated automatically
12942 by bootstrap or automake.
12943
12944 * po/ChangeLog: Remove: all but one entry was a duplicate
12945 of this file, and I moved that 2000-11-02 entry here.
12946
12947 * config/.cvsignore: Add Makefile, depcomp, install-sh.
12948 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
12949 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
12950 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
12951 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
12952 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
12953 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
12954 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
12955 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
12956 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
12957 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
12958 xstrndup.h.
12959 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
12960 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
12961 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
12962 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
12963 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
12964 * src/.cvsignore: Remove *_.c.
12965
12966
12967 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
12968 support it. (The latest stable gzip doesn't.)
12969
129702004-04-27 Paul Eggert <eggert@twinsun.com>
12971
12972 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
12973 case, as stos_ is now used by destructors due to the 2004-02-09
12974 change.
12975
12976 Remove more K&R C support.
12977 * lib/libiberty.y (PARAMS): Remove. All uses removed.
12978 * lib/subpipe.c (errno): Remove decl.
12979 Include <stdlib.h> unconditionally.
12980 (EXIT_FAILURE): Remove macro.
12981 * src/complain.c (vfprintf, strerror): Remove.
12982 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
12983 unconditionally.
12984 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
12985 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
12986 (strchr, strspn, memchr): Remove decls.
12987 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
12988 unconditionally. Do not declare perror.
12989 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
12990 unconditionally.
12991
12992 * src/complain.c (_): Remove useless defn, as system.h defines this.
12993
12994 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
12995 with latest obstack.h.
12996 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
12997 to procedure types, as obstack.h now does that for us.
12998 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
12999
13000 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
13001 so that this include file can stand alone.
13002 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
13003 does this now. Include subpipe.h first after config.h, to
13004 test whether it can stand alone.
13005
13006 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
13007 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
13008 unused declaration.
13009
13010 * tests/synclines.at (%union synch line): Put a dummy member in
13011 the union, because empty unions aren't allowed in C. Caught
13012 by GCC 3.4.0.
13013
130142004-04-13 Jim Meyering <jim@meyering.net>
13015
13016 * src/conflicts.c (conflicts_print): Correct format string typo:
13017 use `%%' to produce literal `%'. (trivial change)
13018
130192004-03-30 Paul Eggert <eggert@twinsun.com>
13020
13021 * src/getargs.c (version): Update copyright year to 2004.
13022
13023 * data/c.m4 (b4_int_type): Use 'short int' rather than
13024 'short', and similarly for 'long', 'unsigned', etc.
13025 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
13026 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
13027 yy_yypstack, yydumpstack): Likewise.
13028 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
13029 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
13030 Likewise.
13031 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
13032 yy_stack_print, yyparse): Likewise.
13033 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
13034 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
13035 * lib/bitset.c (bitset_print): Likewise.
13036 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
13037 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13038 * lib/bitsetv.c (bitsetv_dump): Likewise.
13039 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
13040 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
13041 Likewise.
13042 * src/LR0.c (allocate_itemsets): Likewise.
13043 * src/gram.h (rule_number, rule): Likewise.
13044 * src/lalr.h (goto_number): Likewise.
13045 * src/nullable.c (nullable_compute): Likewise.
13046 * src/output.c (prepare_rules): Likewise.
13047 * src/relation.c (relation_print, relation_digraph): Likewise.
13048 * src/relation.h (relation_node): Likewise.
13049 * src/state.h (state_number, transitions, errs, reductions,
13050 struct state): Likewise.
13051 * src/symtab.h (symbol_number, struct symbol): Likewise.
13052 * src/tables.c (vector_number, tally, action_number,
13053 default_goto, goto_actions): Likewise.
13054 * tests/existing.at (GNU Cim Grammar): Likewise.
13055 * tests/regression.at (Web2c Actions): Likewise.
13056
13057 * src/output.c (muscle_insert_short_int_table): Renamed from
13058 muscle_insert_short_table. All uses changed.
13059
130602004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
13061
13062 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
13063 (declaration): Replace expected_conflicts with expected_sr_conflicts.
13064 Add %expect-rr rule.
13065
13066 * src/scan-gram.l: Recognize %expect-rr.
13067
13068 * src/conflicts.h (expected_sr_conflicts): Rename from
13069 expected_conflicts.
13070 (expected_rr_conflicts): Declare.
13071
13072 * src/conflicts.c (expected_sr_conflicts): Rename from
13073 expected_conflicts.
13074 (expected_rr_conflicts): Define.
13075 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
13076 for GLR parsers.
13077 Use expected_sr_conflicts in place of expected_conflicts.
13078 Warn if expected_rr_conflicts used in non-GLR parser.
13079
13080 * doc/bison.texinfo: Add documentation for %expect-rr.
13081
130822004-03-08 Paul Eggert <eggert@gnu.org>
13083
13084 Add support for hex token numbers. Suggested by Odd Arild Olsen in
13085 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
13086
13087 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
13088 in lalr1.cc.
13089 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
13090 * src/scan-gram.l (scan_integer): New function.
13091 ({int}): Use it.
13092 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
13093 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
13094 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
13095 Say "long int", not "long", for uniformity with GNU style.
13096
130972004-02-25 Paul Eggert <eggert@twinsun.com>
13098
13099 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
13100 compilers. This fixes a problem with Intel's C++ compiler being
13101 chatty, reported by Guido Trentalancia in
13102 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
13103
131042004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
13105
13106 Support %destructor and merge error locations in lalr1.cc.
13107
13108 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
13109 (Parser::stos_): Define unconditionally.
13110 (Parser::destruct_): New method. Generate its body with
13111 b4_yydestruct_generate.
13112 (Parser::error_start_): New attribute.
13113 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
13114 token which are discarded.
13115 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
13116 error_start_ when erroneous token are discarded.
13117 (Parser::parse) <yyerrlab1>: Compute the location of the error
13118 token so that it covers all the discarded tokens.
13119 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
13120 it can be called with `%skeleton "lalr1.cc"', and do that.
13121
131222004-02-02 Paul Eggert <eggert@twinsun.com>
13123
13124 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
13125 $(top_srcdir)/lib and ../lib. This fixes a bug reported
13126 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
13127 There's no need to mention top_builddir since Automake does that
13128 for us.
13129 (INCLUDES): Remove, as Automake says it's obsolescent.
13130 Contents migrated into AM_CPPFLAGS as described above.
13131 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
13132
131332004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
13134
13135 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
13136 (yyreportSyntaxError): Handle case where lookahead token is
13137 YYEMPTY.
13138
131392004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13140
13141 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
13142 resulting parsers are compilable with C++.
13143
131442003-12-23 Paul Eggert <eggert@twinsun.com>
13145
13146 * config/depcomp, config/install-sh: Sync with Automake 1.8.
13147 * src/output.c (output_skeleton): Rename local var.
13148 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
13149 Bison tokens, as this runs afoul of the 2003-10-07 change that
13150 disallowed NUL bytes in character constants or string literals.
13151
13152 * tests/local.at: Require Autoconf 2.59's Autotest.
13153 * tests/testsuite.at: Don't include local.at, since we now assume
13154 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
13155 including it.
13156 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
13157 multiple inclusion warnings.
13158
131592003-12-02 Akim Demaille <akim@epita.fr>
13160
13161 * doc/bison.texinfo (How Can I Reset the Parser): More about start
13162 conditions.
13163 From Bruno Haible.
13164
131652003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
13166
13167 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
13168
131692003-10-07 Paul Eggert <eggert@twinsun.com>
13170
13171 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
13172 if testsuite doesn't exist.
13173
13174 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
13175 literals, unfortunately.
13176 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
13177 Complain about NUL bytes in character constants or string literals.
13178
131792003-10-05 Paul Eggert <eggert@twinsun.com>
13180
13181 * NEWS: Don't document %no-default-prec, as it's still
13182 too experimental.
13183 * doc/bison.texinfo: Document %no-default-prec only if
13184 the defaultprec flag is set. Normally it's not.
13185
131862003-10-04 Paul Eggert <eggert@twinsun.com>
13187
13188 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
13189 non-modifiable lvalue, instead of a modifiable one.
13190 * doc/bison.texinfo (Actions): Document that $$ can
13191 be assigned to. Do not claim that $$ and $N are
13192 array element references: user code should not rely on this.
13193
131942003-10-01 Paul Eggert <eggert@twinsun.com>
13195
13196 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
13197 (grammar_declaration): Use it.
13198 * src/scan-gram.l: New token %no-default-prec.
13199 * tests/conflicts.at: Revamp tests to use %no-default-prec.
13200 * NEWS, doc/bison.texinfo: Document the above.
13201
132022003-10-01 Akim Demaille <akim@epita.fr>
13203
13204 VCG no longer supports long_straight_phase.
13205
13206 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
13207 * src/print_graph.c (print_graph): Adjust.
13208
132092003-09-30 Frank Heckenbach <frank@g-n-u.de>
13210 and Paul Eggert <eggert@twinsun.com>
13211
13212 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
13213 Table of Symbols): Document %default-prec.
13214 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
13215 (grammar_declaration): Set default_prec on %default-prec.
13216 * src/scan-gram.l (%default-prec): New token.
13217 * src/reader.h (default_prec): New flag.
13218 * src/reader.c: Likewise.
13219 (packgram): Handle it.
13220 * tests/conflicts.at (%default-prec without %prec,
13221 %default-prec with %prec, %default-prec 1): New tests.
13222
132232003-09-30 Paul Eggert <eggert@twinsun.com>
13224
13225 * tests/testsuite.at: Include local.at, not input.at, fixing
13226 a typo in the 2003-08-25 patch.
13227
132282003-08-27 Akim Demaille <akim@epita.fr>
13229
13230 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
13231 GCC warnings.
13232
132332003-08-26 Akim Demaille <akim@epita.fr>
13234
13235 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
13236 "<\#" to avoid magic from Gnus when posting parts of this script.
13237
132382003-08-26 Akim Demaille <akim@epita.fr>
13239
13240 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
13241 (Parser::parse): here.
13242 Adjust: nerrs and errstatus is now replaced by...
13243 (Parser::nerrs_, Parser::errstatus_): New.
13244
132452003-08-25 Akim Demaille <akim@epita.fr>
13246
13247 * config/announce-gen, Makefile.cfg: New.
13248 * Makefile.am: Adjust.
13249 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
13250 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
13251
132522003-08-25 Akim Demaille <akim@epita.fr>
13253
13254 When reducing initial empty rules, Bison parser read an initial
13255 location that is not defined. This results in garbage, and that
13256 affects Bison's own parser. Therefore we need (i) to extend Bison
13257 to support a means to initialize this location, and (ii) to use
13258 this CVS Bison to fix CVS Bison's parser.
13259
13260 * src/reader.h, reader.c (epilogue_augment): Remove, replace
13261 with...
13262 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
13263 * src/parse-gram.y: Adjust.
13264 (%initial-action): New.
13265 (%error-verbose): Since we require CVS Bison, there is no reason
13266 not to use it.
13267 * src/scan-gram.l: Adjust.
13268 * src/Makefile.am (YACC): New, to make sure we use our own parser.
13269 * data/yacc.c (yyparse): Use b4_initial_action.
13270
132712003-08-25 Akim Demaille <akim@epita.fr>
13272
13273 * doc/bison.texinfo: Don't promote stdout for error messages.
13274
132752003-08-25 Akim Demaille <akim@epita.fr>
13276
13277 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
13278 From Alexandre Duret-Lutz.
13279
132802003-08-25 Akim Demaille <akim@epita.fr>
13281
13282 Version 1.875c.
13283
132842003-08-25 Akim Demaille <akim@epita.fr>
13285
13286 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
13287 Use them.
13288
132892003-08-25 Akim Demaille <akim@epita.fr>
13290
13291 * data/lalr1.cc (Parser::reduce_print_): New.
13292 Use it.
13293
132942003-08-25 Akim Demaille <akim@epita.fr>
13295
13296 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
13297 error recovery loops. This patch is based on
13298 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
13299 Also, augment the similarity between lalr1.cc and yacc.c.
13300 Note: the locations of error recovery rules are not correct yet.
13301
13302 * data/lalr1.cc: Comment changes to augment the similarity between
13303 lalr1.cc and yacc.c.
13304 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
13305 (yyerrlab1): Remove, but where it used to be (now the bottom part of
13306 yyerrlab), when hitting EOF, pop the whole stack here instead of
13307 merely falling thru the default error handling mechanism.
13308 (yyerrorlab): New label, with the old contents of YYERROR,
13309 plus the following change: pop the stack of rhs corresponding
13310 to the production that invoked YYERROR. That is how Yacc
13311 behaves (required by POSIX).
13312 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
13313 fail.
13314
133152003-08-25 Akim Demaille <akim@epita.fr>
13316
13317 Tune local.at so that people can "autom4te -l autotest calc.at -o
13318 calc" for instance, to extract a sub test suite.
13319
13320 * tests/testsuite.at: Move the initialization, Autotest version
13321 requirement, and AT_TESTED invocation into...
13322 * tests/local.at: here.
13323 * tests/testsuite.at: Include it for compatibility with Autoconf
13324 2.57.
13325 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
13326 be ignore.
13327
133282003-08-04 Paul Eggert <eggert@twinsun.com>
13329
13330 Rework code slightly to avoid gcc -Wtraditional warnings.
13331 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
13332 The returned value is now stored in *YY0. All callers changed.
13333 * src/output.c (merge_output): Adjust to the above change.
13334
133352003-07-26 Paul Eggert <eggert@twinsun.com>
13336
13337 * data/glr.c (YYASSERT): New macro.
13338 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
13339 yyresolveStates, yyprocessOneStack):
13340 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
13341 Derived from a suggestion by Frank Heckenbach.
13342
133432003-07-25 Paul Eggert <eggert@twinsun.com>
13344
13345 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
13346 for portability to K&R C (after ansi2knr, presumably). See
13347 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
13348 by Frank Heckenbach, though I have omitted the structure-initialization
13349 part of his glr-knr.diff patch since I recall that the Portable
13350 C Compiler didn't require that change.
13351
13352 Let the user specify how to allocate and free memory.
13353 Derived from a suggestion by Frank Heckenbach in
13354 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
13355 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
13356 All uses of free, malloc, realloc changed to use these macros,
13357 and unnecessary casts removed.
13358 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
13359
133602003-07-06 Matthias Mann <MatthiasMann@gmx.de>
13361
13362 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
13363 use s.empty() rather than s == "" to test for empty string; see
13364 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
13365 (trivial change)
13366
133672003-06-25 Akim Demaille <akim@epita.fr>
13368
13369 * config/depcomp, config/install-sh: Update from masters.
13370
133712003-06-20 Paul Eggert <eggert@twinsun.com>
13372
13373 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
13374 and return properly parenthesized result.
13375 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
13376 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
13377 Remove unnecessary parentheses from uses.
13378 * doc/bison.texinfo (Location Default Action): Describe the
13379 conventions for parentheses.
13380
133812003-06-19 Paul Eggert <eggert@twinsun.com>
13382
13383 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
13384 yyreportTree): Do not assume that size_t is the same width as int,
13385 when printing sizes. Print sizes using an unsigned format.
13386 Problem reported by Frank Heckenbach in
13387 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
13388
13389 Port to Forte Developer 7 C compiler.
13390 * data/glr.c (struct YYLTYPE): If locations are not being used,
13391 declare a single dummy member, as empty structs do not conform
13392 to the C standard.
13393 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
13394 the Forte Developer 7 C compiler complains that end-of-loop
13395 code is not reached.
13396
133972003-06-17 Paul Eggert <eggert@twinsun.com>
13398
13399 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
13400 avoid warnings from picky compilers about redefinition of PARAMS.
13401
134022003-06-17 Paul Eggert <eggert@twinsun.com>
13403
13404 Version 1.875b.
13405
13406 * NEWS: Document 1.875b.
13407
13408 * lib/bbitset.h: Do not include config.h; that's the includer's job.
13409 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
13410 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
13411 Don't use 'index' in comments, as it's a builtin fn on some hosts.
13412 * lib/bitset_stats.c: Include gettext.h unconditionally, as
13413 per recent gettext manual's suggestion.
13414 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
13415 Use prototypes, not old-style definitions.
13416 * lib/lbitset.c (lbitset_unused_clear): Likewise.
13417 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
13418 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
13419 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
13420 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
13421 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
13422 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
13423 vbitset_or_and_cmp, vbitset_copy): Likewise.
13424
13425 * lib/libiberty.h: Do not include config.h; that's the includer's job.
13426 Do not include <stdlib.h>.
13427 (PARAMS): Define unconditionally for C89.
13428 (ATTRIBUTE_NORETURN): Remove.
13429 (ATTRIBUTE_UNUSED): Define unconditionally.
13430
13431 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
13432 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
13433 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
13434 * lib/vbitset.c, lib/vbitset.h: New files.
13435 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13436 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
13437 from libbitset.
13438
13439 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
13440 `How Can I Reset @code{yyparse}', since texinfo does not allow
13441 arbitrary @ in node names.
13442
13443 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
13444 shouldn't be needed according to the gettext 0.12.1 documentation
13445 but which seem to be needed anyway: codeset.m4 glibc21.m4
13446 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
13447 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
13448 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
13449
13450 * lib/.cvsignore: Add stdbool.h.
13451 * m4/.cvsignore: Add nls.m4, po.m4.
13452
13453 Upgrade to CVS gnulib.
13454 * stdbool_.h: File renamed from stdbool.h.in.
13455 * configure.ac (AM_STDBOOL_H): Invoke this instead of
13456 AC_HEADER_STDBOOL.
13457 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
13458 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
13459 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
13460 (MOSTLYCLEANFILES): New var.
13461 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
13462 (stdbool.h): New rule.
13463 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
13464 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
13465 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
13466 m4/quote.m4: Upgrade to today's gnulib.
13467
13468 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
13469 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
13470 the tests right now.
13471 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
13472 yyerror are declared before use; C99 requires this.
13473
134742003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13475
13476 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
13477 first.
13478 (yyrecoverSyntaxError): Correct the logic for setting and testing
13479 yyerrState.
13480 Correct comment on handling EOF.
13481 Allow states with only a default reduction, rather than failing
13482 (I can't quite reconstruct why these were not allowed before).
13483
13484 Fixes to avoid problem that $-N rules in GLR parsers can cause
13485 buffer overruns, corrupting state.
13486
13487 * src/output.c (prepare_rules): Output max_left_semantic_context
13488 definition.
13489 * src/reader.h (max_left_semantic_context): New variable declaration.
13490 * src/scan-gram.l (max_left_semantic_context): Define.
13491 (handle_action_dollar): Update max_left_semantic_context.
13492 * data/glr.c (YYMAXLEFT): New definition.
13493 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
13494 (yyresolveAction): Ditto.
13495
13496 Fixes to problems with location handling in GLR parsers reported by
13497 Frank Heckenbach (2003/06/05).
13498
13499 * data/glr.c (YYLTYPE): Make trivial if locations not used.
13500 (YYRHSLOC): Add parentheses, and define only if locations used.
13501 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
13502 locations not used.
13503 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
13504 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
13505
13506 * tests/cxx-type.at: Exercise location information; update tests
13507 to differentiate output with and without locations.
13508 Remove forward declarations of yylex and yyerror---caused errors
13509 because default YYLTYPE not yet defined.
13510 Change semantic actions to compute strings, rather than printing
13511 them directly (to test proper passing of semantics values). Change
13512 output to prefix notation and update test data and expected results.
13513 (yylex): Track locations.
13514 (stmtMerge): Return value rather than printing, and include arguments
13515 in value.
13516
135172003-06-03 Paul Eggert <eggert@twinsun.com>
13518
13519 Avoid warnings generated by GCC 2.95.4 when Bison is
13520 configured with --enable-gcc-warnings.
13521 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
13522 yy::]b4_parser_class_name[::translate_,
13523 yy::Stack::operator[] (unsigned),
13524 yy::Stack::operator[] (unsigned) const,
13525 yy::Slice::operator[] (unsigned),
13526 yy::Slice::operator[] (unsigned) const):
13527 Rename local vars to avoid warnings.
13528 * tests/glr-regression.at (Improper handling of embedded actions
13529 and $-N in GLR parsers): Remove unused local variable from yylex.
13530 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
13531 (void) as arg when not pure, since we now assume C89 when building
13532 Bison. Pacify GCC by using parameter.
13533
135342003-06-02 Paul Eggert <eggert@twinsun.com>
13535
13536 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
13537 yy::Location::lines, yy::Location::columns): Rename arguments
13538 to avoid shadowing; this removes a warning generated by GCC 3.3.
13539
135402003-06-01 Paul Eggert <eggert@twinsun.com>
13541
13542 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
13543 to g++, as GCC 3.3 complains if you do it.
13544 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
13545 everything that WARNING_CFLAGS has, except omit warnings
13546 not suitable for C++.
13547 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
13548 * tests/atlocal.in (CXXFLAGS): New var.
13549 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
13550
13551 Fix a GLR parser bug I reported in February; see
13552 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
13553 The problem was that GLR parsers did not conform to the C standard,
13554 because actions like { $1 = $2 + $3; } expanded to expressions
13555 that invoked YYFILL in separate subexpressions, and YYFILL assigned
13556 to a local variable. The C standard says that expressions
13557 like (var = f ()) + (var = f ()) have undefined behavior.
13558 Another problem was that GCC sometimes issues warnings that
13559 yyfill and its parameters are unused.
13560
13561 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
13562 as possibly unused.
13563 (yyfill): New function.
13564 (YYFILL): Use it.
13565 (yyuserAction): Change type of yynormal to bool, so that it matches
13566 the new yyfill signature. Mark it as possibly unused.
13567
13568
13569 Follow up on a bug I reported in February, where a Bison-generated
13570 parser can loop. Provide a test case and a fix for yacc.c. I
13571 don't have a fix for lalr1.cc or for glr.c, unfortunately.
13572 The original bug report is in:
13573 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
13574
13575 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
13576 macro's size was becoming unwieldy.
13577 (yyerrlab): Do not discard an empty lookahead symbol, as this
13578 might destroy garbage.
13579 (yyerrorlab): New label, with the old contents of YYERROR,
13580 plus the following change: pop the stack of rhs corresponding
13581 to the production that invoked YYERROR. That is how Yacc
13582 behaves, and POSIX requires this behavior.
13583 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
13584 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
13585 Define 'alarm' to do nothing if unistd.h is not available.
13586 Add a new rule "exp: '-' error;" to test the above change to
13587 data/yacc.c. Use 'alarm' to abort any test taking longer than
13588 10 seconds, as it's probably looping.
13589 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
13590 Also, the new yacc.c generates two fewer diagnostics for an
13591 existing test.
13592
135932003-05-24 Paul Eggert <eggert@twinsun.com>
13594
13595 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
13596 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
13597 This fixes a problem reported by John Bowman when the Compaq/HP
13598 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
13599 -ansi -Wall -gall).
13600 * data/yacc.c (union yyalloc): Likewise.
13601 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
13602
13603 Switch from 'int' to 'bool' where that makes sense.
13604
13605 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
13606 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
13607 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
13608 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
13609 Return or accept bool, not int. All callers changed.
13610 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
13611 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
13612 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
13613 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
13614 bitset_or_and_cmp_): Likewise.
13615 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
13616 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
13617 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
13618 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
13619 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
13620 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
13621 bitset_stats_or_and_cmp): Likewise.
13622 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
13623 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
13624 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
13625 ebitset_xor_cmp): Likewise.
13626 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
13627 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
13628 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
13629 lbitset_xor_cmp): Likewise.
13630 * lib/bbitset.h: Include <stdbool.h>.
13631 (struct bitset_vtable): The following members now return bool, not
13632 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
13633 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
13634 or_and_cmp).
13635 * src/conflicts.c (count_rr_conflicts): Likewise.
13636 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
13637 All uses changed.
13638 * lib/ebitset.c (ebitset_obstack_init): Likewise.
13639 * lib/lbitset.c (lbitset_obstack_init): Likewise.
13640 * src/getargs.c (debug_flag, defines_flag, locations_flag,
13641 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
13642 graph_flag): Likewise.
13643 * src/getargs.h (debug_flag, defines_flag, locations_flag,
13644 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
13645 graph_flag): Likewise.
13646 * src/output.c (error_verbose): Likewise.
13647 * src/output.h (error_verbose): Likewise.
13648 * src/reader.c (start_flag, typed): Likewise.
13649 * src/reader.h (typed): Likewise.
13650 * src/getargs.c (LOCATIONS_OPTION): New constant.
13651 (long_options, getargs): Use it.
13652 * src/lalr.c (build_relations): Use bool, not int.
13653 * src/nullable.c (nullable_compute): Likewise.
13654 * src/print.c (print_reductions): Likewise.
13655 * src/tables.c (action_row, pack_vector): Likewise.
13656 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
13657 * src/output.c (prepare): Use it.
13658 * src/output.c (token_definitions_output,
13659 symbol_destructors_output, symbol_destructors_output): Use string,
13660 not boolean integer, to keep track of whether to output separator.
13661 * src/print_graph.c (print_core): Likewise.
13662 * src/state.c (state_rule_lookaheads_print): Likewise.
13663
13664 * config/install-sh: Sync from automake 1.7.5.
13665
136662003-05-14 Paul Eggert <eggert@twinsun.com>
13667
13668 * src/parse-gram.y (rules_or_grammar_declaration): Require a
13669 semicolon after a grammar declaration, in the interest of possible
13670 future changes to the Bison input language.
13671 Do not allow a stray semicolon at the start of the grammar.
13672 (rhses.1): Allow one or more semicolons after any rule, including
13673 just before "|" as required by POSIX.
13674 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
13675 grammar.
13676
136772003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
13678
13679 %parse-param support for lalr1.cc.
13680
13681 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
13682 b4_cc_constructor_calls, b4_cc_constructor_call,
13683 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
13684 definitions.
13685 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
13686 parse-param arguments.
13687 (yy::b4_parser_class_name): Declare instance variables to
13688 hold parse-param arguments.
13689 * tests/calc.at: s/value/semantic_value/ because value clashes
13690 with a member of yy::b4_parser_class_name. Adjust C++ code
13691 to handle %parse-param. Enable %parse-param test in C++.
13692
136932003-05-12 Paul Eggert <eggert@twinsun.com>
13694
13695 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
13696 English a bit. Fix fclose typo. Change "const char" to "char
13697 const", and use ANSI C rather than K&R for "main". Suggest
13698 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
13699 and suggest yy_switch_to_buffer.
13700
137012003-05-05 Paul Eggert <eggert@twinsun.com>
13702
13703 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
13704 C89. This avoids a diagnostic on compilers that define __STDC__
13705 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
13706 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
13707
137082003-05-03 Paul Eggert <eggert@twinsun.com>
13709
13710 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
13711 Do not overrun array bounds.
13712 This should fix a bug reported today by Olatunji Oluwabukunmi in
13713 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
13714
137152003-04-29 Akim Demaille <akim@epita.fr>
13716
13717 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
13718 * src/getargs.c, src/getargs.h: here, as bool, not int.
13719 (nondeterministic_parser): New.
13720 * src/parse-gram.y, src/scan-gram.l: Support
13721 %nondeterministic-parser.
13722 * src/output.c (prepare): Use nondeterministic_parser instead
13723 of glr_parser where appropriate.
13724 * src/tables.c (conflict_row, action_row, save_row)
13725 (token_actions, token_actions, pack_vector): Ditto.
13726
137272003-04-29 Akim Demaille <akim@epita.fr>
13728
13729 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
13730
137312003-04-29 Akim Demaille <akim@epita.fr>
13732
13733 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
13734 with %pure-parser and %locations to exercise the patch from Yakov
13735 Markovitch below.
13736
137372003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
13738
13739 * data/yacc.c: (b4_lex_param): Corrected for the case where
13740 %lex-param is provided and %pure-parser isn't.
13741
137422003-04-27 Paul Eggert <eggert@twinsun.com>
13743
13744 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
13745 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
13746 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
13747 if it is not defined.
13748 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
13749
137502003-04-26 Paul Eggert <eggert@twinsun.com>
13751
13752 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
13753 Declare to be of type suitable for the ninf value itself, not of
13754 type suitable for the corresponding table, since the latter might
13755 be unsigned but the ninf value might be negative. This fixes a
13756 bug reported by Alexandre Duret-Lutz in
13757 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
13758
13759 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
13760 invokes it. We shouldn't invoke it twice because it will attempt
13761 to put error.o in the archive twice. This fixes a glitch reported
13762 by Martin Mokrejs in
13763 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
13764
137652003-04-21 Paul Eggert <eggert@twinsun.com>
13766
13767 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
13768 to gnulib.
13769
137702003-04-21 Yakov Markovitch <Markovitch@iso.ru>
13771
13772 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
13773 Fix obvious typo that results in uncompilable GLR parsers
13774 when both %pure-parser and %locations are used. (trivial change)
13775
137762003-04-17 Paul Eggert <eggert@twinsun.com>
13777
13778 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
13779 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
13780 Do not insert the expected token via unput, as this runs afoul
13781 of a POSIX-compatibility bug in flex 2.5.31.
13782 All uses changed to BEGIN the parent state,
13783 since we no longer insert the expected token via unput.
13784 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
13785 that is no longer emitted after the above change.
13786
13787 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
13788 the first one. This change is from Paul Hilfinger, and it fixes
13789 regression reported by Werner Lemberg in
13790 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
13791
13792 (resolve_sr_conflict): Don't invoke state_errs_set
13793 unless one or more tokens have been explicitly made errors.
13794 Otherwise, the above change causes Bison to abort.
13795
13796 * tests/existing.at (GNU pic Grammar): New test case, taken from
13797 Lemberg's email.
13798
137992003-03-31 Akim Demaille <akim@epita.fr>
13800
13801 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
13802
138032003-03-31 Akim Demaille <akim@epita.fr>
13804
13805 * src/output.c (prepare_symbols): Avoid trailing spaces in the
13806 output.
13807
138082003-03-31 Akim Demaille <akim@epita.fr>
13809
13810 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
13811 From Paul Hilfinger.
13812
138132003-03-29 Akim Demaille <akim@epita.fr>
13814
13815 * m4/error.m4: Do not put under dynamic conditions some code which
13816 expansion is under static control.
13817
138182003-03-29 Akim Demaille <akim@epita.fr>
13819
13820 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
13821
138222003-03-29 Akim Demaille <akim@epita.fr>
13823
13824 * doc/bison.texinfo (Strings are Destroyed): New.
13825
138262003-03-13 Paul Eggert <eggert@twinsun.com>
13827
13828 * .cvsignore: Add configure.lineno.
13829 * src/.cvsignore: Add yacc.
13830 * tests/.cvsignore: Add testsuite.log.
13831 * doc/fdl.texi: Sync with latest FSF version.
13832
138332003-03-12 Paul Eggert <eggert@twinsun.com>
13834
13835 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
13836 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
13837 cursor, instead of leaving it undefined. This fixes a bug
13838 reported by Tim Van Holder in
13839 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
13840 * tests/input.at (Torturing the Scanner): Test the scanner on
13841 an empty input file, which was Tim Van Holder's test case.
13842
13843 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
13844 <sys/resource.h> can be included, include sys/time.h and
13845 sys/times.h first, if available. This works around the SunOS
13846 4.1.4 porting bug reported by Bruce Becker in
13847 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
13848
13849 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
13850 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
13851 AC_HEADER_SYS_WAIT.
13852
13853 Merge changes from gnulib. This was prompted because the CVS
13854 snapshot didn't build on Solaris 7 due to strnlen problems.
13855
13856 These changes need to be merged back into gnulib:
13857 * lib/hash.c: Include <stdbool.h> unconditionally.
13858 * m4/onceonly.m4 (m4_quote): New macro.
13859 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
13860 Quote AC_FOREACH variable-expansions properly.
13861 The 2003-01-03 obstack.h change also needs merging.
13862 {end of changes requiring merging}
13863
13864 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13865 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
13866 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
13867 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
13868 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
13869 New files, imported from gnulib.
13870 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
13871 above.
13872
13873 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
13874 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
13875 gnulib sources.
13876
13877 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
13878 Add.
13879 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
13880 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
13881 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
13882 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
13883 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
13884 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
13885 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
13886 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
13887 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
13888 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
13889 (jm_PREREQ_ARGMATCH): Remove.
13890 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
13891 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
13892
13893 * src/system.h: Include <stdbool.h> unconditionally.
13894
13895 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
13896 assuming at least C89 in the bitset code for some time now.
13897
138982003-03-03 Akim Demaille <akim@epita.fr>
13899
13900 * ro.po: New.
13901
139022003-03-02 Akim Demaille <akim@epita.fr>
13903
13904 * doc/bison.texinfo (Table of Symbols): Reactivate the
13905 documentation for %lex-param, and %parse-param.
13906
139072003-03-02 Akim Demaille <akim@epita.fr>
13908
13909 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
13910 generate verbose error messages.
13911 Use the number of tokens as an upper bound in yytname, as it
13912 cannot be a non terminal.
13913
139142003-03-02 Akim Demaille <akim@epita.fr>
13915
13916 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
13917 message.
13918
139192003-03-02 Akim Demaille <akim@epita.fr>
13920
13921 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
13922 Use them to exercise yycheck overrun.
13923 Based on Andrew Suffield's grammar.
13924
139252003-03-02 Akim Demaille <akim@epita.fr>
13926
13927 Create tests/local.at for Bison generic testing macros.
13928
13929 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
13930 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
13931 This new file.
13932 * tests/calc.at (AT_CHECK_CALC): Adjust.
13933 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
13934 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
13935 * tests/local.at: here.
13936 (AT_COMPILE_CXX): Tags the tests using it as c++.
13937 Ignore the test if CXX is not functional.
13938
139392003-03-01 Paul Eggert <eggert@twinsun.com>
13940
13941 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
13942 not loc->end, since loc->end might contain garbage and this leads
13943 to undefined behavior on some platforms.
13944 (id_loc, token_start): Use (IF_LINTed) initial values that do not
13945 depend on *loc, so that the reader doesn't give the the false
13946 impression that *loc is initialized.
13947 (<INITIAL>"%%"): Do not bother setting code_start, since its value
13948 does not survive the return.
13949
139502003-03-01 Akim Demaille <akim@epita.fr>
13951
13952 * src/scan-gram.l (code_start): Always initialize it when entering
13953 into yylex, as SC_EPILOGUE is activated *before* the corresponding
13954 yylex invocation. An alternative would be making it static, but
13955 then it starts with the second %%'s beginning, instead of its end.
13956
139572003-02-28 Paul Eggert <eggert@twinsun.com>
13958
13959 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
13960 around a UnixWare 7.1.1 porting bug reported by John Hughes in
13961 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
13962
139632003-02-26 Paul Eggert <eggert@twinsun.com>
13964
13965 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
13966 Remove Sequent/Pyramid discussion (nobody uses them any more).
13967 Merge VMS and MS-DOS discussion; these ports may well be dead
13968 but let's keep mentioning them for now. Put <> around email
13969 addresses. Add copyright notice.
13970
139712003-02-24 Paul Eggert <eggert@twinsun.com>
13972
13973 * data/glr.c (yy_reduce_print): yylineno -> yylno,
13974 to avoid collision with flex use of yylineno.
13975 Problem reported by Bruce Lilly in
13976 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
13977 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
13978 * data/yacc.c (yy_reduce_print): Likewise.
13979
13980 * config/depcomp: Sync with Automake 1.7.3.
13981
139822003-02-21 Akim Demaille <akim@epita.fr>
13983
13984 * data/lalr1.cc: Use temporary variables instead of casts to
13985 change integer types.
13986 Suggested by Paul Eggert.
13987
139882003-02-21 Akim Demaille <akim@epita.fr>
13989
13990 * doc/bison.texinfo: Use "location" consistently to refer to @n,
13991 to avoid confusions with lalr1.cc's notion of Position.
13992 Suggested by Paul Eggert.
13993
139942003-02-20 Akim Demaille <akim@epita.fr>
13995
13996 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
13997 before initial_columns.
13998 (location.hh): Use consistent variable names when defining the
13999 operator<<.
14000 Use "last" so that we subtract from Positions, not from unsigned.
14001
140022003-02-20 Akim Demaille <akim@epita.fr>
14003
14004 * data/lalr1.cc (position.hh): New subfile, including the extended
14005 and Doxygen'ed documentation of class Position.
14006 (location.hh): Use it.
14007 Document a` la Doxygen.
14008 With the help of Benoit Perrot.
14009
140102003-02-20 Akim Demaille <akim@epita.fr>
14011
14012 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
14013 AT_YACC_IF.
14014 Redefine AT_YYERROR_SEES_LOC_IF using it.
14015 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
14016 not defined.
14017 Don't use the location in yy::Parser::error_ and
14018 yy::Parser::print_ when not %locations.
14019 Activate more lalr1.cc tests.
14020
140212003-02-19 Akim Demaille <akim@epita.fr>
14022
14023 * data/lalr1.cc: When displaying a line number, be sure to make it
14024 an int.
14025
140262003-02-19 Akim Demaille <akim@epita.fr>
14027
14028 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
14029 Remove, useless.
14030 (YYABORT, YYACCEPT, YYERROR): New.
14031 * tests/calc.at: Renable the lalr1.cc test.
14032
140332003-02-19 Akim Demaille <akim@epita.fr>
14034
14035 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
14036 error recovery, mixing with/without pops and discarding of the
14037 lookahead.
14038 Exercise YYERROR.
14039 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
14040
140412003-02-17 Paul Eggert <eggert@twinsun.com>
14042
14043 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
14044 * tests/testsuite.at (AT_COMPILE): Use them.
14045 This fixes the testsuite problem reported by Robert Lentz in
14046 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
14047
140482003-02-12 Paul Eggert <eggert@twinsun.com>
14049
14050 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
14051 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
14052 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
14053 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
14054 Check for malloc failure, for consistency with yacc.c.
14055 (yytname_size): Remove, for consistency with yacc.c.
14056
14057 The bug still remains in data/lalr1.cc, as I didn't have time
14058 to fix it there.
14059
140602003-02-06 Akim Demaille <akim@epita.fr>
14061
14062 * configure.ac (GXX): Rename as...
14063 (CXX): this, to keep the original Autoconf semantics.
14064 Require 2.57.
14065 * data/lalr1.cc: Fix b4_copyright invocations.
14066 If YYDEBUG is not defined, don't depend upon name_ being defined.
14067 (location.hh): Include string and iostream.
14068 (Position::filename): New member.
14069 (Position::Position ()): New.
14070 (operator<< (Position)): New.
14071 (operator- (Position, int)): New.
14072 (Location::first, Location::last): Rename as...
14073 (Location::begin, Location::end): these, to mock the conventional
14074 iterator names.
14075 (operator<< (Location)): New.
14076 * tests/atlocal.in (CXX): New.
14077 * tests/testsuite.at (AT_COMPILE_CXX): New.
14078 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
14079 locations in a more synthetic way.
14080 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
14081 lalr1.cc is used.
14082 Adjust the C locations to match those from Emacs: first column is
14083 column 0.
14084 Change all the expected results.
14085 Conform to the GCS: simplify the locations when applicable.
14086 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
14087 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
14088 these CPP macros with the m4 macros new defined by...
14089 (AT_CHECK_PUSHDEFS): this, i.e.:
14090 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
14091 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
14092 New macros.
14093 (AT_CHECK_POPDEFS): Undefine them.
14094 (AT_CHECK_CALC_LALR1_CC): New.
14095 Use it for the first lalr1.cc test.
14096
140972003-02-04 Akim Demaille <akim@epita.fr>
14098
14099 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
14100 Location as is defined.
14101
141022003-02-04 Akim Demaille <akim@epita.fr>
14103
14104 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
14105 name_ being defined.
14106
141072003-02-03 Paul Eggert <eggert@twinsun.com>
14108
14109 * src/gram.h (start_symbol): Remove unused decl.
14110
14111 Use more-consistent naming conventions for local vars.
14112
14113 * src/derives.c (derives_compute): Change type of local var from
14114 int to rule_number.
14115 * src/gram.c (grammar_rules_partial_print): Likewise.
14116 * src/print.c (print_core): Likewise.
14117 * src/reduce.c (reduce_grammar_tables): Likewise.
14118
14119 * src/gram.c (grammar_dump): Change name of item_number *
14120 local var from r to rp.
14121 * src/nullable.c (nullable_compute): Likewise.
14122
14123 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
14124
14125 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
14126 for symbol or symbol_number var.
14127 * src/reader.c (grammar_start_symbol_set): Likewise.
14128 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
14129 Likewise.
14130 * src/state.c (transitions_to): Likewise.
14131 * src/state.h: Likewise.
14132 * src/tables.c (symbol_number_to_vector_number): Likewise.
14133
14134 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
14135 char * var.
14136
14137 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
14138 var.
14139
14140 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
14141 var.
14142
14143 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
14144 Use str, not s, for char * var. Use ch, not c, for character var.
14145 Use size for size var.
14146
14147 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
14148 char * var.
14149 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
14150 uniqstr var.
14151 * src/uniqstr.h: Likewise.
14152
14153 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
14154 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
14155 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
14156 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
14157 param to have same name as that of enum, so that we don't use
14158 "s" to stand for a non-state.
14159
141602003-02-02 Akim Demaille <akim@epita.fr>
14161
14162 * src/scan-skel.l: Scan more than one inert character per yylex
14163 invocation.
14164
141652003-02-01 Paul Eggert <eggert@twinsun.com>
14166
14167 Version 1.875a.
14168
14169 * po/LINGUAS: Add ms.
14170
141712003-01-30 Akim Demaille <akim@epita.fr>
14172
14173 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
14174
141752003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14176
14177 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
14178 of $1.
14179
14180 Changes in response to error report by S. Eken: GLR mode does not
14181 handle negative $ indices or $ indices in embedded rules correctly.
14182 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
14183
14184 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
14185 (b4_rhs_location): Ditto.
14186 (yyfill): New function to copy from stack tree into array
14187 incrementally.
14188 (yyuserAction): Modify to allow incremental move of semantic values
14189 to rhs array when in GLR mode.
14190 Define YYFILL to use in user-defined actions to fill semantic array
14191 as needed.
14192 Remove dummy use of yystack, as there is now a guaranteed use.
14193 (yydoAction): Modify to allow incremental move of semantic values
14194 to rhs array when in GLR mode.
14195 (yyresolveAction): Ditto.
14196 (yyglrShiftDefer): Update comment.
14197 (yyresolveStates): Use X == NULL for pointers, not !X.
14198 (yyglrReduce): Ditto.
14199 (yydoAction): Ditto
14200
14201 * tests/glr-regr1.at: Rename to ...
14202 * tests/glr-regression.at: Add new regression test for the problems
14203 described above (adapted from S. Eken).
14204 Update copyright notice.
14205 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
14206 * tests/Makefile.am: Ditto.
14207
142082003-01-28 Paul Eggert <eggert@twinsun.com>
14209
14210 * data/lalr1.cc: Do not use @output_header_name@ unless
14211 b4_defines_flag is set. This fixes two bugs reported by
14212 Tim Van Holder in
14213 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
14214 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
14215
142162003-01-21 Paul Eggert <eggert@twinsun.com>
14217
14218 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
14219 we don't need to worry about yyerrlab1 being reported as an
14220 "unused label" by non-GCC C compilers. The downside is that if
14221 locations are used then a couple of statements are duplicated each
14222 time YYERROR is invoked, but the upside is that the warnings
14223 should vanish.
14224 (yyerrlab1): Move code to YERROR.
14225 (yyerrlab2): Remove. Change uses back to yyerrlab1.
14226 This reverts some of the 2002-12-27 change.
14227
142282003-01-17 Paul Eggert <eggert@twinsun.com>
14229
14230 * src/output.c (symbol_printers_output): Fix typo that led
14231 to core dump. Problem reported by Antonio Rus in
14232 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
14233
142342003-01-13 Akim Demaille <akim@epita.fr>,
14235 Quoc Peyrot <chojin@lrde.epita.fr>,
14236 Robert Anisko <anisko_r@lrde.epita.fr>
14237
14238 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
14239 when the stacks contain one element, as the loop would otherwise
14240 free the last state, and then use the top state (the one we just
14241 popped). This means that the initial elements will not be freed
14242 explicitly, as is the case in yacc.c; it is not a problem, as
14243 these elements have fake values.
14244
142452003-01-11 Paul Eggert <eggert@twinsun.com>
14246
14247 * NEWS: %expect-violations are now just warnings, reverting
14248 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
14249 bootstrapping problem reported by Matthias Klose; see
14250 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
14251 * src/conflicts.c (conflicts_print): Likewise.
14252 * tests/conflicts.at (%expect not enough, %expect too much,
14253 %expect with reduce conflicts): Likewise.
14254 * doc/bison.texinfo (Expect Decl): Document this. Also mention
14255 that the warning is enabled if the number of conflicts changes
14256 (not necessarily increases).
14257
14258 * src/getargs.c (version): Update copyright year.
14259
142602003-01-09 Akim Demaille <akim@epita.fr>
14261
14262 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
14263
142642003-01-08 Paul Eggert <eggert@twinsun.com>
14265
14266 * Makefile.maint (WGETFLAGS):
14267 New macro, containing "-C off" to disable proxy caches.
14268 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
14269 (rel-check): Use $(WGET) instead of wget.
14270
142712003-01-06 Paul Eggert <eggert@twinsun.com>
14272
14273 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
14274 the GLR paper of Scott, Johnstone and Hussain.
14275
142762003-01-04 Paul Eggert <eggert@twinsun.com>
14277
14278 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
14279 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
14280 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
14281 (EXTRA_LIBRARIES): New var, for liby.a.
14282 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
14283 (EXTRA_SCRIPTS): New var, for yacc.
14284
14285 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
14286 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
14287 Problem reported by Nelson H. F. Beebe.
14288
142892003-01-03 Paul Eggert <eggert@twinsun.com>
14290
14291 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
14292 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
14293 when compiling Bison 1.875's `bitset bset = obstack_alloc
14294 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
14295
14296 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
14297 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
14298 grow to a huge size with typical invocation.
14299
14300 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
14301 Use the pattern recommended by Autoconf 2.57, except also protect
14302 against double-definition.
14303 * src/system.h: Likewise.
14304 Portability issues reported by Nelson H. F. Beebe.
14305
14306 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
14307 All uses changed. Provide a definition in both C and C++.
14308 (yytrue, yyfalse): Define even if defined (__cplusplus).
14309
14310 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
14311 Reported by Nelson H. F. Beebe.
14312
14313 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
14314
143152003-01-02 Paul Eggert <eggert@twinsun.com>
14316
14317 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
14318 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
14319 Bug reported by Nelson H. F. Beebe.
14320
143212003-01-01 Paul Eggert <eggert@twinsun.com>
14322
14323 * Version 1.875.
14324
143252002-12-30 Paul Eggert <eggert@twinsun.com>
14326
14327 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
14328 Moved here from...
14329 (<INITIAL>","): Here. This causes stray "," to be treated
14330 more uniformly.
14331
14332 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
14333 last brace in braced code when not in Yacc mode, for compatibility
14334 with Bison 1.35. This resurrects the 2001-12-15 patch to
14335 src/reader.c.
14336
14337 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
14338 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
14339
143402002-12-28 Paul Eggert <eggert@twinsun.com>
14341
14342 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
14343 that of SYM's type. This fixes Debian bug 168069, reported by
14344 Thomas Olsson.
14345
143462002-12-28 Paul Eggert <eggert@twinsun.com>
14347
14348 Version 1.75f.
14349
14350 Switch back to the Yacc style of conflict reports, undoing some
14351 of the 2002-07-30 change.
14352 * doc/bison.texinfo (Understanding): Use Yacc style for
14353 conflict reports. Also, use new way of locating rules.
14354 * src/conflicts.c (conflict_report):
14355 Renamed from conflict_report_yacc, removing the old
14356 'conflict_report'. Translate the entire conflict report at once,
14357 so that we don't assume that "," has the same interpretation in
14358 all languages.
14359 (conflicts_output): Use Yacc-style conflict report for each state,
14360 instead of our more-complicated style.
14361 (conflicts_print): Use Yacc-style conflict report, except print
14362 the input file name when not emulating Yacc.
14363 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
14364 Conflicted Reduction, %expect not enough, %expect too much,
14365 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
14366 * tests/existing.at (GNU Cim Grammar): Likewise.
14367 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
14368
14369 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
14370 fatal): Don't invoke fflush; it's not needed and it might even be
14371 harmful for stdout, as stdout might not be open.
14372 * src/reduce.c (reduce_print): Likewise.
14373
143742002-12-27 Paul Eggert <eggert@twinsun.com>
14375
14376 Fix a bug where error locations were not being recorded correctly.
14377 This problem was originally reported by Paul Hilfinger in
14378 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
14379
14380 * data/yacc.c (yyparse): New local var yylerrsp, to record the
14381 top of the location stack's error locations.
14382 (yyerrlab): Set it. When discarding a token, push its location
14383 onto yylerrsp so that we don't lose track of the error's end.
14384 (yyerrlab1): Now is only the target of YYERROR, so that we can
14385 properly record the location of the action that failed. For GCC
14386 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
14387 GCC warning about yyerrlab1 being unused if YYERROR is unused.
14388 (yyerrlab2): New label, which yyerrlab now falls through to.
14389 Compute the error's location by applying YYLLOC_DEFAULT to
14390 the locations of all the symbols that went into the error.
14391 * doc/bison.texinfo (Location Default Action): Mention that
14392 YYLLOC_DEFAULT is also invoked for syntax errors.
14393 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
14394 Error locations include the locations of all the tokens that were
14395 discarded, not just the last token.
14396
143972002-12-26 Paul Eggert <eggert@twinsun.com>
14398
14399 * src/files.c: Include quote.h.
14400 (compute_output_file_names): Warn if we detect conflicting
14401 outputs to the same file. This should catch the misunderstanding
14402 exemplified by Debian Bug 165349, reported by Bruce Stephens..
14403
14404 * src/conflicts.c (conflicts_print): If the user specifies
14405 "%expect N", report an error if there are any reduce/reduce
14406 conflicts. This is what the manual says should happen.
14407 This fixes Debian bug 130890, reported by Anthony DeRobertis.
14408 * tests/conflicts.at (%expect with reduce conflicts): New test.
14409
14410 Don't use m4_include on relative file names, as it doesn't work as
14411 desired if there happens to be a file with that name under ".".
14412
14413 * m4sugar/version.m4: Remove; it was included but it wasn't used.
14414 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
14415 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
14416 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
14417 * src/output.c (output_skeleton): Use full path names when
14418 specifying a file to include; don't rely on include path, as
14419 it's unreliable when the working file contains a file with
14420 that name.
14421
144222002-12-25 Paul Eggert <eggert@twinsun.com>
14423
14424 Remove obsolete references to bison.simple and bison.hairy.
14425 Problem mentioned by Aubin Mahe in
14426 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
14427 * data/glr.c: Comment fix.
14428 * doc/bison.1: Remove references. Also, mention "yacc".
14429
14430 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
14431 with -g option.
14432
14433 * src/parse-gram.y (declaration): Use enum "report_states" rather
14434 than its numeric value 1.
14435
14436 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
14437 opening a new one. This fixes Debian bug 165349, reported by
14438 Bruce Stephens.
14439
144402002-12-24 Paul Eggert <eggert@twinsun.com>
14441
14442 Version 1.75e.
14443
14444 * Makefile.maint (cvs-update): Don't assume that the shell
14445 supports $(...), as Solaris sh doesn't.
14446
14447 * src/parse-gram.y (lloc_default): Remove test for empty
14448 nonterminals at the end, since it didn't change the result.
14449
144502002-12-24 Paul Eggert <eggert@twinsun.com>
14451
14452 If the user does not define YYSTYPE as a macro, Bison now declares it
14453 using typedef instead of defining it as a macro. POSIX requires this.
14454 For consistency, YYLTYPE is also declared instead of defined.
14455
14456 %union directives can now have a tag before the `{', e.g., the
14457 directive `%union foo {...}' now generates the C code
14458 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
14459 The default union tag is `YYSTYPE', for compatibility with Solaris 9
14460 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
14461 instead of `yyltype'.
14462
14463 `yystype' and `yyltype' are now obsolescent macros instead of being
14464 typedefs or tags; they are no longer documented and will be
14465 withdrawn in a future release.
14466
14467 * data/glr.c (b4_location_type): Remove.
14468 (YYSTYPE): Renamed from yystype.
14469 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
14470 (struct YYLTYPE): Renamed from struct yyltype.
14471 (YYLTYPE): Renamed from yyltype.
14472 (yyltype, yystype): New (and obsolescent) macros,
14473 for backward compatibility.
14474 * data/yacc.c: Likewise.
14475
14476 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
14477 does not specify a union tag. This is for compatibility with
14478 Solaris 9 yacc.
14479
14480 * src/parse-gram.y (add_param): 2nd arg is now char * not char
14481 const *, since it is now modified by stripping surrounding { }.
14482 (current_braced_code): Remove.
14483 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
14484 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
14485 trailing " {...}". Now of type <chars>.
14486 (grammar_declaration): Adjust to bundled tokens.
14487 (code_content): Remove; stripping is now done by add_param.
14488 (print_token_value): Print contents of bundled tokens.
14489 (token_name): New function.
14490
14491 * src/reader.h (braced_code, current_braced_code): Remove.
14492 (token_name): New decl.
14493
14494 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
14495 token_type, not braced_code code_kind. All uses changed.
14496 (SC_PRE_CODE): New state, for scanning after a keyword that
14497 has (or usually has) an immediately-following braced code.
14498 (token_type): New local var, to keep track of which token type
14499 to return when scanning braced code.
14500 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
14501 <INITIAL>"%parse-param", <INITIAL>"%printer",
14502 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
14503 instead of returning a token type immediately.
14504 (<INITIAL>"{"): Set token type.
14505 (<SC_BRACED_CODE>"}"): Use it.
14506 (handle_action_dollar, handle_action_at): Now returns bool
14507 indicating success. Fail if ! current_rule; this prevents a core dump.
14508 (handle_symbol_code_dollar, handle_symbol_code_at):
14509 Remove; merge body into caller.
14510 (handle_dollar, handle_at): Complain in invalid contexts.
14511
14512 * NEWS, doc/bison.texinfo: Document the above.
14513 * NEWS: Fix years and program names in copyright notice.
14514
145152002-12-17 Paul Eggert <eggert@twinsun.com>
14516
14517 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
14518 Reporting, Table of Symbols): Omit mentions of %lex-param and
14519 %parse-param from the documentation for now.
14520
145212002-12-15 Paul Eggert <eggert@twinsun.com>
14522
14523 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
14524 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
14525 lookahead symbol, and which sets yychar in parser actions) and it
14526 disagreed with the Bison documentation. Bug
14527 reported by Andrew Walrond.
14528
14529 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
14530 as the caller now does that.
14531 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
14532 (YYEMPTY): Parenthesize right hand side, since others use it.
14533 (yyparse): Don't assume that our generated code is the only code
14534 that sets yychar.
14535
145362002-12-13 Paul Eggert <eggert@twinsun.com>
14537
14538 Version 1.75d.
14539
14540 POSIX requires a "yacc" command.
14541 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
14542 (MOSTLYCLEANFILES): Add yacc.
14543 (yacc): New rule.
14544 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
14545 as an alias for bison y.
14546
14547 * po/LINGUAS: Add da.
14548
14549 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
14550 problem with latest <getopt.h>.
14551 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
14552
14553 * doc/fdl.texi: Upgrade to 1.2.
14554 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
14555 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
14556 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
14557 gnulib.
14558 * config/install-sh: Sync with autotools.
14559
14560 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
14561 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
14562 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
14563 locations are requested.
14564 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
14565 locations are requested.
14566
145672002-12-12 Paul Eggert <eggert@twinsun.com>
14568
14569 Remove unportable casts and storage allocation tricks.
14570 While we're at it, remove almost all casts, since they
14571 usually aren't needed and are a sign of trouble.
14572
14573 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
14574
14575 * src/derives.c (derives_compute): Do not subtract NTOKENS from
14576 the pointer DSET returned by malloc; this isn't portable.
14577 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
14578 Similarly for DERIVES.
14579 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
14580 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
14581 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
14582
14583 * src/derives.c (derives_compute): Do not bother invoking
14584 int_of_rule_number, since rule numbers are integers.
14585
14586 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
14587 rather than XMALLOC (char, N).
14588
14589 * src/files.c (filename_split): Rewrite to avoid cast.
14590
14591 * src/gram.h (symbol_number_as_item_number,
14592 item_number_as_symbol_number, rule_number_as_item_number,
14593 item_number_as_rule_number):
14594 Now inline functions rather than macros, to avoid casts.
14595 * src/state.h (state_number_as_int): Likewise.
14596 * src/tables.c (state_number_to_vector_number,
14597 symbol_number_to_vector_number): Likewise.
14598
14599 * src/gram.h (int_of_rule_number): Remove; no longer used.
14600
14601 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
14602 since the resulting storage is always stored into.
14603
14604 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
14605 where it's needed.
14606
14607 * src/muscle_tab.c (muscle_m4_output):
14608 Now inline. Return bool, not int.
14609 * src/state.c (state_compare): Likewise.
14610 * src/symtab.c (symbol_check_defined,
14611 symbol_check_alias_consistency, symbol_pack, symbol_translation,
14612 hash_compare_symbol, hash_symbol):
14613 Likewise.
14614 * src/uniqstr.c (uniqstr_print): Likewise.
14615 * src/muscle_tab.c (muscle_m4_output_processor):
14616 New function, to avoid casts.
14617 * src/state.c (state_comparator, stage_hasher): Likewise.
14618 * src/symtab.c (symbol_check_defined_processor,
14619 symbol_check_alias_consistency_processor, symbol_pack_processor,
14620 symbol_translation_processor, hash_symbol_comparator,
14621 hash_symbol_hasher): Likewise.
14622 * src/uniqstr.c (uniqstr_print_processor): Likewise.
14623 * src/muscle_tab.c (muscles_m4_output):
14624 Use new functions instead of casting old functions unportably.
14625 * src/state.c (state_hash_new): Likewise.
14626 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
14627 symbols_token_translations_init):
14628 Likewise.
14629 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
14630
14631 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
14632 var instead of casting to long, to avoid casts.
14633 (prepare_states): Use MALLOC rather than alloca, so that we don't
14634 have to worry about alloca.
14635 * src/state.c (state_hash_lookup): Likewise.
14636
14637 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
14638 local var instead of casting to unsigned char, to avoid casts.
14639
14640 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
14641 STATE_ALLOC): Remove.
14642 (transitions_new, errs_new, reductions_new, state_new): Use malloc
14643 rather than calloc, and use offsetof to avoid allocating slightly
14644 too much storage.
14645 (state_new): Initialize all members.
14646
14647 * src/state.c (state_hash): Use unsigned accumulator, not signed.
14648
14649 * src/symtab.c (symbol_free): Remove; unused.
14650 (symbol_get): Remove cast in lhs of assignment.
14651 (symbols_do): Now static. Accept generic arguments, not
14652 hashing-related ones.
14653
14654 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
14655 (symbol_processor): Remove.
14656 (symbols_do): Remove decl; now static.
14657
14658 * src/system.h (alloca): Remove; decl no longer needed.
14659 (<stddef.h>): Include, for offsetof.
14660 (<inttypes.>, <stdint.h>): Include if available.
14661 (uintptr_t): New type, if system lacks it.
14662 (CALLOC, MALLOC, REALLOC): New macros.
14663 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
14664 new macros.
14665
14666 * src/tables.c (table_size): Now int, to pacify GCC.
14667 (table_grow, table_ninf_remap): Use signed table size.
14668 (save_row): Don't bother initializing locals when not needed.
14669 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
14670 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
14671
14672 * src/vcg.h: Correct misspellings.
14673
14674 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
14675
14676
14677 * src/getargs.c (getargs): Don't assume EOF == -1.
14678
146792002-12-09 Paul Eggert <eggert@twinsun.com>
14680
14681 Change identifier spellings to avoid collisions with names
14682 that are reserved by POSIX.
14683
14684 Don't use names ending in _t, since POSIX reserves them.
14685 For consistency, remove _e and _s endings -- they're weren't
14686 needed to remove ambiguity. All uses changed.
14687 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
14688 turn was just renamed from struniq_t.
14689 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
14690 which in turn was just renamed from struniq_processor_t.
14691 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
14692 in turn was renamed from hash_compare_struniq_t.
14693 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
14694 (state_list): Renamed from state_list_t.
14695 * src/assoc.h (assoc): Renamed from assoc_t.
14696 * src/conflicts.c (enum conflict_resolution): Renamed from
14697 enum conflict_resolution_e.
14698 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
14699 (rule_list): Renamed from rule_list_t.
14700 * src/getargs.h (enum trace): Renamed from enum trace_e.
14701 (enum report): Renamed from enum report_e.
14702 * src/gram.h (item_number): Renamed from item_number_t.
14703 (rule_number): Renamed from rule_number_t.
14704 (struct rule_s): Remove the "rule_s" part; not used.
14705 (rule): Renamed from rule_t.
14706 (rule_filter): Renamed from rule_filter_t.
14707 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
14708 (goto_list): Renamed from goto_list_t.
14709 * src/lalr.h (goto_number): Renamed from goto_number_t.
14710 * src/location.h (location): Renamed from location_t.
14711 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
14712 and moved here from:
14713 * src/muscle_tab.h (muscle_entry_t): here.
14714 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
14715 (rule_list): Renamed from rule_list_t.
14716 * src/print_graph.c (static_graph): Renamed from graph.
14717 * src/reader.h (braced_code): Renamed from braced_code_t.
14718 Remove brace_code_e tag.
14719 * src/relation.h (relation_node): Renamed from relation_node_t.
14720 (relation_nodes): Renamed from relation_nodes_t.
14721 (relation): Renamed from relation_t.
14722 * src/state.h (state_number): Renamed from state_number_t.
14723 (struct state): Renamed from struct state_s.
14724 (state): Renamed from state_t.
14725 (transitions): Renamed from transitions_t. Unused (and
14726 misspelled) transtion_s tag removed.
14727 (errs): Renamed from errs_t. Unused errs_s tag removed.
14728 (reductions): Renamed from reductions_t. Unused tag
14729 reductions_s removed.
14730 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
14731 (struct symbol_list): Renamed from struct symbol_list_s.
14732 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
14733 (struct symbol): Renamed from struct symbol_s.
14734 (symbol): Renamed from symbol_t.
14735 * src/tables.c (vector_number): Renamed from vector_number_t.
14736 (action_number): Renamed from action_t.
14737 * src/tables.h (base_number): Renamed from base_t.
14738 * src/vcg.h (enum color): Renamed from enum color_e.
14739 (enum textmode): Renamed from enum textmode_e.
14740 (enum shape): Renamed from enum shape_e.
14741 (struct colorentry): Renamed from struct colorentry_s.
14742 (struct classname): Renamed from struct classname_s.
14743 (struct infoname): Renamed from struct infoname_s.
14744 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
14745 (enum decision): Renamed from enum decision_e.
14746 (enum orientation): Renamed from enum orientation_e.
14747 (enum alignment): Renamed from enum alignment_e.
14748 (enum arrow_mode): Renamed from enum arrow_mode_e.
14749 (enum crossing_type): Renamed from enum crossing_type_e.
14750 (enum view): Renamed from enum view_e.
14751 (struct node): Renamed from struct node_s.
14752 (node): Renamed from node_t.
14753 (enum linestyle): Renamed from enum linestyle_e.
14754 (enum arrowstyle): Renamed from enum arrowstyle_e.
14755 (struct edge): Renamed from struct edge.
14756 (edge): Renamed from edge_t.
14757 (struct graph): Renamed from struct graph_s.
14758 (graph): Renamed from graph_t.
14759 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
14760 Rename value_t -> value.
14761 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
14762 value_t_as_yystype -> value_as_yystype.
14763
14764 Don't include <errno.h> in the mainstream code, since it
14765 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
14766 * lib/get-errno.c, lib/get-errno.h: New files.
14767 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
14768 get-errno.c.
14769 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
14770 * src/output.c (output_skeleton): Likewise.
14771 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
14772 instead of errno.
14773 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
14774 Likewise.
14775 (handle_action_dollar, handle_action_at): Likewise.
14776 * src/system.h: Do not include <errno.h>.
14777 (TAB_EXT): Renamed from EXT_TAB.
14778 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
14779
14780 Avoid str[a-z]*, since <string.h> reserves that name space.
14781 Change all instances of "struniq" in names to "uniqstr", and
14782 likewise for "STRUNIQ" and "UNIQSTR".
14783 * src/uniqstr.c: Renamed from src/struniq.c.
14784 * src/uniqstr.h: Renamed from src/struniq.h.
14785 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
14786 * src/files.c (strsuffix): Remove; unused.
14787 (concat2): Renamed from stringappend. Now static.
14788 * src/files.h (strsuffix, stringappend): Remove; unused.
14789 * src/parse-gram.y (<chars>): Renamed from <string>.
14790 (<uniqstr>): Renamed from <struniq>.
14791 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
14792 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
14793 (struct graph_s.expand): Renamed from struct graph_s.stretch.
14794 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
14795 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
14796 (N_EXPAND): Renamed from N_STRETCH.
14797
14798 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
14799 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
14800 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
14801 Remove; unused.
14802 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
14803 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
14804 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
14805 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
14806 (BASE_MAXIMUM): Renamed from BASE_MAX.
14807 (BASE_MINIMUM): Renamed from BASE_MIN.
14808 (ACTION_MAX): Remove; unused.
14809 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
14810 Unnecessary casts removed from above defines.
14811
14812
14813 Fix misspelling in names.
14814 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
14815 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
14816 G_NODE_ALIGNEMENT.
14817
14818
14819 * lib/timevar.c (timevar_report): Renamed from time_report,
14820 for consistency with other names.
14821 * lib/timevar.h (timevar_report): New decl.
14822 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
14823
14824
14825 Sort include-file uses.
14826
14827 Reorder all include files under src to be in the order "system.h".
14828 then the ../lib include files in angle brackets (alphabetized),
14829 then the . include files in double-quotes (alphabetized). Fix
14830 dependency breakages encountered in this process, as follows:
14831 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
14832 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
14833 * src/state.h: Include "symtab.h".
14834
148352002-12-08 Paul Eggert <eggert@twinsun.com>
14836
14837 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
14838 since this causes problems when __file__ contains character
14839 sequences like "@" that are treated specially by src/scan-skel.l.
14840 Instead, just use the file's basename. This fixes the bug
14841 reported by Martin Mokrejs in
14842 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
14843
148442002-12-06 Paul Eggert <eggert@twinsun.com>
14845
14846 Add support for rules that do not have trailing semicolons, as
14847 POSIX requires. Improve the quality of locations in Bison
14848 diagnostics.
14849
14850 * src/location.c: Include <quotearg.h>.
14851 (empty_location): Now const.
14852 (location_print): New function. Follow the recommendation of the
14853 GNU Coding Standards for locations that span file boundaries.
14854 * src/location.h: Do not include <quotearg.h>; no longer needed.
14855 (boundary): New type.
14856 (location_t): Use it. This allows locations to span file boundaries.
14857 All member uses changed: file -> start.file or end.file (as needed),
14858 first_line -> start.line, first_column -> start.column,
14859 last_line -> end.line, last_column -> end.column.
14860 (equal_boundaries): New function.
14861 (LOCATION_RESET, LOCATION_STEP): Remove.
14862 (LOCATION_PRINT): Remove. All callers changed to use location_print.
14863 (empty_location): Now const.
14864 (location_print): New decl.
14865 * src/parse-gram.y (lloc_default): New function, which handles
14866 empty locations more accurately.
14867 (YYLLOC_DEFAULT): Use it.
14868 (%token COLON): Remove.
14869 (%token ID_COLON): New token.
14870 (rules): Use it.
14871 (declarations, rules): Remove trailing semicolon.
14872 (declaration, rules_or_grammar_declaration):
14873 Allow empty (";") declaration.
14874 (symbol_def): Remove empty actions; no longer needed.
14875 (rules_or_grammar_declaration): Remove trailing semicolon.
14876 (semi_colon.opt): Remove.
14877 * src/reader.h: Include location.h.
14878 (scanner_cursor): New decl.
14879 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
14880 rolling our own.
14881 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
14882 of *loc.
14883 (STEP): Remove. No longer needed, now that adjust_location does
14884 the work. All uses removed.
14885 (scanner_cursor): New var.
14886 (adjust_location): Renamed from extend_location. It now sets
14887 *loc and adjusts the scanner cursor. All uses changed.
14888 Don't bother testing for CR.
14889 (handle_syncline): Remove location arg; now updates scanner cursor.
14890 All callers changed.
14891 (unexpected_end_of_file): Now accepts start boundary of token or
14892 comment, not location. All callers changed. Update scanner cursor,
14893 not the location.
14894 (SC_AFTER_IDENTIFIER): New state.
14895 (context_state): Renamed from c_context. All uses changed.
14896 (id_loc, code_start, token_start): New local vars.
14897 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
14898 processing of Yacc white space and equivalents here.
14899 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
14900 instead of returning ID immediately, since we need to search for
14901 a subsequent colon.
14902 (<INITIAL>"'", "\""): Save token_start.
14903 (<INITIAL>"%{", "{", "%%"): Save code_start.
14904 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
14905 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
14906 BEGIN context_state at end, not INITIAL.
14907 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
14908 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
14909 Return correct token start.
14910 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
14911 the start of a character, string or multiline comment is found.
14912 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
14913 Reduction): Adjust reported locations to match the more-precise
14914 results now expected.
14915 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
14916 * tests/reduce.at (Useless Rules, Reduced Automaton,
14917 Underivable Rules): Likewise.
14918 * tests/regression.at (Invalid inputs): No longer `expecting ";"
14919 or "|"' now that so many other tokens are allowed by the new grammar.
14920
14921 * src/complain.h (current_file): Remove duplicate decl;
14922 current_file is now owned by files.h.
14923 * src/complain.c, src/scan-gram.l: Include files.h.
14924
149252002-12-06 Paul Eggert <eggert@twinsun.com>
14926
14927 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
14928 promotes to int; it might be unsigned int.
14929 * data/yacc.c (yy_reduce_print): Likewise.
14930
14931 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
14932 be #defined in the prologue, not in the Bison declarations.
14933 This fixes Debian Bug 102878, reported by Shaul Karl.
14934
149352002-12-02 Paul Eggert <eggert@twinsun.com>
14936
14937 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
14938 * lib/strtoul.c: New file, from gnulib.
14939 This fixes a porting bug reported by Peter Klein in
14940 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
14941
149422002-11-30 Paul Eggert <eggert@twinsun.com>
14943
14944 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
14945 and put only a forward declaration in the prologue. This is for
14946 consistency with the other scanner helper functions.
14947
14948 Type clashes now generate warnings, not errors, since it
14949 appears that POSIX may allow some grammars with type clashes.
14950 * src/reader.c (grammar_current_rule_check): Warn about
14951 type clashes instead of complaining.
14952 * tests/input.at (Type Clashes): Expect warnings, not complaints.
14953
14954 Add Yacc library, since POSIX requires it.
14955 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
14956 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
14957 * lib/main.c, lib/yyerror.c: New files.
14958
14959 gram_error can be static; it need not be extern.
14960 * src/reader.h (gram_error): Remove decl.
14961 * src/parse-gram.y (gram_error): Now static. Add static decl.
14962 (print_token_value): Omit parameter names from forward decl,
14963 for consistency.
14964
149652002-11-29 Paul Eggert <eggert@twinsun.com>
14966
14967 * doc/bison.texinfo: Emphasize that yylex and yyerror must
14968 be declared before being used. E.g., one should typically
14969 declare them in the prologue. Use GNU coding style in examples.
14970 Put "const" consistently after the type it modifies. Mention
14971 that C99 supports "inline". Mention that yyerror traditionally
14972 returns "int".
14973
14974 %parse-param and %lex-param now take just one argument, the
14975 declaration; the argument name is deduced from the declaration.
14976
14977 * doc/bison.texinfo (Parser Function, Pure Calling, Error
14978 Reporting, Table of Symbols): Document this.
14979 * src/parse-gram.y (add_param): New function.
14980 (COMMA): Remove.
14981 (declaration): Implement new rule for %parse-param and %lex-param.
14982 * src/scan-gram.l: "," now elicits a warning, rather than being
14983 a token; this is more compatible with byacc.
14984 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
14985
149862002-11-27 Paul Eggert <eggert@twinsun.com>
14987
14988 Rename identifiers to avoid real and potential collisions.
14989
14990 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
14991 to avoid collision with lex macro described by Bruce Lilly in
14992 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
14993 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
14994 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
14995 * src/parse-gram.y (print_token_value): Renamed from yyprint.
14996 All uses changed.
14997 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
14998 The name "yycontrol" violates the name space rules, and this stuff
14999 wasn't being used anyway.
15000 (input): Remove action; this stuff wasn't being used.
15001 (gram_error): Rename local variable yylloc -> loc.
15002 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
15003 (YY_DECL): Don't use "yy" at start of local variables.
15004 All uses changed, e.g., yylloc -> loc.
15005 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
15006 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
15007 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
15008 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
15009
15010 * src/parse-gram.y (gram_error): loc is now const *.
15011 * src/reader.h (gram_error): Likewise.
15012
150132002-11-24 Paul Eggert <eggert@twinsun.com>
15014
15015 Version 1.75c.
15016
15017 * tests/actions.at (Actions after errors): Use an output format
15018 more similar to that of the Printers and Destructors test.
15019 Test the position of the ';' token too.
15020 (Printers and Destructors): Likewise.
15021 (Printers and Destructors: %glr-parser): Remove for now, to avoid
15022 unnecessarily alarming people when the test fails.
15023
15024 * data/yacc.c (yyerrlab1): Move this label down, so that the
15025 parser does not discard the lookahead token if the user code
15026 invokes YYERROR. This change is required for POSIX conformance.
15027
15028 * lib/error.c: Sync with gnulib.
15029
150302002-11-22 Paul Eggert <eggert@twinsun.com>
15031
15032 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
15033 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
15034 * lib/xmalloc.c: Likewise.
15035
150362002-11-20 Paul Eggert <eggert@twinsun.com>
15037
15038 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
15039
150402002-11-20 Paul Eggert <eggert@twinsun.com>
15041
15042 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
15043 should use `if (! x) abort ();' rather than `assert (x);', and
15044 anyway it's one less thing to worry about configuring.
15045
15046 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
15047 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
15048 and replace all instances of assert with abort.
15049 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
15050 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
15051
15052 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
15053 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
15054 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
15055 hash_find_entry, hash_rehash, hash_insert): Likewise.
15056 * src/conflicts.c (resolve_sr_conflict): Likewise.
15057 * src/lalr.c (set_goto_map, map_goto): Likewise.
15058 * src/nullable.c (nullable_compute): Likewise.
15059 * src/output.c (prepare_rules, token_definitions_output): Likewise.
15060 * src/reader.c (packgram, reader): Likewise.
15061 * src/state.c (state_new, state_free, state_transitions_set,
15062 state_reduction_find): Likewise.
15063 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
15064 symbol_pack): Likewise.
15065 * src/tables.c (conflict_row, pack_vector): Likewise.
15066 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
15067 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
15068 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
15069 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
15070
15071 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
15072 (ARGMATCH_CONSTRAINT): New macro.
15073 (ARGMATCH_ASSERT): Use it.
15074
15075 * src/system.h (verify): New macro.
15076 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
15077 rather than assert.
15078 * src/tables.c (tables_generate): Likewise.
15079
15080 * src/struniq.c (struniq_assert): Now returns void, and aborts
15081 if the assertion is false.
15082 (struniq_assert_p): Remove.
15083 * src/struniq.h: Likewise.
15084
150852002-11-18 Paul Eggert <eggert@twinsun.com>
15086
15087 * data/glr.c (yygetLRActions): Replace `yyindex' with
15088 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
15089 This fixes the regression with Sun ONE Studio 7 cc that I reported in
15090 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
15091
150922002-11-18 Akim Demaille <akim@epita.fr>
15093
15094 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
15095 space.
15096 From Tim Van Holder.
15097
150982002-11-17 Paul Eggert <eggert@twinsun.com>
15099
15100 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
15101 to "SyntaxError" for consistency with my 2002-11-15 change.
15102
15103 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
15104 not define to {}, since this breaks the common use of `YYDPRINTF
15105 ((...));' if a single statement is desired (e.g. before `else').
15106 Work around GCC warnings by surrounding corresponding calls with
15107 {} if needed.
15108 (yyhasResolvedValue): Remove unused function.
15109 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
15110 loop body.
15111 (yyreportSyntaxError): Renamed from yyreportParseError.
15112 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
15113 All uses changed.
15114 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
15115 extern when possible. Remove unused initializations.
15116
151172002-11-16 Akim Demaille <akim@epita.fr>
15118
15119 Augment the similarity between GLR and LALR traces.
15120
15121 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
15122 (YY_REDUCE_PRINT): New.
15123 (yyparse): Use them.
15124 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
15125 YYDPRINT here.
15126 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
15127 state reached after the reduction/recovery, since...
15128 (yyparse, yyprocessOneStack): Report the state we are entering in.
15129
151302002-11-16 Akim Demaille <akim@epita.fr>
15131
15132 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
15133 Add support for --trace=skeleton.
15134 * src/scan-skel.l: %option debug.
15135 Scan strings of non-@ or \n instead of character by character.
15136 (scan_skel): Handle trace_skeleton.
15137 (QPUTS): New.
15138 (@output_parser_name@, @output_header_name@): ``Restore'' their
15139 support (used to be M4 macros).
15140 * data/yacc.c: Quote larger chunks, a la glr.c.
15141 * data/lalr1.cc: Likewise.
15142 The header guards are no longer available, so use some other
15143 string than `YYLSP_NEEDED'.
15144
151452002-11-16 Akim Demaille <akim@epita.fr>
15146
15147 Make the ``Printers and Destructors'' test more verbose, taking
15148 `yacc.c''s behavior as (possibly wrong) reference.
15149
15150 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
15151 instead of fprint on stdout.
15152 Set and report the last_line of the symbols.
15153 Consistently display values and locations.
15154
151552002-11-16 Paul Eggert <eggert@twinsun.com>
15156
15157 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
15158
151592002-11-15 Paul Eggert <eggert@twinsun.com>
15160
15161 * tests/actions.at (Actions after errors): New test case.
15162
15163 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
15164 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
15165 tests/action.at, tests/calc.at, tests/conflicts.at,
15166 tests/cxx-type.at, tests/regression.at:
15167 "parse error" -> "syntax error" for POSIX compatibility.
15168 "parsing stack overflow..." -> "parser stack overflow" so
15169 that code matches Bison documentation.
15170
151712002-11-15 Akim Demaille <akim@epita.fr>
15172
15173 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
15174 take two BRACED_CODE, not two string_content.
15175 Free the scanner's obstack when we are done.
15176 (code_content): New.
15177 * tests/calc.at: Adjust.
15178 * doc/bison.texinfo: Adjust.
15179 Also, make sure to include the `,' for these declarations.
15180
151812002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
15182
15183 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
15184 definition; avoids potential autoreconf problems.
15185
151862002-11-15 Akim Demaille <akim@epita.fr>
15187
15188 Always check the value returned by yyparse.
15189
15190 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
15191 returned by yyparse.
15192 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
15193 Adjust calls.
15194 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
15195 returned by yyparse.
15196
151972002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15198
15199 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
15200 on input.at test.
15201
152022002-11-14 Paul Eggert <eggert@twinsun.com>
15203
15204 * src/output.c (output_skeleton): Call xfopen instead of
15205 duplicating xfopen's body.
15206
15207 Fix bugs reported by Nelson H. F. Beebe in
15208 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
15209
15210 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
15211 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
15212 Group compiler. Instead, use "$CC -E bar.c". Include the .h
15213 file twice in the grammar, as an extra check.
15214
15215 * tests/input.at (Torturing the Scanner): Surround the
15216 backslash-newline tests with "#if 0", to make it less likely that
15217 we'll run into compiler bugs. Bring back solitary \ inside
15218 comment, but add a closing comment to work around HP C bug. Don't
15219 test backslash-newline in C character constant.
15220
152212002-11-14 Akim Demaille <akim@epita.fr>
15222
15223 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
15224 status of the compiler.
15225 Calling `exit 1' is no longer needed.
15226 Reported by Nelson H. F. Beebe.
15227
152282002-11-14 Akim Demaille <akim@epita.fr>
15229
15230 * tests/atlocal.in (CPPFLAGS): We have config.h.
15231 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
15232 New.
15233 * tests/actions.at, tests/calc.at, tests/conflicts.at,
15234 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
15235 * tests/regression.at, tests/torture.at: Use them for all the
15236 grammars that are to be compiled.
15237 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
15238 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
15239 * doc/bison.texinfo (GLR Parsers): Document `inline'.
15240
152412002-11-14 Akim Demaille <akim@epita.fr>
15242
15243 * doc/bison.texinfo: Various formatting changes (alignments in
15244 samples, additional @group/@end group, GCS in samples.
15245 Use @deffn instead of simple @table to define the directives,
15246 macros, variables etc.
15247
152482002-11-13 Paul Eggert <eggert@twinsun.com>
15249
15250 Fix some bugs reported by Albert Chin-A-Young in
15251 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
15252
15253 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
15254 -o c"; the HP C compiler chatters during compilation.
15255 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
15256 * tests/headers.at (export YYLTYPE): Likewise.
15257
15258 * tests/input.at (Torturing the Scanner): Remove lines containing
15259 solitary backslashes, as they tickle a bug in the HP C compiler.
15260
15261 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
15262 comments, since they're not portable. Use GNU coding style.
15263
152642002-11-13 Akim Demaille <akim@epita.fr>
15265
15266 * data/yacc.c: Leave bigger chunks of quoted text.
15267 (YYDSYMPRINTF): New.
15268 Use it to report symbol activities.
15269 * data/glr.c (YYDSYMPRINTF): New.
15270 Use it.
15271
152722002-11-12 Paul Eggert <eggert@twinsun.com>
15273
15274 Version 1.75b.
15275
15276 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
15277 (yyglrReduce): Return yyok, not 0.
15278 This should avoid the enumerated-type warnings reported
15279 by Nelson H. F. Beebe in
15280 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
15281
15282 * lib/bbitset.h (BITSET_INLINE): Remove.
15283 * lib/bitset.h [! BITSET_INLINE]: Remove.
15284 (bitset_set, bitset_reset, bitset_test): Rename local vars
15285 to avoid shadowing warnings by GCC.
15286
15287 * data/glr.c (inline): Remove #define. It's the user's
15288 responsibility to #define it away, just like 'const'.
15289 This fixes one of the bugs reported by Nelson H. F. Beebe in
15290 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
15291
15292 * Makefile.maint (po-check): Scan .l and .y files instead of the
15293 .c and the .h files that they generate. This fixes the bug
15294 reported by Tim Van Holder in:
15295 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
15296 Look for N_ as well as for _. Try to avoid matching #define for
15297 N_ and _.
15298 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
15299 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
15300 * src/scan-gram.l: Revamp regular expressions so that " and '
15301 do not confuse xgettext.
15302
15303 * src/struniq.h (struniq_new): Do not declare the return type
15304 to be 'const'; this violates the C standard.
15305 * src/struniq.c (struniq_new): Likewise.
15306
153072002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
15308
15309 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
15310 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
15311 linker.
15312
153132002-11-12 Akim Demaille <akim@epita.fr>
15314
15315 * Makefile.maint: Sync with Autoconf:
15316 (local_updates): New.
15317
153182002-11-12 Akim Demaille <akim@epita.fr>
15319
15320 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
15321
153222002-11-12 Akim Demaille <akim@epita.fr>
15323
15324 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
15325 locations.
15326
153272002-11-12 Akim Demaille <akim@epita.fr>
15328
15329 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
15330 not yyvalue.
15331
153322002-11-12 Akim Demaille <akim@epita.fr>
15333
15334 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
15335 Use it to test the GLR parser.
15336
153372002-11-12 Akim Demaille <akim@epita.fr>
15338
15339 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
15340 defines it.
15341 * data/glr.c (yystos): New.
15342 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
15343 (YYDSYMPRINT): New.
15344 (yyval): Don't define it, it is handled via M4.
15345 (yyrecoverParseError): Free verbosely the discarded symbols.
15346 * data/yacc.c (yysymprint): Remove, rather...
15347 (b4_yysymprint_generate): invoke.
15348 * data/c.m4 (b4_yysymprint_generate): New.
15349 Accept pointers as arguments, as opposed to the version from
15350 yacc.c.
15351 (b4_yydestruct_generate): Likewise.
15352 * tests/cations.at (Printers and Destructors): Use Bison directives
15353 instead of CPP macros.
15354 Don't rely on internal details.
15355
153562002-11-12 Akim Demaille <akim@epita.fr>
15357
15358 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
15359 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
15360 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
15361 it against YYEMPTY and so forth), work on yytoken (i.e., set
15362 it to YYEMPTY etc.).
15363 (yydestruct): Replace with a b4_yydestruct_generate invocation.
15364 (b4_symbol_actions): Remove.
15365 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
15366 for 0, end-of-input.
15367
153682002-11-12 Akim Demaille <akim@epita.fr>
15369
15370 * doc/bison.texinfo (Destructor Decl): New.
15371
153722002-11-12 Akim Demaille <akim@epita.fr>
15373
15374 * src/tables.c (tables_generate): Use free for pointers that
15375 cannot be NULL, not XFREE.
15376 (pack_vector): Use assert, not fatal, for bound violations.
15377 * src/state.c (state_new): Likewise.
15378 * src/reader.c (reader): Likewise.
15379 * src/lalr.c (set_goto_map): Likewise.
15380 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
15381 the file name.
15382
153832002-11-12 Akim Demaille <akim@epita.fr>
15384
15385 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
15386 Restore.
15387 * src/scan-gram.l (last_string): Is global to the file, not to
15388 yylex.
15389 * src/parse-gram.y (input): Don't append the epilogue here,
15390 (epilogue.opt): do it here, and free the scanner's obstack.
15391 * src/reader.c (epilogue_set): Rename as...
15392 (epilogue_augment): this.
15393 * data/c.m4 (b4_epilogue): Defaults to empty.
15394
153952002-11-12 Akim Demaille <akim@epita.fr>
15396
15397 * src/getargs.c (long_options): Remove duplicates.
15398 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
15399 Remove.
15400 * doc/bison.rnh: Remove.
15401 * doc/bison.texinfo (VMS Invocation): Remove.
15402
154032002-11-12 Akim Demaille <akim@epita.fr>
15404
15405 * src/struniq.h, src/struniq.c (struniq_t): Is const.
15406 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
15407
15408 Use struniq for symbols.
15409
15410 * src/symtab.h (symbol_t): The tag member is a struniq.
15411 (symbol_type_set): Adjust.
15412 * src/symtab.c (symbol_new): Takes a struniq.
15413 (symbol_free): Don't free the tag member.
15414 (hash_compare_symbol_t, hash_symbol_t): Rename as...
15415 (hash_compare_symbol, hash_symbol): these.
15416 Use the fact that tags as struniqs.
15417 (symbol_get): Use struniq_new.
15418 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
15419 Returns a strniq.
15420 * src/reader.h (merger_list, grammar_currentmerge_set): The name
15421 and type members are struniqs.
15422 * src/reader.c (get_merge_function)
15423 (grammar_current_rule_merge_set): Adjust.
15424 (TYPE, current_type): Are struniq.
15425
15426 Use struniq for file names.
15427
15428 * src/files.h, src/files.c (infile): Split into...
15429 (grammar_file, current_file): these.
15430 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
15431 * src/reduce.c (reduce_print): Likewise.
15432 * src/getargs.c (getargs): Likewise.
15433 * src/complain.h, src/complain.c: Likewise.
15434 * src/main.c (main): Call struniqs_new early enough to use it for
15435 file names.
15436 Don't free the input file name.
15437
154382002-11-12 Akim Demaille <akim@epita.fr>
15439
15440 * src/symtab.c (symbol_free): Remove dead deactivated code:
15441 type_name are properly removed.
15442 Don't use XFREE to free items that cannot be NULL.
15443 * src/struniq.h, src/struniq.c: New.
15444 * src/main.c (main): Initialize/free struniqs.
15445 * src/parse-gram.y (%union): Add astruniq member.
15446 (yyprint): Adjust.
15447 * src/scan-gram.l (<{tag}>): Return a struniq.
15448 Free the obstack bit that used to store it.
15449 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
15450
154512002-11-11 Paul Eggert <eggert@twinsun.com>
15452
15453 Revamp to fix many (but not all) of the C- and M4-related quoting
15454 problems. Among other things, this fixes the Bison bug reported
15455 by Jan Hubicka when processing the Bash grammar; see:
15456 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
15457
15458 Use new @ escapes consistently. Represent brackets with @{ and @}
15459 rather than @<:@ and @:>@, since this works a bit better with dumb
15460 editors like vi. Represent @ with @@, since @ is now consistently
15461 an escape. Use @oline@ and @ofile@ rather than __oline__ and
15462 __ofile__, to avoid unexpected expansions. Similarly, use @output
15463 rather than #output.
15464
15465 * data/c.m4 (b4_copyright): Omit file name from comment, since
15466 the file name could contain "*/".
15467 (b4_synclines_flag): Don't quote the 2nd argument; it should already
15468 be quoted. All uses changed.
15469
15470 * data/glr.c: Use new @ escapes consistently.
15471 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
15472 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
15473 Remove, since they couldn't handle arbitrary characters in file
15474 names.
15475 * data/lalr1.cc: Likewise.
15476 * data/yacc.c: Likewise.
15477
15478 * src/files.c (output_infix): Remove; all uses removed.
15479 * src/files.h: Likewise.
15480
15481 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
15482 mishandled funny characters in file names, and anyway it isn't
15483 needed any more.
15484 * data/yacc.c: Likewise.
15485 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
15486
15487 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
15488 * data/yacc.c: Likewise.
15489
15490 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
15491 strings now.
15492 (muscle_init): Quote filename as a C string.
15493 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
15494 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
15495 * src/output.c (escaped_file_name_output): New function.
15496 (prepare_symbols): Quote tokens for M4.
15497 (prepare): Don't insert output_infix, output_prefix,
15498 output_parser_name, output_header_name; this is now down by scan-skel.
15499 Insert skeleton as a C string.
15500
15501 * src/output.c (user_actions_output, symbol_destructors_output,
15502 symbol_printers_output): Quote filenames for C and M4.
15503 * src/reader.c (prologue_augment, epilogue_set): Likewise.
15504
15505 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
15506 escapes other than \\ and \'; this simplifies the code.
15507 (<SC_STRING>): Likewise, for \\ and \".
15508 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
15509 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
15510 Use new escapes @{ and @} for [ and ].
15511
15512 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
15513 them with auto vars.
15514 Switch to new escape scheme, where @ is the escape character uniformly.
15515 Abort if a stray escape character is found. Avoid unbounded input
15516 buffer when parsing non-escaped text.
15517
15518 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
15519 __oline__, #output, $@, and @{ do not have unintended meanings.
15520
155212002-11-09 Paul Eggert <eggert@twinsun.com>
15522
15523 Fix the test failure due to GCC warnings described in
15524 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
15525 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
15526 evaluate to 0 if it's impossible for NINF to be in the respective
15527 table.
15528 (yygetLRActions, yyrecoverParseError): Use them.
15529
15530 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
15531 counted in the token inserted at end of file. Now takes
15532 location_t *, not location_t, so that the location can be
15533 adjusted. All uses changed.
15534
15535 * tests/regression.at (Invalid inputs): Adjust wording in
15536 diagnostic to match the new behavior.
15537
15538 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
15539 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
15540 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
15541 abort ();'. This reduces the runtime of the "Many lookaheads"
15542 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
15543 GCC 3.2.
15544
155452002-11-07 Paul Eggert <eggert@twinsun.com>
15546
15547 * src/parse-gram.y (CHARACTER): Remove unused token.
15548 All uses removed.
15549
15550 * src/scan-gram.l: Remove stack option. We no longer use the
15551 stack, since the stack was never deeper than 1; instead, use the
15552 new auto var c_context to record the stacked value.
15553
15554 Remove nounput option. At an unexpected end of file, we now unput
15555 the minimal input necessary to end cleanly; this simplifies the
15556 code.
15557
15558 Avoid unbounded token sizes where this is easy.
15559
15560 (unexpected_end_of_file): New function.
15561 Use it to systematize the error message on unexpected EOF.
15562 (last-string): Now auto, not static.
15563 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
15564 (scanner_last_string_free): Remove; not used.
15565 (percent_percent_count): Move decl to just before use.
15566 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
15567 not the (never otherwised-used) CHARACTER.
15568
155692002-11-07 Akim Demaille <akim@epita.fr>
15570
15571 Let yyerror always receive the msg as last argument, so that
15572 yyerror can be variadic.
15573
15574 * data/yacc.c (b4_yyerror_args): New.
15575 Use it when calling yyerror.
15576 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
15577 Use it when calling yyerror.
15578 * doc/bison.texinfo (Error Reporting): Adjust.
15579 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
15580 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
15581
155822002-11-06 Akim Demaille <akim@epita.fr>
15583
15584 #line should have quoted strings.
15585 Ideally, this should be done by m4_quotearg.
15586
15587 * src/scan-skel.l: Include quotearg.h.
15588 Quote __ofile__.
15589 * src/output.c (symbol_printers_output)
15590 (symbol_destructors_output): Quote the file name.
15591
155922002-11-06 Akim Demaille <akim@epita.fr>
15593
15594 * tests/regression.at (Invalid inputs): Adjust to the recent
15595 messages.
15596
155972002-11-06 Akim Demaille <akim@epita.fr>
15598
15599 Restore --no-lines.
15600 Reported by Jim Kent.
15601
15602 * data/c.m4 (b4_syncline): New.
15603 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
15604 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
15605 * src/output.c (user_actions_output): Likewise.
15606 (prepare): Define 'b4_synclines_flag'.
15607 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
15608
156092002-11-06 Akim Demaille <akim@epita.fr>
15610
15611 * src/main.c (main): Free `infile'.
15612 * src/scan-gram.l (handle_syncline): New.
15613 Recognize `#line'.
15614 * src/output.c (user_actions_output, symbol_destructors_output)
15615 (symbol_printers_output): Use the location's file name, not
15616 infile.
15617 * src/reader.c (prologue_augment, epilogue_set): Likewise.
15618
156192002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15620
15621 * src/tables.c (matching_state): Don't allow states to match if
15622 either has GLR conflict entries.
15623
156242002-11-05 Paul Eggert <eggert@twinsun.com>
15625
15626 * src/scan-gram.l: Use more accurate diagnostics, e.g.
15627 "integer out of range" rather than "invalid value".
15628 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
15629 accordingly.
15630
15631 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
15632 Also, remove one static variable in the scanner.
15633
15634 * src/scan-gram.l (braces_level): Now auto, not static.
15635 Initialize to zero if the compiler is being picky.
15636 (INITIAL): Clear braces_level instead of incrementing it.
15637 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
15638 as POSIX 1003.1-2001 requires.
15639 * src/system.h (IF_LINT): New macro, taken from coreutils.
15640 * configure.ac: Define "lint" if --enable-gcc-warnings.
15641
156422002-11-05 Akim Demaille <akim@epita.fr>
15643
15644 * src/scan-gram.l: When it starts with `%', complain about the
15645 whole directive, not just that `invalid character: %'.
15646
156472002-11-04 Akim Demaille <akim@epita.fr>
15648
15649 * Makefile.maint: Update from Autoconf.
15650 (update, cvs-update, po-update, do-po-update): New.
15651
156522002-11-04 Akim Demaille <akim@epita.fr>
15653
15654 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
15655 and yyerror.
15656 Have yyerror `use' its arguments.
15657 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
15658 returns true when location & yacc & pure & parse-param.
15659 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
15660
156612002-11-04 Akim Demaille <akim@epita.fr>
15662
15663 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
15664 clashes.
15665 * src/scan-gram.l: Use [\'] instead of ['] to pacify
15666 font-lock-mode.
15667 Use complain_at.
15668 Use quote, not quote_n since LOCATION_PRINT no longer uses the
15669 slot 0.
15670
156712002-11-03 Paul Eggert <eggert@twinsun.com>
15672
15673 * src/reader.c (get_merge_function, grammar_current_rule_check):
15674 Use consistent diagnostics for reporting type name clashes.
15675 Quote the types with <>, for consistency with Yacc.
15676 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
15677
156782002-11-03 Akim Demaille <akim@epita.fr>
15679
15680 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
15681 New.
15682 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
15683 (b4_parse_param): Remove.
15684 Use b4_identification.
15685 Propagate b4_pure_args where needed to pass them to yyerror.
15686 * data/glr.m4 (b4_parse_param): Remove.
15687 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
15688 (b4_lpure_formals): New.
15689 Use b4_identification.
15690 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
15691 b4_user_formals and b4_user_args.
15692 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
15693 (yyreportAmbiguity): When using a pure parser, also need
15694 the location, and the parse-params.
15695 Adjust callers.
15696 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
15697 When using a pure parser, also need the parse-params.
15698 Adjust callers.
15699 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
15700 (%pure-parser + %parse-param) LALR and GLR parsers.
15701 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
15702 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
15703 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
15704 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
15705 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
15706 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
15707 * doc/bison.texinfo: Untabify the whole file.
15708 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
15709 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
15710 (Error Reporting): Adjust to these new directives.
15711 Document %error-verbose, deprecate YYERROR_VERBOSE.
15712
157132002-11-03 Akim Demaille <akim@epita.fr>
15714
15715 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
15716 AT_CHECK_CALC_GLR invocations to use % directives, instead of
15717 command line options.
15718 * tests/cxx-type.at: Formatting changes.
15719
157202002-11-03 Paul Eggert <eggert@twinsun.com>
15721
15722 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
15723 to count columns correctly, and to check for invalid inputs.
15724
15725 Use mbsnwidth to count columns correctly. Account for tabs, too.
15726 Include mbswidth.h.
15727 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
15728 (extend_location): New function.
15729 (YY_LINES): Remove.
15730
15731 Handle CRLF in C code rather than in Lex code.
15732 (YY_INPUT): New macro.
15733 (no_cr_read): New function.
15734
15735 Scan UCNs, even though we don't fully handle them yet.
15736 (convert_ucn_to_byte): New function.
15737
15738 Handle backslash-newline correctly in C code.
15739 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
15740 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
15741 all uses changed.
15742 (tag, splice): New EREs. Do not allow NUL or newline in tags.
15743 Use {splice} wherever C allows backslash-newline.
15744 YY_STEP after space, newline, vertical-tab.
15745 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
15746
15747 (letter, id): Don't assume ASCII; e.g., spell out a-z.
15748
15749 ({int}, handle_action_dollar, handle_action_at): Check for integer
15750 overflow.
15751
15752 (YY_STEP): Omit trailing semicolon, so that it's more like C.
15753
15754 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
15755 as well as \000. Check for UCHAR_MAX, not 255.
15756 Allow \x with an arbitrary positive number of digits, as in C.
15757 Check for overflow here.
15758 Allow \? and UCNs, for compatibility with C.
15759
15760 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
15761 with quote slot used by complain_at.
15762
15763 * tests/input.at: Add tests for backslash-newline, m4 quotes
15764 in symbols, long literals, and funny escapes in strings.
15765
15766 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
15767 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
15768 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
15769 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
15770 * m4/mbswidth.m4: New file, from GNU coreutils.
15771
15772 * doc/bison.texinfo (Grammar Outline): Document // comments.
15773 (Symbols): Document that trigraphs have no special meaning in Bison,
15774 nor is backslash-newline allowed.
15775 (Actions): Document that trigraphs have no special meaning.
15776
15777 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
15778 no longer used.
15779
157802002-11-02 Paul Eggert <eggert@twinsun.com>
15781
15782 * src/reader.c: Don't include quote.h; not needed.
15783 (get_merge_function): Reword warning to be consistent with
15784 type clash diagnostic in grammar_current_rule_check.
15785
15786 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
15787 bug in trigraph handling.
15788
15789 * src/output.c (prepare_symbols): When printing token names,
15790 escape "[" as "@<:@" and likewise for "]".
15791
15792 * src/system.h (errno): Remove declaration, as we are now
15793 assuming C89 or better, and C89 guarantees errno.
15794
157952002-10-30 Paul Eggert <eggert@twinsun.com>
15796
15797 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
15798 Check for close failures.
15799 * src/files.h (xfclose): Return void, not int, since it always
15800 returned zero.
15801 * src/files.c (xfclose): Likewise. Report I/O error if ferror
15802 indicates one.
15803 * src/output.c (output_skeleton): Use xfclose rather than fclose
15804 and ferror. xfclose now checks ferror.
15805
15806 * data/glr.c (YYLEFTMOST_STATE): Remove.
15807 (yyreportTree): Use a stack-based leftmost state. This avoids
15808 our continuing battles with bogus warnings about initializers.
15809
158102002-10-30 Akim Demaille <akim@epita.fr>
15811
15812 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
15813 #if.
15814
158152002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15816
15817 * tests/glr-regr1.at: New test for reported regressions.
15818 * tests/testsuite.at: Add glr-regr1.at test.
15819 * tests/Makefile.am: Add glr-regr1.at test.
15820
158212002-10-24 Paul Eggert <eggert@twinsun.com>
15822
15823 Version 1.75a.
15824
15825 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
15826 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
15827 we use malloc. Don't assume 'A' through 'Z' are contiguous.
15828 Don't assume strdup exists; POSIX says its an XSI extension.
15829 Check for buffer overflow on input.
15830
158312002-10-24 Akim Demaille <akim@epita.fr>
15832
15833 * src/output.c (output_skeleton): Don't disable M4sugar comments
15834 too soon: it results in comments being expanded.
15835 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
15836 first output.
15837
158382002-10-24 Akim Demaille <akim@epita.fr>
15839
15840 * data/yacc.c (m4_int_type): New.
15841 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
15842 char' as only yacc.c wants K&R portability.
15843 * data/glr.c (yysigned_char): Remove.
15844 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
15845 Reported by Quoc Peyrot.
15846
158472002-10-23 Paul Eggert <eggert@twinsun.com>
15848
15849 * src/main.c (main): With --trace=time, report times even if a
15850 non-fatal error occurs. Formerly, the times were reported in some
15851 such cases but not in others.
15852 * src/reader.c (reader): Just return if a complaint has been issued,
15853 instead of exiting, so that 'main' can report times.
15854
158552002-10-22 Akim Demaille <akim@epita.fr>
15856
15857 * src/system.h: Include sys/types.
15858 Reported by Bert Deknuydt.
15859
158602002-10-23 Paul Eggert <eggert@twinsun.com>
15861
15862 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
15863 Suggested by Art Haas.
15864
158652002-10-22 Paul Eggert <eggert@twinsun.com>
15866
15867 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
15868 decl; not needed any more.
15869 * src/main.c (main): Use return to exit, undoing yesterday's change.
15870 The last OS that we could find where this wouldn't work is
15871 SunOS 3.5, and that's too old to worry about now.
15872
15873 * data/glr.c (struct yyltype): Define members even when not
15874 doing locations. This is more consistent with yacc.c, and it
15875 works around the following bug reports:
15876 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
15877 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
15878
15879 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
15880 @acronym consistently. Standardize on "Yacc" instead of "YACC",
15881 "Algol" instead of "ALGOL". Give a bit more history about BNF.
15882
158832002-10-22 Akim Demaille <akim@epita.fr>
15884
15885 * data/README: New.
15886
158872002-10-21 Paul Eggert <eggert@twinsun.com>
15888
15889 Be consistent about 'bool'; the old code used an enum in one
15890 module and an int in another, and this violates the C standard.
15891 * m4/stdbool.m4: New file, from coreutils 4.5.3.
15892 * configure.ac (AC_HEADER_STDBOOL): Add.
15893 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
15894 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
15895 * src/symtab.c (hash_compare_symbol_t): Likewise.
15896 * src/system.h (bool, false, true): Use a definition consistent
15897 with ../lib/hash.c. All uses changed.
15898
15899 * src/complain.c (warning_issued): Renamed from warn_message_count,
15900 so that we needn't worry about integer overflow (!).
15901 Now of type bool. All uses changed.
15902 (complaint_issued): Renamed from complain_message_count; likewise.
15903
15904 * src/main.c (main): Use exit to exit with failure.
15905
15906 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
15907 rather than 1 and 0.
15908 * src/main.c (main): Likewise.
15909 * src/getargs.c (getargs): Likewise.
15910 * src/reader.c (reader): Likewise.
15911
15912 * src/getarg.c (getargs): Remove duplicate code for
15913 "Try `bison --help'".
15914
15915 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
15916 What was that "2" for?
15917
15918 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
15919 * src/getargs.c (usage): Likewise.
15920
15921 * src/getargs.c (getargs): When there are too few operands, report
15922 the last one. When there are too many, report the first extra
15923 one. This is how diffutils does it.
15924
159252002-10-20 Paul Eggert <eggert@twinsun.com>
15926
15927 Remove K&R vestiges.
15928 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
15929 * src/complain.c (VA_START): Remove. Assume prototypes.
15930 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
15931 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
15932 fatal): Assume prototypes.
15933 * src/complain.h: Assume prototypes.
15934 * src/system.h (PARAMS): Remove.
15935 Include <limits.h> unconditionally, since it's guaranteeed even
15936 for a freestanding C89 compiler.
15937 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
15938 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
15939
159402002-10-20 Akim Demaille <akim@epita.fr>
15941
15942 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
15943 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
15944 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
15945 (yyresolveStates, yyresolveAction, yyresolveStack)
15946 (yyprocessOneStack): Use them.
15947 (yy_reduce_print): New.
15948 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
15949
159502002-10-20 Akim Demaille <akim@epita.fr>
15951
15952 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
15953 arguments and output `void'.
15954 (b4_c_function): Rename as...
15955 (b4_c_function_def): this.
15956 (b4_c_function_decl, b4_c_ansi_function_def)
15957 (b4_c_ansi_function_decl): New.
15958 Change the interpretation of the arguments: before `int, foo', now
15959 `int foo, foo'.
15960 * data/yacc.c (yyparse): Prototype and define thanks to these.
15961 Adjust b4_c_function_def uses.
15962 * data/glr.c (yyparse): Likewise, but ANSI only.
15963
159642002-10-20 Akim Demaille <akim@epita.fr>
15965
15966 * src/output.c (prepare): Move the definition of `tokens_number',
15967 `nterms_number', `undef_token_number', `user_token_number_max'
15968 to...
15969 (prepare_tokens): Here.
15970 (prepare_tokens): Rename as...
15971 (prepare_symbols): this.
15972 (prepare): Move the definition of `rules_number' to...
15973 (prepare_rules): here.
15974 (prepare): Move the definition of `last', `final_state_number',
15975 `states_number' to...
15976 (prepare_states): here.
15977 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
15978
159792002-10-20 Akim Demaille <akim@epita.fr>
15980
15981 * src/tables.h, src/tables.c, src/output.c: Comment changes.
15982
159832002-10-20 Akim Demaille <akim@epita.fr>
15984
15985 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
15986 * data/c.m4: here.
15987
159882002-10-20 Akim Demaille <akim@epita.fr>
15989
15990 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
15991 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
15992 `pair'.
15993 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
15994 `name' to...
15995 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
15996 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
15997 These.
15998
159992002-10-19 Paul Eggert <eggert@twinsun.com>
16000
16001 Do not create a temporary file, as that involves security and
16002 cleanup headaches. Instead, use a pair of pipes.
16003 Derived from a suggestion by Florian Krohm.
16004 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
16005 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
16006 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
16007 (BISON_PREREQ_SUBPIPE): Add.
16008 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
16009 Add subpipe.h, subpipe.c.
16010 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
16011 * po/POTFILES.in: Add lib/subpipe.c.
16012 * src/output.c: Include "subpipe.h".
16013 (m4_invoke): Remove decl.
16014 (scan_skel): New decl.
16015 (output_skeleton): Use pipe rather than temporary file for m4 input.
16016 Check that m4sugar.m4 is readable, to avoid deadlock.
16017 Check for pipe I/O error.
16018 * src/scan-skel.l (readpipe): Remove decl.
16019 (scan_skel): New function, to be used in place of m4_invoke.
16020 Read from stream rather than file.
16021
16022 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
16023 float, as this generates a warning on Solaris 8 + GCC 3.2 with
16024 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
16025 this generates a more-accurate value anyway.
16026
16027 * lib/timevar.c (timervar_accumulate): Rename locals to
16028 avoid confusion with similarly-named more-global.
16029 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
16030
16031 * src/output.c (prepare): Use xstrdup to convert char const *
16032 to char *, to avoid GCC warning.
16033
160342002-10-19 Akim Demaille <akim@epita.fr>
16035
16036 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
16037 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
16038 Use them to have `calc.y' ready for %pure-parser.
16039 * data/yacc.c (YYLEX): Pass a yylex return type to
16040 b4_c_function_call.
16041
160422002-10-19 Akim Demaille <akim@epita.fr>
16043
16044 Prototype support of %lex-param and %parse-param.
16045
16046 * src/parse-gram.y: Add the definition of the %lex-param and
16047 %parse-param tokens, plus their rules.
16048 Drop the `_' version of %glr-parser.
16049 Add the "," token.
16050 * src/scan-gram.l (INITIAL): Scan them.
16051 * src/muscle_tab.c: Comment changes.
16052 (muscle_insert, muscle_find): Rename `pair' as `probe'.
16053 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
16054 (muscle_entry_s): The `value' member is no longer const.
16055 Adjust all dependencies.
16056 * src/muscle_tab.c (muscle_init): Adjust: use
16057 MUSCLE_INSERT_STRING.
16058 Initialize the obstack earlier.
16059 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
16060 (muscle_pair_list_grow): New.
16061 * data/c.m4 (b4_c_function_call, b4_c_args): New.
16062 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
16063 * tests/calc.at: Use %locations, not --locations.
16064 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
16065
160662002-10-19 Akim Demaille <akim@epita.fr>
16067
16068 * src/getargs.c (usage): Take status as argument and exit
16069 accordingly.
16070 Report the traditional `Try ... --help' message when status != 0.
16071 (usage, version): Don't take a FILE * as arg, it is pointless.
16072 (getargs): When there is an incorrect number of arguments, make it
16073 an error, and report it GNUlically thanks to `usage ()'.
16074
160752002-10-18 Paul Eggert <eggert@twinsun.com>
16076
16077 * data/glr.c (yyreportParseError): Don't assume that sprintf
16078 yields the length of the printed string, as this is not true
16079 on SunOS 4.1.4. Reported by Peter Klein.
16080
16081 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
16082 * tests/conflicts.at (%nonassoc and eof): Likewise.
16083 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
16084
160852002-10-17 Akim Demaille <akim@epita.fr>
16086
16087 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
16088 * src/getargs.c (trace_types, trace_args): Adjust.
16089 * src/reader.c (grammar_current_rule_prec_set)
16090 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
16091 Standardize error messages.
16092 And s/@prec/%prec/!
16093 (reader): Use trace_flag to enable scanner/parser debugging,
16094 instead of an adhoc scheme.
16095 * src/scan-gram.l: Remove trailing debugging code.
16096
160972002-10-16 Paul Eggert <eggert@twinsun.com>
16098
16099 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
16100 MUSCLE_TAB_H.
16101
16102 * NEWS: Officially drop support for building Bison with K&R C,
16103 since it didn't work anyway and it's not worth worrying about.
16104 * Makefile.maint (wget_files): Remove ansi2knr.c.
16105 (ansi2knr.c-url_prefix): Remove.
16106 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
16107 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16108 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16109
161102002-10-15 Paul Eggert <eggert@twinsun.com>
16111
16112 Stop using the "enum_" trick for K&R-style function definitions;
16113 it confused me, and I was the author! Instead, assume that people
16114 who want to use K&R C compilers (when using these modules in GCC,
16115 perhaps?) will run ansi2knr.
16116
16117 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
16118 All uses of "enum_" changed to "enum ".
16119 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
16120 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
16121
16122 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
16123 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
16124 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
16125 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
16126 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
16127 abitset_not, abitset_ones, abitset_or, abitset_or_and,
16128 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
16129 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
16130 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
16131 Use function prototypes; this removes the need for declaring
16132 static functions simply to provide their prototypes.
16133 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
16134 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
16135 bitset_count_, bitset_create, bitset_dump, bitset_first,
16136 bitset_free, bitset_init, bitset_last, bitset_next,
16137 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
16138 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
16139 bitset_print, bitset_release_memory, bitset_toggle_,
16140 bitset_type_choose, bitset_type_get, bitset_type_name_get,
16141 debug_bitset): Likewise.
16142 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
16143 * lib/bitset_stats.c (bitset_log_histogram_print,
16144 bitset_percent_histogram_print, bitset_stats_and,
16145 bitset_stats_and_cmp, bitset_stats_and_or,
16146 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
16147 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
16148 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
16149 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
16150 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
16151 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
16152 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
16153 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
16154 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
16155 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
16156 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
16157 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
16158 bitset_stats_zero): Likewise.
16159 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
16160 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
16161 bitsetv_dump, debug_bitsetv): Likewise.
16162 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
16163 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
16164 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
16165 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
16166 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
16167 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
16168 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
16169 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
16170 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
16171 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
16172 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
16173 Likewise.
16174 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
16175 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
16176 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
16177 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
16178 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
16179 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
16180 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
16181 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
16182 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
16183 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
16184 lbitset_xor_cmp, lbitset_zero): Likewise.
16185
161862002-10-14 Akim Demaille <akim@epita.fr>
16187
16188 Version 1.75.
16189
161902002-10-14 Akim Demaille <akim@epita.fr>
16191
16192 * tests/Makefile.am (maintainer-check-posix): New.
16193
161942002-10-14 Akim Demaille <akim@epita.fr>
16195
16196 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
16197 member.
16198
161992002-10-14 Akim Demaille <akim@epita.fr>
16200
16201 * src/tables.c (table_ninf_remap): base -> tab.
16202 Reported by Matt Rosing.
16203
162042002-10-14 Paul Eggert <eggert@twinsun.com>
16205
16206 * tests/action.at, tests/calc.at, tests/conflicts.at,
16207 tests/cxx-type.at, tests/headers.at, tests/input.at,
16208 tests/regression.at, tests/synclines.at, tests/torture.at:
16209 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
16210 so that the tests still work even if POSIXLY_CORRECT is set.
16211 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
16212
16213 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
16214 for portability to K&R hosts. Fix typo: signed char is guaranteed
16215 only to 127, not to 128.
16216 * data/glr.c (yysigned_char): New type.
16217 * data/yacc.c (yysigned_char): Likewise.
16218 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
16219
162202002-10-13 Paul Eggert <eggert@twinsun.com>
16221
16222 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
16223 true due to limited range of data type" warning from GCC.
16224
16225 * data/c.m4 (b4_token_defines): Protect against double-inclusion
16226 by wrapping enum yytokentype's definition inside #ifndef
16227 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
16228
162292002-10-13 Akim Demaille <akim@epita.fr>
16230
16231 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
16232 Un yy- yyrhs to avoid the name clash with the global YYRHS.
16233
162342002-10-13 Akim Demaille <akim@epita.fr>
16235
16236 * Makefile.maint: Update from Autoconf 2.54.
16237 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
16238
162392002-10-13 Akim Demaille <akim@epita.fr>
16240
16241 * src/print.c (print_state): Separate the list of solved conflicts
16242 from the other items.
16243 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
16244
162452002-10-13 Akim Demaille <akim@epita.fr>
16246
16247 Let nondeterministic skeletons be usable with deterministic
16248 tables.
16249
16250 With the patch, GAWK compiled by GCC without -O2 passes its test
16251 suite using a GLR parser driven by LALR tables. It fails with -O2
16252 because `struct stat' gives two different answers on my machine:
16253 88 (definition of an auto var) and later 96 (memset on this var).
16254 Hence the stack is badly corrumpted. The headers inclusion is to
16255 blame: if I move the awk.h inclusion before GLR's system header
16256 inclusion, the two struct stat have the same size.
16257
16258 * src/tables.c (pack_table): Always create conflict_table.
16259 (token_actions): Always create conflict_list.
16260 * data/glr.c (YYFLAG): Remove, unused.
16261
162622002-10-13 Akim Demaille <akim@epita.fr>
16263
16264 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
16265 (O0FLAGS): New.
16266 (VALGRIND, GXX): New.
16267 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
16268 * tests/bison.in: Run $PREBISON a pre-command.
16269 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
16270 (maintainer-check-g++): New.
16271 * Makefile.am (maintainer-check): New.
16272
162732002-10-13 Akim Demaille <akim@epita.fr>
16274
16275 * data/glr.c: Formatting changes.
16276 Tweak some trace messages to match yacc.c's.
16277
162782002-10-13 Akim Demaille <akim@epita.fr>
16279
16280 GLR parsers sometimes raise parse errors instead of performing the
16281 default reduction.
16282 Reported by Charles-Henry de Boysson.
16283
16284 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
16285 check the length of the traces when %glr.
16286 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
16287 GLR's traces.
16288 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
16289 Test GLR parsers.
16290 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
16291 (yyltype): Remove the yy prefix from the member names.
16292 (yytable): Complete its comment.
16293 (yygetLRActions): Map error action number from YYTABLE from
16294 YYTABLE_NINF to 0.
16295 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
16296 (which was a bug: it should have been YYTABEL_NINF, and yet it was
16297 not satisfying as we could compare an YYACTION computed from
16298 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
16299 only value for error actions.
16300 (yyreportParseError): In verbose parse error messages, don't issue
16301 `error' in the list of expected tokens.
16302 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
16303 next action to perform to match glr.c's decoding.
16304 (yytable): Complete its comment.
16305
163062002-10-13 Paul Eggert <eggert@twinsun.com>
16307
16308 Fix problem reported by Henrik Grubbstroem in
16309 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
16310 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
16311 because the Bison parser reads the second action before reducing
16312 the first one.
16313 * src/scan-gram.l (rule_length): New static var.
16314 Use it to keep track of the rule length in the scanner, since
16315 we can't expect the parser to be in lock-step sync with the scanner.
16316 (handle_action_dollar, handle_action_at): Use this var.
16317 * tests/actions.at (Exotic Dollars): Test for the problem.
16318
163192002-10-12 Paul Eggert <eggert@twinsun.com>
16320
16321 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
16322 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
16323 Include <sys/time.h> when checking for clock_t and struct tms.
16324 Use same include order as source.
16325 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
16326 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
16327
16328 * lib/timevar.c: Update copyright date and clarify comments.
16329 (get_time) [IN_GCC]: Keep the GCC version for reference.
16330
16331 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
16332 GCC version as of today, then merge Bison's changes.
16333 Change "GCC" to "Bison" in copyright notice. timevar.def's
16334 author is Akim, so change that too.
16335
16336 * src/reader.c (grammar_current_rule_check):
16337 Don't worry about the default action if $$ is untyped.
16338 Prevents bogus warnings reported by Jim Gifford in
16339 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
16340
16341 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
16342 * data/glr.c, data/lalr1.cc, data/yacc.c:
16343 Output token definitions before the first part of user declarations.
16344 Fixes compatibility problem reported by Jim Gifford for kbd in
16345 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
16346
163472002-10-11 Paul Eggert <eggert@twinsun.com>
16348
16349 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
16350 (yyparse): here. This undoes some of the 2002-07-25 change.
16351 Compatibility problem reported by Ralf S. Engelschall with
16352 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
16353
163542002-10-11 Akim Demaille <akim@epita.fr>
16355
16356 * tests/regression.at Characters Escapes): New.
16357 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
16358 characters.
16359 Reported by Jan Nieuwenhuizen.
16360
163612002-10-11 Akim Demaille <akim@epita.fr>
16362
16363 * po/id.po: New.
16364
163652002-10-10 Paul Eggert <eggert@twinsun.com>
16366
16367 Portability fixes for bitsets; this also avoids several GCC
16368 warnings.
16369
16370 * lib/abitset.c: Include <stddef.h>, for offsetof.
16371 * lib/lbitset.c: Likewise.
16372
16373 * lib/abitset.c (abitset_bytes): Return a size that is aligned
16374 properly for vectors of objects. Do not assume that adding a
16375 header size to a multiple of a word size yields a value that is
16376 properly aligned for the whole union.
16377 * lib/bitsetv.c (bitsetv_alloc): Likewise.
16378
16379 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
16380 unique names for structures.
16381 * lib/ebitset.c (ebitset_bytes): Likewise.
16382 * lib/lbitset.c (lbitset_bytes): Likewise.
16383
16384 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
16385 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
16386 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
16387 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
16388 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
16389 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
16390 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
16391 to improve the type-checking that GCC can do.
16392 * lib/bitset.c (bitset_op4_cmp): Likewise.
16393 * lib/bitset_stats.c (bitset_stats_count,
16394 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
16395 bitset_stats_copy, bitset_stats_disjoint_p,
16396 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
16397 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
16398 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
16399 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
16400 bitset_stats_and_or_cmp, bitset_stats_andn_or,
16401 bitset_stats_andn_or_cmp, bitset_stats_or_and,
16402 bitset_stats_or_and_cmp): Likewise.
16403 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
16404 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
16405 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
16406 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
16407
16408 * lib/abitset.h: Include bitset.h, not bbitset.h.
16409 * lib/ebitset.h: Likewise.
16410 * lib/lbitset.h: Likewise.
16411
16412 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
16413 All instances of parameters of type enum bitset_opts are now of
16414 type enum_bitset_opts, to conform to the C Standard, and similarly
16415 for enum_bitset_type.
16416 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
16417 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
16418
16419 Do not use "struct bitset_struct" to mean different things in
16420 different modules. Not only is this confusing, it violates
16421 the C Standard, which requires that structure types in different
16422 modules must be compatible if one is to be passed to the other.
16423 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
16424 All instances of "struct bitset_struct *" replaced with "bitset".
16425 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
16426 (union bitset_union, struct abitset_struct, struct ebitset_struct,
16427 struct lbitset_struct, struct bitset_stats_struct): New types.
16428 All uses of struct bitset_struct changed to union bitset_union,
16429 etc.
16430 * lib/abitset.c (struct abitset_struct, abitset,
16431 struct bitset_struct): Remove.
16432 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
16433 struct bitset_struct): Remove.
16434 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
16435 bitset_struct): Remove.
16436 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
16437 Likewise.
16438
16439 Do not call a function of type T using a call that assumes the
16440 function is of a different type U. Standard C requires that a
16441 function must be called with a type that is compatible with its
16442 definition.
16443 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
16444 New decls.
16445 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
16446 New functions.
16447 * lib/ebitset.c (PFV): Remove.
16448 * lib/lbitset.c (PFV): Likewise.
16449 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
16450 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
16451 decls.
16452 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
16453 (ebitset_vtable): Use them.
16454 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
16455 lbitset_xor): New functions.
16456 (lbitset_vtable): Use them.
16457
16458 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
16459 Declare.
16460
16461 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
16462 GCC warning.
16463 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
16464 Use offsetof, for simplicity.
16465
164662002-10-06 Paul Eggert <eggert@twinsun.com>
16467
16468 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
16469 the same width as int. This reapplies a hunk of the 2002-08-12 patch
16470 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
16471 which was inadvertently undone by the 2002-09-30 patch.
16472 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
16473 the same width as int.
16474
164752002-10-04 Paul Eggert <eggert@twinsun.com>
16476
16477 Version 1.50.
16478
16479 * configure.ac (AC_INIT), NEWS: Increment version number.
16480
16481 * doc/bison.texinfo: Minor spelling, grammar, and white space
16482 fixes.
16483 (Symbols): Mention that any negative value returned from yylex
16484 signifies end-of-input. Warn about negative chars. Mention
16485 the portable Standard C character set.
16486
16487 The GNU coding standard says CFLAGS and YFLAGS are reserved
16488 for the installer to set.
16489 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
16490 * src/Makefile.am (AM_CFLAGS): Likewise.
16491 (AM_YFLAGS): Renamed from YFLAGS.
16492
16493 Fix some MAX and MIN problems.
16494 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
16495 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
16496 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
16497 * src/reader.c (reader): Use it.
16498
16499 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
16500 POSIX 1003.1-2001 has removed fgrep.
16501
165022002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
16503
16504 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
16505 interpreted as signed.
16506 * lib/ebitset.c (ebitset_list): Fix bug.
16507
165082002-10-01 Paul Eggert <eggert@twinsun.com>
16509
16510 More fixes for 64-bit hosts and large bitsets.
16511
16512 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
16513 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
16514 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
16515 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
16516 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
16517 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
16518 bitset_count_): Likewise.
16519 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
16520 bitset_first, bitset_last): Likewise.
16521 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
16522 bitset_stats_list_reverse, bitset_stats_size,
16523 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
16524 Likewise.
16525 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
16526 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
16527 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
16528 bitsetv_reflexive_transitive_closure): Likewise.
16529 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
16530 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
16531 Likewise.
16532 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
16533 Likewise.
16534
16535 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
16536 Use size_t, not unsigned int, to count bytes.
16537 * lib/abitset.h (abitset_bytes): Likewise.
16538 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
16539 Likewise.
16540 * lib/bitset.h (bitset_bytes): Likewise.
16541 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
16542 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
16543 * lib/bitsetv.c (bitsetv_alloc): Likewise.
16544 * lib/ebitset.c (ebitset_bytes): Likewise.
16545 * lib/ebitset.h (ebitset_bytes): Likewise.
16546 * lib/lbitset.c (lbitset_bytes): Likewise.
16547 * lib/lbitset.h (lbitset_bytes): Likewise.
16548
16549 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
16550 abitset_subset_p, abitset_disjoint_p, abitset_and,
16551 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
16552 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
16553 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
16554 abitset_or_and, abitset_or_and_cmp):
16555 Use bitset_windex instead of unsigned int.
16556 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
16557 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
16558 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
16559 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
16560 Likewise.
16561 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
16562
16563 * lib/bitset.c (bitset_print):
16564 Use proper printf formats for widths of integer types.
16565 * lib/bitset_stats.c (bitset_percent_histogram_print,
16566 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
16567 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
16568 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
16569 * lib/lbitset.c (lbitset_bytes): Likewise.
16570
16571 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
16572 BITSET_SIZE_MAX): New macros.
16573 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
16574 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
16575 to BITSET_WINDEX_MAX.
16576
16577 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
16578 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
16579 since we now return the bitset_bindex type (not int).
16580
16581 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
16582 when computing sizes.
16583 * lib/ebitset.c (ebitset_elts_grow): Likewise.
16584
16585 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
16586 and avoid cast to unsigned.
16587
165882002-09-30 Akim Demaille <akim@epita.fr>
16589
16590 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
16591 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
16592 Updates from Michael Hayes.
16593
165942002-09-30 Art Haas <ahaas@neosoft.com>
16595
16596 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
16597 invocations.
16598 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
16599 defined.
16600
166012002-09-27 Akim Demaille <akim@epita.fr>
16602
16603 Version 1.49c.
16604
166052002-09-27 Akim Demaille <akim@epita.fr>
16606
16607 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
16608 (Because of AC_LIBSOURCE).
16609
166102002-09-27 Akim Demaille <akim@epita.fr>
16611
16612 Playing with Autoscan.
16613
16614 * configure.ac: Remove the old LIBOBJ tweaks.
16615 (AC_REPLACE_FUNCS): Add strrchr and strtol.
16616 * lib/strrchr.c: New.
16617 * lib/strtol.c: New, from the Coreutils 4.5.1.
16618
166192002-09-27 Akim Demaille <akim@epita.fr>
16620
16621 Playing with Autoscan.
16622
16623 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
16624 * lib/Makefile.am (libbison_a_SOURCES): No longer include
16625 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
16626 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
16627 Coreutils 4.5.1.
16628
166292002-09-24 Akim Demaille <akim@epita.fr>
16630
16631 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
16632 (Frequently Asked Questions, Parser Stack Overflow): New.
16633
166342002-09-13 Akim Demaille <akim@epita.fr>
16635
16636 Playing with autoscan.
16637
16638 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
16639 * src/files.c (skeleton_find): Remove, unused.
16640 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
16641 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
16642
166432002-09-13 Akim Demaille <akim@epita.fr>
16644
16645 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
16646 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
16647
166482002-09-13 Akim Demaille <akim@epita.fr>
16649
16650 * configure.ac: Require 2.54.
16651 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
16652 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
16653 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
16654 Remove, provided by Autoconf macros.
16655
166562002-09-12 Akim Demaille <akim@epita.fr>
16657
16658 * m4/prereq.m4: Update, from Coreutils 4.5.1.
16659
166602002-09-12 Akim Demaille <akim@epita.fr>
16661
16662 * m4/prereq.m4: Update, from Fileutils 4.1.5.
16663 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
16664 Reported by Martin Mokrejs.
16665
166662002-09-10 Akim Demaille <akim@epita.fr>
16667
16668 * src/parse-gram.y: Associate a human readable string to each
16669 token type.
16670 * tests/regression.at (Invalid inputs): Adjust.
16671
166722002-09-10 Gary V. Vaughan <gary@gnu.org>
16673
16674 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
16675 with an Autoconf-2.5x style configure.ac.
16676
166772002-09-06 Paul Eggert <eggert@twinsun.com>
16678
16679 * doc/bison.texinfo (Conditions): Make explicit that the GPL
16680 exception applies only to yacc.c. This is a modification of a
16681 patch originally suggested by Akim Demaille.
16682
166832002-09-06 Akim Demaille <akim@epita.fr>
16684
16685 * data/c.m4 (b4_copyright): Move the GPL exception comment from
16686 here to...
16687 * data/yacc.c: here.
16688
16689 * data/lalr1.cc (struct yyltype): Don't define it, since we use
16690 LocationType.
16691 (b4_ltype): Default to yy::Location from location.hh.
16692
166932002-09-04 Jim Meyering <jim@meyering.net>
16694
16695 * data/yacc.c: Guard the declaration of yytoknum also with
16696 `#ifdef YYPRINT', so it is declared only when used.
16697
166982002-09-04 Akim Demaille <akim@epita.fr>
16699
16700 * configure.in: Rename as...
16701 * configure.ac: this.
16702 Bump to 1.49c.
16703
167042002-09-04 Akim Demaille <akim@epita.fr>
16705
16706 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
16707 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
16708 translate maintainer only messages.
16709
167102002-08-12 Paul Eggert <eggert@twinsun.com>
16711
16712 Version 1.49b.
16713
16714 * Makefile.am (SUBDIRS): Remove intl.
16715 (DISTCLEANFILES): Remove.
16716 * NEWS: Mention that GNU M4 is now required. Clarify what is
16717 meant by "larger grammars". Mention the pt_BR translation.
16718 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
16719 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
16720 Bump version from 0.11.2 to 0.11.5.
16721 (BISON_PREREQ_STAGE): Remove.
16722 (AM_GNU_GETTEXT): Use external gettext.
16723 (AC_OUTPUT): Remove intl/Makefile.
16724
16725 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
16726
16727 * data/glr.c: Include string.h, for strlen.
16728 (yyreportParseError): Use size_t for yysize.
16729 (yy_yypstack): No longer nested inside yypstates, as nested
16730 functions are not portable. Do not assume size_t is the
16731 same width as int.
16732 (yypstates): Do not assume that ptrdiff_t is the same width
16733 as int, and similarly for yyposn and YYINDEX.
16734
16735 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
16736
16737 * lib/Makefile.am (INCLUDES): Do not include from the intl
16738 directory, which has been removed.
16739 * src/Makefile.am (INCLUDES): Likewise.
16740
16741 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
16742 (bitsets_sources, additional_bitsets_sources, timevars_sources):
16743 New vars.
16744
16745 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
16746 * tests/Makefile.am (EXTRA_DIST): Likewise.
16747
16748 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
16749 Do not assume that bitset_windex is the same width as unsigned.
16750
16751 * lib/abitset.c (abitset_unused_clear): Do not assume that
16752 bitset_word is the same width as int.
16753 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
16754 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
16755 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
16756 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
16757 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
16758
16759 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
16760 portability to one's complement hosts!).
16761 * lib/ebitset.c (ebitset_op1): Likewise.
16762 * lib/lbitset.c (lbitset_op1): Likewise.
16763
16764 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
16765 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
16766 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
16767 Sync with fileutils.
16768 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
16769 lib/gettext.h: Sync with diffutils.
16770
16771 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
16772 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
16773
16774 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
16775 PROTOTYPES to check for prototypes, and "defined __STDC__" to
16776 check for void *.
16777
16778 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
16779 size_t; the old version tried to do this but casted improperly.
16780 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
16781 (bitset_test): Now returns int, not unsigned long.
16782
16783 * lib/bitset_stats.c: Include "gettext.h".
16784 (_): New macro.
16785 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
16786 name locals "index", as it generates unnecessary warnings on some
16787 hosts that have an "index" function.
16788
16789 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
16790 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
16791 they need translation.
16792 * src/LR0.c (state_list_append, new_itemsets, get_state,
16793 append_states, generate_states): Likewise.
16794 * src/assoc.c (assoc_to_string): Likewise.
16795 * src/closure.c (print_closure, set_firsts, closure): Likewise.
16796 * src/gram.c (grammar_dump): Likewise.
16797 * src/injections.c (injections_compute): Likewise.
16798 * src/lalr.c (lookaheads_print): Likewise.
16799 * src/relation.c (relation_transpose): Likewise.
16800 * src/scan-gram.l: Likewise.
16801 * src/tables.c (table_grow, pack_vector): Likewise.
16802
16803 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
16804 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
16805 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
16806 * m4/mbstate_t.m4: Sync with fileutils.
16807 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
16808
16809 * po/LINGUAS: Add pt_BR.
16810 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
16811 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
16812 lib/timevar.c.
16813 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
16814 manual recommends.
16815 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
16816
16817 * src/complain.c (strerror_r): Remove decl; not needed.
16818 (strerror): Use same pattern as ../lib/error.c.
16819
16820 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
16821
16822 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
16823
16824 * src/main.c (main): Cast result of bindtextdomain and textdomain
16825 to void, to avoid a GCC warning when --disable-nls is in effect.
16826
16827 * src/scan-gram.l: Use strings rather than escapes when possible,
16828 to minimize the number of warnings from xgettext.
16829 (handle_action_dollar, handle_action_at): Don't use isdigit,
16830 as it mishandles negative chars and it may not work as expected
16831 outside the C locale.
16832
16833 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
16834 this is a GCC extension and is not portable to other compilers.
16835
16836 * src/system.h (alloca): Use same pattern as ../lib/error.c.
16837 Do not include <ctype.h>; no longer needed.
16838 Do not include <malloc.h>; no longer needed (and generates
16839 warnings on OpenBSD 3.0).
16840
16841 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
16842 it's not portable.
16843
16844 * tests/regression.at: Do not use 'cc -c input.c -o input';
16845 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
16846
16847 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
16848 exit status as failure, not just exit status 1. Sun C exits
16849 with status 2 sometimes.
16850
16851 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
16852 Use it for the two large tests.
16853
168542002-08-02 Akim Demaille <akim@epita.fr>
16855
16856 * src/conflicts.c (conflicts_output): Don't output rules never
16857 reduced here, since anyway that computation doesn't work.
16858 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
16859 (rule_useless_p, rule_never_reduced_p): New.
16860 (grammar_rules_partial_print): Use a filter instead of a range.
16861 Display the title only if needed.
16862 (grammar_rules_print): Adjust.
16863 (grammar_rules_never_reduced_report): New.
16864 * src/tables.c (action_row): Move the computation of rules never
16865 reduced to...
16866 (token_actions): here.
16867 * src/main.c (main): Make the parser before making the report, so
16868 that rules never reduced are computed.
16869 Call grammar_rules_never_reduced_report.
16870 * src/print.c (print_results): Report rules never reduced.
16871 * tests/conflicts.at, tests/reduce.at: Adjust.
16872
168732002-08-01 Akim Demaille <akim@epita.fr>
16874
16875 Instead of attaching lookaheads and duplicating the rules being
16876 reduced by a state, attach the lookaheads to the reductions.
16877
16878 * src/state.h (state_t): Remove the `lookaheads',
16879 `lookaheads_rule' member.
16880 (reductions_t): Add a `lookaheads' member.
16881 Use a regular array for the `rules'.
16882 * src/state.c (reductions_new): Initialize the lookaheads member
16883 to 0.
16884 (state_rule_lookaheads_print): Adjust.
16885 * src/state.h, src/state.c (state_reductions_find): New.
16886 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
16887 (count_rr_conflicts): Adjust.
16888 * src/lalr.c (LArule): Remove.
16889 (add_lookback_edge): Adjust.
16890 (state_lookaheads_count): New.
16891 (states_lookaheads_initialize): Merge into...
16892 (initialize_LA): this.
16893 (lalr_free): Adjust.
16894 * src/main.c (main): Don't free nullable and derives too early: it
16895 is used by --verbose.
16896 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
16897
168982002-08-01 Akim Demaille <akim@epita.fr>
16899
16900 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
16901 `rule_number_t**'.
16902 (set_derives, free_derives): Rename as...
16903 (derives_compute, derives_free): this.
16904 Adjust all dependencies.
16905 * src/nullable.c (set_nullable, free_nullable): Rename as...
16906 (nullable_compute, nullable_free): these.
16907 (rule_list_t): Store rule_t *, not rule_number_t.
16908 * src/state.c (state_rule_lookaheads_print): Directly compare rule
16909 pointers, instead of their numbers.
16910 * src/main.c (main): Call nullable_free, and derives_free earlier,
16911 as they were lo longer used.
16912
169132002-08-01 Akim Demaille <akim@epita.fr>
16914
16915 * lib/timevar.c (get_time): Include children time.
16916 * src/lalr.h (LA, LArule): Don't export them: used with the
16917 state_t.
16918 * src/lalr.c (LA, LArule): Static.
16919 * src/lalr.h, src/lalr.c (lalr_free): New.
16920 * src/main.c (main): Call it.
16921 * src/tables.c (pack_vector): Check whether loc is >= to the
16922 table_size, not >.
16923 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
16924 (tables_generate): do it, since that's also it which allocates
16925 them.
16926 Don't free LA and LArule, main does.
16927
169282002-07-31 Akim Demaille <akim@epita.fr>
16929
16930 Separate parser tables computation and output.
16931
16932 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
16933 (conflict_list, conflict_list_cnt, table, check, table_ninf)
16934 (yydefgoto, yydefact, high): Move to...
16935 * src/tables.h, src/tables.c: here.
16936 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
16937 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
16938 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
16939 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
16940 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
16941 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
16942 (action_row, save_row, token_actions, save_column, default_goto)
16943 (goto_actions, sort_actions, matching_state, pack_vector)
16944 (table_ninf_remap, pack_table, prepare_actions): Move to...
16945 * src/tables.c: here.
16946 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
16947 * src/output.c (token_actions, output_base, output_conflicts)
16948 (output_check): Merge into...
16949 (prepare_actions): this.
16950 (actions_output): Rename as...
16951 (user_actions_output): this.
16952 * src/main.c (main): Call tables_generate and tables_free.
16953
169542002-07-31 Akim Demaille <akim@epita.fr>
16955
16956 Steal GCC's --time-report support.
16957
16958 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
16959 stolen/adjusted from GCC.
16960 * m4/stage.m4: Remove time related checks.
16961 * m4/timevar.m4: New.
16962 * configure.in: Adjust.
16963 * src/system.h: Adjust to using timevar.h.
16964 * src/getargs.h, src/getargs.c: Support trace_time for
16965 --trace=time.
16966 * src/main.c (stage): Remove.
16967 (main): Replace `stage' invocations with timevar calls.
16968 * src/output.c: Insert pertinent timevar calls.
16969
169702002-07-31 Akim Demaille <akim@epita.fr>
16971
16972 Let --trace have arguments.
16973
16974 * src/getargs.h (enum trace_e): New.
16975 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
16976 (long_options, short_options): --trace/-T takes an optional
16977 argument.
16978 Change all the uses of trace_flag to reflect the new flags.
16979 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
16980
16981 Strengthen `stage' portability.
16982
16983 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
16984 * configure.in: Use it.
16985 Don't check for malloc.h and sys/times.h.
16986 * src/system.h: Include them when appropriate.
16987 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
16988 times and struct tms are available.
16989
169902002-07-30 Akim Demaille <akim@epita.fr>
16991
16992 In verbose parse error message, don't report `error' as an
16993 expected token.
16994 * tests/actions.at (Printers and Destructors): Adjust.
16995 * tests/calc.at (Calculator $1): Adjust.
16996 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
16997 error message, do not report the parser accepts the error token in
16998 that state.
16999
170002002-07-30 Akim Demaille <akim@epita.fr>
17001
17002 Normalize conflict related messages.
17003
17004 * src/complain.h, src/complain.c (warn, complain): New.
17005 * src/conflicts.c (conflicts_print): Use them.
17006 (conflict_report_yacc): New, extracted from...
17007 (conflicts_print): here.
17008 * tests/conflicts.at, tests/existing.at: Adjust.
17009
170102002-07-30 Akim Demaille <akim@epita.fr>
17011
17012 Report rules which are never reduced by the parser: those hidden
17013 by conflicts.
17014
17015 * src/LR0.c (save_reductions): Don't make the final state too
17016 different: save its reduction (accept) instead of having a state
17017 without any action (no shift or goto, no reduce).
17018 Note: the final state is now a ``regular'' state, i.e., the
17019 parsers now contain `reduce 0' as default reduction.
17020 Nevertheless, since they decide to `accept' when yystate =
17021 final_state, they still will not reduce rule 0.
17022 * src/print.c (print_actions, print_reduction): Adjust.
17023 * src/output.c (action_row): Track reduced rules.
17024 (token_actions): Report rules never reduced.
17025 * tests/conflicts.at, tests/regression.at: Adjust.
17026
170272002-07-30 Akim Demaille <akim@epita.fr>
17028
17029 `stage' was accidently included in a previous patch.
17030 Initiate its autoconfiscation.
17031
17032 * configure.in: Look for malloc.h and sys/times.h.
17033 * src/main.c (stage): Adjust.
17034 Report only when trace_flag.
17035
170362002-07-29 Akim Demaille <akim@epita.fr>
17037
17038 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
17039 state_number_t.
17040 (errs_t): symbol_t*, not symbol_number_t.
17041 (reductions_t): rule_t*, not rule_number_t.
17042 (FOR_EACH_SHIFT): New.
17043 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
17044 * src/print.c, src/print_graph.c: Adjust.
17045
170462002-07-29 Akim Demaille <akim@epita.fr>
17047
17048 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
17049
17050 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
17051 (endtoken, accept): these.
17052 * src/reader.c (reader): Set endtoken's default tag to "$end".
17053 Set undeftoken's tag to "$undefined" instead of "$undefined.".
17054 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
17055 Adjust.
17056
170572002-07-29 Akim Demaille <akim@epita.fr>
17058
17059 * src/reduce.c (reduce_grammar): When the language is empty,
17060 complain about the start symbol, not the axiom.
17061 Use its location.
17062 * tests/reduce.at (Empty Language): New.
17063
170642002-07-26 Akim Demaille <akim@epita.fr>
17065
17066 * src/reader.h, src/reader.c (gram_error): ... can't get
17067 yycontrol without making too strong assumptions on the parser
17068 itself.
17069 * src/output.c (prepare_tokens): Use the real 0th value of
17070 token_translations instead of `0'.
17071 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
17072 visible here.
17073 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
17074 for the time being: %locations ought to provide it to yyerror.
17075
170762002-07-25 Akim Demaille <akim@epita.fr>
17077
17078 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
17079 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
17080 * tests/regression.at (Web2c Actions): Adjust.
17081
170822002-07-25 Akim Demaille <akim@epita.fr>
17083
17084 Stop storing rules from 1 to nrules + 1.
17085
17086 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
17087 * src/nullable.c, src/output.c, src/print.c, src/reader.c
17088 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
17089 Iterate from 0 to nrules.
17090 Use rule_number_as_item_number and item_number_as_rule_number.
17091 Adjust to `derive' now containing possibly 0.
17092 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
17093 Handle the `- 1' part in rule numbers from/to item numbers.
17094 * src/conflicts.c (log_resolution): Fix the message which reversed
17095 shift and reduce.
17096 * src/output.c (action_row): Initialize default_rule to -1.
17097 (token_actions): Adjust.
17098 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
17099 expected output.
17100 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
17101
171022002-07-25 Akim Demaille <akim@epita.fr>
17103
17104 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
17105 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
17106 (b4_c_knr_arg_decl): New.
17107 * data/yacc.c: Use it to define yysymprint, yydestruct, and
17108 yyreport_parse_error.
17109
171102002-07-25 Akim Demaille <akim@epita.fr>
17111
17112 * data/yacc.c (yyreport_parse_error): New, extracted from...
17113 (yyparse): here.
17114 (yydestruct, yysymprint): Move above yyparse.
17115 Be K&R compliant.
17116
171172002-07-25 Akim Demaille <akim@epita.fr>
17118
17119 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
17120 replace...
17121 (b4_sint_type, b4_uint_type): these.
17122 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
17123 * tests/regression.at (Web2c Actions): Adjust.
17124
171252002-07-25 Akim Demaille <akim@epita.fr>
17126
17127 * src/gram.h (TIEM_NUMBER_MAX): New.
17128 (item_number_of_rule_number, rule_number_of_item_number): Rename
17129 as...
17130 (rule_number_as_item_number, item_number_as_rule_number): these.
17131 Adjust dependencies.
17132 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17133 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17134 (symbol_number_to_vector_number): New.
17135 (order): Of vector_number_t* type.
17136 (base_t, BASE_MAX, BASE_MIN): New.
17137 (froms, tos, width, pos, check): Of base_t type.
17138 (action_number_t, ACTION_MIN, ACTION_MAX): New.
17139 (actrow): Of action_number_t type.
17140 (conflrow): Of unsigned int type.
17141 (table_ninf, base_ninf): New.
17142 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
17143 (muscle_insert_int_table, muscle_insert_base_table)
17144 (muscle_insert_rule_number_table): New.
17145 (prepare_tokens): Output `toknum' as int_table.
17146 (action_row): Returns a rule_number_t.
17147 Use ACTION_MIN, not SHRT_MIN.
17148 (token_actions): yydefact is rule_number_t*.
17149 (table_ninf_remap): New.
17150 (pack_table): Use it for `base' and `table'.
17151 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
17152 replaced with...
17153 (YYPACT_NINF, YYTABLE_NINF): these.
17154 (yypact, yytable): Compute their types instead of hard-coded
17155 `short'.
17156 * tests/regression.at (Web2c Actions): Adjust.
17157
171582002-07-19 Akim Demaille <akim@epita.fr>
17159
17160 * src/scan-gram.l (id): Can start with an underscore.
17161
171622002-07-16 Akim Demaille <akim@epita.fr>
17163
17164 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
17165 Adjust all former `associativity' dependencies.
17166 * src/symtab.c (symbol_new): Default associativity is `undef', not
17167 `right'.
17168 (symbol_check_alias_consistence): Adjust.
17169
171702002-07-09 Akim Demaille <akim@epita.fr>
17171
17172 * doc/bison.texinfo: Properly set the ``header'' part.
17173 Use @dircategory ``GNU programming tools'' as per Texinfo's
17174 documentation.
17175 Use @copying.
17176
171772002-07-09 Akim Demaille <akim@epita.fr>
17178
17179 * lib/quotearg.h: Protect against multiple inclusions.
17180 * src/location.h (location_t): Add a `file' member.
17181 (LOCATION_RESET, LOCATION_PRINT): Adjust.
17182 * src/complain.c (warn_at, complain_at, fatal_at): Drop
17183 `error_one_per_line' support.
17184
171852002-07-09 Akim Demaille <akim@epita.fr>
17186
17187 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
17188 * src/reader.c (lineno): Remove.
17189 Adjust all dependencies.
17190 (get_merge_function): Take a location and use complain_at.
17191 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
17192 * tests/regression.at (Invalid inputs, Mixing %token styles):
17193 Adjust.
17194
171952002-07-09 Akim Demaille <akim@epita.fr>
17196
17197 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
17198 recovery rule, and forbid extensions when --yacc.
17199 (gram_error): Use complain_at.
17200 * src/reader.c (reader): Exit if there were parse errors.
17201
172022002-07-09 Akim Demaille <akim@epita.fr>
17203
17204 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
17205 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
17206 Reported by R Blake <blakers@mac.com>.
17207
172082002-07-09 Akim Demaille <akim@epita.fr>
17209
17210 * data/yacc.c: Output the copyright notive in the header.
17211
172122002-07-03 Akim Demaille <akim@epita.fr>
17213
17214 * src/output.c (froms, tos): Are state_number_t.
17215 (save_column): sp, sp1, and sp2 are state_number_t.
17216 (prepare): Rename `final' as `final_state_number', `nnts' as
17217 `nterms_number', `nrules' as `rules_number', `nstates' as
17218 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
17219 unused.
17220 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
17221 * data/lalr1.cc (nsym_): Remove, unused.
17222
172232002-07-03 Akim Demaille <akim@epita.fr>
17224
17225 * src/lalr.h, src/lalr.c (goto_number_t): New.
17226 * src/lalr.c (goto_list_t): New.
17227 Propagate them.
17228 * src/nullable.c (rule_list_t): New.
17229 Propagate.
17230 * src/types.h: Remove.
17231
172322002-07-03 Akim Demaille <akim@epita.fr>
17233
17234 * src/closure.c (print_fderives): Use rule_rhs_print.
17235 * src/derives.c (print_derives): Use rule_rhs_print.
17236 (rule_list_t): New, replaces `shorts'.
17237 (set_derives): Add comments.
17238 * tests/sets.at (Nullable, Firsts): Adjust.
17239
172402002-07-03 Akim Demaille <akim@epita.fr>
17241
17242 * src/output.c (prepare_actions): Free `tally' and `width'.
17243 (prepare_actions): Allocate and free `order'.
17244 * src/symtab.c (symbols_free): Free `symbols'.
17245 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
17246 * src/output.c (m4_invoke): Move to...
17247 * src/scan-skel.l: here.
17248 (<<EOF>>): Close yyout, and free its name.
17249
172502002-07-03 Akim Demaille <akim@epita.fr>
17251
17252 Fix some memory leaks, and fix a bug: state 0 was examined twice.
17253
17254 * src/LR0.c (new_state): Merge into...
17255 (state_list_append): this.
17256 (new_states): Merge into...
17257 (generate_states): here.
17258 (set_states): Don't ensure a proper `errs' state member here, do it...
17259 * src/conflicts.c (conflicts_solve): here.
17260 * src/state.h, src/state.c: Comment changes.
17261 (state_t): Rename member `shifts' as `transitions'.
17262 Adjust all dependencies.
17263 (errs_new): For consistency, also take the values as argument.
17264 (errs_dup): Remove.
17265 (state_errs_set): New.
17266 (state_reductions_set, state_transitions_set): Assert that no
17267 previous value was assigned.
17268 (state_free): New.
17269 (states_free): Use it.
17270 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
17271 temporary storage: use `errs' and `nerrs' as elsewhere.
17272 (set_conflicts): Allocate and free this `errs'.
17273
172742002-07-02 Akim Demaille <akim@epita.fr>
17275
17276 * lib/libiberty.h: New.
17277 * lib: Update the bitset implementation from upstream.
17278 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
17279 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
17280 * src/main.c: Adjust bitset stats calls.
17281
172822002-07-01 Paul Eggert <eggert@twinsun.com>
17283
17284 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
17285 char, so that negative chars don't collide with $.
17286
172872002-06-30 Akim Demaille <akim@epita.fr>
17288
17289 Have the GLR tests be `warning' checked, and fix the warnings.
17290
17291 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
17292 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
17293 (yyremoveDeletes): `yyi' and `yyj' are size_t.
17294 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
17295 (yyaddDeferredAction): static.
17296 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
17297 (yyreportParseError): yyprefix is const.
17298 yytokenp is used only when verbose.
17299 (yy__GNUC__): Replace with __GNUC__.
17300 (yypdumpstack): yyi is size_t.
17301 (yypreference): Un-yy local variables and arguments, to avoid
17302 clashes with `yyr1'. Anyway, we are not in the user name space.
17303 (yytname_size): be an int, as is compared with ints.
17304 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
17305 Use them.
17306 * tests/cxx-gram.at: Use quotation to protect $1.
17307 Use AT_COMPILE to enable warnings hunts.
17308 Prototype yylex and yyerror.
17309 `Use' argc.
17310 Include `string.h', not `strings.h'.
17311 Produce and prototype stmtMerge only when used.
17312 yylex takes a location.
17313
173142002-06-30 Akim Demaille <akim@epita.fr>
17315
17316 We spend a lot of time in quotearg, in particular when --verbose.
17317
17318 * src/symtab.c (symbol_get): Store a quoted version of the key.
17319 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
17320 Adjust all callers.
17321
173222002-06-30 Akim Demaille <akim@epita.fr>
17323
17324 * src/state.h (reductions_t): Rename member `nreds' as num.
17325 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
17326 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
17327
173282002-06-30 Akim Demaille <akim@epita.fr>
17329
17330 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
17331 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
17332 (shifts_to): Rename as...
17333 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
17334 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
17335 (TRANSITION_IS_DISABLED, transitions_to): these.
17336
173372002-06-30 Akim Demaille <akim@epita.fr>
17338
17339 * src/print.c (print_shifts, print_gotos): Merge into...
17340 (print_transitions): this.
17341 (print_transitions, print_errs, print_reductions): Align the
17342 lookaheads columns.
17343 (print_core, print_transitions, print_errs, print_state,
17344 print_grammar): Output empty lines separator before, not after.
17345 (state_default_rule_compute): Rename as...
17346 (state_default_rule): this.
17347 * tests/conflicts.at (Defaulted Conflicted Reduction),
17348 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
17349 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
17350
173512002-06-30 Akim Demaille <akim@epita.fr>
17352
17353 Display items as we display rules.
17354
17355 * src/gram.h, src/gram.c (rule_lhs_print): New.
17356 * src/gram.c (grammar_rules_partial_print): Use it.
17357 * src/print.c (print_core): Likewise.
17358 * tests/conflicts.at (Defaulted Conflicted Reduction),
17359 (Unresolved SR Conflicts): Adjust.
17360 (Unresolved SR Conflicts): Adjust and rename as...
17361 (Resolved SR Conflicts): this, as was meant.
17362 * tests/regression.at (Web2c Report): Adjust.
17363
173642002-06-30 Akim Demaille <akim@epita.fr>
17365
17366 * src/print.c (state_default_rule_compute): New, extracted from...
17367 (print_reductions): here.
17368 Pessimize, but clarify the code.
17369 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
17370
173712002-06-30 Akim Demaille <akim@epita.fr>
17372
17373 * src/output.c (action_row): Let default_rule be always a rule
17374 number.
17375
173762002-06-30 Akim Demaille <akim@epita.fr>
17377
17378 * src/closure.c (print_firsts, print_fderives, closure):
17379 Use BITSET_EXECUTE.
17380 * src/lalr.c (lookaheads_print): Likewise.
17381 * src/state.c (state_rule_lookaheads_print): Likewise.
17382 * src/print_graph.c (print_core): Likewise.
17383 * src/print.c (print_reductions): Likewise.
17384 * src/output.c (action_row): Likewise.
17385 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
17386
173872002-06-30 Akim Demaille <akim@epita.fr>
17388
17389 * src/print_graph.c: Use report_flag.
17390
173912002-06-30 Akim Demaille <akim@epita.fr>
17392
17393 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
17394 to...
17395 * src/relation.h, src/relation.c (traverse, relation_digraph)
17396 (relation_print, relation_transpose): New.
17397
173982002-06-30 Akim Demaille <akim@epita.fr>
17399
17400 * src/state.h, src/state.c (shifts_to): New.
17401 * src/lalr.c (build_relations): Use it.
17402
174032002-06-30 Akim Demaille <akim@epita.fr>
17404
17405 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
17406 (item_number_of_rule_number, rule_number_of_item_number): New.
17407 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
17408 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
17409 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
17410 Propagate their use.
17411 Much remains to be done, in particular wrt `shorts' from types.h.
17412
174132002-06-30 Akim Demaille <akim@epita.fr>
17414
17415 * src/symtab.c (symbol_new): Initialize the `printer' member.
17416
174172002-06-30 Akim Demaille <akim@epita.fr>
17418
17419 * src/LR0.c (save_reductions): Remove, replaced by...
17420 * src/state.h, src/state.c (state_reductions_set): New.
17421 (reductions, errs): Rename as...
17422 (reductions_t, errs_t): these.
17423 Adjust all dependencies.
17424
174252002-06-30 Akim Demaille <akim@epita.fr>
17426
17427 * src/LR0.c (state_list_t, state_list_append): New.
17428 (first_state, last_state): Now symbol_list_t.
17429 (this_state): Remove.
17430 (new_itemsets, append_states, save_reductions): Take a state_t as
17431 argument.
17432 (set_states, generate_states): Adjust.
17433 (save_shifts): Remove, replaced by...
17434 * src/state.h, src/state.c (state_shifts_set): New.
17435 (shifts): Rename as...
17436 (shifts_t): this.
17437 Adjust all dependencies.
17438 * src/state.h (state_t): Remove the `next' member.
17439
174402002-06-30 Akim Demaille <akim@epita.fr>
17441
17442 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
17443 escaped in slot 0.
17444
174452002-06-30 Akim Demaille <akim@epita.fr>
17446
17447 Use hash.h for the state hash table.
17448
17449 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
17450 (allocate_storage): Use state_hash_new.
17451 (free_storage): Use state_hash_free.
17452 (new_state, get_state): Adjust.
17453 * src/lalr.h, src/lalr.c (states): Move to...
17454 * src/states.h (state_t): Remove the `link' member, no longer
17455 used.
17456 * src/states.h, src/states.c: here.
17457 (state_hash_new, state_hash_free, state_hash_lookup)
17458 (state_hash_insert, states_free): New.
17459 * src/states.c (state_table, state_compare, state_hash): New.
17460 * src/output.c (output_actions): Do not free states now, since we
17461 still need to know the final_state number in `prepare', called
17462 afterwards. Do it...
17463 * src/main.c (main): here: call states_free after `output'.
17464
174652002-06-30 Akim Demaille <akim@epita.fr>
17466
17467 * src/state.h, src/state.c (state_new): New, extracted from...
17468 * src/LR0.c (new_state): here.
17469 * src/state.h (STATE_ALLOC): Move to...
17470 * src/state.c: here.
17471 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
17472 * src/state.h, src/state.c: here.
17473
174742002-06-30 Akim Demaille <akim@epita.fr>
17475
17476 * src/reader.c (gensym): Rename as...
17477 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
17478 (getsym): Rename as...
17479 (symbol_get): this.
17480
174812002-06-30 Akim Demaille <akim@epita.fr>
17482
17483 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
17484 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
17485 * src/output.c, src/print.c, src/print_graph.c: Propagate.
17486 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
17487
174882002-06-30 Akim Demaille <akim@epita.fr>
17489
17490 Make the test suite pass with warnings checked.
17491
17492 * tests/actions.at (Printers and Destructors): Improve.
17493 Avoid unsigned vs. signed issues.
17494 * tests/calc.at: Don't exercise the scanner here, do it...
17495 * tests/input.at (Torturing the Scanner): here.
17496
174972002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17498
17499 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
17500 reorganize first lines parallel to yacc.c.
17501
175022002-06-28 Akim Demaille <akim@epita.fr>
17503
17504 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
17505 (b4_token_enum, b4_token_defines): New, factored from...
17506 * data/lalr1.cc, data/yacc.c, glr.c: here.
17507
175082002-06-28 Akim Demaille <akim@epita.fr>
17509
17510 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
17511 unused variables.
17512 * src/output.c (merger_output): static.
17513
175142002-06-28 Akim Demaille <akim@epita.fr>
17515
17516 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
17517 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
17518 pacify GCC.
17519 * src/output.c (save_row): Initialize all the variables to pacify GCC.
17520
175212002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17522
17523 Accumulated changelog for new GLR parsing features.
17524
17525 * src/conflicts.c (count_total_conflicts): Change name to
17526 conflicts_total_count.
17527 * src/conflicts.h: Ditto.
17528 * src/output.c (token_actions): Use the new name.
17529 (output_conflicts): Change conflp => conflict_list_heads, and
17530 confl => conflict_list for better readability.
17531 * data/glr.c: Use the new names.
17532 * NEWS: Add self to GLR announcement.
17533
17534 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
17535
17536 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
17537 Akim Demaille.
17538
17539 * data/bison.glr: Change name to glr.c
17540 * data/glr.c: Renamed from bison.glr.
17541 * data/Makefile.am: Add glr.c
17542
17543 * src/getargs.c:
17544
17545 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
17546 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
17547
17548 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17549
17550 * data/bison.glr: Be sure to restore the
17551 current #line when returning to the skeleton contents after having
17552 exposed the input file's #line.
17553
17554 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17555
17556 * data/bison.glr: Bring up to date with changes to bison.simple.
17557
17558 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17559
17560 * data/bison.glr: Correct definitions that use b4_prefix.
17561 Various reformatting.
17562 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
17563 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
17564 yytokenp argument; now part of stack.
17565 (yychar): Define to behave as documented.
17566 (yyclearin): Ditto.
17567
17568 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17569
17570 * src/reader.h: Add declaration for free_merger_functions.
17571
17572 * src/reader.c (merge_functions): New variable.
17573 (get_merge_function): New function.
17574 (free_merger_functions): New function.
17575 (readgram): Check for %prec that is not followed by a symbol.
17576 Handle %dprec and %merge declarations.
17577 (packgram): Initialize dprec and merger fields in rules array.
17578
17579 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
17580 conflict_list_cnt, conflict_list_free): New variables.
17581 (table_grow): Also grow conflict_table.
17582 (prepare_rules): Output dprec and merger tables.
17583 (conflict_row): New function.
17584 (action_row): Output conflict lists for GLR parser. Don't use
17585 default reduction in conflicted states for GLR parser so that there
17586 are spaces for the conflict lists.
17587 (save_row): Also save conflict information.
17588 (token_actions): Allocate conflict list.
17589 (merger_output): New function.
17590 (pack_vector): Pack conflict table, too.
17591 (output_conflicts): New function to output yyconflp and yyconfl.
17592 (output_check): Allocate conflict_tos.
17593 (output_actions): Output conflict tables, also.
17594 (output_skeleton): Output b4_mergers definition.
17595 (prepare): Output b4_max_rhs_length definition.
17596 Use 'bison.glr' as default skeleton for GLR parsers.
17597
17598 * src/gram.c (glr_parser): New flag.
17599 (grammar_free): Call free_merger_functions.
17600
17601 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
17602 all pairs of conflicting reductions, rather than just all tokens
17603 causing conflicts. Needed to size conflict tables.
17604 (conflicts_output): Modify call to count_rr_conflicts for new
17605 interface.
17606 (conflicts_print): Ditto.
17607 (count_total_conflicts): New function.
17608
17609 * src/reader.h (merger_list): New type.
17610 (merge_functions): New variable.
17611
17612 * src/lex.h (tok_dprec, tok_merge): New token types.
17613
17614 * src/gram.h (rule_s): Add dprec and merger fields.
17615 (glr_parser): New flag.
17616
17617 * src/conflicts.h (count_total_conflicts): New function.
17618
17619 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
17620
17621 * doc/bison.texinfo (Generalized LR Parsing): New section.
17622 (GLR Parsers): New section.
17623 (Language and Grammar): Mention GLR parsing.
17624 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
17625 Correct typo ("tge" -> "the").
17626
17627 * data/bison.glr: New skeleton for GLR parsing.
17628
17629 * tests/cxx-gram.at: New tests for GLR parsing.
17630
17631 * tests/testsuite.at: Include cxx-gram.at.
17632
17633 * tests/Makefile.am: Add cxx-gram.at.
17634
17635 * src/parse-gram.y:
17636
17637 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
17638
17639 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
17640
176412002-06-27 Akim Demaille <akim@epita.fr>
17642
17643 * src/options.h, src/options.c: Remove.
17644 * src/getargs.c (short_options, long_options): New.
17645
176462002-06-27 Akim Demaille <akim@epita.fr>
17647
17648 * data/bison.simple, data/bison.c++: Rename as...
17649 * data/yacc.c, data/lalr1.cc: these.
17650 * doc/bison.texinfo (Environment Variables): Remove.
17651
176522002-06-25 Raja R Harinath <harinath@cs.umn.edu>
17653
17654 * src/getargs.c (report_argmatch): Initialize strtok().
17655
176562002-06-20 Akim Demaille <akim@epita.fr>
17657
17658 * data/bison.simple (b4_symbol_actions): New, replaces...
17659 (b4_symbol_destructor, b4_symbol_printer): these.
17660 (yysymprint): Be sure to call YYPRINT only for tokens, and using
17661 user token numbers.
17662
176632002-06-20 Akim Demaille <akim@epita.fr>
17664
17665 * data/bison.simple (yydestructor): Rename as...
17666 (yydestruct): this.
17667
176682002-06-20 Akim Demaille <akim@epita.fr>
17669
17670 * src/symtab.h, src/symtab.c (symbol_type_set)
17671 (symbol_destructor_set, symbol_precedence_set): The location is
17672 the last argument.
17673 Adjust all callers.
17674
176752002-06-20 Akim Demaille <akim@epita.fr>
17676
17677 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
17678 internals.
17679 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
17680 Takes a location.
17681 * src/symtab.h, src/symtab.c (symbol_class_set)
17682 (symbol_user_token_number_set): Likewise.
17683 Adjust all callers.
17684 Promote complain_at.
17685 * tests/input.at (Type Clashes): Adjust.
17686
176872002-06-20 Akim Demaille <akim@epita.fr>
17688
17689 * data/bison.simple (YYLEX): Fix the declaration when
17690 %pure-parser.
17691
176922002-06-20 Akim Demaille <akim@epita.fr>
17693
17694 * data/bison.simple (yysymprint): Don't print the token number,
17695 just its name.
17696 * tests/actions.at (Destructors): Rename as...
17697 (Printers and Destructors): this.
17698 Also exercise %printer.
17699
177002002-06-20 Akim Demaille <akim@epita.fr>
17701
17702 * data/bison.simple (YYDSYMPRINT): New.
17703 Use it to remove many of the #if YYDEBUG/if (yydebug).
17704
177052002-06-20 Akim Demaille <akim@epita.fr>
17706
17707 * src/symtab.h, src/symtab.c (symbol_t): printer and
17708 printer_location are new members.
17709 (symbol_printer_set): New.
17710 * src/parse-gram.y (PERCENT_PRINTER): New token.
17711 Handle its associated rule.
17712 * src/scan-gram.l: Adjust.
17713 (handle_destructor_at, handle_destructor_dollar): Rename as...
17714 (handle_symbol_code_at, handle_symbol_code_dollar): these.
17715 * src/output.c (symbol_printers_output): New.
17716 (output_skeleton): Call it.
17717 * data/bison.simple (yysymprint): New. Cannot be named yyprint
17718 since there are already many grammar files with a user `yyprint'.
17719 Replace the calls to YYPRINT to calls to yysymprint.
17720 * tests/calc.at: Adjust.
17721 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
17722 taking advantage of parser very internal details (stack size!).
17723
177242002-06-20 Akim Demaille <akim@epita.fr>
17725
17726 * src/scan-gram.l: Complete the scanner with the missing patterns
17727 to pacify Flex.
17728 Use `quote' and `symbol_tag_get' where appropriate.
17729
177302002-06-19 Akim Demaille <akim@epita.fr>
17731
17732 * tests/actions.at (Destructors): Augment to test locations.
17733 * data/bison.simple (yydestructor): Pass it the current location
17734 if locations are enabled.
17735 Prototype only when __STDC__ or C++.
17736 Change the argument names to move into the yy name space: there is
17737 user code here.
17738
177392002-06-19 Akim Demaille <akim@epita.fr>
17740
17741 * data/bison.simple (b4_pure_if): New.
17742 Use it instead of #ifdef YYPURE.
17743
177442002-06-19 Akim Demaille <akim@epita.fr>
17745
17746 * data/bison.simple (b4_location_if): New.
17747 Use it instead of #ifdef YYLSP_NEEDED.
17748
177492002-06-19 Akim Demaille <akim@epita.fr>
17750
17751 Prepare @$ in %destructor, but currently don't bind it in the
17752 skeleton, as %location use is not cleaned up yet.
17753
17754 * src/scan-gram.l (handle_dollar, handle_destructor_at)
17755 (handle_action_at): New.
17756 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
17757 a braced_code_t and a location as additional arguments.
17758 (handle_destructor_dollar): Instead of requiring `b4_eval', just
17759 unquote one when outputting `b4_dollar_dollar'.
17760 Adjust callers.
17761 * data/bison.simple (b4_eval): Remove.
17762 (b4_symbol_destructor): Adjust.
17763 * tests/input.at (Invalid @n): Adjust.
17764
177652002-06-19 Zack Weinberg <zack@codesourcery.com>
17766
17767 * doc/bison.texinfo: Document ability to have multiple
17768 prologue sections.
17769
177702002-06-18 Akim Demaille <akim@epita.fr>
17771
17772 * src/files.c (compute_base_names): When computing the output file
17773 names from the input file name, strip the directory part.
17774
177752002-06-18 Akim Demaille <akim@epita.fr>
17776
17777 * data/bison.simple.new: Comment changes.
17778 Reported by Andreas Schwab.
17779
177802002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
17781
17782 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
17783 there are no `label `yyoverflowlab' defined but not used' warnings
17784 when yyoverflow is defined.
17785
177862002-06-18 Akim Demaille <akim@epita.fr>
17787
17788 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
17789 new member.
17790 (symbol_destructor_set): Adjust.
17791 * src/output.c (symbol_destructors_output): Output the destructor
17792 locations.
17793 Output the symbol name.
17794 * data/bison.simple (b4_symbol_destructor): Adjust.
17795
177962002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
17797 and Akim Demaille <akim@epita.fr>
17798
17799 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
17800 what's left on the stack when the error recovery hits EOF.
17801 * tests/actions.at (Destructors): Complete to exercise this case.
17802
178032002-06-17 Akim Demaille <akim@epita.fr>
17804
17805 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
17806 arguments is really empty, not only equal to `[]'.
17807 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
17808 member.
17809 (symbol_destructor_set): New.
17810 * src/output.c (symbol_destructors_output): New.
17811 * src/reader.h (brace_code_t, current_braced_code): New.
17812 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
17813 (handle_dollar): Rename as...
17814 (handle_action_dollar): this.
17815 (handle_destructor_dollar): New.
17816 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
17817 (grammar_declaration): Use it.
17818 * data/bison.simple (yystos): Is always defined.
17819 (yydestructor): New.
17820 * tests/actions.at (Destructors): New.
17821 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
17822
178232002-06-17 Akim Demaille <akim@epita.fr>
17824
17825 * src/symlist.h, src/symlist.c (symbol_list_length): New.
17826 * src/scan-gram.l (handle_dollar, handle_at): Compute the
17827 rule_length only when needed.
17828 * src/output.c (actions_output, token_definitions_output): Output
17829 the full M4 block.
17830 * src/symtab.c: Don't access directly to the symbol tag, use
17831 symbol_tag_get.
17832 * src/parse-gram.y: Use symbol_list_free.
17833
178342002-06-17 Akim Demaille <akim@epita.fr>
17835
17836 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
17837 (symbol_list_prepend, get_type_name): Move to...
17838 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
17839 (symbol_list_prepend, symbol_list_n_type_name_get): here.
17840 Adjust all callers.
17841 (symbol_list_free): New.
17842 * src/scan-gram.l (handle_dollar): Takes a location.
17843 * tests/input.at (Invalid $n): Adjust.
17844
178452002-06-17 Akim Demaille <akim@epita.fr>
17846
17847 * src/reader.h, src/reader.c (symbol_list_new): Export it.
17848 (symbol_list_prepend): New.
17849 * src/parse-gram.y (%union): `list' is a new member.
17850 (symbols.1): New, replaces...
17851 (terms_to_prec.1, nterms_to_type.1): these.
17852 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
17853 Take a location as additional argument.
17854 Adjust all callers.
17855
178562002-06-15 Akim Demaille <akim@epita.fr>
17857
17858 * src/parse-gram.y: Move %token in the declaration section so that
17859 we don't depend upon CVS Bison.
17860
178612002-06-15 Akim Demaille <akim@epita.fr>
17862
17863 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
17864 * src/print.c (print_core): Use it.
17865
178662002-06-15 Akim Demaille <akim@epita.fr>
17867
17868 * src/conflicts.c (log_resolution): Accept the rule involved in
17869 the sr conflicts instead of the lookahead number that points to
17870 that rule.
17871 (flush_reduce): Accept the current lookahead vector as argument,
17872 instead of the index in LA.
17873 (resolve_sr_conflict): Accept the current number of lookahead
17874 bitset to consider for the STATE, instead of the index in LA.
17875 (set_conflicts): Adjust.
17876 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
17877
178782002-06-15 Akim Demaille <akim@epita.fr>
17879
17880 * src/state.h (state_t): Replace the `lookaheadsp' member, a
17881 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
17882 Adjust all dependencies.
17883 * src/lalr.c (initialize_lookaheads): Split into...
17884 (states_lookaheads_count, states_lookaheads_initialize): these.
17885 (lalr): Adjust.
17886
178872002-06-15 Akim Demaille <akim@epita.fr>
17888
17889 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
17890 out of...
17891 (grammar_rules_print): here.
17892 * src/reduce.c (reduce_output): Use it.
17893 * tests/reduce.at (Useless Rules, Reduced Automaton)
17894 (Underivable Rules): Adjust.
17895
178962002-06-15 Akim Demaille <akim@epita.fr>
17897
17898 Copy BYacc's nice way to report the grammar.
17899
17900 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
17901 New.
17902 Don't print the rules' location, it is confusing and useless.
17903 (rule_print): Use grammar_rhs_print.
17904 * src/print.c (print_grammar): Use grammar_rules_print.
17905
179062002-06-15 Akim Demaille <akim@epita.fr>
17907
17908 Complete and rationalize `useless thing' warnings.
17909
17910 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
17911 (symbol_tag_print): New.
17912 Use them everywhere in place of accessing directly the tag member.
17913 * src/gram.h, src/gram.c (rule_print): New.
17914 Use it where a rule used to be printed `by hand'.
17915 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
17916 (reduce_grammar_tables): Report the useless rules.
17917 (reduce_print): Useless things are a warning, not an error.
17918 Report it as such.
17919 * tests/reduce.at (Useless Nonterminals, Useless Rules):
17920 (Reduced Automaton, Underivable Rules): Adjust.
17921 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
17922 * tests/conflicts.at (Unresolved SR Conflicts)
17923 (Solved SR Conflicts): Adjust.
17924
179252002-06-15 Akim Demaille <akim@epita.fr>
17926
17927 Let symbols have a location.
17928
17929 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
17930 (getsym): Adjust.
17931 Adjust all callers.
17932 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
17933 Use location_t, not int.
17934 * src/symtab.c (symbol_check_defined): Take advantage of the
17935 location.
17936 * tests/regression.at (Invalid inputs): Adjust.
17937
179382002-06-15 Akim Demaille <akim@epita.fr>
17939
17940 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
17941 (input): Don't try to initialize yylloc here, do it in the
17942 scanner.
17943 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
17944 * src/gram.h (rule_t): Change line and action_line into location
17945 and action_location, of location_t type.
17946 Adjust all dependencies.
17947 * src/location.h, src/location.c (empty_location): New.
17948 * src/reader.h, src/reader.c (grammar_start_symbol_set)
17949 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
17950 (grammar_current_rule_symbol_append)
17951 (grammar_current_rule_action_append): Expect a location as argument.
17952 * src/reader.c (grammar_midrule_action): Adjust to attach an
17953 action's location as dummy symbol location.
17954 * src/symtab.h, src/symtab.c (startsymbol_location): New.
17955 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
17956 the line numbers.
17957
179582002-06-14 Akim Demaille <akim@epita.fr>
17959
17960 Grammar declarations may be found in the grammar section.
17961
17962 * src/parse-gram.y (rules_or_grammar_declaration): New.
17963 (declarations): Each declaration may end with a semicolon, not
17964 just...
17965 (grammar_declaration): `"%union"'.
17966 (grammar): Branch to rules_or_grammar_declaration.
17967
179682002-06-14 Akim Demaille <akim@epita.fr>
17969
17970 * src/main.c (main): Invoke scanner_free.
17971
179722002-06-14 Akim Demaille <akim@epita.fr>
17973
17974 * src/output.c (m4_invoke): Extracted from...
17975 (output_skeleton): here.
17976 Free tempfile.
17977
179782002-06-14 Akim Demaille <akim@epita.fr>
17979
17980 * src/parse-gram.y (directives, directive, gram)
17981 (grammar_directives, precedence_directives, precedence_directive):
17982 Rename as...
17983 (declarations, declaration, grammar, grammar_declaration)
17984 (precedence_declaration, precedence_declarator): these.
17985 (symbol_declaration): New.
17986
179872002-06-14 Akim Demaille <akim@epita.fr>
17988
17989 * src/files.c (action_obstack): Remove, unused.
17990 (output_obstack): Remove it, and all its dependencies, as it is no
17991 longer needed.
17992 * src/reader.c (epilogue_set): Build the epilogue in the
17993 muscle_obstack.
17994 * src/output.h, src/output.c (muscle_obstack): Move to...
17995 * src/muscle_tab.h, src/muscle_tab.h: here.
17996 (muscle_init): Initialize muscle_obstack.
17997 (muscle_free): New.
17998 * src/main.c (main): Call it.
17999
180002002-06-14 Akim Demaille <akim@epita.fr>
18001
18002 * src/location.h: New, extracted from...
18003 * src/reader.h: here.
18004 * src/Makefile.am (noinst_HEADERS): Merge into
18005 (bison_SOURCES): this.
18006 Add location.h.
18007 * src/parse-gram.y: Use location_t instead of Bison's.
18008 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
18009 Use location_t instead of ints.
18010
180112002-06-14 Akim Demaille <akim@epita.fr>
18012
18013 * data/bison.simple, data/bison.c++: Be sure to restore the
18014 current #line when returning to the skeleton contents after having
18015 exposed the input file's #line.
18016
180172002-06-12 Akim Demaille <akim@epita.fr>
18018
18019 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
18020 eager.
18021 * tests/actions.at (Exotic Dollars): New.
18022
180232002-06-12 Akim Demaille <akim@epita.fr>
18024
18025 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
18026 ['"/] too eagerly.
18027 * tests/input.at (Torturing the Scanner): New.
18028
180292002-06-11 Akim Demaille <akim@epita.fr>
18030
18031 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
18032 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
18033 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
18034 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
18035 * src/reader.c (reader): Use it.
18036
180372002-06-11 Akim Demaille <akim@epita.fr>
18038
18039 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
18040 Adjust all callers.
18041 (scanner_last_string_free): New.
18042
180432002-06-11 Akim Demaille <akim@epita.fr>
18044
18045 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
18046 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
18047 (last_string, YY_OBS_FREE): New.
18048 Use them when returning an ID.
18049
180502002-06-11 Akim Demaille <akim@epita.fr>
18051
18052 Have Bison grammars parsed by a Bison grammar.
18053
18054 * src/reader.c, src/reader.h (prologue_augment): New.
18055 * src/reader.c (copy_definition): Remove.
18056
18057 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
18058 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
18059 (grammar_current_rule_prec_set, grammar_current_rule_check)
18060 (grammar_current_rule_symbol_append)
18061 (grammar_current_rule_action_append): Export.
18062 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
18063 (symbol_list_action_append): Remove.
18064 Hook the routines from reader.
18065 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
18066 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
18067
18068 * src/reader.c (read_declarations): Remove, unused.
18069
18070 * src/parse-gram.y: Handle the epilogue.
18071 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
18072 (grammar_start_symbol_set): this.
18073 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
18074 * src/reader.c (readgram): Remove, unused.
18075 (reader): Adjust to insert eoftoken and axiom where appropriate.
18076
18077 * src/reader.c (copy_dollar): Replace with...
18078 * src/scan-gram.h (handle_dollar): this.
18079 * src/parse-gram.y: Remove `%thong'.
18080
18081 * src/reader.c (copy_at): Replace with...
18082 * src/scan-gram.h (handle_at): this.
18083
18084 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
18085 New.
18086
18087 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
18088 time being.
18089
18090 * src/reader.h, src/reader.c (grammar_rule_end): New.
18091
18092 * src/parse.y (current_type, current_class): New.
18093 Implement `%nterm', `%token' support.
18094 Merge `%term' into `%token'.
18095 (string_as_id): New.
18096 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
18097 type name.
18098
18099 * src/parse-gram.y: Be sure to handle properly the beginning of
18100 rules.
18101
18102 * src/parse-gram.y: Handle %type.
18103 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
18104
18105 * src/parse-gram.y: More directives support.
18106 * src/options.c: No longer handle source directives.
18107
18108 * src/parse-gram.y: Fix %output.
18109
18110 * src/parse-gram.y: Handle %union.
18111 Use the prologue locations.
18112 * src/reader.c (parse_union_decl): Remove.
18113
18114 * src/reader.h, src/reader.c (epilogue_set): New.
18115 * src/parse-gram.y: Use it.
18116
18117 * data/bison.simple, data/bison.c++: b4_stype is now either not
18118 defined, then default to int, or to the contents of %union,
18119 without `union' itself.
18120 Adjust.
18121 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
18122
18123 * src/output.c (actions_output): Don't output braces, as they are
18124 already handled by the scanner.
18125
18126 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
18127 characters to themselves.
18128
18129 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
18130 that the epilogue has a proper #line.
18131
18132 * src/parse-gram.y: Handle precedence/associativity.
18133
18134 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
18135 a terminal.
18136 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
18137 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
18138 at all to define terminals that cannot be emitted.
18139
18140 * src/scan-gram.l: Escape M4 characters.
18141
18142 * src/scan-gram.l: Working properly with escapes in user
18143 strings/characters.
18144
18145 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
18146 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
18147 grammar.
18148 Use more modest sizes, as for the time being the parser does not
18149 release memory, and therefore the process swallows a huge amount
18150 of memory.
18151
18152 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
18153 stricter %token grammar.
18154
18155 * src/symtab.h (associativity): Add `undef_assoc'.
18156 (symbol_precedence_set): Do nothing when passed an undef_assoc.
18157 * src/symtab.c (symbol_check_alias_consistence): Adjust.
18158
18159 * tests/regression.at (Invalid %directive): Remove, as it is now
18160 meaningless.
18161 (Invalid inputs): Adjust to the new error messages.
18162 (Token definitions): The new grammar doesn't allow too many
18163 eccentricities.
18164
18165 * src/lex.h, src/lex.c: Remove.
18166 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
18167 (copy_character, copy_string2, copy_string, copy_identifier)
18168 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
18169 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
18170 (parse_action): Remove.
18171 * po/POTFILES.in: Adjust.
18172
181732002-06-11 Akim Demaille <akim@epita.fr>
18174
18175 * src/reader.c (parse_action): Don't store directly into the
18176 rule's action member: return the action as a string.
18177 Don't require `rule_length' as an argument: compute it.
18178 (grammar_current_rule_symbol_append)
18179 (grammar_current_rule_action_append): New, eved out from
18180 (readgram): here.
18181 Remove `action_flag', `rulelength', unused now.
18182
181832002-06-11 Akim Demaille <akim@epita.fr>
18184
18185 * src/reader.c (grammar_current_rule_prec_set).
18186 (grammar_current_rule_check): New, eved out from...
18187 (readgram): here.
18188 Remove `xaction', `first_rhs': useless.
18189 * tests/input.at (Type clashes): New.
18190 * tests/existing.at (GNU Cim Grammar): Adjust.
18191
181922002-06-11 Akim Demaille <akim@epita.fr>
18193
18194 * src/reader.c (grammar_midrule_action): New, Eved out from
18195 (readgram): here.
18196
181972002-06-11 Akim Demaille <akim@epita.fr>
18198
18199 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
18200 New.
18201 (readgram): Use them as replacement of inlined code, crule and
18202 crule1.
18203
182042002-06-11 Akim Demaille <akim@epita.fr>
18205
18206 * src/reader.c (grammar_end, grammar_symbol_append): New.
18207 (readgram): Use them.
18208 Make the use of `p' as local as possible.
18209
182102002-06-10 Akim Demaille <akim@epita.fr>
18211
18212 GCJ's parser requires the tokens to be defined before the prologue.
18213
18214 * data/bison.simple: Output the token definition before the user's
18215 prologue.
18216 * tests/regression.at (Braces parsing, Duplicate string)
18217 (Mixing %token styles): Check the output from bison.
18218 (Early token definitions): New.
18219
182202002-06-10 Akim Demaille <akim@epita.fr>
18221
18222 * src/symtab.c (symbol_user_token_number_set): Don't complain when
18223 assigning twice the same user number to a token, so that we can
18224 use it in...
18225 * src/lex.c (lex): here.
18226 Also use `symbol_class_set' instead of hand written code.
18227 * src/reader.c (parse_assoc_decl): Likewise.
18228
182292002-06-10 Akim Demaille <akim@epita.fr>
18230
18231 * src/symtab.c, src/symtab.c (symbol_class_set)
18232 (symbol_user_token_number_set): New.
18233 * src/reader.c (parse_token_decl): Use them.
18234 Use a switch instead of ifs.
18235 Use a single argument.
18236
182372002-06-10 Akim Demaille <akim@epita.fr>
18238
18239 Remove `%thong' support as it is undocumented, unused, duplicates
18240 `%token's job, and creates useless e-mail traffic with people who
18241 want to know what it is, why it is undocumented, unused, and
18242 duplicates `%token's job.
18243
18244 * src/reader.c (parse_thong_decl): Remove.
18245 * src/options.c (option_table): Remove "thong".
18246 * src/lex.h (tok_thong): Remove.
18247
182482002-06-10 Akim Demaille <akim@epita.fr>
18249
18250 * src/symtab.c, src/symtab.c (symbol_type_set)
18251 (symbol_precedence_set): New.
18252 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
18253 (value_components_used): Remove, unused.
18254
182552002-06-09 Akim Demaille <akim@epita.fr>
18256
18257 Move symbols handling code out of the reader.
18258
18259 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
18260 (axiom): Move to...
18261 * src/symtab.h, src/symtab.c: here.
18262
18263 * src/gram.c (start_symbol): Remove: use startsymbol->number.
18264 * src/reader.c (startval): Rename as...
18265 * src/symtab.h, src/symtab.c (startsymbol): this.
18266 * src/reader.c: Adjust.
18267
18268 * src/reader.c (symbol_check_defined, symbol_make_alias)
18269 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
18270 (token_translations_init)
18271 Move to...
18272 * src/symtab.c: here.
18273 * src/reader.c (packsymbols): Move to...
18274 * src/symtab.h, src/symtab.c (symbols_pack): here.
18275 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
18276 argument.
18277
182782002-06-03 Akim Demaille <akim@epita.fr>
18279
18280 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
18281 then statements.
18282
182832002-06-03 Akim Demaille <akim@epita.fr>
18284
18285 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
18286 structs with non literals.
18287 * src/scan-skel.l: never-interactive.
18288 * src/conflicts.c (enum conflict_resolution_e): No trailing
18289 comma.
18290 * src/getargs.c (usage): Split long literal strings.
18291 Reported by Hans Aberg.
18292
182932002-05-28 Akim Demaille <akim@epita.fr>
18294
18295 * data/bison.c++: Use C++ ostreams.
18296 (cdebug_): New member.
18297
182982002-05-28 Akim Demaille <akim@epita.fr>
18299
18300 * src/output.c (output_skeleton): Be sure to allocate enough room
18301 for `/' _and_ for `\0' in full_skeleton.
18302
183032002-05-28 Akim Demaille <akim@epita.fr>
18304
18305 * data/bison.c++: Catch up with bison.simple:
18306 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18307 and Paul Eggert <eggert@twinsun.com>: `error' handing.
18308 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
18309 and popping traces.
18310
183112002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18312
18313 * src/output.c (output_skeleton): Put an explicit path in front of
18314 the skeleton file name, rather than relying on the -I directory,
18315 to partially alleviate effects of having a skeleton file lying around
18316 in the current directory.
18317
183182002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18319
18320 * src/conflicts.c (log_resolution): Correct typo:
18321 obstack_printf should be obstack_fgrow1.
18322
183232002-05-26 Akim Demaille <akim@epita.fr>
18324
18325 * src/state.h (state_t): `solved_conflicts' is a new member.
18326 * src/LR0.c (new_state): Set it to 0.
18327 * src/conflicts.h, src/conflicts.c (print_conflicts)
18328 (free_conflicts, solve_conflicts): Rename as...
18329 (conflicts_print, conflicts_free, conflicts_solve): these.
18330 Adjust callers.
18331 * src/conflicts.c (enum conflict_resolution_e)
18332 (solved_conflicts_obstack): New, used by...
18333 (log_resolution): this.
18334 Adjust to attach the conflict resolution to each state.
18335 Complete the description with the precedence/associativity
18336 information.
18337 (resolve_sr_conflict): Adjust.
18338 * src/print.c (print_state): Output its solved_conflicts.
18339 * tests/conflicts.at (Unresolved SR Conflicts)
18340 (Solved SR Conflicts): Exercise --report=all.
18341
183422002-05-26 Akim Demaille <akim@epita.fr>
18343
18344 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
18345 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
18346 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
18347 (token_number_t, item_number_as_token_number)
18348 (token_number_as_item_number, muscle_insert_token_number_table):
18349 Rename as...
18350 (symbol_number_t, item_number_as_symbol_number)
18351 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
18352 these, since it is more appropriate.
18353
183542002-05-26 Akim Demaille <akim@epita.fr>
18355
18356 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
18357 `Error:' lines.
18358 * data/bison.simple (yystos) [YYDEBUG]: New.
18359 (yyparse) [YYDEBUG]: Display the symbols which are popped during
18360 error recovery.
18361 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
18362
183632002-05-25 Akim Demaille <akim@epita.fr>
18364
18365 * doc/bison.texinfo (Debugging): Split into...
18366 (Tracing): this new section, its former contents, and...
18367 (Understanding): this new section.
18368 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
18369 by...
18370 (report_flag): this.
18371 Adjust all dependencies.
18372 (report_args, report_types, report_argmatch): New.
18373 (usage, getargs): Report/support -r, --report.
18374 * src/options.h
18375 (struct option_table_struct): Rename as..,
18376 (struct option_table_s): this.
18377 Rename the `set_flag' member to `flag' to match with getopt_long's
18378 struct.
18379 * src/options.c (option_table): Split verbose into an entry for
18380 %verbose, and another for --verbose.
18381 Support --report/-r, so remove -r from the obsolete --raw.
18382 * src/print.c: Attach full item sets and lookaheads reports to
18383 report_flag instead of trace_flag.
18384 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
18385
183862002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18387 and Paul Eggert <eggert@twinsun.com>
18388
18389 * data/bison.simple (yyparse): Correct error handling to conform to
18390 POSIX and yacc. Specifically, after syntax error is discovered,
18391 do not reduce further before shifting the error token.
18392 Clean up the code a bit by removing the labels yyerrdefault,
18393 yyerrhandle, yyerrpop.
18394 * NEWS: Document the above.
18395
183962002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18397
18398 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
18399 type; it isn't always big enough, since it doesn't necessarily
18400 include non-terminals.
18401 (yytranslate): Expand definition of yy_token_number_type, so that
18402 the latter can be removed.
18403 (yy_token_number_type): Remove, only one use.
18404 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
18405 don't use TokenNumberType as element type.
18406
18407 * tests/regression.at: Modify expected output to agree with change
18408 to yyr1 and yytranslate.
18409
184102002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
18411
18412 * src/reader.c (parse_action): Use copy_character instead of
18413 obstack_1grow.
18414
184152002-05-13 Akim Demaille <akim@epita.fr>
18416
18417 * tests/regression.at (Token definitions): Prototype yylex and
18418 yyerror.
18419
184202002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18421
18422 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
18423 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
18424 32-bit arithmetic.
18425 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
18426
184272002-05-07 Akim Demaille <akim@epita.fr>
18428
18429 * tests/synclines.at: Be sure to prototype yylex and yyerror to
18430 avoid GCC warnings.
18431
184322002-05-07 Akim Demaille <akim@epita.fr>
18433
18434 Kill GCC warnings.
18435
18436 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
18437 over the RHS of each rule.
18438 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
18439 * src/state.h (state_t): Member `nitems' is unsigned short.
18440 * src/LR0.c (get_state): Adjust.
18441 * src/reader.c (packgram): Likewise.
18442 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
18443 `Type'.
18444 (muscle_insert_int_table): Remove, unused.
18445 (prepare_rules): Remove `max'.
18446
184472002-05-06 Akim Demaille <akim@epita.fr>
18448
18449 * src/closure.c (print_firsts): Display of the symbol tags.
18450 (bitmatrix_print): Move to...
18451 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
18452 here.
18453 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
18454
184552002-05-06 Akim Demaille <akim@epita.fr>
18456
18457 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
18458 hash_do_for_each.
18459
184602002-05-06 Akim Demaille <akim@epita.fr>
18461
18462 * src/LR0.c (new_state, get_state): Instead of using the global
18463 `kernel_size' and `kernel_base', have two new arguments:
18464 `core_size' and `core'.
18465 Adjust callers.
18466
184672002-05-06 Akim Demaille <akim@epita.fr>
18468
18469 * src/reader.c (packgram): No longer end `ritem' with a 0
18470 sentinel: it is not used.
18471
184722002-05-05 Akim Demaille <akim@epita.fr>
18473
18474 New experimental feature: display the lookaheads in the report and
18475 graph.
18476
18477 * src/print (print_core): When --trace-flag, display the rules
18478 lookaheads.
18479 * src/print_graph.c (print_core): Likewise.
18480 Swap the arguments.
18481 Adjust caller.
18482
184832002-05-05 Akim Demaille <akim@epita.fr>
18484
18485 * tests/torture.at (Many lookaheads): New test.
18486
184872002-05-05 Akim Demaille <akim@epita.fr>
18488
18489 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
18490 (GENERATE_MUSCLE_INSERT_TABLE): this.
18491 (output_int_table, output_unsigned_int_table, output_short_table)
18492 (output_token_number_table, output_item_number_table): Replace with...
18493 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
18494 (muscle_insert_short_table, muscle_insert_token_number_table)
18495 (muscle_insert_item_number_table): these.
18496 Adjust all callers.
18497 (prepare_tokens): Don't free `translations', since...
18498 * src/reader.h, src/reader.c (grammar_free): do it.
18499 Move to...
18500 * src/gram.h, src/gram.c (grammar_free): here.
18501 * data/bison.simple, data/bison.c++: b4_token_number_max is now
18502 b4_translate_max.
18503
185042002-05-05 Akim Demaille <akim@epita.fr>
18505
18506 * src/output.c (output_unsigned_int_table): New.
18507 (prepare_rules): `i' is unsigned.
18508 `prhs', `rline', `r2' are unsigned int.
18509 Rename muscle `rhs_number_max' as `rhs_max'.
18510 Output muscles `prhs_max', `rline_max', and `r2_max'.
18511 Free rline and r1.
18512 * data/bison.simple, data/bison.c++: Adjust to use these muscles
18513 to compute types instead of constant types.
18514 * tests/regression.at (Web2c Actions): Adjust.
18515
185162002-05-04 Akim Demaille <akim@epita.fr>
18517
18518 * src/symtab.h (SALIAS, SUNDEF): Rename as...
18519 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
18520 Adjust dependencies.
18521 * src/output.c (token_definitions_output): Be sure not to output a
18522 `#define 'a'' when fed with `%token 'a' "a"'.
18523 * tests/regression.at (Token definitions): New.
18524
185252002-05-03 Paul Eggert <eggert@twinsun.com>
18526
18527 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
18528 for K&R C.
18529
185302002-05-03 gettextize <bug-gnu-gettext@gnu.org>
18531
18532 * Makefile.am (SUBDIRS): Remove intl.
18533 (EXTRA_DIST): Add config/config.rpath.
18534
185352002-05-03 Akim Demaille <akim@epita.fr>
18536
18537 * data/bison.simple (m4_if): Don't output empty enums.
18538 And actually, output valid enum definitions :(.
18539
185402002-05-03 Akim Demaille <akim@epita.fr>
18541
18542 * configure.bat: Remove, completely obsolete.
18543 * Makefile.am (EXTRA_DIST): Adjust.
18544 Don't distribute config.rpath...
18545 * config/Makefile.am (EXTRA_DIST): Do it.
18546
185472002-05-03 Akim Demaille <akim@epita.fr>
18548
18549 * configure.in (GETTEXT_VERSION): New.
18550 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
18551
185522002-05-03 Akim Demaille <akim@epita.fr>
18553
18554 * data/bison.simple (b4_token_enum): New.
18555 (b4_token_defines): Use it to output tokens both as #define and
18556 enums.
18557 Suggested by Paul Eggert.
18558 * src/output.c (token_definitions_output): Don't output spurious
18559 white spaces.
18560
185612002-05-03 Akim Demaille <akim@epita.fr>
18562
18563 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
18564
185652002-05-02 Robert Anisko <robert@lrde.epita.fr>
18566
18567 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
18568 Update the stack class, give a try to deque as the default container.
18569
185702002-05-02 Akim Demaille <akim@epita.fr>
18571
18572 * data/bison.simple (yyparse): Do not implement @$ = @1.
18573 (YYLLOC_DEFAULT): Adjust to do it.
18574 * doc/bison.texinfo (Location Default Action): Fix.
18575
185762002-05-02 Akim Demaille <akim@epita.fr>
18577
18578 * src/reader.c (parse_braces): Merge into...
18579 (parse_action): this.
18580
185812002-05-02 Akim Demaille <akim@epita.fr>
18582
18583 * configure.in (ALL_LINGUAS): Remove.
18584 * po/LINGUAS, hr.po: New.
18585
185862002-05-02 Akim Demaille <akim@epita.fr>
18587
18588 Remove the so called hairy (semantic) parsers.
18589
18590 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
18591 * src/gram.h, src/gram.c (semantic_parser): Remove.
18592 (rule_t): Remove the guard and guard_line members.
18593 * src/lex.h (token_t): remove tok_guard.
18594 * src/options.c (option_table): Remove %guard and %semantic_parser
18595 support.
18596 * src/output.c, src/output.h (guards_output): Remove.
18597 (prepare): Adjust.
18598 (token_definitions_output): Don't output the `T'
18599 tokens (???).
18600 (output_skeleton): Don't output the guards.
18601 * src/files.c, src/files.c (attrsfile): Remove.
18602 * src/reader.c (symbol_list): Remove the guard and guard_line
18603 members.
18604 Adjust dependencies.
18605 (parse_guard): Remove.
18606 * data/bison.hairy: Remove.
18607 * doc/bison.texinfo (Environment Variables): Remove occurrences of
18608 BISON_HAIRY.
18609
186102002-05-02 Akim Demaille <akim@epita.fr>
18611
18612 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
18613 (parse_guard): Rename the formal argument `stack_offset' as
18614 `rule_length', which is more readable.
18615 Adjust callers.
18616 (copy_at, copy_dollar): Instead of outputting the hard coded
18617 values of $$, $n and so forth, output invocation to b4_lhs_value,
18618 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
18619 Note: this patch partially drops `semantic-parser' support: it
18620 always does `rule_length - n', where semantic parsers ought to
18621 always use `-n'.
18622 * data/bison.simple, data/bison.c++ (b4_lhs_value)
18623 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
18624
186252002-05-02 Akim Demaille <akim@epita.fr>
18626
18627 * configure.in (AC_INIT): Bump to 1.49b.
18628 (AM_INIT_AUTOMAKE): Short invocation.
18629
186302002-05-02 Akim Demaille <akim@epita.fr>
18631
18632 Version 1.49a.
18633
186342002-05-01 Akim Demaille <akim@epita.fr>
18635
18636 * src/skeleton.h: Remove.
18637
186382002-05-01 Akim Demaille <akim@epita.fr>
18639
18640 * src/skeleton.h: Fix the #endif.
18641 Reported by Magnus Fromreide.
18642
186432002-04-26 Paul Eggert <eggert@twinsun.com>
18644
18645 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
18646 Define if we define YYSTYPE and YYLTYPE, respectively.
18647 (YYCOPY): Fix [] quoting problem in the non-GCC case.
18648
186492002-04-25 Robert Anisko <robert@lrde.epita.fr>
18650
18651 * src/scan-skel.l: Postprocess quadrigraphs.
18652
18653 * src/reader.c (copy_character): New function, used to output
18654 single characters while replacing `[' and `]' with quadrigraphs, to
18655 avoid troubles with M4 quotes.
18656 (copy_comment): Output characters with copy_character.
18657 (read_additionnal_code): Likewise.
18658 (copy_string2): Likewise.
18659 (copy_definition): Likewise.
18660
18661 * tests/calc.at: Exercise M4 quoting.
18662
186632002-04-25 Akim Demaille <akim@epita.fr>
18664
18665 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
18666 between `!' and the command.
18667 Reported by Paul Eggert.
18668
186692002-04-24 Robert Anisko <robert@lrde.epita.fr>
18670
18671 * tests/calc.at: Exercise prologue splitting.
18672
18673 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
18674 `b4_post_prologue' instead of `b4_prologue'.
18675
18676 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
18677 muscles.
18678 (output): Free pre_prologue_obstack and post_prologue_obstack.
18679 * src/files.h, src/files.c (attrs_obstack): Remove.
18680 (pre_prologue_obstack, post_prologue_obstack): New.
18681 * src/reader.c (copy_definition): Add a parameter to specify the
18682 obstack to fill, instead of using attrs_obstack unconditionally.
18683 (read_declarations): Pass pre_prologue_obstack to copy_definition if
18684 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
18685
186862002-04-23 Paul Eggert <eggert@twinsun.com>
18687
18688 * data/bison.simple: Remove unnecessary commentary and white
18689 space differences from 1_29-branch.
18690 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
18691
18692 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
18693 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
18694 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
18695 constructors or destructors.
18696
18697 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
18698
186992002-04-23 Akim Demaille <akim@epita.fr>
18700
18701 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
18702 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
18703 location with columns.
18704 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
18705 All reported by Paul Eggert.
18706
187072002-04-22 Akim Demaille <akim@epita.fr>
18708
18709 * src/reduce.c (dump_grammar): Move to...
18710 * src/gram.h, src/gram.c (grammar_dump): here.
18711 Be sure to separate long item numbers.
18712 Don't read the members of a rule's prec if its nil.
18713
187142002-04-22 Akim Demaille <akim@epita.fr>
18715
18716 * src/output.c (table_size, table_grow): New.
18717 (MAXTABLE): Remove, replace uses with table_size.
18718 (pack_vector): Instead of dying when the table is too big, grow it.
18719
187202002-04-22 Akim Demaille <akim@epita.fr>
18721
18722 * data/bison.simple (yyr1): Its type is that of a token number.
18723 * data/bison.c++ (r1_): Likewise.
18724 * tests/regression.at (Web2c Actions): Adjust.
18725
187262002-04-22 Akim Demaille <akim@epita.fr>
18727
18728 * src/reader.c (token_translations_init): 256 is now the default
18729 value for the error token, i.e., it will be assigned another
18730 number if the user assigned 256 to one of her tokens.
18731 (reader): Don't force 256 to error.
18732 * doc/bison.texinfo (Symbols): Adjust.
18733 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
18734 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
18735 etc. instead of 10, 20, 30 (which was used to `jump' over error
18736 (256) and undefined (2)).
18737
187382002-04-22 Akim Demaille <akim@epita.fr>
18739
18740 Propagate more token_number_t.
18741
18742 * src/gram.h (token_number_as_item_number)
18743 (item_number_as_token_number): New.
18744 * src/output.c (GENERATE_OUTPUT_TABLE): New.
18745 Use it to create output_item_number_table and
18746 output_token_number_table.
18747 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
18748 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
18749 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
18750 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
18751
187522002-04-22 Akim Demaille <akim@epita.fr>
18753
18754 * src/output.h, src/output.c (get_lines_number): Remove.
18755
187562002-04-19 Akim Demaille <akim@epita.fr>
18757
18758 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
18759 as Lex/Flex'.
18760 (Debugging): More details about enabling the debugging features.
18761 (Table of Symbols): Describe $$, $n, @$, and @n.
18762 Suggested by Tim Josling.
18763
187642002-04-19 Akim Demaille <akim@epita.fr>
18765
18766 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
18767
187682002-04-10 Akim Demaille <akim@epita.fr>
18769
18770 * src/system.h: Rely on HAVE_LIMITS_H.
18771 Suggested by Paul Eggert.
18772
187732002-04-09 Akim Demaille <akim@epita.fr>
18774
18775 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
18776 full stderr, and strip it according to the bison options, instead
18777 of composing the error message from different bits.
18778 This makes it easier to check for several error messages.
18779 Adjust all the invocations.
18780 Add an invocation exercising the error token.
18781 Add an invocation demonstrating a stupid error message.
18782 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
18783 Adjust the tests.
18784 Error message are for stderr, not stdout.
18785
187862002-04-09 Akim Demaille <akim@epita.fr>
18787
18788 * src/gram.h, src/gram.c (error_token_number): Remove, use
18789 errtoken->number.
18790 * src/reader.c (reader): Don't specify the user token number (2)
18791 for $undefined, as it uselessly prevents using it.
18792 * src/gram.h (token_number_t): Move to...
18793 * src/symtab.h: here.
18794 (state_t.number): Is a token_number_t.
18795 * src/print.c, src/reader.c: Use undeftoken->number instead of
18796 hard coded 2.
18797 (Even though this 2 is not the same as above: the number of the
18798 undeftoken remains being 2, it is its user token number which
18799 might not be 2).
18800 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
18801 `user_token_number_max'.
18802 Output `undef_token_number'.
18803 * data/bison.simple, data/bison.c++: Use them.
18804 Be sure to map invalid yylex return values to
18805 `undef_token_number'. This saves us from gratuitous SEGV.
18806
18807 * tests/conflicts.at (Solved SR Conflicts)
18808 (Unresolved SR Conflicts): Adjust.
18809 * tests/regression.at (Web2c Actions): Adjust.
18810
188112002-04-08 Akim Demaille <akim@epita.fr>
18812
18813 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
18814 Adding #line.
18815 Remove the duplicate `typedefs'.
18816 (RhsNumberType): Fix the declaration and various other typos.
18817 Use __ofile__.
18818 * data/bison.simple: Use __ofile__.
18819 * src/scan-skel.l: Handle __ofile__.
18820
188212002-04-08 Akim Demaille <akim@epita.fr>
18822
18823 * src/gram.h (item_number_t): New, the type of item numbers in
18824 RITEM. Note that it must be able to code symbol numbers as
18825 positive number, and the negation of rule numbers as negative
18826 numbers.
18827 Adjust all dependencies (pretty many).
18828 * src/reduce.c (rule): Remove this `short *' pointer: use
18829 item_number_t.
18830 * src/system.h (MINSHORT, MAXSHORT): Remove.
18831 Include `limits.h'.
18832 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
18833 (shortcpy): Remove.
18834 (MAXTABLE): Move to...
18835 * src/output.c (MAXTABLE): here.
18836 (prepare_rules): Use output_int_table to output rhs.
18837 * data/bison.simple, data/bison.c++: Adjust.
18838 * tests/torture.at (Big triangle): Move the limit from 254 to
18839 500.
18840 * tests/regression.at (Web2c Actions): Ajust.
18841
18842 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
18843 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
18844 passes, but produces negative #line number, once fixed, GCC is
18845 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
18846 C), it passes.
18847 * src/state.h (state_h): Code input lines on ints, not shorts.
18848
188492002-04-08 Akim Demaille <akim@epita.fr>
18850
18851 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
18852 and then the grammar.
18853
188542002-04-08 Akim Demaille <akim@epita.fr>
18855
18856 * src/system.h: No longer using strndup.
18857
188582002-04-07 Akim Demaille <akim@epita.fr>
18859
18860 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
18861 * src/output.c (output_table_data): Return the longest number.
18862 (prepare_tokens): Output `token_number_max').
18863 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
18864 New.
18865 Use them to define yy_token_number_type/TokenNumberType.
18866 Use this type for yytranslate.
18867 * tests/torture.at (Big triangle): Push the limit from 124 to
18868 253.
18869 * tests/regression.at (Web2c Actions): Adjust.
18870
188712002-04-07 Akim Demaille <akim@epita.fr>
18872
18873 * tests/torture.at (Big triangle): New.
18874 (GNU AWK Grammar, GNU Cim Grammar): Move to...
18875 * tests/existing.at: here.
18876
188772002-04-07 Akim Demaille <akim@epita.fr>
18878
18879 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
18880 nritems.
18881 Adjust dependencies.
18882
188832002-04-07 Akim Demaille <akim@epita.fr>
18884
18885 * src/reader.c: Normalize increments to prefix form.
18886
188872002-04-07 Akim Demaille <akim@epita.fr>
18888
18889 * src/reader.c, symtab.c: Remove debugging code.
18890
188912002-04-07 Akim Demaille <akim@epita.fr>
18892
18893 Rename all the `bucket's as `symbol_t'.
18894
18895 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
18896 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
18897 * src/symtab.c, src/symtab.h (bucket): Rename as...
18898 (symbol_t): this.
18899 (symbol_list_new, bucket_check_defined, bucket_make_alias)
18900 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
18901 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
18902 (buckets_new, buckets_free, buckets_do): Rename as...
18903 (symbol_list_new, symbol_check_defined, symbol_make_alias)
18904 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
18905 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
18906 (symbols_new, symbols_free, symbols_do): these.
18907
189082002-04-07 Akim Demaille <akim@epita.fr>
18909
18910 Use lib/hash for the symbol table.
18911
18912 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
18913 EOF.
18914 * src/lex.c (lex): Set the `number' member of new terminals.
18915 * src/reader.c (bucket_check_defined, bucket_make_alias)
18916 (bucket_check_alias_consistence, bucket_translation): New.
18917 (reader, grammar_free, readgram, token_translations_init)
18918 (packsymbols): Adjust.
18919 (reader): Number the predefined tokens.
18920 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
18921 for predefined tokens.
18922 * src/symtab.h (bucket): Remove all the hash table related
18923 members.
18924 * src/symtab.c (symtab): Replace by...
18925 (bucket_table): this.
18926 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
18927 (buckets_new, buckets_do): New.
18928
189292002-04-07 Akim Demaille <akim@epita.fr>
18930
18931 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
18932 (start_symbol, max_user_token_number, semantic_parser)
18933 (error_token_number): Initialize.
18934 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
18935 Initialize.
18936 (reader): Don't.
18937 (errtoken, eoftoken, undeftoken, axiom): Extern.
18938
189392002-04-07 Akim Demaille <akim@epita.fr>
18940
18941 * src/gram.h (rule_s): prec and precsym are now pointers
18942 to the bucket giving the priority/associativity.
18943 Member `associativity' removed: useless.
18944 * src/reduce.c, src/conflicts.c: Adjust.
18945
189462002-04-07 Akim Demaille <akim@epita.fr>
18947
18948 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
18949 Properly escape the symbols' TAG when outputting them.
18950
189512002-04-07 Akim Demaille <akim@epita.fr>
18952
18953 * src/lalr.h (LA): Is a bitsetv, not bitset*.
18954
189552002-04-07 Akim Demaille <akim@epita.fr>
18956
18957 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
18958 (LArule): this, which is an array to rule_t*.
18959 * src/print.c, src/conflicts.c: Adjust.
18960
189612002-04-07 Akim Demaille <akim@epita.fr>
18962
18963 * src/gram.h (rule_t): Rename `number' as `user_number'.
18964 `number' is a new member.
18965 Adjust dependencies.
18966 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
18967
189682002-04-07 Akim Demaille <akim@epita.fr>
18969
18970 As a result of the previous patch, it is no longer needed
18971 to reorder ritem itself.
18972
18973 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
18974
189752002-04-07 Akim Demaille <akim@epita.fr>
18976
18977 Be sure never to walk through RITEMS, but use only data related to
18978 the rules themselves. RITEMS should be banished.
18979
18980 * src/output.c (output_token_translations): Rename as...
18981 (prepare_tokens): this.
18982 In addition to `translate', prepare the muscles `tname' and
18983 `toknum', which were handled by...
18984 (output_rule_data): this.
18985 Remove, and move the remainder of its outputs into...
18986 (prepare_rules): this new routines, which also merges content from
18987 (output_gram): this.
18988 (prepare_rules): Be sure never to walk through RITEMS.
18989 (output_stos): Rename as...
18990 (prepare_stos): this.
18991 (output): Always invoke prepare_states, after all, just don't use it
18992 in the output if you don't need it.
18993
189942002-04-07 Akim Demaille <akim@epita.fr>
18995
18996 * src/LR0.c (new_state): Display `nstates' as the name of the
18997 newly created state.
18998 Adjust to initialize first_state and last_state if needed.
18999 Be sure to distinguish the initial from the final state.
19000 (new_states): Create the itemset of the initial state, and use
19001 new_state.
19002 * src/closure.c (closure): Now that the initial state has its
19003 items properly set, there is no need for a special case when
19004 creating `ruleset'.
19005
19006 As a result, now the rule 0, reducing to $axiom, is visible in the
19007 outputs. Adjust the test suite.
19008
19009 * tests/conflicts.at (Solved SR Conflicts)
19010 (Unresolved SR Conflicts): Adjust.
19011 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
19012 * tests/conflicts.at (S/R in initial): New.
19013
190142002-04-07 Akim Demaille <akim@epita.fr>
19015
19016 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
19017 the RHS of the rules.
19018 * src/output.c (output_gram): Likewise.
19019
190202002-04-07 Akim Demaille <akim@epita.fr>
19021
19022 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
19023 bucket.
19024 Adjust all dependencies.
19025 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
19026 `number' of the buckets too.
19027 * src/gram.h: Include `symtab.h'.
19028 (associativity): Move to...
19029 * src/symtab.h: here.
19030 No longer include `gram.h'.
19031
190322002-04-07 Akim Demaille <akim@epita.fr>
19033
19034 * src/gram.h, src/gram.c (rules_rhs_length): New.
19035 (ritem_longest_rhs): Use it.
19036 * src/gram.h (rule_t): `number' is a new member.
19037 * src/reader.c (packgram): Set it.
19038 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
19039 the end of `rules', and count them out of `nrules'.
19040 (reduce_output, dump_grammar): Adjust.
19041 * src/print.c (print_grammar): It is no longer needed to check for
19042 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
19043 * tests/reduce.at (Reduced Automaton): New test.
19044
190452002-04-07 Akim Demaille <akim@epita.fr>
19046
19047 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
19048 lacking `+ 1' to nrules, Bison reported as useless a token if it
19049 was used solely to set the precedence of the last rule...
19050
190512002-04-07 Akim Demaille <akim@epita.fr>
19052
19053 * data/bison.c++, data/bison.simple: Don't output the current file
19054 name in #line, to avoid useless diffs between two identical
19055 outputs under different names.
19056
190572002-04-07 Akim Demaille <akim@epita.fr>
19058
19059 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
19060 Normalize loops to using `< nrules + 1', not `<= nrules'.
19061
190622002-04-07 Akim Demaille <akim@epita.fr>
19063
19064 * TODO: Update.
19065
190662002-04-07 Akim Demaille <akim@epita.fr>
19067
19068 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
19069 bucket.value as bucket.number.
19070
190712002-04-07 Akim Demaille <akim@epita.fr>
19072
19073 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
19074 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
19075 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
19076 RHS, instead of being an index in RITEMS.
19077
190782002-04-04 Paul Eggert <eggert@twinsun.com>
19079
19080 * doc/bison.texinfo: Update copyright date.
19081 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
19082 (Symbols): Warn about running Bison in one character set,
19083 but compiling and/or running in an incompatible one.
19084 Warn about character code 256, too.
19085
190862002-04-03 Paul Eggert <eggert@twinsun.com>
19087
19088 * src/bison.data (YYSTACK_ALLOC): Depend on whether
19089 YYERROR_VERBOSE is nonzero, not whether it is defined.
19090
19091 Merge changes from bison-1_29-branch.
19092
190932002-03-20 Paul Eggert <eggert@twinsun.com>
19094
19095 Merge fixes from Debian bison_1.34-1.diff.
19096
19097 * configure.in (AC_PREREQ): 2.53.
19098
190992002-03-20 Akim Demaille <akim@epita.fr>
19100
19101 * src/conflicts.c (log_resolution): Argument `resolution' is const.
19102
191032002-03-19 Paul Eggert <eggert@twinsun.com>
19104
19105 * src/bison.simple (YYCOPY): New macro.
19106 (YYSTACK_RELOCATE): Use it.
19107 Remove Type arg; no longer needed. All callers changed.
19108 (yymemcpy): Remove; no longer needed.
19109
19110 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
19111 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
19112
191132002-03-19 Akim Demaille <akim@epita.fr>
19114
19115 Test and fix the #line outputs.
19116
19117 * tests/atlocal.at (GCC): New.
19118 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
19119 (Prologue synch line, %union synch line, Postprologue synch line)
19120 (Action synch line, Epilogue synch line): New tests.
19121 * src/reader.c (parse_union_decl): Define the muscle stype_line.
19122 * data/bison.simple, data/bison.c++: Use it.
19123
191242002-03-19 Akim Demaille <akim@epita.fr>
19125
19126 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
19127 (Solved SR Conflicts, %expect not enough, %expect right)
19128 (%expect too much): Move to...
19129 * tests/conflicts.at: this new file.
19130
191312002-03-19 Akim Demaille <akim@epita.fr>
19132
19133 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19134 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
19135 that we can move to enums for instance.
19136 * src/output.c (token_definitions_output): Output a list of
19137 `token-name, token-number' instead of the #define.
19138 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
19139
191402002-03-14 Akim Demaille <akim@epita.fr>
19141
19142 Use Gettext 0.11.1.
19143
191442002-03-09 Robert Anisko <robert@lrde.epita.fr>
19145
19146 * data/bison.c++: Make the user able to add members to the generated
19147 parser by subclassing.
19148
191492002-03-05 Robert Anisko <robert@lrde.epita.fr>
19150
19151 * src/reader.c (read_additionnal_code): `c' should be an integer, not
19152 a character.
19153 Reported by Nicolas Tisserand and Nicolas Burrus.
19154
191552002-03-04 Robert Anisko <robert@lrde.epita.fr>
19156
19157 * src/reader.c: Warn about lacking semi-colons, do not complain.
19158
191592002-03-04 Robert Anisko <robert@lrde.epita.fr>
19160
19161 * data/bison.c++: Remove a debug line.
19162
191632002-03-04 Robert Anisko <robert@lrde.epita.fr>
19164
19165 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
19166 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
19167 provide a default implementation.
19168
191692002-03-04 Akim Demaille <akim@epita.fr>
19170
19171 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
19172 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
19173 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
19174 * tests/semantic.at (Parsing Guards): Similarly.
19175 * src/reader.at (readgram): Complain if the last rule is not ended
19176 with a semi-colon.
19177
191782002-03-04 Akim Demaille <akim@epita.fr>
19179
19180 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
19181 * src/closure.c: here.
19182 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
19183 RTC.
19184 * src/warshall.h, src/warshall.c: Remove.
19185 * tests/sets.at (Broken Closure): Adjust.
19186
191872002-03-04 Akim Demaille <akim@epita.fr>
19188
19189 * src/output.c (output_skeleton): tempdir is const.
19190 bytes_read is unused.
19191
191922002-03-04 Akim Demaille <akim@epita.fr>
19193
19194 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19195 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
19196 Update.
19197 From Michael Hayes.
19198
191992002-03-04 Akim Demaille <akim@epita.fr>
19200
19201 * src/closure.c (closure): `r' is unused.
19202
192032002-03-04 Akim Demaille <akim@epita.fr>
19204
19205 * tests/sets.at (Broken Closure): Add the ending `;'.
19206 * src/reader.at (readgram): Complain if a rule is not ended with a
19207 semi-colon.
19208
192092002-03-04 Akim Demaille <akim@epita.fr>
19210
19211 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
19212 (count_sr_conflicts): Use bitset_count.
19213 * src/reduce.c (inaccessable_symbols): Ditto.
19214 (bits_size): Remove.
19215 * src/warshall.h, src/warshall.c: Convert to bitsetv.
19216
192172002-03-04 Akim Demaille <akim@epita.fr>
19218
19219 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
19220 * src/reduce.c: Remove the `bitset_zero's following the
19221 `bitset_create's, as now it is performed by the latter.
19222
192232002-03-04 Akim Demaille <akim@epita.fr>
19224
19225 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
19226 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
19227 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
19228 latest sources from Michael.
19229
192302002-03-04 Akim Demaille <akim@epita.fr>
19231
19232 * src/output.c (output): Don't free the grammar.
19233 * src/reader.c (grammar_free): New.
19234 * src/main.c (main): Call it and don't free symtab here.
19235
192362002-03-04 Akim Demaille <akim@epita.fr>
19237
19238 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
19239 before returning.
19240 Reported by Benoit Perrot.
19241
192422002-03-04 Akim Demaille <akim@epita.fr>
19243
19244 Use bitset operations when possible, not loops over bits.
19245
19246 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
19247 bitset_or.
19248 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
19249 * src/reduce.c (useless_nonterminals): Formatting changes.
19250 * src/warshall.c (TC): Use bitset_or.
19251
192522002-03-04 Akim Demaille <akim@epita.fr>
19253
19254 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
19255 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
19256 Ditto.
19257
192582002-03-04 Akim Demaille <akim@epita.fr>
19259
19260 * src/lalr.c (F): Now a bitset*.
19261 Adjust all dependencies.
19262
192632002-03-04 Akim Demaille <akim@epita.fr>
19264
19265 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
19266 Adjust all dependencies.
19267
192682002-03-04 Akim Demaille <akim@epita.fr>
19269
19270 * src/L0.c, src/LR0.h (nstates): Be size_t.
19271 Adjust comparisons (signed vs unsigned).
19272 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
19273 bitset*.
19274 Adjust all dependencies.
19275
192762002-03-04 Akim Demaille <akim@epita.fr>
19277
19278 * src/closure.c (firsts): Now, also a bitset.
19279 Adjust all dependencies.
19280 (varsetsize): Remove, now unused.
19281 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
19282
192832002-03-04 Akim Demaille <akim@epita.fr>
19284
19285 * src/print.c: Convert to use bitset.h, not hand coded iterations
19286 over ints.
19287
192882002-03-04 Akim Demaille <akim@epita.fr>
19289
19290 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
19291
192922002-03-04 Akim Demaille <akim@epita.fr>
19293
19294 * src/closure.c (ruleset): Be a bitset.
19295 (rulesetsize): Remove.
19296
192972002-03-04 Akim Demaille <akim@epita.fr>
19298
19299 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19300 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
19301 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
19302 * src/closure.c (fderives): Be an array of bitsets.
19303
193042002-02-28 Robert Anisko <robert@lrde.epita.fr>
19305
19306 * data/bison.c++: Merge the two generated headers. Insert a copyright
19307 notice in each output file.
19308
193092002-02-28 Akim Demaille <akim@epita.fr>
19310
19311 * data/bison.c++: Copy the prologue of bison.simple to fetch
19312 useful M4 definitions, such as b4_header_guard.
19313
193142002-02-25 Akim Demaille <akim@epita.fr>
19315
19316 * src/getargs.c (version): Give the name of the authors, and use a
19317 translator friendly scheme for the bgr
19318 copyright notice.
19319
193202002-02-25 Akim Demaille <akim@epita.fr>
19321
19322 * src/output.c (header_output): Remove, now handled completely via
19323 M4.
19324
193252002-02-25 Akim Demaille <akim@epita.fr>
19326
19327 * m4/m4.m4: New, from CVS Autoconf.
19328 * configure.in: Invoke it.
19329 * src/output.c (output_skeleton): Use its result instead of the
19330 hard coded name.
19331
193322002-02-25 Akim Demaille <akim@epita.fr>
19333
19334 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
19335 Fileutils 4.1.5.
19336 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
19337 * src/output.c (output_skeleton): Use mkstemp to create a real
19338 temporary file.
19339 Move the filling of `skeleton' and its muscle to...
19340 (prepare): here.
19341 (output): Move the definition of the prologue muscle to...
19342 (prepare): here.
19343 * src/system.h (DEFAULT_TMPDIR): New.
19344
193452002-02-14 Paul Eggert <eggert@twinsun.com>
19346
19347 Remove the support for C++ namespace cleanliness; it was
19348 causing more problems than it was curing, since it didn't work
19349 properly on some nonstandard C++ compilers. This can wait
19350 for a proper C++ parser.
19351
19352 * NEWS: Document this.
19353 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
19354 of C++, as it's treated like C now.
19355 * src/bison.simple (YYSTD): Remove.
19356 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
19357 Treat C++ just like Standard C instead of trying to support
19358 namespace cleanliness.
19359
193602002-02-14 Akim Demaille <akim@epita.fr>
19361
19362 * tests/regression.at (else): Adjust to Andreas' change.
19363
193642002-02-14 Akim Demaille <akim@epita.fr>
19365
19366 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
19367
193682002-02-13 Andreas Schwab <schwab@suse.de>
19369
19370 * src/output.c (output_rule_data): Don't output NULL, it might
19371 not be defined yet.
19372
193732002-02-11 Robert Anisko <robert@lrde.epita.fr>
19374
19375 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
19376 (Copyright notice): Update.
19377
193782002-02-11 Akim Demaille <akim@epita.fr>
19379
19380 * tests/regression.at (%nonassoc and eof): Don't include
19381 nonportable headers.
19382
193832002-02-08 Robert Anisko <robert@lrde.epita.fr>
19384
19385 * data/bison.c++: Correct error recovery. Make the user able to
19386 initialize the starting location.
19387
193882002-02-07 Akim Demaille <akim@epita.fr>
19389
19390 * tests/input.at: New.
19391
193922002-02-07 Robert Anisko <robert@lrde.epita.fr>
19393
19394 * data/bison.c++: Replace some direct m4 expansions by constants. Be
19395 more consistent when naming methods and variables. Put preprocessor
19396 directives around tables only needed for debugging.
19397
193982002-02-07 Robert Anisko <robert@lrde.epita.fr>
19399
19400 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
19401 C++ parsers.
19402 (yy::b4_name::parse): Use print_.
19403
194042002-02-07 Robert Anisko <robert@lrde.epita.fr>
19405
19406 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
19407
194082002-02-07 Robert Anisko <robert@lrde.epita.fr>
19409
19410 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
19411 C++ parsers.
19412 (yy::b4_name::parse): Build verbose error messages, and use error_.
19413
194142002-02-06 Robert Anisko <robert@lrde.epita.fr>
19415
19416 * data/bison.c++: Fix m4 quoting in comments.
19417
194182002-02-06 Robert Anisko <robert@lrde.epita.fr>
19419
19420 * data/bison.c++: Adjust the parser code. Fix some muscles that were
19421 not expanded by m4.
19422
194232002-02-05 Akim Demaille <akim@epita.fr>
19424
19425 * data/bison.c++: Adjust to the M4 back end.
19426 More is certainly needed.
19427
194282002-02-05 Akim Demaille <akim@epita.fr>
19429
19430 Give a try to M4 as a back end.
19431
19432 * lib/readpipe.c: New, from wdiff.
19433 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
19434 BISON_HAIRY.
19435 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
19436 specific values. Now it is m4 that performs the lookup.
19437 * src/parse-skel.y: Remove.
19438 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
19439 * src/output.c (actions_output, guards_output)
19440 (token_definitions_output): No longer keeps track of the output
19441 line number, hence remove the second argument.
19442 (guards_output): Check against the guard member of a rule, not the
19443 action member.
19444 Adjust callers.
19445 (output_skeleton): Don't look for the skeleton location, let m4 do
19446 that.
19447 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
19448 file will be used.
19449 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
19450 (prepare): Given that for the time being changesyntax is not
19451 usable in M4, rename the muscles using `-' to `_'.
19452 Define `defines_flag', `output_parser_name' and `output_header_name'.
19453 * src/output.h (actions_output, guards_output)
19454 (token_definitions_output): Adjust prototypes.
19455 * src/scan-skel.l: Instead of scanning the skeletons, it now
19456 processes the output of m4: `__oline__' and `#output'.
19457 * data/bison.simple: Adjust to be used by M4(sugar).
19458 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
19459 to date.
19460 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
19461 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
19462 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
19463 shamelessly stolen from CVS Autoconf.
19464
194652002-02-05 Akim Demaille <akim@epita.fr>
19466
19467 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
19468 * configure.in: Check for the declarations of free and malloc.
19469 * src/muscle_tab.c: Adjust.
19470
194712002-02-05 Akim Demaille <akim@epita.fr>
19472
19473 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
19474 which have no values.
19475
194762002-02-05 Akim Demaille <akim@epita.fr>
19477
19478 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
19479 * data/: here.
19480
194812002-01-29 Paul Eggert <eggert@twinsun.com>
19482
19483 * src/bison.simple (YYSIZE_T): Do not define merely because
19484 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
19485 On some platforms, <alloca.h> does not declare YYSTD (size_t).
19486
194872002-01-27 Akim Demaille <akim@epita.fr>
19488
19489 Fix `%nonassoc and eof'.
19490
19491 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
19492 which were not properly copied! Replace
19493 memcpy (res->errs, src->errs, src->nerrs);
19494 with
19495 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
19496 !!!
19497 * tests/regression.at (%nonassoc and eof): Adjust to newest
19498 Autotest: `.' is not in the PATH.
19499
195002002-01-27 Akim Demaille <akim@epita.fr>
19501
19502 * tests/sets.at (AT_EXTRACT_SETS): New.
19503 (Nullable): Use it.
19504 (Firsts): New.
19505
195062002-01-26 Akim Demaille <akim@epita.fr>
19507
19508 * tests/actions.at, tests/calc.at, tests/headers.at,
19509 * tests/torture.at: Adjust to the newest Autotest which no longer
19510 forces `.' in the PATH.
19511
195122002-01-25 Akim Demaille <akim@epita.fr>
19513
19514 * tests/regression.at (%nonassoc and eof): New.
19515 Suggested by Robert Anisko.
19516
195172002-01-24 Akim Demaille <akim@epita.fr>
19518
19519 Bison dumps core when trying to complain about broken input files.
19520 Reported by Cris van Pelt.
19521
19522 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
19523 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
19524 into...
19525 (Invalid inputs): Strengthen: exercise parse_percent_token.
19526
195272002-01-24 Robert Anisko <robert.anisko@epita.fr>
19528
19529 * src/Makefile.am: Add bison.c++.
19530 * src/bison.c++: New skeleton.
19531
195322002-01-21 Paolo Bonzini <bonzini@gnu.org>
19533
19534 * po/it.po: New.
19535
195362002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
19537
19538 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
19539
195402002-01-20 Marc Autret <marc@gnu.org>
19541
19542 * src/files.c (compute_output_file_names): Fix
19543
195442002-01-20 Marc Autret <marc@gnu.org>
19545
19546 * tests/output.at: New test.
19547 * src/files.c (compute_base_names): Don't map extensions when
19548 the YACC flag is set, use defaults.
19549 Reported by Evgeny Stambulchik.
19550
195512002-01-20 Marc Autret <marc@gnu.org>
19552
19553 * src/system.h: Need to define __attribute__ away for non-GCC
19554 compilers as well (i.e., the vendor C compiler).
19555 Suggested by Albert Chin-A-Young.
19556
195572002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
19558
19559 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
19560 canonical definition.
19561 * src/system.h: Use the canonical definition for PARAMS (avoids
19562 a conflict with the macro from lib/hash.h).
19563
195642002-01-11 Akim Demaille <akim@epita.fr>
19565
19566 * configure.in: Use AC_FUNC_STRNLEN.
19567 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
19568
195692002-01-09 Akim Demaille <akim@epita.fr>
19570
19571 * src/files.c, src/files.h (output_infix): New.
19572 (tab_extension): Remove.
19573 (compute_base_names): Compute the former, drop the latter.
19574 * src/output.c (prepare): Insert the muscles `output-infix', and
19575 `output-suffix'.
19576 * src/parse-skel.y (string, string.1): New.
19577 (section.header): Use it.
19578 (section.yacc): Remove.
19579 (prefix): Remove too.
19580 * src/scan-skel.l: Adjust.
19581 * src/bison.simple, src/bison.hairy: Adjust.
19582
195832002-01-09 Akim Demaille <akim@epita.fr>
19584
19585 * configure.in (WERROR_CFLAGS): Compute it.
19586 * src/Makefile.am (CFLAGS): Pass it.
19587 * tests/atlocal.in (CFLAGS): Idem.
19588 * src/files.c: Fix a few warnings.
19589 (get_extension_index): Remove, unused.
19590
195912002-01-08 Akim Demaille <akim@epita.fr>
19592
19593 * src/getargs.c (AS_FILE_NAME): New.
19594 (getargs): Use it to convert DOSish file names.
19595 * src/files.c (base_name): Rename as full_base_name to avoid
19596 clashes with `base_name ()'.
19597 (filename_split): New.
19598 (compute_base_names): N-th rewrite, using filename_split.
19599
196002002-01-08 Akim Demaille <akim@epita.fr>
19601
19602 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
19603 New, stolen from the Fileutils 4.1.
19604 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
19605 * configure.in: Check for the presence of memrchr, and of its
19606 prototype.
19607
196082002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
19609
19610 * lib/hash.h (__P): Added definition for this macro.
19611 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
19612 BUILT_SOURCES, to ensure they are generated first.
19613 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
19614 %error-verbose to allow bootstrapping with bison 1.30x.
19615
196162002-01-06 Akim Demaille <akim@epita.fr>
19617
19618 * src/reader.c (parse_braces): Don't fetch the next char, the
19619 convention is to fetch on entry.
19620 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
19621 'switch' without a following semicolon.
19622 * tests/regression.at (braces parsing): New.
19623
196242002-01-06 Akim Demaille <akim@epita.fr>
19625
19626 Bison is dead wrong in its RR conflict reports.
19627
19628 * tests/torture.at (GNU Cim Grammar): New.
19629 * src/conflicts.c (count_rr_conflicts): Fix.
19630
196312002-01-06 Akim Demaille <akim@epita.fr>
19632
19633 Creating package.m4 from configure.ac causes too many problems.
19634
19635 * tests/Makefile.am (package.m4): Create it by hand,
19636 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
19637
196382002-01-06 Akim Demaille <akim@epita.fr>
19639
19640 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
19641 skeleton.h.
19642
196432002-01-04 Paul Eggert <eggert@twinsun.com>
19644
19645 * doc/bison.texinfo (Debugging):
19646 Remove YYSTDERR; it's no longer defined or used.
19647 Also, s/cstdio.h/cstdio/.
19648
196492002-01-03 Akim Demaille <akim@epita.fr>
19650
19651 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
19652
196532002-01-03 Akim Demaille <akim@epita.fr>
19654
19655 * src/parse-skel.y (process_skeleton): Don't bind the parser's
19656 tracing code to --trace, wait for a better --trace option, with
19657 args.
19658
196592002-01-03 Akim Demaille <akim@epita.fr>
19660
19661 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
19662 The ISO C++ standard is extremely clear about it: stderr is
19663 considered a macro, not a regular symbol (see table 94 `Header
19664 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
19665 Therefore std:: does not apply to it. It still does with fprintf.
19666 Also, s/cstdio.h/cstdio/.
19667
196682002-01-03 Akim Demaille <akim@epita.fr>
19669
19670 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
19671 for non system headers.
19672
196732002-01-02 Akim Demaille <akim@epita.fr>
19674
19675 Equip the skeleton chain with location tracking, runtime trace,
19676 pure parser and scanner.
19677
19678 * src/parse-skel.y: Request a pure parser, locations, and prefix
19679 renaming.
19680 (%union): Having several members with the same type does not help
19681 type mismatches, simplify.
19682 (YYPRINT, yyprint): New.
19683 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
19684 (skel_error): this.
19685 Handle locations.
19686 * src/scan-skel.l: Adjust to these changes.
19687 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
19688 (LOCATION_PRINT, skel_control_t): New.
19689
196902001-12-30 Akim Demaille <akim@epita.fr>
19691
19692 * src/parse-skel.y: Get rid of the shift/reduce conflict:
19693 replace `gb' with BLANKS.
19694 * src/scan-skel.l: Adjust.
19695
196962001-12-30 Akim Demaille <akim@epita.fr>
19697
19698 * src/system.h: We don't need nor want bcopy.
19699 Throw away MS-DOS crap: we don't need getpid.
19700 * configure.in: We don't need strndup. It was even causing
19701 problems: because Flex includes the headers *before* us,
19702 _GNU_SOURCE is not defined by config.h, and therefore strndup was
19703 not visible.
19704 * lib/xstrndup.c: New.
19705 * src/scan-skel.l: Use it.
19706 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
19707 * src/parse-skel.y: Use %directives instead of #defines.
19708
197092001-12-30 Akim Demaille <akim@epita.fr>
19710
19711 * src/skeleton.h: New.
19712 * src/output.c (output_parser, output_master_parser): Remove, dead
19713 code.
19714 * src/output.h (get_lines_number, actions_output, guards_output)
19715 (token_definitions_output): Prototype them.
19716 * src/parse-skel.y: Add the license notice.
19717 Include output.h and skeleton.h.
19718 (process_skeleton): Returns void, and takes a single parameter.
19719 * src/scan-skel.l: Add the license notice.
19720 Include skeleton.h.
19721 Don't use %option yylineno: it seems that then Flex imagines
19722 REJECT has been used, and therefore it won't reallocate its
19723 buffers (which makes no other sense to me than a bug). It results
19724 in warnings for `unused: yy_flex_realloc'.
19725
197262001-12-30 Robert Anisko <robert.anisko@epita.fr>
19727
19728 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
19729 (MUSCLE_INSERT_PREFIX): ...to there.
19730 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
19731 (MUSCLE_INSERT_PREFIX): Move from here...
19732
19733 * src/bison.hairy: Add a section directive. Put braces around muscle
19734 names. This parser skeleton is still broken, but Bison should not
19735 choke on a bad muscle 'syntax'.
19736 * src/bison.simple: Add a section directive. Put braces around muscle
19737 names.
19738
19739 * src/files.h (strsuffix, stringappend): Add declarations.
19740 (tab_extension): Add declaration.
19741 (short_base_name): Add declaration.
19742
19743 * src/files.c (strsuffix, stringappend): No longer static. These
19744 functions are used in the skeleton parser.
19745 (tab_extension): New.
19746 (compute_base_names): Use the computations done in this function
19747 to guess if the generated parsers should have '.tab' in their
19748 names.
19749 (short_base_name): No longer static.
19750
19751 * src/output.c (output_skeleton): New.
19752 (output): Disable call to output_master_parser, and give a try to
19753 a new skeleton handling system.
19754 (guards_output, actions_output): No longer static.
19755 (token_definitions_output, get_lines_number): No longer static.
19756
19757 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
19758
19759 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
19760 parse-skel.y.
19761
19762 * src/parse-skel.y: New file.
19763 * src/scan-skel.l: New file.
19764
197652001-12-29 Akim Demaille <akim@epita.fr>
19766
19767 %name-prefix is broken.
19768
19769 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
19770 Adjust all dependencies.
19771 * tests/headers.at (export YYLTYPE): Strengthen this test: use
19772 %name-prefix.
19773
19774 Renaming yylval but not yylloc is not consistent. Now we do.
19775
19776 * src/bison.simple: Prefix yylloc if used.
19777 * doc/bison.texinfo (Decl Summary): Document that.
19778
197792001-12-29 Akim Demaille <akim@epita.fr>
19780
19781 * doc/bison.texinfo: Promote `%long-directive' over
19782 `%long_directive'.
19783 Remove all references to fixed-output-files, yacc is enough.
19784
197852001-12-29 Akim Demaille <akim@epita.fr>
19786
19787 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
19788 user prologue. These are defaults.
19789 * tests/actions.at (Mid-rule actions): Make sure the user can
19790 define YYDEBUG and YYERROR_VERBOSE.
19791
197922001-12-29 Akim Demaille <akim@epita.fr>
19793
19794 * src/output.c (header_output): Don't forget to export YYLTYPE and
19795 yylloc.
19796 * tests/headers.at (export YYLTYPE): New, make sure it does.
19797 * tests/regression.at (%union and --defines, Invalid CPP headers):
19798 Move to...
19799 * tests/headers.at: here.
19800
198012001-12-29 Akim Demaille <akim@epita.fr>
19802
19803 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
19804
198052001-12-29 Akim Demaille <akim@epita.fr>
19806
19807 * tests/actions.at (Mid-rule actions): Output on a single line
19808 instead of several.
19809
198102001-12-29 Akim Demaille <akim@epita.fr>
19811
19812 * doc/bison.texinfo: Formatting changes.
19813
198142001-12-29 Akim Demaille <akim@epita.fr>
19815
19816 Don't store the token defs in a muscle, just be ready to output it
19817 on command. Now possible via `symbols'. Fixes a memory leak.
19818
19819 * src/output.c (token_definitions_output): New.
19820 (output_parser, header_output): Use it.
19821 * src/reader.c (symbols_save): Remove.
19822
198232001-12-29 Akim Demaille <akim@epita.fr>
19824
19825 * src/bison.simple: Do not provide a default for YYSTYPE and
19826 YYLTYPE before the user's prologue. Otherwise it's hardly... a
19827 default.
19828
198292001-12-29 Akim Demaille <akim@epita.fr>
19830
19831 Mid-rule actions are simply... ignored!
19832
19833 * src/reader.c (readgram): Be sure to attach mid-rule actions to
19834 the empty-rule associated to the dummy symbol, not to the host
19835 rule.
19836 * tests/actions.at (Mid-rule actions): New.
19837
198382001-12-29 Akim Demaille <akim@epita.fr>
19839
19840 Memory leak.
19841
19842 * src/reader.c (reader): Free grammar.
19843
198442001-12-29 Akim Demaille <akim@epita.fr>
19845
19846 Memory leak.
19847
19848 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
19849 since it allocates it for each state, although only one is needed.
19850 (allocate_storage): Do it here.
19851
198522001-12-29 Akim Demaille <akim@epita.fr>
19853
19854 * src/options.h, src/options.c (create_long_option_table): Rename
19855 as...
19856 (long_option_table_new): this, with a clearer prototype.
19857 (percent_table): Remove, unused,
19858 * src/getargs.c (getargs): Adjust.
19859
198602001-12-29 Akim Demaille <akim@epita.fr>
19861
19862 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
19863 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
19864 as states.
19865
198662001-12-29 Akim Demaille <akim@epita.fr>
19867
19868 * src/lalr.c (build_relations): Rename `states' as `states1'.
19869 Sorry, I don't understand exactly what it is, no better name...
19870
198712001-12-29 Akim Demaille <akim@epita.fr>
19872
19873 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
19874 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
19875 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
19876 as rules.
19877
198782001-12-29 Akim Demaille <akim@epita.fr>
19879
19880 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
19881 ago.
19882
198832001-12-29 Akim Demaille <akim@epita.fr>
19884
19885 * src/reader.c, src/reader.h (user_toknums): Remove.
19886 Adjust all users to use symbols[i]->user_token_number.
19887
198882001-12-29 Akim Demaille <akim@epita.fr>
19889
19890 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
19891 Adjust all users to use symbols[i]->prec or ->assoc.
19892
198932001-12-29 Akim Demaille <akim@epita.fr>
19894
19895 * src/reader.c, src/reader.h (tags): Remove.
19896 Adjust all users to use symbols[i]->tag.
19897
198982001-12-29 Akim Demaille <akim@epita.fr>
19899
19900 * src/gram.h, src/gram.c (symbols): New, similar to state_table
19901 and rule_table.
19902 * src/reader.c (packsymbols): Fill this table.
19903 Drop sprec.
19904 * src/conflicts.c (resolve_sr_conflict): Adjust.
19905 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
19906 single table.
19907 Use symbols[i]->tag instead of tags[i].
19908
199092001-12-29 Akim Demaille <akim@epita.fr>
19910
19911 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
19912 In addition, put a comment in there, to replace...
19913 * tests/regression.at (%union and C comments): Remove.
19914
199152001-12-29 Akim Demaille <akim@epita.fr>
19916
19917 * tests/regression.at (Web2c Actions): Blindly move the actual
19918 output as expected output. The contents *seem* right to me, but I
19919 can't pretend reading perfectly parser tables... Nonetheless, all
19920 the other tests pass correctly, the table look OK, even though the
19921 presence of `$axiom' is to be noted: AFAICS it is useless (but
19922 harmless).
19923
199242001-12-29 Akim Demaille <akim@epita.fr>
19925
19926 * src/reader.c (readgram): Don't add the rule 0 if there were no
19927 rules read. In other words, add it _after_ having performed
19928 grammar sanity checks.
19929 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
19930
199312001-12-29 Akim Demaille <akim@epita.fr>
19932
19933 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
19934 visible, and some states have now a different number.
19935
199362001-12-29 Akim Demaille <akim@epita.fr>
19937
19938 * src/reader.c (readgram): Bind the initial rule's lineno to that
19939 of the first rule.
19940 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
19941 (Solved SR Conflicts): Adjust rule 0's line number.
19942
199432001-12-29 Akim Demaille <akim@epita.fr>
19944
19945 Fix the `GAWK Grammar' failure.
19946
19947 * src/LR0.c (final_state): Initialize to -1 so that we do compute
19948 the reductions of the first state which was mistakenly confused
19949 with the final state because precisely final_state was initialized
19950 to 0.
19951 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
19952 now noticed by Bison.
19953 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
19954 have a reduction on $default.
19955
199562001-12-29 Akim Demaille <akim@epita.fr>
19957
19958 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
19959 rule line numbers.
19960 * src/closure.c (print_closure): Likewise.
19961 * src/derives.c (print_derives): Likewise.
19962 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
19963 now.
19964
199652001-12-29 Akim Demaille <akim@epita.fr>
19966
19967 * src/lalr.c (lookaheads_print): New.
19968 (lalr): Call it when --trace-flag.
19969 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
19970 are dumped.
19971
199722001-12-29 Akim Demaille <akim@epita.fr>
19973
19974 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
19975 when walking through ritem, even via rule->rhs.
19976 * src/reduce.c (dump_grammar, useful_production, reduce_output)
19977 (useful_production, useless_nonterminals): Likewise.
19978 (reduce_grammar_tables): Likewise, plus update nritems.
19979 * src/nullable.c (set_nullable): Likewise.
19980 * src/lalr.c (build_relations): Likewise.
19981 * tests/sets.at (Nullable): Adjust.
19982 Fortunately, now, the $axiom is no longer nullable.
19983
199842001-12-29 Akim Demaille <akim@epita.fr>
19985
19986 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
19987 the 0-sentinel.
19988 * src/gram.c (ritem_longest_rhs): Likewise.
19989 * src/reduce.c (nonterminals_reduce): Likewise.
19990 * src/print_graph.c (print_graph): Likewise.
19991 * src/output.c (output_rule_data): Likewise.
19992 * src/nullable.c (set_nullable): Likewise.
19993
199942001-12-29 Akim Demaille <akim@epita.fr>
19995
19996 * src/output.c: Comment changes.
19997
199982001-12-27 Paul Eggert <eggert@twinsun.com>
19999
20000 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
20001 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
20002 Sparc, as they were causing more porting problems than the
20003 (minor) performance improvement was worth.
20004
20005 Also, catch up with 1.31's YYSTD.
20006
200072001-12-27 Akim Demaille <akim@epita.fr>
20008
20009 * src/output.c (output_gram): Rely on nritems, not the
20010 0-sentinel. See below.
20011 Use -1 as separator, not 0.
20012 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
20013 Rely on -1 as separator in yyrhs, instead of 0.
20014 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
20015 twice `Now at end of input', therefore there are two lines less to
20016 expect.
20017
200182001-12-27 Akim Demaille <akim@epita.fr>
20019
20020 * tests/regression.at (Unresolved SR Conflicts):
20021 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
20022 below.
20023
200242001-12-27 Akim Demaille <akim@epita.fr>
20025
20026 * src/LR0.c (new_state): Recognize the final state by the fact it
20027 is reached by eoftoken.
20028 (insert_start_shifting_state, insert_eof_shifting_state)
20029 (insert_accepting_state, augment_automaton): Remove, since now
20030 these states are automatically computed from the initial state.
20031 (generate_states): Adjust.
20032 * src/print.c: When reporting a rule number to the user, substract
20033 1, so that the axiom rule is rule 0, and the first user rule is 1.
20034 * src/reduce.c: Likewise.
20035 * src/print_graph.c (print_core): For the time being, just as for
20036 the report, depend upon --trace-flags to dump the full set of
20037 items.
20038 * src/reader.c (readgram): Once the grammar read, insert the rule
20039 0: `$axiom: START-SYMBOL $'.
20040 * tests/set.at: Adjust: rule 0 is now displayed, and since the
20041 number of the states has changed (the final state is no longer
20042 necessarily the last), catch up.
20043
200442001-12-27 Akim Demaille <akim@epita.fr>
20045
20046 Try to make the use of the eoftoken valid. Given that its value
20047 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
20048 is used instead of > 0 where appropriate, (ii), depend upon nritems
20049 instead of the 0-sentinel.
20050
20051 * src/gram.h, src/gram.c (nritems): New.
20052 Expected to be duplication of nitems, but for the time being...
20053 * src/reader.c (packgram): Assert nritems and nitems are equal.
20054 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
20055 * src/closure.c (print_closure, print_fderives): Likewise.
20056 * src/gram.c (ritem_print): Likewise.
20057 * src/print.c (print_core, print_grammar): Likewise.
20058 * src/print_graph.c: Likewise.
20059
200602001-12-27 Akim Demaille <akim@epita.fr>
20061
20062 * src/main.c (main): If there are complains after grammar
20063 reductions, then output the report anyway if requested, then die.
20064 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
20065 * src/reader.c (eoftoken): New.
20066 (parse_token_decl): If the token being defined has value `0', it
20067 is the eoftoken.
20068 (packsymbols): No longer hack `tags' to insert `$' by hand.
20069 Be sure to preserve the value of the eoftoken.
20070 (reader): Make sure eoftoken is defined.
20071 Initialize nsyms to 0: now eoftoken is created just like the others.
20072 * src/print.c (print_grammar): Don't special case the eof token.
20073 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
20074 lie anyway, albeit pleasant.
20075 * tests/calc.at: Exercise error messages with eoftoken.
20076 Change the grammar so that empty input is invalid.
20077 Adjust expectations.
20078 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
20079
200802001-12-27 Akim Demaille <akim@epita.fr>
20081
20082 * configure.in: Check the protos of strchr ans strspn.
20083 Replace strchr if needed.
20084 * src/system.h: Provide the protos of strchr, strspn and memchr if
20085 missing.
20086 * lib/strchr.c: New.
20087 * src/reader.c (symbols_save): Use strchr.
20088
200892001-12-27 Akim Demaille <akim@epita.fr>
20090
20091 * src/print.c, src/print_graph.c (escape): New.
20092 Use it to quote the TAGS outputs.
20093 * src/print_graph.c (print_state): Now errors are in red, and
20094 reductions in green.
20095 Prefer high to wide: output the state number on a line of its own.
20096
200972001-12-27 Akim Demaille <akim@epita.fr>
20098
20099 * src/state.h, src/state.c (reductions_new): New.
20100 * src/LR0.c (set_state_table): Let all the states have a
20101 `reductions', even if reduced to 0.
20102 (save_reductions): Adjust.
20103 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
20104 * src/print.c (print_reductions, print_actions): Adjust.
20105 * src/output.c (action_row): Adjust.
20106
201072001-12-27 Akim Demaille <akim@epita.fr>
20108
20109 * src/state.h, src/state.c (errs_new, errs_dup): New.
20110 * src/LR0.c (set_state_table): Let all the states have an errs,
20111 even if reduced to 0.
20112 * src/print.c (print_errs, print_reductions): Adjust.
20113 * src/output.c (output_actions, action_row): Adjust.
20114 * src/conflicts.c (resolve_sr_conflict): Adjust.
20115
201162001-12-27 Akim Demaille <akim@epita.fr>
20117
20118 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
20119
201202001-12-27 Akim Demaille <akim@epita.fr>
20121
20122 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
20123 * src/print.c: here.
20124 (lookaheadset, shiftset): New, used as additional storage by
20125 print_reductions.
20126 (print_results): Adjust.
20127 (print_shifts, print_gotos, print_errs): New, extracted from...
20128 (print_actions): here.
20129 * src/print_graph.c (print_actions): Remove dead code.
20130
201312001-12-27 Akim Demaille <akim@epita.fr>
20132
20133 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
20134 `$n' and `@n'.
20135
201362001-12-27 Akim Demaille <akim@epita.fr>
20137
20138 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
20139 (build_relations): Adjust.
20140
201412001-12-27 Akim Demaille <akim@epita.fr>
20142
20143 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
20144 duplication.
20145
201462001-12-27 Akim Demaille <akim@epita.fr>
20147
20148 * src/reader.c (packgram): Catch nitems overflows.
20149
201502001-12-27 Akim Demaille <akim@epita.fr>
20151
20152 * src/files.c, src/files.h (guard_obstack): Remove.
20153 * src/output.c (output): Adjust.
20154 * src/reader.c (parse_braces): New, factoring...
20155 (copy_action, copy_guard): these two which are renamed as...
20156 (parse_action, parse_guard): these.
20157 As a voluntary consequence, using braces around guards is now
20158 mandatory.
20159
201602001-12-27 Akim Demaille <akim@epita.fr>
20161
20162 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
20163 * src/reader.c (symbol_list): `guard' and `guard_line' are new
20164 members.
20165 (symbol_list_new): Adjust.
20166 (copy_action): action_line is the first line, not the last.
20167 (copy_guard): Just as for actions, store the `action' only, not
20168 the switch/case/break flesh.
20169 Don't parse the user action that might follow the guard, let...
20170 (readgram): do it, i.e., now, there can be an action after a
20171 guard.
20172 In other words the guard is just explicitly optional.
20173 (packgram): Adjust.
20174 * src/output.c (guards_output): New.
20175 (output_parser): Call it when needed.
20176 (output): Also free the guard and attrs obstacks.
20177 * src/files.c, src/files.h (obstack_save): Remove.
20178 (output_files): Remove.
20179 As a result, if one needs the former `.act' file, using an
20180 appropriate skeleton which requires actions and guards is now
20181 required.
20182 * src/main.c (main): Adjust.
20183 * tests/semantic.at: New.
20184 * tests/regression.at: Use `input.y' as input file name.
20185 Avoid 8+3 problems by requiring input.c when the test needs the
20186 parser.
20187
201882001-12-27 Akim Demaille <akim@epita.fr>
20189
20190 * src/reader.c (symbol_list_new): Be sure to initialize all the
20191 fields.
20192
201932001-12-27 Akim Demaille <akim@epita.fr>
20194
20195 All the hacks using a final pseudo state are now useless.
20196
20197 * src/LR0.c (set_state_table): state_table holds exactly nstates.
20198 * src/lalr.c (nLA): New.
20199 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
20200 instead of lookaheadsp from the pseudo state (nstate + 1).
20201
202022001-12-27 Akim Demaille <akim@epita.fr>
20203
20204 * src/output.c (action_row, token_actions): Use a state_t instead
20205 of a integer, and nlookaheads instead of the following state's
20206 lookaheadsp.
20207
202082001-12-27 Akim Demaille <akim@epita.fr>
20209
20210 * src/conflicts.c (log_resolution, flush_shift)
20211 (resolve_sr_conflict, set_conflicts, solve_conflicts)
20212 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
20213 (conflicts_print, print_reductions): Use a state_t instead of an
20214 integer when referring to a state.
20215 As much as possible, depend upon nlookaheads, instead of the
20216 `lookaheadsp' member of the following state (since lookaheads of
20217 successive states are successive, the difference between state n + 1
20218 and n served as the number of lookaheads for state n).
20219 * src/lalr.c (add_lookback_edge): Likewise.
20220 * src/print.c (print_core, print_actions, print_state)
20221 (print_results): Likewise.
20222 * src/print_graph.c (print_core, print_actions, print_state)
20223 (print_graph): Likewise.
20224 * src/conflicts.h: Adjust.
20225
202262001-12-27 Akim Demaille <akim@epita.fr>
20227
20228 * src/bison.hairy: Formatting/comment changes.
20229 ANSIfy.
20230 Remove `register' indications.
20231 Add plenty of `static'.
20232
202332001-12-27 Akim Demaille <akim@epita.fr>
20234
20235 * src/output.c (prepare): Drop the muscle `ntbase' which
20236 duplicates ntokens.
20237 * src/bison.simple: Formatting/comment changes.
20238 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
20239 is an undocumented synonym.
20240
202412001-12-22 Akim Demaille <akim@epita.fr>
20242
20243 * src/output.c (output_table_data): Change the prototype to use
20244 `int' for array ranges: some invocations do pass an int, not a
20245 short.
20246 Reported by Wayne Green.
20247
202482001-12-22 Akim Demaille <akim@epita.fr>
20249
20250 Some actions of web2c.y are improperly triggered.
20251 Reported by Mike Castle.
20252
20253 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
20254 * tests/regression.at (Web2c): Rename as...
20255 (Web2c Report): this.
20256 (Web2c Actions): New.
20257
202582001-12-22 Akim Demaille <akim@epita.fr>
20259
20260 Reductions in web2c.y are improperly reported.
20261 Reported by Mike Castle.
20262
20263 * src/conflicts.c (print_reductions): Fix.
20264 * tests/regression.at (Web2c): New.
20265
202662001-12-18 Akim Demaille <akim@epita.fr>
20267
20268 Some host fail on `assert (!"foo")', which expands to
20269 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
20270 Reported by Nelson Beebee.
20271
20272 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
20273 `#define it_succeeded 0' and `assert (it_succeeded)'.
20274
202752001-12-17 Marc Autret <autret_m@epita.fr>
20276
20277 * src/bison.simple: Don't hard code the skeleton line and filename.
20278 * src/output.c (output_parser): Rename 'line' as 'output_line'.
20279 New line counter 'skeleton_line' (skeleton-line muscle).
20280
202812001-12-17 Paul Eggert <eggert@twinsun.com>
20282
20283 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
20284 YYDEBUG must be defined to a nonzero value.
20285
20286 * src/bison.simple (yytname): Do not assume that the user defines
20287 YYDEBUG to a properly parenthesized expression.
20288
202892001-12-17 Akim Demaille <akim@epita.fr>
20290
20291 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
20292 nlookaheads is a new member.
20293 Adjust all users.
20294 * src/lalr.h (nlookaheads): Remove this orphan declaration.
20295 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
20296 state.
20297
202982001-12-17 Akim Demaille <akim@epita.fr>
20299
20300 * src/files.h, src/files.c (open_files, close_files): Remove.
20301 * src/main.c (main): Don't open/close files, nor invoke lex_free,
20302 let...
20303 * src/reader.c (reader): Do it.
20304
203052001-12-17 Akim Demaille <akim@epita.fr>
20306
20307 * src/conflicts.c (print_reductions): Formatting changes.
20308
203092001-12-17 Akim Demaille <akim@epita.fr>
20310
20311 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
20312 (flush_reduce): New.
20313 (resolve_sr_conflict): Adjust.
20314
203152001-12-17 Akim Demaille <akim@epita.fr>
20316
20317 * src/output.c (output_obstack): Be static and rename as...
20318 (format_obstack): this, to avoid any confusion with files.c's
20319 output_obstack.
20320 * src/reader.h (muscle_obstack): Move to...
20321 * src/output.h: here, since it's defined in output.c.
20322
203232001-12-17 Akim Demaille <akim@epita.fr>
20324
20325 * src/output.c (action_row, save_column, default_goto)
20326 (sort_actions, matching_state, pack_vector): Better variable
20327 locality.
20328
203292001-12-17 Akim Demaille <akim@epita.fr>
20330
20331 * src/output.c: Various formatting changes.
20332
203332001-12-17 Akim Demaille <akim@epita.fr>
20334
20335 * src/files.c (output_files): Free the output_obstack.
20336 * src/main.c (main): Call print and print_graph conditionally.
20337 * src/print.c (print): Work unconditionally.
20338 * src/print_graph.c (print_graph): Work unconditionally.
20339 * src/conflicts.c (log_resolution): Output only if verbose_flag.
20340
203412001-12-16 Marc Autret <autret_m@epita.fr>
20342
20343 * src/output.c (actions_output): Fix. When we use %no-lines,
20344 there is one less line per action.
20345
203462001-12-16 Marc Autret <autret_m@epita.fr>
20347
20348 * src/bison.simple: Remove a useless #line directive.
20349 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
20350 * src/output.c (get_lines_number): New.
20351 (output_parser): Adjust, now takes care about the lines of a
20352 output muscles.
20353 Fix line numbering.
20354 (actions_output): Computes the number of lines taken by actions.
20355 (output_master_parser): Insert new skeleton which is the name of
20356 the output parser file name.
20357
203582001-12-15 Marc Autret <autret_m@epita.fr>
20359
20360 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
20361
203622001-12-15 Marc Autret <autret_m@epita.fr>
20363
20364 * src/output.c (output_gram): Keep track of the hairy one.
20365
203662001-12-15 Akim Demaille <akim@epita.fr>
20367
20368 Make `make distcheck' work.
20369
20370 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
20371 system.h which uses libgettext.h.
20372
203732001-12-15 Akim Demaille <akim@epita.fr>
20374
20375 * src/nullable.c (set_nullable): Useless rules must be skipped,
20376 otherwise, since we range over their symbols, we might look at a
20377 nonterminal which no longer ``exists'', i.e., it is not counted in
20378 `nvars', hence we overflow our arrays.
20379
203802001-12-15 Akim Demaille <akim@epita.fr>
20381
20382 The header can also be produced directly, without any obstack!
20383 Yahoo!
20384
20385 * src/files.c, src/files.h (defines_obstack): Remove.
20386 (compute_header_macro): Global.
20387 (defines_obstack_save): Remove.
20388 * src/reader.c (parse_union_decl): No longer output to
20389 defines_obstack: its content can be found in the `stype' muscle
20390 anyway.
20391 (output_token_translations): Merge into...
20392 (symbols_output): this.
20393 Rename as...
20394 (symbols_save): this.
20395 (reader): Adjust.
20396 * src/output.c (header_output): New.
20397 (output): Call it.
20398
203992001-12-15 Akim Demaille <akim@epita.fr>
20400
20401 * src/reader.c (parse_union_decl): Instead of handling two obstack
20402 simultaneously, use one to define the `stype' muscle, and use the
20403 value of the latter to fill defines_obstack.
20404 (copy_comment): Remove.
20405 (copy_comment2): Work for a single obstack.
20406 Rename as...
20407 (copy_comment): this.
20408
204092001-12-15 Akim Demaille <akim@epita.fr>
20410
20411 * src/lex.c, src/lex.h (xgetc): No longer static.
20412 * src/reader.c (parse_union_decl): Revamp.
20413
204142001-12-15 Akim Demaille <akim@epita.fr>
20415
20416 Still making progress in separating Bison into (i) input, (ii)
20417 process, (iii) output: now we can directly output the parser file
20418 without using table_obstack at all.
20419
20420 * src/files.c, src/files.h (table_obstack): Bye bye.
20421 (parser_file_name): New.
20422 * src/files.c (compute_output_file_names): Compute it.
20423 * src/output.c (actions_output, output_parser)
20424 (output_master_parser): To a file instead of an obstack.
20425
204262001-12-15 Akim Demaille <akim@epita.fr>
20427
20428 Attach actions to rules, instead of pre-outputting them to
20429 actions_obstack.
20430
20431 * src/gram.h (rule_t): action and action_line are new members.
20432 * src/reader.c (symbol_list): Likewise.
20433 (copy_action): Save the actions within the rule.
20434 (packgram): Save them in rule_table.
20435 * src/output.c (actions_output): New.
20436 (output_parser): Use it on `%%actions'.
20437 (output_rule_data): Don't free rule_table.
20438 (output): Do it.
20439 (prepare): Don't save the `action' muscle.
20440 * src/bison.simple: s/%%action/%%actions/.
20441
204422001-12-15 Akim Demaille <akim@epita.fr>
20443
20444 * src/reader.c (copy_action): When --yacc, don't append a `;'
20445 to the user action: let it fail if lacking.
20446 Suggested by Arnold Robbins and Tom Tromey.
20447
204482001-12-14 Akim Demaille <akim@epita.fr>
20449
20450 * src/lex.c (literalchar): Simply return the char you decoded, non
20451 longer mess around with obstacks and int pointers.
20452 Adjust all callers.
20453
204542001-12-14 Akim Demaille <akim@epita.fr>
20455
20456 * src/lex.c (literalchar): Don't escape the special characters,
20457 just decode them, and keep them as char (before, eol was output as
20458 the 2 char string `\n' etc.).
20459 * src/output.c (output_rule_data): Use quotearg to output the
20460 token strings.
20461
204622001-12-13 Paul Eggert <eggert@twinsun.com>
20463
20464 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
20465 Do not infringe on the global user namespace when using C++.
20466 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
20467 All uses of `fprintf' and `stderr' changed.
20468
20469 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
20470
204712001-12-13 Akim Demaille <akim@epita.fr>
20472
20473 The computation of nullable is broken: it doesn't handle empty
20474 RHS's properly.
20475
20476 * tests/torture.at (GNU AWK Grammar): New.
20477 * tests/sets.at (Nullable): New.
20478 * src/nullable.c (set_nullable): Instead of blindly looping over
20479 `ritems', loop over the rules, and then over their rhs's.
20480
20481 Work around Autotest bugs.
20482
20483 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
20484 frame, because Autotest understand lines starting with a `+' as
20485 traces from the shell. Then, they are not processed properly.
20486 Admittedly an Autotest bug, but we don't have time to wait for
20487 Autotest to catch up.
20488 * tests/regression.at (Broken Closure): Adjust to the new table
20489 frames.
20490 Move to...
20491 * tests/sets.at: here.
20492
204932001-12-13 Akim Demaille <akim@epita.fr>
20494
20495 * src/closure.c (closure): Use nrules instead of playing tricks
20496 with BITS_PER_WORD.
20497
204982001-12-13 Akim Demaille <akim@epita.fr>
20499
20500 * src/print.c (print_actions): Output the handling of `$' as the
20501 traces do: shifting the token EOF. Before EOF was treated as a
20502 nonterminal.
20503 * tests/regression.at: Adjust some tests.
20504 * src/print_graph.c (print_core): Complete the set of items via
20505 closure. The next-to-final and final states are still unsatisfying,
20506 but that's to be addressed elsewhere.
20507 No longer output the rule numbers, but do output the state number.
20508 A single loop for the shifts + gotos is enough, but picked a
20509 distinct color for each.
20510 (print_graph): Initialize and finalize closure.
20511
205122001-12-13 Akim Demaille <akim@epita.fr>
20513
20514 * src/reader.c (readgram): Remove dead code, an strip useless
20515 braces.
20516 (get_type): Remove, unused.
20517
205182001-12-12 Akim Demaille <akim@epita.fr>
20519
20520 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
20521 on that of lib/error.c.
20522
205232001-12-12 Akim Demaille <akim@epita.fr>
20524
20525 Some hosts don't like `/' in includes.
20526
20527 * src/system.h: Include libgettext.h without qualifying the path.
20528 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
20529 $(top_srcdir).
20530
205312001-12-11 Marc Autret <autret_m@epita.fr>
20532
20533 * src/output.c (output_parser): Remove useless muscle.
20534
205352001-12-11 Marc Autret <autret_m@epita.fr>
20536
20537 * src/bison.simple: Remove #line just before %%epilogue. It
20538 is now handled in ...
20539 * src/reader.c (read_additionnal_code): Add the output of a
20540 #line for the epilogue.
20541
205422001-12-10 Marc Autret <autret_m@epita.fr>
20543
20544 * src/reader.c (copy_definition): Re-use CPP-outed code which
20545 replace precedent remove.
20546 * src/bison.simple: Remove #line before %%prologue because
20547 %%input-line is wrong at this time.
20548
205492001-12-10 Marc Autret <autret_m@epita.fr>
20550
20551 * src/reader.c (symbols_output): Clean up.
20552 * src/output.c (output_gram, output): Clean up.
20553
205542001-12-10 Akim Demaille <akim@epita.fr>
20555
20556 * src/lalr.c (initialize_lookaheads): New. Extracted from...
20557 * src/LR0.c (set_state_table): here.
20558 * src/lalr.c (lalr): Call it.
20559
205602001-12-10 Akim Demaille <akim@epita.fr>
20561
20562 * src/state.h (shifts): Remove the `number' member: shifts are
20563 attached to state, hence no longer need to be labelled with a
20564 state number.
20565
205662001-12-10 Akim Demaille <akim@epita.fr>
20567
20568 Now that states have a complete set of members, the linked list of
20569 shifts is useless: just fill directly the state's shifts member.
20570
20571 * src/state.h (shifts): Remove the `next' member.
20572 * src/LR0.c (first_state, last_state): Remove.
20573 Adjust the callers.
20574 (augment_automaton): Don't look for the shifts that must be added
20575 a shift on EOF: it is those of the state we looked for! But now,
20576 since shifts are attached, it is no longer needed to looking
20577 merely by its id: its number.
20578
205792001-12-10 Akim Demaille <akim@epita.fr>
20580
20581 * src/LR0.c (augment_automaton): Better variable locality.
20582 Remove an impossible branch: if there is a state corresponding to
20583 the start symbol being shifted, then there is shift for the start
20584 symbol from the initial state.
20585
205862001-12-10 Akim Demaille <akim@epita.fr>
20587
20588 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
20589 only when appropriate: when insert_start_shifting_state' is not
20590 invoked.
20591 * tests/regression.at (Rule Line Numbers): Adjust.
20592
205932001-12-10 Akim Demaille <akim@epita.fr>
20594
20595 * src/LR0.c (augment_automaton): Now that all states have shifts,
20596 merge the two cases addition shifts to the initial state.
20597
205982001-12-10 Akim Demaille <akim@epita.fr>
20599
20600 * src/lalr.c (set_state_table): Move to...
20601 * src/LR0.c: here.
20602 * src/lalr.c (lalr): Don't call it...
20603 * src/LR0.c (generate_states): do it.
20604 * src/LR0.h (first_state): Remove, only the table is used.
20605
206062001-12-10 Akim Demaille <akim@epita.fr>
20607
20608 * src/LR0.h (first_shift, first_reduction): Remove.
20609 * src/lalr.c: Don't use first_shift: find shifts through the
20610 states.
20611
206122001-12-10 Akim Demaille <akim@epita.fr>
20613
20614 * src/LR0.c: Attach shifts to states as soon as they are
20615 computed.
20616 * src/lalr.c (set_state_table): Instead of assigning shifts to
20617 state, just assert that the mapping was properly done.
20618
206192001-12-10 Akim Demaille <akim@epita.fr>
20620
20621 * src/LR0.c (insert_start_shift): Rename as...
20622 (insert_start_shifting_state): this.
20623 (insert_eof_shifting_state, insert_accepting_state): New.
20624 (augment_automaton): Adjust.
20625 Better locality of the variables.
20626 When looking if the start_symbol is shifted from the initial
20627 state, using `while (... symbol != start_symbol ...)' sounds
20628 better than `while (... symbol < start_symbol ...)': If fail
20629 to see how the order between symbols could be relevant!
20630
206312001-12-10 Akim Demaille <akim@epita.fr>
20632
20633 * src/getargs.h: Don't declare `spec_name_prefix' and
20634 `spec_file_prefix', declared by src/files.h.
20635 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
20636 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
20637 * src/output.c (prepare): Adjust.
20638 * src/reader.c (symbols_output): Likewise.
20639 * src/vmsgetargs.c: Vaguely adjust, but who cares?
20640
206412001-12-10 Akim Demaille <akim@epita.fr>
20642
20643 * src/muscle_tab.c (muscle_init): NULL is a better default than
20644 `"0"'.
20645
206462001-12-10 Akim Demaille <akim@epita.fr>
20647
20648 * src/reader.c (reader): Calling symbols_output once is enough.
20649
206502001-12-10 Akim Demaille <akim@epita.fr>
20651
20652 Now that states have a complete set of members, the linked list of
20653 reductions is useless: just fill directly the state's reductions
20654 member.
20655
20656 * src/state.h (struct reductions): Remove member `number' and
20657 `next'.
20658 * src/LR0.c (first_reduction, last_reduction): Remove.
20659 (save_reductions): Don't link the new reductions, store them in
20660 this_state.
20661 * src/lalr.c (set_state_table): No need to attach reductions to
20662 states, it's already done.
20663 * src/output.c (output_actions): No longer free the shifts, then
20664 the reductions, then the states: free all the states and their
20665 members.
20666
206672001-12-10 Akim Demaille <akim@epita.fr>
20668
20669 * src/options.c (OPTN, DRTV, BOTH): New.
20670 (option_table): Use them.
20671
20672 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
20673 the job of system.h.
20674 * src/options.c: Don't include stdio.h and xalloc.h for the same
20675 reasons.
20676
206772001-12-10 Akim Demaille <akim@epita.fr>
20678
20679 * src/output.c (output, prepare): Make sure the values of the
20680 muscles `action' and `prologue' are 0-terminated.
20681
206822001-12-10 Akim Demaille <akim@epita.fr>
20683
20684 Clean up GCC warnings.
20685
20686 * src/reader.c (copy_action): `buf' is not used.
20687 (parse_skel_decl): Be static.
20688 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
20689 * src/options.h (create_long_option_table): Have a real prototype.
20690 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
20691 (hash_delete_at): Return const void *.
20692 Adjust casts to preserve the const.
20693
206942001-12-10 Akim Demaille <akim@epita.fr>
20695
20696 * configure.in: Require 2.52g.
20697 M4 is not needed, but AUTOM4TE is.
20698 * m4/m4.m4: Remove.
20699 * tests/Makefile.am: Adjust.
20700
207012001-12-10 Akim Demaille <akim@epita.fr>
20702
20703 One structure for states is enough, even though theoretically
20704 there are LR(0) states and LALR(1) states.
20705
20706 * src/lalr.h (state_t): Remove.
20707 (state_table): Be state_t **, not state_t *.
20708 * src/state.h (core, CORE_ALLOC): Rename as...
20709 (state_t, STATE_ALLOC): this.
20710 Add the LALR(1) members: shifts, reductions, errs.
20711 * src/LR0.c (state_table): Rename as...
20712 (state_hash): this, to avoid name clashes with the global
20713 `state_table'.
20714 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
20715 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
20716
207172001-12-10 Akim Demaille <akim@epita.fr>
20718
20719 Bison dumps core on bash.y.
20720 Reported by Pascal Bart.
20721
20722 * src/warshall.c (bitmatrix_print): New.
20723 (TC): Use it.
20724 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
20725 j must be the outer loop.
20726 * tests/regression.at (Broken Closure): New.
20727
207282001-12-05 Akim Demaille <akim@epita.fr>
20729
20730 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
20731 its argument.
20732 Reported by Peter Hamorsky.
20733
207342001-12-05 Akim Demaille <akim@epita.fr>
20735
20736 * src/conflicts.c (err_table): Remove.
20737 (resolve_sr_conflict): Adjust.
20738 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
20739 Rename as...
20740 (state_t.reductions, state_t.shifts): this.
20741
207422001-12-05 Akim Demaille <akim@epita.fr>
20743
20744 * src/reduce.c (reduce_grammar_tables): No longer disable the
20745 removal of useless rules via CPP but via `if (0)', so that the
20746 compiler still check the code is valid.
20747 For instance, it should have noticed `rline' no longer exists: use
20748 the `line' member of rule_t.
20749 * src/gram.c (dummy, rline): Remove, unused.
20750
207512001-12-05 Akim Demaille <akim@epita.fr>
20752
20753 * src/output.c (pack_vector): Use assert, not berror.
20754 * src/main.c (berror): Remove, unused.
20755
207562001-12-05 Akim Demaille <akim@epita.fr>
20757
20758 New experimental feature: if --verbose --trace output all the
20759 items of a state, not only its kernel.
20760
20761 * src/print.c (print_core): If `trace_flag', then invoke closure
20762 before outputting the items of the state (print_core is no longer
20763 a correct name them).
20764 (print_results): Invoke new_closure/free_closure if needed.
20765
207662001-12-05 Akim Demaille <akim@epita.fr>
20767
20768 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
20769 * src/closure.c, src/closure.h (itemsetsize): Rename as...
20770 (nitemset): for consistency with the rest of the project.
20771
207722001-12-05 Akim Demaille <akim@epita.fr>
20773
20774 * src/closure.c (print_closure): Improve.
20775 (closure): Use it for printing input and output.
20776
207772001-12-05 Akim Demaille <akim@epita.fr>
20778
20779 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
20780 indexed by nonterminals.
20781
207822001-12-05 Akim Demaille <akim@epita.fr>
20783
20784 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
20785 what it was!).
20786 * src/warshall.h: Remove accidental duplication of the content.
20787
207882001-12-05 Akim Demaille <akim@epita.fr>
20789
20790 * src/closure.c (set_fderives): De-obfuscate.
20791
207922001-12-05 Akim Demaille <akim@epita.fr>
20793
20794 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
20795
207962001-12-05 Akim Demaille <akim@epita.fr>
20797
20798 * src/closure.c (set_firsts): De-obfuscate.
20799
208002001-12-05 Akim Demaille <akim@epita.fr>
20801
20802 * src/output.c (action_row): De-obfuscate
20803 using the good o' techniques: arrays not pointers, variable
20804 locality, BITISSET, RESETBIT etc.
20805
208062001-12-05 Akim Demaille <akim@epita.fr>
20807
20808 Pessimize the code to simplify it: from now on, all the states
20809 have a valid SHIFTS, which NSHIFTS is possibly 0.
20810
20811 * src/LR0.c (shifts_new): Be global and move to..
20812 * src/state.c, src/state.h: here.
20813 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
20814 * src/print_graph: Adjust.
20815
208162001-12-05 Akim Demaille <akim@epita.fr>
20817
20818 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
20819 * src/conflicts.c: Use it.
20820 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
20821 incorrectly ``simplified''.
20822
208232001-12-05 Akim Demaille <akim@epita.fr>
20824
20825 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
20826 using the good o' techniques: arrays not pointers, variable
20827 locality, BITISSET, RESETBIT etc.
20828
208292001-12-05 Akim Demaille <akim@epita.fr>
20830
20831 * src/state.h (SHIFT_SYMBOL): New.
20832 * src/conflicts.c: Use it to deobfuscate.
20833
208342001-12-05 Akim Demaille <akim@epita.fr>
20835
20836 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
20837 (print_reductions): De-obfuscate using the good o' techniques:
20838 arrays not pointers, variable locality, BITISSET.
20839
208402001-12-05 Akim Demaille <akim@epita.fr>
20841
20842 * src/conflicts.c (print_reductions): Arrays, not pointers.
20843 Use BITISSET.
20844
208452001-12-05 Akim Demaille <akim@epita.fr>
20846
20847 * src/conflicts.c (print_reductions): Pessimize, but clarify.
20848
208492001-12-05 Akim Demaille <akim@epita.fr>
20850
20851 * src/conflicts.c (print_reductions): Improve variable locality.
20852
208532001-12-05 Akim Demaille <akim@epita.fr>
20854
20855 * src/conflicts.c (print_reductions): Pessimize, but clarify.
20856
208572001-12-05 Akim Demaille <akim@epita.fr>
20858
20859 * src/conflicts.c (print_reductions): Improve variable locality.
20860
208612001-12-05 Akim Demaille <akim@epita.fr>
20862
20863 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
20864 * src/lalr.c: Use them.
20865
208662001-12-05 Akim Demaille <akim@epita.fr>
20867
20868 * src/LR0.c (augment_automaton): Formatting changes.
20869 Better variable locality.
20870
208712001-12-05 Akim Demaille <akim@epita.fr>
20872
20873 * src/lalr.c (matrix_print): New.
20874 (transpose): Use it.
20875 Use arrays instead of pointers.
20876
208772001-12-05 Akim Demaille <akim@epita.fr>
20878
20879 * src/lalr.c (maxrhs): Move to...
20880 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
20881 * src/lalr.c (build_relations): Adjust.
20882
208832001-12-05 Akim Demaille <akim@epita.fr>
20884
20885 * src/lalr.c (transpose): Free the memory allocated to the
20886 argument, as it is replaced by the results by the unique caller.
20887 (build_relations): Merely invoke transpose: it handles the memory
20888 deallocation.
20889 Improve variable locality.
20890 Avoid variables used as mere abbreviations.
20891 (compute_lookaheads): Use arrays instead of pointers.
20892
208932001-12-05 Akim Demaille <akim@epita.fr>
20894
20895 * src/lalr.c (initialize_F): Improve variable locality.
20896 Avoid variables used as mere abbreviations.
20897
208982001-12-05 Akim Demaille <akim@epita.fr>
20899
20900 * src/derives.c (print_derives): Display the ruleno.
20901 * src/lalr.c (initialize_F, transpose): Better variable locality
20902 to improve readability.
20903 Avoid variables used as mere abbreviations.
20904
209052001-12-05 Akim Demaille <akim@epita.fr>
20906
20907 * src/lalr.c (traverse): Use arrays instead of pointers.
20908
209092001-12-05 Akim Demaille <akim@epita.fr>
20910
20911 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
20912 the handling of squeue.
20913 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
20914
209152001-12-05 Akim Demaille <akim@epita.fr>
20916
20917 Because useless nonterminals are now kept alive (instead of being
20918 `destroyed'), we now sometimes examine them, and store information
20919 related to them. Hence we need to know their number, and adjust
20920 memory allocations.
20921
20922 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
20923 static.
20924 * src/LR0.c (allocate_itemsets): The memory allocated to
20925 `symbol_count' was used for two different purpose: once to count
20926 the number of occurrences of each symbol, and later reassigned to
20927 `shift_symbol', containing the symbol that can be shifted from a
20928 given state.
20929 Deobfuscate, i.e., allocate, use and free `symbol_count' here
20930 only, and...
20931 (new_itemsets): Allocate `shift_symbol' here.
20932 (allocate_itemsets): symbol_count includes useless nonterminals.
20933 Make room for them.
20934 (free_storage): Use `free', not `XFREE', for pointers that cannot
20935 be null.
20936
209372001-12-05 Akim Demaille <akim@epita.fr>
20938
20939 * src/nullable.c (set_nullable): Deobfuscate the handling of
20940 ritem.
20941 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
20942
209432001-12-05 Akim Demaille <akim@epita.fr>
20944
20945 * src/gram.c, src/gram.h (ritem_print): New.
20946 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
20947 (This useless function was defined only to work around VMS linkers
20948 that can't handle compilation units with variables only).
20949 * src/reduce.c (dump_grammar): Use it to trace the construction of
20950 ritem.
20951
209522001-12-04 Paul Eggert <eggert@twinsun.com>
20953
20954 * src/bison.simple (union yyalloc): Change member names
20955 to be the same as the stack names.
20956 (yyparse): yyptr is now union yyalloc *, not char *.
20957 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
20958 and may generate better code on some machines.
20959 (yystpcpy): Use prototype if __STDC__ is defined, not just
20960 if __cplusplus is defined.
20961
209622001-11-30 Akim Demaille <akim@epita.fr>
20963
20964 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
20965 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
20966 Gettext doesn't compile cleanly, and dies with -Werror.
20967 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
20968 Include WARNING_CFLAGS here.
20969 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
20970 before being defined.
20971
209722001-11-27 Paul Eggert <eggert@twinsun.com>
20973
20974 * lib/quotearg.h (quotearg_n, quotearg_n_style):
20975 First arg is int, not unsigned.
20976 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
20977 (SIZE_MAX, UINT_MAX): New macros.
20978 (quotearg_n_options): Abort if N is negative.
20979 Avoid overflow check on hosts where size_t is 64 bits and int
20980 is 32 bits, as overflow is impossible there.
20981 Fix off-by-one typo that caused unnecessary reallocation.
20982
209832001-11-29 Paul Eggert <eggert@twinsun.com>
20984
20985 Name space cleanup in generated parser.
20986
20987 * doc/bison.texinfo (Bison Parser): Discuss system headers
20988 and their effect on the user name space.
20989
20990 * src/bison.simple:
20991 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
20992 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
20993 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
20994
20995 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
20996 on user names when possible.
20997
20998 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
20999 Simplify test for whather <alloca.h> exists.
21000
21001 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
21002
21003 (<stdio.h>): Include if YYDEBUG.
21004
21005 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
21006 ! defined (yyoverflow) && ! defined (yymemcpy).
21007
21008 (yymemcpy, yyparse): Rename local variables as needed so that
21009 they all begin with 'yy'.
21010
21011 (yystrlen, yystpcpy): New functions.
21012
21013 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
21014 All uses changed.
21015
21016 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
21017 instead of relying on string.h functions. Use YYSTACK_ALLOC
21018 and YYSTACK_FREE instead of malloc and free.
21019
210202001-11-30 Akim Demaille <akim@epita.fr>
21021
21022 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
21023 before their first uses.
21024 (YYBISON, YYPURE): Move to the top of the output.
21025
210262001-11-30 Akim Demaille <akim@epita.fr>
21027
21028 * tests/reduce.at (Useless Nonterminals): Fix.
21029
210302001-11-30 Akim Demaille <akim@epita.fr>
21031
21032 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
21033 if body instead of `;' to pacify GCC's warnings.
21034
210352001-11-30 Akim Demaille <akim@epita.fr>
21036
21037 Instead of mapping the LHS of unused rules to -1, keep the LHS
21038 valid, but flag the rules as invalid.
21039
21040 * src/gram.h (rule_t): `useful' is a new member.
21041 * src/print.c (print_grammar): Adjust.
21042 * src/derives.c (set_derives): Likewise.
21043 * src/reader.c (packgram, reduce_output): Likewise.
21044 * src/reduce.c (reduce_grammar_tables): Likewise.
21045 * tests/reduce.at (Underivable Rules, Useless Rules): New.
21046
210472001-11-30 Akim Demaille <akim@epita.fr>
21048
21049 * src/reduce.c (reduce_output): Formatting changes.
21050 * src/print.c (print_results, print_grammar): Likewise.
21051 * tests/regression.at (Rule Line Numbers)
21052 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
21053
210542001-11-30 Akim Demaille <akim@epita.fr>
21055
21056 * src/reduce.c (nonterminals_reduce): Instead of throwing away
21057 useless nonterminals, move them at the end of the symbol arrays.
21058 (reduce_output): Adjust.
21059 * tests/reduce.at (Useless Nonterminals): Adjust.
21060
210612001-11-30 Akim Demaille <akim@epita.fr>
21062
21063 * src/reduce.c: Various comment/formatting changes.
21064 (nonterminals_reduce): New, extracted from...
21065 (reduce_grammar_tables): here.
21066 (reduce_grammar): Call nonterminals_reduce.
21067
210682001-11-29 Paul Eggert <eggert@twinsun.com>
21069
21070 * src/bison.simple (YYSTACK_REALLOC): Remove.
21071 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
21072 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
21073 New macros.
21074 (union yyalloc): New type.
21075 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
21076 an arbitrary restriction on hosts where size_t is wider than int.
21077
21078 (yyparse): Don't dump core if alloca or malloc fails; instead, report
21079 a parser stack overflow. Allocate just one block of memory for all
21080 three stacks, instead of allocating three blocks; this typically is
21081 faster and reduces fragmentation.
21082
21083 Do not limit the number of items in the stack to a value that fits
21084 in 'int', as this is an arbitrary limit on hosts with 64-bit
21085 size_t and 32-bit int.
21086
210872001-11-29 Marc Autret <autret_m@epita.fr>
21088
21089 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
21090 of defining YYERROR_VERBOSE.
21091 [AT_DATA]: $4 is now out of C declarations in the prologue.
21092
210932001-11-28 Marc Autret <autret_m@epita.fr>
21094
21095 * src/reader.c (parse_dquoted_param): New.
21096 (parse_skel_decl): Use it.
21097 * src/lex.h: Add its prototype.
21098 * src/lex.c (literalchar): Become not static.
21099
211002001-11-28 Marc Autret <autret_m@epita.fr>
21101
21102 * src/output.h: And put its extern declaration here.
21103 * src/output.c (error_verbose): Define here.
21104 (prepare): Echo name modification.
21105 * src/getargs.h: Clean its extern declaration.
21106 * src/getargs.c (error_verbose_flag): Remove.
21107 (getargs): Remove case 'e'.
21108 * src/options.c (option_table): 'error-verbose' is now seen as simple
21109 percent option.
21110 Include output.h.
21111
21112 * src/reader.c (read_declarations): Remove case tok_include.
21113 (parse_include_decl): Remove.
21114 * src/lex.h (token_t): Remove tok_include.
21115 * src/options.c (option_table): 'include' is now a simple command line
21116 option.
21117
211182001-11-28 Marc Autret <autret_m@epita.fr>
21119
21120 * src/bison.simple: Adjust muscle names.
21121 * src/muscle_tab.c (muscle_init): Also rename the muscles.
21122 * src/output.c (prepare): s/_/-/ for the muscles names.
21123 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
21124
211252001-11-28 Marc Autret <autret_m@epita.fr>
21126
21127 * src/bison.simple: Fix debug.
21128 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
21129
211302001-11-28 Akim Demaille <akim@epita.fr>
21131
21132 * src/LR0.c (shifts_new): New.
21133 (save_shifts, insert_start_shift, augment_automaton): Use it.
21134
211352001-11-28 Akim Demaille <akim@epita.fr>
21136
21137 * src/closure.c (closure): `b' and `ruleno' denote the same value:
21138 keep ruleno only.
21139
211402001-11-28 Akim Demaille <akim@epita.fr>
21141
21142 * src/closure.c (closure): Instead of looping over word in array
21143 then bits in words, loop over bits in array.
21144
211452001-11-28 Akim Demaille <akim@epita.fr>
21146
21147 * src/closure.c (closure): No longer optimize the special case
21148 where all the bits of `ruleset[r]' are set to 0, to make the code
21149 clearer.
21150
211512001-11-28 Akim Demaille <akim@epita.fr>
21152
21153 * src/closure.c (closure): `r' and `c' are new variables, used to
21154 de-obfuscate accesses to RULESET and CORE.
21155
211562001-11-28 Akim Demaille <akim@epita.fr>
21157
21158 * src/reduce.c (reduce_print): Use ngettext.
21159 (dump_grammar): Improve the trace accuracy.
21160
211612001-11-28 Akim Demaille <akim@epita.fr>
21162
21163 * src/reduce.c (dump_grammar): Don't translate trace messages.
21164
211652001-11-28 Akim Demaille <akim@epita.fr>
21166
21167 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
21168 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
21169 as all tags are free'ed afterwards.
21170 From Enrico Scholz.
21171
211722001-11-27 Paul Eggert <eggert@twinsun.com>
21173
21174 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
21175 use alloca when we didn't want to, and vice versa.
21176
211772001-11-27 Marc Autret <autret_m@epita.fr>
21178
21179 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
21180 initialization.
21181 * src/output.c (prepare): Remove its update.
21182
211832001-11-27 Marc Autret <autret_m@epita.fr>
21184
21185 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
21186 Use %error-verbose.
21187
211882001-11-27 Marc Autret <autret_m@epita.fr>
21189
21190 * src/bison.simple: Remove YYERROR_VERBOSE using.
21191 Use %%error_verbose.
21192 (yyparse): Likewise.
21193 * src/output.c (prepare): Give its final value.
21194 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
21195 * src/getargs.h: Add its extern declaration.
21196 * src/getargs.c (error_verbose_flag): New int.
21197 (getargs): Update to catch new case.
21198 * src/options.c (option_table): 'error-verbose' is a new option.
21199 (shortopts): Update.
21200
212012001-11-27 Akim Demaille <akim@epita.fr>
21202
21203 * src/system.h: Use intl/libgettext.h.
21204 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
21205
212062001-11-27 Akim Demaille <akim@epita.fr>
21207
21208 * tests/torture.at (Exploding the Stack Size with Malloc):
21209 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
21210
212112001-11-27 Akim Demaille <akim@epita.fr>
21212
21213 * src/files.c: Include error.h.
21214 Reported by Hans Aberg.
21215
212162001-11-26 Marc Autret <autret_m@epita.fr>
21217
21218 * src/reader.c (parse_include_decl): New, not yet implemented.
21219 (read_declarations): Add case tok_include.
21220 * src/getargs.h (include): Add its extern definition.
21221 * src/getargs.c (include): New const char *.
21222 (getargs): Add case '-I'.
21223 * src/options.c (option_table): Add include as command line and
21224 percent option.
21225 * src/lex.h (token_t): Add tok_include.
21226
212272001-11-26 Akim Demaille <akim@epita.fr>
21228
21229 * src/reader.c (readgram): Make sure rules for mid-rule actions
21230 have a lineno equal to that of their host rule.
21231 Reported by Hans Aberg.
21232 * tests/regression.at (Rule Line Numbers): New.
21233
212342001-11-26 Akim Demaille <akim@epita.fr>
21235
21236 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
21237 size_ts.
21238
212392001-11-26 Akim Demaille <akim@epita.fr>
21240
21241 * src/complain.c, src/complain.h (error): Remove, provided by
21242 lib/error.[ch].
21243
212442001-11-26 Akim Demaille <akim@epita.fr>
21245
21246 * src/reader.c (read_declarations): Don't abort on tok_illegal,
21247 issue an error message.
21248 * tests/regression.at (Invalid %directive): New.
21249 Reported by Hans Aberg.
21250
212512001-11-26 Akim Demaille <akim@epita.fr>
21252
21253 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
21254 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
21255
212562001-11-26 Akim Demaille <akim@epita.fr>
21257
21258 * src/conflicts.c (conflicts_print): Don't complain at all when
21259 there are no reduce/reduce conflicts, and as many shift/reduce
21260 conflicts as expected.
21261 * tests/regression.at (%expect right): Adjust.
21262
212632001-11-23 Akim Demaille <akim@epita.fr>
21264
21265 * lib/alloca.c: Update, from fileutils.
21266
212672001-11-23 Akim Demaille <akim@epita.fr>
21268
21269 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
21270
212712001-11-23 Akim Demaille <akim@epita.fr>
21272
21273 * src/system.h: Include alloca.h.
21274 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
21275
212762001-11-23 Akim Demaille <akim@epita.fr>
21277
21278 * src/print_graph.c (print_actions): Remove `rule', unused.
21279 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
21280 pacify GCC's signed < unsigned warnings.
21281 * src/closure.c (itemsetsize): Likewise.
21282 * src/reader.c (symbol_list_new): Static.
21283
212842001-11-23 Akim Demaille <akim@epita.fr>
21285
21286 Attaching lineno to buckets is stupid, since only one copy of each
21287 symbol is kept, only the line of the first occurrence is kept too.
21288
21289 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
21290 * src/reader.c (rline_allocated): Remove, unused.
21291 (symbol_list): Have a `line' member.
21292 (symbol_list_new): New.
21293 (readgram): Use it.
21294 * src/print.c (print_grammar): Output the rule line numbers.
21295 * tests/regression.at (Solved SR Conflicts)
21296 (Unresolved SR Conflicts): Adjust.
21297 Reported by Hans Aberg.
21298
212992001-11-22 Marc Autret <autret_m@epita.fr>
21300
21301 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
21302
213032001-11-22 Marc Autret <autret_m@epita.fr>
21304
21305 * src/muscle_tab.c (muscle_init): Remove initialization of
21306 skeleton muscle.
21307 * src/output.c (output_master_parser): Do it here.
21308
213092001-11-20 Akim Demaille <akim@epita.fr>
21310
21311 * po/sv.po: New.
21312 * configure.in (ALL_LINGUAS): Adjust.
21313 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
21314 longer contains strings to translate.
21315
213162001-11-19 Akim Demaille <akim@epita.fr>
21317
21318 * src/conflicts.c (conflicts_print): Add a missing \n.
21319
213202001-11-19 Akim Demaille <akim@epita.fr>
21321
21322 * src/nullable.c (nullable_print): New.
21323 (set_nullable): Call it when tracing.
21324 Better locality of variables.
21325
213262001-11-19 Akim Demaille <akim@epita.fr>
21327
21328 * src/print.c (print_actions): Better locality of variables.
21329
213302001-11-19 Akim Demaille <akim@epita.fr>
21331
21332 * src/derives.c (print_derives): Fix and enrich.
21333 * src/closure.c (print_fderives): Likewise.
21334
213352001-11-19 Akim Demaille <akim@epita.fr>
21336
21337 * src/closure.c (itemsetend): Remove, replaced with...
21338 (itemsetsize): new.
21339
213402001-11-19 Akim Demaille <akim@epita.fr>
21341
21342 * src/LR0.c (kernel_end): Remove, replaced with...
21343 (kernel_size): new.
21344
213452001-11-19 Akim Demaille <akim@epita.fr>
21346
21347 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
21348 to clarify.
21349
213502001-11-19 Akim Demaille <akim@epita.fr>
21351
21352 * src/closure.c (closure): Use arrays instead of pointers to clarify.
21353
213542001-11-19 Akim Demaille <akim@epita.fr>
21355
21356 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
21357 trace messages.
21358 * src/LR0.c: Likewise.
21359 (allocate_itemsets): Use arrays instead of pointers to clarify.
21360
213612001-11-19 Akim Demaille <akim@epita.fr>
21362
21363 * src/getargs.c (statistics_flag): Replace with...
21364 (trace_flag): New.
21365 (longopts): Accept --trace instead of --statistics.
21366 * src/getargs.h, src/options.c: Adjust.
21367 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
21368 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
21369
213702001-11-19 Akim Demaille <akim@epita.fr>
21371
21372 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
21373 pointers to clarify the code.
21374 (save_reductions, save_shifts): Factor common parts of alternatives.
21375
213762001-11-19 Akim Demaille <akim@epita.fr>
21377
21378 * src/LR0.c (new_state, get_state): Complete TRACE code.
21379 * src/closure.c: Include `reader.h' to get `tags', needed by the
21380 trace code.
21381 Rename the conditional DEBUG as TRACE.
21382 Output consistently TRACEs to stderr, not stdout.
21383 * src/derives.c: Likewise.
21384 * src/reduce.c: (inaccessable_symbols): Using if is better style
21385 than goto.
21386 Use `#if TRACE' instead of `#if 0' for tracing code.
21387
213882001-11-19 Akim Demaille <akim@epita.fr>
21389
21390 * src/system.h (LIST_FREE, shortcpy): New.
21391 * src/LR0.c: Use them.
21392 * src/output.c (free_itemsets, free_reductions, free_shifts):
21393 Remove, replaced by LIST_FREE.
21394
213952001-11-19 Akim Demaille <akim@epita.fr>
21396
21397 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
21398 (REDUCTIONS_ALLOC): New.
21399 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
21400 allocation.
21401
214022001-11-19 Akim Demaille <akim@epita.fr>
21403
21404 * src/LR0.c (new_state): Complete trace code.
21405 * src/nullable.c (set_nullable): Don't translate traces.
21406
214072001-11-19 Akim Demaille <akim@epita.fr>
21408
21409 * src/print_graph.c (print_core): Better locality of variables.
21410 * src/print.c (print_core): Likewise.
21411
214122001-11-19 Akim Demaille <akim@epita.fr>
21413
21414 * src/vcg.c: You do the output, so you are responsible of the
21415 handling of VCG syntax, in particular: use quotearg.
21416 * src/print_graph.c: Don't.
21417 (print_actions): Don't output the actions as part of the nodes,
21418 since that's the job of the edges.
21419 (print_state): Don't output by hand: fill the node description,
21420 and ask for its output.
21421
214222001-11-19 Akim Demaille <akim@epita.fr>
21423
21424 * src/bison.simple (yyparse): When verbosely reporting an error,
21425 no longer put additional quotes around token names.
21426 * tests/calc.at: Adjust.
21427
214282001-11-19 Akim Demaille <akim@epita.fr>
21429
21430 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
21431 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
21432 * src/output.c: Adjust.
21433
214342001-11-19 Akim Demaille <akim@epita.fr>
21435
21436 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
21437 (rule_t): this.
21438 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
21439
214402001-11-19 Akim Demaille <akim@epita.fr>
21441
21442 * src/gram.h (rule_t): New.
21443 (rule_table): New.
21444 (rrhs, rlhs): Remove, part of state_t.
21445 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
21446 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
21447 * src/reader.c, src/reduce.c: Adjust.
21448
214492001-11-19 Akim Demaille <akim@epita.fr>
21450
21451 * src/reader.c (symbols_output): New, extracted from...
21452 (packsymbols): Here.
21453 (reader): Call it.
21454
214552001-11-19 Akim Demaille <akim@epita.fr>
21456
21457 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
21458 (maxrhs): this new function.
21459
214602001-11-19 Akim Demaille <akim@epita.fr>
21461
21462 * src/lalr.c (F): New macro to access the variable F.
21463 Adjust.
21464
214652001-11-19 Akim Demaille <akim@epita.fr>
21466
21467 * src/lalr.h (LA): New macro to access the variable LA.
21468 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21469 * src/lalr.c: Adjust.
21470
214712001-11-19 Akim Demaille <akim@epita.fr>
21472
21473 * src/lalr.c (initialize_LA): Only initialize LA. Let...
21474 (set_state_table): handle the `lookaheads' members.
21475
214762001-11-19 Akim Demaille <akim@epita.fr>
21477
21478 * src/lalr.h (lookaheads): Removed array, whose contents is now
21479 a member of...
21480 (state_t): this structure.
21481 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21482 Adjust.
21483
214842001-11-19 Akim Demaille <akim@epita.fr>
21485
21486 * src/lalr.h (consistent): Removed array, whose contents is now
21487 a member of...
21488 (state_t): this structure.
21489 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21490 Adjust.
21491
214922001-11-19 Akim Demaille <akim@epita.fr>
21493
21494 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
21495 contents are now members of...
21496 (state_t): this structure.
21497 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21498 Adjust.
21499
215002001-11-19 Akim Demaille <akim@epita.fr>
21501
21502 * src/lalr.h (state_t): New.
21503 (state_table): Be a state_t * instead of a core **.
21504 (accessing_symbol): Remove, part of state_t.
21505 * src/lalr.c: Adjust.
21506 (set_accessing_symbol): Merge into...
21507 (set_state_table): this.
21508 * src/print_graph.c, src/conflicts.c: Adjust.
21509
215102001-11-14 Akim Demaille <akim@epita.fr>
21511
21512 * tests/calc.at, tests/output.at, tests/regression.at,
21513 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
21514 now the tests are run in private dirs, therefore AC_CLEANUP and
21515 family can be simplified to 0-ary.
21516 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
21517 use abs. path to find config.h.
21518 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
21519 stderr, there can be way too much random noise.
21520 Instead pass -Werror to GCC and rely on the exit status.
21521 Reported by Wolfram Wagner.
21522
215232001-11-14 Akim Demaille <akim@epita.fr>
21524
21525 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
21526 defined only if yyoverflow is defined, to avoid `warning: unused
21527 variable `yyvs1''.
21528 Reported by The Test Suite.
21529
215302001-11-14 Akim Demaille <akim@epita.fr>
21531
21532 * src/print.c: Include reduce.h.
21533 Reported by Hans Aberg.
21534
215352001-11-14 Akim Demaille <akim@epita.fr>
21536
21537 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
21538 Revert a previous patch: these are really const.
21539 * src/conflicts.c (conflict_report): Additional useless pair of
21540 braces to pacify GCC's warnings for `if () if () {} else {}'.
21541 * src/lex.c (parse_percent_token): Replace equal_offset with
21542 arg_offset.
21543 arg is const.
21544 Be sure to strdup `arg' when used, since there is no reason for
21545 token_buffer not to change.
21546
215472001-11-14 Akim Demaille <akim@epita.fr>
21548
21549 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
21550 definition.
21551 * src/main.c (main): Use them.
21552 Suggested by Hans Aberg.
21553
215542001-11-12 Akim Demaille <akim@epita.fr>
21555
21556 * src/system.h (ngettext): Now that we use ngettext, be sure to
21557 provide a default definition when NLS are not used.
21558
215592001-11-12 Akim Demaille <akim@epita.fr>
21560
21561 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
21562 Use @kbd to denote user input.
21563 (Language and Grammar): ANSIfy the example.
21564 Adjust its layout for info/notinfo.
21565 (Location Tracking Calc): Output error messages to stderr.
21566 Output locations in a more GNUtically correct way.
21567 Fix a couple of Englishos.
21568 Adjust @group/@end group pairs.
21569
215702001-11-12 Akim Demaille <akim@epita.fr>
21571
21572 %expect was not functioning at all.
21573
21574 * src/conflicts.c (expected_conflicts): Set to -1.
21575 (conflict_report): Use ngettext.
21576 (conflicts_print): Check %expect and make its violation an error.
21577 * doc/bison.texinfo (Expect Decl): Adjust.
21578 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
21579 * tests/regression.at (%expect not enough, %expect right)
21580 (%expect too much): New.
21581
215822001-11-12 Akim Demaille <akim@epita.fr>
21583
21584 * tests/regression.at (Conflicts): Rename as...
21585 (Unresolved SR Conflicts): this.
21586 (Solved SR Conflicts): New.
21587
215882001-11-12 Akim Demaille <akim@epita.fr>
21589
21590 * src/reduce.c (print_results): Rename as...
21591 (reduce_output): This.
21592 Output to OUT, passed as argument, instead of output_obstack.
21593 (dump_grammar): Likewise.
21594 (reduce_free): New.
21595 Also free V1.
21596 (reduce_grammar): No longer call reduce_output, since...
21597 * src/print.c (print_results): do it.
21598 * src/main.c (main): Call reduce_free;
21599
216002001-11-12 Akim Demaille <akim@epita.fr>
21601
21602 * src/conflicts.c (print_reductions): Accept OUT as argument.
21603 Output to it, not to output_obstack.
21604 * src/print.c (print_actions): Adjust.
21605
216062001-11-12 Akim Demaille <akim@epita.fr>
21607
21608 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
21609 the result instead of using...
21610 (src_total, rrc_total, src_count, rrc_count): Remove.
21611 (any_conflicts): Remove.
21612 (print_conflicts): Split into...
21613 (conflicts_print, conflicts_output): New.
21614 * src/conflicts.h: Adjust.
21615 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
21616 * src/print.c (print_grammar): Issue `\n' between two rules.
21617 * tests/regression.at (Conflicts): New.
21618 Reported by Tom Lane.
21619
216202001-11-12 Akim Demaille <akim@epita.fr>
21621
21622 * tests/regression.at (Invalid input): Remove, duplicate with
21623 ``Invalid input: 1''.
21624
216252001-11-12 Akim Demaille <akim@epita.fr>
21626
21627 * tests/torture.at (AT_DATA_STACK_TORTURE)
21628 (Exploding the Stack Size with Alloca)
21629 (Exploding the Stack Size with Malloc): New.
21630
216312001-11-12 Akim Demaille <akim@epita.fr>
21632
21633 * src/bison.simple (YYSTACK_REALLOC): New.
21634 (yyparse) [!yyoverflow]: Use it and free the old stack.
21635 Reported by Per Allansson.
21636
216372001-11-12 Pascal Bart <pascal.bart@epita.fr>
21638
21639 * src/bison.simple: Define type yystype instead of YYSTYPE, and
21640 define CPP macro, which substitute YYSTYPE by yystype.
21641 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
21642 with yyltype/YYLTYPE. This allows inclusion of the generated
21643 header within the parser if the compiler, such as GGC, accepts
21644 multiple equivalent #defines.
21645 From Akim.
21646
216472001-11-05 Akim Demaille <akim@epita.fr>
21648
21649 * src/reader.c (symbols_output): New, extracted from...
21650 (packsymbols): here.
21651 (reader): Adjust.
21652
216532001-11-05 Akim Demaille <akim@epita.fr>
21654
21655 * src/lex.c (parse_percent_token): s/quotearg/quote/.
21656
216572001-11-05 Akim Demaille <akim@epita.fr>
21658
21659 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
21660 pattern.
21661
216622001-11-05 Akim Demaille <akim@epita.fr>
21663
21664 * src/options.h (struct option_table_struct): set_flags is void*.
21665 * src/options.c (longopts): Support `--output' and `%output'.
21666 (usage): Adjust.
21667 * src/lex.h (tok_setopt): Remove, replaced with...
21668 (tok_intopt, tok_stropt): these new guys.
21669 * src/lex.c (getopt.h): Not needed.
21670 (token_buffer, unlexed_token_buffer): Not const.
21671 (percent_table): Promote `-' over `_' in directive names.
21672 Active `%name-prefix', `file-prefix', and `output'.
21673 (parse_percent_token): Accept possible arguments to directives.
21674 Promote `-' over `_' in directive names.
21675
216762001-11-04 Akim Demaille <akim@epita.fr>
21677
21678 * doc/bison.texinfo (Decl Summary): Split the list into
21679 `directives for grammars' and `directives for bison'.
21680 Sort'em.
21681 Add description of `%name-prefix', `file-prefix', and `output'.
21682 Promote `-' over `_' in directive names.
21683 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
21684 Simplify the description of `--name-prefix'.
21685 Promote `-' over `_' in directive names.
21686 Promote `--output' over `--output-file'.
21687 Fix the description of `--defines'.
21688 * tests/output.at: Exercise %file-prefix and %output.
21689
216902001-11-02 Akim Demaille <akim@epita.fr>
21691
21692 * doc/refcard.tex: Update.
21693
216942001-11-02 Akim Demaille <akim@epita.fr>
21695
21696 * src/symtab.h (SUNDEF): New.
21697 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
21698 stand for `uninitialized', instead of 0.
21699 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
21700 * src/lex.c (lex): Adjust.
21701
21702 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
21703 Number it 0.
21704 Let yylex return it instead of a plain 0.
21705 Reported by Dick Streefland.
21706
217072001-11-02 Akim Demaille <akim@epita.fr>
21708
21709 * tests/regression.at (Mixing %token styles): New test.
21710
217112001-11-02 Akim Demaille <akim@epita.fr>
21712
21713 * src/reader.c (parse_thong_decl): Formatting changes.
21714 (token_translations_init): New, extracted from...
21715 (packsymbols): Here.
21716 Adjust.
21717
217182001-11-01 Akim Demaille <akim@epita.fr>
21719
21720 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
21721 Check that `9foo.y' produces correct cpp guards.
21722 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
21723 guards.
21724 Reported by Wwp.
21725
217262001-11-01 Akim Demaille <akim@epita.fr>
21727
21728 * tests/regression.at (Invalid input: 2): New.
21729 * src/lex.c (unlexed_token_buffer): New.
21730 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
21731 too.
21732 Reported by Wwp.
21733
217342001-11-01 Akim Demaille <akim@epita.fr>
21735
21736 * tests/calc.at: Catch up with 1.30.
21737 * configure.in: Bump to 1.49a.
21738 Adjust to newer Autotest.
21739
217402001-10-19 Pascal Bart <pascal.bart@epita.fr>
21741
21742 * src/conflicts.c: Move global variables rrc_total and src_total ...
21743 (print_conflicts): here.
21744 * src/output.c (output): Free global variable user_toknums.
21745 * src/lex.c (token_obstack): Become static.
21746
217472001-10-18 Akim Demaille <akim@epita.fr>
21748
21749 * tests/atlocal.in (GCC): Add.
21750 * tests/calc.at: s/m4_match/m4_bmatch/.
21751 s/m4_patsubst/m4_bpatsubst/.
21752 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
21753 * configure.in: AC_SUBST(GCC).
21754
217552001-10-14 Marc Autret <autret_m@epita.fr>
21756
21757 * src/options.c (create_long_option_table): Fix.
21758
217592001-10-10 Akim Demaille <akim@epita.fr>
21760
21761 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
21762
217632001-10-04 Akim Demaille <akim@epita.fr>
21764
21765 * src/reader.c (parse_union_decl): Push the caracters in
21766 union_obstack, not attrs_obstack.
21767
217682001-10-04 Akim Demaille <akim@epita.fr>
21769
21770 Merge in the branch 1.29.
21771
21772 * src/reader.c (packsymbols): Use a temporary obstack for
21773 `%%tokendef', since output_stack is already used elsewhere.
21774
21775 2001-10-02 Akim Demaille <akim@epita.fr>
21776
21777 Bump 1.29d.
21778
21779 2001-10-02 Akim Demaille <akim@epita.fr>
21780
21781 Version 1.29c.
21782
21783 2001-10-02 Akim Demaille <akim@epita.fr>
21784
21785 * tests/regression.at (Invalid CPP headers): New.
21786 From Alexander Belopolsky.
21787 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
21788
21789 2001-10-02 Akim Demaille <akim@epita.fr>
21790
21791 * tests/regression.at (Invalid input): New.
21792 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
21793 Reported by Shura.
21794
21795 2001-10-02 Akim Demaille <akim@epita.fr>
21796
21797 * tests/calc.at: Now that --debug works, the tests must be adjusted.
21798
21799 2001-10-02 Akim Demaille <akim@epita.fr>
21800
21801 * src/output.c (output_parser): Assert `skeleton'.
21802 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
21803 systems.
21804 From Shura.
21805
21806 2001-10-01 Marc Autret <autret_m@epita.fr>
21807
21808 * src/lex.h: Echo modifications.
21809 * src/lex.c (unlex): Parameter is now token_t.
21810 From Hans Aberg.
21811
21812 2001-10-01 Marc Autret <autret_m@epita.fr>
21813
21814 * src/main.c: Include lex.h.
21815 From Hans Aberg.
21816
21817 2001-09-29 Akim Demaille <akim@epita.fr>
21818
21819 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
21820
21821 2001-09-28 Akim Demaille <akim@epita.fr>
21822
21823 * tests/testsuite.at: Update to newer Autotest.
21824 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
21825
21826 2001-09-27 Akim Demaille <akim@epita.fr>
21827
21828 Position independent wrapper.
21829
21830 * tests/bison: Remove.
21831 * tests/bison.in: New.
21832 * configure.in: Adjust.
21833
21834 2001-09-27 Paul Eggert <eggert@twinsun.com>
21835
21836 Port quotearg fixes from tar 1.13.24.
21837
21838 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
21839 tm to be declared.
21840 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
21841 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
21842
21843 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
21844 * m4/mbrtowc.m4: New file.
21845 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
21846 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
21847
21848 2001-09-27 Akim Demaille <akim@epita.fr>
21849
21850 Bump to 1.29c.
21851
21852 2001-09-27 Akim Demaille <akim@epita.fr>
21853
21854 Version 1.29b.
21855
21856 2001-09-25 Akim Demaille <akim@epita.fr>
21857
21858 * src/system.h: Include `xalloc.h'.
21859 Remove it from the C files.
21860 * src/files.c (output_files): Free the obstacks.
21861 * src/lex.c (init_lex): Rename as...
21862 (lex_init): this.
21863 (lex_free): New.
21864 * src/main.c (main): Use it.
21865
21866 2001-09-24 Marc Autret <autret_m@epita.fr>
21867
21868 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
21869 to output informations in fout (FILE*).
21870 (open_graph, close_graph): Likewise.
21871 (output_graph, output_edge, output_node): Likewise.
21872 * src/vcg.h: Update function prototypes.
21873 * src/print_graph.c (print_graph): Open output graph file.
21874 (print_actions): Adjust.
21875 * src/files.h: Remove extern declaration.
21876 * src/files.c: Remove graph_obstack declaration.
21877 (open_files): Remove graph_obstack initialization.
21878 (output_files): Remove graph_obstack saving.
21879
21880 2001-09-24 Marc Autret <autret_m@epita.fr>
21881
21882 * src/files.c (compute_output_file_names): Fix.
21883
21884 2001-09-24 Marc Autret <autret_m@epita.fr>,
21885 Akim Demaille <akim@epita.fr>
21886
21887 * src/reader.c (reader): Remove call to free_symtab ().
21888 * src/main.c (main): Call it here.
21889 Include symtab.h.
21890 * src/conflicts.c (initialize_conflicts): Rename as...
21891 (solve_conflicts): this.
21892 * src/print.c (print_core, print_actions, print_state)
21893 (print_grammar): Dump to a file instead a `output_obstack'.
21894 (print_results): Dump `output_obstack', and then proceed with the
21895 FILE *.
21896 * src/files.c (compute_output_file_names, close_files): New.
21897 (output_files): Adjust.
21898 * src/main.c (main): Adjust.
21899
21900 2001-09-23 Marc Autret <autret_m@epita.fr>
21901
21902 * src/files.c (compute_header_macro): Computes header macro name
21903 from spec_defines_file when given.
21904
21905 2001-09-23 Marc Autret <autret_m@epita.fr>
21906
21907 * src/files.c (output_files): Add default extensions.
21908
21909 2001-09-22 Akim Demaille <akim@epita.fr>
21910
21911 * src/conflicts.c (finalize_conflicts): Rename as...
21912 (free_conflicts): this.
21913
21914 2001-09-22 Akim Demaille <akim@epita.fr>
21915
21916 * src/gram.c (gram_free): Rename back as...
21917 (dummy): this.
21918 (output_token_translations): Free `token_translations'.
21919 * src/symtab.c (free_symtab): Free the tag field.
21920
21921 2001-09-22 Akim Demaille <akim@epita.fr>
21922
21923 Remove `translations' as it is always set to true.
21924
21925 * src/gram.h: Adjust.
21926 * src/reader.c (packsymbols, parse_token_decl): Adjust
21927 * src/print.c (print_grammar): Adjust.
21928 * src/output.c (output_token_translations): Adjust.
21929 * src/lex.c (lex): Adjust.
21930 * src/gram.c: Be sure the set pointers to NULL.
21931 (dummy): Rename as...
21932 (gram_free): this.
21933
21934 2001-09-22 Akim Demaille <akim@epita.fr>
21935
21936 * configure.in: Invoke AM_LIB_DMALLOC.
21937 * src/system.h: Use dmalloc.
21938 * src/LR0.c: Be sure to have pointers initialized to NULL.
21939 (allocate_itemsets): Allocate kernel_items only if needed.
21940
21941 2001-09-22 Akim Demaille <akim@epita.fr>
21942
21943 * configure.in: Bump to 1.29b.
21944 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
21945 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
21946 need xmalloc.c in calc.y.
21947 From Pascal Bart.
21948
21949 2001-09-21 Akim Demaille <akim@epita.fr>
21950
21951 Version 1.29a.
21952 * Makefile.maint, config/config.guess, config/config.sub,
21953 * config/missing: Update from masters.
21954 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
21955 upon package.m4.
21956 * configure.in (ALL_LINGUAS): Add `tr'.
21957
21958 2001-09-21 Akim Demaille <akim@epita.fr>
21959
21960 * tests/Makefile.am (package.m4): Move to...
21961 ($(srcdir)/$(TESTSUITE)): here.
21962
21963 2001-09-20 Akim Demaille <akim@epita.fr>
21964
21965 * src/complain.c: No longer try to be standalone: use system.h.
21966 Don't assume __STDC__ is defined to 1. Just test if it is defined.
21967 * src/complain.h: Likewise.
21968 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
21969 Remove the unused variable `n'.
21970 From Albert Chin-A-Young.
21971
21972 2001-09-18 Marc Autret <autret_m@epita.fr>
21973
21974 * doc/bison.1: Update.
21975 * doc/bison.texinfo (Bison Options): Update --defines and --graph
21976 descriptions.
21977 (Option Cross Key): Update.
21978 Add --graph.
21979
21980 2001-09-18 Marc Autret <autret_m@epita.fr>
21981
21982 * tests/regression.at: New test (comment in %union).
21983
21984 2001-09-18 Marc Autret <autret_m@epita.fr>
21985
21986 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
21987 do that.
21988 Reported by Keith Browne.
21989
21990 2001-09-18 Marc Autret <autret_m@epita.fr>
21991
21992 * tests/output.at: Add tests for --defines and --graph.
21993
21994 2001-09-18 Marc Autret <autret_m@epita.fr>
21995
21996 * tests/output.at: Removes tests of %{header,src}_extension features.
21997
21998 2001-09-18 Akim Demaille <akim@epita.fr>
21999
22000 * tests/Makefile.am (package.m4): New.
22001 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
22002 (_AT_CHECK_CALC_ERROR): Likewise.
22003 Factor the `, ' part of verbose error messages.
22004
22005 2001-09-18 Marc Autret <autret_m@epita.fr>
22006
22007 * src/getargs.c (longopts): Declare --defines and --graph as options
22008 with optional arguments.
22009 * src/files.h: Add extern declarations.
22010 * src/files.c (spec_graph_file, spec_defines_file): New.
22011 (output_files): Update.
22012 Remove CPP-outed code.
22013
22014 2001-09-18 Marc Autret <autret_m@epita.fr>
22015
22016 Turn off %{source,header}_extension feature.
22017
22018 * src/files.c (compute_exts_from_gf): Update.
22019 (compute_exts_from_src): Update.
22020 (output_files): CPP-out useless code.
22021 * src/files.h: Remove {header,source}_extension extern declarations.
22022 * src/reader.c (parse_dquoted_param): CPP-out.
22023 (parse_header_extension_decl): Remove.
22024 (parse_source_extension_decl): Remove.
22025 (read_declarations): Remove cases tok_{hdrext,srcext}.
22026 * src/lex.c (percent_table): Remove {header,source}_extension entries.
22027 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
22028
22029 2001-09-10 Akim Demaille <akim@epita.fr>
22030
22031 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
22032 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
22033 (AT_CHECK_OUTPUT): this.
22034 Merely check ls' exit status, its output is useless.
22035
22036 2001-09-10 Akim Demaille <akim@epita.fr>
22037
22038 * tests/calc.at: Use m4_match.
22039 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
22040
22041 2001-09-10 Marc Autret <autret_m@epita.fr>,
22042 Akim Demaille <akim@epita.fr>
22043
22044 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
22045 enum color_e.
22046 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
22047 to `normal'.
22048 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
22049 * src/lex.h: Adjust prototype.
22050 (token_t): Add `tok_undef'.
22051 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
22052 (parse_percent_token): Now returns token_t.
22053 Add default statement in switch.
22054 (lex): Separate `c' as an input variable, from the token_t result
22055 part.
22056 (unlexed): Is a token_t.
22057
22058 2001-09-10 Akim Demaille <akim@epita.fr>
22059
22060 * configure.in: Bump to 1.29a.
22061
22062 2001-09-07 Akim Demaille <akim@epita.fr>
22063
22064 Version 1.29.
22065
22066 2001-08-30 Akim Demaille <akim@epita.fr>
22067
22068 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
22069 * m4/atconfig.m4: Remove.
22070 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
22071 * tests/bison: New.
22072 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
22073 m4_if, m4_patsubst, and m4_regexp.
22074 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
22075 `input' file instead of echo.
22076
22077 2001-08-29 Akim Demaille <akim@epita.fr>
22078
22079 Bump to 1.28e.
22080
22081 2001-08-29 Akim Demaille <akim@epita.fr>
22082
22083 Version 1.28d.
22084
22085 2001-08-29 Paul Eggert <eggert@twinsun.com>
22086
22087 * src/bison.simple (yyparse): Don't take the address of an
22088 item before the start of an array, as that doesn't conform to
22089 the C Standard.
22090
22091 2001-08-29 Robert Anisko <anisko_r@epita.fr>
22092
22093 * doc/bison.texinfo (Location Tracking Calc): New node.
22094
22095 2001-08-29 Paul Eggert <eggert@twinsun.com>
22096
22097 * src/output.c (output): Do not define const, as this now
22098 causes more problems than it cures.
22099
22100 2001-08-29 Akim Demaille <akim@epita.fr>
22101
22102 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
22103 the nodes.
22104 Be sure to tag the `detailmenu'.
22105
22106 2001-08-29 Akim Demaille <akim@epita.fr>
22107
22108 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
22109 download in a tmp dir.
22110
22111 2001-08-28 Marc Autret <autret_m@epita.fr>
22112
22113 * config/depcomp: New file.
22114
22115 2001-08-28 Marc Autret <autret_m@epita.fr>
22116
22117 * doc/bison.1 (mandoc): Adjust.
22118 From Juan Manuel Guerrero.
22119
22120 2001-08-28 Marc Autret <autret_m@epita.fr>
22121
22122 * src/print_graph.c (print_state): Fix.
22123
22124 2001-08-27 Marc Autret <autret_m@epita.fr>
22125
22126 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
22127 char * members.
22128 Echo modifications to the functions prototypes.
22129 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
22130
22131 2001-08-27 Marc Autret <autret_m@epita.fr>
22132
22133 * src/vcg.c: Include `xalloc.h'.
22134 (add_colorentry): New.
22135 (add_classname): New.
22136 (add_infoname): New.
22137 * src/vcg.h: Add new prototypes.
22138
22139 2001-08-27 Akim Demaille <akim@epita.fr>
22140
22141 * Makefile.maint: Sync. again with CVS Autoconf.
22142
22143 2001-08-27 Akim Demaille <akim@epita.fr>
22144
22145 * Makefile.maint: Formatting changes.
22146 (po-update, cvs-update, update): New targets.
22147 (AMTAR): Remove.
22148
22149 2001-08-27 Akim Demaille <akim@epita.fr>
22150
22151 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
22152 * Makefile.maint: Sync. with CVS Autoconf.
22153
22154 2001-08-27 Marc Autret <autret_m@epita.fr>
22155
22156 * src/vcg.h (struct infoname_s): New.
22157 (struct colorentry_s): New.
22158 (graph_s): New fields {vertical,horizontal}_order in structure.
22159 Add `infoname' field.
22160 Add `colorentry' field;
22161 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
22162 (G_HORIZONTAL_ORDER): New.
22163 (G_INFONAME): New.
22164 (G_COLORENTRY): New.
22165 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
22166 Add output of `infoname'.
22167 Add output of `colorentry'.
22168
22169 2001-08-27 Marc Autret <autret_m@epita.fr>
22170
22171 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
22172 This one shadowed a global parameter.
22173
22174 2001-08-24 Marc Autret <autret_m@epita.fr>
22175
22176 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
22177 instead of `unsigned'.
22178 (print_state): Do not call obstack_object_size () in obstack_grow ()
22179 to avoid macro variables shadowing.
22180
22181 2001-08-23 Marc Autret <autret_m@epita.fr>
22182
22183 * src/lex.c (percent_table): Typo: s/naem/name/.
22184 Add graph option.
22185 Normalize new options declarations.
22186
22187 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
22188
22189 * tests/suite.at: Exercise %header_extension and %source_extension.
22190
22191 2001-08-16 Marc Autret <autret_m@epita.fr>
22192
22193 * src/reader.c (parse_dquoted_param): New.
22194 (parse_header_extension_decl): Use it.
22195 (parse_source_extension_decl): Likewise.
22196
22197 2001-08-16 Marc Autret <autret_m@epita.fr>
22198
22199 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
22200 (get_xxxx_str): Use assert () instead of complain ().
22201 Remove return invokations in default cases.
22202 (get_decision_str): Modify default behaviour. Remove second argument.
22203 Echo modifications on calls.
22204 (output_graph): Fix.
22205
22206 2001-08-16 Marc Autret <autret_m@epita.fr>
22207
22208 * src/getargs.c (usage): Update with ``-g, --graph''.
22209
22210 2001-08-16 Marc Autret <autret_m@epita.fr>
22211
22212 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
22213 (Option Cross Key): Likewise.
22214 * doc/bison.1: Update.
22215
222162001-09-25 Pascal Bart <pascal.bart@epita.fr>
22217
22218 * src/output.c (output_master_parser): Don't finish action_obstack.
22219 (output_parser): Don't care about the muscle action, here.
22220 (prepare): Copy the action_obstack in the action muscle.
22221 (output): Free action_obstack.
22222
222232001-09-23 Pascal Bart <pascal.bart@epita.fr>
22224
22225 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
22226 will contain `%union' declaration.
22227 (parse_union_decl): Delete #line directive output.
22228 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
22229 informations about %union.
22230 (parse_union_decl): Copy the union_obstack in the muscle stype.
22231 * src/bison.simple: Add new #line directive.
22232 Add typdef %%stype YYSTYPE.
22233
222342001-09-23 Pascal Bart <pascal.bart@epita.fr>
22235
22236 * src/bison.simple: Add new `#line' directive.
22237
222382001-09-22 Pascal Bart <pascal.bart@epita.fr>
22239
22240 * src/bison.simple: New `#line' directive.
22241 * src/output.c (output_parser): Support new dynamic muscle input_line.
22242
222432001-09-22 Marc Autret <autret_m@epita.fr>
22244
22245 * src/output.c (output_master_parser): New.
22246 (output_parser): Be more re-entrant.
22247
222482001-09-21 Marc Autret <autret_m@epita.fr>
22249
22250 * src/reader.c (copy_definition, parse_union_decl): Update and use
22251 `linef' muscle.
22252 (copy_action): Likewise.
22253 Use obstack_1grow ().
22254 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
22255
222562001-09-21 Marc Autret <autret_m@epita.fr>
22257
22258 * src/options.c (option_table): Adjust.
22259 * src/lex.c (parse_percent_token): Fix.
22260
222612001-09-20 Pascal Bart <pascal.bart@epita.fr>
22262
22263 * src/options.c (symtab.h): Include it, need by lex.h.
22264
222652001-09-20 Pascal Bart <pascal.bart@epita.fr>
22266
22267 * src/lex.c (parse_percent_token): Change type of variable `tx', which
22268 is now an option_table_struct*.
22269 (option_strcmp): New function option_strcmp.
22270 (parse_percent_token): Call option_strcmp.
22271 * src/getargs.c (xalloc.h, options.h): Include it.
22272 (getargs): Call create_long_option_table.
22273 (getargs): Free longopts at the end of the function.
22274 (shortopts): Move in options.c.
22275 * src/options.c (create_long_option_table): New function. Convert
22276 information from option_table to option structure.
22277 * src/reader.c (options.h): Include it.
22278
22279 * src/Makefile.am: Adjust.
22280 * src/options.c (option_table): Create from longopts and percent_table.
22281 * src/getargs.c (longopts): Delete.
22282 * src/lex.c (struct percent_table_struct): Delete.
22283 (percent_table): Delete.
22284 (options.h): Include it.
22285 * src/options.c: Create.
22286 * src/options.h: Create.
22287 Declare enum opt_access_e.
22288 Define struct option_table_struct.
22289
222902001-09-20 Marc Autret <autret_m@epita.fr>
22291
22292 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
22293 sections of Bison.
22294
222952001-09-19 Pascal Bart <pascal.bart@epita.fr>
22296
22297 * src/bison.simple: s/%%filename/%%skeleton.
22298 * src/muscle_tab.c (getargs.h): Include it.
22299 (muscle_init): Insert new muscle skeleton.
22300
223012001-09-18 Pascal Bart <pascal.bart@epita.fr>
22302
22303 * src/output.c (output_parser): Delete unused variable actions_dumped.
22304
223052001-09-07 Pascal Bart <pascal.bart@epita.fr>
22306
22307 * src/output.c (output): Delete call to reader_output_yylsp.
22308 * src/reader.c (reader): Likewise.
22309 * src/reader.h: Delete declaration of reader_output_yylsp.
22310
223112001-09-02 Marc Autret <autret_m@epita.fr>
22312
22313 * src/reader.c: Include muscle_tab.h.
22314 (parse_union_decl): Update.
22315 (parse_macro_decl): Rename parse_muscle_decl.
22316 Update to use renamed functions and variable.
22317 (read_declarations, copy_action, read_additionnal_code, : Updated
22318 with correct variables and functions names.
22319 (packsymbols, reader): Likewise.
22320
22321 * src/reader.h (muscle_obstack): Extern declaration update.
22322
22323 * src/output.c: Include muscle_tab.h
22324 In all functions using macro_insert, change by using muscle_insert ().
22325 (macro_obstack): Rename muscle_obstack.
22326 Echo modifications in the whole file.
22327 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
22328 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
22329 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
22330
22331 * src/muscle_tab.h: Update double inclusion macros.
22332 (macro_entry_s): Rename muscle_entry_s.
22333 Update prototypes.
22334
22335 * src/muscle_tab.c: Include muscle_tab.h.
22336 Rename macro_tabble to muscle_table.
22337 (mhash1, mhash2, mcmp): Use muscle_entry.
22338 (macro_init): Rename muscle_init. Update.
22339 (macro_insert): Rename muscle_insert. Update.
22340 (macro_find): Rename muscle_find. Update.
22341
22342 * src/main.c: Include muscle_tab.h.
22343 (main): Call muscle_init ().
22344 * src/Makefile.am (bison_SOURCES): Echo modifications.
22345
223462001-09-02 Marc Autret <autret_m@epita.fr>
22347
22348 Now the files macro_tab.[ch] are named muscle_tab.[ch].
22349
22350 * src/muscle_tab.c, src/muscle_tab.h: Add files.
22351
223522001-09-02 Marc Autret <autret_m@epita.fr>
22353
22354 * src/macrotab.c, src/macrotab.h: Remove.
22355
223562001-09-01 Pascal Bart <pascal.bart@epita.fr>
22357
22358 * src/reader.c (copy_guard): Use muscle to specify the `#line'
22359 filename.
22360
223612001-09-01 Marc Autret <autret_m@epita.fr>
22362
22363 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
22364 to an explicit value to activate the feature. We do it here.
22365
223662001-08-31 Pascal Bart <pascal.bart@epita.fr>
22367
22368 * src/output.c (prepare): Delete the `filename' muscule insertion.
22369 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
22370 (parse_union_decl): Likewise.
22371 * src/macrotab.c (macro_init): Initialize filename by infile.
22372
223732001-08-31 Marc Autret <autret_m@epita.fr>
22374
22375 * src/bison.simple (YYLSP_NEEDED): New definition.
22376 * src/output.c (prepare): Add macro insertion of `locations_flag'
22377
223782001-08-31 Pascal Bart <pascal.bart@epita.fr>
22379
22380 * src/output.c (prepare): Delete insertion of previous muscles,
22381 and insert the `prefix' muscles.
22382 * src/macrotab.c (macro_init): Likewise.
22383 (macro_init): Initialization prefix directive by `yy'.
22384 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
22385 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
22386 yylval, yydebug, yyerror, yynerrs and yyparse.
22387 New directive `#define' to substitute yydebug, ... with option
22388 name_prefix.
22389
223902001-08-31 Pascal Bart <pascal.bart@epita.fr>
22391
22392 * src/main.c (main): Standardize.
22393 * src/output.c (output_table_data, output_parser): Likewise.
22394 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
22395
223962001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
22397
22398 * src/reader.c (read_additionnal_code): Rename %%user_code to
22399 %%epilogue.
22400 * src/output.c (output): Rename %%declarations to %%prologue.
22401 * src/bison.simple: Echo modifications.
22402
224032001-08-31 Marc Autret <autret_m@epita.fr>
22404
22405 * src/reader.c (readgram): CleanUp.
22406 (output_token_defines): Likewise.
22407 (packsymbols): Likewise.
22408 (reader): Likewise.
22409 * src/output.c (output): CPP-out useless code.
22410
224112001-08-31 Pascal Bart <pascal.bart@epita.fr>
22412
22413 * src/reader.c (reader): Delete obsolete call to function
22414 output_trailers and output_headers.
22415 * src/output.h: Remove obsolete functions prototypes of output_headers
22416 and output_trailers.
22417
224182001-08-30 Pascal Bart <pascal.bart@epita.fr>
22419
22420 * src/main.c: Include macrotab.h.
22421 * src/macrotab.h (macro_entry_s): Constify fields.
22422 Adjust functions prototypes.
22423 * src/macrotab.c (macro_insert): Constify key and value.
22424 (macro_find): Constify key.
22425 (macro_insert): Include 'xalloc.h'
22426 (macro_insert): Use XMALLOC.
22427 (macro_find): Constify return value.
22428 * src/output.c (output_table_data): Rename table to table_data.
22429 (output_parser): Constify macro_key, macro_value.
22430
224312001-08-30 Marc Autret <autret_m@epita.fr>
22432
22433 * src/reader.c (parse_skel_decl): New.
22434 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
22435 * src/lex.h (token_t): New token `tok_skel'.
22436 * src/lex.c (percent_table): Add skeleton option entry.
22437 Standardize.
22438
224392001-08-29 Marc Autret <autret_m@epita.fr>
22440
22441 * src/bison.simple: Add %%user_code directive at the end.
22442 * src/reader.c (read_additionnal_code): New.
22443 (reader): Use it.
22444 * src/output.c (output_program): Remove.
22445 (output): Update.
22446
224472001-08-28 Marc Autret <autret_m@epita.fr>
22448
22449 * src/output.c (output_actions): Clean up.
22450 (output_gram): CPP-out useless code.
22451 * src/reader.c (reader): Clean up, CPP-out useless code.
22452
224532001-08-28 Pascal Bart <pascal.bart@epita.fr>
22454
22455 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
22456 directive.
22457 * src/bison.simple: Add `%%definitions'.
22458
224592001-08-28 Marc Autret <autret_m@epita.fr>
22460
22461 * config/depcomp: New file.
22462
224632001-08-27 Paul Eggert <eggert@twinsun.com>
22464
22465 * src/bison.simple (yyparse): Don't take the address of an
22466 item before the start of an array, as that doesn't conform to
22467 the C Standard.
22468
224692001-08-27 Robert Anisko <robert.anisko@epita.fr>
22470
22471 * src/output.c (output): Remove the initialization of the macro
22472 obstack. It was done too late here.
22473
22474 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
22475 completely wrong.
22476 (reader): Initialize the macro obstack here, since we need it to grow
22477 '%define' directives.
22478
22479 * src/reader.h: Declare the macro obstack as extern.
22480
224812001-08-27 Robert Anisko <robert.anisko@epita.fr>
22482
22483 * src/output.c (output_parser): Fix. Store single '%' characters in
22484 the output obstack instead of throwing them away.
22485
224862001-08-27 Akim Demaille <akim@epita.fr>
22487
22488 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
22489
224902001-08-25 Robert Anisko <robert.anisko@epita.fr>
22491
22492 * lib/Makefile.am: Adjust.
22493
224942001-08-25 Robert Anisko <robert.anisko@epita.fr>
22495
22496 * src/bison.simple: Update and add '%%' directives.
22497
224982001-08-25 Robert Anisko <robert.anisko@epita.fr>
22499
22500 * src/reader.c (reader): Remove calls to 'output_headers' and
22501 'output_trailers'. Remove some C output.
22502 (readgram): Disable a piece of code that was writing a default
22503 definition for 'YYSTYPE'.
22504 (reader_output_yylsp): Remove.
22505 (packsymbols): Output token defintions to a macro.
22506 (copy_definition): Disable C output.
22507
22508 * src/reader.c (parse_macro_decl): New function used to parse macro
22509 declarations.
22510 (copy_string2): Put the body of copy_string into this new function.
22511 Add a parameter to let the caller choose whether he wants to copy the
22512 string delimiters or not.
22513 (copy_string): Be a simple call to copy_string2 with the last argument
22514 bound to true.
22515 (read_declarations): Add case for macro definition.
22516 (copy_identifier): New.
22517 (parse_macro_decl): Read macro identifiers using copy_identifier
22518 rather than lex.
22519
225202001-08-25 Robert Anisko <robert.anisko@epita.fr>
22521
22522 * src/output.c (prepare): Add prefixed names.
22523 (output_parser): Output semantic actions.
22524 (output_parser): Fix bug on '%%line' directives.
22525
22526 * src/output.c (output_headers): Remove. The C code printed by this
22527 function should now be in the skeletons.
22528 (output_trailers): Remove.
22529 (output): Disable call to 'reader_output_yylsp'.
22530 (output_rule_data): Do not output tables to the table obstack.
22531
22532 * src/output.c: Remove some C dedicated output.
22533 Improve the use of macro and output obstacks.
22534 (output_defines): Remove.
22535
22536 * src/output.c (output_token_translations): Associate 'translate'
22537 table with a macro. No output to the table obstack.
22538 (output_gram): Same for 'rhs' and 'prhs'.
22539 (output_stos): Same for 'stos'.
22540 (output_rule_data): Same for 'r1' and 'r2'.
22541 (token_actions): Same for 'defact'.
22542 (goto_actions): Same for 'defgoto'.
22543 (output_base): Same for 'pact' and 'pgoto'.
22544 (output_table): Same for 'table'.
22545 (output_check): Same for 'check'.
22546
22547 * src/output.c (output_table_data): New function.
22548 (output_short_table): Remove.
22549 (output_short_or_char_table): Remove.
22550
22551 * src/output.c (output_parser): Replace most of the skeleton copy code
22552 with something new. Skeletons are now processed character by character
22553 rather than line by line, and Bison looks for '%%' macros. This is the
22554 first step in making Bison's output process (a lot) more flexible.
22555 (output_parser): Use the macro table.
22556
225572001-08-25 Robert Anisko <robert.anisko@epita.fr>
22558
22559 * src/main.c (main): Initialize the macro table.
22560
225612001-08-25 Robert Anisko <robert.anisko@epita.fr>
22562
22563 * src/lex.c (percent_table): Add tok_define.
22564 * src/lex.h: Add tok_define.
22565
225662001-08-25 Robert Anisko <robert.anisko@epita.fr>
22567
22568 * src/macrotab.c: New file.
22569 * src/macrotab.h: New file.
22570 * src/Makefile.am: Update.
22571
225722001-08-25 Robert Anisko <robert.anisko@epita.fr>
22573
22574 * lib/hash.c: New file.
22575 * lib/hash.h: New file.
22576 * lib/Makefile.am: Update.
22577
225782001-08-15 Akim Demaille <akim@epita.fr>
22579
22580 Version 1.28c.
22581
225822001-08-15 Marc Autret <autret_m@epita.fr>
22583
22584 * src/reader.c (readgram): Indent output macro YYSTYPE.
22585 (packsymbols): Likewise.
22586 (output_token_defines): Likewise.
22587 * src/files.c: Standardize.
22588 (compute_header_macro): New.
22589 (defines_obstack_save): New. Use compute_header_macro.
22590 (output_files): Update. Use defines_obstack_save.
22591
225922001-08-15 Akim Demaille <akim@epita.fr>
22593
22594 * doc/bison.texinfo (Table of Symbols): Document
22595 YYSTACK_USE_ALLOCA.
22596
225972001-08-15 Akim Demaille <akim@epita.fr>
22598
22599 * missing: Update from CVS Automake.
22600 * config/config.guess, config/config.sub, config/texinfo.tex:
22601 Update from gnu.org.
22602
226032001-08-15 Akim Demaille <akim@epita.fr>
22604
22605 * Makefile.maint: Sync with CVS Autoconf.
22606
226072001-08-14 Pascal Bart <pascal.bart@epita.fr>
22608
22609 * doc/bison.texinfo: Include GNU Free Documentation License from
22610 `fdl.texi'.
22611 * doc/fdl.texi: Add to package.
22612
226132001-08-14 Marc Autret <autret_m@epita.fr>
22614
22615 Turn on %{source,header}_extension features.
22616
22617 * src/lex.c (percent_table): Un-CPP out header_extension and
22618 source_extension.
22619 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
22620 (compute_exts_from_src): Remove conditions. It restores priorities
22621 between options.
22622
226232001-08-14 Marc Autret <autret_m@epita.fr>
22624
22625 * src/files.c (compute_base_names): Add extensions computing when
22626 `--file-prefix' used.
22627 Standardize function calls.
22628
226292001-08-13 Marc Autret <autret_m@epita.fr>
22630
22631 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
22632 defining it (defined but null disables alloca).
22633
226342001-08-13 Marc Autret <autret_m@epita.fr>
22635
22636 * src/bison.simple (_yy_memcpy): CPP reformat.
22637
226382001-08-13 Pascal Bart <pascal.bart@epita.fr>
22639
22640 * tests/atconfig.in (CPPFLAGS): Fix.
22641
226422001-08-10 Pascal Bart <pascal.bart@epita.fr>
22643
22644 * doc/bison.texinfo: Include GNU General Public License from
22645 `gpl.texi'.
22646 * doc/gpl.texi: Add to package.
22647
226482001-08-10 Marc Autret <autret_m@epita.fr>
22649
22650 * src/print_graph.h: Fix.
22651 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
22652
226532001-08-10 Akim Demaille <akim@epita.fr>
22654
22655 * src/system.h: Provide default declarations for stpcpy, strndup,
22656 and strnlen.
22657
226582001-08-10 Robert Anisko <anisko_r@epita.fr>
22659
22660 * doc/bison.texinfo (Locations): Update @$ stuff.
22661
226622001-08-09 Robert Anisko <anisko_r@epita.fr>
22663
22664 * src/bison.simple (YYLLOC_DEFAULT): Update.
22665 (yyparse): Adjust.
22666
226672001-08-08 Marc Autret <autret_m@epita.fr>
22668
22669 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
22670 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
22671 Reported by Fabrice Bauzac.
22672
226732001-08-08 Marc Autret <autret_m@epita.fr>
22674
22675 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
22676 * src/vcg.c (output_node): Fix.
22677 * src/vcg.h: Cleanup.
22678 * src/print_graph.c: Add comments.
22679 (node_output_size): New global variable. Simplify the formatting of
22680 the VCG graph output.
22681 (print_actions): Unused code is now used. It notifies the final state
22682 and no action states in the VCG graph. It also give the reduce actions.
22683 The `shift and goto' edges are red and the `go to state' edges are
22684 blue.
22685 Get the current node name and node_obstack by argument.
22686 (node_obstack): New variable.
22687 (print_state): Manage node_obstack.
22688 (print_core): Use node_obstack given by argument.
22689 A node is not only computed here but in print_actions also.
22690 (print_graph): CPP out useless code instead of commenting it.
22691
226922001-08-07 Pascal Bart <pascal.bart@epita.fr>
22693
22694 * tests/atconfig.in (CPPFLAGS): Fix.
22695
226962001-08-07 Akim Demaille <akim@epita.fr>
22697
22698 * src/print_graph.c (quote): New.
22699 (print_core): Use it.
22700
227012001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
22702
22703 * src/vcg.c (complain.h): Include it.
22704 Unepitaize `return' invocations.
22705 [NDEBUG] (main): Remove.
22706 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
22707 * src/files.c (open_files): Initialize graph_obstack.
22708 * src/print_graph.c (print_actions): CPP out useless code.
22709 (print_core): Don't output the last `\n' in labels.
22710 Use `quote'.
22711 * src/files.c (output_files): Output the VCG file.
22712 * src/main.c (main): Invoke print_graph ();
22713
227142001-08-06 Marc Autret <autret_m@epita.fr>
22715
22716 Automaton VCG graph output.
22717 Using option ``-g'' or long option ``--graph'', you can generate
22718 a gram_filename.vcg file containing a VCG description of the LALR (1)
22719 automaton of your grammar.
22720
22721 * src/main.c: Call to print_graph() function.
22722 * src/getargs.h: Update.
22723 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
22724 (graph_flag): New flag.
22725 (longopts): Update.
22726 (getargs): Add case `g'.
22727 * src/files.c (graph_obstack): New obstack struct.
22728 (open_files): Initialize new obstack.
22729 (output_files): Saves graph_obstack if required.
22730 * src/files.h (graph_obstack): New extern declaration.
22731 * src/Makefile.am: Add new source files.
22732
227332001-08-06 Marc Autret <autret_m@epita.fr>
22734
22735 * src/print_graph.c, src/print_graph.h (graph): New.
22736 * src/vcg.h: New file.
22737 * src/vcg.c: New file, VCG graph handling.
22738
227392001-08-06 Marc Autret <autret_m@epita.fr>
22740
22741 Add of %source_extension and %header_extension which specify
22742 the source or/and the header output file extension.
22743
22744 * src/files.c (compute_base_names): Remove initialisation of
22745 src_extension and header_extension.
22746 (compute_exts_from_gf): Update.
22747 (compute_exts_from_src): Update.
22748 (output_files): Update.
22749 * src/reader.c (parse_header_extension_decl): New.
22750 (parse_source_extension_decl): New.
22751 (read_declarations): New case statements for the new tokens.
22752 * src/lex.c (percent_table): Add entries for %source_extension
22753 and %header_extension.
22754 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
22755
227562001-08-06 Marc Autret <autret_m@epita.fr>
22757
22758 * configure.in: Bump to 1.28c.
22759 * doc/bison.texinfo: Texinfo thingies.
22760
227612001-08-04 Pascal Bart <pascal.bart@epita.fr>
22762
22763 * tests/atconfig.in (CPPFLAGS): Add.
22764 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
22765
227662001-08-03 Akim Demaille <akim@epita.fr>
22767
22768 Version 1.28b.
22769
227702001-08-03 Akim Demaille <akim@epita.fr>
22771
22772 * tests/Makefile.am (check-local): Ship testsuite.
22773 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
22774 Include `string.h'.
22775
227762001-08-03 Akim Demaille <akim@epita.fr>
22777
22778 * configure.in: Try using -Wformat when compiling.
22779
227802001-08-03 Akim Demaille <akim@epita.fr>
22781
22782 * configure.in: Bump to 1.28b.
22783
227842001-08-03 Akim Demaille <akim@epita.fr>
22785
22786 * src/complain.c: Adjust strerror_r portability issues.
22787
227882001-08-03 Akim Demaille <akim@epita.fr>
22789
22790 Version 1.28a.
22791
227922001-08-03 Akim Demaille <akim@epita.fr>
22793
22794 * src/getargs.c, src/getarg.h (skeleton)): Constify.
22795 * src/lex.c (literalchar): Avoid name clashes on `buf'.
22796 * src/getargs.c: Include complain.h.
22797 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
22798 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
22799
228002001-08-03 Akim Demaille <akim@epita.fr>
22801
22802 * src/reader.c (readgram): Display hidden chars in error messages.
22803
228042001-08-03 Akim Demaille <akim@epita.fr>
22805
22806 Update to gettext 0.10.39.
22807
228082001-08-03 Akim Demaille <akim@epita.fr>
22809
22810 * lib/strspn.c: New.
22811
228122001-08-01 Marc Autret <autret_m@epita.fr>
22813
22814 * doc/bison.texinfo: Update.
22815 * doc/bison.1 (mandoc): Update.
22816 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
22817 * src/files.c: Support output files extensions computing.
22818 (src_extension): New static variable.
22819 (header_extension): New static variable.
22820 (tr): New function.
22821 (get_extension_index): New function, gets the index of an extension
22822 filename in a string.
22823 (compute_exts_from_gf): New function, computes extensions from the
22824 grammar file extension.
22825 (compute_exts_from_src): New functions, computes extensions from the
22826 C source file extension, file given by ``-o'' option.
22827 (compute_base_names): Update.
22828 (output_files): Update.
22829
228302001-08-01 Robert Anisko <anisko_r@epita.fr>
22831
22832 * doc/bison.texi: Document @$.
22833 (Locations): New section.
22834
228352001-07-18 Akim Demaille <akim@epita.fr>
22836
22837 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
22838 * config/prev-version.txt, config/move-if-change: New.
22839 * Makefile.am: Adjust.
22840
228412001-07-08 Pascal Bart <pascal.bart@epita.fr>
22842
22843 * src/bison.simple (yyparse): Suppress warning `comparaison
22844 between signed and unsigned'.
22845
228462001-07-05 Pascal Bart <pascal.bart@epita.fr>
22847
22848 * src/getargs.h (raw_flag): Remove.
22849 * src/getargs.c: Die on `-r'/`--raw'.
22850 * src/lex.c (parse_percent_token): Die on `%raw'.
22851 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
22852 * tests/calc.at: Suppress test with option `--raw'.
22853
228542001-07-14 Akim Demaille <akim@epita.fr>
22855
22856 * config/: New.
22857 * configure.in: Require Autoconf 2.50.
22858 Update to gettext 0.10.38.
22859
228602001-03-16 Akim Demaille <akim@epita.fr>
22861
22862 * doc/bison.texinfo: ANSIfy the examples.
22863
228642001-03-16 Akim Demaille <akim@epita.fr>
22865
22866 * getargs.c (skeleton): New variable.
22867 (longopts): --skeleton is a new option.
22868 (shortopts, getargs): -S is a new option.
22869 * getargs.h: Declare skeleton.
22870 * output.c (output_parser): Use it.
22871
228722001-03-16 Akim Demaille <akim@epita.fr>
22873
22874 * m4/strerror_r.m4: New.
22875 * m4/error.m4: Run AC_FUNC_STRERROR_R.
22876 * lib/error.h, lib/error.c: Update.
22877
228782001-03-16 Akim Demaille <akim@epita.fr>
22879
22880 * src/getargs.c (longopts): Clean up.
22881
228822001-02-21 Akim Demaille <akim@epita.fr>
22883
22884 * src/reader.c (gensym): `gensym_count' is your own.
22885 Use a static buf to create the symbol name, as token_buffer is no
22886 longer a buffer.
22887
228882001-02-08 Akim Demaille <akim@epita.fr>
22889
22890 * src/conflicts.c (conflict_report): Be sure not to append to res
22891 between two calls, which could happen if both first sprintf were
22892 skipped, but not the first cp += strlen.
22893
228942001-02-08 Akim Demaille <akim@epita.fr>
22895
22896 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
22897 New, from fileutils 4.0.37.
22898 * configure.in: Require Autoconf 2.49c. I took some time before
22899 making this decision. This is the only way out for portability
22900 issues in Bison, it would mean way too much duplicate effort to
22901 import in Bison features implemented in 2.49c since 2.13.
22902 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
22903
229042001-02-02 Akim Demaille <akim@epita.fr>
22905
22906 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
22907 * lib/xalloc.h, lib/xmalloc.c: Update.
22908
229092001-01-19 Akim Demaille <akim@epita.fr>
22910
22911 Get rid of the ad hoc handling of token_buffer in the scanner: use
22912 the obstacks.
22913
22914 * src/lex.c (token_obstack): New.
22915 (init_lex): Initialize it. No longer call...
22916 (grow_token_buffer): this. Remove it.
22917 Adjust all the places which used it to use the obstack.
22918
229192001-01-19 Akim Demaille <akim@epita.fr>
22920
22921 * src/lex.h: Rename all the tokens:
22922 s/\bENDFILE\b/tok_eof/g;
22923 s/\bIDENTIFIER\b/tok_identifier/g;
22924 etc.
22925 Let them be enums, not #define, to ease debugging.
22926 Adjust all the code.
22927
229282001-01-18 Akim Demaille <akim@epita.fr>
22929
22930 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
22931 * src/lex.c (maxtoken, grow_token_buffer): Static.
22932
229332001-01-18 Akim Demaille <akim@epita.fr>
22934
22935 Since we now use obstacks, more % directives can be enabled.
22936
22937 * src/lex.c (percent_table): Also accept `%yacc',
22938 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
22939 `%debug'.
22940 Handle the actions for `%semantic_parser' and `%pure_parser' here,
22941 instead of returning a token.
22942 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
22943 * src/reader.c (read_declarations): Adjust.
22944 * src/files.c (open_files): Don't call `compute_base_names', don't
22945 compute `attrsfile' since they depend upon data which might be
22946 *in* the input file now.
22947 (output_files): Do it here.
22948 * src/output.c (output_headers): Document the fact that this patch
22949 introduces a guaranteed SEGV for semantic parsers.
22950 * doc/bison.texinfo: Document them.
22951 * tests/suite.at: Exercise these %options.
22952
229532000-12-20 Akim Demaille <akim@epita.fr>
22954
22955 Also handle the output file (--verbose) with obstacks.
22956
22957 * files.c (foutput): Remove.
22958 (output_obstack): New.
22959 Adjust all dependencies.
22960 * src/conflicts.c: Return a string.
22961 * src/system.h (obstack_grow_string): Rename as...
22962 (obstack_sgrow): this. Be ready to work with non literals.
22963 (obstack_fgrow4): New.
22964
229652000-12-20 Akim Demaille <akim@epita.fr>
22966
22967 * src/files.c (open_files): Fix the computation of short_base_name
22968 in the case of `-o foo.tab.c'.
22969
229702000-12-20 Akim Demaille <akim@epita.fr>
22971
22972 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
22973 (copy_dollar): Now that everything uses obstacks, get rid of the
22974 FILE * parameters.
22975
229762000-12-20 Akim Demaille <akim@epita.fr>
22977
22978 * src/files.c (open_files): Actually the `.output' file is based
22979 on the short_base_name, not base_name.
22980 * tests/suite.at (Checking output file names): Adjust.
22981
229822000-12-20 Akim Demaille <akim@epita.fr>
22983
22984 * src/bison.s1: Remove, we now use directly...
22985 * src/bison.simple: this.
22986 * src/Makefile.am: Use pkgdata instead of data.
22987
229882000-12-20 Akim Demaille <akim@epita.fr>
22989
22990 * src/files.c (guard_obstack): New.
22991 (open_files): Initialize it.
22992 (output_files): Dump it...
22993 * src/files.h: Export it.
22994 * src/reader.c (copy_guard): Use it.
22995
229962000-12-19 Akim Demaille <akim@epita.fr>
22997
22998 * src/files.c (outfile, defsfile, actfile): Removed as global
22999 vars.
23000 (open_files): Don't compute them.
23001 (output_files): Adjust.
23002 (base_name, short_base_name): Be global.
23003 Adjust dependencies.
23004
230052000-12-19 Akim Demaille <akim@epita.fr>
23006
23007 * src/files.c (strsuffix): New.
23008 (stringappend): Be just like strcat but allocate.
23009 (base_names): Eve out from open_files.
23010 Try to simplify the rather hairy computation of base_name and
23011 short_base_name.
23012 (open_files): Use it.
23013 * tests/suite.at (Checking output file names): New test.
23014
230152000-12-19 Akim Demaille <akim@epita.fr>
23016
23017 * src/system.h (obstack_grow_literal_string): Rename as...
23018 (obstack_grow_string): this.
23019 * src/output.c (output_parser): Recognize `%% actions' instead of
23020 `$'.
23021 * src/bison.s1: s/$/%% actions/.
23022 * src/bison.hairy: Likewise.
23023
230242000-12-19 Akim Demaille <akim@epita.fr>
23025
23026 * src/output.c (output_parser): Compute the `#line' lines when
23027 there are.
23028 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
23029 Suggested by Hans Aberg.
23030
230312000-12-19 Akim Demaille <akim@epita.fr>
23032
23033 Let the handling of the skeleton files be local to the procedures
23034 that use it.
23035
23036 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
23037 longer static.
23038 (fparser, open_extra_files): Remove.
23039 (open_files, output_files): Don't take care of fparser.
23040 * src/files.h: Adjust.
23041 * src/output.c (output_parser): Open and close the file to the
23042 skeleton.
23043 * src/reader.c (read_declarations): When %semantic_parser, open
23044 fguard.
23045
230462000-12-19 Akim Demaille <akim@epita.fr>
23047
23048 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
23049 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
23050
230512000-12-19 Akim Demaille <akim@epita.fr>
23052
23053 * src/files.c (open_files): Yipee! We no longer need all the code
23054 looking for `/tmp' since we have no tmp file.
23055
230562000-12-19 Akim Demaille <akim@epita.fr>
23057
23058 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
23059 New macros.
23060 * src/files.c (open_files): Less dependency on MSDOS etc.
23061
230622000-12-14 Akim Demaille <akim@epita.fr>
23063
23064 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
23065 Provide a default definition.
23066 Use it when executing the default @ action.
23067 * src/reader.c (reader_output_yylsp): No longer include
23068 `timestamp' and `text' in the default YYLTYPE.
23069
230702000-12-12 Akim Demaille <akim@epita.fr>
23071
23072 * src/reader.c (copy_definition, parse_union_decl, copy_action)
23073 (copy_guard): Quote the file names.
23074 Reported by Laurent Mascherpa.
23075
230762000-12-12 Akim Demaille <akim@epita.fr>
23077
23078 * src/output.c (output_headers, output_program, output): Be sure
23079 to escape special characters when outputting filenames.
23080 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
23081 (output_headers): Don't depend on them, Use ACTSTR.
23082
230832000-11-17 Akim Demaille <akim@epita.fr>
23084
23085 * lib/obstack.h: Formatting changes.
23086 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
23087 prevents type checking.
23088 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
23089 cast the value to (void *): assigning a `foo *' to a `void *'
23090 variable is valid.
23091 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
23092 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
23093 append characters.
23094
230952000-11-17 Akim Demaille <akim@epita.fr>
23096
23097 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
23098 as...
23099 (suite.m4, regression.m4, calc.m4): these.
23100 * tests/atgeneral.m4: Update from CVS Autoconf.
23101
231022000-11-17 Akim Demaille <akim@epita.fr>
23103
23104 * tests/regression.m4 (%union and --defines): New test,
23105 demonstrating a current bug in the obstack implementation.
23106
231072000-11-17 Akim Demaille <akim@epita.fr>
23108
23109 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
23110 macros.
23111 Use them to declare the variables which are global or local to
23112 `yyparse'.
23113
231142000-11-17 Akim Demaille <akim@epita.fr>
23115
23116 * acconfig.h: Remove, no longer used.
23117
231182000-11-07 Akim Demaille <akim@epita.fr>
23119
23120 * src: s/Copyright (C)/Copyright/g.
23121
231222000-11-07 Akim Demaille <akim@epita.fr>
23123
23124 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
23125 defining.
23126 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
23127
231282000-11-07 Akim Demaille <akim@epita.fr>
23129
23130 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
23131 Merge in a single CPP if/else.
23132
231332000-11-07 Akim Demaille <akim@epita.fr>
23134
23135 * src/output.c (output): Remove useless variables.
23136 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
23137 argument `data' for consistency with the prototypes.
23138 Qualify it `const'.
23139 (obstack_copy, obstack_copy0): Rename the second argument as
23140 `address' for consistency. Qualify it `const'.
23141 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
23142 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
23143 `const' their input argument (`data' or `address').
23144 Adjust the corresponding macros to include `const' in casts.
23145
231462000-11-03 Akim Demaille <akim@epita.fr>
23147
23148 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
23149 s/PFILE1/BISON_HAIRY/.
23150 Adjust dependencies.
23151
231522000-11-03 Akim Demaille <akim@epita.fr>
23153
23154 For some reason, this was not applied.
23155
23156 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23157 `unlink': it's no longer used.
23158
231592000-11-03 Akim Demaille <akim@epita.fr>
23160
23161 * src/files.c (skeleton_find): New function, eved out of...
23162 (open_files, open_extra_files): here.
23163
231642000-11-03 Akim Demaille <akim@epita.fr>
23165
23166 Don't use `atexit'.
23167
23168 * src/files.c (obstack_save): New function.
23169 (done): Rename as...
23170 (output_files): this.
23171 Use `obstack_save'.
23172 * src/main.c (main): Don't use `atexit' to register `done', since
23173 it no longer has to remove tmp files, just call `output_files'
23174 when there are no errors.
23175
231762000-11-02 Akim Demaille <akim@epita.fr>
23177
23178 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23179 `unlink': it's no longer used.
23180 * src/files.h: Formatting changes.
23181
231822000-11-02 Akim Demaille <akim@epita.fr>
23183
23184 Remove the last uses of mktemp and unlink/delete.
23185
23186 * src/files.c (fdefines, ftable): Removed.
23187 (defines_ostack, table_obstack): New.
23188 Adjust dependencies of the former into uses of the latter.
23189 * src/output.c (output_short_or_char_table, output_short_table):
23190 Convert to using obstacks.
23191 * src/reader.c (copy_comment2): Accept one FILE * and two
23192 obstacks.
23193 (output_token_defines, reader_output_yylsp): Use obstacks.
23194 * src/system.h (obstack_fgrow3): New.
23195 * po/POTFILES.in: Adjust.
23196
231972000-11-01 Akim Demaille <akim@epita.fr>
23198
23199 Change each use of `fattrs' into a use of `attrs_obstack'.
23200
23201 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
23202 * src/files.c (fattrs): Remove.
23203 (attrs_obstack): New.
23204 Adjust all dependencies.
23205 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
23206
232072000-11-01 Akim Demaille <akim@epita.fr>
23208
23209 Introduce obstacks.
23210 Change each use of `faction' into a use of `action_obstack'.
23211
23212 * lib/obstack.h, lib/obstack.c: New files.
23213 * src/files.c (faction): Remove.
23214 (action_obstack): New.
23215 Adjust all dependencies.
23216
232172000-10-20 Akim Demaille <akim@epita.fr>
23218
23219 * lib/quote.h (PARAMS): New macro. Use it.
23220
232212000-10-16 Akim Demaille <akim@epita.fr>
23222
23223 * src/output.c (output_short_or_char_table): New function.
23224 (output_short_table, output_token_translations): Use it.
23225 (goto_actions): Use output_short_table.
23226
232272000-10-16 Akim Demaille <akim@epita.fr>
23228
23229 * src/symtab.c (bucket_new): New function.
23230 (getsym): Use it.
23231
23232 * src/output.c (output_short_table): New argument to display the
23233 comment associated with the table.
23234 Adjust dependencies.
23235 (output_gram): Use it.
23236 (output_rule_data): Nicer output layout for YYTNAME.
23237
232382000-10-16 Akim Demaille <akim@epita.fr>
23239
23240 * src/lex.c (read_typename): New function.
23241 (lex): Use it.
23242 * src/reader.c (copy_dollar): Likewise.
23243
232442000-10-16 Akim Demaille <akim@epita.fr>
23245
23246 * src/reader.c (copy_comment2): Expect the input stream to be on
23247 the `/' which is suspected to open a comment, instead of being
23248 called after `//' or `/*' was read.
23249 (copy_comment, copy_definition, parse_union_decl, copy_action)
23250 (copy_guard): Adjust.
23251
232522000-10-16 Akim Demaille <akim@epita.fr>
23253
23254 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
23255 `read_signed_integer'.
23256
232572000-10-16 Akim Demaille <akim@epita.fr>
23258
23259 * src/reader.c (copy_dollar): New function.
23260 (copy_guard, copy_action): Use it.
23261
232622000-10-16 Akim Demaille <akim@epita.fr>
23263
23264 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
23265 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
23266 New files, from Fileutils 4.0.27.
23267 * src/main.c (printable_version): Remove.
23268 * src/lex.c, src/reader.c: Use `quote'.
23269
232702000-10-04 Akim Demaille <akim@epita.fr>
23271
23272 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
23273
232742000-10-04 Akim Demaille <akim@epita.fr>
23275
23276 * doc/bison.texinfo: Various typos spotted by Neil Booth.
23277
232782000-10-04 Akim Demaille <akim@epita.fr>
23279
23280 When a literal string is used to define two different tokens,
23281 `bison -v' segfaults.
23282 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
23283
23284 * tests/regression.m4: New file.
23285 Include the core of the sample provided by Piotr Gackiewicz.
23286 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
23287 properly.
23288
232892000-10-04 Akim Demaille <akim@epita.fr>
23290
23291 * src/reader.c (parse_expect_decl): Keep `count' within the size
23292 of `buffer'.
23293 From Neil Booth.
23294
232952000-10-02 Paul Eggert <eggert@twinsun.com>
23296
23297 * bison.s1 (yyparse): Assign the default value
23298 unconditionally, to avoid a GCC warning and make the parser a
23299 tad smaller.
23300
233012000-10-02 Akim Demaille <akim@epita.fr>
23302
23303 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
23304 options.
23305
233062000-10-02 Akim Demaille <akim@epita.fr>
23307
23308 * src/derives.c, src/print.c, src/reduce.c: To ease the
23309 translation, move some `\n' out of the translated strings.
23310
233112000-10-02 Akim Demaille <akim@epita.fr>
23312
23313 The location tracking mechanism is precious for parse error
23314 messages. Nevertheless, it is enabled only when `@n' is used in
23315 the grammar, which is a different issue (you can use it in error
23316 message, but not in the grammar per se). Therefore, there should
23317 be another means to enable it.
23318
23319 * src/getargs.c (getargs): Support `--locations'.
23320 (usage): Report it.
23321 * src/getargs.h (locationsflag): Export it.
23322 * src/lex.c (percent_table): Support `%locations'.
23323 * src/reader.c (yylsp_needed): Remove this variable, now replaced
23324 with `locationsflag'.
23325 * doc/bison.texinfo: Document `--locations' and `%locations'.
23326 Sort the options.
23327 * tests/calc.m4: Test it.
23328
23329 For regularity of the names, replace each
23330 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
23331 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
23332 In addition replace each `flag' with `_flag'.
23333
233342000-10-02 Akim Demaille <akim@epita.fr>
23335
23336 Also test parse error messages, including with YYERROR_VERBOSE.
23337
23338 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
23339 associative).
23340 Use it to check the computations.
23341 Use it to check `nonassoc' is honored.
23342 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
23343 `--yyerror-verbose'.
23344 (_AT_CHECK_CALC): Adjust to this option.
23345 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
23346
233472000-10-02 Akim Demaille <akim@epita.fr>
23348
23349 Test also `--verbose', `--defines' and `--name-prefix'. Testing
23350 the latter demonstrates a flaw in the handling of non debugging
23351 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
23352 was used in order to simplify:
23353
23354 #if YYDEBUG
23355 if (yydebug)
23356 {
23357 ...
23358 }
23359 #endif
23360
23361 into
23362
23363 if (yydebug)
23364 {
23365 ...
23366 }
23367
23368 unfortunately this leads to a CPP conflict when
23369 `--name-prefix=foo' is used since it produces `#define yydebug
23370 foodebug'.
23371
23372 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
23373 (YYDPRINTF): New macro.
23374 Spread its use.
23375 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
23376 the bison options.
23377 Also test `--verbose', `--defines' and `--name-prefix'.
23378
233792000-10-02 Akim Demaille <akim@epita.fr>
23380
23381 Improve the readability of the produced parsers.
23382
23383 * src/bison.s1: Formatting changes.
23384 Improve the comment related to the `$' mark.
23385 (yydefault): Don't fall through to `yyresume': `goto' there.
23386 * src/output.c (output_parser): When the `$' is met, skip the end
23387 of its line.
23388 New variable, `number_of_dollar_signs', to check there's exactly
23389 one `$' in the parser skeleton.
23390
233912000-10-02 Akim Demaille <akim@epita.fr>
23392
23393 * lib/xstrdup.c: New file, from the fileutils.
23394 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
23395 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
23396 instead of strlen + xmalloc + strcpy.
23397 * src/symtab.c (copys): Remove, use xstrdup instead.
23398
233992000-10-02 Akim Demaille <akim@epita.fr>
23400
23401 * src/gram.h (associativity): New enum type which replaces the
23402 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
23403 `right_assoc', `left_assoc' and `non_assoc'.
23404 Adjust all dependencies.
23405 * src/reader.c: Formatting changes.
23406 (LTYPESTR): Don't define it, use it as a literal in
23407 `reader_output_yylsp'.
23408 * src/symtab.h (symbol_class): New enum type which replaces the
23409 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
23410 `sunknown', `stoken and `snterm'.
23411
234122000-10-02 Akim Demaille <akim@epita.fr>
23413
23414 * src/getargs.c (fixed_outfiles): Rename as...
23415 (yaccflag): for consistency and accuracy.
23416 Adjust dependencies.
23417
234182000-10-02 Akim Demaille <akim@epita.fr>
23419
23420 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
23421 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
23422 difficult and introduced a lot of core dump. It turns out that
23423 Bison used an implementation of `xmalloc' based on `calloc', and
23424 at various places it does depend upon the initialization to 0. I
23425 have not tried to isolate the pertinent places, and all the former
23426 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
23427 someone should address this issue.
23428
23429 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
23430 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
23431 files.
23432 Adjust dependencies.
23433 * src/warshall.h: New file.
23434 Propagate.
23435
234362000-10-02 Akim Demaille <akim@epita.fr>
23437
23438 Various anti-`extern in *.c' changes.
23439
23440 * src/system.h: Include `assert.h'.
23441
234422000-10-02 Akim Demaille <akim@epita.fr>
23443
23444 * src/state.h (nstates, final_state, first_state, first_shift)
23445 (first_reduction): Move their exportation from here...
23446 * src/LR0.h: to here.
23447 Adjust dependencies.
23448 * src/getargs.c (statisticsflag): New variable.
23449 Add support for `--statistics'.
23450 Adjust dependencies.
23451
23452 Remove a lot of now useless `extern' statements in most files.
23453
234542000-10-02 Akim Demaille <akim@epita.fr>
23455
23456 * src/LR0.h: New file.
23457 Propagate its use.
23458
234592000-10-02 Akim Demaille <akim@epita.fr>
23460
23461 * src/print.h: New file.
23462 Propagate its use.
23463 * src/print.c: Formatting and ordering changes.
23464 (verbose, terse): Replace with...
23465 (print_results): this new function.
23466 Adjust dependencies.
23467
234682000-10-02 Akim Demaille <akim@epita.fr>
23469
23470 * src/conflicts.c (conflict_report): New function.
23471 (conflict_log, verbose_conflict_log): Replace with...
23472 (print_conflicts): this function.
23473 Adjust dependencies.
23474 * src/conflicts.h: New file.
23475 Propagate its inclusion.
23476
234772000-10-02 Akim Demaille <akim@epita.fr>
23478
23479 * src/nullable.h: New file.
23480 Propagate its inclusion.
23481 * src/nullable.c: Formatting changes.
23482
234832000-10-02 Akim Demaille <akim@epita.fr>
23484
23485 * src/reduce.h: New file.
23486 Propagate its inclusion.
23487 * src/reduce.c: Topological sort and other formatting changes.
23488 (bool, TRUE, FALSE): Move their definition to...
23489 * src/system.h: here.
23490
234912000-10-02 Akim Demaille <akim@epita.fr>
23492
23493 * src/files.c: Formatting changes.
23494 (tryopen, tryclose, openfiles): Rename as...
23495 (xfopen, xfclose, open_files): this.
23496 (stringappend): static.
23497 * src/files.h: Complete the list of exported symbols.
23498 Propagate its use.
23499
235002000-10-02 Akim Demaille <akim@epita.fr>
23501
23502 * src/reader.h: New file.
23503 Propagate its use instead of tedious list of `extern' and
23504 prototypes.
23505 * src/reader.c: Formatting changes, topological sort,
23506 s/register//.
23507
235082000-10-02 Akim Demaille <akim@epita.fr>
23509
23510 * src/lex.h: Prototype `lex.c' exported functions.
23511 * src/reader.c: Adjust.
23512 * src/lex.c: Formatting changes.
23513 (safegetc): Rename as...
23514 (xgetc): this.
23515
235162000-10-02 Akim Demaille <akim@epita.fr>
23517
23518 * src/lalr.h: New file.
23519 Propagate its inclusion instead of prototypes and `extern'.
23520 * src/lalr.c: Formatting changes, topological sorting etc.
23521
235222000-10-02 Akim Demaille <akim@epita.fr>
23523
23524 * src/output.c (token_actions): Introduce a temporary array,
23525 YYDEFACT, that makes it possible for this function to use
23526 output_short_table.
23527
235282000-10-02 Akim Demaille <akim@epita.fr>
23529
23530 `user_toknums' is output as a `short[]' in `output.c', while it is
23531 defined as a `int[]' in `reader.c'. For consistency with the
23532 other output tables, `user_toknums' is now defined as a table of
23533 shorts.
23534
23535 * src/reader.c (user_toknums): Be a short table instead of an int
23536 table.
23537 Adjust dependencies.
23538
23539 Factor the short table outputs.
23540
23541 * src/output.c (output_short_table): New function.
23542 * src/output.c (output_gram, output_stos, output_rule_data)
23543 (output_base, output_table, output_check): Use it.
23544
235452000-10-02 Akim Demaille <akim@epita.fr>
23546
23547 * src/output.c (output): Topological sort of the functions, in
23548 order to get rid of the `static' prototypes.
23549 No longer use `register'.
23550 * src/output.h: New file.
23551 Propagate its inclusion in files explicitly prototyping functions
23552 from output.c.
23553
235542000-09-21 Akim Demaille <akim@epita.fr>
23555
23556 * src/atgeneral.m4: Update from Autoconf.
23557
235582000-09-21 Akim Demaille <akim@epita.fr>
23559
23560 * src/closure.h: New file.
23561 * src/closure.c: Formatting changes, topological sort over the
23562 functions, use of closure.h.
23563 (initialize_closure, finalize_closure): Rename as...
23564 (new_closure, free_closure): these. Adjust dependencies.
23565 * src/LR0.c: Formatting changes, topological sort, use of
23566 cloture.h.
23567 (initialize_states): Rename as...
23568 (new_states): this.
23569 * src/Makefile.am (noinst_HEADERS): Adjust.
23570
235712000-09-20 Akim Demaille <akim@epita.fr>
23572
23573 * src/acconfig.h: Don't protect config.h against multiple
23574 inclusion.
23575 Don't define PARAMS.
23576 * src/system.h: Define PARAMS.
23577 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
23578 purpose of config.h. system.h must not try to fix wrong
23579 definitions in config.h.
23580
235812000-09-20 Akim Demaille <akim@epita.fr>
23582
23583 * src/derives.h: New file.
23584 * src/main.c, src/derives.h: Use it.
23585 Formatting changes.
23586 * src/Makefile.am (noinst_HEADERS): Adjust.
23587
235882000-09-20 Akim Demaille <akim@epita.fr>
23589
23590 * tests/atgeneral.m4: Update from Autoconf.
23591 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
23592 (AT_CHECK_CALC): New macros.
23593 Use these macros to test bison with options `', `--raw',
23594 `--debug', `--yacc', `--yacc --debug'.
23595
235962000-09-19 Akim Demaille <akim@epita.fr>
23597
23598 * src/output.c: Formatting changes.
23599 * src/machine.h: Remove, leaving its contents in...
23600 * src/system.h: here.
23601 Include stdio.h.
23602 Adjust all dependencies on stdio.h and machine.h.
23603 * src/getargs.h: New file.
23604 Let all `extern' declarations about getargs.c be replaced with
23605 inclusion of `getargs.h'.
23606 * src/Makefile.am (noinst_HEADERS): Adjust.
23607
23608 * tests/calc.m4 (yyin): Be initialized in main, not on the global
23609 scope.
23610 (yyerror): Returns void, not int.
23611 * doc/bison.texinfo: Formatting changes.
23612
236132000-09-19 Akim Demaille <akim@epita.fr>
23614
23615 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
23616 portable.
23617
236182000-09-18 Akim Demaille <akim@epita.fr>
23619
23620 * configure.in: Append WARNING_CFLAGS to CFLAGS.
23621 * src/Makefile.am (INCLUDES): Don't.
23622 Be ready to fetch headers in lib/.
23623
236242000-09-18 Akim Demaille <akim@epita.fr>
23625
23626 * doc/bison.texinfo: Update the copyright.
23627 ANSIfy and GNUify the examples.
23628 Remove the old menu.
23629
236302000-09-18 Akim Demaille <akim@epita.fr>
23631
23632 First set of tests: use the `calc' example from the documentation.
23633
23634 * src/bison.s1 (yyparse): Condition the code using `yytname' which
23635 is defined only when YYDEBUG is.
23636 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
23637 * src/files.c (tryopen, tryclose): Formatting changes.
23638 Move to the top and be static.
23639 * src/reader.c (read_signed_integer): Likewise.
23640 * tests/calc.m4: New file.
23641 * Makefile.am, suite.m4: Adjust.
23642 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
23643
236442000-09-18 Akim Demaille <akim@epita.fr>
23645
23646 Add support for an Autotest test suite for Bison.
23647
23648 * m4/m4.m4, m4/atconfig.m4: New files.
23649 * m4/Makefile.am (EXTRA_DIST): Adjust.
23650 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
23651 files.
23652 * src/getargs.c: Display a more standard --version message.
23653 * src/reader.c (reader): Formatting changes.
23654 No longer depend upon VERSION_STRING.
23655 * configure.in: No longer use `dnl'.
23656 Set up the test suite and the new directory `tests/.
23657 (VERSION_STRING): Remove.
23658
236592000-04-14 Akim Demaille <akim@epita.fr>
23660
23661 * src/reader.c (copy_comment2): New function, same as former
23662 `copy_comment', but outputs into two FILE *.
23663 (copy_comment): Use it.
23664 (parse_union_decl): Use it.
23665 (get_type, parse_start_decl): Use the same `invalid' message.
23666 (parse_start_decl, parse_union_decl): Use the same `multiple'
23667 message.
23668 (parse_union_decl, copy_guard, copy_action): Use the same
23669 `unmatched' message.
23670 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
23671
236722000-03-31 Akim Demaille <akim@epita.fr>
23673
23674 * src/files.c (tryopen, tryclose): Move to the top.
23675 Be static.
23676
236772000-03-31 Akim Demaille <akim@epita.fr>
23678
23679 * src/main.c (main): Don't call `done', exit does it.
23680
236812000-03-31 Akim Demaille <akim@epita.fr>
23682
23683 * allocate.c: s/return (foo)/return foo/.
23684 * lalr.c: Likewise.
23685 * LR0.c: Likewise.
23686 * output.c: Likewise.
23687 * reader.c: Likewise.
23688 * symtab.c: Likewise.
23689 * vmsgetargs.c: Likewise.
23690
236912000-03-31 Akim Demaille <akim@epita.fr>
23692
23693 Clean up the error reporting functions.
23694
23695 * src/report.c: New file.
23696 * src/report.h: Likewise.
23697 * src/Makefile.am: Adjust.
23698 * m4/error.m4: New file.
23699 * m4/Makefile.am: Adjust.
23700 * configure.in (jm_PREREQ_ERROR): Call it.
23701 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
23702 Remove.
23703 (fatal, fatals): Remove. All callers use complain.c::fatal.
23704 (warn, warni, warns, warnss, warnss): Remove. All callers use
23705 complain.c::complain.
23706 (toomany): Remove, use fatal instead.
23707 * src/files.c (done): No argument, use complain_message_count.
23708 * src/main.c (main): Register `done' to `atexit'.
23709
23710 * src/getargs.c (usage): More `fputs', less `fprintf'.
23711
237122000-03-28 Akim Demaille <akim@epita.fr>
23713
23714 * lib/: New directory.
23715 * Makefile.am (SUBDIRS): Adjust.
23716 * configure.in: Adjust.
23717 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
23718 useless.
23719 * src/alloca.c: Moved to lib/.
23720 * src/getopt.c: Likewise.
23721 * src/getopt1.c: Likewise.
23722 * src/getopt.h: Likewise.
23723 * src/ansi2knr.c: Likewise.
23724 * src/ansi2knr.1: Likewise.
23725 * src/Makefile.am: Adjust.
23726 * lib/Makefile.am: New file.
23727
237282000-03-28 Akim Demaille <akim@epita.fr>
23729
23730 * src/getargs.c (usage): Refresh the help message.
23731
237322000-03-17 Akim Demaille <akim@epita.fr>
23733
23734 * src/getopt1.c: Updated from textutils 2.0e
23735 * src/getopt.c: Likewise.
23736 * src/getopt.h: Likewise.
23737
237382000-03-17 Akim Demaille <akim@epita.fr>
23739
23740 * src/Makefile.am (bison.simple): Fix the awk program: quote only
23741 the file name, not the whole `#line LINE FILE'.
23742
237432000-03-17 Akim Demaille <akim@epita.fr>
23744
23745 On syntax errors, report the token on which we choked.
23746
23747 * src/bison.s1 (yyparse): In the label yyerrlab, when
23748 YYERROR_VERBOSE, add yychar in msg.
23749
237502000-03-17 Akim Demaille <akim@epita.fr>
23751
23752 * src/reader.c (copy_at): New function.
23753 (copy_guard): Use it.
23754 (copy_action): Use it.
23755
237562000-03-17 Akim Demaille <akim@epita.fr>
23757
23758 Be kind to translators, save some useless translations.
23759
23760 * src/main.c (banner): New function.
23761 (fatal_banner): Use it.
23762 (warn_banner): Use it.
23763
237642000-03-17 Akim Demaille <akim@epita.fr>
23765
23766 * src/reader.c (copy_definition): Use copy_string and
23767 copy_comment. Removed now unused `match', `ended',
23768 `cplus_comment'.
23769 (copy_comment, copy_string): Moved, to be visible from
23770 copy_definition.
23771
237722000-03-17 Akim Demaille <akim@epita.fr>
23773
23774 * src/reader.c (copy_string): Declare `static inline'. No
23775 problems with inline, since it is checked by configure.
23776 (copy_comment): Likewise.
23777
237782000-03-17 Akim Demaille <akim@epita.fr>
23779
23780 * src/reader.c (packsymbols): Formatting changes.
23781
237822000-03-17 Akim Demaille <akim@epita.fr>
23783
23784 * src/reader.c (copy_comment): New function, factored out from:
23785 (copy_action): Use it. Removed now unused `match', `ended',
23786 `cplus_comment'.
23787 (copy_guard): Likewise.
23788
237892000-03-17 Akim Demaille <akim@epita.fr>
23790
23791 * src/reader.c (copy_string): New function, factored out from:
23792 (copy_action): Use it.
23793 (copy_guard): Likewise.
23794
237952000-03-17 Akim Demaille <akim@epita.fr>
23796
23797 Change the handling of @s so that they behave exactly like $s.
23798 There is now a pseudo variable @$ (readble and writable), location
23799 of the lhs of the rule (by default ranging from the location of
23800 the first symbol of the rhs, to the location of the last symbol,
23801 or, if the rhs is empty, YYLLOC).
23802
23803 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
23804 yyval.
23805 (yyparse): When providing a default semantic action, provide a
23806 default location action.
23807 (after the $): No longer change `*YYLSP', just stack YYLOC the
23808 same way you stack YYVAL.
23809 * src/reader.c (read_declarations): Use warns.
23810 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
23811 (copy_action, case '@'): Likewise.
23812 Use a standard error message, to save useless work from
23813 translators.
23814
238152000-03-17 Akim Demaille <akim@epita.fr>
23816
23817 * src/bison.s1: Formatting and cosmetics changes.
23818 * src/reader.c: Likewise.
23819 Update the Copyright notice.
23820
238212000-03-17 Akim Demaille <akim@epita.fr>
23822
23823 * src/bison.s1 (#line): All set to `#line' only, since the
23824 Makefile now handles them.
23825
238262000-03-16 Akim Demaille <akim@epita.fr>
23827
23828 * src/output.c (output_rule_data): Output the documentation of
23829 some of the tables.
23830 (Copyright notice): Update.
23831 Formatting changes.
23832
238332000-03-16 Akim Demaille <akim@epita.fr>
23834
23835 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
23836 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
23837 One `#if YYDEBUG' remains, since it uses variables which are
23838 defined only if `YYDEBUG != 0'.
23839
238402000-03-16 Akim Demaille <akim@epita.fr>
23841
23842 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
23843 and related variables so that the similarities are highlighted.
23844
238452000-03-16 Akim Demaille <akim@epita.fr>
23846
23847 * src/bison.s1: Properly indent CPP directives.
23848
238492000-03-16 Akim Demaille <akim@epita.fr>
23850
23851 * src/bison.s1: Properly indent the `alloca' CPP section.
23852
238532000-03-16 Akim Demaille <akim@epita.fr>
23854
23855 Do not hard code values of directories in `configure.in'.
23856 Update the `configure' tool chain.
23857
23858 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
23859 src/makefile.am.
23860 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
23861 (AC_OUTPUT): Add m4/Makefile.
23862 Bump to bison 1.28a, 1.29 has never been released.
23863 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
23864 handled via src/Makefile.am.
23865 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
23866 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
23867 autoheader.
23868 * Makefile.am (SUBDIRS): Add m4.
23869 (ACLOCAL_AM_FLAGS): New variable.
23870 (AUTOMAKE_OPTIONS): Add check-news.
23871 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
23872 the proper line number and file name.
23873 (DEFS): Propagate the location of bison library files and of the
23874 locale files.
23875 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
23876 builddir.
23877 * acinclude.m4: Remove, replaced by the directory m4.
23878 * m4/Makefile.am (EXTRA_DIST): New variable.
23879 * m4/gettext.m4: New file, from the fileutils.
23880 * m4/lcmessage.m4: Likewise
23881 * m4/progtest.m4: Likewise.
23882 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
23883
238842000-03-10 Akim Demaille <akim@epita.fr>
23885
23886 * src/closure.c:
23887 Formatting changes of various comments.
23888 Respect the GNU coding standards at various places.
23889 Don't use `_()' when no translation is needed.
23890
238911999-12-13 Jesse Thilo <jthilo@gnu.org>
23892
23893 * src/files.c:
23894 OS/2 honors TMPDIR environment variable.
23895
238961999-12-13 Jesse Thilo <jthilo@gnu.org>
23897
23898 * doc/bison.texinfo: Tweaked spelling and grammar.
23899 Updated ISBN.
23900 Removed reference to price of printed copy.
23901 Mention BISON_SIMPLE and BISON_HAIRY.
23902
239031999-12-13 Jesse Thilo <jthilo@gnu.org>
23904
23905 * configure.in, NEWS:
23906 Bison 1.29 released.
23907
239081999-10-27 Jesse Thilo <jthilo@gnu.org>
23909
23910 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
23911 Added reference card.
23912
239131999-07-26 Jesse Thilo <jthilo@gnu.org>
23914
23915 * po/ru.po: Added Russian translation.
23916
239171999-07-26 Jesse Thilo <jthilo@gnu.org>
23918
23919 * configure.in: Added Russian translation.
23920
239211999-07-06 Jesse Thilo <jthilo@gnu.org>
23922
23923 * configure.in, NEWS, README:
23924 Released version 1.28.
23925
239261999-06-14 Jesse Thilo <jthilo@gnu.org>
23927
23928 * src/system.h:
23929 Squashed redefinition warning on some systems.
23930
23931 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
23932 Have configure build version string instead of relying on ANSI string
23933 concatentation.
23934
239351999-06-14 Jesse Thilo <jthilo@gnu.org>
23936
23937 * po/POTFILES.in: Got rid of version.c.
23938
239391999-06-14 Jesse Thilo <jthilo@gnu.org>
23940
23941 * acconfig.h, configure.in:
23942 Have configure build version string instead of relying on ANSI string
23943 concatentation.
23944
239451999-06-08 Jesse Thilo <jthilo@gnu.org>
23946
23947 * doc/bison.1:
23948 Dropped mention of `+' for long-named options.
23949
239501999-05-30 Jesse Thilo <jthilo@gnu.org>
23951
23952 * src/files.c: Added <unistd.h> for unlink().
23953
23954 * src/Makefile.am, src/system.h:
23955 I18n fixes.
23956
239571999-05-30 Jesse Thilo <jthilo@gnu.org>
23958
23959 * README: Added a FAQ list.
23960
23961 * configure.in, acconfig.h:
23962 I18n fixes.
23963
239641999-05-30 Jesse Thilo <jthilo@gnu.org>
23965
23966 * doc/FAQ, doc/Makefile.am:
23967 Added a FAQ list.
23968
239691999-05-19 Jesse Thilo <jthilo@gnu.org>
23970
23971 * src/alloc.h, src/symtab.h, src/version.c:
23972 Protected inclusion of "config.h" with HAVE_CONFIG_H.
23973
239741999-04-18 Jesse Thilo <jthilo@gnu.org>
23975
23976 * src/.cvsignore, src/Makefile.am:
23977 Reorganized: sources in `src', documentation in `doc'.
23978
23979 * src/lex.c (literalchar):
23980 fixed the code for escaping double quotes (thanks
23981 Jonathan Czisny.)
23982
239831999-04-18 Jesse Thilo <jthilo@gnu.org>
23984
23985 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
23986 Adjusted paths to reflect directory reorganization.
23987
239881999-04-18 Jesse Thilo <jthilo@gnu.org>
23989
23990 * doc/.cvsignore, doc/Makefile.am:
23991 Reorganized: sources in `src', documentation in `doc'.
23992
239931999-04-18 Jesse Thilo <jthilo@gnu.org>
23994
23995 * configure.in:
23996 Updated AC_INIT file to reflect directory reorganization.
23997
23998 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
23999 Reorganized: sources in `src', documentation in `doc'.
24000
240011999-04-13 Jesse Thilo <jthilo@gnu.org>
24002
24003 * src/allocate.c:
24004 Don't declare calloc() and realloc() if not necessary.
24005
240061999-04-13 Jesse Thilo <jthilo@gnu.org>
24007
24008 * configure.in, acconfig.h, acinclude.m4:
24009 Don't declare calloc() and realloc() if not necessary.
24010
240111999-03-23 Jesse Thilo <jthilo@gnu.org>
24012
24013 * po/.cvsignore: Added i18n support.
24014
240151999-03-23 Jesse Thilo <jthilo@gnu.org>
24016
24017 * acconfig.h, configure.in, Makefile.am:
24018 Added i18n support.
24019
240201999-03-22 Jesse Thilo <jthilo@gnu.org>
24021
24022 * src/bison.s1: Fixed #line numbers.
24023
240241999-03-15 Jesse Thilo <jthilo@gnu.org>
24025
24026 * po/es.po, po/fr.po, po/nl.po, po/de.po:
24027 Added PO files from Translation Project.
24028
240291999-03-03 Jesse Thilo <jthilo@gnu.org>
24030
24031 * Makefile.am:
24032 Added support for non-ANSI compilers (ansi2knr).
24033
240341999-02-16 Jesse Thilo <jthilo@gnu.org>
24035
24036 * configure.in: Bumped version number to 1.27.
24037
24038 * Makefile.am:
24039 Added `bison.simple' to list of files removed by `make distclean'.
24040
240411999-02-12 Jesse Thilo <jthilo@gnu.org>
24042
24043 * src/files.c, src/files.h:
24044 Defined locations of parser files in config.h instead of Makefile.
24045
240461999-02-12 Jesse Thilo <jthilo@gnu.org>
24047
24048 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
24049 Defined locations of parser files in config.h instead of Makefile.
24050
240511999-02-09 Jesse Thilo <jthilo@gnu.org>
24052
24053 * Makefile.am:
24054 Removed inappropriate use of $< macro.
24055
240561999-02-05 Jesse Thilo <jthilo@gnu.org>
24057
24058 * po/Makefile.in.in, po/POTFILES.in:
24059 Add `po' directory skeleton.
24060
240611999-01-27 Jesse Thilo <jthilo@gnu.org>
24062
24063 * README: Document help-bison list.
24064
24065 * configure.in: Add check for mkstemp().
24066
240671999-01-20 Jesse Thilo <jthilo@gnu.org>
24068
24069 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
24070 Hush a few compiler warnings.
24071
24072 * src/files.c:
24073 Add tryclose(), which verifies that fclose was successful.
24074 Hush a couple of compiler warnings.
24075
240761999-01-20 Jesse Thilo <jthilo@gnu.org>
24077
24078 * Makefile.am, OChangeLog:
24079 ChangeLog is now automatically generated. Include the old version as
24080 OChangeLog.
24081
240821999-01-14 Jesse Thilo <jthilo@gnu.org>
24083
24084 * 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:
24085 Update FSF address.
24086
240871999-01-14 Jesse Thilo <jthilo@gnu.org>
24088
24089 * doc/bison.texinfo: Fix formatting glitch.
24090
24091 * doc/bison.texinfo: Update FSF address.
24092
240931999-01-14 Jesse Thilo <jthilo@gnu.org>
24094
24095 * acconfig.h: Update FSF address.
24096
240971999-01-08 Jesse Thilo <jthilo@gnu.org>
24098
24099 * src/system.h:
24100 Don't define PACKAGE here, since config.h defines it.
24101
241021998-12-30 Jesse Thilo <jthilo@gnu.org>
24103
24104 * src/reader.c: Update copyright date.
24105
24106 * src/main.c:
24107 Ditch sprintf to statically-sized buffers in fatal/warn functions in
24108 favor of output directly to stderr (avoids buffer overruns).
24109
24110 * src/reader.c: Some checks for premature EOF.
24111
24112 * 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:
24113 Use prototypes if the compiler understands them.
24114
24115 * src/files.c: Honor TMPDIR on Unix hosts.
24116 Use prototypes if the compiler understands them.
24117
24118 * src/reader.c:
24119 Fix a couple of buffer overrun bugs.
24120 Use prototypes if the compiler understands them.
24121
24122 * src/system.h: Include unistd.h and ctype.h.
24123 Use #ifdef instead of #if for NLS symbols.
24124
241251998-12-30 Jesse Thilo <jthilo@gnu.org>
24126
24127 * doc/bison.texinfo:
24128 Delete comment "consider using @set for edition number, etc..." since
24129 we now are doing so.
24130
241311998-12-30 Jesse Thilo <jthilo@gnu.org>
24132
24133 * configure.in:
24134 Use prototypes if the compiler understands them.
24135
24136 * NEWS: Document 1.26 highlights.
24137
24138 * Makefile.am: Require Automake 1.3 or later.
24139
24140 * acconfig.h:
24141 Use prototypes if the compiler understands them.
24142
241431998-12-29 Jesse Thilo <jthilo@gnu.org>
24144
24145 * src/version.c:
24146 Use VERSION symbol from automake for version number.
24147
241481998-12-29 Jesse Thilo <jthilo@gnu.org>
24149
24150 * acconfig.h, configure.in, version.cin:
24151 Use VERSION symbol from automake for version number.
24152
241531998-11-28 Jesse Thilo <jthilo@gnu.org>
24154
24155 * Makefile.am:
24156 Distribute original version of simple parser (bison.s1), not built
24157 version (bison.simple).
24158
241591998-11-28 Jesse Thilo <jthilo@gnu.org>
24160
24161 * doc/bison.texinfo: Add info dir entry.
24162
24163 * doc/bison.texinfo:
24164 Let automake put version number into documentation.
24165
241661998-11-26 Jesse Thilo <jthilo@gnu.org>
24167
24168 * src/bison.cld, src/build.com, src/vmshlp.mar:
24169 Add non-RCS files from /gd/gnu/bison.
24170
241711998-11-26 Jesse Thilo <jthilo@gnu.org>
24172
24173 * doc/bison.1:
24174 Document the BISON_HAIRY and BISON_SIMPLE variables.
24175
241761998-11-25 Jesse Thilo <jthilo@gnu.org>
24177
24178 * src/version.c: Build version.c automatically.
24179
24180 * src/reader.c:
24181 Fix token numbering (used to start at 258, not 257).
24182
24183 * src/system.h: Include config.h.
24184
24185 * src/getargs.c: Update bug report address.
24186
24187 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
24188 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
24189
241901998-11-25 Jesse Thilo <jthilo@gnu.org>
24191
24192 * Makefile.am:
24193 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24194
24195 * configure.in, version.cin:
24196 Build version.c automatically.
24197
24198 * AUTHORS: Add AUTHORS file.
24199
24200 * README: Update bug report address.
24201
24202 * bison.simple:
24203 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24204
24205 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
24206 Add automake stuff.
24207
242081998-11-25 Jesse Thilo <jthilo@gnu.org>
24209
24210 * doc/bison.texinfo: Clean up some formatting.
24211
242121998-05-05 Richard Stallman <rms@gnu.org>
24213
24214 * doc/bison.texinfo:
24215 Explain better why to make a pure parser.
24216
242171998-01-05 Richard Stallman <rms@gnu.org>
24218
24219 * src/files.c (openfiles):
24220 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
24221 find a temporary directory, if possible. Do not unlink files while
24222 they are open.
24223
242241997-08-25 Richard Stallman <rms@gnu.org>
24225
24226 * src/reader.c (stack_offset;):
24227 Change some warni to warns.
24228
24229 * src/lex.c (literalchar): Use warns, not warni.
24230
242311997-06-28 Richard Stallman <rms@gnu.org>
24232
24233 * src/bison.s1: Add a Bison version comment.
24234
24235 * src/main.c (fatal, warn, berror):
24236 Use program_name.
24237
242381997-06-28 Richard Stallman <rms@gnu.org>
24239
24240 * Makefile.in (bison_version): New variable.
24241 (dist): Use that variable.
24242 (bison.s1): Substitute the Bison version into bison.simple.
24243
24244 * bison.simple: Add a Bison version comment.
24245
242461997-06-18 Richard Stallman <rms@gnu.org>
24247
24248 * src/main.c (fatal, warn, berror):
24249 Make error messages standard.
24250 (toomany): Improve error message text.
24251
24252 * 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:
24253 new.h renamed to alloc.h.
24254
242551997-06-18 Richard Stallman <rms@gnu.org>
24256
24257 * Makefile.in: new.h renamed to alloc.h.
24258
242591997-05-24 Richard Stallman <rms@gnu.org>
24260
24261 * src/lex.c (literalchar):
24262 Fix the code for escaping \, " and '.
24263
24264 (lex): Avoid trouble when there are many chars
24265 to discard in a char literal with just several chars in it.
24266
242671997-05-17 Richard Stallman <rms@gnu.org>
24268
24269 * src/bison.s1:
24270 Use malloc, if using alloca is troublesome.
24271 (YYSTACK_USE_ALLOCA): New flag macro.
24272 Define it for some systems and compilers.
24273 (YYSTACK_ALLOC): New macro.
24274 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24275 If it was malloc'd, free it.
24276
242771997-05-17 Richard Stallman <rms@gnu.org>
24278
24279 * bison.simple:
24280 Use malloc, if using alloca is troublesome.
24281 (YYSTACK_USE_ALLOCA): New flag macro.
24282 Define it for some systems and compilers.
24283 (YYSTACK_ALLOC): New macro.
24284 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24285 If it was malloc'd, free it.
24286
242871997-04-23 Richard Stallman <rms@gnu.org>
24288
24289 * src/bison.s1:
24290 (alloca) [__hpux]: Always define as __builtin_alloca.
24291
242921997-04-23 Richard Stallman <rms@gnu.org>
24293
24294 * bison.simple:
24295 (alloca) [__hpux]: Always define as __builtin_alloca.
24296
242971997-04-22 Richard Stallman <rms@gnu.org>
24298
24299 * src/bison.s1:
24300 [__hpux]: Include alloca.h (right for HPUX 10)
24301 instead of declaring alloca (right for HPUX 9).
24302
24303 * src/bison.s1 (__yy_memcpy):
24304 Declare arg `count' as unsigned int.
24305 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24306
243071997-04-22 Richard Stallman <rms@gnu.org>
24308
24309 * bison.simple:
24310 [__hpux]: Include alloca.h (right for HPUX 10)
24311 instead of declaring alloca (right for HPUX 9).
24312
24313 * bison.simple (__yy_memcpy):
24314 Declare arg `count' as unsigned int.
24315 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24316
243171997-01-03 Richard Stallman <rms@gnu.org>
24318
24319 * src/allocate.c: [__STDC__ or _MSC_VER]:
24320 Declare calloc and realloc to return void *.
24321
243221997-01-02 Richard Stallman <rms@gnu.org>
24323
24324 * src/system.h:
24325 [_MSC_VER]: Include stdlib.h and process.h.
24326 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
24327
24328 * src/main.c (main): Return FAILURE as a value.
24329 (printable_version): Declare arg as int, not char.
24330
243311997-01-02 Richard Stallman <rms@gnu.org>
24332
24333 * Makefile.in (dist):
24334 Explicitly check for symlinks, and copy them.
24335
243361996-12-19 Richard Stallman <rms@gnu.org>
24337
24338 * src/files.c:
24339 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
24340
243411996-12-18 Paul Eggert <eggert@gnu.org>
24342
24343 * src/bison.s1 (yyparse):
24344 If __GNUC__ and YYPARSE_PARAM are both defined,
24345 declare yyparse to have a void * argument.
24346
243471996-12-18 Paul Eggert <eggert@gnu.org>
24348
24349 * bison.simple (yyparse):
24350 If __GNUC__ and YYPARSE_PARAM are both defined,
24351 declare yyparse to have a void * argument.
24352
243531996-12-17 Richard Stallman <rms@gnu.org>
24354
24355 * src/reduce.c (nbits): Add some casts.
24356
243571996-08-12 Richard Stallman <rms@gnu.org>
24358
24359 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
24360
243611996-08-12 Richard Stallman <rms@gnu.org>
24362
24363 * bison.simple: Test _MSDOS as well as _MSDOS_.
24364
243651996-07-31 Richard Stallman <rms@gnu.org>
24366
24367 * src/bison.s1:
24368 [__sun && __i386]: Include alloca.h.
24369
243701996-07-31 Richard Stallman <rms@gnu.org>
24371
24372 * bison.simple:
24373 [__sun && __i386]: Include alloca.h.
24374
243751996-07-30 Richard Stallman <rms@gnu.org>
24376
24377 * src/bison.s1: Comment change.
24378
24379 * src/bison.s1: Test _MSDOS_, not MSDOS.
24380
243811996-07-30 Richard Stallman <rms@gnu.org>
24382
24383 * bison.simple: Comment change.
24384
24385 * bison.simple: Test _MSDOS_, not MSDOS.
24386
243871996-06-01 Richard Stallman <rms@gnu.org>
24388
24389 * 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:
24390 Insert `_' macro around many string constants.
24391
24392 * src/main.c:
24393 Insert `_' macro around many string constants.
24394
24395 (main): Call setlocale, bindtextdomain and textdomain.
24396
24397 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
24398 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
24399 [ENABLE_NLS]: Include libintl.h.
24400 [ENABLE_NLS] (gettext): Define.
24401 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
24402 (N_, PACKAGE, LOCALEDIR): New macros.
24403
244041996-06-01 Richard Stallman <rms@gnu.org>
24405
24406 * POTFILES.in: New file.
24407
24408 * Makefile.in (allocate.o):
24409 Define target explicitly.
24410
24411 * Makefile.in (CFLAGS): Set to @CFLAGS@.
24412 (LDFLAGS): Set to @LDFLAGS@.
24413 (configure): Run autoconf only if preceding `cd' succeeds.
24414 (bison.s1): Redirect output to temporary file then move the
24415 temporary to the target, rather than redirecting directly to bison.s1.
24416 (clean): Remove config.status and config.log.
24417 (distclean): Don't remove config.status here.
24418
244191996-05-12 Richard Stallman <rms@gnu.org>
24420
24421 * src/bison.s1:
24422 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24423
244241996-05-12 Richard Stallman <rms@gnu.org>
24425
24426 * bison.simple:
24427 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24428
244291996-05-11 Richard Stallman <rms@gnu.org>
24430
24431 * src/bison.s1 (__yy_memcpy):
24432 Really reorder the args, as was supposedly done on Feb 14 1995.
24433 (yyparse): Calls changed accordingly.
24434
244351996-05-11 Richard Stallman <rms@gnu.org>
24436
24437 * Makefile.in (dist): Don't use $(srcdir).
24438
24439 * bison.simple (__yy_memcpy):
24440 Really reorder the args, as was supposedly done on Feb 14 1995.
24441 (yyparse): Calls changed accordingly.
24442
244431996-01-27 Richard Stallman <rms@gnu.org>
24444
24445 * src/output.c (output_rule_data):
24446 Test YYERROR_VERBOSE in the conditional
24447 around the definition of ttyname.
24448
244491995-12-29 Richard Stallman <rms@gnu.org>
24450
24451 * src/bison.s1:
24452 Fix line numbers in #line commands.
24453
244541995-12-29 Richard Stallman <rms@gnu.org>
24455
24456 * bison.simple:
24457 Fix line numbers in #line commands.
24458
244591995-12-27 Richard Stallman <rms@gnu.org>
24460
24461 * src/bison.s1 (YYPARSE_PARAM_DECL):
24462 In C++, make it always null.
24463 (YYPARSE_PARAM_ARG): New macro.
24464 (yyparse): Use YYPARSE_PARAM_ARG.
24465
244661995-12-27 Richard Stallman <rms@gnu.org>
24467
24468 * bison.simple (YYPARSE_PARAM_DECL):
24469 In C++, make it always null.
24470 (YYPARSE_PARAM_ARG): New macro.
24471 (yyparse): Use YYPARSE_PARAM_ARG.
24472
244731995-11-29 Richard Stallman <rms@gnu.org>
24474
24475 * doc/bison.texinfo:
24476 Describe literal string tokens, %raw, %no_lines, %token_table.
24477
244781995-11-29 Daniel Hagerty <hag@gnu.org>
24479
24480 * doc/bison.texinfo: Fixed update date
24481
244821995-10-16 Richard Stallman <rms@gnu.org>
24483
24484 * src/version.c: Version 1.25.
24485
244861995-10-16 Richard Stallman <rms@gnu.org>
24487
24488 * NEWS: *** empty log message ***
24489
244901995-10-16 Richard Stallman <rms@gnu.org>
24491
24492 * doc/bison.1, doc/bison.rnh:
24493 Add new options.
24494
244951995-10-15 Richard Stallman <rms@gnu.org>
24496
24497 * src/vmsgetargs.c, src/getargs.c:
24498 Added -n, -k, and -raw switches.
24499 (noparserflag, toknumflag, rawtoknumflag): New variables.
24500
24501 * src/symtab.h (SALIAS):
24502 New #define for adding aliases to %token.
24503 (struct bucket): Added `alias' field.
24504
24505 * src/reduce.c (reduce_grammar):
24506 Revise error message.
24507 (print_notices): Remove final `.' from error message.
24508
24509 * src/reader.c (reader_output_yylsp):
24510 New function.
24511 (readgram): Use `#if 0' around code that accepted %command
24512 inside grammar rules: The documentation doesn't allow it,
24513 and it will fail since the %command processors scan for the next %.
24514 (parse_token_decl): Extended the %token
24515 declaration to allow a multi-character symbol as an alias.
24516 (parse_thong_decl): New function.
24517 (read_declarations): Added %thong declarations.
24518 (read_declarations): Handle NOOP to deal with allowing
24519 % declarations as another means to specify the flags.
24520 (readgram): Allow %prec prior to semantics embedded in a rule.
24521 (skip_to_char, read_declarations, copy_definition)
24522 (parse_token_decl, parse_start_decl, parse_type_decl)
24523 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
24524 (get_type_name, copy_guard, copy_action, readgram)
24525 (get_type, packsymbols): Revised most error messages.
24526 Changed `fatal' to `warnxxx' to avoid aborting for error.
24527 Revised and use multiple warnxxx functions to avoid using VARARGS1.
24528 (read_declarations): Improve the error message for
24529 an invalid character. Do not abort.
24530 (read_declarations, copy_guard, copy_action): Use
24531 printable_version to avoid unprintable characters in printed output.
24532 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
24533 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
24534 Allow the type of a non-terminal can be given
24535 more than once, as long as all specifications give the same type.
24536
24537 * src/output.c:
24538 (output_headers, output_trailers, output, output_gram)
24539 (output_rule_data): Implement noparserflag variable.
24540 Implement toknumflag variable.
24541 (output): Call reader_output_yylsp to output LTYPESTR.
24542
24543 * src/main.c (main):
24544 If reader sees an error, don't process the grammar.
24545 (fatals): Updated to not use VARARGS1.
24546 (printable_version, int_to_string, warn, warni, warns, warnss)
24547 (warnsss): New error reporting functions. Avoid abort for error.
24548
24549 * src/lex.h:
24550 Added THONG and NOOP for alias processing.
24551 Added SETOPT for the new code that allows setting options with %flags.
24552
24553 * src/lex.c:
24554 Include getopt.h. Add some extern decls.
24555 (safegetc): New function to deal with EOF gracefully.
24556 (literalchar); new function to deal with reading \ escapes.
24557 (lex): Use literalchar.
24558 (lex): Implemented "..." tokens.
24559 (literalchar, lex, parse_percent_token): Made tokenbuffer
24560 always contain the token. This includes growing the token
24561 buffer while reading an integer.
24562 (parse_percent_token): Replaced if-else statement with percent_table.
24563 (parse_percent_token): Added % declarations as another
24564 way to specify the flags -n, -l, and -r. Also added hooks for
24565 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
24566 major changes to files.c.
24567 (lex) Retain in the incoming stream a character following
24568 an incorrect '/'.
24569 (skip_white_space, lex): Revised most error messages
24570 and changed fatal to warn to avoid aborting.
24571 (percent_table): Added %thong declarations.
24572
24573 * src/gram.h: Comment changes.
24574
24575 * src/files.c (openfiles, open_extra_files, done):
24576 Add faction flag
24577 and actfile file. Handle noparserflag. Both for -n switch.
24578
24579 * src/conflicts.c (resolve_sr_conflict):
24580 Remove use of alloca.
24581
245821995-06-01 Jim Meyering <meyering@gnu.org>
24583
24584 * doc/bison.texinfo: *** empty log message ***
24585
245861995-05-06 Richard Stallman <rms@gnu.org>
24587
24588 * src/bison.s1: Comment change.
24589
245901995-05-06 Richard Stallman <rms@gnu.org>
24591
24592 * bison.simple: Comment change.
24593
245941995-05-03 Richard Stallman <rms@gnu.org>
24595
24596 * src/version.c: Version now 1.24.
24597
24598 * src/bison.s1: Change distribution terms.
24599
24600 * src/version.c: Version now 1.23.
24601
246021995-05-03 Richard Stallman <rms@gnu.org>
24603
24604 * doc/bison.texinfo:
24605 Rewrite "Conditions for Using Bison".
24606 Update version to 1.24.
24607
246081995-05-03 Richard Stallman <rms@gnu.org>
24609
24610 * bison.simple: Change distribution terms.
24611
246121995-02-23 Richard Stallman <rms@gnu.org>
24613
24614 * src/files.c: Test __VMS_POSIX as well as VMS.
24615
246161995-02-14 Jim Meyering <meyering@gnu.org>
24617
24618 * src/bison.s1 (__yy_memcpy):
24619 Renamed from __yy_bcopy to avoid
24620 confusion. Reverse FROM and TO arguments to be consistent with
24621 those of memcpy.
24622
246231995-02-14 Jim Meyering <meyering@gnu.org>
24624
24625 * bison.simple (__yy_memcpy):
24626 Renamed from __yy_bcopy to avoid
24627 confusion. Reverse FROM and TO arguments to be consistent with
24628 those of memcpy.
24629
246301994-11-10 David J. MacKenzie <djm@gnu.org>
24631
24632 * NEWS: reformat
24633
24634 * NEWS: New file.
24635
24636 * Makefile.in (DISTFILES): Include NEWS.
24637
24638 * Makefile.in (DISTFILES):
24639 Include install-sh, not install.sh.
24640
24641 * configure.in: Update to Autoconf v2 macro names.
24642
246431994-10-05 David J. MacKenzie <djm@gnu.org>
24644
24645 * Makefile.in: fix typo
24646
24647 * Makefile.in (prefix, exec_prefix):
24648 Let configure set them.
24649
246501994-09-28 David J. MacKenzie <djm@gnu.org>
24651
24652 * Makefile.in: Set datadir to $(prefix)/share.
24653
246541994-09-15 Richard Stallman <rms@gnu.org>
24655
24656 * src/bison.s1:
24657 Update copyright notice and GPL version.
24658
246591994-09-15 Richard Stallman <rms@gnu.org>
24660
24661 * bison.simple:
24662 Update copyright notice and GPL version.
24663
246641994-07-12 Richard Stallman <rms@gnu.org>
24665
24666 * src/reduce.c, src/reader.c:
24667 entered into RCS
24668
246691994-05-05 David J. MacKenzie <djm@gnu.org>
24670
24671 * Makefile.in: entered into RCS
24672
246731994-03-26 Richard Stallman <rms@gnu.org>
24674
24675 * src/bison.s1: entered into RCS
24676
246771994-03-26 Richard Stallman <rms@gnu.org>
24678
24679 * bison.simple: entered into RCS
24680
246811994-03-25 Richard Stallman <rms@gnu.org>
24682
24683 * src/main.c: entered into RCS
24684
246851994-03-24 Richard Stallman <rms@gnu.org>
24686
24687 * src/conflicts.c: entered into RCS
24688
246891994-01-02 Richard Stallman <rms@gnu.org>
24690
24691 * Makefile.in: *** empty log message ***
24692
246931993-11-21 Richard Stallman <rms@gnu.org>
24694
24695 * src/bison.s1: *** empty log message ***
24696
246971993-11-21 Richard Stallman <rms@gnu.org>
24698
24699 * doc/bison.texinfo: entered into RCS
24700
24701 * doc/bison.texinfo: *** empty log message ***
24702
247031993-11-21 Richard Stallman <rms@gnu.org>
24704
24705 * bison.simple: *** empty log message ***
24706
247071993-10-25 David J. MacKenzie <djm@gnu.org>
24708
24709 * doc/bison.texinfo: *** empty log message ***
24710
247111993-10-19 Richard Stallman <rms@gnu.org>
24712
24713 * src/bison.s1: *** empty log message ***
24714
247151993-10-19 Richard Stallman <rms@gnu.org>
24716
24717 * bison.simple: *** empty log message ***
24718
247191993-10-14 Richard Stallman <rms@gnu.org>
24720
24721 * src/bison.s1: *** empty log message ***
24722
247231993-10-14 Richard Stallman <rms@gnu.org>
24724
24725 * bison.simple: *** empty log message ***
24726
247271993-09-14 David J. MacKenzie <djm@gnu.org>
24728
24729 * doc/bison.texinfo: *** empty log message ***
24730
247311993-09-13 Noah Friedman <friedman@gnu.org>
24732
24733 * Makefile.in: *** empty log message ***
24734
247351993-09-10 Richard Stallman <rms@gnu.org>
24736
24737 * src/conflicts.c: *** empty log message ***
24738
24739 * src/system.h: entered into RCS
24740
247411993-09-10 Richard Stallman <rms@gnu.org>
24742
24743 * doc/bison.1: entered into RCS
24744
247451993-09-06 Noah Friedman <friedman@gnu.org>
24746
24747 * src/version.c: entered into RCS
24748
247491993-09-06 Noah Friedman <friedman@gnu.org>
24750
24751 * Makefile.in: *** empty log message ***
24752
247531993-07-30 David J. MacKenzie <djm@gnu.org>
24754
24755 * Makefile.in: *** empty log message ***
24756
247571993-07-24 Richard Stallman <rms@gnu.org>
24758
24759 * src/bison.s1: *** empty log message ***
24760
247611993-07-24 Richard Stallman <rms@gnu.org>
24762
24763 * bison.simple: *** empty log message ***
24764
247651993-07-08 David J. MacKenzie <djm@gnu.org>
24766
24767 * Makefile.in: *** empty log message ***
24768
247691993-07-04 Richard Stallman <rms@gnu.org>
24770
24771 * src/bison.s1: *** empty log message ***
24772
247731993-07-04 Richard Stallman <rms@gnu.org>
24774
24775 * bison.simple: *** empty log message ***
24776
247771993-06-26 David J. MacKenzie <djm@gnu.org>
24778
24779 * src/getargs.c: entered into RCS
24780
247811993-06-26 David J. MacKenzie <djm@gnu.org>
24782
24783 * doc/bison.texinfo: *** empty log message ***
24784
24785 * doc/bison.1: New file.
24786
247871993-06-25 Richard Stallman <rms@gnu.org>
24788
24789 * src/getargs.c: New file.
24790
247911993-06-16 Richard Stallman <rms@gnu.org>
24792
24793 * src/bison.s1: *** empty log message ***
24794
247951993-06-16 Richard Stallman <rms@gnu.org>
24796
24797 * bison.simple: *** empty log message ***
24798
247991993-06-03 Richard Stallman <rms@gnu.org>
24800
24801 * src/bison.s1: New file.
24802
248031993-06-03 Richard Stallman <rms@gnu.org>
24804
24805 * doc/bison.texinfo: *** empty log message ***
24806
248071993-06-03 Richard Stallman <rms@gnu.org>
24808
24809 * bison.simple: New file.
24810
248111993-05-19 Richard Stallman <rms@gnu.org>
24812
24813 * doc/bison.texinfo: New file.
24814
248151993-05-07 Noah Friedman <friedman@gnu.org>
24816
24817 * Makefile.in: *** empty log message ***
24818
248191993-04-28 Noah Friedman <friedman@gnu.org>
24820
24821 * src/reader.c: *** empty log message ***
24822
248231993-04-23 Noah Friedman <friedman@gnu.org>
24824
24825 * src/alloc.h: entered into RCS
24826
248271993-04-20 David J. MacKenzie <djm@gnu.org>
24828
24829 * src/version.c: *** empty log message ***
24830
24831 * src/files.c, src/allocate.c:
24832 entered into RCS
24833
24834 * src/reader.c: *** empty log message ***
24835
24836 * src/lex.c: entered into RCS
24837
24838 * src/conflicts.c: New file.
24839
24840 * src/symtab.c: entered into RCS
24841
24842 * src/alloc.h: New file.
24843
24844 * src/LR0.c: entered into RCS
24845
248461993-04-18 Noah Friedman <friedman@gnu.org>
24847
24848 * src/reader.c: New file.
24849
24850 * src/version.c: *** empty log message ***
24851
248521993-04-18 Noah Friedman <friedman@gnu.org>
24853
24854 * Makefile.in: *** empty log message ***
24855
248561993-04-17 Noah Friedman <friedman@gnu.org>
24857
24858 * Makefile.in: *** empty log message ***
24859
248601993-04-15 Richard Stallman <rms@gnu.org>
24861
24862 * src/main.c, src/files.c:
24863 New file.
24864
248651993-04-15 Noah Friedman <friedman@gnu.org>
24866
24867 * configure.in: entered into RCS
24868
24869 * configure.in: *** empty log message ***
24870
24871 * configure.in: New file.
24872
248731993-04-14 Richard Stallman <rms@gnu.org>
24874
24875 * Makefile.in: New file.
24876
248771993-04-13 Richard Stallman <rms@gnu.org>
24878
24879 * src/version.c: New file.
24880
248811993-03-25 Richard Stallman <rms@gnu.org>
24882
24883 * src/output.c: entered into RCS
24884
248851992-09-25 Richard Stallman <rms@gnu.org>
24886
24887 * configure.bat: entered into RCS
24888
248891992-06-22 Richard Stallman <rms@gnu.org>
24890
24891 * src/vmsgetargs.c: entered into RCS
24892
248931992-06-22 Richard Stallman <rms@gnu.org>
24894
24895 * doc/bison.rnh: entered into RCS
24896
248971992-04-20 David J. MacKenzie <djm@gnu.org>
24898
24899 * README: entered into RCS
24900
249011992-01-22 Richard Stallman <rms@gnu.org>
24902
24903 * src/machine.h: entered into RCS
24904
249051991-12-21 Richard Stallman <rms@gnu.org>
24906
24907 * src/lalr.c, src/closure.c:
24908 entered into RCS
24909
249101991-12-20 Richard Stallman <rms@gnu.org>
24911
24912 * src/state.h: entered into RCS
24913
249141991-12-18 Richard Stallman <rms@gnu.org>
24915
24916 * src/print.c, src/nullable.c, src/derives.c:
24917 entered into RCS
24918
249191991-11-03 David J. MacKenzie <djm@gnu.org>
24920
24921 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
24922 entered into RCS
24923
249241988-09-09 Richard Stallman <rms@gnu.org>
24925
24926 * src/bison.hairy: entered into RCS
24927
249281987-12-16 Richard Stallman <rms@gnu.org>
24929
24930 * REFERENCES: entered into RCS
24931
24932
24933 -----
24934
24935 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
24936 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
24937 2008, 2009 Free Software Foundation, Inc.
24938
24939 Copying and distribution of this file, with or without
24940 modification, are permitted provided the copyright notice and this
24941 notice are preserved.