]> git.saurik.com Git - bison.git/blob - ChangeLog
cf04873ea80b71ed67761345bdb63bd2019456ce
[bison.git] / ChangeLog
1 2010-01-21 Joel E. Denny <jdenny@clemson.edu>
2
3 maint: automate PACKAGE_COPYRIGHT_YEAR update, and update it.
4 * HACKING (Release Procedure): Update notes on copyright years.
5 * Makefile.am (update-package-copyright-year): New target rule.
6 * build-aux/update-package-copyright-year: New file.
7 * cfg.mk (update-copyright): Add update-package-copyright-year
8 as a dependency.
9
10 2010-01-19 Joel E. Denny <jdenny@clemson.edu>
11
12 * bootstrap: Import improvements from latest gnulib.
13
14 2010-01-19 Joel E. Denny <jdenny@clemson.edu>
15
16 build: require Automake 1.11.1 to avoid a security flaw.
17 * HACKING (Release Procedure): Don't document Automake security
18 flaw here.
19 * configure.ac (AM_INIT_AUTOMAKE): Require 1.11.1, and explain
20 why here.
21
22 2010-01-19 Joel E. Denny <jdenny@clemson.edu>
23
24 gnulib: update to latest.
25
26 2010-01-19 Joel E. Denny <jdenny@clemson.edu>
27
28 ChangeLog (2006-09-15): add Odd Arild Olsen's role for push.c.
29
30 2010-01-15 Joel E. Denny <jdenny@clemson.edu>
31
32 Thank the developer of the initial push parser implementation.
33 This unfortunate oversight is several years old.
34 * THANKS (Odd Arild Olsen): Add.
35
36 2010-01-04 Joel E. Denny <jdenny@clemson.edu>
37
38 Fix some comments concerning LR(0) versus LALR(1).
39
40 Stop equating LR(0) with nondeterminism and LALR(1) with
41 determinism. That is, if all states are consistent, then LR(0)
42 tables are deterministic. On the other hand, LALR(1) tables
43 might be nondeterministic before conflict resolution, and GLR
44 permits LALR(1) tables to remain nondeterministic.
45 * src/LR0.c, src/LR0.h: Here.
46 * src/lalr.c, src/lalr.h: Here.
47 * src/main.c (main): Here.
48 * src/state.c, src/state.h: Here.
49
50 * src/ielr.h (ielr): In preconditions, expect LR(0) not LALR(1)
51 parser tables.
52
53 2010-01-04 Joel E. Denny <jdenny@clemson.edu>
54
55 maint: run "make update-copyright"
56
57 2009-12-30 Joel E. Denny <jdenny@clemson.edu>
58
59 POSIX: complain if %prec's token was not defined.
60 * NEWS (2.5): Document.
61 * src/reader.c (grammar_rule_check): Convert warning to
62 complaint.
63 * tests/input.at (%prec's token must be defined): Update.
64
65 2009-12-30 Joel E. Denny <jdenny@clemson.edu>
66
67 POSIX: warn if %prec's token was not defined.
68 Reported by Florian Krohm at
69 <http://lists.gnu.org/archive/html/bug-bison/2009-12/msg00005.html>.
70 * NEWS (2.4.2): Document.
71 * src/reader.c (grammar_rule_check): Implement.
72 (grammar_current_rule_prec_set): Add comments explaining that we
73 here assume a %prec identifier is a token, but we still manage
74 to support POSIX.
75 * tests/input.at (%prec's token must be defined): New test
76 group.
77
78 2009-12-31 Joel E. Denny <jdenny@clemson.edu>
79
80 * HACKING (Release Procedure): Recommend a secure automake.
81
82 2009-12-29 Joel E. Denny <jdenny@clemson.edu>
83
84 portability: `<' and `>' are not always defined on addresses.
85 Specifically, don't sort objects by their memory addresses when
86 they're not allocated in the same array or other object. Though
87 I haven't found a test case where that fails on my platform, C
88 says the behavior is undefined.
89 * src/AnnotationList.c (AnnotationList__insertInto): Remove
90 FIXME. Use new id field of InadequacyList nodes rather than
91 their memory addresses when sorting.
92 (AnnotationList__compute_from_inadequacies): Add
93 inadequacy_list_node_count argument to pass to
94 InadequacyList__new_conflict.
95 * src/AnnotationList.h
96 (AnnotationList__compute_from_inadequacies): Update prototype
97 and documentation for new argument.
98 * src/InadequacyList.c (InadequacyList__new_conflict): Add
99 node_count argument and use it to assign a unique ID.
100 * src/InadequacyList.h (InadequacyListNodeCount): New typedef.
101 (InadequacyList): Add id field.
102 (InadequacyList__new_conflict): Update prototype and
103 documentation for new argument.
104 * src/ielr.c (ielr_compute_annotation_lists): Update
105 AnnotationList__compute_from_inadequacies invocation.
106
107 2009-12-20 Joel E. Denny <jdenny@clemson.edu>
108
109 Fix handling of yychar manipulation in user semantic actions.
110 The problem was that yacc.c didn't always update the yychar
111 translation afterwards. However, other skeletons appear to be
112 fine. glr.c appears to already translate yychar before every
113 use. lalr1.cc does not define yychar and does not document its
114 replacement, yyla, for users. It does provide yyclearin, but
115 that does not manipulate yyla and thus requires no translation
116 update. In lalr1.java, yychar is out of scope during semantic
117 actions.
118 * NEWS (2.5): Document.
119 * data/yacc.c (YYBACKUP): Don't bother translating yychar into
120 yytoken here.
121 (yyparse, yypush_parse): Instead, translate before every use of
122 yytoken, and add comments explaining this approach.
123 * tests/actions.at (Destroying lookahead assigned by semantic
124 action): New test group checking that translation happens before
125 lookahead destructor calls at parser return. Previously,
126 incorrect destructors were called.
127 * tests/conflicts.at (parse.error=verbose and consistent
128 errors): New test group checking that translation happens at
129 syntax error detection before the associated verbose error
130 message and the associated lookahead destructor calls. While
131 the destructor call is fixed by this patch, the verbose error
132 message is currently incorrect due to another bug (see
133 comments in test group), so this is an expected failure for now.
134
135 2009-12-21 Joel E. Denny <jdenny@clemson.edu>
136
137 YYFAIL: warn about uses and remove from lalr1.java.
138 * NEWS (2.5): Document.
139 * data/lalr1.java (parser::YYStack::YYFAIL): Rename to YYERRLAB,
140 and make it private. Update all uses.
141 * src/scan-code.l (SC_RULE_ACTION): Implement warning.
142
143 2009-12-21 Joel E. Denny <jdenny@clemson.edu>
144
145 YYFAIL: deprecate.
146 * NEWS (2.4.2): Document deprecation and the phase-out plan.
147 * data/lalr1.java (parser::YYStack::YYFAIL): Add comment about
148 deprecation.
149 * data/yacc.c (YYFAIL): Likewise, and suppress warnings about
150 YYFAIL from GCC cpp's -Wunused-macros.
151 * doc/bison.texinfo (Java Action Features): Remove YYFAIL
152 documentation.
153 (LocalWords): Remove YYFAIL.
154
155 2009-12-20 Joel E. Denny <jdenny@clemson.edu>
156
157 tests: cleanup.
158 * tests/c++.at (Syntax error discarding no lookahead): Don't
159 ignore stderr. Instead, eliminate remaining warnings.
160
161 2009-12-18 Joel E. Denny <jdenny@clemson.edu>
162
163 lalr1.cc: don't discard non-existent lookahead on syntax error.
164 * data/lalr1.cc (parser::parse): Check yyempty first.
165 * tests/c++.at (Syntax error discarding no lookahead): New test
166 group.
167
168 2009-12-17 Joel E. Denny <jdenny@clemson.edu>
169
170 Code cleanup.
171 * src/symtab.c, src/symtab.h (symbol_class_get_string): Remove
172 function, which is no longer used.
173
174 2009-12-16 Joel E. Denny <jdenny@clemson.edu>
175
176 Add gcc's -Wundef to test suite and fix another warning from it.
177 * NEWS (2.4.2): Update description of -Wundef fix.
178 * configure.ac (WARN_CXXFLAGS_TEST): New substitution.
179 (WARN_CFLAGS_TEST): New substitution.
180 * data/glr.c: Avoid warning about __STRICT_ANSI__.
181 * tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
182 WARN_CFLAGS.
183 (NO_WERROR_CFLAGS): Likewise.
184 (CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
185
186 2009-12-16 Joel E. Denny <jdenny@clemson.edu>
187
188 * data/yacc.c: Reformat m4 a little.
189
190 2009-12-16 Joel E. Denny <jdenny@clemson.edu>
191
192 Document gcc -Wundef fix.
193 * NEWS (2.4.2): Here.
194 * THANKS (Jonathan Nieder): Add.
195
196 2009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
197
198 Simplify y.tab.c when location tracking is disabled.
199 * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
200 tracking is not enabled. Instead, unconditionally define
201 YY_LOCATION_PRINT as a no-op for backward compatibility.
202
203 2009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
204
205 Avoid warnings from gcc -Wundef y.tab.c.
206 * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
207 defined before using them.
208 * data/lalr1.cc: Likewise.
209 * data/yacc.c: Likewise.
210
211 2009-12-15 Joel E. Denny <jdenny@clemson.edu>
212
213 autoconf: update to latest for fix of M4 detection.
214 Reported by Eric Blake.
215 * submodules/autoconf: Update.
216
217 2009-12-15 Joel E. Denny <jdenny@clemson.edu>
218
219 portability: use -DGNULIB_POSIXCHECK.
220 Reported by Eric Blake. See discussions at
221 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html>
222 and
223 <http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html>.
224 * HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
225 * bootstrap.conf (gnulib_modules): Add all the printf modules
226 suggested by -DGNULIB_POSIXCHECK. Add realloc-posix as
227 suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
228 (excluded_files): Remove m4/printf-posix.m4.
229 * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
230 lib/libbison.a so gnulib libraries can be linked.
231
232 2009-12-15 Joel E. Denny <jdenny@clemson.edu>
233
234 gnulib: update for fix of fprintf-posix, which we'll use soon.
235 * etc/prefix-gnulib-mk (prefix): Adjust regex for make file
236 targets so that gnulib's new arg-nonnull.h and link-warning.h
237 are matched.
238 * gnulib: Update.
239
240 2009-12-14 Joel E. Denny <jdenny@clemson.edu>
241
242 Enable assertion output and --disable-assert for configure.
243 * bootstrap.conf (gnulib_modules): Add assert module.
244 * src/system.h (aver): Define as assert, and summarize the
245 discussion on this issue.
246
247 2009-12-14 Joel E. Denny <jdenny@clemson.edu>
248
249 Expand GLR acronym in summary of Bison.
250 Based on discussion with Akim Demaille starting at
251 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html>.
252 * doc/bison.texinfo (Introduction): Here.
253 * src/getargs.c (usage): Here.
254
255 2009-10-03 Alex Rozenman <rozenman@gmail.com>
256
257 Document named references.
258 * doc/bison.texinfo (Actions): Add new example and xref to
259 Using Named References node.
260 (Using Named References): New node.
261
262 2009-10-16 Joel E. Denny <jdenny@clemson.edu>
263
264 cleanup.
265 * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead
266 of char*.
267 (Sbitset__isEmpty): Use Sbitset instead of char*.
268 * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char
269 instead of char. This helps to avoid casting errors.
270 (Sbitset__or): Use Sbitset instead of char*.
271
272 2009-10-16 Joel E. Denny <jdenny@clemson.edu>
273
274 portability: don't assume 8-bit bytes.
275 That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff.
276 * src/Sbitset.h (Sbitset__nbytes): Here.
277 (Sbitset__byteAddress): Here.
278 (Sbitset__bit_mask): Here.
279 (Sbitset__last_byte_mask): Here.
280 (Sbitset__ones): Here.
281 (SBITSET__FOR_EACH): Here.
282
283 2009-10-11 Joel E. Denny <jdenny@clemson.edu>
284
285 portability: use va_start and va_end in the same function.
286 * src/complain.c (error_message): Move va_end from here...
287 (ERROR_MESSAGE): ... to here.
288
289 2009-10-08 Joel E. Denny <jdenny@clemson.edu>
290
291 * data/bison.m4: Update comments for rename to muscle-tab.h.
292
293 2009-10-07 Joel E. Denny <jdenny@clemson.edu>
294
295 Minor code cleanup.
296 * src/muscle-tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and
297 replace all uses with UNIQSTR_CONCAT.
298 * src/uniqstr.c (uniqstr_vsprintf): New function.
299 * src/uniqstr.h (uniqstr_vsprintf): Add prototype.
300 (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New
301 macros.
302
303 2009-10-06 Joel E. Denny <jdenny@clemson.edu>
304
305 * TODO (Complaint submessage indentation): New.
306
307 2009-10-04 Joel E. Denny <jdenny@clemson.edu>
308
309 Minor code cleanup.
310 * src/parse-gram.y: Clean up sorting of declarations.
311 Use types to simplify %printer declarations where possible.
312 Provide %printer for BRACKETED_ID and symbol.prec.
313 * src/symtab.c: Whitespace change.
314
315 2009-10-04 Joel E. Denny <jdenny@clemson.edu>
316
317 tests: skip tests of file names that platform does not support.
318 Reported by Michael Raskin at
319 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
320 * THANKS (Michael Raskin): Add.
321 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
322 to fail at least for file names containing ":" or "\".
323
324 2009-09-23 Joel E. Denny <jdenny@clemson.edu>
325
326 yysyntax_error: avoid duplicate lookahead collection.
327 Except when memory reallocation is required, this change
328 eliminates the need to invoke yysyntax_error twice and thus to
329 repeat the collection of lookaheads. It also prepares for
330 future extensions that will make those repetitions more
331 expensive and that will require additional memory management in
332 yysyntax_error. Finally, it fixes an obscure bug already
333 exercised in the test suite.
334 * data/yacc.c (yysyntax_error): Add arguments for message
335 buffer variables stored in the parser. Instead of size, return
336 status similar to yyparse status but indicating success of
337 message creation. Other than the actual reallocation of the
338 message buffer, import and clean up memory management code
339 from...
340 (yyparse, yypush_parse): ... here.
341 * tests/regression.at (parse.error=verbose overflow): No longer
342 an expected failure.
343
344 2009-09-23 Joel E. Denny <jdenny@clemson.edu>
345
346 yysyntax_error: test memory management more.
347 * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro.
348 * tests/regression.at (parse.error=verbose and
349 YYSTACK_USE_ALLOCA): New test group.
350 (parse.error=verbose overflow): New test group that reveals an
351 obscure bug. Expected fail for now.
352
353 2009-10-04 Joel E. Denny <jdenny@clemson.edu>
354
355 benchmarks: use %debug consistently among grammars.
356 * etc/bench.pl.in (generate_grammar_triangular): Do not activate
357 %debug by default. It can affect the timings even if yydebug=0.
358 (generate_grammar_calc): For consistency with other grammars,
359 use YYDEBUG environment variable to set yydebug.
360
361 2009-10-03 Joel E. Denny <jdenny@clemson.edu>
362
363 Remove dead code.
364 * src/symtab.c (symbol_pack): Here because every symbol's number
365 is always defined by this time.
366
367 2009-10-03 Alex Rozenman <rozenman@gmail.com>
368
369 Add additional space after periods in NEWS.
370 * NEWS (2.5): here.
371
372 2009-09-29 Joel E. Denny <jdenny@clemson.edu>
373
374 Use the correct conversion specifier for size_t.
375 Reported by Jim Meyering.
376 * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu"
377 because Sbitset__Index is size_t.
378 * src/Sbitset.c (Sbitset__fprint): Use it instead of %d.
379
380 2009-09-27 Joel E. Denny <jdenny@clemson.edu>
381
382 tests: don't abuse AT_BISON_CHECK.
383 * tests/regression.at (parse-gram.y: LALR = IELR): Move
384 additional shell commands outside of AT_BISON_CHECK.
385
386 2009-09-26 Joel E. Denny <jdenny@clemson.edu>
387
388 tests: check that parse-gram.y's IELR and LALR are identical.
389 * tests/atlocal.in (abs_top_srcdir): New shell variable.
390 * tests/regression.at (parse-gram.y: LALR = IELR): New test
391 group.
392
393 2009-09-19 Alex Rozenman <rozenman@gmail.com>
394
395 Keep sub-messages aligned. Fix strings for translation.
396 * src/location.h (location_print): Add return value.
397 * src/location.c (location_print): Return number of printed
398 characters.
399 * src/complain.h (complain_at_indent, warn_at_indent): Prototype
400 new functions.
401 * src/complain.cpp (indent_ptr): New static variable.
402 (error_message, complain_at_indent, warn_at_indent): Implement
403 the alignment mechanism.
404 * src/scan-code.l (parse_ref, show_sub_messages): Fix strings
405 for translations. Use new alignment mechanism.
406 * tests/named-ref.at: Adjust test-cases.
407 * NEWS (2.5): Add an announcement about named references.
408
409 2009-09-17 Akim Demaille <demaille@gostai.com>
410
411 doc: fixes.
412 * doc/bison.texinfo: here.
413 Reported by Alex Rozenman.
414
415 2009-09-16 Akim Demaille <demaille@gostai.com>
416
417 doc: lalr1.cc and variants.
418 * doc/bison.texinfo (Decl Summary): Document the "lex_symbol" and
419 "variant" %define variables.
420 (C++ Semantic Values): Split into...
421 (C++ Unions, C++ Variants): these.
422 The latter is new.
423 (C++ Parser Interface): Fix type names.
424 Document parser::syntax_error.
425 Document the fact that locations are not mandatory.
426 (C++ Scanner Interface): Split into...
427 (Split Symbols, Complete Symbols): these.
428 The later is new.
429 (Calc++ Parsing Driver): Use variants.
430 Add more comments.
431 Adjust style.
432 (Calc++ Parser): Declare all the tokens, no
433 longer accept raw characters.
434 Remove %union.
435 Adjust types and printers.
436 Remove destructors.
437 (Calc++ Scanner): Use make_<SYMBOL> functions.
438 Use strerror in error message.
439
440 2009-09-16 Akim Demaille <demaille@gostai.com>
441
442 doc: spell checking.
443 * doc/bison.texinfo: here.
444
445 2009-09-16 Akim Demaille <demaille@gostai.com>
446
447 doc: comment changes.
448 * doc/bison.texinfo: Comment changes.
449
450 2009-09-16 Akim Demaille <demaille@gostai.com>
451
452 lalr1.cc: factor the yytranslate_ invocation in make_SYMBOLS.
453 * data/c++.m4, data/lalr1.cc (parser::symbol_type): Change the
454 constructor to take a token_type instead of the (internal) symbol
455 number.
456 Call yytranslate_.
457 * data/variant.hh (b4_symbol_constructor_define_): Therefore,
458 don't call yytranslate_ here.
459
460 2009-09-16 Akim Demaille <demaille@gostai.com>
461
462 TODO: statistics.
463 * TODO (Figures): New.
464
465 2009-09-13 Joel E. Denny <jdenny@clemson.edu>
466
467 tests: clean up push.at test group titles.
468 * tests/push.at: Remove "Push Parsing: " from test group titles
469 because these are already under the banner "Push Parsing Tests".
470
471 2009-09-12 Alex Rozenman <rozenman@gmail.com>
472
473 Provide an additional sub-message for clarity.
474 Add "symbol not found in production" error message when
475 an "invalid reference" is detected in named references
476 resolution.
477 * src/scan-code.l: Update "invalid reference" case.
478 * tests/named-ref.at: Adjust test-cases.
479
480 2009-09-10 Joel E. Denny <jdenny@clemson.edu>
481
482 Clean up yacc.c a little.
483 * data/yacc.c: Clean up M4 for readability, and make output
484 whitespace more consistent. For the main parse function
485 comment, instead of saying "yyparse or yypush_parse", say either
486 "yyparse" or "yypush_parse" depending on which it actually is.
487
488 2009-09-10 Joel E. Denny <jdenny@clemson.edu>
489
490 Fix --enable-gcc-warnings.
491 * src/parse-gram.y (%printer <param>): Handle param_none.
492
493 2009-09-09 Akim Demaille <demaille@gostai.com>
494
495 lalr1.cc: syntax_error as exceptions.
496 It is common to use sort of factories in the user actions. These
497 factories may check some "syntactic" constraints that are not
498 enforced by the grammar itself. This is possible using YYERROR
499 within the action itself. Provide the user with a means to throw
500 a syntax_error exception.
501
502 * data/c++.m4 (b4_public_types_declare, b4_public_types_define):
503 Declare and define yy::parser::syntax_error.
504 * data/lalr1.cc: Include stdexcept.
505 (yy::parser::parse): Wrap the user action within a try/catch.
506 * data/glr.cc: Include stdexcept.
507
508 2009-09-09 Akim Demaille <demaille@gostai.com>
509
510 lalr1.cc: add missing "inline".
511 * data/c++.m4 (b4_public_types_define): Add missing inline to
512 implementations provided in headers.
513
514 2009-09-09 Akim Demaille <demaille@gostai.com>
515
516 %param: documentation.
517 * NEWS (2.6): Document %param, %lex-param, and %parse-param
518 changes.
519 * doc/bison.texinfo: Document that %lex-param and %parse-param
520 are n-ary.
521 Changes some examples to demonstrate it.
522 (Calc++ Parser): Use %param.
523
524 2009-09-09 Akim Demaille <demaille@gostai.com>
525
526 Regen.
527
528 2009-09-09 Akim Demaille <demaille@gostai.com>
529
530 style changes.
531 * src/parse-gram.y (add_param): Scope changes.
532
533 2009-09-09 Akim Demaille <demaille@gostai.com>
534
535 %parse: support several arguments.
536 * src/parse-gram.y (current_param): New.
537 (param_type): Add param_none.
538 (params): New nonterminal.
539 Use it.
540
541 2009-09-09 Akim Demaille <demaille@gostai.com>
542
543 Regen.
544
545 2009-09-09 Akim Demaille <demaille@gostai.com>
546
547 %param.
548 Provide a means to factor lex-param and parse-param common
549 declarations.
550
551 * src/parse-gram.y (param_type): New.
552 Define a %printer for it.
553 (add_param): Use it.
554 (%parse-param, %lex-param): Merge into...
555 (%parse): this new token.
556 Adjust the grammar to use it.
557 * src/scan-gram.l (RETURN_VALUE): New.
558 (RETURN_PERCENT_FLAG): Use it.
559 (RETURN_PERCENT_PARAM): New.
560 Use it to support %parse-param, %lex-param and %param.
561
562 2009-09-03 Joel E. Denny <jdenny@clemson.edu>
563
564 Use aver not assert.
565 * src/output.c: Don't include assert.h.
566 (output_skeleton): Use aver not assert.
567 * src/system.h (aver): In documentation of why, add links to
568 Paul Eggert's explanations in the mailing lists.
569
570 2009-09-05 Alex Rozenman <rozenman@gmail.com>
571
572 Use "Unresolved reference" error message when no symbols were found
573 in a symbolic reference resolution. Remove .expr and -expr from
574 the shown reference when the reference is unresolved.
575 * src/scan-code.l: Change the error message, adjust location columns,
576 rename variable "exact_mode" to "explicit_bracketing".
577 * tests/named-ref.at: Adjust existing tests and add a new one.
578
579 2009-09-04 Akim Demaille <demaille@gostai.com>
580
581 Adjust synclines in src/parse-gram.[ch].
582 * tests/bison.in: Do some magic (including working around issues
583 with ylwrap) when this wrapper is used to compile
584 src/parse-gram.y.
585
586 2009-09-03 Joel E. Denny <jdenny@clemson.edu>
587
588 Complain about unused %define variables and %code qualifiers.
589 * NEWS (2.5): Document.
590 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
591 * doc/bison.texinfo (Decl Summary): Document complaint, and
592 improve %define documentation a little otherwise.
593 * tests/input.at (Reject unused %code qualifiers): Update.
594 (%define errors): Update.
595 (%define, --define, --force-define): Update.
596 (%define backward compatibility): Update.
597 (Unused %define api.pure): Update.
598 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
599
600 2009-09-03 Joel E. Denny <jdenny@clemson.edu>
601
602 Don't suppress warnings about unused parse.error.
603 * data/bison.m4 (b4_error_verbose_flag): Don't examine value of
604 %define variable parse.error unless b4_error_verbose_flag is
605 actually expanded in a skeleton.
606
607 2009-09-03 Akim Demaille <demaille@gostai.com>
608
609 * NEWS (2.4.2): Add "Internationalization" item.
610
611 2009-09-03 Akim Demaille <demaille@gostai.com>
612
613 bootstrap: fix/improve find_tool.
614 * bootstrap (find_tool): Improve error messages.
615 Fix typo about find_tool_names.
616
617 2009-08-29 Joel E. Denny <jdenny@clemson.edu>
618
619 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
620 See
621 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
622 * src/scan-code.h (code_props_rule_action_init): Rename
623 named_ref arg to name so it doesn't shadow named_ref type. This
624 makes it consistent with the function definition in scan-code.l
625 anyway.
626
627 2009-08-28 Joel E. Denny <jdenny@clemson.edu>
628
629 %define: accept unquoted values.
630 * NEWS (2.5): Group all %define changes together, and document
631 this one. Remove quotes in IELR and canonical LR entry.
632 * doc/bison.texinfo: Remove quotes in most examples throughout.
633 (Decl Summary): Update %define documentation.
634 (Table of Symbols): Likewise.
635 * src/ielr.c (LrType): Update documentation.
636 * src/parse-gram.y (content.opt): Add production for ID.
637 * tests/actions.at: Remove quotes in most tests.
638 * tests/calc.at: Likewise.
639 * tests/existing.at: Likewise.
640 * tests/input.at: Likewise.
641 * tests/local.at: Likewise.
642 * tests/push.at: Likewise.
643 * tests/reduce.at: Likewise.
644 * tests/torture.at: Likewise.
645
646 2009-08-28 Joel E. Denny <jdenny@clemson.edu>
647
648 %define lr.type: make values lowercase IDs.
649 That is, "LALR" => "lalr", "IELR" => "ielr", and
650 "canonical LR" => "canonical-lr".
651 * NEWS (2.5): Update documentation.
652 * doc/bison.texinfo (Decl Summary): Likewise.
653 * src/ielr.c (ielr): Use new values.
654 * src/ielr.h (ielr): Update documentation.
655 * src/reader.c (prepare_percent_define_front_end_variables): Use
656 and validate new values.
657 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
658 grammars.
659 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
660
661 2009-08-27 Eric Blake <ebb9@byu.net>
662
663 scan-gram: avoid portability trap with ctype usage.
664 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
665 Avoid compiler warning.
666
667 2009-08-27 Joel E. Denny <jdenny@clemson.edu>
668
669 tests: use perl for printing special sequences to files.
670 And skip tests if perl is not available. This is better than
671 playing tricks with shell portability. Suggested by Akim
672 Demaille.
673 * tests/input.at (Bad character literals): Use it here for
674 omitting final newlines.
675 (Bad escapes in literals): Use it here for special characters.
676
677 2009-08-26 Joel E. Denny <jdenny@clemson.edu>
678
679 tests: show a use of %define lr.default-reductions "consistent"
680 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
681 prevents the omission of expected tokens for %error-verbose.
682
683 2009-08-26 Akim Demaille <demaille@gostai.com>
684
685 tests: portability fix.
686 * tests/input.at (Bad escapes in literals): Don't expect "echo
687 '\0'" to output \ then 0.
688
689 2009-08-26 Joel E. Denny <jdenny@clemson.edu>
690
691 Actually handle the yytable zero value correctly this time.
692 * data/bison.m4 (b4_integral_parser_tables_map): Don't mention
693 zero values in the YYTABLE comments.
694 * data/glr.c (yytable_value_is_error): Don't check for zero
695 value.
696 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
697 * data/yacc.c (yytable_value_is_error): Likewise.
698 * data/lalr1.java (yy_table_value_is_error_): Likewise.
699 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
700 * src/tables.h: In header comments, explain why it's useless to
701 check for a zero value in yytable.
702
703 2009-08-25 Joel E. Denny <jdenny@clemson.edu>
704
705 More fixes related to last two patches.
706 * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE
707 comments: zero indicates syntax error not default action.
708 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
709 defined.
710 * data/glr.c (yyis_pact_ninf): Rename to...
711 (yypact_value_is_default): ... this.
712 (yyisDefaultedState): Update for rename.
713 (yyis_table_ninf): Rename to...
714 (yytable_value_is_error): ... this, and check for value zero
715 besides just YYTABLE_NINF.
716 (yygetLRActions): Check for default value from yypact. It
717 appears that this check is always performed before this function
718 is invoked, and so adding the check here is probably redundant.
719 However, the code may evolve after this subtlety is forgotten.
720 Also, update for rename to yytable_value_is_error. Because that
721 macro now checks for zero, a different but equivalent branch of
722 the if-then-else here is evaluated.
723 (yyreportSyntaxError): Update for rename to
724 yytable_value_is_error. The zero condition was mishandled
725 before.
726 (yyrecoverSyntaxError): Update for renames. No behavioral
727 changes.
728 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
729 New function.
730 (yy_table_value_is_error_): New function.
731 (parse): Use new functions where possible. No behavioral
732 changes.
733 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
734 The zero condition was mishandled before.
735 * data/yacc.c (yyis_pact_ninf): Rename to...
736 (yypact_value_is_default): ... this.
737 (yyis_table_ninf): Rename to...
738 (yytable_value_is_error): ... this, and check for value zero
739 besides just YYTABLE_NINF.
740 (yysyntax_error): Update for rename to yytable_value_is_error.
741 The zero condition was mishandled before.
742 (yyparse): Update for renames. No behavioral changes.
743 * src/tables.h: Improve comments about yypact, yytable, etc.
744 more. Most importantly, say yytable value of zero means syntax
745 error not default action.
746
747 2009-08-25 Joel E. Denny <jdenny@clemson.edu>
748
749 Fix %error-verbose for conflicts resolved by %nonassoc.
750 * NEWS (2.5): Document.
751 * data/glr.c (yyreportSyntaxError): Fix this by checking
752 yyis_table_ninf.
753 * data/yacc.c (yysyntax_error): Likewise.
754 * data/lalr1.cc (yysyntax_error_): Fix this by checking
755 yytable_ninf_.
756 * data/lalr1.java (yysyntax_error): Likewise.
757 * tests/conflicts.at (%nonassoc and eof): Update expected output
758 and remove FIXME.
759
760 2009-08-25 Joel E. Denny <jdenny@clemson.edu>
761
762 Some code and documentation improvements.
763 * data/c.m4 (b4_table_value_equals): New macro to capture
764 some repeated code.
765 * data/glr.c (yyis_pact_ninf): Use it here.
766 (yyis_table_ninf): Likewise.
767 (yyreportSyntaxError): Improve internal comments.
768 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
769 Use it everywhere possible.
770 (yyis_table_ninf): Likewise.
771 (yysyntax_error): Improve internal comments.
772 * data/lalr1.cc (yysyntax_error_): Likewise.
773 * data/lalr1.java (yysyntax_error): Likewise.
774 * src/tables.h: Improve comments about yypact, yytable, etc.
775
776 2009-08-21 Joel E. Denny <jdenny@clemson.edu>
777
778 Use locale when quoting.
779 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
780 quote rather than implementing quoting here.
781
782 2009-08-20 Eric Blake <ebb9@byu.net>
783
784 Make previous patch more robust.
785 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
786 argmatch.h.
787 (output_skeleton): Use it.
788 Suggested by Akim Demaille.
789
790 Import latest m4/m4.m4.
791 * submodules/autoconf: Update to autoconf 2.64.
792 * configure.ac (M4_GNU_OPTION): New define.
793 * src/output.c (output_skeleton): Use it to resolve FIXME.
794 * NEWS: Mention this.
795
796 2009-08-19 Joel E. Denny <jdenny@clemson.edu>
797
798 Fix complaints about escape sequences.
799 Discussed starting at
800 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
801 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
802 For a \0 and similar escape sequences meaning the null
803 character, report an invalid escape sequence instead of an
804 invalid null character because the latter does not actually
805 appear in the user's input.
806 In all escape sequence complaints, don't escape the initial
807 backslash, and don't quote when the sequence appears at the end
808 of the complaint line unless there's whitespace that quotearg
809 won't escape.
810 Consistently say "invalid" not "unrecognized".
811 Consistently prefer "empty character literal" over "extra
812 characters in character literal" warning for invalid escape
813 sequences; that is, consistently discard those sequences.
814 * tests/input.at (Bad escapes in literals): New.
815
816 2009-08-19 Akim Demaille <demaille@gostai.com>
817
818 doc: fixes.
819 * doc/bison.texinfo: Fix minor Texinfo errors.
820
821 2009-08-19 Akim Demaille <demaille@gostai.com>
822
823 tests: distcc compliance.
824 * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's
825 error messages from the output.
826
827 2009-08-19 Akim Demaille <demaille@gostai.com>
828
829 variables: simplify the upgrade of namespace into api.namespace.
830
831 This patch simplifies "variables: rename namespace as
832 api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c.
833 Suggested by Joel E. Denny in
834 http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html
835
836 * src/muscle-tab.c (muscle_percent_variable_update): New.
837 (muscle_percent_define_insert): Use it in replacement of the
838 previous tr invocation.
839 Remove variable_tr, no longer needed.
840 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
841 Remove.
842 * data/c++.m4: No longer handle namespace -> api.namespace.
843 * tests/input.at (%define backward compatibility): Check that
844 namespace is treated as api.namespace.
845
846 2009-08-19 Akim Demaille <demaille@gostai.com>
847
848 doc: %initial-action to initialize yylloc.
849 Reported by Bill Allombert.
850 * doc/bison.texinfo: Set fill-column to 76.
851 (Location Type): Document the use of %initial-action to initialize
852 yylloc.
853
854 2009-08-19 Akim Demaille <demaille@gostai.com>
855
856 lalr1.cc: use state_type.
857 * data/lalr1.cc (yysyntax_error_): Use state_type.
858 Move argument names into yy*.
859
860 2009-08-19 Akim Demaille <demaille@gostai.com>
861
862 lalr1.cc: get rid of yyparse's yystate.
863 yystate and yystack_[0].state are equal, keep only the latter.
864 The former was also used as a temporary variable to compute the
865 post-reduction state. Move this computation into an auxiliary
866 function.
867
868 * data/glr.c (yyLRgotoState): Fuse variable definition and first
869 assignment.
870 * data/lalr1.cc (yy_lr_goto_state_): New.
871 (yyparse): Use it.
872 Replace remaining uses of yystate by yystate_[0].state.
873 Remove the former.
874
875 2009-08-19 Akim Demaille <demaille@gostai.com>
876
877 lalr1.cc: destroy $$ when YYERROR is called.
878 * data/lalr1.cc (yyreduce): Compute the resulting state before
879 running the user action so that yylhs is a valid symbol.
880 (yyerrorlab): Since yylhs is complete (it knows its type), we can
881 simply call yy_destroy_ to destroy $$ on YYERROR invocations.
882 * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants.
883
884 2009-08-18 Joel E. Denny <jdenny@clemson.edu>
885
886 maint: update for gnulib's recent update-copyright changes
887 * gnulib: Update.
888 * .x-update-copyright (COPYING): Add as it's no longer implied
889 when .x-update-copyright is present.
890 * cfg.mk (update-copyright-local): Remove, now ignored.
891 (update-copyright): Declare update-b4-copyright as a dependency.
892
893 2009-08-17 Akim Demaille <demaille@gostai.com>
894
895 build: require gettext 0.17.
896
897 Suggested by Bruno Haible.
898 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
899 * configure.ac: require gettext 0.17 to ensure compatibility with
900 gnulib.
901
902 2009-08-17 Akim Demaille <demaille@gostai.com>
903
904 build: lower gettext requirements.
905
906 Bison was uselessly requiring the formatstring macros from
907 gettext, which resulted in mo files not being installed on systems
908 that perfectly supported Bison mo files. Lower the requirement.
909 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
910
911 * configure.ac: Require need-ngettext instead of
912 need-formatstring-macros.
913 Reported by Martin Jabocs.
914 Suggested by Bruno Haible.
915 * INSTALL: Restructure.
916 (Internationalization): New.
917
918 2009-08-14 Joel E. Denny <jdenny@clemson.edu>
919
920 maint: fix use of copyright year intervals.
921 * gnulib: Update.
922 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
923 as now recommended in gnulib/NEWS.
924 * build-aux/update-b4-copyright: Fix.
925 * cfg.mk (update-copyright-env): Configure update-copyright.
926
927 2009-08-13 Joel E. Denny <jdenny@clemson.edu>
928
929 Make it easier to write deterministic tests.
930 Continues Akim's work from his 2009-06-10 commits.
931 * src/reader.c (check_and_convert_grammar): Don't add any
932 symbols after the first symbols_do invocation.
933 * src/symtab.c (symbols_sorted): New static global.
934 (user_token_number_redeclaration): Update comments.
935 (symbol_from_uniqstr): If a new symbol is being created, assert
936 that symbols_sorted hasn't been allocated yet.
937 (symbols_free): Free symbols_sorted.
938 (symbols_cmp, symbols_cmp_qsort): New functions.
939 (symbols_do): Sort symbol_table into symbols_sorted on first
940 invocation.
941 * tests/input.at (Numbered tokens): Recombine tests now that the
942 output should be deterministic across multiple numbers.
943
944 2009-08-12 Akim Demaille <demaille@gostai.com>
945
946 tests: GCC 4.5 compliance.
947 * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's
948 messages about #error.
949
950 2009-08-12 Akim Demaille <demaille@gostai.com>
951
952 build: fix the generation of the documentation.
953 Some of our targets use "bison --help", but they can't depend on
954 "bison" itself (to avoid additional requirements on the user), so
955 they used to call "make src/bison" in the commands. Then
956 concurrent builds may fail: one make might be aiming one of its
957 jobs at compiling src/bison, and another job at generating the man
958 page. If the latter is faster than the former, then we have two
959 makes that concurrently try to compile src/bison.
960
961 This might also be a more convincing explanation for the failure
962 described in the patch "build: fix paths".
963
964 * Makefile.am (SUFFIXES): Initialize.
965 * build-aux/move-if-change: New, symlink to gnulib's.
966 * build-aux/local.mk: Ship it.
967 * doc/common.x: Remove, merged into...
968 * doc/bison.x: here.
969 * doc/local.mk (doc/bison.help): New.
970 ($(CROSS_OPTIONS_TEXI)): Depend on it.
971 Use src/bison.
972 (.x.1): Replace with...
973 (doc/bison.1): this explicit, simpler, target.
974 (common_dep): Remove, inlined where appropriate.
975 (SUFFIXES, PREPATH): Remove, unused.
976
977 2009-08-12 Akim Demaille <demaille@gostai.com>
978
979 gnulib: improve prefixing.
980 * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather,
981 change the value of...
982 (gl_LIBOBJS): this.
983 Adjust more variables.
984 * etc/prefix-gnulib-mk (prefix_assignment): Don't rename
985 gl_LIBOBJS.
986 (prefix): Also transform rules whose targets have slashes.
987 Use $prefix liberally.
988 Map @MKDIR_P@ to $(MKDIR_P).
989 Prefix directories that are mkdir'd.
990
991 2009-08-12 Akim Demaille <demaille@gostai.com>
992
993 build: fix paths.
994 When using $(top_builddir) inconsistently, Make (including GNU
995 Make) is sometimes confused. As a result it may want to build
996 lib/libbison.la and $(top_builddir)/lib/libbison.la (the same
997 file, different names) concurrently, which, amusingly enough,
998 might end with:
999
1000 ranlib lib/libbison.a
1001 ranlib lib/libbison.a
1002 make[2]: *** [lib/libbison.a] Segmentation fault
1003
1004 on OS X.
1005
1006 * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not
1007 needed.
1008
1009 2009-08-12 Akim Demaille <demaille@gostai.com>
1010
1011 distcheck: fix.
1012
1013 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
1014
1015 2009-08-10 Joel E. Denny <jdenny@clemson.edu>
1016
1017 * tests/local.mk (TESTSUITE_AT): Add named-refs.at.
1018
1019 2009-08-10 Joel E. Denny <jdenny@clemson.edu>
1020
1021 Miscellaneous code readability improvements.
1022
1023 * src/reader.c (reader): Move %define front-end variable
1024 defaults and checking into...
1025 (prepare_percent_define_front_end_variables): ... this new
1026 function.
1027
1028 * src/scan-gram.l (INITIAL): For consistency with string
1029 literals, don't store open quote on character literal. It's
1030 discarded before returning anyway.
1031 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
1032 Make length test more readable, and make the character stored
1033 for an empty literal more obvious while consistent with the
1034 previous behavior.
1035
1036 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
1037 USER_NUMBER_HAS_STRING_ALIAS throughout.
1038 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
1039 that is repeated in symtab.h. Improve argument names to make it
1040 clear which side of the symbol-string alias pair is which.
1041 (symbol_check_alias_consistency): Improve local variable names
1042 for the same purpose.
1043 * src/symtab.h (struct symbol): Make comments about aliases
1044 clearer.
1045 (symbol_make_alias): Improve comments and argument name.
1046 * src/output.c (token_definitions_output): Update for rename to
1047 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
1048
1049 2009-08-08 Alex Rozenman <rozenman@gmail.com>
1050
1051 Convert "misleading reference" messages to warnings.
1052 * src/scan-code.l: New function 'show_sub_messages', more
1053 factoring.
1054 * tests/named-ref.at: Adjust tests.
1055
1056 2009-08-06 Joel E. Denny <jdenny@clemson.edu>
1057
1058 maint: run "make update-copyright"
1059
1060 2009-08-06 Joel E. Denny <jdenny@clemson.edu>
1061
1062 maint: make update-b4-copyright easier to use
1063 * build-aux/update-b4-copyright: In warnings, report line
1064 numbers rather than character positions.
1065 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
1066 that update-copyright runs it.
1067 * gnulib: Update.
1068
1069 2009-08-05 Joel E. Denny <jdenny@clemson.edu>
1070
1071 maint: clean up update-b4-copyright code
1072 * build-aux/update-b4-copyright: Do not accept 2-digit
1073 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
1074 Don't accept a `[' in a b4_copyright argument.
1075 Format code more consistently.
1076 Don't assume b4*copyright never occurs.
1077
1078 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
1079
1080 maint: automate b4_copyright updates.
1081 * Makefile.am (update-b4-copyright): New target rule.
1082 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
1083 * build-aux/update-b4-copyright: New.
1084 * data/yacc.c: Remove stray characters around b4_copyright
1085 invocations.
1086
1087 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
1088
1089 maint: automate annual package-wide copyright-year update.
1090 * .x-update-copyright: New.
1091 * Makefile.am (EXTRA_DIST): Remove maint.mk.
1092 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
1093 update-copyright. Remove gnumakefile, which is implied by
1094 maintainer-makefile.
1095 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
1096 * gnulib: Update.
1097 * maint.mk: Remove, now copied from gnulib.
1098 * examples/extexi: Add missing "(C)" in copyright statement so
1099 update-copyright can recognize it.
1100 * src/LR0.h: Likewise.
1101 * src/print.h: Likewise.
1102 * src/print_graph.h: Likewise.
1103 * src/gram.c: Add missing comma in copyright statement.
1104 * src/gram.h: Likewise.
1105
1106 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
1107
1108 Fix "make distcheck".
1109 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
1110 of just calc.stamp.
1111
1112 2009-08-01 Joel E. Denny <jdenny@clemson.edu>
1113
1114 Pacify "gcc -Wunused" for the input function from Flex.
1115 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
1116 and later.
1117 * src/scan-code.l: Add "%option noinput", which I cannot find in
1118 the Flex manual, but which Flex has supported since at least as
1119 far back as 2.5.4. However, if any of our developers still use
1120 Flex 2.5.4, they'll need to stop configuring with
1121 --enable-gcc-warnings because "%option noinput" didn't work
1122 correctly until Flex 2.5.6.
1123 * src/scan-gram.l: Likewise.
1124 * src/scan-skel.l: Likewise.
1125
1126 2009-07-31 Alex Rozenman <rozenman@gmail.com>
1127
1128 Fix --enable-gcc-warnings problems.
1129 * src/reader.c: Adjust variable names.
1130 * src/scan-code.l: Fix prototypes and adjust names.
1131 * src/named-ref.c: Remove redundant "if".
1132
1133 2009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1134
1135 Fix a --enable-gcc-warnings problem.
1136 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
1137 variable.
1138
1139 2009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1140
1141 Warn about character literals not of length one.
1142 * NEWS (2.5): Document.
1143 * src/scan-gram.l (INITIAL): Remove comment that we don't check
1144 the length.
1145 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
1146 * tests/input.at (Bad character literals): New test group.
1147
1148 2009-07-24 Alex Rozenman <rozenman@gmail.com>
1149
1150 Fix some memory leaks.
1151 * src/named-ref.c: Add a pointer check (named_ref_free).
1152 * src/scan-code.l: New function (variant_table_free). Called in
1153 code_scanner_free.
1154 * src/symlist.c: Call to named_ref_free (symbol_list_free).
1155
1156 2009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1157
1158 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
1159
1160 2009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
1161
1162 Some M4 cleanup in the testsuite.
1163 Suggested by Eric Blake at
1164 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
1165 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
1166 complicate the code by distinguishing between a missing value
1167 and an empty string value for an optional argument. This fix is
1168 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
1169 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
1170 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
1171 arguments are not needed because of the following changes.
1172 Fix stale comments.
1173 Bison developers should use GNU M4 and should not use
1174 POSIXLY_CORRECT when building the test suite, so do not
1175 complicate the code by avoiding $10 and above.
1176 Do not quote an empty string value for an optional argument, and
1177 do not distinguish between a missing value and an empty string
1178 value.
1179
1180 2009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1181
1182 Revert unnecessary column realignment in --help output.
1183 Reported by Akim Demaille at
1184 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
1185 * src/getargs.c (usage): Here.
1186
1187 2009-07-04 Alex Rozenman <rozenman@gmail.com>
1188
1189 Alphabetical order in src/local.mk.
1190 * src/local.mk: Adjust.
1191
1192 2009-07-04 Alex Rozenman <rozenman@gmail.com>
1193
1194 Style changes and factoring.
1195 * src/named-ref.h: Add comments.
1196 * src/parse-gram.y: Readability and style changes.
1197 * src/reader.c: Factoring: assign_named_ref function.
1198 * src/scan-code.l: Factoring and style changes. Rename
1199 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
1200 Use "unsigned" type for variant index. Improve readablity.
1201 * src/scan-gram.l: Change error messages and add comments.
1202 * src/symlist.h: symbol_list_null: New function decl.
1203 * src/symlist.c: symbol_list_null: Implement here.
1204 * tests/named-refs.at: Adjust for new error messages.
1205
1206 2009-06-29 Eric Blake <ebb9@byu.net>
1207
1208 scan-code: avoid compiler warnings
1209 * src/scan-code.l (parse_named_ref): Use correct specifiers.
1210
1211 2009-06-29 Akim Demaille <demaille@gostai.com>
1212
1213 build: avoid concurrent extraction of calc++.
1214 * examples/calc++/Makefile.am (calc.stamp): New.
1215 Depend on it to create the sources of calc++ so that concurrent
1216 builds don't launch several "extexi" in parallel.
1217 Not only this is inefficient, this also builds incorrect sources
1218 with several extractions mixed together.
1219
1220 2009-06-29 Akim Demaille <demaille@gostai.com>
1221
1222 parse.error: fix.
1223 * data/bison.m4: Move code related to specific variables after the
1224 definition of the variable-maintaining macros so that we don't
1225 "invoke" b4_percent_define_check_values before it is defined.
1226
1227 2009-06-29 Akim Demaille <demaille@gostai.com>
1228
1229 variables: parse.error
1230
1231 Implement, document, and test the replacement of %error-verbose
1232 by %define parse.error "verbose".
1233 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
1234 values of the parse.error variable.
1235 Make "simple" its default value.
1236 Check the valid values.
1237 * src/parse-gram.y: Use %define parse.error.
1238 (PERCENT_ERROR_VERBOSE): New token.
1239 Support it.
1240 * src/scan-gram.l: Support %error-verbose.
1241
1242 * doc/bison.texinfo (Decl Summary): Replace the documentation of
1243 %define error-verbose by that of %define parse.error.
1244 * NEWS: Document it.
1245
1246 * tests/actions.at, tests/calc.at: Use parse.error instead of
1247 %error-verbose.
1248
1249 2009-06-27 Alex Rozenman <rozenman@gmail.com>
1250
1251 Implement support for named symbol references.
1252 * src/parse-gram.y: Add new syntax (named_ref.opt).
1253 * src/reader.c: Store named refs in symbol lists.
1254 * src/reader.h: New argument for symbol_append and
1255 action_append functions.
1256 * src/scan-code.h: Add new field (named_ref) into
1257 code_props data structure. Keeps named ref of midrule
1258 actions.
1259 * src/scan-code.l: Support for named refs in semantic
1260 action code. New function 'parse_named_ref'.
1261 * src/scan-gram.l: Support bracketed id.
1262 * src/symlist.c: Store named refs in symbol lists.
1263 * src/symlist.h: New field in symbol list: named_ref.
1264 * src/named-ref.h: New file, a struct for named_ref.
1265 * src/named-ref.cp: New file, named_ref_new function.
1266 * src/local.mk: Add two new files.
1267 * tests/testsuite.at: Include new test group:
1268 * tests/named-refs.at: this new file.
1269
1270 2009-06-25 Akim Demaille <demaille@gostai.com>
1271
1272 hash: check insertion for memory exhaustion.
1273 * src/uniqstr.c (uniqstr_new): New.
1274
1275 2009-06-24 Akim Demaille <demaille@gostai.com>
1276
1277 variables: rename namespace as api.namespace.
1278 Discussed in
1279 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
1280
1281 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1282 New.
1283 (b4_percent_define_use): New.
1284 Use it where applicable.
1285 * data/c++.m4: Replace uses of the variable "namespace" by
1286 "api.namespace".
1287 Default the latter to the former.
1288 * doc/bison.texinfo (Decl Summary): Document "namespace" as
1289 obsolete.
1290 Document api.namespace.
1291 Use @samp to document %define uses, keep @code for identifiers.
1292 * NEWS: Likewise.
1293 * tests/c++.at, tests/input.at: Test api.namespace instead of
1294 namespace. (The tests passed with namespace.)
1295
1296 2009-06-11 Akim Demaille <demaille@gostai.com>
1297
1298 style changes.
1299 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
1300 * src/print-xml.c: Style changes.
1301 * tests/conflicts.at: Comment changes.
1302
1303 2009-06-11 Akim Demaille <demaille@gostai.com>
1304
1305 xml: beware of user strings used to give a %prec to rules.
1306 * tests/conflicts.at (%prec with user strings): New.
1307 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
1308 XML output.
1309
1310 2009-06-11 Akim Demaille <demaille@gostai.com>
1311
1312 hash: check insertion for memory exhaustion.
1313 * src/muscle-tab.c (muscle_insert, muscle_grow)
1314 * src/state.c (state_hash_insert): Check the return value of
1315 hash_insert.
1316
1317 2009-06-11 Akim Demaille <demaille@gostai.com>
1318
1319 tests: honor TESTSUITEFLAGS in every check target.
1320 * tests/local.mk (RUN_TESTSUITE): New.
1321 (check-local, installcheck-local, maintainer-check-g++)
1322 (maintainer-check-posix, maintainer-check-valgrind): Use it.
1323
1324 2009-06-10 Akim Demaille <demaille@gostai.com>
1325
1326 deterministic test suite.
1327 Some consistency checks on symbols are performed after all the
1328 symbols were read, by an iteration over the symbol table. This
1329 traversal is nondeterministic, which can be a problem for test
1330 cases.
1331 Avoid this.
1332 Addresses another form of nondeterminism reported by Joel E. Denny.
1333 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1334
1335 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
1336 test in two.
1337 Use different file names for the three tests to make the
1338 maintenance easier.
1339
1340 2009-06-10 Akim Demaille <demaille@gostai.com>
1341
1342 gnulib: update.
1343 * gnulib: Update to latest.
1344 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
1345 * m4/.gitignore: Regen.
1346 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
1347 Call xalloc_die on hash_insert failures.
1348 Requested by the new __warn_unused_result__ attribute of
1349 hash_insert.
1350
1351 2009-06-10 Akim Demaille <demaille@gostai.com>
1352
1353 deterministic user-token-number redeclaration errors.
1354 Address nondeterminism reported by Joel E. Denny.
1355 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1356
1357 * src/uniqstr.h: Comment changes.
1358 * src/location.h (boundary_cmp, location_cmp): New.
1359 * src/symtab.c (user_token_number_redeclaration): New.
1360 (symbol_translation): Use it.
1361 * tests/input.at (Numbered tokens): Adjust the expected output.
1362
1363 2009-05-25 Akim Demaille <demaille@gostai.com>
1364
1365 build: avoid ignored errors.
1366 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
1367 errors, they pollute the output.
1368
1369 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1370
1371 Convert multiple variable definition warnings to complaints.
1372 * NEWS (2.5): Add a new entry for that change.
1373 * doc/bison.texinfo (Decl Summary): Update %define entry.
1374 (Bison Options): Update -D/--define/-F/--force-define entry.
1375 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
1376 * src/muscle-tab.h (muscle_percent_define_insert): Update
1377 comments.
1378 * tests/input.at (`%define errors'): Update.
1379 (`%define, --define, --force-define'): Update.
1380
1381 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1382
1383 -F/--force-define and relative %define/-D/--define priorities.
1384 * NEWS (2.5): Add documentation to -D/--define entry.
1385 * build-aux/cross-options.pl: Hard-code association of
1386 --force-define with %define.
1387 * doc/bison.texinfo (Decl Summary): In %define entry,
1388 cross-reference command-line options.
1389 (Bison Options): Add documentation to -D/--define entry.
1390 (Option Cross Key): Widen column for --force-define row.
1391 * src/getargs.c (usage): Document -F/--force-define. Realign
1392 options in output.
1393 (short_options, long_options, getargs): Parse -F/--force-define,
1394 and update muscle_percent_define_insert invocations.
1395 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
1396 (muscle_percent_define_insert): Add argument with that type.
1397 * src/muscle-tab.c (muscle_percent_define_insert): Implement
1398 -F/--force-define behavior and priorities.
1399 (muscle_percent_define_ensure): Update
1400 muscle_percent_define_insert invocation.
1401 * src/parse-gram.y (prologue_declaration): Update
1402 muscle_percent_define_insert invocations.
1403 * tests/input.at (`%define, --define'): Rename to...
1404 (`%define, --define, --force-define'): ... this and extend.
1405
1406 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1407
1408 Update some comments to make sense for -D.
1409 * data/bison.m4 (b4_check_user_names): In header comments, say
1410 "user occurrence" instead of "grammar occurrence".
1411 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
1412 (muscle_percent_code_grow): Likewise just for consistency.
1413
1414 2009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1415
1416 * data/c++.m4 (b4_namespace_close): Simplify slightly.
1417
1418 2009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
1419
1420 Handle a trailing `:' in a user-supplied C++ namespace better.
1421 * data/c++.m4 (b4_namespace_close): Don't let it be printed
1422 among the closing braces here. This fix might make the
1423 generated code easier to debug, but otherwise it should be
1424 insignificant because a trailing `:' is a C++ error already.
1425
1426 2009-05-19 Akim Demaille <demaille@gostai.com>
1427
1428 remove useless variable.
1429 * src/getargs.c (skeleton_arg): Remove now useless variable.
1430 Should help the compiler see that this printf-like call is sane.
1431
1432 2009-05-15 Akim Demaille <demaille@gostai.com>
1433
1434 Rename token.prefix as api.tokens.prefix.
1435 Discussed here.
1436 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
1437
1438 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
1439 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
1440 (token.prefix): Rename as...
1441 (api.tokens.prefix): this.
1442
1443 2009-05-11 Akim Demaille <demaille@gostai.com>
1444
1445 doc: use C++ headers.
1446 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
1447 headers.
1448
1449 2009-05-11 Akim Demaille <demaille@gostai.com>
1450
1451 doc: token.prefix
1452 * doc/bison.simple (Decl Summary): Document token.prefix.
1453 (Calc++ Parser): Various fixes.
1454 Formatting changes.
1455 Use token.prefix.
1456 Introduce a macro TOKEN to shorten the code and make it more
1457 readable.
1458 (Calc++ Scanner): Adjust.
1459 * NEWS (Variable token.prefix): New.
1460
1461 2009-05-04 Akim Demaille <demaille@gostai.com>
1462
1463 bison: catch bad symbol names.
1464 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
1465 * tests/input.at: Adjust.
1466
1467 2009-05-04 Akim Demaille <demaille@gostai.com>
1468
1469 identifiers: dashes are letters.
1470 Dashes can now start identifiers (symbols and directives).
1471
1472 * src/scan-gram.l ({letter}): Add dash.
1473 ({id}): Remove it.
1474 * tests/input.at (Symbols): Adjust.
1475 Remove stray comment.
1476 * tests/regression.at (Invalid inputs): Adjust error message.
1477 * doc/bison.texinfo (Symbols): Update.
1478
1479 2009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
1480
1481 Declare %code to be a permanent feature.
1482 * NEWS (2.4.2): Here.
1483 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
1484 experimental.
1485 (Decl Summary): Likewise.
1486
1487 2009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1488
1489 Convert underscores to dashes in some %define variable names.
1490 For now, just api.push-pull and lr.keep-unreachable-states.
1491 Maintain old names for backward compatibility.
1492 * NEWS (2.5): Document.
1493 * data/c.m4 (b4_identification): Update comment.
1494 * data/yacc.c: Update access.
1495 * doc/bison.texinfo: Update.
1496 * etc/bench.pl.in (bench_push_parser): Update use.
1497 * src/files.c (tr): Move to...
1498 * src/getargs.c, src/getargs.h (tr): ... here because I can't
1499 think of a better place to expose it. My logic is that, for all
1500 uses of tr so far, command-line arguments can be involved, and
1501 getargs.h is already included.
1502 * src/main.c (main): Update access.
1503 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
1504 variable names to new variable names before assigning value.
1505 * src/reader.c (reader): Update setting default.
1506 * tests/calc.at: Update uses.
1507 * tests/conflicts.at (Unreachable States After Conflict
1508 Resolution): Update use.
1509 * tests/input.at (%define enum variables): Update use.
1510 (%define backward compatibility): New test group.
1511 * tests/push.at: Update uses.
1512 * tests/reduce.at: Update uses.
1513 * tests/torture.at: Update uses.
1514
1515 2009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1516
1517 Set all front-end %define defaults in one place.
1518 * src/main.c (main): Move lr.keep_unreachable_states default...
1519 * src/reader.c (reader): ... to here.
1520
1521 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1522
1523 Rename lr.default_reductions to lr.default-reductions.
1524 * NEWS (2.5): Here.
1525 * doc/bison.texinfo: Here.
1526 * src/lalr.c (initialize_LA): Here.
1527 * src/print.c (print_reductions): Here.
1528 * src/reader.c (reader): Here.
1529 * src/tables.c (action_row): Here.
1530 * tests/input.at (%define enum variables): Here.
1531 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
1532
1533 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1534
1535 Pacify ./configure --enable-gcc-warnings.
1536 * tests/input.at (Symbols): Prototype yyerror and yylex.
1537
1538 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1539
1540 Document how `%define "var" "value"' is not M4-friendly.
1541 * src/parse-gram.y (variable): In comments here.
1542
1543 2009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1544
1545 Clean up recent patches a little.
1546 Reported by Akim Demaille.
1547 * doc/bison.texinfo (Understanding): Fix typos.
1548 * src/print.c (print_reductions): Don't use negated variable.
1549
1550 2009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1551
1552 List accepted values for a %define enum variable with an invalid value.
1553 Suggested by Akim Demaille at
1554 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
1555 * data/bison.m4 (_b4_percent_define_check_values): Implement.
1556 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
1557 * tests/input.at (%define lr.default_reductions invalid values): Merge
1558 into...
1559 (%define enum variables): ... here, and update output.
1560
1561 2009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
1562
1563 Rename "default rule" to "default reduction".
1564 This includes changing variable names in code, changing
1565 comments, and renaming %define lr.default_rules to %define
1566 lr.default_reductions.
1567 * NEWS (2.5): Update IELR documentation.
1568 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
1569 documentation.
1570 * data/glr.c, data/lalr1.java: Sync copyright dates.
1571 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
1572 and lr.type documentation. Make some other wording
1573 improvements.
1574 (Glossary): Adjust cross-references and Default Reduction
1575 definition.
1576 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
1577 Remove a confusing comment pointed out by Akim Demaille.
1578 (initialize_LA): Adjust code.
1579 * src/print-xml.c (print_reductions): Adjust code.
1580 * src/print.c (print_reductions): Adjust code.
1581 * src/reader.c (reader): Adjust code.
1582 * src/tables.c (action_row): Adjust code.
1583 (token_actions): Adjust code.
1584 * src/tables.h: Adjust YYDEFACT documentation.
1585 * tests/input.at (%define lr.default_rules invalid values):
1586 Rename test group to...
1587 (%define lr.default_reductions invalid values): ... this, and
1588 update grammar file and expected output.
1589 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
1590 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
1591
1592 2009-04-21 Akim Demaille <demaille@gostai.com>
1593
1594 tests: check the use of dashes and periods in symbols.
1595 * tests/input.at (Symbol): New test group.
1596
1597 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1598
1599 Document %define lr.type and lr.default_rules.
1600 * NEWS (2.5): Add an entry.
1601 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
1602 besides just LALR(1) and GLR(1).
1603 * doc/bison.texinfo (Introduction): Likewise.
1604 (Language and Grammar): Bison is no longer limited to LALR(1)
1605 restrictions.
1606 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
1607 when trying to distinguish from GLR. Talk about LR(1) grammars
1608 rather than LALR(1) grammars.
1609 (Decl Summary): In %define api.push_pull entry, say it applies
1610 to deterministic parsers in C rather than LALR(1) parsers in C.
1611 Add lr.default_rules entry.
1612 Add lr.type entry.
1613 (Mystery Conflicts): Bison is no longer limited to LALR(1)
1614 restrictions.
1615 (Generalized LR Parsing): Same changes as for the previous GLR
1616 section.
1617 (Memory Management): Say deterministic rather than LALR(1).
1618 (Understanding): Correct some bison output.
1619 Index discussion of "accepting state".
1620 Say deterministic rather than LALR(1).
1621 (Bison Options): In --yacc entry, say deterministic rather than
1622 LALR(1).
1623 In --report, --graph, and --xml entries, just don't mention
1624 LALR(1).
1625 (C++ Parsers): Say deterministic rather than LALR(1).
1626 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
1627 (Glossary): Add Accepting State, Consistent State, Default Rule,
1628 and IELR(1) definitions.
1629 In Generalized LR (GLR) definition, make same changes as in
1630 previous GLR sections.
1631 In LALR(1) definition, say Bison uses LALR(1) by default rather
1632 than implying Bison is limited to LALR(1).
1633 (LocalWords): Add IELR.
1634
1635 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1636
1637 Finish implementing %define lr.type.
1638 Its value can be "LALR", "IELR", or "canonical LR".
1639 * lib/timevar.def (TV_IELR_PHASE1): New var.
1640 (TV_IELR_PHASE2): New var.
1641 (TV_IELR_PHASE3): New var.
1642 (TV_IELR_PHASE4): New var.
1643 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
1644 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
1645 Sbitset.h, ielr.h, and ielr.c.
1646 * src/getargs.h, src/getargs.c (enum trace, trace_args,
1647 trace_types): Add trace_ielr.
1648 * src/lalr.h, src/lalr.c (ngotos): Export it.
1649 (F): Rename to...
1650 (goto_follows): ... this, update all uses, and export it.
1651 (set_goto_map): Export it.
1652 (map_goto): Export it.
1653 (compute_lookahead_tokens): Don't free goto_follows yet. Now
1654 handled in ielr.
1655 (initialize_LA): Export it. Move lookback allocation to...
1656 (lalr): ... here because, for canonical LR, initialize_LA must
1657 be invoked but lookback and much of the rest of LALR isn't
1658 needed.
1659 * main.c (main): Instead of lalr, invoke ielr, which invokes
1660 lalr.
1661 * src/reader.c (reader): Default lr.type to "LALR".
1662 Default lr.default_rules to "accepting" if lr.type is "canonical
1663 LR". Leave the default as "all" otherwise.
1664 Check for a valid lr.type value.
1665 * src/state.h, src/state.c (struct state_list): Add state_list
1666 member.
1667 (state_new): Initialize state_list member to NULL.
1668 (state_new_isocore): New function, exported.
1669 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
1670 exercises all values of lr.type.
1671 (GNU AWK Grammar): Rename test group to...
1672 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
1673 AT_TEST_EXISTING_GRAMMAR.
1674 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
1675 (GNU pic Grammar): Rename test group to...
1676 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
1677 AT_TEST_EXISTING_GRAMMAR.
1678 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
1679 all values of lr.type.
1680 (Single State Split): New test groups using AT_TEST_LR_TYPE.
1681 (Lane Split): Likewise.
1682 (Complex Lane Split): Likewise.
1683 (Split During Added Lookahead Propagation): Likewise.
1684
1685 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1686
1687 Add new files for IELR and canonical LR implementation.
1688 * src/AnnotationList.c: New.
1689 * src/AnnotationList.h: New.
1690 * src/InadequacyList.c: New.
1691 * src/InadequacyList.h: New.
1692 * src/Sbitset.c: New.
1693 * src/Sbitset.h: New.
1694 * src/ielr.c: New.
1695 * src/ielr.h: New.
1696
1697 2009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1698
1699 Implement %define lr.default_rules.
1700 Its value describes the states that are permitted to contain
1701 default rules: "all", "consistent", or "accepting".
1702 * src/reader.c (reader): Default lr.default_rules to "all".
1703 Check for a valid lr.default_rules value.
1704 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
1705 is "accepting", then only mark the accepting state as
1706 consistent.
1707 (initialize_LA): Tell state_lookahead_tokens_count whether
1708 lr.default_rules is "accepting".
1709 * src/tables.c (action_row): If lr.default_rules is not "all",
1710 then disable default rules in inconsistent states.
1711 * src/print.c (print_reductions): Use this opportunity to
1712 perform some assertions about whether lr.default_rules was
1713 obeyed correctly.
1714 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
1715 helps with checking the parser tables for a grammar.
1716 * tests/input.at (%define lr.default_rules invalid values): New
1717 test group.
1718 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
1719 AT_TEST_TABLES_AND_PARSE.
1720 (`no %define lr.default_rules'): New test group generated by
1721 AT_TEST_LR_DEFAULT_RULES.
1722 (`%define lr.default_rules "all"'): Likewise.
1723 (`%define lr.default_rules "consistent"'): Likewise.
1724 (`%define lr.default_rules "accepting"'): Likewise.
1725
1726 2009-04-20 Akim Demaille <demaille@gostai.com>
1727
1728 Formatting change.
1729
1730 2009-04-20 Akim Demaille <demaille@gostai.com>
1731
1732 bison: factoring.
1733 * src/output.c (token_definitions_output): Use symbol_id_get
1734 instead of duplicating its logic.
1735 * TODO (YYERRCODE): Extend.
1736
1737 2009-04-20 Akim Demaille <demaille@gostai.com>
1738
1739 variables: prefer error-verbose to error_verbose.
1740 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
1741 instead of error_verbose.
1742 * src/scan-gram.l (%error-verbose): Map to the error-verbose
1743 variable.
1744 * doc/bison.texinfo: Promote %define error-verbose instead of
1745 %error-verbose.
1746 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
1747
1748 2009-04-15 Akim Demaille <demaille@gostai.com>
1749
1750 variables: accept dashes.
1751 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
1752 underscores.
1753 * src/scan-gram.l ({id}): Also accept dashes after the initial
1754 letter.
1755 ({directive}): Use {id}.
1756 * src/parse-gram.y: Comment and formatting changes.
1757 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
1758 symbols.
1759 * src/complain.h, src/complain.c (yacc_at): New.
1760 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
1761 symbol names.
1762 * src/output.c (token_definitions_output): Do not #define token
1763 names with dashes.
1764
1765 2009-04-20 Akim Demaille <demaille@gostai.com>
1766
1767 Consistently refer to Yacc, not YACC.
1768 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
1769
1770 2009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
1771
1772 Pacify make maintainer-check-posix.
1773 * tests/input.at (%define, --define): Move bison command-line
1774 options before grammar file name.
1775
1776 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1777
1778 Document semicolon warnings.
1779 * NEWS (2.5): Here.
1780
1781 2009-04-14 Akim Demaille <demaille@gostai.com>
1782
1783 variables: use `parse.assert' instead of `assert'.
1784 * TODO (assert): Remove.
1785 * data/bison.m4 (b4_assert_if): Replace with...
1786 (b4_parse_assert_if): this.
1787 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
1788 * doc/bison.texinfo (Decl Summary): Document parse.assert.
1789
1790 2009-04-14 Akim Demaille <demaille@gostai.com>
1791
1792 variables: use `parse.trace' instead of `debug'.
1793 * src/getargs.c (getargs): Map -t to %define trace.parse.
1794 * src/scan-gram.l (%debug): Map to %define trace.parse.
1795 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
1796 names to `_' in macro names.
1797 (b4_debug_if): Replace with...
1798 (b4_parse_trace_if): this.
1799 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1800 * data/yacc.c: Adjust.
1801 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
1802 Use @code to label the variable list.
1803 Document the variable parse.trace.
1804 (Tracing): Promote the parse.trace variable.
1805 * TODO: %printer is not documented.
1806
1807 2009-04-14 Akim Demaille <demaille@gostai.com>
1808
1809 doc: minor fixes.
1810 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
1811 (Table of Symbols): Remove duplicate entry for %debug.
1812
1813 2009-04-10 Eric Blake <ebb9@byu.net>
1814
1815 submodules: update to latest
1816 * submodules/autoconf: Use latest upstream Autoconf.
1817
1818 2009-04-06 Eric Blake <ebb9@byu.net>
1819
1820 Work around autoconf 2.63b bug in testsuite.
1821 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
1822 autoconf bug related to # in test.
1823
1824 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1825
1826 * NEWS (2.5): New section. Describe new -D/--define feature.
1827
1828 2009-04-06 Akim Demaille <demaille@gostai.com>
1829
1830 Regen.
1831 * src/parse-gram.h, src/parse-gram.c: Regen.
1832
1833 2009-04-06 Akim Demaille <demaille@gostai.com>
1834
1835 rename muscle_tab.* as muscle-tab.* for consistency.
1836 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
1837 * src/muscle-tab.h, src/muscle-tab.c: these.
1838 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
1839 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
1840
1841 2009-04-06 Akim Demaille <demaille@gostai.com>
1842
1843 Makefile: introduce $(BISON).
1844 * src/local.mk (BISON): New.
1845 (YACC): Use it.
1846
1847 2009-04-06 Akim Demaille <demaille@gostai.com>
1848
1849 parser: handle %locations as %define locations.
1850 * src/getargs.h, src/getargs.c (locations_flag): Remove.
1851 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
1852 to set "locations" to true.
1853 * src/output.c (prepare): Don't output "locations".
1854 * src/scan-gram.l (%locations): Handle it as a %<flag>.
1855 * src/parse-gram.y: It's no longer a token.
1856 Don't handle it.
1857 * data/bison.m4 (b4_locations_if): Define it with
1858 b4_percent_define_if_define.
1859 * data/c.m4, data/glr.cc: Adjust.
1860
1861 2009-04-06 Akim Demaille <demaille@gostai.com>
1862
1863 Regen.
1864 * src/parse-gram.c: Regen.
1865
1866 2009-04-06 Akim Demaille <demaille@gostai.com>
1867
1868 muscle: factor the handling of obsolete of obsolete directives.
1869 Suggested by Joel E. Denny.
1870
1871 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
1872 New, extracted from...
1873 * src/parse-gram.y (prologue_declaration: pure-parser): here.
1874 Remove it.
1875 (prologue_declaration: "%<flag>"): Use
1876 muscle_percent_define_ensure.
1877 (%error-verbose, %pure-parser): No longer tokens.
1878 * src/scan-gram.l (pure-parser): Return as a %<flag>.
1879
1880 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1881
1882 Fix options documentation.
1883 * build-aux/cross-options.pl: As in --help output, write optional
1884 arguments as [=ARG] not =[ARG].
1885 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
1886
1887 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1888
1889 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
1890 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
1891 requirements for a correct m4 are stricter.
1892 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
1893 * configure.ac: Update to use AC_PROG_GNU_M4.
1894 Reported by Eric Blake.
1895
1896 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1897
1898 Help with updating web manual.
1899 * HACKING: Incorporate instructions from gnulib/doc/README.
1900 * bootstrap.conf (gnulib_modules): Add gendocs.
1901
1902 2009-04-03 Akim Demaille <demaille@gostai.com>
1903
1904 Regen.
1905 * src/parse-gram.h, src/parse-gram.c: Regen.
1906
1907 2009-04-03 Akim Demaille <demaille@gostai.com>
1908
1909 Factor %FLAG at scan level.
1910 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
1911 definitions and associated rules, replaced by....
1912 (PERCENT_FLAG): this new token type, and rule.
1913 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
1914 Use it for %debug and %error-verbose.
1915
1916 2009-04-03 Akim Demaille <demaille@gostai.com>
1917
1918 Regen.
1919 * src/parse-gram.h, src/parse-gram.c: Regen.
1920
1921 2009-04-03 Akim Demaille <demaille@gostai.com>
1922
1923 Treat %debug as %define debug.
1924 * data/bison.m4 (b4_debug_if): New.
1925 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
1926 * data/lalr1.java: Use it instead of b4_debug_flag.
1927 * src/getargs.h, src/getargs.c (debug_flag): Remove.
1928 * src/output.c (prepare): Don't output it.
1929 * src/parse-gram.y: Treat %debug as %define debug.
1930
1931 2009-04-03 Akim Demaille <demaille@gostai.com>
1932
1933 Treat %error-verbose as %define error_verbose.
1934 This allows to pass -Derror_verbose on the command line. Better
1935 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
1936 ERROR_VERBOSE being defined as false or true.
1937 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
1938 on b4_percent_define_ifdef, for does not check the defined value,
1939 but only whether the symbol is defined, rely on
1940 b4_percent_define_flag_if, so that a value of "false" is processed
1941 as a false.
1942 If not defined, define the flag to "false".
1943 (b4_error_verbose_if): New.
1944 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
1945 b4_error_verbose_flag.
1946 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
1947 * src/output.c (prepare): Don't output it.
1948 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
1949
1950 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1951
1952 Fix strange %define locations for default values.
1953 Reported by Akim Demaille at
1954 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
1955 and discussed again starting at
1956 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
1957 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
1958 because location information is bogus.
1959 Use angle brackets to delimit fake file name because square brackets
1960 look like underexpanded m4. Choose a better fake file name.
1961 Use negative line numbers.
1962 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
1963 * src/location.c (location_print): If line for a boundary is negative,
1964 only print that boundary's file name.
1965 * src/location.h: Document that.
1966 * tests/skeletons.at (%define Boolean variables: invalid skeleton
1967 defaults): Update output.
1968
1969 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1970
1971 Pacify ./configure --enable-gcc-warnings.
1972 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
1973 in lib won't compile with it.
1974 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
1975
1976 2009-03-31 Akim Demaille <demaille@gostai.com>
1977
1978 bootstrap: --help to stdout.
1979 * bootstrap (usage): Don't send --help to stderr.
1980 Use a here doc instead of a long string.
1981
1982 2009-03-31 Akim Demaille <demaille@gostai.com>
1983
1984 bootstrap: README-hacking no longer exists
1985 * bootstrap (checkout_only_file): Set to HACKING.
1986
1987 2009-03-26 Akim Demaille <demaille@gostai.com>
1988
1989 doc: merge HACKING and README-hacking.
1990 Two files is confusing.
1991 Reported by Alexandre Duret-Lutz.
1992
1993 * README-hacking: Merge into...
1994 * HACKING (Working from the repository): here.
1995
1996 2009-03-26 Akim Demaille <demaille@gostai.com>
1997
1998 doc: update README-hacking.
1999 * README-hacking: We now use git and git submodules.
2000 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
2001
2002 2009-03-26 Akim Demaille <demaille@gostai.com>
2003
2004 lalr1.cc: avoid GCC 4.3 warnings.
2005 GCC 4.3 now warns about "a || b && c" and asks for explicit
2006 parentheses.
2007 Reported by Alexandre Duret-Lutz.
2008 * data/location.cc: Update copyright years.
2009 (Position::operator==): Use parens to make precedence explicit.
2010 Compare lines and columns first, as they are more likely to be
2011 different, and they are faster to compare.
2012
2013 2009-03-26 Akim Demaille <demaille@gostai.com>
2014
2015 gnulib: update.
2016 * gnulib: Update to latest.
2017 * src/local.mk (AM_CFLAGS): Move to...
2018 * Makefile.am: here.
2019 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
2020 AM_CFLAGS.
2021
2022 2009-03-02 Akim Demaille <demaille@gostai.com>
2023
2024 Comment changes.
2025
2026 2009-03-02 Akim Demaille <demaille@gostai.com>
2027
2028 Share b4_yytranslate_define.
2029 * data/lalr1.cc (b4_yytranslate_define): Move to...
2030 * data/c++.m4: here.
2031
2032 2009-03-02 Akim Demaille <demaille@gostai.com>
2033
2034 Use locations in the variant example.
2035 Yes, this obfuscates the point of this example, variants only.
2036 But glr.cc cannot work (yet?) without locations. This change
2037 makes it easier to use this example with glr.cc.
2038
2039 * examples/variant.yy (assert): %define it.
2040 (locations): Request them.
2041 (yylex): Bind the location to the stage.
2042
2043 2009-03-02 Akim Demaille <demaille@gostai.com>
2044
2045 Dub make_TOKEN as a public type interface.
2046 * data/c++.m4 (b4_symbol_constructor_declare)
2047 (b4_symbol_constructor_define): New empty stubs.
2048 (b4_public_types_declare, b4_public_types_define): Use them.
2049 * data/lalr1.cc (b4_symbol_constructor_declare)
2050 (b4_symbol_constructor_declare_)
2051 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
2052 Move to...
2053 * data/variant.hh: here.
2054 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
2055 needed.
2056 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
2057 b4_symbol_constructor_declare, as it is now done by
2058 b4_public_types_define and b4_public_types_declare.
2059
2060 2009-03-02 Akim Demaille <demaille@gostai.com>
2061
2062 Coding style changes.
2063 * data/lalr1.cc (b4_symbol_constructor_declaration_)
2064 (b4_symbol_constructor_declarations)
2065 (b4_symbol_constructor_definition_)
2066 (b4_symbol_constructor_definitions)
2067 (b4_yytranslate_definition): Rename as...
2068 (b4_symbol_constructor_declare_)
2069 (b4_symbol_constructor_declare)
2070 (b4_symbol_constructor_define_)
2071 (b4_symbol_constructor_define)
2072 (b4_yytranslate_define): these.
2073 * data/variant.hh (b4_variant_definition): Rename as...
2074 (b4_variant_define): this.
2075
2076 2009-03-02 Akim Demaille <demaille@gostai.com>
2077
2078 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
2079 * data/bison.m4 (b4_percent_define_if_define): New.
2080 * data/c++.m4 (b4_variant_if): Move to...
2081 * data/bison.m4: Here, using b4_percent_define_if_define.
2082 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
2083 * data/bison.m4: Here, using b4_percent_define_if_define.
2084
2085 2009-03-02 Akim Demaille <demaille@gostai.com>
2086
2087 Dub symbol_type_base as a public type.
2088 * data/c++.m4 (b4_public_types_declare): Now define
2089 symbol_type_base and symbol_type.
2090 (b4_public_types_define): New.
2091 In both cases, the definitions are taken verbatim from lalr1.cc.
2092 * data/lalr1.cc: Adjust.
2093
2094 2009-03-02 Akim Demaille <demaille@gostai.com>
2095
2096 b4_public_types_declare.
2097 * data/c++.m4 (b4_public_types_declare): New.
2098 * data/glr.cc, data/lalr1.cc: Use it.
2099
2100 2009-03-02 Akim Demaille <demaille@gostai.com>
2101
2102 b4_semantic_type_declare.
2103 * data/c++.m4 (b4_semantic_type_declare): New.
2104 Factors and generalizes what was in glr.cc and lalr1.cc.
2105 * data/variant.hh (b4_semantic_type_declare): Redefine it for
2106 variants.
2107 * data/lalr1.cc, data/glr.cc: Use it.
2108
2109 2009-02-26 Akim Demaille <demaille@gostai.com>
2110
2111 Upgrade gnulib.
2112 * gnulib: Upgrade from master.
2113 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
2114 Regen.
2115
2116 2009-02-25 Akim Demaille <demaille@gostai.com>
2117
2118 Remove useless arguments.
2119 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
2120 relevant.
2121
2122 2009-02-25 Akim Demaille <demaille@gostai.com>
2123
2124 Comment changes.
2125 * data/lalr1.cc: here.
2126
2127 2009-02-25 Akim Demaille <demaille@gostai.com>
2128
2129 Fix glr.cc's debug level handling.
2130 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
2131 glr.c which is used.
2132 (debug_level, set_debug_level): Adjust.
2133
2134 2009-02-25 Akim Demaille <demaille@gostai.com>
2135
2136 Copyright years.
2137 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
2138
2139 2009-02-25 Akim Demaille <demaille@gostai.com>
2140
2141 Style changes.
2142 * etc/bench.pl.in (generate_grammar_list): Consitently use
2143 location_type, not yy::location.
2144
2145 2009-02-25 Akim Demaille <demaille@gostai.com>
2146
2147 Comment change.
2148 * data/lalr1.cc: here.
2149
2150 2009-02-19 Akim Demaille <demaille@gostai.com>
2151
2152 Make yyparser::error public.
2153 * data/lalr1.cc: here.
2154 There is no good reason to keep it private (and it is convenient
2155 to use it from the scanner for instance). It is already public in
2156 glr.cc.
2157
2158 2009-02-19 Akim Demaille <demaille@gostai.com>
2159
2160 Comment changes.
2161 * data/glr.cc: here.
2162
2163 2009-02-19 Akim Demaille <demaille@gostai.com>
2164
2165 Remove trailing blanks.
2166 The epilogue has its own ending \n, no need to add another.
2167
2168 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
2169 epilogue.
2170 * data/glr.cc: dnl when extending the epilogue.
2171 Remove stray "private:".
2172
2173 2009-02-19 Akim Demaille <demaille@gostai.com>
2174
2175 Use b4_c_modern.
2176 * data/c.m4 (b4_c_function_decl): Here.
2177
2178 2009-02-19 Akim Demaille <demaille@gostai.com>
2179
2180 Comment changes.
2181 * data/lalr1.cc: here.
2182
2183 2009-02-19 Akim Demaille <demaille@gostai.com>
2184
2185 Extract variant.hh
2186 * data/variant.hh: New, extracted from...
2187 * data/lalr1.cc: here.
2188 Adjust.
2189 * data/local.mk: Adjust.
2190
2191 2009-02-19 Akim Demaille <demaille@gostai.com>
2192
2193 Extract stack.hh from lalr1.cc.
2194 * data/stack.hh: New.
2195 * data/lalr1.cc: Extract from here.
2196 * data/local.mk: Adjust.
2197
2198 2009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
2199
2200 Add reminder about uploading public key to keys.gnupg.net.
2201 * HACKING (Release Procedure): Here.
2202
2203 2009-01-28 Akim Demaille <demaille@gostai.com>
2204
2205 * NEWS: Update information about 2.4.1 and 2.4.2.
2206
2207 2008-11-04 Akim Demaille <demaille@gostai.com>
2208
2209 Reformat NEWS.
2210 * NEWS: Use more outline-mode markup.
2211 Suggested by Jim Meyering.
2212
2213 2009-01-08 Akim Demaille <demaille@gostai.com>
2214
2215 Fix grep portability issues.
2216 Grep on Solaris does not support -q.
2217 Reported by Summum Bonum.
2218
2219 * NEWS: Add a stub for 2.4.2.
2220 * THANKS: Add Summum Bonum.
2221 * tests/atlocal.in (EGREP): New.
2222 (CC, CXX, XSLTPROC): Make it possible to override them via
2223 envvars.
2224 * tests/java.at: Use $EGREP instead of egrep.
2225 Use AT_CHECK's ignore instead of grep's -q.
2226
2227 2008-12-11 Akim Demaille <demaille@gostai.com>
2228
2229 Pass the token type to yysyntax_error.
2230 * data/yacc.c (yysyntax_error): Take the transated token instead
2231 of the raw number.
2232 Adjust callers.
2233 * TODO: Update.
2234
2235 2008-12-11 Akim Demaille <demaille@gostai.com>
2236
2237 Formatting changes.
2238 * data/glr.c: Formatting changes.
2239
2240 2008-12-11 Akim Demaille <demaille@gostai.com>
2241
2242 Propagate i18n changes into glr.c.
2243 * TODO: Update.
2244 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
2245 building the error message format dynamically.
2246 * data/lalr1.java: Formatting changes.
2247
2248 2008-12-11 Akim Demaille <demaille@gostai.com>
2249
2250 Use testsuite -C.
2251 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
2252 Solves problems when top_srcdir is an absolute path.
2253 Suggested by Eric Blake.
2254 * configure.ac: Require Autoconf 2.62.
2255
2256 2008-12-11 Akim Demaille <demaille@gostai.com>
2257
2258 Simplify the i18n of the error messages.
2259 * data/lalr1.cc: Comment changes.
2260 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
2261 lalr1.cc instead of building dynamically the format string.
2262
2263 2008-12-08 Akim Demaille <demaille@gostai.com>
2264
2265 Fix portability issue in the test suite.
2266 * tests/local.at (AT_MATCHES_CHECK): New.
2267 Based on Perl instead of Sed. Sed has too many portability
2268 pitfalls, not ever Sed is GNU Sed.
2269 * tests/actions.at (Fix user actions without a trailing semicolon):
2270 Use it.
2271
2272 2008-12-08 Akim Demaille <demaille@gostai.com>
2273
2274 Update data/README.
2275 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
2276
2277 2008-12-08 Akim Demaille <demaille@gostai.com>
2278
2279 Install autoconf as a submodule to get m4sugar.
2280 * .gitmodules: Add submodules/autoconf.
2281 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
2282 submodules/autoconf.
2283
2284 2008-12-08 Akim Demaille <demaille@gostai.com>
2285
2286 Test token.prefix in all the skeletons.
2287 * data/java.m4 (b4_token_enum): Use the token.prefix.
2288 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
2289 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
2290 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
2291 * tests/java.at: Comment changes.
2292 (AT_CHECK_JAVA_MINIMAL): Define the END token.
2293 (Java parser class and package names): Add token.prefix check.
2294
2295 2008-12-08 Akim Demaille <demaille@gostai.com>
2296
2297 Fix regeneration of atconfig.
2298 * tests/local.mk (tests/atconfig): The rule was incorrect, but
2299 remove it: now that there is no tests/Makefile.am, the top-level
2300 Makefile properly updates atconfig when needed.
2301
2302 2008-12-07 Di-an Jan <dianj@freeshell.org>
2303
2304 Implement the FIXME that ends an user action with a semicolon
2305 if it seems necessary.
2306 * src/scan-code.l (flex rules section): Flag cpp directive from
2307 any `#' to the first unescaped end-of-line. Semicolon is not
2308 needed after `;', `{', '}', or cpp directives and is needed after
2309 any other token (whitespaces and comments have no effect).
2310 * tests/actions.at (Fix user actions without a trailing semicolon):
2311 New test.
2312 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
2313 to make user actions complete statements.
2314 Adjust column numbers in error messages.
2315 * tests/regression.at (Fix user actions without a trailing semicolon):
2316 Remove. Covered by new test.
2317
2318 2008-12-07 Akim Demaille <demaille@gostai.com>
2319
2320 Update gnulib.
2321 * gnulib: Update from master.
2322
2323 2008-12-05 Eric Blake <ebb9@byu.net>
2324
2325 Avoid compiler warning.
2326 * src/output.c (muscle_insert_item_number_table): Delete unused
2327 function.
2328
2329 2008-12-02 Eric Blake <ebb9@byu.net>
2330
2331 Build testsuite with newer autoconf.
2332 * tests/output.at (m4_expand): Don't override in newer autoconf,
2333 where the underlying implementation changed.
2334 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
2335 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
2336 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
2337 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
2338 since some of them contain unbalanced ')'.
2339
2340 2008-12-01 Akim Demaille <demaille@gostai.com>
2341
2342 Use b4_symbol for printers and destructors everywhere.
2343 * data/bison.m4 (b4_symbol_action_location): New.
2344 * data/c.m4 (b4_symbol_actions): Remove.
2345 Adjust all callers to use by b4_symbol_foreach and the corresponding
2346 b4_symbol_printer/destructor macro.
2347 * data/glr.cc: Adjust.
2348 * data/lalr1.java: Adjust the %destructor sanity check.
2349 * src/output.c (symbol_code_props_output): Remove, we no longer
2350 need the b4_symbol_printers/destructors tables.
2351
2352 2008-12-01 Akim Demaille <demaille@gostai.com>
2353
2354 Use b4_symbol_case_.
2355 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
2356 b4_symbol_case_.
2357
2358 2008-12-01 Akim Demaille <demaille@gostai.com>
2359
2360 Move b4_symbol based macro to bison.m4.
2361 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
2362 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
2363 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
2364 (b4_type_foreach): Move to...
2365 * data/bison.m4: Here.
2366 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
2367 b4_symbol_value_template instead of b4_symbol_value.
2368
2369 2008-12-01 Akim Demaille <demaille@gostai.com>
2370
2371 b4_symbol/type_foreach.
2372 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
2373 Use them.
2374
2375 2008-12-01 Akim Demaille <demaille@gostai.com>
2376
2377 Use the symbol properties to output the printer/destructor for lalr1.cc.
2378 Instead of defining complex list of tuples to define various
2379 properties of the symbols, we now prefer to define symbols as
2380 "structs" in m4: using the symbol key (its number), and the
2381 property name, b4_symbol gives it value. Use this to handle
2382 destructors and printers.
2383
2384 * src/output.c (CODE_PROP): New.
2385 (prepare_symbol_definitions): Use it to define the printer and
2386 destructor related attributes of the symbols.
2387 * data/lalr1.cc (b4_symbol_actions): Rename as...
2388 (b4_symbol_action): this.
2389 Use b4_symbol instead of 6 arguments.
2390 (b4_symbol_printer, b4_symbol_destructor): New.
2391 Use them instead of b4_symbol_actions.
2392
2393 2008-12-01 Akim Demaille <demaille@gostai.com>
2394
2395 Avoid capturing variables too easily.
2396 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
2397 v__ and p__ instead of v and p.
2398
2399 2008-12-01 Akim Demaille <demaille@gostai.com>
2400
2401 Remove spurious empty line before syncline.
2402 * data/bison.m4 (b4_syncline): Don't output an empty line before
2403 the output.
2404
2405 2008-11-26 Akim Demaille <demaille@gostai.com>
2406
2407 Convert lib/Makefile.am into lib/local.mk.
2408 The real problem is rather gnulib.mk, which itself is extracted
2409 from a Makefile.am that gnulib expects to the "recursive". The
2410 tool prefix-gnulib-mk converts such a gnulib.mk to be
2411 non-recursive. Also, some AC_SUBST variables need to be adjusted.
2412
2413 * etc/prefix-gnulib-mk: New.
2414 * bootstrap (slurp): Use it to convert further gnulib.mk.
2415 No longer try to avoid re-creation of lib/gnulib.mk as the changes
2416 are deeper.
2417 * lib/Makefile.am: Rename as...
2418 * lib/local.mk: this.
2419 Adjust to be prefixed.
2420 * Makefile.am, configure.ac: Adjust.
2421 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
2422
2423 2008-11-26 Akim Demaille <demaille@gostai.com>
2424
2425 s/_FLAGS/FLAGS/.
2426 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
2427 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
2428 Reported by Eric Blake.
2429
2430 2008-11-26 Akim Demaille <demaille@gostai.com>
2431
2432 Use b4_parser_tables_define in glr.cc.
2433 * data/glr.c: Use b4_parser_tables_define instead of defining the
2434 (deterministic integral) tables by hand.
2435
2436 2008-11-26 Akim Demaille <demaille@gostai.com>
2437
2438 Use b4_parser_tables_define in Java.
2439 * data/java.m4 (b4_typed_parser_table): Rename as...
2440 (b4_typed_parser_table_define): this, for consistency.
2441 Accept a comment as $4.
2442 Move $2 into yy*_.
2443 (b4_integral_parser_table): Rename as...
2444 (b4_integral_parser_table_define): this.
2445 * data/lalr1.java: Adjust all uses.
2446 Use b4_parser_tables_define instead of generation by hand.
2447
2448 2008-11-26 Akim Demaille <demaille@gostai.com>
2449
2450 Prepare the convergence bw C style and Java table generation.
2451 * data/bison.m4 (b4_tables_map, b4_tables_declare)
2452 (b4_tables_define): Rename as...
2453 (b4_integral_parser_tables_map, b4_parser_tables_declare)
2454 (b4_parser_tables_define): these.
2455 * data/c.m4 (b4_table_define): Rename as...
2456 (b4_integral_parser_table_define): this.
2457 * data/lalr1.cc: Adjust.
2458 (b4_table_define, b4_table_declare): Rename as...
2459 (b4_integral_parser_table_define)
2460 (b4_integral_parser_table_declare): these.
2461 (yyrline_): Move the comment where it is actually used.
2462 * data/yacc.c: Adjust.
2463 (yyrline): Use b4_integral_parser_table_define.
2464
2465 2008-11-26 Akim Demaille <demaille@gostai.com>
2466
2467 Regen.
2468 * src/parse-gram.h, src/parse-gram.c: Regen.
2469
2470 2008-11-26 Akim Demaille <demaille@gostai.com>
2471
2472 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
2473 * data/lalr1.cc (b4_tables_map): Move to...
2474 * data/bison.m4: here.
2475 Update the comment for yytable during the flight.
2476 (b4_tables_declare, b4_tables_define): New.
2477 * data/lalr1.cc: Use them.
2478 * data/c.m4 (b4_table_define): New.
2479 * data/yacc.c: Use b4_tables_define instead of output the tables
2480 by hand.
2481 * tests/regression.at (Web2c Actions): Adjust the expected output,
2482 the order of the tables changed.
2483
2484 2008-11-26 Akim Demaille <demaille@gostai.com>
2485
2486 Get rid of (yy)rhs and (yy)prhs.
2487 These tables are no longer needed in the parsers, and they don't seem to
2488 be useful. They are not documented either.
2489
2490 * src/output.c (prepare_rules): Get rid of rhs and prhs.
2491 Adjust the computation of (yy)r2.
2492
2493 2008-11-26 Akim Demaille <demaille@gostai.com>
2494
2495 Rule length is unsigned.
2496 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
2497
2498 2008-11-26 Akim Demaille <demaille@gostai.com>
2499
2500 Get rid of lalr1-split.cc.
2501 It was no longer maintainer.
2502
2503 * data/lalr1-split.cc: Remove.
2504 * etc/bench.pl.in (bench_fusion_parser): Remove.
2505 Adjust.
2506
2507 2008-11-26 Akim Demaille <demaille@gostai.com>
2508
2509 Use yy* consistently.
2510 * data/glr.c: Now that yyrhs no longer exists as a global
2511 variable, rename local "rhs" variables into "yyrhs" for
2512 consistency.
2513
2514 2008-11-25 Akim Demaille <demaille@gostai.com>
2515
2516 Get rid of yyrhs and yyprhs in glr.c.
2517 * data/glr.c (yyrhs, yyprhs): Remove.
2518 Instead, use the state stack and yystos.
2519
2520 2008-11-25 Akim Demaille <demaille@gostai.com>
2521
2522 Flag glr tests.
2523 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
2524 as an Autotest keyword.
2525
2526 2008-11-25 Akim Demaille <demaille@gostai.com>
2527
2528 Prefer TESTSUITE_FLAGS.
2529 TESTSUITEFLAGS is barely readable.
2530
2531 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
2532 for backward compatibility.
2533 Use the former instead of the latter.
2534
2535 2008-11-25 Akim Demaille <demaille@gostai.com>
2536
2537 Get rid of yyrhs and yyprhs in larl1.java.
2538 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
2539 (yy_reduce_print): Rather, use yystos_ and the state stack.
2540
2541 2008-11-25 Akim Demaille <demaille@gostai.com>
2542
2543 Formatting changes.
2544
2545 2008-11-25 Akim Demaille <demaille@gostai.com>
2546
2547 Get rid of yyrhs and yyprhs in yacc.c.
2548 They were used to get the symbol types, given a rule number, when
2549 displaying the top of the stack before a reduction. But the
2550 symbol type is available from the state stack. This has two be
2551 benefits: two tables less in the parser (making it smaller), and a
2552 more consistent use of the three stacks which will help to fuse
2553 them.
2554
2555 * data/yacc.c (yyprhs, yyrhs): Remove.
2556 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
2557 (yy_reduce_print): Take yyssp as argument.
2558 Use it, together with yystos, to get the symbol type.
2559 * tests/regression.at (Web2c Report): Remove these tables from the
2560 expected output.
2561
2562 2008-11-25 Akim Demaille <demaille@gostai.com>
2563
2564 b4_tables_map.
2565 The point is to factor the generation of the tables across skeletons.
2566 This is language dependant.
2567
2568 * data/c.m4 (b4_comment_): New.
2569 Should be usable to define how to generate tables independently of
2570 the language.
2571 (b4_c_comment): New.
2572 (b4_comment): Bounce to b4_c_comment.
2573 Now support $2 = [PREFIX] for indentation.
2574 * data/lalr1.cc (b4_table_declare): Don't output a comment if
2575 there is no comment.
2576 Indent it properly when there is one.
2577 Output the ending semicolon.
2578 (b4_table_define): Space changes.
2579 Output the ending semicolon.
2580 (b4_tables_map): New.
2581 Use it twice instead of declaring and defining the (integral)
2582 tables by hand.
2583
2584 2008-11-25 Akim Demaille <demaille@gostai.com>
2585
2586 b4_table_declare.
2587 * data/lalr1.cc (b4_table_declare): New.
2588 Use it to declare the tables defined with b4_table_define.
2589 (b4_table_define): Declare a third arg to match b4_table_declare
2590 signature.
2591 Move all the comments around invocations of b4_table_define into
2592 the invocations itselves.
2593 Move things around to have the order for declarations and
2594 definitions.
2595
2596 2008-11-25 Akim Demaille <demaille@gostai.com>
2597
2598 Formatting changes.
2599 * data/lalr1.java: here.
2600
2601 2008-11-25 Akim Demaille <demaille@gostai.com>
2602
2603 b4_args is more general than only C++.
2604 * data/lalr1.cc (b4_args, _b4_args): Move to...
2605 * data/bison.m4: here.
2606
2607 2008-11-21 Di-an Jan <dianj@freeshell.org>
2608
2609 Implement no-XXX arguments for --warnings, --report, --trace.
2610 * src/getargs.c (flags_argmatch): Handles no-XXX.
2611 Fix typo in doxygen comment.
2612
2613 2008-11-21 Akim Demaille <demaille@gostai.com>
2614
2615 Display the changes in cross-options.texi.
2616 * build-aux/cross-options.pl ($sep): New, to separate items.
2617 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
2618 changes.
2619
2620 2008-11-20 Di-an Jan <dianj@freeshell.org>
2621
2622 Improves options in the manual.
2623 * doc/bison.texinfo (-g, -x): Add space before argument.
2624 (Option Cross Key): Implement FIXME: listing directives also.
2625 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
2626 (Short Option): Special case -d. Put arguments inside @option.
2627 (Bison Directive): Add column, automatically extracted from
2628 src/scan-gram.l (actual name passed as the first argument)
2629 with special case for %define.
2630 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
2631 to build-aux/cross-options.pl.
2632 * src/getargs.c (usage): Document limitations of cross-options.pl.
2633 * src/scan-gram.l: Likewise.
2634
2635 2008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2636
2637 Fix unexpanded macros in GLR defines file.
2638 Reported by Csaba Raduly at
2639 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
2640 * THANKS (Csaba Raduly): Add.
2641 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
2642 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
2643 lexer in a separate module that includes the defines file.
2644 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
2645 source.
2646 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
2647 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
2648 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
2649 (AT_DATA_SOURCE_PROLOGUE): New.
2650 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
2651 (AT_DATA_SOURCE): New.
2652 (AT_FULL_COMPILE): Extend to support an additional source file.
2653
2654 2008-11-18 Akim Demaille <demaille@gostai.com>
2655
2656 More TODO.
2657 * TODO: More short term issues.
2658
2659 2008-11-18 Akim Demaille <demaille@gostai.com>
2660
2661 Regen.
2662 * src/parse-gram.h, src/parse-gram.c: Regen.
2663
2664 2008-11-18 Akim Demaille <demaille@gostai.com>
2665
2666 Use b4_subtract where possible.
2667 * data/lalr1.cc (b4_subtract): Move to...
2668 * data/bison.m4: here.
2669 * data/glr.c (b4_rhs_data): Use it.
2670 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
2671
2672 2008-11-18 Akim Demaille <demaille@gostai.com>
2673
2674 Remove incorrect mode specification.
2675 * data/glr.cc: Don't pretend it's C code.
2676
2677 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2678
2679 Simplify last patch slightly.
2680 * src/getargs.c (getargs): Here.
2681
2682 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2683
2684 Fix last warning from --enable-gcc-warnings.
2685 * src/getargs.c (getargs): Don't assign const address to non-const
2686 pointer.
2687
2688 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2689
2690 Don't let maintainer-*-check targets force a version update.
2691 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
2692 handled.
2693
2694 2008-11-17 Di-an Jan <dianj@freeshell.org>
2695
2696 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
2697 Align menus. Adjust word wrapping. Use node names for menu names.
2698 (Examples): Don't abbreviate node names.
2699 (LocalWords): Remove abbreviations.
2700 (Copying): Make description a sentence.
2701 (Java Action Features): Remove period to match the rest of menu.
2702
2703 2008-11-17 Di-an Jan <dianj@freeshell.org>
2704
2705 Handles several --enable-gcc-warnings.
2706 * src/getargs.c (command_line_location): Set parameters to void.
2707 * src/output.c (symbol_type_name_cmp): Make static.
2708 (symbols_by_type_name): Set parameters to void.
2709 (symbol_definitions_output): Remove unused parameter. Rename as...
2710 (prepare_symbol_definitions): this.
2711 (muscles_output): Move symbol_definitions_output to...
2712 (output): here as prepare_symbol_definitions.
2713 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
2714 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
2715
2716 2008-11-17 Di-an Jan <dianj@freeshell.org>
2717
2718 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
2719 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
2720
2721 2008-11-16 Akim Demaille <demaille@gostai.com>
2722
2723 Add missing $(EXEEXT).
2724 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
2725 "src/bison$(EXEEXT)".
2726 Reported by Di-an Jan.
2727
2728 2008-11-15 Akim Demaille <demaille@gostai.com>
2729
2730 * TODO: Update.
2731
2732 2008-11-15 Akim Demaille <demaille@gostai.com>
2733
2734 Formatting changes.
2735 * tests/input.at: here.
2736
2737 2008-11-15 Akim Demaille <demaille@gostai.com>
2738
2739 Remove duplicate header inclusion.
2740 * src/LR0.c: here.
2741
2742 2008-11-15 Akim Demaille <demaille@gostai.com>
2743
2744 * src/parse-gram.h, src/parse-gram.c: Regen.
2745
2746 2008-11-15 Akim Demaille <demaille@gostai.com>
2747
2748 Support parametric types.
2749
2750 There are two issues to handle: first scanning nested angle
2751 bracket pairs to support types such as std::pair< std::string,
2752 std::list<std::string> > >.
2753
2754 Another issue is to address idiosyncracies of C++: do not glue two
2755 closing angle brackets together (otherwise it's operator>>), and
2756 avoid sticking blindly a TYPE to the opening <, as it can result
2757 in '<:' which is a digraph for '['.
2758
2759 * src/scan-gram.l (brace_level): Rename as...
2760 (nesting): this.
2761 (SC_TAG): New.
2762 Implement support for complex tags.
2763 (tag): Accept
2764 , but not <.
2765 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
2766 (b4_symbol_variant): Leave space around types as parameters.
2767 * examples/variant.yy: Use nested template types and leading ::.
2768 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
2769 Rename as...
2770 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
2771 * tests/c++.at: Test parametric types.
2772
2773 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2774
2775 Test token.prefix.
2776 This is not sufficient, but we test at least that the make_SYMBOL
2777 interface is not affected by token.prefix. A more general test
2778 will be implemented when the support of token.prefix is generalized
2779 to more skeletons.
2780
2781 * tests/c++.at: One more variant test, using token.prefix.
2782
2783 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2784
2785 Test the make_TOKEN interface.
2786 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
2787 Factor the common code in yylex.
2788 Use it to test "%define lex_symbol".
2789
2790 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2791
2792 Formatting change.
2793
2794 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2795
2796 Simplify code for variants bench marks.
2797 * etc/bench.pl.in (&generate_grammar_list): Define and use
2798 location_type.
2799 Factor the common code in yylex.
2800
2801 2008-11-15 Akim Demaille <demaille@gostai.com>
2802
2803 Better error message.
2804 * bootstrap (find_tool): Fix the error message.
2805
2806 2008-11-15 Akim Demaille <demaille@gostai.com>
2807
2808 Update variant.yy to newest interface.
2809 * examples/variant.yy: Define lex_symbol.
2810 Adjust.
2811
2812 2008-11-15 Akim Demaille <demaille@gostai.com>
2813
2814 Don't use locations in variant.yy.
2815 * examples/variant.yy: Adjust to not using locations.
2816
2817 2008-11-15 Akim Demaille <demaille@gostai.com>
2818
2819 Comment changes.
2820 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
2821 comments for the license.
2822
2823 2008-11-15 Akim Demaille <demaille@gostai.com>
2824
2825 Remove tests/Makefile.am.
2826 * tests/Makefile.am: Rename as...
2827 * tests/local.mk: this.
2828 * Makefile.am, configure.ac: Adjust.
2829 * Makefile.am (DISTCLEANFILES): Define.
2830 (maintainer-check, maintainer-xml-check, maintainer-push-check):
2831 Remove, we no longer need to bounce to the real targets.
2832
2833 2008-11-15 Akim Demaille <demaille@gostai.com>
2834
2835 Comment changes.
2836
2837 2008-11-15 Akim Demaille <demaille@gostai.com>
2838
2839 djgpp/local.mk.
2840 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
2841 * djgpp/local.mk: this new file.
2842
2843 2008-11-15 Akim Demaille <demaille@gostai.com>
2844
2845 Remove doc/Makefile.am.
2846 * doc/Makefile.am: Rename as...
2847 * doc/local.mk: this.
2848 Adjust paths
2849 * Makefile.am, configure.ac: Adjust.
2850 * Makefile.am (MOSTLYCLEANFILES): New.
2851 * src/local.mk: Adjust.
2852
2853 2008-11-15 Akim Demaille <demaille@gostai.com>
2854
2855 Move sc_tight_scope into maint.mk.
2856 It does not work, and I don't know how it was supposed to work: it
2857 seems to be looking for sources in the build tree. I just moved
2858 it at a better place, fixing it is still required.
2859
2860 * src/local.mk (echo): Remove.
2861 (sc_tight_scope): Move to...
2862 * maint.mk: here.
2863
2864 2008-11-15 Akim Demaille <demaille@gostai.com>
2865
2866 Regen.
2867 * src/parse-gram.h, src/parse-gram.h: Regen.
2868
2869 2008-11-15 Akim Demaille <demaille@gostai.com>
2870
2871 Remove src/Makefile.am.
2872 * src/Makefile.am: Rename as...
2873 * src/local.mk: this.
2874 Prefix all the paths with src/.
2875 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
2876 (AM_CPPFLAGS): Find find in builddir/src.
2877 (YACC): Move the flags into...
2878 (AM_YFLAGS): here.
2879 * maint.mk (sc_tight_scope): Disable.
2880 It used to bounce to the version in src/Makefile.am which is now
2881 part of this very Makefile.
2882 * Makefile.am, configure.ac: Adjust.
2883 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
2884 include "..." to find files "here": we are no longer in src/, so
2885 qualify the includes with src/.
2886 * doc/Makefile.am (PREPATH): No longer include the top_builddir
2887 prefix.
2888 (.x.1): Adjust to be able to create src/foo from the top level
2889 Makefile, instead of going bounce to src/Makefile the creation of
2890 foo.
2891
2892 2008-11-15 Akim Demaille <demaille@gostai.com>
2893
2894 Remove useless variable.
2895 * doc/Makefile.am (srcsrcdir): Remove.
2896
2897 2008-11-15 Akim Demaille <demaille@gostai.com>
2898
2899 Remove data/Makefile.am.
2900 * data/Makefile.am: Rename as...
2901 * data/local.mk: this.
2902 Adjust paths.
2903 * Makefile.am, configure.ac: Adjust.
2904
2905 2008-11-15 Akim Demaille <demaille@gostai.com>
2906
2907 Remove etc/Makefile.am.
2908 * etc/Makefile.am: Rename as...
2909 * etc/local.mk: this.
2910 Adjust.
2911 * Makefile.am, configure.ac: Adjust.
2912
2913 2008-11-15 Akim Demaille <demaille@gostai.com>
2914
2915 Remove examples/local.mk.
2916 examples/calc++/Makefile.am might be interesting to keep as is, since
2917 it is an example in itself.
2918
2919 * examples/Makefile.am: Rename as...
2920 * examples/local.mk: this.
2921 Adjust.
2922 * Makefile.am, configure.ac: Adjust.
2923
2924 2008-11-15 Akim Demaille <demaille@gostai.com>
2925
2926 Remove build-aux/Makefile.am.
2927 Recursive Makefiles are really way too slow, let's get rid of some of
2928 them.
2929
2930 * build-aux/Makefile.am: Rename as...
2931 * build-aux/local.mk: this.
2932 Adjust paths.
2933 * Makefile.am, configure.ac: Adjust.
2934
2935 2008-11-15 Akim Demaille <demaille@gostai.com>
2936
2937 Provide convenience constructors for locations and positions.
2938 * data/location.cc (position::position): Accept file, line and
2939 column as arguments with default values.
2940 Always qualify initial line and column literals as unsigned.
2941 (location::location): Provide convenience constructors.
2942
2943 2008-11-15 Akim Demaille <demaille@gostai.com>
2944
2945 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
2946 token type.
2947 Using template buys us nothing, and makes it uselessly complex to
2948 construct a symbol. Besides, it could not be generalized to other
2949 languages, while make_FOO would work in C/Java etc.
2950
2951 * data/lalr1.cc (b4_symbol_): New.
2952 (b4_symbol): Use it.
2953 (b4_symbol_constructor_declaration_)
2954 (b4_symbol_constructor_definition_): Instead of generating
2955 specializations of an overloaded template function, just generate
2956 several functions whose names are forged from the token names
2957 without the token.prefix.
2958 (b4_symbol_constructor_declarations): Generate them for all the
2959 symbols, not just by class of symbol type, now that instead of
2960 specializing a function template by the token, we generate a
2961 function named after the token.
2962 (b4_symbol_constructor_specialization_)
2963 (b4_symbol_constructor_specializations): Remove.
2964 * etc/bench.pl.in: Adjust to this new API.
2965
2966 2008-11-13 Akim Demaille <demaille@gostai.com>
2967
2968 %define token.prefix.
2969 Provide a means to add a prefix to the name of the tokens as
2970 output in the generated files. Because of name clashes, it is
2971 good to have such a prefix such as TOK_ that protects from names
2972 such as EOF, FILE etc. But it clutters the grammar itself.
2973
2974 * data/bison.m4 (token.prefix): Empty by default.
2975 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
2976 * data/lalr1.cc (b4_symbol): Ditto.
2977
2978 2008-11-13 Akim Demaille <demaille@gostai.com>
2979
2980 Compute at M4 time some of the subtractions.
2981 * data/lalr1.cc (b4_subtract): New.
2982 (b4_rhs_data): Use it.
2983
2984 2008-11-13 Akim Demaille <demaille@gostai.com>
2985
2986 symbol::token.
2987 This allows the user to get the type of a token returned by yylex.
2988
2989 * data/lalr1.cc (symbol::token): New.
2990 (yytoknum_): Define when %define lex_symbol, independently of
2991 %debug.
2992 (yytoken_number_): Move into...
2993 (symbol::token): here, since that's the only use.
2994 The other one is YYPRINT which was not officially supported
2995 by lalr1.cc, and anyway it did not work since YYPRINT uses this
2996 array under a different name (yytoknum).
2997
2998 2008-11-13 Akim Demaille <demaille@gostai.com>
2999
3000 YYERRCODE.
3001 * TODO (YYERRCODE): Mention the case of $undef.
3002
3003 2008-11-13 Akim Demaille <demaille@gostai.com>
3004
3005 TODO: YYPRINT.
3006 * TODO (YYPRINT): New.
3007
3008 2008-11-13 Akim Demaille <demaille@gostai.com>
3009
3010 Comment changes.
3011 * data/lalr1.cc, data/yacc.c: Fix the description of the
3012 yytranslate and yytoknum tables.
3013
3014 2008-11-13 Akim Demaille <demaille@gostai.com>
3015
3016 Define make_symbol in the header.
3017 To reach good performances these functions should be inlined (yet
3018 this is to measure precisely). To this end they must be available
3019 to the caller.
3020
3021 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
3022 location_type with the class name.
3023 Since will now be output in the header, declare "inline".
3024 No longer use b4_symbol_constructor_specializations, but
3025 b4_symbol_constructor_definitions in the header.
3026 Don't call it in the *.cc file.
3027
3028 2008-11-13 Akim Demaille <demaille@gostai.com>
3029
3030 Define yytranslate in the header for lex_symbol.
3031 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
3032 into the header file when using %define lex_symbol.
3033 (yytranslate_): Declare inline.
3034
3035 2008-11-13 Akim Demaille <demaille@gostai.com>
3036
3037 Define the constructors of symbol_type in
3038 b4_symbol_constructor_definitions.
3039 The constructors are called by the make_symbol functions, which a
3040 forthcoming patch will move elsewhere. Hence the interest of
3041 putting them together.
3042
3043 The stack_symbol_type does not need to be moved, it is used only
3044 by the parser.
3045
3046 * data/lalr1.cc: Move symbol_type and symbol_base_type
3047 constructors into...
3048 (b4_symbol_constructor_definitions): here.
3049 Adjust.
3050
3051 2008-11-13 Akim Demaille <demaille@gostai.com>
3052
3053 Make it easier to move the definition of yytranslate_.
3054 Forthcoming changes will make it possible to use yytranslate_
3055 from outside the parser implementation file.
3056
3057 * data/lalr1.cc (b4_yytranslate_definition): New.
3058 Use it.
3059
3060 2008-11-13 Akim Demaille <demaille@gostai.com>
3061
3062 Remove useless class specification.
3063 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
3064 to refer to the class name to use a type defined by the class for
3065 arguments of member functions.
3066
3067 2008-11-13 Akim Demaille <demaille@gostai.com>
3068
3069 Finer input type for yytranslate.
3070 This patch is debatable: the tradition expects yylex to return an int
3071 which happens to correspond to token_number (which is an enum). This
3072 allows for instance to return characters (such as '*' etc.). But this
3073 goes against the stronger typing I am trying to have with the new
3074 lex interface which return a symbol_type. So in this case, feed
3075 yytranslate_ with a token_type.
3076
3077 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
3078 expect a token_type.
3079
3080 2008-11-13 Akim Demaille <demaille@gostai.com>
3081
3082 Honor lex-params in %define lex_symbol mode.
3083 * data/lalr1.cc: Use b4_lex_param.
3084
3085 2008-11-13 Akim Demaille <demaille@gostai.com>
3086
3087 Simplify names.
3088 * src/output.c (symbol_definitions_output): Rename symbol
3089 attributes type_name and has_type_name as type and has_type.
3090 * data/lalr1.cc: Adjust uses.
3091
3092 2008-11-13 Akim Demaille <demaille@gostai.com>
3093
3094 Use b4_type_names for the union type.
3095 The union used to compute the size of the variant used to iterate
3096 over the type of all the symbols, with a lot of redundancy. Now
3097 iterate over the lists of symbols having the same type-name.
3098
3099 * data/lalr1.cc (b4_char_sizeof_): New.
3100 (b4_char_sizeof): Use it.
3101 Adjust to be called with a list of numbers instead of a single
3102 number.
3103 Adjust its caller for new-line issues.
3104
3105 2008-11-13 Akim Demaille <demaille@gostai.com>
3106
3107 Define the "identifier" of a symbol.
3108 Symbols may have several string representations, for instance if
3109 they have an alias. What I call its "id" is a string that can be
3110 used as an identifier. May not exist.
3111
3112 Currently the symbols which have the "tag_is_id" flag set are
3113 those that don't have an alias. Look harder for the id.
3114
3115 * src/output.c (is_identifier): Move to...
3116 * src/symtab.c (is_identifier): here.
3117 * src/symtab.h, src/symtab.c (symbol_id_get): New.
3118 * src/output.c (symbol_definitions_output): Use it to define "id"
3119 and "has_id".
3120 Remove the definition of "tag_is_id".
3121 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
3122 "tag_is_id" were used to produce code.
3123 We still use "tag" for documentation.
3124
3125 2008-11-11 Akim Demaille <demaille@gostai.com>
3126
3127 Locations are no longer required by lalr1.cc.
3128 * data/lalr1.cc (_b4_args, b4_args): New.
3129 Adjust all uses of locations to make them optional.
3130 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
3131 (AT_CHECK_NAMESPACE): Check the use of locations.
3132 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
3133 without locations with lalr1.cc.
3134 Test these cases.
3135 * tests/output.at: Check lalr1.cc with and without location
3136 support.
3137 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
3138 Don't use locations.
3139
3140 2008-11-11 Akim Demaille <demaille@gostai.com>
3141
3142 AT_FULL_COMPILE.
3143 * tests/local.at (AT_FULL_COMPILE): New.
3144 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
3145
3146 2008-11-11 Akim Demaille <demaille@gostai.com>
3147
3148 Support parens in calc++.
3149 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
3150 * examples/calc++/test (run): Check the expected output.
3151 Adjust callers.
3152 Check parens too.
3153
3154 2008-11-11 Akim Demaille <demaille@gostai.com>
3155
3156 Simplify lalr1.cc since %defines is mandatory.
3157 * data/lalr1.cc: Remove useless calls to b4_defines_if.
3158
3159 2008-11-11 Akim Demaille <demaille@gostai.com>
3160
3161 TODO: yyfmt.
3162 * TODO (yysyntax_error): New item.
3163
3164 2008-11-11 Akim Demaille <demaille@gostai.com>
3165
3166 Prefer M4 to CPP.
3167 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
3168 YYERROR_VERBOSE.
3169
3170 2008-11-11 Akim Demaille <demaille@gostai.com>
3171
3172 Support i18n of the parse error messages.
3173 * TODO (lalr1.cc/I18n): Remove.
3174 * data/lalr1.cc (yysyntax_error_): Support the translation of the
3175 error messages, as done in yacc.c.
3176 Stay within the yy* pseudo namespace.
3177
3178 2008-11-11 Akim Demaille <demaille@gostai.com>
3179
3180 More TODO.
3181 * TODO (single stack, yysyntax_error): New.
3182
3183 2008-11-11 Akim Demaille <demaille@gostai.com>
3184
3185 Make it possible to return a symbol_type from yylex.
3186 * data/lalr1.cc (b4_lex_symbol_if): New.
3187 (parse): When lex_symbol is defined, expected yylex to return the
3188 complete lookahead.
3189 * etc/bench.pl.in (generate_grammar_list): Extend to support this
3190 yylex interface.
3191 (bench_variant_parser): Exercise it.
3192
3193 2008-11-11 Akim Demaille <demaille@gostai.com>
3194
3195 Remove useless bench case.
3196 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
3197 no longer used.
3198
3199 2008-11-11 Akim Demaille <demaille@gostai.com>
3200
3201 Improve display of directives.
3202 * etc/bench.pl.in (parse_term): Don't add useless eol.
3203
3204 2008-11-11 Akim Demaille <demaille@gostai.com>
3205
3206 Use string_cast in the bench.
3207 * etc/bench.pl.in (generate_grammar_list): Define and use
3208 string_cast.
3209
3210 2008-11-11 Akim Demaille <demaille@gostai.com>
3211
3212 Replace yychar with a Boolean.
3213 * data/lalr1.cc (parse::yychar): Replace by...
3214 (parse::yyempty): this.
3215
3216 2008-11-11 Akim Demaille <demaille@gostai.com>
3217
3218 Factor the tables.
3219 * TODO: New item.
3220
3221 2008-11-11 Akim Demaille <demaille@gostai.com>
3222
3223 Let yytranslate handle the eof case.
3224 * data/lalr1.cc (yytranslate_): Handle the EOF case.
3225 Adjust callers.
3226 No longer expect yychar to be equal to yyeof_, rather, test the
3227 lookahead's (translated) kind.
3228
3229 2008-11-11 Akim Demaille <demaille@gostai.com>
3230
3231 yychar cannot be empty in yyerrlab.
3232 * TODO (yychar == yyempty_): New.
3233 * data/lalr1.cc: Remove the handling of this case.
3234 This eases forthcoming changes related to yychar and yytranslate.
3235
3236 2008-11-11 Akim Demaille <demaille@gostai.com>
3237
3238 Bench: syntactic sugar for %define/#define.
3239 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
3240 (&bench_push_parser, bench_variant_parser): Use this feature.
3241 (&eat): New.
3242 Use it.
3243
3244 2008-11-11 Akim Demaille <demaille@gostai.com>
3245
3246 Less memory pressure on the "list" bench.
3247 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
3248 the values, to limit memory pressure.
3249
3250 2008-11-11 Akim Demaille <demaille@gostai.com>
3251
3252 Introduce make_symbol.
3253 make_symbol provides a means to construct a full symbol (kind,
3254 value, location) in a single shot. It is meant to be a Symbol
3255 constructor, parameterized by the symbol kind so that overloading
3256 would prevent incorrect kind/value pairs. Unfortunately
3257 parameterized constructors do not work well in C++ (unless the
3258 parameter also appears as an argument, which is not acceptable),
3259 hence the use of a function instead of a constructor.
3260
3261 * data/lalr1.cc (b4_symbol_constructor_declaration_)
3262 (b4_symbol_constructor_declarations)
3263 (b4_symbol_constructor_specialization_)
3264 (b4_symbol_constructor_specializations)
3265 (b4_symbol_constructor_definition_)
3266 (b4_symbol_constructor_definitions): New.
3267 Use them where appropriate to generate declaration, declaration of
3268 the specializations, and implementations of the templated
3269 overloaded function "make_symbol".
3270 (variant::variant): Always define a default ctor.
3271 Also provide a copy ctor.
3272 (symbol_base_type, symbol_type): New ctor overloads for value-less
3273 symbols.
3274 (symbol_type): Now public, so that functions such as yylex can use
3275 it.
3276
3277 2008-11-11 Akim Demaille <demaille@gostai.com>
3278
3279 Inform m4 whether a tag is a valid id.
3280 * src/output.c (is_identifier): New.
3281 (symbol_definitions_output): Use it to define tag_is_id.
3282 But maybe this should be done at m4 level?
3283
3284 2008-11-11 Akim Demaille <demaille@gostai.com>
3285
3286 Test 214 was failing: it greps with a pattern containing [ ]*
3287 which obviously meant to catch spaces and tabs, but contained only
3288 spaces. Tabulations in sources are a nuisance, so to simplify the
3289 matter, get rid of all the tabulations in the Java sources. The
3290 other skeletons will be treated equally later.
3291
3292 * data/java.m4, data/lalr1.java: Untabify.
3293 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
3294 tabulations are no longer generated.
3295
3296 2008-11-11 Paolo Bonzini <bonzini@gnu.org>
3297
3298 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
3299 * configure.ac: Adjust usage.
3300 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3301 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3302 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
3303
3304 2008-11-10 Di-an Jan <dianj@freeshell.org>
3305
3306 Workaround Java's ``code too large'' problem for parser tables
3307 in most cases, by using one function per initialization.
3308 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
3309 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
3310 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
3311 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
3312 (yytname_): Use b4_typed_parser_table.
3313 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
3314 ``code too large'' error.
3315
3316 2008-11-10 Di-an Jan <dianj@freeshell.org>
3317
3318 * NEWS: Document them.
3319
3320 General Java skeleton improvements.
3321 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
3322 using gcj < 4.3 in the testsuite, according to comments in
3323 gnulib/m4/javacomp.m4.
3324 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
3325 location_type, position_type): Remove extraneous brackets from
3326 b4_percent_define_default.
3327 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
3328 m4_define and m4_define_default.
3329 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
3330 which marks the end of user code with appropriate syncline, like all
3331 the other skeletons.
3332 (b4_user_post_prologue): Add. Don't silently drop.
3333 (yylex): Remove.
3334 (parse): Inline yylex.
3335 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
3336 (%{...%}): Fix typo of %code imports.
3337 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
3338
3339 Support annotations on parser class with %define annotations.
3340 * data/lalr1.java (annotations): Add to parser class modifier.
3341 * doc/bison.texinfo (Java Parser Interface): Document
3342 %define annotations.
3343 (Java Declarations Summary): Document %define annotations.
3344 * tests/java.at (Java parser class modifiers): Test annotations.
3345
3346 Do not generate code for %error-verbose unless requested.
3347 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
3348 Make private. Make conditional on %error-verbose.
3349 (getErrorVerbose, setErrorVerbose): New.
3350 (yytnamerr_): Make conditional on %error-verbose.
3351 (yysyntax_error): Make some code conditional on %error-verbose.
3352 * doc/bison.texinfo (Java Bison Interface): Remove the parts
3353 about %error-verbose having no effect.
3354 (getErrorVerbose, setErrorVerbose): Document.
3355
3356 Move constants for token names to Lexer interface.
3357 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
3358 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
3359 (parse): Qualify EOF to Lexer.EOF.
3360 * doc/bison.texinfo (Java Parser Interface): Move documentation of
3361 EOF and token names to Java Lexer Interface.
3362 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
3363
3364 Make yyerror public.
3365 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
3366 (yyerror): Change to public. Add Javadoc comments. Use longer
3367 parameter names. Make the body rather than the declarator
3368 conditional on %locations.
3369 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
3370
3371 Allow user to add code to the constructor with %code init.
3372 * data/java.m4 (b4_init_throws): New, for %define init_throws.
3373 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
3374 Add %code init to the front of the constructor body.
3375 * doc/bison.texinfo (YYParser.YYParser): Document %code init
3376 and %define init_throws.
3377 (Java Declarations Summary): Document %code init and
3378 %define init_throws.
3379 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
3380 (Java constructor init and init_throws): Add tests.
3381
3382 2008-11-10 Akim Demaille <demaille@gostai.com>
3383
3384 Update TODO.
3385 * TODO (-D): is implemented.
3386 (associativity): Same precedence must have the same associativity.
3387 For instance, how can a * b / c be parsed if * is %left and / is
3388 %right?
3389 (YYERRORCODE, YYFAIL, YYBACKUP): New.
3390
3391 2008-11-10 Akim Demaille <demaille@gostai.com>
3392
3393 Formatting changes.
3394
3395 2008-11-10 Akim Demaille <demaille@gostai.com>
3396
3397 More information about the symbols.
3398 * src/output.c (type_names_output): Document all the symbols,
3399 including those that don't have a type-name.
3400 (symbol_definitions_output): Define "is_token" and
3401 "has_type_name".
3402 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
3403 type-name, now that they are defined too in b4_type_names.
3404
3405 2008-11-10 Akim Demaille <demaille@gostai.com>
3406
3407 Regen.
3408
3409 2008-11-10 Akim Demaille <demaille@gostai.com>
3410
3411 Make parser::yytranslate static.
3412 Small speedup (1%) on the list grammar. And makes yytranslate_
3413 available in non member functions.
3414
3415 * data/lalr1.cc (yytranslate_): Does not need to be a instance
3416 function.
3417
3418 2008-11-10 Akim Demaille <demaille@gostai.com>
3419
3420 Avoid trailing spaces.
3421 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
3422 * data/lalr1.cc: Don't indent before rule and symbol actions, as
3423 they can be empty, and anyway this incorrectly indents the first
3424 action.
3425
3426 2008-11-10 Akim Demaille <demaille@gostai.com>
3427
3428 Comment changes.
3429
3430 2008-11-10 Akim Demaille <demaille@gostai.com>
3431
3432 Use "enum" for integral constants.
3433 This is just nicer to read, I observed no speedup.
3434
3435 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
3436 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
3437 (yyuser_token_number_max_, yyundef_token_): Move into...
3438 (yytranslate_): here.
3439
3440 2008-11-10 Akim Demaille <demaille@gostai.com>
3441
3442 Shortcuts in bench directives.
3443 * etc/bench.pl.in (parse_dirs): New.
3444 Use it.
3445 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
3446 Create the benches in "benches/".
3447
3448 2008-11-10 Akim Demaille <demaille@gostai.com>
3449
3450 Formatting changes.
3451 * data/lalr1.cc: here.
3452
3453 2008-11-10 Akim Demaille <demaille@gostai.com>
3454
3455 Adjust verbose message to using emacs.
3456 * etc/bench.pl.in: Inform compilation-mode when we change the
3457 directory.
3458 (generate_grammar_list): Recognize %define "variant" in addition
3459 to %define variant.
3460
3461 2008-11-10 Akim Demaille <demaille@gostai.com>
3462
3463 Classify symbols by type-name.
3464 * src/uniqstr.h (UNIQSTR_CMP): New.
3465 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
3466 (type_names_output): New.
3467 (muscles_output): Use it.
3468 * data/lalr1.cc (b4_symbol_action_): Remove.
3469 (b4_symbol_case_, b4_type_action_): New.
3470 Adjust uses of b4_symbol_action_ to use b4_type_action_.
3471
3472 2008-11-10 Akim Demaille <demaille@gostai.com>
3473
3474 Change the handling of the symbols in the skeletons.
3475 Before we were using tables which lines were the symbols and which
3476 columns were things like number, tag, type-name etc. It is was
3477 difficult to extend: each time a column was added, all the numbers had
3478 to be updated (you asked for colon $2, not for "tag"). Also, it was
3479 hard to filter these tables when only a subset of the symbols (say the
3480 tokens, or the nterms, or the tokens that have and external number
3481 *and* a type-name) was of interest.
3482
3483 Now instead of monolithic tables, we define one macro per cell. For
3484 instance "b4_symbol(0, tag)" is a macro name which contents is
3485 self-decriptive. The macro "b4_symbol" provides easier access to
3486 these cells.
3487
3488 * src/output.c (type_names_output): Remove.
3489 (symbol_numbers_output, symbol_definitions_output): New.
3490 (muscles_output): Call them.
3491 (prepare_symbols): Define b4_symbols_number.
3492
3493 2008-11-10 Akim Demaille <demaille@gostai.com>
3494
3495 --trace=muscles
3496 * src/getargs.h, src/getargs.c (trace_muscle): New.
3497 (trace_types, trace_args): Support it.
3498 * src/output.c (output_skeleton): Use it.
3499
3500 2008-11-10 Akim Demaille <demaille@gostai.com>
3501
3502 muscles_output.
3503 * src/output.c (muscles_output): New, extracted from...
3504 (output_skeleton): here.
3505 Adjust.
3506
3507 2008-11-10 Akim Demaille <demaille@gostai.com>
3508
3509 Formatting changes.
3510
3511 2008-11-10 Akim Demaille <demaille@gostai.com>
3512
3513 Update the variant example.
3514 * examples/variant.yy: Formatting changes.
3515 One stage build.
3516
3517 2008-11-10 Akim Demaille <demaille@gostai.com>
3518
3519 Support constructor with an argument.
3520 This improves the "list" bench by 2%.
3521
3522 * data/lalr1.cc (variant::build): Add an overloaded version with
3523 an argument.
3524 * tests/c++.at (AT_CHECK_VARIANT): Check it.
3525
3526 2008-11-10 Akim Demaille <demaille@gostai.com>
3527
3528 Test variants.
3529 * tests/c++.at (AT_CHECK_VARIANTS): New.
3530 Use it with and without %define assert.
3531
3532 2008-11-10 Akim Demaille <demaille@gostai.com>
3533
3534 Add %precedence support.
3535 Unfortunately it is not possible to reuse the %prec directive. This
3536 is because to please POSIX, we do not require to end the rules with a
3537 semicolon. As a result,
3538
3539 foo: bar %prec baz
3540
3541 is ambiguous: either a rule which precedence is that of baz, or a rule,
3542 and then a declaration of the precedence of the token baz.
3543
3544 * doc/bison.texinfo: Document %precedence.
3545 (Precedence Only): New.
3546 * src/assoc.h, src/assoc.c (precedence_assoc): New.
3547 * src/conflicts.c (resolve_sr_conflict): Support it.
3548 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
3549 Parse it.
3550 * tests/calc.at: Use %precedence for NEG.
3551 * tests/conflicts.at (%precedence does not suffice)
3552 (%precedence suffices): New tests.
3553
3554 2008-11-09 Akim Demaille <demaille@gostai.com>
3555
3556 Make benches in a sub dirs.
3557 * etc/bench.pl.in ($dir): New.
3558 Use it.
3559 Check the use of constructors with an argument.
3560 (bench_variant_parser): Fix.
3561
3562 2008-11-09 Akim Demaille <demaille@gostai.com>
3563
3564 fix eof condition
3565
3566 2008-11-09 Akim Demaille <demaille@gostai.com>
3567
3568 Fix --help.
3569
3570 2008-11-09 Akim Demaille <demaille@gostai.com>
3571
3572 Require the generation of parse-gram.output.
3573 * src/Makefile.am (YACC): Pass --report=all.
3574
3575 2008-11-09 Akim Demaille <demaille@gostai.com>
3576
3577 Formatting changes.
3578
3579 2008-11-09 Akim Demaille <demaille@gostai.com>
3580
3581 Update TODO.
3582 * TODO: Remove obsolete items.
3583 Update others.
3584
3585 2008-11-09 Akim Demaille <demaille@gostai.com>
3586
3587 Enhance bench.pl.
3588 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
3589 (@token, $grammar, $bench): New.
3590 (generate_grammar_variant): Rename as...
3591 (generate_grammar_list): this.
3592 (generate_grammar): Adjust.
3593 (bench_grammar): Rename as...
3594 (bench): this.
3595 Use it in the various bench-marking routines.
3596 (-b, -g): New options.
3597
3598 2008-11-09 Akim Demaille <demaille@gostai.com>
3599
3600 Use a static hierarchy for symbols in the C++ parser.
3601 * data/lalr1.cc (symbol_base_type, symbol_type)
3602 (stack_symbol_type): Make it a static hierarchy.
3603 Adjust dependencies.
3604
3605 2008-11-09 Akim Demaille <demaille@gostai.com>
3606
3607 bench.pl -d, --directive.
3608 * etc/bench.pl.in (@directive): New.
3609 (&bench_grammar): Use it.
3610 (&bench_list_grammar): New, to provide access to the "variant"
3611 grammar.
3612 Use it.
3613 (getopts): Support -d, --directive.
3614
3615 2008-11-09 Akim Demaille <demaille@gostai.com>
3616
3617 Use inline for small operations.
3618 * data/lalr1.cc (symbol_base_type, symbol_type)
3619 (stack_symbol_type): Declare constructor and other operations as
3620 inline.
3621 (yy_destroy_): Inline.
3622
3623 2008-11-09 Akim Demaille <demaille@gostai.com>
3624
3625 Introduce a hierarchy for symbols.
3626 * data/lalr1.cc (symbol_base_type, symbol_type): New.
3627 (data_type): Rename as...
3628 (stack_symbol_type): this.
3629 Derive from symbol_base_type.
3630 (yy_symbol_value_print_): Merge into...
3631 (yy_symbol_print_): this.
3632 Rename as...
3633 (yy_print_): this.
3634 (yydestruct_): Rename as...
3635 (yy_destroy_): this.
3636 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
3637 (parser::parse): yyla is now of symbol_type.
3638 Use its type member instead of yytoken.
3639
3640 2008-11-09 Akim Demaille <demaille@gostai.com>
3641
3642 Rename data_type and stack_symbol_type.
3643 * data/lalr1.cc (data_type): Rename as...
3644 (stack_symbol_type): this.
3645
3646 2008-11-09 Akim Demaille <demaille@gostai.com>
3647
3648 Handle semantic value and location together.
3649 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
3650 yydata.value and yydata.location.
3651 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
3652 (YY_SYMBOL_PRINT): Now take semantic value and location as a
3653 single arg.
3654 Adjust all callers.
3655 (yydestruct_): New overload for a stack symbol.
3656
3657 2008-11-09 Akim Demaille <demaille@gostai.com>
3658
3659 Push a complete symbol, not connected parts.
3660 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
3661 state, value and location.
3662 Adjust callers.
3663
3664 2008-11-09 Akim Demaille <demaille@gostai.com>
3665
3666 Agregate yylval and yylloc.
3667 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
3668 (parser::yyla): this.
3669
3670 2008-11-09 Akim Demaille <demaille@gostai.com>
3671
3672 Rely on the state stack to display reduction traces.
3673 To display rhs symbols before a reduction, we used information
3674 about the rule reduced, which required the tables yyrhs and
3675 yyprhs. Now use rely only on the state stack to get the same
3676 information.
3677
3678 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
3679 Use them.
3680 (parser::yyrhs_, parser::yyprhs_): Remove.
3681 (parser::yy_reduce_print_): Use the state stack.
3682
3683 2008-11-09 Akim Demaille <demaille@gostai.com>
3684
3685 Fuse yyval and yyloc into yylhs.
3686 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
3687 yylhs.
3688 (parse): Replace yyval and yyloc with yylhs.value and
3689 yylhs.location.
3690 After a user action, compute yylhs.state earlier.
3691 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
3692 fresh error_token.
3693
3694 2008-11-09 Di-an Jan <dianj@freeshell.org>
3695
3696 Remove unused variable.
3697 * src/output.c (type_names_output): Remove unused variable sep.
3698
3699 2008-11-09 Paolo Bonzini <bonzini@gnu.org>
3700
3701 Change tests/output.at quoting.
3702 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
3703 expanding arguments.
3704
3705 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3706
3707 Don't add a semicolon to actions for %skeleton or %language.
3708 It breaks Java test cases as reported by Akim Demaille.
3709 * src/scan-code.l: Implement.
3710
3711 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3712
3713 Clean up %skeleton and %language priority implementation.
3714 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
3715 remove static qualifier because others will soon need to see it.
3716 (language_prio): Likewise.
3717 (getargs): Use command_line_prio rather than 0.
3718 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
3719 enum fields.
3720 (skeleton_prio): Extern it.
3721 (language_prio): Extern it.
3722 * src/parse-gram.y: Use grammar_prio rather than 1.
3723
3724 2008-11-07 Akim Demaille <demaille@gostai.com>
3725
3726 Moving push traces into yypush_.
3727 * data/lalr1.cc (yypush_): Now takes a optional trace message.
3728 Adjust all uses.
3729
3730 2008-11-07 Akim Demaille <demaille@gostai.com>
3731
3732 The single-stack C++ parser is now the standard one.
3733 * data/lalr1.cc: Rename as...
3734 * data/lalr1-split.cc: this.
3735 * data/lalr1-fusion.cc: Rename as...
3736 * data/lalr1.cc: this.
3737 * etc/bench.pl.in: Adjust.
3738
3739 2008-11-07 Akim Demaille <demaille@gostai.com>
3740
3741 Avoid empty-if warnings.
3742 Reported by Quentin Hocquet.
3743
3744 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
3745 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
3746
3747 2008-11-07 Akim Demaille <demaille@gostai.com>
3748
3749 Pass command line location to skeleton_arg and language_argmatch.
3750 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
3751 The location argument is now mandatory.
3752 Adjust all dependencies.
3753 (getargs): Use command_line_location.
3754
3755 2008-11-07 Akim Demaille <demaille@gostai.com>
3756
3757 -D, --define.
3758 * src/getargs.c (usage): Document -D.
3759 Fix help string for --locations.
3760 (command_line_location): New.
3761 (short_options, long_options, getargs): Support -D, --define.
3762 (getargs): Move -d support at the right place.
3763 * doc/bison.texinfo (Bison Options): Update.
3764 * tests/input.at (%define, --define): New.
3765
3766 2008-11-07 Akim Demaille <demaille@gostai.com>
3767
3768 Initialize the muscle table before parsing the command line.
3769 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
3770 (getargs): Define file_name.
3771 * src/main.c (main): Initialize muscle_tab before calling
3772 getargs.
3773 * src/muscle_tab.c (muscle_init): No longer define file_name, as
3774 its value is not available yet.
3775
3776 2008-11-07 Akim Demaille <demaille@gostai.com>
3777
3778 Locations without columns for command line arguments.
3779 * src/location.c (location_print): Don't display negative columns.
3780 * src/location.h: Document this.
3781
3782 2008-11-07 Akim Demaille <demaille@gostai.com>
3783
3784 Fix --help.
3785 * src/getargs.c (usage): Fix help string for -W.
3786
3787 2008-11-07 Akim Demaille <demaille@gostai.com>
3788
3789 Handle more general types of option arguments.
3790 * build-aux/cross-options.pl: The argument ends at the first
3791 space, not the first non-symbol character.
3792 Use @var for each word appearing the argument description.
3793
3794 2008-11-07 Akim Demaille <demaille@gostai.com>
3795
3796 Destroy the variants that remain on the stack in case of error.
3797 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
3798 destructor.
3799 Display the value only if yymsg is nonnull.
3800 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
3801
3802 2008-11-07 Akim Demaille <demaille@gostai.com>
3803
3804 Add "%define assert" to variants.
3805 This is used to help the user catch cases where some value gets
3806 ovewritten by a new one. This should not happen, as this will
3807 probably leak.
3808
3809 Unfortunately this uncovered a bug in the C++ parser itself: the
3810 lookahead value was not destroyed between two calls to yylex. For
3811 instance if the previous lookahead was a std::string, and then an int,
3812 then the value of the std::string was correctly taken (i.e., the
3813 lookahead was now an empty string), but std::string structure itself
3814 was not reclaimed.
3815
3816 This is now done in variant::build(other&) (which is used to take the
3817 value of the lookahead): other is not only stolen from its value, it
3818 is also destroyed. This incurs a new performance penalty of a few
3819 percent, and union becomes faster again.
3820
3821 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
3822 (b4_variant_if): New.
3823 (variant::built): New.
3824 Use it whereever the status of the variant changes.
3825 * etc/bench.pl.in: Check the penalty of %define assert.
3826
3827 2008-11-07 Akim Demaille <demaille@gostai.com>
3828
3829 Use "%define variant" in bench.pl.
3830 * etc/bench.pl.in: No longer use the pseudo directive %variants,
3831 just use %define variants.
3832
3833 2008-11-07 Akim Demaille <demaille@gostai.com>
3834
3835 Regen.
3836 * src/parse-gram.h, src/parse-gram.c: Regen.
3837
3838 2008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
3839
3840 Fix user actions without a trailing semicolon.
3841 Reported by Sergei Steshenko at
3842 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
3843 * THANKS (Sergei Steshenko): Add.
3844 * src/scan-code.l (SC_RULE_ACTION): Fix it.
3845 * tests/regression.at (Fix user actions without a trailing semicolon):
3846 New test case.
3847
3848 2008-11-04 Akim Demaille <demaille@gostai.com>
3849
3850 Use b4_copyright_years.
3851 * data/yacc.c (b4_copyright_years): New.
3852 Fix its value according to the comments in the file.
3853 Use it and undefine it.
3854
3855 2008-11-04 Akim Demaille <demaille@gostai.com>
3856
3857 Formatting changes.
3858 * data/lalr1-fusion.cc, src/parse-gram.y: here.
3859
3860 2008-11-04 Akim Demaille <demaille@gostai.com>
3861
3862 Formatting changes.
3863 * data/lalr1-fusion.cc: here.
3864
3865 2008-11-04 Akim Demaille <demaille@gostai.com>
3866
3867 Use strict on bench.pl.
3868 * etc/bench.pl.in (&run, &generate_grammar): New.
3869 Rename the grammar generating functions for consistency.
3870 Change the interface so that the list of benches to run is passed
3871 as (optionless) arguments.
3872 (&compile): Use &run.
3873
3874 2008-11-04 Akim Demaille <demaille@gostai.com>
3875
3876 Remove spurious initial empty lines.
3877 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
3878 * data/yacc.c: End the @output lines with an @.
3879
3880 2008-11-04 Akim Demaille <demaille@gostai.com>
3881
3882 Improve the display of sizes.
3883 * etc/bench.p.in: Higher precision.
3884 Sort by decreasing size.
3885
3886 2008-11-04 Akim Demaille <demaille@gostai.com>
3887
3888 Don't memcpy C++ structures.
3889 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
3890 arguments.
3891 (variant::build): New overload for
3892 copy-construction-that-destroys.
3893 (variant::swap): New.
3894 (parser::yypush_): Use it in variant mode.
3895
3896 2008-11-04 Akim Demaille <demaille@gostai.com>
3897
3898 Better defaults for bench.pl.
3899 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
3900 default values.
3901 Adjust &verbose uses.
3902 (-q, --quiet): New.
3903
3904 2008-11-04 Akim Demaille <demaille@gostai.com>
3905
3906 Make variant.yy more complex.
3907 std::list cannot be copied via memcpy, they are more demanding than
3908 std::string. Use one std::list to strengthen the test.
3909
3910 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
3911 Adjust.
3912 Create a list of strings, instead of a single large string.
3913
3914 2008-11-04 Akim Demaille <demaille@gostai.com>
3915
3916 bench.pl --bench.
3917 * etc/bench.pl.in (--bench, $bench): New.
3918
3919 2008-11-04 Akim Demaille <demaille@gostai.com>
3920
3921 Sort methods.
3922 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
3923 Define it after as().
3924
3925 2008-11-04 Akim Demaille <demaille@gostai.com>
3926
3927 Useless parens.
3928 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
3929
3930 2008-11-04 Akim Demaille <demaille@gostai.com>
3931
3932 Issue missing synclines after user actions.
3933 * data/c.m4 (b4_case): Issue synclines on the output file.
3934
3935 2008-11-04 Akim Demaille <demaille@gostai.com>
3936
3937 Remove trailing empty line.
3938 * data/lalr1-fusion.cc: Don't add an empty line after the user's
3939 epilogue.
3940
3941 2008-11-04 Akim Demaille <demaille@gostai.com>
3942
3943 Fix output of copyright years.
3944 * data/bison.m4 (b4_copyright): Fix the indentation of the
3945 copyright year paragraph.
3946 Use b4_copyright_years when no years are given.
3947 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
3948 (b4_copyright_years): New.
3949 Use it.
3950
3951 2008-11-04 Akim Demaille <demaille@gostai.com>
3952
3953 Avoid the spurious initial empty line.
3954 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
3955 the end of @output request to suppress the empty line that
3956 results.
3957
3958 2008-11-04 Akim Demaille <demaille@gostai.com>
3959
3960 Remove parser::rhs_number_type.
3961 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
3962 (yyrhs_): Use b4_table_define.
3963
3964 2008-11-04 Akim Demaille <demaille@gostai.com>
3965
3966 Fix iteration type.
3967 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
3968
3969 2008-11-04 Akim Demaille <demaille@gostai.com>
3970
3971 Factor the declaration of the integer tables.
3972 * data/lalr1-fusion.cc (b4_table_define): New.
3973 Use it.
3974
3975 2008-11-03 Akim Demaille <demaille@gostai.com>
3976
3977 Fix indentation of tables in lalr1.cc
3978 * data/lalr1-fusion.cc: Fix the indentation.
3979
3980 2008-11-03 Akim Demaille <demaille@gostai.com>
3981
3982 Destroy the lhs symbols after reduction.
3983 * data/lalr1-fusion.cc (parse): After the user action, when in
3984 variant mode, destroy the lhs symbols.
3985
3986 2008-11-03 Akim Demaille <demaille@gostai.com>
3987
3988 Simplify yysyntax_error_ use.
3989 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
3990 type, but make it unnamed in the declaration when it is not used.
3991
3992 2008-11-03 Akim Demaille <demaille@gostai.com>
3993
3994 Let yy::variant::build return an lvalue.
3995 * data/lalr1-fusion.cc (variant::build): Return a reference to the
3996 object.
3997
3998 2008-11-03 Akim Demaille <demaille@gostai.com>
3999
4000 Define yy::variant only when needed.
4001 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
4002 used.
4003
4004 2008-11-03 Akim Demaille <demaille@gostai.com>
4005
4006 Bench the three-stack lalr1.cc.
4007 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
4008 one-stack one.
4009
4010 2008-11-03 Akim Demaille <demaille@gostai.com>
4011
4012 Fail on parse error in calc++.
4013 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
4014 status.
4015 * examples/calc++/test ($me, $number, $exit, run): New.
4016 Use them to propagate errors to the exit status.
4017
4018 2008-11-03 Akim Demaille <demaille@gostai.com>
4019
4020 Don't specify the skeleton twice in the example.
4021 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
4022 file does what is needed.
4023
4024 2008-11-03 Akim Demaille <demaille@gostai.com>
4025
4026 bench: Improve output.
4027 * etc/bench.pl.in (bench_grammar): Tune the printf format.
4028
4029 2008-11-03 Akim Demaille <demaille@gostai.com>
4030
4031 bench: check impact of %debug on variants.
4032 * etc/bench.pl.in (variant_grammar): Fix the computation of
4033 $variant.
4034 Generate a grammar file that can work with or without %debug.
4035 Do use the @directive.
4036 (bench_variant_parser): Check impact of %debug.
4037 (@directives): Rename all the occurrences to...
4038 (@directive): this, for consistency.
4039
4040 2008-11-03 Akim Demaille <demaille@gostai.com>
4041
4042 bench: report the size too.
4043 * etc/bench.pl.in ($iterations): Defaults to -3.
4044 (&bench_grammar): Require hireswallclock.
4045 Compute and display the size of the result.
4046 More comments.
4047
4048 2008-11-03 Akim Demaille <demaille@gostai.com>
4049
4050 bench: More use of the verbosity level.
4051 * etc/bench.pl.in ($verbose, &verbose): New.
4052 Use them.
4053 More POD documentation.
4054
4055 2008-11-03 Akim Demaille <demaille@gostai.com>
4056
4057 bench.pl: a command line interface
4058 * etc/bench.pl.in: More doc.
4059 Some fixes in the documentation.
4060 ($cflags, $iterations, &help, &getopt): New.
4061 Use them.
4062 (&variant_grammar): Let the number of stages be 10 times what is
4063 specified.
4064
4065 2008-11-03 Akim Demaille <demaille@gostai.com>
4066
4067 Bench the use of Boost.Variants.
4068 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
4069 New.
4070 (&compile): Be ready to compile C++ parsers.
4071 (&bench_push_parser): Move debug information to the outermost
4072 level.
4073 * THANKS: Add Michiel De Wilde.
4074
4075 2008-11-03 Akim Demaille <demaille@gostai.com>
4076
4077 bench.pl: Pass directives as a list instead of as a string.
4078 * etc/bench.pl.in (&directives): New.
4079 (&triangular_grammar, &calc_grammar): Use it to format the Bison
4080 directives.
4081 (&triangular_grammar): Do use the directives (were ignored).
4082 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
4083 directives.
4084
4085 2008-11-03 Akim Demaille <demaille@gostai.com>
4086
4087 Improve genericity of bench.pl.
4088 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
4089 argument.
4090 (&bench_push_parser): New.
4091 Call it.
4092
4093 2008-11-03 Akim Demaille <demaille@gostai.com>
4094
4095 Add documentation to bench.pl.
4096 * etc/bench.pl.in: Comment changes.
4097
4098 2008-11-03 Akim Demaille <demaille@gostai.com>
4099
4100 Fuse the three stacks into a single one.
4101
4102 In order to make it easy to perform benchmarks to ensure that
4103 there are no performance loss, lalr1.cc is forked into
4104 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
4105 lalr1.cc.
4106
4107 Meanwhile, to make sure that lalr1-fusion.cc is correctly
4108 exercized by the test suite, the user must install a symbolic link
4109 from lalr1.cc to it.
4110
4111 Instead of having three stacks (state, value, location), use a
4112 stack of triples. This considerably simplifies the code (and it
4113 will be easier not to require locations as currently does the C++
4114 parser), and also gives a 10% speedup according to
4115 etc/bench (probably mainly since memory allocation is done once
4116 instead of three times).
4117
4118 Another motivation is to make it easier to destruct properly
4119 semantic values: now that they are bound to their state (hence
4120 symbol type) it will be easier to call the appropriate destructor.
4121
4122 These changes should probably benefit the C parser too.
4123
4124 * data/lalr1.cc: Copy as...
4125 * data/lalr1-fusion.cc: this new file.
4126 (b4_rhs_value, b4_rhs_location): New definitions overriding those
4127 from c++.m4.
4128 (state_stack_type, semantic_stack_type, location_stack_type)
4129 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
4130 (data_type, stack_type, yystack_): New.
4131 (YYLLOC_DEFAULT, yypush_): Adjust.
4132 (yyerror_range): Now based on data_type, not location_type.
4133
4134 2008-11-03 Akim Demaille <demaille@gostai.com>
4135
4136 Push the state, value, and location at the same time.
4137 This is needed to prepare a forthcoming patch that fuses the three
4138 stacks into one.
4139
4140 * data/lalr1.cc (parser::yypush_): New.
4141 (parser::yynewstate): Change the semantics: instead of arriving to
4142 this label when value and location have been pushed, but yystate
4143 is to be pushed on the state stack, now the three of them must
4144 have been pushed before. yystate still must be the new state.
4145 This allows to use yypush_ everywhere instead of individual
4146 handling of the stacks.
4147
4148 2008-11-03 Akim Demaille <demaille@gostai.com>
4149
4150 Prefer references to pointers.
4151 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
4152 definition to use references instead of pointers.
4153 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
4154 Take the value and location as references.
4155 Adjust callers.
4156
4157 2008-11-03 Akim Demaille <demaille@gostai.com>
4158
4159 stack::size instead of stack::height.
4160 * data/lalr1.cc (stack::height): Rename as...
4161 (stack::size): this.
4162 Fix the output type.
4163 Comment changes.
4164
4165 2008-11-03 Akim Demaille <demaille@gostai.com>
4166
4167 Use variants to support objects as semantic values.
4168 This patch was inspired by work by Michiel De Wilde. But he used
4169 Boost variants which (i) requires Boost on the user side, (ii) is
4170 slow, and (iii) has useless overhead (the parser knows the type of
4171 the semantic value there is no reason to duplicate this
4172 information as Boost.Variants do).
4173
4174 This implementation reserves a buffer large enough to store the
4175 largest objects. yy::variant implements this buffer. It was
4176 implemented with Quentin Hocquet.
4177
4178 * src/output.c (type_names_output): New.
4179 (output_skeleton): Invoke it.
4180 * data/c++.m4 (b4_variant_if): New.
4181 (b4_symbol_value): If needed, provide a definition for variants.
4182 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
4183 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
4184 (b4_char_sizeof, yy::variant): New.
4185 (parser::parse): If variants are requested, define
4186 parser::union_type, parser::variant, change the definition of
4187 semantic_type, construct $$ before running the user action instead
4188 of performing a default $$ = $1.
4189 * examples/variant.yy: New.
4190 Based on an example by Michiel De Wilde.
4191
4192 2008-11-03 Akim Demaille <demaille@gostai.com>
4193
4194 Parameterize the extraction of semantic values.
4195 To make future changes easier, no longer rely on ".TYPE" being the
4196 way to get a semantic value.
4197
4198 * data/c.m4 (b4_symbol_value): New.
4199 Use it.
4200 * data/c++.m4, data/yacc.c: Use it.
4201 * data/glr.c: Use b4_symbol_value.
4202 (b4_rhs_data): New.
4203 Use it.
4204
4205 2008-11-03 Akim Demaille <demaille@gostai.com>
4206
4207 Prepare easier M4 changes.
4208 * data/lalr1.cc: Use escaped [] instead of literals to prepare
4209 future changes.
4210
4211 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4212
4213 Initiate further development.
4214 * NEWS: Create an empty section for new entries.
4215 * gnulib: Update submodule to HEAD.
4216
4217 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4218
4219 * NEWS: Version 2.4.
4220
4221 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4222
4223 Prepare for next release.
4224 * NEWS: Briefly mention changes since 2.3b.
4225 * README: Say GNU m4 1.4.6, which we've been requiring in release
4226 announcements already, not 1.4.3, which breaks the build.
4227
4228 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4229
4230 Say %language is experimental.
4231 We're thinking of extending it's effect on output file naming. See the
4232 thread at
4233 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
4234 * NEWS: Say it's experimental.
4235 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
4236 recommend it over %skeleton for now.
4237 (Bison Options): Likewise.
4238 (C++ Bison Interface): Use %skeleton not %language.
4239 (Calc++ Parser): Use %skeleton not %language.
4240 * src/getargs.c (usage): Say it's experimental.
4241
4242 2008-11-01 Di-an Jan <dianj@freeshell.org>
4243 Paolo Bonzini <bonzini@gnu.org>
4244
4245 Support all Java parser class modifiers.
4246 * data/java.m4 (b4_percent_define_get3): New.
4247 (b4_final_if, b4_strictfp_if): New.
4248 * data/lalr1.java (final, strictfp, extends, implements): Support.
4249 * doc/bison.texinfo (final, strictfp, extends, implements): Add
4250 documentation.
4251 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
4252 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
4253 (AT_CHECK_JAVA_GREP): New.
4254 (Java parser class modifiers): New test.
4255 (Java parser class extends and implements): New test.
4256
4257 Model exception propagation better with throws and lex_throws.
4258 * data/java.m4 (b4_list2): New.
4259 (throws): Change default.
4260 * data/lalr1.java (yyaction): Add throws.
4261 (parse): Add lex_throws in addition to throws.
4262 * doc/bison.texinfo (throws, lex_throws): Add documentation.
4263 * tests/java.at (Java throws specifications): New test.
4264
4265 Improve documentation for Java parsers.
4266 * doc/bison.texinfo (Java Parsers): Add subsections.
4267 Don't quote first argument of %define.
4268 (Java Bison Interface): Document output files. Move documentation
4269 of parser class and merge into Java Parser Interface. Document
4270 features that error out. Document directives with no effect.
4271 Move note about Javadoc higher.
4272 (Java Semantic Values): Explicitly mention stype.
4273 Document that generic types cannot be used.
4274 (Java Location Values): Use @deftypeivar. Document constructors.
4275 Correct return value for toString.
4276 (Java Parser Interface): List undocumented constants/fields.
4277 Move documentation of fields added by %parse-param closer to list
4278 of members. Document that token names are added as fields.
4279 Document constructors accurately. Remove error method.
4280 (Java Scanner Interface): Move note on %pure-parser to Java Bison
4281 Interface. Describe %code lexer and yylex accutately.
4282 Remove documentation that does not match the code.
4283 (Java Action Features): New.
4284 (Java Differences): Add reference. Add item on semantic values.
4285 Add note about @{ ... @}. Clarify %% epilogue placement.
4286 (Java Declarations Summary): New.
4287
4288 Fix Java skeleton.
4289 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
4290 (b4_remove_comma): Quote test argument.
4291 (b4_identification): Remove "bison" field.
4292 * tests/java.at (Java parser class and package names): New test.
4293 (Java %parse-param and %lex-param): New test.
4294 (Java stype, position_class and location_class): New test.
4295
4296 2008-10-31 Di-an Jan <dianj@freeshell.org>
4297
4298 * data/lalr1.jave: Update copyright years.
4299 (YYParser): Correct name of "generated from" file in Javadoc:
4300 use b4_file_name instead of @ofile@.
4301 (Location constructor): Correct Javadoc parameter name.
4302 (yylloc): Add missing opening m4 quote after b4_location_if.
4303 This removes a stray [ in the Javadoc of Lexer.getStartPos.
4304 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
4305 (YYParser constructor): Correct Javadoc parameter name.
4306
4307 2008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
4308
4309 Always put auxiliary code files in the same dir as other output files.
4310 * src/files.c (compute_file_name_parts): When the user specifies
4311 --output but not --file-prefix, extract the directory prefix from the
4312 file prefix not from the grammar file name. This affects the location
4313 of files like location.hh generated by the C++ skeleton. The includes
4314 in the other output files require this fix.
4315 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
4316 for expected output files.
4317 (Output files): Add a test for the above.
4318
4319 2008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
4320
4321 * gnulib: Update submodule to HEAD.
4322
4323 2008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4324
4325 Update copyright year.
4326 * src/files.c: Here.
4327
4328 2008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
4329
4330 Don't overwrite the input file.
4331 * src/files.c (output_file_name_check): Fatal error if using input file
4332 for output.
4333 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
4334 argument.
4335 (Conflicting output files): Add test.
4336
4337 2008-10-28 Akim Demaille <demaille@gostai.com>
4338
4339 Space changes.
4340 * data/lalr1.cc: Formatting changes.
4341
4342 2008-10-28 Akim Demaille <demaille@gostai.com>
4343
4344 Don't define debugging functions when !YYDEBUG.
4345 * data/lalr1.cc (debug_stream, set_debug_stream)
4346 (debug_level_type, debug_level, set_debug_level): Don't
4347 declare them when YYDEBUG is not defined.
4348 The implementation are already YYDEBUG-aware.
4349
4350 2008-10-28 Akim Demaille <demaille@gostai.com>
4351
4352 Prefer "continue" for empty loop bodies.
4353 * etc/bench.pl.in: Use "continue" instead of {}.
4354
4355 2008-10-28 Akim Demaille <demaille@gostai.com>
4356
4357 Space and comments changes.
4358 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
4359 * data/c.m4, data/lalr1.cc: Space changes.
4360
4361 2008-10-28 Akim Demaille <demaille@gostai.com>
4362
4363 Make gnulib a submodule.
4364 * gnulib: New.
4365 * .gitmodules (gnulib): New.
4366
4367 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4368
4369 Fix yyerror_range for user-defined location type in C++. Reported by
4370 Georg Sauthoff at
4371 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
4372 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
4373 * THANKS (Georg Sauthoff): Add.
4374
4375 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4376
4377 Update several administrative files mainly to facilitate releasing.
4378 * HACKING (Administrivia): Make the git-merge-changelog notes more
4379 helpful.
4380 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
4381 (Release Procedure): Update for git and add numerous details that were
4382 previously missing.
4383 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
4384 * maint.mk (announcement): Don't list bison as a bootstrap tool so
4385 that announcements don't claim we bootstrapped with whatever bison
4386 happened to be in PATH. Add flex as a bootstrap tool.
4387 * Makefile.maint: Remove, previously replaced by maint.mk.
4388 * Makefile.cfg: Remove, and migrate settings to...
4389 * cfg.mk: ... here for the sake of `make announcement'.
4390 * bootstrap.conf (gnulib_modules): Add announce-gen.
4391 * README: Say GNU Bison instead of just Bison. Suggested by Karl
4392 Berry.
4393
4394 2008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
4395
4396 Small but important bugfixes for the Java skeleton.
4397 * data/lalr1.java (yyerror): Change Location to b4_location_type.
4398 (yy_symbol_print): Call toString on yyvaluep.
4399
4400 2008-08-29 Akim Demaille <demaille@gostai.com>
4401
4402 Clarify UPDATED use.
4403 * doc/bison.texinfo: It refers to the last edition of this file,
4404 not to the release date of Bison.
4405 Reported by Joel E. Denny.
4406
4407 2008-08-29 Akim Demaille <demaille@gostai.com>
4408
4409 * README: Update FAQ pointer.
4410 Reported by Joel E. Denny.
4411
4412 2008-08-27 Eric Blake <ebb9@byu.net>
4413
4414 Resync m4sugar from autoconf.
4415 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
4416 (m4_init): Adjust to latest m4.git changes.
4417 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
4418 effects.
4419 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
4420 (_m4_list_cmp): Reduce side effects.
4421
4422 2008-08-27 Akim Demaille <demaille@gostai.com>
4423
4424 Check yyerrok in calc.at.
4425 * tests/calc.at (calc.y): Use yyerrok on "( error )".
4426 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
4427 expected.
4428
4429 2008-08-27 Akim Demaille <demaille@gostai.com>
4430
4431 Support yyerrok in lalr1.cc.
4432 YYBACKUP is still to import back into lalr1.cc.
4433 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
4434
4435 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4436
4437 For maintainer-check*, don't recompile for a $(VERSION) update.
4438 * cfg.mk: New file.
4439 (_is-dist-target): Override the one in GNUmakefile.
4440 * Makefile.am (EXTRA_DIST): Add cfg.mk.
4441
4442 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4443
4444 Update for recent change to gnulib.
4445 * src/parse-gram.y: Don't include strverscmp.h. It comes from
4446 string.h now.
4447
4448 2008-08-15 Eric Blake <ebb9@byu.net>
4449
4450 Remaining m4sugar merge from autoconf.
4451 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
4452 * data/m4sugar/foreach.m4: New file, copied from autoconf.
4453 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
4454 * src/output.c (output_skeleton): Tell m4 how to find it.
4455
4456 Partial m4sugar merge from autoconf: m4_map.
4457 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
4458 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
4459 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
4460 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
4461 for empty list.
4462 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
4463 Likewise.
4464 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
4465 declares it.
4466
4467 2008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
4468
4469 Keep .version and PACKAGE_VERSION in sync.
4470 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
4471 dependency, and add comments justifying this in more detail. Discussed
4472 starting at
4473 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
4474
4475 2008-08-06 Eric Blake <ebb9@byu.net>
4476
4477 Partial m4sugar merge from autoconf: m4_shiftn.
4478 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
4479 (m4_shift2, m4_shift3): New macros.
4480 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
4481 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
4482 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
4483 * data/java.m4 (b4_remove_comma): Likewise.
4484
4485 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
4486 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
4487 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
4488 (m4_init): Consolidate wrapped text into single m4_wrap.
4489 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
4490 in wrapped text.
4491
4492 2008-08-05 Eric Blake <ebb9@byu.net>
4493
4494 Partial m4sugar merge from autoconf: builtins, version.m4.
4495 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
4496 (m4_prepend): Remove, as it is unused and inherently quadratic,
4497 whereas m4_append is linear in newer m4.
4498 (m4_mkstemp): New builtin.
4499 (m4_symbols): Make rename conditional.
4500 (m4_version_prereq): Ensure fatal error if used in bison, which
4501 intentionally lacks version.m4.
4502
4503 Fix comments in m4sugar.
4504 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
4505
4506 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
4507
4508 Update for recent .gitignore fix in Gnulib.
4509 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
4510 anchored .gitignore entries.
4511
4512 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
4513
4514 Set gnu or gnits strictness.
4515 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
4516 development and gnits strictness for releases. Based on Eric Blake's
4517 suggestion at
4518 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
4519
4520 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
4521
4522 * NEWS: Clarify documentation of %language.
4523
4524 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
4525
4526 Support usage of git-merge-changelog.
4527 * .gitattributes: New.
4528 * HACKING: Document usage of git-merge-changelog.
4529 * bootstrap: Install git-merge-changelog entries in .git/config
4530 if appropriate.
4531
4532 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4533
4534 Remove remaining dependence on CVS Id keyword.
4535 * ChangeLog: For the sake of people still using CVS, don't use dollars
4536 when mentioning Id.
4537 * data/xslt/bison.xsl: Remove Id from header comments, where it was
4538 unusual anyway.
4539 * data/xslt/xml2dot.xsl: Likewise.
4540 * data/xslt/xml2text.xsl: Likewise.
4541 * data/xslt/xml2xhtml.xsl: Likewise.
4542 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
4543 * doc/Makefile.am (neutralize): Remove, no longer needed.
4544 (.x.1): Don't use neutralize.
4545 (edit): Don't substitute for ID.
4546 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
4547
4548 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4549
4550 Fix dependence on computed configure variables.
4551 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
4552 $(top_srcdir)/configure.ac so that changes to computed variables, such
4553 as PACKAGE_VERSION, are seen.
4554 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
4555
4556 2008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
4557
4558 Update copyright dates for recent changes.
4559 * Makefile.am: Here.
4560 * src/Makefile.am: Here.
4561 * src/reduce.c: Here.
4562 * tests/reduce.at: Here.
4563
4564 2008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
4565
4566 Use git-version-gen for version names between releases.
4567 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
4568 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
4569 * .prev-version: New.
4570 * .version.in: Remove.
4571 * ChangeLog: Remove the Id previously used for capturing the CVS
4572 revision.
4573 * GNUmakefile: Remove, now copied from Gnulib.
4574 * Makefile.am: Add code suggested by comments in
4575 build-aux/git-version-gen.
4576 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
4577 .prev-version, and .version.
4578 * NEWS (2.3b+): Rename to...
4579 (?.?): ... this because we're dropping the "+" version naming scheme,
4580 but, in general, we still can't be sure of our next release name.
4581 * bootstrap: Add a quick hack to remove from .gitignore the
4582 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
4583 entry. This should really be fixed in gnulib instead.
4584 * bootstrap.conf (gnulib_modules): Add gnumakefile.
4585 * configure.ac (AC_INIT): Set version name by invoking
4586 build-aux/git-version-gen.
4587 (AC_CONFIG_FILES): Remove .version, now generated by
4588 build-aux/git-version-gen.
4589 * maint.mk: New, copied from coreutils.
4590 * doc/.cvsignore (bison.1): Add.
4591 * doc/.gitignore (/bison.1): Add.
4592 * doc/bison.1: Remove, generated.
4593 * src/.cvsignore (revision.c): Remove.
4594 * src/.gitignore (/revision.c): Remove.
4595 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
4596 (BUILT_SOURCES): Remove revision.c.
4597 (revision.c): Remove.
4598 * src/getargs.c (version): Don't print revision after the VERSION.
4599 * src/revision.h: Remove.
4600
4601 2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4602
4603 Fix untranslatable composition of sentences. Reported by Goran
4604 Uddeborg at
4605 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
4606 * THANKS (Goran Uddeborg): Add.
4607 * src/reduce.c (reduce_print): Report the number of nonterminals and
4608 rules useless in the grammar in separate sentences.
4609 * tests/reduce.at (Useless Rules): Update output.
4610 (Reduced Automaton): Likewise.
4611 (Underivable Rules): Likewise.
4612 (Empty Language): Likewise.
4613
4614 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4615
4616 Fix some .gitignore and .cvsignore problems.
4617 * bootstrap (insert_sorted_if_absent): Replace all uses with...
4618 (insert_vc_ignore): ... this new function, which prepends `/' to all
4619 .gitignore entries before passing them to insert_sorted_if_absent.
4620 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
4621 .cvsignore files are maintained even though Bison developers run
4622 bootstrap while using Git.
4623 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
4624 unneeded by Bison.
4625 (gnulib): Add.
4626 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
4627 unneeded. Reported by Eric Blake.
4628 * lib/.gitignore (/*~): Add.
4629 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
4630 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
4631 Blake.
4632 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
4633
4634 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4635
4636 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
4637 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
4638 * bootstrap.conf (gnulib_modules): Add unsetenv.
4639 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
4640 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
4641 (/setenv.m4): Add.
4642 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
4643 the first argument because it may become position-dependent, and unset
4644 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
4645 Add comments explaining these issues in more detail.
4646
4647 2008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
4648
4649 Add .gitignore everywhere based on .cvsignore.
4650 * .gitignore: New.
4651 * build-aux/.gitignore: New.
4652 * data/.gitignore: New.
4653 * doc/.gitignore: New.
4654 * etc/.gitignore: New.
4655 * examples/.gitignore: New.
4656 * examples/calc++/.gitignore: New.
4657 * lib/.gitignore: New.
4658 * m4/.gitignore: New.
4659 * po/.gitignore: New.
4660 * runtime-po/.gitignore: New.
4661 * src/.gitignore: New.
4662 * tests/.gitignore: New.
4663
4664 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4665
4666 * NEWS (2.3b+): New section, empty for now.
4667 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
4668
4669 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4670
4671 * NEWS (2.3b): Update release date since there has been a delay in
4672 getting the announcements and tarballs out.
4673
4674 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
4675
4676 * NEWS: Version 2.3b.
4677 * configure.ac (AC_INIT): Likewise.
4678 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
4679
4680 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
4681
4682 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
4683 been doing it for years.
4684 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
4685 (Release Procedure): Add FIXME about make alpha being unmaintained.
4686
4687 2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
4688
4689 * data/yacc.c: Reformat m4 a little for readability.
4690 * src/lalr.c (build_relations): Correct comment.
4691
4692 2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4693
4694 DJGPP specific issue.
4695 * djgpp/config.sed: Fixes required to run configure scripts generated
4696 by autoconf 2.62.
4697
4698 2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4699
4700 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
4701 coordinator@translationproject.org.
4702
4703 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4704
4705 * THANKS: Add Eric Blake.
4706
4707 2008-04-23 Eric Blake <ebb9@byu.net>
4708
4709 Revert prior patch, by working around autoconf regression.
4710 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
4711 ("Output file name: ("): Uncomment test.
4712 ("Output file name: )"): Likewise.
4713 Based on an idea from Noah Misch.
4714
4715 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4716
4717 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
4718 2.61. Reported by Juan Manuel Guerrero at
4719 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
4720 * tests/output.at ("Output file name: ("): Comment out test case for
4721 now.
4722 ("Output file name: )"): Likewise.
4723
4724 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4725
4726 * GNUmakefile: Update git-version-gen invocation so make dist
4727 succeeds.
4728
4729 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4730
4731 Update to the current gnulib CVS repository, and fix trigraph handling
4732 in Bison.
4733 * bootstrap: Update gnulib CVS repository URL.
4734 (symlink_to_dir): Encapsulate the code that guarantees the destination
4735 directory exists into...
4736 (check_dst_dir): ... this new function, and...
4737 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
4738 fail when copying files into lib/uniwidth/.
4739 * src/output.c (prepare_symbols): When writing yytname muscles, where
4740 symbol names will be encoded in C-string literals, tell quotearg to
4741 escape trigraphs. This used to be the default in gnulib.
4742 * tests/regression.at (Token definitions): Because of the change in
4743 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
4744 escapes trigraphs in symbol names. Thus, yytname no longer has
4745 trigraphs unnecessarily doubly escaped. Update test case output.
4746 Extend test case to be sure Bison's own error messages will no longer
4747 have trigraphs in symbol names unnecessarily escaped once.
4748
4749 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
4750
4751 Fix make dist infinite loop reported by Juan Manuel Guerrero at
4752 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
4753 * .cvsignore: Add .version.
4754 * .version.in: New.
4755 * bootstrap.conf (gnulib_modules): Add git-version-gen.
4756 * configure.ac (AC_CONFIG_FILES): Add .version.
4757 * build-aux/.cvsignore: Add git-version-gen.
4758
4759 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4760
4761 * NEWS (2.3a+): Mention that -g now takes an argument.
4762 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
4763 consistency. Update the -g and -x entries now that they take
4764 arguments. Use brackets to indicate optional arguments.
4765 * src/getargs.c (usage): Explain the relationship between arguments of
4766 long and short options more completely. Document --defines and -d
4767 separately since the former takes an argument but, for POSIX Yacc, the
4768 latter does not.
4769 (short_options): Let -W take an optional argument like --warnings.
4770 (getargs): Sort cases.
4771
4772 2008-02-28 Akim Demaille <demaille@gostai.com>
4773
4774 * doc/bison.texinfo: Fix a few typos.
4775
4776 2008-02-28 Akim Demaille <akim@epita.fr>
4777
4778 * doc/bison.texinfo (Bison Options): Document -W.
4779 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
4780
4781 2008-02-28 Akim Demaille <akim@epita.fr>
4782
4783 * src/getargs.c (short_options): Split and sort for readability.
4784 -g and -x take optional arguments, just like their long options.
4785 * build-aux/cross-options.pl: Use /x to make the regexp easier to
4786 understand.
4787 Fix the handling of $opt which resulted in all the argument to be
4788 considered as optional.
4789
4790 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
4791
4792 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
4793 say its interface is experimental.
4794 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4795 Java.
4796 (Bison Options): In the -L and --language entry, mention Java.
4797 (Java Bison Interface): Say the interface is experimental.
4798 * src/getargs.c (usage): Mention -L and --language.
4799
4800 * NEWS (2.3a+): Say the push parsing interface is experimental.
4801 * doc/bison.texinfo (Push Decl): Likewise.
4802 (Decl Summary): Likewise in the "%define api.push_pull" entry.
4803 (Push Parser Function): Likewise.
4804 (Pull Parser Function): Likewise.
4805 (Parser Create Function): Likewise.
4806 (Parser Delete Function): Likewise.
4807 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
4808 yypull_parse, and yypush_parse entries.
4809
4810 * NEWS (2.3a+): Mention XML support, and say the schema is
4811 experimental.
4812 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
4813 * src/getargs.c (usage): Say the XML schema is experimental.
4814
4815 * NEWS (2.3a+): Say option instead of flag.
4816
4817 2008-02-21 Wojciech Polak <polak@gnu.org>
4818
4819 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
4820 text.
4821
4822 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
4823
4824 Fix impure push parser compile error reported by Bob Rossi at
4825 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
4826 * data/yacc.c: Clean up whitespace in the output a little.
4827 (yypstate_allocated): Define for impure push parsers regardless of
4828 whether the pull interface is also requested.
4829 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
4830 check impure push parsers without the pull interface.
4831
4832 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
4833 yyerror takes arguments specified by %parse-param while yypstate_new
4834 does not.
4835 * doc/bison.texinfo (Parser Create Function): Document that
4836 yypstate_new returns 0 for multiple impure parser instances.
4837 * tests/push.at (Push Parsing: Multiple impure instances): Update
4838 expected stderr output.
4839
4840 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
4841
4842 * runtime-po/POTFILES.in (push.c): Remove.
4843
4844 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
4845
4846 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
4847 * data/push.c: Rename to...
4848 * data/yacc.c: ... this, overwriting it.
4849 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
4850 `%push-pull-parser' -> `%define api.push_pull "both"'.
4851 Remove old yacc.c tests, and update push.c tests to yacc.c.
4852
4853 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
4854
4855 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
4856 `"%code top" blocks' instead of `%code "top" blocks'.
4857 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
4858 Clean up whitespace in the output a little.
4859
4860 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
4861
4862 Fix documentation problems reported by Tim Josling at
4863 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
4864 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
4865 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
4866 integers. Explain the effect of literal string aliases on error
4867 messages. Copy token 0 documentation from the C++ skeleton
4868 documentation.
4869
4870 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
4871
4872 Accept a token number in a %left, %right, or %nonassoc for POSIX
4873 conformance. Reported by Tim Josling at
4874 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
4875 * NEWS (2.3a+): Mention.
4876 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
4877 and code numbers are treated by precedence declarations.
4878 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
4879 of symbols.1.
4880 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
4881 of symbol.
4882 (symbol.prec): New, just like symbol but allows INT.
4883 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
4884 longer holds.
4885 * tests/regression.at (Token number in precedence declaration): New
4886 test case.
4887
4888 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4889
4890 DJGPP specific issues.
4891 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
4892 be changed. Copyright timestamp adjusted.
4893 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
4894 be changed. Copyright timestamp adjusted.
4895 * djgpp/config.site: Copyright timestamp adjusted.
4896 * djgpp/config_h.sed: Copyright timestamp adjusted.
4897 * djgpp/djunpack.bat: Copyright timestamp adjusted.
4898 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
4899 filename translation list.
4900 * djgpp/subpipe.c (init_subpipe): Check the environment variables
4901 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
4902 files shall be created. Before trying to use the temp dir where the
4903 environment variable points to check that the dir really exists. If
4904 not default to the cwd as temp dir. Copyright timestamp adjusted.
4905 * djgpp/subpipe.h: Copyright timestamp adjusted.
4906 * djgpp/testsuite.sed: Copyright timestamp adjusted.
4907
4908 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
4909
4910 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
4911
4912 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
4913
4914 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
4915 Problem reported by Claudio Saavedra in
4916 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
4917
4918 2008-01-05 Wojciech Polak <polak@gnu.org>
4919
4920 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
4921 document's title with the input grammar file name.
4922
4923 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
4924
4925 Automate regression testing of the XML/XSLT implementation. Discussed
4926 starting at
4927 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
4928 * configure.ac (XSLTPROC): New substitution.
4929 * Makefile.am (maintainer-xml-check): New phony target invoking...
4930 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
4931 invoking make maintainer-check with BISON_TEST_XML=1.
4932 * tests/atlocal.in (XSLTPROC): New.
4933 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
4934 not to report reachable memory when Bison is expected to have a
4935 non-zero exit status and (2) to compare XML/XSLT output with --graph
4936 and --report=all output for every working grammar when
4937 BISON_TEST_XML=1.
4938 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
4939 (AT_BISON_CHECK_XML): New.
4940 (AT_QUELL_VALGRIND): New.
4941 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
4942 (AT_CHECK): ... don't redefine this since this was the old way to
4943 quell Valgrind.
4944 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
4945 AT_BISON_CHECK invocations.
4946 * tests/c++.at: Likewise.
4947 * tests/calc.at: Likewise.
4948 * tests/conflicts.at: Likewise.
4949 * tests/cxx-type.at: Likewise.
4950 * tests/existing.at: Likewise.
4951 * tests/glr-regression.at: Likewise.
4952 * tests/headers.at: Likewise.
4953 * tests/input.at: Likewise.
4954 * tests/java.at: Likewise.
4955 * tests/output.at: Likewise.
4956 * tests/push.at: Likewise.
4957 * tests/reduce.at: Likewise.
4958 * tests/regression.at: Likewise.
4959 * tests/sets.at: Likewise.
4960 * tests/skeletons.at: Likewise.
4961 * tests/synclines.at: Likewise.
4962 * tests/torture.at: Likewise.
4963 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
4964 tends to hang xsltproc.
4965 (Big horizontal): Likewise.
4966
4967 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
4968
4969 In XML output, remove redundant class attribute on symbol element.
4970 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
4971 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
4972 look up a symbol to determine whether it's a nonterminal or terminal.
4973 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
4974 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
4975
4976 Add prec/assoc information to XML output.
4977 * src/gram.c (grammar_rules_print_xml): For each rule that has a
4978 %prec, add a percent_prec attribute.
4979 * src/print-xml.c (print_grammar): For each terminal that has a
4980 precedence or associativity, add a prec or assoc attribute.
4981 (xml_indent): New.
4982 (xml_puts): Use xml_indent.
4983 (xml_printf): Use xml_indent.
4984 * src/print-xml.h (xml_indent): Prototype.
4985
4986 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
4987 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
4988
4989 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
4990
4991 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
4992 (bison:ruleByNumber): ... this for clarity.
4993 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
4994 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
4995 (xsl:template match="reduction"): Update.
4996 (xsl:template match="item"): Update.
4997 (xsl:template match="reduction"): Update.
4998
4999 In the XML output, don't print the list of rules where symbols appear.
5000 Compute it in XSLT instead. Discussed at
5001 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
5002 * data/xslt/bison.xsl (bison:ruleByLhs): New.
5003 (bison:ruleByRhs): New.
5004 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
5005 bison:ruleByRhs.
5006 (xsl:template match="terminal/rule"): Remove.
5007 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5008 bison:ruleByRhs.
5009 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5010 Remove.
5011 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
5012 bison:ruleByRhs and mode="number-link" for rule template.
5013 (xsl:template match="terminal/rule"): Remove.
5014 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5015 bison:ruleByRhs and mode="number-link" for rule template.
5016 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5017 Rewrite as...
5018 (xsl:template match="rule" mode="number-link"): ... this.
5019 * src/print-xml.c (print_grammar): Don't print the list of rules.
5020
5021 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
5022
5023 Don't let --report affect XML output; always print all information.
5024 Discussed at
5025 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
5026 * src/conflicts.c (log_resolution): Implement.
5027 * src/print-xml.c (print_core): Implement.
5028 (print_state): Implement.
5029 (print_xml): Implement.
5030
5031 * NEWS (2.3a+): Fix quotes.
5032 * src/parse-gram.y (prologue_declaration): For consistency with -v,
5033 don't let %verbose clear the list specified by --report.
5034
5035 2007-11-26 Akim Demaille <akim@epita.fr>
5036
5037 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
5038
5039 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
5040
5041 In the XML output, list useless and unused symbols and rules with the
5042 useful ones and add a "usefulness" attribute. Discussed starting at
5043 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
5044 * src/gram.c (grammar_rules_partial_print_xml): Remove.
5045 (grammar_rules_print_xml): Print all rules instead of just those
5046 useful in the grammar, and add a "usefulness" attribute.
5047 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
5048 * src/print-xml.c (print_rules_useless_in_parser): Remove.
5049 (print_grammar): Print all nonterminals instead of just useful ones,
5050 and add a "usefulness" attribute to nonterminals and terminals.
5051 (print_xml): Don't print a separate "reductions" or
5052 "rules-useless-in-parser" element.
5053 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
5054 (reduce_xml): Remove.
5055 (reduce_token_unused_in_grammar): New.
5056 (reduce_nonterminal_useless_in_grammar): New.
5057 * src/reduce.h (reduce_xml): Remove prototype.
5058 (reduce_token_unused_in_grammar): Add prototype.
5059 (reduce_nonterminal_useless_in_grammar): Add prototype.
5060 * data/xslt/xml2text.xsl: Update for XML changes.
5061 * data/xslt/xml2xhtml.xsl: Update for XML changes.
5062 * tests/reduce.at (Useless Terminals): Update output.
5063 (Useless Rules): Update output.
5064 (Reduced Automaton): Update output.
5065
5066 Say "Terminals unused in grammar" instead of "Unused terminals".
5067 * NEWS (2.3a+): Update.
5068 * doc/bison.texinfo (Understanding): Update example output.
5069 * src/reduce.c (reduce_output): Implement.
5070 * data/xslt/xml2text.xsl: Implement.
5071 * data/xslt/xml2xhtml.xsl: Implement.
5072
5073 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
5074
5075 Accept --report-file=FILE to override the default `.output' filename.
5076 * NEWS (2.3a+): Mention.
5077 * doc/bison.texinfo (Bison Options): Add an entry.
5078 * src/files.c (compute_output_file_names): Don't override
5079 spec_verbose_file if already set.
5080 * src/getargs.c (usage): Document --report-file.
5081 (REPORT_FILE_OPTION): New anonymous enum member.
5082 (long_options): Add entry for it.
5083 (getargs): Add case for it setting spec_verbose_file.
5084
5085 * build-aux/cross-options.pl: Don't record a short option just because
5086 there's an arg.
5087 * doc/.cvsignore: Add yacc.1.
5088
5089 2007-11-14 Akim Demaille <akim@epita.fr>
5090
5091 * doc/yacc.1.in: New.
5092 * configure.ac, doc/Makefile.am: Adjust.
5093 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
5094 config.h symbol.
5095 Use AC_SUBST for assignments too.
5096 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
5097
5098 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5099
5100 * src/gram.c: Remove comments that duplicate comments in gram.h.
5101
5102 When reporting useless rules and nonterminals, say "useless in grammar"
5103 instead of "useless", and say "useless in parser" instead of "never
5104 reduced". Discussed starting at
5105 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
5106 * NEWS (2.3a+): Mention this change.
5107 * data/xslt/xml2text.xsl: Update output text and expected input XML
5108 element names to match changes below.
5109 * data/xslt/xml2xhtml.xsl: Likewise.
5110 (xsl:template match="bison-xml-report"): Add missing entry in Table of
5111 Contents: "Rules useless in parser due to conflicts".
5112 * doc/bison.texinfo (Decl Summary): Reword a little.
5113 (Understanding): Update example output for changes below.
5114 * src/gram.c: (rule_useful_p): Rename to...
5115 (rule_useful_in_grammar_p): ... this.
5116 (rule_useless_p): Rename to...
5117 (rule_useless_in_grammar_p): ... this.
5118 (rule_never_reduced_p): Rename to...
5119 (rule_useless_in_parser_p): ... this.
5120 (grammar_rules_print): Update for renames.
5121 (grammar_rules_print_xml): Update for renames.
5122 (grammar_rules_never_reduced_report): Rename to...
5123 (grammar_rules_useless_report): ... this since it is used for either
5124 kind of useless rule.
5125 * src/gram.h: Reword comments and update function names in prototypes.
5126 * src/main.c (main): Say "rule useless in parser due to conflicts".
5127 * src/print-xml.c (print_rules_never_reduced): Rename to...
5128 (print_rules_useless_in_parser): ... this, and rename output XML
5129 element "rules-never-reduced" to "rules-useless-in-parser".
5130 (print_xml): Update for rename.
5131 * src/print.c (print_results): Say "Rules useless in parser due to
5132 conflicts".
5133 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
5134 (nonterminals_reduce): Say "nonterminal useless in grammar".
5135 (reduce_output): Say "Nonterminals useless in grammar".
5136 Say "Rules useless in grammar".
5137 (reduce_xml): Rename output XML element "useless" to
5138 "useless-in-grammar".
5139 (reduce_print): Don't report the count of grammatically useless rules
5140 as "rules never reduced" just because %yacc is specified.
5141 In the correct report of this count, say nonterminal(s) and rule(s)
5142 "useless in grammar".
5143 * tests/conflicts.at (S/R in initial): Update expected output.
5144 (Defaulted Conflicted Reduction): Likewise.
5145 (Unreachable States After Conflict Resolution): Likewise.
5146 * tests/existing.at (GNU pic Grammar): Likewise.
5147 * tests/reduce.at (Useless Nonterminals): Likewise.
5148 (Useless Rules): Likewise.
5149 (Reduced Automaton): Likewise.
5150 (Underivable Rules): Likewise.
5151 (Empty Language): Likewise.
5152
5153 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
5154
5155 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
5156 here document and before the EOF so that BSD's implementation of Bourne
5157 shell doesn't parse the delimiter as part of the here document.
5158 * doc/.cvsignore: Add cross-options.texi.
5159 * src/getargs.c (usage): Add a blank line after the warning categories.
5160
5161 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
5162
5163 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
5164
5165 2007-11-05 Akim Demaille <akim@epita.fr>
5166
5167 Remove Id: from bison.1.
5168 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
5169 (perl -0777 -pi -e 's/\.PP\nId): New.
5170 (.x.1): Use it to ignore the version control revision.
5171
5172 2007-11-05 Akim Demaille <demaille@gostai.com>
5173
5174 * build-aux/Makefile.am: Ship cross-options.pl.
5175 * doc/Makefile.am: Always refer to cross-options.texi with
5176 $(srcdir).
5177 (MAINTAINERCLEANFILES): Add it.
5178
5179 2007-11-04 Akim Demaille <demaille@gostai.com>
5180
5181 Generate the long/short option cross-table.
5182 * build-aux/cross-options.pl: New.
5183 * doc/Makefile.am (cross-options.texi): New.
5184 * doc/bison.texinfo: Use it.
5185
5186 2007-11-04 Akim Demaille <demaille@gostai.com>
5187
5188 Generate bison.1 using help2man.
5189 * doc/common.x, doc/bison.x: New.
5190 * doc/Makefile.am (bison.1, .x.1): New.
5191 The code is taken from autoconf-2.61/man/Makefile.am.
5192 * configure.ac: Look for help2man.
5193
5194 2007-11-04 Akim Demaille <demaille@gostai.com>
5195
5196 Complete --help.
5197 * src/getargs.c (usage): Document -W, make it clear that -d,
5198 -g and -x have optional arguments.
5199
5200 2007-11-04 Akim Demaille <demaille@gostai.com>
5201
5202 Find sha1sum when named gsha1sum.
5203 * bootstrap (find_tool): New.
5204 ($SHA1SUM): New.
5205
5206 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5207
5208 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
5209 at
5210 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
5211 * NEWS (2.3a+): Mention.
5212 * data/bison.m4 (b4_pure_if): Don't define it here.
5213 * data/c.m4 (b4_identification): Depend on individual skeletons to
5214 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
5215 values of the %define variables api.pure or api.push_pull. Define
5216 YYPURE, YYPUSH, and YYPULL accordingly.
5217 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
5218 glr.cc has already defined b4_pure_flag.
5219 * data/push.c: Define b4_pure_if based on `%define api.pure'.
5220 Remove YYPUSH and YYPULL since they're back in b4_identification again.
5221 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
5222 * doc/bison.texinfo (Pure Decl): Update.
5223 (Push Decl): Update.
5224 (Decl Summary): Add api.pure to %define entry.
5225 In %pure-parser entry, say it's deprecated and reference %define.
5226 (Pure Calling): Update.
5227 (Error Reporting): Update.
5228 (C++ Scanner Interface): Update.
5229 (How Can I Reset the Parser): Update.
5230 (Table of Symbols): In %pure-parser entry, say it's deprecated and
5231 reference %define.
5232 * src/getargs.c (pure_parser): Remove global variable.
5233 * src/getargs.h (pure_parser): Remove extern.
5234 * src/output.c (prepare): Don't define pure_flag muscle.
5235 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
5236 wrapper around `%define api.pure'.
5237 * tests/calc.at (Simple LALR Calculator): Update.
5238 (Simple GLR Calculator): Update.
5239 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
5240 Update.
5241 (GLR: Resolve ambiguity, pure, locations): Update.
5242 (GLR: Merge conflicting parses, pure, no locations): Update.
5243 (GLR: Merge conflicting parses, pure, locations): Update.
5244 * tests/glr-regression.at (Uninitialized location when reporting
5245 ambiguity): Update
5246 * tests/input.at (Unused %define api.pure): New test case.
5247 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
5248 AT_PURE_IF and AT_PURE_AND_LOC_IF.
5249 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5250
5251 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5252
5253 %define push_pull -> %define api.push_pull. Discussed starting at
5254 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
5255 * data/push.c: Expect the new name.
5256 * data/yacc.c: Likewise.
5257 * doc/bison.texinfo (Push Decl): Update.
5258 (Decl Summary): Update %define entry.
5259 (Push Parser Function): Update.
5260 (Pull Parser Function): Update.
5261 (Parser Create Function): Update.
5262 (Parser Delete Function): Update.
5263 * tests/calc.at (Simple LALR Calculator): Update.
5264 * tests/input.at (%define enum variables): Update.
5265 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5266 (Push Parsing: Multiple impure instances): Update.
5267 (Push Parsing: Unsupported Skeletons): Update.
5268 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
5269 (Exploding the Stack Size with Malloc): Update.
5270
5271 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
5272 other entries some.
5273
5274 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
5275
5276 For the XML output's terminal element, rename @number to @token-number,
5277 and add @symbol-number. In the nonterminal element, rename @number to
5278 @symbol-number. Discussed starting at
5279 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
5280 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
5281 renames.
5282 (xsl:template match="nonterminal"): Likewise.
5283 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
5284 (xsl:template match="nonterminal"): Likewise.
5285 * src/print-xml.c (print_grammar): Implement.
5286
5287 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5288
5289 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
5290 2007-10-11 change, the child elements here are items not rules.
5291 (xsl:template match="item"): New.
5292 (xsl:template match="rule"): Update for new reduced itemset.
5293 (xsl:template match="point"): Remove.
5294 (xsl:template match="empty"): For consistency with --graph, don't
5295 output "/* empty */".
5296 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
5297 line-wrap, don't pass a negative value as first-line-length since this
5298 won't work with the following changes.
5299 (xsl:template name="line-wrap"): Simplify slightly.
5300 (xsl:template name="ws-search"): Eliminate recursion.
5301 * src/print_graph.c (print_core): Don't print a reduction's lookahead
5302 set next to an item whose dot is not at the end of the RHS even if it
5303 happens to be associated with the same rule.
5304
5305 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5306
5307 Add %define lr.keep_unreachable_states.
5308 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
5309 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
5310 * src/main.c (main): Implement it.
5311 * tests/conflicts.at (Unreachable States After Conflict Resolution):
5312 Extend to test it, and fix a typo.
5313
5314 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5315
5316 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
5317 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
5318 the example .output text.
5319 * tests/regression.at (Extra lookahead sets in report): Improve wording
5320 of comments.
5321
5322 2007-10-17 Wojciech Polak <polak@gnu.org>
5323
5324 * src/print-xml.c (print_grammar): Renamed
5325 <terminal> and <nonterminal> attributes:
5326 "type" to "number" and "symbol" to "name".
5327 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
5328 Use new attribute names.
5329 (xsl:template match="nonterminal"): Likewise.
5330 * data/xslt/xml2xhtml.xsl: Likewise.
5331
5332 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
5333
5334 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
5335 (Option Cross Key): Likewise.
5336
5337 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
5338 next to an item whose dot is not at the end of the RHS even if it
5339 happens to be associated with the same rule.
5340 * src/print.c (print_core): Likewise.
5341 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
5342 (Resolved SR Conflicts): Update output.
5343 * tests/regression.at (Extra lookahead sets in report): New test case.
5344
5345 2007-10-11 Wojciech Polak <polak@gnu.org>
5346
5347 * src/print-xml.c (print_core): Remove item set
5348 redundancy.
5349 * data/xslt/bison.xsl (bison:ruleNumber): New key.
5350 Improve processing time. Suggested by Joel E. Denny.
5351 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
5352 Write xsl:param "required" attribute as comment.
5353 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
5354 (xsl:template match="rule"): Support new reduced itemset.
5355 (xsl:template match="point"): Remove.
5356 * data/xslt/xml2xhtml.xsl: Likewise.
5357
5358 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5359
5360 * src/getargs.c (version): Update copyright year.
5361
5362 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5363
5364 Make xml2dot.xsl and --graph produce the same output.
5365 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
5366 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
5367 escaped later.
5368 (xsl:template name="output-node"): Use the new escape template instead
5369 of the string-replace template directly.
5370 (xsl:template name="output-edge"): Likewise.
5371 (xsl:template name="escape"): New, escapes backslashes and newlines in
5372 addition to quotation marks.
5373 * src/graphviz.c (start_graph, output_node, output_edge): Add
5374 whitespace to output for legibility.
5375
5376 Make xml2text.xsl and --report produce the same output, and remove the
5377 XML "conflicts" element since a conflict summary is easily extracted
5378 from the automaton.
5379 * data/xslt/bison.xsl: New.
5380 (xsl:template match="state" mode="bison:count-conflicts): New.
5381 * data/xslt/xml2text.xsl: Import bison.xsl.
5382 (xsl:template match="bison-xml-report"): Instead of styling the
5383 "conflicts" element, style the "automaton" element with mode
5384 "conflicts". Unlike the former, the latter lists S/R and R/R
5385 conflicts for a state on the same line.
5386 (xsl:template match="conflicts"): Remove.
5387 (xsl:template match="conflict"): Remove.
5388 (xsl:template match="terminal"): Line-wrap the list of rules in which
5389 the terminal is used.
5390 (xsl:template match="nonterminal"): Likewise for nonterminals.
5391 (xsl:template match="automaton" mode="conflicts"): New.
5392 (xsl:template match="state" mode="conflicts"): New.
5393 (xsl:template name="line-wrap"): New.
5394 (xsl:template name="ws-search"): New.
5395 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
5396 (xsl:template match="bison-xml-report"): Instead of styling the
5397 "conflicts" element, style the "automaton" element with mode
5398 "conflicts."
5399 (xsl:template match="conflicts"): Remove.
5400 (xsl:template match="conflict"): Remove.
5401 (xsl:template match="automaton" mode="conflicts"): New.
5402 (xsl:template match="state" mode="conflicts): New.
5403 * src/conflicts.c (conflicts_output_xml): Remove.
5404 * src/conflicts.h (conflicts_output_xml): Remove prototype.
5405 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
5406 * src/print.c (print_grammar): Consistently wrap at the 66th column so
5407 the corresponding XSLT is easier. Also, never wrap between a word and
5408 the comma that follows it.
5409
5410 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5411
5412 Improve C++ namespace support. Discussed starting at
5413 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
5414 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
5415 b4_namespace_close): New macros that interpret the %define variable
5416 "namespace" so its value can contain "::" to indicate nested
5417 namespaces.
5418 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
5419 the above macros.
5420 * data/lalr1.cc (b4_namespace): Likewise.
5421 * data/location.cc (b4_namespace): Likewise.
5422 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
5423 inside a new table in the general %define entry. Document `%define
5424 namespace' there as well. Point the %name-prefix entry to it since it
5425 explains it more completely in the case of C++.
5426 (C++ Bison Interface): Mention `%define namespace' instead of
5427 %name-prefix.
5428 (Table of Symbols): Remove the `%define push_pull' entry. The %define
5429 entry suffices.
5430 * tests/c++.at (Relative namespace references): New test case.
5431 (Absolute namespace references): New test case.
5432 (Syntactically invalid namespace references): New test case.
5433 * tests/input.at (C++ namespace reference errors): New test case.
5434
5435 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5436
5437 Add syncline support and location accessor to internal %define
5438 interfaces.
5439 * data/bison.m4 (b4_percent_define_get_loc): New.
5440 (b4_percent_define_get_syncline): New.
5441 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
5442 (b4_percent_define_default): Record defining location as line 1 rather
5443 than 0 for the sake of synchronizing #line's, and define
5444 b4_percent_define_syncline(VARIABLE).
5445 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
5446 * src/muscle_tab.c (muscle_syncline_grow): New.
5447 (muscle_code_grow): Use muscle_syncline_grow.
5448 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
5449 define b4_percent_define_syncline(VARIABLE).
5450 (muscle_percent_define_get_loc): New.
5451 (muscle_percent_define_get_syncline): New.
5452 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
5453 remove some unused variables.
5454 (muscle_percent_define_default): Record defining location as line 1
5455 rather than 0 for the sake of synchronizing #line's, and define
5456 b4_percent_define_syncline(VARIABLE).
5457 (muscle_percent_define_check_values): Use
5458 muscle_percent_define_get_loc.
5459 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
5460 (muscle_percent_define_get_syncline): Prototype.
5461 * tests/skeletons.at (%define Boolean variables: invalid skeleton
5462 defaults): Update output for location change.
5463 (Complaining during macro argument expansion): Extend to test
5464 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
5465
5466 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
5467
5468 Fix some error-reporting macro bugs.
5469 * data/bison.m4 (b4_cat): New.
5470 (b4_error, b4_error_at): Use b4_cat to send error directives directly
5471 to stdout so they don't become arguments to other macros. Update
5472 comments and add examples.
5473 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
5474 add examples.
5475 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
5476 after printing the error directive so that M4 doesn't report subsequent
5477 problems that are induced by this problem.
5478 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
5479 instead of just in them. Recognize @\n in both places. Both expand to
5480 the empty string. Needed by b4_cat.
5481 * tests/skeletons.at (Complaining during macro argument expansion):
5482 New test case.
5483 (Fatal errors make M4 exit immediately): New test case.
5484
5485 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
5486
5487 Implement --print-datadir.
5488 * src/getargs.c (usage): Mention.
5489 (PRINT_DATADIR_OPTION): New anonymous enum member.
5490 (long_options): Add entry for it.
5491 (getargs): Add case for it calling compute_pkgdatadir.
5492 * src/output.c (output_skeleton): Encapsulate data directory
5493 computation from here...
5494 (prepare): ... and from here...
5495 (compute_pkgdatadir): ... into this new function.
5496 * src/output.h (compute_pkgdatadir): Prototype.
5497
5498 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
5499
5500 * src/print-xml.c (escape_bufs): New static global variable
5501 replacing...
5502 (xml_escape_n): ... the static local variable buf here.
5503 (print_xml): Free memory for escape_bufs.
5504 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
5505
5506 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
5507
5508 Replace `%push-parser' and `%push-pull-parser' with
5509 `%define push_pull "push"' and `%define push_pull "both"'.
5510 `%define push_pull "pull"' is the default.
5511 * doc/bison.texinfo (Push Decl, Push Parser Function,
5512 Pull Parser Function, Parser Create Function, Parser Delete Function):
5513 Update declarations.
5514 (Decl Summary, Table of Symbols): Replace %push-parser and
5515 %push-pull-parser entries with a %define push_pull entry.
5516 * data/bison.m4 (b4_percent_define_check_values): New macro.
5517 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
5518 definitions...
5519 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
5520 definitions...
5521 * data/push.c: ... to here and compute them from the value of the
5522 %define variable push_pull.
5523 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
5524 parsing requests here...
5525 * data/yacc.c: ... hack this to switch to push.c any time
5526 b4_use_push_pull_flag or the %define variable push_pull is set. This
5527 will go away when we mv push.c yacc.c.
5528 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
5529 push parsing is not supported since unused %define variables are
5530 reported anyway.
5531 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
5532 * src/muscle_tab.h (muscle_percent_define_check_values): Update
5533 comments for consistency with b4_percent_define_check_values.
5534 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
5535 muscles.
5536 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
5537 Remove.
5538 (prologue_declaration): Remove %push-parser and %push-pull-parser
5539 rules.
5540 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
5541 * tests/calc.at: Update declarations.
5542 * tests/input.at (%define enum variables): New test case.
5543 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
5544 declaration.
5545 (Push Parsing: Multiple impure instances): Update declaration.
5546 (Push Parsing: Unsupported Skeletons): New test case.
5547 * tests/torture.at (Exploding the Stack Size with Alloca): Update
5548 declaration.
5549 (Exploding the Stack Size with Malloc): Update declaration.
5550
5551 2007-09-24 Wojciech Polak <polak@gnu.org>
5552
5553 Add XSLT transformations.
5554
5555 * data/xslt/xml2dot.xsl: Transform XML into DOT.
5556 * data/xslt/xml2text.xsl: Transform XML into plain text.
5557 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
5558 * data/Makefile.am (xsltdir): New variable.
5559 (dist_xslt_DATA): Add xslt/*.xsl files.
5560
5561 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
5562
5563 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
5564 Problem reported by Wojciech Polak.
5565 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
5566 (xml_printf): Undo change I made on 21 September; that is,
5567 indent 2 spaces, not 1.
5568
5569 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
5570
5571 Pacify ./configure --enable-gcc-warnings.
5572 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
5573 `char const *' instead of `char *'.
5574 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
5575 local variable `sep'.
5576
5577 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5578
5579 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
5580 elsewhere.
5581 * src/print-xml.c: Prefer "const" after types; that's more consistent.
5582 (xml_printf): Indent just 1 space for level.
5583 (e_char, xlate_char): Remove.
5584 (xml_escape_string): Rewrite to avoid undefined behavior (used
5585 storage that was freed from the stack).
5586 (xml_escape_n): Don't bother checking for subscript error.
5587
5588 2007-09-21 Wojciech Polak <polak@gnu.org>
5589
5590 Add Bison XML Automaton Report.
5591
5592 Add support for an -x option to generate an XML report.
5593 It is not documented yet.
5594 * src/print-xml.c: New file.
5595 * src/print-xml.h: Likewise.
5596 * lib/timevar.def (TV_XML): New var.
5597 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
5598 * src/conflicts.c: Include print-xml.h.
5599 (solved_conflicts_xml_obstack): New var.
5600 (log_resolution, conflicts_solve, conflicts_free):
5601 Add support for XML report.
5602 (conflicts_output_val): New function.
5603 * src/conflicts.h (conflicts_output_val): New decl.
5604 * src/files.c (spec_xml_file): New var.
5605 (compute_output_file_names, output_file_names_free): Add XML support.
5606 * src/files.h (spec_xml_file): New decl.
5607 * src/getargs.c (xml_flag): New var.
5608 (usage, short_options, long_options, getargs): Add XML support.
5609 * src/getargs.h (xml_flag): New decl.
5610 * src/gram.c: Include print-xml.h.
5611 (rule_lhs_print_xml, rule_rhs_print_xml):
5612 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
5613 New functions.
5614 * src/gram.h: Declare external ones.
5615 * src/main.c: Include print-xml.h.
5616 (main): Add XML support.
5617 * src/reduce.c: Include print-xml.h.
5618 (reduce_xml): New function.
5619 * src/reduce.h: Declare it.
5620 * src/state.c: Include print-xml.h.
5621 (state_new): Add XML support.
5622 (state_rule_lookahead_tokens_print_xml): New function.
5623 * src/state.h: Declare it.
5624 (struct state): New member solved_conflicts_xml.
5625 * src/symtab.c (symbol_class_get_string): New function.
5626 * src/symtab.h: Declare it.
5627
5628 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5629
5630 * GNUmakefile: Switch to coreutils's version.
5631 * bootstrap: Likewise.
5632 * Makefile.cfg: Adjust to new GNUmakefile.
5633 * README-hacking: Likewise.
5634
5635 Import from gnulib:
5636
5637 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
5638 Bruno Haible <bruno@clisp.org>
5639
5640 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
5641 and is a script that invokes bison. Tighten the code. Add comments.
5642
5643 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
5644
5645 Spell "boolean" as "Boolean". Reported by Akim Demaille.
5646 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
5647 * doc/bison.texinfo (Decl Summary): Fix.
5648 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
5649 * tests/input.at (Boolean %define variables): Update output.
5650 * tests/skeletons.at (%define boolean variables: invalid skeleton
5651 defaults): Rename to...
5652 (%define Boolean variables: invalid skeleton defaults): ... this and
5653 update output.
5654
5655 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
5656
5657 In impure push mode, don't allow more than one yypstate to be allocated
5658 since multiple impure parsers would corrupt yynerrs.
5659 * data/push.c (yypstate_allocated): New static global variable
5660 initialized to 0.
5661 (yypull_parse): If yypstate_new returns 0, don't report it as memory
5662 exhaustion if yypstate_allocated is 1, but still return 2.
5663 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
5664 already 1. Otherwise, set it to 1.
5665 (yypstate_delete): Set it to 0.
5666 * tests/push.at (Push Parsing: Multiple impure instances): New test
5667 case.
5668
5669 2007-08-17 Bob Rossi <bob@brasko.net>
5670
5671 * doc/bison.texinfo (Push Decl): Document the push parser.
5672 (Table of Symbols): Ditto.
5673 (Pure Decl): Ditto.
5674 (Decl Summary): Ditto.
5675 (Multiple Parsers, Push Parser Function, Pull Parser Function,
5676 Parser Create Function, Parser Delete Function):
5677 Add new push parser symbols.
5678 (Table of Symbols): Document push-parser, push-pull-parser,
5679 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
5680
5681 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
5682
5683 Update to GPLv3.
5684 * doc/gpl-3.0.texi: New file.
5685 * doc/gpl.texi: Remove.
5686 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
5687 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
5688 * README-hacking, TODO, bootstrap, bootstrap.conf:
5689 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
5690 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
5691 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
5692 * data/lalr1.cc, data/lalr1.java, data/location.cc:
5693 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
5694 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
5695 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
5696 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
5697 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
5698 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
5699 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
5700 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
5701 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
5702 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
5703 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
5704 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
5705 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
5706 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
5707 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
5708 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
5709 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
5710 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
5711 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
5712 * src/complain.c, src/complain.h, src/conflicts.c:
5713 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
5714 * src/files.h, src/flex-scanner.h, src/getargs.c:
5715 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
5716 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
5717 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
5718 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
5719 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
5720 * src/print.c, src/print.h, src/print_graph.c:
5721 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
5722 * src/reduce.h, src/relation.c, src/relation.h:
5723 * src/revision.h, src/scan-code.h, src/scan-code.l:
5724 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
5725 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
5726 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
5727 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
5728 * tests/Makefile.am, tests/actions.at, tests/c++.at:
5729 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
5730 * tests/existing.at, tests/glr-regression.at:
5731 * tests/headers.at, tests/input.at, tests/java.at:
5732 * tests/local.at, tests/output.at, tests/push.at:
5733 * tests/reduce.at, tests/regression.at, tests/sets.at:
5734 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
5735 * tests/torture.at:
5736 Update to GPLv3.
5737
5738 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
5739
5740 Get rid of broken %no-parser, -n, and --no-parser implementation and
5741 documentation.
5742 * TODO: Don't mention them.
5743 * doc/bison.1: Likewise.
5744 * doc/bison.texinfo (Decl Summary): Likewise.
5745 (Bison Options): Likewise.
5746 (Option Cross Key): Likewise.
5747 * src/getargs.c (no_parser_flag): Remove global variable.
5748 (usage): Don't print description of -n and --no-parser.
5749 (long_options): Remove --no-parser entry here.
5750 (getargs): Remove -n case in the switch here.
5751 * src/getargs.h (no_parser_flag): Remove extern.
5752 * tests/regression.at (Web2c Actions): Remove comment that mentions
5753 --no-parser.
5754
5755 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
5756
5757 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
5758 name user variables starting with `yy'. Just pass NULL instead of a
5759 dummy local &yylval to yypush_parse.
5760 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
5761 starting with `yy'.
5762
5763 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
5764
5765 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
5766 true since it's then always used regardless of whether yyoverflow is
5767 defined. Reported by Christian Burger at
5768 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
5769 * THANKS: Add Christian Burger.
5770
5771 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
5772 node names: say "Decl Summary" not "Bison Declaration Summary".
5773
5774 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
5775
5776 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
5777 determine whether this function has already complained about an invalid
5778 value for a %define boolean variable, don't check whether Bison has
5779 ever examined the value. As written, the check was a tautology.
5780 Instead, record and check for this complaint using a separate muscle.
5781
5782 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
5783
5784 Fix push parsing memory leak reported by Brandon Lucia at
5785 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
5786 * THANKS: Add Brandon Lucia.
5787 * data/push.c (yypstate_delete): Free the stack if it was reallocated
5788 but the parse never completed and thus freed it.
5789 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
5790 * tests/testsuite.at: Include push.at.
5791 * test/push.at: New.
5792 (Push Parsing: Memory Leak for Early Deletion): New test case.
5793
5794 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
5795
5796 Improve handling of multiple S/R conflicts in the same state and of S/R
5797 conflicts involving multiple reductions.
5798 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
5799 set for a state here or Bison will abort if it is reassigned on a
5800 later conflicted reduction in the same state.
5801 Similarly, don't finalize and assign the solved conflicts report here
5802 or it will be lost if it is reassigned on a later conflicted reduction
5803 in the same state.
5804 (set_conflicts): Instead, assign them both here after all S/R conflicts
5805 in the state have been fully examined.
5806 * src/print.c (shift_set): Rename to...
5807 (no_reduce_set): ... this.
5808 (print_reductions): Update for rename, and add %nonassoc error action
5809 tokens to no_reduce_set so that, when printing the first remaining
5810 reduction on an error action token, the reduction is enclosed in
5811 brackets.
5812 (print_results): Update for rename.
5813 * tests/conflicts.at (Solved conflicts report for multiple reductions
5814 in a state): New test case.
5815 (%nonassoc error actions for multiple reductions in a state): New test
5816 case.
5817
5818 * src/main.c (main): Don't depend on C99 features.
5819
5820 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
5821
5822 * build-aux/.cvsignore: Add compile.
5823 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
5824 uniwidth.
5825
5826 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
5827
5828 * bootstrap (slurp): Create target directories that don't exist.
5829 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
5830
5831 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5832
5833 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
5834 than item number.
5835 * closure.c (closure): Likewise.
5836 * state.h (reductions): Comment sorting of rules.
5837 (state): Comment sorting of items.
5838
5839 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
5840
5841 Fix C++ test cases after recent Gnulib changes. Discussed starting at
5842 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
5843 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
5844 definition in order to avoid Gnulib headers since we don't use config.h
5845 here.
5846 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
5847 rather than AT_DATA so that config.h is included.
5848
5849 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
5850
5851 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
5852 instead of fprintf. Guard these functions with #if YYDEBUG instead of
5853 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
5854 and so that YYFPRINTF is guaranteed to be defined here.
5855
5856 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
5857
5858 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
5859 with...
5860 (muscle_percent_define_check_values): ... this more helpful function.
5861 Again, it's not used yet, but it will be.
5862 * src/muscle_tab.h: Likewise.
5863
5864 Improve some comments in parser table construction.
5865 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
5866 (generate_states): Don't mention ruleset, which is internal to closure.
5867 * src/closure.c (closure): Explain sorting of core and itemset, which
5868 is required for this function to behave correctly.
5869 * src/closure.h (closure): Mention sorting.
5870
5871 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
5872
5873 * src/lalr.c (state_lookahead_tokens_count): For code readability,
5874 move the check for disabled transitions to an aver since conflict
5875 resolution hasn't happened yet.
5876
5877 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
5878 labels a state as inconsistent just because it has error transitions.
5879 The original form of this check appeared in revision 1.1 of lalr.c,
5880 which was committed on 1991-12-21. Now (at least), changing the
5881 consistency label on such a state appears to have no useful effect in
5882 any of the places it is examined, which I enumerate below. The key
5883 point to understanding each item in this enumeration is that a state
5884 with an error transition is labelled consistent in the first place only
5885 if it has no rules, so the check cannot matter for states that have
5886 rules. (1) Labelling a state as inconsistent will cause set_conflicts
5887 to try to identify its conflicts, and a state must have *rules* to have
5888 conflicts. (2) Labelling a state as inconsistent will affect how
5889 action_row sets the default *rule* for the state. (3) Labelling a
5890 state as inconsistent will cause build_relations to add lookback edges
5891 to *rules* in that state.
5892 * src/state.h (struct state): Word the comment for member consistent
5893 more carefully.
5894
5895 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5896
5897 Don't depend on C99 features.
5898 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
5899 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
5900 * src/reader.c (check_and_convert_grammar): Fix for-loop.
5901 * src/state.c (state_mark_reachable_states): Fix for-loop.
5902 (state_remove_unreachable_states): Fix for-loop.
5903
5904 Don't widen struct state with member reachable just to temporarily
5905 record reachability. Instead, use a local bitset.
5906 * src/state.h (struct state): Remove member.
5907 * src/state.c (state_new): Don't initialize it.
5908 (state_mark_reachable_states): Rename to...
5909 (state_record_reachable_states): ... this, and use bitset.
5910 (state_remove_unreachable_states): Use bitset.
5911
5912 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
5913
5914 * src/Makefile.am (yacc): Quote target action commands properly so
5915 that the yacc script isn't corrupt. Reported by Hans Aberg at
5916 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
5917
5918 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
5919 the case of pure parsers. Reported by Frans Englich at
5920 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
5921 * THANKS: Add Frans Englich.
5922
5923 * NEWS (2.3a+): In the %code entry, reference section `Bison
5924 Declaration Summary' from the manual now since the %code summary has
5925 moved there.
5926 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
5927 in the rules section must be terminated by semicolons.
5928
5929 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
5930
5931 Extend the front-end API for %define variables to more completely
5932 mirror the back-end. This will be useful in the future.
5933 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
5934 Update comments to mention the new front-end counterparts of these
5935 macros.
5936 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
5937 for muscle_string_decode and muscle_location_decode.
5938 (muscle_string_decode): New static function.
5939 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
5940 (muscle_percent_define_get, muscle_percent_define_ifdef): New
5941 functions.
5942 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
5943 muscle_percent_define_get to mimic the b4_percent_define_flag_if
5944 implementation more closely.
5945 (muscle_percent_define_invalid_value): New function.
5946 * src/muscle_tab.h (muscle_percent_define_get,
5947 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
5948 Prototype.
5949
5950 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
5951
5952 * NEWS (2.3a+): Mention yesterday's state-removal change.
5953 (2.3a): Remove the %language entry, which was added after 2.3a.
5954 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
5955 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
5956 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
5957 tests/existing.at: Update copyright date.
5958
5959 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5960
5961 If conflict resolution makes states unreachable, remove those states,
5962 report rules that are then unused, and don't report conflicts in those
5963 states.
5964 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
5965 New global function.
5966 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
5967 function.
5968 * src/main.c (main): After conflict resolution, remove the unreachable
5969 states and update all data structures that reference states by number.
5970 * src/state.c (state_new): Initialize each state's reachable member to
5971 false.
5972 (state_mark_reachable_states): New static function.
5973 (state_remove_unreachable_states): New global function.
5974 * src/state.h (struct state): Add member bool reachable.
5975 (state_remove_unreachable_states): Prototype.
5976 * tests/conflicts.at (Unreachable States After Conflict Resolution):
5977 New test case.
5978 * tests/existing.at (GNU pic Grammar): Update test case output now that
5979 an unused rule is discovered.
5980
5981 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5982
5983 Minor code cleanup in parser table construction.
5984 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
5985 (new_itemsets, save_reductions): Update for rename to nitemset.
5986 * src/closure.c (nritemset): Rename to...
5987 (nitemset): ... this since the "r" appears to meaningless and isn't
5988 used in the comments.
5989 (closure): Update for rename.
5990 * src/closure.h (nritemset): Update extern to...
5991 (nitemset): ... this.
5992 * src/lalr.c (LA): Fix a typo in comments.
5993 * src/print.c (print_core): Update for rename to nitemset.
5994 * src/print_graph.c (print_graph): Likewise.
5995 * src/state.h: Fix some typos in header comments.
5996
5997 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
5998
5999 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
6000 still sticks to ASCII. Sorry!
6001
6002 * README-hacking: New file, taken mostly from coreutils, with changes
6003 for Bison. Contains much of the contents of:
6004 * README-cvs: Remove.
6005 * bootstrap: Sync from gnulib.
6006 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
6007 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
6008
6009 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
6010
6011 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
6012 Setzer.
6013 (Java Differences): Fix some typos.
6014 * THANKS: Add Sebastian Setzer.
6015
6016 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
6017
6018 * data/java.m4 (b4_single_class_if): Remove.
6019 (b4_abstract_if): Look at "%define abstract".
6020 (b4_lexer_if): New.
6021 (b4_union_name): Rename...
6022 (b4_yystype): ... to this. Map to "%define stype".
6023 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
6024 b4_maybe_throws): Fix quoting.
6025 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
6026 * data/lalr1.java (Lexer interface): Always define.
6027 (Lexer interface within parser class): Remove.
6028 (YYLexer class): New, used when "%code lexer" is present.
6029 (constructor): When "%code lexer" is used, pass %lex-param
6030 to the lexer constructor.
6031 (yylex, yyparse): Remove %lex-param from method invocations
6032 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
6033
6034 * doc/bison.texinfo (Java Bison Interface): Mention "%define
6035 abstract". Rename "%define union_name" to "%define stype".
6036 Rename method names according to previous patch.
6037 (Java Scanner Interface): Describe "%code lexer" instead of
6038 "%pure-parser" and "%define single_class".
6039 (Java Differences): Mention "%code lexer".
6040
6041 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
6042 Include scanner here, using macros from tests/local.at.
6043 (AT_DATA_CALC_Y): Remove final argument.
6044 (_AT_CHECK_JAVA_CALC): Likewise.
6045 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
6046 of %locations and %error-verbose.
6047 (main): Test with and without %lex-param.
6048 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
6049 (AT_BISON_OPTION_POPDEFS): Pop it.
6050
6051 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6052
6053 DJGPP spefic issue. Inhibit the use of disallowed characters for
6054 file name genertion on Win98, WinXP, etc. These are |<>":?*\
6055 and concern testsuite case 46.
6056 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
6057 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
6058 * djgpp/config.bat: Inhibit the use of disallowed characters.
6059
6060 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6061
6062 Miscellaneous %define and %code cleanup.
6063 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
6064 values are interpreted.
6065 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
6066 documentation a little more.
6067 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
6068 muscle_percent_define_insert, muscle_percent_code_grow): New
6069 functions/macros.
6070 * src/muscle_tab.h (muscle_percent_define_insert,
6071 muscle_percent_code_grow): Prototype.
6072 * src/parse-gram.y (prologue_declaration): Use
6073 muscle_percent_define_insert and muscle_percent_code_grow when parsing
6074 %define and %code directives.
6075
6076 Make it easy to share %define boolean variables between the front-end
6077 and back-end. Though not used yet, this will be useful in the future.
6078 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
6079 Bison uses of names rather than just skeleton uses of names.
6080 (b4_percent_define_get, b4_percent_define_ifdef): Rename
6081 b4_percent_define_skeleton_variables(VARIABLE) to
6082 b4_percent_define_bison_variables(VARIABLE).
6083 (b4_percent_code_get, b4_percent_code_ifdef): Rename
6084 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
6085 b4_percent_code_bison_qualifiers(QUALIFIER).
6086 (b4_check_user_names_wrap): Update for renames.
6087 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
6088 muscle_percent_define_default): New functions mimicking
6089 b4_percent_define_flag_if and b4_percent_define_default.
6090
6091 For %define variables, report locations for invalid values and
6092 redefinitions.
6093 * data/bison.m4 (b4_percent_define_flag_if): Read
6094 b4_percent_define_loc(VARIABLE) to report the location of an invalid
6095 value for VARIABLE.
6096 (b4_percent_define_default): Save a special location in
6097 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
6098 must later be reported as invalid.
6099 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
6100 functions.
6101 (muscle_percent_define_insert): Record the location of VARIABLE in
6102 muscle percent_define_loc(VARIABLE), and use it to report the previous
6103 location for a redefinition.
6104 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
6105 (muscle_percent_define_default): Update like b4_percent_define_default.
6106 (muscle_grow_user_name_list): Rename to...
6107 (muscle_user_name_list_grow): ... this for consistency and use
6108 muscle_location_grow.
6109 * src/muscle_tab.h (muscle_location_grow): Prototype.
6110 * tests/input.at (%define errors): Update expected output.
6111 * tests/skeletons.at (%define boolean variables: invalid skeleton
6112 defaults): New test case.
6113
6114 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
6115
6116 * src/print.c (lookahead_set, state_default_rule): Remove.
6117 (print_reductions): Replace state_default_rule invocation with
6118 equivalent use of yydefact, which was computed in token_actions in
6119 tables.c.
6120 (print_results): Don't allocate lookahead_set.
6121
6122 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
6123
6124 * data/lalr1.java: Prefix all private members with yy.
6125
6126 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
6127
6128 Use YYFPRINTF instead of fprintf where appropriate. Reported by
6129 Sebastien Fricker at
6130 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
6131 * THANKS: Add Sebastien Fricker.
6132 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
6133 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
6134 accept a variable number of arguments.
6135
6136 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
6137
6138 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
6139
6140 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6141
6142 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
6143 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
6144 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
6145
6146 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
6147
6148 Undo my 2007-02-07 change, switching back to the c-strcase module
6149 introduced in the 2007-02-03 change. Bruno Haible reported that
6150 the 2007-02-07 change would be dangerous in Turkish if we add a
6151 language whose name contains "i", since "i" is not lowercase "I"
6152 in Turkish.
6153 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
6154 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
6155 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
6156 * m4/.cvsignore: Remove strcase.m4.
6157 * src/getargs.c: Revert 2007-02-07 change, as follows.
6158 Include c-strcase.h.
6159 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
6160
6161 2007-02-11 Bruno Haible <bruno@clisp.org>
6162
6163 Enable the Java related testsuite tests when the only Java compiler
6164 found is a gcj < 4.3. Discussed at
6165 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
6166 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
6167
6168 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
6169
6170 * data/Makefile.am: Update copyright date.
6171 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
6172 yypstate_new returns NULL.
6173 (yypstate_new): Return NULL if malloc does.
6174 * src/reader.c (packgram): Move translation of rule actions from the
6175 beginning of packgram to...
6176 (check_and_convert_grammar): ... here right before packgram is invoked
6177 so it's easier to write more complete comments, and remove redundant
6178 code.
6179
6180 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
6181
6182 As in semantic actions, make @$ in %initial-action, %destructor, and
6183 %printer imply %locations.
6184 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
6185 scanning @$.
6186 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
6187 (@$ in %initial-action implies %locations,
6188 @$ in %destructor implies %locations,
6189 @$ in %printer implies %locations): ... these new test cases.
6190
6191 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
6192
6193 Undo most of the 2007-02-03 change, switching to the strcase module
6194 now that gnulib strcase has been fixed.
6195 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
6196 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
6197 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
6198 * m4/.cvsignore: Add strcase.m4.
6199 * src/getargs.c: Revert 2007-02-03 change, as follows.
6200 Don't include c-strcase.h.
6201 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
6202 strcasecmp has "unspecified behavior" outside the POSIX locale,
6203 but it works fine in practice if at least one argument is ASCII,
6204 as is the case in Bison.
6205
6206 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
6207
6208 * tests/java.at: Skip tests if only one of javac/java is present.
6209 Reported by Joel E. Denny.
6210 * tests/atlocal.in: Adjust copyright years.
6211
6212 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
6213
6214 * data/lalr1.java (Stack): Work around old verifiers that disallow
6215 access to the private fields of an inner class, from the outer class.
6216 We can make Stack's fields public because user code doesn't have access
6217 to the instance of Stack used by parse(). Reported by Paul Eggert.
6218
6219 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
6220
6221 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
6222 the right spot for these files?
6223 * bootstrap.conf (gnulib_modules): Add c-strcase.
6224 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
6225 c-strncasecmp.c.
6226 * src/getargs.c: Include c-strcase.h.
6227 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
6228 to avoid unspecified behavior.
6229
6230 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
6231
6232 * doc/bison.texinfo (Decl Summary): Correct typo.
6233
6234 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
6235
6236 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
6237 Complain if the value does not match empty, "true" or "false".
6238 * data/c++.m4: Adjust default definitions of %define variables.
6239 * data/java.m4: Adjust default definitions of %define variables.
6240 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
6241 to above behavior.
6242 * tests/input.at (Boolean %define variables): Test new behavior.
6243
6244 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
6245
6246 * NEWS: Mention java.
6247 * TODO: Remove things that are done.
6248 * bootstrap.conf: Add javacomp-script and javaexec-script.
6249 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
6250
6251 * data/Makefile.am: Add new files.
6252 * data/java-skel.m4: New.
6253 * data/java.m4: New.
6254 * data/lalr1.java: New.
6255
6256 * doc/bison.texinfo: Put "A Complete C++ Example" under
6257 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
6258 under Other Languages.
6259
6260 * src/getargs.c (valid_languages): Add Java.
6261 * src/getargs.h (struct bison_language): Update size of string fields.
6262
6263 * tests/Makefile.am: Add java.at.
6264 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
6265 * tests/java.at: New.
6266 * tests/testsuite.at: Include it.
6267
6268 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
6269
6270 Clean up.
6271 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
6272 at_directive_argv arguments so these no longer have to be global
6273 variables. Also, update the implementation for the following changes.
6274 (fail_for_at_directive_too_many_args,
6275 fail_for_at_directive_too_few_args): Add at_directive_name argument.
6276 (at_directive_name): Remove as at_directive_argv[0] will be used for
6277 this now.
6278 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
6279 for the directive name.
6280 (at_directive_argc, at_directive_argv): Make these local within
6281 skel_lex instead of global.
6282 (INITIAL): Update directive start action for above changes.
6283 (SC_AT_DIRECTIVE_ARG): Rename to...
6284 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
6285 (SC_AT_DIRECTIVE_SKIP_WS): Update.
6286 (scan_skel): Move yylex_destroy to...
6287 (skel_scanner_free): ... here.
6288 * tests/skeletons.at (installed skeleton file name): Rename to...
6289 (installed skeleton file names): ... this.
6290
6291 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
6292
6293 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
6294 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
6295 Summary" not "Directives".
6296 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
6297 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
6298 since the former is now the more complete one.
6299 (Prologue Alternatives): Likewise and do the same for %defines.
6300 (Table of Symbols): Add summary of %code, add summary of %define, and
6301 move full %code documentation to...
6302 (Decl Summary): ... here for consistency with other entries in these
6303 sections.
6304 Move %define entry in order to keep this list alphabetized.
6305 Reword %define entry a little to put less emphasis on the skeleton
6306 concept, which most users shouldn't have to think about.
6307
6308 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
6309
6310 Adjust to recent gnulib changes.
6311 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
6312 Add string.h, string_.h, unistd_.h, wchar_.h.
6313 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
6314 * src/system.h: Don't include <stpcpy.h>; this is now done by
6315 <string.h>.
6316
6317 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
6318
6319 Simplify implementation of unqualified %code, implement macros for
6320 uniform treatment of boolean %define flags. Document %define.
6321 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
6322 b4_percent_code_ifdef): New.
6323 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
6324 * data/c++.m4: Define default value for global_tokens_and_yystype.
6325 * data/glr.cc: Likewise.
6326 * data/location.cc: Use b4_percent_define_flag_if.
6327
6328 * doc/bison.texinfo (Decl Summary): Document %define.
6329
6330 * src/parse-gram.y (Unqualified %code): Change muscle name to
6331 b4_percent_code().
6332 (content.opt): Default to empty.
6333
6334 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6335
6336 Implement support for relative and absolute skeleton file names.
6337 Discussed starting at
6338 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
6339 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
6340 (Bison Options): Document in --skeleton entry.
6341 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
6342 full_skeleton can't necessarily hold all of pkgdatadir.
6343 If the specified skeleton file name contains a `/', don't prepend
6344 pkgdatadir.
6345 * src/parse-gram.y (prologue_declaration): If the specified skeleton
6346 file name contains a `/', prepend the grammar file directory.
6347 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
6348 * skeletons.at: New file.
6349 (relative skeleton file names): New test case.
6350 (installed skeleton file names): New test case.
6351 * tests/testsuite.at: Include skeletons.at.
6352
6353 * bootstrap: Update copyright to 2007.
6354
6355 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
6356
6357 * bootstrap: Remove occurrences of .#bootmp from the files.
6358
6359 2007-01-17 Akim Demaille <akim@epita.fr>
6360
6361 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
6362 nonterminals.
6363 Use per-type %printer.
6364
6365 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6366
6367 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
6368 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6369 djgpp/config.site, src/files.c, src/files.h, src/main.c,
6370 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
6371 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
6372 tests/glr-regression.at, tests/input.at, tests/local.at,
6373 tests/output.at, tests/torture.at: Update copyright to 2007.
6374
6375 2007-01-16 Akim Demaille <akim@epita.fr>
6376
6377 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
6378 error code.
6379 (Calc++ Scanner): Exit with failure if we can't open the input
6380 file.
6381 Accept "-" standing for stdin.
6382 (Calc++ Top Level): Print the result only if the parsing was
6383 successful.
6384
6385 2007-01-16 Akim Demaille <akim@epita.fr>
6386
6387 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
6388
6389 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
6390 and Joel E. Denny <jdenny@ces.clemson.edu>
6391
6392 Clean up %define and %code implementation in M4 some. Most
6393 importantly, rename all related macros to be in the b4_percent_define
6394 and b4_percent_code namespaces. Also, complete support for `.' in
6395 %define variable names and %code qualifiers.
6396 * data/bison.m4 (b4_check_user_names): Check for special
6397 "SKELETON-NAMESPACE(name)" macros instead of using two nested
6398 m4_foreach loops.
6399 (b4_get_percent_define, b4_get_percent_code): Rename to...
6400 (b4_percent_define_get, b4_percent_code_get): ... these.
6401 Extend documentation with examples.
6402 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
6403 b4_percent_define_skeleton_variables and
6404 b4_percent_code_skeleton_qualifiers.
6405 Expect any value for the %define variable `foo' to be stored in the
6406 macro named `b4_percent_define(foo)'; expect any %code blocks for the
6407 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
6408 expect any unqualified %code blocks to be stored in a macro named
6409 `b4_percent_code_unqualified'.
6410 Use m4_indir so that %define variable names and %code qualifiers can
6411 contain `.', which is allowed by the grammar parser.
6412 (b4_percent_define_default): New macro to set a default value for a
6413 %define variable.
6414 (m4_wrap): Update wrapped code, and fix some underquoting.
6415 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
6416 Expect grammar uses of %define variables and %code qualifiers to be
6417 defined in b4_percent_define_user_variables and
6418 b4_percent_code_user_qualifiers.
6419 * data/c++.m4: Use b4_percent_define_default rather than
6420 m4_define_default. Fix some underquoting. Skeleton usage of %define
6421 variable define_location_comparison now implies skeleton usage of
6422 %define variable filename_type.
6423 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6424 data/push.c, data/yacc.c: Update macro names.
6425 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
6426 muscle names.
6427
6428 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6429
6430 DJGPP specific issues.
6431
6432 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
6433 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
6434
6435 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6436
6437 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
6438 run parsers in all tests so that Valgrind is invoked during
6439 maintainer-check-valgrind.
6440 (Duplicate representation of merged trees): Free all semantic values.
6441 (Duplicated user destructor for lookahead): Likewise.
6442
6443 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6444
6445 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
6446 command-line prefix.
6447 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
6448 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
6449 miss Valgrind messages.
6450 (Exploding the Stack Size with Malloc): Likewise.
6451
6452 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6453
6454 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
6455 locals. Reported by Juan Manuel Guerrero at
6456 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
6457 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
6458 Fix some indentation also.
6459 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
6460 explaining this issue.
6461
6462 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
6463 and Joel E. Denny <jdenny@ces.clemson.edu>
6464
6465 Simplify union and prologue handling, and escape union and lex/parse
6466 params with digraphs.
6467 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
6468 values to the empty string since these are no longer guaranteed
6469 initialized by the front-end.
6470 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
6471 braces around b4_user_stype since this is no longer done by the
6472 front-end.
6473 * src/files.c, src/files.h (pre_prologue_obstack,
6474 post_prologue_obstack): Remove.
6475 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
6476 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
6477 with digraphs. This fixes lex params and parse params.
6478 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
6479 * src/output.c (prepare): Remove muscle insertion of the prologues.
6480 (output): Remove freeing of pre_prologue_obstack and
6481 post_prologue_obstack.
6482 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
6483 than prologue_augment for prologue parsing so you don't need prologue
6484 obstacks.
6485 (grammar_declaration): For %union RHS, use `braceless' instead of
6486 "{...}" so that braces are already stripped and code is escaped with
6487 digraphs.
6488 * src/reader.c (prologue_augment): Remove.
6489 (reader): Remove initialization of pre_prologue_obstack and
6490 post_prologue_obstack.
6491 * src/reader.h (prologue_augment): Remove.
6492
6493 * data/c.m4: Remove stray parenthesis.
6494
6495 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6496
6497 Remove quotes from variables names in %define directives and from
6498 qualifiers in %code directives, and restrict the characters that are
6499 allowed in them to M4-friendly ones. For %define, continue to support
6500 the quoted form as a deprecated feature. Discussed starting at
6501 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
6502 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
6503 %code.
6504 * doc/bison.texinfo (Prologue Alternatives): Update.
6505 (Decl Summary): In %defines entry, update mention of `%code requires'
6506 and `%code provides'.
6507 (C++ Location Values): Update %define uses.
6508 (Calc++ Parser Interface): Likewise.
6509 (Calc++ Parser): Likewise, and update `%code requires' uses.
6510 (Table of Symbols): Update %code documentation.
6511 * src/parse-gram.y (prologue_declaration): For %define variables, use
6512 `variable' instead of `STRING'.
6513 (grammar_declaration): For %code qualifiers, use `ID' instead of
6514 `STRING'.
6515 (variable): New nonterminal that takes an `ID' or a `STRING'.
6516 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
6517 and %define uses.
6518 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
6519 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
6520 (%define errors): Update %define uses.
6521
6522 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6523
6524 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
6525 instead of muscle_insert for %define values so that M4-special
6526 characters are replaced with digraphs.
6527 * tests/input.at (%define errors): Extend to check weird values.
6528
6529 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6530
6531 Instead of having skeletons declare all valid %define variables and
6532 %code qualifiers, provide macros that retrieve the associated values
6533 and build these lists automatically. Thus Bison will now warn when a
6534 variable or qualifier is not used by the skeleton in the current
6535 invocation regardless of whether it might sometimes be used by that
6536 skeleton in other invocations. Also, move all %define value macros to
6537 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
6538 form, which is replaced by %code.
6539 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
6540 (b4_check_user_names): ... this, and change the series of valid name
6541 arguments to a single list argument for names used in the skeleton
6542 similar to the existing list argument for names used in the grammar.
6543 Warn instead of complaining.
6544 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
6545 values and %code code, to format %code code properly, and to build
6546 lists of all %define variables and %code qualifiers used in the
6547 skeleton: b4_skeleton_percent_define_variables and
6548 b4_skeleton_percent_code_qualifiers.
6549 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
6550 Remove, and...
6551 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
6552 the skeleton names lists can finish building first. In place of
6553 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
6554 expect the lists b4_user_percent_define_variables and
6555 b4_user_percent_code_qualifiers.
6556 * data/c++.m4: Where setting default values for b4_parser_class_name,
6557 b4_location_type, b4_filename_type, b4_namespace, and
6558 b4_define_location_comparison, update their names to the
6559 b4_percent_define_ namespace.
6560 * data/glr.c: Don't use b4_check_percent_define_variables and
6561 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6562 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
6563 (b4_parser_class_name, b4_namespace): Define these using
6564 b4_get_percent_define for parser_class_name and namespace.
6565 * data/location.cc: Use b4_get_percent_define.
6566 * data/push.c: Don't use b4_check_percent_define_variables and
6567 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6568 * data/yacc.c: Likewise, and don't call m4_exit in
6569 b4_use_push_for_pull_if or m4_wrap code will never execute.
6570 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
6571 Rename to...
6572 (muscle_grow_user_name_list): ... this for consistency with the
6573 terminology used in bison.m4.
6574 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
6575 %define variable names, and rename muscle used_percent_define_variables
6576 to user_percent_define_variables.
6577 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
6578 user_percent_code_qualifiers.
6579 (content): Remove.
6580 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
6581 {CODE} form is no longer accepted.
6582 * tests/input.at (Reject bad %code qualifiers): Rename to...
6583 (Reject unused %code qualifiers): ... this, and update test output.
6584 (%define error): Update test output.
6585
6586 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
6587
6588 Check for unrecognized %define variables similar to checking for
6589 unrecognized %code qualifiers. Check for redefined %define variables.
6590 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
6591 generalizes...
6592 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
6593 (b4_check_percent_define_variables): New, also wraps it.
6594 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
6595 variables using b4_check_percent_define_variables.
6596 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
6597 all those exercised in the test suite and all those listed in the
6598 `Default values' section of c++.m4. Are there others?
6599 * data/push.c, data/yacc.c: Declare no valid %define variables.
6600 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
6601 similar to muscle_find, but it works even when the muscle stores a
6602 const value.
6603 (muscle_grow_used_name_list): New function for constructing the used
6604 name list muscles that b4_check_for_unrecognized_names requires.
6605 * src/parse-gram.y (prologue_declaration): Warn if a variable is
6606 %define'd more than once. Define the b4_used_percent_define_variables
6607 muscle with muscle_grow_used_name_list.
6608 (grammar_declaration): Abbreviate %code code with
6609 muscle_grow_used_name_list.
6610 * tests/input.at (%define errors): New.
6611
6612 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6613
6614 Provide warn_at, complain_at, and fatal_at function callbacks to the
6615 skeletons, and use this for %code qualifier complaints.
6616 * data/bison.m4 (b4_error_at): New, invoked by...
6617 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
6618 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
6619 @fatal_at(...@) directives.
6620 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
6621 qualifiers in b4_used_percent_code_qualifiers and to use
6622 b4_complain_at.
6623 * src/location.c, src/location.h (boundary_set_from_string): New global
6624 function.
6625 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
6626 function.
6627 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
6628 to b4_used_percent_code_qualifiers.
6629 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
6630 function.
6631 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
6632 (lineno): Rename to...
6633 (out_lineno): ... this so I don't misunderstand it again.
6634 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
6635 here; these newlines are in the input but not the output file.
6636 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
6637 (at_directive_perform): ... this new static function, and add handling
6638 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
6639 directives.
6640 * tests/input.at (Reject bad %code qualifiers): Update test output with
6641 locations and extend.
6642
6643 * tests/output.at (Output file name: [, Output file name: ]): Remove
6644 bogus comment about these tests failing.
6645
6646 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6647
6648 Clean up b4_check_percent_code_qualifiers a little.
6649 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
6650 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
6651 documentation and add examples.
6652 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
6653 qualifiers here.
6654
6655 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
6656
6657 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
6658 unreliable -- especially when they're hidden inside another macro.
6659 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
6660 data/c.m4: Remove m4_divert(-1).
6661 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6662 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
6663 m4_divert_push(0) and m4_divert_pop(0).
6664 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
6665 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
6666 pushed and popped by m4sugar, should be first on the stack.
6667
6668 Provide warn, complain, and fatal function callbacks to the skeletons.
6669 This provides more flexibility than m4_fatal, improves the error
6670 message format, and captures messages for translation. Discussed
6671 starting at
6672 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
6673 * data/bison.m4 (b4_error): New, invoked by...
6674 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
6675 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
6676 directives. Because these M4 macros might be called when the current
6677 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
6678 the previous removal of uses of m4_divert, which caused trouble.
6679 (b4_check_percent_code_qualifiers): Use b4_complain instead of
6680 m4_fatal to report unrecognized %code qualifiers.
6681 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
6682 push parser requests.
6683 * data/glr.c: Use b4_complain instead of m4_fatal to report
6684 non-deterministic push parser requests.
6685 Update @output usage to @output(...@) form.
6686 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
6687 report missing %defines. Update @output usage to @output(...@) form.
6688 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
6689 @output(...@) form.
6690 * src/main.c (main): Invoke skel_scanner_free.
6691 * src/scan-skel.h (skel_scanner_free): Prototype new function.
6692 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
6693 obstack_for_string from flex-scanner.h.
6694 (YY_DECL): Use to declare skel_lex static.
6695 (decode_at_digraphs): Remove; now handled in the new
6696 SC_AT_DIRECTIVE_ARG start condition.
6697 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
6698 functions.
6699 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
6700 at_directive_argv): New static globals.
6701 (INITIAL): Use fail_for_invalid_at.
6702 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
6703 recognize the start of a generalized `@directive(...@)' form and
6704 start...
6705 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
6706 directive args (using the new obstack_for_string), to decode the
6707 contained @ diagraphs, and to perform the directive. It recognizes
6708 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
6709 @output(...@).
6710 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
6711 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
6712 `@,'.
6713 (scan_skel): Initialize obstack_for_string on the first call.
6714 (skel_scanner_free): New function to free obstack_for_string.
6715 * tests/input.at (Reject bad %code qualifiers): Update test output.
6716
6717 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
6718
6719 Consolidate the 4 prologue alternative directives (%code, %requires,
6720 %provides, and %code-top) into a single %code directive with an
6721 optional qualifier field. Discussed at
6722 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
6723 * NEWS (2.3a+): Rewrite the existing entry for the prologue
6724 alternatives.
6725 * doc/bison.texinfo (Prologue Alternatives): Update.
6726 (Decl Summary): Update to %code "requires" and %code "provides".
6727 (Calc++ Parser): Update to %code "requires".
6728 (Table of Symbols): Remove entries for %requires, %provides, and
6729 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
6730 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
6731 are replaced by b4_percent_code_provides and b4_percent_code_requires,
6732 which are skeleton-specific.
6733 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
6734 declare what %code qualifiers it supports and to complain if any other
6735 qualifiers were used in the grammar.
6736 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
6737 and b4_user_code([b4_percent_code_provides]) in place of
6738 b4_user_requires and b4_user_provides.
6739 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
6740 Add b4_user_code([b4_percent_code_top]) and
6741 b4_user_code([b4_percent_code]).
6742 Invoke b4_check_percent_code_qualifiers.
6743 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
6744 PERCENT_REQUIRES): Remove.
6745 (grammar_declaration): Remove RHS's for %code-top, %provides, and
6746 %requires. Rewrite the %code RHS as the unqualified form defining the
6747 muscle b4_percent_code. Add another RHS for the qualified %code form,
6748 which defines muscles of the form b4_percent_code_QUALIFIER and the
6749 b4_used_percent_code_qualifiers muscle.
6750 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
6751 PERCENT_REQUIRES): Remove.
6752 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
6753 %code "requires" and %code "provides".
6754 * tests/input.at (Reject bad %code qualifiers): New.
6755
6756 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
6757
6758 Use the new code_props interface for destructors and printers.
6759 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
6760 printer_location members, and change the type of the destructor and
6761 printer members to code_props.
6762 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
6763 symbol_printer_get, semantic_type_destructor_set,
6764 semantic_type_printer_set, default_tagged_destructor_set,
6765 default_tagless_destructor_set, default_tagged_printer_set,
6766 default_tagless_printer_set): Use code_props in arguments and return
6767 types in place of char const * and location.
6768 (symbol_destructor_location_get, symbol_printer_location_get): Remove
6769 since the locations are now contained in the return of
6770 symbol_destructor_get and symbol_printer_get.
6771 * src/output.c (symbol_destructors_output, symbol_printers_output):
6772 Replace with...
6773 (symbol_code_props_output): ... this to eliminate duplicate code.
6774 (output_skeleton): Update to use symbol_code_props_output.
6775 * src/reader.c (symbol_should_be_used): Update use of
6776 symbol_destructor_get.
6777 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
6778 Update uses of the various _destructor_set and _printer_set functions.
6779 * src/symtab.c: (default_tagged_destructor_location,
6780 default_tagless_destructor_location, default_tagged_printer_location,
6781 default_tagless_printer_location): Remove since we...
6782 (default_tagged_destructor, default_tagless_destructor,
6783 default_tagged_printer, default_tagless_printer): ... change the type
6784 of these to code_props.
6785 (symbol_new, semantic_type_new, symbol_destructor_set,
6786 semantic_type_destructor_set, symbol_destructor_get,
6787 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
6788 symbol_check_alias_consistency, default_tagged_destructor_set,
6789 default_tagless_destructor_set, default_tagged_printer_set,
6790 default_tagless_printer_set): Update.
6791 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
6792 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
6793 code_props members.
6794 (symbol_print): Use SYMBOL_CODE_PRINT.
6795
6796 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
6797
6798 Use the new code_props interface for rule actions.
6799 * src/symlist.h (symbol_list): Replace action, action_location, and
6800 used members with a code_props action_props member.
6801 * src/reader.c (symbol_should_be_used, grammar_rule_check,
6802 grammar_midrule_action, grammar_current_rule_merge_set,
6803 grammar_current_rule_symbol_append, packgram): Update.
6804 * src/scan-code.h (translate_rule_action): Remove, no longer used.
6805 * src/scan-code.l (handle_action_dollar): Update.
6806 (translate_rule_action): Remove, no longer used.
6807 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
6808
6809 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6810
6811 Use the new code_props interface in parse-gram.y.
6812 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
6813 Update all uses of translate_* functions to use the new code_props
6814 interface and to use gram_scanner_last_string_free and
6815 code_scanner_last_string_free where possible.
6816 (grammar_declaration): symbol_list_destructor_set and
6817 symbol_list_printer_set now perform the translation, so don't do it
6818 here. Use gram_scanner_last_string_free where possible.
6819 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
6820 translate_code): Remove, no longer used.
6821 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
6822 symbol_list_printer_set): Perform code translation here rather than
6823 depending on the caller to do so.
6824
6825 * src/symlist.h (struct symbol_list): Correct some documentation typos.
6826 * src/scan-gram.h (gram_last_string): Remove declaration.
6827 * src/scan-gram.l (last_string): Declare it static.
6828
6829 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6830
6831 Encapsulate code properties and related functionality for the various
6832 destructors, printers, and actions into a code_props structure and
6833 interface. This patch merely implements code_props in scan-code.h and
6834 scan-code.l. Future patches will rewrite other modules to use it.
6835 Discussed starting at
6836 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
6837 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
6838 consistently initialize const structs that have an empty location
6839 field.
6840 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
6841 to ensure consistency.
6842 * src/scan-code.h (code_props): New structure.
6843 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
6844 function, macro, and const global variable for initializing a
6845 code_props with no code.
6846 (code_props_plain_init, code_props_symbol_action_init,
6847 code_props_rule_action_init, code_props_translate_code): The rest of
6848 the new code_props functional interface. Among other things, the init
6849 functions set the code_props kind field so that
6850 code_props_translate_code will know whether to behave like
6851 translate_symbol_action, translate_rule_action, or translate_code.
6852 These old translate functions must remain until all other modules are
6853 updated to use the new code_props interface.
6854 (code_scanner_last_string_free): New function similar to
6855 gram_scanner_last_string_free.
6856 (code_scanner_free): Add documentation.
6857 * src/scan-code.l: Implement the new interface.
6858 (code_lex): Make it static, add a code_props* argument, and remove the
6859 rule argument.
6860 (last_string): New static global similar to the one in scan-gram.l.
6861 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
6862 instead of rule.
6863 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
6864 code_props since Bison may one day use this information for destructors
6865 and printers.
6866 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
6867 (handle_action_dollar): Use symbol_list_n_get and set used flag
6868 directly since symbol_list_n_used_set is removed.
6869 (translate_action): Add a code_props* argument and remove the rule,
6870 action, and location arguments. Pass the code_props* on to code_lex.
6871 (translate_rule_action, translate_symbol_action, translate_code):
6872 Rewrite as wrappers around the new code_props interface.
6873 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
6874 it would eventually need to break the encapsulation of code_props.
6875
6876 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
6877
6878 * etc/.cvsignore: New.
6879
6880 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
6881
6882 Add maintainer-push-check to run maintainer-check using push parsing in
6883 place of pull parsing where available.
6884 * Makefile.am (maintainer-push-check): New.
6885 * data/bison.m4 (b4_use_push_for_pull_if): New.
6886 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
6887 appropriately based on their existing values.
6888 (yypush_parse): Don't print push-parser-specific diagnostics if push
6889 parsing is being used in place of pull parsing.
6890 * data/yacc.c: If push parsing should replace pull parsing, redirect to
6891 push.c.
6892 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
6893 variable, and insert b4_use_push_for_pull_flag into muscles.
6894 * tests/Makefile.am (maintainer-push-check): New.
6895
6896 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
6897
6898 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
6899 (whether successful or failed) so that yypush_parse can be invoked
6900 again to start a new parse using the same yypstate.
6901 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
6902 check multiple yypull_parse invocations on the same yypstate. For pull
6903 mode, extend to check multiple yyparse invocations.
6904 (Exploding the Stack Size with Alloca): Extend to try with
6905 %push-pull-parser.
6906 (Exploding the Stack Size with Malloc): Likewise.
6907
6908 * tests/calc.at (Simple LALR Calculator): Don't specify
6909 %skeleton "push.c" since %push-pull-parser implies that now.
6910 * tests/headers.at (export YYLTYPE): Don't check for the push
6911 declarations. Otherwise, this test case can't be used to see if push
6912 mode can truly emulate pull mode.
6913 * tests/input.at (Torturing the Scanner): Likewise.
6914 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
6915 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
6916 AT_YACC_IF, which now includes the case of push mode since %skeleton
6917 need not be used for push mode. This will be more intuitive once
6918 push.c is renamed to yacc.c.
6919
6920 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
6921
6922 For push mode, convert yyparse from a macro to a function, invoke yylex
6923 instead of passing a yylexp argument to yypull_parse, and don't
6924 generate yypull_parse or yyparse unless %push-pull-parser is declared.
6925 Discussed starting at
6926 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
6927 * data/bison.m4 (b4_pull_if): New.
6928 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
6929 * data/push.c: Improve M4 quoting a little.
6930 (b4_generate_macro_args, b4_parenthesize): Remove.
6931 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
6932 any time a pull parser is requested.
6933 Don't #define this as a wrapper around yypull_parse. Instead, when
6934 both push and pull are requested, make it a function that does that
6935 same thing.
6936 (yypull_parse): If there's a b4_prefix, #define this to
6937 b4_prefix[pull_parse] when both push and pull are requested.
6938 Don't define this as a function unless both push and pull are
6939 requested.
6940 Remove the yylexp argument and hard-code yylex invocation instead.
6941 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
6942 %push-parser.
6943 * src/getargs.c (pull_parser): New global initialized to true.
6944 * getargs.h (pull_parser): extern it.
6945 * src/output.c (prepare): Insert pull_flag muscle.
6946 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
6947 (prologue_declaration): Set both push_parser and pull_parser = true for
6948 %push-pull-parser. Set push_parser = true and pull_parser = false for
6949 %push-parser.
6950 * src/scan-gram.l: Don't accept %push_parser as an alternative to
6951 %push-parser since there's no backward-compatibility concern here.
6952 Scan %push-pull-parser.
6953 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
6954 instead of %push-parser.
6955 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
6956 prototype it in the module that calls yyparse.
6957 * tests/input.at (Torturing the Scanner): Likewise.
6958 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
6959
6960 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
6961
6962 Update etc/bench.pl. Optimize push mode a little (the yyn change
6963 deserves most of the credit).
6964 * Makefile.am (SUBDIRS): Add etc subdirectory.
6965 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
6966 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
6967 yytoken, yyval, and yyloc declarations to...
6968 (yyparse or yypush_parse): ... here to improve performance. For
6969 yypush_parse invocations after the first, be sure to assign yyn its old
6970 value again.
6971 (yypstate_new): Don't bother initializing the yyresult field since the
6972 initial value isn't used.
6973 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
6974 remove the #define that, in push mode, set it to yyps->NAME.
6975 * etc/Makefile.am: New.
6976 * etc/bench.pl: Remove and build it instead from...
6977 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
6978 "tests/bison" from the build directory by default rather than just
6979 invoking "bison" from $PATH.
6980 (calc_grammar): Update push parser code: don't declare yylval globally,
6981 don't define yyparse_wrapper, and don't #define yyparse.
6982 (bench_grammar): Update to check all working combinations of yacc.c,
6983 push.c, impure, pure, pull, and push.
6984
6985 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
6986
6987 For push mode, add pull wrappers around yypush_parse.
6988 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
6989 (yypull_parse): New function wrapping yypush_parse.
6990 (yyparse): New #define wrapping yypull_parse.
6991 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
6992 is declared.
6993 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
6994 prototype yylex in the module that calls yyparse, and don't prototype
6995 yyparse there. Otherwise, the yyparse expansion won't compile.
6996 * tests/input.at (Torturing the Scanner): Likewise.
6997
6998 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
6999
7000 Enable push parsers to operate in impure mode. Thus, %push-parser no
7001 longer implies %pure-parser. The point of this change is to move
7002 towards being able to test the push parser code by running the entire
7003 test suite as if %push-parser had been declared.
7004 * data/push.c (yypush_parse): For impure mode, remove the
7005 yypushed_char, yypushed_val, and yypushed_loc arguments.
7006 Instead, declare these as local variables initialized to the global
7007 yychar, yylval, and yylloc.
7008 For the first yypush_parse invocation only, restore the initial values
7009 of these global variables when it's time to read a token since they
7010 have been overwritten.
7011 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
7012 %push-parser.
7013 * tests/calc.at (Simple LALR(1) Calculator): Always declare
7014 %pure-parser along with %push-parser since this test case was designed
7015 for pure push parsers.
7016 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
7017 (AT_YACC_OR_PUSH_IF): New.
7018 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
7019 add a note that it's still wrong for some cases (as it has been for a
7020 while).
7021 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
7022 %push-parser no longer implies %pure-parser.
7023
7024 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7025
7026 Remove some unnecessary differences between the pull parser code and
7027 the push parser code. This patch enables yynerrs in push mode.
7028 * data/push.c: Reformat M4 a little.
7029 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
7030 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
7031 because push mode is on. Instead, if pure mode is on, move yynerrs
7032 to...
7033 (b4_declare_parser_state_variables): ... here.
7034 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
7035 to yyps->NAME so it can be used in yypush_parse.
7036 (yypush_parse): Don't omit uses of yynerrs in push mode.
7037
7038 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7039
7040 Fix bug such that the first pushed token's value and location are
7041 sometimes overwritten (sometimes by %initial-action) before being used.
7042 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
7043 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
7044 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
7045 more closely mimic the pull parser logic.
7046 Don't copy the pushed token to yychar, yylval, and yylloc until it's
7047 time to read a token, which is after any initialization of yylval and
7048 yylloc.
7049 (gottoken): Rename label to...
7050 (yyread_pushed_token): ... for clarity and to avoid infringing on the
7051 user namespace.
7052
7053 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7054
7055 Rearrange initialization of the parser state variables so that the
7056 skeleton doesn't have to have a copy for pull mode and another for push
7057 mode. This patch also fixes at least a bug such that yylloc was not
7058 initialized (with b4_location_initial_line and
7059 b4_location_initial_column) upon calling yypush_parse. However, that
7060 initialization now overwrites the first token's location;
7061 %initial-action assigning @$ already did the same thing, and both bugs
7062 will be fixed in a later patch.
7063 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
7064 (b4_declare_parser_state_variables): Remove initialization of yytoken,
7065 yyss, yyvs, yyls, and yystacksize.
7066 (yypstate_new): Remove initialization of some yypstate fields: yystate,
7067 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
7068 yylsp.
7069 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
7070 yyps->NAME so it can be used in yypush_parse.
7071 (yyparse or yypush_parse): For yypush_parse, don't print the
7072 "Starting parse" diagnostic for invocations after the first.
7073 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
7074 yypush_parse, only do it for the first invocation.
7075 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
7076 initialization to occur in yypush_parse but only on the first
7077 invocation.
7078
7079 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7080
7081 * data/push.c: Add CPP guards around push parser declarations in both
7082 the header and the code file.
7083 In the code file, move the push parser declarations to the same place
7084 they appear in the header file.
7085 Clean up the M4 some, especially the inconsistent underquoting in
7086 some b4_c_function_def and b4_c_function_decl uses.
7087
7088 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7089
7090 Encapsulate the push parser state variables into an M4 macro so the
7091 push skeleton doesn't have to list them again for pull mode's yyparse.
7092 For push mode, remove yypush_parse's local equivalents of these
7093 variables to eliminate unnecessary copying between the two sets at
7094 run-time. This patch also fixes at least a bug related to multiple
7095 %initial-action invocations in push mode.
7096 * data/push.c (b4_declare_parser_variables): Rename to...
7097 (b4_declare_scanner_communication_variables): ... this for clarity and
7098 update both uses.
7099 (b4_declare_yyparse_variables): Remove and move its contents to the one
7100 spot where it was invoked.
7101 (b4_declare_parser_state_variables): New macro containing the parser
7102 state variables required by push mode.
7103 (struct yypstate): Replace all fields but yynew with
7104 b4_declare_parser_state_variables.
7105 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
7106 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
7107 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
7108 (yyparse or yypush_parse): For yyparse in pull mode, replace local
7109 parser state variable declarations with
7110 b4_declare_parser_state_variables.
7111 Don't initialize parser state variables when calling yypush_parse since
7112 yypstate_new already does that.
7113 Invoke the user's initial action only upon the first yypush_parse
7114 invocation.
7115 Remove all code that copies between the local parser state variables
7116 and the yypstate.
7117
7118 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7119
7120 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
7121 prevent a name collision in a future patch where these names will
7122 sometimes be #define'd.
7123 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
7124 since it no longer has the same name as the existing argument.
7125 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
7126
7127 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
7128 and Joel E. Denny <jdenny@ces.clemson.edu>
7129
7130 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
7131 that the argument is case-insensitive, and there's no `=' here.
7132 For the %skeleton entry, mention that %language is better.
7133 (Bison Options): Likewise for --language and --skeleton. Move the
7134 --skeleton entry so that the `Tuning the parser' section is sorted
7135 alphabetically on long options.
7136 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
7137 %language directive in detail here; cross-reference the %language
7138 documentation instead.
7139 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
7140 `%require "2.3b"' so that the example is always up-to-date.
7141 (Table of Symbols): Add entries for %language and %skeleton.
7142 * examples/extexi (normalize): Instead of replacing every %require
7143 argument with the current Bison version, just substitute for
7144 `@value{VERSION}'. This guarantees that we're testing what actually
7145 appears in the documentation.
7146 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
7147 rather than `@VERSION@'.
7148
7149 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7150
7151 * NEWS: Reword the %language news a bit, and put it earlier.
7152
7153 * src/getargs.c (skeleton_arg): Last arg is now location const *.
7154 Rewrite to simplify the logic.
7155 (language_argmatch): Likewise.
7156 (program_name): We now own this var.
7157 * src/getargs.h (struct bison_language): Use char[] rather than
7158 const char *.
7159
7160 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
7161 Java is supported.
7162 * src/complain.c (program_name): Remove decl; no longer needed.
7163 * src/main.c (program_name): Remove; now belongs to getargs.
7164
7165 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
7166
7167 * NEWS: Document %language.
7168
7169 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
7170
7171 * data/c-skel.m4, data/c++-skel.m4: New files.
7172 * data/glr.c: Complain on push parsers.
7173
7174 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
7175 over %skeleton.
7176 (Decl Summary): Document %language and %skeleton.
7177 (Command line): Document -L.
7178
7179 * examples/extexi: Rewrite %require directive.
7180 * examples/calc++/Makefile.am: Pass VERSION to extexi.
7181
7182 * src/files.c (compute_exts_from_gc): Look in language structure
7183 for .y extension.
7184 (compute_file_name_parts): Check whether .tab should be added.
7185 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
7186 (language, skeleton_arg, language_argmatch): New.
7187 (long_options): Add --language.
7188 (getargs): Use skeleton_arg, add -L/--language.
7189 * src/getargs.h: Include location.h.
7190 (struct bison_language, language, skeleton_arg, language_argmatch): New.
7191 * src/output.c (prepare): Pick default skeleton from struct language.
7192 Don't dispatch C skeletons here.
7193 * src/parse-gram.y (PERCENT_LANGUAGE): New.
7194 (prologue_declaration): Add "%language" rule, use skeleton_arg.
7195 * src/scan-gram.l ("%language"): New rule.
7196
7197 * tests/calc.at: Test %skeleton and %language.
7198 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
7199 (AT_GLR_IF): Look for %skeleton "glr.cc".
7200 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
7201 (AT_YACC_IF): Reject %language.
7202
7203 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7204
7205 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
7206 since it wasn't used; only the typedef name 'semantic_type' is needed.
7207 Also, omit trailing white space.
7208
7209 * bootstrap: Sync from coreutils.
7210 (gnulib_extra_files): Add build-aux/announce.gen.
7211 (slurp): Adjust .gitignore files like .cvsignore files.
7212 * build-aux/announce-gen: Remove from CVS, since bootstrap
7213 now creates this.
7214
7215 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
7216
7217 Make %push-parser imply %pure-parser. This fixes several bugs; see
7218 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
7219 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
7220 pure_parser = true.
7221 * data/push.c: Don't bother testing b4_push_if when deciding whether
7222 to expand b4_declare_parser_variables globally.
7223 (yypush_parse): Likewise in here.
7224
7225 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
7226 (yy_reduce_print): Reformat M4 for readability.
7227
7228 2006-12-15 Bob Rossi <bob@brasko.net>
7229 and Joel Denny <jdenny@ces.clemson.edu>
7230
7231 * data/push.c (yypstate): Add typedef, and update all uses of
7232 struct yypstate to just yypstate.
7233 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
7234
7235 2006-12-14 Bob Rossi <bob@brasko.net>
7236
7237 * data/push.c (yypush_parse): Declare prototype regardless of
7238 %locations option.
7239
7240 2006-12-14 Bob Rossi <bob@brasko.net>
7241
7242 * data/push.c (yyparse): Remove the prototype and the #define when in
7243 push-parser mode.
7244
7245 2006-12-13 Bob Rossi <bob@brasko.net>
7246
7247 * data/push.c (yypstate_init): Rename to...
7248 (yypstate_new): ... this and use b4_c_function_def.
7249 (yypstate_delete): New.
7250 (yypush_parse): Change parameters yynval and yynlloc to be const.
7251 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
7252 yypstate_delete functions.
7253
7254 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
7255
7256 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
7257 strange test case titles. Reported by Bob Rossi.
7258
7259 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
7260
7261 * TODO: Add pointer to Sylvain Schmitz's work on static detection
7262 of potential ambiguities in GLR grammers.
7263
7264 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
7265
7266 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
7267 `bison ', use m4_index instead of m4_substr since chopping up a string
7268 containing M4-special characters causes problems here.
7269
7270 Fix a couple of bugs related to special characters in user-specified
7271 file names, and make it easier for skeletons to compute output file
7272 names with the same file name prefix as Bison-computed output file
7273 names.
7274 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
7275 b4_parser_file_name and b4_spec_defines_file instead of
7276 @output_parser_name@ and @output_header_name@, which are now redundant.
7277 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
7278 b4_parser_file_name, b4_spec_defines_file, and the new
7279 @basename(FILENAME@) instead of @output_parser_name@ and
7280 @output_header_name@, which inappropriately escaped the file names as
7281 C string literals.
7282 * src/files.c (all_but_ext): Remove static qualifier.
7283 (compute_output_file_names): Move `free (all_but_ext)' to...
7284 (output_file_names_free): ... here since all_but_ext is needed later.
7285 * src/files.h (all_but_ext): Extern.
7286 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
7287 exactly what MUSCLE_INSERT_STRING used to do.
7288 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
7289 characters are escaped properly.
7290 * src/output.c (prepare): Define muscle file_name_all_but_ext as
7291 all_but_ext.
7292 For pkgdatadir muscle, maintain previous functionality by using
7293 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
7294 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
7295 digraphs would never be expanded. Hopefully no one has M4-special
7296 characters in his Bison installation path.
7297 * src/scan-skel.l: Don't parse @output_header_name@ and
7298 @output_parser_name@ anymore since they're now redundant.
7299 In @output, use decode_at_digraphs.
7300 Parse a new @basename command that invokes last_component.
7301 (decode_at_digraphs): New.
7302 (BASE_QPUTS): Remove unused.
7303 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
7304 (Output file name): New tests.
7305
7306 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
7307
7308 Warn about output files that are generated by the skeletons and that
7309 conflict with other output files.
7310 * data/glr.c: Don't generate the header file here when glr.cc does.
7311 * src/files.c (file_names, file_names_count): New static globals.
7312 (compute_output_file_names): Invoke output_file_name_check for files
7313 not generated by the skeletons and remove existing checks.
7314 (output_file_name_check): New function that warns about conflicting
7315 output file names.
7316 (output_file_names_free): Free file_names.
7317 * src/files.h (output_file_name_check): Declare.
7318 * src/scan-skel.l: Invoke output_file_name_check for files generated by
7319 the skeletons.
7320 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
7321 (Conflicting output files): New tests.
7322
7323 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7324
7325 * doc/bison.texinfo: Fix a couple of typos.
7326
7327 2006-12-08 Bob Rossi <bob@brasko.net>
7328
7329 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
7330 Rename to...
7331 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
7332 update all uses.
7333 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
7334 (yypush_parse): Rename yypvars argument to yyps and remove redundant
7335 local pv.
7336 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
7337 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
7338
7339 2006-12-07 Bob Rossi <bob@brasko.net>
7340 and Joel Denny <jdenny@ces.clemson.edu>
7341
7342 * data/push.c (yypvarsinit): Change return type from void* to struct
7343 yypvars*. No longer cast to void* on return.
7344 (struct yypvars): Remove yylen since it need not be remembered between
7345 yypushparse invocations.
7346 (yypushparse): Don't copy between yylen and pv->yylen.
7347
7348 2006-12-05 Bob Rossi <bob@brasko.net>
7349
7350 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
7351 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
7352 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
7353 (struct yypvars): Remove b4_declare_parser_variables.
7354 (yypvarsinit): Remove init code for removed variables.
7355 (global scope): Do not declare b4_declare_parser_variables if
7356 push or pure mode.
7357 (yypushparse): Add b4_declare_parser_variables.
7358 Init new local variables, and remove init code for removed
7359 yypvars variables.
7360 (yyparse): Delete.
7361 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
7362 and yyparse for other modes.
7363 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
7364 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
7365 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
7366 (AT_PURE_LEX_IF): True if pure or push parser.
7367
7368 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
7369
7370 Document Yacc prologue alternatives and default %destructor's and
7371 %printer's as experimental. Don't mention Java yet. Discussed at
7372 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
7373 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
7374 (2.3a): Annotate this entry to say the old forms of these features were
7375 also experimental.
7376 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
7377 Table of Symbols): Say they're experimental. Comment out any mention
7378 of Java (we'll want this back eventually).
7379
7380 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
7381
7382 Support a file name argument to %defines. Deprecate `=' in
7383 %file-prefix, %name-prefix, and %output. Discussed at
7384 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
7385 * NEWS (2.3a+): Mention.
7386 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
7387 form of %defines, and remove `=' from entries for %file-prefix,
7388 %name-prefix, and %output.
7389 * src/parse-gram.y (prologue_declaration): Implement.
7390 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
7391 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
7392 all but one occurrence of %name-prefix.
7393 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
7394 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
7395 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
7396 occurrence of each of %file-prefix and %output. Add check for %defines
7397 with argument.
7398 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
7399 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
7400 Remove the `=' from %output.
7401
7402 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
7403
7404 Don't escape $ in test case titles since Autoconf 2.61 now does that
7405 correctly.
7406 * tests/actions.at (Default %printer and %destructor are not for error
7407 or $undefined): Here.
7408 (Default %printer and %destructor are not for $accept): Here.
7409 * tests/input.at (Invalid $n and @n): Here.
7410
7411 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
7412
7413 Rename <!> to <>. Discussed starting at
7414 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
7415 * NEWS (2.3a+): Update.
7416 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
7417 Update.
7418 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
7419 * src/scan-gram.l (INITIAL): Implement.
7420 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
7421 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
7422 comment.
7423 * tests/actions.at (Default tagless %printer and %destructor,
7424 Default tagged and per-type %printer and %destructor,
7425 Default %printer and %destructor are not for error or $undefined,
7426 Default %printer and %destructor are not for $accept,
7427 Default %printer and %destructor for mid-rule values): Update.
7428 * tests/input.at (Default %printer and %destructor redeclared,
7429 Unused values with default %destructor): Update.
7430
7431 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
7432
7433 Don't let %prec take a nonterminal.
7434 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
7435 token.
7436 * tests/input.at (%prec takes a token): New test checking that %prec
7437 won't take a nonterminal.
7438
7439 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7440
7441 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
7442 it was double-quoted.
7443 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
7444 grammar is maintained with Bison's highest standards.
7445 * src/getargs.c: Fix some typos in Doxygen comments.
7446
7447 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7448
7449 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
7450 later. Reported by Paul Eggert in
7451 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
7452 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
7453 * src/scan-code.l (translate_action): Don't bother invoking
7454 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
7455 (code_scanner_free): Instead of invoking
7456 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
7457 which frees more.
7458 * src/scan-gram.l (gram_scanner_free): Likewise.
7459 * src/scan-skel.l (scan_skel): Likewise.
7460
7461 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
7462
7463 * src/files.c (tr): Change return type to void.
7464 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
7465 has been called previously for the same key.
7466 (muscle_find): Return storage instead of value so that
7467 --enable-gcc-warnings doesn't produce warnings that the return discards
7468 const. aver that the value and storage are the same since storage
7469 could potentially be NULL when value is not.
7470 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
7471 same as 0.
7472
7473 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7474
7475 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
7476 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
7477 us a slightly cleaner distribution, and also works.
7478 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
7479 gnulib changes.
7480
7481 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
7482 and Paul Eggert <eggert@cs.ucla.edu>
7483
7484 Don't let Bison leak memory except when it complains.
7485 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
7486 (spec_defines_file, dir_prefix): Now char *, not const char *,
7487 since they are freed.
7488 * src/files.c: Likewise.
7489 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
7490 Likewise.
7491 (tr): Now operates in-place. All uses changed.
7492 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
7493 values.
7494 (compute_file_name_parts, compute_output_file_names): Don't store
7495 read-only data in variables that will be freed.
7496 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
7497 src_extension, and header_extension.
7498 (output_file_names_free): New public function to free
7499 spec_verbose_file, spec_graph_file, spec_defines_file,
7500 parser_file_name, and dir_prefix.
7501 * src/getargs.c (getargs): Don't store read-only data in variables that
7502 will be freed.
7503 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
7504 (which previously existed but was unused), and quotearg_free.
7505 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
7506 * src/muscle_tab.c: Likewise.
7507 (muscle_entry): Make the value char const *,
7508 and add a new storage member that is char * and can be freed.
7509 (muscle_entry_free): New private function.
7510 (muscle_init): Use it instead of free.
7511 (muscle_insert, muscle_grow): Update and use new storage member.
7512 (muscle_code_grow): Free the string passed to muscle_grow
7513 since it's not needed anymore.
7514 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
7515 add a new `char *code' member.
7516 ("{...}"): Declare semantic type as code.
7517 * src/scan-code.h (translate_rule_action):
7518 (translate_symbol_action, translate_code, translate_action): Return
7519 `char const *' rather than `char *' since external code should not free
7520 these strings.
7521 * src/scan-code.l: Likewise.
7522 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
7523 which is "{...}" in the parser.
7524 * tests/Makefile.am (maintainer-check-valgrind): Set
7525 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
7526 Valgrind.
7527 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
7528 complain.
7529 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
7530 expecting a non-zero exit status sets --leak-check=summary and
7531 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
7532 this case, and we don't want to hear about it.
7533
7534 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7535
7536 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
7537 instead of from the template, to simplify configuration a bit.
7538 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
7539 and m4/wint_t.m4, as they are needed with the latest gnulib.
7540
7541 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7542
7543 Disable unset/unused mid-rule value warnings by default, and recognize
7544 --warnings=midrule-values to enable them. Discussed starting at
7545 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
7546 * NEWS (2.3a+): Mention.
7547 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
7548 warnings): Add entry for midrule-values subargument.
7549 * src/reader.c (symbol_should_be_used): Don't return true just because
7550 the value is a set/used mid-rule value unless
7551 --warnings=midrule-values was specified.
7552 * tests/input.at (Unused values, Unused values before symbol
7553 declarations): Run tests with and without --warnings=midrule-values.
7554
7555 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
7556 than LIST_FREE directly.
7557
7558 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7559
7560 Finish implementing --warnings=error, which should not be implied by
7561 --warnings=all (or by its synonyms -W and --warnings without
7562 subarguments).
7563 * src/complain.c (set_warning_issued): New function to report that
7564 warnings are being treated as errors and to record an error if so.
7565 Invoke...
7566 (warn_at, warn): ... here.
7567 * src/getargs.c (warnings_args, warnings_types): Reorder so that
7568 "error - warnings are errors" does not appear above "all - all of the
7569 above".
7570 (getargs): For -W and --warnings without subarguments, don't let
7571 FLAGS_ARGMATCH set warnings_error in warnings_flag.
7572 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
7573
7574 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7575
7576 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
7577 empty subargument list. For example: `bison --warnings= parser.y'.
7578
7579 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7580
7581 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
7582 the parser header file so that gcc doesn't warn.
7583
7584 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7585
7586 Split the default %destructor/%printer into two kinds: <*> and <!>.
7587 Discussed starting at
7588 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
7589 * NEWS (2.3a+): Mention.
7590 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
7591 previous change today related to mid-rules.
7592 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
7593 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
7594 (TYPE_TAG_ANY): Add as <*>.
7595 (TYPE_TAG_NONE): Add as <!>.
7596 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
7597 for <*> and <!>.
7598 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
7599 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
7600 * src/symlist.c (symbol_list_default_new): Split into tagged and
7601 tagless versions.
7602 (symbol_list_destructor_set, symbol_list_printer_set): Split
7603 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
7604 SYMLIST_DEFAULT_TAGLESS.
7605 * src/symlist.h: Update symbol_list_default*_new prototypes.
7606 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
7607 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
7608 * src/symtab.c (default_destructor, default_destructor_location,
7609 default_printer, default_printer_location): Split each into tagged and
7610 tagless versions.
7611 (symbol_destructor_get, symbol_destructor_location_get,
7612 symbol_printer_get, symbol_printer_location_get): Implement tagged
7613 default and tagless default cases.
7614 (default_destructor_set, default_printer_set): Split each into tagged
7615 and tagless versions.
7616 * src/symtab.h: Update prototypes.
7617 * tests/actions.at (Default %printer and %destructor): Rename to...
7618 (Default tagless %printer and %destructor): ... this, and extend.
7619 (Per-type %printer and %destructor): Rename to...
7620 (Default tagged and per-type %printer and %destructor): ... this, and
7621 extend.
7622 (Default %printer and %destructor for user-defined end token): Extend.
7623 (Default %printer and %destructor are not for error or $undefined):
7624 Update.
7625 (Default %printer and %destructor are not for $accept): Update.
7626 (Default %printer and %destructor for mid-rule values): Extend.
7627 * tests/input.at (Default %printer and %destructor redeclared): Extend.
7628 (Unused values with default %destructor): Extend.
7629
7630 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7631
7632 Don't apply the default %destructor/%printer to an unreferenced midrule
7633 value. Mentioned at
7634 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
7635 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
7636 like $@n instead of just @n so that the default %destructor/%printer
7637 logic doesn't see them as user-defined symbols.
7638 (symbol_is_dummy): Check for both forms of the name.
7639 * src/reader.c (packgram): Remove the `$' from each midrule symbol
7640 name for which the midrule value is referenced in any action.
7641 * tests/actions.at (Default %printer and %destructor for mid-rule
7642 values): New test.
7643 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
7644 for change to dummy symbol names.
7645
7646 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7647
7648 Warn about unset midrule $$ if the corresponding $n is used.
7649 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
7650 $n usage.
7651 (packgram): Before invoking grammar_rule_check on any rule, make sure
7652 all actions have already been scanned in order to set `used' flags.
7653 Otherwise, checking that a midrule's $$ is set will not always work
7654 properly because the midrule check must forward-reference the midrule's
7655 parent rule.
7656 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
7657 warning.
7658
7659 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7660
7661 More improvements to the documentation of the prologue alternatives:
7662 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
7663 Bison manual.
7664 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
7665 some text to clarify the relative importance of the new directives and
7666 to show how these directives may be viewed as code labels.
7667
7668 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
7669
7670 Similar to the recently removed %before-header, add %code-top as the
7671 alternative to the pre-prologue. Mentioned at
7672 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
7673 Also, let the prologue alternatives appear in the grammar section.
7674 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
7675 (prologue_declaration): Move the existing prologue alternatives to...
7676 (grammar_declaration): ... here and add %code-top.
7677 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
7678
7679 Clean up and extend documentation for the prologue alternatives.
7680 * NEWS (2.3a+): Describe prologue alternatives.
7681 * doc/bison.texinfo (Prologue): Move discussion of prologue
7682 alternatives to...
7683 (Prologue Alternatives): ... this new section, and extend it to discuss
7684 all 4 directives in detail.
7685 (Table of Symbols): Clean up discussion of prologue alternatives and
7686 add %code-top.
7687
7688 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7689
7690 DJGPP specific issues.
7691
7692 * djgpp/config.bat: config.hin has been moved to lib. Adjust
7693 config.bat accordingly.
7694 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
7695 * djgpp/config.site: Likewise.
7696
7697 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
7698
7699 Replace %*-header with %provides, %requires, %code. See discussion at
7700 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
7701
7702 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
7703 (b4_user_start_header): Remove.
7704 * data/glr.c: Use new macros instead of b4_*start_header
7705 and b4_*end_header.
7706 * data/glr.cc: Likewise.
7707 * data/lalr1.cc: Likewise.
7708 * data/push.c: Likewise.
7709 * data/yacc.c: Likewise.
7710
7711 * doc/bison.texinfo: Remove %before-header, rename
7712 %{start,end,after}-header to %requires, %provides, %code.
7713
7714 * src/parse-gram.y: Likewise (also rename token names accordingly).
7715 * src/scan-gram.l: Likewise.
7716 * tests/actions.at: Likewise.
7717
7718 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
7719
7720 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
7721 Problem reported by Joel E. Denny.
7722
7723 2006-10-14 Jim Meyering <jim@meyering.net>
7724
7725 (Sync from coreutils.)
7726 Work also when the working directory (with e.g. coreutils sources)
7727 is version controlled with git, rather than CVS.
7728 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
7729 rather than CVS.
7730 In messages and comments, say e.g., "checked-out sources",
7731 rather than "CVS sources".
7732 (version_controlled_file): New function. Work for git as well as
7733 for CVS. Don't use grep's -q option.
7734 (slurp): Call it here, in place of CVS-specific code.
7735
7736 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
7737
7738 Fix testsuite for ./configure --enable-gcc-warnings:
7739 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
7740 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
7741 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
7742 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
7743 * test/regression.at (Diagnostic that expects two alternatives):
7744 Likewise.
7745
7746 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
7747
7748 * bootstrap.conf (gnulib_modules): Add config-h.
7749 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
7750 worry about HAVE_CONFIG_H.
7751 * lib/abitset.c: Likewise.
7752 * lib/bitset.c: Likewise.
7753 * lib/bitset_stats.c: Likewise.
7754 * lib/bitsetv-print.c: Likewise.
7755 * lib/bitsetv.c: Likewise.
7756 * lib/ebitset.c: Likewise.
7757 * lib/get-errno.c: Likewise.
7758 * lib/lbitset.c: Likewise.
7759 * lib/subpipe.c: Likewise.
7760 * lib/timevar.c: Likewise.
7761 * lib/vbitset.c: Likewise.
7762 * lib/bitset.c: Include "bitset.h" first, to test interface.
7763 * lib/bitset_stats.c: Include "bitset_stats.h" first.
7764 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
7765 * lib/bitsetv.c: Include "bitsetv.h" first.
7766 * lib/get-errno.c: Include "get-errno.h" first.
7767 * m4/.cvsignore: Add config-h.m4.
7768 * tests/actions.at (Default %printer and %destructor for ...):
7769 Adjust expected line numbers in output to reflect removal of #if
7770 HAVE_CONFIG_H lines.
7771 * tests/glr-regression.at (Missed %merge type warnings when ...):
7772 Likewise.
7773 * tests/regression.at (Braced code in declaration in rules section):
7774 Likewise.
7775 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
7776 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
7777 Include <config.h> unconditionally.
7778
7779 * bootstrap: Sync from coreutils, as follows:
7780
7781 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
7782
7783 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
7784 variable was sometimes used without being initialized. This
7785 messed up the installation of the INSTALL file in some cases.
7786
7787 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
7788
7789 * bootstrap (usage, main program, symlink_to_gnulib): Add option
7790 --copy. Inspired by a suggestion from Bruno Haible.
7791
7792 2006-10-03 Jim Meyering <jim@meyering.net>
7793
7794 * bootstrap: Undo last change to this file, since now gnulib-tool
7795 sticks with the automake default in generating dependencies.
7796
7797 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
7798
7799 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
7800 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
7801
7802 * doc/bison.1: Add copyright notice.
7803
7804 * data/glr.c: Don't include <stdarg.h>; not used.
7805
7806 * NEWS: The -g and --graph options now output graphs in Graphviz
7807 DOT format, not VCG format.
7808 * doc/bison.1: Likewise.
7809 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
7810 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
7811 of this change in
7812 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
7813 * TODO: Remove Graphviz entry.
7814 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
7815 remove vcg.c, vcg.h, vcg_defaults.h.
7816 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
7817 * src/graphviz.c, src/graphviz.h: New files.
7818 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
7819 * src/files.h: Make comment more generic.
7820 * src/main.c (main): Likewise.
7821 * src/print_graph.h: Likewise.
7822 * src/getargs.c (usage): Make usage description more generic.
7823 * src/print_graph.c: Include graphviz.h rather than vcg.h.
7824 (static_graph, fgraph): Remove. All uses changed to pass
7825 arguments instead of sharing a static var.
7826 (print_core, print_actions, print_state, print_graph):
7827 Output graphviz format rather than VCG format.
7828 * tests/.cvsignore: Remove *.vcg; add *.dot.
7829 * tests/output.at: Expect *.dot files, not *.vcg files.
7830
7831 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
7832 accommodates the 2006-10-08 change.
7833
7834 2006-10-11 Bob Rossi <bob@brasko.net>
7835
7836 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
7837 (b4_yyssa, b4_yyerror_range): New macros.
7838 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
7839 (yypvarsinit): Remove init of removed fields.
7840 (yypushparse): Remove use of removed fields; use new macros instead.
7841
7842 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
7843
7844 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
7845 in a push parser. Reindent slightly to match yacc.c better.
7846
7847 2006-10-11 Bob Rossi <bob@brasko.net>
7848
7849 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
7850 yymsg_alloc fields.
7851 (yypvarsinit, yypushparse): Remove init of removed fields.
7852 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
7853
7854 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
7855
7856 * THANKS: Add Paolo Bonzini and Bob Rossi.
7857
7858 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
7859
7860 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
7861 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
7862 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
7863 b4_define_user_cde and uses): Remove.
7864 (b4_comment, b4_prefix, b4_sync_start): New.
7865 * data/bison.m4: New file, with most of the content removed from c.m4.
7866 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
7867 * src/output.c (output_skeleton): Pass bison.m4.
7868 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
7869 only if specified.
7870
7871 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
7872
7873 Fix test failure reported by Tom Lane in
7874 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
7875 and try to make such failures easier to catch in the future.
7876 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
7877 that's now the caller's responsibility.
7878 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
7879 Set yychar = YYEOF if it's negative.
7880 * tests/actions.at (yylex): Abort if asked to read past EOF.
7881 * tests/conflicts.at (yylex): Likewise.
7882 * tests/cxx-type.at (yylex): Likewise.
7883 * tests/glr-regression.at (yylex): Likewise.
7884 * tests/input.at (yylex): Likewise.
7885 * tests/regression.at (yylex): Likewise.
7886 * tests/torture.at (yylex): Likewise.
7887
7888 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
7889
7890 Fix problems with translating English-language diagnostics.
7891 * bootstrap: Fix bug introduced in recent bootstrap changes, with
7892 respect to bison-runtime pot generation. The YY_ stuff
7893 wasn't being captured.
7894 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
7895 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
7896 * runtime-po/POTFILES.in: Add data/push.c.
7897
7898 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
7899
7900 Merge bootstrap changes from coreutils.
7901
7902 2006-09-28 Jim Meyering <jim@meyering.net>
7903
7904 Automatically generated dependencies are important even
7905 when all of the sources in a directory come from gnulib.
7906 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
7907 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
7908
7909 2006-09-23 Jim Meyering <jim@meyering.net>
7910
7911 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
7912
7913 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7914
7915 * bootstrap: Add support for --force.
7916 (usage): New function. Describe usage less tersely.
7917 (CVS_only_file): New var.
7918
7919 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
7920
7921 * data/push.c (YYPUSH_MORE): Make it an enum instead.
7922 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
7923 Adjust white space and comments to match GNU style better.
7924
7925 2006-09-20 Bob Rossi <bob@brasko.net>
7926
7927 * data/push.c (yyresult_get): Remove function.
7928 (YYPUSH_MORE): Add #define.
7929 (yypushparse): Modify return value.
7930
7931 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7932
7933 * stamp-h.in: Remove; no longer needed.
7934 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
7935 Remove config.h, config.hin, intl (no longer created).
7936 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
7937 stamp-h1.
7938
7939 Sync bootstrap from coreutils, as follows:
7940
7941 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
7942
7943 * bootstrap (symlink_to_gnulib): New function.
7944 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
7945 to copies-of-gnulib.
7946 (cp_mark_as_generated, slurp, gnulib_files):
7947 Avoid making a copy if it's the same as the old version.
7948 (gnulib_files): Add support for this variable (used by Bison).
7949
7950 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7951
7952 * src/getargs.c (usage): Rework to use conventions similar to
7953 coreutils, to make translation a bit easier and the code a bit
7954 smaller. Problem reported by Tim Van Holder.
7955
7956 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
7957
7958 Use some of gnulib's new modules, taken from coreutils.
7959
7960 * bootstrap: Sync from coreutils, except add support for gnulib_files.
7961 * bootstrap.conf: New file.
7962 (gnulib_modules): Add configmake, inttypes, unistd.
7963 (XGETTEXT_OPTIONS): Add complain, complain_at,
7964 fatal, fatal_at, warn, warn_at, unexpected_end.
7965 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
7966 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
7967 (gl_EARLY): Add.
7968 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
7969 (gl_INIT): Add
7970 (GNULIB_AUTOCONF_SNIPPET): Remove.
7971 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
7972 the pickiest.
7973 * lib/.cvsignore: Add inttypes_.h.
7974 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
7975 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
7976 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
7977 no-longer-necessary initializations.
7978 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
7979 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
7980 use the unistd module.
7981 * src/system.h: Likewise.
7982 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
7983 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
7984 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
7985 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
7986 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
7987 * src/system.h: Include inttypes.h unconditionally, now that we
7988 use the inttypes module. Don't bother to include stdint.h, since
7989 inttypes.h now does that for us.
7990 (LOCALEDIR): Remove, now that we use the configmake module.
7991 * src/getargs.c: Include configmake.h.
7992 * src/main.c: Likewise.
7993 * src/output.c: Likewise.
7994 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
7995 not from $abs_top_builddir, since config.h moved.
7996
7997
7998 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
7999 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
8000
8001 * src/parse-gram.y (symbol_declaration): Don't put statements
8002 before declarations; it's not portable to C89.
8003 * src/scan-code.l (handle_action_at): Likewise.
8004
8005 * src/scan-code.l: Always initialize braces_level; the old code
8006 left it uninitialized and therefore had undefined behavior.
8007
8008 Don't attempt to redefine 'assert', since it runs afoul of
8009 systems where standard headers (mistakenly) include <assert.h>.
8010 Instead, define and use our own alternative, called 'aver'.
8011 * src/reader.c: Don't include assert.h, since we no longer
8012 use assert.
8013 * src/scan-code.l: Likewise.
8014 * src/system.h (assert): Remove, replacing with....
8015 (aver): New function, taking a bool arg. All uses changed.
8016 * src/tables.c (pack_vector): Ensure that aver arg is bool,
8017 not merely an integer.
8018
8019 2006-09-15 Bob Rossi <bob@brasko.net>
8020
8021 Add support for push parsing. Based on the original work of
8022 Odd Arild Olsen <oao@fibula.no>.
8023 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
8024 * data/c.m4 (YYPUSH): New.
8025 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
8026 * data/push.c: New file.
8027 * src/getargs.c (push_parser): New var.
8028 * src/getargs.h (push_parser): New declaration.
8029 * src/output.c (prepare): Add macro insertion of `push_flag'.
8030 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
8031 (prologue_declaration): Parse %push-parser.
8032 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
8033 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
8034 list of removed lines from the traces observed.
8035 (AT_CHECK_CALC_LALR): Added push parser tests.
8036
8037 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
8038
8039 * NEWS: Version 2.3a.
8040 * configure.ac (AC_INIT): Likewise.
8041
8042 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
8043 "#define YYSTYPE int" that caused "make maintainer-check" to fail
8044 due to header ordering dependencies. I don't know why the #define
8045 was there.
8046
8047 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
8048 runtime cost when YYDEBUG is not defined, and so that some tests
8049 that used to fail now work. Problem and initial suggestion by
8050 Paolo Bonzini.
8051 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
8052 * data/glr.cc (b4_parser_class_name):
8053 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
8054 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
8055 (yydebug_) [YYDEBUG]: New member.
8056 (yycdebug_): Now defined only if YYDEBUG.
8057 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
8058 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
8059 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
8060 if YYYDEBUG.
8061 (debug_stream, set_debug_stream, debug_level, set_debug_level):
8062 Define only if YYDEBUG.
8063 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
8064 set_debug_level.
8065 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
8066 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
8067 AT_CHECK_CALC_GLR_CC that are working now.
8068
8069 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
8070
8071 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
8072 We don't need them in glr.cc, and glr.c defines them.
8073 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
8074 assumes that defining it to anything is the same as defining
8075 it to 1. Problem reported by Paolo Bonzini.
8076
8077 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
8078
8079 * data/c.m4 (b4_null, b4_case): Define.
8080 * src/output.c (prepare_symbols): Use b4_null.
8081 (user_actions_output): Use b4_case.
8082
8083 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
8084
8085 * data/glr.c (b4_shared_declarations): Put start-header first,
8086 before any #includes that we generate, so that feature-test
8087 macros work. Problem reported by Michael Deutschmann in
8088 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
8089 * data/lalr1.cc: Likewise.
8090 * doc/bison.texinfo (Prologue): Document that feature-test macros
8091 should be defined before any Bison declarations.
8092 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
8093 that depend on location.hh after, not before, Bison decls, since
8094 we now include location.hh after the first user prologue.
8095
8096 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
8097 Sander Brandenburg in
8098 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
8099 Also, fix minor white space and comment issues.
8100 (Prologue): Mention that it's better to define feature-test macros
8101 before Bison declarations. Problem reported by Michael Deutschmann.
8102
8103 * README-cvs: Fix typo: "&" should be "&&". Problem reported
8104 by Jim Meyering.
8105 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
8106 This adjusts to recent gnulib changes.
8107
8108 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8109
8110 Finish implementation of per-type %destructor/%printer. Discussed
8111 starting at
8112 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
8113 and
8114 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
8115 * NEWS (2.3+): Add a description of this feature to the default
8116 %destructor/%printer description.
8117 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
8118 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
8119 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
8120 list node contains a semantic type.
8121 * src/symtab.c, src/symtab.h: Extend with a table that associates
8122 semantic types with their %destructor's and %printer's.
8123 (semantic_type_from_uniqstr, semantic_type_get,
8124 semantic_type_destructor_set, semantic_type_printer_set): New functions
8125 composing the public interface of that table.
8126 (symbol_destructor_get, symbol_destructor_location_get,
8127 symbol_printer_get, symbol_printer_location_get): If there's no
8128 per-symbol %destructor/%printer, look up the per-type before trying
8129 the default.
8130 * tests/actions.at (Per-type %printer and %destructor): New test case.
8131 * tests/input.at (Default %printer and %destructor redeclared):
8132 Extend to check that multiple occurrences of %symbol-default in a
8133 single %destructor/%printer declaration is an error.
8134 (Per-type %printer and %destructor redeclared, Unused values with
8135 per-type %destructor): New test cases.
8136
8137 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8138
8139 Require default %destructor/%printer to be declared using
8140 %symbol-default instead of an empty symbol list, and start working on
8141 new per-type %destructor/%printer. Discussed at
8142 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
8143 * NEWS (2.3+): Add %symbol-default to example.
8144 * bison.texinfo (Freeing Discarded Symbols): Likewise.
8145 (Table of Symbols): Add entry for %symbol-default.
8146 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
8147 (generic_symlist, generic_symlist_item): New nonterminals for creating
8148 a list in which each item is a symbol, semantic type, or
8149 %symbol-default.
8150 (grammar_declaration): Use generic_symlist in %destructor and %printer
8151 declarations instead of symbols.1 or an empty list.
8152 (symbol_declaration, precedence_declaration, symbols.1): Update actions
8153 for changes to symbol_list.
8154 * src/reader.c: Update for changes to symbol_list.
8155 * src/scan-code.l: Likewise.
8156 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
8157 * src/symlist.c, src/symlist.h: Extend such that a list node may
8158 represent a semantic type or a %symbol-default in addition to just an
8159 ordinary symbol. Add switched functions for setting %destructor's and
8160 %printer's.
8161 * tests/actions.at, tests/input.at: Add %symbol-default to all default
8162 %destructor/%printer declarations.
8163
8164 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
8165
8166 Whether the default %destructor/%printer applies to a particular symbol
8167 isn't a question of whether the user *declares* that symbol (in %token,
8168 for example). It's a question of whether the user by any means
8169 *defines* the symbol at all (by simply using a char token, for
8170 example). $end is defined by Bison whereas any other token with token
8171 number 0 is defined by the user. The error token is always defined by
8172 Bison regardless of whether the user declares it with %token, but we
8173 may one day let the user define error as a nonterminal instead.
8174 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
8175 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
8176 the meaning of "user-defined".
8177 * tests/actions.at (Default %printer and %destructor for user-declared
8178 end token): Rename to...
8179 (Default %printer and %destructor for user-defined end token): ...
8180 this.
8181
8182 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
8183 computation of whether to apply the default, don't maintain a list of
8184 every Bison-defined symbol. Instead, just check for a first character
8185 of '$', which a user symbol cannot have, and check for the error token.
8186
8187 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
8188
8189 Don't apply the default %destructor or %printer to the error token,
8190 $undefined, or $accept. This change fits the general rule that the
8191 default %destructor and %printer are only for user-declared symbols,
8192 and it solves several difficulties that are described in the new test
8193 cases listed below.
8194 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
8195 * tests/actions.at (Default %printer and %destructor are not for error
8196 or $undefined, Default %printer and %destructor are not for $accept):
8197 New test cases.
8198
8199 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
8200
8201 Allow %start after the first rule.
8202 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
8203 when parsing the first rule.
8204 (check_and_convert_grammar): Search for it here after all grammar
8205 declarations have been parsed. Skip midrules, which have dummy LHS
8206 nonterminals.
8207 * src/symtab.c (symbol_is_dummy): New function.
8208 * src/symtab.h (symbol_is_dummy): Declare it.
8209 * tests/input.at (%start after first rule): New test.
8210
8211 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8212
8213 Redo some of the previous commit: add back the ability to use
8214 non-aliased/undeclared string literals since it might be useful to
8215 those declaring %token-table.
8216 * src/reader.c (check_and_convert_grammar): Undo changes in previous
8217 commit: don't worry about complaints from symbols_pack.
8218 * src/symtab.c (symbol_new, symbol_class_set,
8219 symbol_check_alias_consistency): Undo changes in previous commit: count
8220 each string literal as a new symbol and token, assign it a symbol
8221 number, and don't complain about non-aliased string literals.
8222 (symbols_pack): Since symbol_make_alias still does not decrement symbol
8223 and token counts but does still set aliased tokens to the same number,
8224 symbol_pack_processor now leaves empty slots in the symbols array.
8225 Remove those slots.
8226 * tests/regression.at (Undeclared string literal): Remove test case
8227 added in previous commit since non-aliased string literals are allowed
8228 again.
8229 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
8230 remove unnecessary string literal declarations.
8231 * tests/sets.at (Firsts): Likewise.
8232
8233 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8234
8235 Don't allow an undeclared string literal, but allow a string literal to
8236 be used before its declaration.
8237 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
8238 symbols_pack complained.
8239 * src/symtab.c (symbol_new): Don't count a string literal as a new
8240 symbol.
8241 (symbol_class_set): Don't count a string literal as a new token, and
8242 don't assign it a symbol number since symbol_make_alias does that.
8243 (symbol_make_alias): It's not necessary to decrement the symbol and
8244 token counts anymore. Don't assume that an alias declaration occurs
8245 before any uses of the identifier or string, and thus don't assert that
8246 one of them has the highest symbol number so far.
8247 (symbol_check_alias_consistency): Complain if there's a string literal
8248 that wasn't declared as an alias.
8249 (symbols_pack): Bail if symbol_check_alias_consistency failed since
8250 symbol_pack asserts that every token has been assigned a symbol number
8251 although undeclared string literals have not.
8252 * tests/regression.at (String alias declared after use, Undeclared
8253 string literal): New test cases.
8254 (Characters Escapes, Web2c Actions): Declare string literals as
8255 aliases.
8256 * tests/sets.at (Firsts): Likewise.
8257
8258 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
8259
8260 In the grammar scanner, STRING_FINISH unclosed constructs and return
8261 them to the parser in order to improve error messages.
8262 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
8263 SC_BRACED_CODE, SC_PROLOGUE): Implement.
8264 * tests/input.at (Unclosed constructs): New test case.
8265 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
8266 seen.
8267
8268 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
8269 unused global.
8270
8271 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
8272
8273 Handle string aliases for character tokens correctly.
8274 * src/symtab.c (symbol_user_token_number_set): If the token has an
8275 alias, check and set its alias's user token number instead of its own,
8276 which is set to indicate the alias. Previously, every occurrence of
8277 the character token in the grammar overwrote that alias indicator with
8278 the character code.
8279 * tests/input.at (String aliases for character tokens): New test.
8280
8281 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
8282
8283 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
8284
8285 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
8286
8287 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
8288 to prevent failures when building on older platforms.
8289 Check for autopoint failure.
8290 Set XGETTEXT_OPTIONS to values that check for C format strings,
8291 so that translators are warned about them (this also helps
8292 prevent core dumps).
8293
8294 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
8295 function, since it simplifies our code a bit.
8296
8297 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
8298 rather than -W, so we don't get bogus warnings about sign comparisons.
8299 Add -Wpointer-arith, since that warning is useful (it reports code
8300 that does not conform to C89 and that some compilers reject).
8301 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
8302 since it's no longer needed.
8303
8304 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
8305
8306 Clean up scanners a bit.
8307 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
8308 definitions so gcc won't warn when obstack_for_string is unused.
8309 * src/scan-code.l: config.h and system.h are already #include'd by
8310 scan-code-c.c, so get rid of them here.
8311 * src/scan-gram.l: Likewise.
8312 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
8313 definitions rather than duplicating the rest of it.
8314 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
8315
8316 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
8317
8318 Suppress signed/unsigned comparison warnings for yycheck.
8319 * data/c.m4 (b4_safest_int_type): New macro.
8320 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
8321 a signed int type, cast it to b4_safest_int_type first.
8322 * data/yacc.c: Likewise.
8323 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
8324 also overwritten.
8325
8326 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
8327
8328 * doc/bison.texinfo: Fix some typos.
8329
8330 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
8331
8332 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
8333 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
8334
8335 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
8336 the latest gnulib does this a different way.
8337 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
8338 translation was patched, so stop omitting it.
8339
8340 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8341
8342 Enable declaration of default %printer/%destructor. Make the parser
8343 use these for all user-declared grammar symbols for which the user does
8344 not declare a specific %printer/%destructor. Thus, the parser uses it
8345 for token 0 if the user declares it but not if Bison generates it as
8346 $end. Discussed starting at
8347 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
8348 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
8349 and
8350 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
8351 * NEWS (2.3+): Mention.
8352 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
8353 declare a %destructor for a mid-rule's semantic value. It's just
8354 impossible to declare one specific to it.
8355 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
8356 code. Describe default %destructor form.
8357 * src/parse-gram.y (grammar_declaration): Parse default
8358 %printer/%destructor declarations.
8359 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
8360 and symbol_destructor_location_get rather than accessing the destructor
8361 and destructor_location members of struct symbol.
8362 (symbol_printers_output): Likewise but for %printer's.
8363 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
8364 again.
8365 * src/symtab.c (default_destructor, default_destructor_location,
8366 default_printer, default_printer_location): New static global
8367 variables to record the default %destructor and %printer.
8368 (symbol_destructor_get, symbol_destructor_location_get,
8369 symbol_printer_get, symbol_printer_location_get): New functions to
8370 compute the appropriate %destructor and %printer for a symbol.
8371 (default_destructor_set, default_printer_set): New functions to set the
8372 default %destructor and %printer.
8373 * src/symtab.h: Prototype all those new functions.
8374 * tests/actions.at (Default %printer and %destructor): New test to
8375 check that the right %printer and %destructor are called, that they're
8376 not called for $end, and that $$ and @$ work correctly.
8377 (Default %printer and %destructor for user-declared end token): New
8378 test to check that the default %printer and %destructor are called for
8379 a user-declared end token.
8380 * tests/input.at (Default %printer and %destructor redeclared, Unused
8381 values with default %destructor): New tests to check related grammar
8382 warnings and errors.
8383
8384 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8385
8386 Clean up handling of %destructor for the end token (token 0).
8387 Discussed starting at
8388 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
8389 and
8390 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
8391
8392 Make the skeletons consistent in how they pop the end token and invoke
8393 its %destructor.
8394 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
8395 state, which has token number 0, since this would invoke the
8396 %destructor for the end token.
8397 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
8398 until after shifting the end token, or else it won't be popped.
8399 * data/yacc.c (yyparse): Likewise.
8400
8401 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
8402 it's the end token. Upon termination, destroy an unshifted lookahead
8403 even when it's the end token.
8404 * data/lalr1.cc (yy::parser::parse): Likewise.
8405 * data/yacc.c (yyparse): Likewise.
8406
8407 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
8408 value warnings for the end token when the user gives the end token a
8409 %destructor.
8410
8411 * tests/actions.at (Printers and Destructors): Test all the above.
8412
8413 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
8414
8415 Update to latest gnulib and gettext versions.
8416 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
8417 Add fopen-safer.
8418 (gnulib_files): Add m4/warning.m4. Don't worry about files
8419 overwritten by autopoint.
8420 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
8421 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
8422 rejects them.
8423 Don't use autoreconf; instead, invoke autopoint etc. by hand,
8424 so that we can remove the intl files at a better time.
8425 (intl_files_to_remove): Remove aclocal.m4, since it gets
8426 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
8427 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
8428 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
8429 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
8430 Remove datarootdir hack; no longer needed.
8431 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
8432 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
8433 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
8434 strdup.h.
8435 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
8436 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
8437
8438 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
8439
8440 * bootstrap: Adjust to today's change to gnulib-tool by invoking
8441 it with --assume-autoconf='latest-stable'.
8442
8443 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
8444
8445 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
8446 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
8447 YYSTYPE' and `{'.
8448 * src/muscle_tab.h (muscle_grow): Replace the header comments with
8449 those from muscle_tab.c since the old ones are misleading.
8450
8451 2006-07-13 Akim Demaille <akim@epita.fr>
8452
8453 Support %define "KEY" {VALUE}.
8454 * src/scan-code.h, src/scan-code.l (translate_action)
8455 (translate_rule_action, translate_symbol_action, translate_code):
8456 Return char *, not const char *.
8457 * src/parse-gram.y (declaration): Rename as...
8458 (prologue_declaration): this.
8459 (string_content): Remove this nonterminal, use STRING.
8460 (braceless, content, content.opt): New nonterminal.
8461 Use them.
8462 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
8463 as value.
8464 * src/scan-gram.l (getargs.h): Don't include it.
8465
8466 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
8467
8468 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
8469 rather than a for-loop that declares a local bool variable. This
8470 should work around a compatibility problem with a Cray x1e C++
8471 compiler reported by Hung Nguyen in
8472 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
8473 The for-loop was introduced in the 2004-11-17 change but I don't
8474 know why it was needed.
8475
8476 2006-07-12 Akim Demaille <akim@epita.fr>
8477
8478 * data/c.m4: Comment changes.
8479
8480 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
8481
8482 * src/complain.c (error_message, ERROR_MESSAGE): New.
8483 To factor...
8484 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
8485 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
8486
8487 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
8488
8489 * NEWS: Instead of %union, you can define and use your own union type
8490 YYSTYPE if your grammar contains at least one <type> tag.
8491 Your YYSTYPE need not be a macro; it can be a typedef.
8492 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
8493 (Union Decl, Decl Summary): Document this.
8494 * data/glr.c (YYSTYPE): Implement this.
8495 * data/glr.cc (YYSTYPE): Likewise.
8496 * data/lalr1.cc (YYSTYPE): Likewise.
8497 * data/yacc.c (YYSTYPE): Likewise.
8498 * src/output.c (prepare): Output tag_seen_flag.
8499 * src/parse-gram.y (declaration, grammar_declaration):
8500 Use 'union_seen' rather than 'typed' to determine whether
8501 %union has been seen, since grammars can now be typed without
8502 %union.
8503 (symbol_declaration, type.opt, symbol_def):
8504 Keep track of whether a tag has been seen.
8505 * src/reader.c (union_seen, tag_seen): New vars.
8506 (typed): remove.
8507 * src/reader.h (union_seen, tag_seen, typed): Likewise.
8508 * src/scan-code.l (untyped_var_seen): New variable.
8509 (handle_action_dollar): Adjust to above changes.
8510 (handle_action_dollar, handle_action_at):
8511 Improve overflow checking for outlandish numbers.
8512 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
8513 avoid new diagnostics generated by above changes.
8514 * tests/regression.at (YYSTYPE typedef): Add test to check
8515 for type tags without %union.
8516
8517 * src/symlist.c (symbol_list_length): Return int, not unsigned
8518 int, since callers expect int. This may need to get revisited
8519 once we have proper integer overflow checking.
8520
8521 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
8522 object is now static.
8523
8524 * src/getargs.c (flags_argmatch): Return void, not int,
8525 to pacify ./configure --enable-gcc-warnings.
8526
8527 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
8528 since last_string is already defined to FLEX_PREFIX (last_string).
8529
8530 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
8531
8532 Implement --warnings/-W.
8533 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
8534 replaced by...
8535 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
8536 Adjust callers.
8537 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
8538 (warnings_args, warnings_types): New.
8539 (getargs, short_options, long_options): Accept -W/--warnings.
8540 Sort the options by alphabetical order, upper case letter right
8541 before its lower case.
8542
8543 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
8544
8545 Change %merge result type clash warnings to errors. Discussed at
8546 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
8547 * src/reader.c (record_merge_function_type): Use complain_at.
8548 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8549 declared later): Update test case results.
8550
8551 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
8552
8553 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
8554 to be in alphabetical order.
8555 (trace_args): Spelling fixes.
8556
8557 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
8558
8559 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
8560 so they don't collide with user-defined macros.
8561 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
8562 this was never guaranteed, and now that we're using gnulib stdint,
8563 which defines int_fast16_t to long int, the problem is exposed.
8564
8565 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
8566
8567 * data/c.m4 (b4_basename): Simplify a bit, since we don't
8568 need the full POSIX semantics (and weren't implementing them
8569 anyway).
8570
8571 Adjust to Autoconf 2.60 and today's gnulib.
8572 * bootstrap (gnulib_modules): Add stdint.
8573 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
8574 no longer copies it.
8575 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
8576 since stdint needs the former and wcwidth (which is now required
8577 by mbswidth) needs the latter.
8578 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
8579 work around a compatibility glitch between gettext 0.14.6 and
8580 Autoconf 2.60.
8581 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
8582 Do not check for uintptr_t, since new stdint module does the right
8583 thing.
8584 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
8585 Add stdint.h, stdint_.h, wcwidth.h.
8586 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
8587 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
8588 stdint.m4, wchar_t.m4, wcwidth.m4.
8589 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
8590 usual order for ../lib/*.h files.
8591 (file_name_split): Use last_component, not base_name, to adjust
8592 to gnulib changes.
8593 * src/parse-gram.h: Include <strverscmp.h> in the usual order
8594 for ../lib/*.h files.
8595 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
8596 Define unconditionally, since we now assume the stdint module.
8597 * src/scan-skel.l: Include <dirname.h>.
8598 (BASE_QPUTS): Use last_component, not base_name.
8599 * src/system.h: Include <unlocked-io.h> in the usual order
8600 for ../lib/*.h files. Include <stdint.h> unconditionally,
8601 since we now use the stdint module.
8602 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
8603 HAVE_UINTPTR_T, since we now use the stdint module.
8604 (base_name): Remove decl, since files now include <dirname.h>
8605 to get the decl.
8606
8607 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
8608
8609 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
8610 New, default to 1.
8611 * data/yacc.c, data/glr.c, data/location.cc: Use them.
8612 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
8613 default.
8614 * tests/calc.at: Adjust.
8615
8616 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
8617
8618 * data/c.m4 (b4_basename): New.
8619 (b4_syncline): Also output the location of its invocation (from
8620 the skeleton).
8621 (b4_user_action, b4_define_user_action, b4_user_actions)
8622 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
8623 (b4_user_stype): New.
8624 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
8625
8626 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8627
8628 In the grammar file, the first column is 1 not 0 on the first line as
8629 on every other line.
8630 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
8631 * tests/input.at (Torturing the Scanner): Update output.
8632
8633 * src/scan-gram.l (scanner_cursor): Declare it static.
8634
8635 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8636
8637 In warnings, say "previous declaration" rather than "first
8638 declaration".
8639 * src/symtab.c (redeclaration): Do that here.
8640 * src/reader.c (record_merge_function_type): In the case of a result
8641 type clash, report the previous declaration rather than the very first
8642 one in the grammar file.
8643 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8644 declared later): Add a third declaration to check this behavior.
8645 * tests/input.at (Incompatible Aliases): Update output.
8646
8647 2006-06-27 Akim Demaille <akim@epita.fr>
8648
8649 * doc/Doxyfile.in: New.
8650 * doc/Makefile.am: Use it.
8651 * src/lalr.h, src/symtab.h: Initial doxygenation.
8652
8653 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8654
8655 Don't miss %merge result type warnings just because the LHS types are
8656 declared after the %merge. This continues the effort of the previous
8657 patch.
8658 * src/reader.c (get_merge_function): Don't set the merger type yet.
8659 (record_merge_function_type): New function for setting the merger type
8660 and checking for clashes.
8661 (grammar_current_rule_merge_set): Set the location of the %merge for
8662 the current rule.
8663 (packgram): Invoke record_merge_function_type for each rule now that
8664 all symbol type declarations have been parsed.
8665 * src/reader.h (merger_list.type_declaration_location): New member
8666 storing the location of the first %merge from which the type for this
8667 merging function was derived.
8668 * src/symlist.h (symbol_list.merger_declaration_location): New member
8669 storing the location of a rule's %merge, if any.
8670 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8671 declared later): New test to catch the error fixed by the above patch.
8672
8673 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8674
8675 Get action warnings (grammar_rule_check) right even when symbol
8676 declarations appear after the rules. Discussed at
8677 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
8678 and
8679 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
8680 Don't mistake the type of $$ in a midrule to be that of its parent
8681 rule's $$.
8682 * src/reader.c (grammar_current_rule_end): Don't invoke
8683 grammar_rule_check yet since not all symbol declarations may have been
8684 parsed yet.
8685 (grammar_midrule_action): Likewise.
8686 Don't record whether the midrule's $$ has been used yet since actions
8687 haven't been translated yet.
8688 Record the midrule's parent rule and its RHS index within the parent
8689 rule.
8690 (grammar_current_rule_action_append): Don't translate the action yet
8691 since not all symbol declarations may have been parsed yet and, thus,
8692 warnings about types for $$, $n, @$, and @n can't be reported yet.
8693 (packgram): Translate the action and invoke grammar_rule_check now that
8694 all symbol declarations have been parsed.
8695 * src/scan-code.l (handle_action_dollar): Now that this is invoked
8696 after parsing the entire grammar file, the symbol list here in the case
8697 of a midrule is actually the midrule's empty RHS, so reference its
8698 parent rule's RHS where necessary.
8699 On the other hand, now that you can already know it's a midrule, you
8700 aren't forced to think $$ has the same type as its parent rule's $$.
8701 (handle_action_at): In the case of a midrule, reference the parent rule
8702 where necessary.
8703 * src/symlist.c (symbol_list_new): Initialize new midrule-related
8704 members.
8705 (symbol_list_length): Now that this is invoked after all rules have
8706 been parsed, a NULL symbol (rather than a NULL symbol list node)
8707 terminates a rule. symbol_list_print already does this correctly.
8708 * src/symlist.h (symbol_list.midrule_parent_rule,
8709 symbol_list.midrule_parent_rhs_index): New members so that midrules can
8710 remember their relationships with their parents.
8711 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
8712 fixed by the above patch.
8713 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
8714 implementing...
8715 (Unused values): ... this old test case and...
8716 (Unused values before symbol declarations): ... this new test case.
8717 This one is the same as `Unused values' except that all symbol
8718 declarations appear after the rules in order to catch the rest of the
8719 errors fixed by the above patch.
8720
8721 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8722
8723 More cleanup.
8724 * src/reader.c (current_rule): Declare it static since it's no longer
8725 used outside this file.
8726 (grammar_current_rule_action_append): Remove redundant arguments from
8727 translate_rule_action invocation.
8728 * src/reader.h (current_rule): Remove this unused extern.
8729 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
8730 * src/scan-code.l (translate_rule_action): Likewise.
8731
8732 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
8733
8734 Clean up yesterday's patch.
8735 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
8736 to...
8737 * src/reader.c (grammar_current_rule_action_append): ... here for
8738 consistency with grammar_current_rule_symbol_append.
8739 * tests/regression.at (Braced code in declaration in rules section):
8740 Make yyerror and yylex static as usual.
8741
8742 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
8743
8744 Fix bug that mistakes braced code in a declaration in the rules section
8745 to be a rule action. Mentioned at
8746 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
8747 * src/scan-gram.l: Move midrule action detection from the start of the
8748 scanning of any braced code to...
8749 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
8750 action. For readability, use $2 and @2 rather than the equivalent
8751 global variables.
8752 * tests/regression.at (Braced code in declaration in rules section):
8753 New test to catch the error fixed by the above patch.
8754
8755 Work on code readability some.
8756 * src/scan-code.l (current_rule): Get rid of this misleading and
8757 redundant declaration: it's actually extern'ed in reader.h.
8758 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
8759 translate_action): Add a rule argument and use it instead of the global
8760 current_rule.
8761 (translate_rule_action): This already receives current_rule through an
8762 argument, so pass it on to translate_action instead of assigning
8763 current_rule to current_rule.
8764 (translate_symbol_action, translate_code): Pass rule = NULL to
8765 translate_action.
8766
8767 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
8768
8769 Rename %before-definitions to %start-header and %after-definitions to
8770 %end-header. Don't use these declarations to separate pre-prologue
8771 blocks from post-prologue blocks. Add new order-independent
8772 declarations %before-header and %after-header as alternatives to the
8773 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
8774 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
8775 * NEWS (2.3+): Update for these changes.
8776 * data/glr.c (b4_before_definitions): Update to...
8777 (b4_start_header): ... this.
8778 (b4_after_definitions): Update to...
8779 (b4_end_header): ... this.
8780 * data/glr.cc: Likewise.
8781 * data/lalr1.cc: Likewise.
8782 * data/yacc.c: Likewise.
8783 * doc/bison.texinfo (The prologue): Update names, and replace remaining
8784 prologue blocks with %*-header declarations.
8785 (Calc++ Parser): Likewise.
8786 (Decl Summary): Update names.
8787 (Table of Symbols): Update description.
8788 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
8789 (PERCENT_END_HEADER): ... this.
8790 (PERCENT_BEFORE_DEFINITIONS): Update to...
8791 (PERCENT_START_HEADER): ... this.
8792 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
8793 (declaration): Update token names and m4 macro names.
8794 When parsing %end-header and %start-header, invoke translate_code
8795 before muscle_code_grow, and no longer set global booleans to remember
8796 whether these declarations have been seen.
8797 Parse new %after-header and %before-header.
8798 * src/reader.c (before_definitions, after_definitions): Remove.
8799 (prologue_augment): Accept a new bool argument to specify whether to
8800 augment the pre-prologue or post-prologue.
8801 * src/reader.h (before_definitions, after_definitions): Remove these
8802 extern's.
8803 (prologue_augment): Add new bool argument.
8804 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
8805 (PERCENT_END_HEADER): ... this.
8806 (PERCENT_BEFORE_DEFINITIONS): Update to...
8807 (PERCENT_START_HEADER): ... this.
8808 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
8809 * tests/actions.at (Printers and Destructors): Update names.
8810
8811 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
8812
8813 Add comparison operators for C++ location classes. Discussed at
8814 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
8815 * data/c++.m4 (b4_define_location_comparison): New boolean %define
8816 declaration indicating whether filename_type has an operator==. If
8817 filename_type is `std::string', it defaults to `1', `0' otherwise.
8818 * data/location.cc: Iff b4_define_location_comparison is `1', add
8819 operator== and operator!= for class position and for class location.
8820
8821 Some minor fixes.
8822 * src/scan-action.l: Remove unused file.
8823 * src/symtab.c (symbol_printer_set): Use printer_location not
8824 destructor_location.
8825 * src/symtab.h (struct symbol): Replace incorrect source comment for
8826 printer members.
8827 * tests/input.at (Incompatible Aliases): Update output with correct
8828 printer location.
8829
8830 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
8831
8832 Don't put the pre-prologue in the header file. For the yacc.c code
8833 file and the glr.c header and code files, move the pre-prologue before
8834 the token definitions. Add new %before-definitions and
8835 %after-definitions to declare code that will go in both the header file
8836 and code file. Discussed at
8837 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
8838 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
8839 and
8840 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
8841 * NEWS (2.3+): Describe these changes.
8842 * data/glr.c (b4_pre_prologue): Move from within to before...
8843 (b4_shared_declarations): ... this.
8844 Add new b4_before_definitions before b4_token_enums.
8845 Add new b4_after_definitions at the end.
8846 * data/glr.cc (b4_pre_prologue): Replace with...
8847 (b4_before_definitions): ... this in the header file.
8848 (b4_after_definitions): New near the end of the header file.
8849 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
8850 code file right before including the header file.
8851 (b4_before_definitions): New in the previous position of
8852 b4_pre_prologue in the header file.
8853 (b4_after_definitions): New near the end of the header file.
8854 * data/yacc.c: Clean up some m4 quoting especially in the header file.
8855 (b4_token_enums_defines): In the code file, move to right before
8856 YYSTYPE for consistency with the header file.
8857 (b4_before_definitions): New right before b4_token_enums_defines in
8858 both the header and code file.
8859 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
8860 header and code file.
8861 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
8862 of prologues for %union dependencies.
8863 (Decl Summary): In %defines description, mention the effect of
8864 %before-definitions and %after-definitions on the header file.
8865 (Calc++ Parser): Forward declare driver in a %before-definitions rather
8866 than in the pre-prologue so that make check succeeds.
8867 (Table of Symbols): Add entries for %before-definitions and
8868 %after-definitions.
8869 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
8870 %before-definitions.
8871 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
8872 (declaration): Parse those declarations and append to
8873 b4_before_definitions and b4_after_definitions, respectively.
8874 * src/reader.c (before_definitions, after_definitions): New bools to
8875 track whether those declarations have been seen.
8876 (prologue_augment): Add to the post-prologue if %union,
8877 %before-definitions, or %after-definitions has been seen.
8878 * src/reader.h (before_definitions, after_definitions): New extern's.
8879 * src/scan-gram.l: Scan the new declarations.
8880 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
8881 prologue block in a %before-definitions or a %after-definitions based
8882 on whether the %union is declared.
8883 * tests/regression.at (Early token definitions with --yacc, Early token
8884 definitions without --yacc): Move tests for token definitions into the
8885 post-prologue since token names are no longer defined in the
8886 pre-prologue.
8887
8888 2006-06-20 Akim Demaille <akim@epita.fr>
8889
8890 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
8891 (symbol_get): Use it.
8892 * src/parse-gram.y: Use it.
8893
8894 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
8895
8896 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
8897 build succeeds when configured with --enable-gcc-warnings.
8898
8899 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
8900
8901 * src/parse-gram.y (char_name): New function.
8902 (CHAR, STRING, string_content): For %printer, properly escape.
8903 (ID): Prefer fputs to fprintf.
8904 (id): Reindent to be consistent with other rules.
8905 Properly quote char.
8906
8907 The Translation Project changed its way of publishing translations
8908 to maintainers. I haven't received any responses to my request
8909 for supporting the old way, or for documenting the new way. I
8910 have modified 'bootstrap' to use screen scraping
8911 (in this case, HTML scraping). This is unreliable and inelegant,
8912 but I don't see any better way. Yuck.
8913 * bootstrap (TP_URL, WGET_COMMAND): New vars.
8914 (get_translations): New function, which uses HTML scraping to
8915 deduce locations of latest translations.
8916 Use this function to grab both bison and bison-runtime .po files.
8917 Don't bother priming the pump for the runtime-po domain any more,
8918 as it's now translated better than bison is.
8919
8920 2006-06-19 Akim Demaille <akim@epita.fr>
8921
8922 * src/scan-gram.l: No longer "parse" things after `%union' until
8923 `{'. Rather, return a single "%union" token.
8924 No longer make symbols: return strings, and leave the conversion
8925 to symbols to the parser.
8926 (SC_PRE_CODE, token_type): Remove.
8927 * src/parse-gram.y (%union): New field `character'.
8928 Sort tokens.
8929 (CHAR): New token.
8930 (ID, ID_COLON): Now that the scanner no longer makes them
8931 identifiers, adjust all uses to invoke symbol_get.
8932 (id_colon): New, wraps the conversion from string to symbol.
8933 (%union): Accept a possible union_name.
8934 (symbol): Now can be a char.
8935 * data/c.m4 (b4_union_name): Leave a default value.
8936 * data/glr.c, data/yacc.c: Use it.
8937
8938 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
8939
8940 For associating token numbers with token names for "yacc.c", don't use
8941 #define statements unless `--yacc' is specified; always use enum
8942 yytokentype. Most important discussions start at:
8943 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
8944 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
8945 and
8946 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
8947 * NEWS (2.3+): Mention.
8948 * data/c.m4 (b4_yacc_if): New.
8949 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
8950 token #define's.
8951 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
8952 on token name definitions.
8953 * src/getargs.c (usage): Capitalize `Yacc' in English.
8954 * src/output.c (prepare): Define b4_yacc_flag.
8955 * tests/regression.at (Early token definitions): Test that tokens names
8956 are defined before the pre-prologue not just before the post-prologue.
8957 Remove this test case and copy to...
8958 (Early token definitions with --yacc): ... this to test #define's.
8959 (Early token definitions without --yacc): ... and this to test enums.
8960
8961 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
8962
8963 * NEWS: Reword the post-2.3 change to not be so optimistic about
8964 removing the old "look-ahead" spelling.
8965 Update previous look-ahead/lookahead change reports.
8966 * REFERENCES: look-ahead -> lookahead (since that's
8967 what he actually wrote).
8968 * doc/refcard.tex: look ahead -> lookahead,
8969 look-ahead -> lookahead
8970
8971 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
8972
8973 For consistency, use `lookahead' instead of `look-ahead' or
8974 `look_ahead'. Discussed starting at
8975 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
8976 and then at
8977 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
8978 * NEWS: For the next release, note the change to `--report'.
8979 * TODO, doc/bison.1: Update English.
8980 * doc/bison.texinfo: Update English.
8981 (Understanding Your Parser, Bison Options): Document as
8982 `--report=lookahead' rather than `--report=look-ahead'.
8983 * src/conflicts.c: Update English in comments.
8984 (lookahead_set): Rename from look_ahead_set.
8985 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
8986 (resolve_sr_conflict): Rename local look_ahead_tokens to
8987 lookahead_tokens, and update other uses.
8988 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
8989 count_rr_conflicts, conflicts_free): Update uses.
8990 * src/getargs.c (report_args): Move "lookahead" before alternate
8991 spellings.
8992 (report_types): Update uses.
8993 (usage): For `--report' usage description, state `lookahead' spelling
8994 rather than `look-ahead'.
8995 * src/getargs.h (report.report_lookahead_tokens): Rename from
8996 report_look_ahead_tokens.
8997 * src/lalr.c: Update English in comments.
8998 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
8999 (state_lookahead_tokens_count): Rename from
9000 state_look_ahead_tokens_count.
9001 Rename local n_look_ahead_tokens to n_lookahead_tokens.
9002 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
9003 Rename local n_look_ahead_tokens to n_lookahead_tokens.
9004 Update other uses.
9005 Update English in output.
9006 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
9007 * src/print.c: Update English in comments.
9008 (lookahead_set): Rename from look_ahead_set.
9009 (print_reduction): Rename argument lookahead_token from
9010 look_ahead_token.
9011 (print_core, state_default_rule, print_reductions, print_results):
9012 Update uses.
9013 * src/print_graph.c: Update English in comments.
9014 (print_core): Update uses.
9015 * src/state.c: Update English in comments.
9016 (reductions_new): Update uses.
9017 (state_rule_lookahead_tokens_print): Rename from
9018 state_rule_look_ahead_tokens_print, and update other uses.
9019 * src/state.h: Update English in comments.
9020 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
9021 (state_rule_lookahead_tokens_print): Rename from
9022 state_rule_look_ahead_tokens_print.
9023 * src/tables.c: Update English in comments.
9024 (conflict_row, action_row): Update uses.
9025 * tests/glr-regression.at
9026 (Incorrect lookahead during deterministic GLR,
9027 Incorrect lookahead during nondeterministic GLR): Rename
9028 print_look_ahead to print_lookahead.
9029 * tests/torture.at: Update English in comments.
9030 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
9031 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
9032 (Many lookahead tokens): Update uses.
9033 * data/glr.c: Update English in comments.
9034 * lalr1.cc: Likewise.
9035 * yacc.c: Likewise.
9036 * src/conflicts.h: Likewise.
9037 * src/lalr.h: Likewise.
9038 * src/main.c: Likewise.
9039 * src/output.c: Likewise.
9040 * src/parse-gram.c: Likewise.
9041 * src/tables.h: Likewise.
9042 * tests/calc.at: Likewise.
9043
9044 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
9045
9046 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
9047
9048 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
9049
9050 * TODO: Add request from Nelson H. F. Beebe to be able to install
9051 Bison without installing the yacc script.
9052
9053 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9054
9055 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
9056 and yytext if they're already #define'd.
9057 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
9058 * src/scan-code-c.c: ... here.
9059 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
9060 <config.h>.
9061
9062 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9063
9064 Get Bison to build again when configured with --enable-gcc-warnings.
9065 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
9066 missing #include's.
9067 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
9068 loc argument as it shadows a global.
9069 * src/scan-gram.l: Remove stray comma that prevents boundary_set
9070 invocation.
9071
9072 * src/.cvsignore: Add scan-code.c.
9073
9074 2006-06-07 Akim Demaille <akim@epita.fr>
9075
9076 * src/scan-gram.l: Move the "add a trailing ; to actions" code
9077 to...
9078 * src/scan-code.l: here.
9079 * tests/input.at (Torturing the Scanner): Fix another location
9080 error.
9081
9082 2006-06-07 Akim Demaille <akim@epita.fr>
9083
9084 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
9085
9086 2006-06-06 Akim Demaille <akim@epita.fr>
9087
9088 Extract the parsing of user actions from the grammar scanner.
9089 As a consequence, the relation between the grammar scanner and
9090 parser is much simpler. We can also split "composite tokens" back
9091 into simple tokens.
9092 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
9093 * src/scan-gram.l (add_column_width, adjust_location): Move to and
9094 rename as...
9095 * src/location.h, src/location.c (add_column_width)
9096 (location_compute): these.
9097 Fix the column count: the initial column is 0.
9098 (location_print): Be robust to ending column being 0.
9099 * src/location.h (boundary_set): New.
9100 * src/main.c: Adjust to scanner_free being renamed as
9101 gram_scanner_free.
9102 * src/output.c: Include scan-code.h.
9103 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
9104 Use boundary_set.
9105 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
9106 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
9107 which is now, again, a separate token.
9108 Adjust all dependencies.
9109 Whereever actions with $ and @ are used, use translate_code.
9110 (action): Remove this nonterminal which is now useless.
9111 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
9112 (grammar_current_rule_action_append): Use translate_code.
9113 (packgram): Bound check ruleno, itemno, and rule_length.
9114 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
9115 (last_string, last_braced_code_loc, max_left_semantic_context)
9116 (scanner_initialize, scanner_free, scanner_last_string_free)
9117 (gram_out, gram_lineno, YY_DECL_): Move to...
9118 * src/scan-gram.h: this new file.
9119 (YY_DECL): Rename as...
9120 (GRAM_DECL): this.
9121 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
9122 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
9123 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
9124 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
9125 Move these declarations, and...
9126 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
9127 these to...
9128 * src/flex-scanner.h: this new file.
9129 * src/scan-gram.l (rule_length, rule_length_overflow)
9130 (increment_rule_length): Remove.
9131 (last_braced_code_loc): Rename as...
9132 (gram_last_braced_code_loc): this.
9133 Adjust to the changes of the parser.
9134 Move all the handling of $ and @ into...
9135 * src/scan-code.l: here.
9136 * src/scan-gram.l (handle_dollar, handle_at): Remove.
9137 (handle_action_dollar, handle_action_at): Move to...
9138 * src/scan-code.l: here.
9139 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
9140 scan-code.h, scan-code-c.c, scan-gram.h.
9141 (EXTRA_bison_SOURCES): Add scan-code.l.
9142 (BUILT_SOURCES): Add scan-code.c.
9143 (yacc): Be robust to white spaces.
9144
9145 * tests/conflicts.at, tests/input.at, tests/reduce.at,
9146 * tests/regression.at: Adjust the column numbers.
9147 * tests/regression.at: Adjust the error message.
9148
9149 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9150
9151 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9152 Use Akim's wording from
9153 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
9154
9155 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9156
9157 Between Bison releases, manually append `+' to the previous Bison
9158 release number, and use that as a signal to automatically print the
9159 ChangeLog's CVS Id keyword from --version. Discussed starting at
9160 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
9161 * ChangeLog: Add Id header.
9162 * configure.ac (AC_INIT): Append `+' to `2.3'.
9163 * src/.cvsignore: Add revision.c.
9164 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
9165 (BUILT_SOURCES): Add revision.c.
9166 (revision.c): New target rule. This file defines a new global variable
9167 named revision. It initializes it with either the Id from ChangeLog
9168 or, if VERSION doesn't contain `+', with the empty string.
9169 * src/getargs.c (version): Print the value of revision.
9170 * src/revision.h: Extern revision.
9171
9172 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
9173
9174 * NEWS: Version 2.3.
9175 * configure.ac (AC_INIT): Likewise.
9176
9177 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
9178
9179 * data/glr.c (YYRECOVERING): Define to be a function-like macro
9180 with no arguments, not as an object-like macro. This is for
9181 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
9182 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
9183 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
9184 Document this.
9185
9186 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
9187
9188 * src/getargs.c (usage): Back out yesterday's modification of the
9189 --help output so that we don't have to wait for translation before
9190 releasing 2.3.
9191
9192 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
9193
9194 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
9195 Problem reported by Akim Demaille.
9196
9197 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
9198
9199 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9200
9201 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
9202
9203 * data/yacc.c (yy_reduce_print): Omit trailing white space in
9204 generated source code. Problem reported by Frans Englich in
9205 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
9206
9207 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
9208
9209 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
9210 shell, not within 'make', so that 'make' by an ordinary builder
9211 (using GNU make) does not worry about configuring gzip. This also
9212 works around a bug reported independently by Keith Thompson and by
9213 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
9214 stderr rather than stdout, messing up the build logs.
9215
9216 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9217
9218 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
9219 to make sure that YYID will never be unused. This fixes a 'make
9220 maintainer-check' failure caused by the recent changes to the 'Trivial
9221 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
9222 not used.
9223 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
9224
9225 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9226
9227 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
9228 state before an empty RHS is always resolved here. Only the location
9229 of that state is guaranteed to be resolved, and that's enough. This
9230 fixes the remaining bug reported by Derek M. Jones in
9231 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9232 * tests/glr-regression.at (Uninitialized location when reporting
9233 ambiguity): Test the above case.
9234 Also, the embedded comments in this test case claim it checks the case
9235 of an empty RHS that has inherited the initial location. However, the
9236 corresponding LHS was already resolved, so yyresolveLocations didn't
9237 actually have reason to modify it. Fix this by forcing
9238 nondeterministic operation at the beginning of the parse.
9239
9240 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
9241
9242 * data/c.m4 (b4_yy_symbol_print_generate):
9243 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
9244 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
9245 of the bugs reported today by Derek M Jones in
9246 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9247 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
9248 defined to be a type name without parens or brackets.
9249 (Location Type): Similarly for YYLTYPE.
9250 * tests/regression.at (Trivial grammars): Put in a test for this
9251 bug that will be caught by 'make maintainer-check' (though not,
9252 alas, by 'make check' unless your compiler is picky).
9253
9254 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
9255
9256 * NEWS: Version 2.2.
9257 * configure.ac (AC_INIT): Likewise.
9258
9259 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
9260
9261 * data/glr.c (yyreportTree): Make room in yystates for the state
9262 preceding the RHS. This fixes the segmentation fault reported by Derek
9263 M. Jones in
9264 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
9265 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
9266 to the user. Reported for yyreportTree by Derek M. Jones later in the
9267 same thread.
9268 * THANKS: Add Derek M. Jones.
9269 Update my email address.
9270 Fix typo in Steve Murphy's name.
9271
9272 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
9273
9274 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
9275 checking against YYLAST that caused the parser to miss a potential
9276 alternative in its diagnostic.
9277 Problem reported by Maria Jose Moron Fernandez in
9278 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
9279 * data/lalr1.cc (yysyntax_error_): Likewise.
9280 * data/yacc.c (yysyntax_error): Likewise.
9281 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
9282 tokens, in case we run into an older C compiler.
9283 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
9284 Use them to check for the off-by-one error fixed above.
9285
9286 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
9287 YYSIZE_T, not size_t.
9288 * tests/regression.at (Trivial grammars): New test, to catch
9289 the error fixed by the above patch.
9290
9291 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
9292
9293 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
9294 scheme.
9295 Reported by Steve Murphy.
9296
9297 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
9298
9299 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
9300 * data/glr.cc: b4_location_flag is now b4_locations_flag.
9301
9302 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
9303
9304 Implement --trace=m4.
9305 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
9306 * src/output.c (output_skeleton): When set, pass -dV to m4.
9307
9308 Factor the handling of flags in m4.
9309 * src/output.c (prepare): Rename the muscle names debug, defines,
9310 error_verbose to debug_flag, defines_flag, error_verbose_flag.
9311 * data/c.m4: Adjust.
9312 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
9313 Use b4_define_flag_if to define other b4_FLAG_if macros.
9314 (b4_location_if): As a consequence, rename as...
9315 (b4_locations_if): this, for consistency.
9316 Adjust all the skeletons.
9317
9318 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
9319
9320 * etc/bench.pm: Shorten bench names.
9321
9322 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
9323
9324 * src/output.h, src/output.c (error_verbose): Move to...
9325 * src/getargs.h, src/getargs.c: here.
9326 Sort the flags.
9327 Adjust dependencies.
9328
9329 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
9330
9331 * data/c.m4 (b4_copyright): Put the special exception for Bison
9332 skeletons here, so we don't have to put it in each skeleton. All
9333 uses changed. Suggested by Akim Demaille. Also, wrap the
9334 copyright notice, in case it is longer than 80 columns. Replace
9335 comma by newline after title.
9336
9337 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
9338
9339 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
9340 incompatibility, not a bug. Mention that it wasn't fixed as of
9341 flex 2.5.33.
9342
9343 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
9344
9345 * examples/extexi: Enforce the precedence of concatenation over
9346 >>.
9347 Reported by Tommy Nordgren.
9348
9349 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
9350
9351 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
9352 with the member "token".
9353 Reported by Martin Nylin.
9354
9355 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
9356
9357 * data/glr.c: Switch to Bison 2.2 special-exception language in
9358 the copyright notice. Use more-regular format for titles and
9359 copyright notices.
9360 * data/glr.cc: Likewise.
9361 * data/location.cc: Likewise.
9362 * data/yacc.cc: Likewise.
9363 * doc/bison.texinfo (Conditions): Document this.
9364 * NEWS: likewise. Upgrade version to 2.2.
9365
9366 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
9367
9368 * data/glr.cc: Remove dead code.
9369
9370 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
9371
9372 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
9373 that variable and the line breaks the bootstrap. Problem reported
9374 by Juan M. Guerrero.
9375
9376 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
9377
9378 * doc/bison.texinfo (Multiple start-symbols): New.
9379
9380 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
9381
9382 * etc/README, etc/bench.pl: New.
9383
9384 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
9385
9386 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
9387 rule.
9388 Reported by Mickael Labau.
9389 * tests/input.at (Torturing the Scanner): Test it.
9390
9391 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
9392
9393 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
9394 Problem reported by Bob Rossi.
9395
9396 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
9397
9398 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
9399 and didn't really work.
9400 For the index, use @ifnotinfo, not @iftex.
9401 Minor cleanups of spacing and terminology.
9402
9403 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
9404
9405 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
9406 of AT_NAME_PREFIX when %name-prefix is not used.
9407
9408 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
9409
9410 Apply --prefix to C++ skeletons too: they change the namespace.
9411 The test suite already exercize these cases.
9412 * data/c++.m4 (b4_namespace): New.
9413 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
9414 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
9415 * data/yacc.c, data/glr.c: Remove a useless `[]'.
9416 * doc/bison.texinfo: Document it.
9417 (Option Cross Key): Use @multitable in all formats. It looks
9418 nicer, even in TeX outputs.
9419 (Rules): Use the same code whatever the output type is.
9420 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
9421 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
9422 * tests/calc.at: Use it, instead of hard coding `yy'.
9423
9424 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
9425
9426 * TODO: Remove dead items.
9427
9428 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
9429
9430 * doc/FAQ: Remove, merged into...
9431 * doc/bison.texinfo (FAQ): this.
9432 * doc/Makefile.am (EXTRA_DIST): Adjust.
9433
9434 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
9435
9436 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
9437 even if empty.
9438 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
9439 * doc/bison.texinfo (Calc++ Scanner): Use it.
9440
9441 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
9442
9443 Fix two nits reported by twlevo, plus one more that I discovered.
9444
9445 * src/assoc.h (assoc_to_string): Give a name to the arg, as
9446 this is the usual Bison style.
9447 * src/location.h (location_print): Likewise.
9448
9449 * src/reader.h (token_name): Likewise.
9450
9451 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
9452
9453 Fix some nits reported by twlevo.
9454 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
9455 and "POSIX". Use more-modern syntax for URLs. Mention C++
9456 and ask for Java. Don't hardwire OS version numbers. Add
9457 copyright notice.
9458 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
9459 * src/conflicts.c (solved_conflicts_obstack): Now static.
9460
9461 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
9462
9463 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
9464 page. Say "you can use it" not "you may use it" as on the web page;
9465 we're describing capabilities not granting permission.
9466
9467 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
9468
9469 * data/glr.c (yyresolveLocations): Rename local variables to avoid
9470 shadowing warnings. Use usual patter for iterating through RHS.
9471 * tests/glr-regression.at
9472 (Uninitialized location when reporting ambiguity):
9473 Modify yylex so that it uses its argument, rather than trying
9474 to rely on ARGSUSED (which doesn't work for gcc with warnings).
9475 const char -> char const.
9476
9477 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
9478 Don't use tabs inside commands; it messes up 'ps'.
9479 Problem reported by twlevo.
9480
9481 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
9482
9483 * tests/glr-regression.at (Uninitialized location when reporting
9484 ambiguity): New test case.
9485 * data/glr.c (yyresolveLocations): New function, which uses
9486 YYLLOC_DEFAULT.
9487 (yyresolveValue): Invoke yyresolveLocations before reporting an
9488 ambiguity.
9489 * doc/bison.texinfo (Default Action for Locations): Note
9490 YYLLOC_DEFAULT's usage for ambiguity locations.
9491 (GLR Semantic Actions): Cross-reference those notes.
9492
9493 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
9494
9495 * tests/glr-regression.at (Leaked semantic values when reporting
9496 ambiguity): Remove unnecessary union and type declarations.
9497 (Leaked lookahead after nondeterministic parse syntax error): New test
9498 case.
9499 * data/glr.c (yyparse): Check for zero stacks remaining before
9500 attempting to shift the lookahead so that you don't lose it.
9501
9502 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
9503
9504 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
9505 * tests/glr-regression.at (Leaked semantic values when reporting
9506 ambiguity): New test case.
9507 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
9508 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
9509 now unnecessary yystackp parameter.
9510 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
9511 destructors can be called.
9512
9513 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
9514 in existing testcases.
9515
9516 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
9517
9518 Don't leak semantic values for parent RHS when a user action cuts the
9519 parser, and clean up related code a bit.
9520 * tests/glr-regression.at (Leaked merged semantic value if user action
9521 cuts parse): Rename to...
9522 (Leaked semantic values if user action cuts parse): ... this. Add check
9523 for leaked parent RHS values.
9524 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
9525 between an unresolved state (non-empty chain of semantic options) and
9526 an incomplete one (signaled by an empty chain).
9527 (yyresolveStates): Document the interface. Move all manipulation of a
9528 successfully or unsuccessfully resolved yyGLRState to...
9529 (yyresolveValue): ... here so that yyresolveValue always leaves a
9530 yyGLRState with consistent data and thus is easier to understand.
9531 Remove the yyvalp and yylocp parameters since they are always just
9532 taken from the yys parameter. When reporting a discarded merged value
9533 in debugging output, note that it is incompletely merged. Document the
9534 interface.
9535 (yyresolveAction): If resolving any of the RHS states fails, destroy
9536 them all rather than leaking them. Thus, as long as user actions are
9537 written to clean up the RHS correctly, yyresolveAction always cleans up
9538 the RHS of a semantic option. Document the interface.
9539
9540 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
9541
9542 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
9543 led to a segmentation fault in GNU Pascal. Problem reported
9544 by Waldek Hebisch.
9545
9546 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
9547
9548 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
9549 mid-rule action inside a nonterminal symbol in order to declare a
9550 destructor for its semantic value.
9551
9552 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
9553
9554 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
9555 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
9556 __cplusplus && ! defined _STDLIB_H && !
9557 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
9558 defined free))]: Include <stdlib.h> rather than rolling our own
9559 declarations of malloc and free, to avoid problems with
9560 incompatible declarations (using 'throw') C++'s stdlib.h. This
9561 should fix Debian bug 340012
9562 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
9563 reported by Guillaume Melquiond.
9564
9565 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9566
9567 * NEWS: Clarify symbols versus types in unused-value warnings.
9568
9569 * configure.ac (AC_INIT): Bump version number.
9570
9571 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9572
9573 * NEWS: Version 2.1a.
9574 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
9575 since C99 requires this.
9576
9577 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
9578
9579 * m4/c-working.m4: New file.
9580 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
9581
9582 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
9583
9584 * Makefile.maint: Merge from coreutils.
9585
9586 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
9587
9588 More portability fixes for problems summarized by Nelson H. F. Beebe.
9589
9590 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
9591 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
9592 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
9593 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
9594 messes up because C++ code is compiled in 32-bit mode but linked
9595 in 64-bit mode.
9596
9597 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
9598
9599 More portability fixes for problems summarized by Nelson H. F. Beebe.
9600
9601 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
9602 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
9603
9604 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
9605 nodist_PROGRAMS, since we don't need to actually compile the
9606 example if we're just doing a plain 'make'. This avoids bothering
9607 the installer unnecessarily about problems due to weird C++
9608 compilers.
9609
9610 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
9611
9612 More portability fixes for problems summarized by Nelson H. F. Beebe.
9613
9614 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
9615 than #include "...", and compile with -I'.'. The old method was
9616 not portable, according to Posix and the C standard, and it does
9617 not work with Sun C 5.7, where previous #line directives affect
9618 the working directory used in later #include "..." directives.
9619
9620 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9621
9622 Various DJGGP specific issues in /djgpp
9623
9624 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
9625
9626 More portability fixes for problems summarized by Nelson H. F. Beebe.
9627
9628 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
9629 '#include <map>' works and that you can apply ++ to iterators.
9630
9631 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
9632
9633 Work around portability problems summarized by Nelson H. F. Beebe in
9634 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
9635
9636 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
9637 that '#include <string>' works.
9638
9639 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
9640 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
9641 "warning: sorry: semantics of inline function static data `const
9642 unsigned char translate_table[262]' are wrong (you'll wind up with
9643 multiple copies)".
9644
9645 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
9646 or, xor to not_, and_, or_, and xor_, respectively. This works
9647 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
9648 random system header somewhere that includes the equivalent of
9649 <iso646.h>.
9650
9651 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
9652 -E" works; it apparently doesn't work with PathScale EKO Compiler
9653 Suite Version 2.0.
9654
9655 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
9656
9657 During deterministic GLR operation, user actions should be able to
9658 influence the parse by changing yychar. To make this easier to fix and
9659 to make glr.c easier to evolve in general, don't maintain yytoken in
9660 parallel with yychar; just compute yytoken when needed.
9661 * tests/glr-regression.at (Incorrect lookahead during deterministic
9662 GLR): Check that setting yychar in a user action has the intended
9663 effect.
9664 * data/glr.c (yyGLRStack): Remove yytokenp member.
9665 (yyclearin): Don't set *yytokenp.
9666 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
9667 yychar rather than *yytokenp to determine the current lookahead.
9668 Compute yytoken locally when needed.
9669 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
9670 point to.
9671
9672 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
9673 after `--report' documentation.
9674
9675 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
9676
9677 * src/parse-gram.y (grammar_declaration): Location of printer
9678 symbol is @1, not list->location. Bug reported by twlevo.
9679 * tests/input.at (Incompatible Aliases): Adjust to above change.
9680
9681 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
9682
9683 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
9684 all the test at once. This makes the output easier to read in the
9685 normal case.
9686
9687 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
9688 got from <http://bro-ids.org/download.html>. The bug is that
9689 when two actions appeared in succession, the second one was
9690 scanned before the first one was added to the grammar rule
9691 as a midrule action. Bison then output the incorrect warning
9692 "parse.y:905.17-906.36: warning: unused value: $3".
9693 * src/parse-gram.y (BRACED_CODE, action): These are no longer
9694 associated with a value.
9695 (rhs): Don't invoke grammar_current_rule_action_append.
9696 (action): Invoke it here instead.
9697 * src/reader.c (grammar_midrule_action): Now extern.
9698 (grammar_current_rule_action_append): Don't invoke
9699 grammar_midrule_action; that is now the scanner's job.
9700 * src/reader.h (last_string, last_braced_code_loc):
9701 (grammar_midrule_action): New decls.
9702 * src/scan-gram.l (last_string): Now extern, sigh.
9703 (last_braced_code_loc): New extern variable.
9704 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
9705 rule already has an action.
9706 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
9707 * tests/input.at (AT_CHECK_UNUSED_VALUES):
9708 Add some tests to check that the above changes fixed the bug.
9709
9710 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
9711
9712 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
9713 All used changed. Check whether the symbol has a destructor,
9714 not whether it is typed.
9715 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
9716 that the values are still reported as unused. All line numbers
9717 adjusted.
9718
9719 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
9720
9721 Work around a bug in bro 0.8, which underparenthesizes its
9722 definition of YYLLOC_DEFAULT.
9723 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
9724 their arguments.
9725 * data/lalr1.cc: Likewise.
9726 * data/yacc.cc: Likewise.
9727
9728 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
9729
9730 Work around a bug in Pike 7.0, and give the Pike folks a
9731 better way to override the usual int widths.
9732 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
9733 user can override the types.
9734 (short): #undef, to work around a bug in Pike 7.0.
9735 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
9736 (union yyalloc.yyss): Use yytype_int16 rather than short.
9737 All uses changed.
9738 (yysigned_char): Remove.
9739 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
9740 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
9741 * tests/regression.at (Web2c Actions): Adjust to above changes.
9742
9743 * src/reader.c (check_and_convert_grammar): New function.
9744 (reader): Close the input file even if something went wrong during
9745 parsing. Minor file descriptor leak reported by twlevo.
9746
9747 * src/assoc.c (assoc_to_string): Use a default: abort (); case
9748 to pacify gcc -Wswitch-default.
9749 * src/scan-gram.l (adjust_location): Use a default: break; case
9750 to pacify gcc -Wswitch-default.
9751 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
9752 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
9753 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
9754 Move these decls to scan-skel.l, since they don't need to be
9755 visible elsewhere.
9756 * src/scan-skel.l: Accept the above decls.
9757 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
9758 is used.
9759
9760 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
9761
9762 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
9763 since we don't want to insist on a version number at the start
9764 of the changelog every time.
9765 * Makefile.maint: Sync from coreutils a bit better.
9766 (sc_trailing_blank): Renamed from sc_trailing_space.
9767 All uses changed.
9768 (sc_no_if_have_config_h, sc_require_config_h):
9769 (sc_prohibit_assert_without_use): New rules.
9770 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
9771 (sc_dd_max_sym_length): Fix leading spaces in rule.
9772 (sc_system_h_headers): Prefix with @.
9773 (sc_useless_cpp_parens, m4-check): Output line numbers.
9774 (changelog-check): Allow version only in head.
9775 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
9776 satisfy new Makefile.maint rule.
9777 * data/glr.c: Likewise.
9778 * data/glr.cc: Likewise.
9779 * data/lalr1.cc: Likewise.
9780 * data/yacc.c: Likewise.
9781 * lib/ebitsetv.c: Likewise.
9782 * lib/lbitset.c: Likewise.
9783 * lib/subpipe.c: Likewise.
9784 * lib/timevar.c: Likewise.
9785 * src/system.h: Likewise.
9786 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
9787 * djgpp/Makefile.maint: Add copyright notice.
9788 * djgpp/README.in: Likewise.
9789 * djgpp/config.bat: Likewise.
9790 * djgpp/config.site: Likewise.
9791 * djgpp/config_h.sed: Likewise.
9792 * djgpp/djunpack.bat: Likewise.
9793 * djgpp/config.sed: Fix copyright notice to match standard format.
9794 * djgpp/subpipe.h: Likewise.
9795 * lib/bitsetv-print.c: Likewise.
9796 * lib/bitsetv.c: Likewise.
9797 * lib/subpipe.h: Likewise.
9798 * lib/timevar.c: Likewise.
9799 * lib/timevar.h: Likewise.
9800 * djgpp/subpipe.c: Use standard recipe for config.h.
9801 * lib/abitset.c: Likewise.
9802 * lib/bitset.c: Likewise.
9803 * lib/bitset_stats.c: Likewise.
9804 * lib/bitsetv-print.c: Likewise.
9805 * lib/bitsetv.c: Likewise.
9806 * lib/ebitsetv.c: Likewise.
9807 * lib/get-errno.c: Likewise.
9808 * lib/lbitset.c: Likewise.
9809 * lib/subpipe.c: Likewise.
9810 * lib/timevar.c: Likewise.
9811 * lib/vbitset.c: Likewise.
9812 * tests/local.at: Likewise.
9813 * src/scan-gram.l: Don't include verify.h, since system.h does
9814 that for us.
9815 * .x-sc_require_config_h: New file.
9816 * .x-sc_unmarked_diagnostics: New file.
9817
9818 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
9819
9820 Be a bit more systematic about using 'abort'.
9821 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
9822 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
9823 Put 'default: abort ();' before some other case, to satisfy older
9824 pedantic compilers.
9825 * lib/bitset_stats.c (bitset_stats_init): Likewise.
9826 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
9827 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
9828 * src/conflicts.c (resolve_sr_conflict): Likewise.
9829 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
9830 (get_decision_str, get_orientation_str, get_node_alignment_str):
9831 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
9832 (get_linestyle_str, get_arrowstyle_str): Likewise.
9833 * src/conflicts.c (resolve_sr_conflict):
9834 Use a default case rather than one for the one remaining enum
9835 value, to catch invalid enum values as well.
9836 * src/lalr.c (set_goto_map, map_goto):
9837 Prefer "assert (FOO);" to "if (!FOO) abort ();".
9838 * src/nullable.c (nullable_compute, token_definitions_output):
9839 Likewise.
9840 * src/reader.c (packgram, reader): Likewise.
9841 * src/state.c (transitions_to, state_new, state_reduction_find):
9842 Likewise.
9843 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
9844 (symbol_pack): Likewise.
9845 * src/tables.c (conflict_row, pack_vector): Likewise.
9846 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
9847 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
9848 * src/system.h: Don't include <assert.h>.
9849 (assert): New macro.
9850
9851 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
9852 (Destructor Decl, Parser Function, Pure Calling):
9853 Describe rules for braces inside C code more carefully.
9854
9855 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
9856
9857 Fix some porting glitches found by Nelson H. F. Beebe.
9858 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
9859 compilers that don't understand that abort () does not return.
9860 * src/state.c (transitions_to): Likewise.
9861 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
9862 that '#include <cstdlib>' works.
9863 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
9864 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
9865 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
9866 for the benefit of some pre-C99 compilers.
9867
9868 * bootstrap: Undo changes to gnulib files that autoreconf made.
9869
9870 Minor fixups to get 'make maintainer-check' to work.
9871 * configure.ac: Don't use -Wnested-externs, as it's incompatible
9872 with the new verify.h implementation.
9873 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
9874 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
9875 * data/yacc.c (YYUSE): Likewise.
9876 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
9877 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
9878 * src/parse-gram.y (declaration): Don't pass a string constant
9879 to a function that expects char *, since GCC might complain
9880 about the constant value.
9881 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
9882 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
9883 before #defining them.
9884 * tests/glr-regression.at
9885 (Incorrectly initialized location for empty right-hand side in GLR):
9886 In yyerror, use the msg arg.
9887 (Corrupted semantic options if user action cuts parse):
9888 (Incorrect lookahead during deterministic GLR):
9889 (Incorrect lookahead during nondeterministic GLR):
9890 Don't name a local var 'index'; it shadows string.h's 'index'.
9891
9892 2006-01-19 Akim Demaille <akim@epita.fr>
9893
9894 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
9895 location, not just parts of it.
9896
9897 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
9898
9899 * NEWS: Document the fact that multiple %unions are now allowed.
9900 * doc/bison.texinfo (Union Decl): Likewise.
9901 * TODO: This feature is now implemented, so remove it from
9902 the wishlist.
9903
9904 * Makefile.maint: Merge with coreutils Makefile.maint.
9905 (CVS_LIST): Use build-aux version if available.
9906 (VERSION_REGEXP): New macro.
9907 (syntax-check-rules): Add sc_no_if_have_config_h,
9908 sc_prohibit_assert_without_use, sc_require_config_h,
9909 sc_useless_cpp_parens.
9910 (sc_obsolete_symbols): Check for O_NDELAY.
9911 (sc_dd_max_sym_length): Track coreutils.
9912 (sc_unmarked_diagnostics): Look in all files, not just *.c.
9913 (sc_useless_cpp_parens): New rule.
9914 (news-date-check): Look for version or today's date.
9915 (changelog-check): Don't require version number near head.
9916 (copyright-check): Use current year instead of hardwiring 2005.
9917 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
9918 (announcement): Add --gpg-key-ID.
9919
9920 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
9921 with "file system".
9922
9923 Avoid undefined behavior that addressed just before the start of an
9924 array. Problem reported by twlevo.
9925 * src/reader.c (packgram): Prepend a new sentinel before ritem.
9926 * src/lalr.c (build_relations): Rely on new sentinel.
9927 * src/gram.c (gram_free): Adjust to new sentinel.
9928
9929 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
9930
9931 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
9932 yylookaheadNeeds. All uses updated.
9933 (yysplitStack): Rename local yynewLookaheadStatuses to
9934 yynewLookaheadNeeds.
9935 * data/glr-regression.at (Incorrect lookahead during nondeterministic
9936 GLR): In comments, change `lookahead status' to `lookahead need'.
9937
9938 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9939
9940 * data/glr.c (yysplitStack): A little stylistic rewrite.
9941
9942 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9943
9944 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
9945
9946 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
9947
9948 * doc/bison.texinfo: Fix some typos.
9949 (GLR Semantic Actions): New subsection discussing special
9950 considerations because GLR semantic actions might be deferred.
9951 (Actions): Mention look-ahead usage of yylval.
9952 (Actions and Locations): Mention look-ahead usage of yylloc.
9953 (Special Features for Use in Actions): Add YYEOF entry and mention it
9954 in the yychar entry.
9955 In the yychar entry, remove mention of the local yychar case (pure
9956 parser) since this is irrelevant information when writing semantic
9957 actions and since it's already discussed in `Table of Symbols' where
9958 yychar is otherwise described as an external variable.
9959 In the yychar entry, don't call it the `current' look-ahead since it
9960 isn't when semantic actions are deferred.
9961 In the yychar and yyclearin entries, add note about deferred semantic
9962 actions.
9963 Add yylloc and yylval entries discussing look-ahead usage.
9964 (Look-Ahead Tokens): When discussing yychar, don't call it the
9965 `current' look-ahead, and do mention yylval and yylloc.
9966 (Error Recovery): Cross-reference `Action Features' when mentioning
9967 yyclearin.
9968 (Table of Symbols): In the yychar entry, don't call it the `current'
9969 look-ahead.
9970 In the yylloc and yylval entries, mention look-ahead usage.
9971
9972 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
9973
9974 * tests/glr-regression.at: Update copyright year to 2006.
9975
9976 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
9977
9978 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
9979 use during nondeterministic operation to track which stacks have
9980 actually needed the current lookahead.
9981 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
9982 Allocate, deallocate, resize, and otherwise shuffle space for
9983 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
9984 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
9985 appropriately during nondeterministic operation.
9986 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
9987 members to store the current lookahead to be used by the deferred
9988 user action.
9989 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
9990 from which the RHS is taken. Set the lookahead members of the new
9991 yySemanticOption according to the lookahead status for stack yyk.
9992 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
9993 yyaddDeferredAction.
9994 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
9995 members of yySemanticOption before invoking yyuserAction, and then set
9996 them back to their current values afterward.
9997 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
9998 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
9999 * tests/glr-regression.at: Remove `.' from the ends of recent test case
10000 titles for consistency.
10001 (Leaked merged semantic value if user action cuts parse): In order to
10002 suppress lint warnings, use arguments in merge function, and assign
10003 char value < 128 in main.
10004 (Incorrect lookahead during deterministic GLR): New test case.
10005 (Incorrect lookahead during nondeterministic GLR): New test case.
10006
10007 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10008
10009 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
10010 !yyvaluep as signal that no semantic value is available to print.
10011 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
10012 to print a semantic value.
10013
10014 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10015
10016 * tests/glr-regression.at: For consistency with my newer test cases,
10017 don't thank myself.
10018
10019 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
10020
10021 * data/glr.c (yyresolveValue): When merging semantic options, if at
10022 least one user action succeeds but a later one cuts the parse, then
10023 destroy the semantic value before returning rather than leaking it.
10024 (yyresolveStates): If a user action cuts the parse and thus
10025 yyresolveValue fails, ignore the (unset) semantic value rather than
10026 corrupting the yyGLRState, and empty the semantic options list since
10027 the user actions should have called all necessary destructors.
10028 Simplify code with YYCHK.
10029 * tests/glr-regression.at (Corrupted semantic options if user action
10030 cuts parse): New test case.
10031 (Undesirable destructors if user action cuts parse): New test case.
10032 Before applying any of this patch, this test case never actually failed
10033 for me... but only because the corrupted semantic options usually
10034 masked this bug.
10035 (Leaked merged semantic value if user action cuts parse): New test
10036 case.
10037
10038 2006-01-05 Akim Demaille <akim@epita.fr>
10039
10040 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
10041
10042 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
10043
10044 * data/c.m4 (b4_c_modern): New macro, with a new provision for
10045 _MSC_VER. Problem reported by Cenzato Marco.
10046 (b4_c_function_def): Use it.
10047 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
10048 b4_c_modern.
10049 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
10050 than rolling our own.
10051
10052 2006-01-04 Akim Demaille <akim@epita.fr>
10053
10054 Also warn about non-used mid-rule values.
10055 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
10056 member.
10057 (symbol_list_new): Adjust.
10058 * src/reader.c (symbol_typed_p): New.
10059 (grammar_rule_check): Use it.
10060 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
10061 Check its rule.
10062 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
10063 Use it.
10064 * tests/actions.at (Exotic Dollars): Adjust.
10065
10066 2006-01-04 Akim Demaille <akim@epita.fr>
10067
10068 * src/reader.c (grammar_midrule_action): If $$ is set in a
10069 mid-rule, move the `used' bit to its lhs.
10070 * tests/input.at (Unused values): New.
10071 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
10072
10073 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
10074
10075 * doc/bison.texinfo (Bison Options): Say more accurately what
10076 --yacc does.
10077 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
10078 about declarations in the grammar when in Yacc mode, as POSIX does
10079 not require a diagnostic when the grammar uses extensions.
10080
10081 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
10082
10083 Warn about dubious constructions like "%token T T".
10084 Reported by twlevo.
10085 * src/symtab.h (struct symbol.declared): New member.
10086 * src/symtab.c (symbol_new): Initialize it to false.
10087 (symbol_class_set): New arg DECLARING, specifying whether
10088 this is a declaration that we want to warn about, if there
10089 is more than one of them. All uses changed.
10090
10091 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
10092 Allow multiple %union directives, whose contents concatenate.
10093 * src/parse-gram.y (grammar_declaration): Likewise.
10094 Use muscle_code_grow, so that we don't need stype_line any more.
10095 All uses changed.
10096
10097 * src/muscle_tab.c (muscle_grow): Fix comment.
10098
10099 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
10100 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
10101 Update copyright year to 2006.
10102
10103 2006-01-03 Akim Demaille <akim@epita.fr>
10104
10105 Have glr.cc pass (some of) the calc.at tests.
10106 * data/glr.cc (b4_parse_param_orig): New.
10107 (b4_parse_param): Improve its definition, and bound it more
10108 clearly in the skeleton.
10109 (b4_epilogue): Append, instead of prepending, in order to keep
10110 #line consistency.
10111 Simplify the generation of auxiliary functions: locations and
10112 purity are mandated.
10113 (b4_global_tokens_and_yystype): Honor it.
10114 * data/location.cc (c++.m4): Don't include it.
10115 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
10116 and AT_SKEL_CC_IF.
10117 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
10118 AT_LALR1_CC_IF.
10119 Be sure to initialize the first position's filename.
10120 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
10121 mandated anyway.
10122 (AT_CHECK_CALC_GLR_CC): New.
10123 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
10124
10125 2006-01-02 Akim Demaille <akim@epita.fr>
10126
10127 * src/output.c (output_skeleton): Don't hard wire the inclusion of
10128 c.m4.
10129 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
10130 * data/glr.cc: Do not include stack.hh.
10131
10132 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
10133
10134 * data/glr.c: Reformat whitespace with tabs.
10135 (b4_lpure_formals): Remove this unused m4 macro.
10136 * tests/cxx-type.at: Reformat whitespace with tabs.
10137 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
10138 since it's a member. Rename type to isNterm for clarity.
10139
10140 2005-12-29 Akim <akim@sulaco.local>
10141
10142 Let glr.cc catch up with symbol_value_print.
10143 * data/glr.cc (b4_yysymprint_generate): Replace by...
10144 (b4_yy_symbol_print_generate): this.
10145 (yy_symbol_print, yy_symbol_value_print): Declare them.
10146
10147 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
10148
10149 * src/location.h (boundary): Note that a line or column equal
10150 to INT_MAX indicates an overflow.
10151 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
10152 (rule_length_overflow, increment_rule_length, add_column_width):
10153 New functions.
10154 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
10155 (<SC_BRACED_CODE>"}"):
10156 Use increment_rule_length rather than incrementing it by hand.
10157 (adjust_location, handle_syncline): Diagnose overflow.
10158 (handle_action_dollar, handle_action_at):
10159 Fix bug with monstrosities like $-2147483648.
10160 Remove now-unnecessary checks.
10161 (scan_integer): Verify assumptions and remove now-unnecessary checks.
10162 (convert_ucn_to_byte): Verify assumptions.
10163 (handle_syncline): New arg LOC. All callers changed.
10164 Don't store through a value derived from char const * pointer.
10165
10166 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
10167 GCC warnings.
10168
10169 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
10170
10171 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
10172 Remove unnecessary forward static decls.
10173
10174 2005-12-27 Akim Demaille <akim@epita.fr>
10175
10176 * src/reader.c (grammar_current_rule_check): Also check that $$
10177 is used.
10178 Take the rule to check as argument, hence rename as...
10179 (grammar_rule_check): this.
10180 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
10181 Rename as...
10182 (grammar_rule_begin, grammar_rule_end): these, for consistency.
10183 (grammar_midrule_action, grammar_symbol_append): Now static.
10184 * tests/torture.at (input): Don't rely on the default action
10185 being always performed.
10186 * tests/calc.at: "Set" $$ even when the action is "cut" with
10187 YYERROR or other.
10188 * tests/actions.at (Exotic Dollars): Instead of using unused
10189 values, check that the warning is issued.
10190
10191 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
10192
10193 * NEWS: Improve wording for unused-value warnings.
10194
10195 2005-12-22 Akim Demaille <akim@epita.fr>
10196
10197 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
10198 (b4_yysymprint_generate): Rename as...
10199 (b4_yy_symbol_print_generate): this.
10200 Generate yy_symbol_print instead of yysymprint.
10201 Generate also yy_symbol_value_print, and use it.
10202
10203 2005-12-22 Akim Demaille <akim@epita.fr>
10204
10205 * NEWS: Warn about unused values.
10206 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
10207 a `used' member.
10208 (symbol_list_n_get, symbol_list_n_used_set): New.
10209 (symbol_list_n_type_name_get): Use symbol_list_n_get.
10210 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
10211 * src/reader.c (grammar_current_rule_check): Check that values are
10212 used.
10213 * src/symtab.c (symbol_print): Accept 0.
10214 * tests/existing.at: Remove the type information.
10215 Empty the actions.
10216 Remove useless actions (beware of mid-rule actions: perl -000
10217 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
10218 * tests/actions.at (Exotic Dollars): Use unused values.
10219 * tests/calc.at: Likewise.
10220 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10221 Likewise.
10222
10223 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
10224 rule_useful_p.
10225
10226 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
10227
10228 Undo 2005-12-01 tentative license wording change. The wording is
10229 still being reviewed by the lawyers, and we don't want to wait for
10230 them before publishing a test release. For now, revert to the
10231 previous wording.
10232 * NEWS: Undo 2005-12-01 change.
10233 * data/glr.c: Revert to previous license wording.
10234 * data/glr.cc: Likewise.
10235 * data/lalr1.cc: Likewise.
10236 * data/location.cc: Likewise.
10237 * data/yacc.c: Likewise.
10238
10239 * NEWS: Reword %destructor vs YYABORT etc.
10240 * data/glr.c: Use American spacing, for consistency.
10241 * data/glr.cc: Likewise.
10242 * data/lalr1.cc: Likewise.
10243 * data/yacc.c: Likewise.
10244 * data/yacc.c: Reformat comments slightly.
10245 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
10246 for consistency. Fix some spelling errors and reword recently-included
10247 text slightly.
10248 * tests/cxx-type.at: Cast results of malloc, for C++.
10249
10250 2005-12-21 Joel E. Denny <address@hidden>
10251
10252 * tests/cxx-type.at: Construct a tree, count the parents of shared
10253 nodes, and free each node once and only once. Previously, the memory
10254 for semantic values was leaked instead.
10255
10256 2005-12-21 Joel E. Denny <address@hidden>
10257
10258 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
10259 (yylval, yylloc): If pure, #define to yystackp->yyval and
10260 yystackp->yyloc similar to yychar and yynerrs.
10261 (yyparse): If pure, remove local yylval and yylloc. Add local
10262 yystackp to accommodate pure definitions of yylval and yylloc.
10263 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
10264 yylvalp and yyllocp to &yylval and &yylloc.
10265 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
10266 namespace. Previously, nerrs and char were missing, but lval and lloc
10267 weren't necessary.
10268 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
10269 yylvalp and yyllocp parameters since, if pure, these are now always
10270 accessible through yystackp. If not pure, they are still accessible
10271 globally.
10272 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
10273 `if (YYID (N))' to pacify lint.
10274
10275 2005-12-21 Akim Demaille <akim@epita.fr>
10276
10277 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
10278 destroy the RHS symbols of a rule.
10279 * data/yacc.c (yylen): Initialize to 0.
10280 Keep its value to the number of items to possibly shift.
10281 In particular, a regular successful parse that ends on YYFINAL by
10282 a (internal) YYACCEPT must not have yylen != 0.
10283 (yyerrorlab, yyreturn): Pop the RHS.
10284 Reorder a bit to emphasize the `shifting' bits of code.
10285 (YYPOPSTACK): Now accept a number of items to pop.
10286 * data/lalr1.cc: Likewise.
10287 * data/glr.c: Formatting changes.
10288 Use goto instead of fall through.
10289 * doc/bison.texinfo (Destructor Decl): Complete.
10290
10291 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10292
10293 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10294 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
10295 * djgpp/config.bat: Replace every occurence of the file name
10296 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10297 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10298 * djgpp/config.sed: Replace every occurence of the file name
10299 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10300 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10301 * djgpp/djunpack.bat: DJGPP specific file.
10302 * djgpp/fnchange.lst: DJGPP specific file.
10303 * djgpp/README.in: Add new information about how to unpack the bison
10304 source on MSDOS and other systems which have 8.3 file name restrictions
10305 using djunpack.bat and fnchange.lst.
10306
10307 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
10308
10309 * bootstrap (build_cvs_prefix): Remove; unused.
10310 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
10311 when getting gnulib.
10312
10313 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
10314
10315 * data/glr.c: Reorder typedef declarations for structs to match order
10316 of struct declarations.
10317 Rename yystack everywhere to yystackp except in yyparse where it's not
10318 a pointer.
10319 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
10320 consistency.
10321 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
10322 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
10323 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
10324 lint.
10325
10326 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
10327
10328 * tests/sets.at (Accept): Fix typos in regular expression used to
10329 sed out the final state number.
10330
10331 Work around portability problem on Solaris 10: flex-generated
10332 files include <stdio.h> before <config.h>, which messes up
10333 because the latter defines __EXTENSIONS__. Address the problem
10334 by creating two new little files that include <config.h> first,
10335 then include the flex-generated files. Rewrite everyone else
10336 to include <config.h> first, as well.
10337 * lib/timevar.c: Always include "config.h".
10338 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
10339 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
10340 (EXTRA_bison_SOURCES): New macro.
10341 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
10342 * src/system.h: Don't include config.h.
10343 * src/LR0.c: Include <config.h> first.
10344 * src/assoc.c: Likewise.
10345 * src/closure.c: Likewise.
10346 * src/complain.c: Likewise.
10347 * src/conflicts.c: Likewise.
10348 * src/derives.c: Likewise.
10349 * src/files.c: Likewise.
10350 * src/getargs.c: Likewise.
10351 * src/gram.c: Likewise.
10352 * src/lalr.c: Likewise.
10353 * src/location.c: Likewise.
10354 * src/main.c: Likewise.
10355 * src/muscle_tab.c: Likewise.
10356 * src/nullable.c: Likewise.
10357 * src/output.c: Likewise.
10358 * src/parse-gram.y: Likewise.
10359 * src/print.c: Likewise.
10360 * src/print_graph.c: Likewise.
10361 * src/reader.c: Likewise.
10362 * src/reduce.c: Likewise.
10363 * src/relation.c: Likewise.
10364 * src/state.c: Likewise.
10365 * src/symlist.c: Likewise.
10366 * src/symtab.c: Likewise.
10367 * src/tables.c: Likewise.
10368 * src/uniqstr.c: Likewise.
10369 * src/vcg.c: Likewise.
10370
10371 * src/parse-gram.y: Fix minor problems uncovered by lint.
10372 (current_lhs, current_lhs_location): Now static.
10373 (current_assoc): Remove unused variable.
10374
10375 Cleanups so that Bison-generated parsers have less lint.
10376 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
10377 Prepend /*ARGSUSED*/, for lint's sake.
10378 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
10379 definition if 'lint' is defined.
10380 (YYID): New macro (or function, if lint).
10381 All uses of /*CONSTCOND*/0 replaced by YYID(0).
10382 * data/yacc.c: Likewise.
10383 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
10384 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
10385 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
10386 is C++ only.
10387 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
10388 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
10389 Use YYID(0) rather than 0, for lint.
10390 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
10391 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
10392
10393 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
10394
10395 * tests/glr-regression.at
10396 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10397 Close memory leak reported by twlevo.
10398
10399 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
10400
10401 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
10402 all stacks.
10403 (yyparse): Iterate another stack in order to call user destructors.
10404 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10405 New test case.
10406 (Duplicated user destructor for lookahead): This test now is expected
10407 to succeed.
10408
10409 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
10410
10411 * NEWS: Document the following change.
10412 * data/yacc.c: Say "parser skeleton" rather than "file", since
10413 it's no longer just a file.
10414 * data/glr.c: Grant a special exception for C GLR parsers, that
10415 reads like the already-existing exception for C LALR(1) parsers.
10416 * data/glr.cc: Likewise.
10417 * data/lalr1.cc: Likewise.
10418 * data/location.cc: Likewise.
10419 * data/yacc.c: Reword the "written by" statement to clarify that
10420 it was the parser skeleton, not the entire output file.
10421 * data/glr.c: Written by Paul Hilfinger.
10422 * data/glr.cc: Written by Akim Demaille.
10423 * data/lalr1.cc: Likewise.
10424
10425 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
10426
10427 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
10428 Fix typos in previous change that broke 'make check'.
10429 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
10430 supported in C.
10431 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
10432 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
10433 We can revert this once things settle down.
10434
10435 * src/conflicts.c (conflicts_print): Don't print file name twice
10436 when %expect fails because there were no conflicts.
10437 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
10438 change.
10439 * tests/conflicts.at (%expect not enough, %expect too much):
10440 (%expect with reduce conflicts): Adjust to new behavior.
10441
10442 2005-11-18 Akim Demaille <akim@epita.fr>
10443
10444 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
10445 errors.
10446 * NEWS: Document this.
10447 * doc/bison.texinfo (Expect Decl): Likewise.
10448
10449 2005-11-16 Akim Demaille <akim@epita.fr>
10450
10451 Generalize the display of semantic values and locations in traces.
10452 * data/glr.c (yy_reduce_print): Fix indices (again).
10453 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
10454 literal integers.
10455 * data/lalr1.cc (yyreduce_print): Rename as...
10456 (yy_reduce_print): this.
10457 Display values and locations.
10458 * data/yacc.c (yy_reduce_print): Likewise.
10459 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
10460 (yysymprint): Move higher to be visible from yy_reduce_print).
10461 (yyparse): Adjust.
10462 * tests/calc.at: Adjust the expected length of the traces.
10463
10464 2005-11-14 Akim Demaille <akim@epita.fr>
10465
10466 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
10467 from 1 to N, while values and location start at 0.
10468 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
10469
10470 2005-11-14 Akim Demaille <akim@epita.fr>
10471
10472 * data/glr.c (yy_reduce_print): Fix the $ number.
10473
10474 2005-11-14 Akim Demaille <akim@epita.fr>
10475
10476 "Use" parse parameters.
10477 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
10478 * data/glr.c, data/glr.cc: Use them.
10479 * data/glr.c (YYUSE): Have a C++ definition that supports
10480 non-pointer types.
10481
10482 2005-11-14 Akim Demaille <akim@epita.fr>
10483
10484 * data/glr.c (yyexpandGLRStack): Declare only if defined.
10485
10486 2005-11-14 Akim Demaille <akim@epita.fr>
10487
10488 * data/glr.cc: New.
10489 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
10490
10491 2005-11-12 Akim Demaille <akim@epita.fr>
10492
10493 Let position and location be PODs.
10494 * data/location.cc (position::initialize, location::initialize): New.
10495 (position::position, location::location): Define only if
10496 b4_location_constructors is defined.
10497 * data/lalr1.cc (b4_location_constructors): Define it for backward
10498 compatibility.
10499 * doc/bison.texinfo (Initial Action Decl): Use initialize.
10500
10501 2005-11-12 Akim Demaille <akim@epita.fr>
10502
10503 * data/lalr1.cc: Move the body of the ctor and dtor into the
10504 parser file (instead of the header).
10505 Wrap the implementations in a "namespace yy".
10506
10507 2005-11-12 Akim Demaille <akim@epita.fr>
10508
10509 Have glr.c include its header file when created.
10510 * data/glr.c (b4_shared_declarations): New.
10511 Output them verbatim in the parser if !%defines, otherwise
10512 output then in the header file, and include it instead.
10513
10514 2005-11-11 Akim Demaille <akim@epita.fr>
10515
10516 * data/glr.c: Comment changes.
10517
10518 2005-11-11 Akim Demaille <akim@epita.fr>
10519
10520 When yydebug, report semantic and location values for reductions.
10521 * data/glr.c (yy_reduce_print): Report the semantic values and the
10522 locations.
10523 (YY_REDUCE_PRINT): Adjust.
10524 (yyglrReduce): Use them.
10525 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
10526 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
10527 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
10528 traces.
10529
10530 2005-11-10 Akim Demaille <akim@epita.fr>
10531
10532 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
10533 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
10534 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
10535
10536 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
10537
10538 * m4/cxx.m4, examples/Makefile.am: Don't build
10539 examples/calc++ if no C++ compiler is available. (trivial change)
10540
10541 2005-11-09 Akim Demaille <akim@epita.fr>
10542
10543 * src/scan-skel.l: Use a couple of asserts.
10544
10545 2005-11-03 Akim Demaille <akim@epita.fr>
10546
10547 In some (weird) cases, the final state number is incorrect.
10548 Reported by Alexandre Duret-Lutz.
10549 * src/LR0.c (state_list_append): Remove the computation of
10550 final_state.
10551 (save_reductions): Do it here.
10552 (get_state): Alpha conversion.
10553 (generate_states): Use a for loop.
10554 * src/gram.h (item_number_is_rule_number)
10555 (item_number_is_symbol_number): New.
10556 * src/state.c: Use assert.
10557 * src/system.h: Include assert.h.
10558 * tests/sets.at (Accept): New.
10559
10560 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10561
10562 * data/glr.c (yyfill): Adjust comment.
10563 (yyresolveAction): Initialize default location properly
10564 for empty right-hand sides.
10565 (yydoAction): Ditto.
10566 Add comment explaining apparently dead code.
10567 * tests/glr-regression.at
10568 (Incorrectly initialized location for empty right-hand side in GLR):
10569 New test.
10570
10571 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
10572
10573 * bootstrap (cleanup_gnulib): New function. Use it to clean up
10574 gnulib when interrupted. This fixes some race conditions and
10575 works around some portability problems (one noted by Paul
10576 Hilfinger).
10577
10578 2005-10-22 Akim <akim@epita.fr>
10579
10580 * Makefile.cfg: Adjust to config -> build-aux.
10581 Reported by twledo.
10582
10583 2005-10-21 Akim Demaille <akim@epita.fr>
10584
10585 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
10586 the %parse-params.
10587 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
10588 * data/yacc.c (b4_Pure_if): Rename as...
10589 (b4_yacc_pure_if): this.
10590 (YY_SYMBOL_PRINT, yyparse): Adjust.
10591 * doc/bison.texinfo: Formatting changes.
10592
10593 2005-10-21 Akim Demaille <akim@epita.fr>
10594
10595 Finish the transition config -> build-aux.
10596 * configure.ac, Makefile.am: Use build-aux.
10597 * config/prev-version, config/announce-gen, config/Makefile.am:
10598 Move to...
10599 * build-aux/prev-version, build-aux/announce-gen,
10600 * build-aux/Makefile.am: here.
10601
10602 2005-10-14 Akim Demaille <akim@epita.fr>
10603
10604 * examples/calc++/test: Use set -x only when VERBOSE.
10605
10606 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
10607
10608 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
10609 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
10610
10611 2005-10-13 Akim Demaille <akim@epita.fr>
10612
10613 * src/scan-skel.l: Output the base name parts of the parser and
10614 header file names.
10615 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
10616 additional checks.
10617 Use this to exercise C++ outputs in subdirs.
10618 Reported by Oleg Smolsky.
10619
10620 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
10621
10622 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
10623 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
10624 Problem reported by John P. Hartmann.
10625 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
10626 already defined it.
10627
10628 2005-10-12 Akim Demaille <akim@epita.fr>
10629
10630 * src/parse-gram.y (version_check): Exit 63 to please missing
10631 (stands for "version mismatch).
10632 * tests/input.at, doc/bison.texinfo: Adjust.
10633
10634 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
10635
10636 Work around portability problems with Visual Age C compiler
10637 (xlc and xlC_r) reported by John P. Hartmann.
10638 * data/location.cc (initial_column, initial_line): Remove.
10639 All uses replaced by 0 and 1.
10640 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
10641 that xlc complains about.
10642 * src/scan-skel.l (skel_wrap): Likewise.
10643 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
10644 as __STDC__.
10645 * data/yacc.c (YYMODERN_C): New macro, which also looks at
10646 __STDC_VERSION__. Use it everywhere instead of looking at
10647 __STDC__ and __cplusplus.
10648
10649 2005-10-10 Akim Demaille <akim@epita.fr>
10650
10651 * examples/calc++/test: Be quiet unless VERBOSE.
10652
10653 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
10654
10655 * data/c.m4 (yydestruct, yysymprint):
10656 Use YYUSE instead of casting to void.
10657 * data/glr.c (YYUSE): New macro.
10658 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10659 Use it instead of rolling our own.
10660 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10661 (YYCHK1):
10662 Use /*CONSTCOND*/ to suppress lint warnings.
10663 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10664 (YY_STACK_PRINT): Use 'false' not '0'.
10665 (YYUSE): New macro.
10666 (yysymprint_, yydestruct_): Use it instead of rolling our own.
10667 * data/yacc.c (YYUSE): New macro.
10668 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
10669 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
10670 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
10671
10672
10673 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
10674 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
10675
10676 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
10677
10678 Undo the parts of the unlocked-I/O change that substituted
10679 putc or puts for printf. This might hurt performance a bit,
10680 but some people prefer the printf style.
10681 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
10682 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
10683 All uses replaced by YYFPRINTF and YYDPRINTF.
10684 * data/yacc.c: Likewise.
10685 * lib/bitset.c (bitset_print): Likewise.
10686 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
10687 putc and puts.
10688 * lib/lbitset.c (debug_lbitset): Likewise.
10689 * src/closure.c (print_firsts, print_fderives): Likewise.
10690 * src/gram.c (grammar_dump): Likewise.
10691 * src/lalr.c (look_ahead_tokens_print): Likewise.
10692 * src/output.c (escaped_output): Likewise.
10693 (user_actions_output): Break apart two printfs.
10694 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
10695 * src/reduce.c (reduce_print): Likewise.
10696 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
10697 * src/system.h: Include unlocked-io.h rathe than stdio.h.
10698
10699 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10700 Use assignments rather than casts-to-void to suppress
10701 unused-variable warnings. This pacifies 'lint'.
10702 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
10703 unused-variable warnings.
10704
10705 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10706
10707 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10708
10709 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
10710
10711 Use unlocked I/O for a minor performance improvement on hosts like
10712 GNU/Linux and Solaris that support unlocked I/O. The basic idea
10713 is to use the gnlib unlocked-io module, and to prefer putc and
10714 puts to printf when either will work (since the latter doesn't
10715 come in an unlocked flavor).
10716 * bootstrap (gnulib_modules): Add unlocked-io.
10717 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
10718 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
10719 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
10720 and similarly for puts and putc and printf.
10721 * data/yacc.c: Likewise.
10722 * lib/bitset.c (bitset_print): Likewise.
10723 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
10724 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
10725 to printf.
10726 * lib/lbitset.c (debug_lbitset): Likewise.
10727 * src/closure.c (print_firsts, print_fderives): Likewise.
10728 * src/gram.c (grammar_dump): Likewise.
10729 * src/lalr.c (look_ahead_tokens_print): Likewise.
10730 * src/output.c (escaped_output): Likewise.
10731 (user_actions_output): Coalesce two printfs.
10732 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
10733 * src/reduce.c (reduce_print): Likewise.
10734 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
10735 * src/system.h: Include unlocked-io.h rather than stdio.h.
10736
10737 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
10738 this confuses xgettext.
10739
10740 2005-10-02 Akim Demaille <akim@epita.fr>
10741
10742 * bootstrap (gnulib_modules): Add strverscmp.
10743 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
10744 * m4/.cvsignore: Add strverscmp.m4.
10745 * src/parse-gram.y (%require): New token, new rule.
10746 (version_check): New.
10747 * src/scan-gram.l (%require): Adjust.
10748 * tests/input.at (AT_REQUIRE): New.
10749 Use it.
10750 * doc/bison.texinfo (Require Decl): New.
10751 (Calc++ Parser): Use %require.
10752
10753 2005-10-02 Akim Demaille <akim@epita.fr>
10754
10755 * data/location.cc: New.
10756
10757 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
10758 Akim Demaille <akim@epita.fr>
10759
10760 Make sure -odir/foo.cc creates dir/location.hh etc.
10761 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
10762 (spec_file_prefix, spec_verbose_file, spec_graph_file)
10763 (spec_defines_file): Now const.
10764 (dir_prefix): New.
10765 (short_base_name): Remove.
10766 * src/files.c: Adjust.
10767 (dirname.h): Include.
10768 (base_name): Don't prototype it.
10769 (finput): Remove, duplicates gram_in.
10770 (full_base_name, short_base_name): Replace by...
10771 (all_but_ext, all_but_tab_ext): these.
10772 (compute_base_names): Rename as...
10773 (compute_file_name_parts): this.
10774 Update to compute the new variables, including dir_prefix.
10775 Adjust dependencies.
10776 * src/output.c (prepare): Output them.
10777 * src/reader.c: Adjust to use gram_in, not finput.
10778 * src/scan-skel.l (@dir_prefix@): New.
10779
10780 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10781
10782 * lib/subpipe.c: New function end_of_output_subpipe() added
10783 to allow support for non-posix systems. This is a no-op function
10784 for posix systems.
10785
10786 * lib/subpipe.h: New function end_of_output_subpipe() added
10787 to allow support for non-posix systems. This is a no-op function
10788 for posix systems.
10789
10790 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
10791 handle the lack of pipe/fork functionality on non-posix systems.
10792
10793 * djgpp/Makefile.maint: DJGPP specific file.
10794
10795 * djgpp/README.in: DJGPP specific file.
10796
10797 * djgpp/config.bat: DJGPP specific configuration file.
10798
10799 * djgpp/config.sed: DJGPP specific configuration file.
10800
10801 * djgpp/config.site: DJGPP specific configuration file.
10802
10803 * djgpp/config_h.sed: DJGPP specific configuration file.
10804
10805 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
10806
10807 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
10808
10809 2005-10-02 Akim Demaille <akim@epita.fr>
10810
10811 * data/location.cc: New, extract from...
10812 * data/lalr1.cc: here.
10813 (location.hh): Include it after the user prologue, in case the
10814 filename type is defined by the user.
10815 Forward declation location and position before the pre-prologue.
10816 (yyresult_): Rename as...
10817 (yyresult): this, it's a local variable, not an attribute.
10818 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
10819
10820 2005-10-01 Akim Demaille <akim@epita.fr>
10821
10822 * examples/extexi: Restore the #line generation.
10823
10824 2005-09-30 Akim Demaille <akim@epita.fr>,
10825 Alexandre Duret-Lutz <adl@gnu.org>
10826
10827 Move the token type and YYSTYPE in the parser class.
10828 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
10829 (parser::token): New, from the moved free definition of tokens.
10830 (parser::semantic_value): Now a full definition instead of an
10831 indirection to YYSTYPE.
10832 (b4_post_prologue): No longer included in the header file, but
10833 in the implementation file.
10834 * doc/bison.texi (C+ Language Interface): Update.
10835 * src/parse-gram.y: Support unary %define.
10836 * tests/actions.at: Define global_tokens_and_yystype for backward
10837 compatibility until we update the tests.
10838 * tests/calc.at: Idem.
10839 (first_line, first_column, last_line, last_column): Define for lalr1.cc
10840 to simplify the code.
10841
10842 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
10843
10844 Port to SunOS 4.1.4, which lacks strtoul and strerror.
10845 Ah, the good old days! Problem reported by Peter Klein.
10846 * bootstrap (gnulib_modules): Add strerror, strtoul.
10847 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
10848 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
10849
10850 2005-09-29 Akim Demaille <akim@epita.fr>
10851
10852 * data/c.m4 (b4_error_verbose_if): New.
10853 * data/lalr1.cc: Use it.
10854 (YYERROR_VERBOSE_IF): Remove.
10855 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
10856 parser members, replaced by...
10857 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
10858 local variables.
10859 (yysyntax_error_): Takes the state number as argument.
10860 (yyreduce_print_): Use the argument yyrule, not the former
10861 attribute yyn_.
10862
10863 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
10864
10865 * bootstrap (gnulib_modules): Add verify.
10866 * lib/.cvsignore: Add verify.h.
10867 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
10868 * src/system.h (verify): Remove.
10869 Include verify.h instead.
10870 * src/tables.c (tables_generate): Use new API for 'verify'.
10871
10872 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
10873
10874 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
10875 local variables whose names begin with 'yy'.
10876 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
10877 Trivial changes from Joel E. Denny.
10878
10879 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
10880 it itself.
10881 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
10882 don't use alloca any more.
10883
10884 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
10885 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
10886 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
10887 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
10888 to match yacc.c, to test more hosts.
10889
10890 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
10891
10892 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
10893 doesn't affect behavior.
10894 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
10895 Solaris, AIX, MSC.
10896 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
10897 This works a bit better with glibc, if user code has already included
10898 stdlib.h.
10899 * doc/bison.texinfo (Bison Parser): Document that users can't
10900 arbitrarily use malloc and free for other purposes. Document
10901 that <alloca.h> and <malloc.h> might be included.
10902 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
10903 user must declare alloca.
10904
10905 * HACKING (release): Forwarn the Translation Project about
10906 stable releses.
10907
10908 2005-09-20 Akim Demaille <akim@epita.fr>
10909
10910 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
10911
10912 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
10913
10914 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
10915 (YYSTACK_ALLOC_MAXIMUM): Use it.
10916 (yysyntax_error): New function.
10917 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
10918 multiple syntax errors are reported, and alloca is being used.
10919 Instead, reallocate buffers twice as big each time, so that
10920 we waste at most half the allocated memory. Start with a small
10921 (128-byte) buffer that will suffice in most cases anyway.
10922 Use yysyntax_error to do most of the work.
10923
10924 * doc/bison.texinfo (Error Reporting, Table of Symbols):
10925 yynerrs is the number of errors reported, not the number of
10926 errors encountered.
10927
10928 * tests/glr-regression.at (Duplicated user destructor for lookahead):
10929 Mark it as expected to fail.
10930 Cast result of malloc; problem reported by twlevo@xs4all.nl.
10931 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
10932 Don't start user-code symbols with "yy", to avoid name space problems.
10933
10934 2005-09-19 Akim Demaille <akim@epita.fr>
10935
10936 Remove the traits, failed experiment.
10937 It never proved useful, and anyway because of the current
10938 definition, it was not possible to have several specialization of
10939 this traits, making it useless.
10940 * data/lalr1.cc (yy:traits): Remove.
10941 Inline its definitions in the parser class.
10942
10943 2005-09-19 Akim Demaille <akim@epita.fr>
10944
10945 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
10946 least Mac OSX with a /usr/local install of gettext.
10947
10948 2005-09-19 Akim Demaille <akim@epita.fr>
10949
10950 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
10951 and yytoken for similarity with the other skeletons.
10952
10953 2005-09-19 Akim Demaille <akim@epita.fr>
10954
10955 * NEWS, configure.ac: update version number to 2.1a.
10956
10957 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
10958
10959 * NEWS: Version 2.1.
10960
10961 * NEWS: Remove notice of yytname change, since it was never in an
10962 official release.
10963 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
10964 diagnostic.
10965 * src/output.c (prepare): Likewise.
10966 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
10967 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
10968 is not defined. This is an awful hack, but it's enough for now.
10969 All callers changed.
10970 * tests/glr-regression-at (make_value): Args are const pointers now,
10971 to avoid GCC warning.
10972 (Duplicated user destructor for lookahead): New test. Currently
10973 skipped. It fails on my host but I'm not sure it'll always fail.
10974
10975 2005-09-16 Akim Demaille <akim@epita.fr>
10976
10977 * src/symtab.h (struct symbol): Declare the printer and destructor
10978 as const, to avoid accidental calls to free.
10979 (symbol_destructor_set, symbol_printer_set): Adjust.
10980 * src/symtab.c: Adjust.
10981
10982 2005-09-16 Akim Demaille <akim@epita.fr>
10983
10984 * data/c.m4 (b4_token_enums): New.
10985 (b4_token_defines): Rename as...
10986 (b4_token_enums_defines): this.
10987 (b4_token_defines): New, output only the #defines.
10988 * data/yacc.c, data/glr.c: Adjust.
10989 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
10990 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
10991 as default values.
10992
10993 2005-09-16 Akim Demaille <akim@epita.fr>
10994
10995 * data/lalr1.cc (yylex_): Remove, inline its code.
10996 (yyreport_syntax_error_): Remove, replaced by...
10997 (yysyntax_error_): this which returns a string and leaves to the
10998 caller the call to the users' error function.
10999 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
11000 Move from members of the parser object...
11001 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
11002 to local variables of the parse function.
11003
11004 2005-09-16 Akim Demaille <akim@epita.fr>
11005
11006 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
11007 since it's in Bison's name space.
11008
11009 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
11010
11011 * data/glr.c (yyresolveValue): Add default case to pacify
11012 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
11013
11014 * NEWS: Document when yyparse started to return 2.
11015 * doc/bison.texinfo (Parser Function): Document when yyparse
11016 returns 2.
11017
11018 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
11019 (b4_filename_type): Renamed back from b4_file_name_type. All uses
11020 changed.
11021 (class position): file_name -> filename (reverting). All uses changed.
11022
11023 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
11024
11025 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
11026 do anything if $@ exists. This reverts part of the 2005-07-07
11027 patch.
11028
11029 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
11030
11031 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
11032 contains obsolete information and isn't worth distributing as a
11033 separate file anyway.
11034 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
11035 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
11036 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
11037 (yyparse): Abort if user code uses longjmp to throw an unexpected
11038 value.
11039
11040 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
11041
11042 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
11043 Suggested by twlevo@xs4all.nl.
11044
11045 * data/glr.c (YYCHK1): Do not assume YYE is in range.
11046 This avoids a diagnostic from gcc -Wswitch-enum.
11047 Problem reported by twlevo@xs4all.nl.
11048
11049 * doc/bison.texinfo: Don't use "filename", as per GNU coding
11050 standards. Use "file name" or "file" or "name", depending on
11051 the context.
11052 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
11053 not to hack/foo.tab.c.
11054 (Calc++ Top Level): 2nd arg of main is not const.
11055 * data/glr.c: b4_filename -> b4_file_name.
11056 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
11057 All uses changed.
11058 (class position): filename -> file_name. All uses changed.
11059 * data/yacc.c: b4_filename -> b4_file_name.
11060 * lib/bitset.h: filename -> file_name in local vars.
11061 * lib/bitset_stats.c: Likewise.
11062 * src/files.c: Likewise.
11063 * src/scan-skel.l ("@output ".*\n): Likewise.
11064 * src/files.c (file_name_split): Renamed from filename_split.
11065 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
11066
11067 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
11068
11069 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
11070 to accommodate latest gnulib.
11071
11072 * tests/glr-regression.at (Duplicate representation of merged trees):
11073 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
11074
11075 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
11076 needed.
11077
11078 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
11079
11080 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
11081 All uses changed. Invoke user destructor after an error during a
11082 split parse (trivial change from Joel E. Denny).
11083
11084 * tests/glr-regression.at
11085 (User destructor after an error during a split parse): New test case.
11086 Problem reported by Joel E. Denny in:
11087 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
11088
11089 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
11090
11091 * README-cvs: Give URLs for recommended tools.
11092 Mention Gzip version problem, and bootstrapping issues.
11093 Remove troubleshooting section, as it's somewhat obsolete.
11094
11095 * bootstrap (no_cache): New var, to accommodate different wget
11096 variants. Use it instead of '-C off'. Problem reported by
11097 twlevo@xs4all.nl.
11098
11099 * data/glr.c (yydestroyStackItem): New function.
11100 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
11101 debugging information. Problem reported by Joel E. Denny.
11102
11103 2005-08-25 Akim Demaille <akim@epita.fr>
11104
11105 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
11106
11107 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
11108
11109 * data/glr.c (yyrecoverSyntaxError, yyreturn):
11110 Don't invoke destructor on unresolved entries.
11111 * tests/glr-regression.at
11112 (User destructor for unresolved GLR semantic value): New test case.
11113 Problem reported by Joel E. Denny in:
11114 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
11115
11116 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
11117
11118 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
11119 Add strnlen.c.
11120 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
11121 lib-prefix.m4, po.m4.
11122
11123 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
11124 in yydestruct diagnostic, since it might not be an error.
11125 Problem reported by Joel Denny near end of
11126 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
11127 * data/lalr1.cc (yyerturn): Likewise.
11128 * data/yacc.c (yyreturn): Likewise.
11129 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
11130
11131 * src/files.c: Remove obsolete FIXME comment.
11132
11133 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
11134 with the other templates, and to fix bogus run-on messages such
11135 as the one reported at the end of
11136 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
11137 All callers changed to avoid the newline.
11138 (yyprocessOneStack): Output two lines rather than one, to accommodate
11139 the above change. This changes the debug output format slightly.
11140
11141 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
11142 reported by Joel E. Denny in
11143 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
11144 (trivial change).
11145 * tests/glr-regression.at (Duplicate representation of merged trees):
11146 New test, from Joel E. Denny in:
11147 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
11148 * THANKS: Add Joel E. Denny.
11149
11150 * configure.ac (AC_INIT): Bump to 2.0c.
11151
11152 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
11153
11154 * NEWS: Version 2.0b.
11155
11156 * Makefile.am (SUBDIRS): Put examples before tests, so that
11157 "make check" doesn't finish with "All 1 tests passed".
11158
11159 * tests/regression.at (Token definitions): Don't rely on
11160 AT_PARSER_CHECK for data that contains backslashes. It currently
11161 uses 'echo', and 'echo' isn't portable if its argument contains
11162 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
11163 that the byte '\0xff' is not printable in the C locale; it is,
11164 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
11165 not printable, so use '\0x81' to test.
11166
11167 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
11168 version of GCC, since the macro is used with non-GCC compilers.
11169
11170 Fix core dump reported by Pablo De Napoli in
11171 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
11172 * tests/regression.at (Invalid inputs with {}): New test.
11173 * src/parse-gram.y (token_name): Translate type before using
11174 it as an index.
11175
11176 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
11177 the user's name space. All uses changed to __attribute__
11178 ((__unused__)).
11179 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
11180 Add __attribute__ ((__noreturn__)).
11181
11182 * etc/clcommit: Remove. We weren't using it, and it failed
11183 "make maintainer-distcheck".
11184 * Makefile.maint: Merge from coreutils.
11185 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
11186 (syntax-check-rules): Change list of rules as described below.
11187 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
11188 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
11189 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
11190 (sc_trailing_space): New rules.
11191 (sc_xalloc_h_in_src): Remove.
11192 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
11193 (sc_space_tab, sc_error_exit_success, sc_changelog):
11194 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
11195 (makefile-check, po-check, author_mark_check):
11196 (makefile_path_separator_check, copyright-check):
11197 Use grep -n, to make it easier to find violations.
11198 Use CVS_LIST and CVS_LIST_EXCEPT.
11199 (header_regexp, h_re): Remove.
11200 (dd_c): New macro.
11201 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
11202 (my-distcheck): Use more-modern GCC flags.
11203 (signatures, %.asc): Remove.
11204 (rel-files, announcement): Remove signatures.
11205 Restore old updating code, even though we don't use it, so
11206 that we're the same as coreutils.
11207 (alpha, beta, major): Depend on news-date-check.
11208 Make the upload commands.
11209
11210 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
11211 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
11212 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
11213 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
11214 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
11215 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
11216 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
11217 * tests/sets.at: Likewise.
11218
11219 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
11220 we comment out the Autoconf version number.
11221 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
11222 it's error-prone and "make maintainer-distcheck" rejects it.
11223
11224 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
11225 Indent calls to "error" to pacify "make maintainer-distcheck",
11226 when the calls are not intended to be translated.
11227 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
11228
11229 * src/Makefile.am (DEFS): Use +=, to pacify
11230 "make maintainer-distcheck".
11231 (bison_SOURCES): Add scan-skel.h.
11232 (sc_tight_scope): New rule, from coreutils.
11233
11234 * src/files.c (src_extension, header_extension):
11235 Now static, not extern.
11236 * src/getargs.c (short_options): Likewise.
11237 * src/muscle_tab.c (muscle_table): Likewise.
11238 * src/parse-gram.y (current_class, current_type, current_prec):
11239 Likewise.
11240 * src/reader.c (grammar_end, previous_rule_end): Likewise.
11241 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
11242 * src/main.c (main): Cast bindtextdomain and textdomain calls to
11243 void, to avoid warning when NLS is disabled.
11244 * src/output.c: Include scan-skel.h.
11245 (scan_skel): Remove decl, since scan-skel.h does this.
11246 (output_skeleton):
11247 Indent calls to "error" to pacify "make maintainer-distcheck".
11248 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
11249 * src/reader.h (gram_end, gram_lineno): New decls to pacify
11250 "make maintainer-distcheck".
11251 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
11252 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
11253 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
11254 (skel_lex_destroy, scan_skel): Move these decls to...
11255 * src/scan-skel.h: New file.
11256 * src/uniqstr.c (uniqstr_assert):
11257 Indent calls to "error" to pacify "make maintainer-distcheck".
11258
11259 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
11260 not @VAR@.
11261
11262 * tests/torture.at: Revamp to avoid misuse of atoi that
11263 "make maintainer-distcheck" complained about.
11264
11265 * examples/extexi (message): Don't print a message more than once,
11266 and omit line-number decoration that makes Emacs compile think
11267 that informative messages are worth worrying about.
11268
11269 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
11270
11271 * configure.ac: Update version number.
11272
11273 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
11274 accidentally.
11275 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
11276 autogenerated by the maintainer.
11277 * examples/calc++/.cvsignore: Add *.yy.
11278
11279 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
11280 * lib/bitset_stats.c (bitset_stats_init): Likewise.
11281 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11282
11283 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
11284
11285 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
11286 from maintainer-distcheck about casting the argument of 'free'.
11287
11288 * NEWS: Mention recent yytname changes.
11289 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
11290
11291 * bootstrap: For translations that have not yet been upgraded to
11292 the new runtime-po domain, prime the pump by extracting the
11293 relevant strings from the obsolete translations. This code can be
11294 removed once the bison-runtime domain has been translated by each
11295 team.
11296
11297 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
11298 now that token names are already quoted.
11299
11300 Fix problem reported by Anthony Heading.
11301 * data/glr.c (YYTOKEN_TABLE): New macro.
11302 (yytname): Define if YYTOKEN_TABLE.
11303 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
11304 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
11305 (YYERROR_VERBOSE): Define the same way the other skeletons do.
11306 * src/output.c (prepare_symbols): Output token_table_flag.
11307
11308 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
11309
11310 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
11311 again if the first call fails.
11312
11313 * data/glr.c (yytnamerr): New function.
11314 (yyreportSyntaxError): Use it to dequote most string literals.
11315 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
11316 with other skeletons. All uses changed.
11317 (yytnameerr_): New function.
11318 (yyreport_syntax_error): Use it to dequote most string literals.
11319 * data/yacc.c (yytnamerr): New function.
11320 (yyerrlab): Use it to decode most string literals.
11321 * doc/bison.texinfo (Decl Summary, Calling Convention):
11322 Clarify quoting convention of yytname.
11323 * src/output.c (prepare_symbols): Quote all names. This undoes
11324 the 2005-04-17 change, which is now accomplished (mostly) via
11325 changes in the parsers as described above.
11326 * tests/regression.at (Token definitions, Web2c Actions):
11327 Undo most 2005-04-17 change here, too.
11328
11329 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
11330
11331 Fix more problems reported by twlevo@xs4all.nl.
11332 * tests/cxx-type.at: Don't pipe output of ./types through sed to
11333 remove trailing spaces. This loses the exit status of ./types,
11334 and isn't needed since ./types shouldn't be emitting trailing
11335 spaces.
11336 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
11337 as the stack isn't valid in that case.
11338
11339 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
11340 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
11341 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
11342 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
11343 is used.
11344 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
11345 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
11346 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
11347 Likewise.
11348
11349 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
11350 overly-picky compilers that reject 'char *foo = "bar";'.
11351
11352 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
11353 to FILE * parameter, not to stderr. This fixes a typo introduced
11354 in the 2005-07-12 change.
11355
11356 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
11357 warnings from GCC 4.
11358
11359 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
11360 (yyglrShiftDefer, yysplitStack):
11361 Remove unused parameters b4_pure_formals. All uses changed.
11362 (yyglrShift): Remove unused parameters b4_user_formals.
11363 All uses changed.
11364 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
11365
11366 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
11367
11368 Destructor cleanups and regularization among the three skeletons.
11369 * NEWS: Document the behavior changes.
11370 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
11371 stack before failing, as the cleanup code will do it for us now.
11372 * data/lalr1.cc (yyerrlab): Likewise.
11373 * data/glr.c (yyparse): Pop everything off the stack before
11374 freeing it, so that destructors get called properly.
11375 * data/lalr1.cc (yyreturn): Likewise.
11376 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
11377 This is more consistent.
11378 * doc/bison.texinfo (Destructor Decl): Mention more reasons
11379 why destructors might be called. 1.875 -> 2.1.
11380 (Destructor Decl, Decl Summary, Table of Symbols):
11381 Some English-language cleanups for %destructor.
11382 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11383 Add output line for destructor of start symbol.
11384 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
11385 because of that same extra output line.
11386
11387 * NEWS: Document minor wording changes in diagnostics of
11388 Bison-generated parsers.
11389 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
11390 Remove unused formals. All uses changed.
11391 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
11392 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
11393 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
11394 Rename yyoverflowab to yyexhaustedlab.
11395 When memory exhaustion occurs during syntax-error reporting,
11396 report it separately rather than in a single diagnostic; this
11397 eases translation.
11398 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
11399 (Memory Exhausted): Renamed from Parser Stack Overflow.
11400 Revamp wording slightly to prefer "memory exhaustion".
11401 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
11402
11403 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
11404
11405 Add i18n support to the GLR skeleton. Partially fix the C++
11406 skeleton; a C++ expert needs to finish this. Remove debugging
11407 msgids; there's little point to having them translated, since they
11408 can be understood only by someone who can read the
11409 (English-language) source code.
11410
11411 Generate runtime-po/bison-runtime.pot automatically, so that we
11412 don't have to worry about garbage getting in that file. We'll
11413 make sure after the next official release that old msgids don't
11414 get lost. See
11415 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
11416
11417 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
11418 Now auto-generated.
11419 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
11420 Fix typos in explanations of the runtime file.
11421 * bootstrap: Change gettext keyword from YYI18N to YY_.
11422 Use standard Makefile.in.in in runtime-po, since we'll arrange
11423 for backward-compatible bison-runtime.po files in a different way.
11424 * data/glr.c (YY_): New macro, from yacc.c.
11425 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
11426 Translate messages intended for users.
11427 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
11428 the wording in the other skeletons. We don't know that the memory
11429 is virtual.
11430 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
11431 Use same method that yacc.c uses.
11432 Don't translate debugging messages.
11433 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
11434 it doesn't work (yet), and requires C++ expertise to fix.
11435 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
11436 Move defn to a more logical place, to be consistent with other
11437 skeletons.
11438 Don't translate debugging messages.
11439 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
11440 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
11441 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
11442 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
11443
11444 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
11445 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
11446 void, not int.
11447 * tests/glr-regression.at (Badly Collapsed GLR States):
11448 Likewise.
11449 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
11450 yylex should return 0 at EOF rather than aborting.
11451
11452 Improve tests for stack overflow in GLR parser.
11453 Problem reported by twlevo@xs4all.nl.
11454 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
11455 All uses removed.
11456 (yyStackOverflow): Just longjmp, but with value 2 so that caller
11457 can handle the problem.
11458 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
11459 (yyparse): New local variable yyresult to record the result.
11460 Use result of setjmp to set it, rather than storing itinto
11461 struct.
11462 (yyDone): Remove label.
11463 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
11464 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
11465 if YYABORT is used).
11466 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
11467 yyparse status; put status > 1 into diagnostic.
11468 Check that status==2 works.
11469 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
11470 Use exit status 3 for failure to open (which shouldn't happen).
11471
11472 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
11473
11474 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
11475 1 on syntax error; just let yyparse do its thing.
11476 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
11477 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
11478 (Exploding the Stack Size with Alloca):
11479 (Exploding the Stack Size with Malloc):
11480 Expect exit status 2, not 1, since the parser is supposed to blow
11481 its stack. Problem reported by twlevo@xs4all.nl.
11482
11483 * data/glr.c (yyparse): Don't assume that the initial calls
11484 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
11485 Print a stack-overflow message and fail instead.
11486 Initialize the line-number information before creating the stack,
11487 so that the stack-overflow message can report line zero safely.
11488
11489 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
11490
11491 Fix problems reported by twlevo@xs4all.nl.
11492 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
11493 (yyuserMerge): Provide a default case if b4_mergers is empty.
11494 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
11495 * tests/glr-regression.at
11496 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
11497 Add casts to pacify C++ compilers.
11498 * tests/glr-regression.at (Improper merging of GLR delayed action
11499 sets): Declare yylex before using it.
11500 * tests/Makefile.am (maintainer-check-g++): Fix a stray
11501 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
11502 test for valgrind; valgrind is independent of g++.
11503 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
11504 for compatibility with POSIX 1003.1-2001 (if running coreutils).
11505 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
11506 Use a destructor, so that we can expand the stack. Change
11507 YYSTYPE to char * so that we can free it. Cast result of malloc.
11508
11509 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11510
11511 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
11512 a valgrind failure. Problem reported by twlevo@xs4all.nl.
11513
11514 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
11515
11516 * PACKAGING: New file, suggested by Bruno Haible and taken from
11517 similar wording in gettext's PACKAGING file.
11518 * NEWS: Mention PACKAGING.
11519 * Makefile.am (EXTRA_DIST): Add PACKAGING.
11520
11521 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
11522
11523 * NEWS: Document recent i18n improvements.
11524 * bootstrap: Get runtime translations into runtime-po.
11525 Create runtime-po files automatically, if possible.
11526 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
11527 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
11528 does not infringe on the user's name space.
11529 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
11530 * doc/bison.texinfo (Internationalization): Revamp the English
11531 and Texinfo syntax a bit, to try to make it clearer.
11532 (Bison Options, Option Cross Key): Mention --print-localedir.
11533 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
11534 YYENABLE_NLS. Quote a bit more.
11535 * runtime-po/.cvsignore: New file.
11536 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
11537 * runtime-po/Rules-quot: Remove; now created by bootstrap.
11538 * runtime-po/quot.sed: Likewise.
11539 * runtime-po/boldquot.sed: Likewise.
11540 * runtime-po/en@quot.header: Likewise.
11541 * runtime-po/en@boldquot.header: Likewise.
11542 * runtime-po/insert-header.sin: Likewise.
11543 * runtime-po/remove-potcdate.sin: Likewise.
11544 * runtime-po/Makevars: Likewise.
11545 * runtime-po/LINGUAS: Likewise.
11546 * runtime-po/de.po: Likewise; we will rely on the translation project
11547 to maintain this, so "bootstrap" should get it.
11548 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
11549 its value.
11550 * src/main.c (main): Bind the bison-runtime domain, too.
11551
11552 2005-07-12 Bruno Haible <bruno@clisp.org>
11553
11554 * data/yacc.c: Include <libintl.h> when NLS is enabled.
11555 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
11556 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
11557 * runtime-po: New directory.
11558 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
11559 $(DOMAIN).pot-update rule, so that old messages are never dropped.
11560 * runtime-po/Rules-quot: New file, copied from po/.
11561 * runtime-po/quot.sed: Likewise.
11562 * runtime-po/boldquot.sed: Likewise.
11563 * runtime-po/en@quot.header: Likewise.
11564 * runtime-po/en@boldquot.header: Likewise.
11565 * runtime-po/insert-header.sin: Likewise.
11566 * runtime-po/remove-potcdate.sin: Likewise.
11567 * runtime-po/Makevars: New file.
11568 * runtime-po/POTFILES.in: New file.
11569 * runtime-po/LINGUAS: New file.
11570 * runtime-po/bison-runtime.pot: New file.
11571 * runtime-po/de.po: New file.
11572 * m4/bison.m4: New file.
11573 * Makefile.am (SUBDIRS): Add runtime-po.
11574 (aclocaldir, aclocal_DATA): New variables.
11575 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
11576 Define aclocaldir.
11577 * src/getargs.c (usage): Document --print-localedir option.
11578 (PRINT_LOCALEDIR_OPTION): New enum item.
11579 (long_options): Add --print-localedir option.
11580 (getargs): Handle --print-localedir option.
11581 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
11582 (Internationalization): New section.
11583
11584 2005-07-12 Akim Demaille <akim@epita.fr>
11585
11586 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
11587 for consistency with the rest of the code.
11588 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
11589 Add separators.
11590
11591 2005-07-12 Akim Demaille <akim@epita.fr>
11592
11593 * src/parse-gram.y: Use %printer instead of YYPRINT.
11594
11595 2005-07-12 Akim Demaille <akim@epita.fr>
11596
11597 * src/symtab.h, src/symtab.c (symbol_print): New.
11598 * src/symlist.h, src/symlist.c (symbol_list_print): New.
11599 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
11600
11601 2005-07-12 Akim Demaille <akim@epita.fr>
11602
11603 * data/glr.c (b4_syncline): Fix (swap) the definitions of
11604 b4_at_dollar and b4_dollar_dollar.
11605
11606 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
11607
11608 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
11609 and Pennello's paper.
11610
11611 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
11612
11613 * data/yacc.c (yyparse): Undo previous patch. Instead,
11614 set yylsp[0] and yyvsp[0] only if the initial action
11615 sets yylloc and yylval, respectively.
11616
11617 * data/yacc.c (yyparse): In the initial action, set
11618 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
11619 This avoids the use of undefined variables if the initial
11620 action does not set yylloc and/or yylval.
11621
11622 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
11623
11624 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
11625 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
11626 Remove from CVS. These files are automatically generated.
11627 * examples/extexi: Clarify that this file is now part of Bison,
11628 not GNU M4, and that it works with any POSIX-compatible Awk.
11629 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
11630 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
11631 so that we also get calc++-parser.yy. Geneate it.
11632 Use $(AWK), not gawk, since any conforming Awk will do.
11633 Put comment before action, since older 'make' can't handle comment
11634 in action.
11635 $(BUILT_SOURCES): List all built sources, not just some of them.
11636 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
11637 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
11638 $($(calc_sources_generated)): Remove unnecessary test for existence
11639 of target. (This had a shell syntax error anyway; a stray "x".)
11640 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
11641 calc++-parser.yy.
11642 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
11643
11644 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
11645 implied by the other modules.
11646
11647 2005-07-06 Akim Demaille <akim@epita.fr>
11648
11649 Bind examples/calc++ to the package.
11650 * examples/calc++/Makefile: Remove, replaced by...
11651 * examples/calc++/Makefile.am: ... this new file.
11652 * examples/calc++/test: Remove input.
11653 * examples/calc++/compile: Remove.
11654 * examples/Makefile.am: New.
11655 * configure.ac, Makefile.am: Adjust.
11656 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
11657
11658 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
11659
11660 * data/glr.c (yyFail): Drastically simplify; since the format argument
11661 never had any % directives, we can simply pass it to yyerror.
11662 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
11663 be modified later, as that is the usual style in glr.c.
11664 Problems reported by Paul Hilfinger.
11665
11666 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
11667 and size overflow errors.
11668 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
11669 in case the user prolog sets feature-test macros like _GNU_SOURCE.
11670 (YYSIZEMAX): New macro.
11671 (yystpcpy): New function, taken from yacc.c.
11672 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
11673 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
11674 so that we don't have to maintain their signatures.
11675 (yyFail): Check for buffer overflow, by using vsnprintf rather
11676 than vsprintf. Allocate a bigger buffer if possible.
11677 Report an error if buffer allocation fails.
11678 (yyStackOverflow): New function.
11679 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
11680 the initialization was successful. It might fail if storage was
11681 exhausted.
11682 (yyexpandGLRStack): Add more checks for storage allocation failure.
11683 Use yyStackOverflow to report failures.
11684 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
11685 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
11686 Don't assume stack number fits in int.
11687 (yysplitStack): Check for storage allocation failure.
11688 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
11689 can print diagnostics on storage allocation failure. All callers
11690 changed.
11691 (yyresolveValue): Use yybool for boolean.
11692 (yyreportSyntaxError): Check for size-calculation overflow.
11693 This code is taken from yacc.c.
11694 (yyparse): Check for storage allocation errors when allocating
11695 the initial stack.
11696
11697 2005-07-05 Akim Demaille <akim@epita.fr>
11698
11699 Extract calc++ from the documentation.
11700 * doc/bison.texinfo (Calc++): Add the extraction marks.
11701 * examples/extexi: New, from the aborted GNU Programming 2E.
11702 Separate the different paragraph of a file with empty lines.
11703 * examples/Makefile: Use it to extract the whole calc++ example.
11704
11705 2005-06-24 Akim Demaille <akim@epita.fr>
11706
11707 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
11708 class typedefs.
11709
11710 2005-06-22 Akim Demaille <akim@epita.fr>
11711
11712 * doc/bison.texinfo (C++ Language Interface): First stab.
11713 (C++ Parsers): Remove.
11714
11715 2005-06-22 Akim Demaille <akim@epita.fr>
11716
11717 * data/lalr1.cc (yylex_): Honor %lex-param.
11718
11719 2005-06-22 Akim Demaille <akim@epita.fr>
11720
11721 Start a set of simple examples.
11722 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
11723 * examples/calc++/calc++-driver.hh,
11724 * examples/calc++/calc++-parser.yy,
11725 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
11726 * examples/calc++/compile, examples/calc++/test: New.
11727
11728 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
11729
11730 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
11731 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
11732 which stems from the 2005-05-27 patch.
11733
11734 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11735
11736 * data/glr.c: Modify treatment of unused parameters to permit use
11737 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
11738
11739 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
11740
11741 Fix infringement on user name space reported by Janos Zoltan Szabo.
11742 * data/yacc.c (yyparse): strlen -> yystrlen.
11743
11744 2005-05-30 Akim Demaille <akim@epita.fr>
11745
11746 * data/lalr1.cc (_): New.
11747 Translate the various messages.
11748
11749 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
11750
11751 Fix infringement on user name space reported by Bruno Haible.
11752 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
11753 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
11754 the user's name space.
11755 (alloca): Include <stdlib.h> to get it, if it's not built in.
11756 (YYMALLOC, YYFREE): Define only if needed.
11757 (malloc, free): Declare, but only if needed, as this infringes on
11758 the user name space.
11759
11760 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
11761
11762 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
11763 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
11764 with %d format.
11765 * lib/ebitset.c (min, max): Undef before defining.
11766 * lib/vbitset.c (min, max): Likewise.
11767 * lib/subpipe.c (create_subpipe): Save local variables in case
11768 vfork clobbers them.
11769
11770 2005-05-24 Bruno Haible <bruno@clisp.org>
11771
11772 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
11773 error message syntax used by gcc-4.0.
11774
11775 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
11776
11777 * README: Mention m4 1.4.3. Remove obsolete advice about
11778 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
11779
11780 * bootstrap: Remove workaround for problem I encountered with
11781 gettext 0.14.1; it seems to be fixed now.
11782
11783 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
11784
11785 * NEWS: Version 2.0a.
11786
11787 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
11788 the previous change.
11789
11790 Various maintainer cleanups.
11791 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
11792 conftest*, for benefit of CVS commands run at the same time as
11793 "configure". Add build-aux, since "bootstrap" now creates it and
11794 its subfiles.
11795 * Makefile.cfg (move_if_change): Remove.
11796 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
11797 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
11798 (po_repo, do-po-update, po-update, wget_files, get-targets):
11799 (config.guess-url_prefix, config.sub-url_prefix):
11800 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
11801 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
11802 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
11803 Remove.
11804 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
11805 this is now the recommended name.
11806 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
11807 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
11808 ylwrap. These files now go into build-aux.
11809 * config/move-if-change: Remove.
11810 * config/prev-version.txt: Bump from 1.75 to 2.0.
11811
11812 * bootstrap: Add stdio-safer, unistd-safer modules.
11813 Remove m4/glibc2.m4 (introduced by latest gnulib, but
11814 we don't need it).
11815 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
11816 fopen-safer.c, stdio-safer.h, unistd-safer.h.
11817 * lib/subpipe.c: Include "unistd-safer.h".
11818 (create_subpipe): Make sure all the newly-created
11819 file descriptors are > 2, so that diagnostics don't
11820 get sent down them (which might cause Bison to hang, in theory).
11821 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
11822 * src/files.c (xfopen): Use fopen_safer, not fopen.
11823
11824 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
11825 yesterday's yacc.c fix.
11826
11827 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
11828
11829 * data/glr.c, data/lalr1.cc: Update copyright date.
11830
11831 Fix a destructor bug reported by Wolfgang Spraul in
11832 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
11833 * data/yacc.c (yyabortlab): Don't call destructor, and
11834 don't set yychar to EMPTY.
11835 (yyoverflowlab): Don't call destructor.
11836 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
11837 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
11838 since we no longer output the message "discarding lookahead token
11839 end of input ()".
11840
11841 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11842
11843 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
11844 fix a small glitch in debugging output.
11845 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
11846 after YY_SYMBOL_PRINT where needed.
11847
11848 (struct yyGLRState): Add some comments.
11849 (struct yySemanticOption): Add some comments.
11850 (union yyGLRStackItem): Add comment.
11851
11852 (yymergeOptionSets): Correct this to properly perform the union,
11853 avoiding infinite reported by Michael Rosien.
11854 Update comment.
11855
11856 * tests/glr-regression.at: Add test for GLR merging error reported
11857 by M. Rosien.
11858
11859 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
11860
11861 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
11862 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
11863 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
11864 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
11865 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
11866 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
11867 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
11868 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
11869 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
11870 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
11871 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
11872 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
11873 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
11874 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
11875 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
11876 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
11877 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
11878 src/derives.h, src/files.c, src/files.h, src/getargs.c,
11879 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
11880 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
11881 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
11882 src/output.h, src/parse-gram.c, src/parse-gram.h,
11883 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
11884 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
11885 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
11886 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
11887 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
11888 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
11889 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
11890 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
11891 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
11892 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
11893 tests/reduce.at, tests/regression.at, tests/sets.at,
11894 tests/synclines.at, tests/testsuite.at, tests/torture.at:
11895 Update FSF postal mail address.
11896
11897 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
11898
11899 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
11900 Problem reported by Ralf Menzel.
11901
11902 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
11903
11904 * tests/actions.at: Test that stack overflow invokes destructors.
11905 From Marcus Holland-Moritz.
11906 * data/yacc.c (yyerrlab): Move the code that destroys the stack
11907 from here....
11908 (yyreturn): to here. That way, destructors are called properly
11909 even if the stack overflows, or the user calls YYACCEPT or
11910 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
11911 (yyoverflowlab): Destroy the lookahead.
11912
11913 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
11914
11915 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
11916
11917 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
11918
11919 * NEWS: Bison-generated C parsers no longer quote literal strings
11920 associated with tokens.
11921 * src/output.c (prepare_symbols): Don't escape strings,
11922 since users don't want to see C escapes.
11923 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
11924 in diagnostics.
11925 * tests/input.at (Torturing the Scanner): Likewise.
11926 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
11927
11928 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
11929
11930 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
11931 the data size is known to be too small and we can't increase it.
11932 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
11933
11934 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
11935
11936 * src/parse-gram.y: Include quotearg.h.
11937 (string_as_id): Quote $1 before using it as a key, since the
11938 lexer no longer quotes it for us.
11939 (string_content): Don't strip quotes, since lexer no longer
11940 quotes it for us.
11941 * src/scan-gram.l: Include quotearg.h.
11942 ("\""): Omit quote.
11943 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
11944 a key, since the rest of the lexer doesn't quote it.
11945 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
11946 * tests/regression.at (Token definitions): Check for backslashes
11947 in token strings.
11948
11949 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
11950 (YYSIZE_T): Define to unsigned long int when using an older compiler.
11951 (yyparse): Revamp code to generate long syntax error message, to
11952 make it easier to translate, and to avoid problems with arithmetic
11953 overflow. Change "virtual memory" to "memory" in diagnostic, since
11954 we don't know whether the memory is virtual.
11955
11956 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
11957
11958 * NEWS: Bison-generated C parsers now use the _ macro to
11959 translate strings.
11960 * data/yacc.c (_) [!defined _]: New macro.
11961 All English strings wrapped inside this macro.
11962 * doc/bison.texinfo (Bison Parser): Document _.
11963 * po/POTFILES.in: Include src/parse-gram.c, since it now
11964 includes translateable strings that parse-gram.y doesn't.
11965
11966 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
11967
11968 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
11969 reverting the 2004-10-11 change to this function.
11970 (symbol_check_alias_consistency): Don't call symbol_type_set
11971 if the type name is already correct.
11972 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
11973
11974 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
11975
11976 * tests/regression.at (Token definitions): Don't use a token named
11977 c, as that generates a "#define c ..." that runs afoul of buggy
11978 stdlib.h that uses the identifier c as a member of struct
11979 drand48_data. Problem reported by Horst Wente.
11980
11981 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
11982
11983 * bootstrap: Change translation URL from
11984 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
11985 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
11986 redirection glitches. Problem reported by twlevo@xs4all.nl.
11987
11988 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
11989
11990 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
11991 after operands; POSIX says this isn't portable for the c99 command.
11992
11993 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
11994
11995 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
11996 immediately if a data overrun has occurred; this may help us track
11997 down what may be a spurious failure on MacOS.
11998
11999 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
12000
12001 Respond to problems reported by twlevo@xs4all.nl.
12002
12003 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
12004
12005 * src/vcg.h: Comment fix.
12006 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
12007 (G_CMAX): Change to -1 instead of INT_MAX.
12008
12009 * data/yacc.c (yyparse): Omit spaces before #line.
12010
12011 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
12012
12013 * src/tables.c (state_number_to_vector_number): Put it inside an
12014 "#if 0", since it's not currently used. Problem reported by
12015 Roland McGrath.
12016
12017 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
12018
12019 * src/output.c (escaped_output): Renamed from
12020 escaped_file_name_output, since we now use it for symbol tags as
12021 well. All uses changed.
12022 (symbol_destructors_output, symbol_printers_output):
12023 Escape symbol tags too.
12024 Problem reported by Matyas Forstner in
12025 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
12026
12027 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
12028 not needed.
12029 * src/output.c (user_actions_output, token_definitions_output,
12030 symbol_destructors_output, symbol_printers_output): Likewise.
12031 * src/reader.c (prologue_augment): Likewise.
12032 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
12033
12034 * src/vcg.c (output_edge): Don't quote linestyle arg.
12035 Problem reported by twlevo@xs4all.nl.
12036
12037 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
12038
12039 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
12040 example, reported by Derek M Jones. Also, make the example even
12041 more outrageous, to better illustrate how bad the problem is.
12042
12043 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
12044
12045 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
12046 putsym. Typo reported by Sebastian Piping.
12047
12048 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
12049
12050 * doc/bison.texinfo (Language and Grammar): some -> same
12051 (Epilogue): int he -> in the
12052 Typos reported by Sebastian Piping via Justin Pence.
12053
12054 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
12055
12056 * tests/glr-regression.at (Improper handling of embedded actions
12057 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
12058 embedded actions and $-N in GLR parsers", work around an Autoconf bug
12059 with dollar signs in test names.
12060 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
12061 for a similar reason.
12062
12063 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
12064
12065 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
12066 wants to redefine G_VIEW.
12067
12068 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
12069
12070 * src/vcg.c (get_view_str): Remove case for normal_view.
12071 Problem reported by twlevo@xs4all.nl.
12072
12073 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
12074
12075 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
12076 Problem reported by twlevo@xs4all.nl.
12077
12078 * doc/bison.texinfo: Change @dircategory from "GNU programming
12079 tools" to "Software development". Requested by Richard Stallman
12080 via Karl Berry.
12081
12082 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
12083
12084 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
12085 Problem reported by twlevo@xs4all.nl.
12086
12087 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
12088
12089 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
12090 keyword; it's not needed with modern compilers, and it doesn't
12091 affect correctness with older compilers. Suggested by
12092 twlevo@xs4all.nl.
12093
12094 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
12095
12096 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
12097 gcc -Wswitch-default.
12098 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
12099 * data/yacc.c (yyparse): Likewise.
12100
12101 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
12102
12103 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
12104 already. Let config.h define any nonstandard values.
12105
12106 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
12107
12108 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
12109 for the benefit of slower hosts. Problem reported by
12110 Nelson H. F. Beebe.
12111
12112 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
12113
12114 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
12115 being defined and not used.
12116 * data/lalr1.cc (yyparse): Likewise.
12117 Use "if (false)" rather than "if (0)".
12118
12119 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
12120
12121 * TODO: Mention that we should allow NUL bytes in tokens.
12122
12123 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
12124
12125 * src/scan-skel.l (<<EOF>>): Don't close standard output.
12126 Problem reported by Hans Aberg.
12127
12128 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
12129
12130 * src/getargs.c (version): Happy new year; update overall
12131 program copyright date from 2004 to 2005.
12132
12133 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
12134 Problem reported by Hans Aberg.
12135 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
12136 (Output file names.): Add a test for the case when standard output
12137 is closed.
12138
12139 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
12140
12141 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
12142 to fix an oversight in the Bison 2.0 manual.
12143
12144 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
12145
12146 * NEWS: Version 2.0. Reformat the existing news items since
12147 1.875, so that related items are grouped together.
12148 * configure.ac (AC_INIT): Bump version to 2.0.
12149 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
12150
12151 * tests/torture.at (Exploding the Stack Size with Alloca): Set
12152 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
12153 otherwise, we're not testing alloca. Unfortunately there's no
12154 simple way to consult HAVE_ALLOCA here.
12155
12156 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
12157 for yymsg, too.
12158
12159 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
12160 hand. This avoids a warning about comparing int to size_t when
12161 GCC warnings are enabled.
12162
12163 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
12164
12165 * NEWS: Bison-generated parsers no longer default to using the
12166 alloca function (when available) to extend the parser stack, due
12167 to widespread problems in unchecked stack-overflow detection.
12168 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
12169 responsibility to set it to a positive value. This lets the user
12170 specify a value that is not a preprocessor constant.
12171 * data/yacc.c (YYMAXDEPTH): Likewise.
12172 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
12173 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
12174 to be a compile-time constant. However, explain the constraints on it.
12175 Also, explain the constraints on YYINITDEPTH.
12176 (Table of Symbols): Explain that alloca is no longer the default.
12177 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
12178 to 1.
12179
12180 * doc/bison.texinfo (Location Default Action): Mention that n must
12181 be zero when k is zero. Suggested by Frank Heckenbach.
12182
12183 2004-12-22 Akim Demaille <akim@epita.fr>
12184
12185 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
12186 (parser::state_type, parser::semantic_type, parser::location_type):
12187 Private, not public.
12188 (parser::parse): Return ints, not bool.
12189 Returning a bool introduces a problem: 0 corresponds to false, and
12190 it seems weird to return false on success. Returning true changes
12191 the conventions for yyparse.
12192 Alternatively we could return void and send an exception.
12193 There is no clear consensus (yet?).
12194 (state_stack, semantic_stack, location_stack): Rename as...
12195 (state_stack_type, semantic_stack_type, location_stack_type): these.
12196 Private, not public.
12197 * tests/c++.at: New.
12198 * tests/testsuite.at, tests/Makefile.am: Adjust.
12199
12200 2004-12-21 Akim Demaille <akim@epita.fr>
12201
12202 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
12203
12204 2004-12-21 Akim Demaille <akim@epita.fr>
12205
12206 Don't impose std::string for filenames.
12207
12208 * data/lalr1.cc (b4_filename_type): New.
12209 (position::filename): Use it.
12210 (parser.hh): Move the inclusion of stack.hh and location.hh below
12211 the user code, so that needed headers for the filename type can be
12212 included first.
12213 Forward declare them before the user code.
12214 * tests/Makefile.am (check-local, installcheck-local): Pass
12215 TESTSUITEFLAGS to the TESTSUITE.
12216
12217 2004-12-20 Akim Demaille <akim@epita.fr>
12218
12219 Use more STL like names: my_class instead of MyClass.
12220
12221 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
12222 (SemanticStack, SemanticType, StateStack, StateType)
12223 (TokenNumberType, Stack, Slice, Traits, Parser::location)
12224 (Parser::value): Rename as...
12225 (location_stack, location_type, rhs_number_type, semantic_stack)
12226 (semantic_type, state_stack, state_type, token_number_type, stack)
12227 (slice, traits, parser::yylloc, parser::yylval): these.
12228
12229 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
12230
12231 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
12232
12233 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
12234 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12235
12236 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
12237
12238 Remove uses of 'short int' and 'unsigned short int'. This raises
12239 some arbitrary limits. It uses more memory but nowadays that's
12240 not much of an issue.
12241
12242 This change does not affect the generated parsers; that's a different
12243 task, as some users will want to conserve memory there.
12244
12245 Ideally we should use size_t to represent all object counts, and
12246 something like ptrdiff_t to represent signed differences of object
12247 counts; but that will require more code-cleanup than I have the
12248 time to do right now.
12249
12250 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
12251 Use size_t, not int or short int, to count objects.
12252 * src/closure.c (nritemset, closure): Likewise.
12253 * src/closure.h (nritemset, closure): Likewise.
12254 * src/nullable.c (nullable_compute): Likewise.
12255 * src/print.c (print_core): Likewise.
12256 * src/print_graph.c (print_core): Likewise.
12257 * src/state.c (state_compare, state_hash): Likewise.
12258 * src/state.h (struct state): Likewise.
12259 * src/tables.c (default_goto, goto_actions): Likewise.
12260
12261 * src/gram.h (rule_number, rule): Use int, not short int.
12262 * src/output.c (prepare_rules): Likewise.
12263 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
12264 errs, reductions): Likewise.
12265 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
12266 Likewise.
12267 * src/tables.c (vector_number, tally, action_number,
12268 ACTION_NUMBER_MINIMUM): Likewise.
12269 * src/output.c (muscle_insert_short_int_table): Remove.
12270
12271 2004-12-17 Akim Demaille <akim@epita.fr>
12272
12273 * data/lalr1.cc: Extensive Doxygenation.
12274 (error_): Rename as...
12275 (error): this, since it is visible to the user.
12276 Adjust callers.
12277 (Parser::message): Now an automatic variable from...
12278 (Parser::yyreport_syntax_error_): here.
12279 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
12280 Parser::error.
12281 * tests/input.at: Escape $.
12282
12283 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
12284
12285 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
12286 Parenthesize rhs to avoid obscure problems with mistakes like
12287 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
12288 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12289 b4_rhs_location): Likewise.
12290 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12291 b4_rhs_location): Likewise.
12292
12293 2004-12-16 Akim Demaille <akim@epita.fr>
12294
12295 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
12296 yacc.c: be sure to stay within yycheck_.
12297 * tests/actions.at: Re-enable C++ tests.
12298
12299 2004-12-16 Akim Demaille <akim@epita.fr>
12300
12301 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
12302 real.
12303
12304 2004-12-16 Akim Demaille <akim@epita.fr>
12305
12306 Use #define to handle the %name-prefix.
12307
12308 * data/glr.c, data/yacc.c: Comment changes.
12309 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
12310 so that one can refer to yylex in the parser file, and have it
12311 renamed, as is the case with other skeletons.
12312
12313 2004-12-16 Akim Demaille <akim@epita.fr>
12314
12315 Move lalr1.cc internals into yy*.
12316
12317 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
12318 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
12319 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
12320 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
12321 (empty_, final_, terror_, errcode_, ntokens_)
12322 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
12323 (looka_, ilooka_, error_range_, nerrs_):
12324 Rename as...
12325 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
12326 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
12327 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
12328 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
12329 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
12330 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
12331 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
12332 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
12333 these.
12334
12335 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
12336
12337 Fix some problems reported by twlevo at xs4all.
12338 * src/symtab.c (symbol_new): Report an error if the input grammar
12339 contains too many symbols. This is better than calling abort() later.
12340 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
12341 (struct node, struct graph):
12342 Rename member expand to stretch. All uses changed.
12343 (struct graph): Remove member layoutalgorithm. All uses removed.
12344 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
12345 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
12346 All uses changed.
12347 (N_STRETCH): Rename from N_EXPAND. All uses changed.
12348
12349 2004-12-15 Akim Demaille <akim@epita.fr>
12350
12351 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
12352 Add more Doxygen comments.
12353 (symprint_, stack_print_, reduce_print_, destruct_, pop)
12354 (report_syntax_error_, translate_): Rename as...
12355 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
12356 (yypop_, yyreport_syntax_error_, yytranslate_): this.
12357
12358 2004-12-15 Akim Demaille <akim@epita.fr>
12359
12360 * data/lalr1.cc (lex_): Rename as...
12361 (yylex_): this.
12362 Move the trace here.
12363 Take the %name-prefix into account.
12364 Reported by Alexandre Duret-Lutz.
12365
12366 2004-12-15 Akim Demaille <akim@epita.fr>
12367
12368 Simplify the C++ parser constructor.
12369
12370 * data/lalr1.cc (debug_): Rename as...
12371 (yydebug_): so that the parser's internals are always in the yy*
12372 pseudo namespace.
12373 Adjust uses.
12374 (b4_parse_param_decl): Remove the leading comma as it is now only
12375 called as unique argument list.
12376 (Parser::Parser): Remove the constructor accepting a location and
12377 an initial debugging level.
12378 Remove from the other ctor the argument for the debugging level.
12379 (debug_level_type, debug_level, set_debug_level): New.
12380
12381 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
12382 constructor calls.
12383
12384 2004-12-15 Akim Demaille <akim@epita.fr>
12385
12386 Remove b4_root related material: failure experiment
12387 (which goal was to allow to derive from a class).
12388
12389 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
12390 definitions and uses.
12391
12392 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
12393
12394 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
12395 not 2, since it's not portable to subtract 1 from the start of an
12396 array. The new item 0 is never set or used. All uses changed.
12397
12398 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
12399 the default definition of YYLLOC_DEFAULT. Problem reported
12400 by Frank Heckenbach.
12401
12402 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
12403
12404 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
12405 the normal case and one for the error case. Just use the
12406 first one uniformly. Problem reported by Frank Heckenbach.
12407 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
12408 use exactly the same macro in both places.
12409 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
12410 so that the normal-case YYRHSLOC works for the error case too.
12411 All uses changed.
12412 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
12413 (YYLLOC_DEFAULT): Use the same macro as glr.c.
12414 * doc/bison.texinfo (Location Default Action): Don't claim that
12415 we have an array of locations. Use the same macro for both glr
12416 and lalr parsers. Mention YYRHSLOC. Mention what happens when
12417 the index is 0.
12418
12419 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12420
12421 * HACKING: Update email addresses to send announcements to.
12422
12423 * configure.ac (AC_INIT): Bump version to 1.875f.
12424
12425 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12426
12427 * NEWS: Version 1.875e.
12428 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
12429
12430 * src/scan-skel.l: Include "complain.h", for "fatal".
12431
12432 * src/relation.h (relation_print, relation_digraph):
12433 Relation sizes are of type relation_node, not size_t (this is
12434 merely a doc fix, since the two types are equivalent).
12435 (relation_transpose): Relation sizes are of type relation_node,
12436 not int.
12437 * src/relation.c: Likewise.
12438 (top, infinity): Now of type relation_node, not int.
12439 (traverse, relation_transpose): Use relation_node, not int.
12440
12441 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
12442 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
12443 (yyparse): Remove unused local introduced in 2004-10-25 patch.
12444
12445 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
12446 specifying whether the test should be skipped. Use it tp
12447 specify that the [%defines %skeleton "lalr1.cc"] tests currently
12448 fail on some hosts, and should be skipped.
12449
12450 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
12451
12452 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
12453 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
12454 unless otherwise specified below.
12455
12456 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
12457 to allocate kernel_base, kernel_items, kernel_size, since
12458 they needn't be initialized to 0.
12459 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
12460 * src/closure.c (new_closure): Likewise, for itemset.
12461 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
12462 * src/lalr.c (set_goto_map): Likewise, for temp_map.
12463 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
12464 (build_relations): Likewise for edge, states1, includes.
12465 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
12466 * src/reader.c (packgram): Likewise, for ritem, rules.
12467 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
12468 * src/relation.c (relation_digraph): Likewise for VERTICES.
12469 (relation_transpose): Likewise for new_R, end_R.
12470 * src/symtab.c (symbols_token_translations_init): Likewise for
12471 token_translations.
12472 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
12473 (token_actions): Likewise for yydefact, actrow, conflrow,
12474 conflict_list.
12475 (save_column): Likewise for froms[symno], tos[symno].
12476 (goto_actions): Likewise for state_count.
12477 (pack_table): Likewise for base, pos, check.
12478 (tables_generate): Likewise for width.
12479
12480 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
12481 for initial core. Just have a separate core, so we needn't worry
12482 about whether kernel_size and kernel_base are initialized.
12483
12484 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
12485 kernel_size, kernel_items): Remove unnecessary initialization.
12486 * src/conflicts.c (conflicts): Likewise.
12487 * src/derives.c (derives): Likewise.
12488 * src/muscle_tablc (muscle_insert): Likewise.
12489 * src/relation.c (relation_digraph): Likewise.
12490 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
12491 conflrow, conflict_table, conflict_list, table, check):
12492 Likewise.
12493
12494 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
12495 This is because all callers pass unsigned int.
12496 * src/closure.h (new_closure): Likewise.
12497
12498 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
12499 (build_relations): Initialize includes[i] in all cases.
12500 * src/reader.c (packgram): Always initialize rules[ruleno].prec
12501 and rules[ruleno].precsym. Initialize members in order.
12502 * src/relation.c (relation_transpose): Always initialize new_R[i]
12503 and end_R[i].
12504 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
12505
12506 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
12507 conflict_list[0] was always 0, but now it isn't initialized.
12508
12509 * src/table.c (table_grow): When conflict_table grew, the grown
12510 area wasn't cleared. Fix this.
12511
12512 * lib/.cvsignore: Add strdup.c, strdup.h.
12513 * m4/.cvsignore: Add strdup.m4.
12514
12515 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
12516
12517 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
12518 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
12519 GOTO_NUMBER_MAXIMUM, since we occasionally compute
12520 ngotos + 1 without checking for overflow.
12521 (build_relations): Use END_NODE, not -1, to denote end of edges.
12522 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
12523 build_relations): Use goto_number, not int, for goto numbers.
12524 * src/tables.c (save_column, default_goto): Likewise.
12525
12526 2004-11-23 Akim Demaille <akim@epita.fr>
12527
12528 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
12529 of #defining from yystype.
12530 Don't typedef yystype, C++ does not need it.
12531 This lets it possible to forward declare it as union.
12532
12533 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
12534
12535 * bootstrap (gnulib_modules): Add extensions.
12536 Problem reported by Jim Meyering.
12537
12538 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
12539
12540 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
12541 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
12542 src/system.h, src/tables.c: XFREE -> free, to accommodate
12543 recent change to gnulib xalloc.h.
12544 Problem reported by Jim Meyering.
12545
12546 2004-11-17 Akim Demaille <akim@epita.fr>
12547
12548 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
12549
12550 2004-11-17 Akim Demaille <akim@epita.fr>,
12551 Alexandre Duret-Lutz <adl@gnu.org>
12552
12553 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
12554 changes.
12555 (YYCDEBUG): Adjust.
12556 Use it instead of cdebug_.
12557 (Parser::debug_stream, Parser::set_debug_stream): New.
12558 (Parser::symprint_): Define cdebug_ for temporary backward
12559 compatibility.
12560 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
12561 debug_stream ().
12562
12563 2004-11-17 Akim Demaille <akim@epita.fr>
12564
12565 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
12566 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
12567 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
12568 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12569
12570 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
12571
12572 * data/glr.c (yyloc_default): Remove; not used.
12573 Problem reported by Frank Heckenbach.
12574
12575 2004-10-25 Akim Demaille <akim@epita.fr>
12576
12577 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
12578 Introduce another definition to address simple location arrays.
12579 (yyGLRStack): New member: yyerror_range.
12580 (yyrecoverSyntaxError, yyparse): Update it.
12581 (yyrecoverSyntaxError): Use it when shifting the error token to
12582 have an accurate range, equivalent to the one computed by both
12583 yacc.c and lalr1.cc.
12584 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
12585 that column numbers start at column 0, as per GNU Coding
12586 Standards, the others tests, and the doc.
12587 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
12588 Adjust to the above change (first column is 0).
12589 And adjust the location of the "<error>", now covering the whole
12590 line.
12591
12592 2004-10-22 Akim Demaille <akim@epita.fr>
12593 and Paul Eggert <eggert@cs.ucla.edu>
12594
12595 Remove some arbitrary limits on goto numbers and relations.
12596 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
12597 initial values, since they're never used.
12598 (set_goto_map): ngotos is now unsigned, so test for overflow
12599 by seeing whether it wraps around to zero.
12600 * src/lalr.h (goto_number): Now size_t, not short int.
12601 (GOTO_NUMBER_MAXIMUM): Remove.
12602 * src/relation.c (relation_print, traverse, relation_transpose):
12603 Check for END_NODE rather than looking at sign.
12604 * src/relation.h (END_NODE): New macro.
12605 (relation_node): Now size_t, not short int.
12606
12607 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
12608
12609 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
12610 keyword, not an identifier. Problem reported by Baron Schwartz in
12611 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
12612
12613 2004-10-11 Akim Demaille <akim@epita.fr>
12614
12615 * src/symtab.c (symbol_check_alias_consistency): Also check
12616 type names, destructors, and printers.
12617 Reported by Alexandre Duret-Lutz.
12618 Recode the handling of associativity and precedence in terms
12619 of symbol_precedence_set.
12620 Accept no redeclaration at all, not even equal to the previous
12621 value.
12622 (redeclaration): New.
12623 Use it to factor redeclaration complaints.
12624 (symbol_make_alias): Don't set the type of the alias, let
12625 symbol_check_alias_consistency do it as for other features.
12626 * src/symtab.h (symbol): Add new member prec_location, and
12627 type_location.
12628 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
12629 * tests/input.at (Incompatible Aliases): New.
12630
12631 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
12632
12633 .cvsignore fixes to accommodate gnulib changes,
12634 and the practice of naming build directories "_build".
12635 * .cvsignore: Add "_*". Sort.
12636 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
12637 * m4/.cvsignore: Add "*_gl.m4".
12638
12639 2004-10-06 Akim Demaille <akim@epita.fr>
12640
12641 * src/parse-gram.y (add_param): Fix the truncation of trailing
12642 spaces.
12643
12644 2004-10-05 Akim Demaille <akim@epita.fr>
12645
12646 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
12647 whether the reducion was empty or not. This leaves room to
12648 improve the use of YYLLOC_DEFAULT in such a case.
12649 lalr1.cc is still experimental, so changing this is acceptable.
12650 And finally, there are probably not many users who changed the
12651 handling of locations in GLR, so changing is admissible too.
12652
12653 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
12654 empty reduction, set @$ to an empty location ending the previously
12655 stacked symbol.
12656 Adjust uses to make sure the code is triggered on empty
12657 reductions.
12658 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
12659 expected output: empty reductions have empty locations.
12660
12661 2004-09-29 Akim Demaille <akim@epita.fr>
12662
12663 * data/lalr1.cc: Move towards a more standard C++ coding style
12664 for templates: Class < T > -> Class<T>.
12665
12666 2004-09-29 Akim Demaille <akim@epita.fr>
12667
12668 * data/lalr1.cc: Reinstall the former ctor, for sake of
12669 compatibility, but warn it will be removed.
12670 Move towards a more standard C++ coding style (i.e., type *var ->
12671 type* var).
12672
12673 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
12674
12675 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
12676 since it's less likely to work if NULs are involved in the future.
12677
12678 2004-09-27 Akim Demaille <akim@epita.fr>
12679
12680 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
12681
12682 2004-09-27 Akim Demaille <akim@epita.fr>
12683
12684 * data/lalr1.cc (b4_parse_param_decl_1): New.
12685 (b4_parse_param_decl): Use it to have different names between attribute
12686 and argument names.
12687 (b4_cc_constructor_call): Likewise.
12688
12689 2004-09-24 Akim Demaille <akim@epita.fr>
12690
12691 * src/parse-gram.y (add_param): Strip the leading and trailing
12692 blanks from a formal argument declaration.
12693 (YY_LOCATION_PRINT): New.
12694
12695 2004-09-24 Akim Demaille <akim@epita.fr>
12696
12697 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
12698 after the location.
12699
12700 2004-09-24 Akim Demaille <akim@epita.fr>
12701
12702 * doc/bison.texinfo (Table of Symbols): Sort.
12703
12704 2004-09-21 Akim Demaille <akim@epita.fr>
12705
12706 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
12707 the useless parentheses.
12708 Suggested by Paul Eggert.
12709
12710 2004-09-20 Akim Demaille <akim@epita.fr>
12711
12712 Let the initial-action act on the look-ahead, and use it for the
12713 "initial push" (corresponding to an hypothetical beginning-of-file).
12714 And let lalr1.cc honor %initial-action.
12715
12716 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
12717 example.
12718 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
12719 (Parser::Parser): Remove the ctor that used to initialize it.
12720 (Parser::parse): Like in the other skeletons, issue the "starting
12721 parse" message before any action.
12722 Honor %initial-action.
12723 Initialize the stacks with the lookahead.
12724 * data/yacc.c: Let $$ and @$ in %initial-action designate the
12725 look-ahead.
12726 Push them in the stacks.
12727 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
12728
12729 2004-09-20 Akim Demaille <akim@epita.fr>
12730
12731 * doc/bison.texinfo (Initial Action Decl): New.
12732
12733 2004-09-20 Akim Demaille <akim@epita.fr>
12734
12735 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
12736 clearer criterion to define it.
12737 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
12738 When reducing on an empty RHS, use the latest stacked location as
12739 location.
12740 yylloc is not always available.
12741 * data/glr.c: Likewise.
12742 Also, honor initial-actions.
12743
12744 2004-09-20 Akim Demaille <akim@epita.fr>
12745
12746 * data/yacc.c (YY_LOCATION_PRINT): New.
12747 Define when we know YYLTYPE's structure, i.e., when the default
12748 YYLLOC_DEFAULT is used.
12749 * data/c.m4 (b4_yysymprint_generate): Use it.
12750 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
12751 value of the result.
12752 (error_start_): Replace with...
12753 (error_range_): this location array.
12754 This allows to replace code relying on the implementation of
12755 locations by portable code.
12756 * data/yacc.c (yylerrsp): Replace with...
12757 (yyerror_range): this.
12758 Every time a token is popped, update yyerror_range[0], to have an
12759 accurate location for the error token.
12760 * data/glr.c (YY_LOCATION_PRINT): New.
12761 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
12762 deference a pointer.
12763 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
12764 report the location in %printers.
12765
12766 * src/scan-skel.l: Instead of abort, report error messages to ease
12767 understanding skeleton scanning failures.
12768
12769 2004-09-16 Akim Demaille <akim@epita.fr>
12770
12771 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
12772 (iterator, const_iterator): these, to be more in the C++ spirit.
12773 Also, return reverse iterators so that when displaying the stack
12774 we display its bottom first.
12775 (Parser::stack_print_, Parser::reduce_print_): Match the messages
12776 from yacc.c.
12777 We should probably use vector here though.
12778
12779 2004-09-16 Akim Demaille <akim@epita.fr>
12780
12781 Have more complete shift traces.
12782
12783 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
12784 to report Shifts instead of ad hoc YYDPRINTF invocations,
12785 including for the error token.
12786 * data/lalr1.cc (symprint_): Output the location.
12787 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
12788 output the location within the %printer.
12789 Activate GLR tests, at least to make sure they compile properly.
12790 They still don't pass though.
12791 * tests/calc.at: Adjust expect verbose output, since now "Entering
12792 state..." is on a different line than the "Shifting" message.
12793
12794 2004-09-08 Akim Demaille <akim@epita.fr>
12795
12796 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
12797 Bison directive from the Bison file to the invocation of this
12798 macro, so that these directives are passed to
12799 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
12800 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
12801 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
12802 the extra Bison directives instead of the whole series.
12803 Change the grammar so that there are recoverable errors, and
12804 unrecoverable errors. Now we can have the parser give up before
12805 consuming the whole input. As a result we now can observe that
12806 the lookahead is freed when needed.
12807 Change the parser source to parse argv[1] instead of a hard coded
12808 string.
12809 Simplify yylex, and give a value and location to EOF.
12810 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
12811 passed directives already coded in the file.
12812 Add some tests to check the location of "error".
12813 For some tests, the C++ parser is correct, and not yacc.c.
12814 For other tests, they provide different, but unsatisfying, values,
12815 so keep the C++ value so that at least one parser is "correct"
12816 according to the test suite.
12817 (Actions after errors): Remove, this is subsumed by the
12818 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
12819
12820 2004-09-06 Akim Demaille <akim@epita.fr>
12821
12822 * data/lalr1.cc: Adjust the indentation of the labels.
12823 (Parser::pop): New.
12824 Use it.
12825
12826 2004-09-06 Akim Demaille <akim@epita.fr>
12827
12828 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
12829 argument, an informative message.
12830 Call YY_SYMBOL_PRINT.
12831 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
12832 * data/lalr1.cc (destruct_): Likewise.
12833 In addition, no longer depend on b4_yysymprint_generate and
12834 b4_yydestruct_generate to generate these functions, do it "by
12835 hand".
12836
12837 2004-09-03 Akim Demaille <akim@epita.fr>
12838
12839 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
12840 invoked, yydestruct the lookahead.
12841 * tests/calc.at (Calculator $1): Update the expected lengths of
12842 traces: there is an added line for the discarded lookahead.
12843 * doc/bison.texinfo (Destructor Decl): Some rewording.
12844 Define "discarded" symbols.
12845
12846 2004-09-02 Akim Demaille <akim@epita.fr>
12847
12848 * data/lalr1.cc (translate_, destruct_): No reason to be static.
12849
12850 2004-09-02 Akim Demaille <akim@epita.fr>
12851
12852 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
12853 (YYDSYMPRINTF): Rename as...
12854 (YY_SYMBOL_PRINT): this.
12855 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
12856 two.
12857 Use it instead of direct symprint_ calls.
12858 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
12859 one.
12860
12861 2004-09-02 Akim Demaille <akim@epita.fr>
12862
12863 * data/lalr1.cc (b4_yysymprint_generate): New.
12864 (symprint_): New member function, defined when YYDEBUG.
12865 Use it consistently instead of token/nterm debugging output by
12866 hand.
12867 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
12868 %printer calls to use cdebug_ when using lalr1.cc.
12869
12870 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
12871
12872 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
12873 with #ifdef YYDEBUG.
12874
12875 2004-08-26 Akim Demaille <akim@epita.fr>
12876
12877 * doc/bison.texinfo (Implementing Loops): Rename as...
12878 (Implementing Gotos/Loops): this.
12879
12880 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
12881
12882 Adjust to latest gnulib.
12883 * bootstrap (gnulib_modules): Add xalloc-die.
12884 Set LC_ALL=C so that file names sort consistently.
12885 Prefer the gnulib copies of gettext.m4, glibc21.m4,
12886 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
12887 uintmax_t.m4, ulonglong.m4.
12888 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
12889 po.m4 since we are now using _gl.m4 instead.
12890
12891 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
12892
12893 * src/scan-action.l: Remove. Scanning of semantic actions is
12894 handled in scan-gram.l.
12895
12896 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
12897
12898 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
12899
12900 * src/location.h (struct): The file member is a uniqstr.
12901 (equal_boundaries): Use UNIQSTR_EQ for comparison.
12902
12903 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
12904
12905 Fix bug with non-%union parsers that have printers or destructors,
12906 which led to a Bison core dump. Reported by Peter Fales in
12907 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
12908
12909 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
12910 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
12911 not to our own type.
12912 * src/output.c (symbol_destructors_output, symbol_printers_output):
12913 Don't assume %union.
12914 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
12915 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
12916 UNION-FLAG. All callers changed.
12917 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
12918 Use type char, not unsigned int, when declaring an array of char;
12919 this lets us remove a cast.
12920 (Printers and Destructors): Add non-%union test cases.
12921
12922 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
12923
12924 * doc/bison.texinfo: Minor editorial changes, mostly to the new
12925 GLR writeups. E.g., avoid frenchspacing and the future tense,
12926 change "lookahead" to "look-ahead", and change "wrt" to "with
12927 respect to".
12928
12929 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12930
12931 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
12932 New sections, split off from the GLR Parsers section. Put the new
12933 Simple GLR Parser near the start of the GLR section, for clarity.
12934 Rewrite connective text.
12935
12936 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
12937
12938 * doc/bison.texinfo (Simple GLR Parsers): New section.
12939
12940 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
12941
12942 * NEWS, TODO, doc/bison.texinfo:
12943 Use "look-ahead" instead of "lookahead", to be consistent.
12944 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
12945 while we're fixing "look-ahead".
12946 * src/conflicts.c (shift_set): Renamed from shiftset.
12947 (look_ahead_set): Renamed from lookaheadset.
12948 * src/print.c: Likewise.
12949 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
12950 name for "lookahead".
12951 (report_types, usage): Likewise.
12952 * src/getargs.h (report_look_ahead_tokens): Renamed from
12953 report_lookaheads.
12954 * src/lalr.c (compute_look_ahead_tokens): Renamed from
12955 compute_lookaheads.
12956 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
12957 (look_ahead_tokens_print): Renamed from lookaheads_print.
12958 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
12959 state_rule_lookaheads_print.
12960 * src/state.h: Likewise.
12961 (reductions.look_ahead_tokens): Renamed from lookaheads.
12962 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
12963 AT_DATA_LOOKAHEADS_GRAMMAR.
12964
12965 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
12966
12967 * README: Update location of patched M4 distribution.
12968
12969 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
12970
12971 Don't assume the C++ compiler takes the same arguments as the C compiler
12972 (trivial change).
12973 * configure.ac (O0CXXFLAGS): New var.
12974 * tests/atlocal.in (CXXFLAGS): Use it.
12975
12976 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
12977
12978 Fix some "make check" problems with C++ reported by
12979 Albert Chin-A-Young for Tru64 C++ in this thread:
12980 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
12981
12982 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
12983 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12984 Output to a .cc file for C++, not to a .c file.
12985 * tests/calc.at (AT_CHECK_CALC): Likewise.
12986 * tests/regression.at (AT_CHECK_DANCER): Likewise.
12987 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
12988
12989 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
12990
12991 * tests/calc.at, tests/actions.at: Workaround for SGI
12992 C++ compiler. (trivial change)
12993
12994 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
12995
12996 Spent a few hours checking out which prerequisite versions the
12997 current sources actually require. I went all the way back to
12998 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
12999 a seemingly endless set of combinations of versions more recent
13000 than that. The bottom line is that the current sources require
13001 fairly recent versions of the build tools, and it'll be some work
13002 to change this.
13003 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
13004 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
13005 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
13006 Add comments explaining why those particular versions are
13007 currently needed.
13008
13009 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
13010 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
13011 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
13012
13013 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
13014 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
13015
13016 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
13017
13018 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
13019 0.11.5. Suggested by Bruno Haible.
13020 * bootstrap: Remove gettext version checking.
13021
13022 * doc/bison.texinfo (Decl Summary): Also mention that %union
13023 can depend on prerequisite types. Problem reported by Tim
13024 Van Holder.
13025
13026 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
13027
13028 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
13029 * README-alpha: Don't tell people not to package this.
13030
13031 * bootstrap: Don't assume $(...) works; use `...` instead.
13032 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
13033 gettext better.
13034
13035 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
13036 put into the -d output file, and mention what to do if YYSTYPE is
13037 defined as a macro.
13038
13039 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
13040
13041 Undo change made earlier today: it caused autopoint to not bring
13042 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
13043 autopoint's.
13044
13045 * bootstrap: Check that gettext version matches what's in
13046 configure.ac. Warn users to ignore robots.txt ERROR 404.
13047 * bootstrap: Undo today's earlier change (logged below).
13048 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
13049
13050 The gettext version checking is causing more trouble than it's
13051 curing; remove it. Problem reported by Paul Hilfinger.
13052
13053 * bootstrap: Issue a warning that one can expect a message
13054 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
13055 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
13056
13057 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
13058
13059 Ensure that the C++ compiler used for testing actually works on a
13060 simple test program; if not, skip the C++-related tests. Problem
13061 reported by Vin Shelton in:
13062 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
13063
13064 * m4/cxx.m4: New file.
13065 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
13066 * tests/atlocal.in (BISON_CXX_WORKS): Add.
13067 * tests/local.at (AT_COMPILE_CXX): Use it.
13068
13069 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13070
13071 * data/glr.c (yylloc): Output this macro even if locations are not
13072 being generated, as the GLR parser needs it even in that case.
13073 Problem reported by Troy A. Johnson
13074 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
13075
13076 * configure.ac (AC_INIT): Update to 1.875e.
13077
13078 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13079
13080 * NEWS: Version 1.875d.
13081 * configure.ac (AC_INIT): Likewise.
13082 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
13083
13084 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
13085 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
13086 lalr1.cc runs afoul of the first, and the last two are no longer
13087 supported by GCC 3.4.0.
13088 * README: Mention GNU m4 1.4 or later; mention m4 patches.
13089 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
13090
13091 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
13092
13093 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
13094 unsigned int, for compatibility with latest gnulib hash module.
13095 * src/state.c (state_hash, state_hasher): Likewise.
13096 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
13097 * src/uniqstr.c (hash_uniqstr): Likewise.
13098
13099 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
13100
13101 * NEWS: Unescaped newlines are no longer allowed in char & strings.
13102
13103 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
13104 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
13105 character and string literals.
13106 (unexpected_end): New function.
13107 (unexpected_eof): Use it.
13108 (unexpected_newline): New function.
13109 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
13110 actions.
13111
13112 * NEWS: Document %expect-rr.
13113
13114 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
13115 Fix typo by replacing $1 with $option.
13116 Remove more 'intl'-related files.
13117 Don't DEFUN AM_INTL_SUBDIR twice.
13118
13119 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
13120 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
13121 strtoul.c.
13122 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
13123 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
13124 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
13125 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
13126 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
13127 * src/.cvsignore: Add *.output.
13128
13129 * src/parse-gram.y: Put copyright notice inside %{ %} so it
13130 gets copied to the output file.
13131
13132 2004-04-28 Paul Eggert <eggert@twinsun.com>
13133
13134 Get files from the gnulib and po repositories, instead of relying
13135 on them being in our CVS. Upgrade to latest versions of gnulib
13136 and Automake.
13137
13138 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
13139 * bootstrap: Bootstrap from gnulib and po repositories.
13140 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
13141 * README-cvs: Document these changes. Remove version numbers from
13142 mentions of build tools, since they change so often. Mention Flex.
13143
13144 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
13145 (gl_USE_SYSTEM_EXTENSIONS): Add.
13146 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
13147 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
13148 does this for us.
13149 (AC_ISC_POSIX): Remove; we no longer support this
13150 ancient OS, as it gets in the way of latest Autoconf & gnulib.
13151 (AC_HEADER_STDC): Remove: we now assume C89 or better.
13152 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
13153 Do not check for C89 headers, except for locale.h which is used
13154 by the Yacc library and must port to K&R hosts.
13155 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
13156 Do not check for C89 functions, except for setlocale which is
13157 used by the Yacc library.
13158 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
13159 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
13160 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
13161 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
13162 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
13163 AM_GNU_GETTEXT): Remove; now done by:
13164 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
13165 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
13166 for us.
13167
13168 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
13169 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
13170 Define to empty, as gnulib.mk will do the rest for us.
13171 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
13172 for us.
13173 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
13174 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
13175
13176 * src/files.c: Include gnulib's xstrndup.h.
13177
13178 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
13179 (REALLOC): Use xnrealloc, for likewise.
13180 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
13181 (strnlen, memrchr): Remove decls; functions no longer used.
13182 Include <stpcpy.h>.
13183
13184 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
13185 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
13186 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
13187 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
13188 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
13189 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
13190 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
13191 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
13192 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
13193 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
13194 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
13195 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13196 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
13197 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
13198 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
13199 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
13200 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
13201 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
13202 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
13203 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
13204 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
13205 Remove, as these files are now generated automatically
13206 by bootstrap or automake.
13207
13208 * po/ChangeLog: Remove: all but one entry was a duplicate
13209 of this file, and I moved that 2000-11-02 entry here.
13210
13211 * config/.cvsignore: Add Makefile, depcomp, install-sh.
13212 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
13213 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
13214 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
13215 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
13216 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
13217 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
13218 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
13219 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
13220 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
13221 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
13222 xstrndup.h.
13223 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
13224 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
13225 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
13226 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
13227 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
13228 * src/.cvsignore: Remove *_.c.
13229
13230
13231 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
13232 support it. (The latest stable gzip doesn't.)
13233
13234 2004-04-27 Paul Eggert <eggert@twinsun.com>
13235
13236 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
13237 case, as stos_ is now used by destructors due to the 2004-02-09
13238 change.
13239
13240 Remove more K&R C support.
13241 * lib/libiberty.y (PARAMS): Remove. All uses removed.
13242 * lib/subpipe.c (errno): Remove decl.
13243 Include <stdlib.h> unconditionally.
13244 (EXIT_FAILURE): Remove macro.
13245 * src/complain.c (vfprintf, strerror): Remove.
13246 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
13247 unconditionally.
13248 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
13249 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
13250 (strchr, strspn, memchr): Remove decls.
13251 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
13252 unconditionally. Do not declare perror.
13253 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
13254 unconditionally.
13255
13256 * src/complain.c (_): Remove useless defn, as system.h defines this.
13257
13258 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
13259 with latest obstack.h.
13260 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
13261 to procedure types, as obstack.h now does that for us.
13262 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
13263
13264 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
13265 so that this include file can stand alone.
13266 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
13267 does this now. Include subpipe.h first after config.h, to
13268 test whether it can stand alone.
13269
13270 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
13271 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
13272 unused declaration.
13273
13274 * tests/synclines.at (%union synch line): Put a dummy member in
13275 the union, because empty unions aren't allowed in C. Caught
13276 by GCC 3.4.0.
13277
13278 2004-04-13 Jim Meyering <jim@meyering.net>
13279
13280 * src/conflicts.c (conflicts_print): Correct format string typo:
13281 use `%%' to produce literal `%'. (trivial change)
13282
13283 2004-03-30 Paul Eggert <eggert@twinsun.com>
13284
13285 * src/getargs.c (version): Update copyright year to 2004.
13286
13287 * data/c.m4 (b4_int_type): Use 'short int' rather than
13288 'short', and similarly for 'long', 'unsigned', etc.
13289 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
13290 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
13291 yy_yypstack, yydumpstack): Likewise.
13292 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
13293 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
13294 Likewise.
13295 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
13296 yy_stack_print, yyparse): Likewise.
13297 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
13298 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
13299 * lib/bitset.c (bitset_print): Likewise.
13300 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
13301 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13302 * lib/bitsetv.c (bitsetv_dump): Likewise.
13303 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
13304 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
13305 Likewise.
13306 * src/LR0.c (allocate_itemsets): Likewise.
13307 * src/gram.h (rule_number, rule): Likewise.
13308 * src/lalr.h (goto_number): Likewise.
13309 * src/nullable.c (nullable_compute): Likewise.
13310 * src/output.c (prepare_rules): Likewise.
13311 * src/relation.c (relation_print, relation_digraph): Likewise.
13312 * src/relation.h (relation_node): Likewise.
13313 * src/state.h (state_number, transitions, errs, reductions,
13314 struct state): Likewise.
13315 * src/symtab.h (symbol_number, struct symbol): Likewise.
13316 * src/tables.c (vector_number, tally, action_number,
13317 default_goto, goto_actions): Likewise.
13318 * tests/existing.at (GNU Cim Grammar): Likewise.
13319 * tests/regression.at (Web2c Actions): Likewise.
13320
13321 * src/output.c (muscle_insert_short_int_table): Renamed from
13322 muscle_insert_short_table. All uses changed.
13323
13324 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
13325
13326 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
13327 (declaration): Replace expected_conflicts with expected_sr_conflicts.
13328 Add %expect-rr rule.
13329
13330 * src/scan-gram.l: Recognize %expect-rr.
13331
13332 * src/conflicts.h (expected_sr_conflicts): Rename from
13333 expected_conflicts.
13334 (expected_rr_conflicts): Declare.
13335
13336 * src/conflicts.c (expected_sr_conflicts): Rename from
13337 expected_conflicts.
13338 (expected_rr_conflicts): Define.
13339 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
13340 for GLR parsers.
13341 Use expected_sr_conflicts in place of expected_conflicts.
13342 Warn if expected_rr_conflicts used in non-GLR parser.
13343
13344 * doc/bison.texinfo: Add documentation for %expect-rr.
13345
13346 2004-03-08 Paul Eggert <eggert@gnu.org>
13347
13348 Add support for hex token numbers. Suggested by Odd Arild Olsen in
13349 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
13350
13351 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
13352 in lalr1.cc.
13353 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
13354 * src/scan-gram.l (scan_integer): New function.
13355 ({int}): Use it.
13356 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
13357 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
13358 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
13359 Say "long int", not "long", for uniformity with GNU style.
13360
13361 2004-02-25 Paul Eggert <eggert@twinsun.com>
13362
13363 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
13364 compilers. This fixes a problem with Intel's C++ compiler being
13365 chatty, reported by Guido Trentalancia in
13366 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
13367
13368 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
13369
13370 Support %destructor and merge error locations in lalr1.cc.
13371
13372 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
13373 (Parser::stos_): Define unconditionally.
13374 (Parser::destruct_): New method. Generate its body with
13375 b4_yydestruct_generate.
13376 (Parser::error_start_): New attribute.
13377 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
13378 token which are discarded.
13379 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
13380 error_start_ when erroneous token are discarded.
13381 (Parser::parse) <yyerrlab1>: Compute the location of the error
13382 token so that it covers all the discarded tokens.
13383 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
13384 it can be called with `%skeleton "lalr1.cc"', and do that.
13385
13386 2004-02-02 Paul Eggert <eggert@twinsun.com>
13387
13388 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
13389 $(top_srcdir)/lib and ../lib. This fixes a bug reported
13390 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
13391 There's no need to mention top_builddir since Automake does that
13392 for us.
13393 (INCLUDES): Remove, as Automake says it's obsolescent.
13394 Contents migrated into AM_CPPFLAGS as described above.
13395 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
13396
13397 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
13398
13399 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
13400 (yyreportSyntaxError): Handle case where lookahead token is
13401 YYEMPTY.
13402
13403 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13404
13405 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
13406 resulting parsers are compilable with C++.
13407
13408 2003-12-23 Paul Eggert <eggert@twinsun.com>
13409
13410 * config/depcomp, config/install-sh: Sync with Automake 1.8.
13411 * src/output.c (output_skeleton): Rename local var.
13412 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
13413 Bison tokens, as this runs afoul of the 2003-10-07 change that
13414 disallowed NUL bytes in character constants or string literals.
13415
13416 * tests/local.at: Require Autoconf 2.59's Autotest.
13417 * tests/testsuite.at: Don't include local.at, since we now assume
13418 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
13419 including it.
13420 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
13421 multiple inclusion warnings.
13422
13423 2003-12-02 Akim Demaille <akim@epita.fr>
13424
13425 * doc/bison.texinfo (How Can I Reset the Parser): More about start
13426 conditions.
13427 From Bruno Haible.
13428
13429 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
13430
13431 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
13432
13433 2003-10-07 Paul Eggert <eggert@twinsun.com>
13434
13435 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
13436 if testsuite doesn't exist.
13437
13438 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
13439 literals, unfortunately.
13440 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
13441 Complain about NUL bytes in character constants or string literals.
13442
13443 2003-10-05 Paul Eggert <eggert@twinsun.com>
13444
13445 * NEWS: Don't document %no-default-prec, as it's still
13446 too experimental.
13447 * doc/bison.texinfo: Document %no-default-prec only if
13448 the defaultprec flag is set. Normally it's not.
13449
13450 2003-10-04 Paul Eggert <eggert@twinsun.com>
13451
13452 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
13453 non-modifiable lvalue, instead of a modifiable one.
13454 * doc/bison.texinfo (Actions): Document that $$ can
13455 be assigned to. Do not claim that $$ and $N are
13456 array element references: user code should not rely on this.
13457
13458 2003-10-01 Paul Eggert <eggert@twinsun.com>
13459
13460 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
13461 (grammar_declaration): Use it.
13462 * src/scan-gram.l: New token %no-default-prec.
13463 * tests/conflicts.at: Revamp tests to use %no-default-prec.
13464 * NEWS, doc/bison.texinfo: Document the above.
13465
13466 2003-10-01 Akim Demaille <akim@epita.fr>
13467
13468 VCG no longer supports long_straight_phase.
13469
13470 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
13471 * src/print_graph.c (print_graph): Adjust.
13472
13473 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
13474 and Paul Eggert <eggert@twinsun.com>
13475
13476 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
13477 Table of Symbols): Document %default-prec.
13478 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
13479 (grammar_declaration): Set default_prec on %default-prec.
13480 * src/scan-gram.l (%default-prec): New token.
13481 * src/reader.h (default_prec): New flag.
13482 * src/reader.c: Likewise.
13483 (packgram): Handle it.
13484 * tests/conflicts.at (%default-prec without %prec,
13485 %default-prec with %prec, %default-prec 1): New tests.
13486
13487 2003-09-30 Paul Eggert <eggert@twinsun.com>
13488
13489 * tests/testsuite.at: Include local.at, not input.at, fixing
13490 a typo in the 2003-08-25 patch.
13491
13492 2003-08-27 Akim Demaille <akim@epita.fr>
13493
13494 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
13495 GCC warnings.
13496
13497 2003-08-26 Akim Demaille <akim@epita.fr>
13498
13499 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
13500 "<\#" to avoid magic from Gnus when posting parts of this script.
13501
13502 2003-08-26 Akim Demaille <akim@epita.fr>
13503
13504 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
13505 (Parser::parse): here.
13506 Adjust: nerrs and errstatus is now replaced by...
13507 (Parser::nerrs_, Parser::errstatus_): New.
13508
13509 2003-08-25 Akim Demaille <akim@epita.fr>
13510
13511 * config/announce-gen, Makefile.cfg: New.
13512 * Makefile.am: Adjust.
13513 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
13514 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
13515
13516 2003-08-25 Akim Demaille <akim@epita.fr>
13517
13518 When reducing initial empty rules, Bison parser read an initial
13519 location that is not defined. This results in garbage, and that
13520 affects Bison's own parser. Therefore we need (i) to extend Bison
13521 to support a means to initialize this location, and (ii) to use
13522 this CVS Bison to fix CVS Bison's parser.
13523
13524 * src/reader.h, reader.c (epilogue_augment): Remove, replace
13525 with...
13526 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
13527 * src/parse-gram.y: Adjust.
13528 (%initial-action): New.
13529 (%error-verbose): Since we require CVS Bison, there is no reason
13530 not to use it.
13531 * src/scan-gram.l: Adjust.
13532 * src/Makefile.am (YACC): New, to make sure we use our own parser.
13533 * data/yacc.c (yyparse): Use b4_initial_action.
13534
13535 2003-08-25 Akim Demaille <akim@epita.fr>
13536
13537 * doc/bison.texinfo: Don't promote stdout for error messages.
13538
13539 2003-08-25 Akim Demaille <akim@epita.fr>
13540
13541 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
13542 From Alexandre Duret-Lutz.
13543
13544 2003-08-25 Akim Demaille <akim@epita.fr>
13545
13546 Version 1.875c.
13547
13548 2003-08-25 Akim Demaille <akim@epita.fr>
13549
13550 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
13551 Use them.
13552
13553 2003-08-25 Akim Demaille <akim@epita.fr>
13554
13555 * data/lalr1.cc (Parser::reduce_print_): New.
13556 Use it.
13557
13558 2003-08-25 Akim Demaille <akim@epita.fr>
13559
13560 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
13561 error recovery loops. This patch is based on
13562 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
13563 Also, augment the similarity between lalr1.cc and yacc.c.
13564 Note: the locations of error recovery rules are not correct yet.
13565
13566 * data/lalr1.cc: Comment changes to augment the similarity between
13567 lalr1.cc and yacc.c.
13568 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
13569 (yyerrlab1): Remove, but where it used to be (now the bottom part of
13570 yyerrlab), when hitting EOF, pop the whole stack here instead of
13571 merely falling thru the default error handling mechanism.
13572 (yyerrorlab): New label, with the old contents of YYERROR,
13573 plus the following change: pop the stack of rhs corresponding
13574 to the production that invoked YYERROR. That is how Yacc
13575 behaves (required by POSIX).
13576 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
13577 fail.
13578
13579 2003-08-25 Akim Demaille <akim@epita.fr>
13580
13581 Tune local.at so that people can "autom4te -l autotest calc.at -o
13582 calc" for instance, to extract a sub test suite.
13583
13584 * tests/testsuite.at: Move the initialization, Autotest version
13585 requirement, and AT_TESTED invocation into...
13586 * tests/local.at: here.
13587 * tests/testsuite.at: Include it for compatibility with Autoconf
13588 2.57.
13589 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
13590 be ignore.
13591
13592 2003-08-04 Paul Eggert <eggert@twinsun.com>
13593
13594 Rework code slightly to avoid gcc -Wtraditional warnings.
13595 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
13596 The returned value is now stored in *YY0. All callers changed.
13597 * src/output.c (merge_output): Adjust to the above change.
13598
13599 2003-07-26 Paul Eggert <eggert@twinsun.com>
13600
13601 * data/glr.c (YYASSERT): New macro.
13602 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
13603 yyresolveStates, yyprocessOneStack):
13604 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
13605 Derived from a suggestion by Frank Heckenbach.
13606
13607 2003-07-25 Paul Eggert <eggert@twinsun.com>
13608
13609 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
13610 for portability to K&R C (after ansi2knr, presumably). See
13611 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
13612 by Frank Heckenbach, though I have omitted the structure-initialization
13613 part of his glr-knr.diff patch since I recall that the Portable
13614 C Compiler didn't require that change.
13615
13616 Let the user specify how to allocate and free memory.
13617 Derived from a suggestion by Frank Heckenbach in
13618 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
13619 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
13620 All uses of free, malloc, realloc changed to use these macros,
13621 and unnecessary casts removed.
13622 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
13623
13624 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
13625
13626 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
13627 use s.empty() rather than s == "" to test for empty string; see
13628 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
13629 (trivial change)
13630
13631 2003-06-25 Akim Demaille <akim@epita.fr>
13632
13633 * config/depcomp, config/install-sh: Update from masters.
13634
13635 2003-06-20 Paul Eggert <eggert@twinsun.com>
13636
13637 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
13638 and return properly parenthesized result.
13639 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
13640 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
13641 Remove unnecessary parentheses from uses.
13642 * doc/bison.texinfo (Location Default Action): Describe the
13643 conventions for parentheses.
13644
13645 2003-06-19 Paul Eggert <eggert@twinsun.com>
13646
13647 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
13648 yyreportTree): Do not assume that size_t is the same width as int,
13649 when printing sizes. Print sizes using an unsigned format.
13650 Problem reported by Frank Heckenbach in
13651 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
13652
13653 Port to Forte Developer 7 C compiler.
13654 * data/glr.c (struct YYLTYPE): If locations are not being used,
13655 declare a single dummy member, as empty structs do not conform
13656 to the C standard.
13657 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
13658 the Forte Developer 7 C compiler complains that end-of-loop
13659 code is not reached.
13660
13661 2003-06-17 Paul Eggert <eggert@twinsun.com>
13662
13663 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
13664 avoid warnings from picky compilers about redefinition of PARAMS.
13665
13666 2003-06-17 Paul Eggert <eggert@twinsun.com>
13667
13668 Version 1.875b.
13669
13670 * NEWS: Document 1.875b.
13671
13672 * lib/bbitset.h: Do not include config.h; that's the includer's job.
13673 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
13674 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
13675 Don't use 'index' in comments, as it's a builtin fn on some hosts.
13676 * lib/bitset_stats.c: Include gettext.h unconditionally, as
13677 per recent gettext manual's suggestion.
13678 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
13679 Use prototypes, not old-style definitions.
13680 * lib/lbitset.c (lbitset_unused_clear): Likewise.
13681 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
13682 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
13683 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
13684 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
13685 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
13686 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
13687 vbitset_or_and_cmp, vbitset_copy): Likewise.
13688
13689 * lib/libiberty.h: Do not include config.h; that's the includer's job.
13690 Do not include <stdlib.h>.
13691 (PARAMS): Define unconditionally for C89.
13692 (ATTRIBUTE_NORETURN): Remove.
13693 (ATTRIBUTE_UNUSED): Define unconditionally.
13694
13695 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
13696 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
13697 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
13698 * lib/vbitset.c, lib/vbitset.h: New files.
13699 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13700 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
13701 from libbitset.
13702
13703 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
13704 `How Can I Reset @code{yyparse}', since texinfo does not allow
13705 arbitrary @ in node names.
13706
13707 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
13708 shouldn't be needed according to the gettext 0.12.1 documentation
13709 but which seem to be needed anyway: codeset.m4 glibc21.m4
13710 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
13711 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
13712 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
13713
13714 * lib/.cvsignore: Add stdbool.h.
13715 * m4/.cvsignore: Add nls.m4, po.m4.
13716
13717 Upgrade to CVS gnulib.
13718 * stdbool_.h: File renamed from stdbool.h.in.
13719 * configure.ac (AM_STDBOOL_H): Invoke this instead of
13720 AC_HEADER_STDBOOL.
13721 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
13722 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
13723 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
13724 (MOSTLYCLEANFILES): New var.
13725 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
13726 (stdbool.h): New rule.
13727 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
13728 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
13729 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
13730 m4/quote.m4: Upgrade to today's gnulib.
13731
13732 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
13733 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
13734 the tests right now.
13735 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
13736 yyerror are declared before use; C99 requires this.
13737
13738 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13739
13740 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
13741 first.
13742 (yyrecoverSyntaxError): Correct the logic for setting and testing
13743 yyerrState.
13744 Correct comment on handling EOF.
13745 Allow states with only a default reduction, rather than failing
13746 (I can't quite reconstruct why these were not allowed before).
13747
13748 Fixes to avoid problem that $-N rules in GLR parsers can cause
13749 buffer overruns, corrupting state.
13750
13751 * src/output.c (prepare_rules): Output max_left_semantic_context
13752 definition.
13753 * src/reader.h (max_left_semantic_context): New variable declaration.
13754 * src/scan-gram.l (max_left_semantic_context): Define.
13755 (handle_action_dollar): Update max_left_semantic_context.
13756 * data/glr.c (YYMAXLEFT): New definition.
13757 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
13758 (yyresolveAction): Ditto.
13759
13760 Fixes to problems with location handling in GLR parsers reported by
13761 Frank Heckenbach (2003/06/05).
13762
13763 * data/glr.c (YYLTYPE): Make trivial if locations not used.
13764 (YYRHSLOC): Add parentheses, and define only if locations used.
13765 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
13766 locations not used.
13767 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
13768 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
13769
13770 * tests/cxx-type.at: Exercise location information; update tests
13771 to differentiate output with and without locations.
13772 Remove forward declarations of yylex and yyerror---caused errors
13773 because default YYLTYPE not yet defined.
13774 Change semantic actions to compute strings, rather than printing
13775 them directly (to test proper passing of semantics values). Change
13776 output to prefix notation and update test data and expected results.
13777 (yylex): Track locations.
13778 (stmtMerge): Return value rather than printing, and include arguments
13779 in value.
13780
13781 2003-06-03 Paul Eggert <eggert@twinsun.com>
13782
13783 Avoid warnings generated by GCC 2.95.4 when Bison is
13784 configured with --enable-gcc-warnings.
13785 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
13786 yy::]b4_parser_class_name[::translate_,
13787 yy::Stack::operator[] (unsigned),
13788 yy::Stack::operator[] (unsigned) const,
13789 yy::Slice::operator[] (unsigned),
13790 yy::Slice::operator[] (unsigned) const):
13791 Rename local vars to avoid warnings.
13792 * tests/glr-regression.at (Improper handling of embedded actions
13793 and $-N in GLR parsers): Remove unused local variable from yylex.
13794 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
13795 (void) as arg when not pure, since we now assume C89 when building
13796 Bison. Pacify GCC by using parameter.
13797
13798 2003-06-02 Paul Eggert <eggert@twinsun.com>
13799
13800 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
13801 yy::Location::lines, yy::Location::columns): Rename arguments
13802 to avoid shadowing; this removes a warning generated by GCC 3.3.
13803
13804 2003-06-01 Paul Eggert <eggert@twinsun.com>
13805
13806 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
13807 to g++, as GCC 3.3 complains if you do it.
13808 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
13809 everything that WARNING_CFLAGS has, except omit warnings
13810 not suitable for C++.
13811 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
13812 * tests/atlocal.in (CXXFLAGS): New var.
13813 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
13814
13815 Fix a GLR parser bug I reported in February; see
13816 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
13817 The problem was that GLR parsers did not conform to the C standard,
13818 because actions like { $1 = $2 + $3; } expanded to expressions
13819 that invoked YYFILL in separate subexpressions, and YYFILL assigned
13820 to a local variable. The C standard says that expressions
13821 like (var = f ()) + (var = f ()) have undefined behavior.
13822 Another problem was that GCC sometimes issues warnings that
13823 yyfill and its parameters are unused.
13824
13825 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
13826 as possibly unused.
13827 (yyfill): New function.
13828 (YYFILL): Use it.
13829 (yyuserAction): Change type of yynormal to bool, so that it matches
13830 the new yyfill signature. Mark it as possibly unused.
13831
13832
13833 Follow up on a bug I reported in February, where a Bison-generated
13834 parser can loop. Provide a test case and a fix for yacc.c. I
13835 don't have a fix for lalr1.cc or for glr.c, unfortunately.
13836 The original bug report is in:
13837 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
13838
13839 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
13840 macro's size was becoming unwieldy.
13841 (yyerrlab): Do not discard an empty lookahead symbol, as this
13842 might destroy garbage.
13843 (yyerrorlab): New label, with the old contents of YYERROR,
13844 plus the following change: pop the stack of rhs corresponding
13845 to the production that invoked YYERROR. That is how Yacc
13846 behaves, and POSIX requires this behavior.
13847 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
13848 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
13849 Define 'alarm' to do nothing if unistd.h is not available.
13850 Add a new rule "exp: '-' error;" to test the above change to
13851 data/yacc.c. Use 'alarm' to abort any test taking longer than
13852 10 seconds, as it's probably looping.
13853 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
13854 Also, the new yacc.c generates two fewer diagnostics for an
13855 existing test.
13856
13857 2003-05-24 Paul Eggert <eggert@twinsun.com>
13858
13859 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
13860 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
13861 This fixes a problem reported by John Bowman when the Compaq/HP
13862 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
13863 -ansi -Wall -gall).
13864 * data/yacc.c (union yyalloc): Likewise.
13865 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
13866
13867 Switch from 'int' to 'bool' where that makes sense.
13868
13869 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
13870 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
13871 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
13872 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
13873 Return or accept bool, not int. All callers changed.
13874 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
13875 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
13876 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
13877 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
13878 bitset_or_and_cmp_): Likewise.
13879 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
13880 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
13881 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
13882 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
13883 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
13884 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
13885 bitset_stats_or_and_cmp): Likewise.
13886 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
13887 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
13888 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
13889 ebitset_xor_cmp): Likewise.
13890 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
13891 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
13892 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
13893 lbitset_xor_cmp): Likewise.
13894 * lib/bbitset.h: Include <stdbool.h>.
13895 (struct bitset_vtable): The following members now return bool, not
13896 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
13897 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
13898 or_and_cmp).
13899 * src/conflicts.c (count_rr_conflicts): Likewise.
13900 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
13901 All uses changed.
13902 * lib/ebitset.c (ebitset_obstack_init): Likewise.
13903 * lib/lbitset.c (lbitset_obstack_init): Likewise.
13904 * src/getargs.c (debug_flag, defines_flag, locations_flag,
13905 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
13906 graph_flag): Likewise.
13907 * src/getargs.h (debug_flag, defines_flag, locations_flag,
13908 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
13909 graph_flag): Likewise.
13910 * src/output.c (error_verbose): Likewise.
13911 * src/output.h (error_verbose): Likewise.
13912 * src/reader.c (start_flag, typed): Likewise.
13913 * src/reader.h (typed): Likewise.
13914 * src/getargs.c (LOCATIONS_OPTION): New constant.
13915 (long_options, getargs): Use it.
13916 * src/lalr.c (build_relations): Use bool, not int.
13917 * src/nullable.c (nullable_compute): Likewise.
13918 * src/print.c (print_reductions): Likewise.
13919 * src/tables.c (action_row, pack_vector): Likewise.
13920 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
13921 * src/output.c (prepare): Use it.
13922 * src/output.c (token_definitions_output,
13923 symbol_destructors_output, symbol_destructors_output): Use string,
13924 not boolean integer, to keep track of whether to output separator.
13925 * src/print_graph.c (print_core): Likewise.
13926 * src/state.c (state_rule_lookaheads_print): Likewise.
13927
13928 * config/install-sh: Sync from automake 1.7.5.
13929
13930 2003-05-14 Paul Eggert <eggert@twinsun.com>
13931
13932 * src/parse-gram.y (rules_or_grammar_declaration): Require a
13933 semicolon after a grammar declaration, in the interest of possible
13934 future changes to the Bison input language.
13935 Do not allow a stray semicolon at the start of the grammar.
13936 (rhses.1): Allow one or more semicolons after any rule, including
13937 just before "|" as required by POSIX.
13938 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
13939 grammar.
13940
13941 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
13942
13943 %parse-param support for lalr1.cc.
13944
13945 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
13946 b4_cc_constructor_calls, b4_cc_constructor_call,
13947 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
13948 definitions.
13949 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
13950 parse-param arguments.
13951 (yy::b4_parser_class_name): Declare instance variables to
13952 hold parse-param arguments.
13953 * tests/calc.at: s/value/semantic_value/ because value clashes
13954 with a member of yy::b4_parser_class_name. Adjust C++ code
13955 to handle %parse-param. Enable %parse-param test in C++.
13956
13957 2003-05-12 Paul Eggert <eggert@twinsun.com>
13958
13959 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
13960 English a bit. Fix fclose typo. Change "const char" to "char
13961 const", and use ANSI C rather than K&R for "main". Suggest
13962 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
13963 and suggest yy_switch_to_buffer.
13964
13965 2003-05-05 Paul Eggert <eggert@twinsun.com>
13966
13967 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
13968 C89. This avoids a diagnostic on compilers that define __STDC__
13969 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
13970 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
13971
13972 2003-05-03 Paul Eggert <eggert@twinsun.com>
13973
13974 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
13975 Do not overrun array bounds.
13976 This should fix a bug reported today by Olatunji Oluwabukunmi in
13977 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
13978
13979 2003-04-29 Akim Demaille <akim@epita.fr>
13980
13981 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
13982 * src/getargs.c, src/getargs.h: here, as bool, not int.
13983 (nondeterministic_parser): New.
13984 * src/parse-gram.y, src/scan-gram.l: Support
13985 %nondeterministic-parser.
13986 * src/output.c (prepare): Use nondeterministic_parser instead
13987 of glr_parser where appropriate.
13988 * src/tables.c (conflict_row, action_row, save_row)
13989 (token_actions, token_actions, pack_vector): Ditto.
13990
13991 2003-04-29 Akim Demaille <akim@epita.fr>
13992
13993 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
13994
13995 2003-04-29 Akim Demaille <akim@epita.fr>
13996
13997 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
13998 with %pure-parser and %locations to exercise the patch from Yakov
13999 Markovitch below.
14000
14001 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
14002
14003 * data/yacc.c: (b4_lex_param): Corrected for the case where
14004 %lex-param is provided and %pure-parser isn't.
14005
14006 2003-04-27 Paul Eggert <eggert@twinsun.com>
14007
14008 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
14009 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
14010 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
14011 if it is not defined.
14012 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
14013
14014 2003-04-26 Paul Eggert <eggert@twinsun.com>
14015
14016 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
14017 Declare to be of type suitable for the ninf value itself, not of
14018 type suitable for the corresponding table, since the latter might
14019 be unsigned but the ninf value might be negative. This fixes a
14020 bug reported by Alexandre Duret-Lutz in
14021 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
14022
14023 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
14024 invokes it. We shouldn't invoke it twice because it will attempt
14025 to put error.o in the archive twice. This fixes a glitch reported
14026 by Martin Mokrejs in
14027 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
14028
14029 2003-04-21 Paul Eggert <eggert@twinsun.com>
14030
14031 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
14032 to gnulib.
14033
14034 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
14035
14036 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
14037 Fix obvious typo that results in uncompilable GLR parsers
14038 when both %pure-parser and %locations are used. (trivial change)
14039
14040 2003-04-17 Paul Eggert <eggert@twinsun.com>
14041
14042 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
14043 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
14044 Do not insert the expected token via unput, as this runs afoul
14045 of a POSIX-compatibility bug in flex 2.5.31.
14046 All uses changed to BEGIN the parent state,
14047 since we no longer insert the expected token via unput.
14048 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
14049 that is no longer emitted after the above change.
14050
14051 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
14052 the first one. This change is from Paul Hilfinger, and it fixes
14053 regression reported by Werner Lemberg in
14054 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
14055
14056 (resolve_sr_conflict): Don't invoke state_errs_set
14057 unless one or more tokens have been explicitly made errors.
14058 Otherwise, the above change causes Bison to abort.
14059
14060 * tests/existing.at (GNU pic Grammar): New test case, taken from
14061 Lemberg's email.
14062
14063 2003-03-31 Akim Demaille <akim@epita.fr>
14064
14065 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
14066
14067 2003-03-31 Akim Demaille <akim@epita.fr>
14068
14069 * src/output.c (prepare_symbols): Avoid trailing spaces in the
14070 output.
14071
14072 2003-03-31 Akim Demaille <akim@epita.fr>
14073
14074 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
14075 From Paul Hilfinger.
14076
14077 2003-03-29 Akim Demaille <akim@epita.fr>
14078
14079 * m4/error.m4: Do not put under dynamic conditions some code which
14080 expansion is under static control.
14081
14082 2003-03-29 Akim Demaille <akim@epita.fr>
14083
14084 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
14085
14086 2003-03-29 Akim Demaille <akim@epita.fr>
14087
14088 * doc/bison.texinfo (Strings are Destroyed): New.
14089
14090 2003-03-13 Paul Eggert <eggert@twinsun.com>
14091
14092 * .cvsignore: Add configure.lineno.
14093 * src/.cvsignore: Add yacc.
14094 * tests/.cvsignore: Add testsuite.log.
14095 * doc/fdl.texi: Sync with latest FSF version.
14096
14097 2003-03-12 Paul Eggert <eggert@twinsun.com>
14098
14099 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
14100 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
14101 cursor, instead of leaving it undefined. This fixes a bug
14102 reported by Tim Van Holder in
14103 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
14104 * tests/input.at (Torturing the Scanner): Test the scanner on
14105 an empty input file, which was Tim Van Holder's test case.
14106
14107 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
14108 <sys/resource.h> can be included, include sys/time.h and
14109 sys/times.h first, if available. This works around the SunOS
14110 4.1.4 porting bug reported by Bruce Becker in
14111 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
14112
14113 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
14114 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
14115 AC_HEADER_SYS_WAIT.
14116
14117 Merge changes from gnulib. This was prompted because the CVS
14118 snapshot didn't build on Solaris 7 due to strnlen problems.
14119
14120 These changes need to be merged back into gnulib:
14121 * lib/hash.c: Include <stdbool.h> unconditionally.
14122 * m4/onceonly.m4 (m4_quote): New macro.
14123 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
14124 Quote AC_FOREACH variable-expansions properly.
14125 The 2003-01-03 obstack.h change also needs merging.
14126 {end of changes requiring merging}
14127
14128 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
14129 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
14130 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
14131 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
14132 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
14133 New files, imported from gnulib.
14134 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
14135 above.
14136
14137 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
14138 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
14139 gnulib sources.
14140
14141 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
14142 Add.
14143 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
14144 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
14145 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
14146 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
14147 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
14148 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
14149 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
14150 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
14151 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
14152 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
14153 (jm_PREREQ_ARGMATCH): Remove.
14154 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
14155 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
14156
14157 * src/system.h: Include <stdbool.h> unconditionally.
14158
14159 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
14160 assuming at least C89 in the bitset code for some time now.
14161
14162 2003-03-03 Akim Demaille <akim@epita.fr>
14163
14164 * ro.po: New.
14165
14166 2003-03-02 Akim Demaille <akim@epita.fr>
14167
14168 * doc/bison.texinfo (Table of Symbols): Reactivate the
14169 documentation for %lex-param, and %parse-param.
14170
14171 2003-03-02 Akim Demaille <akim@epita.fr>
14172
14173 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
14174 generate verbose error messages.
14175 Use the number of tokens as an upper bound in yytname, as it
14176 cannot be a non terminal.
14177
14178 2003-03-02 Akim Demaille <akim@epita.fr>
14179
14180 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
14181 message.
14182
14183 2003-03-02 Akim Demaille <akim@epita.fr>
14184
14185 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
14186 Use them to exercise yycheck overrun.
14187 Based on Andrew Suffield's grammar.
14188
14189 2003-03-02 Akim Demaille <akim@epita.fr>
14190
14191 Create tests/local.at for Bison generic testing macros.
14192
14193 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
14194 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
14195 This new file.
14196 * tests/calc.at (AT_CHECK_CALC): Adjust.
14197 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
14198 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
14199 * tests/local.at: here.
14200 (AT_COMPILE_CXX): Tags the tests using it as c++.
14201 Ignore the test if CXX is not functional.
14202
14203 2003-03-01 Paul Eggert <eggert@twinsun.com>
14204
14205 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
14206 not loc->end, since loc->end might contain garbage and this leads
14207 to undefined behavior on some platforms.
14208 (id_loc, token_start): Use (IF_LINTed) initial values that do not
14209 depend on *loc, so that the reader doesn't give the the false
14210 impression that *loc is initialized.
14211 (<INITIAL>"%%"): Do not bother setting code_start, since its value
14212 does not survive the return.
14213
14214 2003-03-01 Akim Demaille <akim@epita.fr>
14215
14216 * src/scan-gram.l (code_start): Always initialize it when entering
14217 into yylex, as SC_EPILOGUE is activated *before* the corresponding
14218 yylex invocation. An alternative would be making it static, but
14219 then it starts with the second %%'s beginning, instead of its end.
14220
14221 2003-02-28 Paul Eggert <eggert@twinsun.com>
14222
14223 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
14224 around a UnixWare 7.1.1 porting bug reported by John Hughes in
14225 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
14226
14227 2003-02-26 Paul Eggert <eggert@twinsun.com>
14228
14229 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
14230 Remove Sequent/Pyramid discussion (nobody uses them any more).
14231 Merge VMS and MS-DOS discussion; these ports may well be dead
14232 but let's keep mentioning them for now. Put <> around email
14233 addresses. Add copyright notice.
14234
14235 2003-02-24 Paul Eggert <eggert@twinsun.com>
14236
14237 * data/glr.c (yy_reduce_print): yylineno -> yylno,
14238 to avoid collision with flex use of yylineno.
14239 Problem reported by Bruce Lilly in
14240 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
14241 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
14242 * data/yacc.c (yy_reduce_print): Likewise.
14243
14244 * config/depcomp: Sync with Automake 1.7.3.
14245
14246 2003-02-21 Akim Demaille <akim@epita.fr>
14247
14248 * data/lalr1.cc: Use temporary variables instead of casts to
14249 change integer types.
14250 Suggested by Paul Eggert.
14251
14252 2003-02-21 Akim Demaille <akim@epita.fr>
14253
14254 * doc/bison.texinfo: Use "location" consistently to refer to @n,
14255 to avoid confusions with lalr1.cc's notion of Position.
14256 Suggested by Paul Eggert.
14257
14258 2003-02-20 Akim Demaille <akim@epita.fr>
14259
14260 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
14261 before initial_columns.
14262 (location.hh): Use consistent variable names when defining the
14263 operator<<.
14264 Use "last" so that we subtract from Positions, not from unsigned.
14265
14266 2003-02-20 Akim Demaille <akim@epita.fr>
14267
14268 * data/lalr1.cc (position.hh): New subfile, including the extended
14269 and Doxygen'ed documentation of class Position.
14270 (location.hh): Use it.
14271 Document a` la Doxygen.
14272 With the help of Benoit Perrot.
14273
14274 2003-02-20 Akim Demaille <akim@epita.fr>
14275
14276 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
14277 AT_YACC_IF.
14278 Redefine AT_YYERROR_SEES_LOC_IF using it.
14279 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
14280 not defined.
14281 Don't use the location in yy::Parser::error_ and
14282 yy::Parser::print_ when not %locations.
14283 Activate more lalr1.cc tests.
14284
14285 2003-02-19 Akim Demaille <akim@epita.fr>
14286
14287 * data/lalr1.cc: When displaying a line number, be sure to make it
14288 an int.
14289
14290 2003-02-19 Akim Demaille <akim@epita.fr>
14291
14292 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
14293 Remove, useless.
14294 (YYABORT, YYACCEPT, YYERROR): New.
14295 * tests/calc.at: Renable the lalr1.cc test.
14296
14297 2003-02-19 Akim Demaille <akim@epita.fr>
14298
14299 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
14300 error recovery, mixing with/without pops and discarding of the
14301 lookahead.
14302 Exercise YYERROR.
14303 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
14304
14305 2003-02-17 Paul Eggert <eggert@twinsun.com>
14306
14307 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
14308 * tests/testsuite.at (AT_COMPILE): Use them.
14309 This fixes the testsuite problem reported by Robert Lentz in
14310 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
14311
14312 2003-02-12 Paul Eggert <eggert@twinsun.com>
14313
14314 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
14315 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
14316 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
14317 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
14318 Check for malloc failure, for consistency with yacc.c.
14319 (yytname_size): Remove, for consistency with yacc.c.
14320
14321 The bug still remains in data/lalr1.cc, as I didn't have time
14322 to fix it there.
14323
14324 2003-02-06 Akim Demaille <akim@epita.fr>
14325
14326 * configure.ac (GXX): Rename as...
14327 (CXX): this, to keep the original Autoconf semantics.
14328 Require 2.57.
14329 * data/lalr1.cc: Fix b4_copyright invocations.
14330 If YYDEBUG is not defined, don't depend upon name_ being defined.
14331 (location.hh): Include string and iostream.
14332 (Position::filename): New member.
14333 (Position::Position ()): New.
14334 (operator<< (Position)): New.
14335 (operator- (Position, int)): New.
14336 (Location::first, Location::last): Rename as...
14337 (Location::begin, Location::end): these, to mock the conventional
14338 iterator names.
14339 (operator<< (Location)): New.
14340 * tests/atlocal.in (CXX): New.
14341 * tests/testsuite.at (AT_COMPILE_CXX): New.
14342 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
14343 locations in a more synthetic way.
14344 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
14345 lalr1.cc is used.
14346 Adjust the C locations to match those from Emacs: first column is
14347 column 0.
14348 Change all the expected results.
14349 Conform to the GCS: simplify the locations when applicable.
14350 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
14351 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
14352 these CPP macros with the m4 macros new defined by...
14353 (AT_CHECK_PUSHDEFS): this, i.e.:
14354 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
14355 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
14356 New macros.
14357 (AT_CHECK_POPDEFS): Undefine them.
14358 (AT_CHECK_CALC_LALR1_CC): New.
14359 Use it for the first lalr1.cc test.
14360
14361 2003-02-04 Akim Demaille <akim@epita.fr>
14362
14363 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
14364 Location as is defined.
14365
14366 2003-02-04 Akim Demaille <akim@epita.fr>
14367
14368 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
14369 name_ being defined.
14370
14371 2003-02-03 Paul Eggert <eggert@twinsun.com>
14372
14373 * src/gram.h (start_symbol): Remove unused decl.
14374
14375 Use more-consistent naming conventions for local vars.
14376
14377 * src/derives.c (derives_compute): Change type of local var from
14378 int to rule_number.
14379 * src/gram.c (grammar_rules_partial_print): Likewise.
14380 * src/print.c (print_core): Likewise.
14381 * src/reduce.c (reduce_grammar_tables): Likewise.
14382
14383 * src/gram.c (grammar_dump): Change name of item_number *
14384 local var from r to rp.
14385 * src/nullable.c (nullable_compute): Likewise.
14386
14387 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
14388
14389 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
14390 for symbol or symbol_number var.
14391 * src/reader.c (grammar_start_symbol_set): Likewise.
14392 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
14393 Likewise.
14394 * src/state.c (transitions_to): Likewise.
14395 * src/state.h: Likewise.
14396 * src/tables.c (symbol_number_to_vector_number): Likewise.
14397
14398 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
14399 char * var.
14400
14401 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
14402 var.
14403
14404 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
14405 var.
14406
14407 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
14408 Use str, not s, for char * var. Use ch, not c, for character var.
14409 Use size for size var.
14410
14411 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
14412 char * var.
14413 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
14414 uniqstr var.
14415 * src/uniqstr.h: Likewise.
14416
14417 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
14418 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
14419 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
14420 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
14421 param to have same name as that of enum, so that we don't use
14422 "s" to stand for a non-state.
14423
14424 2003-02-02 Akim Demaille <akim@epita.fr>
14425
14426 * src/scan-skel.l: Scan more than one inert character per yylex
14427 invocation.
14428
14429 2003-02-01 Paul Eggert <eggert@twinsun.com>
14430
14431 Version 1.875a.
14432
14433 * po/LINGUAS: Add ms.
14434
14435 2003-01-30 Akim Demaille <akim@epita.fr>
14436
14437 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
14438
14439 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14440
14441 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
14442 of $1.
14443
14444 Changes in response to error report by S. Eken: GLR mode does not
14445 handle negative $ indices or $ indices in embedded rules correctly.
14446 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
14447
14448 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
14449 (b4_rhs_location): Ditto.
14450 (yyfill): New function to copy from stack tree into array
14451 incrementally.
14452 (yyuserAction): Modify to allow incremental move of semantic values
14453 to rhs array when in GLR mode.
14454 Define YYFILL to use in user-defined actions to fill semantic array
14455 as needed.
14456 Remove dummy use of yystack, as there is now a guaranteed use.
14457 (yydoAction): Modify to allow incremental move of semantic values
14458 to rhs array when in GLR mode.
14459 (yyresolveAction): Ditto.
14460 (yyglrShiftDefer): Update comment.
14461 (yyresolveStates): Use X == NULL for pointers, not !X.
14462 (yyglrReduce): Ditto.
14463 (yydoAction): Ditto
14464
14465 * tests/glr-regr1.at: Rename to ...
14466 * tests/glr-regression.at: Add new regression test for the problems
14467 described above (adapted from S. Eken).
14468 Update copyright notice.
14469 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
14470 * tests/Makefile.am: Ditto.
14471
14472 2003-01-28 Paul Eggert <eggert@twinsun.com>
14473
14474 * data/lalr1.cc: Do not use @output_header_name@ unless
14475 b4_defines_flag is set. This fixes two bugs reported by
14476 Tim Van Holder in
14477 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
14478 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
14479
14480 2003-01-21 Paul Eggert <eggert@twinsun.com>
14481
14482 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
14483 we don't need to worry about yyerrlab1 being reported as an
14484 "unused label" by non-GCC C compilers. The downside is that if
14485 locations are used then a couple of statements are duplicated each
14486 time YYERROR is invoked, but the upside is that the warnings
14487 should vanish.
14488 (yyerrlab1): Move code to YERROR.
14489 (yyerrlab2): Remove. Change uses back to yyerrlab1.
14490 This reverts some of the 2002-12-27 change.
14491
14492 2003-01-17 Paul Eggert <eggert@twinsun.com>
14493
14494 * src/output.c (symbol_printers_output): Fix typo that led
14495 to core dump. Problem reported by Antonio Rus in
14496 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
14497
14498 2003-01-13 Akim Demaille <akim@epita.fr>,
14499 Quoc Peyrot <chojin@lrde.epita.fr>,
14500 Robert Anisko <anisko_r@lrde.epita.fr>
14501
14502 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
14503 when the stacks contain one element, as the loop would otherwise
14504 free the last state, and then use the top state (the one we just
14505 popped). This means that the initial elements will not be freed
14506 explicitly, as is the case in yacc.c; it is not a problem, as
14507 these elements have fake values.
14508
14509 2003-01-11 Paul Eggert <eggert@twinsun.com>
14510
14511 * NEWS: %expect-violations are now just warnings, reverting
14512 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
14513 bootstrapping problem reported by Matthias Klose; see
14514 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
14515 * src/conflicts.c (conflicts_print): Likewise.
14516 * tests/conflicts.at (%expect not enough, %expect too much,
14517 %expect with reduce conflicts): Likewise.
14518 * doc/bison.texinfo (Expect Decl): Document this. Also mention
14519 that the warning is enabled if the number of conflicts changes
14520 (not necessarily increases).
14521
14522 * src/getargs.c (version): Update copyright year.
14523
14524 2003-01-09 Akim Demaille <akim@epita.fr>
14525
14526 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
14527
14528 2003-01-08 Paul Eggert <eggert@twinsun.com>
14529
14530 * Makefile.maint (WGETFLAGS):
14531 New macro, containing "-C off" to disable proxy caches.
14532 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
14533 (rel-check): Use $(WGET) instead of wget.
14534
14535 2003-01-06 Paul Eggert <eggert@twinsun.com>
14536
14537 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
14538 the GLR paper of Scott, Johnstone and Hussain.
14539
14540 2003-01-04 Paul Eggert <eggert@twinsun.com>
14541
14542 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
14543 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
14544 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
14545 (EXTRA_LIBRARIES): New var, for liby.a.
14546 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
14547 (EXTRA_SCRIPTS): New var, for yacc.
14548
14549 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
14550 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
14551 Problem reported by Nelson H. F. Beebe.
14552
14553 2003-01-03 Paul Eggert <eggert@twinsun.com>
14554
14555 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
14556 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
14557 when compiling Bison 1.875's `bitset bset = obstack_alloc
14558 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
14559
14560 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
14561 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
14562 grow to a huge size with typical invocation.
14563
14564 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
14565 Use the pattern recommended by Autoconf 2.57, except also protect
14566 against double-definition.
14567 * src/system.h: Likewise.
14568 Portability issues reported by Nelson H. F. Beebe.
14569
14570 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
14571 All uses changed. Provide a definition in both C and C++.
14572 (yytrue, yyfalse): Define even if defined (__cplusplus).
14573
14574 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
14575 Reported by Nelson H. F. Beebe.
14576
14577 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
14578
14579 2003-01-02 Paul Eggert <eggert@twinsun.com>
14580
14581 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
14582 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
14583 Bug reported by Nelson H. F. Beebe.
14584
14585 2003-01-01 Paul Eggert <eggert@twinsun.com>
14586
14587 * Version 1.875.
14588
14589 2002-12-30 Paul Eggert <eggert@twinsun.com>
14590
14591 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
14592 Moved here from...
14593 (<INITIAL>","): Here. This causes stray "," to be treated
14594 more uniformly.
14595
14596 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
14597 last brace in braced code when not in Yacc mode, for compatibility
14598 with Bison 1.35. This resurrects the 2001-12-15 patch to
14599 src/reader.c.
14600
14601 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
14602 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
14603
14604 2002-12-28 Paul Eggert <eggert@twinsun.com>
14605
14606 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
14607 that of SYM's type. This fixes Debian bug 168069, reported by
14608 Thomas Olsson.
14609
14610 2002-12-28 Paul Eggert <eggert@twinsun.com>
14611
14612 Version 1.75f.
14613
14614 Switch back to the Yacc style of conflict reports, undoing some
14615 of the 2002-07-30 change.
14616 * doc/bison.texinfo (Understanding): Use Yacc style for
14617 conflict reports. Also, use new way of locating rules.
14618 * src/conflicts.c (conflict_report):
14619 Renamed from conflict_report_yacc, removing the old
14620 'conflict_report'. Translate the entire conflict report at once,
14621 so that we don't assume that "," has the same interpretation in
14622 all languages.
14623 (conflicts_output): Use Yacc-style conflict report for each state,
14624 instead of our more-complicated style.
14625 (conflicts_print): Use Yacc-style conflict report, except print
14626 the input file name when not emulating Yacc.
14627 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
14628 Conflicted Reduction, %expect not enough, %expect too much,
14629 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
14630 * tests/existing.at (GNU Cim Grammar): Likewise.
14631 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
14632
14633 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
14634 fatal): Don't invoke fflush; it's not needed and it might even be
14635 harmful for stdout, as stdout might not be open.
14636 * src/reduce.c (reduce_print): Likewise.
14637
14638 2002-12-27 Paul Eggert <eggert@twinsun.com>
14639
14640 Fix a bug where error locations were not being recorded correctly.
14641 This problem was originally reported by Paul Hilfinger in
14642 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
14643
14644 * data/yacc.c (yyparse): New local var yylerrsp, to record the
14645 top of the location stack's error locations.
14646 (yyerrlab): Set it. When discarding a token, push its location
14647 onto yylerrsp so that we don't lose track of the error's end.
14648 (yyerrlab1): Now is only the target of YYERROR, so that we can
14649 properly record the location of the action that failed. For GCC
14650 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
14651 GCC warning about yyerrlab1 being unused if YYERROR is unused.
14652 (yyerrlab2): New label, which yyerrlab now falls through to.
14653 Compute the error's location by applying YYLLOC_DEFAULT to
14654 the locations of all the symbols that went into the error.
14655 * doc/bison.texinfo (Location Default Action): Mention that
14656 YYLLOC_DEFAULT is also invoked for syntax errors.
14657 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
14658 Error locations include the locations of all the tokens that were
14659 discarded, not just the last token.
14660
14661 2002-12-26 Paul Eggert <eggert@twinsun.com>
14662
14663 * src/files.c: Include quote.h.
14664 (compute_output_file_names): Warn if we detect conflicting
14665 outputs to the same file. This should catch the misunderstanding
14666 exemplified by Debian Bug 165349, reported by Bruce Stephens..
14667
14668 * src/conflicts.c (conflicts_print): If the user specifies
14669 "%expect N", report an error if there are any reduce/reduce
14670 conflicts. This is what the manual says should happen.
14671 This fixes Debian bug 130890, reported by Anthony DeRobertis.
14672 * tests/conflicts.at (%expect with reduce conflicts): New test.
14673
14674 Don't use m4_include on relative file names, as it doesn't work as
14675 desired if there happens to be a file with that name under ".".
14676
14677 * m4sugar/version.m4: Remove; it was included but it wasn't used.
14678 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
14679 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
14680 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
14681 * src/output.c (output_skeleton): Use full path names when
14682 specifying a file to include; don't rely on include path, as
14683 it's unreliable when the working file contains a file with
14684 that name.
14685
14686 2002-12-25 Paul Eggert <eggert@twinsun.com>
14687
14688 Remove obsolete references to bison.simple and bison.hairy.
14689 Problem mentioned by Aubin Mahe in
14690 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
14691 * data/glr.c: Comment fix.
14692 * doc/bison.1: Remove references. Also, mention "yacc".
14693
14694 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
14695 with -g option.
14696
14697 * src/parse-gram.y (declaration): Use enum "report_states" rather
14698 than its numeric value 1.
14699
14700 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
14701 opening a new one. This fixes Debian bug 165349, reported by
14702 Bruce Stephens.
14703
14704 2002-12-24 Paul Eggert <eggert@twinsun.com>
14705
14706 Version 1.75e.
14707
14708 * Makefile.maint (cvs-update): Don't assume that the shell
14709 supports $(...), as Solaris sh doesn't.
14710
14711 * src/parse-gram.y (lloc_default): Remove test for empty
14712 nonterminals at the end, since it didn't change the result.
14713
14714 2002-12-24 Paul Eggert <eggert@twinsun.com>
14715
14716 If the user does not define YYSTYPE as a macro, Bison now declares it
14717 using typedef instead of defining it as a macro. POSIX requires this.
14718 For consistency, YYLTYPE is also declared instead of defined.
14719
14720 %union directives can now have a tag before the `{', e.g., the
14721 directive `%union foo {...}' now generates the C code
14722 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
14723 The default union tag is `YYSTYPE', for compatibility with Solaris 9
14724 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
14725 instead of `yyltype'.
14726
14727 `yystype' and `yyltype' are now obsolescent macros instead of being
14728 typedefs or tags; they are no longer documented and will be
14729 withdrawn in a future release.
14730
14731 * data/glr.c (b4_location_type): Remove.
14732 (YYSTYPE): Renamed from yystype.
14733 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
14734 (struct YYLTYPE): Renamed from struct yyltype.
14735 (YYLTYPE): Renamed from yyltype.
14736 (yyltype, yystype): New (and obsolescent) macros,
14737 for backward compatibility.
14738 * data/yacc.c: Likewise.
14739
14740 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
14741 does not specify a union tag. This is for compatibility with
14742 Solaris 9 yacc.
14743
14744 * src/parse-gram.y (add_param): 2nd arg is now char * not char
14745 const *, since it is now modified by stripping surrounding { }.
14746 (current_braced_code): Remove.
14747 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
14748 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
14749 trailing " {...}". Now of type <chars>.
14750 (grammar_declaration): Adjust to bundled tokens.
14751 (code_content): Remove; stripping is now done by add_param.
14752 (print_token_value): Print contents of bundled tokens.
14753 (token_name): New function.
14754
14755 * src/reader.h (braced_code, current_braced_code): Remove.
14756 (token_name): New decl.
14757
14758 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
14759 token_type, not braced_code code_kind. All uses changed.
14760 (SC_PRE_CODE): New state, for scanning after a keyword that
14761 has (or usually has) an immediately-following braced code.
14762 (token_type): New local var, to keep track of which token type
14763 to return when scanning braced code.
14764 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
14765 <INITIAL>"%parse-param", <INITIAL>"%printer",
14766 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
14767 instead of returning a token type immediately.
14768 (<INITIAL>"{"): Set token type.
14769 (<SC_BRACED_CODE>"}"): Use it.
14770 (handle_action_dollar, handle_action_at): Now returns bool
14771 indicating success. Fail if ! current_rule; this prevents a core dump.
14772 (handle_symbol_code_dollar, handle_symbol_code_at):
14773 Remove; merge body into caller.
14774 (handle_dollar, handle_at): Complain in invalid contexts.
14775
14776 * NEWS, doc/bison.texinfo: Document the above.
14777 * NEWS: Fix years and program names in copyright notice.
14778
14779 2002-12-17 Paul Eggert <eggert@twinsun.com>
14780
14781 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
14782 Reporting, Table of Symbols): Omit mentions of %lex-param and
14783 %parse-param from the documentation for now.
14784
14785 2002-12-15 Paul Eggert <eggert@twinsun.com>
14786
14787 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
14788 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
14789 lookahead symbol, and which sets yychar in parser actions) and it
14790 disagreed with the Bison documentation. Bug
14791 reported by Andrew Walrond.
14792
14793 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
14794 as the caller now does that.
14795 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
14796 (YYEMPTY): Parenthesize right hand side, since others use it.
14797 (yyparse): Don't assume that our generated code is the only code
14798 that sets yychar.
14799
14800 2002-12-13 Paul Eggert <eggert@twinsun.com>
14801
14802 Version 1.75d.
14803
14804 POSIX requires a "yacc" command.
14805 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
14806 (MOSTLYCLEANFILES): Add yacc.
14807 (yacc): New rule.
14808 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
14809 as an alias for bison y.
14810
14811 * po/LINGUAS: Add da.
14812
14813 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
14814 problem with latest <getopt.h>.
14815 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
14816
14817 * doc/fdl.texi: Upgrade to 1.2.
14818 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
14819 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
14820 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
14821 gnulib.
14822 * config/install-sh: Sync with autotools.
14823
14824 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
14825 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
14826 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
14827 locations are requested.
14828 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
14829 locations are requested.
14830
14831 2002-12-12 Paul Eggert <eggert@twinsun.com>
14832
14833 Remove unportable casts and storage allocation tricks.
14834 While we're at it, remove almost all casts, since they
14835 usually aren't needed and are a sign of trouble.
14836
14837 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
14838
14839 * src/derives.c (derives_compute): Do not subtract NTOKENS from
14840 the pointer DSET returned by malloc; this isn't portable.
14841 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
14842 Similarly for DERIVES.
14843 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
14844 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
14845 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
14846
14847 * src/derives.c (derives_compute): Do not bother invoking
14848 int_of_rule_number, since rule numbers are integers.
14849
14850 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
14851 rather than XMALLOC (char, N).
14852
14853 * src/files.c (filename_split): Rewrite to avoid cast.
14854
14855 * src/gram.h (symbol_number_as_item_number,
14856 item_number_as_symbol_number, rule_number_as_item_number,
14857 item_number_as_rule_number):
14858 Now inline functions rather than macros, to avoid casts.
14859 * src/state.h (state_number_as_int): Likewise.
14860 * src/tables.c (state_number_to_vector_number,
14861 symbol_number_to_vector_number): Likewise.
14862
14863 * src/gram.h (int_of_rule_number): Remove; no longer used.
14864
14865 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
14866 since the resulting storage is always stored into.
14867
14868 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
14869 where it's needed.
14870
14871 * src/muscle_tab.c (muscle_m4_output):
14872 Now inline. Return bool, not int.
14873 * src/state.c (state_compare): Likewise.
14874 * src/symtab.c (symbol_check_defined,
14875 symbol_check_alias_consistency, symbol_pack, symbol_translation,
14876 hash_compare_symbol, hash_symbol):
14877 Likewise.
14878 * src/uniqstr.c (uniqstr_print): Likewise.
14879 * src/muscle_tab.c (muscle_m4_output_processor):
14880 New function, to avoid casts.
14881 * src/state.c (state_comparator, stage_hasher): Likewise.
14882 * src/symtab.c (symbol_check_defined_processor,
14883 symbol_check_alias_consistency_processor, symbol_pack_processor,
14884 symbol_translation_processor, hash_symbol_comparator,
14885 hash_symbol_hasher): Likewise.
14886 * src/uniqstr.c (uniqstr_print_processor): Likewise.
14887 * src/muscle_tab.c (muscles_m4_output):
14888 Use new functions instead of casting old functions unportably.
14889 * src/state.c (state_hash_new): Likewise.
14890 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
14891 symbols_token_translations_init):
14892 Likewise.
14893 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
14894
14895 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
14896 var instead of casting to long, to avoid casts.
14897 (prepare_states): Use MALLOC rather than alloca, so that we don't
14898 have to worry about alloca.
14899 * src/state.c (state_hash_lookup): Likewise.
14900
14901 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
14902 local var instead of casting to unsigned char, to avoid casts.
14903
14904 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
14905 STATE_ALLOC): Remove.
14906 (transitions_new, errs_new, reductions_new, state_new): Use malloc
14907 rather than calloc, and use offsetof to avoid allocating slightly
14908 too much storage.
14909 (state_new): Initialize all members.
14910
14911 * src/state.c (state_hash): Use unsigned accumulator, not signed.
14912
14913 * src/symtab.c (symbol_free): Remove; unused.
14914 (symbol_get): Remove cast in lhs of assignment.
14915 (symbols_do): Now static. Accept generic arguments, not
14916 hashing-related ones.
14917
14918 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
14919 (symbol_processor): Remove.
14920 (symbols_do): Remove decl; now static.
14921
14922 * src/system.h (alloca): Remove; decl no longer needed.
14923 (<stddef.h>): Include, for offsetof.
14924 (<inttypes.>, <stdint.h>): Include if available.
14925 (uintptr_t): New type, if system lacks it.
14926 (CALLOC, MALLOC, REALLOC): New macros.
14927 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
14928 new macros.
14929
14930 * src/tables.c (table_size): Now int, to pacify GCC.
14931 (table_grow, table_ninf_remap): Use signed table size.
14932 (save_row): Don't bother initializing locals when not needed.
14933 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
14934 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
14935
14936 * src/vcg.h: Correct misspellings.
14937
14938 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
14939
14940
14941 * src/getargs.c (getargs): Don't assume EOF == -1.
14942
14943 2002-12-09 Paul Eggert <eggert@twinsun.com>
14944
14945 Change identifier spellings to avoid collisions with names
14946 that are reserved by POSIX.
14947
14948 Don't use names ending in _t, since POSIX reserves them.
14949 For consistency, remove _e and _s endings -- they're weren't
14950 needed to remove ambiguity. All uses changed.
14951 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
14952 turn was just renamed from struniq_t.
14953 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
14954 which in turn was just renamed from struniq_processor_t.
14955 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
14956 in turn was renamed from hash_compare_struniq_t.
14957 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
14958 (state_list): Renamed from state_list_t.
14959 * src/assoc.h (assoc): Renamed from assoc_t.
14960 * src/conflicts.c (enum conflict_resolution): Renamed from
14961 enum conflict_resolution_e.
14962 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
14963 (rule_list): Renamed from rule_list_t.
14964 * src/getargs.h (enum trace): Renamed from enum trace_e.
14965 (enum report): Renamed from enum report_e.
14966 * src/gram.h (item_number): Renamed from item_number_t.
14967 (rule_number): Renamed from rule_number_t.
14968 (struct rule_s): Remove the "rule_s" part; not used.
14969 (rule): Renamed from rule_t.
14970 (rule_filter): Renamed from rule_filter_t.
14971 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
14972 (goto_list): Renamed from goto_list_t.
14973 * src/lalr.h (goto_number): Renamed from goto_number_t.
14974 * src/location.h (location): Renamed from location_t.
14975 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
14976 and moved here from:
14977 * src/muscle_tab.h (muscle_entry_t): here.
14978 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
14979 (rule_list): Renamed from rule_list_t.
14980 * src/print_graph.c (static_graph): Renamed from graph.
14981 * src/reader.h (braced_code): Renamed from braced_code_t.
14982 Remove brace_code_e tag.
14983 * src/relation.h (relation_node): Renamed from relation_node_t.
14984 (relation_nodes): Renamed from relation_nodes_t.
14985 (relation): Renamed from relation_t.
14986 * src/state.h (state_number): Renamed from state_number_t.
14987 (struct state): Renamed from struct state_s.
14988 (state): Renamed from state_t.
14989 (transitions): Renamed from transitions_t. Unused (and
14990 misspelled) transtion_s tag removed.
14991 (errs): Renamed from errs_t. Unused errs_s tag removed.
14992 (reductions): Renamed from reductions_t. Unused tag
14993 reductions_s removed.
14994 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
14995 (struct symbol_list): Renamed from struct symbol_list_s.
14996 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
14997 (struct symbol): Renamed from struct symbol_s.
14998 (symbol): Renamed from symbol_t.
14999 * src/tables.c (vector_number): Renamed from vector_number_t.
15000 (action_number): Renamed from action_t.
15001 * src/tables.h (base_number): Renamed from base_t.
15002 * src/vcg.h (enum color): Renamed from enum color_e.
15003 (enum textmode): Renamed from enum textmode_e.
15004 (enum shape): Renamed from enum shape_e.
15005 (struct colorentry): Renamed from struct colorentry_s.
15006 (struct classname): Renamed from struct classname_s.
15007 (struct infoname): Renamed from struct infoname_s.
15008 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
15009 (enum decision): Renamed from enum decision_e.
15010 (enum orientation): Renamed from enum orientation_e.
15011 (enum alignment): Renamed from enum alignment_e.
15012 (enum arrow_mode): Renamed from enum arrow_mode_e.
15013 (enum crossing_type): Renamed from enum crossing_type_e.
15014 (enum view): Renamed from enum view_e.
15015 (struct node): Renamed from struct node_s.
15016 (node): Renamed from node_t.
15017 (enum linestyle): Renamed from enum linestyle_e.
15018 (enum arrowstyle): Renamed from enum arrowstyle_e.
15019 (struct edge): Renamed from struct edge.
15020 (edge): Renamed from edge_t.
15021 (struct graph): Renamed from struct graph_s.
15022 (graph): Renamed from graph_t.
15023 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
15024 Rename value_t -> value.
15025 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
15026 value_t_as_yystype -> value_as_yystype.
15027
15028 Don't include <errno.h> in the mainstream code, since it
15029 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
15030 * lib/get-errno.c, lib/get-errno.h: New files.
15031 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
15032 get-errno.c.
15033 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
15034 * src/output.c (output_skeleton): Likewise.
15035 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
15036 instead of errno.
15037 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
15038 Likewise.
15039 (handle_action_dollar, handle_action_at): Likewise.
15040 * src/system.h: Do not include <errno.h>.
15041 (TAB_EXT): Renamed from EXT_TAB.
15042 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
15043
15044 Avoid str[a-z]*, since <string.h> reserves that name space.
15045 Change all instances of "struniq" in names to "uniqstr", and
15046 likewise for "STRUNIQ" and "UNIQSTR".
15047 * src/uniqstr.c: Renamed from src/struniq.c.
15048 * src/uniqstr.h: Renamed from src/struniq.h.
15049 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
15050 * src/files.c (strsuffix): Remove; unused.
15051 (concat2): Renamed from stringappend. Now static.
15052 * src/files.h (strsuffix, stringappend): Remove; unused.
15053 * src/parse-gram.y (<chars>): Renamed from <string>.
15054 (<uniqstr>): Renamed from <struniq>.
15055 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
15056 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
15057 (struct graph_s.expand): Renamed from struct graph_s.stretch.
15058 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
15059 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
15060 (N_EXPAND): Renamed from N_STRETCH.
15061
15062 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
15063 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
15064 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
15065 Remove; unused.
15066 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
15067 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
15068 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
15069 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
15070 (BASE_MAXIMUM): Renamed from BASE_MAX.
15071 (BASE_MINIMUM): Renamed from BASE_MIN.
15072 (ACTION_MAX): Remove; unused.
15073 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
15074 Unnecessary casts removed from above defines.
15075
15076
15077 Fix misspelling in names.
15078 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
15079 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
15080 G_NODE_ALIGNEMENT.
15081
15082
15083 * lib/timevar.c (timevar_report): Renamed from time_report,
15084 for consistency with other names.
15085 * lib/timevar.h (timevar_report): New decl.
15086 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
15087
15088
15089 Sort include-file uses.
15090
15091 Reorder all include files under src to be in the order "system.h".
15092 then the ../lib include files in angle brackets (alphabetized),
15093 then the . include files in double-quotes (alphabetized). Fix
15094 dependency breakages encountered in this process, as follows:
15095 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
15096 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
15097 * src/state.h: Include "symtab.h".
15098
15099 2002-12-08 Paul Eggert <eggert@twinsun.com>
15100
15101 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
15102 since this causes problems when __file__ contains character
15103 sequences like "@" that are treated specially by src/scan-skel.l.
15104 Instead, just use the file's basename. This fixes the bug
15105 reported by Martin Mokrejs in
15106 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
15107
15108 2002-12-06 Paul Eggert <eggert@twinsun.com>
15109
15110 Add support for rules that do not have trailing semicolons, as
15111 POSIX requires. Improve the quality of locations in Bison
15112 diagnostics.
15113
15114 * src/location.c: Include <quotearg.h>.
15115 (empty_location): Now const.
15116 (location_print): New function. Follow the recommendation of the
15117 GNU Coding Standards for locations that span file boundaries.
15118 * src/location.h: Do not include <quotearg.h>; no longer needed.
15119 (boundary): New type.
15120 (location_t): Use it. This allows locations to span file boundaries.
15121 All member uses changed: file -> start.file or end.file (as needed),
15122 first_line -> start.line, first_column -> start.column,
15123 last_line -> end.line, last_column -> end.column.
15124 (equal_boundaries): New function.
15125 (LOCATION_RESET, LOCATION_STEP): Remove.
15126 (LOCATION_PRINT): Remove. All callers changed to use location_print.
15127 (empty_location): Now const.
15128 (location_print): New decl.
15129 * src/parse-gram.y (lloc_default): New function, which handles
15130 empty locations more accurately.
15131 (YYLLOC_DEFAULT): Use it.
15132 (%token COLON): Remove.
15133 (%token ID_COLON): New token.
15134 (rules): Use it.
15135 (declarations, rules): Remove trailing semicolon.
15136 (declaration, rules_or_grammar_declaration):
15137 Allow empty (";") declaration.
15138 (symbol_def): Remove empty actions; no longer needed.
15139 (rules_or_grammar_declaration): Remove trailing semicolon.
15140 (semi_colon.opt): Remove.
15141 * src/reader.h: Include location.h.
15142 (scanner_cursor): New decl.
15143 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
15144 rolling our own.
15145 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
15146 of *loc.
15147 (STEP): Remove. No longer needed, now that adjust_location does
15148 the work. All uses removed.
15149 (scanner_cursor): New var.
15150 (adjust_location): Renamed from extend_location. It now sets
15151 *loc and adjusts the scanner cursor. All uses changed.
15152 Don't bother testing for CR.
15153 (handle_syncline): Remove location arg; now updates scanner cursor.
15154 All callers changed.
15155 (unexpected_end_of_file): Now accepts start boundary of token or
15156 comment, not location. All callers changed. Update scanner cursor,
15157 not the location.
15158 (SC_AFTER_IDENTIFIER): New state.
15159 (context_state): Renamed from c_context. All uses changed.
15160 (id_loc, code_start, token_start): New local vars.
15161 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
15162 processing of Yacc white space and equivalents here.
15163 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
15164 instead of returning ID immediately, since we need to search for
15165 a subsequent colon.
15166 (<INITIAL>"'", "\""): Save token_start.
15167 (<INITIAL>"%{", "{", "%%"): Save code_start.
15168 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
15169 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
15170 BEGIN context_state at end, not INITIAL.
15171 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
15172 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
15173 Return correct token start.
15174 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
15175 the start of a character, string or multiline comment is found.
15176 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
15177 Reduction): Adjust reported locations to match the more-precise
15178 results now expected.
15179 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
15180 * tests/reduce.at (Useless Rules, Reduced Automaton,
15181 Underivable Rules): Likewise.
15182 * tests/regression.at (Invalid inputs): No longer `expecting ";"
15183 or "|"' now that so many other tokens are allowed by the new grammar.
15184
15185 * src/complain.h (current_file): Remove duplicate decl;
15186 current_file is now owned by files.h.
15187 * src/complain.c, src/scan-gram.l: Include files.h.
15188
15189 2002-12-06 Paul Eggert <eggert@twinsun.com>
15190
15191 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
15192 promotes to int; it might be unsigned int.
15193 * data/yacc.c (yy_reduce_print): Likewise.
15194
15195 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
15196 be #defined in the prologue, not in the Bison declarations.
15197 This fixes Debian Bug 102878, reported by Shaul Karl.
15198
15199 2002-12-02 Paul Eggert <eggert@twinsun.com>
15200
15201 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
15202 * lib/strtoul.c: New file, from gnulib.
15203 This fixes a porting bug reported by Peter Klein in
15204 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
15205
15206 2002-11-30 Paul Eggert <eggert@twinsun.com>
15207
15208 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
15209 and put only a forward declaration in the prologue. This is for
15210 consistency with the other scanner helper functions.
15211
15212 Type clashes now generate warnings, not errors, since it
15213 appears that POSIX may allow some grammars with type clashes.
15214 * src/reader.c (grammar_current_rule_check): Warn about
15215 type clashes instead of complaining.
15216 * tests/input.at (Type Clashes): Expect warnings, not complaints.
15217
15218 Add Yacc library, since POSIX requires it.
15219 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
15220 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
15221 * lib/main.c, lib/yyerror.c: New files.
15222
15223 gram_error can be static; it need not be extern.
15224 * src/reader.h (gram_error): Remove decl.
15225 * src/parse-gram.y (gram_error): Now static. Add static decl.
15226 (print_token_value): Omit parameter names from forward decl,
15227 for consistency.
15228
15229 2002-11-29 Paul Eggert <eggert@twinsun.com>
15230
15231 * doc/bison.texinfo: Emphasize that yylex and yyerror must
15232 be declared before being used. E.g., one should typically
15233 declare them in the prologue. Use GNU coding style in examples.
15234 Put "const" consistently after the type it modifies. Mention
15235 that C99 supports "inline". Mention that yyerror traditionally
15236 returns "int".
15237
15238 %parse-param and %lex-param now take just one argument, the
15239 declaration; the argument name is deduced from the declaration.
15240
15241 * doc/bison.texinfo (Parser Function, Pure Calling, Error
15242 Reporting, Table of Symbols): Document this.
15243 * src/parse-gram.y (add_param): New function.
15244 (COMMA): Remove.
15245 (declaration): Implement new rule for %parse-param and %lex-param.
15246 * src/scan-gram.l: "," now elicits a warning, rather than being
15247 a token; this is more compatible with byacc.
15248 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
15249
15250 2002-11-27 Paul Eggert <eggert@twinsun.com>
15251
15252 Rename identifiers to avoid real and potential collisions.
15253
15254 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
15255 to avoid collision with lex macro described by Bruce Lilly in
15256 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
15257 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
15258 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
15259 * src/parse-gram.y (print_token_value): Renamed from yyprint.
15260 All uses changed.
15261 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
15262 The name "yycontrol" violates the name space rules, and this stuff
15263 wasn't being used anyway.
15264 (input): Remove action; this stuff wasn't being used.
15265 (gram_error): Rename local variable yylloc -> loc.
15266 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
15267 (YY_DECL): Don't use "yy" at start of local variables.
15268 All uses changed, e.g., yylloc -> loc.
15269 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
15270 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
15271 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
15272 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
15273
15274 * src/parse-gram.y (gram_error): loc is now const *.
15275 * src/reader.h (gram_error): Likewise.
15276
15277 2002-11-24 Paul Eggert <eggert@twinsun.com>
15278
15279 Version 1.75c.
15280
15281 * tests/actions.at (Actions after errors): Use an output format
15282 more similar to that of the Printers and Destructors test.
15283 Test the position of the ';' token too.
15284 (Printers and Destructors): Likewise.
15285 (Printers and Destructors: %glr-parser): Remove for now, to avoid
15286 unnecessarily alarming people when the test fails.
15287
15288 * data/yacc.c (yyerrlab1): Move this label down, so that the
15289 parser does not discard the lookahead token if the user code
15290 invokes YYERROR. This change is required for POSIX conformance.
15291
15292 * lib/error.c: Sync with gnulib.
15293
15294 2002-11-22 Paul Eggert <eggert@twinsun.com>
15295
15296 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
15297 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
15298 * lib/xmalloc.c: Likewise.
15299
15300 2002-11-20 Paul Eggert <eggert@twinsun.com>
15301
15302 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
15303
15304 2002-11-20 Paul Eggert <eggert@twinsun.com>
15305
15306 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
15307 should use `if (! x) abort ();' rather than `assert (x);', and
15308 anyway it's one less thing to worry about configuring.
15309
15310 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
15311 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
15312 and replace all instances of assert with abort.
15313 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
15314 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
15315
15316 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
15317 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
15318 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
15319 hash_find_entry, hash_rehash, hash_insert): Likewise.
15320 * src/conflicts.c (resolve_sr_conflict): Likewise.
15321 * src/lalr.c (set_goto_map, map_goto): Likewise.
15322 * src/nullable.c (nullable_compute): Likewise.
15323 * src/output.c (prepare_rules, token_definitions_output): Likewise.
15324 * src/reader.c (packgram, reader): Likewise.
15325 * src/state.c (state_new, state_free, state_transitions_set,
15326 state_reduction_find): Likewise.
15327 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
15328 symbol_pack): Likewise.
15329 * src/tables.c (conflict_row, pack_vector): Likewise.
15330 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
15331 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
15332 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
15333 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
15334
15335 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
15336 (ARGMATCH_CONSTRAINT): New macro.
15337 (ARGMATCH_ASSERT): Use it.
15338
15339 * src/system.h (verify): New macro.
15340 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
15341 rather than assert.
15342 * src/tables.c (tables_generate): Likewise.
15343
15344 * src/struniq.c (struniq_assert): Now returns void, and aborts
15345 if the assertion is false.
15346 (struniq_assert_p): Remove.
15347 * src/struniq.h: Likewise.
15348
15349 2002-11-18 Paul Eggert <eggert@twinsun.com>
15350
15351 * data/glr.c (yygetLRActions): Replace `yyindex' with
15352 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
15353 This fixes the regression with Sun ONE Studio 7 cc that I reported in
15354 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
15355
15356 2002-11-18 Akim Demaille <akim@epita.fr>
15357
15358 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
15359 space.
15360 From Tim Van Holder.
15361
15362 2002-11-17 Paul Eggert <eggert@twinsun.com>
15363
15364 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
15365 to "SyntaxError" for consistency with my 2002-11-15 change.
15366
15367 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
15368 not define to {}, since this breaks the common use of `YYDPRINTF
15369 ((...));' if a single statement is desired (e.g. before `else').
15370 Work around GCC warnings by surrounding corresponding calls with
15371 {} if needed.
15372 (yyhasResolvedValue): Remove unused function.
15373 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
15374 loop body.
15375 (yyreportSyntaxError): Renamed from yyreportParseError.
15376 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
15377 All uses changed.
15378 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
15379 extern when possible. Remove unused initializations.
15380
15381 2002-11-16 Akim Demaille <akim@epita.fr>
15382
15383 Augment the similarity between GLR and LALR traces.
15384
15385 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
15386 (YY_REDUCE_PRINT): New.
15387 (yyparse): Use them.
15388 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
15389 YYDPRINT here.
15390 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
15391 state reached after the reduction/recovery, since...
15392 (yyparse, yyprocessOneStack): Report the state we are entering in.
15393
15394 2002-11-16 Akim Demaille <akim@epita.fr>
15395
15396 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
15397 Add support for --trace=skeleton.
15398 * src/scan-skel.l: %option debug.
15399 Scan strings of non-@ or \n instead of character by character.
15400 (scan_skel): Handle trace_skeleton.
15401 (QPUTS): New.
15402 (@output_parser_name@, @output_header_name@): ``Restore'' their
15403 support (used to be M4 macros).
15404 * data/yacc.c: Quote larger chunks, a la glr.c.
15405 * data/lalr1.cc: Likewise.
15406 The header guards are no longer available, so use some other
15407 string than `YYLSP_NEEDED'.
15408
15409 2002-11-16 Akim Demaille <akim@epita.fr>
15410
15411 Make the ``Printers and Destructors'' test more verbose, taking
15412 `yacc.c''s behavior as (possibly wrong) reference.
15413
15414 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
15415 instead of fprint on stdout.
15416 Set and report the last_line of the symbols.
15417 Consistently display values and locations.
15418
15419 2002-11-16 Paul Eggert <eggert@twinsun.com>
15420
15421 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
15422
15423 2002-11-15 Paul Eggert <eggert@twinsun.com>
15424
15425 * tests/actions.at (Actions after errors): New test case.
15426
15427 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
15428 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
15429 tests/action.at, tests/calc.at, tests/conflicts.at,
15430 tests/cxx-type.at, tests/regression.at:
15431 "parse error" -> "syntax error" for POSIX compatibility.
15432 "parsing stack overflow..." -> "parser stack overflow" so
15433 that code matches Bison documentation.
15434
15435 2002-11-15 Akim Demaille <akim@epita.fr>
15436
15437 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
15438 take two BRACED_CODE, not two string_content.
15439 Free the scanner's obstack when we are done.
15440 (code_content): New.
15441 * tests/calc.at: Adjust.
15442 * doc/bison.texinfo: Adjust.
15443 Also, make sure to include the `,' for these declarations.
15444
15445 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
15446
15447 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
15448 definition; avoids potential autoreconf problems.
15449
15450 2002-11-15 Akim Demaille <akim@epita.fr>
15451
15452 Always check the value returned by yyparse.
15453
15454 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
15455 returned by yyparse.
15456 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
15457 Adjust calls.
15458 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
15459 returned by yyparse.
15460
15461 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15462
15463 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
15464 on input.at test.
15465
15466 2002-11-14 Paul Eggert <eggert@twinsun.com>
15467
15468 * src/output.c (output_skeleton): Call xfopen instead of
15469 duplicating xfopen's body.
15470
15471 Fix bugs reported by Nelson H. F. Beebe in
15472 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
15473
15474 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
15475 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
15476 Group compiler. Instead, use "$CC -E bar.c". Include the .h
15477 file twice in the grammar, as an extra check.
15478
15479 * tests/input.at (Torturing the Scanner): Surround the
15480 backslash-newline tests with "#if 0", to make it less likely that
15481 we'll run into compiler bugs. Bring back solitary \ inside
15482 comment, but add a closing comment to work around HP C bug. Don't
15483 test backslash-newline in C character constant.
15484
15485 2002-11-14 Akim Demaille <akim@epita.fr>
15486
15487 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
15488 status of the compiler.
15489 Calling `exit 1' is no longer needed.
15490 Reported by Nelson H. F. Beebe.
15491
15492 2002-11-14 Akim Demaille <akim@epita.fr>
15493
15494 * tests/atlocal.in (CPPFLAGS): We have config.h.
15495 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
15496 New.
15497 * tests/actions.at, tests/calc.at, tests/conflicts.at,
15498 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
15499 * tests/regression.at, tests/torture.at: Use them for all the
15500 grammars that are to be compiled.
15501 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
15502 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
15503 * doc/bison.texinfo (GLR Parsers): Document `inline'.
15504
15505 2002-11-14 Akim Demaille <akim@epita.fr>
15506
15507 * doc/bison.texinfo: Various formatting changes (alignments in
15508 samples, additional @group/@end group, GCS in samples.
15509 Use @deffn instead of simple @table to define the directives,
15510 macros, variables etc.
15511
15512 2002-11-13 Paul Eggert <eggert@twinsun.com>
15513
15514 Fix some bugs reported by Albert Chin-A-Young in
15515 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
15516
15517 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
15518 -o c"; the HP C compiler chatters during compilation.
15519 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
15520 * tests/headers.at (export YYLTYPE): Likewise.
15521
15522 * tests/input.at (Torturing the Scanner): Remove lines containing
15523 solitary backslashes, as they tickle a bug in the HP C compiler.
15524
15525 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
15526 comments, since they're not portable. Use GNU coding style.
15527
15528 2002-11-13 Akim Demaille <akim@epita.fr>
15529
15530 * data/yacc.c: Leave bigger chunks of quoted text.
15531 (YYDSYMPRINTF): New.
15532 Use it to report symbol activities.
15533 * data/glr.c (YYDSYMPRINTF): New.
15534 Use it.
15535
15536 2002-11-12 Paul Eggert <eggert@twinsun.com>
15537
15538 Version 1.75b.
15539
15540 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
15541 (yyglrReduce): Return yyok, not 0.
15542 This should avoid the enumerated-type warnings reported
15543 by Nelson H. F. Beebe in
15544 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
15545
15546 * lib/bbitset.h (BITSET_INLINE): Remove.
15547 * lib/bitset.h [! BITSET_INLINE]: Remove.
15548 (bitset_set, bitset_reset, bitset_test): Rename local vars
15549 to avoid shadowing warnings by GCC.
15550
15551 * data/glr.c (inline): Remove #define. It's the user's
15552 responsibility to #define it away, just like 'const'.
15553 This fixes one of the bugs reported by Nelson H. F. Beebe in
15554 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
15555
15556 * Makefile.maint (po-check): Scan .l and .y files instead of the
15557 .c and the .h files that they generate. This fixes the bug
15558 reported by Tim Van Holder in:
15559 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
15560 Look for N_ as well as for _. Try to avoid matching #define for
15561 N_ and _.
15562 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
15563 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
15564 * src/scan-gram.l: Revamp regular expressions so that " and '
15565 do not confuse xgettext.
15566
15567 * src/struniq.h (struniq_new): Do not declare the return type
15568 to be 'const'; this violates the C standard.
15569 * src/struniq.c (struniq_new): Likewise.
15570
15571 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
15572
15573 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
15574 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
15575 linker.
15576
15577 2002-11-12 Akim Demaille <akim@epita.fr>
15578
15579 * Makefile.maint: Sync with Autoconf:
15580 (local_updates): New.
15581
15582 2002-11-12 Akim Demaille <akim@epita.fr>
15583
15584 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
15585
15586 2002-11-12 Akim Demaille <akim@epita.fr>
15587
15588 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
15589 locations.
15590
15591 2002-11-12 Akim Demaille <akim@epita.fr>
15592
15593 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
15594 not yyvalue.
15595
15596 2002-11-12 Akim Demaille <akim@epita.fr>
15597
15598 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
15599 Use it to test the GLR parser.
15600
15601 2002-11-12 Akim Demaille <akim@epita.fr>
15602
15603 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
15604 defines it.
15605 * data/glr.c (yystos): New.
15606 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
15607 (YYDSYMPRINT): New.
15608 (yyval): Don't define it, it is handled via M4.
15609 (yyrecoverParseError): Free verbosely the discarded symbols.
15610 * data/yacc.c (yysymprint): Remove, rather...
15611 (b4_yysymprint_generate): invoke.
15612 * data/c.m4 (b4_yysymprint_generate): New.
15613 Accept pointers as arguments, as opposed to the version from
15614 yacc.c.
15615 (b4_yydestruct_generate): Likewise.
15616 * tests/cations.at (Printers and Destructors): Use Bison directives
15617 instead of CPP macros.
15618 Don't rely on internal details.
15619
15620 2002-11-12 Akim Demaille <akim@epita.fr>
15621
15622 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
15623 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
15624 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
15625 it against YYEMPTY and so forth), work on yytoken (i.e., set
15626 it to YYEMPTY etc.).
15627 (yydestruct): Replace with a b4_yydestruct_generate invocation.
15628 (b4_symbol_actions): Remove.
15629 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
15630 for 0, end-of-input.
15631
15632 2002-11-12 Akim Demaille <akim@epita.fr>
15633
15634 * doc/bison.texinfo (Destructor Decl): New.
15635
15636 2002-11-12 Akim Demaille <akim@epita.fr>
15637
15638 * src/tables.c (tables_generate): Use free for pointers that
15639 cannot be NULL, not XFREE.
15640 (pack_vector): Use assert, not fatal, for bound violations.
15641 * src/state.c (state_new): Likewise.
15642 * src/reader.c (reader): Likewise.
15643 * src/lalr.c (set_goto_map): Likewise.
15644 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
15645 the file name.
15646
15647 2002-11-12 Akim Demaille <akim@epita.fr>
15648
15649 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
15650 Restore.
15651 * src/scan-gram.l (last_string): Is global to the file, not to
15652 yylex.
15653 * src/parse-gram.y (input): Don't append the epilogue here,
15654 (epilogue.opt): do it here, and free the scanner's obstack.
15655 * src/reader.c (epilogue_set): Rename as...
15656 (epilogue_augment): this.
15657 * data/c.m4 (b4_epilogue): Defaults to empty.
15658
15659 2002-11-12 Akim Demaille <akim@epita.fr>
15660
15661 * src/getargs.c (long_options): Remove duplicates.
15662 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
15663 Remove.
15664 * doc/bison.rnh: Remove.
15665 * doc/bison.texinfo (VMS Invocation): Remove.
15666
15667 2002-11-12 Akim Demaille <akim@epita.fr>
15668
15669 * src/struniq.h, src/struniq.c (struniq_t): Is const.
15670 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
15671
15672 Use struniq for symbols.
15673
15674 * src/symtab.h (symbol_t): The tag member is a struniq.
15675 (symbol_type_set): Adjust.
15676 * src/symtab.c (symbol_new): Takes a struniq.
15677 (symbol_free): Don't free the tag member.
15678 (hash_compare_symbol_t, hash_symbol_t): Rename as...
15679 (hash_compare_symbol, hash_symbol): these.
15680 Use the fact that tags as struniqs.
15681 (symbol_get): Use struniq_new.
15682 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
15683 Returns a strniq.
15684 * src/reader.h (merger_list, grammar_currentmerge_set): The name
15685 and type members are struniqs.
15686 * src/reader.c (get_merge_function)
15687 (grammar_current_rule_merge_set): Adjust.
15688 (TYPE, current_type): Are struniq.
15689
15690 Use struniq for file names.
15691
15692 * src/files.h, src/files.c (infile): Split into...
15693 (grammar_file, current_file): these.
15694 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
15695 * src/reduce.c (reduce_print): Likewise.
15696 * src/getargs.c (getargs): Likewise.
15697 * src/complain.h, src/complain.c: Likewise.
15698 * src/main.c (main): Call struniqs_new early enough to use it for
15699 file names.
15700 Don't free the input file name.
15701
15702 2002-11-12 Akim Demaille <akim@epita.fr>
15703
15704 * src/symtab.c (symbol_free): Remove dead deactivated code:
15705 type_name are properly removed.
15706 Don't use XFREE to free items that cannot be NULL.
15707 * src/struniq.h, src/struniq.c: New.
15708 * src/main.c (main): Initialize/free struniqs.
15709 * src/parse-gram.y (%union): Add astruniq member.
15710 (yyprint): Adjust.
15711 * src/scan-gram.l (<{tag}>): Return a struniq.
15712 Free the obstack bit that used to store it.
15713 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
15714
15715 2002-11-11 Paul Eggert <eggert@twinsun.com>
15716
15717 Revamp to fix many (but not all) of the C- and M4-related quoting
15718 problems. Among other things, this fixes the Bison bug reported
15719 by Jan Hubicka when processing the Bash grammar; see:
15720 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
15721
15722 Use new @ escapes consistently. Represent brackets with @{ and @}
15723 rather than @<:@ and @:>@, since this works a bit better with dumb
15724 editors like vi. Represent @ with @@, since @ is now consistently
15725 an escape. Use @oline@ and @ofile@ rather than __oline__ and
15726 __ofile__, to avoid unexpected expansions. Similarly, use @output
15727 rather than #output.
15728
15729 * data/c.m4 (b4_copyright): Omit file name from comment, since
15730 the file name could contain "*/".
15731 (b4_synclines_flag): Don't quote the 2nd argument; it should already
15732 be quoted. All uses changed.
15733
15734 * data/glr.c: Use new @ escapes consistently.
15735 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
15736 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
15737 Remove, since they couldn't handle arbitrary characters in file
15738 names.
15739 * data/lalr1.cc: Likewise.
15740 * data/yacc.c: Likewise.
15741
15742 * src/files.c (output_infix): Remove; all uses removed.
15743 * src/files.h: Likewise.
15744
15745 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
15746 mishandled funny characters in file names, and anyway it isn't
15747 needed any more.
15748 * data/yacc.c: Likewise.
15749 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
15750
15751 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
15752 * data/yacc.c: Likewise.
15753
15754 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
15755 strings now.
15756 (muscle_init): Quote filename as a C string.
15757 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
15758 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
15759 * src/output.c (escaped_file_name_output): New function.
15760 (prepare_symbols): Quote tokens for M4.
15761 (prepare): Don't insert output_infix, output_prefix,
15762 output_parser_name, output_header_name; this is now down by scan-skel.
15763 Insert skeleton as a C string.
15764
15765 * src/output.c (user_actions_output, symbol_destructors_output,
15766 symbol_printers_output): Quote filenames for C and M4.
15767 * src/reader.c (prologue_augment, epilogue_set): Likewise.
15768
15769 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
15770 escapes other than \\ and \'; this simplifies the code.
15771 (<SC_STRING>): Likewise, for \\ and \".
15772 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
15773 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
15774 Use new escapes @{ and @} for [ and ].
15775
15776 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
15777 them with auto vars.
15778 Switch to new escape scheme, where @ is the escape character uniformly.
15779 Abort if a stray escape character is found. Avoid unbounded input
15780 buffer when parsing non-escaped text.
15781
15782 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
15783 __oline__, #output, $@, and @{ do not have unintended meanings.
15784
15785 2002-11-09 Paul Eggert <eggert@twinsun.com>
15786
15787 Fix the test failure due to GCC warnings described in
15788 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
15789 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
15790 evaluate to 0 if it's impossible for NINF to be in the respective
15791 table.
15792 (yygetLRActions, yyrecoverParseError): Use them.
15793
15794 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
15795 counted in the token inserted at end of file. Now takes
15796 location_t *, not location_t, so that the location can be
15797 adjusted. All uses changed.
15798
15799 * tests/regression.at (Invalid inputs): Adjust wording in
15800 diagnostic to match the new behavior.
15801
15802 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
15803 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
15804 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
15805 abort ();'. This reduces the runtime of the "Many lookaheads"
15806 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
15807 GCC 3.2.
15808
15809 2002-11-07 Paul Eggert <eggert@twinsun.com>
15810
15811 * src/parse-gram.y (CHARACTER): Remove unused token.
15812 All uses removed.
15813
15814 * src/scan-gram.l: Remove stack option. We no longer use the
15815 stack, since the stack was never deeper than 1; instead, use the
15816 new auto var c_context to record the stacked value.
15817
15818 Remove nounput option. At an unexpected end of file, we now unput
15819 the minimal input necessary to end cleanly; this simplifies the
15820 code.
15821
15822 Avoid unbounded token sizes where this is easy.
15823
15824 (unexpected_end_of_file): New function.
15825 Use it to systematize the error message on unexpected EOF.
15826 (last-string): Now auto, not static.
15827 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
15828 (scanner_last_string_free): Remove; not used.
15829 (percent_percent_count): Move decl to just before use.
15830 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
15831 not the (never otherwised-used) CHARACTER.
15832
15833 2002-11-07 Akim Demaille <akim@epita.fr>
15834
15835 Let yyerror always receive the msg as last argument, so that
15836 yyerror can be variadic.
15837
15838 * data/yacc.c (b4_yyerror_args): New.
15839 Use it when calling yyerror.
15840 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
15841 Use it when calling yyerror.
15842 * doc/bison.texinfo (Error Reporting): Adjust.
15843 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
15844 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
15845
15846 2002-11-06 Akim Demaille <akim@epita.fr>
15847
15848 #line should have quoted strings.
15849 Ideally, this should be done by m4_quotearg.
15850
15851 * src/scan-skel.l: Include quotearg.h.
15852 Quote __ofile__.
15853 * src/output.c (symbol_printers_output)
15854 (symbol_destructors_output): Quote the file name.
15855
15856 2002-11-06 Akim Demaille <akim@epita.fr>
15857
15858 * tests/regression.at (Invalid inputs): Adjust to the recent
15859 messages.
15860
15861 2002-11-06 Akim Demaille <akim@epita.fr>
15862
15863 Restore --no-lines.
15864 Reported by Jim Kent.
15865
15866 * data/c.m4 (b4_syncline): New.
15867 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
15868 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
15869 * src/output.c (user_actions_output): Likewise.
15870 (prepare): Define 'b4_synclines_flag'.
15871 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
15872
15873 2002-11-06 Akim Demaille <akim@epita.fr>
15874
15875 * src/main.c (main): Free `infile'.
15876 * src/scan-gram.l (handle_syncline): New.
15877 Recognize `#line'.
15878 * src/output.c (user_actions_output, symbol_destructors_output)
15879 (symbol_printers_output): Use the location's file name, not
15880 infile.
15881 * src/reader.c (prologue_augment, epilogue_set): Likewise.
15882
15883 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15884
15885 * src/tables.c (matching_state): Don't allow states to match if
15886 either has GLR conflict entries.
15887
15888 2002-11-05 Paul Eggert <eggert@twinsun.com>
15889
15890 * src/scan-gram.l: Use more accurate diagnostics, e.g.
15891 "integer out of range" rather than "invalid value".
15892 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
15893 accordingly.
15894
15895 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
15896 Also, remove one static variable in the scanner.
15897
15898 * src/scan-gram.l (braces_level): Now auto, not static.
15899 Initialize to zero if the compiler is being picky.
15900 (INITIAL): Clear braces_level instead of incrementing it.
15901 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
15902 as POSIX 1003.1-2001 requires.
15903 * src/system.h (IF_LINT): New macro, taken from coreutils.
15904 * configure.ac: Define "lint" if --enable-gcc-warnings.
15905
15906 2002-11-05 Akim Demaille <akim@epita.fr>
15907
15908 * src/scan-gram.l: When it starts with `%', complain about the
15909 whole directive, not just that `invalid character: %'.
15910
15911 2002-11-04 Akim Demaille <akim@epita.fr>
15912
15913 * Makefile.maint: Update from Autoconf.
15914 (update, cvs-update, po-update, do-po-update): New.
15915
15916 2002-11-04 Akim Demaille <akim@epita.fr>
15917
15918 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
15919 and yyerror.
15920 Have yyerror `use' its arguments.
15921 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
15922 returns true when location & yacc & pure & parse-param.
15923 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
15924
15925 2002-11-04 Akim Demaille <akim@epita.fr>
15926
15927 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
15928 clashes.
15929 * src/scan-gram.l: Use [\'] instead of ['] to pacify
15930 font-lock-mode.
15931 Use complain_at.
15932 Use quote, not quote_n since LOCATION_PRINT no longer uses the
15933 slot 0.
15934
15935 2002-11-03 Paul Eggert <eggert@twinsun.com>
15936
15937 * src/reader.c (get_merge_function, grammar_current_rule_check):
15938 Use consistent diagnostics for reporting type name clashes.
15939 Quote the types with <>, for consistency with Yacc.
15940 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
15941
15942 2002-11-03 Akim Demaille <akim@epita.fr>
15943
15944 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
15945 New.
15946 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
15947 (b4_parse_param): Remove.
15948 Use b4_identification.
15949 Propagate b4_pure_args where needed to pass them to yyerror.
15950 * data/glr.m4 (b4_parse_param): Remove.
15951 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
15952 (b4_lpure_formals): New.
15953 Use b4_identification.
15954 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
15955 b4_user_formals and b4_user_args.
15956 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
15957 (yyreportAmbiguity): When using a pure parser, also need
15958 the location, and the parse-params.
15959 Adjust callers.
15960 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
15961 When using a pure parser, also need the parse-params.
15962 Adjust callers.
15963 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
15964 (%pure-parser + %parse-param) LALR and GLR parsers.
15965 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
15966 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
15967 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
15968 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
15969 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
15970 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
15971 * doc/bison.texinfo: Untabify the whole file.
15972 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
15973 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
15974 (Error Reporting): Adjust to these new directives.
15975 Document %error-verbose, deprecate YYERROR_VERBOSE.
15976
15977 2002-11-03 Akim Demaille <akim@epita.fr>
15978
15979 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
15980 AT_CHECK_CALC_GLR invocations to use % directives, instead of
15981 command line options.
15982 * tests/cxx-type.at: Formatting changes.
15983
15984 2002-11-03 Paul Eggert <eggert@twinsun.com>
15985
15986 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
15987 to count columns correctly, and to check for invalid inputs.
15988
15989 Use mbsnwidth to count columns correctly. Account for tabs, too.
15990 Include mbswidth.h.
15991 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
15992 (extend_location): New function.
15993 (YY_LINES): Remove.
15994
15995 Handle CRLF in C code rather than in Lex code.
15996 (YY_INPUT): New macro.
15997 (no_cr_read): New function.
15998
15999 Scan UCNs, even though we don't fully handle them yet.
16000 (convert_ucn_to_byte): New function.
16001
16002 Handle backslash-newline correctly in C code.
16003 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
16004 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
16005 all uses changed.
16006 (tag, splice): New EREs. Do not allow NUL or newline in tags.
16007 Use {splice} wherever C allows backslash-newline.
16008 YY_STEP after space, newline, vertical-tab.
16009 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
16010
16011 (letter, id): Don't assume ASCII; e.g., spell out a-z.
16012
16013 ({int}, handle_action_dollar, handle_action_at): Check for integer
16014 overflow.
16015
16016 (YY_STEP): Omit trailing semicolon, so that it's more like C.
16017
16018 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
16019 as well as \000. Check for UCHAR_MAX, not 255.
16020 Allow \x with an arbitrary positive number of digits, as in C.
16021 Check for overflow here.
16022 Allow \? and UCNs, for compatibility with C.
16023
16024 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
16025 with quote slot used by complain_at.
16026
16027 * tests/input.at: Add tests for backslash-newline, m4 quotes
16028 in symbols, long literals, and funny escapes in strings.
16029
16030 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
16031 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
16032 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
16033 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
16034 * m4/mbswidth.m4: New file, from GNU coreutils.
16035
16036 * doc/bison.texinfo (Grammar Outline): Document // comments.
16037 (Symbols): Document that trigraphs have no special meaning in Bison,
16038 nor is backslash-newline allowed.
16039 (Actions): Document that trigraphs have no special meaning.
16040
16041 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
16042 no longer used.
16043
16044 2002-11-02 Paul Eggert <eggert@twinsun.com>
16045
16046 * src/reader.c: Don't include quote.h; not needed.
16047 (get_merge_function): Reword warning to be consistent with
16048 type clash diagnostic in grammar_current_rule_check.
16049
16050 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
16051 bug in trigraph handling.
16052
16053 * src/output.c (prepare_symbols): When printing token names,
16054 escape "[" as "@<:@" and likewise for "]".
16055
16056 * src/system.h (errno): Remove declaration, as we are now
16057 assuming C89 or better, and C89 guarantees errno.
16058
16059 2002-10-30 Paul Eggert <eggert@twinsun.com>
16060
16061 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
16062 Check for close failures.
16063 * src/files.h (xfclose): Return void, not int, since it always
16064 returned zero.
16065 * src/files.c (xfclose): Likewise. Report I/O error if ferror
16066 indicates one.
16067 * src/output.c (output_skeleton): Use xfclose rather than fclose
16068 and ferror. xfclose now checks ferror.
16069
16070 * data/glr.c (YYLEFTMOST_STATE): Remove.
16071 (yyreportTree): Use a stack-based leftmost state. This avoids
16072 our continuing battles with bogus warnings about initializers.
16073
16074 2002-10-30 Akim Demaille <akim@epita.fr>
16075
16076 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
16077 #if.
16078
16079 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16080
16081 * tests/glr-regr1.at: New test for reported regressions.
16082 * tests/testsuite.at: Add glr-regr1.at test.
16083 * tests/Makefile.am: Add glr-regr1.at test.
16084
16085 2002-10-24 Paul Eggert <eggert@twinsun.com>
16086
16087 Version 1.75a.
16088
16089 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
16090 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
16091 we use malloc. Don't assume 'A' through 'Z' are contiguous.
16092 Don't assume strdup exists; POSIX says its an XSI extension.
16093 Check for buffer overflow on input.
16094
16095 2002-10-24 Akim Demaille <akim@epita.fr>
16096
16097 * src/output.c (output_skeleton): Don't disable M4sugar comments
16098 too soon: it results in comments being expanded.
16099 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
16100 first output.
16101
16102 2002-10-24 Akim Demaille <akim@epita.fr>
16103
16104 * data/yacc.c (m4_int_type): New.
16105 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
16106 char' as only yacc.c wants K&R portability.
16107 * data/glr.c (yysigned_char): Remove.
16108 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
16109 Reported by Quoc Peyrot.
16110
16111 2002-10-23 Paul Eggert <eggert@twinsun.com>
16112
16113 * src/main.c (main): With --trace=time, report times even if a
16114 non-fatal error occurs. Formerly, the times were reported in some
16115 such cases but not in others.
16116 * src/reader.c (reader): Just return if a complaint has been issued,
16117 instead of exiting, so that 'main' can report times.
16118
16119 2002-10-22 Akim Demaille <akim@epita.fr>
16120
16121 * src/system.h: Include sys/types.
16122 Reported by Bert Deknuydt.
16123
16124 2002-10-23 Paul Eggert <eggert@twinsun.com>
16125
16126 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
16127 Suggested by Art Haas.
16128
16129 2002-10-22 Paul Eggert <eggert@twinsun.com>
16130
16131 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
16132 decl; not needed any more.
16133 * src/main.c (main): Use return to exit, undoing yesterday's change.
16134 The last OS that we could find where this wouldn't work is
16135 SunOS 3.5, and that's too old to worry about now.
16136
16137 * data/glr.c (struct yyltype): Define members even when not
16138 doing locations. This is more consistent with yacc.c, and it
16139 works around the following bug reports:
16140 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
16141 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
16142
16143 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
16144 @acronym consistently. Standardize on "Yacc" instead of "YACC",
16145 "Algol" instead of "ALGOL". Give a bit more history about BNF.
16146
16147 2002-10-22 Akim Demaille <akim@epita.fr>
16148
16149 * data/README: New.
16150
16151 2002-10-21 Paul Eggert <eggert@twinsun.com>
16152
16153 Be consistent about 'bool'; the old code used an enum in one
16154 module and an int in another, and this violates the C standard.
16155 * m4/stdbool.m4: New file, from coreutils 4.5.3.
16156 * configure.ac (AC_HEADER_STDBOOL): Add.
16157 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
16158 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
16159 * src/symtab.c (hash_compare_symbol_t): Likewise.
16160 * src/system.h (bool, false, true): Use a definition consistent
16161 with ../lib/hash.c. All uses changed.
16162
16163 * src/complain.c (warning_issued): Renamed from warn_message_count,
16164 so that we needn't worry about integer overflow (!).
16165 Now of type bool. All uses changed.
16166 (complaint_issued): Renamed from complain_message_count; likewise.
16167
16168 * src/main.c (main): Use exit to exit with failure.
16169
16170 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
16171 rather than 1 and 0.
16172 * src/main.c (main): Likewise.
16173 * src/getargs.c (getargs): Likewise.
16174 * src/reader.c (reader): Likewise.
16175
16176 * src/getarg.c (getargs): Remove duplicate code for
16177 "Try `bison --help'".
16178
16179 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
16180 What was that "2" for?
16181
16182 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
16183 * src/getargs.c (usage): Likewise.
16184
16185 * src/getargs.c (getargs): When there are too few operands, report
16186 the last one. When there are too many, report the first extra
16187 one. This is how diffutils does it.
16188
16189 2002-10-20 Paul Eggert <eggert@twinsun.com>
16190
16191 Remove K&R vestiges.
16192 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
16193 * src/complain.c (VA_START): Remove. Assume prototypes.
16194 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
16195 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
16196 fatal): Assume prototypes.
16197 * src/complain.h: Assume prototypes.
16198 * src/system.h (PARAMS): Remove.
16199 Include <limits.h> unconditionally, since it's guaranteeed even
16200 for a freestanding C89 compiler.
16201 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
16202 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
16203
16204 2002-10-20 Akim Demaille <akim@epita.fr>
16205
16206 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
16207 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
16208 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
16209 (yyresolveStates, yyresolveAction, yyresolveStack)
16210 (yyprocessOneStack): Use them.
16211 (yy_reduce_print): New.
16212 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
16213
16214 2002-10-20 Akim Demaille <akim@epita.fr>
16215
16216 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
16217 arguments and output `void'.
16218 (b4_c_function): Rename as...
16219 (b4_c_function_def): this.
16220 (b4_c_function_decl, b4_c_ansi_function_def)
16221 (b4_c_ansi_function_decl): New.
16222 Change the interpretation of the arguments: before `int, foo', now
16223 `int foo, foo'.
16224 * data/yacc.c (yyparse): Prototype and define thanks to these.
16225 Adjust b4_c_function_def uses.
16226 * data/glr.c (yyparse): Likewise, but ANSI only.
16227
16228 2002-10-20 Akim Demaille <akim@epita.fr>
16229
16230 * src/output.c (prepare): Move the definition of `tokens_number',
16231 `nterms_number', `undef_token_number', `user_token_number_max'
16232 to...
16233 (prepare_tokens): Here.
16234 (prepare_tokens): Rename as...
16235 (prepare_symbols): this.
16236 (prepare): Move the definition of `rules_number' to...
16237 (prepare_rules): here.
16238 (prepare): Move the definition of `last', `final_state_number',
16239 `states_number' to...
16240 (prepare_states): here.
16241 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
16242
16243 2002-10-20 Akim Demaille <akim@epita.fr>
16244
16245 * src/tables.h, src/tables.c, src/output.c: Comment changes.
16246
16247 2002-10-20 Akim Demaille <akim@epita.fr>
16248
16249 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
16250 * data/c.m4: here.
16251
16252 2002-10-20 Akim Demaille <akim@epita.fr>
16253
16254 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
16255 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
16256 `pair'.
16257 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
16258 `name' to...
16259 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
16260 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
16261 These.
16262
16263 2002-10-19 Paul Eggert <eggert@twinsun.com>
16264
16265 Do not create a temporary file, as that involves security and
16266 cleanup headaches. Instead, use a pair of pipes.
16267 Derived from a suggestion by Florian Krohm.
16268 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
16269 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
16270 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
16271 (BISON_PREREQ_SUBPIPE): Add.
16272 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
16273 Add subpipe.h, subpipe.c.
16274 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
16275 * po/POTFILES.in: Add lib/subpipe.c.
16276 * src/output.c: Include "subpipe.h".
16277 (m4_invoke): Remove decl.
16278 (scan_skel): New decl.
16279 (output_skeleton): Use pipe rather than temporary file for m4 input.
16280 Check that m4sugar.m4 is readable, to avoid deadlock.
16281 Check for pipe I/O error.
16282 * src/scan-skel.l (readpipe): Remove decl.
16283 (scan_skel): New function, to be used in place of m4_invoke.
16284 Read from stream rather than file.
16285
16286 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
16287 float, as this generates a warning on Solaris 8 + GCC 3.2 with
16288 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
16289 this generates a more-accurate value anyway.
16290
16291 * lib/timevar.c (timervar_accumulate): Rename locals to
16292 avoid confusion with similarly-named more-global.
16293 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
16294
16295 * src/output.c (prepare): Use xstrdup to convert char const *
16296 to char *, to avoid GCC warning.
16297
16298 2002-10-19 Akim Demaille <akim@epita.fr>
16299
16300 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
16301 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
16302 Use them to have `calc.y' ready for %pure-parser.
16303 * data/yacc.c (YYLEX): Pass a yylex return type to
16304 b4_c_function_call.
16305
16306 2002-10-19 Akim Demaille <akim@epita.fr>
16307
16308 Prototype support of %lex-param and %parse-param.
16309
16310 * src/parse-gram.y: Add the definition of the %lex-param and
16311 %parse-param tokens, plus their rules.
16312 Drop the `_' version of %glr-parser.
16313 Add the "," token.
16314 * src/scan-gram.l (INITIAL): Scan them.
16315 * src/muscle_tab.c: Comment changes.
16316 (muscle_insert, muscle_find): Rename `pair' as `probe'.
16317 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
16318 (muscle_entry_s): The `value' member is no longer const.
16319 Adjust all dependencies.
16320 * src/muscle_tab.c (muscle_init): Adjust: use
16321 MUSCLE_INSERT_STRING.
16322 Initialize the obstack earlier.
16323 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
16324 (muscle_pair_list_grow): New.
16325 * data/c.m4 (b4_c_function_call, b4_c_args): New.
16326 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
16327 * tests/calc.at: Use %locations, not --locations.
16328 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
16329
16330 2002-10-19 Akim Demaille <akim@epita.fr>
16331
16332 * src/getargs.c (usage): Take status as argument and exit
16333 accordingly.
16334 Report the traditional `Try ... --help' message when status != 0.
16335 (usage, version): Don't take a FILE * as arg, it is pointless.
16336 (getargs): When there is an incorrect number of arguments, make it
16337 an error, and report it GNUlically thanks to `usage ()'.
16338
16339 2002-10-18 Paul Eggert <eggert@twinsun.com>
16340
16341 * data/glr.c (yyreportParseError): Don't assume that sprintf
16342 yields the length of the printed string, as this is not true
16343 on SunOS 4.1.4. Reported by Peter Klein.
16344
16345 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
16346 * tests/conflicts.at (%nonassoc and eof): Likewise.
16347 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
16348
16349 2002-10-17 Akim Demaille <akim@epita.fr>
16350
16351 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
16352 * src/getargs.c (trace_types, trace_args): Adjust.
16353 * src/reader.c (grammar_current_rule_prec_set)
16354 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
16355 Standardize error messages.
16356 And s/@prec/%prec/!
16357 (reader): Use trace_flag to enable scanner/parser debugging,
16358 instead of an adhoc scheme.
16359 * src/scan-gram.l: Remove trailing debugging code.
16360
16361 2002-10-16 Paul Eggert <eggert@twinsun.com>
16362
16363 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
16364 MUSCLE_TAB_H.
16365
16366 * NEWS: Officially drop support for building Bison with K&R C,
16367 since it didn't work anyway and it's not worth worrying about.
16368 * Makefile.maint (wget_files): Remove ansi2knr.c.
16369 (ansi2knr.c-url_prefix): Remove.
16370 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
16371 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16372 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16373
16374 2002-10-15 Paul Eggert <eggert@twinsun.com>
16375
16376 Stop using the "enum_" trick for K&R-style function definitions;
16377 it confused me, and I was the author! Instead, assume that people
16378 who want to use K&R C compilers (when using these modules in GCC,
16379 perhaps?) will run ansi2knr.
16380
16381 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
16382 All uses of "enum_" changed to "enum ".
16383 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
16384 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
16385
16386 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
16387 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
16388 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
16389 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
16390 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
16391 abitset_not, abitset_ones, abitset_or, abitset_or_and,
16392 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
16393 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
16394 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
16395 Use function prototypes; this removes the need for declaring
16396 static functions simply to provide their prototypes.
16397 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
16398 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
16399 bitset_count_, bitset_create, bitset_dump, bitset_first,
16400 bitset_free, bitset_init, bitset_last, bitset_next,
16401 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
16402 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
16403 bitset_print, bitset_release_memory, bitset_toggle_,
16404 bitset_type_choose, bitset_type_get, bitset_type_name_get,
16405 debug_bitset): Likewise.
16406 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
16407 * lib/bitset_stats.c (bitset_log_histogram_print,
16408 bitset_percent_histogram_print, bitset_stats_and,
16409 bitset_stats_and_cmp, bitset_stats_and_or,
16410 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
16411 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
16412 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
16413 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
16414 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
16415 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
16416 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
16417 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
16418 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
16419 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
16420 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
16421 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
16422 bitset_stats_zero): Likewise.
16423 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
16424 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
16425 bitsetv_dump, debug_bitsetv): Likewise.
16426 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
16427 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
16428 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
16429 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
16430 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
16431 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
16432 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
16433 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
16434 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
16435 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
16436 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
16437 Likewise.
16438 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
16439 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
16440 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
16441 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
16442 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
16443 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
16444 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
16445 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
16446 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
16447 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
16448 lbitset_xor_cmp, lbitset_zero): Likewise.
16449
16450 2002-10-14 Akim Demaille <akim@epita.fr>
16451
16452 Version 1.75.
16453
16454 2002-10-14 Akim Demaille <akim@epita.fr>
16455
16456 * tests/Makefile.am (maintainer-check-posix): New.
16457
16458 2002-10-14 Akim Demaille <akim@epita.fr>
16459
16460 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
16461 member.
16462
16463 2002-10-14 Akim Demaille <akim@epita.fr>
16464
16465 * src/tables.c (table_ninf_remap): base -> tab.
16466 Reported by Matt Rosing.
16467
16468 2002-10-14 Paul Eggert <eggert@twinsun.com>
16469
16470 * tests/action.at, tests/calc.at, tests/conflicts.at,
16471 tests/cxx-type.at, tests/headers.at, tests/input.at,
16472 tests/regression.at, tests/synclines.at, tests/torture.at:
16473 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
16474 so that the tests still work even if POSIXLY_CORRECT is set.
16475 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
16476
16477 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
16478 for portability to K&R hosts. Fix typo: signed char is guaranteed
16479 only to 127, not to 128.
16480 * data/glr.c (yysigned_char): New type.
16481 * data/yacc.c (yysigned_char): Likewise.
16482 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
16483
16484 2002-10-13 Paul Eggert <eggert@twinsun.com>
16485
16486 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
16487 true due to limited range of data type" warning from GCC.
16488
16489 * data/c.m4 (b4_token_defines): Protect against double-inclusion
16490 by wrapping enum yytokentype's definition inside #ifndef
16491 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
16492
16493 2002-10-13 Akim Demaille <akim@epita.fr>
16494
16495 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
16496 Un yy- yyrhs to avoid the name clash with the global YYRHS.
16497
16498 2002-10-13 Akim Demaille <akim@epita.fr>
16499
16500 * Makefile.maint: Update from Autoconf 2.54.
16501 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
16502
16503 2002-10-13 Akim Demaille <akim@epita.fr>
16504
16505 * src/print.c (print_state): Separate the list of solved conflicts
16506 from the other items.
16507 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
16508
16509 2002-10-13 Akim Demaille <akim@epita.fr>
16510
16511 Let nondeterministic skeletons be usable with deterministic
16512 tables.
16513
16514 With the patch, GAWK compiled by GCC without -O2 passes its test
16515 suite using a GLR parser driven by LALR tables. It fails with -O2
16516 because `struct stat' gives two different answers on my machine:
16517 88 (definition of an auto var) and later 96 (memset on this var).
16518 Hence the stack is badly corrumpted. The headers inclusion is to
16519 blame: if I move the awk.h inclusion before GLR's system header
16520 inclusion, the two struct stat have the same size.
16521
16522 * src/tables.c (pack_table): Always create conflict_table.
16523 (token_actions): Always create conflict_list.
16524 * data/glr.c (YYFLAG): Remove, unused.
16525
16526 2002-10-13 Akim Demaille <akim@epita.fr>
16527
16528 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
16529 (O0FLAGS): New.
16530 (VALGRIND, GXX): New.
16531 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
16532 * tests/bison.in: Run $PREBISON a pre-command.
16533 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
16534 (maintainer-check-g++): New.
16535 * Makefile.am (maintainer-check): New.
16536
16537 2002-10-13 Akim Demaille <akim@epita.fr>
16538
16539 * data/glr.c: Formatting changes.
16540 Tweak some trace messages to match yacc.c's.
16541
16542 2002-10-13 Akim Demaille <akim@epita.fr>
16543
16544 GLR parsers sometimes raise parse errors instead of performing the
16545 default reduction.
16546 Reported by Charles-Henry de Boysson.
16547
16548 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
16549 check the length of the traces when %glr.
16550 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
16551 GLR's traces.
16552 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
16553 Test GLR parsers.
16554 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
16555 (yyltype): Remove the yy prefix from the member names.
16556 (yytable): Complete its comment.
16557 (yygetLRActions): Map error action number from YYTABLE from
16558 YYTABLE_NINF to 0.
16559 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
16560 (which was a bug: it should have been YYTABEL_NINF, and yet it was
16561 not satisfying as we could compare an YYACTION computed from
16562 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
16563 only value for error actions.
16564 (yyreportParseError): In verbose parse error messages, don't issue
16565 `error' in the list of expected tokens.
16566 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
16567 next action to perform to match glr.c's decoding.
16568 (yytable): Complete its comment.
16569
16570 2002-10-13 Paul Eggert <eggert@twinsun.com>
16571
16572 Fix problem reported by Henrik Grubbstroem in
16573 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
16574 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
16575 because the Bison parser reads the second action before reducing
16576 the first one.
16577 * src/scan-gram.l (rule_length): New static var.
16578 Use it to keep track of the rule length in the scanner, since
16579 we can't expect the parser to be in lock-step sync with the scanner.
16580 (handle_action_dollar, handle_action_at): Use this var.
16581 * tests/actions.at (Exotic Dollars): Test for the problem.
16582
16583 2002-10-12 Paul Eggert <eggert@twinsun.com>
16584
16585 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
16586 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
16587 Include <sys/time.h> when checking for clock_t and struct tms.
16588 Use same include order as source.
16589 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
16590 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
16591
16592 * lib/timevar.c: Update copyright date and clarify comments.
16593 (get_time) [IN_GCC]: Keep the GCC version for reference.
16594
16595 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
16596 GCC version as of today, then merge Bison's changes.
16597 Change "GCC" to "Bison" in copyright notice. timevar.def's
16598 author is Akim, so change that too.
16599
16600 * src/reader.c (grammar_current_rule_check):
16601 Don't worry about the default action if $$ is untyped.
16602 Prevents bogus warnings reported by Jim Gifford in
16603 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
16604
16605 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
16606 * data/glr.c, data/lalr1.cc, data/yacc.c:
16607 Output token definitions before the first part of user declarations.
16608 Fixes compatibility problem reported by Jim Gifford for kbd in
16609 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
16610
16611 2002-10-11 Paul Eggert <eggert@twinsun.com>
16612
16613 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
16614 (yyparse): here. This undoes some of the 2002-07-25 change.
16615 Compatibility problem reported by Ralf S. Engelschall with
16616 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
16617
16618 2002-10-11 Akim Demaille <akim@epita.fr>
16619
16620 * tests/regression.at Characters Escapes): New.
16621 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
16622 characters.
16623 Reported by Jan Nieuwenhuizen.
16624
16625 2002-10-11 Akim Demaille <akim@epita.fr>
16626
16627 * po/id.po: New.
16628
16629 2002-10-10 Paul Eggert <eggert@twinsun.com>
16630
16631 Portability fixes for bitsets; this also avoids several GCC
16632 warnings.
16633
16634 * lib/abitset.c: Include <stddef.h>, for offsetof.
16635 * lib/lbitset.c: Likewise.
16636
16637 * lib/abitset.c (abitset_bytes): Return a size that is aligned
16638 properly for vectors of objects. Do not assume that adding a
16639 header size to a multiple of a word size yields a value that is
16640 properly aligned for the whole union.
16641 * lib/bitsetv.c (bitsetv_alloc): Likewise.
16642
16643 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
16644 unique names for structures.
16645 * lib/ebitset.c (ebitset_bytes): Likewise.
16646 * lib/lbitset.c (lbitset_bytes): Likewise.
16647
16648 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
16649 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
16650 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
16651 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
16652 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
16653 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
16654 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
16655 to improve the type-checking that GCC can do.
16656 * lib/bitset.c (bitset_op4_cmp): Likewise.
16657 * lib/bitset_stats.c (bitset_stats_count,
16658 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
16659 bitset_stats_copy, bitset_stats_disjoint_p,
16660 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
16661 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
16662 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
16663 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
16664 bitset_stats_and_or_cmp, bitset_stats_andn_or,
16665 bitset_stats_andn_or_cmp, bitset_stats_or_and,
16666 bitset_stats_or_and_cmp): Likewise.
16667 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
16668 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
16669 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
16670 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
16671
16672 * lib/abitset.h: Include bitset.h, not bbitset.h.
16673 * lib/ebitset.h: Likewise.
16674 * lib/lbitset.h: Likewise.
16675
16676 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
16677 All instances of parameters of type enum bitset_opts are now of
16678 type enum_bitset_opts, to conform to the C Standard, and similarly
16679 for enum_bitset_type.
16680 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
16681 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
16682
16683 Do not use "struct bitset_struct" to mean different things in
16684 different modules. Not only is this confusing, it violates
16685 the C Standard, which requires that structure types in different
16686 modules must be compatible if one is to be passed to the other.
16687 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
16688 All instances of "struct bitset_struct *" replaced with "bitset".
16689 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
16690 (union bitset_union, struct abitset_struct, struct ebitset_struct,
16691 struct lbitset_struct, struct bitset_stats_struct): New types.
16692 All uses of struct bitset_struct changed to union bitset_union,
16693 etc.
16694 * lib/abitset.c (struct abitset_struct, abitset,
16695 struct bitset_struct): Remove.
16696 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
16697 struct bitset_struct): Remove.
16698 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
16699 bitset_struct): Remove.
16700 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
16701 Likewise.
16702
16703 Do not call a function of type T using a call that assumes the
16704 function is of a different type U. Standard C requires that a
16705 function must be called with a type that is compatible with its
16706 definition.
16707 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
16708 New decls.
16709 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
16710 New functions.
16711 * lib/ebitset.c (PFV): Remove.
16712 * lib/lbitset.c (PFV): Likewise.
16713 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
16714 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
16715 decls.
16716 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
16717 (ebitset_vtable): Use them.
16718 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
16719 lbitset_xor): New functions.
16720 (lbitset_vtable): Use them.
16721
16722 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
16723 Declare.
16724
16725 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
16726 GCC warning.
16727 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
16728 Use offsetof, for simplicity.
16729
16730 2002-10-06 Paul Eggert <eggert@twinsun.com>
16731
16732 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
16733 the same width as int. This reapplies a hunk of the 2002-08-12 patch
16734 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
16735 which was inadvertently undone by the 2002-09-30 patch.
16736 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
16737 the same width as int.
16738
16739 2002-10-04 Paul Eggert <eggert@twinsun.com>
16740
16741 Version 1.50.
16742
16743 * configure.ac (AC_INIT), NEWS: Increment version number.
16744
16745 * doc/bison.texinfo: Minor spelling, grammar, and white space
16746 fixes.
16747 (Symbols): Mention that any negative value returned from yylex
16748 signifies end-of-input. Warn about negative chars. Mention
16749 the portable Standard C character set.
16750
16751 The GNU coding standard says CFLAGS and YFLAGS are reserved
16752 for the installer to set.
16753 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
16754 * src/Makefile.am (AM_CFLAGS): Likewise.
16755 (AM_YFLAGS): Renamed from YFLAGS.
16756
16757 Fix some MAX and MIN problems.
16758 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
16759 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
16760 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
16761 * src/reader.c (reader): Use it.
16762
16763 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
16764 POSIX 1003.1-2001 has removed fgrep.
16765
16766 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
16767
16768 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
16769 interpreted as signed.
16770 * lib/ebitset.c (ebitset_list): Fix bug.
16771
16772 2002-10-01 Paul Eggert <eggert@twinsun.com>
16773
16774 More fixes for 64-bit hosts and large bitsets.
16775
16776 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
16777 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
16778 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
16779 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
16780 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
16781 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
16782 bitset_count_): Likewise.
16783 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
16784 bitset_first, bitset_last): Likewise.
16785 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
16786 bitset_stats_list_reverse, bitset_stats_size,
16787 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
16788 Likewise.
16789 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
16790 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
16791 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
16792 bitsetv_reflexive_transitive_closure): Likewise.
16793 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
16794 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
16795 Likewise.
16796 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
16797 Likewise.
16798
16799 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
16800 Use size_t, not unsigned int, to count bytes.
16801 * lib/abitset.h (abitset_bytes): Likewise.
16802 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
16803 Likewise.
16804 * lib/bitset.h (bitset_bytes): Likewise.
16805 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
16806 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
16807 * lib/bitsetv.c (bitsetv_alloc): Likewise.
16808 * lib/ebitset.c (ebitset_bytes): Likewise.
16809 * lib/ebitset.h (ebitset_bytes): Likewise.
16810 * lib/lbitset.c (lbitset_bytes): Likewise.
16811 * lib/lbitset.h (lbitset_bytes): Likewise.
16812
16813 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
16814 abitset_subset_p, abitset_disjoint_p, abitset_and,
16815 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
16816 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
16817 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
16818 abitset_or_and, abitset_or_and_cmp):
16819 Use bitset_windex instead of unsigned int.
16820 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
16821 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
16822 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
16823 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
16824 Likewise.
16825 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
16826
16827 * lib/bitset.c (bitset_print):
16828 Use proper printf formats for widths of integer types.
16829 * lib/bitset_stats.c (bitset_percent_histogram_print,
16830 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
16831 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
16832 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
16833 * lib/lbitset.c (lbitset_bytes): Likewise.
16834
16835 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
16836 BITSET_SIZE_MAX): New macros.
16837 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
16838 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
16839 to BITSET_WINDEX_MAX.
16840
16841 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
16842 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
16843 since we now return the bitset_bindex type (not int).
16844
16845 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
16846 when computing sizes.
16847 * lib/ebitset.c (ebitset_elts_grow): Likewise.
16848
16849 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
16850 and avoid cast to unsigned.
16851
16852 2002-09-30 Akim Demaille <akim@epita.fr>
16853
16854 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
16855 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
16856 Updates from Michael Hayes.
16857
16858 2002-09-30 Art Haas <ahaas@neosoft.com>
16859
16860 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
16861 invocations.
16862 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
16863 defined.
16864
16865 2002-09-27 Akim Demaille <akim@epita.fr>
16866
16867 Version 1.49c.
16868
16869 2002-09-27 Akim Demaille <akim@epita.fr>
16870
16871 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
16872 (Because of AC_LIBSOURCE).
16873
16874 2002-09-27 Akim Demaille <akim@epita.fr>
16875
16876 Playing with Autoscan.
16877
16878 * configure.ac: Remove the old LIBOBJ tweaks.
16879 (AC_REPLACE_FUNCS): Add strrchr and strtol.
16880 * lib/strrchr.c: New.
16881 * lib/strtol.c: New, from the Coreutils 4.5.1.
16882
16883 2002-09-27 Akim Demaille <akim@epita.fr>
16884
16885 Playing with Autoscan.
16886
16887 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
16888 * lib/Makefile.am (libbison_a_SOURCES): No longer include
16889 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
16890 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
16891 Coreutils 4.5.1.
16892
16893 2002-09-24 Akim Demaille <akim@epita.fr>
16894
16895 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
16896 (Frequently Asked Questions, Parser Stack Overflow): New.
16897
16898 2002-09-13 Akim Demaille <akim@epita.fr>
16899
16900 Playing with autoscan.
16901
16902 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
16903 * src/files.c (skeleton_find): Remove, unused.
16904 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
16905 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
16906
16907 2002-09-13 Akim Demaille <akim@epita.fr>
16908
16909 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
16910 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
16911
16912 2002-09-13 Akim Demaille <akim@epita.fr>
16913
16914 * configure.ac: Require 2.54.
16915 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
16916 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
16917 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
16918 Remove, provided by Autoconf macros.
16919
16920 2002-09-12 Akim Demaille <akim@epita.fr>
16921
16922 * m4/prereq.m4: Update, from Coreutils 4.5.1.
16923
16924 2002-09-12 Akim Demaille <akim@epita.fr>
16925
16926 * m4/prereq.m4: Update, from Fileutils 4.1.5.
16927 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
16928 Reported by Martin Mokrejs.
16929
16930 2002-09-10 Akim Demaille <akim@epita.fr>
16931
16932 * src/parse-gram.y: Associate a human readable string to each
16933 token type.
16934 * tests/regression.at (Invalid inputs): Adjust.
16935
16936 2002-09-10 Gary V. Vaughan <gary@gnu.org>
16937
16938 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
16939 with an Autoconf-2.5x style configure.ac.
16940
16941 2002-09-06 Paul Eggert <eggert@twinsun.com>
16942
16943 * doc/bison.texinfo (Conditions): Make explicit that the GPL
16944 exception applies only to yacc.c. This is a modification of a
16945 patch originally suggested by Akim Demaille.
16946
16947 2002-09-06 Akim Demaille <akim@epita.fr>
16948
16949 * data/c.m4 (b4_copyright): Move the GPL exception comment from
16950 here to...
16951 * data/yacc.c: here.
16952
16953 * data/lalr1.cc (struct yyltype): Don't define it, since we use
16954 LocationType.
16955 (b4_ltype): Default to yy::Location from location.hh.
16956
16957 2002-09-04 Jim Meyering <jim@meyering.net>
16958
16959 * data/yacc.c: Guard the declaration of yytoknum also with
16960 `#ifdef YYPRINT', so it is declared only when used.
16961
16962 2002-09-04 Akim Demaille <akim@epita.fr>
16963
16964 * configure.in: Rename as...
16965 * configure.ac: this.
16966 Bump to 1.49c.
16967
16968 2002-09-04 Akim Demaille <akim@epita.fr>
16969
16970 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
16971 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
16972 translate maintainer only messages.
16973
16974 2002-08-12 Paul Eggert <eggert@twinsun.com>
16975
16976 Version 1.49b.
16977
16978 * Makefile.am (SUBDIRS): Remove intl.
16979 (DISTCLEANFILES): Remove.
16980 * NEWS: Mention that GNU M4 is now required. Clarify what is
16981 meant by "larger grammars". Mention the pt_BR translation.
16982 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
16983 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
16984 Bump version from 0.11.2 to 0.11.5.
16985 (BISON_PREREQ_STAGE): Remove.
16986 (AM_GNU_GETTEXT): Use external gettext.
16987 (AC_OUTPUT): Remove intl/Makefile.
16988
16989 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
16990
16991 * data/glr.c: Include string.h, for strlen.
16992 (yyreportParseError): Use size_t for yysize.
16993 (yy_yypstack): No longer nested inside yypstates, as nested
16994 functions are not portable. Do not assume size_t is the
16995 same width as int.
16996 (yypstates): Do not assume that ptrdiff_t is the same width
16997 as int, and similarly for yyposn and YYINDEX.
16998
16999 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
17000
17001 * lib/Makefile.am (INCLUDES): Do not include from the intl
17002 directory, which has been removed.
17003 * src/Makefile.am (INCLUDES): Likewise.
17004
17005 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
17006 (bitsets_sources, additional_bitsets_sources, timevars_sources):
17007 New vars.
17008
17009 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
17010 * tests/Makefile.am (EXTRA_DIST): Likewise.
17011
17012 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
17013 Do not assume that bitset_windex is the same width as unsigned.
17014
17015 * lib/abitset.c (abitset_unused_clear): Do not assume that
17016 bitset_word is the same width as int.
17017 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
17018 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
17019 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
17020 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
17021 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
17022
17023 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
17024 portability to one's complement hosts!).
17025 * lib/ebitset.c (ebitset_op1): Likewise.
17026 * lib/lbitset.c (lbitset_op1): Likewise.
17027
17028 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
17029 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
17030 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
17031 Sync with fileutils.
17032 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
17033 lib/gettext.h: Sync with diffutils.
17034
17035 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
17036 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
17037
17038 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
17039 PROTOTYPES to check for prototypes, and "defined __STDC__" to
17040 check for void *.
17041
17042 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
17043 size_t; the old version tried to do this but casted improperly.
17044 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
17045 (bitset_test): Now returns int, not unsigned long.
17046
17047 * lib/bitset_stats.c: Include "gettext.h".
17048 (_): New macro.
17049 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
17050 name locals "index", as it generates unnecessary warnings on some
17051 hosts that have an "index" function.
17052
17053 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
17054 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
17055 they need translation.
17056 * src/LR0.c (state_list_append, new_itemsets, get_state,
17057 append_states, generate_states): Likewise.
17058 * src/assoc.c (assoc_to_string): Likewise.
17059 * src/closure.c (print_closure, set_firsts, closure): Likewise.
17060 * src/gram.c (grammar_dump): Likewise.
17061 * src/injections.c (injections_compute): Likewise.
17062 * src/lalr.c (lookaheads_print): Likewise.
17063 * src/relation.c (relation_transpose): Likewise.
17064 * src/scan-gram.l: Likewise.
17065 * src/tables.c (table_grow, pack_vector): Likewise.
17066
17067 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
17068 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
17069 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
17070 * m4/mbstate_t.m4: Sync with fileutils.
17071 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
17072
17073 * po/LINGUAS: Add pt_BR.
17074 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
17075 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
17076 lib/timevar.c.
17077 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
17078 manual recommends.
17079 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
17080
17081 * src/complain.c (strerror_r): Remove decl; not needed.
17082 (strerror): Use same pattern as ../lib/error.c.
17083
17084 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
17085
17086 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
17087
17088 * src/main.c (main): Cast result of bindtextdomain and textdomain
17089 to void, to avoid a GCC warning when --disable-nls is in effect.
17090
17091 * src/scan-gram.l: Use strings rather than escapes when possible,
17092 to minimize the number of warnings from xgettext.
17093 (handle_action_dollar, handle_action_at): Don't use isdigit,
17094 as it mishandles negative chars and it may not work as expected
17095 outside the C locale.
17096
17097 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
17098 this is a GCC extension and is not portable to other compilers.
17099
17100 * src/system.h (alloca): Use same pattern as ../lib/error.c.
17101 Do not include <ctype.h>; no longer needed.
17102 Do not include <malloc.h>; no longer needed (and generates
17103 warnings on OpenBSD 3.0).
17104
17105 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
17106 it's not portable.
17107
17108 * tests/regression.at: Do not use 'cc -c input.c -o input';
17109 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
17110
17111 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
17112 exit status as failure, not just exit status 1. Sun C exits
17113 with status 2 sometimes.
17114
17115 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
17116 Use it for the two large tests.
17117
17118 2002-08-02 Akim Demaille <akim@epita.fr>
17119
17120 * src/conflicts.c (conflicts_output): Don't output rules never
17121 reduced here, since anyway that computation doesn't work.
17122 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
17123 (rule_useless_p, rule_never_reduced_p): New.
17124 (grammar_rules_partial_print): Use a filter instead of a range.
17125 Display the title only if needed.
17126 (grammar_rules_print): Adjust.
17127 (grammar_rules_never_reduced_report): New.
17128 * src/tables.c (action_row): Move the computation of rules never
17129 reduced to...
17130 (token_actions): here.
17131 * src/main.c (main): Make the parser before making the report, so
17132 that rules never reduced are computed.
17133 Call grammar_rules_never_reduced_report.
17134 * src/print.c (print_results): Report rules never reduced.
17135 * tests/conflicts.at, tests/reduce.at: Adjust.
17136
17137 2002-08-01 Akim Demaille <akim@epita.fr>
17138
17139 Instead of attaching lookaheads and duplicating the rules being
17140 reduced by a state, attach the lookaheads to the reductions.
17141
17142 * src/state.h (state_t): Remove the `lookaheads',
17143 `lookaheads_rule' member.
17144 (reductions_t): Add a `lookaheads' member.
17145 Use a regular array for the `rules'.
17146 * src/state.c (reductions_new): Initialize the lookaheads member
17147 to 0.
17148 (state_rule_lookaheads_print): Adjust.
17149 * src/state.h, src/state.c (state_reductions_find): New.
17150 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
17151 (count_rr_conflicts): Adjust.
17152 * src/lalr.c (LArule): Remove.
17153 (add_lookback_edge): Adjust.
17154 (state_lookaheads_count): New.
17155 (states_lookaheads_initialize): Merge into...
17156 (initialize_LA): this.
17157 (lalr_free): Adjust.
17158 * src/main.c (main): Don't free nullable and derives too early: it
17159 is used by --verbose.
17160 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
17161
17162 2002-08-01 Akim Demaille <akim@epita.fr>
17163
17164 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
17165 `rule_number_t**'.
17166 (set_derives, free_derives): Rename as...
17167 (derives_compute, derives_free): this.
17168 Adjust all dependencies.
17169 * src/nullable.c (set_nullable, free_nullable): Rename as...
17170 (nullable_compute, nullable_free): these.
17171 (rule_list_t): Store rule_t *, not rule_number_t.
17172 * src/state.c (state_rule_lookaheads_print): Directly compare rule
17173 pointers, instead of their numbers.
17174 * src/main.c (main): Call nullable_free, and derives_free earlier,
17175 as they were lo longer used.
17176
17177 2002-08-01 Akim Demaille <akim@epita.fr>
17178
17179 * lib/timevar.c (get_time): Include children time.
17180 * src/lalr.h (LA, LArule): Don't export them: used with the
17181 state_t.
17182 * src/lalr.c (LA, LArule): Static.
17183 * src/lalr.h, src/lalr.c (lalr_free): New.
17184 * src/main.c (main): Call it.
17185 * src/tables.c (pack_vector): Check whether loc is >= to the
17186 table_size, not >.
17187 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
17188 (tables_generate): do it, since that's also it which allocates
17189 them.
17190 Don't free LA and LArule, main does.
17191
17192 2002-07-31 Akim Demaille <akim@epita.fr>
17193
17194 Separate parser tables computation and output.
17195
17196 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
17197 (conflict_list, conflict_list_cnt, table, check, table_ninf)
17198 (yydefgoto, yydefact, high): Move to...
17199 * src/tables.h, src/tables.c: here.
17200 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17201 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17202 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
17203 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
17204 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
17205 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
17206 (action_row, save_row, token_actions, save_column, default_goto)
17207 (goto_actions, sort_actions, matching_state, pack_vector)
17208 (table_ninf_remap, pack_table, prepare_actions): Move to...
17209 * src/tables.c: here.
17210 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
17211 * src/output.c (token_actions, output_base, output_conflicts)
17212 (output_check): Merge into...
17213 (prepare_actions): this.
17214 (actions_output): Rename as...
17215 (user_actions_output): this.
17216 * src/main.c (main): Call tables_generate and tables_free.
17217
17218 2002-07-31 Akim Demaille <akim@epita.fr>
17219
17220 Steal GCC's --time-report support.
17221
17222 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
17223 stolen/adjusted from GCC.
17224 * m4/stage.m4: Remove time related checks.
17225 * m4/timevar.m4: New.
17226 * configure.in: Adjust.
17227 * src/system.h: Adjust to using timevar.h.
17228 * src/getargs.h, src/getargs.c: Support trace_time for
17229 --trace=time.
17230 * src/main.c (stage): Remove.
17231 (main): Replace `stage' invocations with timevar calls.
17232 * src/output.c: Insert pertinent timevar calls.
17233
17234 2002-07-31 Akim Demaille <akim@epita.fr>
17235
17236 Let --trace have arguments.
17237
17238 * src/getargs.h (enum trace_e): New.
17239 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
17240 (long_options, short_options): --trace/-T takes an optional
17241 argument.
17242 Change all the uses of trace_flag to reflect the new flags.
17243 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
17244
17245 Strengthen `stage' portability.
17246
17247 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
17248 * configure.in: Use it.
17249 Don't check for malloc.h and sys/times.h.
17250 * src/system.h: Include them when appropriate.
17251 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
17252 times and struct tms are available.
17253
17254 2002-07-30 Akim Demaille <akim@epita.fr>
17255
17256 In verbose parse error message, don't report `error' as an
17257 expected token.
17258 * tests/actions.at (Printers and Destructors): Adjust.
17259 * tests/calc.at (Calculator $1): Adjust.
17260 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
17261 error message, do not report the parser accepts the error token in
17262 that state.
17263
17264 2002-07-30 Akim Demaille <akim@epita.fr>
17265
17266 Normalize conflict related messages.
17267
17268 * src/complain.h, src/complain.c (warn, complain): New.
17269 * src/conflicts.c (conflicts_print): Use them.
17270 (conflict_report_yacc): New, extracted from...
17271 (conflicts_print): here.
17272 * tests/conflicts.at, tests/existing.at: Adjust.
17273
17274 2002-07-30 Akim Demaille <akim@epita.fr>
17275
17276 Report rules which are never reduced by the parser: those hidden
17277 by conflicts.
17278
17279 * src/LR0.c (save_reductions): Don't make the final state too
17280 different: save its reduction (accept) instead of having a state
17281 without any action (no shift or goto, no reduce).
17282 Note: the final state is now a ``regular'' state, i.e., the
17283 parsers now contain `reduce 0' as default reduction.
17284 Nevertheless, since they decide to `accept' when yystate =
17285 final_state, they still will not reduce rule 0.
17286 * src/print.c (print_actions, print_reduction): Adjust.
17287 * src/output.c (action_row): Track reduced rules.
17288 (token_actions): Report rules never reduced.
17289 * tests/conflicts.at, tests/regression.at: Adjust.
17290
17291 2002-07-30 Akim Demaille <akim@epita.fr>
17292
17293 `stage' was accidently included in a previous patch.
17294 Initiate its autoconfiscation.
17295
17296 * configure.in: Look for malloc.h and sys/times.h.
17297 * src/main.c (stage): Adjust.
17298 Report only when trace_flag.
17299
17300 2002-07-29 Akim Demaille <akim@epita.fr>
17301
17302 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
17303 state_number_t.
17304 (errs_t): symbol_t*, not symbol_number_t.
17305 (reductions_t): rule_t*, not rule_number_t.
17306 (FOR_EACH_SHIFT): New.
17307 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
17308 * src/print.c, src/print_graph.c: Adjust.
17309
17310 2002-07-29 Akim Demaille <akim@epita.fr>
17311
17312 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
17313
17314 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
17315 (endtoken, accept): these.
17316 * src/reader.c (reader): Set endtoken's default tag to "$end".
17317 Set undeftoken's tag to "$undefined" instead of "$undefined.".
17318 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
17319 Adjust.
17320
17321 2002-07-29 Akim Demaille <akim@epita.fr>
17322
17323 * src/reduce.c (reduce_grammar): When the language is empty,
17324 complain about the start symbol, not the axiom.
17325 Use its location.
17326 * tests/reduce.at (Empty Language): New.
17327
17328 2002-07-26 Akim Demaille <akim@epita.fr>
17329
17330 * src/reader.h, src/reader.c (gram_error): ... can't get
17331 yycontrol without making too strong assumptions on the parser
17332 itself.
17333 * src/output.c (prepare_tokens): Use the real 0th value of
17334 token_translations instead of `0'.
17335 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
17336 visible here.
17337 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
17338 for the time being: %locations ought to provide it to yyerror.
17339
17340 2002-07-25 Akim Demaille <akim@epita.fr>
17341
17342 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
17343 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
17344 * tests/regression.at (Web2c Actions): Adjust.
17345
17346 2002-07-25 Akim Demaille <akim@epita.fr>
17347
17348 Stop storing rules from 1 to nrules + 1.
17349
17350 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
17351 * src/nullable.c, src/output.c, src/print.c, src/reader.c
17352 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
17353 Iterate from 0 to nrules.
17354 Use rule_number_as_item_number and item_number_as_rule_number.
17355 Adjust to `derive' now containing possibly 0.
17356 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
17357 Handle the `- 1' part in rule numbers from/to item numbers.
17358 * src/conflicts.c (log_resolution): Fix the message which reversed
17359 shift and reduce.
17360 * src/output.c (action_row): Initialize default_rule to -1.
17361 (token_actions): Adjust.
17362 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
17363 expected output.
17364 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
17365
17366 2002-07-25 Akim Demaille <akim@epita.fr>
17367
17368 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
17369 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
17370 (b4_c_knr_arg_decl): New.
17371 * data/yacc.c: Use it to define yysymprint, yydestruct, and
17372 yyreport_parse_error.
17373
17374 2002-07-25 Akim Demaille <akim@epita.fr>
17375
17376 * data/yacc.c (yyreport_parse_error): New, extracted from...
17377 (yyparse): here.
17378 (yydestruct, yysymprint): Move above yyparse.
17379 Be K&R compliant.
17380
17381 2002-07-25 Akim Demaille <akim@epita.fr>
17382
17383 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
17384 replace...
17385 (b4_sint_type, b4_uint_type): these.
17386 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
17387 * tests/regression.at (Web2c Actions): Adjust.
17388
17389 2002-07-25 Akim Demaille <akim@epita.fr>
17390
17391 * src/gram.h (TIEM_NUMBER_MAX): New.
17392 (item_number_of_rule_number, rule_number_of_item_number): Rename
17393 as...
17394 (rule_number_as_item_number, item_number_as_rule_number): these.
17395 Adjust dependencies.
17396 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17397 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17398 (symbol_number_to_vector_number): New.
17399 (order): Of vector_number_t* type.
17400 (base_t, BASE_MAX, BASE_MIN): New.
17401 (froms, tos, width, pos, check): Of base_t type.
17402 (action_number_t, ACTION_MIN, ACTION_MAX): New.
17403 (actrow): Of action_number_t type.
17404 (conflrow): Of unsigned int type.
17405 (table_ninf, base_ninf): New.
17406 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
17407 (muscle_insert_int_table, muscle_insert_base_table)
17408 (muscle_insert_rule_number_table): New.
17409 (prepare_tokens): Output `toknum' as int_table.
17410 (action_row): Returns a rule_number_t.
17411 Use ACTION_MIN, not SHRT_MIN.
17412 (token_actions): yydefact is rule_number_t*.
17413 (table_ninf_remap): New.
17414 (pack_table): Use it for `base' and `table'.
17415 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
17416 replaced with...
17417 (YYPACT_NINF, YYTABLE_NINF): these.
17418 (yypact, yytable): Compute their types instead of hard-coded
17419 `short'.
17420 * tests/regression.at (Web2c Actions): Adjust.
17421
17422 2002-07-19 Akim Demaille <akim@epita.fr>
17423
17424 * src/scan-gram.l (id): Can start with an underscore.
17425
17426 2002-07-16 Akim Demaille <akim@epita.fr>
17427
17428 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
17429 Adjust all former `associativity' dependencies.
17430 * src/symtab.c (symbol_new): Default associativity is `undef', not
17431 `right'.
17432 (symbol_check_alias_consistence): Adjust.
17433
17434 2002-07-09 Akim Demaille <akim@epita.fr>
17435
17436 * doc/bison.texinfo: Properly set the ``header'' part.
17437 Use @dircategory ``GNU programming tools'' as per Texinfo's
17438 documentation.
17439 Use @copying.
17440
17441 2002-07-09 Akim Demaille <akim@epita.fr>
17442
17443 * lib/quotearg.h: Protect against multiple inclusions.
17444 * src/location.h (location_t): Add a `file' member.
17445 (LOCATION_RESET, LOCATION_PRINT): Adjust.
17446 * src/complain.c (warn_at, complain_at, fatal_at): Drop
17447 `error_one_per_line' support.
17448
17449 2002-07-09 Akim Demaille <akim@epita.fr>
17450
17451 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
17452 * src/reader.c (lineno): Remove.
17453 Adjust all dependencies.
17454 (get_merge_function): Take a location and use complain_at.
17455 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
17456 * tests/regression.at (Invalid inputs, Mixing %token styles):
17457 Adjust.
17458
17459 2002-07-09 Akim Demaille <akim@epita.fr>
17460
17461 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
17462 recovery rule, and forbid extensions when --yacc.
17463 (gram_error): Use complain_at.
17464 * src/reader.c (reader): Exit if there were parse errors.
17465
17466 2002-07-09 Akim Demaille <akim@epita.fr>
17467
17468 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
17469 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
17470 Reported by R Blake <blakers@mac.com>.
17471
17472 2002-07-09 Akim Demaille <akim@epita.fr>
17473
17474 * data/yacc.c: Output the copyright notive in the header.
17475
17476 2002-07-03 Akim Demaille <akim@epita.fr>
17477
17478 * src/output.c (froms, tos): Are state_number_t.
17479 (save_column): sp, sp1, and sp2 are state_number_t.
17480 (prepare): Rename `final' as `final_state_number', `nnts' as
17481 `nterms_number', `nrules' as `rules_number', `nstates' as
17482 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
17483 unused.
17484 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
17485 * data/lalr1.cc (nsym_): Remove, unused.
17486
17487 2002-07-03 Akim Demaille <akim@epita.fr>
17488
17489 * src/lalr.h, src/lalr.c (goto_number_t): New.
17490 * src/lalr.c (goto_list_t): New.
17491 Propagate them.
17492 * src/nullable.c (rule_list_t): New.
17493 Propagate.
17494 * src/types.h: Remove.
17495
17496 2002-07-03 Akim Demaille <akim@epita.fr>
17497
17498 * src/closure.c (print_fderives): Use rule_rhs_print.
17499 * src/derives.c (print_derives): Use rule_rhs_print.
17500 (rule_list_t): New, replaces `shorts'.
17501 (set_derives): Add comments.
17502 * tests/sets.at (Nullable, Firsts): Adjust.
17503
17504 2002-07-03 Akim Demaille <akim@epita.fr>
17505
17506 * src/output.c (prepare_actions): Free `tally' and `width'.
17507 (prepare_actions): Allocate and free `order'.
17508 * src/symtab.c (symbols_free): Free `symbols'.
17509 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
17510 * src/output.c (m4_invoke): Move to...
17511 * src/scan-skel.l: here.
17512 (<<EOF>>): Close yyout, and free its name.
17513
17514 2002-07-03 Akim Demaille <akim@epita.fr>
17515
17516 Fix some memory leaks, and fix a bug: state 0 was examined twice.
17517
17518 * src/LR0.c (new_state): Merge into...
17519 (state_list_append): this.
17520 (new_states): Merge into...
17521 (generate_states): here.
17522 (set_states): Don't ensure a proper `errs' state member here, do it...
17523 * src/conflicts.c (conflicts_solve): here.
17524 * src/state.h, src/state.c: Comment changes.
17525 (state_t): Rename member `shifts' as `transitions'.
17526 Adjust all dependencies.
17527 (errs_new): For consistency, also take the values as argument.
17528 (errs_dup): Remove.
17529 (state_errs_set): New.
17530 (state_reductions_set, state_transitions_set): Assert that no
17531 previous value was assigned.
17532 (state_free): New.
17533 (states_free): Use it.
17534 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
17535 temporary storage: use `errs' and `nerrs' as elsewhere.
17536 (set_conflicts): Allocate and free this `errs'.
17537
17538 2002-07-02 Akim Demaille <akim@epita.fr>
17539
17540 * lib/libiberty.h: New.
17541 * lib: Update the bitset implementation from upstream.
17542 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
17543 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
17544 * src/main.c: Adjust bitset stats calls.
17545
17546 2002-07-01 Paul Eggert <eggert@twinsun.com>
17547
17548 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
17549 char, so that negative chars don't collide with $.
17550
17551 2002-06-30 Akim Demaille <akim@epita.fr>
17552
17553 Have the GLR tests be `warning' checked, and fix the warnings.
17554
17555 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
17556 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
17557 (yyremoveDeletes): `yyi' and `yyj' are size_t.
17558 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
17559 (yyaddDeferredAction): static.
17560 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
17561 (yyreportParseError): yyprefix is const.
17562 yytokenp is used only when verbose.
17563 (yy__GNUC__): Replace with __GNUC__.
17564 (yypdumpstack): yyi is size_t.
17565 (yypreference): Un-yy local variables and arguments, to avoid
17566 clashes with `yyr1'. Anyway, we are not in the user name space.
17567 (yytname_size): be an int, as is compared with ints.
17568 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
17569 Use them.
17570 * tests/cxx-gram.at: Use quotation to protect $1.
17571 Use AT_COMPILE to enable warnings hunts.
17572 Prototype yylex and yyerror.
17573 `Use' argc.
17574 Include `string.h', not `strings.h'.
17575 Produce and prototype stmtMerge only when used.
17576 yylex takes a location.
17577
17578 2002-06-30 Akim Demaille <akim@epita.fr>
17579
17580 We spend a lot of time in quotearg, in particular when --verbose.
17581
17582 * src/symtab.c (symbol_get): Store a quoted version of the key.
17583 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
17584 Adjust all callers.
17585
17586 2002-06-30 Akim Demaille <akim@epita.fr>
17587
17588 * src/state.h (reductions_t): Rename member `nreds' as num.
17589 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
17590 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
17591
17592 2002-06-30 Akim Demaille <akim@epita.fr>
17593
17594 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
17595 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
17596 (shifts_to): Rename as...
17597 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
17598 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
17599 (TRANSITION_IS_DISABLED, transitions_to): these.
17600
17601 2002-06-30 Akim Demaille <akim@epita.fr>
17602
17603 * src/print.c (print_shifts, print_gotos): Merge into...
17604 (print_transitions): this.
17605 (print_transitions, print_errs, print_reductions): Align the
17606 lookaheads columns.
17607 (print_core, print_transitions, print_errs, print_state,
17608 print_grammar): Output empty lines separator before, not after.
17609 (state_default_rule_compute): Rename as...
17610 (state_default_rule): this.
17611 * tests/conflicts.at (Defaulted Conflicted Reduction),
17612 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
17613 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
17614
17615 2002-06-30 Akim Demaille <akim@epita.fr>
17616
17617 Display items as we display rules.
17618
17619 * src/gram.h, src/gram.c (rule_lhs_print): New.
17620 * src/gram.c (grammar_rules_partial_print): Use it.
17621 * src/print.c (print_core): Likewise.
17622 * tests/conflicts.at (Defaulted Conflicted Reduction),
17623 (Unresolved SR Conflicts): Adjust.
17624 (Unresolved SR Conflicts): Adjust and rename as...
17625 (Resolved SR Conflicts): this, as was meant.
17626 * tests/regression.at (Web2c Report): Adjust.
17627
17628 2002-06-30 Akim Demaille <akim@epita.fr>
17629
17630 * src/print.c (state_default_rule_compute): New, extracted from...
17631 (print_reductions): here.
17632 Pessimize, but clarify the code.
17633 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
17634
17635 2002-06-30 Akim Demaille <akim@epita.fr>
17636
17637 * src/output.c (action_row): Let default_rule be always a rule
17638 number.
17639
17640 2002-06-30 Akim Demaille <akim@epita.fr>
17641
17642 * src/closure.c (print_firsts, print_fderives, closure):
17643 Use BITSET_EXECUTE.
17644 * src/lalr.c (lookaheads_print): Likewise.
17645 * src/state.c (state_rule_lookaheads_print): Likewise.
17646 * src/print_graph.c (print_core): Likewise.
17647 * src/print.c (print_reductions): Likewise.
17648 * src/output.c (action_row): Likewise.
17649 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
17650
17651 2002-06-30 Akim Demaille <akim@epita.fr>
17652
17653 * src/print_graph.c: Use report_flag.
17654
17655 2002-06-30 Akim Demaille <akim@epita.fr>
17656
17657 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
17658 to...
17659 * src/relation.h, src/relation.c (traverse, relation_digraph)
17660 (relation_print, relation_transpose): New.
17661
17662 2002-06-30 Akim Demaille <akim@epita.fr>
17663
17664 * src/state.h, src/state.c (shifts_to): New.
17665 * src/lalr.c (build_relations): Use it.
17666
17667 2002-06-30 Akim Demaille <akim@epita.fr>
17668
17669 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
17670 (item_number_of_rule_number, rule_number_of_item_number): New.
17671 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
17672 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
17673 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
17674 Propagate their use.
17675 Much remains to be done, in particular wrt `shorts' from types.h.
17676
17677 2002-06-30 Akim Demaille <akim@epita.fr>
17678
17679 * src/symtab.c (symbol_new): Initialize the `printer' member.
17680
17681 2002-06-30 Akim Demaille <akim@epita.fr>
17682
17683 * src/LR0.c (save_reductions): Remove, replaced by...
17684 * src/state.h, src/state.c (state_reductions_set): New.
17685 (reductions, errs): Rename as...
17686 (reductions_t, errs_t): these.
17687 Adjust all dependencies.
17688
17689 2002-06-30 Akim Demaille <akim@epita.fr>
17690
17691 * src/LR0.c (state_list_t, state_list_append): New.
17692 (first_state, last_state): Now symbol_list_t.
17693 (this_state): Remove.
17694 (new_itemsets, append_states, save_reductions): Take a state_t as
17695 argument.
17696 (set_states, generate_states): Adjust.
17697 (save_shifts): Remove, replaced by...
17698 * src/state.h, src/state.c (state_shifts_set): New.
17699 (shifts): Rename as...
17700 (shifts_t): this.
17701 Adjust all dependencies.
17702 * src/state.h (state_t): Remove the `next' member.
17703
17704 2002-06-30 Akim Demaille <akim@epita.fr>
17705
17706 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
17707 escaped in slot 0.
17708
17709 2002-06-30 Akim Demaille <akim@epita.fr>
17710
17711 Use hash.h for the state hash table.
17712
17713 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
17714 (allocate_storage): Use state_hash_new.
17715 (free_storage): Use state_hash_free.
17716 (new_state, get_state): Adjust.
17717 * src/lalr.h, src/lalr.c (states): Move to...
17718 * src/states.h (state_t): Remove the `link' member, no longer
17719 used.
17720 * src/states.h, src/states.c: here.
17721 (state_hash_new, state_hash_free, state_hash_lookup)
17722 (state_hash_insert, states_free): New.
17723 * src/states.c (state_table, state_compare, state_hash): New.
17724 * src/output.c (output_actions): Do not free states now, since we
17725 still need to know the final_state number in `prepare', called
17726 afterwards. Do it...
17727 * src/main.c (main): here: call states_free after `output'.
17728
17729 2002-06-30 Akim Demaille <akim@epita.fr>
17730
17731 * src/state.h, src/state.c (state_new): New, extracted from...
17732 * src/LR0.c (new_state): here.
17733 * src/state.h (STATE_ALLOC): Move to...
17734 * src/state.c: here.
17735 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
17736 * src/state.h, src/state.c: here.
17737
17738 2002-06-30 Akim Demaille <akim@epita.fr>
17739
17740 * src/reader.c (gensym): Rename as...
17741 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
17742 (getsym): Rename as...
17743 (symbol_get): this.
17744
17745 2002-06-30 Akim Demaille <akim@epita.fr>
17746
17747 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
17748 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
17749 * src/output.c, src/print.c, src/print_graph.c: Propagate.
17750 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
17751
17752 2002-06-30 Akim Demaille <akim@epita.fr>
17753
17754 Make the test suite pass with warnings checked.
17755
17756 * tests/actions.at (Printers and Destructors): Improve.
17757 Avoid unsigned vs. signed issues.
17758 * tests/calc.at: Don't exercise the scanner here, do it...
17759 * tests/input.at (Torturing the Scanner): here.
17760
17761 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17762
17763 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
17764 reorganize first lines parallel to yacc.c.
17765
17766 2002-06-28 Akim Demaille <akim@epita.fr>
17767
17768 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
17769 (b4_token_enum, b4_token_defines): New, factored from...
17770 * data/lalr1.cc, data/yacc.c, glr.c: here.
17771
17772 2002-06-28 Akim Demaille <akim@epita.fr>
17773
17774 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
17775 unused variables.
17776 * src/output.c (merger_output): static.
17777
17778 2002-06-28 Akim Demaille <akim@epita.fr>
17779
17780 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
17781 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
17782 pacify GCC.
17783 * src/output.c (save_row): Initialize all the variables to pacify GCC.
17784
17785 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17786
17787 Accumulated changelog for new GLR parsing features.
17788
17789 * src/conflicts.c (count_total_conflicts): Change name to
17790 conflicts_total_count.
17791 * src/conflicts.h: Ditto.
17792 * src/output.c (token_actions): Use the new name.
17793 (output_conflicts): Change conflp => conflict_list_heads, and
17794 confl => conflict_list for better readability.
17795 * data/glr.c: Use the new names.
17796 * NEWS: Add self to GLR announcement.
17797
17798 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
17799
17800 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
17801 Akim Demaille.
17802
17803 * data/bison.glr: Change name to glr.c
17804 * data/glr.c: Renamed from bison.glr.
17805 * data/Makefile.am: Add glr.c
17806
17807 * src/getargs.c:
17808
17809 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
17810 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
17811
17812 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17813
17814 * data/bison.glr: Be sure to restore the
17815 current #line when returning to the skeleton contents after having
17816 exposed the input file's #line.
17817
17818 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17819
17820 * data/bison.glr: Bring up to date with changes to bison.simple.
17821
17822 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17823
17824 * data/bison.glr: Correct definitions that use b4_prefix.
17825 Various reformatting.
17826 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
17827 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
17828 yytokenp argument; now part of stack.
17829 (yychar): Define to behave as documented.
17830 (yyclearin): Ditto.
17831
17832 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17833
17834 * src/reader.h: Add declaration for free_merger_functions.
17835
17836 * src/reader.c (merge_functions): New variable.
17837 (get_merge_function): New function.
17838 (free_merger_functions): New function.
17839 (readgram): Check for %prec that is not followed by a symbol.
17840 Handle %dprec and %merge declarations.
17841 (packgram): Initialize dprec and merger fields in rules array.
17842
17843 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
17844 conflict_list_cnt, conflict_list_free): New variables.
17845 (table_grow): Also grow conflict_table.
17846 (prepare_rules): Output dprec and merger tables.
17847 (conflict_row): New function.
17848 (action_row): Output conflict lists for GLR parser. Don't use
17849 default reduction in conflicted states for GLR parser so that there
17850 are spaces for the conflict lists.
17851 (save_row): Also save conflict information.
17852 (token_actions): Allocate conflict list.
17853 (merger_output): New function.
17854 (pack_vector): Pack conflict table, too.
17855 (output_conflicts): New function to output yyconflp and yyconfl.
17856 (output_check): Allocate conflict_tos.
17857 (output_actions): Output conflict tables, also.
17858 (output_skeleton): Output b4_mergers definition.
17859 (prepare): Output b4_max_rhs_length definition.
17860 Use 'bison.glr' as default skeleton for GLR parsers.
17861
17862 * src/gram.c (glr_parser): New flag.
17863 (grammar_free): Call free_merger_functions.
17864
17865 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
17866 all pairs of conflicting reductions, rather than just all tokens
17867 causing conflicts. Needed to size conflict tables.
17868 (conflicts_output): Modify call to count_rr_conflicts for new
17869 interface.
17870 (conflicts_print): Ditto.
17871 (count_total_conflicts): New function.
17872
17873 * src/reader.h (merger_list): New type.
17874 (merge_functions): New variable.
17875
17876 * src/lex.h (tok_dprec, tok_merge): New token types.
17877
17878 * src/gram.h (rule_s): Add dprec and merger fields.
17879 (glr_parser): New flag.
17880
17881 * src/conflicts.h (count_total_conflicts): New function.
17882
17883 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
17884
17885 * doc/bison.texinfo (Generalized LR Parsing): New section.
17886 (GLR Parsers): New section.
17887 (Language and Grammar): Mention GLR parsing.
17888 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
17889 Correct typo ("tge" -> "the").
17890
17891 * data/bison.glr: New skeleton for GLR parsing.
17892
17893 * tests/cxx-gram.at: New tests for GLR parsing.
17894
17895 * tests/testsuite.at: Include cxx-gram.at.
17896
17897 * tests/Makefile.am: Add cxx-gram.at.
17898
17899 * src/parse-gram.y:
17900
17901 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
17902
17903 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
17904
17905 2002-06-27 Akim Demaille <akim@epita.fr>
17906
17907 * src/options.h, src/options.c: Remove.
17908 * src/getargs.c (short_options, long_options): New.
17909
17910 2002-06-27 Akim Demaille <akim@epita.fr>
17911
17912 * data/bison.simple, data/bison.c++: Rename as...
17913 * data/yacc.c, data/lalr1.cc: these.
17914 * doc/bison.texinfo (Environment Variables): Remove.
17915
17916 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
17917
17918 * src/getargs.c (report_argmatch): Initialize strtok().
17919
17920 2002-06-20 Akim Demaille <akim@epita.fr>
17921
17922 * data/bison.simple (b4_symbol_actions): New, replaces...
17923 (b4_symbol_destructor, b4_symbol_printer): these.
17924 (yysymprint): Be sure to call YYPRINT only for tokens, and using
17925 user token numbers.
17926
17927 2002-06-20 Akim Demaille <akim@epita.fr>
17928
17929 * data/bison.simple (yydestructor): Rename as...
17930 (yydestruct): this.
17931
17932 2002-06-20 Akim Demaille <akim@epita.fr>
17933
17934 * src/symtab.h, src/symtab.c (symbol_type_set)
17935 (symbol_destructor_set, symbol_precedence_set): The location is
17936 the last argument.
17937 Adjust all callers.
17938
17939 2002-06-20 Akim Demaille <akim@epita.fr>
17940
17941 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
17942 internals.
17943 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
17944 Takes a location.
17945 * src/symtab.h, src/symtab.c (symbol_class_set)
17946 (symbol_user_token_number_set): Likewise.
17947 Adjust all callers.
17948 Promote complain_at.
17949 * tests/input.at (Type Clashes): Adjust.
17950
17951 2002-06-20 Akim Demaille <akim@epita.fr>
17952
17953 * data/bison.simple (YYLEX): Fix the declaration when
17954 %pure-parser.
17955
17956 2002-06-20 Akim Demaille <akim@epita.fr>
17957
17958 * data/bison.simple (yysymprint): Don't print the token number,
17959 just its name.
17960 * tests/actions.at (Destructors): Rename as...
17961 (Printers and Destructors): this.
17962 Also exercise %printer.
17963
17964 2002-06-20 Akim Demaille <akim@epita.fr>
17965
17966 * data/bison.simple (YYDSYMPRINT): New.
17967 Use it to remove many of the #if YYDEBUG/if (yydebug).
17968
17969 2002-06-20 Akim Demaille <akim@epita.fr>
17970
17971 * src/symtab.h, src/symtab.c (symbol_t): printer and
17972 printer_location are new members.
17973 (symbol_printer_set): New.
17974 * src/parse-gram.y (PERCENT_PRINTER): New token.
17975 Handle its associated rule.
17976 * src/scan-gram.l: Adjust.
17977 (handle_destructor_at, handle_destructor_dollar): Rename as...
17978 (handle_symbol_code_at, handle_symbol_code_dollar): these.
17979 * src/output.c (symbol_printers_output): New.
17980 (output_skeleton): Call it.
17981 * data/bison.simple (yysymprint): New. Cannot be named yyprint
17982 since there are already many grammar files with a user `yyprint'.
17983 Replace the calls to YYPRINT to calls to yysymprint.
17984 * tests/calc.at: Adjust.
17985 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
17986 taking advantage of parser very internal details (stack size!).
17987
17988 2002-06-20 Akim Demaille <akim@epita.fr>
17989
17990 * src/scan-gram.l: Complete the scanner with the missing patterns
17991 to pacify Flex.
17992 Use `quote' and `symbol_tag_get' where appropriate.
17993
17994 2002-06-19 Akim Demaille <akim@epita.fr>
17995
17996 * tests/actions.at (Destructors): Augment to test locations.
17997 * data/bison.simple (yydestructor): Pass it the current location
17998 if locations are enabled.
17999 Prototype only when __STDC__ or C++.
18000 Change the argument names to move into the yy name space: there is
18001 user code here.
18002
18003 2002-06-19 Akim Demaille <akim@epita.fr>
18004
18005 * data/bison.simple (b4_pure_if): New.
18006 Use it instead of #ifdef YYPURE.
18007
18008 2002-06-19 Akim Demaille <akim@epita.fr>
18009
18010 * data/bison.simple (b4_location_if): New.
18011 Use it instead of #ifdef YYLSP_NEEDED.
18012
18013 2002-06-19 Akim Demaille <akim@epita.fr>
18014
18015 Prepare @$ in %destructor, but currently don't bind it in the
18016 skeleton, as %location use is not cleaned up yet.
18017
18018 * src/scan-gram.l (handle_dollar, handle_destructor_at)
18019 (handle_action_at): New.
18020 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
18021 a braced_code_t and a location as additional arguments.
18022 (handle_destructor_dollar): Instead of requiring `b4_eval', just
18023 unquote one when outputting `b4_dollar_dollar'.
18024 Adjust callers.
18025 * data/bison.simple (b4_eval): Remove.
18026 (b4_symbol_destructor): Adjust.
18027 * tests/input.at (Invalid @n): Adjust.
18028
18029 2002-06-19 Zack Weinberg <zack@codesourcery.com>
18030
18031 * doc/bison.texinfo: Document ability to have multiple
18032 prologue sections.
18033
18034 2002-06-18 Akim Demaille <akim@epita.fr>
18035
18036 * src/files.c (compute_base_names): When computing the output file
18037 names from the input file name, strip the directory part.
18038
18039 2002-06-18 Akim Demaille <akim@epita.fr>
18040
18041 * data/bison.simple.new: Comment changes.
18042 Reported by Andreas Schwab.
18043
18044 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
18045
18046 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
18047 there are no `label `yyoverflowlab' defined but not used' warnings
18048 when yyoverflow is defined.
18049
18050 2002-06-18 Akim Demaille <akim@epita.fr>
18051
18052 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
18053 new member.
18054 (symbol_destructor_set): Adjust.
18055 * src/output.c (symbol_destructors_output): Output the destructor
18056 locations.
18057 Output the symbol name.
18058 * data/bison.simple (b4_symbol_destructor): Adjust.
18059
18060 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
18061 and Akim Demaille <akim@epita.fr>
18062
18063 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
18064 what's left on the stack when the error recovery hits EOF.
18065 * tests/actions.at (Destructors): Complete to exercise this case.
18066
18067 2002-06-17 Akim Demaille <akim@epita.fr>
18068
18069 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
18070 arguments is really empty, not only equal to `[]'.
18071 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
18072 member.
18073 (symbol_destructor_set): New.
18074 * src/output.c (symbol_destructors_output): New.
18075 * src/reader.h (brace_code_t, current_braced_code): New.
18076 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
18077 (handle_dollar): Rename as...
18078 (handle_action_dollar): this.
18079 (handle_destructor_dollar): New.
18080 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
18081 (grammar_declaration): Use it.
18082 * data/bison.simple (yystos): Is always defined.
18083 (yydestructor): New.
18084 * tests/actions.at (Destructors): New.
18085 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
18086
18087 2002-06-17 Akim Demaille <akim@epita.fr>
18088
18089 * src/symlist.h, src/symlist.c (symbol_list_length): New.
18090 * src/scan-gram.l (handle_dollar, handle_at): Compute the
18091 rule_length only when needed.
18092 * src/output.c (actions_output, token_definitions_output): Output
18093 the full M4 block.
18094 * src/symtab.c: Don't access directly to the symbol tag, use
18095 symbol_tag_get.
18096 * src/parse-gram.y: Use symbol_list_free.
18097
18098 2002-06-17 Akim Demaille <akim@epita.fr>
18099
18100 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
18101 (symbol_list_prepend, get_type_name): Move to...
18102 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
18103 (symbol_list_prepend, symbol_list_n_type_name_get): here.
18104 Adjust all callers.
18105 (symbol_list_free): New.
18106 * src/scan-gram.l (handle_dollar): Takes a location.
18107 * tests/input.at (Invalid $n): Adjust.
18108
18109 2002-06-17 Akim Demaille <akim@epita.fr>
18110
18111 * src/reader.h, src/reader.c (symbol_list_new): Export it.
18112 (symbol_list_prepend): New.
18113 * src/parse-gram.y (%union): `list' is a new member.
18114 (symbols.1): New, replaces...
18115 (terms_to_prec.1, nterms_to_type.1): these.
18116 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
18117 Take a location as additional argument.
18118 Adjust all callers.
18119
18120 2002-06-15 Akim Demaille <akim@epita.fr>
18121
18122 * src/parse-gram.y: Move %token in the declaration section so that
18123 we don't depend upon CVS Bison.
18124
18125 2002-06-15 Akim Demaille <akim@epita.fr>
18126
18127 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
18128 * src/print.c (print_core): Use it.
18129
18130 2002-06-15 Akim Demaille <akim@epita.fr>
18131
18132 * src/conflicts.c (log_resolution): Accept the rule involved in
18133 the sr conflicts instead of the lookahead number that points to
18134 that rule.
18135 (flush_reduce): Accept the current lookahead vector as argument,
18136 instead of the index in LA.
18137 (resolve_sr_conflict): Accept the current number of lookahead
18138 bitset to consider for the STATE, instead of the index in LA.
18139 (set_conflicts): Adjust.
18140 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
18141
18142 2002-06-15 Akim Demaille <akim@epita.fr>
18143
18144 * src/state.h (state_t): Replace the `lookaheadsp' member, a
18145 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
18146 Adjust all dependencies.
18147 * src/lalr.c (initialize_lookaheads): Split into...
18148 (states_lookaheads_count, states_lookaheads_initialize): these.
18149 (lalr): Adjust.
18150
18151 2002-06-15 Akim Demaille <akim@epita.fr>
18152
18153 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
18154 out of...
18155 (grammar_rules_print): here.
18156 * src/reduce.c (reduce_output): Use it.
18157 * tests/reduce.at (Useless Rules, Reduced Automaton)
18158 (Underivable Rules): Adjust.
18159
18160 2002-06-15 Akim Demaille <akim@epita.fr>
18161
18162 Copy BYacc's nice way to report the grammar.
18163
18164 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
18165 New.
18166 Don't print the rules' location, it is confusing and useless.
18167 (rule_print): Use grammar_rhs_print.
18168 * src/print.c (print_grammar): Use grammar_rules_print.
18169
18170 2002-06-15 Akim Demaille <akim@epita.fr>
18171
18172 Complete and rationalize `useless thing' warnings.
18173
18174 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
18175 (symbol_tag_print): New.
18176 Use them everywhere in place of accessing directly the tag member.
18177 * src/gram.h, src/gram.c (rule_print): New.
18178 Use it where a rule used to be printed `by hand'.
18179 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
18180 (reduce_grammar_tables): Report the useless rules.
18181 (reduce_print): Useless things are a warning, not an error.
18182 Report it as such.
18183 * tests/reduce.at (Useless Nonterminals, Useless Rules):
18184 (Reduced Automaton, Underivable Rules): Adjust.
18185 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
18186 * tests/conflicts.at (Unresolved SR Conflicts)
18187 (Solved SR Conflicts): Adjust.
18188
18189 2002-06-15 Akim Demaille <akim@epita.fr>
18190
18191 Let symbols have a location.
18192
18193 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
18194 (getsym): Adjust.
18195 Adjust all callers.
18196 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
18197 Use location_t, not int.
18198 * src/symtab.c (symbol_check_defined): Take advantage of the
18199 location.
18200 * tests/regression.at (Invalid inputs): Adjust.
18201
18202 2002-06-15 Akim Demaille <akim@epita.fr>
18203
18204 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
18205 (input): Don't try to initialize yylloc here, do it in the
18206 scanner.
18207 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
18208 * src/gram.h (rule_t): Change line and action_line into location
18209 and action_location, of location_t type.
18210 Adjust all dependencies.
18211 * src/location.h, src/location.c (empty_location): New.
18212 * src/reader.h, src/reader.c (grammar_start_symbol_set)
18213 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
18214 (grammar_current_rule_symbol_append)
18215 (grammar_current_rule_action_append): Expect a location as argument.
18216 * src/reader.c (grammar_midrule_action): Adjust to attach an
18217 action's location as dummy symbol location.
18218 * src/symtab.h, src/symtab.c (startsymbol_location): New.
18219 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
18220 the line numbers.
18221
18222 2002-06-14 Akim Demaille <akim@epita.fr>
18223
18224 Grammar declarations may be found in the grammar section.
18225
18226 * src/parse-gram.y (rules_or_grammar_declaration): New.
18227 (declarations): Each declaration may end with a semicolon, not
18228 just...
18229 (grammar_declaration): `"%union"'.
18230 (grammar): Branch to rules_or_grammar_declaration.
18231
18232 2002-06-14 Akim Demaille <akim@epita.fr>
18233
18234 * src/main.c (main): Invoke scanner_free.
18235
18236 2002-06-14 Akim Demaille <akim@epita.fr>
18237
18238 * src/output.c (m4_invoke): Extracted from...
18239 (output_skeleton): here.
18240 Free tempfile.
18241
18242 2002-06-14 Akim Demaille <akim@epita.fr>
18243
18244 * src/parse-gram.y (directives, directive, gram)
18245 (grammar_directives, precedence_directives, precedence_directive):
18246 Rename as...
18247 (declarations, declaration, grammar, grammar_declaration)
18248 (precedence_declaration, precedence_declarator): these.
18249 (symbol_declaration): New.
18250
18251 2002-06-14 Akim Demaille <akim@epita.fr>
18252
18253 * src/files.c (action_obstack): Remove, unused.
18254 (output_obstack): Remove it, and all its dependencies, as it is no
18255 longer needed.
18256 * src/reader.c (epilogue_set): Build the epilogue in the
18257 muscle_obstack.
18258 * src/output.h, src/output.c (muscle_obstack): Move to...
18259 * src/muscle_tab.h, src/muscle_tab.h: here.
18260 (muscle_init): Initialize muscle_obstack.
18261 (muscle_free): New.
18262 * src/main.c (main): Call it.
18263
18264 2002-06-14 Akim Demaille <akim@epita.fr>
18265
18266 * src/location.h: New, extracted from...
18267 * src/reader.h: here.
18268 * src/Makefile.am (noinst_HEADERS): Merge into
18269 (bison_SOURCES): this.
18270 Add location.h.
18271 * src/parse-gram.y: Use location_t instead of Bison's.
18272 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
18273 Use location_t instead of ints.
18274
18275 2002-06-14 Akim Demaille <akim@epita.fr>
18276
18277 * data/bison.simple, data/bison.c++: Be sure to restore the
18278 current #line when returning to the skeleton contents after having
18279 exposed the input file's #line.
18280
18281 2002-06-12 Akim Demaille <akim@epita.fr>
18282
18283 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
18284 eager.
18285 * tests/actions.at (Exotic Dollars): New.
18286
18287 2002-06-12 Akim Demaille <akim@epita.fr>
18288
18289 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
18290 ['"/] too eagerly.
18291 * tests/input.at (Torturing the Scanner): New.
18292
18293 2002-06-11 Akim Demaille <akim@epita.fr>
18294
18295 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
18296 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
18297 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
18298 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
18299 * src/reader.c (reader): Use it.
18300
18301 2002-06-11 Akim Demaille <akim@epita.fr>
18302
18303 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
18304 Adjust all callers.
18305 (scanner_last_string_free): New.
18306
18307 2002-06-11 Akim Demaille <akim@epita.fr>
18308
18309 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
18310 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
18311 (last_string, YY_OBS_FREE): New.
18312 Use them when returning an ID.
18313
18314 2002-06-11 Akim Demaille <akim@epita.fr>
18315
18316 Have Bison grammars parsed by a Bison grammar.
18317
18318 * src/reader.c, src/reader.h (prologue_augment): New.
18319 * src/reader.c (copy_definition): Remove.
18320
18321 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
18322 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
18323 (grammar_current_rule_prec_set, grammar_current_rule_check)
18324 (grammar_current_rule_symbol_append)
18325 (grammar_current_rule_action_append): Export.
18326 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
18327 (symbol_list_action_append): Remove.
18328 Hook the routines from reader.
18329 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
18330 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
18331
18332 * src/reader.c (read_declarations): Remove, unused.
18333
18334 * src/parse-gram.y: Handle the epilogue.
18335 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
18336 (grammar_start_symbol_set): this.
18337 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
18338 * src/reader.c (readgram): Remove, unused.
18339 (reader): Adjust to insert eoftoken and axiom where appropriate.
18340
18341 * src/reader.c (copy_dollar): Replace with...
18342 * src/scan-gram.h (handle_dollar): this.
18343 * src/parse-gram.y: Remove `%thong'.
18344
18345 * src/reader.c (copy_at): Replace with...
18346 * src/scan-gram.h (handle_at): this.
18347
18348 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
18349 New.
18350
18351 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
18352 time being.
18353
18354 * src/reader.h, src/reader.c (grammar_rule_end): New.
18355
18356 * src/parse.y (current_type, current_class): New.
18357 Implement `%nterm', `%token' support.
18358 Merge `%term' into `%token'.
18359 (string_as_id): New.
18360 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
18361 type name.
18362
18363 * src/parse-gram.y: Be sure to handle properly the beginning of
18364 rules.
18365
18366 * src/parse-gram.y: Handle %type.
18367 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
18368
18369 * src/parse-gram.y: More directives support.
18370 * src/options.c: No longer handle source directives.
18371
18372 * src/parse-gram.y: Fix %output.
18373
18374 * src/parse-gram.y: Handle %union.
18375 Use the prologue locations.
18376 * src/reader.c (parse_union_decl): Remove.
18377
18378 * src/reader.h, src/reader.c (epilogue_set): New.
18379 * src/parse-gram.y: Use it.
18380
18381 * data/bison.simple, data/bison.c++: b4_stype is now either not
18382 defined, then default to int, or to the contents of %union,
18383 without `union' itself.
18384 Adjust.
18385 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
18386
18387 * src/output.c (actions_output): Don't output braces, as they are
18388 already handled by the scanner.
18389
18390 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
18391 characters to themselves.
18392
18393 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
18394 that the epilogue has a proper #line.
18395
18396 * src/parse-gram.y: Handle precedence/associativity.
18397
18398 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
18399 a terminal.
18400 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
18401 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
18402 at all to define terminals that cannot be emitted.
18403
18404 * src/scan-gram.l: Escape M4 characters.
18405
18406 * src/scan-gram.l: Working properly with escapes in user
18407 strings/characters.
18408
18409 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
18410 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
18411 grammar.
18412 Use more modest sizes, as for the time being the parser does not
18413 release memory, and therefore the process swallows a huge amount
18414 of memory.
18415
18416 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
18417 stricter %token grammar.
18418
18419 * src/symtab.h (associativity): Add `undef_assoc'.
18420 (symbol_precedence_set): Do nothing when passed an undef_assoc.
18421 * src/symtab.c (symbol_check_alias_consistence): Adjust.
18422
18423 * tests/regression.at (Invalid %directive): Remove, as it is now
18424 meaningless.
18425 (Invalid inputs): Adjust to the new error messages.
18426 (Token definitions): The new grammar doesn't allow too many
18427 eccentricities.
18428
18429 * src/lex.h, src/lex.c: Remove.
18430 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
18431 (copy_character, copy_string2, copy_string, copy_identifier)
18432 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
18433 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
18434 (parse_action): Remove.
18435 * po/POTFILES.in: Adjust.
18436
18437 2002-06-11 Akim Demaille <akim@epita.fr>
18438
18439 * src/reader.c (parse_action): Don't store directly into the
18440 rule's action member: return the action as a string.
18441 Don't require `rule_length' as an argument: compute it.
18442 (grammar_current_rule_symbol_append)
18443 (grammar_current_rule_action_append): New, eved out from
18444 (readgram): here.
18445 Remove `action_flag', `rulelength', unused now.
18446
18447 2002-06-11 Akim Demaille <akim@epita.fr>
18448
18449 * src/reader.c (grammar_current_rule_prec_set).
18450 (grammar_current_rule_check): New, eved out from...
18451 (readgram): here.
18452 Remove `xaction', `first_rhs': useless.
18453 * tests/input.at (Type clashes): New.
18454 * tests/existing.at (GNU Cim Grammar): Adjust.
18455
18456 2002-06-11 Akim Demaille <akim@epita.fr>
18457
18458 * src/reader.c (grammar_midrule_action): New, Eved out from
18459 (readgram): here.
18460
18461 2002-06-11 Akim Demaille <akim@epita.fr>
18462
18463 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
18464 New.
18465 (readgram): Use them as replacement of inlined code, crule and
18466 crule1.
18467
18468 2002-06-11 Akim Demaille <akim@epita.fr>
18469
18470 * src/reader.c (grammar_end, grammar_symbol_append): New.
18471 (readgram): Use them.
18472 Make the use of `p' as local as possible.
18473
18474 2002-06-10 Akim Demaille <akim@epita.fr>
18475
18476 GCJ's parser requires the tokens to be defined before the prologue.
18477
18478 * data/bison.simple: Output the token definition before the user's
18479 prologue.
18480 * tests/regression.at (Braces parsing, Duplicate string)
18481 (Mixing %token styles): Check the output from bison.
18482 (Early token definitions): New.
18483
18484 2002-06-10 Akim Demaille <akim@epita.fr>
18485
18486 * src/symtab.c (symbol_user_token_number_set): Don't complain when
18487 assigning twice the same user number to a token, so that we can
18488 use it in...
18489 * src/lex.c (lex): here.
18490 Also use `symbol_class_set' instead of hand written code.
18491 * src/reader.c (parse_assoc_decl): Likewise.
18492
18493 2002-06-10 Akim Demaille <akim@epita.fr>
18494
18495 * src/symtab.c, src/symtab.c (symbol_class_set)
18496 (symbol_user_token_number_set): New.
18497 * src/reader.c (parse_token_decl): Use them.
18498 Use a switch instead of ifs.
18499 Use a single argument.
18500
18501 2002-06-10 Akim Demaille <akim@epita.fr>
18502
18503 Remove `%thong' support as it is undocumented, unused, duplicates
18504 `%token's job, and creates useless e-mail traffic with people who
18505 want to know what it is, why it is undocumented, unused, and
18506 duplicates `%token's job.
18507
18508 * src/reader.c (parse_thong_decl): Remove.
18509 * src/options.c (option_table): Remove "thong".
18510 * src/lex.h (tok_thong): Remove.
18511
18512 2002-06-10 Akim Demaille <akim@epita.fr>
18513
18514 * src/symtab.c, src/symtab.c (symbol_type_set)
18515 (symbol_precedence_set): New.
18516 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
18517 (value_components_used): Remove, unused.
18518
18519 2002-06-09 Akim Demaille <akim@epita.fr>
18520
18521 Move symbols handling code out of the reader.
18522
18523 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
18524 (axiom): Move to...
18525 * src/symtab.h, src/symtab.c: here.
18526
18527 * src/gram.c (start_symbol): Remove: use startsymbol->number.
18528 * src/reader.c (startval): Rename as...
18529 * src/symtab.h, src/symtab.c (startsymbol): this.
18530 * src/reader.c: Adjust.
18531
18532 * src/reader.c (symbol_check_defined, symbol_make_alias)
18533 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
18534 (token_translations_init)
18535 Move to...
18536 * src/symtab.c: here.
18537 * src/reader.c (packsymbols): Move to...
18538 * src/symtab.h, src/symtab.c (symbols_pack): here.
18539 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
18540 argument.
18541
18542 2002-06-03 Akim Demaille <akim@epita.fr>
18543
18544 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
18545 then statements.
18546
18547 2002-06-03 Akim Demaille <akim@epita.fr>
18548
18549 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
18550 structs with non literals.
18551 * src/scan-skel.l: never-interactive.
18552 * src/conflicts.c (enum conflict_resolution_e): No trailing
18553 comma.
18554 * src/getargs.c (usage): Split long literal strings.
18555 Reported by Hans Aberg.
18556
18557 2002-05-28 Akim Demaille <akim@epita.fr>
18558
18559 * data/bison.c++: Use C++ ostreams.
18560 (cdebug_): New member.
18561
18562 2002-05-28 Akim Demaille <akim@epita.fr>
18563
18564 * src/output.c (output_skeleton): Be sure to allocate enough room
18565 for `/' _and_ for `\0' in full_skeleton.
18566
18567 2002-05-28 Akim Demaille <akim@epita.fr>
18568
18569 * data/bison.c++: Catch up with bison.simple:
18570 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18571 and Paul Eggert <eggert@twinsun.com>: `error' handing.
18572 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
18573 and popping traces.
18574
18575 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18576
18577 * src/output.c (output_skeleton): Put an explicit path in front of
18578 the skeleton file name, rather than relying on the -I directory,
18579 to partially alleviate effects of having a skeleton file lying around
18580 in the current directory.
18581
18582 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18583
18584 * src/conflicts.c (log_resolution): Correct typo:
18585 obstack_printf should be obstack_fgrow1.
18586
18587 2002-05-26 Akim Demaille <akim@epita.fr>
18588
18589 * src/state.h (state_t): `solved_conflicts' is a new member.
18590 * src/LR0.c (new_state): Set it to 0.
18591 * src/conflicts.h, src/conflicts.c (print_conflicts)
18592 (free_conflicts, solve_conflicts): Rename as...
18593 (conflicts_print, conflicts_free, conflicts_solve): these.
18594 Adjust callers.
18595 * src/conflicts.c (enum conflict_resolution_e)
18596 (solved_conflicts_obstack): New, used by...
18597 (log_resolution): this.
18598 Adjust to attach the conflict resolution to each state.
18599 Complete the description with the precedence/associativity
18600 information.
18601 (resolve_sr_conflict): Adjust.
18602 * src/print.c (print_state): Output its solved_conflicts.
18603 * tests/conflicts.at (Unresolved SR Conflicts)
18604 (Solved SR Conflicts): Exercise --report=all.
18605
18606 2002-05-26 Akim Demaille <akim@epita.fr>
18607
18608 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
18609 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
18610 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
18611 (token_number_t, item_number_as_token_number)
18612 (token_number_as_item_number, muscle_insert_token_number_table):
18613 Rename as...
18614 (symbol_number_t, item_number_as_symbol_number)
18615 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
18616 these, since it is more appropriate.
18617
18618 2002-05-26 Akim Demaille <akim@epita.fr>
18619
18620 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
18621 `Error:' lines.
18622 * data/bison.simple (yystos) [YYDEBUG]: New.
18623 (yyparse) [YYDEBUG]: Display the symbols which are popped during
18624 error recovery.
18625 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
18626
18627 2002-05-25 Akim Demaille <akim@epita.fr>
18628
18629 * doc/bison.texinfo (Debugging): Split into...
18630 (Tracing): this new section, its former contents, and...
18631 (Understanding): this new section.
18632 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
18633 by...
18634 (report_flag): this.
18635 Adjust all dependencies.
18636 (report_args, report_types, report_argmatch): New.
18637 (usage, getargs): Report/support -r, --report.
18638 * src/options.h
18639 (struct option_table_struct): Rename as..,
18640 (struct option_table_s): this.
18641 Rename the `set_flag' member to `flag' to match with getopt_long's
18642 struct.
18643 * src/options.c (option_table): Split verbose into an entry for
18644 %verbose, and another for --verbose.
18645 Support --report/-r, so remove -r from the obsolete --raw.
18646 * src/print.c: Attach full item sets and lookaheads reports to
18647 report_flag instead of trace_flag.
18648 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
18649
18650 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18651 and Paul Eggert <eggert@twinsun.com>
18652
18653 * data/bison.simple (yyparse): Correct error handling to conform to
18654 POSIX and yacc. Specifically, after syntax error is discovered,
18655 do not reduce further before shifting the error token.
18656 Clean up the code a bit by removing the labels yyerrdefault,
18657 yyerrhandle, yyerrpop.
18658 * NEWS: Document the above.
18659
18660 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18661
18662 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
18663 type; it isn't always big enough, since it doesn't necessarily
18664 include non-terminals.
18665 (yytranslate): Expand definition of yy_token_number_type, so that
18666 the latter can be removed.
18667 (yy_token_number_type): Remove, only one use.
18668 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
18669 don't use TokenNumberType as element type.
18670
18671 * tests/regression.at: Modify expected output to agree with change
18672 to yyr1 and yytranslate.
18673
18674 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
18675
18676 * src/reader.c (parse_action): Use copy_character instead of
18677 obstack_1grow.
18678
18679 2002-05-13 Akim Demaille <akim@epita.fr>
18680
18681 * tests/regression.at (Token definitions): Prototype yylex and
18682 yyerror.
18683
18684 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18685
18686 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
18687 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
18688 32-bit arithmetic.
18689 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
18690
18691 2002-05-07 Akim Demaille <akim@epita.fr>
18692
18693 * tests/synclines.at: Be sure to prototype yylex and yyerror to
18694 avoid GCC warnings.
18695
18696 2002-05-07 Akim Demaille <akim@epita.fr>
18697
18698 Kill GCC warnings.
18699
18700 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
18701 over the RHS of each rule.
18702 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
18703 * src/state.h (state_t): Member `nitems' is unsigned short.
18704 * src/LR0.c (get_state): Adjust.
18705 * src/reader.c (packgram): Likewise.
18706 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
18707 `Type'.
18708 (muscle_insert_int_table): Remove, unused.
18709 (prepare_rules): Remove `max'.
18710
18711 2002-05-06 Akim Demaille <akim@epita.fr>
18712
18713 * src/closure.c (print_firsts): Display of the symbol tags.
18714 (bitmatrix_print): Move to...
18715 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
18716 here.
18717 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
18718
18719 2002-05-06 Akim Demaille <akim@epita.fr>
18720
18721 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
18722 hash_do_for_each.
18723
18724 2002-05-06 Akim Demaille <akim@epita.fr>
18725
18726 * src/LR0.c (new_state, get_state): Instead of using the global
18727 `kernel_size' and `kernel_base', have two new arguments:
18728 `core_size' and `core'.
18729 Adjust callers.
18730
18731 2002-05-06 Akim Demaille <akim@epita.fr>
18732
18733 * src/reader.c (packgram): No longer end `ritem' with a 0
18734 sentinel: it is not used.
18735
18736 2002-05-05 Akim Demaille <akim@epita.fr>
18737
18738 New experimental feature: display the lookaheads in the report and
18739 graph.
18740
18741 * src/print (print_core): When --trace-flag, display the rules
18742 lookaheads.
18743 * src/print_graph.c (print_core): Likewise.
18744 Swap the arguments.
18745 Adjust caller.
18746
18747 2002-05-05 Akim Demaille <akim@epita.fr>
18748
18749 * tests/torture.at (Many lookaheads): New test.
18750
18751 2002-05-05 Akim Demaille <akim@epita.fr>
18752
18753 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
18754 (GENERATE_MUSCLE_INSERT_TABLE): this.
18755 (output_int_table, output_unsigned_int_table, output_short_table)
18756 (output_token_number_table, output_item_number_table): Replace with...
18757 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
18758 (muscle_insert_short_table, muscle_insert_token_number_table)
18759 (muscle_insert_item_number_table): these.
18760 Adjust all callers.
18761 (prepare_tokens): Don't free `translations', since...
18762 * src/reader.h, src/reader.c (grammar_free): do it.
18763 Move to...
18764 * src/gram.h, src/gram.c (grammar_free): here.
18765 * data/bison.simple, data/bison.c++: b4_token_number_max is now
18766 b4_translate_max.
18767
18768 2002-05-05 Akim Demaille <akim@epita.fr>
18769
18770 * src/output.c (output_unsigned_int_table): New.
18771 (prepare_rules): `i' is unsigned.
18772 `prhs', `rline', `r2' are unsigned int.
18773 Rename muscle `rhs_number_max' as `rhs_max'.
18774 Output muscles `prhs_max', `rline_max', and `r2_max'.
18775 Free rline and r1.
18776 * data/bison.simple, data/bison.c++: Adjust to use these muscles
18777 to compute types instead of constant types.
18778 * tests/regression.at (Web2c Actions): Adjust.
18779
18780 2002-05-04 Akim Demaille <akim@epita.fr>
18781
18782 * src/symtab.h (SALIAS, SUNDEF): Rename as...
18783 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
18784 Adjust dependencies.
18785 * src/output.c (token_definitions_output): Be sure not to output a
18786 `#define 'a'' when fed with `%token 'a' "a"'.
18787 * tests/regression.at (Token definitions): New.
18788
18789 2002-05-03 Paul Eggert <eggert@twinsun.com>
18790
18791 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
18792 for K&R C.
18793
18794 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
18795
18796 * Makefile.am (SUBDIRS): Remove intl.
18797 (EXTRA_DIST): Add config/config.rpath.
18798
18799 2002-05-03 Akim Demaille <akim@epita.fr>
18800
18801 * data/bison.simple (m4_if): Don't output empty enums.
18802 And actually, output valid enum definitions :(.
18803
18804 2002-05-03 Akim Demaille <akim@epita.fr>
18805
18806 * configure.bat: Remove, completely obsolete.
18807 * Makefile.am (EXTRA_DIST): Adjust.
18808 Don't distribute config.rpath...
18809 * config/Makefile.am (EXTRA_DIST): Do it.
18810
18811 2002-05-03 Akim Demaille <akim@epita.fr>
18812
18813 * configure.in (GETTEXT_VERSION): New.
18814 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
18815
18816 2002-05-03 Akim Demaille <akim@epita.fr>
18817
18818 * data/bison.simple (b4_token_enum): New.
18819 (b4_token_defines): Use it to output tokens both as #define and
18820 enums.
18821 Suggested by Paul Eggert.
18822 * src/output.c (token_definitions_output): Don't output spurious
18823 white spaces.
18824
18825 2002-05-03 Akim Demaille <akim@epita.fr>
18826
18827 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
18828
18829 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
18830
18831 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
18832 Update the stack class, give a try to deque as the default container.
18833
18834 2002-05-02 Akim Demaille <akim@epita.fr>
18835
18836 * data/bison.simple (yyparse): Do not implement @$ = @1.
18837 (YYLLOC_DEFAULT): Adjust to do it.
18838 * doc/bison.texinfo (Location Default Action): Fix.
18839
18840 2002-05-02 Akim Demaille <akim@epita.fr>
18841
18842 * src/reader.c (parse_braces): Merge into...
18843 (parse_action): this.
18844
18845 2002-05-02 Akim Demaille <akim@epita.fr>
18846
18847 * configure.in (ALL_LINGUAS): Remove.
18848 * po/LINGUAS, hr.po: New.
18849
18850 2002-05-02 Akim Demaille <akim@epita.fr>
18851
18852 Remove the so called hairy (semantic) parsers.
18853
18854 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
18855 * src/gram.h, src/gram.c (semantic_parser): Remove.
18856 (rule_t): Remove the guard and guard_line members.
18857 * src/lex.h (token_t): remove tok_guard.
18858 * src/options.c (option_table): Remove %guard and %semantic_parser
18859 support.
18860 * src/output.c, src/output.h (guards_output): Remove.
18861 (prepare): Adjust.
18862 (token_definitions_output): Don't output the `T'
18863 tokens (???).
18864 (output_skeleton): Don't output the guards.
18865 * src/files.c, src/files.c (attrsfile): Remove.
18866 * src/reader.c (symbol_list): Remove the guard and guard_line
18867 members.
18868 Adjust dependencies.
18869 (parse_guard): Remove.
18870 * data/bison.hairy: Remove.
18871 * doc/bison.texinfo (Environment Variables): Remove occurrences of
18872 BISON_HAIRY.
18873
18874 2002-05-02 Akim Demaille <akim@epita.fr>
18875
18876 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
18877 (parse_guard): Rename the formal argument `stack_offset' as
18878 `rule_length', which is more readable.
18879 Adjust callers.
18880 (copy_at, copy_dollar): Instead of outputting the hard coded
18881 values of $$, $n and so forth, output invocation to b4_lhs_value,
18882 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
18883 Note: this patch partially drops `semantic-parser' support: it
18884 always does `rule_length - n', where semantic parsers ought to
18885 always use `-n'.
18886 * data/bison.simple, data/bison.c++ (b4_lhs_value)
18887 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
18888
18889 2002-05-02 Akim Demaille <akim@epita.fr>
18890
18891 * configure.in (AC_INIT): Bump to 1.49b.
18892 (AM_INIT_AUTOMAKE): Short invocation.
18893
18894 2002-05-02 Akim Demaille <akim@epita.fr>
18895
18896 Version 1.49a.
18897
18898 2002-05-01 Akim Demaille <akim@epita.fr>
18899
18900 * src/skeleton.h: Remove.
18901
18902 2002-05-01 Akim Demaille <akim@epita.fr>
18903
18904 * src/skeleton.h: Fix the #endif.
18905 Reported by Magnus Fromreide.
18906
18907 2002-04-26 Paul Eggert <eggert@twinsun.com>
18908
18909 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
18910 Define if we define YYSTYPE and YYLTYPE, respectively.
18911 (YYCOPY): Fix [] quoting problem in the non-GCC case.
18912
18913 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
18914
18915 * src/scan-skel.l: Postprocess quadrigraphs.
18916
18917 * src/reader.c (copy_character): New function, used to output
18918 single characters while replacing `[' and `]' with quadrigraphs, to
18919 avoid troubles with M4 quotes.
18920 (copy_comment): Output characters with copy_character.
18921 (read_additionnal_code): Likewise.
18922 (copy_string2): Likewise.
18923 (copy_definition): Likewise.
18924
18925 * tests/calc.at: Exercise M4 quoting.
18926
18927 2002-04-25 Akim Demaille <akim@epita.fr>
18928
18929 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
18930 between `!' and the command.
18931 Reported by Paul Eggert.
18932
18933 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
18934
18935 * tests/calc.at: Exercise prologue splitting.
18936
18937 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
18938 `b4_post_prologue' instead of `b4_prologue'.
18939
18940 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
18941 muscles.
18942 (output): Free pre_prologue_obstack and post_prologue_obstack.
18943 * src/files.h, src/files.c (attrs_obstack): Remove.
18944 (pre_prologue_obstack, post_prologue_obstack): New.
18945 * src/reader.c (copy_definition): Add a parameter to specify the
18946 obstack to fill, instead of using attrs_obstack unconditionally.
18947 (read_declarations): Pass pre_prologue_obstack to copy_definition if
18948 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
18949
18950 2002-04-23 Paul Eggert <eggert@twinsun.com>
18951
18952 * data/bison.simple: Remove unnecessary commentary and white
18953 space differences from 1_29-branch.
18954 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
18955
18956 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
18957 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
18958 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
18959 constructors or destructors.
18960
18961 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
18962
18963 2002-04-23 Akim Demaille <akim@epita.fr>
18964
18965 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
18966 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
18967 location with columns.
18968 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
18969 All reported by Paul Eggert.
18970
18971 2002-04-22 Akim Demaille <akim@epita.fr>
18972
18973 * src/reduce.c (dump_grammar): Move to...
18974 * src/gram.h, src/gram.c (grammar_dump): here.
18975 Be sure to separate long item numbers.
18976 Don't read the members of a rule's prec if its nil.
18977
18978 2002-04-22 Akim Demaille <akim@epita.fr>
18979
18980 * src/output.c (table_size, table_grow): New.
18981 (MAXTABLE): Remove, replace uses with table_size.
18982 (pack_vector): Instead of dying when the table is too big, grow it.
18983
18984 2002-04-22 Akim Demaille <akim@epita.fr>
18985
18986 * data/bison.simple (yyr1): Its type is that of a token number.
18987 * data/bison.c++ (r1_): Likewise.
18988 * tests/regression.at (Web2c Actions): Adjust.
18989
18990 2002-04-22 Akim Demaille <akim@epita.fr>
18991
18992 * src/reader.c (token_translations_init): 256 is now the default
18993 value for the error token, i.e., it will be assigned another
18994 number if the user assigned 256 to one of her tokens.
18995 (reader): Don't force 256 to error.
18996 * doc/bison.texinfo (Symbols): Adjust.
18997 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
18998 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
18999 etc. instead of 10, 20, 30 (which was used to `jump' over error
19000 (256) and undefined (2)).
19001
19002 2002-04-22 Akim Demaille <akim@epita.fr>
19003
19004 Propagate more token_number_t.
19005
19006 * src/gram.h (token_number_as_item_number)
19007 (item_number_as_token_number): New.
19008 * src/output.c (GENERATE_OUTPUT_TABLE): New.
19009 Use it to create output_item_number_table and
19010 output_token_number_table.
19011 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
19012 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
19013 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
19014 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
19015
19016 2002-04-22 Akim Demaille <akim@epita.fr>
19017
19018 * src/output.h, src/output.c (get_lines_number): Remove.
19019
19020 2002-04-19 Akim Demaille <akim@epita.fr>
19021
19022 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
19023 as Lex/Flex'.
19024 (Debugging): More details about enabling the debugging features.
19025 (Table of Symbols): Describe $$, $n, @$, and @n.
19026 Suggested by Tim Josling.
19027
19028 2002-04-19 Akim Demaille <akim@epita.fr>
19029
19030 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
19031
19032 2002-04-10 Akim Demaille <akim@epita.fr>
19033
19034 * src/system.h: Rely on HAVE_LIMITS_H.
19035 Suggested by Paul Eggert.
19036
19037 2002-04-09 Akim Demaille <akim@epita.fr>
19038
19039 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
19040 full stderr, and strip it according to the bison options, instead
19041 of composing the error message from different bits.
19042 This makes it easier to check for several error messages.
19043 Adjust all the invocations.
19044 Add an invocation exercising the error token.
19045 Add an invocation demonstrating a stupid error message.
19046 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
19047 Adjust the tests.
19048 Error message are for stderr, not stdout.
19049
19050 2002-04-09 Akim Demaille <akim@epita.fr>
19051
19052 * src/gram.h, src/gram.c (error_token_number): Remove, use
19053 errtoken->number.
19054 * src/reader.c (reader): Don't specify the user token number (2)
19055 for $undefined, as it uselessly prevents using it.
19056 * src/gram.h (token_number_t): Move to...
19057 * src/symtab.h: here.
19058 (state_t.number): Is a token_number_t.
19059 * src/print.c, src/reader.c: Use undeftoken->number instead of
19060 hard coded 2.
19061 (Even though this 2 is not the same as above: the number of the
19062 undeftoken remains being 2, it is its user token number which
19063 might not be 2).
19064 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
19065 `user_token_number_max'.
19066 Output `undef_token_number'.
19067 * data/bison.simple, data/bison.c++: Use them.
19068 Be sure to map invalid yylex return values to
19069 `undef_token_number'. This saves us from gratuitous SEGV.
19070
19071 * tests/conflicts.at (Solved SR Conflicts)
19072 (Unresolved SR Conflicts): Adjust.
19073 * tests/regression.at (Web2c Actions): Adjust.
19074
19075 2002-04-08 Akim Demaille <akim@epita.fr>
19076
19077 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
19078 Adding #line.
19079 Remove the duplicate `typedefs'.
19080 (RhsNumberType): Fix the declaration and various other typos.
19081 Use __ofile__.
19082 * data/bison.simple: Use __ofile__.
19083 * src/scan-skel.l: Handle __ofile__.
19084
19085 2002-04-08 Akim Demaille <akim@epita.fr>
19086
19087 * src/gram.h (item_number_t): New, the type of item numbers in
19088 RITEM. Note that it must be able to code symbol numbers as
19089 positive number, and the negation of rule numbers as negative
19090 numbers.
19091 Adjust all dependencies (pretty many).
19092 * src/reduce.c (rule): Remove this `short *' pointer: use
19093 item_number_t.
19094 * src/system.h (MINSHORT, MAXSHORT): Remove.
19095 Include `limits.h'.
19096 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
19097 (shortcpy): Remove.
19098 (MAXTABLE): Move to...
19099 * src/output.c (MAXTABLE): here.
19100 (prepare_rules): Use output_int_table to output rhs.
19101 * data/bison.simple, data/bison.c++: Adjust.
19102 * tests/torture.at (Big triangle): Move the limit from 254 to
19103 500.
19104 * tests/regression.at (Web2c Actions): Ajust.
19105
19106 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
19107 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
19108 passes, but produces negative #line number, once fixed, GCC is
19109 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
19110 C), it passes.
19111 * src/state.h (state_h): Code input lines on ints, not shorts.
19112
19113 2002-04-08 Akim Demaille <akim@epita.fr>
19114
19115 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
19116 and then the grammar.
19117
19118 2002-04-08 Akim Demaille <akim@epita.fr>
19119
19120 * src/system.h: No longer using strndup.
19121
19122 2002-04-07 Akim Demaille <akim@epita.fr>
19123
19124 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
19125 * src/output.c (output_table_data): Return the longest number.
19126 (prepare_tokens): Output `token_number_max').
19127 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
19128 New.
19129 Use them to define yy_token_number_type/TokenNumberType.
19130 Use this type for yytranslate.
19131 * tests/torture.at (Big triangle): Push the limit from 124 to
19132 253.
19133 * tests/regression.at (Web2c Actions): Adjust.
19134
19135 2002-04-07 Akim Demaille <akim@epita.fr>
19136
19137 * tests/torture.at (Big triangle): New.
19138 (GNU AWK Grammar, GNU Cim Grammar): Move to...
19139 * tests/existing.at: here.
19140
19141 2002-04-07 Akim Demaille <akim@epita.fr>
19142
19143 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
19144 nritems.
19145 Adjust dependencies.
19146
19147 2002-04-07 Akim Demaille <akim@epita.fr>
19148
19149 * src/reader.c: Normalize increments to prefix form.
19150
19151 2002-04-07 Akim Demaille <akim@epita.fr>
19152
19153 * src/reader.c, symtab.c: Remove debugging code.
19154
19155 2002-04-07 Akim Demaille <akim@epita.fr>
19156
19157 Rename all the `bucket's as `symbol_t'.
19158
19159 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
19160 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
19161 * src/symtab.c, src/symtab.h (bucket): Rename as...
19162 (symbol_t): this.
19163 (symbol_list_new, bucket_check_defined, bucket_make_alias)
19164 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
19165 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
19166 (buckets_new, buckets_free, buckets_do): Rename as...
19167 (symbol_list_new, symbol_check_defined, symbol_make_alias)
19168 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
19169 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
19170 (symbols_new, symbols_free, symbols_do): these.
19171
19172 2002-04-07 Akim Demaille <akim@epita.fr>
19173
19174 Use lib/hash for the symbol table.
19175
19176 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
19177 EOF.
19178 * src/lex.c (lex): Set the `number' member of new terminals.
19179 * src/reader.c (bucket_check_defined, bucket_make_alias)
19180 (bucket_check_alias_consistence, bucket_translation): New.
19181 (reader, grammar_free, readgram, token_translations_init)
19182 (packsymbols): Adjust.
19183 (reader): Number the predefined tokens.
19184 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
19185 for predefined tokens.
19186 * src/symtab.h (bucket): Remove all the hash table related
19187 members.
19188 * src/symtab.c (symtab): Replace by...
19189 (bucket_table): this.
19190 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
19191 (buckets_new, buckets_do): New.
19192
19193 2002-04-07 Akim Demaille <akim@epita.fr>
19194
19195 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
19196 (start_symbol, max_user_token_number, semantic_parser)
19197 (error_token_number): Initialize.
19198 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
19199 Initialize.
19200 (reader): Don't.
19201 (errtoken, eoftoken, undeftoken, axiom): Extern.
19202
19203 2002-04-07 Akim Demaille <akim@epita.fr>
19204
19205 * src/gram.h (rule_s): prec and precsym are now pointers
19206 to the bucket giving the priority/associativity.
19207 Member `associativity' removed: useless.
19208 * src/reduce.c, src/conflicts.c: Adjust.
19209
19210 2002-04-07 Akim Demaille <akim@epita.fr>
19211
19212 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
19213 Properly escape the symbols' TAG when outputting them.
19214
19215 2002-04-07 Akim Demaille <akim@epita.fr>
19216
19217 * src/lalr.h (LA): Is a bitsetv, not bitset*.
19218
19219 2002-04-07 Akim Demaille <akim@epita.fr>
19220
19221 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
19222 (LArule): this, which is an array to rule_t*.
19223 * src/print.c, src/conflicts.c: Adjust.
19224
19225 2002-04-07 Akim Demaille <akim@epita.fr>
19226
19227 * src/gram.h (rule_t): Rename `number' as `user_number'.
19228 `number' is a new member.
19229 Adjust dependencies.
19230 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
19231
19232 2002-04-07 Akim Demaille <akim@epita.fr>
19233
19234 As a result of the previous patch, it is no longer needed
19235 to reorder ritem itself.
19236
19237 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
19238
19239 2002-04-07 Akim Demaille <akim@epita.fr>
19240
19241 Be sure never to walk through RITEMS, but use only data related to
19242 the rules themselves. RITEMS should be banished.
19243
19244 * src/output.c (output_token_translations): Rename as...
19245 (prepare_tokens): this.
19246 In addition to `translate', prepare the muscles `tname' and
19247 `toknum', which were handled by...
19248 (output_rule_data): this.
19249 Remove, and move the remainder of its outputs into...
19250 (prepare_rules): this new routines, which also merges content from
19251 (output_gram): this.
19252 (prepare_rules): Be sure never to walk through RITEMS.
19253 (output_stos): Rename as...
19254 (prepare_stos): this.
19255 (output): Always invoke prepare_states, after all, just don't use it
19256 in the output if you don't need it.
19257
19258 2002-04-07 Akim Demaille <akim@epita.fr>
19259
19260 * src/LR0.c (new_state): Display `nstates' as the name of the
19261 newly created state.
19262 Adjust to initialize first_state and last_state if needed.
19263 Be sure to distinguish the initial from the final state.
19264 (new_states): Create the itemset of the initial state, and use
19265 new_state.
19266 * src/closure.c (closure): Now that the initial state has its
19267 items properly set, there is no need for a special case when
19268 creating `ruleset'.
19269
19270 As a result, now the rule 0, reducing to $axiom, is visible in the
19271 outputs. Adjust the test suite.
19272
19273 * tests/conflicts.at (Solved SR Conflicts)
19274 (Unresolved SR Conflicts): Adjust.
19275 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
19276 * tests/conflicts.at (S/R in initial): New.
19277
19278 2002-04-07 Akim Demaille <akim@epita.fr>
19279
19280 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
19281 the RHS of the rules.
19282 * src/output.c (output_gram): Likewise.
19283
19284 2002-04-07 Akim Demaille <akim@epita.fr>
19285
19286 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
19287 bucket.
19288 Adjust all dependencies.
19289 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
19290 `number' of the buckets too.
19291 * src/gram.h: Include `symtab.h'.
19292 (associativity): Move to...
19293 * src/symtab.h: here.
19294 No longer include `gram.h'.
19295
19296 2002-04-07 Akim Demaille <akim@epita.fr>
19297
19298 * src/gram.h, src/gram.c (rules_rhs_length): New.
19299 (ritem_longest_rhs): Use it.
19300 * src/gram.h (rule_t): `number' is a new member.
19301 * src/reader.c (packgram): Set it.
19302 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
19303 the end of `rules', and count them out of `nrules'.
19304 (reduce_output, dump_grammar): Adjust.
19305 * src/print.c (print_grammar): It is no longer needed to check for
19306 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
19307 * tests/reduce.at (Reduced Automaton): New test.
19308
19309 2002-04-07 Akim Demaille <akim@epita.fr>
19310
19311 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
19312 lacking `+ 1' to nrules, Bison reported as useless a token if it
19313 was used solely to set the precedence of the last rule...
19314
19315 2002-04-07 Akim Demaille <akim@epita.fr>
19316
19317 * data/bison.c++, data/bison.simple: Don't output the current file
19318 name in #line, to avoid useless diffs between two identical
19319 outputs under different names.
19320
19321 2002-04-07 Akim Demaille <akim@epita.fr>
19322
19323 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
19324 Normalize loops to using `< nrules + 1', not `<= nrules'.
19325
19326 2002-04-07 Akim Demaille <akim@epita.fr>
19327
19328 * TODO: Update.
19329
19330 2002-04-07 Akim Demaille <akim@epita.fr>
19331
19332 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
19333 bucket.value as bucket.number.
19334
19335 2002-04-07 Akim Demaille <akim@epita.fr>
19336
19337 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
19338 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
19339 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
19340 RHS, instead of being an index in RITEMS.
19341
19342 2002-04-04 Paul Eggert <eggert@twinsun.com>
19343
19344 * doc/bison.texinfo: Update copyright date.
19345 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
19346 (Symbols): Warn about running Bison in one character set,
19347 but compiling and/or running in an incompatible one.
19348 Warn about character code 256, too.
19349
19350 2002-04-03 Paul Eggert <eggert@twinsun.com>
19351
19352 * src/bison.data (YYSTACK_ALLOC): Depend on whether
19353 YYERROR_VERBOSE is nonzero, not whether it is defined.
19354
19355 Merge changes from bison-1_29-branch.
19356
19357 2002-03-20 Paul Eggert <eggert@twinsun.com>
19358
19359 Merge fixes from Debian bison_1.34-1.diff.
19360
19361 * configure.in (AC_PREREQ): 2.53.
19362
19363 2002-03-20 Akim Demaille <akim@epita.fr>
19364
19365 * src/conflicts.c (log_resolution): Argument `resolution' is const.
19366
19367 2002-03-19 Paul Eggert <eggert@twinsun.com>
19368
19369 * src/bison.simple (YYCOPY): New macro.
19370 (YYSTACK_RELOCATE): Use it.
19371 Remove Type arg; no longer needed. All callers changed.
19372 (yymemcpy): Remove; no longer needed.
19373
19374 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
19375 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
19376
19377 2002-03-19 Akim Demaille <akim@epita.fr>
19378
19379 Test and fix the #line outputs.
19380
19381 * tests/atlocal.at (GCC): New.
19382 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
19383 (Prologue synch line, %union synch line, Postprologue synch line)
19384 (Action synch line, Epilogue synch line): New tests.
19385 * src/reader.c (parse_union_decl): Define the muscle stype_line.
19386 * data/bison.simple, data/bison.c++: Use it.
19387
19388 2002-03-19 Akim Demaille <akim@epita.fr>
19389
19390 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
19391 (Solved SR Conflicts, %expect not enough, %expect right)
19392 (%expect too much): Move to...
19393 * tests/conflicts.at: this new file.
19394
19395 2002-03-19 Akim Demaille <akim@epita.fr>
19396
19397 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19398 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
19399 that we can move to enums for instance.
19400 * src/output.c (token_definitions_output): Output a list of
19401 `token-name, token-number' instead of the #define.
19402 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
19403
19404 2002-03-14 Akim Demaille <akim@epita.fr>
19405
19406 Use Gettext 0.11.1.
19407
19408 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
19409
19410 * data/bison.c++: Make the user able to add members to the generated
19411 parser by subclassing.
19412
19413 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
19414
19415 * src/reader.c (read_additionnal_code): `c' should be an integer, not
19416 a character.
19417 Reported by Nicolas Tisserand and Nicolas Burrus.
19418
19419 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
19420
19421 * src/reader.c: Warn about lacking semi-colons, do not complain.
19422
19423 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
19424
19425 * data/bison.c++: Remove a debug line.
19426
19427 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
19428
19429 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
19430 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
19431 provide a default implementation.
19432
19433 2002-03-04 Akim Demaille <akim@epita.fr>
19434
19435 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
19436 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
19437 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
19438 * tests/semantic.at (Parsing Guards): Similarly.
19439 * src/reader.at (readgram): Complain if the last rule is not ended
19440 with a semi-colon.
19441
19442 2002-03-04 Akim Demaille <akim@epita.fr>
19443
19444 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
19445 * src/closure.c: here.
19446 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
19447 RTC.
19448 * src/warshall.h, src/warshall.c: Remove.
19449 * tests/sets.at (Broken Closure): Adjust.
19450
19451 2002-03-04 Akim Demaille <akim@epita.fr>
19452
19453 * src/output.c (output_skeleton): tempdir is const.
19454 bytes_read is unused.
19455
19456 2002-03-04 Akim Demaille <akim@epita.fr>
19457
19458 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19459 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
19460 Update.
19461 From Michael Hayes.
19462
19463 2002-03-04 Akim Demaille <akim@epita.fr>
19464
19465 * src/closure.c (closure): `r' is unused.
19466
19467 2002-03-04 Akim Demaille <akim@epita.fr>
19468
19469 * tests/sets.at (Broken Closure): Add the ending `;'.
19470 * src/reader.at (readgram): Complain if a rule is not ended with a
19471 semi-colon.
19472
19473 2002-03-04 Akim Demaille <akim@epita.fr>
19474
19475 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
19476 (count_sr_conflicts): Use bitset_count.
19477 * src/reduce.c (inaccessable_symbols): Ditto.
19478 (bits_size): Remove.
19479 * src/warshall.h, src/warshall.c: Convert to bitsetv.
19480
19481 2002-03-04 Akim Demaille <akim@epita.fr>
19482
19483 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
19484 * src/reduce.c: Remove the `bitset_zero's following the
19485 `bitset_create's, as now it is performed by the latter.
19486
19487 2002-03-04 Akim Demaille <akim@epita.fr>
19488
19489 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
19490 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
19491 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
19492 latest sources from Michael.
19493
19494 2002-03-04 Akim Demaille <akim@epita.fr>
19495
19496 * src/output.c (output): Don't free the grammar.
19497 * src/reader.c (grammar_free): New.
19498 * src/main.c (main): Call it and don't free symtab here.
19499
19500 2002-03-04 Akim Demaille <akim@epita.fr>
19501
19502 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
19503 before returning.
19504 Reported by Benoit Perrot.
19505
19506 2002-03-04 Akim Demaille <akim@epita.fr>
19507
19508 Use bitset operations when possible, not loops over bits.
19509
19510 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
19511 bitset_or.
19512 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
19513 * src/reduce.c (useless_nonterminals): Formatting changes.
19514 * src/warshall.c (TC): Use bitset_or.
19515
19516 2002-03-04 Akim Demaille <akim@epita.fr>
19517
19518 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
19519 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
19520 Ditto.
19521
19522 2002-03-04 Akim Demaille <akim@epita.fr>
19523
19524 * src/lalr.c (F): Now a bitset*.
19525 Adjust all dependencies.
19526
19527 2002-03-04 Akim Demaille <akim@epita.fr>
19528
19529 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
19530 Adjust all dependencies.
19531
19532 2002-03-04 Akim Demaille <akim@epita.fr>
19533
19534 * src/L0.c, src/LR0.h (nstates): Be size_t.
19535 Adjust comparisons (signed vs unsigned).
19536 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
19537 bitset*.
19538 Adjust all dependencies.
19539
19540 2002-03-04 Akim Demaille <akim@epita.fr>
19541
19542 * src/closure.c (firsts): Now, also a bitset.
19543 Adjust all dependencies.
19544 (varsetsize): Remove, now unused.
19545 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
19546
19547 2002-03-04 Akim Demaille <akim@epita.fr>
19548
19549 * src/print.c: Convert to use bitset.h, not hand coded iterations
19550 over ints.
19551
19552 2002-03-04 Akim Demaille <akim@epita.fr>
19553
19554 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
19555
19556 2002-03-04 Akim Demaille <akim@epita.fr>
19557
19558 * src/closure.c (ruleset): Be a bitset.
19559 (rulesetsize): Remove.
19560
19561 2002-03-04 Akim Demaille <akim@epita.fr>
19562
19563 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19564 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
19565 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
19566 * src/closure.c (fderives): Be an array of bitsets.
19567
19568 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
19569
19570 * data/bison.c++: Merge the two generated headers. Insert a copyright
19571 notice in each output file.
19572
19573 2002-02-28 Akim Demaille <akim@epita.fr>
19574
19575 * data/bison.c++: Copy the prologue of bison.simple to fetch
19576 useful M4 definitions, such as b4_header_guard.
19577
19578 2002-02-25 Akim Demaille <akim@epita.fr>
19579
19580 * src/getargs.c (version): Give the name of the authors, and use a
19581 translator friendly scheme for the bgr
19582 copyright notice.
19583
19584 2002-02-25 Akim Demaille <akim@epita.fr>
19585
19586 * src/output.c (header_output): Remove, now handled completely via
19587 M4.
19588
19589 2002-02-25 Akim Demaille <akim@epita.fr>
19590
19591 * m4/m4.m4: New, from CVS Autoconf.
19592 * configure.in: Invoke it.
19593 * src/output.c (output_skeleton): Use its result instead of the
19594 hard coded name.
19595
19596 2002-02-25 Akim Demaille <akim@epita.fr>
19597
19598 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
19599 Fileutils 4.1.5.
19600 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
19601 * src/output.c (output_skeleton): Use mkstemp to create a real
19602 temporary file.
19603 Move the filling of `skeleton' and its muscle to...
19604 (prepare): here.
19605 (output): Move the definition of the prologue muscle to...
19606 (prepare): here.
19607 * src/system.h (DEFAULT_TMPDIR): New.
19608
19609 2002-02-14 Paul Eggert <eggert@twinsun.com>
19610
19611 Remove the support for C++ namespace cleanliness; it was
19612 causing more problems than it was curing, since it didn't work
19613 properly on some nonstandard C++ compilers. This can wait
19614 for a proper C++ parser.
19615
19616 * NEWS: Document this.
19617 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
19618 of C++, as it's treated like C now.
19619 * src/bison.simple (YYSTD): Remove.
19620 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
19621 Treat C++ just like Standard C instead of trying to support
19622 namespace cleanliness.
19623
19624 2002-02-14 Akim Demaille <akim@epita.fr>
19625
19626 * tests/regression.at (else): Adjust to Andreas' change.
19627
19628 2002-02-14 Akim Demaille <akim@epita.fr>
19629
19630 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
19631
19632 2002-02-13 Andreas Schwab <schwab@suse.de>
19633
19634 * src/output.c (output_rule_data): Don't output NULL, it might
19635 not be defined yet.
19636
19637 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
19638
19639 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
19640 (Copyright notice): Update.
19641
19642 2002-02-11 Akim Demaille <akim@epita.fr>
19643
19644 * tests/regression.at (%nonassoc and eof): Don't include
19645 nonportable headers.
19646
19647 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
19648
19649 * data/bison.c++: Correct error recovery. Make the user able to
19650 initialize the starting location.
19651
19652 2002-02-07 Akim Demaille <akim@epita.fr>
19653
19654 * tests/input.at: New.
19655
19656 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
19657
19658 * data/bison.c++: Replace some direct m4 expansions by constants. Be
19659 more consistent when naming methods and variables. Put preprocessor
19660 directives around tables only needed for debugging.
19661
19662 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
19663
19664 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
19665 C++ parsers.
19666 (yy::b4_name::parse): Use print_.
19667
19668 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
19669
19670 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
19671
19672 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
19673
19674 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
19675 C++ parsers.
19676 (yy::b4_name::parse): Build verbose error messages, and use error_.
19677
19678 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
19679
19680 * data/bison.c++: Fix m4 quoting in comments.
19681
19682 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
19683
19684 * data/bison.c++: Adjust the parser code. Fix some muscles that were
19685 not expanded by m4.
19686
19687 2002-02-05 Akim Demaille <akim@epita.fr>
19688
19689 * data/bison.c++: Adjust to the M4 back end.
19690 More is certainly needed.
19691
19692 2002-02-05 Akim Demaille <akim@epita.fr>
19693
19694 Give a try to M4 as a back end.
19695
19696 * lib/readpipe.c: New, from wdiff.
19697 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
19698 BISON_HAIRY.
19699 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
19700 specific values. Now it is m4 that performs the lookup.
19701 * src/parse-skel.y: Remove.
19702 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
19703 * src/output.c (actions_output, guards_output)
19704 (token_definitions_output): No longer keeps track of the output
19705 line number, hence remove the second argument.
19706 (guards_output): Check against the guard member of a rule, not the
19707 action member.
19708 Adjust callers.
19709 (output_skeleton): Don't look for the skeleton location, let m4 do
19710 that.
19711 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
19712 file will be used.
19713 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
19714 (prepare): Given that for the time being changesyntax is not
19715 usable in M4, rename the muscles using `-' to `_'.
19716 Define `defines_flag', `output_parser_name' and `output_header_name'.
19717 * src/output.h (actions_output, guards_output)
19718 (token_definitions_output): Adjust prototypes.
19719 * src/scan-skel.l: Instead of scanning the skeletons, it now
19720 processes the output of m4: `__oline__' and `#output'.
19721 * data/bison.simple: Adjust to be used by M4(sugar).
19722 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
19723 to date.
19724 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
19725 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
19726 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
19727 shamelessly stolen from CVS Autoconf.
19728
19729 2002-02-05 Akim Demaille <akim@epita.fr>
19730
19731 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
19732 * configure.in: Check for the declarations of free and malloc.
19733 * src/muscle_tab.c: Adjust.
19734
19735 2002-02-05 Akim Demaille <akim@epita.fr>
19736
19737 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
19738 which have no values.
19739
19740 2002-02-05 Akim Demaille <akim@epita.fr>
19741
19742 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
19743 * data/: here.
19744
19745 2002-01-29 Paul Eggert <eggert@twinsun.com>
19746
19747 * src/bison.simple (YYSIZE_T): Do not define merely because
19748 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
19749 On some platforms, <alloca.h> does not declare YYSTD (size_t).
19750
19751 2002-01-27 Akim Demaille <akim@epita.fr>
19752
19753 Fix `%nonassoc and eof'.
19754
19755 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
19756 which were not properly copied! Replace
19757 memcpy (res->errs, src->errs, src->nerrs);
19758 with
19759 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
19760 !!!
19761 * tests/regression.at (%nonassoc and eof): Adjust to newest
19762 Autotest: `.' is not in the PATH.
19763
19764 2002-01-27 Akim Demaille <akim@epita.fr>
19765
19766 * tests/sets.at (AT_EXTRACT_SETS): New.
19767 (Nullable): Use it.
19768 (Firsts): New.
19769
19770 2002-01-26 Akim Demaille <akim@epita.fr>
19771
19772 * tests/actions.at, tests/calc.at, tests/headers.at,
19773 * tests/torture.at: Adjust to the newest Autotest which no longer
19774 forces `.' in the PATH.
19775
19776 2002-01-25 Akim Demaille <akim@epita.fr>
19777
19778 * tests/regression.at (%nonassoc and eof): New.
19779 Suggested by Robert Anisko.
19780
19781 2002-01-24 Akim Demaille <akim@epita.fr>
19782
19783 Bison dumps core when trying to complain about broken input files.
19784 Reported by Cris van Pelt.
19785
19786 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
19787 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
19788 into...
19789 (Invalid inputs): Strengthen: exercise parse_percent_token.
19790
19791 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
19792
19793 * src/Makefile.am: Add bison.c++.
19794 * src/bison.c++: New skeleton.
19795
19796 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
19797
19798 * po/it.po: New.
19799
19800 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
19801
19802 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
19803
19804 2002-01-20 Marc Autret <marc@gnu.org>
19805
19806 * src/files.c (compute_output_file_names): Fix
19807
19808 2002-01-20 Marc Autret <marc@gnu.org>
19809
19810 * tests/output.at: New test.
19811 * src/files.c (compute_base_names): Don't map extensions when
19812 the YACC flag is set, use defaults.
19813 Reported by Evgeny Stambulchik.
19814
19815 2002-01-20 Marc Autret <marc@gnu.org>
19816
19817 * src/system.h: Need to define __attribute__ away for non-GCC
19818 compilers as well (i.e., the vendor C compiler).
19819 Suggested by Albert Chin-A-Young.
19820
19821 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
19822
19823 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
19824 canonical definition.
19825 * src/system.h: Use the canonical definition for PARAMS (avoids
19826 a conflict with the macro from lib/hash.h).
19827
19828 2002-01-11 Akim Demaille <akim@epita.fr>
19829
19830 * configure.in: Use AC_FUNC_STRNLEN.
19831 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
19832
19833 2002-01-09 Akim Demaille <akim@epita.fr>
19834
19835 * src/files.c, src/files.h (output_infix): New.
19836 (tab_extension): Remove.
19837 (compute_base_names): Compute the former, drop the latter.
19838 * src/output.c (prepare): Insert the muscles `output-infix', and
19839 `output-suffix'.
19840 * src/parse-skel.y (string, string.1): New.
19841 (section.header): Use it.
19842 (section.yacc): Remove.
19843 (prefix): Remove too.
19844 * src/scan-skel.l: Adjust.
19845 * src/bison.simple, src/bison.hairy: Adjust.
19846
19847 2002-01-09 Akim Demaille <akim@epita.fr>
19848
19849 * configure.in (WERROR_CFLAGS): Compute it.
19850 * src/Makefile.am (CFLAGS): Pass it.
19851 * tests/atlocal.in (CFLAGS): Idem.
19852 * src/files.c: Fix a few warnings.
19853 (get_extension_index): Remove, unused.
19854
19855 2002-01-08 Akim Demaille <akim@epita.fr>
19856
19857 * src/getargs.c (AS_FILE_NAME): New.
19858 (getargs): Use it to convert DOSish file names.
19859 * src/files.c (base_name): Rename as full_base_name to avoid
19860 clashes with `base_name ()'.
19861 (filename_split): New.
19862 (compute_base_names): N-th rewrite, using filename_split.
19863
19864 2002-01-08 Akim Demaille <akim@epita.fr>
19865
19866 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
19867 New, stolen from the Fileutils 4.1.
19868 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
19869 * configure.in: Check for the presence of memrchr, and of its
19870 prototype.
19871
19872 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
19873
19874 * lib/hash.h (__P): Added definition for this macro.
19875 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
19876 BUILT_SOURCES, to ensure they are generated first.
19877 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
19878 %error-verbose to allow bootstrapping with bison 1.30x.
19879
19880 2002-01-06 Akim Demaille <akim@epita.fr>
19881
19882 * src/reader.c (parse_braces): Don't fetch the next char, the
19883 convention is to fetch on entry.
19884 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
19885 'switch' without a following semicolon.
19886 * tests/regression.at (braces parsing): New.
19887
19888 2002-01-06 Akim Demaille <akim@epita.fr>
19889
19890 Bison is dead wrong in its RR conflict reports.
19891
19892 * tests/torture.at (GNU Cim Grammar): New.
19893 * src/conflicts.c (count_rr_conflicts): Fix.
19894
19895 2002-01-06 Akim Demaille <akim@epita.fr>
19896
19897 Creating package.m4 from configure.ac causes too many problems.
19898
19899 * tests/Makefile.am (package.m4): Create it by hand,
19900 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
19901
19902 2002-01-06 Akim Demaille <akim@epita.fr>
19903
19904 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
19905 skeleton.h.
19906
19907 2002-01-04 Paul Eggert <eggert@twinsun.com>
19908
19909 * doc/bison.texinfo (Debugging):
19910 Remove YYSTDERR; it's no longer defined or used.
19911 Also, s/cstdio.h/cstdio/.
19912
19913 2002-01-03 Akim Demaille <akim@epita.fr>
19914
19915 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
19916
19917 2002-01-03 Akim Demaille <akim@epita.fr>
19918
19919 * src/parse-skel.y (process_skeleton): Don't bind the parser's
19920 tracing code to --trace, wait for a better --trace option, with
19921 args.
19922
19923 2002-01-03 Akim Demaille <akim@epita.fr>
19924
19925 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
19926 The ISO C++ standard is extremely clear about it: stderr is
19927 considered a macro, not a regular symbol (see table 94 `Header
19928 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
19929 Therefore std:: does not apply to it. It still does with fprintf.
19930 Also, s/cstdio.h/cstdio/.
19931
19932 2002-01-03 Akim Demaille <akim@epita.fr>
19933
19934 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
19935 for non system headers.
19936
19937 2002-01-02 Akim Demaille <akim@epita.fr>
19938
19939 Equip the skeleton chain with location tracking, runtime trace,
19940 pure parser and scanner.
19941
19942 * src/parse-skel.y: Request a pure parser, locations, and prefix
19943 renaming.
19944 (%union): Having several members with the same type does not help
19945 type mismatches, simplify.
19946 (YYPRINT, yyprint): New.
19947 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
19948 (skel_error): this.
19949 Handle locations.
19950 * src/scan-skel.l: Adjust to these changes.
19951 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
19952 (LOCATION_PRINT, skel_control_t): New.
19953
19954 2001-12-30 Akim Demaille <akim@epita.fr>
19955
19956 * src/parse-skel.y: Get rid of the shift/reduce conflict:
19957 replace `gb' with BLANKS.
19958 * src/scan-skel.l: Adjust.
19959
19960 2001-12-30 Akim Demaille <akim@epita.fr>
19961
19962 * src/system.h: We don't need nor want bcopy.
19963 Throw away MS-DOS crap: we don't need getpid.
19964 * configure.in: We don't need strndup. It was even causing
19965 problems: because Flex includes the headers *before* us,
19966 _GNU_SOURCE is not defined by config.h, and therefore strndup was
19967 not visible.
19968 * lib/xstrndup.c: New.
19969 * src/scan-skel.l: Use it.
19970 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
19971 * src/parse-skel.y: Use %directives instead of #defines.
19972
19973 2001-12-30 Akim Demaille <akim@epita.fr>
19974
19975 * src/skeleton.h: New.
19976 * src/output.c (output_parser, output_master_parser): Remove, dead
19977 code.
19978 * src/output.h (get_lines_number, actions_output, guards_output)
19979 (token_definitions_output): Prototype them.
19980 * src/parse-skel.y: Add the license notice.
19981 Include output.h and skeleton.h.
19982 (process_skeleton): Returns void, and takes a single parameter.
19983 * src/scan-skel.l: Add the license notice.
19984 Include skeleton.h.
19985 Don't use %option yylineno: it seems that then Flex imagines
19986 REJECT has been used, and therefore it won't reallocate its
19987 buffers (which makes no other sense to me than a bug). It results
19988 in warnings for `unused: yy_flex_realloc'.
19989
19990 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
19991
19992 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
19993 (MUSCLE_INSERT_PREFIX): ...to there.
19994 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
19995 (MUSCLE_INSERT_PREFIX): Move from here...
19996
19997 * src/bison.hairy: Add a section directive. Put braces around muscle
19998 names. This parser skeleton is still broken, but Bison should not
19999 choke on a bad muscle 'syntax'.
20000 * src/bison.simple: Add a section directive. Put braces around muscle
20001 names.
20002
20003 * src/files.h (strsuffix, stringappend): Add declarations.
20004 (tab_extension): Add declaration.
20005 (short_base_name): Add declaration.
20006
20007 * src/files.c (strsuffix, stringappend): No longer static. These
20008 functions are used in the skeleton parser.
20009 (tab_extension): New.
20010 (compute_base_names): Use the computations done in this function
20011 to guess if the generated parsers should have '.tab' in their
20012 names.
20013 (short_base_name): No longer static.
20014
20015 * src/output.c (output_skeleton): New.
20016 (output): Disable call to output_master_parser, and give a try to
20017 a new skeleton handling system.
20018 (guards_output, actions_output): No longer static.
20019 (token_definitions_output, get_lines_number): No longer static.
20020
20021 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
20022
20023 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
20024 parse-skel.y.
20025
20026 * src/parse-skel.y: New file.
20027 * src/scan-skel.l: New file.
20028
20029 2001-12-29 Akim Demaille <akim@epita.fr>
20030
20031 %name-prefix is broken.
20032
20033 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
20034 Adjust all dependencies.
20035 * tests/headers.at (export YYLTYPE): Strengthen this test: use
20036 %name-prefix.
20037
20038 Renaming yylval but not yylloc is not consistent. Now we do.
20039
20040 * src/bison.simple: Prefix yylloc if used.
20041 * doc/bison.texinfo (Decl Summary): Document that.
20042
20043 2001-12-29 Akim Demaille <akim@epita.fr>
20044
20045 * doc/bison.texinfo: Promote `%long-directive' over
20046 `%long_directive'.
20047 Remove all references to fixed-output-files, yacc is enough.
20048
20049 2001-12-29 Akim Demaille <akim@epita.fr>
20050
20051 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
20052 user prologue. These are defaults.
20053 * tests/actions.at (Mid-rule actions): Make sure the user can
20054 define YYDEBUG and YYERROR_VERBOSE.
20055
20056 2001-12-29 Akim Demaille <akim@epita.fr>
20057
20058 * src/output.c (header_output): Don't forget to export YYLTYPE and
20059 yylloc.
20060 * tests/headers.at (export YYLTYPE): New, make sure it does.
20061 * tests/regression.at (%union and --defines, Invalid CPP headers):
20062 Move to...
20063 * tests/headers.at: here.
20064
20065 2001-12-29 Akim Demaille <akim@epita.fr>
20066
20067 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
20068
20069 2001-12-29 Akim Demaille <akim@epita.fr>
20070
20071 * tests/actions.at (Mid-rule actions): Output on a single line
20072 instead of several.
20073
20074 2001-12-29 Akim Demaille <akim@epita.fr>
20075
20076 * doc/bison.texinfo: Formatting changes.
20077
20078 2001-12-29 Akim Demaille <akim@epita.fr>
20079
20080 Don't store the token defs in a muscle, just be ready to output it
20081 on command. Now possible via `symbols'. Fixes a memory leak.
20082
20083 * src/output.c (token_definitions_output): New.
20084 (output_parser, header_output): Use it.
20085 * src/reader.c (symbols_save): Remove.
20086
20087 2001-12-29 Akim Demaille <akim@epita.fr>
20088
20089 * src/bison.simple: Do not provide a default for YYSTYPE and
20090 YYLTYPE before the user's prologue. Otherwise it's hardly... a
20091 default.
20092
20093 2001-12-29 Akim Demaille <akim@epita.fr>
20094
20095 Mid-rule actions are simply... ignored!
20096
20097 * src/reader.c (readgram): Be sure to attach mid-rule actions to
20098 the empty-rule associated to the dummy symbol, not to the host
20099 rule.
20100 * tests/actions.at (Mid-rule actions): New.
20101
20102 2001-12-29 Akim Demaille <akim@epita.fr>
20103
20104 Memory leak.
20105
20106 * src/reader.c (reader): Free grammar.
20107
20108 2001-12-29 Akim Demaille <akim@epita.fr>
20109
20110 Memory leak.
20111
20112 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
20113 since it allocates it for each state, although only one is needed.
20114 (allocate_storage): Do it here.
20115
20116 2001-12-29 Akim Demaille <akim@epita.fr>
20117
20118 * src/options.h, src/options.c (create_long_option_table): Rename
20119 as...
20120 (long_option_table_new): this, with a clearer prototype.
20121 (percent_table): Remove, unused,
20122 * src/getargs.c (getargs): Adjust.
20123
20124 2001-12-29 Akim Demaille <akim@epita.fr>
20125
20126 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
20127 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
20128 as states.
20129
20130 2001-12-29 Akim Demaille <akim@epita.fr>
20131
20132 * src/lalr.c (build_relations): Rename `states' as `states1'.
20133 Sorry, I don't understand exactly what it is, no better name...
20134
20135 2001-12-29 Akim Demaille <akim@epita.fr>
20136
20137 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
20138 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
20139 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
20140 as rules.
20141
20142 2001-12-29 Akim Demaille <akim@epita.fr>
20143
20144 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
20145 ago.
20146
20147 2001-12-29 Akim Demaille <akim@epita.fr>
20148
20149 * src/reader.c, src/reader.h (user_toknums): Remove.
20150 Adjust all users to use symbols[i]->user_token_number.
20151
20152 2001-12-29 Akim Demaille <akim@epita.fr>
20153
20154 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
20155 Adjust all users to use symbols[i]->prec or ->assoc.
20156
20157 2001-12-29 Akim Demaille <akim@epita.fr>
20158
20159 * src/reader.c, src/reader.h (tags): Remove.
20160 Adjust all users to use symbols[i]->tag.
20161
20162 2001-12-29 Akim Demaille <akim@epita.fr>
20163
20164 * src/gram.h, src/gram.c (symbols): New, similar to state_table
20165 and rule_table.
20166 * src/reader.c (packsymbols): Fill this table.
20167 Drop sprec.
20168 * src/conflicts.c (resolve_sr_conflict): Adjust.
20169 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
20170 single table.
20171 Use symbols[i]->tag instead of tags[i].
20172
20173 2001-12-29 Akim Demaille <akim@epita.fr>
20174
20175 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
20176 In addition, put a comment in there, to replace...
20177 * tests/regression.at (%union and C comments): Remove.
20178
20179 2001-12-29 Akim Demaille <akim@epita.fr>
20180
20181 * tests/regression.at (Web2c Actions): Blindly move the actual
20182 output as expected output. The contents *seem* right to me, but I
20183 can't pretend reading perfectly parser tables... Nonetheless, all
20184 the other tests pass correctly, the table look OK, even though the
20185 presence of `$axiom' is to be noted: AFAICS it is useless (but
20186 harmless).
20187
20188 2001-12-29 Akim Demaille <akim@epita.fr>
20189
20190 * src/reader.c (readgram): Don't add the rule 0 if there were no
20191 rules read. In other words, add it _after_ having performed
20192 grammar sanity checks.
20193 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
20194
20195 2001-12-29 Akim Demaille <akim@epita.fr>
20196
20197 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
20198 visible, and some states have now a different number.
20199
20200 2001-12-29 Akim Demaille <akim@epita.fr>
20201
20202 * src/reader.c (readgram): Bind the initial rule's lineno to that
20203 of the first rule.
20204 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
20205 (Solved SR Conflicts): Adjust rule 0's line number.
20206
20207 2001-12-29 Akim Demaille <akim@epita.fr>
20208
20209 Fix the `GAWK Grammar' failure.
20210
20211 * src/LR0.c (final_state): Initialize to -1 so that we do compute
20212 the reductions of the first state which was mistakenly confused
20213 with the final state because precisely final_state was initialized
20214 to 0.
20215 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
20216 now noticed by Bison.
20217 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
20218 have a reduction on $default.
20219
20220 2001-12-29 Akim Demaille <akim@epita.fr>
20221
20222 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
20223 rule line numbers.
20224 * src/closure.c (print_closure): Likewise.
20225 * src/derives.c (print_derives): Likewise.
20226 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
20227 now.
20228
20229 2001-12-29 Akim Demaille <akim@epita.fr>
20230
20231 * src/lalr.c (lookaheads_print): New.
20232 (lalr): Call it when --trace-flag.
20233 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
20234 are dumped.
20235
20236 2001-12-29 Akim Demaille <akim@epita.fr>
20237
20238 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
20239 when walking through ritem, even via rule->rhs.
20240 * src/reduce.c (dump_grammar, useful_production, reduce_output)
20241 (useful_production, useless_nonterminals): Likewise.
20242 (reduce_grammar_tables): Likewise, plus update nritems.
20243 * src/nullable.c (set_nullable): Likewise.
20244 * src/lalr.c (build_relations): Likewise.
20245 * tests/sets.at (Nullable): Adjust.
20246 Fortunately, now, the $axiom is no longer nullable.
20247
20248 2001-12-29 Akim Demaille <akim@epita.fr>
20249
20250 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
20251 the 0-sentinel.
20252 * src/gram.c (ritem_longest_rhs): Likewise.
20253 * src/reduce.c (nonterminals_reduce): Likewise.
20254 * src/print_graph.c (print_graph): Likewise.
20255 * src/output.c (output_rule_data): Likewise.
20256 * src/nullable.c (set_nullable): Likewise.
20257
20258 2001-12-29 Akim Demaille <akim@epita.fr>
20259
20260 * src/output.c: Comment changes.
20261
20262 2001-12-27 Paul Eggert <eggert@twinsun.com>
20263
20264 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
20265 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
20266 Sparc, as they were causing more porting problems than the
20267 (minor) performance improvement was worth.
20268
20269 Also, catch up with 1.31's YYSTD.
20270
20271 2001-12-27 Akim Demaille <akim@epita.fr>
20272
20273 * src/output.c (output_gram): Rely on nritems, not the
20274 0-sentinel. See below.
20275 Use -1 as separator, not 0.
20276 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
20277 Rely on -1 as separator in yyrhs, instead of 0.
20278 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
20279 twice `Now at end of input', therefore there are two lines less to
20280 expect.
20281
20282 2001-12-27 Akim Demaille <akim@epita.fr>
20283
20284 * tests/regression.at (Unresolved SR Conflicts):
20285 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
20286 below.
20287
20288 2001-12-27 Akim Demaille <akim@epita.fr>
20289
20290 * src/LR0.c (new_state): Recognize the final state by the fact it
20291 is reached by eoftoken.
20292 (insert_start_shifting_state, insert_eof_shifting_state)
20293 (insert_accepting_state, augment_automaton): Remove, since now
20294 these states are automatically computed from the initial state.
20295 (generate_states): Adjust.
20296 * src/print.c: When reporting a rule number to the user, substract
20297 1, so that the axiom rule is rule 0, and the first user rule is 1.
20298 * src/reduce.c: Likewise.
20299 * src/print_graph.c (print_core): For the time being, just as for
20300 the report, depend upon --trace-flags to dump the full set of
20301 items.
20302 * src/reader.c (readgram): Once the grammar read, insert the rule
20303 0: `$axiom: START-SYMBOL $'.
20304 * tests/set.at: Adjust: rule 0 is now displayed, and since the
20305 number of the states has changed (the final state is no longer
20306 necessarily the last), catch up.
20307
20308 2001-12-27 Akim Demaille <akim@epita.fr>
20309
20310 Try to make the use of the eoftoken valid. Given that its value
20311 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
20312 is used instead of > 0 where appropriate, (ii), depend upon nritems
20313 instead of the 0-sentinel.
20314
20315 * src/gram.h, src/gram.c (nritems): New.
20316 Expected to be duplication of nitems, but for the time being...
20317 * src/reader.c (packgram): Assert nritems and nitems are equal.
20318 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
20319 * src/closure.c (print_closure, print_fderives): Likewise.
20320 * src/gram.c (ritem_print): Likewise.
20321 * src/print.c (print_core, print_grammar): Likewise.
20322 * src/print_graph.c: Likewise.
20323
20324 2001-12-27 Akim Demaille <akim@epita.fr>
20325
20326 * src/main.c (main): If there are complains after grammar
20327 reductions, then output the report anyway if requested, then die.
20328 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
20329 * src/reader.c (eoftoken): New.
20330 (parse_token_decl): If the token being defined has value `0', it
20331 is the eoftoken.
20332 (packsymbols): No longer hack `tags' to insert `$' by hand.
20333 Be sure to preserve the value of the eoftoken.
20334 (reader): Make sure eoftoken is defined.
20335 Initialize nsyms to 0: now eoftoken is created just like the others.
20336 * src/print.c (print_grammar): Don't special case the eof token.
20337 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
20338 lie anyway, albeit pleasant.
20339 * tests/calc.at: Exercise error messages with eoftoken.
20340 Change the grammar so that empty input is invalid.
20341 Adjust expectations.
20342 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
20343
20344 2001-12-27 Akim Demaille <akim@epita.fr>
20345
20346 * configure.in: Check the protos of strchr ans strspn.
20347 Replace strchr if needed.
20348 * src/system.h: Provide the protos of strchr, strspn and memchr if
20349 missing.
20350 * lib/strchr.c: New.
20351 * src/reader.c (symbols_save): Use strchr.
20352
20353 2001-12-27 Akim Demaille <akim@epita.fr>
20354
20355 * src/print.c, src/print_graph.c (escape): New.
20356 Use it to quote the TAGS outputs.
20357 * src/print_graph.c (print_state): Now errors are in red, and
20358 reductions in green.
20359 Prefer high to wide: output the state number on a line of its own.
20360
20361 2001-12-27 Akim Demaille <akim@epita.fr>
20362
20363 * src/state.h, src/state.c (reductions_new): New.
20364 * src/LR0.c (set_state_table): Let all the states have a
20365 `reductions', even if reduced to 0.
20366 (save_reductions): Adjust.
20367 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
20368 * src/print.c (print_reductions, print_actions): Adjust.
20369 * src/output.c (action_row): Adjust.
20370
20371 2001-12-27 Akim Demaille <akim@epita.fr>
20372
20373 * src/state.h, src/state.c (errs_new, errs_dup): New.
20374 * src/LR0.c (set_state_table): Let all the states have an errs,
20375 even if reduced to 0.
20376 * src/print.c (print_errs, print_reductions): Adjust.
20377 * src/output.c (output_actions, action_row): Adjust.
20378 * src/conflicts.c (resolve_sr_conflict): Adjust.
20379
20380 2001-12-27 Akim Demaille <akim@epita.fr>
20381
20382 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
20383
20384 2001-12-27 Akim Demaille <akim@epita.fr>
20385
20386 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
20387 * src/print.c: here.
20388 (lookaheadset, shiftset): New, used as additional storage by
20389 print_reductions.
20390 (print_results): Adjust.
20391 (print_shifts, print_gotos, print_errs): New, extracted from...
20392 (print_actions): here.
20393 * src/print_graph.c (print_actions): Remove dead code.
20394
20395 2001-12-27 Akim Demaille <akim@epita.fr>
20396
20397 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
20398 `$n' and `@n'.
20399
20400 2001-12-27 Akim Demaille <akim@epita.fr>
20401
20402 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
20403 (build_relations): Adjust.
20404
20405 2001-12-27 Akim Demaille <akim@epita.fr>
20406
20407 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
20408 duplication.
20409
20410 2001-12-27 Akim Demaille <akim@epita.fr>
20411
20412 * src/reader.c (packgram): Catch nitems overflows.
20413
20414 2001-12-27 Akim Demaille <akim@epita.fr>
20415
20416 * src/files.c, src/files.h (guard_obstack): Remove.
20417 * src/output.c (output): Adjust.
20418 * src/reader.c (parse_braces): New, factoring...
20419 (copy_action, copy_guard): these two which are renamed as...
20420 (parse_action, parse_guard): these.
20421 As a voluntary consequence, using braces around guards is now
20422 mandatory.
20423
20424 2001-12-27 Akim Demaille <akim@epita.fr>
20425
20426 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
20427 * src/reader.c (symbol_list): `guard' and `guard_line' are new
20428 members.
20429 (symbol_list_new): Adjust.
20430 (copy_action): action_line is the first line, not the last.
20431 (copy_guard): Just as for actions, store the `action' only, not
20432 the switch/case/break flesh.
20433 Don't parse the user action that might follow the guard, let...
20434 (readgram): do it, i.e., now, there can be an action after a
20435 guard.
20436 In other words the guard is just explicitly optional.
20437 (packgram): Adjust.
20438 * src/output.c (guards_output): New.
20439 (output_parser): Call it when needed.
20440 (output): Also free the guard and attrs obstacks.
20441 * src/files.c, src/files.h (obstack_save): Remove.
20442 (output_files): Remove.
20443 As a result, if one needs the former `.act' file, using an
20444 appropriate skeleton which requires actions and guards is now
20445 required.
20446 * src/main.c (main): Adjust.
20447 * tests/semantic.at: New.
20448 * tests/regression.at: Use `input.y' as input file name.
20449 Avoid 8+3 problems by requiring input.c when the test needs the
20450 parser.
20451
20452 2001-12-27 Akim Demaille <akim@epita.fr>
20453
20454 * src/reader.c (symbol_list_new): Be sure to initialize all the
20455 fields.
20456
20457 2001-12-27 Akim Demaille <akim@epita.fr>
20458
20459 All the hacks using a final pseudo state are now useless.
20460
20461 * src/LR0.c (set_state_table): state_table holds exactly nstates.
20462 * src/lalr.c (nLA): New.
20463 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
20464 instead of lookaheadsp from the pseudo state (nstate + 1).
20465
20466 2001-12-27 Akim Demaille <akim@epita.fr>
20467
20468 * src/output.c (action_row, token_actions): Use a state_t instead
20469 of a integer, and nlookaheads instead of the following state's
20470 lookaheadsp.
20471
20472 2001-12-27 Akim Demaille <akim@epita.fr>
20473
20474 * src/conflicts.c (log_resolution, flush_shift)
20475 (resolve_sr_conflict, set_conflicts, solve_conflicts)
20476 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
20477 (conflicts_print, print_reductions): Use a state_t instead of an
20478 integer when referring to a state.
20479 As much as possible, depend upon nlookaheads, instead of the
20480 `lookaheadsp' member of the following state (since lookaheads of
20481 successive states are successive, the difference between state n + 1
20482 and n served as the number of lookaheads for state n).
20483 * src/lalr.c (add_lookback_edge): Likewise.
20484 * src/print.c (print_core, print_actions, print_state)
20485 (print_results): Likewise.
20486 * src/print_graph.c (print_core, print_actions, print_state)
20487 (print_graph): Likewise.
20488 * src/conflicts.h: Adjust.
20489
20490 2001-12-27 Akim Demaille <akim@epita.fr>
20491
20492 * src/bison.hairy: Formatting/comment changes.
20493 ANSIfy.
20494 Remove `register' indications.
20495 Add plenty of `static'.
20496
20497 2001-12-27 Akim Demaille <akim@epita.fr>
20498
20499 * src/output.c (prepare): Drop the muscle `ntbase' which
20500 duplicates ntokens.
20501 * src/bison.simple: Formatting/comment changes.
20502 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
20503 is an undocumented synonym.
20504
20505 2001-12-22 Akim Demaille <akim@epita.fr>
20506
20507 * src/output.c (output_table_data): Change the prototype to use
20508 `int' for array ranges: some invocations do pass an int, not a
20509 short.
20510 Reported by Wayne Green.
20511
20512 2001-12-22 Akim Demaille <akim@epita.fr>
20513
20514 Some actions of web2c.y are improperly triggered.
20515 Reported by Mike Castle.
20516
20517 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
20518 * tests/regression.at (Web2c): Rename as...
20519 (Web2c Report): this.
20520 (Web2c Actions): New.
20521
20522 2001-12-22 Akim Demaille <akim@epita.fr>
20523
20524 Reductions in web2c.y are improperly reported.
20525 Reported by Mike Castle.
20526
20527 * src/conflicts.c (print_reductions): Fix.
20528 * tests/regression.at (Web2c): New.
20529
20530 2001-12-18 Akim Demaille <akim@epita.fr>
20531
20532 Some host fail on `assert (!"foo")', which expands to
20533 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
20534 Reported by Nelson Beebee.
20535
20536 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
20537 `#define it_succeeded 0' and `assert (it_succeeded)'.
20538
20539 2001-12-17 Marc Autret <autret_m@epita.fr>
20540
20541 * src/bison.simple: Don't hard code the skeleton line and filename.
20542 * src/output.c (output_parser): Rename 'line' as 'output_line'.
20543 New line counter 'skeleton_line' (skeleton-line muscle).
20544
20545 2001-12-17 Paul Eggert <eggert@twinsun.com>
20546
20547 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
20548 YYDEBUG must be defined to a nonzero value.
20549
20550 * src/bison.simple (yytname): Do not assume that the user defines
20551 YYDEBUG to a properly parenthesized expression.
20552
20553 2001-12-17 Akim Demaille <akim@epita.fr>
20554
20555 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
20556 nlookaheads is a new member.
20557 Adjust all users.
20558 * src/lalr.h (nlookaheads): Remove this orphan declaration.
20559 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
20560 state.
20561
20562 2001-12-17 Akim Demaille <akim@epita.fr>
20563
20564 * src/files.h, src/files.c (open_files, close_files): Remove.
20565 * src/main.c (main): Don't open/close files, nor invoke lex_free,
20566 let...
20567 * src/reader.c (reader): Do it.
20568
20569 2001-12-17 Akim Demaille <akim@epita.fr>
20570
20571 * src/conflicts.c (print_reductions): Formatting changes.
20572
20573 2001-12-17 Akim Demaille <akim@epita.fr>
20574
20575 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
20576 (flush_reduce): New.
20577 (resolve_sr_conflict): Adjust.
20578
20579 2001-12-17 Akim Demaille <akim@epita.fr>
20580
20581 * src/output.c (output_obstack): Be static and rename as...
20582 (format_obstack): this, to avoid any confusion with files.c's
20583 output_obstack.
20584 * src/reader.h (muscle_obstack): Move to...
20585 * src/output.h: here, since it's defined in output.c.
20586
20587 2001-12-17 Akim Demaille <akim@epita.fr>
20588
20589 * src/output.c (action_row, save_column, default_goto)
20590 (sort_actions, matching_state, pack_vector): Better variable
20591 locality.
20592
20593 2001-12-17 Akim Demaille <akim@epita.fr>
20594
20595 * src/output.c: Various formatting changes.
20596
20597 2001-12-17 Akim Demaille <akim@epita.fr>
20598
20599 * src/files.c (output_files): Free the output_obstack.
20600 * src/main.c (main): Call print and print_graph conditionally.
20601 * src/print.c (print): Work unconditionally.
20602 * src/print_graph.c (print_graph): Work unconditionally.
20603 * src/conflicts.c (log_resolution): Output only if verbose_flag.
20604
20605 2001-12-16 Marc Autret <autret_m@epita.fr>
20606
20607 * src/output.c (actions_output): Fix. When we use %no-lines,
20608 there is one less line per action.
20609
20610 2001-12-16 Marc Autret <autret_m@epita.fr>
20611
20612 * src/bison.simple: Remove a useless #line directive.
20613 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
20614 * src/output.c (get_lines_number): New.
20615 (output_parser): Adjust, now takes care about the lines of a
20616 output muscles.
20617 Fix line numbering.
20618 (actions_output): Computes the number of lines taken by actions.
20619 (output_master_parser): Insert new skeleton which is the name of
20620 the output parser file name.
20621
20622 2001-12-15 Marc Autret <autret_m@epita.fr>
20623
20624 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
20625
20626 2001-12-15 Marc Autret <autret_m@epita.fr>
20627
20628 * src/output.c (output_gram): Keep track of the hairy one.
20629
20630 2001-12-15 Akim Demaille <akim@epita.fr>
20631
20632 Make `make distcheck' work.
20633
20634 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
20635 system.h which uses libgettext.h.
20636
20637 2001-12-15 Akim Demaille <akim@epita.fr>
20638
20639 * src/nullable.c (set_nullable): Useless rules must be skipped,
20640 otherwise, since we range over their symbols, we might look at a
20641 nonterminal which no longer ``exists'', i.e., it is not counted in
20642 `nvars', hence we overflow our arrays.
20643
20644 2001-12-15 Akim Demaille <akim@epita.fr>
20645
20646 The header can also be produced directly, without any obstack!
20647 Yahoo!
20648
20649 * src/files.c, src/files.h (defines_obstack): Remove.
20650 (compute_header_macro): Global.
20651 (defines_obstack_save): Remove.
20652 * src/reader.c (parse_union_decl): No longer output to
20653 defines_obstack: its content can be found in the `stype' muscle
20654 anyway.
20655 (output_token_translations): Merge into...
20656 (symbols_output): this.
20657 Rename as...
20658 (symbols_save): this.
20659 (reader): Adjust.
20660 * src/output.c (header_output): New.
20661 (output): Call it.
20662
20663 2001-12-15 Akim Demaille <akim@epita.fr>
20664
20665 * src/reader.c (parse_union_decl): Instead of handling two obstack
20666 simultaneously, use one to define the `stype' muscle, and use the
20667 value of the latter to fill defines_obstack.
20668 (copy_comment): Remove.
20669 (copy_comment2): Work for a single obstack.
20670 Rename as...
20671 (copy_comment): this.
20672
20673 2001-12-15 Akim Demaille <akim@epita.fr>
20674
20675 * src/lex.c, src/lex.h (xgetc): No longer static.
20676 * src/reader.c (parse_union_decl): Revamp.
20677
20678 2001-12-15 Akim Demaille <akim@epita.fr>
20679
20680 Still making progress in separating Bison into (i) input, (ii)
20681 process, (iii) output: now we can directly output the parser file
20682 without using table_obstack at all.
20683
20684 * src/files.c, src/files.h (table_obstack): Bye bye.
20685 (parser_file_name): New.
20686 * src/files.c (compute_output_file_names): Compute it.
20687 * src/output.c (actions_output, output_parser)
20688 (output_master_parser): To a file instead of an obstack.
20689
20690 2001-12-15 Akim Demaille <akim@epita.fr>
20691
20692 Attach actions to rules, instead of pre-outputting them to
20693 actions_obstack.
20694
20695 * src/gram.h (rule_t): action and action_line are new members.
20696 * src/reader.c (symbol_list): Likewise.
20697 (copy_action): Save the actions within the rule.
20698 (packgram): Save them in rule_table.
20699 * src/output.c (actions_output): New.
20700 (output_parser): Use it on `%%actions'.
20701 (output_rule_data): Don't free rule_table.
20702 (output): Do it.
20703 (prepare): Don't save the `action' muscle.
20704 * src/bison.simple: s/%%action/%%actions/.
20705
20706 2001-12-15 Akim Demaille <akim@epita.fr>
20707
20708 * src/reader.c (copy_action): When --yacc, don't append a `;'
20709 to the user action: let it fail if lacking.
20710 Suggested by Arnold Robbins and Tom Tromey.
20711
20712 2001-12-14 Akim Demaille <akim@epita.fr>
20713
20714 * src/lex.c (literalchar): Simply return the char you decoded, non
20715 longer mess around with obstacks and int pointers.
20716 Adjust all callers.
20717
20718 2001-12-14 Akim Demaille <akim@epita.fr>
20719
20720 * src/lex.c (literalchar): Don't escape the special characters,
20721 just decode them, and keep them as char (before, eol was output as
20722 the 2 char string `\n' etc.).
20723 * src/output.c (output_rule_data): Use quotearg to output the
20724 token strings.
20725
20726 2001-12-13 Paul Eggert <eggert@twinsun.com>
20727
20728 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
20729 Do not infringe on the global user namespace when using C++.
20730 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
20731 All uses of `fprintf' and `stderr' changed.
20732
20733 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
20734
20735 2001-12-13 Akim Demaille <akim@epita.fr>
20736
20737 The computation of nullable is broken: it doesn't handle empty
20738 RHS's properly.
20739
20740 * tests/torture.at (GNU AWK Grammar): New.
20741 * tests/sets.at (Nullable): New.
20742 * src/nullable.c (set_nullable): Instead of blindly looping over
20743 `ritems', loop over the rules, and then over their rhs's.
20744
20745 Work around Autotest bugs.
20746
20747 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
20748 frame, because Autotest understand lines starting with a `+' as
20749 traces from the shell. Then, they are not processed properly.
20750 Admittedly an Autotest bug, but we don't have time to wait for
20751 Autotest to catch up.
20752 * tests/regression.at (Broken Closure): Adjust to the new table
20753 frames.
20754 Move to...
20755 * tests/sets.at: here.
20756
20757 2001-12-13 Akim Demaille <akim@epita.fr>
20758
20759 * src/closure.c (closure): Use nrules instead of playing tricks
20760 with BITS_PER_WORD.
20761
20762 2001-12-13 Akim Demaille <akim@epita.fr>
20763
20764 * src/print.c (print_actions): Output the handling of `$' as the
20765 traces do: shifting the token EOF. Before EOF was treated as a
20766 nonterminal.
20767 * tests/regression.at: Adjust some tests.
20768 * src/print_graph.c (print_core): Complete the set of items via
20769 closure. The next-to-final and final states are still unsatisfying,
20770 but that's to be addressed elsewhere.
20771 No longer output the rule numbers, but do output the state number.
20772 A single loop for the shifts + gotos is enough, but picked a
20773 distinct color for each.
20774 (print_graph): Initialize and finalize closure.
20775
20776 2001-12-13 Akim Demaille <akim@epita.fr>
20777
20778 * src/reader.c (readgram): Remove dead code, an strip useless
20779 braces.
20780 (get_type): Remove, unused.
20781
20782 2001-12-12 Akim Demaille <akim@epita.fr>
20783
20784 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
20785 on that of lib/error.c.
20786
20787 2001-12-12 Akim Demaille <akim@epita.fr>
20788
20789 Some hosts don't like `/' in includes.
20790
20791 * src/system.h: Include libgettext.h without qualifying the path.
20792 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
20793 $(top_srcdir).
20794
20795 2001-12-11 Marc Autret <autret_m@epita.fr>
20796
20797 * src/output.c (output_parser): Remove useless muscle.
20798
20799 2001-12-11 Marc Autret <autret_m@epita.fr>
20800
20801 * src/bison.simple: Remove #line just before %%epilogue. It
20802 is now handled in ...
20803 * src/reader.c (read_additionnal_code): Add the output of a
20804 #line for the epilogue.
20805
20806 2001-12-10 Marc Autret <autret_m@epita.fr>
20807
20808 * src/reader.c (copy_definition): Re-use CPP-outed code which
20809 replace precedent remove.
20810 * src/bison.simple: Remove #line before %%prologue because
20811 %%input-line is wrong at this time.
20812
20813 2001-12-10 Marc Autret <autret_m@epita.fr>
20814
20815 * src/reader.c (symbols_output): Clean up.
20816 * src/output.c (output_gram, output): Clean up.
20817
20818 2001-12-10 Akim Demaille <akim@epita.fr>
20819
20820 * src/lalr.c (initialize_lookaheads): New. Extracted from...
20821 * src/LR0.c (set_state_table): here.
20822 * src/lalr.c (lalr): Call it.
20823
20824 2001-12-10 Akim Demaille <akim@epita.fr>
20825
20826 * src/state.h (shifts): Remove the `number' member: shifts are
20827 attached to state, hence no longer need to be labelled with a
20828 state number.
20829
20830 2001-12-10 Akim Demaille <akim@epita.fr>
20831
20832 Now that states have a complete set of members, the linked list of
20833 shifts is useless: just fill directly the state's shifts member.
20834
20835 * src/state.h (shifts): Remove the `next' member.
20836 * src/LR0.c (first_state, last_state): Remove.
20837 Adjust the callers.
20838 (augment_automaton): Don't look for the shifts that must be added
20839 a shift on EOF: it is those of the state we looked for! But now,
20840 since shifts are attached, it is no longer needed to looking
20841 merely by its id: its number.
20842
20843 2001-12-10 Akim Demaille <akim@epita.fr>
20844
20845 * src/LR0.c (augment_automaton): Better variable locality.
20846 Remove an impossible branch: if there is a state corresponding to
20847 the start symbol being shifted, then there is shift for the start
20848 symbol from the initial state.
20849
20850 2001-12-10 Akim Demaille <akim@epita.fr>
20851
20852 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
20853 only when appropriate: when insert_start_shifting_state' is not
20854 invoked.
20855 * tests/regression.at (Rule Line Numbers): Adjust.
20856
20857 2001-12-10 Akim Demaille <akim@epita.fr>
20858
20859 * src/LR0.c (augment_automaton): Now that all states have shifts,
20860 merge the two cases addition shifts to the initial state.
20861
20862 2001-12-10 Akim Demaille <akim@epita.fr>
20863
20864 * src/lalr.c (set_state_table): Move to...
20865 * src/LR0.c: here.
20866 * src/lalr.c (lalr): Don't call it...
20867 * src/LR0.c (generate_states): do it.
20868 * src/LR0.h (first_state): Remove, only the table is used.
20869
20870 2001-12-10 Akim Demaille <akim@epita.fr>
20871
20872 * src/LR0.h (first_shift, first_reduction): Remove.
20873 * src/lalr.c: Don't use first_shift: find shifts through the
20874 states.
20875
20876 2001-12-10 Akim Demaille <akim@epita.fr>
20877
20878 * src/LR0.c: Attach shifts to states as soon as they are
20879 computed.
20880 * src/lalr.c (set_state_table): Instead of assigning shifts to
20881 state, just assert that the mapping was properly done.
20882
20883 2001-12-10 Akim Demaille <akim@epita.fr>
20884
20885 * src/LR0.c (insert_start_shift): Rename as...
20886 (insert_start_shifting_state): this.
20887 (insert_eof_shifting_state, insert_accepting_state): New.
20888 (augment_automaton): Adjust.
20889 Better locality of the variables.
20890 When looking if the start_symbol is shifted from the initial
20891 state, using `while (... symbol != start_symbol ...)' sounds
20892 better than `while (... symbol < start_symbol ...)': If fail
20893 to see how the order between symbols could be relevant!
20894
20895 2001-12-10 Akim Demaille <akim@epita.fr>
20896
20897 * src/getargs.h: Don't declare `spec_name_prefix' and
20898 `spec_file_prefix', declared by src/files.h.
20899 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
20900 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
20901 * src/output.c (prepare): Adjust.
20902 * src/reader.c (symbols_output): Likewise.
20903 * src/vmsgetargs.c: Vaguely adjust, but who cares?
20904
20905 2001-12-10 Akim Demaille <akim@epita.fr>
20906
20907 * src/muscle_tab.c (muscle_init): NULL is a better default than
20908 `"0"'.
20909
20910 2001-12-10 Akim Demaille <akim@epita.fr>
20911
20912 * src/reader.c (reader): Calling symbols_output once is enough.
20913
20914 2001-12-10 Akim Demaille <akim@epita.fr>
20915
20916 Now that states have a complete set of members, the linked list of
20917 reductions is useless: just fill directly the state's reductions
20918 member.
20919
20920 * src/state.h (struct reductions): Remove member `number' and
20921 `next'.
20922 * src/LR0.c (first_reduction, last_reduction): Remove.
20923 (save_reductions): Don't link the new reductions, store them in
20924 this_state.
20925 * src/lalr.c (set_state_table): No need to attach reductions to
20926 states, it's already done.
20927 * src/output.c (output_actions): No longer free the shifts, then
20928 the reductions, then the states: free all the states and their
20929 members.
20930
20931 2001-12-10 Akim Demaille <akim@epita.fr>
20932
20933 * src/options.c (OPTN, DRTV, BOTH): New.
20934 (option_table): Use them.
20935
20936 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
20937 the job of system.h.
20938 * src/options.c: Don't include stdio.h and xalloc.h for the same
20939 reasons.
20940
20941 2001-12-10 Akim Demaille <akim@epita.fr>
20942
20943 * src/output.c (output, prepare): Make sure the values of the
20944 muscles `action' and `prologue' are 0-terminated.
20945
20946 2001-12-10 Akim Demaille <akim@epita.fr>
20947
20948 Clean up GCC warnings.
20949
20950 * src/reader.c (copy_action): `buf' is not used.
20951 (parse_skel_decl): Be static.
20952 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
20953 * src/options.h (create_long_option_table): Have a real prototype.
20954 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
20955 (hash_delete_at): Return const void *.
20956 Adjust casts to preserve the const.
20957
20958 2001-12-10 Akim Demaille <akim@epita.fr>
20959
20960 * configure.in: Require 2.52g.
20961 M4 is not needed, but AUTOM4TE is.
20962 * m4/m4.m4: Remove.
20963 * tests/Makefile.am: Adjust.
20964
20965 2001-12-10 Akim Demaille <akim@epita.fr>
20966
20967 One structure for states is enough, even though theoretically
20968 there are LR(0) states and LALR(1) states.
20969
20970 * src/lalr.h (state_t): Remove.
20971 (state_table): Be state_t **, not state_t *.
20972 * src/state.h (core, CORE_ALLOC): Rename as...
20973 (state_t, STATE_ALLOC): this.
20974 Add the LALR(1) members: shifts, reductions, errs.
20975 * src/LR0.c (state_table): Rename as...
20976 (state_hash): this, to avoid name clashes with the global
20977 `state_table'.
20978 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
20979 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
20980
20981 2001-12-10 Akim Demaille <akim@epita.fr>
20982
20983 Bison dumps core on bash.y.
20984 Reported by Pascal Bart.
20985
20986 * src/warshall.c (bitmatrix_print): New.
20987 (TC): Use it.
20988 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
20989 j must be the outer loop.
20990 * tests/regression.at (Broken Closure): New.
20991
20992 2001-12-05 Akim Demaille <akim@epita.fr>
20993
20994 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
20995 its argument.
20996 Reported by Peter Hamorsky.
20997
20998 2001-12-05 Akim Demaille <akim@epita.fr>
20999
21000 * src/conflicts.c (err_table): Remove.
21001 (resolve_sr_conflict): Adjust.
21002 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
21003 Rename as...
21004 (state_t.reductions, state_t.shifts): this.
21005
21006 2001-12-05 Akim Demaille <akim@epita.fr>
21007
21008 * src/reduce.c (reduce_grammar_tables): No longer disable the
21009 removal of useless rules via CPP but via `if (0)', so that the
21010 compiler still check the code is valid.
21011 For instance, it should have noticed `rline' no longer exists: use
21012 the `line' member of rule_t.
21013 * src/gram.c (dummy, rline): Remove, unused.
21014
21015 2001-12-05 Akim Demaille <akim@epita.fr>
21016
21017 * src/output.c (pack_vector): Use assert, not berror.
21018 * src/main.c (berror): Remove, unused.
21019
21020 2001-12-05 Akim Demaille <akim@epita.fr>
21021
21022 New experimental feature: if --verbose --trace output all the
21023 items of a state, not only its kernel.
21024
21025 * src/print.c (print_core): If `trace_flag', then invoke closure
21026 before outputting the items of the state (print_core is no longer
21027 a correct name them).
21028 (print_results): Invoke new_closure/free_closure if needed.
21029
21030 2001-12-05 Akim Demaille <akim@epita.fr>
21031
21032 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
21033 * src/closure.c, src/closure.h (itemsetsize): Rename as...
21034 (nitemset): for consistency with the rest of the project.
21035
21036 2001-12-05 Akim Demaille <akim@epita.fr>
21037
21038 * src/closure.c (print_closure): Improve.
21039 (closure): Use it for printing input and output.
21040
21041 2001-12-05 Akim Demaille <akim@epita.fr>
21042
21043 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
21044 indexed by nonterminals.
21045
21046 2001-12-05 Akim Demaille <akim@epita.fr>
21047
21048 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
21049 what it was!).
21050 * src/warshall.h: Remove accidental duplication of the content.
21051
21052 2001-12-05 Akim Demaille <akim@epita.fr>
21053
21054 * src/closure.c (set_fderives): De-obfuscate.
21055
21056 2001-12-05 Akim Demaille <akim@epita.fr>
21057
21058 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
21059
21060 2001-12-05 Akim Demaille <akim@epita.fr>
21061
21062 * src/closure.c (set_firsts): De-obfuscate.
21063
21064 2001-12-05 Akim Demaille <akim@epita.fr>
21065
21066 * src/output.c (action_row): De-obfuscate
21067 using the good o' techniques: arrays not pointers, variable
21068 locality, BITISSET, RESETBIT etc.
21069
21070 2001-12-05 Akim Demaille <akim@epita.fr>
21071
21072 Pessimize the code to simplify it: from now on, all the states
21073 have a valid SHIFTS, which NSHIFTS is possibly 0.
21074
21075 * src/LR0.c (shifts_new): Be global and move to..
21076 * src/state.c, src/state.h: here.
21077 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
21078 * src/print_graph: Adjust.
21079
21080 2001-12-05 Akim Demaille <akim@epita.fr>
21081
21082 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
21083 * src/conflicts.c: Use it.
21084 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
21085 incorrectly ``simplified''.
21086
21087 2001-12-05 Akim Demaille <akim@epita.fr>
21088
21089 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
21090 using the good o' techniques: arrays not pointers, variable
21091 locality, BITISSET, RESETBIT etc.
21092
21093 2001-12-05 Akim Demaille <akim@epita.fr>
21094
21095 * src/state.h (SHIFT_SYMBOL): New.
21096 * src/conflicts.c: Use it to deobfuscate.
21097
21098 2001-12-05 Akim Demaille <akim@epita.fr>
21099
21100 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
21101 (print_reductions): De-obfuscate using the good o' techniques:
21102 arrays not pointers, variable locality, BITISSET.
21103
21104 2001-12-05 Akim Demaille <akim@epita.fr>
21105
21106 * src/conflicts.c (print_reductions): Arrays, not pointers.
21107 Use BITISSET.
21108
21109 2001-12-05 Akim Demaille <akim@epita.fr>
21110
21111 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21112
21113 2001-12-05 Akim Demaille <akim@epita.fr>
21114
21115 * src/conflicts.c (print_reductions): Improve variable locality.
21116
21117 2001-12-05 Akim Demaille <akim@epita.fr>
21118
21119 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21120
21121 2001-12-05 Akim Demaille <akim@epita.fr>
21122
21123 * src/conflicts.c (print_reductions): Improve variable locality.
21124
21125 2001-12-05 Akim Demaille <akim@epita.fr>
21126
21127 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
21128 * src/lalr.c: Use them.
21129
21130 2001-12-05 Akim Demaille <akim@epita.fr>
21131
21132 * src/LR0.c (augment_automaton): Formatting changes.
21133 Better variable locality.
21134
21135 2001-12-05 Akim Demaille <akim@epita.fr>
21136
21137 * src/lalr.c (matrix_print): New.
21138 (transpose): Use it.
21139 Use arrays instead of pointers.
21140
21141 2001-12-05 Akim Demaille <akim@epita.fr>
21142
21143 * src/lalr.c (maxrhs): Move to...
21144 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
21145 * src/lalr.c (build_relations): Adjust.
21146
21147 2001-12-05 Akim Demaille <akim@epita.fr>
21148
21149 * src/lalr.c (transpose): Free the memory allocated to the
21150 argument, as it is replaced by the results by the unique caller.
21151 (build_relations): Merely invoke transpose: it handles the memory
21152 deallocation.
21153 Improve variable locality.
21154 Avoid variables used as mere abbreviations.
21155 (compute_lookaheads): Use arrays instead of pointers.
21156
21157 2001-12-05 Akim Demaille <akim@epita.fr>
21158
21159 * src/lalr.c (initialize_F): Improve variable locality.
21160 Avoid variables used as mere abbreviations.
21161
21162 2001-12-05 Akim Demaille <akim@epita.fr>
21163
21164 * src/derives.c (print_derives): Display the ruleno.
21165 * src/lalr.c (initialize_F, transpose): Better variable locality
21166 to improve readability.
21167 Avoid variables used as mere abbreviations.
21168
21169 2001-12-05 Akim Demaille <akim@epita.fr>
21170
21171 * src/lalr.c (traverse): Use arrays instead of pointers.
21172
21173 2001-12-05 Akim Demaille <akim@epita.fr>
21174
21175 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
21176 the handling of squeue.
21177 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21178
21179 2001-12-05 Akim Demaille <akim@epita.fr>
21180
21181 Because useless nonterminals are now kept alive (instead of being
21182 `destroyed'), we now sometimes examine them, and store information
21183 related to them. Hence we need to know their number, and adjust
21184 memory allocations.
21185
21186 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
21187 static.
21188 * src/LR0.c (allocate_itemsets): The memory allocated to
21189 `symbol_count' was used for two different purpose: once to count
21190 the number of occurrences of each symbol, and later reassigned to
21191 `shift_symbol', containing the symbol that can be shifted from a
21192 given state.
21193 Deobfuscate, i.e., allocate, use and free `symbol_count' here
21194 only, and...
21195 (new_itemsets): Allocate `shift_symbol' here.
21196 (allocate_itemsets): symbol_count includes useless nonterminals.
21197 Make room for them.
21198 (free_storage): Use `free', not `XFREE', for pointers that cannot
21199 be null.
21200
21201 2001-12-05 Akim Demaille <akim@epita.fr>
21202
21203 * src/nullable.c (set_nullable): Deobfuscate the handling of
21204 ritem.
21205 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21206
21207 2001-12-05 Akim Demaille <akim@epita.fr>
21208
21209 * src/gram.c, src/gram.h (ritem_print): New.
21210 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
21211 (This useless function was defined only to work around VMS linkers
21212 that can't handle compilation units with variables only).
21213 * src/reduce.c (dump_grammar): Use it to trace the construction of
21214 ritem.
21215
21216 2001-12-04 Paul Eggert <eggert@twinsun.com>
21217
21218 * src/bison.simple (union yyalloc): Change member names
21219 to be the same as the stack names.
21220 (yyparse): yyptr is now union yyalloc *, not char *.
21221 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
21222 and may generate better code on some machines.
21223 (yystpcpy): Use prototype if __STDC__ is defined, not just
21224 if __cplusplus is defined.
21225
21226 2001-11-30 Akim Demaille <akim@epita.fr>
21227
21228 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
21229 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
21230 Gettext doesn't compile cleanly, and dies with -Werror.
21231 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
21232 Include WARNING_CFLAGS here.
21233 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
21234 before being defined.
21235
21236 2001-11-27 Paul Eggert <eggert@twinsun.com>
21237
21238 * lib/quotearg.h (quotearg_n, quotearg_n_style):
21239 First arg is int, not unsigned.
21240 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
21241 (SIZE_MAX, UINT_MAX): New macros.
21242 (quotearg_n_options): Abort if N is negative.
21243 Avoid overflow check on hosts where size_t is 64 bits and int
21244 is 32 bits, as overflow is impossible there.
21245 Fix off-by-one typo that caused unnecessary reallocation.
21246
21247 2001-11-29 Paul Eggert <eggert@twinsun.com>
21248
21249 Name space cleanup in generated parser.
21250
21251 * doc/bison.texinfo (Bison Parser): Discuss system headers
21252 and their effect on the user name space.
21253
21254 * src/bison.simple:
21255 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
21256 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
21257 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
21258
21259 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
21260 on user names when possible.
21261
21262 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
21263 Simplify test for whather <alloca.h> exists.
21264
21265 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
21266
21267 (<stdio.h>): Include if YYDEBUG.
21268
21269 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
21270 ! defined (yyoverflow) && ! defined (yymemcpy).
21271
21272 (yymemcpy, yyparse): Rename local variables as needed so that
21273 they all begin with 'yy'.
21274
21275 (yystrlen, yystpcpy): New functions.
21276
21277 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
21278 All uses changed.
21279
21280 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
21281 instead of relying on string.h functions. Use YYSTACK_ALLOC
21282 and YYSTACK_FREE instead of malloc and free.
21283
21284 2001-11-30 Akim Demaille <akim@epita.fr>
21285
21286 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
21287 before their first uses.
21288 (YYBISON, YYPURE): Move to the top of the output.
21289
21290 2001-11-30 Akim Demaille <akim@epita.fr>
21291
21292 * tests/reduce.at (Useless Nonterminals): Fix.
21293
21294 2001-11-30 Akim Demaille <akim@epita.fr>
21295
21296 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
21297 if body instead of `;' to pacify GCC's warnings.
21298
21299 2001-11-30 Akim Demaille <akim@epita.fr>
21300
21301 Instead of mapping the LHS of unused rules to -1, keep the LHS
21302 valid, but flag the rules as invalid.
21303
21304 * src/gram.h (rule_t): `useful' is a new member.
21305 * src/print.c (print_grammar): Adjust.
21306 * src/derives.c (set_derives): Likewise.
21307 * src/reader.c (packgram, reduce_output): Likewise.
21308 * src/reduce.c (reduce_grammar_tables): Likewise.
21309 * tests/reduce.at (Underivable Rules, Useless Rules): New.
21310
21311 2001-11-30 Akim Demaille <akim@epita.fr>
21312
21313 * src/reduce.c (reduce_output): Formatting changes.
21314 * src/print.c (print_results, print_grammar): Likewise.
21315 * tests/regression.at (Rule Line Numbers)
21316 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
21317
21318 2001-11-30 Akim Demaille <akim@epita.fr>
21319
21320 * src/reduce.c (nonterminals_reduce): Instead of throwing away
21321 useless nonterminals, move them at the end of the symbol arrays.
21322 (reduce_output): Adjust.
21323 * tests/reduce.at (Useless Nonterminals): Adjust.
21324
21325 2001-11-30 Akim Demaille <akim@epita.fr>
21326
21327 * src/reduce.c: Various comment/formatting changes.
21328 (nonterminals_reduce): New, extracted from...
21329 (reduce_grammar_tables): here.
21330 (reduce_grammar): Call nonterminals_reduce.
21331
21332 2001-11-29 Paul Eggert <eggert@twinsun.com>
21333
21334 * src/bison.simple (YYSTACK_REALLOC): Remove.
21335 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
21336 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
21337 New macros.
21338 (union yyalloc): New type.
21339 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
21340 an arbitrary restriction on hosts where size_t is wider than int.
21341
21342 (yyparse): Don't dump core if alloca or malloc fails; instead, report
21343 a parser stack overflow. Allocate just one block of memory for all
21344 three stacks, instead of allocating three blocks; this typically is
21345 faster and reduces fragmentation.
21346
21347 Do not limit the number of items in the stack to a value that fits
21348 in 'int', as this is an arbitrary limit on hosts with 64-bit
21349 size_t and 32-bit int.
21350
21351 2001-11-29 Marc Autret <autret_m@epita.fr>
21352
21353 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
21354 of defining YYERROR_VERBOSE.
21355 [AT_DATA]: $4 is now out of C declarations in the prologue.
21356
21357 2001-11-28 Marc Autret <autret_m@epita.fr>
21358
21359 * src/reader.c (parse_dquoted_param): New.
21360 (parse_skel_decl): Use it.
21361 * src/lex.h: Add its prototype.
21362 * src/lex.c (literalchar): Become not static.
21363
21364 2001-11-28 Marc Autret <autret_m@epita.fr>
21365
21366 * src/output.h: And put its extern declaration here.
21367 * src/output.c (error_verbose): Define here.
21368 (prepare): Echo name modification.
21369 * src/getargs.h: Clean its extern declaration.
21370 * src/getargs.c (error_verbose_flag): Remove.
21371 (getargs): Remove case 'e'.
21372 * src/options.c (option_table): 'error-verbose' is now seen as simple
21373 percent option.
21374 Include output.h.
21375
21376 * src/reader.c (read_declarations): Remove case tok_include.
21377 (parse_include_decl): Remove.
21378 * src/lex.h (token_t): Remove tok_include.
21379 * src/options.c (option_table): 'include' is now a simple command line
21380 option.
21381
21382 2001-11-28 Marc Autret <autret_m@epita.fr>
21383
21384 * src/bison.simple: Adjust muscle names.
21385 * src/muscle_tab.c (muscle_init): Also rename the muscles.
21386 * src/output.c (prepare): s/_/-/ for the muscles names.
21387 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
21388
21389 2001-11-28 Marc Autret <autret_m@epita.fr>
21390
21391 * src/bison.simple: Fix debug.
21392 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
21393
21394 2001-11-28 Akim Demaille <akim@epita.fr>
21395
21396 * src/LR0.c (shifts_new): New.
21397 (save_shifts, insert_start_shift, augment_automaton): Use it.
21398
21399 2001-11-28 Akim Demaille <akim@epita.fr>
21400
21401 * src/closure.c (closure): `b' and `ruleno' denote the same value:
21402 keep ruleno only.
21403
21404 2001-11-28 Akim Demaille <akim@epita.fr>
21405
21406 * src/closure.c (closure): Instead of looping over word in array
21407 then bits in words, loop over bits in array.
21408
21409 2001-11-28 Akim Demaille <akim@epita.fr>
21410
21411 * src/closure.c (closure): No longer optimize the special case
21412 where all the bits of `ruleset[r]' are set to 0, to make the code
21413 clearer.
21414
21415 2001-11-28 Akim Demaille <akim@epita.fr>
21416
21417 * src/closure.c (closure): `r' and `c' are new variables, used to
21418 de-obfuscate accesses to RULESET and CORE.
21419
21420 2001-11-28 Akim Demaille <akim@epita.fr>
21421
21422 * src/reduce.c (reduce_print): Use ngettext.
21423 (dump_grammar): Improve the trace accuracy.
21424
21425 2001-11-28 Akim Demaille <akim@epita.fr>
21426
21427 * src/reduce.c (dump_grammar): Don't translate trace messages.
21428
21429 2001-11-28 Akim Demaille <akim@epita.fr>
21430
21431 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
21432 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
21433 as all tags are free'ed afterwards.
21434 From Enrico Scholz.
21435
21436 2001-11-27 Paul Eggert <eggert@twinsun.com>
21437
21438 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
21439 use alloca when we didn't want to, and vice versa.
21440
21441 2001-11-27 Marc Autret <autret_m@epita.fr>
21442
21443 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
21444 initialization.
21445 * src/output.c (prepare): Remove its update.
21446
21447 2001-11-27 Marc Autret <autret_m@epita.fr>
21448
21449 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
21450 Use %error-verbose.
21451
21452 2001-11-27 Marc Autret <autret_m@epita.fr>
21453
21454 * src/bison.simple: Remove YYERROR_VERBOSE using.
21455 Use %%error_verbose.
21456 (yyparse): Likewise.
21457 * src/output.c (prepare): Give its final value.
21458 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
21459 * src/getargs.h: Add its extern declaration.
21460 * src/getargs.c (error_verbose_flag): New int.
21461 (getargs): Update to catch new case.
21462 * src/options.c (option_table): 'error-verbose' is a new option.
21463 (shortopts): Update.
21464
21465 2001-11-27 Akim Demaille <akim@epita.fr>
21466
21467 * src/system.h: Use intl/libgettext.h.
21468 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
21469
21470 2001-11-27 Akim Demaille <akim@epita.fr>
21471
21472 * tests/torture.at (Exploding the Stack Size with Malloc):
21473 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
21474
21475 2001-11-27 Akim Demaille <akim@epita.fr>
21476
21477 * src/files.c: Include error.h.
21478 Reported by Hans Aberg.
21479
21480 2001-11-26 Marc Autret <autret_m@epita.fr>
21481
21482 * src/reader.c (parse_include_decl): New, not yet implemented.
21483 (read_declarations): Add case tok_include.
21484 * src/getargs.h (include): Add its extern definition.
21485 * src/getargs.c (include): New const char *.
21486 (getargs): Add case '-I'.
21487 * src/options.c (option_table): Add include as command line and
21488 percent option.
21489 * src/lex.h (token_t): Add tok_include.
21490
21491 2001-11-26 Akim Demaille <akim@epita.fr>
21492
21493 * src/reader.c (readgram): Make sure rules for mid-rule actions
21494 have a lineno equal to that of their host rule.
21495 Reported by Hans Aberg.
21496 * tests/regression.at (Rule Line Numbers): New.
21497
21498 2001-11-26 Akim Demaille <akim@epita.fr>
21499
21500 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
21501 size_ts.
21502
21503 2001-11-26 Akim Demaille <akim@epita.fr>
21504
21505 * src/complain.c, src/complain.h (error): Remove, provided by
21506 lib/error.[ch].
21507
21508 2001-11-26 Akim Demaille <akim@epita.fr>
21509
21510 * src/reader.c (read_declarations): Don't abort on tok_illegal,
21511 issue an error message.
21512 * tests/regression.at (Invalid %directive): New.
21513 Reported by Hans Aberg.
21514
21515 2001-11-26 Akim Demaille <akim@epita.fr>
21516
21517 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
21518 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
21519
21520 2001-11-26 Akim Demaille <akim@epita.fr>
21521
21522 * src/conflicts.c (conflicts_print): Don't complain at all when
21523 there are no reduce/reduce conflicts, and as many shift/reduce
21524 conflicts as expected.
21525 * tests/regression.at (%expect right): Adjust.
21526
21527 2001-11-23 Akim Demaille <akim@epita.fr>
21528
21529 * lib/alloca.c: Update, from fileutils.
21530
21531 2001-11-23 Akim Demaille <akim@epita.fr>
21532
21533 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
21534
21535 2001-11-23 Akim Demaille <akim@epita.fr>
21536
21537 * src/system.h: Include alloca.h.
21538 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
21539
21540 2001-11-23 Akim Demaille <akim@epita.fr>
21541
21542 * src/print_graph.c (print_actions): Remove `rule', unused.
21543 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
21544 pacify GCC's signed < unsigned warnings.
21545 * src/closure.c (itemsetsize): Likewise.
21546 * src/reader.c (symbol_list_new): Static.
21547
21548 2001-11-23 Akim Demaille <akim@epita.fr>
21549
21550 Attaching lineno to buckets is stupid, since only one copy of each
21551 symbol is kept, only the line of the first occurrence is kept too.
21552
21553 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
21554 * src/reader.c (rline_allocated): Remove, unused.
21555 (symbol_list): Have a `line' member.
21556 (symbol_list_new): New.
21557 (readgram): Use it.
21558 * src/print.c (print_grammar): Output the rule line numbers.
21559 * tests/regression.at (Solved SR Conflicts)
21560 (Unresolved SR Conflicts): Adjust.
21561 Reported by Hans Aberg.
21562
21563 2001-11-22 Marc Autret <autret_m@epita.fr>
21564
21565 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
21566
21567 2001-11-22 Marc Autret <autret_m@epita.fr>
21568
21569 * src/muscle_tab.c (muscle_init): Remove initialization of
21570 skeleton muscle.
21571 * src/output.c (output_master_parser): Do it here.
21572
21573 2001-11-20 Akim Demaille <akim@epita.fr>
21574
21575 * po/sv.po: New.
21576 * configure.in (ALL_LINGUAS): Adjust.
21577 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
21578 longer contains strings to translate.
21579
21580 2001-11-19 Akim Demaille <akim@epita.fr>
21581
21582 * src/conflicts.c (conflicts_print): Add a missing \n.
21583
21584 2001-11-19 Akim Demaille <akim@epita.fr>
21585
21586 * src/nullable.c (nullable_print): New.
21587 (set_nullable): Call it when tracing.
21588 Better locality of variables.
21589
21590 2001-11-19 Akim Demaille <akim@epita.fr>
21591
21592 * src/print.c (print_actions): Better locality of variables.
21593
21594 2001-11-19 Akim Demaille <akim@epita.fr>
21595
21596 * src/derives.c (print_derives): Fix and enrich.
21597 * src/closure.c (print_fderives): Likewise.
21598
21599 2001-11-19 Akim Demaille <akim@epita.fr>
21600
21601 * src/closure.c (itemsetend): Remove, replaced with...
21602 (itemsetsize): new.
21603
21604 2001-11-19 Akim Demaille <akim@epita.fr>
21605
21606 * src/LR0.c (kernel_end): Remove, replaced with...
21607 (kernel_size): new.
21608
21609 2001-11-19 Akim Demaille <akim@epita.fr>
21610
21611 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
21612 to clarify.
21613
21614 2001-11-19 Akim Demaille <akim@epita.fr>
21615
21616 * src/closure.c (closure): Use arrays instead of pointers to clarify.
21617
21618 2001-11-19 Akim Demaille <akim@epita.fr>
21619
21620 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
21621 trace messages.
21622 * src/LR0.c: Likewise.
21623 (allocate_itemsets): Use arrays instead of pointers to clarify.
21624
21625 2001-11-19 Akim Demaille <akim@epita.fr>
21626
21627 * src/getargs.c (statistics_flag): Replace with...
21628 (trace_flag): New.
21629 (longopts): Accept --trace instead of --statistics.
21630 * src/getargs.h, src/options.c: Adjust.
21631 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
21632 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
21633
21634 2001-11-19 Akim Demaille <akim@epita.fr>
21635
21636 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
21637 pointers to clarify the code.
21638 (save_reductions, save_shifts): Factor common parts of alternatives.
21639
21640 2001-11-19 Akim Demaille <akim@epita.fr>
21641
21642 * src/LR0.c (new_state, get_state): Complete TRACE code.
21643 * src/closure.c: Include `reader.h' to get `tags', needed by the
21644 trace code.
21645 Rename the conditional DEBUG as TRACE.
21646 Output consistently TRACEs to stderr, not stdout.
21647 * src/derives.c: Likewise.
21648 * src/reduce.c: (inaccessable_symbols): Using if is better style
21649 than goto.
21650 Use `#if TRACE' instead of `#if 0' for tracing code.
21651
21652 2001-11-19 Akim Demaille <akim@epita.fr>
21653
21654 * src/system.h (LIST_FREE, shortcpy): New.
21655 * src/LR0.c: Use them.
21656 * src/output.c (free_itemsets, free_reductions, free_shifts):
21657 Remove, replaced by LIST_FREE.
21658
21659 2001-11-19 Akim Demaille <akim@epita.fr>
21660
21661 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
21662 (REDUCTIONS_ALLOC): New.
21663 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
21664 allocation.
21665
21666 2001-11-19 Akim Demaille <akim@epita.fr>
21667
21668 * src/LR0.c (new_state): Complete trace code.
21669 * src/nullable.c (set_nullable): Don't translate traces.
21670
21671 2001-11-19 Akim Demaille <akim@epita.fr>
21672
21673 * src/print_graph.c (print_core): Better locality of variables.
21674 * src/print.c (print_core): Likewise.
21675
21676 2001-11-19 Akim Demaille <akim@epita.fr>
21677
21678 * src/vcg.c: You do the output, so you are responsible of the
21679 handling of VCG syntax, in particular: use quotearg.
21680 * src/print_graph.c: Don't.
21681 (print_actions): Don't output the actions as part of the nodes,
21682 since that's the job of the edges.
21683 (print_state): Don't output by hand: fill the node description,
21684 and ask for its output.
21685
21686 2001-11-19 Akim Demaille <akim@epita.fr>
21687
21688 * src/bison.simple (yyparse): When verbosely reporting an error,
21689 no longer put additional quotes around token names.
21690 * tests/calc.at: Adjust.
21691
21692 2001-11-19 Akim Demaille <akim@epita.fr>
21693
21694 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
21695 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
21696 * src/output.c: Adjust.
21697
21698 2001-11-19 Akim Demaille <akim@epita.fr>
21699
21700 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
21701 (rule_t): this.
21702 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
21703
21704 2001-11-19 Akim Demaille <akim@epita.fr>
21705
21706 * src/gram.h (rule_t): New.
21707 (rule_table): New.
21708 (rrhs, rlhs): Remove, part of state_t.
21709 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
21710 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
21711 * src/reader.c, src/reduce.c: Adjust.
21712
21713 2001-11-19 Akim Demaille <akim@epita.fr>
21714
21715 * src/reader.c (symbols_output): New, extracted from...
21716 (packsymbols): Here.
21717 (reader): Call it.
21718
21719 2001-11-19 Akim Demaille <akim@epita.fr>
21720
21721 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
21722 (maxrhs): this new function.
21723
21724 2001-11-19 Akim Demaille <akim@epita.fr>
21725
21726 * src/lalr.c (F): New macro to access the variable F.
21727 Adjust.
21728
21729 2001-11-19 Akim Demaille <akim@epita.fr>
21730
21731 * src/lalr.h (LA): New macro to access the variable LA.
21732 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21733 * src/lalr.c: Adjust.
21734
21735 2001-11-19 Akim Demaille <akim@epita.fr>
21736
21737 * src/lalr.c (initialize_LA): Only initialize LA. Let...
21738 (set_state_table): handle the `lookaheads' members.
21739
21740 2001-11-19 Akim Demaille <akim@epita.fr>
21741
21742 * src/lalr.h (lookaheads): Removed array, whose contents is now
21743 a member of...
21744 (state_t): this structure.
21745 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21746 Adjust.
21747
21748 2001-11-19 Akim Demaille <akim@epita.fr>
21749
21750 * src/lalr.h (consistent): Removed array, whose contents is now
21751 a member of...
21752 (state_t): this structure.
21753 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21754 Adjust.
21755
21756 2001-11-19 Akim Demaille <akim@epita.fr>
21757
21758 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
21759 contents are now members of...
21760 (state_t): this structure.
21761 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21762 Adjust.
21763
21764 2001-11-19 Akim Demaille <akim@epita.fr>
21765
21766 * src/lalr.h (state_t): New.
21767 (state_table): Be a state_t * instead of a core **.
21768 (accessing_symbol): Remove, part of state_t.
21769 * src/lalr.c: Adjust.
21770 (set_accessing_symbol): Merge into...
21771 (set_state_table): this.
21772 * src/print_graph.c, src/conflicts.c: Adjust.
21773
21774 2001-11-14 Akim Demaille <akim@epita.fr>
21775
21776 * tests/calc.at, tests/output.at, tests/regression.at,
21777 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
21778 now the tests are run in private dirs, therefore AC_CLEANUP and
21779 family can be simplified to 0-ary.
21780 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
21781 use abs. path to find config.h.
21782 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
21783 stderr, there can be way too much random noise.
21784 Instead pass -Werror to GCC and rely on the exit status.
21785 Reported by Wolfram Wagner.
21786
21787 2001-11-14 Akim Demaille <akim@epita.fr>
21788
21789 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
21790 defined only if yyoverflow is defined, to avoid `warning: unused
21791 variable `yyvs1''.
21792 Reported by The Test Suite.
21793
21794 2001-11-14 Akim Demaille <akim@epita.fr>
21795
21796 * src/print.c: Include reduce.h.
21797 Reported by Hans Aberg.
21798
21799 2001-11-14 Akim Demaille <akim@epita.fr>
21800
21801 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
21802 Revert a previous patch: these are really const.
21803 * src/conflicts.c (conflict_report): Additional useless pair of
21804 braces to pacify GCC's warnings for `if () if () {} else {}'.
21805 * src/lex.c (parse_percent_token): Replace equal_offset with
21806 arg_offset.
21807 arg is const.
21808 Be sure to strdup `arg' when used, since there is no reason for
21809 token_buffer not to change.
21810
21811 2001-11-14 Akim Demaille <akim@epita.fr>
21812
21813 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
21814 definition.
21815 * src/main.c (main): Use them.
21816 Suggested by Hans Aberg.
21817
21818 2001-11-12 Akim Demaille <akim@epita.fr>
21819
21820 * src/system.h (ngettext): Now that we use ngettext, be sure to
21821 provide a default definition when NLS are not used.
21822
21823 2001-11-12 Akim Demaille <akim@epita.fr>
21824
21825 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
21826 Use @kbd to denote user input.
21827 (Language and Grammar): ANSIfy the example.
21828 Adjust its layout for info/notinfo.
21829 (Location Tracking Calc): Output error messages to stderr.
21830 Output locations in a more GNUtically correct way.
21831 Fix a couple of Englishos.
21832 Adjust @group/@end group pairs.
21833
21834 2001-11-12 Akim Demaille <akim@epita.fr>
21835
21836 %expect was not functioning at all.
21837
21838 * src/conflicts.c (expected_conflicts): Set to -1.
21839 (conflict_report): Use ngettext.
21840 (conflicts_print): Check %expect and make its violation an error.
21841 * doc/bison.texinfo (Expect Decl): Adjust.
21842 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
21843 * tests/regression.at (%expect not enough, %expect right)
21844 (%expect too much): New.
21845
21846 2001-11-12 Akim Demaille <akim@epita.fr>
21847
21848 * tests/regression.at (Conflicts): Rename as...
21849 (Unresolved SR Conflicts): this.
21850 (Solved SR Conflicts): New.
21851
21852 2001-11-12 Akim Demaille <akim@epita.fr>
21853
21854 * src/reduce.c (print_results): Rename as...
21855 (reduce_output): This.
21856 Output to OUT, passed as argument, instead of output_obstack.
21857 (dump_grammar): Likewise.
21858 (reduce_free): New.
21859 Also free V1.
21860 (reduce_grammar): No longer call reduce_output, since...
21861 * src/print.c (print_results): do it.
21862 * src/main.c (main): Call reduce_free;
21863
21864 2001-11-12 Akim Demaille <akim@epita.fr>
21865
21866 * src/conflicts.c (print_reductions): Accept OUT as argument.
21867 Output to it, not to output_obstack.
21868 * src/print.c (print_actions): Adjust.
21869
21870 2001-11-12 Akim Demaille <akim@epita.fr>
21871
21872 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
21873 the result instead of using...
21874 (src_total, rrc_total, src_count, rrc_count): Remove.
21875 (any_conflicts): Remove.
21876 (print_conflicts): Split into...
21877 (conflicts_print, conflicts_output): New.
21878 * src/conflicts.h: Adjust.
21879 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
21880 * src/print.c (print_grammar): Issue `\n' between two rules.
21881 * tests/regression.at (Conflicts): New.
21882 Reported by Tom Lane.
21883
21884 2001-11-12 Akim Demaille <akim@epita.fr>
21885
21886 * tests/regression.at (Invalid input): Remove, duplicate with
21887 ``Invalid input: 1''.
21888
21889 2001-11-12 Akim Demaille <akim@epita.fr>
21890
21891 * tests/torture.at (AT_DATA_STACK_TORTURE)
21892 (Exploding the Stack Size with Alloca)
21893 (Exploding the Stack Size with Malloc): New.
21894
21895 2001-11-12 Akim Demaille <akim@epita.fr>
21896
21897 * src/bison.simple (YYSTACK_REALLOC): New.
21898 (yyparse) [!yyoverflow]: Use it and free the old stack.
21899 Reported by Per Allansson.
21900
21901 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
21902
21903 * src/bison.simple: Define type yystype instead of YYSTYPE, and
21904 define CPP macro, which substitute YYSTYPE by yystype.
21905 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
21906 with yyltype/YYLTYPE. This allows inclusion of the generated
21907 header within the parser if the compiler, such as GGC, accepts
21908 multiple equivalent #defines.
21909 From Akim.
21910
21911 2001-11-05 Akim Demaille <akim@epita.fr>
21912
21913 * src/reader.c (symbols_output): New, extracted from...
21914 (packsymbols): here.
21915 (reader): Adjust.
21916
21917 2001-11-05 Akim Demaille <akim@epita.fr>
21918
21919 * src/lex.c (parse_percent_token): s/quotearg/quote/.
21920
21921 2001-11-05 Akim Demaille <akim@epita.fr>
21922
21923 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
21924 pattern.
21925
21926 2001-11-05 Akim Demaille <akim@epita.fr>
21927
21928 * src/options.h (struct option_table_struct): set_flags is void*.
21929 * src/options.c (longopts): Support `--output' and `%output'.
21930 (usage): Adjust.
21931 * src/lex.h (tok_setopt): Remove, replaced with...
21932 (tok_intopt, tok_stropt): these new guys.
21933 * src/lex.c (getopt.h): Not needed.
21934 (token_buffer, unlexed_token_buffer): Not const.
21935 (percent_table): Promote `-' over `_' in directive names.
21936 Active `%name-prefix', `file-prefix', and `output'.
21937 (parse_percent_token): Accept possible arguments to directives.
21938 Promote `-' over `_' in directive names.
21939
21940 2001-11-04 Akim Demaille <akim@epita.fr>
21941
21942 * doc/bison.texinfo (Decl Summary): Split the list into
21943 `directives for grammars' and `directives for bison'.
21944 Sort'em.
21945 Add description of `%name-prefix', `file-prefix', and `output'.
21946 Promote `-' over `_' in directive names.
21947 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
21948 Simplify the description of `--name-prefix'.
21949 Promote `-' over `_' in directive names.
21950 Promote `--output' over `--output-file'.
21951 Fix the description of `--defines'.
21952 * tests/output.at: Exercise %file-prefix and %output.
21953
21954 2001-11-02 Akim Demaille <akim@epita.fr>
21955
21956 * doc/refcard.tex: Update.
21957
21958 2001-11-02 Akim Demaille <akim@epita.fr>
21959
21960 * src/symtab.h (SUNDEF): New.
21961 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
21962 stand for `uninitialized', instead of 0.
21963 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
21964 * src/lex.c (lex): Adjust.
21965
21966 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
21967 Number it 0.
21968 Let yylex return it instead of a plain 0.
21969 Reported by Dick Streefland.
21970
21971 2001-11-02 Akim Demaille <akim@epita.fr>
21972
21973 * tests/regression.at (Mixing %token styles): New test.
21974
21975 2001-11-02 Akim Demaille <akim@epita.fr>
21976
21977 * src/reader.c (parse_thong_decl): Formatting changes.
21978 (token_translations_init): New, extracted from...
21979 (packsymbols): Here.
21980 Adjust.
21981
21982 2001-11-01 Akim Demaille <akim@epita.fr>
21983
21984 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
21985 Check that `9foo.y' produces correct cpp guards.
21986 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
21987 guards.
21988 Reported by Wwp.
21989
21990 2001-11-01 Akim Demaille <akim@epita.fr>
21991
21992 * tests/regression.at (Invalid input: 2): New.
21993 * src/lex.c (unlexed_token_buffer): New.
21994 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
21995 too.
21996 Reported by Wwp.
21997
21998 2001-11-01 Akim Demaille <akim@epita.fr>
21999
22000 * tests/calc.at: Catch up with 1.30.
22001 * configure.in: Bump to 1.49a.
22002 Adjust to newer Autotest.
22003
22004 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
22005
22006 * src/conflicts.c: Move global variables rrc_total and src_total ...
22007 (print_conflicts): here.
22008 * src/output.c (output): Free global variable user_toknums.
22009 * src/lex.c (token_obstack): Become static.
22010
22011 2001-10-18 Akim Demaille <akim@epita.fr>
22012
22013 * tests/atlocal.in (GCC): Add.
22014 * tests/calc.at: s/m4_match/m4_bmatch/.
22015 s/m4_patsubst/m4_bpatsubst/.
22016 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
22017 * configure.in: AC_SUBST(GCC).
22018
22019 2001-10-14 Marc Autret <autret_m@epita.fr>
22020
22021 * src/options.c (create_long_option_table): Fix.
22022
22023 2001-10-10 Akim Demaille <akim@epita.fr>
22024
22025 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
22026
22027 2001-10-04 Akim Demaille <akim@epita.fr>
22028
22029 * src/reader.c (parse_union_decl): Push the caracters in
22030 union_obstack, not attrs_obstack.
22031
22032 2001-10-04 Akim Demaille <akim@epita.fr>
22033
22034 Merge in the branch 1.29.
22035
22036 * src/reader.c (packsymbols): Use a temporary obstack for
22037 `%%tokendef', since output_stack is already used elsewhere.
22038
22039 2001-10-02 Akim Demaille <akim@epita.fr>
22040
22041 Bump 1.29d.
22042
22043 2001-10-02 Akim Demaille <akim@epita.fr>
22044
22045 Version 1.29c.
22046
22047 2001-10-02 Akim Demaille <akim@epita.fr>
22048
22049 * tests/regression.at (Invalid CPP headers): New.
22050 From Alexander Belopolsky.
22051 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
22052
22053 2001-10-02 Akim Demaille <akim@epita.fr>
22054
22055 * tests/regression.at (Invalid input): New.
22056 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
22057 Reported by Shura.
22058
22059 2001-10-02 Akim Demaille <akim@epita.fr>
22060
22061 * tests/calc.at: Now that --debug works, the tests must be adjusted.
22062
22063 2001-10-02 Akim Demaille <akim@epita.fr>
22064
22065 * src/output.c (output_parser): Assert `skeleton'.
22066 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
22067 systems.
22068 From Shura.
22069
22070 2001-10-01 Marc Autret <autret_m@epita.fr>
22071
22072 * src/lex.h: Echo modifications.
22073 * src/lex.c (unlex): Parameter is now token_t.
22074 From Hans Aberg.
22075
22076 2001-10-01 Marc Autret <autret_m@epita.fr>
22077
22078 * src/main.c: Include lex.h.
22079 From Hans Aberg.
22080
22081 2001-09-29 Akim Demaille <akim@epita.fr>
22082
22083 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
22084
22085 2001-09-28 Akim Demaille <akim@epita.fr>
22086
22087 * tests/testsuite.at: Update to newer Autotest.
22088 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
22089
22090 2001-09-27 Akim Demaille <akim@epita.fr>
22091
22092 Position independent wrapper.
22093
22094 * tests/bison: Remove.
22095 * tests/bison.in: New.
22096 * configure.in: Adjust.
22097
22098 2001-09-27 Paul Eggert <eggert@twinsun.com>
22099
22100 Port quotearg fixes from tar 1.13.24.
22101
22102 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
22103 tm to be declared.
22104 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
22105 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
22106
22107 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
22108 * m4/mbrtowc.m4: New file.
22109 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
22110 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
22111
22112 2001-09-27 Akim Demaille <akim@epita.fr>
22113
22114 Bump to 1.29c.
22115
22116 2001-09-27 Akim Demaille <akim@epita.fr>
22117
22118 Version 1.29b.
22119
22120 2001-09-25 Akim Demaille <akim@epita.fr>
22121
22122 * src/system.h: Include `xalloc.h'.
22123 Remove it from the C files.
22124 * src/files.c (output_files): Free the obstacks.
22125 * src/lex.c (init_lex): Rename as...
22126 (lex_init): this.
22127 (lex_free): New.
22128 * src/main.c (main): Use it.
22129
22130 2001-09-24 Marc Autret <autret_m@epita.fr>
22131
22132 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
22133 to output informations in fout (FILE*).
22134 (open_graph, close_graph): Likewise.
22135 (output_graph, output_edge, output_node): Likewise.
22136 * src/vcg.h: Update function prototypes.
22137 * src/print_graph.c (print_graph): Open output graph file.
22138 (print_actions): Adjust.
22139 * src/files.h: Remove extern declaration.
22140 * src/files.c: Remove graph_obstack declaration.
22141 (open_files): Remove graph_obstack initialization.
22142 (output_files): Remove graph_obstack saving.
22143
22144 2001-09-24 Marc Autret <autret_m@epita.fr>
22145
22146 * src/files.c (compute_output_file_names): Fix.
22147
22148 2001-09-24 Marc Autret <autret_m@epita.fr>,
22149 Akim Demaille <akim@epita.fr>
22150
22151 * src/reader.c (reader): Remove call to free_symtab ().
22152 * src/main.c (main): Call it here.
22153 Include symtab.h.
22154 * src/conflicts.c (initialize_conflicts): Rename as...
22155 (solve_conflicts): this.
22156 * src/print.c (print_core, print_actions, print_state)
22157 (print_grammar): Dump to a file instead a `output_obstack'.
22158 (print_results): Dump `output_obstack', and then proceed with the
22159 FILE *.
22160 * src/files.c (compute_output_file_names, close_files): New.
22161 (output_files): Adjust.
22162 * src/main.c (main): Adjust.
22163
22164 2001-09-23 Marc Autret <autret_m@epita.fr>
22165
22166 * src/files.c (compute_header_macro): Computes header macro name
22167 from spec_defines_file when given.
22168
22169 2001-09-23 Marc Autret <autret_m@epita.fr>
22170
22171 * src/files.c (output_files): Add default extensions.
22172
22173 2001-09-22 Akim Demaille <akim@epita.fr>
22174
22175 * src/conflicts.c (finalize_conflicts): Rename as...
22176 (free_conflicts): this.
22177
22178 2001-09-22 Akim Demaille <akim@epita.fr>
22179
22180 * src/gram.c (gram_free): Rename back as...
22181 (dummy): this.
22182 (output_token_translations): Free `token_translations'.
22183 * src/symtab.c (free_symtab): Free the tag field.
22184
22185 2001-09-22 Akim Demaille <akim@epita.fr>
22186
22187 Remove `translations' as it is always set to true.
22188
22189 * src/gram.h: Adjust.
22190 * src/reader.c (packsymbols, parse_token_decl): Adjust
22191 * src/print.c (print_grammar): Adjust.
22192 * src/output.c (output_token_translations): Adjust.
22193 * src/lex.c (lex): Adjust.
22194 * src/gram.c: Be sure the set pointers to NULL.
22195 (dummy): Rename as...
22196 (gram_free): this.
22197
22198 2001-09-22 Akim Demaille <akim@epita.fr>
22199
22200 * configure.in: Invoke AM_LIB_DMALLOC.
22201 * src/system.h: Use dmalloc.
22202 * src/LR0.c: Be sure to have pointers initialized to NULL.
22203 (allocate_itemsets): Allocate kernel_items only if needed.
22204
22205 2001-09-22 Akim Demaille <akim@epita.fr>
22206
22207 * configure.in: Bump to 1.29b.
22208 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
22209 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
22210 need xmalloc.c in calc.y.
22211 From Pascal Bart.
22212
22213 2001-09-21 Akim Demaille <akim@epita.fr>
22214
22215 Version 1.29a.
22216 * Makefile.maint, config/config.guess, config/config.sub,
22217 * config/missing: Update from masters.
22218 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
22219 upon package.m4.
22220 * configure.in (ALL_LINGUAS): Add `tr'.
22221
22222 2001-09-21 Akim Demaille <akim@epita.fr>
22223
22224 * tests/Makefile.am (package.m4): Move to...
22225 ($(srcdir)/$(TESTSUITE)): here.
22226
22227 2001-09-20 Akim Demaille <akim@epita.fr>
22228
22229 * src/complain.c: No longer try to be standalone: use system.h.
22230 Don't assume __STDC__ is defined to 1. Just test if it is defined.
22231 * src/complain.h: Likewise.
22232 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
22233 Remove the unused variable `n'.
22234 From Albert Chin-A-Young.
22235
22236 2001-09-18 Marc Autret <autret_m@epita.fr>
22237
22238 * doc/bison.1: Update.
22239 * doc/bison.texinfo (Bison Options): Update --defines and --graph
22240 descriptions.
22241 (Option Cross Key): Update.
22242 Add --graph.
22243
22244 2001-09-18 Marc Autret <autret_m@epita.fr>
22245
22246 * tests/regression.at: New test (comment in %union).
22247
22248 2001-09-18 Marc Autret <autret_m@epita.fr>
22249
22250 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
22251 do that.
22252 Reported by Keith Browne.
22253
22254 2001-09-18 Marc Autret <autret_m@epita.fr>
22255
22256 * tests/output.at: Add tests for --defines and --graph.
22257
22258 2001-09-18 Marc Autret <autret_m@epita.fr>
22259
22260 * tests/output.at: Removes tests of %{header,src}_extension features.
22261
22262 2001-09-18 Akim Demaille <akim@epita.fr>
22263
22264 * tests/Makefile.am (package.m4): New.
22265 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
22266 (_AT_CHECK_CALC_ERROR): Likewise.
22267 Factor the `, ' part of verbose error messages.
22268
22269 2001-09-18 Marc Autret <autret_m@epita.fr>
22270
22271 * src/getargs.c (longopts): Declare --defines and --graph as options
22272 with optional arguments.
22273 * src/files.h: Add extern declarations.
22274 * src/files.c (spec_graph_file, spec_defines_file): New.
22275 (output_files): Update.
22276 Remove CPP-outed code.
22277
22278 2001-09-18 Marc Autret <autret_m@epita.fr>
22279
22280 Turn off %{source,header}_extension feature.
22281
22282 * src/files.c (compute_exts_from_gf): Update.
22283 (compute_exts_from_src): Update.
22284 (output_files): CPP-out useless code.
22285 * src/files.h: Remove {header,source}_extension extern declarations.
22286 * src/reader.c (parse_dquoted_param): CPP-out.
22287 (parse_header_extension_decl): Remove.
22288 (parse_source_extension_decl): Remove.
22289 (read_declarations): Remove cases tok_{hdrext,srcext}.
22290 * src/lex.c (percent_table): Remove {header,source}_extension entries.
22291 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
22292
22293 2001-09-10 Akim Demaille <akim@epita.fr>
22294
22295 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
22296 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
22297 (AT_CHECK_OUTPUT): this.
22298 Merely check ls' exit status, its output is useless.
22299
22300 2001-09-10 Akim Demaille <akim@epita.fr>
22301
22302 * tests/calc.at: Use m4_match.
22303 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
22304
22305 2001-09-10 Marc Autret <autret_m@epita.fr>,
22306 Akim Demaille <akim@epita.fr>
22307
22308 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
22309 enum color_e.
22310 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
22311 to `normal'.
22312 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
22313 * src/lex.h: Adjust prototype.
22314 (token_t): Add `tok_undef'.
22315 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
22316 (parse_percent_token): Now returns token_t.
22317 Add default statement in switch.
22318 (lex): Separate `c' as an input variable, from the token_t result
22319 part.
22320 (unlexed): Is a token_t.
22321
22322 2001-09-10 Akim Demaille <akim@epita.fr>
22323
22324 * configure.in: Bump to 1.29a.
22325
22326 2001-09-07 Akim Demaille <akim@epita.fr>
22327
22328 Version 1.29.
22329
22330 2001-08-30 Akim Demaille <akim@epita.fr>
22331
22332 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
22333 * m4/atconfig.m4: Remove.
22334 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
22335 * tests/bison: New.
22336 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
22337 m4_if, m4_patsubst, and m4_regexp.
22338 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
22339 `input' file instead of echo.
22340
22341 2001-08-29 Akim Demaille <akim@epita.fr>
22342
22343 Bump to 1.28e.
22344
22345 2001-08-29 Akim Demaille <akim@epita.fr>
22346
22347 Version 1.28d.
22348
22349 2001-08-29 Paul Eggert <eggert@twinsun.com>
22350
22351 * src/bison.simple (yyparse): Don't take the address of an
22352 item before the start of an array, as that doesn't conform to
22353 the C Standard.
22354
22355 2001-08-29 Robert Anisko <anisko_r@epita.fr>
22356
22357 * doc/bison.texinfo (Location Tracking Calc): New node.
22358
22359 2001-08-29 Paul Eggert <eggert@twinsun.com>
22360
22361 * src/output.c (output): Do not define const, as this now
22362 causes more problems than it cures.
22363
22364 2001-08-29 Akim Demaille <akim@epita.fr>
22365
22366 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
22367 the nodes.
22368 Be sure to tag the `detailmenu'.
22369
22370 2001-08-29 Akim Demaille <akim@epita.fr>
22371
22372 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
22373 download in a tmp dir.
22374
22375 2001-08-28 Marc Autret <autret_m@epita.fr>
22376
22377 * config/depcomp: New file.
22378
22379 2001-08-28 Marc Autret <autret_m@epita.fr>
22380
22381 * doc/bison.1 (mandoc): Adjust.
22382 From Juan Manuel Guerrero.
22383
22384 2001-08-28 Marc Autret <autret_m@epita.fr>
22385
22386 * src/print_graph.c (print_state): Fix.
22387
22388 2001-08-27 Marc Autret <autret_m@epita.fr>
22389
22390 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
22391 char * members.
22392 Echo modifications to the functions prototypes.
22393 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
22394
22395 2001-08-27 Marc Autret <autret_m@epita.fr>
22396
22397 * src/vcg.c: Include `xalloc.h'.
22398 (add_colorentry): New.
22399 (add_classname): New.
22400 (add_infoname): New.
22401 * src/vcg.h: Add new prototypes.
22402
22403 2001-08-27 Akim Demaille <akim@epita.fr>
22404
22405 * Makefile.maint: Sync. again with CVS Autoconf.
22406
22407 2001-08-27 Akim Demaille <akim@epita.fr>
22408
22409 * Makefile.maint: Formatting changes.
22410 (po-update, cvs-update, update): New targets.
22411 (AMTAR): Remove.
22412
22413 2001-08-27 Akim Demaille <akim@epita.fr>
22414
22415 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
22416 * Makefile.maint: Sync. with CVS Autoconf.
22417
22418 2001-08-27 Marc Autret <autret_m@epita.fr>
22419
22420 * src/vcg.h (struct infoname_s): New.
22421 (struct colorentry_s): New.
22422 (graph_s): New fields {vertical,horizontal}_order in structure.
22423 Add `infoname' field.
22424 Add `colorentry' field;
22425 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
22426 (G_HORIZONTAL_ORDER): New.
22427 (G_INFONAME): New.
22428 (G_COLORENTRY): New.
22429 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
22430 Add output of `infoname'.
22431 Add output of `colorentry'.
22432
22433 2001-08-27 Marc Autret <autret_m@epita.fr>
22434
22435 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
22436 This one shadowed a global parameter.
22437
22438 2001-08-24 Marc Autret <autret_m@epita.fr>
22439
22440 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
22441 instead of `unsigned'.
22442 (print_state): Do not call obstack_object_size () in obstack_grow ()
22443 to avoid macro variables shadowing.
22444
22445 2001-08-23 Marc Autret <autret_m@epita.fr>
22446
22447 * src/lex.c (percent_table): Typo: s/naem/name/.
22448 Add graph option.
22449 Normalize new options declarations.
22450
22451 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
22452
22453 * tests/suite.at: Exercise %header_extension and %source_extension.
22454
22455 2001-08-16 Marc Autret <autret_m@epita.fr>
22456
22457 * src/reader.c (parse_dquoted_param): New.
22458 (parse_header_extension_decl): Use it.
22459 (parse_source_extension_decl): Likewise.
22460
22461 2001-08-16 Marc Autret <autret_m@epita.fr>
22462
22463 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
22464 (get_xxxx_str): Use assert () instead of complain ().
22465 Remove return invokations in default cases.
22466 (get_decision_str): Modify default behaviour. Remove second argument.
22467 Echo modifications on calls.
22468 (output_graph): Fix.
22469
22470 2001-08-16 Marc Autret <autret_m@epita.fr>
22471
22472 * src/getargs.c (usage): Update with ``-g, --graph''.
22473
22474 2001-08-16 Marc Autret <autret_m@epita.fr>
22475
22476 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
22477 (Option Cross Key): Likewise.
22478 * doc/bison.1: Update.
22479
22480 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
22481
22482 * src/output.c (output_master_parser): Don't finish action_obstack.
22483 (output_parser): Don't care about the muscle action, here.
22484 (prepare): Copy the action_obstack in the action muscle.
22485 (output): Free action_obstack.
22486
22487 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
22488
22489 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
22490 will contain `%union' declaration.
22491 (parse_union_decl): Delete #line directive output.
22492 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
22493 informations about %union.
22494 (parse_union_decl): Copy the union_obstack in the muscle stype.
22495 * src/bison.simple: Add new #line directive.
22496 Add typdef %%stype YYSTYPE.
22497
22498 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
22499
22500 * src/bison.simple: Add new `#line' directive.
22501
22502 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
22503
22504 * src/bison.simple: New `#line' directive.
22505 * src/output.c (output_parser): Support new dynamic muscle input_line.
22506
22507 2001-09-22 Marc Autret <autret_m@epita.fr>
22508
22509 * src/output.c (output_master_parser): New.
22510 (output_parser): Be more re-entrant.
22511
22512 2001-09-21 Marc Autret <autret_m@epita.fr>
22513
22514 * src/reader.c (copy_definition, parse_union_decl): Update and use
22515 `linef' muscle.
22516 (copy_action): Likewise.
22517 Use obstack_1grow ().
22518 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
22519
22520 2001-09-21 Marc Autret <autret_m@epita.fr>
22521
22522 * src/options.c (option_table): Adjust.
22523 * src/lex.c (parse_percent_token): Fix.
22524
22525 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
22526
22527 * src/options.c (symtab.h): Include it, need by lex.h.
22528
22529 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
22530
22531 * src/lex.c (parse_percent_token): Change type of variable `tx', which
22532 is now an option_table_struct*.
22533 (option_strcmp): New function option_strcmp.
22534 (parse_percent_token): Call option_strcmp.
22535 * src/getargs.c (xalloc.h, options.h): Include it.
22536 (getargs): Call create_long_option_table.
22537 (getargs): Free longopts at the end of the function.
22538 (shortopts): Move in options.c.
22539 * src/options.c (create_long_option_table): New function. Convert
22540 information from option_table to option structure.
22541 * src/reader.c (options.h): Include it.
22542
22543 * src/Makefile.am: Adjust.
22544 * src/options.c (option_table): Create from longopts and percent_table.
22545 * src/getargs.c (longopts): Delete.
22546 * src/lex.c (struct percent_table_struct): Delete.
22547 (percent_table): Delete.
22548 (options.h): Include it.
22549 * src/options.c: Create.
22550 * src/options.h: Create.
22551 Declare enum opt_access_e.
22552 Define struct option_table_struct.
22553
22554 2001-09-20 Marc Autret <autret_m@epita.fr>
22555
22556 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
22557 sections of Bison.
22558
22559 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
22560
22561 * src/bison.simple: s/%%filename/%%skeleton.
22562 * src/muscle_tab.c (getargs.h): Include it.
22563 (muscle_init): Insert new muscle skeleton.
22564
22565 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
22566
22567 * src/output.c (output_parser): Delete unused variable actions_dumped.
22568
22569 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
22570
22571 * src/output.c (output): Delete call to reader_output_yylsp.
22572 * src/reader.c (reader): Likewise.
22573 * src/reader.h: Delete declaration of reader_output_yylsp.
22574
22575 2001-09-02 Marc Autret <autret_m@epita.fr>
22576
22577 * src/reader.c: Include muscle_tab.h.
22578 (parse_union_decl): Update.
22579 (parse_macro_decl): Rename parse_muscle_decl.
22580 Update to use renamed functions and variable.
22581 (read_declarations, copy_action, read_additionnal_code, : Updated
22582 with correct variables and functions names.
22583 (packsymbols, reader): Likewise.
22584
22585 * src/reader.h (muscle_obstack): Extern declaration update.
22586
22587 * src/output.c: Include muscle_tab.h
22588 In all functions using macro_insert, change by using muscle_insert ().
22589 (macro_obstack): Rename muscle_obstack.
22590 Echo modifications in the whole file.
22591 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
22592 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
22593 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
22594
22595 * src/muscle_tab.h: Update double inclusion macros.
22596 (macro_entry_s): Rename muscle_entry_s.
22597 Update prototypes.
22598
22599 * src/muscle_tab.c: Include muscle_tab.h.
22600 Rename macro_tabble to muscle_table.
22601 (mhash1, mhash2, mcmp): Use muscle_entry.
22602 (macro_init): Rename muscle_init. Update.
22603 (macro_insert): Rename muscle_insert. Update.
22604 (macro_find): Rename muscle_find. Update.
22605
22606 * src/main.c: Include muscle_tab.h.
22607 (main): Call muscle_init ().
22608 * src/Makefile.am (bison_SOURCES): Echo modifications.
22609
22610 2001-09-02 Marc Autret <autret_m@epita.fr>
22611
22612 Now the files macro_tab.[ch] are named muscle_tab.[ch].
22613
22614 * src/muscle_tab.c, src/muscle_tab.h: Add files.
22615
22616 2001-09-02 Marc Autret <autret_m@epita.fr>
22617
22618 * src/macrotab.c, src/macrotab.h: Remove.
22619
22620 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
22621
22622 * src/reader.c (copy_guard): Use muscle to specify the `#line'
22623 filename.
22624
22625 2001-09-01 Marc Autret <autret_m@epita.fr>
22626
22627 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
22628 to an explicit value to activate the feature. We do it here.
22629
22630 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
22631
22632 * src/output.c (prepare): Delete the `filename' muscule insertion.
22633 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
22634 (parse_union_decl): Likewise.
22635 * src/macrotab.c (macro_init): Initialize filename by infile.
22636
22637 2001-08-31 Marc Autret <autret_m@epita.fr>
22638
22639 * src/bison.simple (YYLSP_NEEDED): New definition.
22640 * src/output.c (prepare): Add macro insertion of `locations_flag'
22641
22642 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
22643
22644 * src/output.c (prepare): Delete insertion of previous muscles,
22645 and insert the `prefix' muscles.
22646 * src/macrotab.c (macro_init): Likewise.
22647 (macro_init): Initialization prefix directive by `yy'.
22648 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
22649 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
22650 yylval, yydebug, yyerror, yynerrs and yyparse.
22651 New directive `#define' to substitute yydebug, ... with option
22652 name_prefix.
22653
22654 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
22655
22656 * src/main.c (main): Standardize.
22657 * src/output.c (output_table_data, output_parser): Likewise.
22658 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
22659
22660 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
22661
22662 * src/reader.c (read_additionnal_code): Rename %%user_code to
22663 %%epilogue.
22664 * src/output.c (output): Rename %%declarations to %%prologue.
22665 * src/bison.simple: Echo modifications.
22666
22667 2001-08-31 Marc Autret <autret_m@epita.fr>
22668
22669 * src/reader.c (readgram): CleanUp.
22670 (output_token_defines): Likewise.
22671 (packsymbols): Likewise.
22672 (reader): Likewise.
22673 * src/output.c (output): CPP-out useless code.
22674
22675 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
22676
22677 * src/reader.c (reader): Delete obsolete call to function
22678 output_trailers and output_headers.
22679 * src/output.h: Remove obsolete functions prototypes of output_headers
22680 and output_trailers.
22681
22682 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
22683
22684 * src/main.c: Include macrotab.h.
22685 * src/macrotab.h (macro_entry_s): Constify fields.
22686 Adjust functions prototypes.
22687 * src/macrotab.c (macro_insert): Constify key and value.
22688 (macro_find): Constify key.
22689 (macro_insert): Include 'xalloc.h'
22690 (macro_insert): Use XMALLOC.
22691 (macro_find): Constify return value.
22692 * src/output.c (output_table_data): Rename table to table_data.
22693 (output_parser): Constify macro_key, macro_value.
22694
22695 2001-08-30 Marc Autret <autret_m@epita.fr>
22696
22697 * src/reader.c (parse_skel_decl): New.
22698 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
22699 * src/lex.h (token_t): New token `tok_skel'.
22700 * src/lex.c (percent_table): Add skeleton option entry.
22701 Standardize.
22702
22703 2001-08-29 Marc Autret <autret_m@epita.fr>
22704
22705 * src/bison.simple: Add %%user_code directive at the end.
22706 * src/reader.c (read_additionnal_code): New.
22707 (reader): Use it.
22708 * src/output.c (output_program): Remove.
22709 (output): Update.
22710
22711 2001-08-28 Marc Autret <autret_m@epita.fr>
22712
22713 * src/output.c (output_actions): Clean up.
22714 (output_gram): CPP-out useless code.
22715 * src/reader.c (reader): Clean up, CPP-out useless code.
22716
22717 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
22718
22719 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
22720 directive.
22721 * src/bison.simple: Add `%%definitions'.
22722
22723 2001-08-28 Marc Autret <autret_m@epita.fr>
22724
22725 * config/depcomp: New file.
22726
22727 2001-08-27 Paul Eggert <eggert@twinsun.com>
22728
22729 * src/bison.simple (yyparse): Don't take the address of an
22730 item before the start of an array, as that doesn't conform to
22731 the C Standard.
22732
22733 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
22734
22735 * src/output.c (output): Remove the initialization of the macro
22736 obstack. It was done too late here.
22737
22738 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
22739 completely wrong.
22740 (reader): Initialize the macro obstack here, since we need it to grow
22741 '%define' directives.
22742
22743 * src/reader.h: Declare the macro obstack as extern.
22744
22745 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
22746
22747 * src/output.c (output_parser): Fix. Store single '%' characters in
22748 the output obstack instead of throwing them away.
22749
22750 2001-08-27 Akim Demaille <akim@epita.fr>
22751
22752 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
22753
22754 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22755
22756 * lib/Makefile.am: Adjust.
22757
22758 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22759
22760 * src/bison.simple: Update and add '%%' directives.
22761
22762 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22763
22764 * src/reader.c (reader): Remove calls to 'output_headers' and
22765 'output_trailers'. Remove some C output.
22766 (readgram): Disable a piece of code that was writing a default
22767 definition for 'YYSTYPE'.
22768 (reader_output_yylsp): Remove.
22769 (packsymbols): Output token defintions to a macro.
22770 (copy_definition): Disable C output.
22771
22772 * src/reader.c (parse_macro_decl): New function used to parse macro
22773 declarations.
22774 (copy_string2): Put the body of copy_string into this new function.
22775 Add a parameter to let the caller choose whether he wants to copy the
22776 string delimiters or not.
22777 (copy_string): Be a simple call to copy_string2 with the last argument
22778 bound to true.
22779 (read_declarations): Add case for macro definition.
22780 (copy_identifier): New.
22781 (parse_macro_decl): Read macro identifiers using copy_identifier
22782 rather than lex.
22783
22784 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22785
22786 * src/output.c (prepare): Add prefixed names.
22787 (output_parser): Output semantic actions.
22788 (output_parser): Fix bug on '%%line' directives.
22789
22790 * src/output.c (output_headers): Remove. The C code printed by this
22791 function should now be in the skeletons.
22792 (output_trailers): Remove.
22793 (output): Disable call to 'reader_output_yylsp'.
22794 (output_rule_data): Do not output tables to the table obstack.
22795
22796 * src/output.c: Remove some C dedicated output.
22797 Improve the use of macro and output obstacks.
22798 (output_defines): Remove.
22799
22800 * src/output.c (output_token_translations): Associate 'translate'
22801 table with a macro. No output to the table obstack.
22802 (output_gram): Same for 'rhs' and 'prhs'.
22803 (output_stos): Same for 'stos'.
22804 (output_rule_data): Same for 'r1' and 'r2'.
22805 (token_actions): Same for 'defact'.
22806 (goto_actions): Same for 'defgoto'.
22807 (output_base): Same for 'pact' and 'pgoto'.
22808 (output_table): Same for 'table'.
22809 (output_check): Same for 'check'.
22810
22811 * src/output.c (output_table_data): New function.
22812 (output_short_table): Remove.
22813 (output_short_or_char_table): Remove.
22814
22815 * src/output.c (output_parser): Replace most of the skeleton copy code
22816 with something new. Skeletons are now processed character by character
22817 rather than line by line, and Bison looks for '%%' macros. This is the
22818 first step in making Bison's output process (a lot) more flexible.
22819 (output_parser): Use the macro table.
22820
22821 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22822
22823 * src/main.c (main): Initialize the macro table.
22824
22825 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22826
22827 * src/lex.c (percent_table): Add tok_define.
22828 * src/lex.h: Add tok_define.
22829
22830 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22831
22832 * src/macrotab.c: New file.
22833 * src/macrotab.h: New file.
22834 * src/Makefile.am: Update.
22835
22836 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22837
22838 * lib/hash.c: New file.
22839 * lib/hash.h: New file.
22840 * lib/Makefile.am: Update.
22841
22842 2001-08-15 Akim Demaille <akim@epita.fr>
22843
22844 Version 1.28c.
22845
22846 2001-08-15 Marc Autret <autret_m@epita.fr>
22847
22848 * src/reader.c (readgram): Indent output macro YYSTYPE.
22849 (packsymbols): Likewise.
22850 (output_token_defines): Likewise.
22851 * src/files.c: Standardize.
22852 (compute_header_macro): New.
22853 (defines_obstack_save): New. Use compute_header_macro.
22854 (output_files): Update. Use defines_obstack_save.
22855
22856 2001-08-15 Akim Demaille <akim@epita.fr>
22857
22858 * doc/bison.texinfo (Table of Symbols): Document
22859 YYSTACK_USE_ALLOCA.
22860
22861 2001-08-15 Akim Demaille <akim@epita.fr>
22862
22863 * missing: Update from CVS Automake.
22864 * config/config.guess, config/config.sub, config/texinfo.tex:
22865 Update from gnu.org.
22866
22867 2001-08-15 Akim Demaille <akim@epita.fr>
22868
22869 * Makefile.maint: Sync with CVS Autoconf.
22870
22871 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
22872
22873 * doc/bison.texinfo: Include GNU Free Documentation License from
22874 `fdl.texi'.
22875 * doc/fdl.texi: Add to package.
22876
22877 2001-08-14 Marc Autret <autret_m@epita.fr>
22878
22879 Turn on %{source,header}_extension features.
22880
22881 * src/lex.c (percent_table): Un-CPP out header_extension and
22882 source_extension.
22883 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
22884 (compute_exts_from_src): Remove conditions. It restores priorities
22885 between options.
22886
22887 2001-08-14 Marc Autret <autret_m@epita.fr>
22888
22889 * src/files.c (compute_base_names): Add extensions computing when
22890 `--file-prefix' used.
22891 Standardize function calls.
22892
22893 2001-08-13 Marc Autret <autret_m@epita.fr>
22894
22895 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
22896 defining it (defined but null disables alloca).
22897
22898 2001-08-13 Marc Autret <autret_m@epita.fr>
22899
22900 * src/bison.simple (_yy_memcpy): CPP reformat.
22901
22902 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
22903
22904 * tests/atconfig.in (CPPFLAGS): Fix.
22905
22906 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
22907
22908 * doc/bison.texinfo: Include GNU General Public License from
22909 `gpl.texi'.
22910 * doc/gpl.texi: Add to package.
22911
22912 2001-08-10 Marc Autret <autret_m@epita.fr>
22913
22914 * src/print_graph.h: Fix.
22915 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
22916
22917 2001-08-10 Akim Demaille <akim@epita.fr>
22918
22919 * src/system.h: Provide default declarations for stpcpy, strndup,
22920 and strnlen.
22921
22922 2001-08-10 Robert Anisko <anisko_r@epita.fr>
22923
22924 * doc/bison.texinfo (Locations): Update @$ stuff.
22925
22926 2001-08-09 Robert Anisko <anisko_r@epita.fr>
22927
22928 * src/bison.simple (YYLLOC_DEFAULT): Update.
22929 (yyparse): Adjust.
22930
22931 2001-08-08 Marc Autret <autret_m@epita.fr>
22932
22933 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
22934 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
22935 Reported by Fabrice Bauzac.
22936
22937 2001-08-08 Marc Autret <autret_m@epita.fr>
22938
22939 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
22940 * src/vcg.c (output_node): Fix.
22941 * src/vcg.h: Cleanup.
22942 * src/print_graph.c: Add comments.
22943 (node_output_size): New global variable. Simplify the formatting of
22944 the VCG graph output.
22945 (print_actions): Unused code is now used. It notifies the final state
22946 and no action states in the VCG graph. It also give the reduce actions.
22947 The `shift and goto' edges are red and the `go to state' edges are
22948 blue.
22949 Get the current node name and node_obstack by argument.
22950 (node_obstack): New variable.
22951 (print_state): Manage node_obstack.
22952 (print_core): Use node_obstack given by argument.
22953 A node is not only computed here but in print_actions also.
22954 (print_graph): CPP out useless code instead of commenting it.
22955
22956 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
22957
22958 * tests/atconfig.in (CPPFLAGS): Fix.
22959
22960 2001-08-07 Akim Demaille <akim@epita.fr>
22961
22962 * src/print_graph.c (quote): New.
22963 (print_core): Use it.
22964
22965 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
22966
22967 * src/vcg.c (complain.h): Include it.
22968 Unepitaize `return' invocations.
22969 [NDEBUG] (main): Remove.
22970 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
22971 * src/files.c (open_files): Initialize graph_obstack.
22972 * src/print_graph.c (print_actions): CPP out useless code.
22973 (print_core): Don't output the last `\n' in labels.
22974 Use `quote'.
22975 * src/files.c (output_files): Output the VCG file.
22976 * src/main.c (main): Invoke print_graph ();
22977
22978 2001-08-06 Marc Autret <autret_m@epita.fr>
22979
22980 Automaton VCG graph output.
22981 Using option ``-g'' or long option ``--graph'', you can generate
22982 a gram_filename.vcg file containing a VCG description of the LALR (1)
22983 automaton of your grammar.
22984
22985 * src/main.c: Call to print_graph() function.
22986 * src/getargs.h: Update.
22987 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
22988 (graph_flag): New flag.
22989 (longopts): Update.
22990 (getargs): Add case `g'.
22991 * src/files.c (graph_obstack): New obstack struct.
22992 (open_files): Initialize new obstack.
22993 (output_files): Saves graph_obstack if required.
22994 * src/files.h (graph_obstack): New extern declaration.
22995 * src/Makefile.am: Add new source files.
22996
22997 2001-08-06 Marc Autret <autret_m@epita.fr>
22998
22999 * src/print_graph.c, src/print_graph.h (graph): New.
23000 * src/vcg.h: New file.
23001 * src/vcg.c: New file, VCG graph handling.
23002
23003 2001-08-06 Marc Autret <autret_m@epita.fr>
23004
23005 Add of %source_extension and %header_extension which specify
23006 the source or/and the header output file extension.
23007
23008 * src/files.c (compute_base_names): Remove initialisation of
23009 src_extension and header_extension.
23010 (compute_exts_from_gf): Update.
23011 (compute_exts_from_src): Update.
23012 (output_files): Update.
23013 * src/reader.c (parse_header_extension_decl): New.
23014 (parse_source_extension_decl): New.
23015 (read_declarations): New case statements for the new tokens.
23016 * src/lex.c (percent_table): Add entries for %source_extension
23017 and %header_extension.
23018 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
23019
23020 2001-08-06 Marc Autret <autret_m@epita.fr>
23021
23022 * configure.in: Bump to 1.28c.
23023 * doc/bison.texinfo: Texinfo thingies.
23024
23025 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
23026
23027 * tests/atconfig.in (CPPFLAGS): Add.
23028 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
23029
23030 2001-08-03 Akim Demaille <akim@epita.fr>
23031
23032 Version 1.28b.
23033
23034 2001-08-03 Akim Demaille <akim@epita.fr>
23035
23036 * tests/Makefile.am (check-local): Ship testsuite.
23037 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
23038 Include `string.h'.
23039
23040 2001-08-03 Akim Demaille <akim@epita.fr>
23041
23042 * configure.in: Try using -Wformat when compiling.
23043
23044 2001-08-03 Akim Demaille <akim@epita.fr>
23045
23046 * configure.in: Bump to 1.28b.
23047
23048 2001-08-03 Akim Demaille <akim@epita.fr>
23049
23050 * src/complain.c: Adjust strerror_r portability issues.
23051
23052 2001-08-03 Akim Demaille <akim@epita.fr>
23053
23054 Version 1.28a.
23055
23056 2001-08-03 Akim Demaille <akim@epita.fr>
23057
23058 * src/getargs.c, src/getarg.h (skeleton)): Constify.
23059 * src/lex.c (literalchar): Avoid name clashes on `buf'.
23060 * src/getargs.c: Include complain.h.
23061 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
23062 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
23063
23064 2001-08-03 Akim Demaille <akim@epita.fr>
23065
23066 * src/reader.c (readgram): Display hidden chars in error messages.
23067
23068 2001-08-03 Akim Demaille <akim@epita.fr>
23069
23070 Update to gettext 0.10.39.
23071
23072 2001-08-03 Akim Demaille <akim@epita.fr>
23073
23074 * lib/strspn.c: New.
23075
23076 2001-08-01 Marc Autret <autret_m@epita.fr>
23077
23078 * doc/bison.texinfo: Update.
23079 * doc/bison.1 (mandoc): Update.
23080 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
23081 * src/files.c: Support output files extensions computing.
23082 (src_extension): New static variable.
23083 (header_extension): New static variable.
23084 (tr): New function.
23085 (get_extension_index): New function, gets the index of an extension
23086 filename in a string.
23087 (compute_exts_from_gf): New function, computes extensions from the
23088 grammar file extension.
23089 (compute_exts_from_src): New functions, computes extensions from the
23090 C source file extension, file given by ``-o'' option.
23091 (compute_base_names): Update.
23092 (output_files): Update.
23093
23094 2001-08-01 Robert Anisko <anisko_r@epita.fr>
23095
23096 * doc/bison.texi: Document @$.
23097 (Locations): New section.
23098
23099 2001-07-18 Akim Demaille <akim@epita.fr>
23100
23101 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
23102 * config/prev-version.txt, config/move-if-change: New.
23103 * Makefile.am: Adjust.
23104
23105 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
23106
23107 * src/bison.simple (yyparse): Suppress warning `comparaison
23108 between signed and unsigned'.
23109
23110 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
23111
23112 * src/getargs.h (raw_flag): Remove.
23113 * src/getargs.c: Die on `-r'/`--raw'.
23114 * src/lex.c (parse_percent_token): Die on `%raw'.
23115 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
23116 * tests/calc.at: Suppress test with option `--raw'.
23117
23118 2001-07-14 Akim Demaille <akim@epita.fr>
23119
23120 * config/: New.
23121 * configure.in: Require Autoconf 2.50.
23122 Update to gettext 0.10.38.
23123
23124 2001-03-16 Akim Demaille <akim@epita.fr>
23125
23126 * doc/bison.texinfo: ANSIfy the examples.
23127
23128 2001-03-16 Akim Demaille <akim@epita.fr>
23129
23130 * getargs.c (skeleton): New variable.
23131 (longopts): --skeleton is a new option.
23132 (shortopts, getargs): -S is a new option.
23133 * getargs.h: Declare skeleton.
23134 * output.c (output_parser): Use it.
23135
23136 2001-03-16 Akim Demaille <akim@epita.fr>
23137
23138 * m4/strerror_r.m4: New.
23139 * m4/error.m4: Run AC_FUNC_STRERROR_R.
23140 * lib/error.h, lib/error.c: Update.
23141
23142 2001-03-16 Akim Demaille <akim@epita.fr>
23143
23144 * src/getargs.c (longopts): Clean up.
23145
23146 2001-02-21 Akim Demaille <akim@epita.fr>
23147
23148 * src/reader.c (gensym): `gensym_count' is your own.
23149 Use a static buf to create the symbol name, as token_buffer is no
23150 longer a buffer.
23151
23152 2001-02-08 Akim Demaille <akim@epita.fr>
23153
23154 * src/conflicts.c (conflict_report): Be sure not to append to res
23155 between two calls, which could happen if both first sprintf were
23156 skipped, but not the first cp += strlen.
23157
23158 2001-02-08 Akim Demaille <akim@epita.fr>
23159
23160 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
23161 New, from fileutils 4.0.37.
23162 * configure.in: Require Autoconf 2.49c. I took some time before
23163 making this decision. This is the only way out for portability
23164 issues in Bison, it would mean way too much duplicate effort to
23165 import in Bison features implemented in 2.49c since 2.13.
23166 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
23167
23168 2001-02-02 Akim Demaille <akim@epita.fr>
23169
23170 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
23171 * lib/xalloc.h, lib/xmalloc.c: Update.
23172
23173 2001-01-19 Akim Demaille <akim@epita.fr>
23174
23175 Get rid of the ad hoc handling of token_buffer in the scanner: use
23176 the obstacks.
23177
23178 * src/lex.c (token_obstack): New.
23179 (init_lex): Initialize it. No longer call...
23180 (grow_token_buffer): this. Remove it.
23181 Adjust all the places which used it to use the obstack.
23182
23183 2001-01-19 Akim Demaille <akim@epita.fr>
23184
23185 * src/lex.h: Rename all the tokens:
23186 s/\bENDFILE\b/tok_eof/g;
23187 s/\bIDENTIFIER\b/tok_identifier/g;
23188 etc.
23189 Let them be enums, not #define, to ease debugging.
23190 Adjust all the code.
23191
23192 2001-01-18 Akim Demaille <akim@epita.fr>
23193
23194 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
23195 * src/lex.c (maxtoken, grow_token_buffer): Static.
23196
23197 2001-01-18 Akim Demaille <akim@epita.fr>
23198
23199 Since we now use obstacks, more % directives can be enabled.
23200
23201 * src/lex.c (percent_table): Also accept `%yacc',
23202 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
23203 `%debug'.
23204 Handle the actions for `%semantic_parser' and `%pure_parser' here,
23205 instead of returning a token.
23206 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
23207 * src/reader.c (read_declarations): Adjust.
23208 * src/files.c (open_files): Don't call `compute_base_names', don't
23209 compute `attrsfile' since they depend upon data which might be
23210 *in* the input file now.
23211 (output_files): Do it here.
23212 * src/output.c (output_headers): Document the fact that this patch
23213 introduces a guaranteed SEGV for semantic parsers.
23214 * doc/bison.texinfo: Document them.
23215 * tests/suite.at: Exercise these %options.
23216
23217 2000-12-20 Akim Demaille <akim@epita.fr>
23218
23219 Also handle the output file (--verbose) with obstacks.
23220
23221 * files.c (foutput): Remove.
23222 (output_obstack): New.
23223 Adjust all dependencies.
23224 * src/conflicts.c: Return a string.
23225 * src/system.h (obstack_grow_string): Rename as...
23226 (obstack_sgrow): this. Be ready to work with non literals.
23227 (obstack_fgrow4): New.
23228
23229 2000-12-20 Akim Demaille <akim@epita.fr>
23230
23231 * src/files.c (open_files): Fix the computation of short_base_name
23232 in the case of `-o foo.tab.c'.
23233
23234 2000-12-20 Akim Demaille <akim@epita.fr>
23235
23236 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
23237 (copy_dollar): Now that everything uses obstacks, get rid of the
23238 FILE * parameters.
23239
23240 2000-12-20 Akim Demaille <akim@epita.fr>
23241
23242 * src/files.c (open_files): Actually the `.output' file is based
23243 on the short_base_name, not base_name.
23244 * tests/suite.at (Checking output file names): Adjust.
23245
23246 2000-12-20 Akim Demaille <akim@epita.fr>
23247
23248 * src/bison.s1: Remove, we now use directly...
23249 * src/bison.simple: this.
23250 * src/Makefile.am: Use pkgdata instead of data.
23251
23252 2000-12-20 Akim Demaille <akim@epita.fr>
23253
23254 * src/files.c (guard_obstack): New.
23255 (open_files): Initialize it.
23256 (output_files): Dump it...
23257 * src/files.h: Export it.
23258 * src/reader.c (copy_guard): Use it.
23259
23260 2000-12-19 Akim Demaille <akim@epita.fr>
23261
23262 * src/files.c (outfile, defsfile, actfile): Removed as global
23263 vars.
23264 (open_files): Don't compute them.
23265 (output_files): Adjust.
23266 (base_name, short_base_name): Be global.
23267 Adjust dependencies.
23268
23269 2000-12-19 Akim Demaille <akim@epita.fr>
23270
23271 * src/files.c (strsuffix): New.
23272 (stringappend): Be just like strcat but allocate.
23273 (base_names): Eve out from open_files.
23274 Try to simplify the rather hairy computation of base_name and
23275 short_base_name.
23276 (open_files): Use it.
23277 * tests/suite.at (Checking output file names): New test.
23278
23279 2000-12-19 Akim Demaille <akim@epita.fr>
23280
23281 * src/system.h (obstack_grow_literal_string): Rename as...
23282 (obstack_grow_string): this.
23283 * src/output.c (output_parser): Recognize `%% actions' instead of
23284 `$'.
23285 * src/bison.s1: s/$/%% actions/.
23286 * src/bison.hairy: Likewise.
23287
23288 2000-12-19 Akim Demaille <akim@epita.fr>
23289
23290 * src/output.c (output_parser): Compute the `#line' lines when
23291 there are.
23292 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
23293 Suggested by Hans Aberg.
23294
23295 2000-12-19 Akim Demaille <akim@epita.fr>
23296
23297 Let the handling of the skeleton files be local to the procedures
23298 that use it.
23299
23300 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
23301 longer static.
23302 (fparser, open_extra_files): Remove.
23303 (open_files, output_files): Don't take care of fparser.
23304 * src/files.h: Adjust.
23305 * src/output.c (output_parser): Open and close the file to the
23306 skeleton.
23307 * src/reader.c (read_declarations): When %semantic_parser, open
23308 fguard.
23309
23310 2000-12-19 Akim Demaille <akim@epita.fr>
23311
23312 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
23313 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
23314
23315 2000-12-19 Akim Demaille <akim@epita.fr>
23316
23317 * src/files.c (open_files): Yipee! We no longer need all the code
23318 looking for `/tmp' since we have no tmp file.
23319
23320 2000-12-19 Akim Demaille <akim@epita.fr>
23321
23322 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
23323 New macros.
23324 * src/files.c (open_files): Less dependency on MSDOS etc.
23325
23326 2000-12-14 Akim Demaille <akim@epita.fr>
23327
23328 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
23329 Provide a default definition.
23330 Use it when executing the default @ action.
23331 * src/reader.c (reader_output_yylsp): No longer include
23332 `timestamp' and `text' in the default YYLTYPE.
23333
23334 2000-12-12 Akim Demaille <akim@epita.fr>
23335
23336 * src/reader.c (copy_definition, parse_union_decl, copy_action)
23337 (copy_guard): Quote the file names.
23338 Reported by Laurent Mascherpa.
23339
23340 2000-12-12 Akim Demaille <akim@epita.fr>
23341
23342 * src/output.c (output_headers, output_program, output): Be sure
23343 to escape special characters when outputting filenames.
23344 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
23345 (output_headers): Don't depend on them, Use ACTSTR.
23346
23347 2000-11-17 Akim Demaille <akim@epita.fr>
23348
23349 * lib/obstack.h: Formatting changes.
23350 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
23351 prevents type checking.
23352 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
23353 cast the value to (void *): assigning a `foo *' to a `void *'
23354 variable is valid.
23355 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
23356 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
23357 append characters.
23358
23359 2000-11-17 Akim Demaille <akim@epita.fr>
23360
23361 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
23362 as...
23363 (suite.m4, regression.m4, calc.m4): these.
23364 * tests/atgeneral.m4: Update from CVS Autoconf.
23365
23366 2000-11-17 Akim Demaille <akim@epita.fr>
23367
23368 * tests/regression.m4 (%union and --defines): New test,
23369 demonstrating a current bug in the obstack implementation.
23370
23371 2000-11-17 Akim Demaille <akim@epita.fr>
23372
23373 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
23374 macros.
23375 Use them to declare the variables which are global or local to
23376 `yyparse'.
23377
23378 2000-11-17 Akim Demaille <akim@epita.fr>
23379
23380 * acconfig.h: Remove, no longer used.
23381
23382 2000-11-07 Akim Demaille <akim@epita.fr>
23383
23384 * src: s/Copyright (C)/Copyright/g.
23385
23386 2000-11-07 Akim Demaille <akim@epita.fr>
23387
23388 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
23389 defining.
23390 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
23391
23392 2000-11-07 Akim Demaille <akim@epita.fr>
23393
23394 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
23395 Merge in a single CPP if/else.
23396
23397 2000-11-07 Akim Demaille <akim@epita.fr>
23398
23399 * src/output.c (output): Remove useless variables.
23400 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
23401 argument `data' for consistency with the prototypes.
23402 Qualify it `const'.
23403 (obstack_copy, obstack_copy0): Rename the second argument as
23404 `address' for consistency. Qualify it `const'.
23405 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
23406 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
23407 `const' their input argument (`data' or `address').
23408 Adjust the corresponding macros to include `const' in casts.
23409
23410 2000-11-03 Akim Demaille <akim@epita.fr>
23411
23412 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
23413 s/PFILE1/BISON_HAIRY/.
23414 Adjust dependencies.
23415
23416 2000-11-03 Akim Demaille <akim@epita.fr>
23417
23418 For some reason, this was not applied.
23419
23420 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23421 `unlink': it's no longer used.
23422
23423 2000-11-03 Akim Demaille <akim@epita.fr>
23424
23425 * src/files.c (skeleton_find): New function, eved out of...
23426 (open_files, open_extra_files): here.
23427
23428 2000-11-03 Akim Demaille <akim@epita.fr>
23429
23430 Don't use `atexit'.
23431
23432 * src/files.c (obstack_save): New function.
23433 (done): Rename as...
23434 (output_files): this.
23435 Use `obstack_save'.
23436 * src/main.c (main): Don't use `atexit' to register `done', since
23437 it no longer has to remove tmp files, just call `output_files'
23438 when there are no errors.
23439
23440 2000-11-02 Akim Demaille <akim@epita.fr>
23441
23442 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23443 `unlink': it's no longer used.
23444 * src/files.h: Formatting changes.
23445
23446 2000-11-02 Akim Demaille <akim@epita.fr>
23447
23448 Remove the last uses of mktemp and unlink/delete.
23449
23450 * src/files.c (fdefines, ftable): Removed.
23451 (defines_ostack, table_obstack): New.
23452 Adjust dependencies of the former into uses of the latter.
23453 * src/output.c (output_short_or_char_table, output_short_table):
23454 Convert to using obstacks.
23455 * src/reader.c (copy_comment2): Accept one FILE * and two
23456 obstacks.
23457 (output_token_defines, reader_output_yylsp): Use obstacks.
23458 * src/system.h (obstack_fgrow3): New.
23459 * po/POTFILES.in: Adjust.
23460
23461 2000-11-01 Akim Demaille <akim@epita.fr>
23462
23463 Change each use of `fattrs' into a use of `attrs_obstack'.
23464
23465 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
23466 * src/files.c (fattrs): Remove.
23467 (attrs_obstack): New.
23468 Adjust all dependencies.
23469 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
23470
23471 2000-11-01 Akim Demaille <akim@epita.fr>
23472
23473 Introduce obstacks.
23474 Change each use of `faction' into a use of `action_obstack'.
23475
23476 * lib/obstack.h, lib/obstack.c: New files.
23477 * src/files.c (faction): Remove.
23478 (action_obstack): New.
23479 Adjust all dependencies.
23480
23481 2000-10-20 Akim Demaille <akim@epita.fr>
23482
23483 * lib/quote.h (PARAMS): New macro. Use it.
23484
23485 2000-10-16 Akim Demaille <akim@epita.fr>
23486
23487 * src/output.c (output_short_or_char_table): New function.
23488 (output_short_table, output_token_translations): Use it.
23489 (goto_actions): Use output_short_table.
23490
23491 2000-10-16 Akim Demaille <akim@epita.fr>
23492
23493 * src/symtab.c (bucket_new): New function.
23494 (getsym): Use it.
23495
23496 * src/output.c (output_short_table): New argument to display the
23497 comment associated with the table.
23498 Adjust dependencies.
23499 (output_gram): Use it.
23500 (output_rule_data): Nicer output layout for YYTNAME.
23501
23502 2000-10-16 Akim Demaille <akim@epita.fr>
23503
23504 * src/lex.c (read_typename): New function.
23505 (lex): Use it.
23506 * src/reader.c (copy_dollar): Likewise.
23507
23508 2000-10-16 Akim Demaille <akim@epita.fr>
23509
23510 * src/reader.c (copy_comment2): Expect the input stream to be on
23511 the `/' which is suspected to open a comment, instead of being
23512 called after `//' or `/*' was read.
23513 (copy_comment, copy_definition, parse_union_decl, copy_action)
23514 (copy_guard): Adjust.
23515
23516 2000-10-16 Akim Demaille <akim@epita.fr>
23517
23518 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
23519 `read_signed_integer'.
23520
23521 2000-10-16 Akim Demaille <akim@epita.fr>
23522
23523 * src/reader.c (copy_dollar): New function.
23524 (copy_guard, copy_action): Use it.
23525
23526 2000-10-16 Akim Demaille <akim@epita.fr>
23527
23528 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
23529 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
23530 New files, from Fileutils 4.0.27.
23531 * src/main.c (printable_version): Remove.
23532 * src/lex.c, src/reader.c: Use `quote'.
23533
23534 2000-10-04 Akim Demaille <akim@epita.fr>
23535
23536 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
23537
23538 2000-10-04 Akim Demaille <akim@epita.fr>
23539
23540 * doc/bison.texinfo: Various typos spotted by Neil Booth.
23541
23542 2000-10-04 Akim Demaille <akim@epita.fr>
23543
23544 When a literal string is used to define two different tokens,
23545 `bison -v' segfaults.
23546 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
23547
23548 * tests/regression.m4: New file.
23549 Include the core of the sample provided by Piotr Gackiewicz.
23550 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
23551 properly.
23552
23553 2000-10-04 Akim Demaille <akim@epita.fr>
23554
23555 * src/reader.c (parse_expect_decl): Keep `count' within the size
23556 of `buffer'.
23557 From Neil Booth.
23558
23559 2000-10-02 Paul Eggert <eggert@twinsun.com>
23560
23561 * bison.s1 (yyparse): Assign the default value
23562 unconditionally, to avoid a GCC warning and make the parser a
23563 tad smaller.
23564
23565 2000-10-02 Akim Demaille <akim@epita.fr>
23566
23567 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
23568 options.
23569
23570 2000-10-02 Akim Demaille <akim@epita.fr>
23571
23572 * src/derives.c, src/print.c, src/reduce.c: To ease the
23573 translation, move some `\n' out of the translated strings.
23574
23575 2000-10-02 Akim Demaille <akim@epita.fr>
23576
23577 The location tracking mechanism is precious for parse error
23578 messages. Nevertheless, it is enabled only when `@n' is used in
23579 the grammar, which is a different issue (you can use it in error
23580 message, but not in the grammar per se). Therefore, there should
23581 be another means to enable it.
23582
23583 * src/getargs.c (getargs): Support `--locations'.
23584 (usage): Report it.
23585 * src/getargs.h (locationsflag): Export it.
23586 * src/lex.c (percent_table): Support `%locations'.
23587 * src/reader.c (yylsp_needed): Remove this variable, now replaced
23588 with `locationsflag'.
23589 * doc/bison.texinfo: Document `--locations' and `%locations'.
23590 Sort the options.
23591 * tests/calc.m4: Test it.
23592
23593 For regularity of the names, replace each
23594 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
23595 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
23596 In addition replace each `flag' with `_flag'.
23597
23598 2000-10-02 Akim Demaille <akim@epita.fr>
23599
23600 Also test parse error messages, including with YYERROR_VERBOSE.
23601
23602 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
23603 associative).
23604 Use it to check the computations.
23605 Use it to check `nonassoc' is honored.
23606 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
23607 `--yyerror-verbose'.
23608 (_AT_CHECK_CALC): Adjust to this option.
23609 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
23610
23611 2000-10-02 Akim Demaille <akim@epita.fr>
23612
23613 Test also `--verbose', `--defines' and `--name-prefix'. Testing
23614 the latter demonstrates a flaw in the handling of non debugging
23615 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
23616 was used in order to simplify:
23617
23618 #if YYDEBUG
23619 if (yydebug)
23620 {
23621 ...
23622 }
23623 #endif
23624
23625 into
23626
23627 if (yydebug)
23628 {
23629 ...
23630 }
23631
23632 unfortunately this leads to a CPP conflict when
23633 `--name-prefix=foo' is used since it produces `#define yydebug
23634 foodebug'.
23635
23636 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
23637 (YYDPRINTF): New macro.
23638 Spread its use.
23639 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
23640 the bison options.
23641 Also test `--verbose', `--defines' and `--name-prefix'.
23642
23643 2000-10-02 Akim Demaille <akim@epita.fr>
23644
23645 Improve the readability of the produced parsers.
23646
23647 * src/bison.s1: Formatting changes.
23648 Improve the comment related to the `$' mark.
23649 (yydefault): Don't fall through to `yyresume': `goto' there.
23650 * src/output.c (output_parser): When the `$' is met, skip the end
23651 of its line.
23652 New variable, `number_of_dollar_signs', to check there's exactly
23653 one `$' in the parser skeleton.
23654
23655 2000-10-02 Akim Demaille <akim@epita.fr>
23656
23657 * lib/xstrdup.c: New file, from the fileutils.
23658 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
23659 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
23660 instead of strlen + xmalloc + strcpy.
23661 * src/symtab.c (copys): Remove, use xstrdup instead.
23662
23663 2000-10-02 Akim Demaille <akim@epita.fr>
23664
23665 * src/gram.h (associativity): New enum type which replaces the
23666 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
23667 `right_assoc', `left_assoc' and `non_assoc'.
23668 Adjust all dependencies.
23669 * src/reader.c: Formatting changes.
23670 (LTYPESTR): Don't define it, use it as a literal in
23671 `reader_output_yylsp'.
23672 * src/symtab.h (symbol_class): New enum type which replaces the
23673 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
23674 `sunknown', `stoken and `snterm'.
23675
23676 2000-10-02 Akim Demaille <akim@epita.fr>
23677
23678 * src/getargs.c (fixed_outfiles): Rename as...
23679 (yaccflag): for consistency and accuracy.
23680 Adjust dependencies.
23681
23682 2000-10-02 Akim Demaille <akim@epita.fr>
23683
23684 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
23685 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
23686 difficult and introduced a lot of core dump. It turns out that
23687 Bison used an implementation of `xmalloc' based on `calloc', and
23688 at various places it does depend upon the initialization to 0. I
23689 have not tried to isolate the pertinent places, and all the former
23690 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
23691 someone should address this issue.
23692
23693 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
23694 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
23695 files.
23696 Adjust dependencies.
23697 * src/warshall.h: New file.
23698 Propagate.
23699
23700 2000-10-02 Akim Demaille <akim@epita.fr>
23701
23702 Various anti-`extern in *.c' changes.
23703
23704 * src/system.h: Include `assert.h'.
23705
23706 2000-10-02 Akim Demaille <akim@epita.fr>
23707
23708 * src/state.h (nstates, final_state, first_state, first_shift)
23709 (first_reduction): Move their exportation from here...
23710 * src/LR0.h: to here.
23711 Adjust dependencies.
23712 * src/getargs.c (statisticsflag): New variable.
23713 Add support for `--statistics'.
23714 Adjust dependencies.
23715
23716 Remove a lot of now useless `extern' statements in most files.
23717
23718 2000-10-02 Akim Demaille <akim@epita.fr>
23719
23720 * src/LR0.h: New file.
23721 Propagate its use.
23722
23723 2000-10-02 Akim Demaille <akim@epita.fr>
23724
23725 * src/print.h: New file.
23726 Propagate its use.
23727 * src/print.c: Formatting and ordering changes.
23728 (verbose, terse): Replace with...
23729 (print_results): this new function.
23730 Adjust dependencies.
23731
23732 2000-10-02 Akim Demaille <akim@epita.fr>
23733
23734 * src/conflicts.c (conflict_report): New function.
23735 (conflict_log, verbose_conflict_log): Replace with...
23736 (print_conflicts): this function.
23737 Adjust dependencies.
23738 * src/conflicts.h: New file.
23739 Propagate its inclusion.
23740
23741 2000-10-02 Akim Demaille <akim@epita.fr>
23742
23743 * src/nullable.h: New file.
23744 Propagate its inclusion.
23745 * src/nullable.c: Formatting changes.
23746
23747 2000-10-02 Akim Demaille <akim@epita.fr>
23748
23749 * src/reduce.h: New file.
23750 Propagate its inclusion.
23751 * src/reduce.c: Topological sort and other formatting changes.
23752 (bool, TRUE, FALSE): Move their definition to...
23753 * src/system.h: here.
23754
23755 2000-10-02 Akim Demaille <akim@epita.fr>
23756
23757 * src/files.c: Formatting changes.
23758 (tryopen, tryclose, openfiles): Rename as...
23759 (xfopen, xfclose, open_files): this.
23760 (stringappend): static.
23761 * src/files.h: Complete the list of exported symbols.
23762 Propagate its use.
23763
23764 2000-10-02 Akim Demaille <akim@epita.fr>
23765
23766 * src/reader.h: New file.
23767 Propagate its use instead of tedious list of `extern' and
23768 prototypes.
23769 * src/reader.c: Formatting changes, topological sort,
23770 s/register//.
23771
23772 2000-10-02 Akim Demaille <akim@epita.fr>
23773
23774 * src/lex.h: Prototype `lex.c' exported functions.
23775 * src/reader.c: Adjust.
23776 * src/lex.c: Formatting changes.
23777 (safegetc): Rename as...
23778 (xgetc): this.
23779
23780 2000-10-02 Akim Demaille <akim@epita.fr>
23781
23782 * src/lalr.h: New file.
23783 Propagate its inclusion instead of prototypes and `extern'.
23784 * src/lalr.c: Formatting changes, topological sorting etc.
23785
23786 2000-10-02 Akim Demaille <akim@epita.fr>
23787
23788 * src/output.c (token_actions): Introduce a temporary array,
23789 YYDEFACT, that makes it possible for this function to use
23790 output_short_table.
23791
23792 2000-10-02 Akim Demaille <akim@epita.fr>
23793
23794 `user_toknums' is output as a `short[]' in `output.c', while it is
23795 defined as a `int[]' in `reader.c'. For consistency with the
23796 other output tables, `user_toknums' is now defined as a table of
23797 shorts.
23798
23799 * src/reader.c (user_toknums): Be a short table instead of an int
23800 table.
23801 Adjust dependencies.
23802
23803 Factor the short table outputs.
23804
23805 * src/output.c (output_short_table): New function.
23806 * src/output.c (output_gram, output_stos, output_rule_data)
23807 (output_base, output_table, output_check): Use it.
23808
23809 2000-10-02 Akim Demaille <akim@epita.fr>
23810
23811 * src/output.c (output): Topological sort of the functions, in
23812 order to get rid of the `static' prototypes.
23813 No longer use `register'.
23814 * src/output.h: New file.
23815 Propagate its inclusion in files explicitly prototyping functions
23816 from output.c.
23817
23818 2000-09-21 Akim Demaille <akim@epita.fr>
23819
23820 * src/atgeneral.m4: Update from Autoconf.
23821
23822 2000-09-21 Akim Demaille <akim@epita.fr>
23823
23824 * src/closure.h: New file.
23825 * src/closure.c: Formatting changes, topological sort over the
23826 functions, use of closure.h.
23827 (initialize_closure, finalize_closure): Rename as...
23828 (new_closure, free_closure): these. Adjust dependencies.
23829 * src/LR0.c: Formatting changes, topological sort, use of
23830 cloture.h.
23831 (initialize_states): Rename as...
23832 (new_states): this.
23833 * src/Makefile.am (noinst_HEADERS): Adjust.
23834
23835 2000-09-20 Akim Demaille <akim@epita.fr>
23836
23837 * src/acconfig.h: Don't protect config.h against multiple
23838 inclusion.
23839 Don't define PARAMS.
23840 * src/system.h: Define PARAMS.
23841 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
23842 purpose of config.h. system.h must not try to fix wrong
23843 definitions in config.h.
23844
23845 2000-09-20 Akim Demaille <akim@epita.fr>
23846
23847 * src/derives.h: New file.
23848 * src/main.c, src/derives.h: Use it.
23849 Formatting changes.
23850 * src/Makefile.am (noinst_HEADERS): Adjust.
23851
23852 2000-09-20 Akim Demaille <akim@epita.fr>
23853
23854 * tests/atgeneral.m4: Update from Autoconf.
23855 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
23856 (AT_CHECK_CALC): New macros.
23857 Use these macros to test bison with options `', `--raw',
23858 `--debug', `--yacc', `--yacc --debug'.
23859
23860 2000-09-19 Akim Demaille <akim@epita.fr>
23861
23862 * src/output.c: Formatting changes.
23863 * src/machine.h: Remove, leaving its contents in...
23864 * src/system.h: here.
23865 Include stdio.h.
23866 Adjust all dependencies on stdio.h and machine.h.
23867 * src/getargs.h: New file.
23868 Let all `extern' declarations about getargs.c be replaced with
23869 inclusion of `getargs.h'.
23870 * src/Makefile.am (noinst_HEADERS): Adjust.
23871
23872 * tests/calc.m4 (yyin): Be initialized in main, not on the global
23873 scope.
23874 (yyerror): Returns void, not int.
23875 * doc/bison.texinfo: Formatting changes.
23876
23877 2000-09-19 Akim Demaille <akim@epita.fr>
23878
23879 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
23880 portable.
23881
23882 2000-09-18 Akim Demaille <akim@epita.fr>
23883
23884 * configure.in: Append WARNING_CFLAGS to CFLAGS.
23885 * src/Makefile.am (INCLUDES): Don't.
23886 Be ready to fetch headers in lib/.
23887
23888 2000-09-18 Akim Demaille <akim@epita.fr>
23889
23890 * doc/bison.texinfo: Update the copyright.
23891 ANSIfy and GNUify the examples.
23892 Remove the old menu.
23893
23894 2000-09-18 Akim Demaille <akim@epita.fr>
23895
23896 First set of tests: use the `calc' example from the documentation.
23897
23898 * src/bison.s1 (yyparse): Condition the code using `yytname' which
23899 is defined only when YYDEBUG is.
23900 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
23901 * src/files.c (tryopen, tryclose): Formatting changes.
23902 Move to the top and be static.
23903 * src/reader.c (read_signed_integer): Likewise.
23904 * tests/calc.m4: New file.
23905 * Makefile.am, suite.m4: Adjust.
23906 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
23907
23908 2000-09-18 Akim Demaille <akim@epita.fr>
23909
23910 Add support for an Autotest test suite for Bison.
23911
23912 * m4/m4.m4, m4/atconfig.m4: New files.
23913 * m4/Makefile.am (EXTRA_DIST): Adjust.
23914 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
23915 files.
23916 * src/getargs.c: Display a more standard --version message.
23917 * src/reader.c (reader): Formatting changes.
23918 No longer depend upon VERSION_STRING.
23919 * configure.in: No longer use `dnl'.
23920 Set up the test suite and the new directory `tests/.
23921 (VERSION_STRING): Remove.
23922
23923 2000-04-14 Akim Demaille <akim@epita.fr>
23924
23925 * src/reader.c (copy_comment2): New function, same as former
23926 `copy_comment', but outputs into two FILE *.
23927 (copy_comment): Use it.
23928 (parse_union_decl): Use it.
23929 (get_type, parse_start_decl): Use the same `invalid' message.
23930 (parse_start_decl, parse_union_decl): Use the same `multiple'
23931 message.
23932 (parse_union_decl, copy_guard, copy_action): Use the same
23933 `unmatched' message.
23934 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
23935
23936 2000-03-31 Akim Demaille <akim@epita.fr>
23937
23938 * src/files.c (tryopen, tryclose): Move to the top.
23939 Be static.
23940
23941 2000-03-31 Akim Demaille <akim@epita.fr>
23942
23943 * src/main.c (main): Don't call `done', exit does it.
23944
23945 2000-03-31 Akim Demaille <akim@epita.fr>
23946
23947 * allocate.c: s/return (foo)/return foo/.
23948 * lalr.c: Likewise.
23949 * LR0.c: Likewise.
23950 * output.c: Likewise.
23951 * reader.c: Likewise.
23952 * symtab.c: Likewise.
23953 * vmsgetargs.c: Likewise.
23954
23955 2000-03-31 Akim Demaille <akim@epita.fr>
23956
23957 Clean up the error reporting functions.
23958
23959 * src/report.c: New file.
23960 * src/report.h: Likewise.
23961 * src/Makefile.am: Adjust.
23962 * m4/error.m4: New file.
23963 * m4/Makefile.am: Adjust.
23964 * configure.in (jm_PREREQ_ERROR): Call it.
23965 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
23966 Remove.
23967 (fatal, fatals): Remove. All callers use complain.c::fatal.
23968 (warn, warni, warns, warnss, warnss): Remove. All callers use
23969 complain.c::complain.
23970 (toomany): Remove, use fatal instead.
23971 * src/files.c (done): No argument, use complain_message_count.
23972 * src/main.c (main): Register `done' to `atexit'.
23973
23974 * src/getargs.c (usage): More `fputs', less `fprintf'.
23975
23976 2000-03-28 Akim Demaille <akim@epita.fr>
23977
23978 * lib/: New directory.
23979 * Makefile.am (SUBDIRS): Adjust.
23980 * configure.in: Adjust.
23981 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
23982 useless.
23983 * src/alloca.c: Moved to lib/.
23984 * src/getopt.c: Likewise.
23985 * src/getopt1.c: Likewise.
23986 * src/getopt.h: Likewise.
23987 * src/ansi2knr.c: Likewise.
23988 * src/ansi2knr.1: Likewise.
23989 * src/Makefile.am: Adjust.
23990 * lib/Makefile.am: New file.
23991
23992 2000-03-28 Akim Demaille <akim@epita.fr>
23993
23994 * src/getargs.c (usage): Refresh the help message.
23995
23996 2000-03-17 Akim Demaille <akim@epita.fr>
23997
23998 * src/getopt1.c: Updated from textutils 2.0e
23999 * src/getopt.c: Likewise.
24000 * src/getopt.h: Likewise.
24001
24002 2000-03-17 Akim Demaille <akim@epita.fr>
24003
24004 * src/Makefile.am (bison.simple): Fix the awk program: quote only
24005 the file name, not the whole `#line LINE FILE'.
24006
24007 2000-03-17 Akim Demaille <akim@epita.fr>
24008
24009 On syntax errors, report the token on which we choked.
24010
24011 * src/bison.s1 (yyparse): In the label yyerrlab, when
24012 YYERROR_VERBOSE, add yychar in msg.
24013
24014 2000-03-17 Akim Demaille <akim@epita.fr>
24015
24016 * src/reader.c (copy_at): New function.
24017 (copy_guard): Use it.
24018 (copy_action): Use it.
24019
24020 2000-03-17 Akim Demaille <akim@epita.fr>
24021
24022 Be kind to translators, save some useless translations.
24023
24024 * src/main.c (banner): New function.
24025 (fatal_banner): Use it.
24026 (warn_banner): Use it.
24027
24028 2000-03-17 Akim Demaille <akim@epita.fr>
24029
24030 * src/reader.c (copy_definition): Use copy_string and
24031 copy_comment. Removed now unused `match', `ended',
24032 `cplus_comment'.
24033 (copy_comment, copy_string): Moved, to be visible from
24034 copy_definition.
24035
24036 2000-03-17 Akim Demaille <akim@epita.fr>
24037
24038 * src/reader.c (copy_string): Declare `static inline'. No
24039 problems with inline, since it is checked by configure.
24040 (copy_comment): Likewise.
24041
24042 2000-03-17 Akim Demaille <akim@epita.fr>
24043
24044 * src/reader.c (packsymbols): Formatting changes.
24045
24046 2000-03-17 Akim Demaille <akim@epita.fr>
24047
24048 * src/reader.c (copy_comment): New function, factored out from:
24049 (copy_action): Use it. Removed now unused `match', `ended',
24050 `cplus_comment'.
24051 (copy_guard): Likewise.
24052
24053 2000-03-17 Akim Demaille <akim@epita.fr>
24054
24055 * src/reader.c (copy_string): New function, factored out from:
24056 (copy_action): Use it.
24057 (copy_guard): Likewise.
24058
24059 2000-03-17 Akim Demaille <akim@epita.fr>
24060
24061 Change the handling of @s so that they behave exactly like $s.
24062 There is now a pseudo variable @$ (readble and writable), location
24063 of the lhs of the rule (by default ranging from the location of
24064 the first symbol of the rhs, to the location of the last symbol,
24065 or, if the rhs is empty, YYLLOC).
24066
24067 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
24068 yyval.
24069 (yyparse): When providing a default semantic action, provide a
24070 default location action.
24071 (after the $): No longer change `*YYLSP', just stack YYLOC the
24072 same way you stack YYVAL.
24073 * src/reader.c (read_declarations): Use warns.
24074 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
24075 (copy_action, case '@'): Likewise.
24076 Use a standard error message, to save useless work from
24077 translators.
24078
24079 2000-03-17 Akim Demaille <akim@epita.fr>
24080
24081 * src/bison.s1: Formatting and cosmetics changes.
24082 * src/reader.c: Likewise.
24083 Update the Copyright notice.
24084
24085 2000-03-17 Akim Demaille <akim@epita.fr>
24086
24087 * src/bison.s1 (#line): All set to `#line' only, since the
24088 Makefile now handles them.
24089
24090 2000-03-16 Akim Demaille <akim@epita.fr>
24091
24092 * src/output.c (output_rule_data): Output the documentation of
24093 some of the tables.
24094 (Copyright notice): Update.
24095 Formatting changes.
24096
24097 2000-03-16 Akim Demaille <akim@epita.fr>
24098
24099 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
24100 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
24101 One `#if YYDEBUG' remains, since it uses variables which are
24102 defined only if `YYDEBUG != 0'.
24103
24104 2000-03-16 Akim Demaille <akim@epita.fr>
24105
24106 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
24107 and related variables so that the similarities are highlighted.
24108
24109 2000-03-16 Akim Demaille <akim@epita.fr>
24110
24111 * src/bison.s1: Properly indent CPP directives.
24112
24113 2000-03-16 Akim Demaille <akim@epita.fr>
24114
24115 * src/bison.s1: Properly indent the `alloca' CPP section.
24116
24117 2000-03-16 Akim Demaille <akim@epita.fr>
24118
24119 Do not hard code values of directories in `configure.in'.
24120 Update the `configure' tool chain.
24121
24122 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
24123 src/makefile.am.
24124 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
24125 (AC_OUTPUT): Add m4/Makefile.
24126 Bump to bison 1.28a, 1.29 has never been released.
24127 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
24128 handled via src/Makefile.am.
24129 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
24130 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
24131 autoheader.
24132 * Makefile.am (SUBDIRS): Add m4.
24133 (ACLOCAL_AM_FLAGS): New variable.
24134 (AUTOMAKE_OPTIONS): Add check-news.
24135 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
24136 the proper line number and file name.
24137 (DEFS): Propagate the location of bison library files and of the
24138 locale files.
24139 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
24140 builddir.
24141 * acinclude.m4: Remove, replaced by the directory m4.
24142 * m4/Makefile.am (EXTRA_DIST): New variable.
24143 * m4/gettext.m4: New file, from the fileutils.
24144 * m4/lcmessage.m4: Likewise
24145 * m4/progtest.m4: Likewise.
24146 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
24147
24148 2000-03-10 Akim Demaille <akim@epita.fr>
24149
24150 * src/closure.c:
24151 Formatting changes of various comments.
24152 Respect the GNU coding standards at various places.
24153 Don't use `_()' when no translation is needed.
24154
24155 1999-12-13 Jesse Thilo <jthilo@gnu.org>
24156
24157 * src/files.c:
24158 OS/2 honors TMPDIR environment variable.
24159
24160 1999-12-13 Jesse Thilo <jthilo@gnu.org>
24161
24162 * doc/bison.texinfo: Tweaked spelling and grammar.
24163 Updated ISBN.
24164 Removed reference to price of printed copy.
24165 Mention BISON_SIMPLE and BISON_HAIRY.
24166
24167 1999-12-13 Jesse Thilo <jthilo@gnu.org>
24168
24169 * configure.in, NEWS:
24170 Bison 1.29 released.
24171
24172 1999-10-27 Jesse Thilo <jthilo@gnu.org>
24173
24174 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
24175 Added reference card.
24176
24177 1999-07-26 Jesse Thilo <jthilo@gnu.org>
24178
24179 * po/ru.po: Added Russian translation.
24180
24181 1999-07-26 Jesse Thilo <jthilo@gnu.org>
24182
24183 * configure.in: Added Russian translation.
24184
24185 1999-07-06 Jesse Thilo <jthilo@gnu.org>
24186
24187 * configure.in, NEWS, README:
24188 Released version 1.28.
24189
24190 1999-06-14 Jesse Thilo <jthilo@gnu.org>
24191
24192 * src/system.h:
24193 Squashed redefinition warning on some systems.
24194
24195 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
24196 Have configure build version string instead of relying on ANSI string
24197 concatentation.
24198
24199 1999-06-14 Jesse Thilo <jthilo@gnu.org>
24200
24201 * po/POTFILES.in: Got rid of version.c.
24202
24203 1999-06-14 Jesse Thilo <jthilo@gnu.org>
24204
24205 * acconfig.h, configure.in:
24206 Have configure build version string instead of relying on ANSI string
24207 concatentation.
24208
24209 1999-06-08 Jesse Thilo <jthilo@gnu.org>
24210
24211 * doc/bison.1:
24212 Dropped mention of `+' for long-named options.
24213
24214 1999-05-30 Jesse Thilo <jthilo@gnu.org>
24215
24216 * src/files.c: Added <unistd.h> for unlink().
24217
24218 * src/Makefile.am, src/system.h:
24219 I18n fixes.
24220
24221 1999-05-30 Jesse Thilo <jthilo@gnu.org>
24222
24223 * README: Added a FAQ list.
24224
24225 * configure.in, acconfig.h:
24226 I18n fixes.
24227
24228 1999-05-30 Jesse Thilo <jthilo@gnu.org>
24229
24230 * doc/FAQ, doc/Makefile.am:
24231 Added a FAQ list.
24232
24233 1999-05-19 Jesse Thilo <jthilo@gnu.org>
24234
24235 * src/alloc.h, src/symtab.h, src/version.c:
24236 Protected inclusion of "config.h" with HAVE_CONFIG_H.
24237
24238 1999-04-18 Jesse Thilo <jthilo@gnu.org>
24239
24240 * src/.cvsignore, src/Makefile.am:
24241 Reorganized: sources in `src', documentation in `doc'.
24242
24243 * src/lex.c (literalchar):
24244 fixed the code for escaping double quotes (thanks
24245 Jonathan Czisny.)
24246
24247 1999-04-18 Jesse Thilo <jthilo@gnu.org>
24248
24249 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
24250 Adjusted paths to reflect directory reorganization.
24251
24252 1999-04-18 Jesse Thilo <jthilo@gnu.org>
24253
24254 * doc/.cvsignore, doc/Makefile.am:
24255 Reorganized: sources in `src', documentation in `doc'.
24256
24257 1999-04-18 Jesse Thilo <jthilo@gnu.org>
24258
24259 * configure.in:
24260 Updated AC_INIT file to reflect directory reorganization.
24261
24262 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
24263 Reorganized: sources in `src', documentation in `doc'.
24264
24265 1999-04-13 Jesse Thilo <jthilo@gnu.org>
24266
24267 * src/allocate.c:
24268 Don't declare calloc() and realloc() if not necessary.
24269
24270 1999-04-13 Jesse Thilo <jthilo@gnu.org>
24271
24272 * configure.in, acconfig.h, acinclude.m4:
24273 Don't declare calloc() and realloc() if not necessary.
24274
24275 1999-03-23 Jesse Thilo <jthilo@gnu.org>
24276
24277 * po/.cvsignore: Added i18n support.
24278
24279 1999-03-23 Jesse Thilo <jthilo@gnu.org>
24280
24281 * acconfig.h, configure.in, Makefile.am:
24282 Added i18n support.
24283
24284 1999-03-22 Jesse Thilo <jthilo@gnu.org>
24285
24286 * src/bison.s1: Fixed #line numbers.
24287
24288 1999-03-15 Jesse Thilo <jthilo@gnu.org>
24289
24290 * po/es.po, po/fr.po, po/nl.po, po/de.po:
24291 Added PO files from Translation Project.
24292
24293 1999-03-03 Jesse Thilo <jthilo@gnu.org>
24294
24295 * Makefile.am:
24296 Added support for non-ANSI compilers (ansi2knr).
24297
24298 1999-02-16 Jesse Thilo <jthilo@gnu.org>
24299
24300 * configure.in: Bumped version number to 1.27.
24301
24302 * Makefile.am:
24303 Added `bison.simple' to list of files removed by `make distclean'.
24304
24305 1999-02-12 Jesse Thilo <jthilo@gnu.org>
24306
24307 * src/files.c, src/files.h:
24308 Defined locations of parser files in config.h instead of Makefile.
24309
24310 1999-02-12 Jesse Thilo <jthilo@gnu.org>
24311
24312 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
24313 Defined locations of parser files in config.h instead of Makefile.
24314
24315 1999-02-09 Jesse Thilo <jthilo@gnu.org>
24316
24317 * Makefile.am:
24318 Removed inappropriate use of $< macro.
24319
24320 1999-02-05 Jesse Thilo <jthilo@gnu.org>
24321
24322 * po/Makefile.in.in, po/POTFILES.in:
24323 Add `po' directory skeleton.
24324
24325 1999-01-27 Jesse Thilo <jthilo@gnu.org>
24326
24327 * README: Document help-bison list.
24328
24329 * configure.in: Add check for mkstemp().
24330
24331 1999-01-20 Jesse Thilo <jthilo@gnu.org>
24332
24333 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
24334 Hush a few compiler warnings.
24335
24336 * src/files.c:
24337 Add tryclose(), which verifies that fclose was successful.
24338 Hush a couple of compiler warnings.
24339
24340 1999-01-20 Jesse Thilo <jthilo@gnu.org>
24341
24342 * Makefile.am, OChangeLog:
24343 ChangeLog is now automatically generated. Include the old version as
24344 OChangeLog.
24345
24346 1999-01-14 Jesse Thilo <jthilo@gnu.org>
24347
24348 * 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:
24349 Update FSF address.
24350
24351 1999-01-14 Jesse Thilo <jthilo@gnu.org>
24352
24353 * doc/bison.texinfo: Fix formatting glitch.
24354
24355 * doc/bison.texinfo: Update FSF address.
24356
24357 1999-01-14 Jesse Thilo <jthilo@gnu.org>
24358
24359 * acconfig.h: Update FSF address.
24360
24361 1999-01-08 Jesse Thilo <jthilo@gnu.org>
24362
24363 * src/system.h:
24364 Don't define PACKAGE here, since config.h defines it.
24365
24366 1998-12-30 Jesse Thilo <jthilo@gnu.org>
24367
24368 * src/reader.c: Update copyright date.
24369
24370 * src/main.c:
24371 Ditch sprintf to statically-sized buffers in fatal/warn functions in
24372 favor of output directly to stderr (avoids buffer overruns).
24373
24374 * src/reader.c: Some checks for premature EOF.
24375
24376 * 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:
24377 Use prototypes if the compiler understands them.
24378
24379 * src/files.c: Honor TMPDIR on Unix hosts.
24380 Use prototypes if the compiler understands them.
24381
24382 * src/reader.c:
24383 Fix a couple of buffer overrun bugs.
24384 Use prototypes if the compiler understands them.
24385
24386 * src/system.h: Include unistd.h and ctype.h.
24387 Use #ifdef instead of #if for NLS symbols.
24388
24389 1998-12-30 Jesse Thilo <jthilo@gnu.org>
24390
24391 * doc/bison.texinfo:
24392 Delete comment "consider using @set for edition number, etc..." since
24393 we now are doing so.
24394
24395 1998-12-30 Jesse Thilo <jthilo@gnu.org>
24396
24397 * configure.in:
24398 Use prototypes if the compiler understands them.
24399
24400 * NEWS: Document 1.26 highlights.
24401
24402 * Makefile.am: Require Automake 1.3 or later.
24403
24404 * acconfig.h:
24405 Use prototypes if the compiler understands them.
24406
24407 1998-12-29 Jesse Thilo <jthilo@gnu.org>
24408
24409 * src/version.c:
24410 Use VERSION symbol from automake for version number.
24411
24412 1998-12-29 Jesse Thilo <jthilo@gnu.org>
24413
24414 * acconfig.h, configure.in, version.cin:
24415 Use VERSION symbol from automake for version number.
24416
24417 1998-11-28 Jesse Thilo <jthilo@gnu.org>
24418
24419 * Makefile.am:
24420 Distribute original version of simple parser (bison.s1), not built
24421 version (bison.simple).
24422
24423 1998-11-28 Jesse Thilo <jthilo@gnu.org>
24424
24425 * doc/bison.texinfo: Add info dir entry.
24426
24427 * doc/bison.texinfo:
24428 Let automake put version number into documentation.
24429
24430 1998-11-26 Jesse Thilo <jthilo@gnu.org>
24431
24432 * src/bison.cld, src/build.com, src/vmshlp.mar:
24433 Add non-RCS files from /gd/gnu/bison.
24434
24435 1998-11-26 Jesse Thilo <jthilo@gnu.org>
24436
24437 * doc/bison.1:
24438 Document the BISON_HAIRY and BISON_SIMPLE variables.
24439
24440 1998-11-25 Jesse Thilo <jthilo@gnu.org>
24441
24442 * src/version.c: Build version.c automatically.
24443
24444 * src/reader.c:
24445 Fix token numbering (used to start at 258, not 257).
24446
24447 * src/system.h: Include config.h.
24448
24449 * src/getargs.c: Update bug report address.
24450
24451 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
24452 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
24453
24454 1998-11-25 Jesse Thilo <jthilo@gnu.org>
24455
24456 * Makefile.am:
24457 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24458
24459 * configure.in, version.cin:
24460 Build version.c automatically.
24461
24462 * AUTHORS: Add AUTHORS file.
24463
24464 * README: Update bug report address.
24465
24466 * bison.simple:
24467 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24468
24469 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
24470 Add automake stuff.
24471
24472 1998-11-25 Jesse Thilo <jthilo@gnu.org>
24473
24474 * doc/bison.texinfo: Clean up some formatting.
24475
24476 1998-05-05 Richard Stallman <rms@gnu.org>
24477
24478 * doc/bison.texinfo:
24479 Explain better why to make a pure parser.
24480
24481 1998-01-05 Richard Stallman <rms@gnu.org>
24482
24483 * src/files.c (openfiles):
24484 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
24485 find a temporary directory, if possible. Do not unlink files while
24486 they are open.
24487
24488 1997-08-25 Richard Stallman <rms@gnu.org>
24489
24490 * src/reader.c (stack_offset;):
24491 Change some warni to warns.
24492
24493 * src/lex.c (literalchar): Use warns, not warni.
24494
24495 1997-06-28 Richard Stallman <rms@gnu.org>
24496
24497 * src/bison.s1: Add a Bison version comment.
24498
24499 * src/main.c (fatal, warn, berror):
24500 Use program_name.
24501
24502 1997-06-28 Richard Stallman <rms@gnu.org>
24503
24504 * Makefile.in (bison_version): New variable.
24505 (dist): Use that variable.
24506 (bison.s1): Substitute the Bison version into bison.simple.
24507
24508 * bison.simple: Add a Bison version comment.
24509
24510 1997-06-18 Richard Stallman <rms@gnu.org>
24511
24512 * src/main.c (fatal, warn, berror):
24513 Make error messages standard.
24514 (toomany): Improve error message text.
24515
24516 * 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:
24517 new.h renamed to alloc.h.
24518
24519 1997-06-18 Richard Stallman <rms@gnu.org>
24520
24521 * Makefile.in: new.h renamed to alloc.h.
24522
24523 1997-05-24 Richard Stallman <rms@gnu.org>
24524
24525 * src/lex.c (literalchar):
24526 Fix the code for escaping \, " and '.
24527
24528 (lex): Avoid trouble when there are many chars
24529 to discard in a char literal with just several chars in it.
24530
24531 1997-05-17 Richard Stallman <rms@gnu.org>
24532
24533 * src/bison.s1:
24534 Use malloc, if using alloca is troublesome.
24535 (YYSTACK_USE_ALLOCA): New flag macro.
24536 Define it for some systems and compilers.
24537 (YYSTACK_ALLOC): New macro.
24538 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24539 If it was malloc'd, free it.
24540
24541 1997-05-17 Richard Stallman <rms@gnu.org>
24542
24543 * bison.simple:
24544 Use malloc, if using alloca is troublesome.
24545 (YYSTACK_USE_ALLOCA): New flag macro.
24546 Define it for some systems and compilers.
24547 (YYSTACK_ALLOC): New macro.
24548 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24549 If it was malloc'd, free it.
24550
24551 1997-04-23 Richard Stallman <rms@gnu.org>
24552
24553 * src/bison.s1:
24554 (alloca) [__hpux]: Always define as __builtin_alloca.
24555
24556 1997-04-23 Richard Stallman <rms@gnu.org>
24557
24558 * bison.simple:
24559 (alloca) [__hpux]: Always define as __builtin_alloca.
24560
24561 1997-04-22 Richard Stallman <rms@gnu.org>
24562
24563 * src/bison.s1:
24564 [__hpux]: Include alloca.h (right for HPUX 10)
24565 instead of declaring alloca (right for HPUX 9).
24566
24567 * src/bison.s1 (__yy_memcpy):
24568 Declare arg `count' as unsigned int.
24569 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24570
24571 1997-04-22 Richard Stallman <rms@gnu.org>
24572
24573 * bison.simple:
24574 [__hpux]: Include alloca.h (right for HPUX 10)
24575 instead of declaring alloca (right for HPUX 9).
24576
24577 * bison.simple (__yy_memcpy):
24578 Declare arg `count' as unsigned int.
24579 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24580
24581 1997-01-03 Richard Stallman <rms@gnu.org>
24582
24583 * src/allocate.c: [__STDC__ or _MSC_VER]:
24584 Declare calloc and realloc to return void *.
24585
24586 1997-01-02 Richard Stallman <rms@gnu.org>
24587
24588 * src/system.h:
24589 [_MSC_VER]: Include stdlib.h and process.h.
24590 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
24591
24592 * src/main.c (main): Return FAILURE as a value.
24593 (printable_version): Declare arg as int, not char.
24594
24595 1997-01-02 Richard Stallman <rms@gnu.org>
24596
24597 * Makefile.in (dist):
24598 Explicitly check for symlinks, and copy them.
24599
24600 1996-12-19 Richard Stallman <rms@gnu.org>
24601
24602 * src/files.c:
24603 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
24604
24605 1996-12-18 Paul Eggert <eggert@gnu.org>
24606
24607 * src/bison.s1 (yyparse):
24608 If __GNUC__ and YYPARSE_PARAM are both defined,
24609 declare yyparse to have a void * argument.
24610
24611 1996-12-18 Paul Eggert <eggert@gnu.org>
24612
24613 * bison.simple (yyparse):
24614 If __GNUC__ and YYPARSE_PARAM are both defined,
24615 declare yyparse to have a void * argument.
24616
24617 1996-12-17 Richard Stallman <rms@gnu.org>
24618
24619 * src/reduce.c (nbits): Add some casts.
24620
24621 1996-08-12 Richard Stallman <rms@gnu.org>
24622
24623 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
24624
24625 1996-08-12 Richard Stallman <rms@gnu.org>
24626
24627 * bison.simple: Test _MSDOS as well as _MSDOS_.
24628
24629 1996-07-31 Richard Stallman <rms@gnu.org>
24630
24631 * src/bison.s1:
24632 [__sun && __i386]: Include alloca.h.
24633
24634 1996-07-31 Richard Stallman <rms@gnu.org>
24635
24636 * bison.simple:
24637 [__sun && __i386]: Include alloca.h.
24638
24639 1996-07-30 Richard Stallman <rms@gnu.org>
24640
24641 * src/bison.s1: Comment change.
24642
24643 * src/bison.s1: Test _MSDOS_, not MSDOS.
24644
24645 1996-07-30 Richard Stallman <rms@gnu.org>
24646
24647 * bison.simple: Comment change.
24648
24649 * bison.simple: Test _MSDOS_, not MSDOS.
24650
24651 1996-06-01 Richard Stallman <rms@gnu.org>
24652
24653 * 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:
24654 Insert `_' macro around many string constants.
24655
24656 * src/main.c:
24657 Insert `_' macro around many string constants.
24658
24659 (main): Call setlocale, bindtextdomain and textdomain.
24660
24661 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
24662 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
24663 [ENABLE_NLS]: Include libintl.h.
24664 [ENABLE_NLS] (gettext): Define.
24665 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
24666 (N_, PACKAGE, LOCALEDIR): New macros.
24667
24668 1996-06-01 Richard Stallman <rms@gnu.org>
24669
24670 * POTFILES.in: New file.
24671
24672 * Makefile.in (allocate.o):
24673 Define target explicitly.
24674
24675 * Makefile.in (CFLAGS): Set to @CFLAGS@.
24676 (LDFLAGS): Set to @LDFLAGS@.
24677 (configure): Run autoconf only if preceding `cd' succeeds.
24678 (bison.s1): Redirect output to temporary file then move the
24679 temporary to the target, rather than redirecting directly to bison.s1.
24680 (clean): Remove config.status and config.log.
24681 (distclean): Don't remove config.status here.
24682
24683 1996-05-12 Richard Stallman <rms@gnu.org>
24684
24685 * src/bison.s1:
24686 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24687
24688 1996-05-12 Richard Stallman <rms@gnu.org>
24689
24690 * bison.simple:
24691 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24692
24693 1996-05-11 Richard Stallman <rms@gnu.org>
24694
24695 * src/bison.s1 (__yy_memcpy):
24696 Really reorder the args, as was supposedly done on Feb 14 1995.
24697 (yyparse): Calls changed accordingly.
24698
24699 1996-05-11 Richard Stallman <rms@gnu.org>
24700
24701 * Makefile.in (dist): Don't use $(srcdir).
24702
24703 * bison.simple (__yy_memcpy):
24704 Really reorder the args, as was supposedly done on Feb 14 1995.
24705 (yyparse): Calls changed accordingly.
24706
24707 1996-01-27 Richard Stallman <rms@gnu.org>
24708
24709 * src/output.c (output_rule_data):
24710 Test YYERROR_VERBOSE in the conditional
24711 around the definition of ttyname.
24712
24713 1995-12-29 Richard Stallman <rms@gnu.org>
24714
24715 * src/bison.s1:
24716 Fix line numbers in #line commands.
24717
24718 1995-12-29 Richard Stallman <rms@gnu.org>
24719
24720 * bison.simple:
24721 Fix line numbers in #line commands.
24722
24723 1995-12-27 Richard Stallman <rms@gnu.org>
24724
24725 * src/bison.s1 (YYPARSE_PARAM_DECL):
24726 In C++, make it always null.
24727 (YYPARSE_PARAM_ARG): New macro.
24728 (yyparse): Use YYPARSE_PARAM_ARG.
24729
24730 1995-12-27 Richard Stallman <rms@gnu.org>
24731
24732 * bison.simple (YYPARSE_PARAM_DECL):
24733 In C++, make it always null.
24734 (YYPARSE_PARAM_ARG): New macro.
24735 (yyparse): Use YYPARSE_PARAM_ARG.
24736
24737 1995-11-29 Richard Stallman <rms@gnu.org>
24738
24739 * doc/bison.texinfo:
24740 Describe literal string tokens, %raw, %no_lines, %token_table.
24741
24742 1995-11-29 Daniel Hagerty <hag@gnu.org>
24743
24744 * doc/bison.texinfo: Fixed update date
24745
24746 1995-10-16 Richard Stallman <rms@gnu.org>
24747
24748 * src/version.c: Version 1.25.
24749
24750 1995-10-16 Richard Stallman <rms@gnu.org>
24751
24752 * NEWS: *** empty log message ***
24753
24754 1995-10-16 Richard Stallman <rms@gnu.org>
24755
24756 * doc/bison.1, doc/bison.rnh:
24757 Add new options.
24758
24759 1995-10-15 Richard Stallman <rms@gnu.org>
24760
24761 * src/vmsgetargs.c, src/getargs.c:
24762 Added -n, -k, and -raw switches.
24763 (noparserflag, toknumflag, rawtoknumflag): New variables.
24764
24765 * src/symtab.h (SALIAS):
24766 New #define for adding aliases to %token.
24767 (struct bucket): Added `alias' field.
24768
24769 * src/reduce.c (reduce_grammar):
24770 Revise error message.
24771 (print_notices): Remove final `.' from error message.
24772
24773 * src/reader.c (reader_output_yylsp):
24774 New function.
24775 (readgram): Use `#if 0' around code that accepted %command
24776 inside grammar rules: The documentation doesn't allow it,
24777 and it will fail since the %command processors scan for the next %.
24778 (parse_token_decl): Extended the %token
24779 declaration to allow a multi-character symbol as an alias.
24780 (parse_thong_decl): New function.
24781 (read_declarations): Added %thong declarations.
24782 (read_declarations): Handle NOOP to deal with allowing
24783 % declarations as another means to specify the flags.
24784 (readgram): Allow %prec prior to semantics embedded in a rule.
24785 (skip_to_char, read_declarations, copy_definition)
24786 (parse_token_decl, parse_start_decl, parse_type_decl)
24787 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
24788 (get_type_name, copy_guard, copy_action, readgram)
24789 (get_type, packsymbols): Revised most error messages.
24790 Changed `fatal' to `warnxxx' to avoid aborting for error.
24791 Revised and use multiple warnxxx functions to avoid using VARARGS1.
24792 (read_declarations): Improve the error message for
24793 an invalid character. Do not abort.
24794 (read_declarations, copy_guard, copy_action): Use
24795 printable_version to avoid unprintable characters in printed output.
24796 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
24797 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
24798 Allow the type of a non-terminal can be given
24799 more than once, as long as all specifications give the same type.
24800
24801 * src/output.c:
24802 (output_headers, output_trailers, output, output_gram)
24803 (output_rule_data): Implement noparserflag variable.
24804 Implement toknumflag variable.
24805 (output): Call reader_output_yylsp to output LTYPESTR.
24806
24807 * src/main.c (main):
24808 If reader sees an error, don't process the grammar.
24809 (fatals): Updated to not use VARARGS1.
24810 (printable_version, int_to_string, warn, warni, warns, warnss)
24811 (warnsss): New error reporting functions. Avoid abort for error.
24812
24813 * src/lex.h:
24814 Added THONG and NOOP for alias processing.
24815 Added SETOPT for the new code that allows setting options with %flags.
24816
24817 * src/lex.c:
24818 Include getopt.h. Add some extern decls.
24819 (safegetc): New function to deal with EOF gracefully.
24820 (literalchar); new function to deal with reading \ escapes.
24821 (lex): Use literalchar.
24822 (lex): Implemented "..." tokens.
24823 (literalchar, lex, parse_percent_token): Made tokenbuffer
24824 always contain the token. This includes growing the token
24825 buffer while reading an integer.
24826 (parse_percent_token): Replaced if-else statement with percent_table.
24827 (parse_percent_token): Added % declarations as another
24828 way to specify the flags -n, -l, and -r. Also added hooks for
24829 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
24830 major changes to files.c.
24831 (lex) Retain in the incoming stream a character following
24832 an incorrect '/'.
24833 (skip_white_space, lex): Revised most error messages
24834 and changed fatal to warn to avoid aborting.
24835 (percent_table): Added %thong declarations.
24836
24837 * src/gram.h: Comment changes.
24838
24839 * src/files.c (openfiles, open_extra_files, done):
24840 Add faction flag
24841 and actfile file. Handle noparserflag. Both for -n switch.
24842
24843 * src/conflicts.c (resolve_sr_conflict):
24844 Remove use of alloca.
24845
24846 1995-06-01 Jim Meyering <meyering@gnu.org>
24847
24848 * doc/bison.texinfo: *** empty log message ***
24849
24850 1995-05-06 Richard Stallman <rms@gnu.org>
24851
24852 * src/bison.s1: Comment change.
24853
24854 1995-05-06 Richard Stallman <rms@gnu.org>
24855
24856 * bison.simple: Comment change.
24857
24858 1995-05-03 Richard Stallman <rms@gnu.org>
24859
24860 * src/version.c: Version now 1.24.
24861
24862 * src/bison.s1: Change distribution terms.
24863
24864 * src/version.c: Version now 1.23.
24865
24866 1995-05-03 Richard Stallman <rms@gnu.org>
24867
24868 * doc/bison.texinfo:
24869 Rewrite "Conditions for Using Bison".
24870 Update version to 1.24.
24871
24872 1995-05-03 Richard Stallman <rms@gnu.org>
24873
24874 * bison.simple: Change distribution terms.
24875
24876 1995-02-23 Richard Stallman <rms@gnu.org>
24877
24878 * src/files.c: Test __VMS_POSIX as well as VMS.
24879
24880 1995-02-14 Jim Meyering <meyering@gnu.org>
24881
24882 * src/bison.s1 (__yy_memcpy):
24883 Renamed from __yy_bcopy to avoid
24884 confusion. Reverse FROM and TO arguments to be consistent with
24885 those of memcpy.
24886
24887 1995-02-14 Jim Meyering <meyering@gnu.org>
24888
24889 * bison.simple (__yy_memcpy):
24890 Renamed from __yy_bcopy to avoid
24891 confusion. Reverse FROM and TO arguments to be consistent with
24892 those of memcpy.
24893
24894 1994-11-10 David J. MacKenzie <djm@gnu.org>
24895
24896 * NEWS: reformat
24897
24898 * NEWS: New file.
24899
24900 * Makefile.in (DISTFILES): Include NEWS.
24901
24902 * Makefile.in (DISTFILES):
24903 Include install-sh, not install.sh.
24904
24905 * configure.in: Update to Autoconf v2 macro names.
24906
24907 1994-10-05 David J. MacKenzie <djm@gnu.org>
24908
24909 * Makefile.in: fix typo
24910
24911 * Makefile.in (prefix, exec_prefix):
24912 Let configure set them.
24913
24914 1994-09-28 David J. MacKenzie <djm@gnu.org>
24915
24916 * Makefile.in: Set datadir to $(prefix)/share.
24917
24918 1994-09-15 Richard Stallman <rms@gnu.org>
24919
24920 * src/bison.s1:
24921 Update copyright notice and GPL version.
24922
24923 1994-09-15 Richard Stallman <rms@gnu.org>
24924
24925 * bison.simple:
24926 Update copyright notice and GPL version.
24927
24928 1994-07-12 Richard Stallman <rms@gnu.org>
24929
24930 * src/reduce.c, src/reader.c:
24931 entered into RCS
24932
24933 1994-05-05 David J. MacKenzie <djm@gnu.org>
24934
24935 * Makefile.in: entered into RCS
24936
24937 1994-03-26 Richard Stallman <rms@gnu.org>
24938
24939 * src/bison.s1: entered into RCS
24940
24941 1994-03-26 Richard Stallman <rms@gnu.org>
24942
24943 * bison.simple: entered into RCS
24944
24945 1994-03-25 Richard Stallman <rms@gnu.org>
24946
24947 * src/main.c: entered into RCS
24948
24949 1994-03-24 Richard Stallman <rms@gnu.org>
24950
24951 * src/conflicts.c: entered into RCS
24952
24953 1994-01-02 Richard Stallman <rms@gnu.org>
24954
24955 * Makefile.in: *** empty log message ***
24956
24957 1993-11-21 Richard Stallman <rms@gnu.org>
24958
24959 * src/bison.s1: *** empty log message ***
24960
24961 1993-11-21 Richard Stallman <rms@gnu.org>
24962
24963 * doc/bison.texinfo: entered into RCS
24964
24965 * doc/bison.texinfo: *** empty log message ***
24966
24967 1993-11-21 Richard Stallman <rms@gnu.org>
24968
24969 * bison.simple: *** empty log message ***
24970
24971 1993-10-25 David J. MacKenzie <djm@gnu.org>
24972
24973 * doc/bison.texinfo: *** empty log message ***
24974
24975 1993-10-19 Richard Stallman <rms@gnu.org>
24976
24977 * src/bison.s1: *** empty log message ***
24978
24979 1993-10-19 Richard Stallman <rms@gnu.org>
24980
24981 * bison.simple: *** empty log message ***
24982
24983 1993-10-14 Richard Stallman <rms@gnu.org>
24984
24985 * src/bison.s1: *** empty log message ***
24986
24987 1993-10-14 Richard Stallman <rms@gnu.org>
24988
24989 * bison.simple: *** empty log message ***
24990
24991 1993-09-14 David J. MacKenzie <djm@gnu.org>
24992
24993 * doc/bison.texinfo: *** empty log message ***
24994
24995 1993-09-13 Noah Friedman <friedman@gnu.org>
24996
24997 * Makefile.in: *** empty log message ***
24998
24999 1993-09-10 Richard Stallman <rms@gnu.org>
25000
25001 * src/conflicts.c: *** empty log message ***
25002
25003 * src/system.h: entered into RCS
25004
25005 1993-09-10 Richard Stallman <rms@gnu.org>
25006
25007 * doc/bison.1: entered into RCS
25008
25009 1993-09-06 Noah Friedman <friedman@gnu.org>
25010
25011 * src/version.c: entered into RCS
25012
25013 1993-09-06 Noah Friedman <friedman@gnu.org>
25014
25015 * Makefile.in: *** empty log message ***
25016
25017 1993-07-30 David J. MacKenzie <djm@gnu.org>
25018
25019 * Makefile.in: *** empty log message ***
25020
25021 1993-07-24 Richard Stallman <rms@gnu.org>
25022
25023 * src/bison.s1: *** empty log message ***
25024
25025 1993-07-24 Richard Stallman <rms@gnu.org>
25026
25027 * bison.simple: *** empty log message ***
25028
25029 1993-07-08 David J. MacKenzie <djm@gnu.org>
25030
25031 * Makefile.in: *** empty log message ***
25032
25033 1993-07-04 Richard Stallman <rms@gnu.org>
25034
25035 * src/bison.s1: *** empty log message ***
25036
25037 1993-07-04 Richard Stallman <rms@gnu.org>
25038
25039 * bison.simple: *** empty log message ***
25040
25041 1993-06-26 David J. MacKenzie <djm@gnu.org>
25042
25043 * src/getargs.c: entered into RCS
25044
25045 1993-06-26 David J. MacKenzie <djm@gnu.org>
25046
25047 * doc/bison.texinfo: *** empty log message ***
25048
25049 * doc/bison.1: New file.
25050
25051 1993-06-25 Richard Stallman <rms@gnu.org>
25052
25053 * src/getargs.c: New file.
25054
25055 1993-06-16 Richard Stallman <rms@gnu.org>
25056
25057 * src/bison.s1: *** empty log message ***
25058
25059 1993-06-16 Richard Stallman <rms@gnu.org>
25060
25061 * bison.simple: *** empty log message ***
25062
25063 1993-06-03 Richard Stallman <rms@gnu.org>
25064
25065 * src/bison.s1: New file.
25066
25067 1993-06-03 Richard Stallman <rms@gnu.org>
25068
25069 * doc/bison.texinfo: *** empty log message ***
25070
25071 1993-06-03 Richard Stallman <rms@gnu.org>
25072
25073 * bison.simple: New file.
25074
25075 1993-05-19 Richard Stallman <rms@gnu.org>
25076
25077 * doc/bison.texinfo: New file.
25078
25079 1993-05-07 Noah Friedman <friedman@gnu.org>
25080
25081 * Makefile.in: *** empty log message ***
25082
25083 1993-04-28 Noah Friedman <friedman@gnu.org>
25084
25085 * src/reader.c: *** empty log message ***
25086
25087 1993-04-23 Noah Friedman <friedman@gnu.org>
25088
25089 * src/alloc.h: entered into RCS
25090
25091 1993-04-20 David J. MacKenzie <djm@gnu.org>
25092
25093 * src/version.c: *** empty log message ***
25094
25095 * src/files.c, src/allocate.c:
25096 entered into RCS
25097
25098 * src/reader.c: *** empty log message ***
25099
25100 * src/lex.c: entered into RCS
25101
25102 * src/conflicts.c: New file.
25103
25104 * src/symtab.c: entered into RCS
25105
25106 * src/alloc.h: New file.
25107
25108 * src/LR0.c: entered into RCS
25109
25110 1993-04-18 Noah Friedman <friedman@gnu.org>
25111
25112 * src/reader.c: New file.
25113
25114 * src/version.c: *** empty log message ***
25115
25116 1993-04-18 Noah Friedman <friedman@gnu.org>
25117
25118 * Makefile.in: *** empty log message ***
25119
25120 1993-04-17 Noah Friedman <friedman@gnu.org>
25121
25122 * Makefile.in: *** empty log message ***
25123
25124 1993-04-15 Richard Stallman <rms@gnu.org>
25125
25126 * src/main.c, src/files.c:
25127 New file.
25128
25129 1993-04-15 Noah Friedman <friedman@gnu.org>
25130
25131 * configure.in: entered into RCS
25132
25133 * configure.in: *** empty log message ***
25134
25135 * configure.in: New file.
25136
25137 1993-04-14 Richard Stallman <rms@gnu.org>
25138
25139 * Makefile.in: New file.
25140
25141 1993-04-13 Richard Stallman <rms@gnu.org>
25142
25143 * src/version.c: New file.
25144
25145 1993-03-25 Richard Stallman <rms@gnu.org>
25146
25147 * src/output.c: entered into RCS
25148
25149 1992-09-25 Richard Stallman <rms@gnu.org>
25150
25151 * configure.bat: entered into RCS
25152
25153 1992-06-22 Richard Stallman <rms@gnu.org>
25154
25155 * src/vmsgetargs.c: entered into RCS
25156
25157 1992-06-22 Richard Stallman <rms@gnu.org>
25158
25159 * doc/bison.rnh: entered into RCS
25160
25161 1992-04-20 David J. MacKenzie <djm@gnu.org>
25162
25163 * README: entered into RCS
25164
25165 1992-01-22 Richard Stallman <rms@gnu.org>
25166
25167 * src/machine.h: entered into RCS
25168
25169 1991-12-21 Richard Stallman <rms@gnu.org>
25170
25171 * src/lalr.c, src/closure.c:
25172 entered into RCS
25173
25174 1991-12-20 Richard Stallman <rms@gnu.org>
25175
25176 * src/state.h: entered into RCS
25177
25178 1991-12-18 Richard Stallman <rms@gnu.org>
25179
25180 * src/print.c, src/nullable.c, src/derives.c:
25181 entered into RCS
25182
25183 1991-11-03 David J. MacKenzie <djm@gnu.org>
25184
25185 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
25186 entered into RCS
25187
25188 1988-09-09 Richard Stallman <rms@gnu.org>
25189
25190 * src/bison.hairy: entered into RCS
25191
25192 1987-12-16 Richard Stallman <rms@gnu.org>
25193
25194 * REFERENCES: entered into RCS
25195
25196
25197 -----
25198
25199 Copyright (C) 1987-1988, 1991-2010 Free Software Foundation,
25200 Inc.
25201
25202 Copying and distribution of this file, with or without
25203 modification, are permitted provided the copyright notice and this
25204 notice are preserved.