]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
tests: don't depend on the actual location type.
[bison.git] / ChangeLog
... / ...
CommitLineData
12010-04-13 Akim Demaille <demaille@gostai.com>
2
3 tests: don't depend on the actual location type.
4 * tests/calc.at: Use yy::parser::location_type rather than
5 yy::location, since the former is always right, and might point to
6 another type than the latter.
7
82010-04-13 Akim Demaille <demaille@gostai.com>
9
10 formatting changes.
11 * tests/calc.at: Formatting changes.
12
132010-04-13 Akim Demaille <demaille@gostai.com>
14
15 lalr1.cc: remove useless forward declaration.
16 * data/lalr1.cc: Include location.hh before stack.hh.
17 Remove the useless forward declarations of position and location.
18 Reported by Chris Morley.
19 * data/glr.cc: Likewise.
20
212010-04-11 Joel E. Denny <joeldenny@joeldenny.org>
22
23 * NEWS (2.4.3): Mention fix for Sun Studio C++.
24
252010-04-10 Joel E. Denny <joeldenny@joeldenny.org>
26
27 tests: fix for newer Sun Studio C++.
28 Reported by Dagobert Michelsen at
29 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00023.html>.
30 * THANKS (Dagobert Michelsen): Add.
31 * configure.ac (AC_PREREQ): Set to 2.64 so we get the latest
32 Autoconf macro for handling the restrict keyword.
33 * gnulib: Update to latest, which no longer overrides that macro
34 from Autoconf.
35
362010-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
37
38 portability: fix pointer arithmetic to conform to C standard.
39 Reported by Tys Lefering at
40 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00035.html>.
41 This fix is already implemented in glr.c and does not apply to
42 lalr1.java.
43 * data/lalr1.cc (yy::parser::parse): Increase size of
44 yyerror_range and adjust subscripting so you don't have to
45 subtract one from the beginning of the array.
46 * data/yacc.c (b4_declare_parser_state_variables,
47 yyparse, yypush_parse): Likewise.
48
492010-04-05 Akim Demaille <demaille@gostai.com>
50
51 remove useless include.
52 * src/graphviz.h: Don't include stdbool.h.
53
542010-04-05 Akim Demaille <demaille@gostai.com>
55
56 graph: sign the output file.
57 * src/graphviz.c (start_graph): Issue comments about Bison.
58 Suggested by Tys Lefering.
59
602010-03-31 Joel E. Denny <jdenny@ces.clemson.edu>
61
62 portability: fix test suite for GCC 4.5's new #error message.
63 Reported by Tys Lefering at
64 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00030.html>.
65 * NEWS (2.4.3): Mention.
66 * tests/synclines.at (AT_TEST_SYNCLINE): Implement.
67
682010-03-30 Akim Demaille <demaille@gostai.com>
69
70 fix comments.
71 * src/graphviz.h: Add missing license notice.
72 Document.
73
742010-03-25 Akim Demaille <demaille@gostai.com>
75
76 tests: fix 250: parse.error=verbose overflow.
77 * tests/regression.at (parse.error=verbose overflow): Avoid the
78 double inclusion of stdlib.h as it triggers hard errors.
79
802010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
81
82 portability: fix for BSD make.
83 Reported by Johan van Selst at
84 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00016.html>.
85 * tests/local.mk ($(TESTSUITE)): Qualify package.m4 in
86 this dependency list as in package.m4's target rule.
87
882010-03-23 Joel E. Denny <jdenny@ces.clemson.edu>
89
90 portability: fix spawning on at least FreeBSD 8 and FreeBSD 9.
91 Reported by Johan van Selst at
92 <http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00014.html>.
93 * NEWS (2.4.3): New.
94 * THANKS (Johan van Selst): Add.
95 * etc/prefix-gnulib-mk (prefix): Adjust regex for makefile
96 targets so that gnulib's new c++defs.h is matched.
97 * gnulib: Update to latest.
98
992010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
100
101 maint: update for changes to gnulib's announce-gen.
102 * HACKING (Announce): RELEASE_TYPE=major must now be written
103 RELEASE_TYPE=stable.
104
1052010-03-20 Joel E. Denny <jdenny@ces.clemson.edu>
106
107 Version 2.4.2.
108 * NEWS (2.4.2): Set version and date. For the recent test suite
109 portability fixes, don't be so optimistic about their success
110 given the lack of feedback on the affected platforms.
111
1122010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
113
114 tests: fix maintainer-xml-check for recent changes.
115 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Use
116 AT_BISON_CHECK_NO_XML rather than AT_BISON_CHECK because an
117 output file whose name conflicts with a previous output file
118 is now never generated.
119
1202010-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
121
122 portability: fix several issues with M4 subprocess.
123
124 M4's output pipe was not being drained upon fatal errors during
125 scan_skel. As a result, broken-pipe messages from M4 were seen
126 on at least AIX, HP-UX, Solaris, and RHEL4, and this caused a
127 failure in the test suite. The problem was that, on platforms
128 where the default disposition for SIGPIPE is ignore instead of
129 terminate, M4 sometimes saw fwrite fail with errno=EPIPE and
130 then reported it. However, there's some sort of race condition,
131 because the new test group occasionally succeeded.
132 Reported by Albert Chin at
133 <http://lists.gnu.org/archive/html/bug-bison/2010-02/msg00004.html>.
134
135 There were also problems with the test suite livelocking on
136 Tru64 5.1b. Reported by Didier Godefroy at
137 <http://lists.gnu.org/archive/html/bug-bison/2009-05/msg00005.html>.
138 Switching to create_pipe_bidi suggested by Akim Demaille.
139
140 To attempt to solve both of these problems, switch to gnulib's
141 create_pipe_bidi and register M4 process as a slave. Along the
142 way, clean up file name conflict handling, which was affected by
143 the broken-pipe problem before the switch.
144 * NEWS (2.4.2): Document.
145 * THANKS (Didier Godefroy): Add.
146 * bootstrap.conf (gnulib_modules): Add pipe.
147 * gnulib: Update to latest to make sure we have all the latest
148 fixes.
149 * lib/local.mk (lib_libbison_a_SOURCES): Remove subpipe.h and
150 subpipe.c.
151 * po/POTFILES.in (lib/subpipe.c): Remove.
152 * src/files.c (compute_output_file_names): Update invocations
153 of output_file_name_check.
154 (output_file_name_check): In the case that the grammar file
155 would be overwritten, use complain instead of fatal, but replace
156 the output file name with /dev/null. Use the /dev/null solution
157 for the case of two conflicting output files as well because it
158 seems safer in case Bison one day tries to open both files at
159 the same time.
160 * src/files.h (output_file_name_check): Update prototype.
161 * src/output.c (output_skeleton): Use create_pipe_bidi and
162 wait_subprocess. Assert that scan_skel completely drains the
163 pipe.
164 * src/scan-skel.l (at_directive_perform): Update
165 output_file_name_check invocation.
166 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): Check that the
167 grammar file actually isn't overwritten.
168 (Conflicting output files: -o foo.y): Update expected output.
169 * tests/skeletons.at (Fatal errors but M4 continues producing
170 output): New test group.
171
1722010-02-04 Joel E. Denny <jdenny@ces.clemson.edu>
173
174 Update POTFILES.
175 * HACKING (Release Procedure): Add reminder about keeping
176 POTFILES files up-to-date.
177 * po/POTFILES.in (src/muscle-tab.c, src/scan-skel.l): Add.
178
1792010-02-01 Joel E. Denny <jdenny@clemson.edu>
180
181 Code cleanup.
182 * tests/atlocal.in (abs_top_srcdir): Remove shell variable,
183 which is already defined in atconfig.
184
1852010-01-22 Joel E. Denny <jdenny@clemson.edu>
186
187 tests: fix missing include caught by g++ 4.4.1.
188 Reported by Tys Lefering.
189 * HACKING (Release checks): Add note about trying a recent GCC.
190 * tests/regression.at (_AT_DATA_DANCER_Y): For C++, include
191 cstdlib for abort.
192 (_AT_DATA_EXPECT2_Y): Likewise.
193
1942010-01-21 Joel E. Denny <jdenny@clemson.edu>
195
196 * cfg.mk (gnulib_dir): Assume gnulib is a subdirectory.
197
1982010-01-21 Joel E. Denny <jdenny@clemson.edu>
199
200 maint: automate PACKAGE_COPYRIGHT_YEAR update, and update it.
201 * HACKING (Release Procedure): Update notes on copyright years.
202 * Makefile.am (update-package-copyright-year): New target rule.
203 * build-aux/update-package-copyright-year: New file.
204 * cfg.mk (update-copyright): Add update-package-copyright-year
205 as a dependency.
206
2072010-01-19 Joel E. Denny <jdenny@clemson.edu>
208
209 * bootstrap: Import improvements from latest gnulib.
210
2112010-01-19 Joel E. Denny <jdenny@clemson.edu>
212
213 build: require Automake 1.11.1 to avoid a security flaw.
214 * HACKING (Release Procedure): Don't document Automake security
215 flaw here.
216 * configure.ac (AM_INIT_AUTOMAKE): Require 1.11.1, and explain
217 why here.
218
2192010-01-19 Joel E. Denny <jdenny@clemson.edu>
220
221 gnulib: update to latest.
222
2232010-01-19 Joel E. Denny <jdenny@clemson.edu>
224
225 ChangeLog (2006-09-15): add Odd Arild Olsen's role for push.c.
226
2272010-01-15 Joel E. Denny <jdenny@clemson.edu>
228
229 Thank the developer of the initial push parser implementation.
230 This unfortunate oversight is several years old.
231 * THANKS (Odd Arild Olsen): Add.
232
2332010-01-04 Joel E. Denny <jdenny@clemson.edu>
234
235 Fix some comments concerning LR(0) versus LALR(1).
236
237 Stop equating LR(0) with nondeterminism and LALR(1) with
238 determinism. That is, if all states are consistent, then LR(0)
239 tables are deterministic. On the other hand, LALR(1) tables
240 might be nondeterministic before conflict resolution, and GLR
241 permits LALR(1) tables to remain nondeterministic.
242 * src/LR0.c, src/LR0.h: Here.
243 * src/lalr.c, src/lalr.h: Here.
244 * src/main.c (main): Here.
245 * src/state.c, src/state.h: Here.
246
247 * src/ielr.h (ielr): In preconditions, expect LR(0) not LALR(1)
248 parser tables.
249
2502010-01-04 Joel E. Denny <jdenny@clemson.edu>
251
252 maint: run "make update-copyright"
253
2542009-12-30 Joel E. Denny <jdenny@clemson.edu>
255
256 POSIX: complain if %prec's token was not defined.
257 * NEWS (2.5): Document.
258 * src/reader.c (grammar_rule_check): Convert warning to
259 complaint.
260 * tests/input.at (%prec's token must be defined): Update.
261
2622009-12-30 Joel E. Denny <jdenny@clemson.edu>
263
264 POSIX: warn if %prec's token was not defined.
265 Reported by Florian Krohm at
266 <http://lists.gnu.org/archive/html/bug-bison/2009-12/msg00005.html>.
267 * NEWS (2.4.2): Document.
268 * src/reader.c (grammar_rule_check): Implement.
269 (grammar_current_rule_prec_set): Add comments explaining that we
270 here assume a %prec identifier is a token, but we still manage
271 to support POSIX.
272 * tests/input.at (%prec's token must be defined): New test
273 group.
274
2752009-12-31 Joel E. Denny <jdenny@clemson.edu>
276
277 * HACKING (Release Procedure): Recommend a secure automake.
278
2792009-12-29 Joel E. Denny <jdenny@clemson.edu>
280
281 portability: `<' and `>' are not always defined on addresses.
282 Specifically, don't sort objects by their memory addresses when
283 they're not allocated in the same array or other object. Though
284 I haven't found a test case where that fails on my platform, C
285 says the behavior is undefined.
286 * src/AnnotationList.c (AnnotationList__insertInto): Remove
287 FIXME. Use new id field of InadequacyList nodes rather than
288 their memory addresses when sorting.
289 (AnnotationList__compute_from_inadequacies): Add
290 inadequacy_list_node_count argument to pass to
291 InadequacyList__new_conflict.
292 * src/AnnotationList.h
293 (AnnotationList__compute_from_inadequacies): Update prototype
294 and documentation for new argument.
295 * src/InadequacyList.c (InadequacyList__new_conflict): Add
296 node_count argument and use it to assign a unique ID.
297 * src/InadequacyList.h (InadequacyListNodeCount): New typedef.
298 (InadequacyList): Add id field.
299 (InadequacyList__new_conflict): Update prototype and
300 documentation for new argument.
301 * src/ielr.c (ielr_compute_annotation_lists): Update
302 AnnotationList__compute_from_inadequacies invocation.
303
3042009-12-20 Joel E. Denny <jdenny@clemson.edu>
305
306 Fix handling of yychar manipulation in user semantic actions.
307 The problem was that yacc.c didn't always update the yychar
308 translation afterwards. However, other skeletons appear to be
309 fine. glr.c appears to already translate yychar before every
310 use. lalr1.cc does not define yychar and does not document its
311 replacement, yyla, for users. It does provide yyclearin, but
312 that does not manipulate yyla and thus requires no translation
313 update. In lalr1.java, yychar is out of scope during semantic
314 actions.
315 * NEWS (2.5): Document.
316 * data/yacc.c (YYBACKUP): Don't bother translating yychar into
317 yytoken here.
318 (yyparse, yypush_parse): Instead, translate before every use of
319 yytoken, and add comments explaining this approach.
320 * tests/actions.at (Destroying lookahead assigned by semantic
321 action): New test group checking that translation happens before
322 lookahead destructor calls at parser return. Previously,
323 incorrect destructors were called.
324 * tests/conflicts.at (parse.error=verbose and consistent
325 errors): New test group checking that translation happens at
326 syntax error detection before the associated verbose error
327 message and the associated lookahead destructor calls. While
328 the destructor call is fixed by this patch, the verbose error
329 message is currently incorrect due to another bug (see
330 comments in test group), so this is an expected failure for now.
331
3322009-12-21 Joel E. Denny <jdenny@clemson.edu>
333
334 YYFAIL: warn about uses and remove from lalr1.java.
335 * NEWS (2.5): Document.
336 * data/lalr1.java (parser::YYStack::YYFAIL): Rename to YYERRLAB,
337 and make it private. Update all uses.
338 * src/scan-code.l (SC_RULE_ACTION): Implement warning.
339
3402009-12-21 Joel E. Denny <jdenny@clemson.edu>
341
342 YYFAIL: deprecate.
343 * NEWS (2.4.2): Document deprecation and the phase-out plan.
344 * data/lalr1.java (parser::YYStack::YYFAIL): Add comment about
345 deprecation.
346 * data/yacc.c (YYFAIL): Likewise, and suppress warnings about
347 YYFAIL from GCC cpp's -Wunused-macros.
348 * doc/bison.texinfo (Java Action Features): Remove YYFAIL
349 documentation.
350 (LocalWords): Remove YYFAIL.
351
3522009-12-20 Joel E. Denny <jdenny@clemson.edu>
353
354 tests: cleanup.
355 * tests/c++.at (Syntax error discarding no lookahead): Don't
356 ignore stderr. Instead, eliminate remaining warnings.
357
3582009-12-18 Joel E. Denny <jdenny@clemson.edu>
359
360 lalr1.cc: don't discard non-existent lookahead on syntax error.
361 * data/lalr1.cc (parser::parse): Check yyempty first.
362 * tests/c++.at (Syntax error discarding no lookahead): New test
363 group.
364
3652009-12-17 Joel E. Denny <jdenny@clemson.edu>
366
367 Code cleanup.
368 * src/symtab.c, src/symtab.h (symbol_class_get_string): Remove
369 function, which is no longer used.
370
3712009-12-16 Joel E. Denny <jdenny@clemson.edu>
372
373 Add gcc's -Wundef to test suite and fix another warning from it.
374 * NEWS (2.4.2): Update description of -Wundef fix.
375 * configure.ac (WARN_CXXFLAGS_TEST): New substitution.
376 (WARN_CFLAGS_TEST): New substitution.
377 * data/glr.c: Avoid warning about __STRICT_ANSI__.
378 * tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
379 WARN_CFLAGS.
380 (NO_WERROR_CFLAGS): Likewise.
381 (CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
382
3832009-12-16 Joel E. Denny <jdenny@clemson.edu>
384
385 * data/yacc.c: Reformat m4 a little.
386
3872009-12-16 Joel E. Denny <jdenny@clemson.edu>
388
389 Document gcc -Wundef fix.
390 * NEWS (2.4.2): Here.
391 * THANKS (Jonathan Nieder): Add.
392
3932009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
394
395 Simplify y.tab.c when location tracking is disabled.
396 * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location
397 tracking is not enabled. Instead, unconditionally define
398 YY_LOCATION_PRINT as a no-op for backward compatibility.
399
4002009-12-15 Jonathan Nieder <jrnieder@gmail.com> (tiny change)
401
402 Avoid warnings from gcc -Wundef y.tab.c.
403 * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
404 defined before using them.
405 * data/lalr1.cc: Likewise.
406 * data/yacc.c: Likewise.
407
4082009-12-15 Joel E. Denny <jdenny@clemson.edu>
409
410 autoconf: update to latest for fix of M4 detection.
411 Reported by Eric Blake.
412 * submodules/autoconf: Update.
413
4142009-12-15 Joel E. Denny <jdenny@clemson.edu>
415
416 portability: use -DGNULIB_POSIXCHECK.
417 Reported by Eric Blake. See discussions at
418 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00008.html>
419 and
420 <http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00108.html>.
421 * HACKING (Release checks): Suggest -DGNULIB_POSIXCHECK.
422 * bootstrap.conf (gnulib_modules): Add all the printf modules
423 suggested by -DGNULIB_POSIXCHECK. Add realloc-posix as
424 suggested by -DGNULIB_POSIXCHECK for gnulib's own vasnprintf.c.
425 (excluded_files): Remove m4/printf-posix.m4.
426 * tests/atlocal.in (LIBS): As for LDADD in src/local.mk, add
427 lib/libbison.a so gnulib libraries can be linked.
428
4292009-12-15 Joel E. Denny <jdenny@clemson.edu>
430
431 gnulib: update for fix of fprintf-posix, which we'll use soon.
432 * etc/prefix-gnulib-mk (prefix): Adjust regex for make file
433 targets so that gnulib's new arg-nonnull.h and link-warning.h
434 are matched.
435 * gnulib: Update.
436
4372009-12-14 Joel E. Denny <jdenny@clemson.edu>
438
439 Enable assertion output and --disable-assert for configure.
440 * bootstrap.conf (gnulib_modules): Add assert module.
441 * src/system.h (aver): Define as assert, and summarize the
442 discussion on this issue.
443
4442009-12-14 Joel E. Denny <jdenny@clemson.edu>
445
446 Expand GLR acronym in summary of Bison.
447 Based on discussion with Akim Demaille starting at
448 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00087.html>.
449 * doc/bison.texinfo (Introduction): Here.
450 * src/getargs.c (usage): Here.
451
4522009-10-03 Alex Rozenman <rozenman@gmail.com>
453
454 Document named references.
455 * doc/bison.texinfo (Actions): Add new example and xref to
456 Using Named References node.
457 (Using Named References): New node.
458
4592009-10-16 Joel E. Denny <jdenny@clemson.edu>
460
461 cleanup.
462 * src/Sbitset.c (Sbitset__new_on_obstack): Use Sbitset instead
463 of char*.
464 (Sbitset__isEmpty): Use Sbitset instead of char*.
465 * src/Sbitset.h (Sbitset): Make it a pointer to unsigned char
466 instead of char. This helps to avoid casting errors.
467 (Sbitset__or): Use Sbitset instead of char*.
468
4692009-10-16 Joel E. Denny <jdenny@clemson.edu>
470
471 portability: don't assume 8-bit bytes.
472 That is, use CHAR_BIT and UCHAR_MAX instead of 8 and 0xff.
473 * src/Sbitset.h (Sbitset__nbytes): Here.
474 (Sbitset__byteAddress): Here.
475 (Sbitset__bit_mask): Here.
476 (Sbitset__last_byte_mask): Here.
477 (Sbitset__ones): Here.
478 (SBITSET__FOR_EACH): Here.
479
4802009-10-11 Joel E. Denny <jdenny@clemson.edu>
481
482 portability: use va_start and va_end in the same function.
483 * src/complain.c (error_message): Move va_end from here...
484 (ERROR_MESSAGE): ... to here.
485
4862009-10-08 Joel E. Denny <jdenny@clemson.edu>
487
488 * data/bison.m4: Update comments for rename to muscle-tab.h.
489
4902009-10-07 Joel E. Denny <jdenny@clemson.edu>
491
492 Minor code cleanup.
493 * src/muscle-tab.c (MUSCLE_USER_NAME_CONVERT): Remove macro and
494 replace all uses with UNIQSTR_CONCAT.
495 * src/uniqstr.c (uniqstr_vsprintf): New function.
496 * src/uniqstr.h (uniqstr_vsprintf): Add prototype.
497 (UNIQSTR_CONCAT, UNIQSTR_GEN_FORMAT, UNIQSTR_GEN_FORMAT_): New
498 macros.
499
5002009-10-06 Joel E. Denny <jdenny@clemson.edu>
501
502 * TODO (Complaint submessage indentation): New.
503
5042009-10-04 Joel E. Denny <jdenny@clemson.edu>
505
506 Minor code cleanup.
507 * src/parse-gram.y: Clean up sorting of declarations.
508 Use types to simplify %printer declarations where possible.
509 Provide %printer for BRACKETED_ID and symbol.prec.
510 * src/symtab.c: Whitespace change.
511
5122009-10-04 Joel E. Denny <jdenny@clemson.edu>
513
514 tests: skip tests of file names that platform does not support.
515 Reported by Michael Raskin at
516 <http://lists.gnu.org/archive/html/bug-bison/2009-09/msg00001.html>.
517 * THANKS (Michael Raskin): Add.
518 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Fix. Cygwin used
519 to fail at least for file names containing ":" or "\".
520
5212009-09-23 Joel E. Denny <jdenny@clemson.edu>
522
523 yysyntax_error: avoid duplicate lookahead collection.
524 Except when memory reallocation is required, this change
525 eliminates the need to invoke yysyntax_error twice and thus to
526 repeat the collection of lookaheads. It also prepares for
527 future extensions that will make those repetitions more
528 expensive and that will require additional memory management in
529 yysyntax_error. Finally, it fixes an obscure bug already
530 exercised in the test suite.
531 * data/yacc.c (yysyntax_error): Add arguments for message
532 buffer variables stored in the parser. Instead of size, return
533 status similar to yyparse status but indicating success of
534 message creation. Other than the actual reallocation of the
535 message buffer, import and clean up memory management code
536 from...
537 (yyparse, yypush_parse): ... here.
538 * tests/regression.at (parse.error=verbose overflow): No longer
539 an expected failure.
540
5412009-09-23 Joel E. Denny <jdenny@clemson.edu>
542
543 yysyntax_error: test memory management more.
544 * tests/atlocal.in (NO_WERROR_CFLAGS): New cpp macro.
545 * tests/regression.at (parse.error=verbose and
546 YYSTACK_USE_ALLOCA): New test group.
547 (parse.error=verbose overflow): New test group that reveals an
548 obscure bug. Expected fail for now.
549
5502009-10-04 Joel E. Denny <jdenny@clemson.edu>
551
552 benchmarks: use %debug consistently among grammars.
553 * etc/bench.pl.in (generate_grammar_triangular): Do not activate
554 %debug by default. It can affect the timings even if yydebug=0.
555 (generate_grammar_calc): For consistency with other grammars,
556 use YYDEBUG environment variable to set yydebug.
557
5582009-10-03 Joel E. Denny <jdenny@clemson.edu>
559
560 Remove dead code.
561 * src/symtab.c (symbol_pack): Here because every symbol's number
562 is always defined by this time.
563
5642009-10-03 Alex Rozenman <rozenman@gmail.com>
565
566 Add additional space after periods in NEWS.
567 * NEWS (2.5): here.
568
5692009-09-29 Joel E. Denny <jdenny@clemson.edu>
570
571 Use the correct conversion specifier for size_t.
572 Reported by Jim Meyering.
573 * src/Sbitset.h (SBITSET__INDEX__CONVERSION_SPEC): New, "zu"
574 because Sbitset__Index is size_t.
575 * src/Sbitset.c (Sbitset__fprint): Use it instead of %d.
576
5772009-09-27 Joel E. Denny <jdenny@clemson.edu>
578
579 tests: don't abuse AT_BISON_CHECK.
580 * tests/regression.at (parse-gram.y: LALR = IELR): Move
581 additional shell commands outside of AT_BISON_CHECK.
582
5832009-09-26 Joel E. Denny <jdenny@clemson.edu>
584
585 tests: check that parse-gram.y's IELR and LALR are identical.
586 * tests/atlocal.in (abs_top_srcdir): New shell variable.
587 * tests/regression.at (parse-gram.y: LALR = IELR): New test
588 group.
589
5902009-09-19 Alex Rozenman <rozenman@gmail.com>
591
592 Keep sub-messages aligned. Fix strings for translation.
593 * src/location.h (location_print): Add return value.
594 * src/location.c (location_print): Return number of printed
595 characters.
596 * src/complain.h (complain_at_indent, warn_at_indent): Prototype
597 new functions.
598 * src/complain.cpp (indent_ptr): New static variable.
599 (error_message, complain_at_indent, warn_at_indent): Implement
600 the alignment mechanism.
601 * src/scan-code.l (parse_ref, show_sub_messages): Fix strings
602 for translations. Use new alignment mechanism.
603 * tests/named-ref.at: Adjust test-cases.
604 * NEWS (2.5): Add an announcement about named references.
605
6062009-09-17 Akim Demaille <demaille@gostai.com>
607
608 doc: fixes.
609 * doc/bison.texinfo: here.
610 Reported by Alex Rozenman.
611
6122009-09-16 Akim Demaille <demaille@gostai.com>
613
614 doc: lalr1.cc and variants.
615 * doc/bison.texinfo (Decl Summary): Document the "lex_symbol" and
616 "variant" %define variables.
617 (C++ Semantic Values): Split into...
618 (C++ Unions, C++ Variants): these.
619 The latter is new.
620 (C++ Parser Interface): Fix type names.
621 Document parser::syntax_error.
622 Document the fact that locations are not mandatory.
623 (C++ Scanner Interface): Split into...
624 (Split Symbols, Complete Symbols): these.
625 The later is new.
626 (Calc++ Parsing Driver): Use variants.
627 Add more comments.
628 Adjust style.
629 (Calc++ Parser): Declare all the tokens, no
630 longer accept raw characters.
631 Remove %union.
632 Adjust types and printers.
633 Remove destructors.
634 (Calc++ Scanner): Use make_<SYMBOL> functions.
635 Use strerror in error message.
636
6372009-09-16 Akim Demaille <demaille@gostai.com>
638
639 doc: spell checking.
640 * doc/bison.texinfo: here.
641
6422009-09-16 Akim Demaille <demaille@gostai.com>
643
644 doc: comment changes.
645 * doc/bison.texinfo: Comment changes.
646
6472009-09-16 Akim Demaille <demaille@gostai.com>
648
649 lalr1.cc: factor the yytranslate_ invocation in make_SYMBOLS.
650 * data/c++.m4, data/lalr1.cc (parser::symbol_type): Change the
651 constructor to take a token_type instead of the (internal) symbol
652 number.
653 Call yytranslate_.
654 * data/variant.hh (b4_symbol_constructor_define_): Therefore,
655 don't call yytranslate_ here.
656
6572009-09-16 Akim Demaille <demaille@gostai.com>
658
659 TODO: statistics.
660 * TODO (Figures): New.
661
6622009-09-13 Joel E. Denny <jdenny@clemson.edu>
663
664 tests: clean up push.at test group titles.
665 * tests/push.at: Remove "Push Parsing: " from test group titles
666 because these are already under the banner "Push Parsing Tests".
667
6682009-09-12 Alex Rozenman <rozenman@gmail.com>
669
670 Provide an additional sub-message for clarity.
671 Add "symbol not found in production" error message when
672 an "invalid reference" is detected in named references
673 resolution.
674 * src/scan-code.l: Update "invalid reference" case.
675 * tests/named-ref.at: Adjust test-cases.
676
6772009-09-10 Joel E. Denny <jdenny@clemson.edu>
678
679 Clean up yacc.c a little.
680 * data/yacc.c: Clean up M4 for readability, and make output
681 whitespace more consistent. For the main parse function
682 comment, instead of saying "yyparse or yypush_parse", say either
683 "yyparse" or "yypush_parse" depending on which it actually is.
684
6852009-09-10 Joel E. Denny <jdenny@clemson.edu>
686
687 Fix --enable-gcc-warnings.
688 * src/parse-gram.y (%printer <param>): Handle param_none.
689
6902009-09-09 Akim Demaille <demaille@gostai.com>
691
692 lalr1.cc: syntax_error as exceptions.
693 It is common to use sort of factories in the user actions. These
694 factories may check some "syntactic" constraints that are not
695 enforced by the grammar itself. This is possible using YYERROR
696 within the action itself. Provide the user with a means to throw
697 a syntax_error exception.
698
699 * data/c++.m4 (b4_public_types_declare, b4_public_types_define):
700 Declare and define yy::parser::syntax_error.
701 * data/lalr1.cc: Include stdexcept.
702 (yy::parser::parse): Wrap the user action within a try/catch.
703 * data/glr.cc: Include stdexcept.
704
7052009-09-09 Akim Demaille <demaille@gostai.com>
706
707 lalr1.cc: add missing "inline".
708 * data/c++.m4 (b4_public_types_define): Add missing inline to
709 implementations provided in headers.
710
7112009-09-09 Akim Demaille <demaille@gostai.com>
712
713 %param: documentation.
714 * NEWS (2.6): Document %param, %lex-param, and %parse-param
715 changes.
716 * doc/bison.texinfo: Document that %lex-param and %parse-param
717 are n-ary.
718 Changes some examples to demonstrate it.
719 (Calc++ Parser): Use %param.
720
7212009-09-09 Akim Demaille <demaille@gostai.com>
722
723 Regen.
724
7252009-09-09 Akim Demaille <demaille@gostai.com>
726
727 style changes.
728 * src/parse-gram.y (add_param): Scope changes.
729
7302009-09-09 Akim Demaille <demaille@gostai.com>
731
732 %parse: support several arguments.
733 * src/parse-gram.y (current_param): New.
734 (param_type): Add param_none.
735 (params): New nonterminal.
736 Use it.
737
7382009-09-09 Akim Demaille <demaille@gostai.com>
739
740 Regen.
741
7422009-09-09 Akim Demaille <demaille@gostai.com>
743
744 %param.
745 Provide a means to factor lex-param and parse-param common
746 declarations.
747
748 * src/parse-gram.y (param_type): New.
749 Define a %printer for it.
750 (add_param): Use it.
751 (%parse-param, %lex-param): Merge into...
752 (%parse): this new token.
753 Adjust the grammar to use it.
754 * src/scan-gram.l (RETURN_VALUE): New.
755 (RETURN_PERCENT_FLAG): Use it.
756 (RETURN_PERCENT_PARAM): New.
757 Use it to support %parse-param, %lex-param and %param.
758
7592009-09-03 Joel E. Denny <jdenny@clemson.edu>
760
761 Use aver not assert.
762 * src/output.c: Don't include assert.h.
763 (output_skeleton): Use aver not assert.
764 * src/system.h (aver): In documentation of why, add links to
765 Paul Eggert's explanations in the mailing lists.
766
7672009-09-05 Alex Rozenman <rozenman@gmail.com>
768
769 Use "Unresolved reference" error message when no symbols were found
770 in a symbolic reference resolution. Remove .expr and -expr from
771 the shown reference when the reference is unresolved.
772 * src/scan-code.l: Change the error message, adjust location columns,
773 rename variable "exact_mode" to "explicit_bracketing".
774 * tests/named-ref.at: Adjust existing tests and add a new one.
775
7762009-09-04 Akim Demaille <demaille@gostai.com>
777
778 Adjust synclines in src/parse-gram.[ch].
779 * tests/bison.in: Do some magic (including working around issues
780 with ylwrap) when this wrapper is used to compile
781 src/parse-gram.y.
782
7832009-09-03 Joel E. Denny <jdenny@clemson.edu>
784
785 Complain about unused %define variables and %code qualifiers.
786 * NEWS (2.5): Document.
787 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
788 * doc/bison.texinfo (Decl Summary): Document complaint, and
789 improve %define documentation a little otherwise.
790 * tests/input.at (Reject unused %code qualifiers): Update.
791 (%define errors): Update.
792 (%define, --define, --force-define): Update.
793 (%define backward compatibility): Update.
794 (Unused %define api.pure): Update.
795 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
796
7972009-09-03 Joel E. Denny <jdenny@clemson.edu>
798
799 Don't suppress warnings about unused parse.error.
800 * data/bison.m4 (b4_error_verbose_flag): Don't examine value of
801 %define variable parse.error unless b4_error_verbose_flag is
802 actually expanded in a skeleton.
803
8042009-09-03 Akim Demaille <demaille@gostai.com>
805
806 * NEWS (2.4.2): Add "Internationalization" item.
807
8082009-09-03 Akim Demaille <demaille@gostai.com>
809
810 bootstrap: fix/improve find_tool.
811 * bootstrap (find_tool): Improve error messages.
812 Fix typo about find_tool_names.
813
8142009-08-29 Joel E. Denny <jdenny@clemson.edu>
815
816 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
817 See
818 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
819 * src/scan-code.h (code_props_rule_action_init): Rename
820 named_ref arg to name so it doesn't shadow named_ref type. This
821 makes it consistent with the function definition in scan-code.l
822 anyway.
823
8242009-08-28 Joel E. Denny <jdenny@clemson.edu>
825
826 %define: accept unquoted values.
827 * NEWS (2.5): Group all %define changes together, and document
828 this one. Remove quotes in IELR and canonical LR entry.
829 * doc/bison.texinfo: Remove quotes in most examples throughout.
830 (Decl Summary): Update %define documentation.
831 (Table of Symbols): Likewise.
832 * src/ielr.c (LrType): Update documentation.
833 * src/parse-gram.y (content.opt): Add production for ID.
834 * tests/actions.at: Remove quotes in most tests.
835 * tests/calc.at: Likewise.
836 * tests/existing.at: Likewise.
837 * tests/input.at: Likewise.
838 * tests/local.at: Likewise.
839 * tests/push.at: Likewise.
840 * tests/reduce.at: Likewise.
841 * tests/torture.at: Likewise.
842
8432009-08-28 Joel E. Denny <jdenny@clemson.edu>
844
845 %define lr.type: make values lowercase IDs.
846 That is, "LALR" => "lalr", "IELR" => "ielr", and
847 "canonical LR" => "canonical-lr".
848 * NEWS (2.5): Update documentation.
849 * doc/bison.texinfo (Decl Summary): Likewise.
850 * src/ielr.c (ielr): Use new values.
851 * src/ielr.h (ielr): Update documentation.
852 * src/reader.c (prepare_percent_define_front_end_variables): Use
853 and validate new values.
854 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
855 grammars.
856 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
857
8582009-08-27 Eric Blake <ebb9@byu.net>
859
860 scan-gram: avoid portability trap with ctype usage.
861 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
862 Avoid compiler warning.
863
8642009-08-27 Joel E. Denny <jdenny@clemson.edu>
865
866 tests: use perl for printing special sequences to files.
867 And skip tests if perl is not available. This is better than
868 playing tricks with shell portability. Suggested by Akim
869 Demaille.
870 * tests/input.at (Bad character literals): Use it here for
871 omitting final newlines.
872 (Bad escapes in literals): Use it here for special characters.
873
8742009-08-26 Joel E. Denny <jdenny@clemson.edu>
875
876 tests: show a use of %define lr.default-reductions "consistent"
877 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
878 prevents the omission of expected tokens for %error-verbose.
879
8802009-08-26 Akim Demaille <demaille@gostai.com>
881
882 tests: portability fix.
883 * tests/input.at (Bad escapes in literals): Don't expect "echo
884 '\0'" to output \ then 0.
885
8862009-08-26 Joel E. Denny <jdenny@clemson.edu>
887
888 Actually handle the yytable zero value correctly this time.
889 * data/bison.m4 (b4_integral_parser_tables_map): Don't mention
890 zero values in the YYTABLE comments.
891 * data/glr.c (yytable_value_is_error): Don't check for zero
892 value.
893 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
894 * data/yacc.c (yytable_value_is_error): Likewise.
895 * data/lalr1.java (yy_table_value_is_error_): Likewise.
896 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
897 * src/tables.h: In header comments, explain why it's useless to
898 check for a zero value in yytable.
899
9002009-08-25 Joel E. Denny <jdenny@clemson.edu>
901
902 More fixes related to last two patches.
903 * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE
904 comments: zero indicates syntax error not default action.
905 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
906 defined.
907 * data/glr.c (yyis_pact_ninf): Rename to...
908 (yypact_value_is_default): ... this.
909 (yyisDefaultedState): Update for rename.
910 (yyis_table_ninf): Rename to...
911 (yytable_value_is_error): ... this, and check for value zero
912 besides just YYTABLE_NINF.
913 (yygetLRActions): Check for default value from yypact. It
914 appears that this check is always performed before this function
915 is invoked, and so adding the check here is probably redundant.
916 However, the code may evolve after this subtlety is forgotten.
917 Also, update for rename to yytable_value_is_error. Because that
918 macro now checks for zero, a different but equivalent branch of
919 the if-then-else here is evaluated.
920 (yyreportSyntaxError): Update for rename to
921 yytable_value_is_error. The zero condition was mishandled
922 before.
923 (yyrecoverSyntaxError): Update for renames. No behavioral
924 changes.
925 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
926 New function.
927 (yy_table_value_is_error_): New function.
928 (parse): Use new functions where possible. No behavioral
929 changes.
930 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
931 The zero condition was mishandled before.
932 * data/yacc.c (yyis_pact_ninf): Rename to...
933 (yypact_value_is_default): ... this.
934 (yyis_table_ninf): Rename to...
935 (yytable_value_is_error): ... this, and check for value zero
936 besides just YYTABLE_NINF.
937 (yysyntax_error): Update for rename to yytable_value_is_error.
938 The zero condition was mishandled before.
939 (yyparse): Update for renames. No behavioral changes.
940 * src/tables.h: Improve comments about yypact, yytable, etc.
941 more. Most importantly, say yytable value of zero means syntax
942 error not default action.
943
9442009-08-25 Joel E. Denny <jdenny@clemson.edu>
945
946 Fix %error-verbose for conflicts resolved by %nonassoc.
947 * NEWS (2.5): Document.
948 * data/glr.c (yyreportSyntaxError): Fix this by checking
949 yyis_table_ninf.
950 * data/yacc.c (yysyntax_error): Likewise.
951 * data/lalr1.cc (yysyntax_error_): Fix this by checking
952 yytable_ninf_.
953 * data/lalr1.java (yysyntax_error): Likewise.
954 * tests/conflicts.at (%nonassoc and eof): Update expected output
955 and remove FIXME.
956
9572009-08-25 Joel E. Denny <jdenny@clemson.edu>
958
959 Some code and documentation improvements.
960 * data/c.m4 (b4_table_value_equals): New macro to capture
961 some repeated code.
962 * data/glr.c (yyis_pact_ninf): Use it here.
963 (yyis_table_ninf): Likewise.
964 (yyreportSyntaxError): Improve internal comments.
965 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
966 Use it everywhere possible.
967 (yyis_table_ninf): Likewise.
968 (yysyntax_error): Improve internal comments.
969 * data/lalr1.cc (yysyntax_error_): Likewise.
970 * data/lalr1.java (yysyntax_error): Likewise.
971 * src/tables.h: Improve comments about yypact, yytable, etc.
972
9732009-08-21 Joel E. Denny <jdenny@clemson.edu>
974
975 Use locale when quoting.
976 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
977 quote rather than implementing quoting here.
978
9792009-08-20 Eric Blake <ebb9@byu.net>
980
981 Make previous patch more robust.
982 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
983 argmatch.h.
984 (output_skeleton): Use it.
985 Suggested by Akim Demaille.
986
987 Import latest m4/m4.m4.
988 * submodules/autoconf: Update to autoconf 2.64.
989 * configure.ac (M4_GNU_OPTION): New define.
990 * src/output.c (output_skeleton): Use it to resolve FIXME.
991 * NEWS: Mention this.
992
9932009-08-19 Joel E. Denny <jdenny@clemson.edu>
994
995 Fix complaints about escape sequences.
996 Discussed starting at
997 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
998 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
999 For a \0 and similar escape sequences meaning the null
1000 character, report an invalid escape sequence instead of an
1001 invalid null character because the latter does not actually
1002 appear in the user's input.
1003 In all escape sequence complaints, don't escape the initial
1004 backslash, and don't quote when the sequence appears at the end
1005 of the complaint line unless there's whitespace that quotearg
1006 won't escape.
1007 Consistently say "invalid" not "unrecognized".
1008 Consistently prefer "empty character literal" over "extra
1009 characters in character literal" warning for invalid escape
1010 sequences; that is, consistently discard those sequences.
1011 * tests/input.at (Bad escapes in literals): New.
1012
10132009-08-19 Akim Demaille <demaille@gostai.com>
1014
1015 doc: fixes.
1016 * doc/bison.texinfo: Fix minor Texinfo errors.
1017
10182009-08-19 Akim Demaille <demaille@gostai.com>
1019
1020 tests: distcc compliance.
1021 * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's
1022 error messages from the output.
1023
10242009-08-19 Akim Demaille <demaille@gostai.com>
1025
1026 variables: simplify the upgrade of namespace into api.namespace.
1027
1028 This patch simplifies "variables: rename namespace as
1029 api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c.
1030 Suggested by Joel E. Denny in
1031 http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html
1032
1033 * src/muscle-tab.c (muscle_percent_variable_update): New.
1034 (muscle_percent_define_insert): Use it in replacement of the
1035 previous tr invocation.
1036 Remove variable_tr, no longer needed.
1037 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1038 Remove.
1039 * data/c++.m4: No longer handle namespace -> api.namespace.
1040 * tests/input.at (%define backward compatibility): Check that
1041 namespace is treated as api.namespace.
1042
10432009-08-19 Akim Demaille <demaille@gostai.com>
1044
1045 doc: %initial-action to initialize yylloc.
1046 Reported by Bill Allombert.
1047 * doc/bison.texinfo: Set fill-column to 76.
1048 (Location Type): Document the use of %initial-action to initialize
1049 yylloc.
1050
10512009-08-19 Akim Demaille <demaille@gostai.com>
1052
1053 lalr1.cc: use state_type.
1054 * data/lalr1.cc (yysyntax_error_): Use state_type.
1055 Move argument names into yy*.
1056
10572009-08-19 Akim Demaille <demaille@gostai.com>
1058
1059 lalr1.cc: get rid of yyparse's yystate.
1060 yystate and yystack_[0].state are equal, keep only the latter.
1061 The former was also used as a temporary variable to compute the
1062 post-reduction state. Move this computation into an auxiliary
1063 function.
1064
1065 * data/glr.c (yyLRgotoState): Fuse variable definition and first
1066 assignment.
1067 * data/lalr1.cc (yy_lr_goto_state_): New.
1068 (yyparse): Use it.
1069 Replace remaining uses of yystate by yystate_[0].state.
1070 Remove the former.
1071
10722009-08-19 Akim Demaille <demaille@gostai.com>
1073
1074 lalr1.cc: destroy $$ when YYERROR is called.
1075 * data/lalr1.cc (yyreduce): Compute the resulting state before
1076 running the user action so that yylhs is a valid symbol.
1077 (yyerrorlab): Since yylhs is complete (it knows its type), we can
1078 simply call yy_destroy_ to destroy $$ on YYERROR invocations.
1079 * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants.
1080
10812009-08-18 Joel E. Denny <jdenny@clemson.edu>
1082
1083 maint: update for gnulib's recent update-copyright changes
1084 * gnulib: Update.
1085 * .x-update-copyright (COPYING): Add as it's no longer implied
1086 when .x-update-copyright is present.
1087 * cfg.mk (update-copyright-local): Remove, now ignored.
1088 (update-copyright): Declare update-b4-copyright as a dependency.
1089
10902009-08-17 Akim Demaille <demaille@gostai.com>
1091
1092 build: require gettext 0.17.
1093
1094 Suggested by Bruno Haible.
1095 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
1096 * configure.ac: require gettext 0.17 to ensure compatibility with
1097 gnulib.
1098
10992009-08-17 Akim Demaille <demaille@gostai.com>
1100
1101 build: lower gettext requirements.
1102
1103 Bison was uselessly requiring the formatstring macros from
1104 gettext, which resulted in mo files not being installed on systems
1105 that perfectly supported Bison mo files. Lower the requirement.
1106 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
1107
1108 * configure.ac: Require need-ngettext instead of
1109 need-formatstring-macros.
1110 Reported by Martin Jabocs.
1111 Suggested by Bruno Haible.
1112 * INSTALL: Restructure.
1113 (Internationalization): New.
1114
11152009-08-14 Joel E. Denny <jdenny@clemson.edu>
1116
1117 maint: fix use of copyright year intervals.
1118 * gnulib: Update.
1119 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
1120 as now recommended in gnulib/NEWS.
1121 * build-aux/update-b4-copyright: Fix.
1122 * cfg.mk (update-copyright-env): Configure update-copyright.
1123
11242009-08-13 Joel E. Denny <jdenny@clemson.edu>
1125
1126 Make it easier to write deterministic tests.
1127 Continues Akim's work from his 2009-06-10 commits.
1128 * src/reader.c (check_and_convert_grammar): Don't add any
1129 symbols after the first symbols_do invocation.
1130 * src/symtab.c (symbols_sorted): New static global.
1131 (user_token_number_redeclaration): Update comments.
1132 (symbol_from_uniqstr): If a new symbol is being created, assert
1133 that symbols_sorted hasn't been allocated yet.
1134 (symbols_free): Free symbols_sorted.
1135 (symbols_cmp, symbols_cmp_qsort): New functions.
1136 (symbols_do): Sort symbol_table into symbols_sorted on first
1137 invocation.
1138 * tests/input.at (Numbered tokens): Recombine tests now that the
1139 output should be deterministic across multiple numbers.
1140
11412009-08-12 Akim Demaille <demaille@gostai.com>
1142
1143 tests: GCC 4.5 compliance.
1144 * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's
1145 messages about #error.
1146
11472009-08-12 Akim Demaille <demaille@gostai.com>
1148
1149 build: fix the generation of the documentation.
1150 Some of our targets use "bison --help", but they can't depend on
1151 "bison" itself (to avoid additional requirements on the user), so
1152 they used to call "make src/bison" in the commands. Then
1153 concurrent builds may fail: one make might be aiming one of its
1154 jobs at compiling src/bison, and another job at generating the man
1155 page. If the latter is faster than the former, then we have two
1156 makes that concurrently try to compile src/bison.
1157
1158 This might also be a more convincing explanation for the failure
1159 described in the patch "build: fix paths".
1160
1161 * Makefile.am (SUFFIXES): Initialize.
1162 * build-aux/move-if-change: New, symlink to gnulib's.
1163 * build-aux/local.mk: Ship it.
1164 * doc/common.x: Remove, merged into...
1165 * doc/bison.x: here.
1166 * doc/local.mk (doc/bison.help): New.
1167 ($(CROSS_OPTIONS_TEXI)): Depend on it.
1168 Use src/bison.
1169 (.x.1): Replace with...
1170 (doc/bison.1): this explicit, simpler, target.
1171 (common_dep): Remove, inlined where appropriate.
1172 (SUFFIXES, PREPATH): Remove, unused.
1173
11742009-08-12 Akim Demaille <demaille@gostai.com>
1175
1176 gnulib: improve prefixing.
1177 * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather,
1178 change the value of...
1179 (gl_LIBOBJS): this.
1180 Adjust more variables.
1181 * etc/prefix-gnulib-mk (prefix_assignment): Don't rename
1182 gl_LIBOBJS.
1183 (prefix): Also transform rules whose targets have slashes.
1184 Use $prefix liberally.
1185 Map @MKDIR_P@ to $(MKDIR_P).
1186 Prefix directories that are mkdir'd.
1187
11882009-08-12 Akim Demaille <demaille@gostai.com>
1189
1190 build: fix paths.
1191 When using $(top_builddir) inconsistently, Make (including GNU
1192 Make) is sometimes confused. As a result it may want to build
1193 lib/libbison.la and $(top_builddir)/lib/libbison.la (the same
1194 file, different names) concurrently, which, amusingly enough,
1195 might end with:
1196
1197 ranlib lib/libbison.a
1198 ranlib lib/libbison.a
1199 make[2]: *** [lib/libbison.a] Segmentation fault
1200
1201 on OS X.
1202
1203 * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not
1204 needed.
1205
12062009-08-12 Akim Demaille <demaille@gostai.com>
1207
1208 distcheck: fix.
1209
1210 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
1211
12122009-08-10 Joel E. Denny <jdenny@clemson.edu>
1213
1214 * tests/local.mk (TESTSUITE_AT): Add named-refs.at.
1215
12162009-08-10 Joel E. Denny <jdenny@clemson.edu>
1217
1218 Miscellaneous code readability improvements.
1219
1220 * src/reader.c (reader): Move %define front-end variable
1221 defaults and checking into...
1222 (prepare_percent_define_front_end_variables): ... this new
1223 function.
1224
1225 * src/scan-gram.l (INITIAL): For consistency with string
1226 literals, don't store open quote on character literal. It's
1227 discarded before returning anyway.
1228 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
1229 Make length test more readable, and make the character stored
1230 for an empty literal more obvious while consistent with the
1231 previous behavior.
1232
1233 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
1234 USER_NUMBER_HAS_STRING_ALIAS throughout.
1235 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
1236 that is repeated in symtab.h. Improve argument names to make it
1237 clear which side of the symbol-string alias pair is which.
1238 (symbol_check_alias_consistency): Improve local variable names
1239 for the same purpose.
1240 * src/symtab.h (struct symbol): Make comments about aliases
1241 clearer.
1242 (symbol_make_alias): Improve comments and argument name.
1243 * src/output.c (token_definitions_output): Update for rename to
1244 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
1245
12462009-08-08 Alex Rozenman <rozenman@gmail.com>
1247
1248 Convert "misleading reference" messages to warnings.
1249 * src/scan-code.l: New function 'show_sub_messages', more
1250 factoring.
1251 * tests/named-ref.at: Adjust tests.
1252
12532009-08-06 Joel E. Denny <jdenny@clemson.edu>
1254
1255 maint: run "make update-copyright"
1256
12572009-08-06 Joel E. Denny <jdenny@clemson.edu>
1258
1259 maint: make update-b4-copyright easier to use
1260 * build-aux/update-b4-copyright: In warnings, report line
1261 numbers rather than character positions.
1262 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
1263 that update-copyright runs it.
1264 * gnulib: Update.
1265
12662009-08-05 Joel E. Denny <jdenny@clemson.edu>
1267
1268 maint: clean up update-b4-copyright code
1269 * build-aux/update-b4-copyright: Do not accept 2-digit
1270 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
1271 Don't accept a `[' in a b4_copyright argument.
1272 Format code more consistently.
1273 Don't assume b4*copyright never occurs.
1274
12752009-08-04 Joel E. Denny <jdenny@clemson.edu>
1276
1277 maint: automate b4_copyright updates.
1278 * Makefile.am (update-b4-copyright): New target rule.
1279 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
1280 * build-aux/update-b4-copyright: New.
1281 * data/yacc.c: Remove stray characters around b4_copyright
1282 invocations.
1283
12842009-08-04 Joel E. Denny <jdenny@clemson.edu>
1285
1286 maint: automate annual package-wide copyright-year update.
1287 * .x-update-copyright: New.
1288 * Makefile.am (EXTRA_DIST): Remove maint.mk.
1289 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
1290 update-copyright. Remove gnumakefile, which is implied by
1291 maintainer-makefile.
1292 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
1293 * gnulib: Update.
1294 * maint.mk: Remove, now copied from gnulib.
1295 * examples/extexi: Add missing "(C)" in copyright statement so
1296 update-copyright can recognize it.
1297 * src/LR0.h: Likewise.
1298 * src/print.h: Likewise.
1299 * src/print_graph.h: Likewise.
1300 * src/gram.c: Add missing comma in copyright statement.
1301 * src/gram.h: Likewise.
1302
13032009-08-04 Joel E. Denny <jdenny@clemson.edu>
1304
1305 Fix "make distcheck".
1306 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
1307 of just calc.stamp.
1308
13092009-08-01 Joel E. Denny <jdenny@clemson.edu>
1310
1311 Pacify "gcc -Wunused" for the input function from Flex.
1312 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
1313 and later.
1314 * src/scan-code.l: Add "%option noinput", which I cannot find in
1315 the Flex manual, but which Flex has supported since at least as
1316 far back as 2.5.4. However, if any of our developers still use
1317 Flex 2.5.4, they'll need to stop configuring with
1318 --enable-gcc-warnings because "%option noinput" didn't work
1319 correctly until Flex 2.5.6.
1320 * src/scan-gram.l: Likewise.
1321 * src/scan-skel.l: Likewise.
1322
13232009-07-31 Alex Rozenman <rozenman@gmail.com>
1324
1325 Fix --enable-gcc-warnings problems.
1326 * src/reader.c: Adjust variable names.
1327 * src/scan-code.l: Fix prototypes and adjust names.
1328 * src/named-ref.c: Remove redundant "if".
1329
13302009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1331
1332 Fix a --enable-gcc-warnings problem.
1333 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
1334 variable.
1335
13362009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1337
1338 Warn about character literals not of length one.
1339 * NEWS (2.5): Document.
1340 * src/scan-gram.l (INITIAL): Remove comment that we don't check
1341 the length.
1342 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
1343 * tests/input.at (Bad character literals): New test group.
1344
13452009-07-24 Alex Rozenman <rozenman@gmail.com>
1346
1347 Fix some memory leaks.
1348 * src/named-ref.c: Add a pointer check (named_ref_free).
1349 * src/scan-code.l: New function (variant_table_free). Called in
1350 code_scanner_free.
1351 * src/symlist.c: Call to named_ref_free (symbol_list_free).
1352
13532009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
1354
1355 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
1356
13572009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
1358
1359 Some M4 cleanup in the testsuite.
1360 Suggested by Eric Blake at
1361 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
1362 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
1363 complicate the code by distinguishing between a missing value
1364 and an empty string value for an optional argument. This fix is
1365 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
1366 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
1367 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
1368 arguments are not needed because of the following changes.
1369 Fix stale comments.
1370 Bison developers should use GNU M4 and should not use
1371 POSIXLY_CORRECT when building the test suite, so do not
1372 complicate the code by avoiding $10 and above.
1373 Do not quote an empty string value for an optional argument, and
1374 do not distinguish between a missing value and an empty string
1375 value.
1376
13772009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
1378
1379 Revert unnecessary column realignment in --help output.
1380 Reported by Akim Demaille at
1381 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
1382 * src/getargs.c (usage): Here.
1383
13842009-07-04 Alex Rozenman <rozenman@gmail.com>
1385
1386 Alphabetical order in src/local.mk.
1387 * src/local.mk: Adjust.
1388
13892009-07-04 Alex Rozenman <rozenman@gmail.com>
1390
1391 Style changes and factoring.
1392 * src/named-ref.h: Add comments.
1393 * src/parse-gram.y: Readability and style changes.
1394 * src/reader.c: Factoring: assign_named_ref function.
1395 * src/scan-code.l: Factoring and style changes. Rename
1396 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
1397 Use "unsigned" type for variant index. Improve readablity.
1398 * src/scan-gram.l: Change error messages and add comments.
1399 * src/symlist.h: symbol_list_null: New function decl.
1400 * src/symlist.c: symbol_list_null: Implement here.
1401 * tests/named-refs.at: Adjust for new error messages.
1402
14032009-06-29 Eric Blake <ebb9@byu.net>
1404
1405 scan-code: avoid compiler warnings
1406 * src/scan-code.l (parse_named_ref): Use correct specifiers.
1407
14082009-06-29 Akim Demaille <demaille@gostai.com>
1409
1410 build: avoid concurrent extraction of calc++.
1411 * examples/calc++/Makefile.am (calc.stamp): New.
1412 Depend on it to create the sources of calc++ so that concurrent
1413 builds don't launch several "extexi" in parallel.
1414 Not only this is inefficient, this also builds incorrect sources
1415 with several extractions mixed together.
1416
14172009-06-29 Akim Demaille <demaille@gostai.com>
1418
1419 parse.error: fix.
1420 * data/bison.m4: Move code related to specific variables after the
1421 definition of the variable-maintaining macros so that we don't
1422 "invoke" b4_percent_define_check_values before it is defined.
1423
14242009-06-29 Akim Demaille <demaille@gostai.com>
1425
1426 variables: parse.error
1427
1428 Implement, document, and test the replacement of %error-verbose
1429 by %define parse.error "verbose".
1430 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
1431 values of the parse.error variable.
1432 Make "simple" its default value.
1433 Check the valid values.
1434 * src/parse-gram.y: Use %define parse.error.
1435 (PERCENT_ERROR_VERBOSE): New token.
1436 Support it.
1437 * src/scan-gram.l: Support %error-verbose.
1438
1439 * doc/bison.texinfo (Decl Summary): Replace the documentation of
1440 %define error-verbose by that of %define parse.error.
1441 * NEWS: Document it.
1442
1443 * tests/actions.at, tests/calc.at: Use parse.error instead of
1444 %error-verbose.
1445
14462009-06-27 Alex Rozenman <rozenman@gmail.com>
1447
1448 Implement support for named symbol references.
1449 * src/parse-gram.y: Add new syntax (named_ref.opt).
1450 * src/reader.c: Store named refs in symbol lists.
1451 * src/reader.h: New argument for symbol_append and
1452 action_append functions.
1453 * src/scan-code.h: Add new field (named_ref) into
1454 code_props data structure. Keeps named ref of midrule
1455 actions.
1456 * src/scan-code.l: Support for named refs in semantic
1457 action code. New function 'parse_named_ref'.
1458 * src/scan-gram.l: Support bracketed id.
1459 * src/symlist.c: Store named refs in symbol lists.
1460 * src/symlist.h: New field in symbol list: named_ref.
1461 * src/named-ref.h: New file, a struct for named_ref.
1462 * src/named-ref.cp: New file, named_ref_new function.
1463 * src/local.mk: Add two new files.
1464 * tests/testsuite.at: Include new test group:
1465 * tests/named-refs.at: this new file.
1466
14672009-06-25 Akim Demaille <demaille@gostai.com>
1468
1469 hash: check insertion for memory exhaustion.
1470 * src/uniqstr.c (uniqstr_new): New.
1471
14722009-06-24 Akim Demaille <demaille@gostai.com>
1473
1474 variables: rename namespace as api.namespace.
1475 Discussed in
1476 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
1477
1478 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
1479 New.
1480 (b4_percent_define_use): New.
1481 Use it where applicable.
1482 * data/c++.m4: Replace uses of the variable "namespace" by
1483 "api.namespace".
1484 Default the latter to the former.
1485 * doc/bison.texinfo (Decl Summary): Document "namespace" as
1486 obsolete.
1487 Document api.namespace.
1488 Use @samp to document %define uses, keep @code for identifiers.
1489 * NEWS: Likewise.
1490 * tests/c++.at, tests/input.at: Test api.namespace instead of
1491 namespace. (The tests passed with namespace.)
1492
14932009-06-11 Akim Demaille <demaille@gostai.com>
1494
1495 style changes.
1496 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
1497 * src/print-xml.c: Style changes.
1498 * tests/conflicts.at: Comment changes.
1499
15002009-06-11 Akim Demaille <demaille@gostai.com>
1501
1502 xml: beware of user strings used to give a %prec to rules.
1503 * tests/conflicts.at (%prec with user strings): New.
1504 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
1505 XML output.
1506
15072009-06-11 Akim Demaille <demaille@gostai.com>
1508
1509 hash: check insertion for memory exhaustion.
1510 * src/muscle-tab.c (muscle_insert, muscle_grow)
1511 * src/state.c (state_hash_insert): Check the return value of
1512 hash_insert.
1513
15142009-06-11 Akim Demaille <demaille@gostai.com>
1515
1516 tests: honor TESTSUITEFLAGS in every check target.
1517 * tests/local.mk (RUN_TESTSUITE): New.
1518 (check-local, installcheck-local, maintainer-check-g++)
1519 (maintainer-check-posix, maintainer-check-valgrind): Use it.
1520
15212009-06-10 Akim Demaille <demaille@gostai.com>
1522
1523 deterministic test suite.
1524 Some consistency checks on symbols are performed after all the
1525 symbols were read, by an iteration over the symbol table. This
1526 traversal is nondeterministic, which can be a problem for test
1527 cases.
1528 Avoid this.
1529 Addresses another form of nondeterminism reported by Joel E. Denny.
1530 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1531
1532 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
1533 test in two.
1534 Use different file names for the three tests to make the
1535 maintenance easier.
1536
15372009-06-10 Akim Demaille <demaille@gostai.com>
1538
1539 gnulib: update.
1540 * gnulib: Update to latest.
1541 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
1542 * m4/.gitignore: Regen.
1543 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
1544 Call xalloc_die on hash_insert failures.
1545 Requested by the new __warn_unused_result__ attribute of
1546 hash_insert.
1547
15482009-06-10 Akim Demaille <demaille@gostai.com>
1549
1550 deterministic user-token-number redeclaration errors.
1551 Address nondeterminism reported by Joel E. Denny.
1552 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
1553
1554 * src/uniqstr.h: Comment changes.
1555 * src/location.h (boundary_cmp, location_cmp): New.
1556 * src/symtab.c (user_token_number_redeclaration): New.
1557 (symbol_translation): Use it.
1558 * tests/input.at (Numbered tokens): Adjust the expected output.
1559
15602009-05-25 Akim Demaille <demaille@gostai.com>
1561
1562 build: avoid ignored errors.
1563 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
1564 errors, they pollute the output.
1565
15662009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1567
1568 Convert multiple variable definition warnings to complaints.
1569 * NEWS (2.5): Add a new entry for that change.
1570 * doc/bison.texinfo (Decl Summary): Update %define entry.
1571 (Bison Options): Update -D/--define/-F/--force-define entry.
1572 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
1573 * src/muscle-tab.h (muscle_percent_define_insert): Update
1574 comments.
1575 * tests/input.at (`%define errors'): Update.
1576 (`%define, --define, --force-define'): Update.
1577
15782009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1579
1580 -F/--force-define and relative %define/-D/--define priorities.
1581 * NEWS (2.5): Add documentation to -D/--define entry.
1582 * build-aux/cross-options.pl: Hard-code association of
1583 --force-define with %define.
1584 * doc/bison.texinfo (Decl Summary): In %define entry,
1585 cross-reference command-line options.
1586 (Bison Options): Add documentation to -D/--define entry.
1587 (Option Cross Key): Widen column for --force-define row.
1588 * src/getargs.c (usage): Document -F/--force-define. Realign
1589 options in output.
1590 (short_options, long_options, getargs): Parse -F/--force-define,
1591 and update muscle_percent_define_insert invocations.
1592 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
1593 (muscle_percent_define_insert): Add argument with that type.
1594 * src/muscle-tab.c (muscle_percent_define_insert): Implement
1595 -F/--force-define behavior and priorities.
1596 (muscle_percent_define_ensure): Update
1597 muscle_percent_define_insert invocation.
1598 * src/parse-gram.y (prologue_declaration): Update
1599 muscle_percent_define_insert invocations.
1600 * tests/input.at (`%define, --define'): Rename to...
1601 (`%define, --define, --force-define'): ... this and extend.
1602
16032009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
1604
1605 Update some comments to make sense for -D.
1606 * data/bison.m4 (b4_check_user_names): In header comments, say
1607 "user occurrence" instead of "grammar occurrence".
1608 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
1609 (muscle_percent_code_grow): Likewise just for consistency.
1610
16112009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1612
1613 * data/c++.m4 (b4_namespace_close): Simplify slightly.
1614
16152009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
1616
1617 Handle a trailing `:' in a user-supplied C++ namespace better.
1618 * data/c++.m4 (b4_namespace_close): Don't let it be printed
1619 among the closing braces here. This fix might make the
1620 generated code easier to debug, but otherwise it should be
1621 insignificant because a trailing `:' is a C++ error already.
1622
16232009-05-19 Akim Demaille <demaille@gostai.com>
1624
1625 remove useless variable.
1626 * src/getargs.c (skeleton_arg): Remove now useless variable.
1627 Should help the compiler see that this printf-like call is sane.
1628
16292009-05-15 Akim Demaille <demaille@gostai.com>
1630
1631 Rename token.prefix as api.tokens.prefix.
1632 Discussed here.
1633 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
1634
1635 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
1636 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
1637 (token.prefix): Rename as...
1638 (api.tokens.prefix): this.
1639
16402009-05-11 Akim Demaille <demaille@gostai.com>
1641
1642 doc: use C++ headers.
1643 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
1644 headers.
1645
16462009-05-11 Akim Demaille <demaille@gostai.com>
1647
1648 doc: token.prefix
1649 * doc/bison.simple (Decl Summary): Document token.prefix.
1650 (Calc++ Parser): Various fixes.
1651 Formatting changes.
1652 Use token.prefix.
1653 Introduce a macro TOKEN to shorten the code and make it more
1654 readable.
1655 (Calc++ Scanner): Adjust.
1656 * NEWS (Variable token.prefix): New.
1657
16582009-05-04 Akim Demaille <demaille@gostai.com>
1659
1660 bison: catch bad symbol names.
1661 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
1662 * tests/input.at: Adjust.
1663
16642009-05-04 Akim Demaille <demaille@gostai.com>
1665
1666 identifiers: dashes are letters.
1667 Dashes can now start identifiers (symbols and directives).
1668
1669 * src/scan-gram.l ({letter}): Add dash.
1670 ({id}): Remove it.
1671 * tests/input.at (Symbols): Adjust.
1672 Remove stray comment.
1673 * tests/regression.at (Invalid inputs): Adjust error message.
1674 * doc/bison.texinfo (Symbols): Update.
1675
16762009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
1677
1678 Declare %code to be a permanent feature.
1679 * NEWS (2.4.2): Here.
1680 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
1681 experimental.
1682 (Decl Summary): Likewise.
1683
16842009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1685
1686 Convert underscores to dashes in some %define variable names.
1687 For now, just api.push-pull and lr.keep-unreachable-states.
1688 Maintain old names for backward compatibility.
1689 * NEWS (2.5): Document.
1690 * data/c.m4 (b4_identification): Update comment.
1691 * data/yacc.c: Update access.
1692 * doc/bison.texinfo: Update.
1693 * etc/bench.pl.in (bench_push_parser): Update use.
1694 * src/files.c (tr): Move to...
1695 * src/getargs.c, src/getargs.h (tr): ... here because I can't
1696 think of a better place to expose it. My logic is that, for all
1697 uses of tr so far, command-line arguments can be involved, and
1698 getargs.h is already included.
1699 * src/main.c (main): Update access.
1700 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
1701 variable names to new variable names before assigning value.
1702 * src/reader.c (reader): Update setting default.
1703 * tests/calc.at: Update uses.
1704 * tests/conflicts.at (Unreachable States After Conflict
1705 Resolution): Update use.
1706 * tests/input.at (%define enum variables): Update use.
1707 (%define backward compatibility): New test group.
1708 * tests/push.at: Update uses.
1709 * tests/reduce.at: Update uses.
1710 * tests/torture.at: Update uses.
1711
17122009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
1713
1714 Set all front-end %define defaults in one place.
1715 * src/main.c (main): Move lr.keep_unreachable_states default...
1716 * src/reader.c (reader): ... to here.
1717
17182009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1719
1720 Rename lr.default_reductions to lr.default-reductions.
1721 * NEWS (2.5): Here.
1722 * doc/bison.texinfo: Here.
1723 * src/lalr.c (initialize_LA): Here.
1724 * src/print.c (print_reductions): Here.
1725 * src/reader.c (reader): Here.
1726 * src/tables.c (action_row): Here.
1727 * tests/input.at (%define enum variables): Here.
1728 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
1729
17302009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1731
1732 Pacify ./configure --enable-gcc-warnings.
1733 * tests/input.at (Symbols): Prototype yyerror and yylex.
1734
17352009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1736
1737 Document how `%define "var" "value"' is not M4-friendly.
1738 * src/parse-gram.y (variable): In comments here.
1739
17402009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1741
1742 Clean up recent patches a little.
1743 Reported by Akim Demaille.
1744 * doc/bison.texinfo (Understanding): Fix typos.
1745 * src/print.c (print_reductions): Don't use negated variable.
1746
17472009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1748
1749 List accepted values for a %define enum variable with an invalid value.
1750 Suggested by Akim Demaille at
1751 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
1752 * data/bison.m4 (_b4_percent_define_check_values): Implement.
1753 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
1754 * tests/input.at (%define lr.default_reductions invalid values): Merge
1755 into...
1756 (%define enum variables): ... here, and update output.
1757
17582009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
1759
1760 Rename "default rule" to "default reduction".
1761 This includes changing variable names in code, changing
1762 comments, and renaming %define lr.default_rules to %define
1763 lr.default_reductions.
1764 * NEWS (2.5): Update IELR documentation.
1765 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
1766 documentation.
1767 * data/glr.c, data/lalr1.java: Sync copyright dates.
1768 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
1769 and lr.type documentation. Make some other wording
1770 improvements.
1771 (Glossary): Adjust cross-references and Default Reduction
1772 definition.
1773 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
1774 Remove a confusing comment pointed out by Akim Demaille.
1775 (initialize_LA): Adjust code.
1776 * src/print-xml.c (print_reductions): Adjust code.
1777 * src/print.c (print_reductions): Adjust code.
1778 * src/reader.c (reader): Adjust code.
1779 * src/tables.c (action_row): Adjust code.
1780 (token_actions): Adjust code.
1781 * src/tables.h: Adjust YYDEFACT documentation.
1782 * tests/input.at (%define lr.default_rules invalid values):
1783 Rename test group to...
1784 (%define lr.default_reductions invalid values): ... this, and
1785 update grammar file and expected output.
1786 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
1787 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
1788
17892009-04-21 Akim Demaille <demaille@gostai.com>
1790
1791 tests: check the use of dashes and periods in symbols.
1792 * tests/input.at (Symbol): New test group.
1793
17942009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1795
1796 Document %define lr.type and lr.default_rules.
1797 * NEWS (2.5): Add an entry.
1798 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
1799 besides just LALR(1) and GLR(1).
1800 * doc/bison.texinfo (Introduction): Likewise.
1801 (Language and Grammar): Bison is no longer limited to LALR(1)
1802 restrictions.
1803 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
1804 when trying to distinguish from GLR. Talk about LR(1) grammars
1805 rather than LALR(1) grammars.
1806 (Decl Summary): In %define api.push_pull entry, say it applies
1807 to deterministic parsers in C rather than LALR(1) parsers in C.
1808 Add lr.default_rules entry.
1809 Add lr.type entry.
1810 (Mystery Conflicts): Bison is no longer limited to LALR(1)
1811 restrictions.
1812 (Generalized LR Parsing): Same changes as for the previous GLR
1813 section.
1814 (Memory Management): Say deterministic rather than LALR(1).
1815 (Understanding): Correct some bison output.
1816 Index discussion of "accepting state".
1817 Say deterministic rather than LALR(1).
1818 (Bison Options): In --yacc entry, say deterministic rather than
1819 LALR(1).
1820 In --report, --graph, and --xml entries, just don't mention
1821 LALR(1).
1822 (C++ Parsers): Say deterministic rather than LALR(1).
1823 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
1824 (Glossary): Add Accepting State, Consistent State, Default Rule,
1825 and IELR(1) definitions.
1826 In Generalized LR (GLR) definition, make same changes as in
1827 previous GLR sections.
1828 In LALR(1) definition, say Bison uses LALR(1) by default rather
1829 than implying Bison is limited to LALR(1).
1830 (LocalWords): Add IELR.
1831
18322009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1833
1834 Finish implementing %define lr.type.
1835 Its value can be "LALR", "IELR", or "canonical LR".
1836 * lib/timevar.def (TV_IELR_PHASE1): New var.
1837 (TV_IELR_PHASE2): New var.
1838 (TV_IELR_PHASE3): New var.
1839 (TV_IELR_PHASE4): New var.
1840 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
1841 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
1842 Sbitset.h, ielr.h, and ielr.c.
1843 * src/getargs.h, src/getargs.c (enum trace, trace_args,
1844 trace_types): Add trace_ielr.
1845 * src/lalr.h, src/lalr.c (ngotos): Export it.
1846 (F): Rename to...
1847 (goto_follows): ... this, update all uses, and export it.
1848 (set_goto_map): Export it.
1849 (map_goto): Export it.
1850 (compute_lookahead_tokens): Don't free goto_follows yet. Now
1851 handled in ielr.
1852 (initialize_LA): Export it. Move lookback allocation to...
1853 (lalr): ... here because, for canonical LR, initialize_LA must
1854 be invoked but lookback and much of the rest of LALR isn't
1855 needed.
1856 * main.c (main): Instead of lalr, invoke ielr, which invokes
1857 lalr.
1858 * src/reader.c (reader): Default lr.type to "LALR".
1859 Default lr.default_rules to "accepting" if lr.type is "canonical
1860 LR". Leave the default as "all" otherwise.
1861 Check for a valid lr.type value.
1862 * src/state.h, src/state.c (struct state_list): Add state_list
1863 member.
1864 (state_new): Initialize state_list member to NULL.
1865 (state_new_isocore): New function, exported.
1866 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
1867 exercises all values of lr.type.
1868 (GNU AWK Grammar): Rename test group to...
1869 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
1870 AT_TEST_EXISTING_GRAMMAR.
1871 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
1872 (GNU pic Grammar): Rename test group to...
1873 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
1874 AT_TEST_EXISTING_GRAMMAR.
1875 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
1876 all values of lr.type.
1877 (Single State Split): New test groups using AT_TEST_LR_TYPE.
1878 (Lane Split): Likewise.
1879 (Complex Lane Split): Likewise.
1880 (Split During Added Lookahead Propagation): Likewise.
1881
18822009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1883
1884 Add new files for IELR and canonical LR implementation.
1885 * src/AnnotationList.c: New.
1886 * src/AnnotationList.h: New.
1887 * src/InadequacyList.c: New.
1888 * src/InadequacyList.h: New.
1889 * src/Sbitset.c: New.
1890 * src/Sbitset.h: New.
1891 * src/ielr.c: New.
1892 * src/ielr.h: New.
1893
18942009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1895
1896 Implement %define lr.default_rules.
1897 Its value describes the states that are permitted to contain
1898 default rules: "all", "consistent", or "accepting".
1899 * src/reader.c (reader): Default lr.default_rules to "all".
1900 Check for a valid lr.default_rules value.
1901 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
1902 is "accepting", then only mark the accepting state as
1903 consistent.
1904 (initialize_LA): Tell state_lookahead_tokens_count whether
1905 lr.default_rules is "accepting".
1906 * src/tables.c (action_row): If lr.default_rules is not "all",
1907 then disable default rules in inconsistent states.
1908 * src/print.c (print_reductions): Use this opportunity to
1909 perform some assertions about whether lr.default_rules was
1910 obeyed correctly.
1911 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
1912 helps with checking the parser tables for a grammar.
1913 * tests/input.at (%define lr.default_rules invalid values): New
1914 test group.
1915 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
1916 AT_TEST_TABLES_AND_PARSE.
1917 (`no %define lr.default_rules'): New test group generated by
1918 AT_TEST_LR_DEFAULT_RULES.
1919 (`%define lr.default_rules "all"'): Likewise.
1920 (`%define lr.default_rules "consistent"'): Likewise.
1921 (`%define lr.default_rules "accepting"'): Likewise.
1922
19232009-04-20 Akim Demaille <demaille@gostai.com>
1924
1925 Formatting change.
1926
19272009-04-20 Akim Demaille <demaille@gostai.com>
1928
1929 bison: factoring.
1930 * src/output.c (token_definitions_output): Use symbol_id_get
1931 instead of duplicating its logic.
1932 * TODO (YYERRCODE): Extend.
1933
19342009-04-20 Akim Demaille <demaille@gostai.com>
1935
1936 variables: prefer error-verbose to error_verbose.
1937 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
1938 instead of error_verbose.
1939 * src/scan-gram.l (%error-verbose): Map to the error-verbose
1940 variable.
1941 * doc/bison.texinfo: Promote %define error-verbose instead of
1942 %error-verbose.
1943 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
1944
19452009-04-15 Akim Demaille <demaille@gostai.com>
1946
1947 variables: accept dashes.
1948 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
1949 underscores.
1950 * src/scan-gram.l ({id}): Also accept dashes after the initial
1951 letter.
1952 ({directive}): Use {id}.
1953 * src/parse-gram.y: Comment and formatting changes.
1954 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
1955 symbols.
1956 * src/complain.h, src/complain.c (yacc_at): New.
1957 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
1958 symbol names.
1959 * src/output.c (token_definitions_output): Do not #define token
1960 names with dashes.
1961
19622009-04-20 Akim Demaille <demaille@gostai.com>
1963
1964 Consistently refer to Yacc, not YACC.
1965 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
1966
19672009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
1968
1969 Pacify make maintainer-check-posix.
1970 * tests/input.at (%define, --define): Move bison command-line
1971 options before grammar file name.
1972
19732009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1974
1975 Document semicolon warnings.
1976 * NEWS (2.5): Here.
1977
19782009-04-14 Akim Demaille <demaille@gostai.com>
1979
1980 variables: use `parse.assert' instead of `assert'.
1981 * TODO (assert): Remove.
1982 * data/bison.m4 (b4_assert_if): Replace with...
1983 (b4_parse_assert_if): this.
1984 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
1985 * doc/bison.texinfo (Decl Summary): Document parse.assert.
1986
19872009-04-14 Akim Demaille <demaille@gostai.com>
1988
1989 variables: use `parse.trace' instead of `debug'.
1990 * src/getargs.c (getargs): Map -t to %define trace.parse.
1991 * src/scan-gram.l (%debug): Map to %define trace.parse.
1992 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
1993 names to `_' in macro names.
1994 (b4_debug_if): Replace with...
1995 (b4_parse_trace_if): this.
1996 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1997 * data/yacc.c: Adjust.
1998 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
1999 Use @code to label the variable list.
2000 Document the variable parse.trace.
2001 (Tracing): Promote the parse.trace variable.
2002 * TODO: %printer is not documented.
2003
20042009-04-14 Akim Demaille <demaille@gostai.com>
2005
2006 doc: minor fixes.
2007 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
2008 (Table of Symbols): Remove duplicate entry for %debug.
2009
20102009-04-10 Eric Blake <ebb9@byu.net>
2011
2012 submodules: update to latest
2013 * submodules/autoconf: Use latest upstream Autoconf.
2014
20152009-04-06 Eric Blake <ebb9@byu.net>
2016
2017 Work around autoconf 2.63b bug in testsuite.
2018 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
2019 autoconf bug related to # in test.
2020
20212009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2022
2023 * NEWS (2.5): New section. Describe new -D/--define feature.
2024
20252009-04-06 Akim Demaille <demaille@gostai.com>
2026
2027 Regen.
2028 * src/parse-gram.h, src/parse-gram.c: Regen.
2029
20302009-04-06 Akim Demaille <demaille@gostai.com>
2031
2032 rename muscle_tab.* as muscle-tab.* for consistency.
2033 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
2034 * src/muscle-tab.h, src/muscle-tab.c: these.
2035 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
2036 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
2037
20382009-04-06 Akim Demaille <demaille@gostai.com>
2039
2040 Makefile: introduce $(BISON).
2041 * src/local.mk (BISON): New.
2042 (YACC): Use it.
2043
20442009-04-06 Akim Demaille <demaille@gostai.com>
2045
2046 parser: handle %locations as %define locations.
2047 * src/getargs.h, src/getargs.c (locations_flag): Remove.
2048 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
2049 to set "locations" to true.
2050 * src/output.c (prepare): Don't output "locations".
2051 * src/scan-gram.l (%locations): Handle it as a %<flag>.
2052 * src/parse-gram.y: It's no longer a token.
2053 Don't handle it.
2054 * data/bison.m4 (b4_locations_if): Define it with
2055 b4_percent_define_if_define.
2056 * data/c.m4, data/glr.cc: Adjust.
2057
20582009-04-06 Akim Demaille <demaille@gostai.com>
2059
2060 Regen.
2061 * src/parse-gram.c: Regen.
2062
20632009-04-06 Akim Demaille <demaille@gostai.com>
2064
2065 muscle: factor the handling of obsolete of obsolete directives.
2066 Suggested by Joel E. Denny.
2067
2068 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
2069 New, extracted from...
2070 * src/parse-gram.y (prologue_declaration: pure-parser): here.
2071 Remove it.
2072 (prologue_declaration: "%<flag>"): Use
2073 muscle_percent_define_ensure.
2074 (%error-verbose, %pure-parser): No longer tokens.
2075 * src/scan-gram.l (pure-parser): Return as a %<flag>.
2076
20772009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
2078
2079 Fix options documentation.
2080 * build-aux/cross-options.pl: As in --help output, write optional
2081 arguments as [=ARG] not =[ARG].
2082 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
2083
20842009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
2085
2086 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
2087 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
2088 requirements for a correct m4 are stricter.
2089 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
2090 * configure.ac: Update to use AC_PROG_GNU_M4.
2091 Reported by Eric Blake.
2092
20932009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2094
2095 Help with updating web manual.
2096 * HACKING: Incorporate instructions from gnulib/doc/README.
2097 * bootstrap.conf (gnulib_modules): Add gendocs.
2098
20992009-04-03 Akim Demaille <demaille@gostai.com>
2100
2101 Regen.
2102 * src/parse-gram.h, src/parse-gram.c: Regen.
2103
21042009-04-03 Akim Demaille <demaille@gostai.com>
2105
2106 Factor %FLAG at scan level.
2107 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
2108 definitions and associated rules, replaced by....
2109 (PERCENT_FLAG): this new token type, and rule.
2110 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
2111 Use it for %debug and %error-verbose.
2112
21132009-04-03 Akim Demaille <demaille@gostai.com>
2114
2115 Regen.
2116 * src/parse-gram.h, src/parse-gram.c: Regen.
2117
21182009-04-03 Akim Demaille <demaille@gostai.com>
2119
2120 Treat %debug as %define debug.
2121 * data/bison.m4 (b4_debug_if): New.
2122 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
2123 * data/lalr1.java: Use it instead of b4_debug_flag.
2124 * src/getargs.h, src/getargs.c (debug_flag): Remove.
2125 * src/output.c (prepare): Don't output it.
2126 * src/parse-gram.y: Treat %debug as %define debug.
2127
21282009-04-03 Akim Demaille <demaille@gostai.com>
2129
2130 Treat %error-verbose as %define error_verbose.
2131 This allows to pass -Derror_verbose on the command line. Better
2132 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
2133 ERROR_VERBOSE being defined as false or true.
2134 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
2135 on b4_percent_define_ifdef, for does not check the defined value,
2136 but only whether the symbol is defined, rely on
2137 b4_percent_define_flag_if, so that a value of "false" is processed
2138 as a false.
2139 If not defined, define the flag to "false".
2140 (b4_error_verbose_if): New.
2141 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
2142 b4_error_verbose_flag.
2143 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
2144 * src/output.c (prepare): Don't output it.
2145 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
2146
21472009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2148
2149 Fix strange %define locations for default values.
2150 Reported by Akim Demaille at
2151 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
2152 and discussed again starting at
2153 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
2154 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
2155 because location information is bogus.
2156 Use angle brackets to delimit fake file name because square brackets
2157 look like underexpanded m4. Choose a better fake file name.
2158 Use negative line numbers.
2159 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
2160 * src/location.c (location_print): If line for a boundary is negative,
2161 only print that boundary's file name.
2162 * src/location.h: Document that.
2163 * tests/skeletons.at (%define Boolean variables: invalid skeleton
2164 defaults): Update output.
2165
21662009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
2167
2168 Pacify ./configure --enable-gcc-warnings.
2169 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
2170 in lib won't compile with it.
2171 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
2172
21732009-03-31 Akim Demaille <demaille@gostai.com>
2174
2175 bootstrap: --help to stdout.
2176 * bootstrap (usage): Don't send --help to stderr.
2177 Use a here doc instead of a long string.
2178
21792009-03-31 Akim Demaille <demaille@gostai.com>
2180
2181 bootstrap: README-hacking no longer exists
2182 * bootstrap (checkout_only_file): Set to HACKING.
2183
21842009-03-26 Akim Demaille <demaille@gostai.com>
2185
2186 doc: merge HACKING and README-hacking.
2187 Two files is confusing.
2188 Reported by Alexandre Duret-Lutz.
2189
2190 * README-hacking: Merge into...
2191 * HACKING (Working from the repository): here.
2192
21932009-03-26 Akim Demaille <demaille@gostai.com>
2194
2195 doc: update README-hacking.
2196 * README-hacking: We now use git and git submodules.
2197 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
2198
21992009-03-26 Akim Demaille <demaille@gostai.com>
2200
2201 lalr1.cc: avoid GCC 4.3 warnings.
2202 GCC 4.3 now warns about "a || b && c" and asks for explicit
2203 parentheses.
2204 Reported by Alexandre Duret-Lutz.
2205 * data/location.cc: Update copyright years.
2206 (Position::operator==): Use parens to make precedence explicit.
2207 Compare lines and columns first, as they are more likely to be
2208 different, and they are faster to compare.
2209
22102009-03-26 Akim Demaille <demaille@gostai.com>
2211
2212 gnulib: update.
2213 * gnulib: Update to latest.
2214 * src/local.mk (AM_CFLAGS): Move to...
2215 * Makefile.am: here.
2216 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
2217 AM_CFLAGS.
2218
22192009-03-02 Akim Demaille <demaille@gostai.com>
2220
2221 Comment changes.
2222
22232009-03-02 Akim Demaille <demaille@gostai.com>
2224
2225 Share b4_yytranslate_define.
2226 * data/lalr1.cc (b4_yytranslate_define): Move to...
2227 * data/c++.m4: here.
2228
22292009-03-02 Akim Demaille <demaille@gostai.com>
2230
2231 Use locations in the variant example.
2232 Yes, this obfuscates the point of this example, variants only.
2233 But glr.cc cannot work (yet?) without locations. This change
2234 makes it easier to use this example with glr.cc.
2235
2236 * examples/variant.yy (assert): %define it.
2237 (locations): Request them.
2238 (yylex): Bind the location to the stage.
2239
22402009-03-02 Akim Demaille <demaille@gostai.com>
2241
2242 Dub make_TOKEN as a public type interface.
2243 * data/c++.m4 (b4_symbol_constructor_declare)
2244 (b4_symbol_constructor_define): New empty stubs.
2245 (b4_public_types_declare, b4_public_types_define): Use them.
2246 * data/lalr1.cc (b4_symbol_constructor_declare)
2247 (b4_symbol_constructor_declare_)
2248 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
2249 Move to...
2250 * data/variant.hh: here.
2251 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
2252 needed.
2253 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
2254 b4_symbol_constructor_declare, as it is now done by
2255 b4_public_types_define and b4_public_types_declare.
2256
22572009-03-02 Akim Demaille <demaille@gostai.com>
2258
2259 Coding style changes.
2260 * data/lalr1.cc (b4_symbol_constructor_declaration_)
2261 (b4_symbol_constructor_declarations)
2262 (b4_symbol_constructor_definition_)
2263 (b4_symbol_constructor_definitions)
2264 (b4_yytranslate_definition): Rename as...
2265 (b4_symbol_constructor_declare_)
2266 (b4_symbol_constructor_declare)
2267 (b4_symbol_constructor_define_)
2268 (b4_symbol_constructor_define)
2269 (b4_yytranslate_define): these.
2270 * data/variant.hh (b4_variant_definition): Rename as...
2271 (b4_variant_define): this.
2272
22732009-03-02 Akim Demaille <demaille@gostai.com>
2274
2275 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
2276 * data/bison.m4 (b4_percent_define_if_define): New.
2277 * data/c++.m4 (b4_variant_if): Move to...
2278 * data/bison.m4: Here, using b4_percent_define_if_define.
2279 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
2280 * data/bison.m4: Here, using b4_percent_define_if_define.
2281
22822009-03-02 Akim Demaille <demaille@gostai.com>
2283
2284 Dub symbol_type_base as a public type.
2285 * data/c++.m4 (b4_public_types_declare): Now define
2286 symbol_type_base and symbol_type.
2287 (b4_public_types_define): New.
2288 In both cases, the definitions are taken verbatim from lalr1.cc.
2289 * data/lalr1.cc: Adjust.
2290
22912009-03-02 Akim Demaille <demaille@gostai.com>
2292
2293 b4_public_types_declare.
2294 * data/c++.m4 (b4_public_types_declare): New.
2295 * data/glr.cc, data/lalr1.cc: Use it.
2296
22972009-03-02 Akim Demaille <demaille@gostai.com>
2298
2299 b4_semantic_type_declare.
2300 * data/c++.m4 (b4_semantic_type_declare): New.
2301 Factors and generalizes what was in glr.cc and lalr1.cc.
2302 * data/variant.hh (b4_semantic_type_declare): Redefine it for
2303 variants.
2304 * data/lalr1.cc, data/glr.cc: Use it.
2305
23062009-02-26 Akim Demaille <demaille@gostai.com>
2307
2308 Upgrade gnulib.
2309 * gnulib: Upgrade from master.
2310 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
2311 Regen.
2312
23132009-02-25 Akim Demaille <demaille@gostai.com>
2314
2315 Remove useless arguments.
2316 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
2317 relevant.
2318
23192009-02-25 Akim Demaille <demaille@gostai.com>
2320
2321 Comment changes.
2322 * data/lalr1.cc: here.
2323
23242009-02-25 Akim Demaille <demaille@gostai.com>
2325
2326 Fix glr.cc's debug level handling.
2327 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
2328 glr.c which is used.
2329 (debug_level, set_debug_level): Adjust.
2330
23312009-02-25 Akim Demaille <demaille@gostai.com>
2332
2333 Copyright years.
2334 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
2335
23362009-02-25 Akim Demaille <demaille@gostai.com>
2337
2338 Style changes.
2339 * etc/bench.pl.in (generate_grammar_list): Consitently use
2340 location_type, not yy::location.
2341
23422009-02-25 Akim Demaille <demaille@gostai.com>
2343
2344 Comment change.
2345 * data/lalr1.cc: here.
2346
23472009-02-19 Akim Demaille <demaille@gostai.com>
2348
2349 Make yyparser::error public.
2350 * data/lalr1.cc: here.
2351 There is no good reason to keep it private (and it is convenient
2352 to use it from the scanner for instance). It is already public in
2353 glr.cc.
2354
23552009-02-19 Akim Demaille <demaille@gostai.com>
2356
2357 Comment changes.
2358 * data/glr.cc: here.
2359
23602009-02-19 Akim Demaille <demaille@gostai.com>
2361
2362 Remove trailing blanks.
2363 The epilogue has its own ending \n, no need to add another.
2364
2365 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
2366 epilogue.
2367 * data/glr.cc: dnl when extending the epilogue.
2368 Remove stray "private:".
2369
23702009-02-19 Akim Demaille <demaille@gostai.com>
2371
2372 Use b4_c_modern.
2373 * data/c.m4 (b4_c_function_decl): Here.
2374
23752009-02-19 Akim Demaille <demaille@gostai.com>
2376
2377 Comment changes.
2378 * data/lalr1.cc: here.
2379
23802009-02-19 Akim Demaille <demaille@gostai.com>
2381
2382 Extract variant.hh
2383 * data/variant.hh: New, extracted from...
2384 * data/lalr1.cc: here.
2385 Adjust.
2386 * data/local.mk: Adjust.
2387
23882009-02-19 Akim Demaille <demaille@gostai.com>
2389
2390 Extract stack.hh from lalr1.cc.
2391 * data/stack.hh: New.
2392 * data/lalr1.cc: Extract from here.
2393 * data/local.mk: Adjust.
2394
23952009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
2396
2397 Add reminder about uploading public key to keys.gnupg.net.
2398 * HACKING (Release Procedure): Here.
2399
24002009-01-28 Akim Demaille <demaille@gostai.com>
2401
2402 * NEWS: Update information about 2.4.1 and 2.4.2.
2403
24042008-11-04 Akim Demaille <demaille@gostai.com>
2405
2406 Reformat NEWS.
2407 * NEWS: Use more outline-mode markup.
2408 Suggested by Jim Meyering.
2409
24102009-01-08 Akim Demaille <demaille@gostai.com>
2411
2412 Fix grep portability issues.
2413 Grep on Solaris does not support -q.
2414 Reported by Summum Bonum.
2415
2416 * NEWS: Add a stub for 2.4.2.
2417 * THANKS: Add Summum Bonum.
2418 * tests/atlocal.in (EGREP): New.
2419 (CC, CXX, XSLTPROC): Make it possible to override them via
2420 envvars.
2421 * tests/java.at: Use $EGREP instead of egrep.
2422 Use AT_CHECK's ignore instead of grep's -q.
2423
24242008-12-11 Akim Demaille <demaille@gostai.com>
2425
2426 Pass the token type to yysyntax_error.
2427 * data/yacc.c (yysyntax_error): Take the transated token instead
2428 of the raw number.
2429 Adjust callers.
2430 * TODO: Update.
2431
24322008-12-11 Akim Demaille <demaille@gostai.com>
2433
2434 Formatting changes.
2435 * data/glr.c: Formatting changes.
2436
24372008-12-11 Akim Demaille <demaille@gostai.com>
2438
2439 Propagate i18n changes into glr.c.
2440 * TODO: Update.
2441 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
2442 building the error message format dynamically.
2443 * data/lalr1.java: Formatting changes.
2444
24452008-12-11 Akim Demaille <demaille@gostai.com>
2446
2447 Use testsuite -C.
2448 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
2449 Solves problems when top_srcdir is an absolute path.
2450 Suggested by Eric Blake.
2451 * configure.ac: Require Autoconf 2.62.
2452
24532008-12-11 Akim Demaille <demaille@gostai.com>
2454
2455 Simplify the i18n of the error messages.
2456 * data/lalr1.cc: Comment changes.
2457 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
2458 lalr1.cc instead of building dynamically the format string.
2459
24602008-12-08 Akim Demaille <demaille@gostai.com>
2461
2462 Fix portability issue in the test suite.
2463 * tests/local.at (AT_MATCHES_CHECK): New.
2464 Based on Perl instead of Sed. Sed has too many portability
2465 pitfalls, not ever Sed is GNU Sed.
2466 * tests/actions.at (Fix user actions without a trailing semicolon):
2467 Use it.
2468
24692008-12-08 Akim Demaille <demaille@gostai.com>
2470
2471 Update data/README.
2472 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
2473
24742008-12-08 Akim Demaille <demaille@gostai.com>
2475
2476 Install autoconf as a submodule to get m4sugar.
2477 * .gitmodules: Add submodules/autoconf.
2478 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
2479 submodules/autoconf.
2480
24812008-12-08 Akim Demaille <demaille@gostai.com>
2482
2483 Test token.prefix in all the skeletons.
2484 * data/java.m4 (b4_token_enum): Use the token.prefix.
2485 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
2486 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
2487 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
2488 * tests/java.at: Comment changes.
2489 (AT_CHECK_JAVA_MINIMAL): Define the END token.
2490 (Java parser class and package names): Add token.prefix check.
2491
24922008-12-08 Akim Demaille <demaille@gostai.com>
2493
2494 Fix regeneration of atconfig.
2495 * tests/local.mk (tests/atconfig): The rule was incorrect, but
2496 remove it: now that there is no tests/Makefile.am, the top-level
2497 Makefile properly updates atconfig when needed.
2498
24992008-12-07 Di-an Jan <dianj@freeshell.org>
2500
2501 Implement the FIXME that ends an user action with a semicolon
2502 if it seems necessary.
2503 * src/scan-code.l (flex rules section): Flag cpp directive from
2504 any `#' to the first unescaped end-of-line. Semicolon is not
2505 needed after `;', `{', '}', or cpp directives and is needed after
2506 any other token (whitespaces and comments have no effect).
2507 * tests/actions.at (Fix user actions without a trailing semicolon):
2508 New test.
2509 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
2510 to make user actions complete statements.
2511 Adjust column numbers in error messages.
2512 * tests/regression.at (Fix user actions without a trailing semicolon):
2513 Remove. Covered by new test.
2514
25152008-12-07 Akim Demaille <demaille@gostai.com>
2516
2517 Update gnulib.
2518 * gnulib: Update from master.
2519
25202008-12-05 Eric Blake <ebb9@byu.net>
2521
2522 Avoid compiler warning.
2523 * src/output.c (muscle_insert_item_number_table): Delete unused
2524 function.
2525
25262008-12-02 Eric Blake <ebb9@byu.net>
2527
2528 Build testsuite with newer autoconf.
2529 * tests/output.at (m4_expand): Don't override in newer autoconf,
2530 where the underlying implementation changed.
2531 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
2532 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
2533 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
2534 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
2535 since some of them contain unbalanced ')'.
2536
25372008-12-01 Akim Demaille <demaille@gostai.com>
2538
2539 Use b4_symbol for printers and destructors everywhere.
2540 * data/bison.m4 (b4_symbol_action_location): New.
2541 * data/c.m4 (b4_symbol_actions): Remove.
2542 Adjust all callers to use by b4_symbol_foreach and the corresponding
2543 b4_symbol_printer/destructor macro.
2544 * data/glr.cc: Adjust.
2545 * data/lalr1.java: Adjust the %destructor sanity check.
2546 * src/output.c (symbol_code_props_output): Remove, we no longer
2547 need the b4_symbol_printers/destructors tables.
2548
25492008-12-01 Akim Demaille <demaille@gostai.com>
2550
2551 Use b4_symbol_case_.
2552 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
2553 b4_symbol_case_.
2554
25552008-12-01 Akim Demaille <demaille@gostai.com>
2556
2557 Move b4_symbol based macro to bison.m4.
2558 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
2559 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
2560 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
2561 (b4_type_foreach): Move to...
2562 * data/bison.m4: Here.
2563 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
2564 b4_symbol_value_template instead of b4_symbol_value.
2565
25662008-12-01 Akim Demaille <demaille@gostai.com>
2567
2568 b4_symbol/type_foreach.
2569 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
2570 Use them.
2571
25722008-12-01 Akim Demaille <demaille@gostai.com>
2573
2574 Use the symbol properties to output the printer/destructor for lalr1.cc.
2575 Instead of defining complex list of tuples to define various
2576 properties of the symbols, we now prefer to define symbols as
2577 "structs" in m4: using the symbol key (its number), and the
2578 property name, b4_symbol gives it value. Use this to handle
2579 destructors and printers.
2580
2581 * src/output.c (CODE_PROP): New.
2582 (prepare_symbol_definitions): Use it to define the printer and
2583 destructor related attributes of the symbols.
2584 * data/lalr1.cc (b4_symbol_actions): Rename as...
2585 (b4_symbol_action): this.
2586 Use b4_symbol instead of 6 arguments.
2587 (b4_symbol_printer, b4_symbol_destructor): New.
2588 Use them instead of b4_symbol_actions.
2589
25902008-12-01 Akim Demaille <demaille@gostai.com>
2591
2592 Avoid capturing variables too easily.
2593 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
2594 v__ and p__ instead of v and p.
2595
25962008-12-01 Akim Demaille <demaille@gostai.com>
2597
2598 Remove spurious empty line before syncline.
2599 * data/bison.m4 (b4_syncline): Don't output an empty line before
2600 the output.
2601
26022008-11-26 Akim Demaille <demaille@gostai.com>
2603
2604 Convert lib/Makefile.am into lib/local.mk.
2605 The real problem is rather gnulib.mk, which itself is extracted
2606 from a Makefile.am that gnulib expects to the "recursive". The
2607 tool prefix-gnulib-mk converts such a gnulib.mk to be
2608 non-recursive. Also, some AC_SUBST variables need to be adjusted.
2609
2610 * etc/prefix-gnulib-mk: New.
2611 * bootstrap (slurp): Use it to convert further gnulib.mk.
2612 No longer try to avoid re-creation of lib/gnulib.mk as the changes
2613 are deeper.
2614 * lib/Makefile.am: Rename as...
2615 * lib/local.mk: this.
2616 Adjust to be prefixed.
2617 * Makefile.am, configure.ac: Adjust.
2618 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
2619
26202008-11-26 Akim Demaille <demaille@gostai.com>
2621
2622 s/_FLAGS/FLAGS/.
2623 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
2624 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
2625 Reported by Eric Blake.
2626
26272008-11-26 Akim Demaille <demaille@gostai.com>
2628
2629 Use b4_parser_tables_define in glr.cc.
2630 * data/glr.c: Use b4_parser_tables_define instead of defining the
2631 (deterministic integral) tables by hand.
2632
26332008-11-26 Akim Demaille <demaille@gostai.com>
2634
2635 Use b4_parser_tables_define in Java.
2636 * data/java.m4 (b4_typed_parser_table): Rename as...
2637 (b4_typed_parser_table_define): this, for consistency.
2638 Accept a comment as $4.
2639 Move $2 into yy*_.
2640 (b4_integral_parser_table): Rename as...
2641 (b4_integral_parser_table_define): this.
2642 * data/lalr1.java: Adjust all uses.
2643 Use b4_parser_tables_define instead of generation by hand.
2644
26452008-11-26 Akim Demaille <demaille@gostai.com>
2646
2647 Prepare the convergence bw C style and Java table generation.
2648 * data/bison.m4 (b4_tables_map, b4_tables_declare)
2649 (b4_tables_define): Rename as...
2650 (b4_integral_parser_tables_map, b4_parser_tables_declare)
2651 (b4_parser_tables_define): these.
2652 * data/c.m4 (b4_table_define): Rename as...
2653 (b4_integral_parser_table_define): this.
2654 * data/lalr1.cc: Adjust.
2655 (b4_table_define, b4_table_declare): Rename as...
2656 (b4_integral_parser_table_define)
2657 (b4_integral_parser_table_declare): these.
2658 (yyrline_): Move the comment where it is actually used.
2659 * data/yacc.c: Adjust.
2660 (yyrline): Use b4_integral_parser_table_define.
2661
26622008-11-26 Akim Demaille <demaille@gostai.com>
2663
2664 Regen.
2665 * src/parse-gram.h, src/parse-gram.c: Regen.
2666
26672008-11-26 Akim Demaille <demaille@gostai.com>
2668
2669 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
2670 * data/lalr1.cc (b4_tables_map): Move to...
2671 * data/bison.m4: here.
2672 Update the comment for yytable during the flight.
2673 (b4_tables_declare, b4_tables_define): New.
2674 * data/lalr1.cc: Use them.
2675 * data/c.m4 (b4_table_define): New.
2676 * data/yacc.c: Use b4_tables_define instead of output the tables
2677 by hand.
2678 * tests/regression.at (Web2c Actions): Adjust the expected output,
2679 the order of the tables changed.
2680
26812008-11-26 Akim Demaille <demaille@gostai.com>
2682
2683 Get rid of (yy)rhs and (yy)prhs.
2684 These tables are no longer needed in the parsers, and they don't seem to
2685 be useful. They are not documented either.
2686
2687 * src/output.c (prepare_rules): Get rid of rhs and prhs.
2688 Adjust the computation of (yy)r2.
2689
26902008-11-26 Akim Demaille <demaille@gostai.com>
2691
2692 Rule length is unsigned.
2693 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
2694
26952008-11-26 Akim Demaille <demaille@gostai.com>
2696
2697 Get rid of lalr1-split.cc.
2698 It was no longer maintainer.
2699
2700 * data/lalr1-split.cc: Remove.
2701 * etc/bench.pl.in (bench_fusion_parser): Remove.
2702 Adjust.
2703
27042008-11-26 Akim Demaille <demaille@gostai.com>
2705
2706 Use yy* consistently.
2707 * data/glr.c: Now that yyrhs no longer exists as a global
2708 variable, rename local "rhs" variables into "yyrhs" for
2709 consistency.
2710
27112008-11-25 Akim Demaille <demaille@gostai.com>
2712
2713 Get rid of yyrhs and yyprhs in glr.c.
2714 * data/glr.c (yyrhs, yyprhs): Remove.
2715 Instead, use the state stack and yystos.
2716
27172008-11-25 Akim Demaille <demaille@gostai.com>
2718
2719 Flag glr tests.
2720 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
2721 as an Autotest keyword.
2722
27232008-11-25 Akim Demaille <demaille@gostai.com>
2724
2725 Prefer TESTSUITE_FLAGS.
2726 TESTSUITEFLAGS is barely readable.
2727
2728 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
2729 for backward compatibility.
2730 Use the former instead of the latter.
2731
27322008-11-25 Akim Demaille <demaille@gostai.com>
2733
2734 Get rid of yyrhs and yyprhs in larl1.java.
2735 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
2736 (yy_reduce_print): Rather, use yystos_ and the state stack.
2737
27382008-11-25 Akim Demaille <demaille@gostai.com>
2739
2740 Formatting changes.
2741
27422008-11-25 Akim Demaille <demaille@gostai.com>
2743
2744 Get rid of yyrhs and yyprhs in yacc.c.
2745 They were used to get the symbol types, given a rule number, when
2746 displaying the top of the stack before a reduction. But the
2747 symbol type is available from the state stack. This has two be
2748 benefits: two tables less in the parser (making it smaller), and a
2749 more consistent use of the three stacks which will help to fuse
2750 them.
2751
2752 * data/yacc.c (yyprhs, yyrhs): Remove.
2753 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
2754 (yy_reduce_print): Take yyssp as argument.
2755 Use it, together with yystos, to get the symbol type.
2756 * tests/regression.at (Web2c Report): Remove these tables from the
2757 expected output.
2758
27592008-11-25 Akim Demaille <demaille@gostai.com>
2760
2761 b4_tables_map.
2762 The point is to factor the generation of the tables across skeletons.
2763 This is language dependant.
2764
2765 * data/c.m4 (b4_comment_): New.
2766 Should be usable to define how to generate tables independently of
2767 the language.
2768 (b4_c_comment): New.
2769 (b4_comment): Bounce to b4_c_comment.
2770 Now support $2 = [PREFIX] for indentation.
2771 * data/lalr1.cc (b4_table_declare): Don't output a comment if
2772 there is no comment.
2773 Indent it properly when there is one.
2774 Output the ending semicolon.
2775 (b4_table_define): Space changes.
2776 Output the ending semicolon.
2777 (b4_tables_map): New.
2778 Use it twice instead of declaring and defining the (integral)
2779 tables by hand.
2780
27812008-11-25 Akim Demaille <demaille@gostai.com>
2782
2783 b4_table_declare.
2784 * data/lalr1.cc (b4_table_declare): New.
2785 Use it to declare the tables defined with b4_table_define.
2786 (b4_table_define): Declare a third arg to match b4_table_declare
2787 signature.
2788 Move all the comments around invocations of b4_table_define into
2789 the invocations itselves.
2790 Move things around to have the order for declarations and
2791 definitions.
2792
27932008-11-25 Akim Demaille <demaille@gostai.com>
2794
2795 Formatting changes.
2796 * data/lalr1.java: here.
2797
27982008-11-25 Akim Demaille <demaille@gostai.com>
2799
2800 b4_args is more general than only C++.
2801 * data/lalr1.cc (b4_args, _b4_args): Move to...
2802 * data/bison.m4: here.
2803
28042008-11-21 Di-an Jan <dianj@freeshell.org>
2805
2806 Implement no-XXX arguments for --warnings, --report, --trace.
2807 * src/getargs.c (flags_argmatch): Handles no-XXX.
2808 Fix typo in doxygen comment.
2809
28102008-11-21 Akim Demaille <demaille@gostai.com>
2811
2812 Display the changes in cross-options.texi.
2813 * build-aux/cross-options.pl ($sep): New, to separate items.
2814 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
2815 changes.
2816
28172008-11-20 Di-an Jan <dianj@freeshell.org>
2818
2819 Improves options in the manual.
2820 * doc/bison.texinfo (-g, -x): Add space before argument.
2821 (Option Cross Key): Implement FIXME: listing directives also.
2822 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
2823 (Short Option): Special case -d. Put arguments inside @option.
2824 (Bison Directive): Add column, automatically extracted from
2825 src/scan-gram.l (actual name passed as the first argument)
2826 with special case for %define.
2827 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
2828 to build-aux/cross-options.pl.
2829 * src/getargs.c (usage): Document limitations of cross-options.pl.
2830 * src/scan-gram.l: Likewise.
2831
28322008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2833
2834 Fix unexpanded macros in GLR defines file.
2835 Reported by Csaba Raduly at
2836 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
2837 * THANKS (Csaba Raduly): Add.
2838 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
2839 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
2840 lexer in a separate module that includes the defines file.
2841 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
2842 source.
2843 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
2844 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
2845 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
2846 (AT_DATA_SOURCE_PROLOGUE): New.
2847 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
2848 (AT_DATA_SOURCE): New.
2849 (AT_FULL_COMPILE): Extend to support an additional source file.
2850
28512008-11-18 Akim Demaille <demaille@gostai.com>
2852
2853 More TODO.
2854 * TODO: More short term issues.
2855
28562008-11-18 Akim Demaille <demaille@gostai.com>
2857
2858 Regen.
2859 * src/parse-gram.h, src/parse-gram.c: Regen.
2860
28612008-11-18 Akim Demaille <demaille@gostai.com>
2862
2863 Use b4_subtract where possible.
2864 * data/lalr1.cc (b4_subtract): Move to...
2865 * data/bison.m4: here.
2866 * data/glr.c (b4_rhs_data): Use it.
2867 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
2868
28692008-11-18 Akim Demaille <demaille@gostai.com>
2870
2871 Remove incorrect mode specification.
2872 * data/glr.cc: Don't pretend it's C code.
2873
28742008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2875
2876 Simplify last patch slightly.
2877 * src/getargs.c (getargs): Here.
2878
28792008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2880
2881 Fix last warning from --enable-gcc-warnings.
2882 * src/getargs.c (getargs): Don't assign const address to non-const
2883 pointer.
2884
28852008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2886
2887 Don't let maintainer-*-check targets force a version update.
2888 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
2889 handled.
2890
28912008-11-17 Di-an Jan <dianj@freeshell.org>
2892
2893 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
2894 Align menus. Adjust word wrapping. Use node names for menu names.
2895 (Examples): Don't abbreviate node names.
2896 (LocalWords): Remove abbreviations.
2897 (Copying): Make description a sentence.
2898 (Java Action Features): Remove period to match the rest of menu.
2899
29002008-11-17 Di-an Jan <dianj@freeshell.org>
2901
2902 Handles several --enable-gcc-warnings.
2903 * src/getargs.c (command_line_location): Set parameters to void.
2904 * src/output.c (symbol_type_name_cmp): Make static.
2905 (symbols_by_type_name): Set parameters to void.
2906 (symbol_definitions_output): Remove unused parameter. Rename as...
2907 (prepare_symbol_definitions): this.
2908 (muscles_output): Move symbol_definitions_output to...
2909 (output): here as prepare_symbol_definitions.
2910 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
2911 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
2912
29132008-11-17 Di-an Jan <dianj@freeshell.org>
2914
2915 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
2916 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
2917
29182008-11-16 Akim Demaille <demaille@gostai.com>
2919
2920 Add missing $(EXEEXT).
2921 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
2922 "src/bison$(EXEEXT)".
2923 Reported by Di-an Jan.
2924
29252008-11-15 Akim Demaille <demaille@gostai.com>
2926
2927 * TODO: Update.
2928
29292008-11-15 Akim Demaille <demaille@gostai.com>
2930
2931 Formatting changes.
2932 * tests/input.at: here.
2933
29342008-11-15 Akim Demaille <demaille@gostai.com>
2935
2936 Remove duplicate header inclusion.
2937 * src/LR0.c: here.
2938
29392008-11-15 Akim Demaille <demaille@gostai.com>
2940
2941 * src/parse-gram.h, src/parse-gram.c: Regen.
2942
29432008-11-15 Akim Demaille <demaille@gostai.com>
2944
2945 Support parametric types.
2946
2947 There are two issues to handle: first scanning nested angle
2948 bracket pairs to support types such as std::pair< std::string,
2949 std::list<std::string> > >.
2950
2951 Another issue is to address idiosyncracies of C++: do not glue two
2952 closing angle brackets together (otherwise it's operator>>), and
2953 avoid sticking blindly a TYPE to the opening <, as it can result
2954 in '<:' which is a digraph for '['.
2955
2956 * src/scan-gram.l (brace_level): Rename as...
2957 (nesting): this.
2958 (SC_TAG): New.
2959 Implement support for complex tags.
2960 (tag): Accept
2961 , but not <.
2962 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
2963 (b4_symbol_variant): Leave space around types as parameters.
2964 * examples/variant.yy: Use nested template types and leading ::.
2965 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
2966 Rename as...
2967 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
2968 * tests/c++.at: Test parametric types.
2969
29702008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2971
2972 Test token.prefix.
2973 This is not sufficient, but we test at least that the make_SYMBOL
2974 interface is not affected by token.prefix. A more general test
2975 will be implemented when the support of token.prefix is generalized
2976 to more skeletons.
2977
2978 * tests/c++.at: One more variant test, using token.prefix.
2979
29802008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2981
2982 Test the make_TOKEN interface.
2983 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
2984 Factor the common code in yylex.
2985 Use it to test "%define lex_symbol".
2986
29872008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2988
2989 Formatting change.
2990
29912008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2992
2993 Simplify code for variants bench marks.
2994 * etc/bench.pl.in (&generate_grammar_list): Define and use
2995 location_type.
2996 Factor the common code in yylex.
2997
29982008-11-15 Akim Demaille <demaille@gostai.com>
2999
3000 Better error message.
3001 * bootstrap (find_tool): Fix the error message.
3002
30032008-11-15 Akim Demaille <demaille@gostai.com>
3004
3005 Update variant.yy to newest interface.
3006 * examples/variant.yy: Define lex_symbol.
3007 Adjust.
3008
30092008-11-15 Akim Demaille <demaille@gostai.com>
3010
3011 Don't use locations in variant.yy.
3012 * examples/variant.yy: Adjust to not using locations.
3013
30142008-11-15 Akim Demaille <demaille@gostai.com>
3015
3016 Comment changes.
3017 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
3018 comments for the license.
3019
30202008-11-15 Akim Demaille <demaille@gostai.com>
3021
3022 Remove tests/Makefile.am.
3023 * tests/Makefile.am: Rename as...
3024 * tests/local.mk: this.
3025 * Makefile.am, configure.ac: Adjust.
3026 * Makefile.am (DISTCLEANFILES): Define.
3027 (maintainer-check, maintainer-xml-check, maintainer-push-check):
3028 Remove, we no longer need to bounce to the real targets.
3029
30302008-11-15 Akim Demaille <demaille@gostai.com>
3031
3032 Comment changes.
3033
30342008-11-15 Akim Demaille <demaille@gostai.com>
3035
3036 djgpp/local.mk.
3037 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
3038 * djgpp/local.mk: this new file.
3039
30402008-11-15 Akim Demaille <demaille@gostai.com>
3041
3042 Remove doc/Makefile.am.
3043 * doc/Makefile.am: Rename as...
3044 * doc/local.mk: this.
3045 Adjust paths
3046 * Makefile.am, configure.ac: Adjust.
3047 * Makefile.am (MOSTLYCLEANFILES): New.
3048 * src/local.mk: Adjust.
3049
30502008-11-15 Akim Demaille <demaille@gostai.com>
3051
3052 Move sc_tight_scope into maint.mk.
3053 It does not work, and I don't know how it was supposed to work: it
3054 seems to be looking for sources in the build tree. I just moved
3055 it at a better place, fixing it is still required.
3056
3057 * src/local.mk (echo): Remove.
3058 (sc_tight_scope): Move to...
3059 * maint.mk: here.
3060
30612008-11-15 Akim Demaille <demaille@gostai.com>
3062
3063 Regen.
3064 * src/parse-gram.h, src/parse-gram.h: Regen.
3065
30662008-11-15 Akim Demaille <demaille@gostai.com>
3067
3068 Remove src/Makefile.am.
3069 * src/Makefile.am: Rename as...
3070 * src/local.mk: this.
3071 Prefix all the paths with src/.
3072 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
3073 (AM_CPPFLAGS): Find find in builddir/src.
3074 (YACC): Move the flags into...
3075 (AM_YFLAGS): here.
3076 * maint.mk (sc_tight_scope): Disable.
3077 It used to bounce to the version in src/Makefile.am which is now
3078 part of this very Makefile.
3079 * Makefile.am, configure.ac: Adjust.
3080 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
3081 include "..." to find files "here": we are no longer in src/, so
3082 qualify the includes with src/.
3083 * doc/Makefile.am (PREPATH): No longer include the top_builddir
3084 prefix.
3085 (.x.1): Adjust to be able to create src/foo from the top level
3086 Makefile, instead of going bounce to src/Makefile the creation of
3087 foo.
3088
30892008-11-15 Akim Demaille <demaille@gostai.com>
3090
3091 Remove useless variable.
3092 * doc/Makefile.am (srcsrcdir): Remove.
3093
30942008-11-15 Akim Demaille <demaille@gostai.com>
3095
3096 Remove data/Makefile.am.
3097 * data/Makefile.am: Rename as...
3098 * data/local.mk: this.
3099 Adjust paths.
3100 * Makefile.am, configure.ac: Adjust.
3101
31022008-11-15 Akim Demaille <demaille@gostai.com>
3103
3104 Remove etc/Makefile.am.
3105 * etc/Makefile.am: Rename as...
3106 * etc/local.mk: this.
3107 Adjust.
3108 * Makefile.am, configure.ac: Adjust.
3109
31102008-11-15 Akim Demaille <demaille@gostai.com>
3111
3112 Remove examples/local.mk.
3113 examples/calc++/Makefile.am might be interesting to keep as is, since
3114 it is an example in itself.
3115
3116 * examples/Makefile.am: Rename as...
3117 * examples/local.mk: this.
3118 Adjust.
3119 * Makefile.am, configure.ac: Adjust.
3120
31212008-11-15 Akim Demaille <demaille@gostai.com>
3122
3123 Remove build-aux/Makefile.am.
3124 Recursive Makefiles are really way too slow, let's get rid of some of
3125 them.
3126
3127 * build-aux/Makefile.am: Rename as...
3128 * build-aux/local.mk: this.
3129 Adjust paths.
3130 * Makefile.am, configure.ac: Adjust.
3131
31322008-11-15 Akim Demaille <demaille@gostai.com>
3133
3134 Provide convenience constructors for locations and positions.
3135 * data/location.cc (position::position): Accept file, line and
3136 column as arguments with default values.
3137 Always qualify initial line and column literals as unsigned.
3138 (location::location): Provide convenience constructors.
3139
31402008-11-15 Akim Demaille <demaille@gostai.com>
3141
3142 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
3143 token type.
3144 Using template buys us nothing, and makes it uselessly complex to
3145 construct a symbol. Besides, it could not be generalized to other
3146 languages, while make_FOO would work in C/Java etc.
3147
3148 * data/lalr1.cc (b4_symbol_): New.
3149 (b4_symbol): Use it.
3150 (b4_symbol_constructor_declaration_)
3151 (b4_symbol_constructor_definition_): Instead of generating
3152 specializations of an overloaded template function, just generate
3153 several functions whose names are forged from the token names
3154 without the token.prefix.
3155 (b4_symbol_constructor_declarations): Generate them for all the
3156 symbols, not just by class of symbol type, now that instead of
3157 specializing a function template by the token, we generate a
3158 function named after the token.
3159 (b4_symbol_constructor_specialization_)
3160 (b4_symbol_constructor_specializations): Remove.
3161 * etc/bench.pl.in: Adjust to this new API.
3162
31632008-11-13 Akim Demaille <demaille@gostai.com>
3164
3165 %define token.prefix.
3166 Provide a means to add a prefix to the name of the tokens as
3167 output in the generated files. Because of name clashes, it is
3168 good to have such a prefix such as TOK_ that protects from names
3169 such as EOF, FILE etc. But it clutters the grammar itself.
3170
3171 * data/bison.m4 (token.prefix): Empty by default.
3172 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
3173 * data/lalr1.cc (b4_symbol): Ditto.
3174
31752008-11-13 Akim Demaille <demaille@gostai.com>
3176
3177 Compute at M4 time some of the subtractions.
3178 * data/lalr1.cc (b4_subtract): New.
3179 (b4_rhs_data): Use it.
3180
31812008-11-13 Akim Demaille <demaille@gostai.com>
3182
3183 symbol::token.
3184 This allows the user to get the type of a token returned by yylex.
3185
3186 * data/lalr1.cc (symbol::token): New.
3187 (yytoknum_): Define when %define lex_symbol, independently of
3188 %debug.
3189 (yytoken_number_): Move into...
3190 (symbol::token): here, since that's the only use.
3191 The other one is YYPRINT which was not officially supported
3192 by lalr1.cc, and anyway it did not work since YYPRINT uses this
3193 array under a different name (yytoknum).
3194
31952008-11-13 Akim Demaille <demaille@gostai.com>
3196
3197 YYERRCODE.
3198 * TODO (YYERRCODE): Mention the case of $undef.
3199
32002008-11-13 Akim Demaille <demaille@gostai.com>
3201
3202 TODO: YYPRINT.
3203 * TODO (YYPRINT): New.
3204
32052008-11-13 Akim Demaille <demaille@gostai.com>
3206
3207 Comment changes.
3208 * data/lalr1.cc, data/yacc.c: Fix the description of the
3209 yytranslate and yytoknum tables.
3210
32112008-11-13 Akim Demaille <demaille@gostai.com>
3212
3213 Define make_symbol in the header.
3214 To reach good performances these functions should be inlined (yet
3215 this is to measure precisely). To this end they must be available
3216 to the caller.
3217
3218 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
3219 location_type with the class name.
3220 Since will now be output in the header, declare "inline".
3221 No longer use b4_symbol_constructor_specializations, but
3222 b4_symbol_constructor_definitions in the header.
3223 Don't call it in the *.cc file.
3224
32252008-11-13 Akim Demaille <demaille@gostai.com>
3226
3227 Define yytranslate in the header for lex_symbol.
3228 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
3229 into the header file when using %define lex_symbol.
3230 (yytranslate_): Declare inline.
3231
32322008-11-13 Akim Demaille <demaille@gostai.com>
3233
3234 Define the constructors of symbol_type in
3235 b4_symbol_constructor_definitions.
3236 The constructors are called by the make_symbol functions, which a
3237 forthcoming patch will move elsewhere. Hence the interest of
3238 putting them together.
3239
3240 The stack_symbol_type does not need to be moved, it is used only
3241 by the parser.
3242
3243 * data/lalr1.cc: Move symbol_type and symbol_base_type
3244 constructors into...
3245 (b4_symbol_constructor_definitions): here.
3246 Adjust.
3247
32482008-11-13 Akim Demaille <demaille@gostai.com>
3249
3250 Make it easier to move the definition of yytranslate_.
3251 Forthcoming changes will make it possible to use yytranslate_
3252 from outside the parser implementation file.
3253
3254 * data/lalr1.cc (b4_yytranslate_definition): New.
3255 Use it.
3256
32572008-11-13 Akim Demaille <demaille@gostai.com>
3258
3259 Remove useless class specification.
3260 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
3261 to refer to the class name to use a type defined by the class for
3262 arguments of member functions.
3263
32642008-11-13 Akim Demaille <demaille@gostai.com>
3265
3266 Finer input type for yytranslate.
3267 This patch is debatable: the tradition expects yylex to return an int
3268 which happens to correspond to token_number (which is an enum). This
3269 allows for instance to return characters (such as '*' etc.). But this
3270 goes against the stronger typing I am trying to have with the new
3271 lex interface which return a symbol_type. So in this case, feed
3272 yytranslate_ with a token_type.
3273
3274 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
3275 expect a token_type.
3276
32772008-11-13 Akim Demaille <demaille@gostai.com>
3278
3279 Honor lex-params in %define lex_symbol mode.
3280 * data/lalr1.cc: Use b4_lex_param.
3281
32822008-11-13 Akim Demaille <demaille@gostai.com>
3283
3284 Simplify names.
3285 * src/output.c (symbol_definitions_output): Rename symbol
3286 attributes type_name and has_type_name as type and has_type.
3287 * data/lalr1.cc: Adjust uses.
3288
32892008-11-13 Akim Demaille <demaille@gostai.com>
3290
3291 Use b4_type_names for the union type.
3292 The union used to compute the size of the variant used to iterate
3293 over the type of all the symbols, with a lot of redundancy. Now
3294 iterate over the lists of symbols having the same type-name.
3295
3296 * data/lalr1.cc (b4_char_sizeof_): New.
3297 (b4_char_sizeof): Use it.
3298 Adjust to be called with a list of numbers instead of a single
3299 number.
3300 Adjust its caller for new-line issues.
3301
33022008-11-13 Akim Demaille <demaille@gostai.com>
3303
3304 Define the "identifier" of a symbol.
3305 Symbols may have several string representations, for instance if
3306 they have an alias. What I call its "id" is a string that can be
3307 used as an identifier. May not exist.
3308
3309 Currently the symbols which have the "tag_is_id" flag set are
3310 those that don't have an alias. Look harder for the id.
3311
3312 * src/output.c (is_identifier): Move to...
3313 * src/symtab.c (is_identifier): here.
3314 * src/symtab.h, src/symtab.c (symbol_id_get): New.
3315 * src/output.c (symbol_definitions_output): Use it to define "id"
3316 and "has_id".
3317 Remove the definition of "tag_is_id".
3318 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
3319 "tag_is_id" were used to produce code.
3320 We still use "tag" for documentation.
3321
33222008-11-11 Akim Demaille <demaille@gostai.com>
3323
3324 Locations are no longer required by lalr1.cc.
3325 * data/lalr1.cc (_b4_args, b4_args): New.
3326 Adjust all uses of locations to make them optional.
3327 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
3328 (AT_CHECK_NAMESPACE): Check the use of locations.
3329 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
3330 without locations with lalr1.cc.
3331 Test these cases.
3332 * tests/output.at: Check lalr1.cc with and without location
3333 support.
3334 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
3335 Don't use locations.
3336
33372008-11-11 Akim Demaille <demaille@gostai.com>
3338
3339 AT_FULL_COMPILE.
3340 * tests/local.at (AT_FULL_COMPILE): New.
3341 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
3342
33432008-11-11 Akim Demaille <demaille@gostai.com>
3344
3345 Support parens in calc++.
3346 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
3347 * examples/calc++/test (run): Check the expected output.
3348 Adjust callers.
3349 Check parens too.
3350
33512008-11-11 Akim Demaille <demaille@gostai.com>
3352
3353 Simplify lalr1.cc since %defines is mandatory.
3354 * data/lalr1.cc: Remove useless calls to b4_defines_if.
3355
33562008-11-11 Akim Demaille <demaille@gostai.com>
3357
3358 TODO: yyfmt.
3359 * TODO (yysyntax_error): New item.
3360
33612008-11-11 Akim Demaille <demaille@gostai.com>
3362
3363 Prefer M4 to CPP.
3364 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
3365 YYERROR_VERBOSE.
3366
33672008-11-11 Akim Demaille <demaille@gostai.com>
3368
3369 Support i18n of the parse error messages.
3370 * TODO (lalr1.cc/I18n): Remove.
3371 * data/lalr1.cc (yysyntax_error_): Support the translation of the
3372 error messages, as done in yacc.c.
3373 Stay within the yy* pseudo namespace.
3374
33752008-11-11 Akim Demaille <demaille@gostai.com>
3376
3377 More TODO.
3378 * TODO (single stack, yysyntax_error): New.
3379
33802008-11-11 Akim Demaille <demaille@gostai.com>
3381
3382 Make it possible to return a symbol_type from yylex.
3383 * data/lalr1.cc (b4_lex_symbol_if): New.
3384 (parse): When lex_symbol is defined, expected yylex to return the
3385 complete lookahead.
3386 * etc/bench.pl.in (generate_grammar_list): Extend to support this
3387 yylex interface.
3388 (bench_variant_parser): Exercise it.
3389
33902008-11-11 Akim Demaille <demaille@gostai.com>
3391
3392 Remove useless bench case.
3393 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
3394 no longer used.
3395
33962008-11-11 Akim Demaille <demaille@gostai.com>
3397
3398 Improve display of directives.
3399 * etc/bench.pl.in (parse_term): Don't add useless eol.
3400
34012008-11-11 Akim Demaille <demaille@gostai.com>
3402
3403 Use string_cast in the bench.
3404 * etc/bench.pl.in (generate_grammar_list): Define and use
3405 string_cast.
3406
34072008-11-11 Akim Demaille <demaille@gostai.com>
3408
3409 Replace yychar with a Boolean.
3410 * data/lalr1.cc (parse::yychar): Replace by...
3411 (parse::yyempty): this.
3412
34132008-11-11 Akim Demaille <demaille@gostai.com>
3414
3415 Factor the tables.
3416 * TODO: New item.
3417
34182008-11-11 Akim Demaille <demaille@gostai.com>
3419
3420 Let yytranslate handle the eof case.
3421 * data/lalr1.cc (yytranslate_): Handle the EOF case.
3422 Adjust callers.
3423 No longer expect yychar to be equal to yyeof_, rather, test the
3424 lookahead's (translated) kind.
3425
34262008-11-11 Akim Demaille <demaille@gostai.com>
3427
3428 yychar cannot be empty in yyerrlab.
3429 * TODO (yychar == yyempty_): New.
3430 * data/lalr1.cc: Remove the handling of this case.
3431 This eases forthcoming changes related to yychar and yytranslate.
3432
34332008-11-11 Akim Demaille <demaille@gostai.com>
3434
3435 Bench: syntactic sugar for %define/#define.
3436 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
3437 (&bench_push_parser, bench_variant_parser): Use this feature.
3438 (&eat): New.
3439 Use it.
3440
34412008-11-11 Akim Demaille <demaille@gostai.com>
3442
3443 Less memory pressure on the "list" bench.
3444 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
3445 the values, to limit memory pressure.
3446
34472008-11-11 Akim Demaille <demaille@gostai.com>
3448
3449 Introduce make_symbol.
3450 make_symbol provides a means to construct a full symbol (kind,
3451 value, location) in a single shot. It is meant to be a Symbol
3452 constructor, parameterized by the symbol kind so that overloading
3453 would prevent incorrect kind/value pairs. Unfortunately
3454 parameterized constructors do not work well in C++ (unless the
3455 parameter also appears as an argument, which is not acceptable),
3456 hence the use of a function instead of a constructor.
3457
3458 * data/lalr1.cc (b4_symbol_constructor_declaration_)
3459 (b4_symbol_constructor_declarations)
3460 (b4_symbol_constructor_specialization_)
3461 (b4_symbol_constructor_specializations)
3462 (b4_symbol_constructor_definition_)
3463 (b4_symbol_constructor_definitions): New.
3464 Use them where appropriate to generate declaration, declaration of
3465 the specializations, and implementations of the templated
3466 overloaded function "make_symbol".
3467 (variant::variant): Always define a default ctor.
3468 Also provide a copy ctor.
3469 (symbol_base_type, symbol_type): New ctor overloads for value-less
3470 symbols.
3471 (symbol_type): Now public, so that functions such as yylex can use
3472 it.
3473
34742008-11-11 Akim Demaille <demaille@gostai.com>
3475
3476 Inform m4 whether a tag is a valid id.
3477 * src/output.c (is_identifier): New.
3478 (symbol_definitions_output): Use it to define tag_is_id.
3479 But maybe this should be done at m4 level?
3480
34812008-11-11 Akim Demaille <demaille@gostai.com>
3482
3483 Test 214 was failing: it greps with a pattern containing [ ]*
3484 which obviously meant to catch spaces and tabs, but contained only
3485 spaces. Tabulations in sources are a nuisance, so to simplify the
3486 matter, get rid of all the tabulations in the Java sources. The
3487 other skeletons will be treated equally later.
3488
3489 * data/java.m4, data/lalr1.java: Untabify.
3490 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
3491 tabulations are no longer generated.
3492
34932008-11-11 Paolo Bonzini <bonzini@gnu.org>
3494
3495 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
3496 * configure.ac: Adjust usage.
3497 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3498 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
3499 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
3500
35012008-11-10 Di-an Jan <dianj@freeshell.org>
3502
3503 Workaround Java's ``code too large'' problem for parser tables
3504 in most cases, by using one function per initialization.
3505 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
3506 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
3507 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
3508 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
3509 (yytname_): Use b4_typed_parser_table.
3510 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
3511 ``code too large'' error.
3512
35132008-11-10 Di-an Jan <dianj@freeshell.org>
3514
3515 * NEWS: Document them.
3516
3517 General Java skeleton improvements.
3518 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
3519 using gcj < 4.3 in the testsuite, according to comments in
3520 gnulib/m4/javacomp.m4.
3521 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
3522 location_type, position_type): Remove extraneous brackets from
3523 b4_percent_define_default.
3524 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
3525 m4_define and m4_define_default.
3526 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
3527 which marks the end of user code with appropriate syncline, like all
3528 the other skeletons.
3529 (b4_user_post_prologue): Add. Don't silently drop.
3530 (yylex): Remove.
3531 (parse): Inline yylex.
3532 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
3533 (%{...%}): Fix typo of %code imports.
3534 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
3535
3536 Support annotations on parser class with %define annotations.
3537 * data/lalr1.java (annotations): Add to parser class modifier.
3538 * doc/bison.texinfo (Java Parser Interface): Document
3539 %define annotations.
3540 (Java Declarations Summary): Document %define annotations.
3541 * tests/java.at (Java parser class modifiers): Test annotations.
3542
3543 Do not generate code for %error-verbose unless requested.
3544 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
3545 Make private. Make conditional on %error-verbose.
3546 (getErrorVerbose, setErrorVerbose): New.
3547 (yytnamerr_): Make conditional on %error-verbose.
3548 (yysyntax_error): Make some code conditional on %error-verbose.
3549 * doc/bison.texinfo (Java Bison Interface): Remove the parts
3550 about %error-verbose having no effect.
3551 (getErrorVerbose, setErrorVerbose): Document.
3552
3553 Move constants for token names to Lexer interface.
3554 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
3555 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
3556 (parse): Qualify EOF to Lexer.EOF.
3557 * doc/bison.texinfo (Java Parser Interface): Move documentation of
3558 EOF and token names to Java Lexer Interface.
3559 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
3560
3561 Make yyerror public.
3562 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
3563 (yyerror): Change to public. Add Javadoc comments. Use longer
3564 parameter names. Make the body rather than the declarator
3565 conditional on %locations.
3566 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
3567
3568 Allow user to add code to the constructor with %code init.
3569 * data/java.m4 (b4_init_throws): New, for %define init_throws.
3570 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
3571 Add %code init to the front of the constructor body.
3572 * doc/bison.texinfo (YYParser.YYParser): Document %code init
3573 and %define init_throws.
3574 (Java Declarations Summary): Document %code init and
3575 %define init_throws.
3576 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
3577 (Java constructor init and init_throws): Add tests.
3578
35792008-11-10 Akim Demaille <demaille@gostai.com>
3580
3581 Update TODO.
3582 * TODO (-D): is implemented.
3583 (associativity): Same precedence must have the same associativity.
3584 For instance, how can a * b / c be parsed if * is %left and / is
3585 %right?
3586 (YYERRORCODE, YYFAIL, YYBACKUP): New.
3587
35882008-11-10 Akim Demaille <demaille@gostai.com>
3589
3590 Formatting changes.
3591
35922008-11-10 Akim Demaille <demaille@gostai.com>
3593
3594 More information about the symbols.
3595 * src/output.c (type_names_output): Document all the symbols,
3596 including those that don't have a type-name.
3597 (symbol_definitions_output): Define "is_token" and
3598 "has_type_name".
3599 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
3600 type-name, now that they are defined too in b4_type_names.
3601
36022008-11-10 Akim Demaille <demaille@gostai.com>
3603
3604 Regen.
3605
36062008-11-10 Akim Demaille <demaille@gostai.com>
3607
3608 Make parser::yytranslate static.
3609 Small speedup (1%) on the list grammar. And makes yytranslate_
3610 available in non member functions.
3611
3612 * data/lalr1.cc (yytranslate_): Does not need to be a instance
3613 function.
3614
36152008-11-10 Akim Demaille <demaille@gostai.com>
3616
3617 Avoid trailing spaces.
3618 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
3619 * data/lalr1.cc: Don't indent before rule and symbol actions, as
3620 they can be empty, and anyway this incorrectly indents the first
3621 action.
3622
36232008-11-10 Akim Demaille <demaille@gostai.com>
3624
3625 Comment changes.
3626
36272008-11-10 Akim Demaille <demaille@gostai.com>
3628
3629 Use "enum" for integral constants.
3630 This is just nicer to read, I observed no speedup.
3631
3632 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
3633 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
3634 (yyuser_token_number_max_, yyundef_token_): Move into...
3635 (yytranslate_): here.
3636
36372008-11-10 Akim Demaille <demaille@gostai.com>
3638
3639 Shortcuts in bench directives.
3640 * etc/bench.pl.in (parse_dirs): New.
3641 Use it.
3642 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
3643 Create the benches in "benches/".
3644
36452008-11-10 Akim Demaille <demaille@gostai.com>
3646
3647 Formatting changes.
3648 * data/lalr1.cc: here.
3649
36502008-11-10 Akim Demaille <demaille@gostai.com>
3651
3652 Adjust verbose message to using emacs.
3653 * etc/bench.pl.in: Inform compilation-mode when we change the
3654 directory.
3655 (generate_grammar_list): Recognize %define "variant" in addition
3656 to %define variant.
3657
36582008-11-10 Akim Demaille <demaille@gostai.com>
3659
3660 Classify symbols by type-name.
3661 * src/uniqstr.h (UNIQSTR_CMP): New.
3662 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
3663 (type_names_output): New.
3664 (muscles_output): Use it.
3665 * data/lalr1.cc (b4_symbol_action_): Remove.
3666 (b4_symbol_case_, b4_type_action_): New.
3667 Adjust uses of b4_symbol_action_ to use b4_type_action_.
3668
36692008-11-10 Akim Demaille <demaille@gostai.com>
3670
3671 Change the handling of the symbols in the skeletons.
3672 Before we were using tables which lines were the symbols and which
3673 columns were things like number, tag, type-name etc. It is was
3674 difficult to extend: each time a column was added, all the numbers had
3675 to be updated (you asked for colon $2, not for "tag"). Also, it was
3676 hard to filter these tables when only a subset of the symbols (say the
3677 tokens, or the nterms, or the tokens that have and external number
3678 *and* a type-name) was of interest.
3679
3680 Now instead of monolithic tables, we define one macro per cell. For
3681 instance "b4_symbol(0, tag)" is a macro name which contents is
3682 self-decriptive. The macro "b4_symbol" provides easier access to
3683 these cells.
3684
3685 * src/output.c (type_names_output): Remove.
3686 (symbol_numbers_output, symbol_definitions_output): New.
3687 (muscles_output): Call them.
3688 (prepare_symbols): Define b4_symbols_number.
3689
36902008-11-10 Akim Demaille <demaille@gostai.com>
3691
3692 --trace=muscles
3693 * src/getargs.h, src/getargs.c (trace_muscle): New.
3694 (trace_types, trace_args): Support it.
3695 * src/output.c (output_skeleton): Use it.
3696
36972008-11-10 Akim Demaille <demaille@gostai.com>
3698
3699 muscles_output.
3700 * src/output.c (muscles_output): New, extracted from...
3701 (output_skeleton): here.
3702 Adjust.
3703
37042008-11-10 Akim Demaille <demaille@gostai.com>
3705
3706 Formatting changes.
3707
37082008-11-10 Akim Demaille <demaille@gostai.com>
3709
3710 Update the variant example.
3711 * examples/variant.yy: Formatting changes.
3712 One stage build.
3713
37142008-11-10 Akim Demaille <demaille@gostai.com>
3715
3716 Support constructor with an argument.
3717 This improves the "list" bench by 2%.
3718
3719 * data/lalr1.cc (variant::build): Add an overloaded version with
3720 an argument.
3721 * tests/c++.at (AT_CHECK_VARIANT): Check it.
3722
37232008-11-10 Akim Demaille <demaille@gostai.com>
3724
3725 Test variants.
3726 * tests/c++.at (AT_CHECK_VARIANTS): New.
3727 Use it with and without %define assert.
3728
37292008-11-10 Akim Demaille <demaille@gostai.com>
3730
3731 Add %precedence support.
3732 Unfortunately it is not possible to reuse the %prec directive. This
3733 is because to please POSIX, we do not require to end the rules with a
3734 semicolon. As a result,
3735
3736 foo: bar %prec baz
3737
3738 is ambiguous: either a rule which precedence is that of baz, or a rule,
3739 and then a declaration of the precedence of the token baz.
3740
3741 * doc/bison.texinfo: Document %precedence.
3742 (Precedence Only): New.
3743 * src/assoc.h, src/assoc.c (precedence_assoc): New.
3744 * src/conflicts.c (resolve_sr_conflict): Support it.
3745 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
3746 Parse it.
3747 * tests/calc.at: Use %precedence for NEG.
3748 * tests/conflicts.at (%precedence does not suffice)
3749 (%precedence suffices): New tests.
3750
37512008-11-09 Akim Demaille <demaille@gostai.com>
3752
3753 Make benches in a sub dirs.
3754 * etc/bench.pl.in ($dir): New.
3755 Use it.
3756 Check the use of constructors with an argument.
3757 (bench_variant_parser): Fix.
3758
37592008-11-09 Akim Demaille <demaille@gostai.com>
3760
3761 fix eof condition
3762
37632008-11-09 Akim Demaille <demaille@gostai.com>
3764
3765 Fix --help.
3766
37672008-11-09 Akim Demaille <demaille@gostai.com>
3768
3769 Require the generation of parse-gram.output.
3770 * src/Makefile.am (YACC): Pass --report=all.
3771
37722008-11-09 Akim Demaille <demaille@gostai.com>
3773
3774 Formatting changes.
3775
37762008-11-09 Akim Demaille <demaille@gostai.com>
3777
3778 Update TODO.
3779 * TODO: Remove obsolete items.
3780 Update others.
3781
37822008-11-09 Akim Demaille <demaille@gostai.com>
3783
3784 Enhance bench.pl.
3785 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
3786 (@token, $grammar, $bench): New.
3787 (generate_grammar_variant): Rename as...
3788 (generate_grammar_list): this.
3789 (generate_grammar): Adjust.
3790 (bench_grammar): Rename as...
3791 (bench): this.
3792 Use it in the various bench-marking routines.
3793 (-b, -g): New options.
3794
37952008-11-09 Akim Demaille <demaille@gostai.com>
3796
3797 Use a static hierarchy for symbols in the C++ parser.
3798 * data/lalr1.cc (symbol_base_type, symbol_type)
3799 (stack_symbol_type): Make it a static hierarchy.
3800 Adjust dependencies.
3801
38022008-11-09 Akim Demaille <demaille@gostai.com>
3803
3804 bench.pl -d, --directive.
3805 * etc/bench.pl.in (@directive): New.
3806 (&bench_grammar): Use it.
3807 (&bench_list_grammar): New, to provide access to the "variant"
3808 grammar.
3809 Use it.
3810 (getopts): Support -d, --directive.
3811
38122008-11-09 Akim Demaille <demaille@gostai.com>
3813
3814 Use inline for small operations.
3815 * data/lalr1.cc (symbol_base_type, symbol_type)
3816 (stack_symbol_type): Declare constructor and other operations as
3817 inline.
3818 (yy_destroy_): Inline.
3819
38202008-11-09 Akim Demaille <demaille@gostai.com>
3821
3822 Introduce a hierarchy for symbols.
3823 * data/lalr1.cc (symbol_base_type, symbol_type): New.
3824 (data_type): Rename as...
3825 (stack_symbol_type): this.
3826 Derive from symbol_base_type.
3827 (yy_symbol_value_print_): Merge into...
3828 (yy_symbol_print_): this.
3829 Rename as...
3830 (yy_print_): this.
3831 (yydestruct_): Rename as...
3832 (yy_destroy_): this.
3833 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
3834 (parser::parse): yyla is now of symbol_type.
3835 Use its type member instead of yytoken.
3836
38372008-11-09 Akim Demaille <demaille@gostai.com>
3838
3839 Rename data_type and stack_symbol_type.
3840 * data/lalr1.cc (data_type): Rename as...
3841 (stack_symbol_type): this.
3842
38432008-11-09 Akim Demaille <demaille@gostai.com>
3844
3845 Handle semantic value and location together.
3846 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
3847 yydata.value and yydata.location.
3848 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
3849 (YY_SYMBOL_PRINT): Now take semantic value and location as a
3850 single arg.
3851 Adjust all callers.
3852 (yydestruct_): New overload for a stack symbol.
3853
38542008-11-09 Akim Demaille <demaille@gostai.com>
3855
3856 Push a complete symbol, not connected parts.
3857 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
3858 state, value and location.
3859 Adjust callers.
3860
38612008-11-09 Akim Demaille <demaille@gostai.com>
3862
3863 Agregate yylval and yylloc.
3864 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
3865 (parser::yyla): this.
3866
38672008-11-09 Akim Demaille <demaille@gostai.com>
3868
3869 Rely on the state stack to display reduction traces.
3870 To display rhs symbols before a reduction, we used information
3871 about the rule reduced, which required the tables yyrhs and
3872 yyprhs. Now use rely only on the state stack to get the same
3873 information.
3874
3875 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
3876 Use them.
3877 (parser::yyrhs_, parser::yyprhs_): Remove.
3878 (parser::yy_reduce_print_): Use the state stack.
3879
38802008-11-09 Akim Demaille <demaille@gostai.com>
3881
3882 Fuse yyval and yyloc into yylhs.
3883 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
3884 yylhs.
3885 (parse): Replace yyval and yyloc with yylhs.value and
3886 yylhs.location.
3887 After a user action, compute yylhs.state earlier.
3888 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
3889 fresh error_token.
3890
38912008-11-09 Di-an Jan <dianj@freeshell.org>
3892
3893 Remove unused variable.
3894 * src/output.c (type_names_output): Remove unused variable sep.
3895
38962008-11-09 Paolo Bonzini <bonzini@gnu.org>
3897
3898 Change tests/output.at quoting.
3899 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
3900 expanding arguments.
3901
39022008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3903
3904 Don't add a semicolon to actions for %skeleton or %language.
3905 It breaks Java test cases as reported by Akim Demaille.
3906 * src/scan-code.l: Implement.
3907
39082008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3909
3910 Clean up %skeleton and %language priority implementation.
3911 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
3912 remove static qualifier because others will soon need to see it.
3913 (language_prio): Likewise.
3914 (getargs): Use command_line_prio rather than 0.
3915 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
3916 enum fields.
3917 (skeleton_prio): Extern it.
3918 (language_prio): Extern it.
3919 * src/parse-gram.y: Use grammar_prio rather than 1.
3920
39212008-11-07 Akim Demaille <demaille@gostai.com>
3922
3923 Moving push traces into yypush_.
3924 * data/lalr1.cc (yypush_): Now takes a optional trace message.
3925 Adjust all uses.
3926
39272008-11-07 Akim Demaille <demaille@gostai.com>
3928
3929 The single-stack C++ parser is now the standard one.
3930 * data/lalr1.cc: Rename as...
3931 * data/lalr1-split.cc: this.
3932 * data/lalr1-fusion.cc: Rename as...
3933 * data/lalr1.cc: this.
3934 * etc/bench.pl.in: Adjust.
3935
39362008-11-07 Akim Demaille <demaille@gostai.com>
3937
3938 Avoid empty-if warnings.
3939 Reported by Quentin Hocquet.
3940
3941 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
3942 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
3943
39442008-11-07 Akim Demaille <demaille@gostai.com>
3945
3946 Pass command line location to skeleton_arg and language_argmatch.
3947 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
3948 The location argument is now mandatory.
3949 Adjust all dependencies.
3950 (getargs): Use command_line_location.
3951
39522008-11-07 Akim Demaille <demaille@gostai.com>
3953
3954 -D, --define.
3955 * src/getargs.c (usage): Document -D.
3956 Fix help string for --locations.
3957 (command_line_location): New.
3958 (short_options, long_options, getargs): Support -D, --define.
3959 (getargs): Move -d support at the right place.
3960 * doc/bison.texinfo (Bison Options): Update.
3961 * tests/input.at (%define, --define): New.
3962
39632008-11-07 Akim Demaille <demaille@gostai.com>
3964
3965 Initialize the muscle table before parsing the command line.
3966 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
3967 (getargs): Define file_name.
3968 * src/main.c (main): Initialize muscle_tab before calling
3969 getargs.
3970 * src/muscle_tab.c (muscle_init): No longer define file_name, as
3971 its value is not available yet.
3972
39732008-11-07 Akim Demaille <demaille@gostai.com>
3974
3975 Locations without columns for command line arguments.
3976 * src/location.c (location_print): Don't display negative columns.
3977 * src/location.h: Document this.
3978
39792008-11-07 Akim Demaille <demaille@gostai.com>
3980
3981 Fix --help.
3982 * src/getargs.c (usage): Fix help string for -W.
3983
39842008-11-07 Akim Demaille <demaille@gostai.com>
3985
3986 Handle more general types of option arguments.
3987 * build-aux/cross-options.pl: The argument ends at the first
3988 space, not the first non-symbol character.
3989 Use @var for each word appearing the argument description.
3990
39912008-11-07 Akim Demaille <demaille@gostai.com>
3992
3993 Destroy the variants that remain on the stack in case of error.
3994 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
3995 destructor.
3996 Display the value only if yymsg is nonnull.
3997 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
3998
39992008-11-07 Akim Demaille <demaille@gostai.com>
4000
4001 Add "%define assert" to variants.
4002 This is used to help the user catch cases where some value gets
4003 ovewritten by a new one. This should not happen, as this will
4004 probably leak.
4005
4006 Unfortunately this uncovered a bug in the C++ parser itself: the
4007 lookahead value was not destroyed between two calls to yylex. For
4008 instance if the previous lookahead was a std::string, and then an int,
4009 then the value of the std::string was correctly taken (i.e., the
4010 lookahead was now an empty string), but std::string structure itself
4011 was not reclaimed.
4012
4013 This is now done in variant::build(other&) (which is used to take the
4014 value of the lookahead): other is not only stolen from its value, it
4015 is also destroyed. This incurs a new performance penalty of a few
4016 percent, and union becomes faster again.
4017
4018 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
4019 (b4_variant_if): New.
4020 (variant::built): New.
4021 Use it whereever the status of the variant changes.
4022 * etc/bench.pl.in: Check the penalty of %define assert.
4023
40242008-11-07 Akim Demaille <demaille@gostai.com>
4025
4026 Use "%define variant" in bench.pl.
4027 * etc/bench.pl.in: No longer use the pseudo directive %variants,
4028 just use %define variants.
4029
40302008-11-07 Akim Demaille <demaille@gostai.com>
4031
4032 Regen.
4033 * src/parse-gram.h, src/parse-gram.c: Regen.
4034
40352008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
4036
4037 Fix user actions without a trailing semicolon.
4038 Reported by Sergei Steshenko at
4039 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
4040 * THANKS (Sergei Steshenko): Add.
4041 * src/scan-code.l (SC_RULE_ACTION): Fix it.
4042 * tests/regression.at (Fix user actions without a trailing semicolon):
4043 New test case.
4044
40452008-11-04 Akim Demaille <demaille@gostai.com>
4046
4047 Use b4_copyright_years.
4048 * data/yacc.c (b4_copyright_years): New.
4049 Fix its value according to the comments in the file.
4050 Use it and undefine it.
4051
40522008-11-04 Akim Demaille <demaille@gostai.com>
4053
4054 Formatting changes.
4055 * data/lalr1-fusion.cc, src/parse-gram.y: here.
4056
40572008-11-04 Akim Demaille <demaille@gostai.com>
4058
4059 Formatting changes.
4060 * data/lalr1-fusion.cc: here.
4061
40622008-11-04 Akim Demaille <demaille@gostai.com>
4063
4064 Use strict on bench.pl.
4065 * etc/bench.pl.in (&run, &generate_grammar): New.
4066 Rename the grammar generating functions for consistency.
4067 Change the interface so that the list of benches to run is passed
4068 as (optionless) arguments.
4069 (&compile): Use &run.
4070
40712008-11-04 Akim Demaille <demaille@gostai.com>
4072
4073 Remove spurious initial empty lines.
4074 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
4075 * data/yacc.c: End the @output lines with an @.
4076
40772008-11-04 Akim Demaille <demaille@gostai.com>
4078
4079 Improve the display of sizes.
4080 * etc/bench.p.in: Higher precision.
4081 Sort by decreasing size.
4082
40832008-11-04 Akim Demaille <demaille@gostai.com>
4084
4085 Don't memcpy C++ structures.
4086 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
4087 arguments.
4088 (variant::build): New overload for
4089 copy-construction-that-destroys.
4090 (variant::swap): New.
4091 (parser::yypush_): Use it in variant mode.
4092
40932008-11-04 Akim Demaille <demaille@gostai.com>
4094
4095 Better defaults for bench.pl.
4096 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
4097 default values.
4098 Adjust &verbose uses.
4099 (-q, --quiet): New.
4100
41012008-11-04 Akim Demaille <demaille@gostai.com>
4102
4103 Make variant.yy more complex.
4104 std::list cannot be copied via memcpy, they are more demanding than
4105 std::string. Use one std::list to strengthen the test.
4106
4107 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
4108 Adjust.
4109 Create a list of strings, instead of a single large string.
4110
41112008-11-04 Akim Demaille <demaille@gostai.com>
4112
4113 bench.pl --bench.
4114 * etc/bench.pl.in (--bench, $bench): New.
4115
41162008-11-04 Akim Demaille <demaille@gostai.com>
4117
4118 Sort methods.
4119 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
4120 Define it after as().
4121
41222008-11-04 Akim Demaille <demaille@gostai.com>
4123
4124 Useless parens.
4125 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
4126
41272008-11-04 Akim Demaille <demaille@gostai.com>
4128
4129 Issue missing synclines after user actions.
4130 * data/c.m4 (b4_case): Issue synclines on the output file.
4131
41322008-11-04 Akim Demaille <demaille@gostai.com>
4133
4134 Remove trailing empty line.
4135 * data/lalr1-fusion.cc: Don't add an empty line after the user's
4136 epilogue.
4137
41382008-11-04 Akim Demaille <demaille@gostai.com>
4139
4140 Fix output of copyright years.
4141 * data/bison.m4 (b4_copyright): Fix the indentation of the
4142 copyright year paragraph.
4143 Use b4_copyright_years when no years are given.
4144 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
4145 (b4_copyright_years): New.
4146 Use it.
4147
41482008-11-04 Akim Demaille <demaille@gostai.com>
4149
4150 Avoid the spurious initial empty line.
4151 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
4152 the end of @output request to suppress the empty line that
4153 results.
4154
41552008-11-04 Akim Demaille <demaille@gostai.com>
4156
4157 Remove parser::rhs_number_type.
4158 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
4159 (yyrhs_): Use b4_table_define.
4160
41612008-11-04 Akim Demaille <demaille@gostai.com>
4162
4163 Fix iteration type.
4164 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
4165
41662008-11-04 Akim Demaille <demaille@gostai.com>
4167
4168 Factor the declaration of the integer tables.
4169 * data/lalr1-fusion.cc (b4_table_define): New.
4170 Use it.
4171
41722008-11-03 Akim Demaille <demaille@gostai.com>
4173
4174 Fix indentation of tables in lalr1.cc
4175 * data/lalr1-fusion.cc: Fix the indentation.
4176
41772008-11-03 Akim Demaille <demaille@gostai.com>
4178
4179 Destroy the lhs symbols after reduction.
4180 * data/lalr1-fusion.cc (parse): After the user action, when in
4181 variant mode, destroy the lhs symbols.
4182
41832008-11-03 Akim Demaille <demaille@gostai.com>
4184
4185 Simplify yysyntax_error_ use.
4186 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
4187 type, but make it unnamed in the declaration when it is not used.
4188
41892008-11-03 Akim Demaille <demaille@gostai.com>
4190
4191 Let yy::variant::build return an lvalue.
4192 * data/lalr1-fusion.cc (variant::build): Return a reference to the
4193 object.
4194
41952008-11-03 Akim Demaille <demaille@gostai.com>
4196
4197 Define yy::variant only when needed.
4198 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
4199 used.
4200
42012008-11-03 Akim Demaille <demaille@gostai.com>
4202
4203 Bench the three-stack lalr1.cc.
4204 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
4205 one-stack one.
4206
42072008-11-03 Akim Demaille <demaille@gostai.com>
4208
4209 Fail on parse error in calc++.
4210 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
4211 status.
4212 * examples/calc++/test ($me, $number, $exit, run): New.
4213 Use them to propagate errors to the exit status.
4214
42152008-11-03 Akim Demaille <demaille@gostai.com>
4216
4217 Don't specify the skeleton twice in the example.
4218 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
4219 file does what is needed.
4220
42212008-11-03 Akim Demaille <demaille@gostai.com>
4222
4223 bench: Improve output.
4224 * etc/bench.pl.in (bench_grammar): Tune the printf format.
4225
42262008-11-03 Akim Demaille <demaille@gostai.com>
4227
4228 bench: check impact of %debug on variants.
4229 * etc/bench.pl.in (variant_grammar): Fix the computation of
4230 $variant.
4231 Generate a grammar file that can work with or without %debug.
4232 Do use the @directive.
4233 (bench_variant_parser): Check impact of %debug.
4234 (@directives): Rename all the occurrences to...
4235 (@directive): this, for consistency.
4236
42372008-11-03 Akim Demaille <demaille@gostai.com>
4238
4239 bench: report the size too.
4240 * etc/bench.pl.in ($iterations): Defaults to -3.
4241 (&bench_grammar): Require hireswallclock.
4242 Compute and display the size of the result.
4243 More comments.
4244
42452008-11-03 Akim Demaille <demaille@gostai.com>
4246
4247 bench: More use of the verbosity level.
4248 * etc/bench.pl.in ($verbose, &verbose): New.
4249 Use them.
4250 More POD documentation.
4251
42522008-11-03 Akim Demaille <demaille@gostai.com>
4253
4254 bench.pl: a command line interface
4255 * etc/bench.pl.in: More doc.
4256 Some fixes in the documentation.
4257 ($cflags, $iterations, &help, &getopt): New.
4258 Use them.
4259 (&variant_grammar): Let the number of stages be 10 times what is
4260 specified.
4261
42622008-11-03 Akim Demaille <demaille@gostai.com>
4263
4264 Bench the use of Boost.Variants.
4265 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
4266 New.
4267 (&compile): Be ready to compile C++ parsers.
4268 (&bench_push_parser): Move debug information to the outermost
4269 level.
4270 * THANKS: Add Michiel De Wilde.
4271
42722008-11-03 Akim Demaille <demaille@gostai.com>
4273
4274 bench.pl: Pass directives as a list instead of as a string.
4275 * etc/bench.pl.in (&directives): New.
4276 (&triangular_grammar, &calc_grammar): Use it to format the Bison
4277 directives.
4278 (&triangular_grammar): Do use the directives (were ignored).
4279 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
4280 directives.
4281
42822008-11-03 Akim Demaille <demaille@gostai.com>
4283
4284 Improve genericity of bench.pl.
4285 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
4286 argument.
4287 (&bench_push_parser): New.
4288 Call it.
4289
42902008-11-03 Akim Demaille <demaille@gostai.com>
4291
4292 Add documentation to bench.pl.
4293 * etc/bench.pl.in: Comment changes.
4294
42952008-11-03 Akim Demaille <demaille@gostai.com>
4296
4297 Fuse the three stacks into a single one.
4298
4299 In order to make it easy to perform benchmarks to ensure that
4300 there are no performance loss, lalr1.cc is forked into
4301 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
4302 lalr1.cc.
4303
4304 Meanwhile, to make sure that lalr1-fusion.cc is correctly
4305 exercized by the test suite, the user must install a symbolic link
4306 from lalr1.cc to it.
4307
4308 Instead of having three stacks (state, value, location), use a
4309 stack of triples. This considerably simplifies the code (and it
4310 will be easier not to require locations as currently does the C++
4311 parser), and also gives a 10% speedup according to
4312 etc/bench (probably mainly since memory allocation is done once
4313 instead of three times).
4314
4315 Another motivation is to make it easier to destruct properly
4316 semantic values: now that they are bound to their state (hence
4317 symbol type) it will be easier to call the appropriate destructor.
4318
4319 These changes should probably benefit the C parser too.
4320
4321 * data/lalr1.cc: Copy as...
4322 * data/lalr1-fusion.cc: this new file.
4323 (b4_rhs_value, b4_rhs_location): New definitions overriding those
4324 from c++.m4.
4325 (state_stack_type, semantic_stack_type, location_stack_type)
4326 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
4327 (data_type, stack_type, yystack_): New.
4328 (YYLLOC_DEFAULT, yypush_): Adjust.
4329 (yyerror_range): Now based on data_type, not location_type.
4330
43312008-11-03 Akim Demaille <demaille@gostai.com>
4332
4333 Push the state, value, and location at the same time.
4334 This is needed to prepare a forthcoming patch that fuses the three
4335 stacks into one.
4336
4337 * data/lalr1.cc (parser::yypush_): New.
4338 (parser::yynewstate): Change the semantics: instead of arriving to
4339 this label when value and location have been pushed, but yystate
4340 is to be pushed on the state stack, now the three of them must
4341 have been pushed before. yystate still must be the new state.
4342 This allows to use yypush_ everywhere instead of individual
4343 handling of the stacks.
4344
43452008-11-03 Akim Demaille <demaille@gostai.com>
4346
4347 Prefer references to pointers.
4348 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
4349 definition to use references instead of pointers.
4350 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
4351 Take the value and location as references.
4352 Adjust callers.
4353
43542008-11-03 Akim Demaille <demaille@gostai.com>
4355
4356 stack::size instead of stack::height.
4357 * data/lalr1.cc (stack::height): Rename as...
4358 (stack::size): this.
4359 Fix the output type.
4360 Comment changes.
4361
43622008-11-03 Akim Demaille <demaille@gostai.com>
4363
4364 Use variants to support objects as semantic values.
4365 This patch was inspired by work by Michiel De Wilde. But he used
4366 Boost variants which (i) requires Boost on the user side, (ii) is
4367 slow, and (iii) has useless overhead (the parser knows the type of
4368 the semantic value there is no reason to duplicate this
4369 information as Boost.Variants do).
4370
4371 This implementation reserves a buffer large enough to store the
4372 largest objects. yy::variant implements this buffer. It was
4373 implemented with Quentin Hocquet.
4374
4375 * src/output.c (type_names_output): New.
4376 (output_skeleton): Invoke it.
4377 * data/c++.m4 (b4_variant_if): New.
4378 (b4_symbol_value): If needed, provide a definition for variants.
4379 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
4380 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
4381 (b4_char_sizeof, yy::variant): New.
4382 (parser::parse): If variants are requested, define
4383 parser::union_type, parser::variant, change the definition of
4384 semantic_type, construct $$ before running the user action instead
4385 of performing a default $$ = $1.
4386 * examples/variant.yy: New.
4387 Based on an example by Michiel De Wilde.
4388
43892008-11-03 Akim Demaille <demaille@gostai.com>
4390
4391 Parameterize the extraction of semantic values.
4392 To make future changes easier, no longer rely on ".TYPE" being the
4393 way to get a semantic value.
4394
4395 * data/c.m4 (b4_symbol_value): New.
4396 Use it.
4397 * data/c++.m4, data/yacc.c: Use it.
4398 * data/glr.c: Use b4_symbol_value.
4399 (b4_rhs_data): New.
4400 Use it.
4401
44022008-11-03 Akim Demaille <demaille@gostai.com>
4403
4404 Prepare easier M4 changes.
4405 * data/lalr1.cc: Use escaped [] instead of literals to prepare
4406 future changes.
4407
44082008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4409
4410 Initiate further development.
4411 * NEWS: Create an empty section for new entries.
4412 * gnulib: Update submodule to HEAD.
4413
44142008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4415
4416 * NEWS: Version 2.4.
4417
44182008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4419
4420 Prepare for next release.
4421 * NEWS: Briefly mention changes since 2.3b.
4422 * README: Say GNU m4 1.4.6, which we've been requiring in release
4423 announcements already, not 1.4.3, which breaks the build.
4424
44252008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
4426
4427 Say %language is experimental.
4428 We're thinking of extending it's effect on output file naming. See the
4429 thread at
4430 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
4431 * NEWS: Say it's experimental.
4432 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
4433 recommend it over %skeleton for now.
4434 (Bison Options): Likewise.
4435 (C++ Bison Interface): Use %skeleton not %language.
4436 (Calc++ Parser): Use %skeleton not %language.
4437 * src/getargs.c (usage): Say it's experimental.
4438
44392008-11-01 Di-an Jan <dianj@freeshell.org>
4440 Paolo Bonzini <bonzini@gnu.org>
4441
4442 Support all Java parser class modifiers.
4443 * data/java.m4 (b4_percent_define_get3): New.
4444 (b4_final_if, b4_strictfp_if): New.
4445 * data/lalr1.java (final, strictfp, extends, implements): Support.
4446 * doc/bison.texinfo (final, strictfp, extends, implements): Add
4447 documentation.
4448 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
4449 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
4450 (AT_CHECK_JAVA_GREP): New.
4451 (Java parser class modifiers): New test.
4452 (Java parser class extends and implements): New test.
4453
4454 Model exception propagation better with throws and lex_throws.
4455 * data/java.m4 (b4_list2): New.
4456 (throws): Change default.
4457 * data/lalr1.java (yyaction): Add throws.
4458 (parse): Add lex_throws in addition to throws.
4459 * doc/bison.texinfo (throws, lex_throws): Add documentation.
4460 * tests/java.at (Java throws specifications): New test.
4461
4462 Improve documentation for Java parsers.
4463 * doc/bison.texinfo (Java Parsers): Add subsections.
4464 Don't quote first argument of %define.
4465 (Java Bison Interface): Document output files. Move documentation
4466 of parser class and merge into Java Parser Interface. Document
4467 features that error out. Document directives with no effect.
4468 Move note about Javadoc higher.
4469 (Java Semantic Values): Explicitly mention stype.
4470 Document that generic types cannot be used.
4471 (Java Location Values): Use @deftypeivar. Document constructors.
4472 Correct return value for toString.
4473 (Java Parser Interface): List undocumented constants/fields.
4474 Move documentation of fields added by %parse-param closer to list
4475 of members. Document that token names are added as fields.
4476 Document constructors accurately. Remove error method.
4477 (Java Scanner Interface): Move note on %pure-parser to Java Bison
4478 Interface. Describe %code lexer and yylex accutately.
4479 Remove documentation that does not match the code.
4480 (Java Action Features): New.
4481 (Java Differences): Add reference. Add item on semantic values.
4482 Add note about @{ ... @}. Clarify %% epilogue placement.
4483 (Java Declarations Summary): New.
4484
4485 Fix Java skeleton.
4486 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
4487 (b4_remove_comma): Quote test argument.
4488 (b4_identification): Remove "bison" field.
4489 * tests/java.at (Java parser class and package names): New test.
4490 (Java %parse-param and %lex-param): New test.
4491 (Java stype, position_class and location_class): New test.
4492
44932008-10-31 Di-an Jan <dianj@freeshell.org>
4494
4495 * data/lalr1.jave: Update copyright years.
4496 (YYParser): Correct name of "generated from" file in Javadoc:
4497 use b4_file_name instead of @ofile@.
4498 (Location constructor): Correct Javadoc parameter name.
4499 (yylloc): Add missing opening m4 quote after b4_location_if.
4500 This removes a stray [ in the Javadoc of Lexer.getStartPos.
4501 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
4502 (YYParser constructor): Correct Javadoc parameter name.
4503
45042008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
4505
4506 Always put auxiliary code files in the same dir as other output files.
4507 * src/files.c (compute_file_name_parts): When the user specifies
4508 --output but not --file-prefix, extract the directory prefix from the
4509 file prefix not from the grammar file name. This affects the location
4510 of files like location.hh generated by the C++ skeleton. The includes
4511 in the other output files require this fix.
4512 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
4513 for expected output files.
4514 (Output files): Add a test for the above.
4515
45162008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
4517
4518 * gnulib: Update submodule to HEAD.
4519
45202008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4521
4522 Update copyright year.
4523 * src/files.c: Here.
4524
45252008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
4526
4527 Don't overwrite the input file.
4528 * src/files.c (output_file_name_check): Fatal error if using input file
4529 for output.
4530 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
4531 argument.
4532 (Conflicting output files): Add test.
4533
45342008-10-28 Akim Demaille <demaille@gostai.com>
4535
4536 Space changes.
4537 * data/lalr1.cc: Formatting changes.
4538
45392008-10-28 Akim Demaille <demaille@gostai.com>
4540
4541 Don't define debugging functions when !YYDEBUG.
4542 * data/lalr1.cc (debug_stream, set_debug_stream)
4543 (debug_level_type, debug_level, set_debug_level): Don't
4544 declare them when YYDEBUG is not defined.
4545 The implementation are already YYDEBUG-aware.
4546
45472008-10-28 Akim Demaille <demaille@gostai.com>
4548
4549 Prefer "continue" for empty loop bodies.
4550 * etc/bench.pl.in: Use "continue" instead of {}.
4551
45522008-10-28 Akim Demaille <demaille@gostai.com>
4553
4554 Space and comments changes.
4555 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
4556 * data/c.m4, data/lalr1.cc: Space changes.
4557
45582008-10-28 Akim Demaille <demaille@gostai.com>
4559
4560 Make gnulib a submodule.
4561 * gnulib: New.
4562 * .gitmodules (gnulib): New.
4563
45642008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4565
4566 Fix yyerror_range for user-defined location type in C++. Reported by
4567 Georg Sauthoff at
4568 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
4569 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
4570 * THANKS (Georg Sauthoff): Add.
4571
45722008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
4573
4574 Update several administrative files mainly to facilitate releasing.
4575 * HACKING (Administrivia): Make the git-merge-changelog notes more
4576 helpful.
4577 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
4578 (Release Procedure): Update for git and add numerous details that were
4579 previously missing.
4580 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
4581 * maint.mk (announcement): Don't list bison as a bootstrap tool so
4582 that announcements don't claim we bootstrapped with whatever bison
4583 happened to be in PATH. Add flex as a bootstrap tool.
4584 * Makefile.maint: Remove, previously replaced by maint.mk.
4585 * Makefile.cfg: Remove, and migrate settings to...
4586 * cfg.mk: ... here for the sake of `make announcement'.
4587 * bootstrap.conf (gnulib_modules): Add announce-gen.
4588 * README: Say GNU Bison instead of just Bison. Suggested by Karl
4589 Berry.
4590
45912008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
4592
4593 Small but important bugfixes for the Java skeleton.
4594 * data/lalr1.java (yyerror): Change Location to b4_location_type.
4595 (yy_symbol_print): Call toString on yyvaluep.
4596
45972008-08-29 Akim Demaille <demaille@gostai.com>
4598
4599 Clarify UPDATED use.
4600 * doc/bison.texinfo: It refers to the last edition of this file,
4601 not to the release date of Bison.
4602 Reported by Joel E. Denny.
4603
46042008-08-29 Akim Demaille <demaille@gostai.com>
4605
4606 * README: Update FAQ pointer.
4607 Reported by Joel E. Denny.
4608
46092008-08-27 Eric Blake <ebb9@byu.net>
4610
4611 Resync m4sugar from autoconf.
4612 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
4613 (m4_init): Adjust to latest m4.git changes.
4614 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
4615 effects.
4616 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
4617 (_m4_list_cmp): Reduce side effects.
4618
46192008-08-27 Akim Demaille <demaille@gostai.com>
4620
4621 Check yyerrok in calc.at.
4622 * tests/calc.at (calc.y): Use yyerrok on "( error )".
4623 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
4624 expected.
4625
46262008-08-27 Akim Demaille <demaille@gostai.com>
4627
4628 Support yyerrok in lalr1.cc.
4629 YYBACKUP is still to import back into lalr1.cc.
4630 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
4631
46322008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4633
4634 For maintainer-check*, don't recompile for a $(VERSION) update.
4635 * cfg.mk: New file.
4636 (_is-dist-target): Override the one in GNUmakefile.
4637 * Makefile.am (EXTRA_DIST): Add cfg.mk.
4638
46392008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
4640
4641 Update for recent change to gnulib.
4642 * src/parse-gram.y: Don't include strverscmp.h. It comes from
4643 string.h now.
4644
46452008-08-15 Eric Blake <ebb9@byu.net>
4646
4647 Remaining m4sugar merge from autoconf.
4648 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
4649 * data/m4sugar/foreach.m4: New file, copied from autoconf.
4650 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
4651 * src/output.c (output_skeleton): Tell m4 how to find it.
4652
4653 Partial m4sugar merge from autoconf: m4_map.
4654 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
4655 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
4656 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
4657 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
4658 for empty list.
4659 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
4660 Likewise.
4661 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
4662 declares it.
4663
46642008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
4665
4666 Keep .version and PACKAGE_VERSION in sync.
4667 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
4668 dependency, and add comments justifying this in more detail. Discussed
4669 starting at
4670 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
4671
46722008-08-06 Eric Blake <ebb9@byu.net>
4673
4674 Partial m4sugar merge from autoconf: m4_shiftn.
4675 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
4676 (m4_shift2, m4_shift3): New macros.
4677 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
4678 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
4679 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
4680 * data/java.m4 (b4_remove_comma): Likewise.
4681
4682 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
4683 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
4684 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
4685 (m4_init): Consolidate wrapped text into single m4_wrap.
4686 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
4687 in wrapped text.
4688
46892008-08-05 Eric Blake <ebb9@byu.net>
4690
4691 Partial m4sugar merge from autoconf: builtins, version.m4.
4692 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
4693 (m4_prepend): Remove, as it is unused and inherently quadratic,
4694 whereas m4_append is linear in newer m4.
4695 (m4_mkstemp): New builtin.
4696 (m4_symbols): Make rename conditional.
4697 (m4_version_prereq): Ensure fatal error if used in bison, which
4698 intentionally lacks version.m4.
4699
4700 Fix comments in m4sugar.
4701 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
4702
47032008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
4704
4705 Update for recent .gitignore fix in Gnulib.
4706 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
4707 anchored .gitignore entries.
4708
47092008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
4710
4711 Set gnu or gnits strictness.
4712 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
4713 development and gnits strictness for releases. Based on Eric Blake's
4714 suggestion at
4715 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
4716
47172008-07-31 Paolo Bonzini <bonzini@gnu.org>
4718
4719 * NEWS: Clarify documentation of %language.
4720
47212008-07-31 Paolo Bonzini <bonzini@gnu.org>
4722
4723 Support usage of git-merge-changelog.
4724 * .gitattributes: New.
4725 * HACKING: Document usage of git-merge-changelog.
4726 * bootstrap: Install git-merge-changelog entries in .git/config
4727 if appropriate.
4728
47292008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4730
4731 Remove remaining dependence on CVS Id keyword.
4732 * ChangeLog: For the sake of people still using CVS, don't use dollars
4733 when mentioning Id.
4734 * data/xslt/bison.xsl: Remove Id from header comments, where it was
4735 unusual anyway.
4736 * data/xslt/xml2dot.xsl: Likewise.
4737 * data/xslt/xml2text.xsl: Likewise.
4738 * data/xslt/xml2xhtml.xsl: Likewise.
4739 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
4740 * doc/Makefile.am (neutralize): Remove, no longer needed.
4741 (.x.1): Don't use neutralize.
4742 (edit): Don't substitute for ID.
4743 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
4744
47452008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4746
4747 Fix dependence on computed configure variables.
4748 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
4749 $(top_srcdir)/configure.ac so that changes to computed variables, such
4750 as PACKAGE_VERSION, are seen.
4751 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
4752
47532008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
4754
4755 Update copyright dates for recent changes.
4756 * Makefile.am: Here.
4757 * src/Makefile.am: Here.
4758 * src/reduce.c: Here.
4759 * tests/reduce.at: Here.
4760
47612008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
4762
4763 Use git-version-gen for version names between releases.
4764 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
4765 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
4766 * .prev-version: New.
4767 * .version.in: Remove.
4768 * ChangeLog: Remove the Id previously used for capturing the CVS
4769 revision.
4770 * GNUmakefile: Remove, now copied from Gnulib.
4771 * Makefile.am: Add code suggested by comments in
4772 build-aux/git-version-gen.
4773 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
4774 .prev-version, and .version.
4775 * NEWS (2.3b+): Rename to...
4776 (?.?): ... this because we're dropping the "+" version naming scheme,
4777 but, in general, we still can't be sure of our next release name.
4778 * bootstrap: Add a quick hack to remove from .gitignore the
4779 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
4780 entry. This should really be fixed in gnulib instead.
4781 * bootstrap.conf (gnulib_modules): Add gnumakefile.
4782 * configure.ac (AC_INIT): Set version name by invoking
4783 build-aux/git-version-gen.
4784 (AC_CONFIG_FILES): Remove .version, now generated by
4785 build-aux/git-version-gen.
4786 * maint.mk: New, copied from coreutils.
4787 * doc/.cvsignore (bison.1): Add.
4788 * doc/.gitignore (/bison.1): Add.
4789 * doc/bison.1: Remove, generated.
4790 * src/.cvsignore (revision.c): Remove.
4791 * src/.gitignore (/revision.c): Remove.
4792 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
4793 (BUILT_SOURCES): Remove revision.c.
4794 (revision.c): Remove.
4795 * src/getargs.c (version): Don't print revision after the VERSION.
4796 * src/revision.h: Remove.
4797
47982008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4799
4800 Fix untranslatable composition of sentences. Reported by Goran
4801 Uddeborg at
4802 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
4803 * THANKS (Goran Uddeborg): Add.
4804 * src/reduce.c (reduce_print): Report the number of nonterminals and
4805 rules useless in the grammar in separate sentences.
4806 * tests/reduce.at (Useless Rules): Update output.
4807 (Reduced Automaton): Likewise.
4808 (Underivable Rules): Likewise.
4809 (Empty Language): Likewise.
4810
48112008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4812
4813 Fix some .gitignore and .cvsignore problems.
4814 * bootstrap (insert_sorted_if_absent): Replace all uses with...
4815 (insert_vc_ignore): ... this new function, which prepends `/' to all
4816 .gitignore entries before passing them to insert_sorted_if_absent.
4817 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
4818 .cvsignore files are maintained even though Bison developers run
4819 bootstrap while using Git.
4820 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
4821 unneeded by Bison.
4822 (gnulib): Add.
4823 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
4824 unneeded. Reported by Eric Blake.
4825 * lib/.gitignore (/*~): Add.
4826 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
4827 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
4828 Blake.
4829 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
4830
48312008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4832
4833 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
4834 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
4835 * bootstrap.conf (gnulib_modules): Add unsetenv.
4836 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
4837 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
4838 (/setenv.m4): Add.
4839 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
4840 the first argument because it may become position-dependent, and unset
4841 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
4842 Add comments explaining these issues in more detail.
4843
48442008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
4845
4846 Add .gitignore everywhere based on .cvsignore.
4847 * .gitignore: New.
4848 * build-aux/.gitignore: New.
4849 * data/.gitignore: New.
4850 * doc/.gitignore: New.
4851 * etc/.gitignore: New.
4852 * examples/.gitignore: New.
4853 * examples/calc++/.gitignore: New.
4854 * lib/.gitignore: New.
4855 * m4/.gitignore: New.
4856 * po/.gitignore: New.
4857 * runtime-po/.gitignore: New.
4858 * src/.gitignore: New.
4859 * tests/.gitignore: New.
4860
48612008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4862
4863 * NEWS (2.3b+): New section, empty for now.
4864 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
4865
48662008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4867
4868 * NEWS (2.3b): Update release date since there has been a delay in
4869 getting the announcements and tarballs out.
4870
48712008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
4872
4873 * NEWS: Version 2.3b.
4874 * configure.ac (AC_INIT): Likewise.
4875 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
4876
48772008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
4878
4879 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
4880 been doing it for years.
4881 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
4882 (Release Procedure): Add FIXME about make alpha being unmaintained.
4883
48842008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
4885
4886 * data/yacc.c: Reformat m4 a little for readability.
4887 * src/lalr.c (build_relations): Correct comment.
4888
48892008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4890
4891 DJGPP specific issue.
4892 * djgpp/config.sed: Fixes required to run configure scripts generated
4893 by autoconf 2.62.
4894
48952008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4896
4897 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
4898 coordinator@translationproject.org.
4899
49002008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4901
4902 * THANKS: Add Eric Blake.
4903
49042008-04-23 Eric Blake <ebb9@byu.net>
4905
4906 Revert prior patch, by working around autoconf regression.
4907 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
4908 ("Output file name: ("): Uncomment test.
4909 ("Output file name: )"): Likewise.
4910 Based on an idea from Noah Misch.
4911
49122008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4913
4914 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
4915 2.61. Reported by Juan Manuel Guerrero at
4916 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
4917 * tests/output.at ("Output file name: ("): Comment out test case for
4918 now.
4919 ("Output file name: )"): Likewise.
4920
49212008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4922
4923 * GNUmakefile: Update git-version-gen invocation so make dist
4924 succeeds.
4925
49262008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4927
4928 Update to the current gnulib CVS repository, and fix trigraph handling
4929 in Bison.
4930 * bootstrap: Update gnulib CVS repository URL.
4931 (symlink_to_dir): Encapsulate the code that guarantees the destination
4932 directory exists into...
4933 (check_dst_dir): ... this new function, and...
4934 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
4935 fail when copying files into lib/uniwidth/.
4936 * src/output.c (prepare_symbols): When writing yytname muscles, where
4937 symbol names will be encoded in C-string literals, tell quotearg to
4938 escape trigraphs. This used to be the default in gnulib.
4939 * tests/regression.at (Token definitions): Because of the change in
4940 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
4941 escapes trigraphs in symbol names. Thus, yytname no longer has
4942 trigraphs unnecessarily doubly escaped. Update test case output.
4943 Extend test case to be sure Bison's own error messages will no longer
4944 have trigraphs in symbol names unnecessarily escaped once.
4945
49462008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
4947
4948 Fix make dist infinite loop reported by Juan Manuel Guerrero at
4949 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
4950 * .cvsignore: Add .version.
4951 * .version.in: New.
4952 * bootstrap.conf (gnulib_modules): Add git-version-gen.
4953 * configure.ac (AC_CONFIG_FILES): Add .version.
4954 * build-aux/.cvsignore: Add git-version-gen.
4955
49562008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4957
4958 * NEWS (2.3a+): Mention that -g now takes an argument.
4959 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
4960 consistency. Update the -g and -x entries now that they take
4961 arguments. Use brackets to indicate optional arguments.
4962 * src/getargs.c (usage): Explain the relationship between arguments of
4963 long and short options more completely. Document --defines and -d
4964 separately since the former takes an argument but, for POSIX Yacc, the
4965 latter does not.
4966 (short_options): Let -W take an optional argument like --warnings.
4967 (getargs): Sort cases.
4968
49692008-02-28 Akim Demaille <demaille@gostai.com>
4970
4971 * doc/bison.texinfo: Fix a few typos.
4972
49732008-02-28 Akim Demaille <akim@epita.fr>
4974
4975 * doc/bison.texinfo (Bison Options): Document -W.
4976 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
4977
49782008-02-28 Akim Demaille <akim@epita.fr>
4979
4980 * src/getargs.c (short_options): Split and sort for readability.
4981 -g and -x take optional arguments, just like their long options.
4982 * build-aux/cross-options.pl: Use /x to make the regexp easier to
4983 understand.
4984 Fix the handling of $opt which resulted in all the argument to be
4985 considered as optional.
4986
49872008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
4988
4989 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
4990 say its interface is experimental.
4991 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4992 Java.
4993 (Bison Options): In the -L and --language entry, mention Java.
4994 (Java Bison Interface): Say the interface is experimental.
4995 * src/getargs.c (usage): Mention -L and --language.
4996
4997 * NEWS (2.3a+): Say the push parsing interface is experimental.
4998 * doc/bison.texinfo (Push Decl): Likewise.
4999 (Decl Summary): Likewise in the "%define api.push_pull" entry.
5000 (Push Parser Function): Likewise.
5001 (Pull Parser Function): Likewise.
5002 (Parser Create Function): Likewise.
5003 (Parser Delete Function): Likewise.
5004 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
5005 yypull_parse, and yypush_parse entries.
5006
5007 * NEWS (2.3a+): Mention XML support, and say the schema is
5008 experimental.
5009 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
5010 * src/getargs.c (usage): Say the XML schema is experimental.
5011
5012 * NEWS (2.3a+): Say option instead of flag.
5013
50142008-02-21 Wojciech Polak <polak@gnu.org>
5015
5016 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
5017 text.
5018
50192008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
5020
5021 Fix impure push parser compile error reported by Bob Rossi at
5022 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
5023 * data/yacc.c: Clean up whitespace in the output a little.
5024 (yypstate_allocated): Define for impure push parsers regardless of
5025 whether the pull interface is also requested.
5026 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
5027 check impure push parsers without the pull interface.
5028
5029 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
5030 yyerror takes arguments specified by %parse-param while yypstate_new
5031 does not.
5032 * doc/bison.texinfo (Parser Create Function): Document that
5033 yypstate_new returns 0 for multiple impure parser instances.
5034 * tests/push.at (Push Parsing: Multiple impure instances): Update
5035 expected stderr output.
5036
50372008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
5038
5039 * runtime-po/POTFILES.in (push.c): Remove.
5040
50412008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
5042
5043 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
5044 * data/push.c: Rename to...
5045 * data/yacc.c: ... this, overwriting it.
5046 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
5047 `%push-pull-parser' -> `%define api.push_pull "both"'.
5048 Remove old yacc.c tests, and update push.c tests to yacc.c.
5049
50502008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
5051
5052 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
5053 `"%code top" blocks' instead of `%code "top" blocks'.
5054 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
5055 Clean up whitespace in the output a little.
5056
50572008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
5058
5059 Fix documentation problems reported by Tim Josling at
5060 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
5061 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
5062 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
5063 integers. Explain the effect of literal string aliases on error
5064 messages. Copy token 0 documentation from the C++ skeleton
5065 documentation.
5066
50672008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
5068
5069 Accept a token number in a %left, %right, or %nonassoc for POSIX
5070 conformance. Reported by Tim Josling at
5071 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
5072 * NEWS (2.3a+): Mention.
5073 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
5074 and code numbers are treated by precedence declarations.
5075 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
5076 of symbols.1.
5077 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
5078 of symbol.
5079 (symbol.prec): New, just like symbol but allows INT.
5080 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
5081 longer holds.
5082 * tests/regression.at (Token number in precedence declaration): New
5083 test case.
5084
50852008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5086
5087 DJGPP specific issues.
5088 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
5089 be changed. Copyright timestamp adjusted.
5090 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
5091 be changed. Copyright timestamp adjusted.
5092 * djgpp/config.site: Copyright timestamp adjusted.
5093 * djgpp/config_h.sed: Copyright timestamp adjusted.
5094 * djgpp/djunpack.bat: Copyright timestamp adjusted.
5095 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
5096 filename translation list.
5097 * djgpp/subpipe.c (init_subpipe): Check the environment variables
5098 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
5099 files shall be created. Before trying to use the temp dir where the
5100 environment variable points to check that the dir really exists. If
5101 not default to the cwd as temp dir. Copyright timestamp adjusted.
5102 * djgpp/subpipe.h: Copyright timestamp adjusted.
5103 * djgpp/testsuite.sed: Copyright timestamp adjusted.
5104
51052008-01-30 Paul Eggert <eggert@cs.ucla.edu>
5106
5107 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
5108
51092008-01-09 Paul Eggert <eggert@cs.ucla.edu>
5110
5111 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
5112 Problem reported by Claudio Saavedra in
5113 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
5114
51152008-01-05 Wojciech Polak <polak@gnu.org>
5116
5117 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
5118 document's title with the input grammar file name.
5119
51202007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
5121
5122 Automate regression testing of the XML/XSLT implementation. Discussed
5123 starting at
5124 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
5125 * configure.ac (XSLTPROC): New substitution.
5126 * Makefile.am (maintainer-xml-check): New phony target invoking...
5127 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
5128 invoking make maintainer-check with BISON_TEST_XML=1.
5129 * tests/atlocal.in (XSLTPROC): New.
5130 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
5131 not to report reachable memory when Bison is expected to have a
5132 non-zero exit status and (2) to compare XML/XSLT output with --graph
5133 and --report=all output for every working grammar when
5134 BISON_TEST_XML=1.
5135 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
5136 (AT_BISON_CHECK_XML): New.
5137 (AT_QUELL_VALGRIND): New.
5138 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
5139 (AT_CHECK): ... don't redefine this since this was the old way to
5140 quell Valgrind.
5141 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
5142 AT_BISON_CHECK invocations.
5143 * tests/c++.at: Likewise.
5144 * tests/calc.at: Likewise.
5145 * tests/conflicts.at: Likewise.
5146 * tests/cxx-type.at: Likewise.
5147 * tests/existing.at: Likewise.
5148 * tests/glr-regression.at: Likewise.
5149 * tests/headers.at: Likewise.
5150 * tests/input.at: Likewise.
5151 * tests/java.at: Likewise.
5152 * tests/output.at: Likewise.
5153 * tests/push.at: Likewise.
5154 * tests/reduce.at: Likewise.
5155 * tests/regression.at: Likewise.
5156 * tests/sets.at: Likewise.
5157 * tests/skeletons.at: Likewise.
5158 * tests/synclines.at: Likewise.
5159 * tests/torture.at: Likewise.
5160 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
5161 tends to hang xsltproc.
5162 (Big horizontal): Likewise.
5163
51642007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
5165
5166 In XML output, remove redundant class attribute on symbol element.
5167 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
5168 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
5169 look up a symbol to determine whether it's a nonterminal or terminal.
5170 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
5171 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
5172
5173 Add prec/assoc information to XML output.
5174 * src/gram.c (grammar_rules_print_xml): For each rule that has a
5175 %prec, add a percent_prec attribute.
5176 * src/print-xml.c (print_grammar): For each terminal that has a
5177 precedence or associativity, add a prec or assoc attribute.
5178 (xml_indent): New.
5179 (xml_puts): Use xml_indent.
5180 (xml_printf): Use xml_indent.
5181 * src/print-xml.h (xml_indent): Prototype.
5182
5183 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
5184 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5185
51862007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
5187
5188 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
5189 (bison:ruleByNumber): ... this for clarity.
5190 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
5191 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
5192 (xsl:template match="reduction"): Update.
5193 (xsl:template match="item"): Update.
5194 (xsl:template match="reduction"): Update.
5195
5196 In the XML output, don't print the list of rules where symbols appear.
5197 Compute it in XSLT instead. Discussed at
5198 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
5199 * data/xslt/bison.xsl (bison:ruleByLhs): New.
5200 (bison:ruleByRhs): New.
5201 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
5202 bison:ruleByRhs.
5203 (xsl:template match="terminal/rule"): Remove.
5204 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5205 bison:ruleByRhs.
5206 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5207 Remove.
5208 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
5209 bison:ruleByRhs and mode="number-link" for rule template.
5210 (xsl:template match="terminal/rule"): Remove.
5211 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
5212 bison:ruleByRhs and mode="number-link" for rule template.
5213 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
5214 Rewrite as...
5215 (xsl:template match="rule" mode="number-link"): ... this.
5216 * src/print-xml.c (print_grammar): Don't print the list of rules.
5217
52182007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
5219
5220 Don't let --report affect XML output; always print all information.
5221 Discussed at
5222 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
5223 * src/conflicts.c (log_resolution): Implement.
5224 * src/print-xml.c (print_core): Implement.
5225 (print_state): Implement.
5226 (print_xml): Implement.
5227
5228 * NEWS (2.3a+): Fix quotes.
5229 * src/parse-gram.y (prologue_declaration): For consistency with -v,
5230 don't let %verbose clear the list specified by --report.
5231
52322007-11-26 Akim Demaille <akim@epita.fr>
5233
5234 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
5235
52362007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
5237
5238 In the XML output, list useless and unused symbols and rules with the
5239 useful ones and add a "usefulness" attribute. Discussed starting at
5240 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
5241 * src/gram.c (grammar_rules_partial_print_xml): Remove.
5242 (grammar_rules_print_xml): Print all rules instead of just those
5243 useful in the grammar, and add a "usefulness" attribute.
5244 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
5245 * src/print-xml.c (print_rules_useless_in_parser): Remove.
5246 (print_grammar): Print all nonterminals instead of just useful ones,
5247 and add a "usefulness" attribute to nonterminals and terminals.
5248 (print_xml): Don't print a separate "reductions" or
5249 "rules-useless-in-parser" element.
5250 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
5251 (reduce_xml): Remove.
5252 (reduce_token_unused_in_grammar): New.
5253 (reduce_nonterminal_useless_in_grammar): New.
5254 * src/reduce.h (reduce_xml): Remove prototype.
5255 (reduce_token_unused_in_grammar): Add prototype.
5256 (reduce_nonterminal_useless_in_grammar): Add prototype.
5257 * data/xslt/xml2text.xsl: Update for XML changes.
5258 * data/xslt/xml2xhtml.xsl: Update for XML changes.
5259 * tests/reduce.at (Useless Terminals): Update output.
5260 (Useless Rules): Update output.
5261 (Reduced Automaton): Update output.
5262
5263 Say "Terminals unused in grammar" instead of "Unused terminals".
5264 * NEWS (2.3a+): Update.
5265 * doc/bison.texinfo (Understanding): Update example output.
5266 * src/reduce.c (reduce_output): Implement.
5267 * data/xslt/xml2text.xsl: Implement.
5268 * data/xslt/xml2xhtml.xsl: Implement.
5269
52702007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
5271
5272 Accept --report-file=FILE to override the default `.output' filename.
5273 * NEWS (2.3a+): Mention.
5274 * doc/bison.texinfo (Bison Options): Add an entry.
5275 * src/files.c (compute_output_file_names): Don't override
5276 spec_verbose_file if already set.
5277 * src/getargs.c (usage): Document --report-file.
5278 (REPORT_FILE_OPTION): New anonymous enum member.
5279 (long_options): Add entry for it.
5280 (getargs): Add case for it setting spec_verbose_file.
5281
5282 * build-aux/cross-options.pl: Don't record a short option just because
5283 there's an arg.
5284 * doc/.cvsignore: Add yacc.1.
5285
52862007-11-14 Akim Demaille <akim@epita.fr>
5287
5288 * doc/yacc.1.in: New.
5289 * configure.ac, doc/Makefile.am: Adjust.
5290 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
5291 config.h symbol.
5292 Use AC_SUBST for assignments too.
5293 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
5294
52952007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
5296
5297 * src/gram.c: Remove comments that duplicate comments in gram.h.
5298
5299 When reporting useless rules and nonterminals, say "useless in grammar"
5300 instead of "useless", and say "useless in parser" instead of "never
5301 reduced". Discussed starting at
5302 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
5303 * NEWS (2.3a+): Mention this change.
5304 * data/xslt/xml2text.xsl: Update output text and expected input XML
5305 element names to match changes below.
5306 * data/xslt/xml2xhtml.xsl: Likewise.
5307 (xsl:template match="bison-xml-report"): Add missing entry in Table of
5308 Contents: "Rules useless in parser due to conflicts".
5309 * doc/bison.texinfo (Decl Summary): Reword a little.
5310 (Understanding): Update example output for changes below.
5311 * src/gram.c: (rule_useful_p): Rename to...
5312 (rule_useful_in_grammar_p): ... this.
5313 (rule_useless_p): Rename to...
5314 (rule_useless_in_grammar_p): ... this.
5315 (rule_never_reduced_p): Rename to...
5316 (rule_useless_in_parser_p): ... this.
5317 (grammar_rules_print): Update for renames.
5318 (grammar_rules_print_xml): Update for renames.
5319 (grammar_rules_never_reduced_report): Rename to...
5320 (grammar_rules_useless_report): ... this since it is used for either
5321 kind of useless rule.
5322 * src/gram.h: Reword comments and update function names in prototypes.
5323 * src/main.c (main): Say "rule useless in parser due to conflicts".
5324 * src/print-xml.c (print_rules_never_reduced): Rename to...
5325 (print_rules_useless_in_parser): ... this, and rename output XML
5326 element "rules-never-reduced" to "rules-useless-in-parser".
5327 (print_xml): Update for rename.
5328 * src/print.c (print_results): Say "Rules useless in parser due to
5329 conflicts".
5330 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
5331 (nonterminals_reduce): Say "nonterminal useless in grammar".
5332 (reduce_output): Say "Nonterminals useless in grammar".
5333 Say "Rules useless in grammar".
5334 (reduce_xml): Rename output XML element "useless" to
5335 "useless-in-grammar".
5336 (reduce_print): Don't report the count of grammatically useless rules
5337 as "rules never reduced" just because %yacc is specified.
5338 In the correct report of this count, say nonterminal(s) and rule(s)
5339 "useless in grammar".
5340 * tests/conflicts.at (S/R in initial): Update expected output.
5341 (Defaulted Conflicted Reduction): Likewise.
5342 (Unreachable States After Conflict Resolution): Likewise.
5343 * tests/existing.at (GNU pic Grammar): Likewise.
5344 * tests/reduce.at (Useless Nonterminals): Likewise.
5345 (Useless Rules): Likewise.
5346 (Reduced Automaton): Likewise.
5347 (Underivable Rules): Likewise.
5348 (Empty Language): Likewise.
5349
53502007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
5351
5352 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
5353 here document and before the EOF so that BSD's implementation of Bourne
5354 shell doesn't parse the delimiter as part of the here document.
5355 * doc/.cvsignore: Add cross-options.texi.
5356 * src/getargs.c (usage): Add a blank line after the warning categories.
5357
53582007-11-08 Paolo Bonzini <bonzini@gnu.org>
5359
5360 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
5361
53622007-11-05 Akim Demaille <akim@epita.fr>
5363
5364 Remove Id: from bison.1.
5365 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
5366 (perl -0777 -pi -e 's/\.PP\nId): New.
5367 (.x.1): Use it to ignore the version control revision.
5368
53692007-11-05 Akim Demaille <demaille@gostai.com>
5370
5371 * build-aux/Makefile.am: Ship cross-options.pl.
5372 * doc/Makefile.am: Always refer to cross-options.texi with
5373 $(srcdir).
5374 (MAINTAINERCLEANFILES): Add it.
5375
53762007-11-04 Akim Demaille <demaille@gostai.com>
5377
5378 Generate the long/short option cross-table.
5379 * build-aux/cross-options.pl: New.
5380 * doc/Makefile.am (cross-options.texi): New.
5381 * doc/bison.texinfo: Use it.
5382
53832007-11-04 Akim Demaille <demaille@gostai.com>
5384
5385 Generate bison.1 using help2man.
5386 * doc/common.x, doc/bison.x: New.
5387 * doc/Makefile.am (bison.1, .x.1): New.
5388 The code is taken from autoconf-2.61/man/Makefile.am.
5389 * configure.ac: Look for help2man.
5390
53912007-11-04 Akim Demaille <demaille@gostai.com>
5392
5393 Complete --help.
5394 * src/getargs.c (usage): Document -W, make it clear that -d,
5395 -g and -x have optional arguments.
5396
53972007-11-04 Akim Demaille <demaille@gostai.com>
5398
5399 Find sha1sum when named gsha1sum.
5400 * bootstrap (find_tool): New.
5401 ($SHA1SUM): New.
5402
54032007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5404
5405 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
5406 at
5407 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
5408 * NEWS (2.3a+): Mention.
5409 * data/bison.m4 (b4_pure_if): Don't define it here.
5410 * data/c.m4 (b4_identification): Depend on individual skeletons to
5411 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
5412 values of the %define variables api.pure or api.push_pull. Define
5413 YYPURE, YYPUSH, and YYPULL accordingly.
5414 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
5415 glr.cc has already defined b4_pure_flag.
5416 * data/push.c: Define b4_pure_if based on `%define api.pure'.
5417 Remove YYPUSH and YYPULL since they're back in b4_identification again.
5418 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
5419 * doc/bison.texinfo (Pure Decl): Update.
5420 (Push Decl): Update.
5421 (Decl Summary): Add api.pure to %define entry.
5422 In %pure-parser entry, say it's deprecated and reference %define.
5423 (Pure Calling): Update.
5424 (Error Reporting): Update.
5425 (C++ Scanner Interface): Update.
5426 (How Can I Reset the Parser): Update.
5427 (Table of Symbols): In %pure-parser entry, say it's deprecated and
5428 reference %define.
5429 * src/getargs.c (pure_parser): Remove global variable.
5430 * src/getargs.h (pure_parser): Remove extern.
5431 * src/output.c (prepare): Don't define pure_flag muscle.
5432 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
5433 wrapper around `%define api.pure'.
5434 * tests/calc.at (Simple LALR Calculator): Update.
5435 (Simple GLR Calculator): Update.
5436 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
5437 Update.
5438 (GLR: Resolve ambiguity, pure, locations): Update.
5439 (GLR: Merge conflicting parses, pure, no locations): Update.
5440 (GLR: Merge conflicting parses, pure, locations): Update.
5441 * tests/glr-regression.at (Uninitialized location when reporting
5442 ambiguity): Update
5443 * tests/input.at (Unused %define api.pure): New test case.
5444 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
5445 AT_PURE_IF and AT_PURE_AND_LOC_IF.
5446 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5447
54482007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
5449
5450 %define push_pull -> %define api.push_pull. Discussed starting at
5451 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
5452 * data/push.c: Expect the new name.
5453 * data/yacc.c: Likewise.
5454 * doc/bison.texinfo (Push Decl): Update.
5455 (Decl Summary): Update %define entry.
5456 (Push Parser Function): Update.
5457 (Pull Parser Function): Update.
5458 (Parser Create Function): Update.
5459 (Parser Delete Function): Update.
5460 * tests/calc.at (Simple LALR Calculator): Update.
5461 * tests/input.at (%define enum variables): Update.
5462 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
5463 (Push Parsing: Multiple impure instances): Update.
5464 (Push Parsing: Unsupported Skeletons): Update.
5465 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
5466 (Exploding the Stack Size with Malloc): Update.
5467
5468 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
5469 other entries some.
5470
54712007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
5472
5473 For the XML output's terminal element, rename @number to @token-number,
5474 and add @symbol-number. In the nonterminal element, rename @number to
5475 @symbol-number. Discussed starting at
5476 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
5477 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
5478 renames.
5479 (xsl:template match="nonterminal"): Likewise.
5480 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
5481 (xsl:template match="nonterminal"): Likewise.
5482 * src/print-xml.c (print_grammar): Implement.
5483
54842007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
5485
5486 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
5487 2007-10-11 change, the child elements here are items not rules.
5488 (xsl:template match="item"): New.
5489 (xsl:template match="rule"): Update for new reduced itemset.
5490 (xsl:template match="point"): Remove.
5491 (xsl:template match="empty"): For consistency with --graph, don't
5492 output "/* empty */".
5493 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
5494 line-wrap, don't pass a negative value as first-line-length since this
5495 won't work with the following changes.
5496 (xsl:template name="line-wrap"): Simplify slightly.
5497 (xsl:template name="ws-search"): Eliminate recursion.
5498 * src/print_graph.c (print_core): Don't print a reduction's lookahead
5499 set next to an item whose dot is not at the end of the RHS even if it
5500 happens to be associated with the same rule.
5501
55022007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5503
5504 Add %define lr.keep_unreachable_states.
5505 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
5506 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
5507 * src/main.c (main): Implement it.
5508 * tests/conflicts.at (Unreachable States After Conflict Resolution):
5509 Extend to test it, and fix a typo.
5510
55112007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
5512
5513 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
5514 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
5515 the example .output text.
5516 * tests/regression.at (Extra lookahead sets in report): Improve wording
5517 of comments.
5518
55192007-10-17 Wojciech Polak <polak@gnu.org>
5520
5521 * src/print-xml.c (print_grammar): Renamed
5522 <terminal> and <nonterminal> attributes:
5523 "type" to "number" and "symbol" to "name".
5524 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
5525 Use new attribute names.
5526 (xsl:template match="nonterminal"): Likewise.
5527 * data/xslt/xml2xhtml.xsl: Likewise.
5528
55292007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
5530
5531 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
5532 (Option Cross Key): Likewise.
5533
5534 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
5535 next to an item whose dot is not at the end of the RHS even if it
5536 happens to be associated with the same rule.
5537 * src/print.c (print_core): Likewise.
5538 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
5539 (Resolved SR Conflicts): Update output.
5540 * tests/regression.at (Extra lookahead sets in report): New test case.
5541
55422007-10-11 Wojciech Polak <polak@gnu.org>
5543
5544 * src/print-xml.c (print_core): Remove item set
5545 redundancy.
5546 * data/xslt/bison.xsl (bison:ruleNumber): New key.
5547 Improve processing time. Suggested by Joel E. Denny.
5548 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
5549 Write xsl:param "required" attribute as comment.
5550 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
5551 (xsl:template match="rule"): Support new reduced itemset.
5552 (xsl:template match="point"): Remove.
5553 * data/xslt/xml2xhtml.xsl: Likewise.
5554
55552007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5556
5557 * src/getargs.c (version): Update copyright year.
5558
55592007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
5560
5561 Make xml2dot.xsl and --graph produce the same output.
5562 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
5563 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
5564 escaped later.
5565 (xsl:template name="output-node"): Use the new escape template instead
5566 of the string-replace template directly.
5567 (xsl:template name="output-edge"): Likewise.
5568 (xsl:template name="escape"): New, escapes backslashes and newlines in
5569 addition to quotation marks.
5570 * src/graphviz.c (start_graph, output_node, output_edge): Add
5571 whitespace to output for legibility.
5572
5573 Make xml2text.xsl and --report produce the same output, and remove the
5574 XML "conflicts" element since a conflict summary is easily extracted
5575 from the automaton.
5576 * data/xslt/bison.xsl: New.
5577 (xsl:template match="state" mode="bison:count-conflicts): New.
5578 * data/xslt/xml2text.xsl: Import bison.xsl.
5579 (xsl:template match="bison-xml-report"): Instead of styling the
5580 "conflicts" element, style the "automaton" element with mode
5581 "conflicts". Unlike the former, the latter lists S/R and R/R
5582 conflicts for a state on the same line.
5583 (xsl:template match="conflicts"): Remove.
5584 (xsl:template match="conflict"): Remove.
5585 (xsl:template match="terminal"): Line-wrap the list of rules in which
5586 the terminal is used.
5587 (xsl:template match="nonterminal"): Likewise for nonterminals.
5588 (xsl:template match="automaton" mode="conflicts"): New.
5589 (xsl:template match="state" mode="conflicts"): New.
5590 (xsl:template name="line-wrap"): New.
5591 (xsl:template name="ws-search"): New.
5592 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
5593 (xsl:template match="bison-xml-report"): Instead of styling the
5594 "conflicts" element, style the "automaton" element with mode
5595 "conflicts."
5596 (xsl:template match="conflicts"): Remove.
5597 (xsl:template match="conflict"): Remove.
5598 (xsl:template match="automaton" mode="conflicts"): New.
5599 (xsl:template match="state" mode="conflicts): New.
5600 * src/conflicts.c (conflicts_output_xml): Remove.
5601 * src/conflicts.h (conflicts_output_xml): Remove prototype.
5602 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
5603 * src/print.c (print_grammar): Consistently wrap at the 66th column so
5604 the corresponding XSLT is easier. Also, never wrap between a word and
5605 the comma that follows it.
5606
56072007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5608
5609 Improve C++ namespace support. Discussed starting at
5610 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
5611 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
5612 b4_namespace_close): New macros that interpret the %define variable
5613 "namespace" so its value can contain "::" to indicate nested
5614 namespaces.
5615 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
5616 the above macros.
5617 * data/lalr1.cc (b4_namespace): Likewise.
5618 * data/location.cc (b4_namespace): Likewise.
5619 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
5620 inside a new table in the general %define entry. Document `%define
5621 namespace' there as well. Point the %name-prefix entry to it since it
5622 explains it more completely in the case of C++.
5623 (C++ Bison Interface): Mention `%define namespace' instead of
5624 %name-prefix.
5625 (Table of Symbols): Remove the `%define push_pull' entry. The %define
5626 entry suffices.
5627 * tests/c++.at (Relative namespace references): New test case.
5628 (Absolute namespace references): New test case.
5629 (Syntactically invalid namespace references): New test case.
5630 * tests/input.at (C++ namespace reference errors): New test case.
5631
56322007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
5633
5634 Add syncline support and location accessor to internal %define
5635 interfaces.
5636 * data/bison.m4 (b4_percent_define_get_loc): New.
5637 (b4_percent_define_get_syncline): New.
5638 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
5639 (b4_percent_define_default): Record defining location as line 1 rather
5640 than 0 for the sake of synchronizing #line's, and define
5641 b4_percent_define_syncline(VARIABLE).
5642 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
5643 * src/muscle_tab.c (muscle_syncline_grow): New.
5644 (muscle_code_grow): Use muscle_syncline_grow.
5645 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
5646 define b4_percent_define_syncline(VARIABLE).
5647 (muscle_percent_define_get_loc): New.
5648 (muscle_percent_define_get_syncline): New.
5649 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
5650 remove some unused variables.
5651 (muscle_percent_define_default): Record defining location as line 1
5652 rather than 0 for the sake of synchronizing #line's, and define
5653 b4_percent_define_syncline(VARIABLE).
5654 (muscle_percent_define_check_values): Use
5655 muscle_percent_define_get_loc.
5656 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
5657 (muscle_percent_define_get_syncline): Prototype.
5658 * tests/skeletons.at (%define Boolean variables: invalid skeleton
5659 defaults): Update output for location change.
5660 (Complaining during macro argument expansion): Extend to test
5661 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
5662
56632007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
5664
5665 Fix some error-reporting macro bugs.
5666 * data/bison.m4 (b4_cat): New.
5667 (b4_error, b4_error_at): Use b4_cat to send error directives directly
5668 to stdout so they don't become arguments to other macros. Update
5669 comments and add examples.
5670 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
5671 add examples.
5672 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
5673 after printing the error directive so that M4 doesn't report subsequent
5674 problems that are induced by this problem.
5675 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
5676 instead of just in them. Recognize @\n in both places. Both expand to
5677 the empty string. Needed by b4_cat.
5678 * tests/skeletons.at (Complaining during macro argument expansion):
5679 New test case.
5680 (Fatal errors make M4 exit immediately): New test case.
5681
56822007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
5683
5684 Implement --print-datadir.
5685 * src/getargs.c (usage): Mention.
5686 (PRINT_DATADIR_OPTION): New anonymous enum member.
5687 (long_options): Add entry for it.
5688 (getargs): Add case for it calling compute_pkgdatadir.
5689 * src/output.c (output_skeleton): Encapsulate data directory
5690 computation from here...
5691 (prepare): ... and from here...
5692 (compute_pkgdatadir): ... into this new function.
5693 * src/output.h (compute_pkgdatadir): Prototype.
5694
56952007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
5696
5697 * src/print-xml.c (escape_bufs): New static global variable
5698 replacing...
5699 (xml_escape_n): ... the static local variable buf here.
5700 (print_xml): Free memory for escape_bufs.
5701 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
5702
57032007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
5704
5705 Replace `%push-parser' and `%push-pull-parser' with
5706 `%define push_pull "push"' and `%define push_pull "both"'.
5707 `%define push_pull "pull"' is the default.
5708 * doc/bison.texinfo (Push Decl, Push Parser Function,
5709 Pull Parser Function, Parser Create Function, Parser Delete Function):
5710 Update declarations.
5711 (Decl Summary, Table of Symbols): Replace %push-parser and
5712 %push-pull-parser entries with a %define push_pull entry.
5713 * data/bison.m4 (b4_percent_define_check_values): New macro.
5714 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
5715 definitions...
5716 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
5717 definitions...
5718 * data/push.c: ... to here and compute them from the value of the
5719 %define variable push_pull.
5720 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
5721 parsing requests here...
5722 * data/yacc.c: ... hack this to switch to push.c any time
5723 b4_use_push_pull_flag or the %define variable push_pull is set. This
5724 will go away when we mv push.c yacc.c.
5725 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
5726 push parsing is not supported since unused %define variables are
5727 reported anyway.
5728 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
5729 * src/muscle_tab.h (muscle_percent_define_check_values): Update
5730 comments for consistency with b4_percent_define_check_values.
5731 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
5732 muscles.
5733 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
5734 Remove.
5735 (prologue_declaration): Remove %push-parser and %push-pull-parser
5736 rules.
5737 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
5738 * tests/calc.at: Update declarations.
5739 * tests/input.at (%define enum variables): New test case.
5740 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
5741 declaration.
5742 (Push Parsing: Multiple impure instances): Update declaration.
5743 (Push Parsing: Unsupported Skeletons): New test case.
5744 * tests/torture.at (Exploding the Stack Size with Alloca): Update
5745 declaration.
5746 (Exploding the Stack Size with Malloc): Update declaration.
5747
57482007-09-24 Wojciech Polak <polak@gnu.org>
5749
5750 Add XSLT transformations.
5751
5752 * data/xslt/xml2dot.xsl: Transform XML into DOT.
5753 * data/xslt/xml2text.xsl: Transform XML into plain text.
5754 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
5755 * data/Makefile.am (xsltdir): New variable.
5756 (dist_xslt_DATA): Add xslt/*.xsl files.
5757
57582007-09-23 Paul Eggert <eggert@cs.ucla.edu>
5759
5760 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
5761 Problem reported by Wojciech Polak.
5762 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
5763 (xml_printf): Undo change I made on 21 September; that is,
5764 indent 2 spaces, not 1.
5765
57662007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
5767
5768 Pacify ./configure --enable-gcc-warnings.
5769 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
5770 `char const *' instead of `char *'.
5771 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
5772 local variable `sep'.
5773
57742007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5775
5776 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
5777 elsewhere.
5778 * src/print-xml.c: Prefer "const" after types; that's more consistent.
5779 (xml_printf): Indent just 1 space for level.
5780 (e_char, xlate_char): Remove.
5781 (xml_escape_string): Rewrite to avoid undefined behavior (used
5782 storage that was freed from the stack).
5783 (xml_escape_n): Don't bother checking for subscript error.
5784
57852007-09-21 Wojciech Polak <polak@gnu.org>
5786
5787 Add Bison XML Automaton Report.
5788
5789 Add support for an -x option to generate an XML report.
5790 It is not documented yet.
5791 * src/print-xml.c: New file.
5792 * src/print-xml.h: Likewise.
5793 * lib/timevar.def (TV_XML): New var.
5794 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
5795 * src/conflicts.c: Include print-xml.h.
5796 (solved_conflicts_xml_obstack): New var.
5797 (log_resolution, conflicts_solve, conflicts_free):
5798 Add support for XML report.
5799 (conflicts_output_val): New function.
5800 * src/conflicts.h (conflicts_output_val): New decl.
5801 * src/files.c (spec_xml_file): New var.
5802 (compute_output_file_names, output_file_names_free): Add XML support.
5803 * src/files.h (spec_xml_file): New decl.
5804 * src/getargs.c (xml_flag): New var.
5805 (usage, short_options, long_options, getargs): Add XML support.
5806 * src/getargs.h (xml_flag): New decl.
5807 * src/gram.c: Include print-xml.h.
5808 (rule_lhs_print_xml, rule_rhs_print_xml):
5809 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
5810 New functions.
5811 * src/gram.h: Declare external ones.
5812 * src/main.c: Include print-xml.h.
5813 (main): Add XML support.
5814 * src/reduce.c: Include print-xml.h.
5815 (reduce_xml): New function.
5816 * src/reduce.h: Declare it.
5817 * src/state.c: Include print-xml.h.
5818 (state_new): Add XML support.
5819 (state_rule_lookahead_tokens_print_xml): New function.
5820 * src/state.h: Declare it.
5821 (struct state): New member solved_conflicts_xml.
5822 * src/symtab.c (symbol_class_get_string): New function.
5823 * src/symtab.h: Declare it.
5824
58252007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5826
5827 * GNUmakefile: Switch to coreutils's version.
5828 * bootstrap: Likewise.
5829 * Makefile.cfg: Adjust to new GNUmakefile.
5830 * README-hacking: Likewise.
5831
5832 Import from gnulib:
5833
5834 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
5835 Bruno Haible <bruno@clisp.org>
5836
5837 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
5838 and is a script that invokes bison. Tighten the code. Add comments.
5839
58402007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
5841
5842 Spell "boolean" as "Boolean". Reported by Akim Demaille.
5843 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
5844 * doc/bison.texinfo (Decl Summary): Fix.
5845 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
5846 * tests/input.at (Boolean %define variables): Update output.
5847 * tests/skeletons.at (%define boolean variables: invalid skeleton
5848 defaults): Rename to...
5849 (%define Boolean variables: invalid skeleton defaults): ... this and
5850 update output.
5851
58522007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
5853
5854 In impure push mode, don't allow more than one yypstate to be allocated
5855 since multiple impure parsers would corrupt yynerrs.
5856 * data/push.c (yypstate_allocated): New static global variable
5857 initialized to 0.
5858 (yypull_parse): If yypstate_new returns 0, don't report it as memory
5859 exhaustion if yypstate_allocated is 1, but still return 2.
5860 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
5861 already 1. Otherwise, set it to 1.
5862 (yypstate_delete): Set it to 0.
5863 * tests/push.at (Push Parsing: Multiple impure instances): New test
5864 case.
5865
58662007-08-17 Bob Rossi <bob@brasko.net>
5867
5868 * doc/bison.texinfo (Push Decl): Document the push parser.
5869 (Table of Symbols): Ditto.
5870 (Pure Decl): Ditto.
5871 (Decl Summary): Ditto.
5872 (Multiple Parsers, Push Parser Function, Pull Parser Function,
5873 Parser Create Function, Parser Delete Function):
5874 Add new push parser symbols.
5875 (Table of Symbols): Document push-parser, push-pull-parser,
5876 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
5877
58782007-08-15 Paul Eggert <eggert@cs.ucla.edu>
5879
5880 Update to GPLv3.
5881 * doc/gpl-3.0.texi: New file.
5882 * doc/gpl.texi: Remove.
5883 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
5884 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
5885 * README-hacking, TODO, bootstrap, bootstrap.conf:
5886 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
5887 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
5888 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
5889 * data/lalr1.cc, data/lalr1.java, data/location.cc:
5890 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
5891 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
5892 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
5893 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
5894 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
5895 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
5896 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
5897 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
5898 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
5899 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
5900 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
5901 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
5902 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
5903 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
5904 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
5905 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
5906 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
5907 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
5908 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
5909 * src/complain.c, src/complain.h, src/conflicts.c:
5910 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
5911 * src/files.h, src/flex-scanner.h, src/getargs.c:
5912 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
5913 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
5914 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
5915 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
5916 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
5917 * src/print.c, src/print.h, src/print_graph.c:
5918 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
5919 * src/reduce.h, src/relation.c, src/relation.h:
5920 * src/revision.h, src/scan-code.h, src/scan-code.l:
5921 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
5922 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
5923 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
5924 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
5925 * tests/Makefile.am, tests/actions.at, tests/c++.at:
5926 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
5927 * tests/existing.at, tests/glr-regression.at:
5928 * tests/headers.at, tests/input.at, tests/java.at:
5929 * tests/local.at, tests/output.at, tests/push.at:
5930 * tests/reduce.at, tests/regression.at, tests/sets.at:
5931 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
5932 * tests/torture.at:
5933 Update to GPLv3.
5934
59352007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
5936
5937 Get rid of broken %no-parser, -n, and --no-parser implementation and
5938 documentation.
5939 * TODO: Don't mention them.
5940 * doc/bison.1: Likewise.
5941 * doc/bison.texinfo (Decl Summary): Likewise.
5942 (Bison Options): Likewise.
5943 (Option Cross Key): Likewise.
5944 * src/getargs.c (no_parser_flag): Remove global variable.
5945 (usage): Don't print description of -n and --no-parser.
5946 (long_options): Remove --no-parser entry here.
5947 (getargs): Remove -n case in the switch here.
5948 * src/getargs.h (no_parser_flag): Remove extern.
5949 * tests/regression.at (Web2c Actions): Remove comment that mentions
5950 --no-parser.
5951
59522007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
5953
5954 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
5955 name user variables starting with `yy'. Just pass NULL instead of a
5956 dummy local &yylval to yypush_parse.
5957 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
5958 starting with `yy'.
5959
59602007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
5961
5962 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
5963 true since it's then always used regardless of whether yyoverflow is
5964 defined. Reported by Christian Burger at
5965 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
5966 * THANKS: Add Christian Burger.
5967
5968 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
5969 node names: say "Decl Summary" not "Bison Declaration Summary".
5970
59712007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
5972
5973 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
5974 determine whether this function has already complained about an invalid
5975 value for a %define boolean variable, don't check whether Bison has
5976 ever examined the value. As written, the check was a tautology.
5977 Instead, record and check for this complaint using a separate muscle.
5978
59792007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
5980
5981 Fix push parsing memory leak reported by Brandon Lucia at
5982 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
5983 * THANKS: Add Brandon Lucia.
5984 * data/push.c (yypstate_delete): Free the stack if it was reallocated
5985 but the parse never completed and thus freed it.
5986 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
5987 * tests/testsuite.at: Include push.at.
5988 * test/push.at: New.
5989 (Push Parsing: Memory Leak for Early Deletion): New test case.
5990
59912007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
5992
5993 Improve handling of multiple S/R conflicts in the same state and of S/R
5994 conflicts involving multiple reductions.
5995 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
5996 set for a state here or Bison will abort if it is reassigned on a
5997 later conflicted reduction in the same state.
5998 Similarly, don't finalize and assign the solved conflicts report here
5999 or it will be lost if it is reassigned on a later conflicted reduction
6000 in the same state.
6001 (set_conflicts): Instead, assign them both here after all S/R conflicts
6002 in the state have been fully examined.
6003 * src/print.c (shift_set): Rename to...
6004 (no_reduce_set): ... this.
6005 (print_reductions): Update for rename, and add %nonassoc error action
6006 tokens to no_reduce_set so that, when printing the first remaining
6007 reduction on an error action token, the reduction is enclosed in
6008 brackets.
6009 (print_results): Update for rename.
6010 * tests/conflicts.at (Solved conflicts report for multiple reductions
6011 in a state): New test case.
6012 (%nonassoc error actions for multiple reductions in a state): New test
6013 case.
6014
6015 * src/main.c (main): Don't depend on C99 features.
6016
60172007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
6018
6019 * build-aux/.cvsignore: Add compile.
6020 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
6021 uniwidth.
6022
60232007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
6024
6025 * bootstrap (slurp): Create target directories that don't exist.
6026 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
6027
60282007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
6029
6030 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
6031 than item number.
6032 * closure.c (closure): Likewise.
6033 * state.h (reductions): Comment sorting of rules.
6034 (state): Comment sorting of items.
6035
60362007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
6037
6038 Fix C++ test cases after recent Gnulib changes. Discussed starting at
6039 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
6040 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
6041 definition in order to avoid Gnulib headers since we don't use config.h
6042 here.
6043 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
6044 rather than AT_DATA so that config.h is included.
6045
60462007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
6047
6048 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
6049 instead of fprintf. Guard these functions with #if YYDEBUG instead of
6050 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
6051 and so that YYFPRINTF is guaranteed to be defined here.
6052
60532007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
6054
6055 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
6056 with...
6057 (muscle_percent_define_check_values): ... this more helpful function.
6058 Again, it's not used yet, but it will be.
6059 * src/muscle_tab.h: Likewise.
6060
6061 Improve some comments in parser table construction.
6062 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
6063 (generate_states): Don't mention ruleset, which is internal to closure.
6064 * src/closure.c (closure): Explain sorting of core and itemset, which
6065 is required for this function to behave correctly.
6066 * src/closure.h (closure): Mention sorting.
6067
60682007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
6069
6070 * src/lalr.c (state_lookahead_tokens_count): For code readability,
6071 move the check for disabled transitions to an aver since conflict
6072 resolution hasn't happened yet.
6073
6074 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
6075 labels a state as inconsistent just because it has error transitions.
6076 The original form of this check appeared in revision 1.1 of lalr.c,
6077 which was committed on 1991-12-21. Now (at least), changing the
6078 consistency label on such a state appears to have no useful effect in
6079 any of the places it is examined, which I enumerate below. The key
6080 point to understanding each item in this enumeration is that a state
6081 with an error transition is labelled consistent in the first place only
6082 if it has no rules, so the check cannot matter for states that have
6083 rules. (1) Labelling a state as inconsistent will cause set_conflicts
6084 to try to identify its conflicts, and a state must have *rules* to have
6085 conflicts. (2) Labelling a state as inconsistent will affect how
6086 action_row sets the default *rule* for the state. (3) Labelling a
6087 state as inconsistent will cause build_relations to add lookback edges
6088 to *rules* in that state.
6089 * src/state.h (struct state): Word the comment for member consistent
6090 more carefully.
6091
60922007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
6093
6094 Don't depend on C99 features.
6095 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
6096 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
6097 * src/reader.c (check_and_convert_grammar): Fix for-loop.
6098 * src/state.c (state_mark_reachable_states): Fix for-loop.
6099 (state_remove_unreachable_states): Fix for-loop.
6100
6101 Don't widen struct state with member reachable just to temporarily
6102 record reachability. Instead, use a local bitset.
6103 * src/state.h (struct state): Remove member.
6104 * src/state.c (state_new): Don't initialize it.
6105 (state_mark_reachable_states): Rename to...
6106 (state_record_reachable_states): ... this, and use bitset.
6107 (state_remove_unreachable_states): Use bitset.
6108
61092007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
6110
6111 * src/Makefile.am (yacc): Quote target action commands properly so
6112 that the yacc script isn't corrupt. Reported by Hans Aberg at
6113 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
6114
6115 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
6116 the case of pure parsers. Reported by Frans Englich at
6117 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
6118 * THANKS: Add Frans Englich.
6119
6120 * NEWS (2.3a+): In the %code entry, reference section `Bison
6121 Declaration Summary' from the manual now since the %code summary has
6122 moved there.
6123 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
6124 in the rules section must be terminated by semicolons.
6125
61262007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
6127
6128 Extend the front-end API for %define variables to more completely
6129 mirror the back-end. This will be useful in the future.
6130 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
6131 Update comments to mention the new front-end counterparts of these
6132 macros.
6133 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
6134 for muscle_string_decode and muscle_location_decode.
6135 (muscle_string_decode): New static function.
6136 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
6137 (muscle_percent_define_get, muscle_percent_define_ifdef): New
6138 functions.
6139 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
6140 muscle_percent_define_get to mimic the b4_percent_define_flag_if
6141 implementation more closely.
6142 (muscle_percent_define_invalid_value): New function.
6143 * src/muscle_tab.h (muscle_percent_define_get,
6144 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
6145 Prototype.
6146
61472007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
6148
6149 * NEWS (2.3a+): Mention yesterday's state-removal change.
6150 (2.3a): Remove the %language entry, which was added after 2.3a.
6151 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
6152 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
6153 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
6154 tests/existing.at: Update copyright date.
6155
61562007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
6157
6158 If conflict resolution makes states unreachable, remove those states,
6159 report rules that are then unused, and don't report conflicts in those
6160 states.
6161 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
6162 New global function.
6163 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
6164 function.
6165 * src/main.c (main): After conflict resolution, remove the unreachable
6166 states and update all data structures that reference states by number.
6167 * src/state.c (state_new): Initialize each state's reachable member to
6168 false.
6169 (state_mark_reachable_states): New static function.
6170 (state_remove_unreachable_states): New global function.
6171 * src/state.h (struct state): Add member bool reachable.
6172 (state_remove_unreachable_states): Prototype.
6173 * tests/conflicts.at (Unreachable States After Conflict Resolution):
6174 New test case.
6175 * tests/existing.at (GNU pic Grammar): Update test case output now that
6176 an unused rule is discovered.
6177
61782007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
6179
6180 Minor code cleanup in parser table construction.
6181 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
6182 (new_itemsets, save_reductions): Update for rename to nitemset.
6183 * src/closure.c (nritemset): Rename to...
6184 (nitemset): ... this since the "r" appears to meaningless and isn't
6185 used in the comments.
6186 (closure): Update for rename.
6187 * src/closure.h (nritemset): Update extern to...
6188 (nitemset): ... this.
6189 * src/lalr.c (LA): Fix a typo in comments.
6190 * src/print.c (print_core): Update for rename to nitemset.
6191 * src/print_graph.c (print_graph): Likewise.
6192 * src/state.h: Fix some typos in header comments.
6193
61942007-04-04 Paul Eggert <eggert@cs.ucla.edu>
6195
6196 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
6197 still sticks to ASCII. Sorry!
6198
6199 * README-hacking: New file, taken mostly from coreutils, with changes
6200 for Bison. Contains much of the contents of:
6201 * README-cvs: Remove.
6202 * bootstrap: Sync from gnulib.
6203 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
6204 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
6205
62062007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
6207
6208 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
6209 Setzer.
6210 (Java Differences): Fix some typos.
6211 * THANKS: Add Sebastian Setzer.
6212
62132007-03-07 Paolo Bonzini <bonzini@gnu.org>
6214
6215 * data/java.m4 (b4_single_class_if): Remove.
6216 (b4_abstract_if): Look at "%define abstract".
6217 (b4_lexer_if): New.
6218 (b4_union_name): Rename...
6219 (b4_yystype): ... to this. Map to "%define stype".
6220 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
6221 b4_maybe_throws): Fix quoting.
6222 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
6223 * data/lalr1.java (Lexer interface): Always define.
6224 (Lexer interface within parser class): Remove.
6225 (YYLexer class): New, used when "%code lexer" is present.
6226 (constructor): When "%code lexer" is used, pass %lex-param
6227 to the lexer constructor.
6228 (yylex, yyparse): Remove %lex-param from method invocations
6229 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
6230
6231 * doc/bison.texinfo (Java Bison Interface): Mention "%define
6232 abstract". Rename "%define union_name" to "%define stype".
6233 Rename method names according to previous patch.
6234 (Java Scanner Interface): Describe "%code lexer" instead of
6235 "%pure-parser" and "%define single_class".
6236 (Java Differences): Mention "%code lexer".
6237
6238 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
6239 Include scanner here, using macros from tests/local.at.
6240 (AT_DATA_CALC_Y): Remove final argument.
6241 (_AT_CHECK_JAVA_CALC): Likewise.
6242 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
6243 of %locations and %error-verbose.
6244 (main): Test with and without %lex-param.
6245 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
6246 (AT_BISON_OPTION_POPDEFS): Pop it.
6247
62482007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6249
6250 DJGPP spefic issue. Inhibit the use of disallowed characters for
6251 file name genertion on Win98, WinXP, etc. These are |<>":?*\
6252 and concern testsuite case 46.
6253 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
6254 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
6255 * djgpp/config.bat: Inhibit the use of disallowed characters.
6256
62572007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
6258
6259 Miscellaneous %define and %code cleanup.
6260 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
6261 values are interpreted.
6262 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
6263 documentation a little more.
6264 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
6265 muscle_percent_define_insert, muscle_percent_code_grow): New
6266 functions/macros.
6267 * src/muscle_tab.h (muscle_percent_define_insert,
6268 muscle_percent_code_grow): Prototype.
6269 * src/parse-gram.y (prologue_declaration): Use
6270 muscle_percent_define_insert and muscle_percent_code_grow when parsing
6271 %define and %code directives.
6272
6273 Make it easy to share %define boolean variables between the front-end
6274 and back-end. Though not used yet, this will be useful in the future.
6275 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
6276 Bison uses of names rather than just skeleton uses of names.
6277 (b4_percent_define_get, b4_percent_define_ifdef): Rename
6278 b4_percent_define_skeleton_variables(VARIABLE) to
6279 b4_percent_define_bison_variables(VARIABLE).
6280 (b4_percent_code_get, b4_percent_code_ifdef): Rename
6281 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
6282 b4_percent_code_bison_qualifiers(QUALIFIER).
6283 (b4_check_user_names_wrap): Update for renames.
6284 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
6285 muscle_percent_define_default): New functions mimicking
6286 b4_percent_define_flag_if and b4_percent_define_default.
6287
6288 For %define variables, report locations for invalid values and
6289 redefinitions.
6290 * data/bison.m4 (b4_percent_define_flag_if): Read
6291 b4_percent_define_loc(VARIABLE) to report the location of an invalid
6292 value for VARIABLE.
6293 (b4_percent_define_default): Save a special location in
6294 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
6295 must later be reported as invalid.
6296 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
6297 functions.
6298 (muscle_percent_define_insert): Record the location of VARIABLE in
6299 muscle percent_define_loc(VARIABLE), and use it to report the previous
6300 location for a redefinition.
6301 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
6302 (muscle_percent_define_default): Update like b4_percent_define_default.
6303 (muscle_grow_user_name_list): Rename to...
6304 (muscle_user_name_list_grow): ... this for consistency and use
6305 muscle_location_grow.
6306 * src/muscle_tab.h (muscle_location_grow): Prototype.
6307 * tests/input.at (%define errors): Update expected output.
6308 * tests/skeletons.at (%define boolean variables: invalid skeleton
6309 defaults): New test case.
6310
63112007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
6312
6313 * src/print.c (lookahead_set, state_default_rule): Remove.
6314 (print_reductions): Replace state_default_rule invocation with
6315 equivalent use of yydefact, which was computed in token_actions in
6316 tables.c.
6317 (print_results): Don't allocate lookahead_set.
6318
63192007-02-27 Paolo Bonzini <bonzini@gnu.org>
6320
6321 * data/lalr1.java: Prefix all private members with yy.
6322
63232007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
6324
6325 Use YYFPRINTF instead of fprintf where appropriate. Reported by
6326 Sebastien Fricker at
6327 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
6328 * THANKS: Add Sebastien Fricker.
6329 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
6330 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
6331 accept a variable number of arguments.
6332
63332007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
6334
6335 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
6336
63372007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6338
6339 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
6340 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
6341 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
6342
63432007-02-11 Paul Eggert <eggert@cs.ucla.edu>
6344
6345 Undo my 2007-02-07 change, switching back to the c-strcase module
6346 introduced in the 2007-02-03 change. Bruno Haible reported that
6347 the 2007-02-07 change would be dangerous in Turkish if we add a
6348 language whose name contains "i", since "i" is not lowercase "I"
6349 in Turkish.
6350 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
6351 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
6352 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
6353 * m4/.cvsignore: Remove strcase.m4.
6354 * src/getargs.c: Revert 2007-02-07 change, as follows.
6355 Include c-strcase.h.
6356 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
6357
63582007-02-11 Bruno Haible <bruno@clisp.org>
6359
6360 Enable the Java related testsuite tests when the only Java compiler
6361 found is a gcj < 4.3. Discussed at
6362 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
6363 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
6364
63652007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
6366
6367 * data/Makefile.am: Update copyright date.
6368 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
6369 yypstate_new returns NULL.
6370 (yypstate_new): Return NULL if malloc does.
6371 * src/reader.c (packgram): Move translation of rule actions from the
6372 beginning of packgram to...
6373 (check_and_convert_grammar): ... here right before packgram is invoked
6374 so it's easier to write more complete comments, and remove redundant
6375 code.
6376
63772007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
6378
6379 As in semantic actions, make @$ in %initial-action, %destructor, and
6380 %printer imply %locations.
6381 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
6382 scanning @$.
6383 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
6384 (@$ in %initial-action implies %locations,
6385 @$ in %destructor implies %locations,
6386 @$ in %printer implies %locations): ... these new test cases.
6387
63882007-02-07 Paul Eggert <eggert@cs.ucla.edu>
6389
6390 Undo most of the 2007-02-03 change, switching to the strcase module
6391 now that gnulib strcase has been fixed.
6392 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
6393 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
6394 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
6395 * m4/.cvsignore: Add strcase.m4.
6396 * src/getargs.c: Revert 2007-02-03 change, as follows.
6397 Don't include c-strcase.h.
6398 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
6399 strcasecmp has "unspecified behavior" outside the POSIX locale,
6400 but it works fine in practice if at least one argument is ASCII,
6401 as is the case in Bison.
6402
64032007-02-07 Paolo Bonzini <bonzini@gnu.org>
6404
6405 * tests/java.at: Skip tests if only one of javac/java is present.
6406 Reported by Joel E. Denny.
6407 * tests/atlocal.in: Adjust copyright years.
6408
64092007-02-05 Paolo Bonzini <bonzini@gnu.org>
6410
6411 * data/lalr1.java (Stack): Work around old verifiers that disallow
6412 access to the private fields of an inner class, from the outer class.
6413 We can make Stack's fields public because user code doesn't have access
6414 to the instance of Stack used by parse(). Reported by Paul Eggert.
6415
64162007-02-03 Paul Eggert <eggert@cs.ucla.edu>
6417
6418 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
6419 the right spot for these files?
6420 * bootstrap.conf (gnulib_modules): Add c-strcase.
6421 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
6422 c-strncasecmp.c.
6423 * src/getargs.c: Include c-strcase.h.
6424 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
6425 to avoid unspecified behavior.
6426
64272007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
6428
6429 * doc/bison.texinfo (Decl Summary): Correct typo.
6430
64312007-01-30 Paolo Bonzini <bonzini@gnu.org>
6432
6433 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
6434 Complain if the value does not match empty, "true" or "false".
6435 * data/c++.m4: Adjust default definitions of %define variables.
6436 * data/java.m4: Adjust default definitions of %define variables.
6437 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
6438 to above behavior.
6439 * tests/input.at (Boolean %define variables): Test new behavior.
6440
64412007-01-29 Paolo Bonzini <bonzini@gnu.org>
6442
6443 * NEWS: Mention java.
6444 * TODO: Remove things that are done.
6445 * bootstrap.conf: Add javacomp-script and javaexec-script.
6446 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
6447
6448 * data/Makefile.am: Add new files.
6449 * data/java-skel.m4: New.
6450 * data/java.m4: New.
6451 * data/lalr1.java: New.
6452
6453 * doc/bison.texinfo: Put "A Complete C++ Example" under
6454 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
6455 under Other Languages.
6456
6457 * src/getargs.c (valid_languages): Add Java.
6458 * src/getargs.h (struct bison_language): Update size of string fields.
6459
6460 * tests/Makefile.am: Add java.at.
6461 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
6462 * tests/java.at: New.
6463 * tests/testsuite.at: Include it.
6464
64652007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
6466
6467 Clean up.
6468 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
6469 at_directive_argv arguments so these no longer have to be global
6470 variables. Also, update the implementation for the following changes.
6471 (fail_for_at_directive_too_many_args,
6472 fail_for_at_directive_too_few_args): Add at_directive_name argument.
6473 (at_directive_name): Remove as at_directive_argv[0] will be used for
6474 this now.
6475 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
6476 for the directive name.
6477 (at_directive_argc, at_directive_argv): Make these local within
6478 skel_lex instead of global.
6479 (INITIAL): Update directive start action for above changes.
6480 (SC_AT_DIRECTIVE_ARG): Rename to...
6481 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
6482 (SC_AT_DIRECTIVE_SKIP_WS): Update.
6483 (scan_skel): Move yylex_destroy to...
6484 (skel_scanner_free): ... here.
6485 * tests/skeletons.at (installed skeleton file name): Rename to...
6486 (installed skeleton file names): ... this.
6487
64882007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
6489
6490 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
6491 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
6492 Summary" not "Directives".
6493 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
6494 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
6495 since the former is now the more complete one.
6496 (Prologue Alternatives): Likewise and do the same for %defines.
6497 (Table of Symbols): Add summary of %code, add summary of %define, and
6498 move full %code documentation to...
6499 (Decl Summary): ... here for consistency with other entries in these
6500 sections.
6501 Move %define entry in order to keep this list alphabetized.
6502 Reword %define entry a little to put less emphasis on the skeleton
6503 concept, which most users shouldn't have to think about.
6504
65052007-01-26 Paul Eggert <eggert@cs.ucla.edu>
6506
6507 Adjust to recent gnulib changes.
6508 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
6509 Add string.h, string_.h, unistd_.h, wchar_.h.
6510 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
6511 * src/system.h: Don't include <stpcpy.h>; this is now done by
6512 <string.h>.
6513
65142007-01-23 Paolo Bonzini <bonzini@gnu.org>
6515
6516 Simplify implementation of unqualified %code, implement macros for
6517 uniform treatment of boolean %define flags. Document %define.
6518 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
6519 b4_percent_code_ifdef): New.
6520 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
6521 * data/c++.m4: Define default value for global_tokens_and_yystype.
6522 * data/glr.cc: Likewise.
6523 * data/location.cc: Use b4_percent_define_flag_if.
6524
6525 * doc/bison.texinfo (Decl Summary): Document %define.
6526
6527 * src/parse-gram.y (Unqualified %code): Change muscle name to
6528 b4_percent_code().
6529 (content.opt): Default to empty.
6530
65312007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6532
6533 Implement support for relative and absolute skeleton file names.
6534 Discussed starting at
6535 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
6536 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
6537 (Bison Options): Document in --skeleton entry.
6538 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
6539 full_skeleton can't necessarily hold all of pkgdatadir.
6540 If the specified skeleton file name contains a `/', don't prepend
6541 pkgdatadir.
6542 * src/parse-gram.y (prologue_declaration): If the specified skeleton
6543 file name contains a `/', prepend the grammar file directory.
6544 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
6545 * skeletons.at: New file.
6546 (relative skeleton file names): New test case.
6547 (installed skeleton file names): New test case.
6548 * tests/testsuite.at: Include skeletons.at.
6549
6550 * bootstrap: Update copyright to 2007.
6551
65522007-01-17 Paolo Bonzini <bonzini@gnu.org>
6553
6554 * bootstrap: Remove occurrences of .#bootmp from the files.
6555
65562007-01-17 Akim Demaille <akim@epita.fr>
6557
6558 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
6559 nonterminals.
6560 Use per-type %printer.
6561
65622007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
6563
6564 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
6565 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6566 djgpp/config.site, src/files.c, src/files.h, src/main.c,
6567 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
6568 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
6569 tests/glr-regression.at, tests/input.at, tests/local.at,
6570 tests/output.at, tests/torture.at: Update copyright to 2007.
6571
65722007-01-16 Akim Demaille <akim@epita.fr>
6573
6574 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
6575 error code.
6576 (Calc++ Scanner): Exit with failure if we can't open the input
6577 file.
6578 Accept "-" standing for stdin.
6579 (Calc++ Top Level): Print the result only if the parsing was
6580 successful.
6581
65822007-01-16 Akim Demaille <akim@epita.fr>
6583
6584 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
6585
65862007-01-15 Paolo Bonzini <bonzini@gnu.org>
6587 and Joel E. Denny <jdenny@ces.clemson.edu>
6588
6589 Clean up %define and %code implementation in M4 some. Most
6590 importantly, rename all related macros to be in the b4_percent_define
6591 and b4_percent_code namespaces. Also, complete support for `.' in
6592 %define variable names and %code qualifiers.
6593 * data/bison.m4 (b4_check_user_names): Check for special
6594 "SKELETON-NAMESPACE(name)" macros instead of using two nested
6595 m4_foreach loops.
6596 (b4_get_percent_define, b4_get_percent_code): Rename to...
6597 (b4_percent_define_get, b4_percent_code_get): ... these.
6598 Extend documentation with examples.
6599 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
6600 b4_percent_define_skeleton_variables and
6601 b4_percent_code_skeleton_qualifiers.
6602 Expect any value for the %define variable `foo' to be stored in the
6603 macro named `b4_percent_define(foo)'; expect any %code blocks for the
6604 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
6605 expect any unqualified %code blocks to be stored in a macro named
6606 `b4_percent_code_unqualified'.
6607 Use m4_indir so that %define variable names and %code qualifiers can
6608 contain `.', which is allowed by the grammar parser.
6609 (b4_percent_define_default): New macro to set a default value for a
6610 %define variable.
6611 (m4_wrap): Update wrapped code, and fix some underquoting.
6612 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
6613 Expect grammar uses of %define variables and %code qualifiers to be
6614 defined in b4_percent_define_user_variables and
6615 b4_percent_code_user_qualifiers.
6616 * data/c++.m4: Use b4_percent_define_default rather than
6617 m4_define_default. Fix some underquoting. Skeleton usage of %define
6618 variable define_location_comparison now implies skeleton usage of
6619 %define variable filename_type.
6620 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6621 data/push.c, data/yacc.c: Update macro names.
6622 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
6623 muscle names.
6624
66252007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6626
6627 DJGPP specific issues.
6628
6629 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
6630 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
6631
66322007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6633
6634 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
6635 run parsers in all tests so that Valgrind is invoked during
6636 maintainer-check-valgrind.
6637 (Duplicate representation of merged trees): Free all semantic values.
6638 (Duplicated user destructor for lookahead): Likewise.
6639
66402007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6641
6642 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
6643 command-line prefix.
6644 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
6645 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
6646 miss Valgrind messages.
6647 (Exploding the Stack Size with Malloc): Likewise.
6648
66492007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
6650
6651 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
6652 locals. Reported by Juan Manuel Guerrero at
6653 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
6654 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
6655 Fix some indentation also.
6656 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
6657 explaining this issue.
6658
66592007-01-09 Paolo Bonzini <bonzini@gnu.org>
6660 and Joel E. Denny <jdenny@ces.clemson.edu>
6661
6662 Simplify union and prologue handling, and escape union and lex/parse
6663 params with digraphs.
6664 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
6665 values to the empty string since these are no longer guaranteed
6666 initialized by the front-end.
6667 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
6668 braces around b4_user_stype since this is no longer done by the
6669 front-end.
6670 * src/files.c, src/files.h (pre_prologue_obstack,
6671 post_prologue_obstack): Remove.
6672 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
6673 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
6674 with digraphs. This fixes lex params and parse params.
6675 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
6676 * src/output.c (prepare): Remove muscle insertion of the prologues.
6677 (output): Remove freeing of pre_prologue_obstack and
6678 post_prologue_obstack.
6679 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
6680 than prologue_augment for prologue parsing so you don't need prologue
6681 obstacks.
6682 (grammar_declaration): For %union RHS, use `braceless' instead of
6683 "{...}" so that braces are already stripped and code is escaped with
6684 digraphs.
6685 * src/reader.c (prologue_augment): Remove.
6686 (reader): Remove initialization of pre_prologue_obstack and
6687 post_prologue_obstack.
6688 * src/reader.h (prologue_augment): Remove.
6689
6690 * data/c.m4: Remove stray parenthesis.
6691
66922007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6693
6694 Remove quotes from variables names in %define directives and from
6695 qualifiers in %code directives, and restrict the characters that are
6696 allowed in them to M4-friendly ones. For %define, continue to support
6697 the quoted form as a deprecated feature. Discussed starting at
6698 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
6699 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
6700 %code.
6701 * doc/bison.texinfo (Prologue Alternatives): Update.
6702 (Decl Summary): In %defines entry, update mention of `%code requires'
6703 and `%code provides'.
6704 (C++ Location Values): Update %define uses.
6705 (Calc++ Parser Interface): Likewise.
6706 (Calc++ Parser): Likewise, and update `%code requires' uses.
6707 (Table of Symbols): Update %code documentation.
6708 * src/parse-gram.y (prologue_declaration): For %define variables, use
6709 `variable' instead of `STRING'.
6710 (grammar_declaration): For %code qualifiers, use `ID' instead of
6711 `STRING'.
6712 (variable): New nonterminal that takes an `ID' or a `STRING'.
6713 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
6714 and %define uses.
6715 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
6716 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
6717 (%define errors): Update %define uses.
6718
67192007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6720
6721 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
6722 instead of muscle_insert for %define values so that M4-special
6723 characters are replaced with digraphs.
6724 * tests/input.at (%define errors): Extend to check weird values.
6725
67262007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
6727
6728 Instead of having skeletons declare all valid %define variables and
6729 %code qualifiers, provide macros that retrieve the associated values
6730 and build these lists automatically. Thus Bison will now warn when a
6731 variable or qualifier is not used by the skeleton in the current
6732 invocation regardless of whether it might sometimes be used by that
6733 skeleton in other invocations. Also, move all %define value macros to
6734 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
6735 form, which is replaced by %code.
6736 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
6737 (b4_check_user_names): ... this, and change the series of valid name
6738 arguments to a single list argument for names used in the skeleton
6739 similar to the existing list argument for names used in the grammar.
6740 Warn instead of complaining.
6741 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
6742 values and %code code, to format %code code properly, and to build
6743 lists of all %define variables and %code qualifiers used in the
6744 skeleton: b4_skeleton_percent_define_variables and
6745 b4_skeleton_percent_code_qualifiers.
6746 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
6747 Remove, and...
6748 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
6749 the skeleton names lists can finish building first. In place of
6750 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
6751 expect the lists b4_user_percent_define_variables and
6752 b4_user_percent_code_qualifiers.
6753 * data/c++.m4: Where setting default values for b4_parser_class_name,
6754 b4_location_type, b4_filename_type, b4_namespace, and
6755 b4_define_location_comparison, update their names to the
6756 b4_percent_define_ namespace.
6757 * data/glr.c: Don't use b4_check_percent_define_variables and
6758 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6759 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
6760 (b4_parser_class_name, b4_namespace): Define these using
6761 b4_get_percent_define for parser_class_name and namespace.
6762 * data/location.cc: Use b4_get_percent_define.
6763 * data/push.c: Don't use b4_check_percent_define_variables and
6764 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6765 * data/yacc.c: Likewise, and don't call m4_exit in
6766 b4_use_push_for_pull_if or m4_wrap code will never execute.
6767 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
6768 Rename to...
6769 (muscle_grow_user_name_list): ... this for consistency with the
6770 terminology used in bison.m4.
6771 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
6772 %define variable names, and rename muscle used_percent_define_variables
6773 to user_percent_define_variables.
6774 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
6775 user_percent_code_qualifiers.
6776 (content): Remove.
6777 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
6778 {CODE} form is no longer accepted.
6779 * tests/input.at (Reject bad %code qualifiers): Rename to...
6780 (Reject unused %code qualifiers): ... this, and update test output.
6781 (%define error): Update test output.
6782
67832007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
6784
6785 Check for unrecognized %define variables similar to checking for
6786 unrecognized %code qualifiers. Check for redefined %define variables.
6787 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
6788 generalizes...
6789 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
6790 (b4_check_percent_define_variables): New, also wraps it.
6791 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
6792 variables using b4_check_percent_define_variables.
6793 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
6794 all those exercised in the test suite and all those listed in the
6795 `Default values' section of c++.m4. Are there others?
6796 * data/push.c, data/yacc.c: Declare no valid %define variables.
6797 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
6798 similar to muscle_find, but it works even when the muscle stores a
6799 const value.
6800 (muscle_grow_used_name_list): New function for constructing the used
6801 name list muscles that b4_check_for_unrecognized_names requires.
6802 * src/parse-gram.y (prologue_declaration): Warn if a variable is
6803 %define'd more than once. Define the b4_used_percent_define_variables
6804 muscle with muscle_grow_used_name_list.
6805 (grammar_declaration): Abbreviate %code code with
6806 muscle_grow_used_name_list.
6807 * tests/input.at (%define errors): New.
6808
68092007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6810
6811 Provide warn_at, complain_at, and fatal_at function callbacks to the
6812 skeletons, and use this for %code qualifier complaints.
6813 * data/bison.m4 (b4_error_at): New, invoked by...
6814 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
6815 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
6816 @fatal_at(...@) directives.
6817 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
6818 qualifiers in b4_used_percent_code_qualifiers and to use
6819 b4_complain_at.
6820 * src/location.c, src/location.h (boundary_set_from_string): New global
6821 function.
6822 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
6823 function.
6824 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
6825 to b4_used_percent_code_qualifiers.
6826 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
6827 function.
6828 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
6829 (lineno): Rename to...
6830 (out_lineno): ... this so I don't misunderstand it again.
6831 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
6832 here; these newlines are in the input but not the output file.
6833 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
6834 (at_directive_perform): ... this new static function, and add handling
6835 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
6836 directives.
6837 * tests/input.at (Reject bad %code qualifiers): Update test output with
6838 locations and extend.
6839
6840 * tests/output.at (Output file name: [, Output file name: ]): Remove
6841 bogus comment about these tests failing.
6842
68432007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6844
6845 Clean up b4_check_percent_code_qualifiers a little.
6846 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
6847 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
6848 documentation and add examples.
6849 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
6850 qualifiers here.
6851
68522007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
6853
6854 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
6855 unreliable -- especially when they're hidden inside another macro.
6856 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
6857 data/c.m4: Remove m4_divert(-1).
6858 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6859 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
6860 m4_divert_push(0) and m4_divert_pop(0).
6861 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
6862 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
6863 pushed and popped by m4sugar, should be first on the stack.
6864
6865 Provide warn, complain, and fatal function callbacks to the skeletons.
6866 This provides more flexibility than m4_fatal, improves the error
6867 message format, and captures messages for translation. Discussed
6868 starting at
6869 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
6870 * data/bison.m4 (b4_error): New, invoked by...
6871 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
6872 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
6873 directives. Because these M4 macros might be called when the current
6874 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
6875 the previous removal of uses of m4_divert, which caused trouble.
6876 (b4_check_percent_code_qualifiers): Use b4_complain instead of
6877 m4_fatal to report unrecognized %code qualifiers.
6878 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
6879 push parser requests.
6880 * data/glr.c: Use b4_complain instead of m4_fatal to report
6881 non-deterministic push parser requests.
6882 Update @output usage to @output(...@) form.
6883 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
6884 report missing %defines. Update @output usage to @output(...@) form.
6885 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
6886 @output(...@) form.
6887 * src/main.c (main): Invoke skel_scanner_free.
6888 * src/scan-skel.h (skel_scanner_free): Prototype new function.
6889 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
6890 obstack_for_string from flex-scanner.h.
6891 (YY_DECL): Use to declare skel_lex static.
6892 (decode_at_digraphs): Remove; now handled in the new
6893 SC_AT_DIRECTIVE_ARG start condition.
6894 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
6895 functions.
6896 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
6897 at_directive_argv): New static globals.
6898 (INITIAL): Use fail_for_invalid_at.
6899 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
6900 recognize the start of a generalized `@directive(...@)' form and
6901 start...
6902 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
6903 directive args (using the new obstack_for_string), to decode the
6904 contained @ diagraphs, and to perform the directive. It recognizes
6905 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
6906 @output(...@).
6907 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
6908 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
6909 `@,'.
6910 (scan_skel): Initialize obstack_for_string on the first call.
6911 (skel_scanner_free): New function to free obstack_for_string.
6912 * tests/input.at (Reject bad %code qualifiers): Update test output.
6913
69142007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
6915
6916 Consolidate the 4 prologue alternative directives (%code, %requires,
6917 %provides, and %code-top) into a single %code directive with an
6918 optional qualifier field. Discussed at
6919 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
6920 * NEWS (2.3a+): Rewrite the existing entry for the prologue
6921 alternatives.
6922 * doc/bison.texinfo (Prologue Alternatives): Update.
6923 (Decl Summary): Update to %code "requires" and %code "provides".
6924 (Calc++ Parser): Update to %code "requires".
6925 (Table of Symbols): Remove entries for %requires, %provides, and
6926 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
6927 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
6928 are replaced by b4_percent_code_provides and b4_percent_code_requires,
6929 which are skeleton-specific.
6930 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
6931 declare what %code qualifiers it supports and to complain if any other
6932 qualifiers were used in the grammar.
6933 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
6934 and b4_user_code([b4_percent_code_provides]) in place of
6935 b4_user_requires and b4_user_provides.
6936 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
6937 Add b4_user_code([b4_percent_code_top]) and
6938 b4_user_code([b4_percent_code]).
6939 Invoke b4_check_percent_code_qualifiers.
6940 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
6941 PERCENT_REQUIRES): Remove.
6942 (grammar_declaration): Remove RHS's for %code-top, %provides, and
6943 %requires. Rewrite the %code RHS as the unqualified form defining the
6944 muscle b4_percent_code. Add another RHS for the qualified %code form,
6945 which defines muscles of the form b4_percent_code_QUALIFIER and the
6946 b4_used_percent_code_qualifiers muscle.
6947 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
6948 PERCENT_REQUIRES): Remove.
6949 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
6950 %code "requires" and %code "provides".
6951 * tests/input.at (Reject bad %code qualifiers): New.
6952
69532007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
6954
6955 Use the new code_props interface for destructors and printers.
6956 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
6957 printer_location members, and change the type of the destructor and
6958 printer members to code_props.
6959 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
6960 symbol_printer_get, semantic_type_destructor_set,
6961 semantic_type_printer_set, default_tagged_destructor_set,
6962 default_tagless_destructor_set, default_tagged_printer_set,
6963 default_tagless_printer_set): Use code_props in arguments and return
6964 types in place of char const * and location.
6965 (symbol_destructor_location_get, symbol_printer_location_get): Remove
6966 since the locations are now contained in the return of
6967 symbol_destructor_get and symbol_printer_get.
6968 * src/output.c (symbol_destructors_output, symbol_printers_output):
6969 Replace with...
6970 (symbol_code_props_output): ... this to eliminate duplicate code.
6971 (output_skeleton): Update to use symbol_code_props_output.
6972 * src/reader.c (symbol_should_be_used): Update use of
6973 symbol_destructor_get.
6974 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
6975 Update uses of the various _destructor_set and _printer_set functions.
6976 * src/symtab.c: (default_tagged_destructor_location,
6977 default_tagless_destructor_location, default_tagged_printer_location,
6978 default_tagless_printer_location): Remove since we...
6979 (default_tagged_destructor, default_tagless_destructor,
6980 default_tagged_printer, default_tagless_printer): ... change the type
6981 of these to code_props.
6982 (symbol_new, semantic_type_new, symbol_destructor_set,
6983 semantic_type_destructor_set, symbol_destructor_get,
6984 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
6985 symbol_check_alias_consistency, default_tagged_destructor_set,
6986 default_tagless_destructor_set, default_tagged_printer_set,
6987 default_tagless_printer_set): Update.
6988 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
6989 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
6990 code_props members.
6991 (symbol_print): Use SYMBOL_CODE_PRINT.
6992
69932007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
6994
6995 Use the new code_props interface for rule actions.
6996 * src/symlist.h (symbol_list): Replace action, action_location, and
6997 used members with a code_props action_props member.
6998 * src/reader.c (symbol_should_be_used, grammar_rule_check,
6999 grammar_midrule_action, grammar_current_rule_merge_set,
7000 grammar_current_rule_symbol_append, packgram): Update.
7001 * src/scan-code.h (translate_rule_action): Remove, no longer used.
7002 * src/scan-code.l (handle_action_dollar): Update.
7003 (translate_rule_action): Remove, no longer used.
7004 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
7005
70062007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7007
7008 Use the new code_props interface in parse-gram.y.
7009 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
7010 Update all uses of translate_* functions to use the new code_props
7011 interface and to use gram_scanner_last_string_free and
7012 code_scanner_last_string_free where possible.
7013 (grammar_declaration): symbol_list_destructor_set and
7014 symbol_list_printer_set now perform the translation, so don't do it
7015 here. Use gram_scanner_last_string_free where possible.
7016 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
7017 translate_code): Remove, no longer used.
7018 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
7019 symbol_list_printer_set): Perform code translation here rather than
7020 depending on the caller to do so.
7021
7022 * src/symlist.h (struct symbol_list): Correct some documentation typos.
7023 * src/scan-gram.h (gram_last_string): Remove declaration.
7024 * src/scan-gram.l (last_string): Declare it static.
7025
70262007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
7027
7028 Encapsulate code properties and related functionality for the various
7029 destructors, printers, and actions into a code_props structure and
7030 interface. This patch merely implements code_props in scan-code.h and
7031 scan-code.l. Future patches will rewrite other modules to use it.
7032 Discussed starting at
7033 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
7034 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
7035 consistently initialize const structs that have an empty location
7036 field.
7037 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
7038 to ensure consistency.
7039 * src/scan-code.h (code_props): New structure.
7040 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
7041 function, macro, and const global variable for initializing a
7042 code_props with no code.
7043 (code_props_plain_init, code_props_symbol_action_init,
7044 code_props_rule_action_init, code_props_translate_code): The rest of
7045 the new code_props functional interface. Among other things, the init
7046 functions set the code_props kind field so that
7047 code_props_translate_code will know whether to behave like
7048 translate_symbol_action, translate_rule_action, or translate_code.
7049 These old translate functions must remain until all other modules are
7050 updated to use the new code_props interface.
7051 (code_scanner_last_string_free): New function similar to
7052 gram_scanner_last_string_free.
7053 (code_scanner_free): Add documentation.
7054 * src/scan-code.l: Implement the new interface.
7055 (code_lex): Make it static, add a code_props* argument, and remove the
7056 rule argument.
7057 (last_string): New static global similar to the one in scan-gram.l.
7058 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
7059 instead of rule.
7060 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
7061 code_props since Bison may one day use this information for destructors
7062 and printers.
7063 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
7064 (handle_action_dollar): Use symbol_list_n_get and set used flag
7065 directly since symbol_list_n_used_set is removed.
7066 (translate_action): Add a code_props* argument and remove the rule,
7067 action, and location arguments. Pass the code_props* on to code_lex.
7068 (translate_rule_action, translate_symbol_action, translate_code):
7069 Rewrite as wrappers around the new code_props interface.
7070 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
7071 it would eventually need to break the encapsulation of code_props.
7072
70732007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
7074
7075 * etc/.cvsignore: New.
7076
70772007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
7078
7079 Add maintainer-push-check to run maintainer-check using push parsing in
7080 place of pull parsing where available.
7081 * Makefile.am (maintainer-push-check): New.
7082 * data/bison.m4 (b4_use_push_for_pull_if): New.
7083 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
7084 appropriately based on their existing values.
7085 (yypush_parse): Don't print push-parser-specific diagnostics if push
7086 parsing is being used in place of pull parsing.
7087 * data/yacc.c: If push parsing should replace pull parsing, redirect to
7088 push.c.
7089 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
7090 variable, and insert b4_use_push_for_pull_flag into muscles.
7091 * tests/Makefile.am (maintainer-push-check): New.
7092
70932006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
7094
7095 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
7096 (whether successful or failed) so that yypush_parse can be invoked
7097 again to start a new parse using the same yypstate.
7098 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
7099 check multiple yypull_parse invocations on the same yypstate. For pull
7100 mode, extend to check multiple yyparse invocations.
7101 (Exploding the Stack Size with Alloca): Extend to try with
7102 %push-pull-parser.
7103 (Exploding the Stack Size with Malloc): Likewise.
7104
7105 * tests/calc.at (Simple LALR Calculator): Don't specify
7106 %skeleton "push.c" since %push-pull-parser implies that now.
7107 * tests/headers.at (export YYLTYPE): Don't check for the push
7108 declarations. Otherwise, this test case can't be used to see if push
7109 mode can truly emulate pull mode.
7110 * tests/input.at (Torturing the Scanner): Likewise.
7111 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
7112 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
7113 AT_YACC_IF, which now includes the case of push mode since %skeleton
7114 need not be used for push mode. This will be more intuitive once
7115 push.c is renamed to yacc.c.
7116
71172006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
7118
7119 For push mode, convert yyparse from a macro to a function, invoke yylex
7120 instead of passing a yylexp argument to yypull_parse, and don't
7121 generate yypull_parse or yyparse unless %push-pull-parser is declared.
7122 Discussed starting at
7123 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
7124 * data/bison.m4 (b4_pull_if): New.
7125 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
7126 * data/push.c: Improve M4 quoting a little.
7127 (b4_generate_macro_args, b4_parenthesize): Remove.
7128 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
7129 any time a pull parser is requested.
7130 Don't #define this as a wrapper around yypull_parse. Instead, when
7131 both push and pull are requested, make it a function that does that
7132 same thing.
7133 (yypull_parse): If there's a b4_prefix, #define this to
7134 b4_prefix[pull_parse] when both push and pull are requested.
7135 Don't define this as a function unless both push and pull are
7136 requested.
7137 Remove the yylexp argument and hard-code yylex invocation instead.
7138 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
7139 %push-parser.
7140 * src/getargs.c (pull_parser): New global initialized to true.
7141 * getargs.h (pull_parser): extern it.
7142 * src/output.c (prepare): Insert pull_flag muscle.
7143 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
7144 (prologue_declaration): Set both push_parser and pull_parser = true for
7145 %push-pull-parser. Set push_parser = true and pull_parser = false for
7146 %push-parser.
7147 * src/scan-gram.l: Don't accept %push_parser as an alternative to
7148 %push-parser since there's no backward-compatibility concern here.
7149 Scan %push-pull-parser.
7150 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
7151 instead of %push-parser.
7152 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
7153 prototype it in the module that calls yyparse.
7154 * tests/input.at (Torturing the Scanner): Likewise.
7155 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
7156
71572006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
7158
7159 Update etc/bench.pl. Optimize push mode a little (the yyn change
7160 deserves most of the credit).
7161 * Makefile.am (SUBDIRS): Add etc subdirectory.
7162 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
7163 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
7164 yytoken, yyval, and yyloc declarations to...
7165 (yyparse or yypush_parse): ... here to improve performance. For
7166 yypush_parse invocations after the first, be sure to assign yyn its old
7167 value again.
7168 (yypstate_new): Don't bother initializing the yyresult field since the
7169 initial value isn't used.
7170 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
7171 remove the #define that, in push mode, set it to yyps->NAME.
7172 * etc/Makefile.am: New.
7173 * etc/bench.pl: Remove and build it instead from...
7174 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
7175 "tests/bison" from the build directory by default rather than just
7176 invoking "bison" from $PATH.
7177 (calc_grammar): Update push parser code: don't declare yylval globally,
7178 don't define yyparse_wrapper, and don't #define yyparse.
7179 (bench_grammar): Update to check all working combinations of yacc.c,
7180 push.c, impure, pure, pull, and push.
7181
71822006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
7183
7184 For push mode, add pull wrappers around yypush_parse.
7185 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
7186 (yypull_parse): New function wrapping yypush_parse.
7187 (yyparse): New #define wrapping yypull_parse.
7188 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
7189 is declared.
7190 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
7191 prototype yylex in the module that calls yyparse, and don't prototype
7192 yyparse there. Otherwise, the yyparse expansion won't compile.
7193 * tests/input.at (Torturing the Scanner): Likewise.
7194
71952006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
7196
7197 Enable push parsers to operate in impure mode. Thus, %push-parser no
7198 longer implies %pure-parser. The point of this change is to move
7199 towards being able to test the push parser code by running the entire
7200 test suite as if %push-parser had been declared.
7201 * data/push.c (yypush_parse): For impure mode, remove the
7202 yypushed_char, yypushed_val, and yypushed_loc arguments.
7203 Instead, declare these as local variables initialized to the global
7204 yychar, yylval, and yylloc.
7205 For the first yypush_parse invocation only, restore the initial values
7206 of these global variables when it's time to read a token since they
7207 have been overwritten.
7208 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
7209 %push-parser.
7210 * tests/calc.at (Simple LALR(1) Calculator): Always declare
7211 %pure-parser along with %push-parser since this test case was designed
7212 for pure push parsers.
7213 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
7214 (AT_YACC_OR_PUSH_IF): New.
7215 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
7216 add a note that it's still wrong for some cases (as it has been for a
7217 while).
7218 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
7219 %push-parser no longer implies %pure-parser.
7220
72212006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7222
7223 Remove some unnecessary differences between the pull parser code and
7224 the push parser code. This patch enables yynerrs in push mode.
7225 * data/push.c: Reformat M4 a little.
7226 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
7227 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
7228 because push mode is on. Instead, if pure mode is on, move yynerrs
7229 to...
7230 (b4_declare_parser_state_variables): ... here.
7231 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
7232 to yyps->NAME so it can be used in yypush_parse.
7233 (yypush_parse): Don't omit uses of yynerrs in push mode.
7234
72352006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7236
7237 Fix bug such that the first pushed token's value and location are
7238 sometimes overwritten (sometimes by %initial-action) before being used.
7239 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
7240 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
7241 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
7242 more closely mimic the pull parser logic.
7243 Don't copy the pushed token to yychar, yylval, and yylloc until it's
7244 time to read a token, which is after any initialization of yylval and
7245 yylloc.
7246 (gottoken): Rename label to...
7247 (yyread_pushed_token): ... for clarity and to avoid infringing on the
7248 user namespace.
7249
72502006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
7251
7252 Rearrange initialization of the parser state variables so that the
7253 skeleton doesn't have to have a copy for pull mode and another for push
7254 mode. This patch also fixes at least a bug such that yylloc was not
7255 initialized (with b4_location_initial_line and
7256 b4_location_initial_column) upon calling yypush_parse. However, that
7257 initialization now overwrites the first token's location;
7258 %initial-action assigning @$ already did the same thing, and both bugs
7259 will be fixed in a later patch.
7260 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
7261 (b4_declare_parser_state_variables): Remove initialization of yytoken,
7262 yyss, yyvs, yyls, and yystacksize.
7263 (yypstate_new): Remove initialization of some yypstate fields: yystate,
7264 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
7265 yylsp.
7266 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
7267 yyps->NAME so it can be used in yypush_parse.
7268 (yyparse or yypush_parse): For yypush_parse, don't print the
7269 "Starting parse" diagnostic for invocations after the first.
7270 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
7271 yypush_parse, only do it for the first invocation.
7272 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
7273 initialization to occur in yypush_parse but only on the first
7274 invocation.
7275
72762006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7277
7278 * data/push.c: Add CPP guards around push parser declarations in both
7279 the header and the code file.
7280 In the code file, move the push parser declarations to the same place
7281 they appear in the header file.
7282 Clean up the M4 some, especially the inconsistent underquoting in
7283 some b4_c_function_def and b4_c_function_decl uses.
7284
72852006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7286
7287 Encapsulate the push parser state variables into an M4 macro so the
7288 push skeleton doesn't have to list them again for pull mode's yyparse.
7289 For push mode, remove yypush_parse's local equivalents of these
7290 variables to eliminate unnecessary copying between the two sets at
7291 run-time. This patch also fixes at least a bug related to multiple
7292 %initial-action invocations in push mode.
7293 * data/push.c (b4_declare_parser_variables): Rename to...
7294 (b4_declare_scanner_communication_variables): ... this for clarity and
7295 update both uses.
7296 (b4_declare_yyparse_variables): Remove and move its contents to the one
7297 spot where it was invoked.
7298 (b4_declare_parser_state_variables): New macro containing the parser
7299 state variables required by push mode.
7300 (struct yypstate): Replace all fields but yynew with
7301 b4_declare_parser_state_variables.
7302 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
7303 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
7304 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
7305 (yyparse or yypush_parse): For yyparse in pull mode, replace local
7306 parser state variable declarations with
7307 b4_declare_parser_state_variables.
7308 Don't initialize parser state variables when calling yypush_parse since
7309 yypstate_new already does that.
7310 Invoke the user's initial action only upon the first yypush_parse
7311 invocation.
7312 Remove all code that copies between the local parser state variables
7313 and the yypstate.
7314
73152006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
7316
7317 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
7318 prevent a name collision in a future patch where these names will
7319 sometimes be #define'd.
7320 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
7321 since it no longer has the same name as the existing argument.
7322 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
7323
73242006-12-19 Paolo Bonzini <bonzini@gnu.org>
7325 and Joel E. Denny <jdenny@ces.clemson.edu>
7326
7327 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
7328 that the argument is case-insensitive, and there's no `=' here.
7329 For the %skeleton entry, mention that %language is better.
7330 (Bison Options): Likewise for --language and --skeleton. Move the
7331 --skeleton entry so that the `Tuning the parser' section is sorted
7332 alphabetically on long options.
7333 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
7334 %language directive in detail here; cross-reference the %language
7335 documentation instead.
7336 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
7337 `%require "2.3b"' so that the example is always up-to-date.
7338 (Table of Symbols): Add entries for %language and %skeleton.
7339 * examples/extexi (normalize): Instead of replacing every %require
7340 argument with the current Bison version, just substitute for
7341 `@value{VERSION}'. This guarantees that we're testing what actually
7342 appears in the documentation.
7343 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
7344 rather than `@VERSION@'.
7345
73462006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7347
7348 * NEWS: Reword the %language news a bit, and put it earlier.
7349
7350 * src/getargs.c (skeleton_arg): Last arg is now location const *.
7351 Rewrite to simplify the logic.
7352 (language_argmatch): Likewise.
7353 (program_name): We now own this var.
7354 * src/getargs.h (struct bison_language): Use char[] rather than
7355 const char *.
7356
7357 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
7358 Java is supported.
7359 * src/complain.c (program_name): Remove decl; no longer needed.
7360 * src/main.c (program_name): Remove; now belongs to getargs.
7361
73622006-12-18 Paolo Bonzini <bonzini@gnu.org>
7363
7364 * NEWS: Document %language.
7365
7366 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
7367
7368 * data/c-skel.m4, data/c++-skel.m4: New files.
7369 * data/glr.c: Complain on push parsers.
7370
7371 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
7372 over %skeleton.
7373 (Decl Summary): Document %language and %skeleton.
7374 (Command line): Document -L.
7375
7376 * examples/extexi: Rewrite %require directive.
7377 * examples/calc++/Makefile.am: Pass VERSION to extexi.
7378
7379 * src/files.c (compute_exts_from_gc): Look in language structure
7380 for .y extension.
7381 (compute_file_name_parts): Check whether .tab should be added.
7382 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
7383 (language, skeleton_arg, language_argmatch): New.
7384 (long_options): Add --language.
7385 (getargs): Use skeleton_arg, add -L/--language.
7386 * src/getargs.h: Include location.h.
7387 (struct bison_language, language, skeleton_arg, language_argmatch): New.
7388 * src/output.c (prepare): Pick default skeleton from struct language.
7389 Don't dispatch C skeletons here.
7390 * src/parse-gram.y (PERCENT_LANGUAGE): New.
7391 (prologue_declaration): Add "%language" rule, use skeleton_arg.
7392 * src/scan-gram.l ("%language"): New rule.
7393
7394 * tests/calc.at: Test %skeleton and %language.
7395 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
7396 (AT_GLR_IF): Look for %skeleton "glr.cc".
7397 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
7398 (AT_YACC_IF): Reject %language.
7399
74002006-12-18 Paul Eggert <eggert@cs.ucla.edu>
7401
7402 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
7403 since it wasn't used; only the typedef name 'semantic_type' is needed.
7404 Also, omit trailing white space.
7405
7406 * bootstrap: Sync from coreutils.
7407 (gnulib_extra_files): Add build-aux/announce.gen.
7408 (slurp): Adjust .gitignore files like .cvsignore files.
7409 * build-aux/announce-gen: Remove from CVS, since bootstrap
7410 now creates this.
7411
74122006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
7413
7414 Make %push-parser imply %pure-parser. This fixes several bugs; see
7415 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
7416 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
7417 pure_parser = true.
7418 * data/push.c: Don't bother testing b4_push_if when deciding whether
7419 to expand b4_declare_parser_variables globally.
7420 (yypush_parse): Likewise in here.
7421
7422 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
7423 (yy_reduce_print): Reformat M4 for readability.
7424
74252006-12-15 Bob Rossi <bob@brasko.net>
7426 and Joel Denny <jdenny@ces.clemson.edu>
7427
7428 * data/push.c (yypstate): Add typedef, and update all uses of
7429 struct yypstate to just yypstate.
7430 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
7431
74322006-12-14 Bob Rossi <bob@brasko.net>
7433
7434 * data/push.c (yypush_parse): Declare prototype regardless of
7435 %locations option.
7436
74372006-12-14 Bob Rossi <bob@brasko.net>
7438
7439 * data/push.c (yyparse): Remove the prototype and the #define when in
7440 push-parser mode.
7441
74422006-12-13 Bob Rossi <bob@brasko.net>
7443
7444 * data/push.c (yypstate_init): Rename to...
7445 (yypstate_new): ... this and use b4_c_function_def.
7446 (yypstate_delete): New.
7447 (yypush_parse): Change parameters yynval and yynlloc to be const.
7448 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
7449 yypstate_delete functions.
7450
74512006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
7452
7453 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
7454 strange test case titles. Reported by Bob Rossi.
7455
74562006-12-13 Paul Eggert <eggert@cs.ucla.edu>
7457
7458 * TODO: Add pointer to Sylvain Schmitz's work on static detection
7459 of potential ambiguities in GLR grammers.
7460
74612006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
7462
7463 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
7464 `bison ', use m4_index instead of m4_substr since chopping up a string
7465 containing M4-special characters causes problems here.
7466
7467 Fix a couple of bugs related to special characters in user-specified
7468 file names, and make it easier for skeletons to compute output file
7469 names with the same file name prefix as Bison-computed output file
7470 names.
7471 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
7472 b4_parser_file_name and b4_spec_defines_file instead of
7473 @output_parser_name@ and @output_header_name@, which are now redundant.
7474 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
7475 b4_parser_file_name, b4_spec_defines_file, and the new
7476 @basename(FILENAME@) instead of @output_parser_name@ and
7477 @output_header_name@, which inappropriately escaped the file names as
7478 C string literals.
7479 * src/files.c (all_but_ext): Remove static qualifier.
7480 (compute_output_file_names): Move `free (all_but_ext)' to...
7481 (output_file_names_free): ... here since all_but_ext is needed later.
7482 * src/files.h (all_but_ext): Extern.
7483 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
7484 exactly what MUSCLE_INSERT_STRING used to do.
7485 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
7486 characters are escaped properly.
7487 * src/output.c (prepare): Define muscle file_name_all_but_ext as
7488 all_but_ext.
7489 For pkgdatadir muscle, maintain previous functionality by using
7490 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
7491 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
7492 digraphs would never be expanded. Hopefully no one has M4-special
7493 characters in his Bison installation path.
7494 * src/scan-skel.l: Don't parse @output_header_name@ and
7495 @output_parser_name@ anymore since they're now redundant.
7496 In @output, use decode_at_digraphs.
7497 Parse a new @basename command that invokes last_component.
7498 (decode_at_digraphs): New.
7499 (BASE_QPUTS): Remove unused.
7500 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
7501 (Output file name): New tests.
7502
75032006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
7504
7505 Warn about output files that are generated by the skeletons and that
7506 conflict with other output files.
7507 * data/glr.c: Don't generate the header file here when glr.cc does.
7508 * src/files.c (file_names, file_names_count): New static globals.
7509 (compute_output_file_names): Invoke output_file_name_check for files
7510 not generated by the skeletons and remove existing checks.
7511 (output_file_name_check): New function that warns about conflicting
7512 output file names.
7513 (output_file_names_free): Free file_names.
7514 * src/files.h (output_file_name_check): Declare.
7515 * src/scan-skel.l: Invoke output_file_name_check for files generated by
7516 the skeletons.
7517 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
7518 (Conflicting output files): New tests.
7519
75202006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7521
7522 * doc/bison.texinfo: Fix a couple of typos.
7523
75242006-12-08 Bob Rossi <bob@brasko.net>
7525
7526 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
7527 Rename to...
7528 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
7529 update all uses.
7530 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
7531 (yypush_parse): Rename yypvars argument to yyps and remove redundant
7532 local pv.
7533 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
7534 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
7535
75362006-12-07 Bob Rossi <bob@brasko.net>
7537 and Joel Denny <jdenny@ces.clemson.edu>
7538
7539 * data/push.c (yypvarsinit): Change return type from void* to struct
7540 yypvars*. No longer cast to void* on return.
7541 (struct yypvars): Remove yylen since it need not be remembered between
7542 yypushparse invocations.
7543 (yypushparse): Don't copy between yylen and pv->yylen.
7544
75452006-12-05 Bob Rossi <bob@brasko.net>
7546
7547 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
7548 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
7549 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
7550 (struct yypvars): Remove b4_declare_parser_variables.
7551 (yypvarsinit): Remove init code for removed variables.
7552 (global scope): Do not declare b4_declare_parser_variables if
7553 push or pure mode.
7554 (yypushparse): Add b4_declare_parser_variables.
7555 Init new local variables, and remove init code for removed
7556 yypvars variables.
7557 (yyparse): Delete.
7558 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
7559 and yyparse for other modes.
7560 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
7561 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
7562 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
7563 (AT_PURE_LEX_IF): True if pure or push parser.
7564
75652006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
7566
7567 Document Yacc prologue alternatives and default %destructor's and
7568 %printer's as experimental. Don't mention Java yet. Discussed at
7569 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
7570 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
7571 (2.3a): Annotate this entry to say the old forms of these features were
7572 also experimental.
7573 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
7574 Table of Symbols): Say they're experimental. Comment out any mention
7575 of Java (we'll want this back eventually).
7576
75772006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
7578
7579 Support a file name argument to %defines. Deprecate `=' in
7580 %file-prefix, %name-prefix, and %output. Discussed at
7581 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
7582 * NEWS (2.3a+): Mention.
7583 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
7584 form of %defines, and remove `=' from entries for %file-prefix,
7585 %name-prefix, and %output.
7586 * src/parse-gram.y (prologue_declaration): Implement.
7587 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
7588 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
7589 all but one occurrence of %name-prefix.
7590 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
7591 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
7592 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
7593 occurrence of each of %file-prefix and %output. Add check for %defines
7594 with argument.
7595 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
7596 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
7597 Remove the `=' from %output.
7598
75992006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
7600
7601 Don't escape $ in test case titles since Autoconf 2.61 now does that
7602 correctly.
7603 * tests/actions.at (Default %printer and %destructor are not for error
7604 or $undefined): Here.
7605 (Default %printer and %destructor are not for $accept): Here.
7606 * tests/input.at (Invalid $n and @n): Here.
7607
76082006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
7609
7610 Rename <!> to <>. Discussed starting at
7611 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
7612 * NEWS (2.3a+): Update.
7613 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
7614 Update.
7615 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
7616 * src/scan-gram.l (INITIAL): Implement.
7617 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
7618 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
7619 comment.
7620 * tests/actions.at (Default tagless %printer and %destructor,
7621 Default tagged and per-type %printer and %destructor,
7622 Default %printer and %destructor are not for error or $undefined,
7623 Default %printer and %destructor are not for $accept,
7624 Default %printer and %destructor for mid-rule values): Update.
7625 * tests/input.at (Default %printer and %destructor redeclared,
7626 Unused values with default %destructor): Update.
7627
76282006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
7629
7630 Don't let %prec take a nonterminal.
7631 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
7632 token.
7633 * tests/input.at (%prec takes a token): New test checking that %prec
7634 won't take a nonterminal.
7635
76362006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7637
7638 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
7639 it was double-quoted.
7640 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
7641 grammar is maintained with Bison's highest standards.
7642 * src/getargs.c: Fix some typos in Doxygen comments.
7643
76442006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
7645
7646 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
7647 later. Reported by Paul Eggert in
7648 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
7649 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
7650 * src/scan-code.l (translate_action): Don't bother invoking
7651 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
7652 (code_scanner_free): Instead of invoking
7653 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
7654 which frees more.
7655 * src/scan-gram.l (gram_scanner_free): Likewise.
7656 * src/scan-skel.l (scan_skel): Likewise.
7657
76582006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
7659
7660 * src/files.c (tr): Change return type to void.
7661 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
7662 has been called previously for the same key.
7663 (muscle_find): Return storage instead of value so that
7664 --enable-gcc-warnings doesn't produce warnings that the return discards
7665 const. aver that the value and storage are the same since storage
7666 could potentially be NULL when value is not.
7667 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
7668 same as 0.
7669
76702006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7671
7672 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
7673 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
7674 us a slightly cleaner distribution, and also works.
7675 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
7676 gnulib changes.
7677
76782006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
7679 and Paul Eggert <eggert@cs.ucla.edu>
7680
7681 Don't let Bison leak memory except when it complains.
7682 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
7683 (spec_defines_file, dir_prefix): Now char *, not const char *,
7684 since they are freed.
7685 * src/files.c: Likewise.
7686 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
7687 Likewise.
7688 (tr): Now operates in-place. All uses changed.
7689 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
7690 values.
7691 (compute_file_name_parts, compute_output_file_names): Don't store
7692 read-only data in variables that will be freed.
7693 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
7694 src_extension, and header_extension.
7695 (output_file_names_free): New public function to free
7696 spec_verbose_file, spec_graph_file, spec_defines_file,
7697 parser_file_name, and dir_prefix.
7698 * src/getargs.c (getargs): Don't store read-only data in variables that
7699 will be freed.
7700 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
7701 (which previously existed but was unused), and quotearg_free.
7702 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
7703 * src/muscle_tab.c: Likewise.
7704 (muscle_entry): Make the value char const *,
7705 and add a new storage member that is char * and can be freed.
7706 (muscle_entry_free): New private function.
7707 (muscle_init): Use it instead of free.
7708 (muscle_insert, muscle_grow): Update and use new storage member.
7709 (muscle_code_grow): Free the string passed to muscle_grow
7710 since it's not needed anymore.
7711 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
7712 add a new `char *code' member.
7713 ("{...}"): Declare semantic type as code.
7714 * src/scan-code.h (translate_rule_action):
7715 (translate_symbol_action, translate_code, translate_action): Return
7716 `char const *' rather than `char *' since external code should not free
7717 these strings.
7718 * src/scan-code.l: Likewise.
7719 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
7720 which is "{...}" in the parser.
7721 * tests/Makefile.am (maintainer-check-valgrind): Set
7722 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
7723 Valgrind.
7724 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
7725 complain.
7726 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
7727 expecting a non-zero exit status sets --leak-check=summary and
7728 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
7729 this case, and we don't want to hear about it.
7730
77312006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7732
7733 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
7734 instead of from the template, to simplify configuration a bit.
7735 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
7736 and m4/wint_t.m4, as they are needed with the latest gnulib.
7737
77382006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7739
7740 Disable unset/unused mid-rule value warnings by default, and recognize
7741 --warnings=midrule-values to enable them. Discussed starting at
7742 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
7743 * NEWS (2.3a+): Mention.
7744 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
7745 warnings): Add entry for midrule-values subargument.
7746 * src/reader.c (symbol_should_be_used): Don't return true just because
7747 the value is a set/used mid-rule value unless
7748 --warnings=midrule-values was specified.
7749 * tests/input.at (Unused values, Unused values before symbol
7750 declarations): Run tests with and without --warnings=midrule-values.
7751
7752 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
7753 than LIST_FREE directly.
7754
77552006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7756
7757 Finish implementing --warnings=error, which should not be implied by
7758 --warnings=all (or by its synonyms -W and --warnings without
7759 subarguments).
7760 * src/complain.c (set_warning_issued): New function to report that
7761 warnings are being treated as errors and to record an error if so.
7762 Invoke...
7763 (warn_at, warn): ... here.
7764 * src/getargs.c (warnings_args, warnings_types): Reorder so that
7765 "error - warnings are errors" does not appear above "all - all of the
7766 above".
7767 (getargs): For -W and --warnings without subarguments, don't let
7768 FLAGS_ARGMATCH set warnings_error in warnings_flag.
7769 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
7770
77712006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7772
7773 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
7774 empty subargument list. For example: `bison --warnings= parser.y'.
7775
77762006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7777
7778 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
7779 the parser header file so that gcc doesn't warn.
7780
77812006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7782
7783 Split the default %destructor/%printer into two kinds: <*> and <!>.
7784 Discussed starting at
7785 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
7786 * NEWS (2.3a+): Mention.
7787 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
7788 previous change today related to mid-rules.
7789 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
7790 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
7791 (TYPE_TAG_ANY): Add as <*>.
7792 (TYPE_TAG_NONE): Add as <!>.
7793 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
7794 for <*> and <!>.
7795 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
7796 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
7797 * src/symlist.c (symbol_list_default_new): Split into tagged and
7798 tagless versions.
7799 (symbol_list_destructor_set, symbol_list_printer_set): Split
7800 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
7801 SYMLIST_DEFAULT_TAGLESS.
7802 * src/symlist.h: Update symbol_list_default*_new prototypes.
7803 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
7804 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
7805 * src/symtab.c (default_destructor, default_destructor_location,
7806 default_printer, default_printer_location): Split each into tagged and
7807 tagless versions.
7808 (symbol_destructor_get, symbol_destructor_location_get,
7809 symbol_printer_get, symbol_printer_location_get): Implement tagged
7810 default and tagless default cases.
7811 (default_destructor_set, default_printer_set): Split each into tagged
7812 and tagless versions.
7813 * src/symtab.h: Update prototypes.
7814 * tests/actions.at (Default %printer and %destructor): Rename to...
7815 (Default tagless %printer and %destructor): ... this, and extend.
7816 (Per-type %printer and %destructor): Rename to...
7817 (Default tagged and per-type %printer and %destructor): ... this, and
7818 extend.
7819 (Default %printer and %destructor for user-defined end token): Extend.
7820 (Default %printer and %destructor are not for error or $undefined):
7821 Update.
7822 (Default %printer and %destructor are not for $accept): Update.
7823 (Default %printer and %destructor for mid-rule values): Extend.
7824 * tests/input.at (Default %printer and %destructor redeclared): Extend.
7825 (Unused values with default %destructor): Extend.
7826
78272006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7828
7829 Don't apply the default %destructor/%printer to an unreferenced midrule
7830 value. Mentioned at
7831 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
7832 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
7833 like $@n instead of just @n so that the default %destructor/%printer
7834 logic doesn't see them as user-defined symbols.
7835 (symbol_is_dummy): Check for both forms of the name.
7836 * src/reader.c (packgram): Remove the `$' from each midrule symbol
7837 name for which the midrule value is referenced in any action.
7838 * tests/actions.at (Default %printer and %destructor for mid-rule
7839 values): New test.
7840 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
7841 for change to dummy symbol names.
7842
78432006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7844
7845 Warn about unset midrule $$ if the corresponding $n is used.
7846 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
7847 $n usage.
7848 (packgram): Before invoking grammar_rule_check on any rule, make sure
7849 all actions have already been scanned in order to set `used' flags.
7850 Otherwise, checking that a midrule's $$ is set will not always work
7851 properly because the midrule check must forward-reference the midrule's
7852 parent rule.
7853 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
7854 warning.
7855
78562006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7857
7858 More improvements to the documentation of the prologue alternatives:
7859 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
7860 Bison manual.
7861 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
7862 some text to clarify the relative importance of the new directives and
7863 to show how these directives may be viewed as code labels.
7864
78652006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
7866
7867 Similar to the recently removed %before-header, add %code-top as the
7868 alternative to the pre-prologue. Mentioned at
7869 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
7870 Also, let the prologue alternatives appear in the grammar section.
7871 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
7872 (prologue_declaration): Move the existing prologue alternatives to...
7873 (grammar_declaration): ... here and add %code-top.
7874 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
7875
7876 Clean up and extend documentation for the prologue alternatives.
7877 * NEWS (2.3a+): Describe prologue alternatives.
7878 * doc/bison.texinfo (Prologue): Move discussion of prologue
7879 alternatives to...
7880 (Prologue Alternatives): ... this new section, and extend it to discuss
7881 all 4 directives in detail.
7882 (Table of Symbols): Clean up discussion of prologue alternatives and
7883 add %code-top.
7884
78852006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7886
7887 DJGPP specific issues.
7888
7889 * djgpp/config.bat: config.hin has been moved to lib. Adjust
7890 config.bat accordingly.
7891 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
7892 * djgpp/config.site: Likewise.
7893
78942006-10-16 Paolo Bonzini <bonzini@gnu.org>
7895
7896 Replace %*-header with %provides, %requires, %code. See discussion at
7897 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
7898
7899 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
7900 (b4_user_start_header): Remove.
7901 * data/glr.c: Use new macros instead of b4_*start_header
7902 and b4_*end_header.
7903 * data/glr.cc: Likewise.
7904 * data/lalr1.cc: Likewise.
7905 * data/push.c: Likewise.
7906 * data/yacc.c: Likewise.
7907
7908 * doc/bison.texinfo: Remove %before-header, rename
7909 %{start,end,after}-header to %requires, %provides, %code.
7910
7911 * src/parse-gram.y: Likewise (also rename token names accordingly).
7912 * src/scan-gram.l: Likewise.
7913 * tests/actions.at: Likewise.
7914
79152006-10-14 Paul Eggert <eggert@cs.ucla.edu>
7916
7917 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
7918 Problem reported by Joel E. Denny.
7919
79202006-10-14 Jim Meyering <jim@meyering.net>
7921
7922 (Sync from coreutils.)
7923 Work also when the working directory (with e.g. coreutils sources)
7924 is version controlled with git, rather than CVS.
7925 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
7926 rather than CVS.
7927 In messages and comments, say e.g., "checked-out sources",
7928 rather than "CVS sources".
7929 (version_controlled_file): New function. Work for git as well as
7930 for CVS. Don't use grep's -q option.
7931 (slurp): Call it here, in place of CVS-specific code.
7932
79332006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
7934
7935 Fix testsuite for ./configure --enable-gcc-warnings:
7936 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
7937 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
7938 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
7939 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
7940 * test/regression.at (Diagnostic that expects two alternatives):
7941 Likewise.
7942
79432006-10-12 Paul Eggert <eggert@cs.ucla.edu>
7944
7945 * bootstrap.conf (gnulib_modules): Add config-h.
7946 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
7947 worry about HAVE_CONFIG_H.
7948 * lib/abitset.c: Likewise.
7949 * lib/bitset.c: Likewise.
7950 * lib/bitset_stats.c: Likewise.
7951 * lib/bitsetv-print.c: Likewise.
7952 * lib/bitsetv.c: Likewise.
7953 * lib/ebitset.c: Likewise.
7954 * lib/get-errno.c: Likewise.
7955 * lib/lbitset.c: Likewise.
7956 * lib/subpipe.c: Likewise.
7957 * lib/timevar.c: Likewise.
7958 * lib/vbitset.c: Likewise.
7959 * lib/bitset.c: Include "bitset.h" first, to test interface.
7960 * lib/bitset_stats.c: Include "bitset_stats.h" first.
7961 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
7962 * lib/bitsetv.c: Include "bitsetv.h" first.
7963 * lib/get-errno.c: Include "get-errno.h" first.
7964 * m4/.cvsignore: Add config-h.m4.
7965 * tests/actions.at (Default %printer and %destructor for ...):
7966 Adjust expected line numbers in output to reflect removal of #if
7967 HAVE_CONFIG_H lines.
7968 * tests/glr-regression.at (Missed %merge type warnings when ...):
7969 Likewise.
7970 * tests/regression.at (Braced code in declaration in rules section):
7971 Likewise.
7972 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
7973 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
7974 Include <config.h> unconditionally.
7975
7976 * bootstrap: Sync from coreutils, as follows:
7977
7978 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
7979
7980 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
7981 variable was sometimes used without being initialized. This
7982 messed up the installation of the INSTALL file in some cases.
7983
7984 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
7985
7986 * bootstrap (usage, main program, symlink_to_gnulib): Add option
7987 --copy. Inspired by a suggestion from Bruno Haible.
7988
7989 2006-10-03 Jim Meyering <jim@meyering.net>
7990
7991 * bootstrap: Undo last change to this file, since now gnulib-tool
7992 sticks with the automake default in generating dependencies.
7993
79942006-10-12 Paul Eggert <eggert@cs.ucla.edu>
7995
7996 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
7997 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
7998
7999 * doc/bison.1: Add copyright notice.
8000
8001 * data/glr.c: Don't include <stdarg.h>; not used.
8002
8003 * NEWS: The -g and --graph options now output graphs in Graphviz
8004 DOT format, not VCG format.
8005 * doc/bison.1: Likewise.
8006 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
8007 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
8008 of this change in
8009 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
8010 * TODO: Remove Graphviz entry.
8011 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
8012 remove vcg.c, vcg.h, vcg_defaults.h.
8013 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
8014 * src/graphviz.c, src/graphviz.h: New files.
8015 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
8016 * src/files.h: Make comment more generic.
8017 * src/main.c (main): Likewise.
8018 * src/print_graph.h: Likewise.
8019 * src/getargs.c (usage): Make usage description more generic.
8020 * src/print_graph.c: Include graphviz.h rather than vcg.h.
8021 (static_graph, fgraph): Remove. All uses changed to pass
8022 arguments instead of sharing a static var.
8023 (print_core, print_actions, print_state, print_graph):
8024 Output graphviz format rather than VCG format.
8025 * tests/.cvsignore: Remove *.vcg; add *.dot.
8026 * tests/output.at: Expect *.dot files, not *.vcg files.
8027
8028 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
8029 accommodates the 2006-10-08 change.
8030
80312006-10-11 Bob Rossi <bob@brasko.net>
8032
8033 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
8034 (b4_yyssa, b4_yyerror_range): New macros.
8035 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
8036 (yypvarsinit): Remove init of removed fields.
8037 (yypushparse): Remove use of removed fields; use new macros instead.
8038
80392006-10-11 Paul Eggert <eggert@cs.ucla.edu>
8040
8041 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
8042 in a push parser. Reindent slightly to match yacc.c better.
8043
80442006-10-11 Bob Rossi <bob@brasko.net>
8045
8046 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
8047 yymsg_alloc fields.
8048 (yypvarsinit, yypushparse): Remove init of removed fields.
8049 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
8050
80512006-10-09 Paul Eggert <eggert@cs.ucla.edu>
8052
8053 * THANKS: Add Paolo Bonzini and Bob Rossi.
8054
80552006-10-08 Paolo Bonzini <bonzini@gnu.org>
8056
8057 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
8058 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
8059 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
8060 b4_define_user_cde and uses): Remove.
8061 (b4_comment, b4_prefix, b4_sync_start): New.
8062 * data/bison.m4: New file, with most of the content removed from c.m4.
8063 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
8064 * src/output.c (output_skeleton): Pass bison.m4.
8065 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
8066 only if specified.
8067
80682006-10-05 Paul Eggert <eggert@cs.ucla.edu>
8069
8070 Fix test failure reported by Tom Lane in
8071 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
8072 and try to make such failures easier to catch in the future.
8073 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
8074 that's now the caller's responsibility.
8075 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
8076 Set yychar = YYEOF if it's negative.
8077 * tests/actions.at (yylex): Abort if asked to read past EOF.
8078 * tests/conflicts.at (yylex): Likewise.
8079 * tests/cxx-type.at (yylex): Likewise.
8080 * tests/glr-regression.at (yylex): Likewise.
8081 * tests/input.at (yylex): Likewise.
8082 * tests/regression.at (yylex): Likewise.
8083 * tests/torture.at (yylex): Likewise.
8084
80852006-10-01 Paul Eggert <eggert@cs.ucla.edu>
8086
8087 Fix problems with translating English-language diagnostics.
8088 * bootstrap: Fix bug introduced in recent bootstrap changes, with
8089 respect to bison-runtime pot generation. The YY_ stuff
8090 wasn't being captured.
8091 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
8092 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
8093 * runtime-po/POTFILES.in: Add data/push.c.
8094
80952006-09-29 Paul Eggert <eggert@cs.ucla.edu>
8096
8097 Merge bootstrap changes from coreutils.
8098
8099 2006-09-28 Jim Meyering <jim@meyering.net>
8100
8101 Automatically generated dependencies are important even
8102 when all of the sources in a directory come from gnulib.
8103 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
8104 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
8105
8106 2006-09-23 Jim Meyering <jim@meyering.net>
8107
8108 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
8109
8110 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8111
8112 * bootstrap: Add support for --force.
8113 (usage): New function. Describe usage less tersely.
8114 (CVS_only_file): New var.
8115
81162006-09-21 Paul Eggert <eggert@cs.ucla.edu>
8117
8118 * data/push.c (YYPUSH_MORE): Make it an enum instead.
8119 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
8120 Adjust white space and comments to match GNU style better.
8121
81222006-09-20 Bob Rossi <bob@brasko.net>
8123
8124 * data/push.c (yyresult_get): Remove function.
8125 (YYPUSH_MORE): Add #define.
8126 (yypushparse): Modify return value.
8127
81282006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8129
8130 * stamp-h.in: Remove; no longer needed.
8131 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
8132 Remove config.h, config.hin, intl (no longer created).
8133 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
8134 stamp-h1.
8135
8136 Sync bootstrap from coreutils, as follows:
8137
8138 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
8139
8140 * bootstrap (symlink_to_gnulib): New function.
8141 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
8142 to copies-of-gnulib.
8143 (cp_mark_as_generated, slurp, gnulib_files):
8144 Avoid making a copy if it's the same as the old version.
8145 (gnulib_files): Add support for this variable (used by Bison).
8146
81472006-09-20 Paul Eggert <eggert@cs.ucla.edu>
8148
8149 * src/getargs.c (usage): Rework to use conventions similar to
8150 coreutils, to make translation a bit easier and the code a bit
8151 smaller. Problem reported by Tim Van Holder.
8152
81532006-09-15 Paul Eggert <eggert@cs.ucla.edu>
8154
8155 Use some of gnulib's new modules, taken from coreutils.
8156
8157 * bootstrap: Sync from coreutils, except add support for gnulib_files.
8158 * bootstrap.conf: New file.
8159 (gnulib_modules): Add configmake, inttypes, unistd.
8160 (XGETTEXT_OPTIONS): Add complain, complain_at,
8161 fatal, fatal_at, warn, warn_at, unexpected_end.
8162 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
8163 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
8164 (gl_EARLY): Add.
8165 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
8166 (gl_INIT): Add
8167 (GNULIB_AUTOCONF_SNIPPET): Remove.
8168 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
8169 the pickiest.
8170 * lib/.cvsignore: Add inttypes_.h.
8171 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
8172 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
8173 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
8174 no-longer-necessary initializations.
8175 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
8176 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
8177 use the unistd module.
8178 * src/system.h: Likewise.
8179 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
8180 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
8181 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
8182 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
8183 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
8184 * src/system.h: Include inttypes.h unconditionally, now that we
8185 use the inttypes module. Don't bother to include stdint.h, since
8186 inttypes.h now does that for us.
8187 (LOCALEDIR): Remove, now that we use the configmake module.
8188 * src/getargs.c: Include configmake.h.
8189 * src/main.c: Likewise.
8190 * src/output.c: Likewise.
8191 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
8192 not from $abs_top_builddir, since config.h moved.
8193
8194
8195 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
8196 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
8197
8198 * src/parse-gram.y (symbol_declaration): Don't put statements
8199 before declarations; it's not portable to C89.
8200 * src/scan-code.l (handle_action_at): Likewise.
8201
8202 * src/scan-code.l: Always initialize braces_level; the old code
8203 left it uninitialized and therefore had undefined behavior.
8204
8205 Don't attempt to redefine 'assert', since it runs afoul of
8206 systems where standard headers (mistakenly) include <assert.h>.
8207 Instead, define and use our own alternative, called 'aver'.
8208 * src/reader.c: Don't include assert.h, since we no longer
8209 use assert.
8210 * src/scan-code.l: Likewise.
8211 * src/system.h (assert): Remove, replacing with....
8212 (aver): New function, taking a bool arg. All uses changed.
8213 * src/tables.c (pack_vector): Ensure that aver arg is bool,
8214 not merely an integer.
8215
82162006-09-15 Bob Rossi <bob@brasko.net>
8217
8218 Add support for push parsing. Based on the original work of
8219 Odd Arild Olsen <oao@fibula.no>.
8220 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
8221 * data/c.m4 (YYPUSH): New.
8222 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
8223 * data/push.c: New file.
8224 * src/getargs.c (push_parser): New var.
8225 * src/getargs.h (push_parser): New declaration.
8226 * src/output.c (prepare): Add macro insertion of `push_flag'.
8227 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
8228 (prologue_declaration): Parse %push-parser.
8229 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
8230 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
8231 list of removed lines from the traces observed.
8232 (AT_CHECK_CALC_LALR): Added push parser tests.
8233
82342006-09-13 Paul Eggert <eggert@cs.ucla.edu>
8235
8236 * NEWS: Version 2.3a.
8237 * configure.ac (AC_INIT): Likewise.
8238
8239 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
8240 "#define YYSTYPE int" that caused "make maintainer-check" to fail
8241 due to header ordering dependencies. I don't know why the #define
8242 was there.
8243
8244 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
8245 runtime cost when YYDEBUG is not defined, and so that some tests
8246 that used to fail now work. Problem and initial suggestion by
8247 Paolo Bonzini.
8248 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
8249 * data/glr.cc (b4_parser_class_name):
8250 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
8251 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
8252 (yydebug_) [YYDEBUG]: New member.
8253 (yycdebug_): Now defined only if YYDEBUG.
8254 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
8255 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
8256 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
8257 if YYYDEBUG.
8258 (debug_stream, set_debug_stream, debug_level, set_debug_level):
8259 Define only if YYDEBUG.
8260 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
8261 set_debug_level.
8262 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
8263 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
8264 AT_CHECK_CALC_GLR_CC that are working now.
8265
82662006-09-12 Paul Eggert <eggert@cs.ucla.edu>
8267
8268 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
8269 We don't need them in glr.cc, and glr.c defines them.
8270 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
8271 assumes that defining it to anything is the same as defining
8272 it to 1. Problem reported by Paolo Bonzini.
8273
82742006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
8275
8276 * data/c.m4 (b4_null, b4_case): Define.
8277 * src/output.c (prepare_symbols): Use b4_null.
8278 (user_actions_output): Use b4_case.
8279
82802006-09-11 Paul Eggert <eggert@cs.ucla.edu>
8281
8282 * data/glr.c (b4_shared_declarations): Put start-header first,
8283 before any #includes that we generate, so that feature-test
8284 macros work. Problem reported by Michael Deutschmann in
8285 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
8286 * data/lalr1.cc: Likewise.
8287 * doc/bison.texinfo (Prologue): Document that feature-test macros
8288 should be defined before any Bison declarations.
8289 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
8290 that depend on location.hh after, not before, Bison decls, since
8291 we now include location.hh after the first user prologue.
8292
8293 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
8294 Sander Brandenburg in
8295 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
8296 Also, fix minor white space and comment issues.
8297 (Prologue): Mention that it's better to define feature-test macros
8298 before Bison declarations. Problem reported by Michael Deutschmann.
8299
8300 * README-cvs: Fix typo: "&" should be "&&". Problem reported
8301 by Jim Meyering.
8302 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
8303 This adjusts to recent gnulib changes.
8304
83052006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8306
8307 Finish implementation of per-type %destructor/%printer. Discussed
8308 starting at
8309 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
8310 and
8311 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
8312 * NEWS (2.3+): Add a description of this feature to the default
8313 %destructor/%printer description.
8314 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
8315 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
8316 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
8317 list node contains a semantic type.
8318 * src/symtab.c, src/symtab.h: Extend with a table that associates
8319 semantic types with their %destructor's and %printer's.
8320 (semantic_type_from_uniqstr, semantic_type_get,
8321 semantic_type_destructor_set, semantic_type_printer_set): New functions
8322 composing the public interface of that table.
8323 (symbol_destructor_get, symbol_destructor_location_get,
8324 symbol_printer_get, symbol_printer_location_get): If there's no
8325 per-symbol %destructor/%printer, look up the per-type before trying
8326 the default.
8327 * tests/actions.at (Per-type %printer and %destructor): New test case.
8328 * tests/input.at (Default %printer and %destructor redeclared):
8329 Extend to check that multiple occurrences of %symbol-default in a
8330 single %destructor/%printer declaration is an error.
8331 (Per-type %printer and %destructor redeclared, Unused values with
8332 per-type %destructor): New test cases.
8333
83342006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
8335
8336 Require default %destructor/%printer to be declared using
8337 %symbol-default instead of an empty symbol list, and start working on
8338 new per-type %destructor/%printer. Discussed at
8339 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
8340 * NEWS (2.3+): Add %symbol-default to example.
8341 * bison.texinfo (Freeing Discarded Symbols): Likewise.
8342 (Table of Symbols): Add entry for %symbol-default.
8343 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
8344 (generic_symlist, generic_symlist_item): New nonterminals for creating
8345 a list in which each item is a symbol, semantic type, or
8346 %symbol-default.
8347 (grammar_declaration): Use generic_symlist in %destructor and %printer
8348 declarations instead of symbols.1 or an empty list.
8349 (symbol_declaration, precedence_declaration, symbols.1): Update actions
8350 for changes to symbol_list.
8351 * src/reader.c: Update for changes to symbol_list.
8352 * src/scan-code.l: Likewise.
8353 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
8354 * src/symlist.c, src/symlist.h: Extend such that a list node may
8355 represent a semantic type or a %symbol-default in addition to just an
8356 ordinary symbol. Add switched functions for setting %destructor's and
8357 %printer's.
8358 * tests/actions.at, tests/input.at: Add %symbol-default to all default
8359 %destructor/%printer declarations.
8360
83612006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
8362
8363 Whether the default %destructor/%printer applies to a particular symbol
8364 isn't a question of whether the user *declares* that symbol (in %token,
8365 for example). It's a question of whether the user by any means
8366 *defines* the symbol at all (by simply using a char token, for
8367 example). $end is defined by Bison whereas any other token with token
8368 number 0 is defined by the user. The error token is always defined by
8369 Bison regardless of whether the user declares it with %token, but we
8370 may one day let the user define error as a nonterminal instead.
8371 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
8372 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
8373 the meaning of "user-defined".
8374 * tests/actions.at (Default %printer and %destructor for user-declared
8375 end token): Rename to...
8376 (Default %printer and %destructor for user-defined end token): ...
8377 this.
8378
8379 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
8380 computation of whether to apply the default, don't maintain a list of
8381 every Bison-defined symbol. Instead, just check for a first character
8382 of '$', which a user symbol cannot have, and check for the error token.
8383
83842006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
8385
8386 Don't apply the default %destructor or %printer to the error token,
8387 $undefined, or $accept. This change fits the general rule that the
8388 default %destructor and %printer are only for user-declared symbols,
8389 and it solves several difficulties that are described in the new test
8390 cases listed below.
8391 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
8392 * tests/actions.at (Default %printer and %destructor are not for error
8393 or $undefined, Default %printer and %destructor are not for $accept):
8394 New test cases.
8395
83962006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
8397
8398 Allow %start after the first rule.
8399 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
8400 when parsing the first rule.
8401 (check_and_convert_grammar): Search for it here after all grammar
8402 declarations have been parsed. Skip midrules, which have dummy LHS
8403 nonterminals.
8404 * src/symtab.c (symbol_is_dummy): New function.
8405 * src/symtab.h (symbol_is_dummy): Declare it.
8406 * tests/input.at (%start after first rule): New test.
8407
84082006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8409
8410 Redo some of the previous commit: add back the ability to use
8411 non-aliased/undeclared string literals since it might be useful to
8412 those declaring %token-table.
8413 * src/reader.c (check_and_convert_grammar): Undo changes in previous
8414 commit: don't worry about complaints from symbols_pack.
8415 * src/symtab.c (symbol_new, symbol_class_set,
8416 symbol_check_alias_consistency): Undo changes in previous commit: count
8417 each string literal as a new symbol and token, assign it a symbol
8418 number, and don't complain about non-aliased string literals.
8419 (symbols_pack): Since symbol_make_alias still does not decrement symbol
8420 and token counts but does still set aliased tokens to the same number,
8421 symbol_pack_processor now leaves empty slots in the symbols array.
8422 Remove those slots.
8423 * tests/regression.at (Undeclared string literal): Remove test case
8424 added in previous commit since non-aliased string literals are allowed
8425 again.
8426 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
8427 remove unnecessary string literal declarations.
8428 * tests/sets.at (Firsts): Likewise.
8429
84302006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
8431
8432 Don't allow an undeclared string literal, but allow a string literal to
8433 be used before its declaration.
8434 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
8435 symbols_pack complained.
8436 * src/symtab.c (symbol_new): Don't count a string literal as a new
8437 symbol.
8438 (symbol_class_set): Don't count a string literal as a new token, and
8439 don't assign it a symbol number since symbol_make_alias does that.
8440 (symbol_make_alias): It's not necessary to decrement the symbol and
8441 token counts anymore. Don't assume that an alias declaration occurs
8442 before any uses of the identifier or string, and thus don't assert that
8443 one of them has the highest symbol number so far.
8444 (symbol_check_alias_consistency): Complain if there's a string literal
8445 that wasn't declared as an alias.
8446 (symbols_pack): Bail if symbol_check_alias_consistency failed since
8447 symbol_pack asserts that every token has been assigned a symbol number
8448 although undeclared string literals have not.
8449 * tests/regression.at (String alias declared after use, Undeclared
8450 string literal): New test cases.
8451 (Characters Escapes, Web2c Actions): Declare string literals as
8452 aliases.
8453 * tests/sets.at (Firsts): Likewise.
8454
84552006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
8456
8457 In the grammar scanner, STRING_FINISH unclosed constructs and return
8458 them to the parser in order to improve error messages.
8459 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
8460 SC_BRACED_CODE, SC_PROLOGUE): Implement.
8461 * tests/input.at (Unclosed constructs): New test case.
8462 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
8463 seen.
8464
8465 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
8466 unused global.
8467
84682006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
8469
8470 Handle string aliases for character tokens correctly.
8471 * src/symtab.c (symbol_user_token_number_set): If the token has an
8472 alias, check and set its alias's user token number instead of its own,
8473 which is set to indicate the alias. Previously, every occurrence of
8474 the character token in the grammar overwrote that alias indicator with
8475 the character code.
8476 * tests/input.at (String aliases for character tokens): New test.
8477
84782006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
8479
8480 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
8481
84822006-08-11 Paul Eggert <eggert@cs.ucla.edu>
8483
8484 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
8485 to prevent failures when building on older platforms.
8486 Check for autopoint failure.
8487 Set XGETTEXT_OPTIONS to values that check for C format strings,
8488 so that translators are warned about them (this also helps
8489 prevent core dumps).
8490
8491 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
8492 function, since it simplifies our code a bit.
8493
8494 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
8495 rather than -W, so we don't get bogus warnings about sign comparisons.
8496 Add -Wpointer-arith, since that warning is useful (it reports code
8497 that does not conform to C89 and that some compilers reject).
8498 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
8499 since it's no longer needed.
8500
85012006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
8502
8503 Clean up scanners a bit.
8504 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
8505 definitions so gcc won't warn when obstack_for_string is unused.
8506 * src/scan-code.l: config.h and system.h are already #include'd by
8507 scan-code-c.c, so get rid of them here.
8508 * src/scan-gram.l: Likewise.
8509 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
8510 definitions rather than duplicating the rest of it.
8511 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
8512
85132006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
8514
8515 Suppress signed/unsigned comparison warnings for yycheck.
8516 * data/c.m4 (b4_safest_int_type): New macro.
8517 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
8518 a signed int type, cast it to b4_safest_int_type first.
8519 * data/yacc.c: Likewise.
8520 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
8521 also overwritten.
8522
85232006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
8524
8525 * doc/bison.texinfo: Fix some typos.
8526
85272006-08-02 Paul Eggert <eggert@cs.ucla.edu>
8528
8529 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
8530 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
8531
8532 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
8533 the latest gnulib does this a different way.
8534 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
8535 translation was patched, so stop omitting it.
8536
85372006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8538
8539 Enable declaration of default %printer/%destructor. Make the parser
8540 use these for all user-declared grammar symbols for which the user does
8541 not declare a specific %printer/%destructor. Thus, the parser uses it
8542 for token 0 if the user declares it but not if Bison generates it as
8543 $end. Discussed starting at
8544 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
8545 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
8546 and
8547 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
8548 * NEWS (2.3+): Mention.
8549 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
8550 declare a %destructor for a mid-rule's semantic value. It's just
8551 impossible to declare one specific to it.
8552 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
8553 code. Describe default %destructor form.
8554 * src/parse-gram.y (grammar_declaration): Parse default
8555 %printer/%destructor declarations.
8556 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
8557 and symbol_destructor_location_get rather than accessing the destructor
8558 and destructor_location members of struct symbol.
8559 (symbol_printers_output): Likewise but for %printer's.
8560 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
8561 again.
8562 * src/symtab.c (default_destructor, default_destructor_location,
8563 default_printer, default_printer_location): New static global
8564 variables to record the default %destructor and %printer.
8565 (symbol_destructor_get, symbol_destructor_location_get,
8566 symbol_printer_get, symbol_printer_location_get): New functions to
8567 compute the appropriate %destructor and %printer for a symbol.
8568 (default_destructor_set, default_printer_set): New functions to set the
8569 default %destructor and %printer.
8570 * src/symtab.h: Prototype all those new functions.
8571 * tests/actions.at (Default %printer and %destructor): New test to
8572 check that the right %printer and %destructor are called, that they're
8573 not called for $end, and that $$ and @$ work correctly.
8574 (Default %printer and %destructor for user-declared end token): New
8575 test to check that the default %printer and %destructor are called for
8576 a user-declared end token.
8577 * tests/input.at (Default %printer and %destructor redeclared, Unused
8578 values with default %destructor): New tests to check related grammar
8579 warnings and errors.
8580
85812006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
8582
8583 Clean up handling of %destructor for the end token (token 0).
8584 Discussed starting at
8585 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
8586 and
8587 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
8588
8589 Make the skeletons consistent in how they pop the end token and invoke
8590 its %destructor.
8591 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
8592 state, which has token number 0, since this would invoke the
8593 %destructor for the end token.
8594 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
8595 until after shifting the end token, or else it won't be popped.
8596 * data/yacc.c (yyparse): Likewise.
8597
8598 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
8599 it's the end token. Upon termination, destroy an unshifted lookahead
8600 even when it's the end token.
8601 * data/lalr1.cc (yy::parser::parse): Likewise.
8602 * data/yacc.c (yyparse): Likewise.
8603
8604 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
8605 value warnings for the end token when the user gives the end token a
8606 %destructor.
8607
8608 * tests/actions.at (Printers and Destructors): Test all the above.
8609
86102006-07-24 Paul Eggert <eggert@cs.ucla.edu>
8611
8612 Update to latest gnulib and gettext versions.
8613 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
8614 Add fopen-safer.
8615 (gnulib_files): Add m4/warning.m4. Don't worry about files
8616 overwritten by autopoint.
8617 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
8618 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
8619 rejects them.
8620 Don't use autoreconf; instead, invoke autopoint etc. by hand,
8621 so that we can remove the intl files at a better time.
8622 (intl_files_to_remove): Remove aclocal.m4, since it gets
8623 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
8624 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
8625 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
8626 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
8627 Remove datarootdir hack; no longer needed.
8628 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
8629 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
8630 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
8631 strdup.h.
8632 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
8633 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
8634
86352006-07-20 Paul Eggert <eggert@cs.ucla.edu>
8636
8637 * bootstrap: Adjust to today's change to gnulib-tool by invoking
8638 it with --assume-autoconf='latest-stable'.
8639
86402006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
8641
8642 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
8643 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
8644 YYSTYPE' and `{'.
8645 * src/muscle_tab.h (muscle_grow): Replace the header comments with
8646 those from muscle_tab.c since the old ones are misleading.
8647
86482006-07-13 Akim Demaille <akim@epita.fr>
8649
8650 Support %define "KEY" {VALUE}.
8651 * src/scan-code.h, src/scan-code.l (translate_action)
8652 (translate_rule_action, translate_symbol_action, translate_code):
8653 Return char *, not const char *.
8654 * src/parse-gram.y (declaration): Rename as...
8655 (prologue_declaration): this.
8656 (string_content): Remove this nonterminal, use STRING.
8657 (braceless, content, content.opt): New nonterminal.
8658 Use them.
8659 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
8660 as value.
8661 * src/scan-gram.l (getargs.h): Don't include it.
8662
86632006-07-12 Paul Eggert <eggert@cs.ucla.edu>
8664
8665 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
8666 rather than a for-loop that declares a local bool variable. This
8667 should work around a compatibility problem with a Cray x1e C++
8668 compiler reported by Hung Nguyen in
8669 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
8670 The for-loop was introduced in the 2004-11-17 change but I don't
8671 know why it was needed.
8672
86732006-07-12 Akim Demaille <akim@epita.fr>
8674
8675 * data/c.m4: Comment changes.
8676
86772006-07-10 Akim Demaille <akim@lrde.epita.fr>
8678
8679 * src/complain.c (error_message, ERROR_MESSAGE): New.
8680 To factor...
8681 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
8682 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
8683
86842006-07-09 Paul Eggert <eggert@cs.ucla.edu>
8685
8686 * NEWS: Instead of %union, you can define and use your own union type
8687 YYSTYPE if your grammar contains at least one <type> tag.
8688 Your YYSTYPE need not be a macro; it can be a typedef.
8689 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
8690 (Union Decl, Decl Summary): Document this.
8691 * data/glr.c (YYSTYPE): Implement this.
8692 * data/glr.cc (YYSTYPE): Likewise.
8693 * data/lalr1.cc (YYSTYPE): Likewise.
8694 * data/yacc.c (YYSTYPE): Likewise.
8695 * src/output.c (prepare): Output tag_seen_flag.
8696 * src/parse-gram.y (declaration, grammar_declaration):
8697 Use 'union_seen' rather than 'typed' to determine whether
8698 %union has been seen, since grammars can now be typed without
8699 %union.
8700 (symbol_declaration, type.opt, symbol_def):
8701 Keep track of whether a tag has been seen.
8702 * src/reader.c (union_seen, tag_seen): New vars.
8703 (typed): remove.
8704 * src/reader.h (union_seen, tag_seen, typed): Likewise.
8705 * src/scan-code.l (untyped_var_seen): New variable.
8706 (handle_action_dollar): Adjust to above changes.
8707 (handle_action_dollar, handle_action_at):
8708 Improve overflow checking for outlandish numbers.
8709 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
8710 avoid new diagnostics generated by above changes.
8711 * tests/regression.at (YYSTYPE typedef): Add test to check
8712 for type tags without %union.
8713
8714 * src/symlist.c (symbol_list_length): Return int, not unsigned
8715 int, since callers expect int. This may need to get revisited
8716 once we have proper integer overflow checking.
8717
8718 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
8719 object is now static.
8720
8721 * src/getargs.c (flags_argmatch): Return void, not int,
8722 to pacify ./configure --enable-gcc-warnings.
8723
8724 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
8725 since last_string is already defined to FLEX_PREFIX (last_string).
8726
87272006-07-09 Akim Demaille <akim@lrde.epita.fr>
8728
8729 Implement --warnings/-W.
8730 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
8731 replaced by...
8732 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
8733 Adjust callers.
8734 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
8735 (warnings_args, warnings_types): New.
8736 (getargs, short_options, long_options): Accept -W/--warnings.
8737 Sort the options by alphabetical order, upper case letter right
8738 before its lower case.
8739
87402006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
8741
8742 Change %merge result type clash warnings to errors. Discussed at
8743 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
8744 * src/reader.c (record_merge_function_type): Use complain_at.
8745 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8746 declared later): Update test case results.
8747
87482006-07-09 Akim Demaille <akim@lrde.epita.fr>
8749
8750 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
8751 to be in alphabetical order.
8752 (trace_args): Spelling fixes.
8753
87542006-07-09 Paul Eggert <eggert@cs.ucla.edu>
8755
8756 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
8757 so they don't collide with user-defined macros.
8758 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
8759 this was never guaranteed, and now that we're using gnulib stdint,
8760 which defines int_fast16_t to long int, the problem is exposed.
8761
87622006-07-08 Paul Eggert <eggert@cs.ucla.edu>
8763
8764 * data/c.m4 (b4_basename): Simplify a bit, since we don't
8765 need the full POSIX semantics (and weren't implementing them
8766 anyway).
8767
8768 Adjust to Autoconf 2.60 and today's gnulib.
8769 * bootstrap (gnulib_modules): Add stdint.
8770 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
8771 no longer copies it.
8772 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
8773 since stdint needs the former and wcwidth (which is now required
8774 by mbswidth) needs the latter.
8775 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
8776 work around a compatibility glitch between gettext 0.14.6 and
8777 Autoconf 2.60.
8778 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
8779 Do not check for uintptr_t, since new stdint module does the right
8780 thing.
8781 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
8782 Add stdint.h, stdint_.h, wcwidth.h.
8783 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
8784 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
8785 stdint.m4, wchar_t.m4, wcwidth.m4.
8786 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
8787 usual order for ../lib/*.h files.
8788 (file_name_split): Use last_component, not base_name, to adjust
8789 to gnulib changes.
8790 * src/parse-gram.h: Include <strverscmp.h> in the usual order
8791 for ../lib/*.h files.
8792 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
8793 Define unconditionally, since we now assume the stdint module.
8794 * src/scan-skel.l: Include <dirname.h>.
8795 (BASE_QPUTS): Use last_component, not base_name.
8796 * src/system.h: Include <unlocked-io.h> in the usual order
8797 for ../lib/*.h files. Include <stdint.h> unconditionally,
8798 since we now use the stdint module.
8799 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
8800 HAVE_UINTPTR_T, since we now use the stdint module.
8801 (base_name): Remove decl, since files now include <dirname.h>
8802 to get the decl.
8803
88042006-07-08 Akim Demaille <akim@lrde.epita.fr>
8805
8806 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
8807 New, default to 1.
8808 * data/yacc.c, data/glr.c, data/location.cc: Use them.
8809 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
8810 default.
8811 * tests/calc.at: Adjust.
8812
88132006-07-08 Akim Demaille <akim@lrde.epita.fr>
8814
8815 * data/c.m4 (b4_basename): New.
8816 (b4_syncline): Also output the location of its invocation (from
8817 the skeleton).
8818 (b4_user_action, b4_define_user_action, b4_user_actions)
8819 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
8820 (b4_user_stype): New.
8821 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
8822
88232006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8824
8825 In the grammar file, the first column is 1 not 0 on the first line as
8826 on every other line.
8827 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
8828 * tests/input.at (Torturing the Scanner): Update output.
8829
8830 * src/scan-gram.l (scanner_cursor): Declare it static.
8831
88322006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8833
8834 In warnings, say "previous declaration" rather than "first
8835 declaration".
8836 * src/symtab.c (redeclaration): Do that here.
8837 * src/reader.c (record_merge_function_type): In the case of a result
8838 type clash, report the previous declaration rather than the very first
8839 one in the grammar file.
8840 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8841 declared later): Add a third declaration to check this behavior.
8842 * tests/input.at (Incompatible Aliases): Update output.
8843
88442006-06-27 Akim Demaille <akim@epita.fr>
8845
8846 * doc/Doxyfile.in: New.
8847 * doc/Makefile.am: Use it.
8848 * src/lalr.h, src/symtab.h: Initial doxygenation.
8849
88502006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8851
8852 Don't miss %merge result type warnings just because the LHS types are
8853 declared after the %merge. This continues the effort of the previous
8854 patch.
8855 * src/reader.c (get_merge_function): Don't set the merger type yet.
8856 (record_merge_function_type): New function for setting the merger type
8857 and checking for clashes.
8858 (grammar_current_rule_merge_set): Set the location of the %merge for
8859 the current rule.
8860 (packgram): Invoke record_merge_function_type for each rule now that
8861 all symbol type declarations have been parsed.
8862 * src/reader.h (merger_list.type_declaration_location): New member
8863 storing the location of the first %merge from which the type for this
8864 merging function was derived.
8865 * src/symlist.h (symbol_list.merger_declaration_location): New member
8866 storing the location of a rule's %merge, if any.
8867 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8868 declared later): New test to catch the error fixed by the above patch.
8869
88702006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8871
8872 Get action warnings (grammar_rule_check) right even when symbol
8873 declarations appear after the rules. Discussed at
8874 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
8875 and
8876 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
8877 Don't mistake the type of $$ in a midrule to be that of its parent
8878 rule's $$.
8879 * src/reader.c (grammar_current_rule_end): Don't invoke
8880 grammar_rule_check yet since not all symbol declarations may have been
8881 parsed yet.
8882 (grammar_midrule_action): Likewise.
8883 Don't record whether the midrule's $$ has been used yet since actions
8884 haven't been translated yet.
8885 Record the midrule's parent rule and its RHS index within the parent
8886 rule.
8887 (grammar_current_rule_action_append): Don't translate the action yet
8888 since not all symbol declarations may have been parsed yet and, thus,
8889 warnings about types for $$, $n, @$, and @n can't be reported yet.
8890 (packgram): Translate the action and invoke grammar_rule_check now that
8891 all symbol declarations have been parsed.
8892 * src/scan-code.l (handle_action_dollar): Now that this is invoked
8893 after parsing the entire grammar file, the symbol list here in the case
8894 of a midrule is actually the midrule's empty RHS, so reference its
8895 parent rule's RHS where necessary.
8896 On the other hand, now that you can already know it's a midrule, you
8897 aren't forced to think $$ has the same type as its parent rule's $$.
8898 (handle_action_at): In the case of a midrule, reference the parent rule
8899 where necessary.
8900 * src/symlist.c (symbol_list_new): Initialize new midrule-related
8901 members.
8902 (symbol_list_length): Now that this is invoked after all rules have
8903 been parsed, a NULL symbol (rather than a NULL symbol list node)
8904 terminates a rule. symbol_list_print already does this correctly.
8905 * src/symlist.h (symbol_list.midrule_parent_rule,
8906 symbol_list.midrule_parent_rhs_index): New members so that midrules can
8907 remember their relationships with their parents.
8908 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
8909 fixed by the above patch.
8910 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
8911 implementing...
8912 (Unused values): ... this old test case and...
8913 (Unused values before symbol declarations): ... this new test case.
8914 This one is the same as `Unused values' except that all symbol
8915 declarations appear after the rules in order to catch the rest of the
8916 errors fixed by the above patch.
8917
89182006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8919
8920 More cleanup.
8921 * src/reader.c (current_rule): Declare it static since it's no longer
8922 used outside this file.
8923 (grammar_current_rule_action_append): Remove redundant arguments from
8924 translate_rule_action invocation.
8925 * src/reader.h (current_rule): Remove this unused extern.
8926 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
8927 * src/scan-code.l (translate_rule_action): Likewise.
8928
89292006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
8930
8931 Clean up yesterday's patch.
8932 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
8933 to...
8934 * src/reader.c (grammar_current_rule_action_append): ... here for
8935 consistency with grammar_current_rule_symbol_append.
8936 * tests/regression.at (Braced code in declaration in rules section):
8937 Make yyerror and yylex static as usual.
8938
89392006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
8940
8941 Fix bug that mistakes braced code in a declaration in the rules section
8942 to be a rule action. Mentioned at
8943 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
8944 * src/scan-gram.l: Move midrule action detection from the start of the
8945 scanning of any braced code to...
8946 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
8947 action. For readability, use $2 and @2 rather than the equivalent
8948 global variables.
8949 * tests/regression.at (Braced code in declaration in rules section):
8950 New test to catch the error fixed by the above patch.
8951
8952 Work on code readability some.
8953 * src/scan-code.l (current_rule): Get rid of this misleading and
8954 redundant declaration: it's actually extern'ed in reader.h.
8955 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
8956 translate_action): Add a rule argument and use it instead of the global
8957 current_rule.
8958 (translate_rule_action): This already receives current_rule through an
8959 argument, so pass it on to translate_action instead of assigning
8960 current_rule to current_rule.
8961 (translate_symbol_action, translate_code): Pass rule = NULL to
8962 translate_action.
8963
89642006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
8965
8966 Rename %before-definitions to %start-header and %after-definitions to
8967 %end-header. Don't use these declarations to separate pre-prologue
8968 blocks from post-prologue blocks. Add new order-independent
8969 declarations %before-header and %after-header as alternatives to the
8970 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
8971 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
8972 * NEWS (2.3+): Update for these changes.
8973 * data/glr.c (b4_before_definitions): Update to...
8974 (b4_start_header): ... this.
8975 (b4_after_definitions): Update to...
8976 (b4_end_header): ... this.
8977 * data/glr.cc: Likewise.
8978 * data/lalr1.cc: Likewise.
8979 * data/yacc.c: Likewise.
8980 * doc/bison.texinfo (The prologue): Update names, and replace remaining
8981 prologue blocks with %*-header declarations.
8982 (Calc++ Parser): Likewise.
8983 (Decl Summary): Update names.
8984 (Table of Symbols): Update description.
8985 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
8986 (PERCENT_END_HEADER): ... this.
8987 (PERCENT_BEFORE_DEFINITIONS): Update to...
8988 (PERCENT_START_HEADER): ... this.
8989 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
8990 (declaration): Update token names and m4 macro names.
8991 When parsing %end-header and %start-header, invoke translate_code
8992 before muscle_code_grow, and no longer set global booleans to remember
8993 whether these declarations have been seen.
8994 Parse new %after-header and %before-header.
8995 * src/reader.c (before_definitions, after_definitions): Remove.
8996 (prologue_augment): Accept a new bool argument to specify whether to
8997 augment the pre-prologue or post-prologue.
8998 * src/reader.h (before_definitions, after_definitions): Remove these
8999 extern's.
9000 (prologue_augment): Add new bool argument.
9001 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
9002 (PERCENT_END_HEADER): ... this.
9003 (PERCENT_BEFORE_DEFINITIONS): Update to...
9004 (PERCENT_START_HEADER): ... this.
9005 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
9006 * tests/actions.at (Printers and Destructors): Update names.
9007
90082006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
9009
9010 Add comparison operators for C++ location classes. Discussed at
9011 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
9012 * data/c++.m4 (b4_define_location_comparison): New boolean %define
9013 declaration indicating whether filename_type has an operator==. If
9014 filename_type is `std::string', it defaults to `1', `0' otherwise.
9015 * data/location.cc: Iff b4_define_location_comparison is `1', add
9016 operator== and operator!= for class position and for class location.
9017
9018 Some minor fixes.
9019 * src/scan-action.l: Remove unused file.
9020 * src/symtab.c (symbol_printer_set): Use printer_location not
9021 destructor_location.
9022 * src/symtab.h (struct symbol): Replace incorrect source comment for
9023 printer members.
9024 * tests/input.at (Incompatible Aliases): Update output with correct
9025 printer location.
9026
90272006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
9028
9029 Don't put the pre-prologue in the header file. For the yacc.c code
9030 file and the glr.c header and code files, move the pre-prologue before
9031 the token definitions. Add new %before-definitions and
9032 %after-definitions to declare code that will go in both the header file
9033 and code file. Discussed at
9034 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
9035 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
9036 and
9037 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
9038 * NEWS (2.3+): Describe these changes.
9039 * data/glr.c (b4_pre_prologue): Move from within to before...
9040 (b4_shared_declarations): ... this.
9041 Add new b4_before_definitions before b4_token_enums.
9042 Add new b4_after_definitions at the end.
9043 * data/glr.cc (b4_pre_prologue): Replace with...
9044 (b4_before_definitions): ... this in the header file.
9045 (b4_after_definitions): New near the end of the header file.
9046 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
9047 code file right before including the header file.
9048 (b4_before_definitions): New in the previous position of
9049 b4_pre_prologue in the header file.
9050 (b4_after_definitions): New near the end of the header file.
9051 * data/yacc.c: Clean up some m4 quoting especially in the header file.
9052 (b4_token_enums_defines): In the code file, move to right before
9053 YYSTYPE for consistency with the header file.
9054 (b4_before_definitions): New right before b4_token_enums_defines in
9055 both the header and code file.
9056 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
9057 header and code file.
9058 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
9059 of prologues for %union dependencies.
9060 (Decl Summary): In %defines description, mention the effect of
9061 %before-definitions and %after-definitions on the header file.
9062 (Calc++ Parser): Forward declare driver in a %before-definitions rather
9063 than in the pre-prologue so that make check succeeds.
9064 (Table of Symbols): Add entries for %before-definitions and
9065 %after-definitions.
9066 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
9067 %before-definitions.
9068 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
9069 (declaration): Parse those declarations and append to
9070 b4_before_definitions and b4_after_definitions, respectively.
9071 * src/reader.c (before_definitions, after_definitions): New bools to
9072 track whether those declarations have been seen.
9073 (prologue_augment): Add to the post-prologue if %union,
9074 %before-definitions, or %after-definitions has been seen.
9075 * src/reader.h (before_definitions, after_definitions): New extern's.
9076 * src/scan-gram.l: Scan the new declarations.
9077 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
9078 prologue block in a %before-definitions or a %after-definitions based
9079 on whether the %union is declared.
9080 * tests/regression.at (Early token definitions with --yacc, Early token
9081 definitions without --yacc): Move tests for token definitions into the
9082 post-prologue since token names are no longer defined in the
9083 pre-prologue.
9084
90852006-06-20 Akim Demaille <akim@epita.fr>
9086
9087 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
9088 (symbol_get): Use it.
9089 * src/parse-gram.y: Use it.
9090
90912006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
9092
9093 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
9094 build succeeds when configured with --enable-gcc-warnings.
9095
90962006-06-19 Paul Eggert <eggert@cs.ucla.edu>
9097
9098 * src/parse-gram.y (char_name): New function.
9099 (CHAR, STRING, string_content): For %printer, properly escape.
9100 (ID): Prefer fputs to fprintf.
9101 (id): Reindent to be consistent with other rules.
9102 Properly quote char.
9103
9104 The Translation Project changed its way of publishing translations
9105 to maintainers. I haven't received any responses to my request
9106 for supporting the old way, or for documenting the new way. I
9107 have modified 'bootstrap' to use screen scraping
9108 (in this case, HTML scraping). This is unreliable and inelegant,
9109 but I don't see any better way. Yuck.
9110 * bootstrap (TP_URL, WGET_COMMAND): New vars.
9111 (get_translations): New function, which uses HTML scraping to
9112 deduce locations of latest translations.
9113 Use this function to grab both bison and bison-runtime .po files.
9114 Don't bother priming the pump for the runtime-po domain any more,
9115 as it's now translated better than bison is.
9116
91172006-06-19 Akim Demaille <akim@epita.fr>
9118
9119 * src/scan-gram.l: No longer "parse" things after `%union' until
9120 `{'. Rather, return a single "%union" token.
9121 No longer make symbols: return strings, and leave the conversion
9122 to symbols to the parser.
9123 (SC_PRE_CODE, token_type): Remove.
9124 * src/parse-gram.y (%union): New field `character'.
9125 Sort tokens.
9126 (CHAR): New token.
9127 (ID, ID_COLON): Now that the scanner no longer makes them
9128 identifiers, adjust all uses to invoke symbol_get.
9129 (id_colon): New, wraps the conversion from string to symbol.
9130 (%union): Accept a possible union_name.
9131 (symbol): Now can be a char.
9132 * data/c.m4 (b4_union_name): Leave a default value.
9133 * data/glr.c, data/yacc.c: Use it.
9134
91352006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
9136
9137 For associating token numbers with token names for "yacc.c", don't use
9138 #define statements unless `--yacc' is specified; always use enum
9139 yytokentype. Most important discussions start at:
9140 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
9141 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
9142 and
9143 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
9144 * NEWS (2.3+): Mention.
9145 * data/c.m4 (b4_yacc_if): New.
9146 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
9147 token #define's.
9148 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
9149 on token name definitions.
9150 * src/getargs.c (usage): Capitalize `Yacc' in English.
9151 * src/output.c (prepare): Define b4_yacc_flag.
9152 * tests/regression.at (Early token definitions): Test that tokens names
9153 are defined before the pre-prologue not just before the post-prologue.
9154 Remove this test case and copy to...
9155 (Early token definitions with --yacc): ... this to test #define's.
9156 (Early token definitions without --yacc): ... and this to test enums.
9157
91582006-06-11 Paul Eggert <eggert@cs.ucla.edu>
9159
9160 * NEWS: Reword the post-2.3 change to not be so optimistic about
9161 removing the old "look-ahead" spelling.
9162 Update previous look-ahead/lookahead change reports.
9163 * REFERENCES: look-ahead -> lookahead (since that's
9164 what he actually wrote).
9165 * doc/refcard.tex: look ahead -> lookahead,
9166 look-ahead -> lookahead
9167
91682006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
9169
9170 For consistency, use `lookahead' instead of `look-ahead' or
9171 `look_ahead'. Discussed starting at
9172 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
9173 and then at
9174 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
9175 * NEWS: For the next release, note the change to `--report'.
9176 * TODO, doc/bison.1: Update English.
9177 * doc/bison.texinfo: Update English.
9178 (Understanding Your Parser, Bison Options): Document as
9179 `--report=lookahead' rather than `--report=look-ahead'.
9180 * src/conflicts.c: Update English in comments.
9181 (lookahead_set): Rename from look_ahead_set.
9182 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
9183 (resolve_sr_conflict): Rename local look_ahead_tokens to
9184 lookahead_tokens, and update other uses.
9185 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
9186 count_rr_conflicts, conflicts_free): Update uses.
9187 * src/getargs.c (report_args): Move "lookahead" before alternate
9188 spellings.
9189 (report_types): Update uses.
9190 (usage): For `--report' usage description, state `lookahead' spelling
9191 rather than `look-ahead'.
9192 * src/getargs.h (report.report_lookahead_tokens): Rename from
9193 report_look_ahead_tokens.
9194 * src/lalr.c: Update English in comments.
9195 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
9196 (state_lookahead_tokens_count): Rename from
9197 state_look_ahead_tokens_count.
9198 Rename local n_look_ahead_tokens to n_lookahead_tokens.
9199 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
9200 Rename local n_look_ahead_tokens to n_lookahead_tokens.
9201 Update other uses.
9202 Update English in output.
9203 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
9204 * src/print.c: Update English in comments.
9205 (lookahead_set): Rename from look_ahead_set.
9206 (print_reduction): Rename argument lookahead_token from
9207 look_ahead_token.
9208 (print_core, state_default_rule, print_reductions, print_results):
9209 Update uses.
9210 * src/print_graph.c: Update English in comments.
9211 (print_core): Update uses.
9212 * src/state.c: Update English in comments.
9213 (reductions_new): Update uses.
9214 (state_rule_lookahead_tokens_print): Rename from
9215 state_rule_look_ahead_tokens_print, and update other uses.
9216 * src/state.h: Update English in comments.
9217 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
9218 (state_rule_lookahead_tokens_print): Rename from
9219 state_rule_look_ahead_tokens_print.
9220 * src/tables.c: Update English in comments.
9221 (conflict_row, action_row): Update uses.
9222 * tests/glr-regression.at
9223 (Incorrect lookahead during deterministic GLR,
9224 Incorrect lookahead during nondeterministic GLR): Rename
9225 print_look_ahead to print_lookahead.
9226 * tests/torture.at: Update English in comments.
9227 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
9228 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
9229 (Many lookahead tokens): Update uses.
9230 * data/glr.c: Update English in comments.
9231 * lalr1.cc: Likewise.
9232 * yacc.c: Likewise.
9233 * src/conflicts.h: Likewise.
9234 * src/lalr.h: Likewise.
9235 * src/main.c: Likewise.
9236 * src/output.c: Likewise.
9237 * src/parse-gram.c: Likewise.
9238 * src/tables.h: Likewise.
9239 * tests/calc.at: Likewise.
9240
92412006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
9242
9243 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
9244
92452006-06-07 Paul Eggert <eggert@cs.ucla.edu>
9246
9247 * TODO: Add request from Nelson H. F. Beebe to be able to install
9248 Bison without installing the yacc script.
9249
92502006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9251
9252 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
9253 and yytext if they're already #define'd.
9254 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
9255 * src/scan-code-c.c: ... here.
9256 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
9257 <config.h>.
9258
92592006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
9260
9261 Get Bison to build again when configured with --enable-gcc-warnings.
9262 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
9263 missing #include's.
9264 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
9265 loc argument as it shadows a global.
9266 * src/scan-gram.l: Remove stray comma that prevents boundary_set
9267 invocation.
9268
9269 * src/.cvsignore: Add scan-code.c.
9270
92712006-06-07 Akim Demaille <akim@epita.fr>
9272
9273 * src/scan-gram.l: Move the "add a trailing ; to actions" code
9274 to...
9275 * src/scan-code.l: here.
9276 * tests/input.at (Torturing the Scanner): Fix another location
9277 error.
9278
92792006-06-07 Akim Demaille <akim@epita.fr>
9280
9281 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
9282
92832006-06-06 Akim Demaille <akim@epita.fr>
9284
9285 Extract the parsing of user actions from the grammar scanner.
9286 As a consequence, the relation between the grammar scanner and
9287 parser is much simpler. We can also split "composite tokens" back
9288 into simple tokens.
9289 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
9290 * src/scan-gram.l (add_column_width, adjust_location): Move to and
9291 rename as...
9292 * src/location.h, src/location.c (add_column_width)
9293 (location_compute): these.
9294 Fix the column count: the initial column is 0.
9295 (location_print): Be robust to ending column being 0.
9296 * src/location.h (boundary_set): New.
9297 * src/main.c: Adjust to scanner_free being renamed as
9298 gram_scanner_free.
9299 * src/output.c: Include scan-code.h.
9300 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
9301 Use boundary_set.
9302 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
9303 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
9304 which is now, again, a separate token.
9305 Adjust all dependencies.
9306 Whereever actions with $ and @ are used, use translate_code.
9307 (action): Remove this nonterminal which is now useless.
9308 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
9309 (grammar_current_rule_action_append): Use translate_code.
9310 (packgram): Bound check ruleno, itemno, and rule_length.
9311 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
9312 (last_string, last_braced_code_loc, max_left_semantic_context)
9313 (scanner_initialize, scanner_free, scanner_last_string_free)
9314 (gram_out, gram_lineno, YY_DECL_): Move to...
9315 * src/scan-gram.h: this new file.
9316 (YY_DECL): Rename as...
9317 (GRAM_DECL): this.
9318 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
9319 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
9320 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
9321 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
9322 Move these declarations, and...
9323 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
9324 these to...
9325 * src/flex-scanner.h: this new file.
9326 * src/scan-gram.l (rule_length, rule_length_overflow)
9327 (increment_rule_length): Remove.
9328 (last_braced_code_loc): Rename as...
9329 (gram_last_braced_code_loc): this.
9330 Adjust to the changes of the parser.
9331 Move all the handling of $ and @ into...
9332 * src/scan-code.l: here.
9333 * src/scan-gram.l (handle_dollar, handle_at): Remove.
9334 (handle_action_dollar, handle_action_at): Move to...
9335 * src/scan-code.l: here.
9336 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
9337 scan-code.h, scan-code-c.c, scan-gram.h.
9338 (EXTRA_bison_SOURCES): Add scan-code.l.
9339 (BUILT_SOURCES): Add scan-code.c.
9340 (yacc): Be robust to white spaces.
9341
9342 * tests/conflicts.at, tests/input.at, tests/reduce.at,
9343 * tests/regression.at: Adjust the column numbers.
9344 * tests/regression.at: Adjust the error message.
9345
93462006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9347
9348 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9349 Use Akim's wording from
9350 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
9351
93522006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
9353
9354 Between Bison releases, manually append `+' to the previous Bison
9355 release number, and use that as a signal to automatically print the
9356 ChangeLog's CVS Id keyword from --version. Discussed starting at
9357 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
9358 * ChangeLog: Add Id header.
9359 * configure.ac (AC_INIT): Append `+' to `2.3'.
9360 * src/.cvsignore: Add revision.c.
9361 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
9362 (BUILT_SOURCES): Add revision.c.
9363 (revision.c): New target rule. This file defines a new global variable
9364 named revision. It initializes it with either the Id from ChangeLog
9365 or, if VERSION doesn't contain `+', with the empty string.
9366 * src/getargs.c (version): Print the value of revision.
9367 * src/revision.h: Extern revision.
9368
93692006-06-05 Paul Eggert <eggert@cs.ucla.edu>
9370
9371 * NEWS: Version 2.3.
9372 * configure.ac (AC_INIT): Likewise.
9373
93742006-05-30 Paul Eggert <eggert@cs.ucla.edu>
9375
9376 * data/glr.c (YYRECOVERING): Define to be a function-like macro
9377 with no arguments, not as an object-like macro. This is for
9378 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
9379 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
9380 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
9381 Document this.
9382
93832006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
9384
9385 * src/getargs.c (usage): Back out yesterday's modification of the
9386 --help output so that we don't have to wait for translation before
9387 releasing 2.3.
9388
93892006-05-29 Paul Eggert <eggert@cs.ucla.edu>
9390
9391 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
9392 Problem reported by Akim Demaille.
9393
93942006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
9395
9396 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
9397
93982006-05-26 Paul Eggert <eggert@cs.ucla.edu>
9399
9400 * data/yacc.c (yy_reduce_print): Omit trailing white space in
9401 generated source code. Problem reported by Frans Englich in
9402 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
9403
94042006-05-22 Paul Eggert <eggert@cs.ucla.edu>
9405
9406 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
9407 shell, not within 'make', so that 'make' by an ordinary builder
9408 (using GNU make) does not worry about configuring gzip. This also
9409 works around a bug reported independently by Keith Thompson and by
9410 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
9411 stderr rather than stdout, messing up the build logs.
9412
94132006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9414
9415 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
9416 to make sure that YYID will never be unused. This fixes a 'make
9417 maintainer-check' failure caused by the recent changes to the 'Trivial
9418 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
9419 not used.
9420 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
9421
94222006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
9423
9424 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
9425 state before an empty RHS is always resolved here. Only the location
9426 of that state is guaranteed to be resolved, and that's enough. This
9427 fixes the remaining bug reported by Derek M. Jones in
9428 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9429 * tests/glr-regression.at (Uninitialized location when reporting
9430 ambiguity): Test the above case.
9431 Also, the embedded comments in this test case claim it checks the case
9432 of an empty RHS that has inherited the initial location. However, the
9433 corresponding LHS was already resolved, so yyresolveLocations didn't
9434 actually have reason to modify it. Fix this by forcing
9435 nondeterministic operation at the beginning of the parse.
9436
94372006-05-20 Paul Eggert <eggert@cs.ucla.edu>
9438
9439 * data/c.m4 (b4_yy_symbol_print_generate):
9440 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
9441 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
9442 of the bugs reported today by Derek M Jones in
9443 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
9444 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
9445 defined to be a type name without parens or brackets.
9446 (Location Type): Similarly for YYLTYPE.
9447 * tests/regression.at (Trivial grammars): Put in a test for this
9448 bug that will be caught by 'make maintainer-check' (though not,
9449 alas, by 'make check' unless your compiler is picky).
9450
94512006-05-19 Paul Eggert <eggert@cs.ucla.edu>
9452
9453 * NEWS: Version 2.2.
9454 * configure.ac (AC_INIT): Likewise.
9455
94562006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
9457
9458 * data/glr.c (yyreportTree): Make room in yystates for the state
9459 preceding the RHS. This fixes the segmentation fault reported by Derek
9460 M. Jones in
9461 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
9462 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
9463 to the user. Reported for yyreportTree by Derek M. Jones later in the
9464 same thread.
9465 * THANKS: Add Derek M. Jones.
9466 Update my email address.
9467 Fix typo in Steve Murphy's name.
9468
94692006-05-14 Paul Eggert <eggert@cs.ucla.edu>
9470
9471 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
9472 checking against YYLAST that caused the parser to miss a potential
9473 alternative in its diagnostic.
9474 Problem reported by Maria Jose Moron Fernandez in
9475 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
9476 * data/lalr1.cc (yysyntax_error_): Likewise.
9477 * data/yacc.c (yysyntax_error): Likewise.
9478 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
9479 tokens, in case we run into an older C compiler.
9480 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
9481 Use them to check for the off-by-one error fixed above.
9482
9483 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
9484 YYSIZE_T, not size_t.
9485 * tests/regression.at (Trivial grammars): New test, to catch
9486 the error fixed by the above patch.
9487
94882006-05-14 Akim Demaille <akim@lrde.epita.fr>
9489
9490 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
9491 scheme.
9492 Reported by Steve Murphy.
9493
94942006-05-14 Akim Demaille <akim@lrde.epita.fr>
9495
9496 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
9497 * data/glr.cc: b4_location_flag is now b4_locations_flag.
9498
94992006-05-14 Akim Demaille <akim@lrde.epita.fr>
9500
9501 Implement --trace=m4.
9502 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
9503 * src/output.c (output_skeleton): When set, pass -dV to m4.
9504
9505 Factor the handling of flags in m4.
9506 * src/output.c (prepare): Rename the muscle names debug, defines,
9507 error_verbose to debug_flag, defines_flag, error_verbose_flag.
9508 * data/c.m4: Adjust.
9509 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
9510 Use b4_define_flag_if to define other b4_FLAG_if macros.
9511 (b4_location_if): As a consequence, rename as...
9512 (b4_locations_if): this, for consistency.
9513 Adjust all the skeletons.
9514
95152006-05-14 Akim Demaille <akim@lrde.epita.fr>
9516
9517 * etc/bench.pm: Shorten bench names.
9518
95192006-05-14 Akim Demaille <akim@lrde.epita.fr>
9520
9521 * src/output.h, src/output.c (error_verbose): Move to...
9522 * src/getargs.h, src/getargs.c: here.
9523 Sort the flags.
9524 Adjust dependencies.
9525
95262006-05-13 Paul Eggert <eggert@cs.ucla.edu>
9527
9528 * data/c.m4 (b4_copyright): Put the special exception for Bison
9529 skeletons here, so we don't have to put it in each skeleton. All
9530 uses changed. Suggested by Akim Demaille. Also, wrap the
9531 copyright notice, in case it is longer than 80 columns. Replace
9532 comma by newline after title.
9533
95342006-05-11 Paul Eggert <eggert@cs.ucla.edu>
9535
9536 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
9537 incompatibility, not a bug. Mention that it wasn't fixed as of
9538 flex 2.5.33.
9539
95402006-05-11 Akim Demaille <akim@lrde.epita.fr>
9541
9542 * examples/extexi: Enforce the precedence of concatenation over
9543 >>.
9544 Reported by Tommy Nordgren.
9545
95462006-05-11 Akim Demaille <akim@lrde.epita.fr>
9547
9548 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
9549 with the member "token".
9550 Reported by Martin Nylin.
9551
95522006-05-08 Paul Eggert <eggert@cs.ucla.edu>
9553
9554 * data/glr.c: Switch to Bison 2.2 special-exception language in
9555 the copyright notice. Use more-regular format for titles and
9556 copyright notices.
9557 * data/glr.cc: Likewise.
9558 * data/location.cc: Likewise.
9559 * data/yacc.cc: Likewise.
9560 * doc/bison.texinfo (Conditions): Document this.
9561 * NEWS: likewise. Upgrade version to 2.2.
9562
95632006-04-27 Akim Demaille <akim@lrde.epita.fr>
9564
9565 * data/glr.cc: Remove dead code.
9566
95672006-04-25 Paul Eggert <eggert@cs.ucla.edu>
9568
9569 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
9570 that variable and the line breaks the bootstrap. Problem reported
9571 by Juan M. Guerrero.
9572
95732006-04-24 Akim Demaille <akim@lrde.epita.fr>
9574
9575 * doc/bison.texinfo (Multiple start-symbols): New.
9576
95772006-04-24 Akim Demaille <akim@lrde.epita.fr>
9578
9579 * etc/README, etc/bench.pl: New.
9580
95812006-04-03 Akim Demaille <akim@lrde.epita.fr>
9582
9583 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
9584 rule.
9585 Reported by Mickael Labau.
9586 * tests/input.at (Torturing the Scanner): Test it.
9587
95882006-03-16 Paul Eggert <eggert@cs.ucla.edu>
9589
9590 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
9591 Problem reported by Bob Rossi.
9592
95932006-03-13 Paul Eggert <eggert@cs.ucla.edu>
9594
9595 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
9596 and didn't really work.
9597 For the index, use @ifnotinfo, not @iftex.
9598 Minor cleanups of spacing and terminology.
9599
96002006-03-12 Akim Demaille <akim@lrde.epita.fr>
9601
9602 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
9603 of AT_NAME_PREFIX when %name-prefix is not used.
9604
96052006-03-12 Akim Demaille <akim@lrde.epita.fr>
9606
9607 Apply --prefix to C++ skeletons too: they change the namespace.
9608 The test suite already exercize these cases.
9609 * data/c++.m4 (b4_namespace): New.
9610 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
9611 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
9612 * data/yacc.c, data/glr.c: Remove a useless `[]'.
9613 * doc/bison.texinfo: Document it.
9614 (Option Cross Key): Use @multitable in all formats. It looks
9615 nicer, even in TeX outputs.
9616 (Rules): Use the same code whatever the output type is.
9617 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
9618 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
9619 * tests/calc.at: Use it, instead of hard coding `yy'.
9620
96212006-03-10 Akim Demaille <akim@lrde.epita.fr>
9622
9623 * TODO: Remove dead items.
9624
96252006-03-10 Akim Demaille <akim@lrde.epita.fr>
9626
9627 * doc/FAQ: Remove, merged into...
9628 * doc/bison.texinfo (FAQ): this.
9629 * doc/Makefile.am (EXTRA_DIST): Adjust.
9630
96312006-03-10 Akim Demaille <akim@lrde.epita.fr>
9632
9633 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
9634 even if empty.
9635 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
9636 * doc/bison.texinfo (Calc++ Scanner): Use it.
9637
96382006-03-09 Paul Eggert <eggert@cs.ucla.edu>
9639
9640 Fix two nits reported by twlevo, plus one more that I discovered.
9641
9642 * src/assoc.h (assoc_to_string): Give a name to the arg, as
9643 this is the usual Bison style.
9644 * src/location.h (location_print): Likewise.
9645
9646 * src/reader.h (token_name): Likewise.
9647
96482006-03-08 Paul Eggert <eggert@cs.ucla.edu>
9649
9650 Fix some nits reported by twlevo.
9651 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
9652 and "POSIX". Use more-modern syntax for URLs. Mention C++
9653 and ask for Java. Don't hardwire OS version numbers. Add
9654 copyright notice.
9655 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
9656 * src/conflicts.c (solved_conflicts_obstack): Now static.
9657
96582006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
9659
9660 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
9661 page. Say "you can use it" not "you may use it" as on the web page;
9662 we're describing capabilities not granting permission.
9663
96642006-03-06 Paul Eggert <eggert@cs.ucla.edu>
9665
9666 * data/glr.c (yyresolveLocations): Rename local variables to avoid
9667 shadowing warnings. Use usual patter for iterating through RHS.
9668 * tests/glr-regression.at
9669 (Uninitialized location when reporting ambiguity):
9670 Modify yylex so that it uses its argument, rather than trying
9671 to rely on ARGSUSED (which doesn't work for gcc with warnings).
9672 const char -> char const.
9673
9674 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
9675 Don't use tabs inside commands; it messes up 'ps'.
9676 Problem reported by twlevo.
9677
96782006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
9679
9680 * tests/glr-regression.at (Uninitialized location when reporting
9681 ambiguity): New test case.
9682 * data/glr.c (yyresolveLocations): New function, which uses
9683 YYLLOC_DEFAULT.
9684 (yyresolveValue): Invoke yyresolveLocations before reporting an
9685 ambiguity.
9686 * doc/bison.texinfo (Default Action for Locations): Note
9687 YYLLOC_DEFAULT's usage for ambiguity locations.
9688 (GLR Semantic Actions): Cross-reference those notes.
9689
96902006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
9691
9692 * tests/glr-regression.at (Leaked semantic values when reporting
9693 ambiguity): Remove unnecessary union and type declarations.
9694 (Leaked lookahead after nondeterministic parse syntax error): New test
9695 case.
9696 * data/glr.c (yyparse): Check for zero stacks remaining before
9697 attempting to shift the lookahead so that you don't lose it.
9698
96992006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
9700
9701 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
9702 * tests/glr-regression.at (Leaked semantic values when reporting
9703 ambiguity): New test case.
9704 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
9705 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
9706 now unnecessary yystackp parameter.
9707 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
9708 destructors can be called.
9709
9710 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
9711 in existing testcases.
9712
97132006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
9714
9715 Don't leak semantic values for parent RHS when a user action cuts the
9716 parser, and clean up related code a bit.
9717 * tests/glr-regression.at (Leaked merged semantic value if user action
9718 cuts parse): Rename to...
9719 (Leaked semantic values if user action cuts parse): ... this. Add check
9720 for leaked parent RHS values.
9721 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
9722 between an unresolved state (non-empty chain of semantic options) and
9723 an incomplete one (signaled by an empty chain).
9724 (yyresolveStates): Document the interface. Move all manipulation of a
9725 successfully or unsuccessfully resolved yyGLRState to...
9726 (yyresolveValue): ... here so that yyresolveValue always leaves a
9727 yyGLRState with consistent data and thus is easier to understand.
9728 Remove the yyvalp and yylocp parameters since they are always just
9729 taken from the yys parameter. When reporting a discarded merged value
9730 in debugging output, note that it is incompletely merged. Document the
9731 interface.
9732 (yyresolveAction): If resolving any of the RHS states fails, destroy
9733 them all rather than leaking them. Thus, as long as user actions are
9734 written to clean up the RHS correctly, yyresolveAction always cleans up
9735 the RHS of a semantic option. Document the interface.
9736
97372006-02-27 Paul Eggert <eggert@cs.ucla.edu>
9738
9739 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
9740 led to a segmentation fault in GNU Pascal. Problem reported
9741 by Waldek Hebisch.
9742
97432006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
9744
9745 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
9746 mid-rule action inside a nonterminal symbol in order to declare a
9747 destructor for its semantic value.
9748
97492006-02-16 Paul Eggert <eggert@cs.ucla.edu>
9750
9751 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
9752 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
9753 __cplusplus && ! defined _STDLIB_H && !
9754 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
9755 defined free))]: Include <stdlib.h> rather than rolling our own
9756 declarations of malloc and free, to avoid problems with
9757 incompatible declarations (using 'throw') C++'s stdlib.h. This
9758 should fix Debian bug 340012
9759 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
9760 reported by Guillaume Melquiond.
9761
97622006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9763
9764 * NEWS: Clarify symbols versus types in unused-value warnings.
9765
9766 * configure.ac (AC_INIT): Bump version number.
9767
97682006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9769
9770 * NEWS: Version 2.1a.
9771 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
9772 since C99 requires this.
9773
97742006-02-11 Paul Eggert <eggert@cs.ucla.edu>
9775
9776 * m4/c-working.m4: New file.
9777 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
9778
97792006-02-10 Paul Eggert <eggert@cs.ucla.edu>
9780
9781 * Makefile.maint: Merge from coreutils.
9782
97832006-02-09 Paul Eggert <eggert@cs.ucla.edu>
9784
9785 More portability fixes for problems summarized by Nelson H. F. Beebe.
9786
9787 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
9788 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
9789 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
9790 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
9791 messes up because C++ code is compiled in 32-bit mode but linked
9792 in 64-bit mode.
9793
97942006-02-08 Paul Eggert <eggert@cs.ucla.edu>
9795
9796 More portability fixes for problems summarized by Nelson H. F. Beebe.
9797
9798 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
9799 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
9800
9801 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
9802 nodist_PROGRAMS, since we don't need to actually compile the
9803 example if we're just doing a plain 'make'. This avoids bothering
9804 the installer unnecessarily about problems due to weird C++
9805 compilers.
9806
98072006-02-06 Paul Eggert <eggert@cs.ucla.edu>
9808
9809 More portability fixes for problems summarized by Nelson H. F. Beebe.
9810
9811 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
9812 than #include "...", and compile with -I'.'. The old method was
9813 not portable, according to Posix and the C standard, and it does
9814 not work with Sun C 5.7, where previous #line directives affect
9815 the working directory used in later #include "..." directives.
9816
98172006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9818
9819 Various DJGGP specific issues in /djgpp
9820
98212006-02-02 Paul Eggert <eggert@cs.ucla.edu>
9822
9823 More portability fixes for problems summarized by Nelson H. F. Beebe.
9824
9825 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
9826 '#include <map>' works and that you can apply ++ to iterators.
9827
98282006-02-01 Paul Eggert <eggert@cs.ucla.edu>
9829
9830 Work around portability problems summarized by Nelson H. F. Beebe in
9831 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
9832
9833 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
9834 that '#include <string>' works.
9835
9836 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
9837 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
9838 "warning: sorry: semantics of inline function static data `const
9839 unsigned char translate_table[262]' are wrong (you'll wind up with
9840 multiple copies)".
9841
9842 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
9843 or, xor to not_, and_, or_, and xor_, respectively. This works
9844 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
9845 random system header somewhere that includes the equivalent of
9846 <iso646.h>.
9847
9848 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
9849 -E" works; it apparently doesn't work with PathScale EKO Compiler
9850 Suite Version 2.0.
9851
98522006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
9853
9854 During deterministic GLR operation, user actions should be able to
9855 influence the parse by changing yychar. To make this easier to fix and
9856 to make glr.c easier to evolve in general, don't maintain yytoken in
9857 parallel with yychar; just compute yytoken when needed.
9858 * tests/glr-regression.at (Incorrect lookahead during deterministic
9859 GLR): Check that setting yychar in a user action has the intended
9860 effect.
9861 * data/glr.c (yyGLRStack): Remove yytokenp member.
9862 (yyclearin): Don't set *yytokenp.
9863 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
9864 yychar rather than *yytokenp to determine the current lookahead.
9865 Compute yytoken locally when needed.
9866 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
9867 point to.
9868
9869 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
9870 after `--report' documentation.
9871
98722006-01-30 Paul Eggert <eggert@cs.ucla.edu>
9873
9874 * src/parse-gram.y (grammar_declaration): Location of printer
9875 symbol is @1, not list->location. Bug reported by twlevo.
9876 * tests/input.at (Incompatible Aliases): Adjust to above change.
9877
98782006-01-29 Paul Eggert <eggert@cs.ucla.edu>
9879
9880 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
9881 all the test at once. This makes the output easier to read in the
9882 normal case.
9883
9884 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
9885 got from <http://bro-ids.org/download.html>. The bug is that
9886 when two actions appeared in succession, the second one was
9887 scanned before the first one was added to the grammar rule
9888 as a midrule action. Bison then output the incorrect warning
9889 "parse.y:905.17-906.36: warning: unused value: $3".
9890 * src/parse-gram.y (BRACED_CODE, action): These are no longer
9891 associated with a value.
9892 (rhs): Don't invoke grammar_current_rule_action_append.
9893 (action): Invoke it here instead.
9894 * src/reader.c (grammar_midrule_action): Now extern.
9895 (grammar_current_rule_action_append): Don't invoke
9896 grammar_midrule_action; that is now the scanner's job.
9897 * src/reader.h (last_string, last_braced_code_loc):
9898 (grammar_midrule_action): New decls.
9899 * src/scan-gram.l (last_string): Now extern, sigh.
9900 (last_braced_code_loc): New extern variable.
9901 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
9902 rule already has an action.
9903 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
9904 * tests/input.at (AT_CHECK_UNUSED_VALUES):
9905 Add some tests to check that the above changes fixed the bug.
9906
99072006-01-27 Paul Eggert <eggert@cs.ucla.edu>
9908
9909 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
9910 All used changed. Check whether the symbol has a destructor,
9911 not whether it is typed.
9912 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
9913 that the values are still reported as unused. All line numbers
9914 adjusted.
9915
99162006-01-23 Paul Eggert <eggert@cs.ucla.edu>
9917
9918 Work around a bug in bro 0.8, which underparenthesizes its
9919 definition of YYLLOC_DEFAULT.
9920 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
9921 their arguments.
9922 * data/lalr1.cc: Likewise.
9923 * data/yacc.cc: Likewise.
9924
99252006-01-22 Paul Eggert <eggert@cs.ucla.edu>
9926
9927 Work around a bug in Pike 7.0, and give the Pike folks a
9928 better way to override the usual int widths.
9929 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
9930 user can override the types.
9931 (short): #undef, to work around a bug in Pike 7.0.
9932 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
9933 (union yyalloc.yyss): Use yytype_int16 rather than short.
9934 All uses changed.
9935 (yysigned_char): Remove.
9936 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
9937 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
9938 * tests/regression.at (Web2c Actions): Adjust to above changes.
9939
9940 * src/reader.c (check_and_convert_grammar): New function.
9941 (reader): Close the input file even if something went wrong during
9942 parsing. Minor file descriptor leak reported by twlevo.
9943
9944 * src/assoc.c (assoc_to_string): Use a default: abort (); case
9945 to pacify gcc -Wswitch-default.
9946 * src/scan-gram.l (adjust_location): Use a default: break; case
9947 to pacify gcc -Wswitch-default.
9948 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
9949 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
9950 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
9951 Move these decls to scan-skel.l, since they don't need to be
9952 visible elsewhere.
9953 * src/scan-skel.l: Accept the above decls.
9954 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
9955 is used.
9956
99572006-01-21 Paul Eggert <eggert@cs.ucla.edu>
9958
9959 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
9960 since we don't want to insist on a version number at the start
9961 of the changelog every time.
9962 * Makefile.maint: Sync from coreutils a bit better.
9963 (sc_trailing_blank): Renamed from sc_trailing_space.
9964 All uses changed.
9965 (sc_no_if_have_config_h, sc_require_config_h):
9966 (sc_prohibit_assert_without_use): New rules.
9967 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
9968 (sc_dd_max_sym_length): Fix leading spaces in rule.
9969 (sc_system_h_headers): Prefix with @.
9970 (sc_useless_cpp_parens, m4-check): Output line numbers.
9971 (changelog-check): Allow version only in head.
9972 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
9973 satisfy new Makefile.maint rule.
9974 * data/glr.c: Likewise.
9975 * data/glr.cc: Likewise.
9976 * data/lalr1.cc: Likewise.
9977 * data/yacc.c: Likewise.
9978 * lib/ebitsetv.c: Likewise.
9979 * lib/lbitset.c: Likewise.
9980 * lib/subpipe.c: Likewise.
9981 * lib/timevar.c: Likewise.
9982 * src/system.h: Likewise.
9983 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
9984 * djgpp/Makefile.maint: Add copyright notice.
9985 * djgpp/README.in: Likewise.
9986 * djgpp/config.bat: Likewise.
9987 * djgpp/config.site: Likewise.
9988 * djgpp/config_h.sed: Likewise.
9989 * djgpp/djunpack.bat: Likewise.
9990 * djgpp/config.sed: Fix copyright notice to match standard format.
9991 * djgpp/subpipe.h: Likewise.
9992 * lib/bitsetv-print.c: Likewise.
9993 * lib/bitsetv.c: Likewise.
9994 * lib/subpipe.h: Likewise.
9995 * lib/timevar.c: Likewise.
9996 * lib/timevar.h: Likewise.
9997 * djgpp/subpipe.c: Use standard recipe for config.h.
9998 * lib/abitset.c: Likewise.
9999 * lib/bitset.c: Likewise.
10000 * lib/bitset_stats.c: Likewise.
10001 * lib/bitsetv-print.c: Likewise.
10002 * lib/bitsetv.c: Likewise.
10003 * lib/ebitsetv.c: Likewise.
10004 * lib/get-errno.c: Likewise.
10005 * lib/lbitset.c: Likewise.
10006 * lib/subpipe.c: Likewise.
10007 * lib/timevar.c: Likewise.
10008 * lib/vbitset.c: Likewise.
10009 * tests/local.at: Likewise.
10010 * src/scan-gram.l: Don't include verify.h, since system.h does
10011 that for us.
10012 * .x-sc_require_config_h: New file.
10013 * .x-sc_unmarked_diagnostics: New file.
10014
100152006-01-20 Paul Eggert <eggert@cs.ucla.edu>
10016
10017 Be a bit more systematic about using 'abort'.
10018 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
10019 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
10020 Put 'default: abort ();' before some other case, to satisfy older
10021 pedantic compilers.
10022 * lib/bitset_stats.c (bitset_stats_init): Likewise.
10023 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
10024 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
10025 * src/conflicts.c (resolve_sr_conflict): Likewise.
10026 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
10027 (get_decision_str, get_orientation_str, get_node_alignment_str):
10028 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
10029 (get_linestyle_str, get_arrowstyle_str): Likewise.
10030 * src/conflicts.c (resolve_sr_conflict):
10031 Use a default case rather than one for the one remaining enum
10032 value, to catch invalid enum values as well.
10033 * src/lalr.c (set_goto_map, map_goto):
10034 Prefer "assert (FOO);" to "if (!FOO) abort ();".
10035 * src/nullable.c (nullable_compute, token_definitions_output):
10036 Likewise.
10037 * src/reader.c (packgram, reader): Likewise.
10038 * src/state.c (transitions_to, state_new, state_reduction_find):
10039 Likewise.
10040 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
10041 (symbol_pack): Likewise.
10042 * src/tables.c (conflict_row, pack_vector): Likewise.
10043 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
10044 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
10045 * src/system.h: Don't include <assert.h>.
10046 (assert): New macro.
10047
10048 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
10049 (Destructor Decl, Parser Function, Pure Calling):
10050 Describe rules for braces inside C code more carefully.
10051
100522006-01-19 Paul Eggert <eggert@cs.ucla.edu>
10053
10054 Fix some porting glitches found by Nelson H. F. Beebe.
10055 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
10056 compilers that don't understand that abort () does not return.
10057 * src/state.c (transitions_to): Likewise.
10058 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
10059 that '#include <cstdlib>' works.
10060 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
10061 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
10062 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
10063 for the benefit of some pre-C99 compilers.
10064
10065 * bootstrap: Undo changes to gnulib files that autoreconf made.
10066
10067 Minor fixups to get 'make maintainer-check' to work.
10068 * configure.ac: Don't use -Wnested-externs, as it's incompatible
10069 with the new verify.h implementation.
10070 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
10071 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
10072 * data/yacc.c (YYUSE): Likewise.
10073 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
10074 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
10075 * src/parse-gram.y (declaration): Don't pass a string constant
10076 to a function that expects char *, since GCC might complain
10077 about the constant value.
10078 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
10079 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
10080 before #defining them.
10081 * tests/glr-regression.at
10082 (Incorrectly initialized location for empty right-hand side in GLR):
10083 In yyerror, use the msg arg.
10084 (Corrupted semantic options if user action cuts parse):
10085 (Incorrect lookahead during deterministic GLR):
10086 (Incorrect lookahead during nondeterministic GLR):
10087 Don't name a local var 'index'; it shadows string.h's 'index'.
10088
100892006-01-19 Akim Demaille <akim@epita.fr>
10090
10091 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
10092 location, not just parts of it.
10093
100942006-01-18 Paul Eggert <eggert@cs.ucla.edu>
10095
10096 * NEWS: Document the fact that multiple %unions are now allowed.
10097 * doc/bison.texinfo (Union Decl): Likewise.
10098 * TODO: This feature is now implemented, so remove it from
10099 the wishlist.
10100
10101 * Makefile.maint: Merge with coreutils Makefile.maint.
10102 (CVS_LIST): Use build-aux version if available.
10103 (VERSION_REGEXP): New macro.
10104 (syntax-check-rules): Add sc_no_if_have_config_h,
10105 sc_prohibit_assert_without_use, sc_require_config_h,
10106 sc_useless_cpp_parens.
10107 (sc_obsolete_symbols): Check for O_NDELAY.
10108 (sc_dd_max_sym_length): Track coreutils.
10109 (sc_unmarked_diagnostics): Look in all files, not just *.c.
10110 (sc_useless_cpp_parens): New rule.
10111 (news-date-check): Look for version or today's date.
10112 (changelog-check): Don't require version number near head.
10113 (copyright-check): Use current year instead of hardwiring 2005.
10114 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
10115 (announcement): Add --gpg-key-ID.
10116
10117 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
10118 with "file system".
10119
10120 Avoid undefined behavior that addressed just before the start of an
10121 array. Problem reported by twlevo.
10122 * src/reader.c (packgram): Prepend a new sentinel before ritem.
10123 * src/lalr.c (build_relations): Rely on new sentinel.
10124 * src/gram.c (gram_free): Adjust to new sentinel.
10125
101262006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
10127
10128 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
10129 yylookaheadNeeds. All uses updated.
10130 (yysplitStack): Rename local yynewLookaheadStatuses to
10131 yynewLookaheadNeeds.
10132 * data/glr-regression.at (Incorrect lookahead during nondeterministic
10133 GLR): In comments, change `lookahead status' to `lookahead need'.
10134
101352006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10136
10137 * data/glr.c (yysplitStack): A little stylistic rewrite.
10138
101392006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10140
10141 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
10142
101432006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
10144
10145 * doc/bison.texinfo: Fix some typos.
10146 (GLR Semantic Actions): New subsection discussing special
10147 considerations because GLR semantic actions might be deferred.
10148 (Actions): Mention look-ahead usage of yylval.
10149 (Actions and Locations): Mention look-ahead usage of yylloc.
10150 (Special Features for Use in Actions): Add YYEOF entry and mention it
10151 in the yychar entry.
10152 In the yychar entry, remove mention of the local yychar case (pure
10153 parser) since this is irrelevant information when writing semantic
10154 actions and since it's already discussed in `Table of Symbols' where
10155 yychar is otherwise described as an external variable.
10156 In the yychar entry, don't call it the `current' look-ahead since it
10157 isn't when semantic actions are deferred.
10158 In the yychar and yyclearin entries, add note about deferred semantic
10159 actions.
10160 Add yylloc and yylval entries discussing look-ahead usage.
10161 (Look-Ahead Tokens): When discussing yychar, don't call it the
10162 `current' look-ahead, and do mention yylval and yylloc.
10163 (Error Recovery): Cross-reference `Action Features' when mentioning
10164 yyclearin.
10165 (Table of Symbols): In the yychar entry, don't call it the `current'
10166 look-ahead.
10167 In the yylloc and yylval entries, mention look-ahead usage.
10168
101692006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
10170
10171 * tests/glr-regression.at: Update copyright year to 2006.
10172
101732006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10174
10175 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
10176 use during nondeterministic operation to track which stacks have
10177 actually needed the current lookahead.
10178 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
10179 Allocate, deallocate, resize, and otherwise shuffle space for
10180 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
10181 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
10182 appropriately during nondeterministic operation.
10183 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
10184 members to store the current lookahead to be used by the deferred
10185 user action.
10186 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
10187 from which the RHS is taken. Set the lookahead members of the new
10188 yySemanticOption according to the lookahead status for stack yyk.
10189 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
10190 yyaddDeferredAction.
10191 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
10192 members of yySemanticOption before invoking yyuserAction, and then set
10193 them back to their current values afterward.
10194 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
10195 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
10196 * tests/glr-regression.at: Remove `.' from the ends of recent test case
10197 titles for consistency.
10198 (Leaked merged semantic value if user action cuts parse): In order to
10199 suppress lint warnings, use arguments in merge function, and assign
10200 char value < 128 in main.
10201 (Incorrect lookahead during deterministic GLR): New test case.
10202 (Incorrect lookahead during nondeterministic GLR): New test case.
10203
102042006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10205
10206 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
10207 !yyvaluep as signal that no semantic value is available to print.
10208 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
10209 to print a semantic value.
10210
102112006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
10212
10213 * tests/glr-regression.at: For consistency with my newer test cases,
10214 don't thank myself.
10215
102162006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
10217
10218 * data/glr.c (yyresolveValue): When merging semantic options, if at
10219 least one user action succeeds but a later one cuts the parse, then
10220 destroy the semantic value before returning rather than leaking it.
10221 (yyresolveStates): If a user action cuts the parse and thus
10222 yyresolveValue fails, ignore the (unset) semantic value rather than
10223 corrupting the yyGLRState, and empty the semantic options list since
10224 the user actions should have called all necessary destructors.
10225 Simplify code with YYCHK.
10226 * tests/glr-regression.at (Corrupted semantic options if user action
10227 cuts parse): New test case.
10228 (Undesirable destructors if user action cuts parse): New test case.
10229 Before applying any of this patch, this test case never actually failed
10230 for me... but only because the corrupted semantic options usually
10231 masked this bug.
10232 (Leaked merged semantic value if user action cuts parse): New test
10233 case.
10234
102352006-01-05 Akim Demaille <akim@epita.fr>
10236
10237 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
10238
102392006-01-04 Paul Eggert <eggert@cs.ucla.edu>
10240
10241 * data/c.m4 (b4_c_modern): New macro, with a new provision for
10242 _MSC_VER. Problem reported by Cenzato Marco.
10243 (b4_c_function_def): Use it.
10244 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
10245 b4_c_modern.
10246 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
10247 than rolling our own.
10248
102492006-01-04 Akim Demaille <akim@epita.fr>
10250
10251 Also warn about non-used mid-rule values.
10252 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
10253 member.
10254 (symbol_list_new): Adjust.
10255 * src/reader.c (symbol_typed_p): New.
10256 (grammar_rule_check): Use it.
10257 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
10258 Check its rule.
10259 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
10260 Use it.
10261 * tests/actions.at (Exotic Dollars): Adjust.
10262
102632006-01-04 Akim Demaille <akim@epita.fr>
10264
10265 * src/reader.c (grammar_midrule_action): If $$ is set in a
10266 mid-rule, move the `used' bit to its lhs.
10267 * tests/input.at (Unused values): New.
10268 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
10269
102702006-01-03 Paul Eggert <eggert@cs.ucla.edu>
10271
10272 * doc/bison.texinfo (Bison Options): Say more accurately what
10273 --yacc does.
10274 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
10275 about declarations in the grammar when in Yacc mode, as POSIX does
10276 not require a diagnostic when the grammar uses extensions.
10277
10278 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
10279
10280 Warn about dubious constructions like "%token T T".
10281 Reported by twlevo.
10282 * src/symtab.h (struct symbol.declared): New member.
10283 * src/symtab.c (symbol_new): Initialize it to false.
10284 (symbol_class_set): New arg DECLARING, specifying whether
10285 this is a declaration that we want to warn about, if there
10286 is more than one of them. All uses changed.
10287
10288 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
10289 Allow multiple %union directives, whose contents concatenate.
10290 * src/parse-gram.y (grammar_declaration): Likewise.
10291 Use muscle_code_grow, so that we don't need stype_line any more.
10292 All uses changed.
10293
10294 * src/muscle_tab.c (muscle_grow): Fix comment.
10295
10296 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
10297 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
10298 Update copyright year to 2006.
10299
103002006-01-03 Akim Demaille <akim@epita.fr>
10301
10302 Have glr.cc pass (some of) the calc.at tests.
10303 * data/glr.cc (b4_parse_param_orig): New.
10304 (b4_parse_param): Improve its definition, and bound it more
10305 clearly in the skeleton.
10306 (b4_epilogue): Append, instead of prepending, in order to keep
10307 #line consistency.
10308 Simplify the generation of auxiliary functions: locations and
10309 purity are mandated.
10310 (b4_global_tokens_and_yystype): Honor it.
10311 * data/location.cc (c++.m4): Don't include it.
10312 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
10313 and AT_SKEL_CC_IF.
10314 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
10315 AT_LALR1_CC_IF.
10316 Be sure to initialize the first position's filename.
10317 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
10318 mandated anyway.
10319 (AT_CHECK_CALC_GLR_CC): New.
10320 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
10321
103222006-01-02 Akim Demaille <akim@epita.fr>
10323
10324 * src/output.c (output_skeleton): Don't hard wire the inclusion of
10325 c.m4.
10326 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
10327 * data/glr.cc: Do not include stack.hh.
10328
103292006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
10330
10331 * data/glr.c: Reformat whitespace with tabs.
10332 (b4_lpure_formals): Remove this unused m4 macro.
10333 * tests/cxx-type.at: Reformat whitespace with tabs.
10334 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
10335 since it's a member. Rename type to isNterm for clarity.
10336
103372005-12-29 Akim <akim@sulaco.local>
10338
10339 Let glr.cc catch up with symbol_value_print.
10340 * data/glr.cc (b4_yysymprint_generate): Replace by...
10341 (b4_yy_symbol_print_generate): this.
10342 (yy_symbol_print, yy_symbol_value_print): Declare them.
10343
103442005-12-28 Paul Eggert <eggert@cs.ucla.edu>
10345
10346 * src/location.h (boundary): Note that a line or column equal
10347 to INT_MAX indicates an overflow.
10348 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
10349 (rule_length_overflow, increment_rule_length, add_column_width):
10350 New functions.
10351 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
10352 (<SC_BRACED_CODE>"}"):
10353 Use increment_rule_length rather than incrementing it by hand.
10354 (adjust_location, handle_syncline): Diagnose overflow.
10355 (handle_action_dollar, handle_action_at):
10356 Fix bug with monstrosities like $-2147483648.
10357 Remove now-unnecessary checks.
10358 (scan_integer): Verify assumptions and remove now-unnecessary checks.
10359 (convert_ucn_to_byte): Verify assumptions.
10360 (handle_syncline): New arg LOC. All callers changed.
10361 Don't store through a value derived from char const * pointer.
10362
10363 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
10364 GCC warnings.
10365
103662005-12-27 Paul Eggert <eggert@cs.ucla.edu>
10367
10368 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
10369 Remove unnecessary forward static decls.
10370
103712005-12-27 Akim Demaille <akim@epita.fr>
10372
10373 * src/reader.c (grammar_current_rule_check): Also check that $$
10374 is used.
10375 Take the rule to check as argument, hence rename as...
10376 (grammar_rule_check): this.
10377 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
10378 Rename as...
10379 (grammar_rule_begin, grammar_rule_end): these, for consistency.
10380 (grammar_midrule_action, grammar_symbol_append): Now static.
10381 * tests/torture.at (input): Don't rely on the default action
10382 being always performed.
10383 * tests/calc.at: "Set" $$ even when the action is "cut" with
10384 YYERROR or other.
10385 * tests/actions.at (Exotic Dollars): Instead of using unused
10386 values, check that the warning is issued.
10387
103882005-12-22 Paul Eggert <eggert@cs.ucla.edu>
10389
10390 * NEWS: Improve wording for unused-value warnings.
10391
103922005-12-22 Akim Demaille <akim@epita.fr>
10393
10394 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
10395 (b4_yysymprint_generate): Rename as...
10396 (b4_yy_symbol_print_generate): this.
10397 Generate yy_symbol_print instead of yysymprint.
10398 Generate also yy_symbol_value_print, and use it.
10399
104002005-12-22 Akim Demaille <akim@epita.fr>
10401
10402 * NEWS: Warn about unused values.
10403 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
10404 a `used' member.
10405 (symbol_list_n_get, symbol_list_n_used_set): New.
10406 (symbol_list_n_type_name_get): Use symbol_list_n_get.
10407 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
10408 * src/reader.c (grammar_current_rule_check): Check that values are
10409 used.
10410 * src/symtab.c (symbol_print): Accept 0.
10411 * tests/existing.at: Remove the type information.
10412 Empty the actions.
10413 Remove useless actions (beware of mid-rule actions: perl -000
10414 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
10415 * tests/actions.at (Exotic Dollars): Use unused values.
10416 * tests/calc.at: Likewise.
10417 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10418 Likewise.
10419
10420 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
10421 rule_useful_p.
10422
104232005-12-21 Paul Eggert <eggert@cs.ucla.edu>
10424
10425 Undo 2005-12-01 tentative license wording change. The wording is
10426 still being reviewed by the lawyers, and we don't want to wait for
10427 them before publishing a test release. For now, revert to the
10428 previous wording.
10429 * NEWS: Undo 2005-12-01 change.
10430 * data/glr.c: Revert to previous license wording.
10431 * data/glr.cc: Likewise.
10432 * data/lalr1.cc: Likewise.
10433 * data/location.cc: Likewise.
10434 * data/yacc.c: Likewise.
10435
10436 * NEWS: Reword %destructor vs YYABORT etc.
10437 * data/glr.c: Use American spacing, for consistency.
10438 * data/glr.cc: Likewise.
10439 * data/lalr1.cc: Likewise.
10440 * data/yacc.c: Likewise.
10441 * data/yacc.c: Reformat comments slightly.
10442 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
10443 for consistency. Fix some spelling errors and reword recently-included
10444 text slightly.
10445 * tests/cxx-type.at: Cast results of malloc, for C++.
10446
104472005-12-21 Joel E. Denny <address@hidden>
10448
10449 * tests/cxx-type.at: Construct a tree, count the parents of shared
10450 nodes, and free each node once and only once. Previously, the memory
10451 for semantic values was leaked instead.
10452
104532005-12-21 Joel E. Denny <address@hidden>
10454
10455 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
10456 (yylval, yylloc): If pure, #define to yystackp->yyval and
10457 yystackp->yyloc similar to yychar and yynerrs.
10458 (yyparse): If pure, remove local yylval and yylloc. Add local
10459 yystackp to accommodate pure definitions of yylval and yylloc.
10460 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
10461 yylvalp and yyllocp to &yylval and &yylloc.
10462 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
10463 namespace. Previously, nerrs and char were missing, but lval and lloc
10464 weren't necessary.
10465 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
10466 yylvalp and yyllocp parameters since, if pure, these are now always
10467 accessible through yystackp. If not pure, they are still accessible
10468 globally.
10469 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
10470 `if (YYID (N))' to pacify lint.
10471
104722005-12-21 Akim Demaille <akim@epita.fr>
10473
10474 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
10475 destroy the RHS symbols of a rule.
10476 * data/yacc.c (yylen): Initialize to 0.
10477 Keep its value to the number of items to possibly shift.
10478 In particular, a regular successful parse that ends on YYFINAL by
10479 a (internal) YYACCEPT must not have yylen != 0.
10480 (yyerrorlab, yyreturn): Pop the RHS.
10481 Reorder a bit to emphasize the `shifting' bits of code.
10482 (YYPOPSTACK): Now accept a number of items to pop.
10483 * data/lalr1.cc: Likewise.
10484 * data/glr.c: Formatting changes.
10485 Use goto instead of fall through.
10486 * doc/bison.texinfo (Destructor Decl): Complete.
10487
104882005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10489
10490 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10491 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
10492 * djgpp/config.bat: Replace every occurence of the file name
10493 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10494 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10495 * djgpp/config.sed: Replace every occurence of the file name
10496 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
10497 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
10498 * djgpp/djunpack.bat: DJGPP specific file.
10499 * djgpp/fnchange.lst: DJGPP specific file.
10500 * djgpp/README.in: Add new information about how to unpack the bison
10501 source on MSDOS and other systems which have 8.3 file name restrictions
10502 using djunpack.bat and fnchange.lst.
10503
105042005-12-12 Paul Eggert <eggert@cs.ucla.edu>
10505
10506 * bootstrap (build_cvs_prefix): Remove; unused.
10507 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
10508 when getting gnulib.
10509
105102005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
10511
10512 * data/glr.c: Reorder typedef declarations for structs to match order
10513 of struct declarations.
10514 Rename yystack everywhere to yystackp except in yyparse where it's not
10515 a pointer.
10516 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
10517 consistency.
10518 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
10519 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
10520 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
10521 lint.
10522
105232005-12-09 Paul Eggert <eggert@cs.ucla.edu>
10524
10525 * tests/sets.at (Accept): Fix typos in regular expression used to
10526 sed out the final state number.
10527
10528 Work around portability problem on Solaris 10: flex-generated
10529 files include <stdio.h> before <config.h>, which messes up
10530 because the latter defines __EXTENSIONS__. Address the problem
10531 by creating two new little files that include <config.h> first,
10532 then include the flex-generated files. Rewrite everyone else
10533 to include <config.h> first, as well.
10534 * lib/timevar.c: Always include "config.h".
10535 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
10536 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
10537 (EXTRA_bison_SOURCES): New macro.
10538 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
10539 * src/system.h: Don't include config.h.
10540 * src/LR0.c: Include <config.h> first.
10541 * src/assoc.c: Likewise.
10542 * src/closure.c: Likewise.
10543 * src/complain.c: Likewise.
10544 * src/conflicts.c: Likewise.
10545 * src/derives.c: Likewise.
10546 * src/files.c: Likewise.
10547 * src/getargs.c: Likewise.
10548 * src/gram.c: Likewise.
10549 * src/lalr.c: Likewise.
10550 * src/location.c: Likewise.
10551 * src/main.c: Likewise.
10552 * src/muscle_tab.c: Likewise.
10553 * src/nullable.c: Likewise.
10554 * src/output.c: Likewise.
10555 * src/parse-gram.y: Likewise.
10556 * src/print.c: Likewise.
10557 * src/print_graph.c: Likewise.
10558 * src/reader.c: Likewise.
10559 * src/reduce.c: Likewise.
10560 * src/relation.c: Likewise.
10561 * src/state.c: Likewise.
10562 * src/symlist.c: Likewise.
10563 * src/symtab.c: Likewise.
10564 * src/tables.c: Likewise.
10565 * src/uniqstr.c: Likewise.
10566 * src/vcg.c: Likewise.
10567
10568 * src/parse-gram.y: Fix minor problems uncovered by lint.
10569 (current_lhs, current_lhs_location): Now static.
10570 (current_assoc): Remove unused variable.
10571
10572 Cleanups so that Bison-generated parsers have less lint.
10573 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
10574 Prepend /*ARGSUSED*/, for lint's sake.
10575 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
10576 definition if 'lint' is defined.
10577 (YYID): New macro (or function, if lint).
10578 All uses of /*CONSTCOND*/0 replaced by YYID(0).
10579 * data/yacc.c: Likewise.
10580 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
10581 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
10582 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
10583 is C++ only.
10584 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
10585 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
10586 Use YYID(0) rather than 0, for lint.
10587 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
10588 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
10589
105902005-12-07 Paul Eggert <eggert@cs.ucla.edu>
10591
10592 * tests/glr-regression.at
10593 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10594 Close memory leak reported by twlevo.
10595
105962005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
10597
10598 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
10599 all stacks.
10600 (yyparse): Iterate another stack in order to call user destructors.
10601 * tests/glr-regression.at (No users destructors if stack 0 deleted):
10602 New test case.
10603 (Duplicated user destructor for lookahead): This test now is expected
10604 to succeed.
10605
106062005-12-01 Paul Eggert <eggert@cs.ucla.edu>
10607
10608 * NEWS: Document the following change.
10609 * data/yacc.c: Say "parser skeleton" rather than "file", since
10610 it's no longer just a file.
10611 * data/glr.c: Grant a special exception for C GLR parsers, that
10612 reads like the already-existing exception for C LALR(1) parsers.
10613 * data/glr.cc: Likewise.
10614 * data/lalr1.cc: Likewise.
10615 * data/location.cc: Likewise.
10616 * data/yacc.c: Reword the "written by" statement to clarify that
10617 it was the parser skeleton, not the entire output file.
10618 * data/glr.c: Written by Paul Hilfinger.
10619 * data/glr.cc: Written by Akim Demaille.
10620 * data/lalr1.cc: Likewise.
10621
106222005-11-18 Paul Eggert <eggert@cs.ucla.edu>
10623
10624 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
10625 Fix typos in previous change that broke 'make check'.
10626 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
10627 supported in C.
10628 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
10629 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
10630 We can revert this once things settle down.
10631
10632 * src/conflicts.c (conflicts_print): Don't print file name twice
10633 when %expect fails because there were no conflicts.
10634 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
10635 change.
10636 * tests/conflicts.at (%expect not enough, %expect too much):
10637 (%expect with reduce conflicts): Adjust to new behavior.
10638
106392005-11-18 Akim Demaille <akim@epita.fr>
10640
10641 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
10642 errors.
10643 * NEWS: Document this.
10644 * doc/bison.texinfo (Expect Decl): Likewise.
10645
106462005-11-16 Akim Demaille <akim@epita.fr>
10647
10648 Generalize the display of semantic values and locations in traces.
10649 * data/glr.c (yy_reduce_print): Fix indices (again).
10650 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
10651 literal integers.
10652 * data/lalr1.cc (yyreduce_print): Rename as...
10653 (yy_reduce_print): this.
10654 Display values and locations.
10655 * data/yacc.c (yy_reduce_print): Likewise.
10656 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
10657 (yysymprint): Move higher to be visible from yy_reduce_print).
10658 (yyparse): Adjust.
10659 * tests/calc.at: Adjust the expected length of the traces.
10660
106612005-11-14 Akim Demaille <akim@epita.fr>
10662
10663 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
10664 from 1 to N, while values and location start at 0.
10665 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
10666
106672005-11-14 Akim Demaille <akim@epita.fr>
10668
10669 * data/glr.c (yy_reduce_print): Fix the $ number.
10670
106712005-11-14 Akim Demaille <akim@epita.fr>
10672
10673 "Use" parse parameters.
10674 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
10675 * data/glr.c, data/glr.cc: Use them.
10676 * data/glr.c (YYUSE): Have a C++ definition that supports
10677 non-pointer types.
10678
106792005-11-14 Akim Demaille <akim@epita.fr>
10680
10681 * data/glr.c (yyexpandGLRStack): Declare only if defined.
10682
106832005-11-14 Akim Demaille <akim@epita.fr>
10684
10685 * data/glr.cc: New.
10686 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
10687
106882005-11-12 Akim Demaille <akim@epita.fr>
10689
10690 Let position and location be PODs.
10691 * data/location.cc (position::initialize, location::initialize): New.
10692 (position::position, location::location): Define only if
10693 b4_location_constructors is defined.
10694 * data/lalr1.cc (b4_location_constructors): Define it for backward
10695 compatibility.
10696 * doc/bison.texinfo (Initial Action Decl): Use initialize.
10697
106982005-11-12 Akim Demaille <akim@epita.fr>
10699
10700 * data/lalr1.cc: Move the body of the ctor and dtor into the
10701 parser file (instead of the header).
10702 Wrap the implementations in a "namespace yy".
10703
107042005-11-12 Akim Demaille <akim@epita.fr>
10705
10706 Have glr.c include its header file when created.
10707 * data/glr.c (b4_shared_declarations): New.
10708 Output them verbatim in the parser if !%defines, otherwise
10709 output then in the header file, and include it instead.
10710
107112005-11-11 Akim Demaille <akim@epita.fr>
10712
10713 * data/glr.c: Comment changes.
10714
107152005-11-11 Akim Demaille <akim@epita.fr>
10716
10717 When yydebug, report semantic and location values for reductions.
10718 * data/glr.c (yy_reduce_print): Report the semantic values and the
10719 locations.
10720 (YY_REDUCE_PRINT): Adjust.
10721 (yyglrReduce): Use them.
10722 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
10723 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
10724 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
10725 traces.
10726
107272005-11-10 Akim Demaille <akim@epita.fr>
10728
10729 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
10730 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
10731 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
10732
107332005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
10734
10735 * m4/cxx.m4, examples/Makefile.am: Don't build
10736 examples/calc++ if no C++ compiler is available. (trivial change)
10737
107382005-11-09 Akim Demaille <akim@epita.fr>
10739
10740 * src/scan-skel.l: Use a couple of asserts.
10741
107422005-11-03 Akim Demaille <akim@epita.fr>
10743
10744 In some (weird) cases, the final state number is incorrect.
10745 Reported by Alexandre Duret-Lutz.
10746 * src/LR0.c (state_list_append): Remove the computation of
10747 final_state.
10748 (save_reductions): Do it here.
10749 (get_state): Alpha conversion.
10750 (generate_states): Use a for loop.
10751 * src/gram.h (item_number_is_rule_number)
10752 (item_number_is_symbol_number): New.
10753 * src/state.c: Use assert.
10754 * src/system.h: Include assert.h.
10755 * tests/sets.at (Accept): New.
10756
107572005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10758
10759 * data/glr.c (yyfill): Adjust comment.
10760 (yyresolveAction): Initialize default location properly
10761 for empty right-hand sides.
10762 (yydoAction): Ditto.
10763 Add comment explaining apparently dead code.
10764 * tests/glr-regression.at
10765 (Incorrectly initialized location for empty right-hand side in GLR):
10766 New test.
10767
107682005-10-30 Paul Eggert <eggert@cs.ucla.edu>
10769
10770 * bootstrap (cleanup_gnulib): New function. Use it to clean up
10771 gnulib when interrupted. This fixes some race conditions and
10772 works around some portability problems (one noted by Paul
10773 Hilfinger).
10774
107752005-10-22 Akim <akim@epita.fr>
10776
10777 * Makefile.cfg: Adjust to config -> build-aux.
10778 Reported by twledo.
10779
107802005-10-21 Akim Demaille <akim@epita.fr>
10781
10782 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
10783 the %parse-params.
10784 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
10785 * data/yacc.c (b4_Pure_if): Rename as...
10786 (b4_yacc_pure_if): this.
10787 (YY_SYMBOL_PRINT, yyparse): Adjust.
10788 * doc/bison.texinfo: Formatting changes.
10789
107902005-10-21 Akim Demaille <akim@epita.fr>
10791
10792 Finish the transition config -> build-aux.
10793 * configure.ac, Makefile.am: Use build-aux.
10794 * config/prev-version, config/announce-gen, config/Makefile.am:
10795 Move to...
10796 * build-aux/prev-version, build-aux/announce-gen,
10797 * build-aux/Makefile.am: here.
10798
107992005-10-14 Akim Demaille <akim@epita.fr>
10800
10801 * examples/calc++/test: Use set -x only when VERBOSE.
10802
108032005-10-13 Paul Eggert <eggert@cs.ucla.edu>
10804
10805 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
10806 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
10807
108082005-10-13 Akim Demaille <akim@epita.fr>
10809
10810 * src/scan-skel.l: Output the base name parts of the parser and
10811 header file names.
10812 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
10813 additional checks.
10814 Use this to exercise C++ outputs in subdirs.
10815 Reported by Oleg Smolsky.
10816
108172005-10-12 Paul Eggert <eggert@cs.ucla.edu>
10818
10819 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
10820 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
10821 Problem reported by John P. Hartmann.
10822 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
10823 already defined it.
10824
108252005-10-12 Akim Demaille <akim@epita.fr>
10826
10827 * src/parse-gram.y (version_check): Exit 63 to please missing
10828 (stands for "version mismatch).
10829 * tests/input.at, doc/bison.texinfo: Adjust.
10830
108312005-10-10 Paul Eggert <eggert@cs.ucla.edu>
10832
10833 Work around portability problems with Visual Age C compiler
10834 (xlc and xlC_r) reported by John P. Hartmann.
10835 * data/location.cc (initial_column, initial_line): Remove.
10836 All uses replaced by 0 and 1.
10837 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
10838 that xlc complains about.
10839 * src/scan-skel.l (skel_wrap): Likewise.
10840 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
10841 as __STDC__.
10842 * data/yacc.c (YYMODERN_C): New macro, which also looks at
10843 __STDC_VERSION__. Use it everywhere instead of looking at
10844 __STDC__ and __cplusplus.
10845
108462005-10-10 Akim Demaille <akim@epita.fr>
10847
10848 * examples/calc++/test: Be quiet unless VERBOSE.
10849
108502005-10-05 Paul Eggert <eggert@cs.ucla.edu>
10851
10852 * data/c.m4 (yydestruct, yysymprint):
10853 Use YYUSE instead of casting to void.
10854 * data/glr.c (YYUSE): New macro.
10855 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10856 Use it instead of rolling our own.
10857 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10858 (YYCHK1):
10859 Use /*CONSTCOND*/ to suppress lint warnings.
10860 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10861 (YY_STACK_PRINT): Use 'false' not '0'.
10862 (YYUSE): New macro.
10863 (yysymprint_, yydestruct_): Use it instead of rolling our own.
10864 * data/yacc.c (YYUSE): New macro.
10865 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
10866 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
10867 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
10868
10869
10870 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
10871 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
10872
108732005-10-04 Paul Eggert <eggert@cs.ucla.edu>
10874
10875 Undo the parts of the unlocked-I/O change that substituted
10876 putc or puts for printf. This might hurt performance a bit,
10877 but some people prefer the printf style.
10878 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
10879 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
10880 All uses replaced by YYFPRINTF and YYDPRINTF.
10881 * data/yacc.c: Likewise.
10882 * lib/bitset.c (bitset_print): Likewise.
10883 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
10884 putc and puts.
10885 * lib/lbitset.c (debug_lbitset): Likewise.
10886 * src/closure.c (print_firsts, print_fderives): Likewise.
10887 * src/gram.c (grammar_dump): Likewise.
10888 * src/lalr.c (look_ahead_tokens_print): Likewise.
10889 * src/output.c (escaped_output): Likewise.
10890 (user_actions_output): Break apart two printfs.
10891 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
10892 * src/reduce.c (reduce_print): Likewise.
10893 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
10894 * src/system.h: Include unlocked-io.h rathe than stdio.h.
10895
10896 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10897 Use assignments rather than casts-to-void to suppress
10898 unused-variable warnings. This pacifies 'lint'.
10899 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
10900 unused-variable warnings.
10901
109022005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10903
10904 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10905
109062005-10-02 Paul Eggert <eggert@cs.ucla.edu>
10907
10908 Use unlocked I/O for a minor performance improvement on hosts like
10909 GNU/Linux and Solaris that support unlocked I/O. The basic idea
10910 is to use the gnlib unlocked-io module, and to prefer putc and
10911 puts to printf when either will work (since the latter doesn't
10912 come in an unlocked flavor).
10913 * bootstrap (gnulib_modules): Add unlocked-io.
10914 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
10915 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
10916 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
10917 and similarly for puts and putc and printf.
10918 * data/yacc.c: Likewise.
10919 * lib/bitset.c (bitset_print): Likewise.
10920 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
10921 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
10922 to printf.
10923 * lib/lbitset.c (debug_lbitset): Likewise.
10924 * src/closure.c (print_firsts, print_fderives): Likewise.
10925 * src/gram.c (grammar_dump): Likewise.
10926 * src/lalr.c (look_ahead_tokens_print): Likewise.
10927 * src/output.c (escaped_output): Likewise.
10928 (user_actions_output): Coalesce two printfs.
10929 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
10930 * src/reduce.c (reduce_print): Likewise.
10931 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
10932 * src/system.h: Include unlocked-io.h rather than stdio.h.
10933
10934 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
10935 this confuses xgettext.
10936
109372005-10-02 Akim Demaille <akim@epita.fr>
10938
10939 * bootstrap (gnulib_modules): Add strverscmp.
10940 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
10941 * m4/.cvsignore: Add strverscmp.m4.
10942 * src/parse-gram.y (%require): New token, new rule.
10943 (version_check): New.
10944 * src/scan-gram.l (%require): Adjust.
10945 * tests/input.at (AT_REQUIRE): New.
10946 Use it.
10947 * doc/bison.texinfo (Require Decl): New.
10948 (Calc++ Parser): Use %require.
10949
109502005-10-02 Akim Demaille <akim@epita.fr>
10951
10952 * data/location.cc: New.
10953
109542005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
10955 Akim Demaille <akim@epita.fr>
10956
10957 Make sure -odir/foo.cc creates dir/location.hh etc.
10958 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
10959 (spec_file_prefix, spec_verbose_file, spec_graph_file)
10960 (spec_defines_file): Now const.
10961 (dir_prefix): New.
10962 (short_base_name): Remove.
10963 * src/files.c: Adjust.
10964 (dirname.h): Include.
10965 (base_name): Don't prototype it.
10966 (finput): Remove, duplicates gram_in.
10967 (full_base_name, short_base_name): Replace by...
10968 (all_but_ext, all_but_tab_ext): these.
10969 (compute_base_names): Rename as...
10970 (compute_file_name_parts): this.
10971 Update to compute the new variables, including dir_prefix.
10972 Adjust dependencies.
10973 * src/output.c (prepare): Output them.
10974 * src/reader.c: Adjust to use gram_in, not finput.
10975 * src/scan-skel.l (@dir_prefix@): New.
10976
109772005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10978
10979 * lib/subpipe.c: New function end_of_output_subpipe() added
10980 to allow support for non-posix systems. This is a no-op function
10981 for posix systems.
10982
10983 * lib/subpipe.h: New function end_of_output_subpipe() added
10984 to allow support for non-posix systems. This is a no-op function
10985 for posix systems.
10986
10987 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
10988 handle the lack of pipe/fork functionality on non-posix systems.
10989
10990 * djgpp/Makefile.maint: DJGPP specific file.
10991
10992 * djgpp/README.in: DJGPP specific file.
10993
10994 * djgpp/config.bat: DJGPP specific configuration file.
10995
10996 * djgpp/config.sed: DJGPP specific configuration file.
10997
10998 * djgpp/config.site: DJGPP specific configuration file.
10999
11000 * djgpp/config_h.sed: DJGPP specific configuration file.
11001
11002 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
11003
11004 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
11005
110062005-10-02 Akim Demaille <akim@epita.fr>
11007
11008 * data/location.cc: New, extract from...
11009 * data/lalr1.cc: here.
11010 (location.hh): Include it after the user prologue, in case the
11011 filename type is defined by the user.
11012 Forward declation location and position before the pre-prologue.
11013 (yyresult_): Rename as...
11014 (yyresult): this, it's a local variable, not an attribute.
11015 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
11016
110172005-10-01 Akim Demaille <akim@epita.fr>
11018
11019 * examples/extexi: Restore the #line generation.
11020
110212005-09-30 Akim Demaille <akim@epita.fr>,
11022 Alexandre Duret-Lutz <adl@gnu.org>
11023
11024 Move the token type and YYSTYPE in the parser class.
11025 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
11026 (parser::token): New, from the moved free definition of tokens.
11027 (parser::semantic_value): Now a full definition instead of an
11028 indirection to YYSTYPE.
11029 (b4_post_prologue): No longer included in the header file, but
11030 in the implementation file.
11031 * doc/bison.texi (C+ Language Interface): Update.
11032 * src/parse-gram.y: Support unary %define.
11033 * tests/actions.at: Define global_tokens_and_yystype for backward
11034 compatibility until we update the tests.
11035 * tests/calc.at: Idem.
11036 (first_line, first_column, last_line, last_column): Define for lalr1.cc
11037 to simplify the code.
11038
110392005-09-29 Paul Eggert <eggert@cs.ucla.edu>
11040
11041 Port to SunOS 4.1.4, which lacks strtoul and strerror.
11042 Ah, the good old days! Problem reported by Peter Klein.
11043 * bootstrap (gnulib_modules): Add strerror, strtoul.
11044 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
11045 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
11046
110472005-09-29 Akim Demaille <akim@epita.fr>
11048
11049 * data/c.m4 (b4_error_verbose_if): New.
11050 * data/lalr1.cc: Use it.
11051 (YYERROR_VERBOSE_IF): Remove.
11052 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
11053 parser members, replaced by...
11054 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
11055 local variables.
11056 (yysyntax_error_): Takes the state number as argument.
11057 (yyreduce_print_): Use the argument yyrule, not the former
11058 attribute yyn_.
11059
110602005-09-26 Paul Eggert <eggert@cs.ucla.edu>
11061
11062 * bootstrap (gnulib_modules): Add verify.
11063 * lib/.cvsignore: Add verify.h.
11064 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
11065 * src/system.h (verify): Remove.
11066 Include verify.h instead.
11067 * src/tables.c (tables_generate): Use new API for 'verify'.
11068
110692005-09-21 Paul Eggert <eggert@cs.ucla.edu>
11070
11071 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
11072 local variables whose names begin with 'yy'.
11073 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
11074 Trivial changes from Joel E. Denny.
11075
11076 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
11077 it itself.
11078 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
11079 don't use alloca any more.
11080
11081 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
11082 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
11083 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
11084 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
11085 to match yacc.c, to test more hosts.
11086
110872005-09-20 Paul Eggert <eggert@cs.ucla.edu>
11088
11089 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
11090 doesn't affect behavior.
11091 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
11092 Solaris, AIX, MSC.
11093 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
11094 This works a bit better with glibc, if user code has already included
11095 stdlib.h.
11096 * doc/bison.texinfo (Bison Parser): Document that users can't
11097 arbitrarily use malloc and free for other purposes. Document
11098 that <alloca.h> and <malloc.h> might be included.
11099 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
11100 user must declare alloca.
11101
11102 * HACKING (release): Forwarn the Translation Project about
11103 stable releses.
11104
111052005-09-20 Akim Demaille <akim@epita.fr>
11106
11107 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
11108
111092005-09-19 Paul Eggert <eggert@cs.ucla.edu>
11110
11111 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
11112 (YYSTACK_ALLOC_MAXIMUM): Use it.
11113 (yysyntax_error): New function.
11114 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
11115 multiple syntax errors are reported, and alloca is being used.
11116 Instead, reallocate buffers twice as big each time, so that
11117 we waste at most half the allocated memory. Start with a small
11118 (128-byte) buffer that will suffice in most cases anyway.
11119 Use yysyntax_error to do most of the work.
11120
11121 * doc/bison.texinfo (Error Reporting, Table of Symbols):
11122 yynerrs is the number of errors reported, not the number of
11123 errors encountered.
11124
11125 * tests/glr-regression.at (Duplicated user destructor for lookahead):
11126 Mark it as expected to fail.
11127 Cast result of malloc; problem reported by twlevo@xs4all.nl.
11128 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
11129 Don't start user-code symbols with "yy", to avoid name space problems.
11130
111312005-09-19 Akim Demaille <akim@epita.fr>
11132
11133 Remove the traits, failed experiment.
11134 It never proved useful, and anyway because of the current
11135 definition, it was not possible to have several specialization of
11136 this traits, making it useless.
11137 * data/lalr1.cc (yy:traits): Remove.
11138 Inline its definitions in the parser class.
11139
111402005-09-19 Akim Demaille <akim@epita.fr>
11141
11142 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
11143 least Mac OSX with a /usr/local install of gettext.
11144
111452005-09-19 Akim Demaille <akim@epita.fr>
11146
11147 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
11148 and yytoken for similarity with the other skeletons.
11149
111502005-09-19 Akim Demaille <akim@epita.fr>
11151
11152 * NEWS, configure.ac: update version number to 2.1a.
11153
111542005-09-16 Paul Eggert <eggert@cs.ucla.edu>
11155
11156 * NEWS: Version 2.1.
11157
11158 * NEWS: Remove notice of yytname change, since it was never in an
11159 official release.
11160 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
11161 diagnostic.
11162 * src/output.c (prepare): Likewise.
11163 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
11164 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
11165 is not defined. This is an awful hack, but it's enough for now.
11166 All callers changed.
11167 * tests/glr-regression-at (make_value): Args are const pointers now,
11168 to avoid GCC warning.
11169 (Duplicated user destructor for lookahead): New test. Currently
11170 skipped. It fails on my host but I'm not sure it'll always fail.
11171
111722005-09-16 Akim Demaille <akim@epita.fr>
11173
11174 * src/symtab.h (struct symbol): Declare the printer and destructor
11175 as const, to avoid accidental calls to free.
11176 (symbol_destructor_set, symbol_printer_set): Adjust.
11177 * src/symtab.c: Adjust.
11178
111792005-09-16 Akim Demaille <akim@epita.fr>
11180
11181 * data/c.m4 (b4_token_enums): New.
11182 (b4_token_defines): Rename as...
11183 (b4_token_enums_defines): this.
11184 (b4_token_defines): New, output only the #defines.
11185 * data/yacc.c, data/glr.c: Adjust.
11186 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
11187 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
11188 as default values.
11189
111902005-09-16 Akim Demaille <akim@epita.fr>
11191
11192 * data/lalr1.cc (yylex_): Remove, inline its code.
11193 (yyreport_syntax_error_): Remove, replaced by...
11194 (yysyntax_error_): this which returns a string and leaves to the
11195 caller the call to the users' error function.
11196 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
11197 Move from members of the parser object...
11198 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
11199 to local variables of the parse function.
11200
112012005-09-16 Akim Demaille <akim@epita.fr>
11202
11203 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
11204 since it's in Bison's name space.
11205
112062005-09-15 Paul Eggert <eggert@cs.ucla.edu>
11207
11208 * data/glr.c (yyresolveValue): Add default case to pacify
11209 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
11210
11211 * NEWS: Document when yyparse started to return 2.
11212 * doc/bison.texinfo (Parser Function): Document when yyparse
11213 returns 2.
11214
11215 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
11216 (b4_filename_type): Renamed back from b4_file_name_type. All uses
11217 changed.
11218 (class position): file_name -> filename (reverting). All uses changed.
11219
112202005-09-14 Paul Eggert <eggert@cs.ucla.edu>
11221
11222 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
11223 do anything if $@ exists. This reverts part of the 2005-07-07
11224 patch.
11225
112262005-09-11 Paul Eggert <eggert@cs.ucla.edu>
11227
11228 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
11229 contains obsolete information and isn't worth distributing as a
11230 separate file anyway.
11231 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
11232 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
11233 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
11234 (yyparse): Abort if user code uses longjmp to throw an unexpected
11235 value.
11236
112372005-09-09 Paul Eggert <eggert@cs.ucla.edu>
11238
11239 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
11240 Suggested by twlevo@xs4all.nl.
11241
11242 * data/glr.c (YYCHK1): Do not assume YYE is in range.
11243 This avoids a diagnostic from gcc -Wswitch-enum.
11244 Problem reported by twlevo@xs4all.nl.
11245
11246 * doc/bison.texinfo: Don't use "filename", as per GNU coding
11247 standards. Use "file name" or "file" or "name", depending on
11248 the context.
11249 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
11250 not to hack/foo.tab.c.
11251 (Calc++ Top Level): 2nd arg of main is not const.
11252 * data/glr.c: b4_filename -> b4_file_name.
11253 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
11254 All uses changed.
11255 (class position): filename -> file_name. All uses changed.
11256 * data/yacc.c: b4_filename -> b4_file_name.
11257 * lib/bitset.h: filename -> file_name in local vars.
11258 * lib/bitset_stats.c: Likewise.
11259 * src/files.c: Likewise.
11260 * src/scan-skel.l ("@output ".*\n): Likewise.
11261 * src/files.c (file_name_split): Renamed from filename_split.
11262 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
11263
112642005-09-08 Paul Eggert <eggert@cs.ucla.edu>
11265
11266 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
11267 to accommodate latest gnulib.
11268
11269 * tests/glr-regression.at (Duplicate representation of merged trees):
11270 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
11271
11272 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
11273 needed.
11274
112752005-08-26 Paul Eggert <eggert@cs.ucla.edu>
11276
11277 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
11278 All uses changed. Invoke user destructor after an error during a
11279 split parse (trivial change from Joel E. Denny).
11280
11281 * tests/glr-regression.at
11282 (User destructor after an error during a split parse): New test case.
11283 Problem reported by Joel E. Denny in:
11284 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
11285
112862005-08-25 Paul Eggert <eggert@cs.ucla.edu>
11287
11288 * README-cvs: Give URLs for recommended tools.
11289 Mention Gzip version problem, and bootstrapping issues.
11290 Remove troubleshooting section, as it's somewhat obsolete.
11291
11292 * bootstrap (no_cache): New var, to accommodate different wget
11293 variants. Use it instead of '-C off'. Problem reported by
11294 twlevo@xs4all.nl.
11295
11296 * data/glr.c (yydestroyStackItem): New function.
11297 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
11298 debugging information. Problem reported by Joel E. Denny.
11299
113002005-08-25 Akim Demaille <akim@epita.fr>
11301
11302 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
11303
113042005-08-24 Paul Eggert <eggert@cs.ucla.edu>
11305
11306 * data/glr.c (yyrecoverSyntaxError, yyreturn):
11307 Don't invoke destructor on unresolved entries.
11308 * tests/glr-regression.at
11309 (User destructor for unresolved GLR semantic value): New test case.
11310 Problem reported by Joel E. Denny in:
11311 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
11312
113132005-08-21 Paul Eggert <eggert@cs.ucla.edu>
11314
11315 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
11316 Add strnlen.c.
11317 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
11318 lib-prefix.m4, po.m4.
11319
11320 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
11321 in yydestruct diagnostic, since it might not be an error.
11322 Problem reported by Joel Denny near end of
11323 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
11324 * data/lalr1.cc (yyerturn): Likewise.
11325 * data/yacc.c (yyreturn): Likewise.
11326 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
11327
11328 * src/files.c: Remove obsolete FIXME comment.
11329
11330 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
11331 with the other templates, and to fix bogus run-on messages such
11332 as the one reported at the end of
11333 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
11334 All callers changed to avoid the newline.
11335 (yyprocessOneStack): Output two lines rather than one, to accommodate
11336 the above change. This changes the debug output format slightly.
11337
11338 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
11339 reported by Joel E. Denny in
11340 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
11341 (trivial change).
11342 * tests/glr-regression.at (Duplicate representation of merged trees):
11343 New test, from Joel E. Denny in:
11344 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
11345 * THANKS: Add Joel E. Denny.
11346
11347 * configure.ac (AC_INIT): Bump to 2.0c.
11348
113492005-07-24 Paul Eggert <eggert@cs.ucla.edu>
11350
11351 * NEWS: Version 2.0b.
11352
11353 * Makefile.am (SUBDIRS): Put examples before tests, so that
11354 "make check" doesn't finish with "All 1 tests passed".
11355
11356 * tests/regression.at (Token definitions): Don't rely on
11357 AT_PARSER_CHECK for data that contains backslashes. It currently
11358 uses 'echo', and 'echo' isn't portable if its argument contains
11359 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
11360 that the byte '\0xff' is not printable in the C locale; it is,
11361 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
11362 not printable, so use '\0x81' to test.
11363
11364 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
11365 version of GCC, since the macro is used with non-GCC compilers.
11366
11367 Fix core dump reported by Pablo De Napoli in
11368 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
11369 * tests/regression.at (Invalid inputs with {}): New test.
11370 * src/parse-gram.y (token_name): Translate type before using
11371 it as an index.
11372
11373 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
11374 the user's name space. All uses changed to __attribute__
11375 ((__unused__)).
11376 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
11377 Add __attribute__ ((__noreturn__)).
11378
11379 * etc/clcommit: Remove. We weren't using it, and it failed
11380 "make maintainer-distcheck".
11381 * Makefile.maint: Merge from coreutils.
11382 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
11383 (syntax-check-rules): Change list of rules as described below.
11384 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
11385 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
11386 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
11387 (sc_trailing_space): New rules.
11388 (sc_xalloc_h_in_src): Remove.
11389 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
11390 (sc_space_tab, sc_error_exit_success, sc_changelog):
11391 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
11392 (makefile-check, po-check, author_mark_check):
11393 (makefile_path_separator_check, copyright-check):
11394 Use grep -n, to make it easier to find violations.
11395 Use CVS_LIST and CVS_LIST_EXCEPT.
11396 (header_regexp, h_re): Remove.
11397 (dd_c): New macro.
11398 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
11399 (my-distcheck): Use more-modern GCC flags.
11400 (signatures, %.asc): Remove.
11401 (rel-files, announcement): Remove signatures.
11402 Restore old updating code, even though we don't use it, so
11403 that we're the same as coreutils.
11404 (alpha, beta, major): Depend on news-date-check.
11405 Make the upload commands.
11406
11407 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
11408 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
11409 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
11410 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
11411 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
11412 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
11413 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
11414 * tests/sets.at: Likewise.
11415
11416 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
11417 we comment out the Autoconf version number.
11418 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
11419 it's error-prone and "make maintainer-distcheck" rejects it.
11420
11421 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
11422 Indent calls to "error" to pacify "make maintainer-distcheck",
11423 when the calls are not intended to be translated.
11424 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
11425
11426 * src/Makefile.am (DEFS): Use +=, to pacify
11427 "make maintainer-distcheck".
11428 (bison_SOURCES): Add scan-skel.h.
11429 (sc_tight_scope): New rule, from coreutils.
11430
11431 * src/files.c (src_extension, header_extension):
11432 Now static, not extern.
11433 * src/getargs.c (short_options): Likewise.
11434 * src/muscle_tab.c (muscle_table): Likewise.
11435 * src/parse-gram.y (current_class, current_type, current_prec):
11436 Likewise.
11437 * src/reader.c (grammar_end, previous_rule_end): Likewise.
11438 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
11439 * src/main.c (main): Cast bindtextdomain and textdomain calls to
11440 void, to avoid warning when NLS is disabled.
11441 * src/output.c: Include scan-skel.h.
11442 (scan_skel): Remove decl, since scan-skel.h does this.
11443 (output_skeleton):
11444 Indent calls to "error" to pacify "make maintainer-distcheck".
11445 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
11446 * src/reader.h (gram_end, gram_lineno): New decls to pacify
11447 "make maintainer-distcheck".
11448 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
11449 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
11450 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
11451 (skel_lex_destroy, scan_skel): Move these decls to...
11452 * src/scan-skel.h: New file.
11453 * src/uniqstr.c (uniqstr_assert):
11454 Indent calls to "error" to pacify "make maintainer-distcheck".
11455
11456 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
11457 not @VAR@.
11458
11459 * tests/torture.at: Revamp to avoid misuse of atoi that
11460 "make maintainer-distcheck" complained about.
11461
11462 * examples/extexi (message): Don't print a message more than once,
11463 and omit line-number decoration that makes Emacs compile think
11464 that informative messages are worth worrying about.
11465
114662005-07-22 Paul Eggert <eggert@cs.ucla.edu>
11467
11468 * configure.ac: Update version number.
11469
11470 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
11471 accidentally.
11472 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
11473 autogenerated by the maintainer.
11474 * examples/calc++/.cvsignore: Add *.yy.
11475
11476 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
11477 * lib/bitset_stats.c (bitset_stats_init): Likewise.
11478 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11479
11480 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
11481
11482 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
11483 from maintainer-distcheck about casting the argument of 'free'.
11484
11485 * NEWS: Mention recent yytname changes.
11486 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
11487
11488 * bootstrap: For translations that have not yet been upgraded to
11489 the new runtime-po domain, prime the pump by extracting the
11490 relevant strings from the obsolete translations. This code can be
11491 removed once the bison-runtime domain has been translated by each
11492 team.
11493
11494 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
11495 now that token names are already quoted.
11496
11497 Fix problem reported by Anthony Heading.
11498 * data/glr.c (YYTOKEN_TABLE): New macro.
11499 (yytname): Define if YYTOKEN_TABLE.
11500 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
11501 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
11502 (YYERROR_VERBOSE): Define the same way the other skeletons do.
11503 * src/output.c (prepare_symbols): Output token_table_flag.
11504
115052005-07-21 Paul Eggert <eggert@cs.ucla.edu>
11506
11507 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
11508 again if the first call fails.
11509
11510 * data/glr.c (yytnamerr): New function.
11511 (yyreportSyntaxError): Use it to dequote most string literals.
11512 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
11513 with other skeletons. All uses changed.
11514 (yytnameerr_): New function.
11515 (yyreport_syntax_error): Use it to dequote most string literals.
11516 * data/yacc.c (yytnamerr): New function.
11517 (yyerrlab): Use it to decode most string literals.
11518 * doc/bison.texinfo (Decl Summary, Calling Convention):
11519 Clarify quoting convention of yytname.
11520 * src/output.c (prepare_symbols): Quote all names. This undoes
11521 the 2005-04-17 change, which is now accomplished (mostly) via
11522 changes in the parsers as described above.
11523 * tests/regression.at (Token definitions, Web2c Actions):
11524 Undo most 2005-04-17 change here, too.
11525
115262005-07-20 Paul Eggert <eggert@cs.ucla.edu>
11527
11528 Fix more problems reported by twlevo@xs4all.nl.
11529 * tests/cxx-type.at: Don't pipe output of ./types through sed to
11530 remove trailing spaces. This loses the exit status of ./types,
11531 and isn't needed since ./types shouldn't be emitting trailing
11532 spaces.
11533 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
11534 as the stack isn't valid in that case.
11535
11536 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
11537 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
11538 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
11539 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
11540 is used.
11541 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
11542 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
11543 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
11544 Likewise.
11545
11546 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
11547 overly-picky compilers that reject 'char *foo = "bar";'.
11548
11549 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
11550 to FILE * parameter, not to stderr. This fixes a typo introduced
11551 in the 2005-07-12 change.
11552
11553 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
11554 warnings from GCC 4.
11555
11556 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
11557 (yyglrShiftDefer, yysplitStack):
11558 Remove unused parameters b4_pure_formals. All uses changed.
11559 (yyglrShift): Remove unused parameters b4_user_formals.
11560 All uses changed.
11561 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
11562
115632005-07-18 Paul Eggert <eggert@cs.ucla.edu>
11564
11565 Destructor cleanups and regularization among the three skeletons.
11566 * NEWS: Document the behavior changes.
11567 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
11568 stack before failing, as the cleanup code will do it for us now.
11569 * data/lalr1.cc (yyerrlab): Likewise.
11570 * data/glr.c (yyparse): Pop everything off the stack before
11571 freeing it, so that destructors get called properly.
11572 * data/lalr1.cc (yyreturn): Likewise.
11573 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
11574 This is more consistent.
11575 * doc/bison.texinfo (Destructor Decl): Mention more reasons
11576 why destructors might be called. 1.875 -> 2.1.
11577 (Destructor Decl, Decl Summary, Table of Symbols):
11578 Some English-language cleanups for %destructor.
11579 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11580 Add output line for destructor of start symbol.
11581 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
11582 because of that same extra output line.
11583
11584 * NEWS: Document minor wording changes in diagnostics of
11585 Bison-generated parsers.
11586 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
11587 Remove unused formals. All uses changed.
11588 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
11589 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
11590 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
11591 Rename yyoverflowab to yyexhaustedlab.
11592 When memory exhaustion occurs during syntax-error reporting,
11593 report it separately rather than in a single diagnostic; this
11594 eases translation.
11595 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
11596 (Memory Exhausted): Renamed from Parser Stack Overflow.
11597 Revamp wording slightly to prefer "memory exhaustion".
11598 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
11599
11600 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
11601
11602 Add i18n support to the GLR skeleton. Partially fix the C++
11603 skeleton; a C++ expert needs to finish this. Remove debugging
11604 msgids; there's little point to having them translated, since they
11605 can be understood only by someone who can read the
11606 (English-language) source code.
11607
11608 Generate runtime-po/bison-runtime.pot automatically, so that we
11609 don't have to worry about garbage getting in that file. We'll
11610 make sure after the next official release that old msgids don't
11611 get lost. See
11612 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
11613
11614 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
11615 Now auto-generated.
11616 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
11617 Fix typos in explanations of the runtime file.
11618 * bootstrap: Change gettext keyword from YYI18N to YY_.
11619 Use standard Makefile.in.in in runtime-po, since we'll arrange
11620 for backward-compatible bison-runtime.po files in a different way.
11621 * data/glr.c (YY_): New macro, from yacc.c.
11622 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
11623 Translate messages intended for users.
11624 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
11625 the wording in the other skeletons. We don't know that the memory
11626 is virtual.
11627 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
11628 Use same method that yacc.c uses.
11629 Don't translate debugging messages.
11630 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
11631 it doesn't work (yet), and requires C++ expertise to fix.
11632 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
11633 Move defn to a more logical place, to be consistent with other
11634 skeletons.
11635 Don't translate debugging messages.
11636 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
11637 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
11638 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
11639 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
11640
11641 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
11642 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
11643 void, not int.
11644 * tests/glr-regression.at (Badly Collapsed GLR States):
11645 Likewise.
11646 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
11647 yylex should return 0 at EOF rather than aborting.
11648
11649 Improve tests for stack overflow in GLR parser.
11650 Problem reported by twlevo@xs4all.nl.
11651 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
11652 All uses removed.
11653 (yyStackOverflow): Just longjmp, but with value 2 so that caller
11654 can handle the problem.
11655 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
11656 (yyparse): New local variable yyresult to record the result.
11657 Use result of setjmp to set it, rather than storing itinto
11658 struct.
11659 (yyDone): Remove label.
11660 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
11661 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
11662 if YYABORT is used).
11663 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
11664 yyparse status; put status > 1 into diagnostic.
11665 Check that status==2 works.
11666 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
11667 Use exit status 3 for failure to open (which shouldn't happen).
11668
116692005-07-17 Paul Eggert <eggert@cs.ucla.edu>
11670
11671 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
11672 1 on syntax error; just let yyparse do its thing.
11673 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
11674 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
11675 (Exploding the Stack Size with Alloca):
11676 (Exploding the Stack Size with Malloc):
11677 Expect exit status 2, not 1, since the parser is supposed to blow
11678 its stack. Problem reported by twlevo@xs4all.nl.
11679
11680 * data/glr.c (yyparse): Don't assume that the initial calls
11681 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
11682 Print a stack-overflow message and fail instead.
11683 Initialize the line-number information before creating the stack,
11684 so that the stack-overflow message can report line zero safely.
11685
116862005-07-14 Paul Eggert <eggert@cs.ucla.edu>
11687
11688 Fix problems reported by twlevo@xs4all.nl.
11689 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
11690 (yyuserMerge): Provide a default case if b4_mergers is empty.
11691 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
11692 * tests/glr-regression.at
11693 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
11694 Add casts to pacify C++ compilers.
11695 * tests/glr-regression.at (Improper merging of GLR delayed action
11696 sets): Declare yylex before using it.
11697 * tests/Makefile.am (maintainer-check-g++): Fix a stray
11698 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
11699 test for valgrind; valgrind is independent of g++.
11700 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
11701 for compatibility with POSIX 1003.1-2001 (if running coreutils).
11702 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
11703 Use a destructor, so that we can expand the stack. Change
11704 YYSTYPE to char * so that we can free it. Cast result of malloc.
11705
117062005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11707
11708 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
11709 a valgrind failure. Problem reported by twlevo@xs4all.nl.
11710
117112005-07-13 Paul Eggert <eggert@cs.ucla.edu>
11712
11713 * PACKAGING: New file, suggested by Bruno Haible and taken from
11714 similar wording in gettext's PACKAGING file.
11715 * NEWS: Mention PACKAGING.
11716 * Makefile.am (EXTRA_DIST): Add PACKAGING.
11717
117182005-07-12 Paul Eggert <eggert@cs.ucla.edu>
11719
11720 * NEWS: Document recent i18n improvements.
11721 * bootstrap: Get runtime translations into runtime-po.
11722 Create runtime-po files automatically, if possible.
11723 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
11724 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
11725 does not infringe on the user's name space.
11726 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
11727 * doc/bison.texinfo (Internationalization): Revamp the English
11728 and Texinfo syntax a bit, to try to make it clearer.
11729 (Bison Options, Option Cross Key): Mention --print-localedir.
11730 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
11731 YYENABLE_NLS. Quote a bit more.
11732 * runtime-po/.cvsignore: New file.
11733 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
11734 * runtime-po/Rules-quot: Remove; now created by bootstrap.
11735 * runtime-po/quot.sed: Likewise.
11736 * runtime-po/boldquot.sed: Likewise.
11737 * runtime-po/en@quot.header: Likewise.
11738 * runtime-po/en@boldquot.header: Likewise.
11739 * runtime-po/insert-header.sin: Likewise.
11740 * runtime-po/remove-potcdate.sin: Likewise.
11741 * runtime-po/Makevars: Likewise.
11742 * runtime-po/LINGUAS: Likewise.
11743 * runtime-po/de.po: Likewise; we will rely on the translation project
11744 to maintain this, so "bootstrap" should get it.
11745 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
11746 its value.
11747 * src/main.c (main): Bind the bison-runtime domain, too.
11748
117492005-07-12 Bruno Haible <bruno@clisp.org>
11750
11751 * data/yacc.c: Include <libintl.h> when NLS is enabled.
11752 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
11753 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
11754 * runtime-po: New directory.
11755 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
11756 $(DOMAIN).pot-update rule, so that old messages are never dropped.
11757 * runtime-po/Rules-quot: New file, copied from po/.
11758 * runtime-po/quot.sed: Likewise.
11759 * runtime-po/boldquot.sed: Likewise.
11760 * runtime-po/en@quot.header: Likewise.
11761 * runtime-po/en@boldquot.header: Likewise.
11762 * runtime-po/insert-header.sin: Likewise.
11763 * runtime-po/remove-potcdate.sin: Likewise.
11764 * runtime-po/Makevars: New file.
11765 * runtime-po/POTFILES.in: New file.
11766 * runtime-po/LINGUAS: New file.
11767 * runtime-po/bison-runtime.pot: New file.
11768 * runtime-po/de.po: New file.
11769 * m4/bison.m4: New file.
11770 * Makefile.am (SUBDIRS): Add runtime-po.
11771 (aclocaldir, aclocal_DATA): New variables.
11772 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
11773 Define aclocaldir.
11774 * src/getargs.c (usage): Document --print-localedir option.
11775 (PRINT_LOCALEDIR_OPTION): New enum item.
11776 (long_options): Add --print-localedir option.
11777 (getargs): Handle --print-localedir option.
11778 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
11779 (Internationalization): New section.
11780
117812005-07-12 Akim Demaille <akim@epita.fr>
11782
11783 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
11784 for consistency with the rest of the code.
11785 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
11786 Add separators.
11787
117882005-07-12 Akim Demaille <akim@epita.fr>
11789
11790 * src/parse-gram.y: Use %printer instead of YYPRINT.
11791
117922005-07-12 Akim Demaille <akim@epita.fr>
11793
11794 * src/symtab.h, src/symtab.c (symbol_print): New.
11795 * src/symlist.h, src/symlist.c (symbol_list_print): New.
11796 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
11797
117982005-07-12 Akim Demaille <akim@epita.fr>
11799
11800 * data/glr.c (b4_syncline): Fix (swap) the definitions of
11801 b4_at_dollar and b4_dollar_dollar.
11802
118032005-07-11 Paul Eggert <eggert@cs.ucla.edu>
11804
11805 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
11806 and Pennello's paper.
11807
118082005-07-09 Paul Eggert <eggert@cs.ucla.edu>
11809
11810 * data/yacc.c (yyparse): Undo previous patch. Instead,
11811 set yylsp[0] and yyvsp[0] only if the initial action
11812 sets yylloc and yylval, respectively.
11813
11814 * data/yacc.c (yyparse): In the initial action, set
11815 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
11816 This avoids the use of undefined variables if the initial
11817 action does not set yylloc and/or yylval.
11818
118192005-07-07 Paul Eggert <eggert@cs.ucla.edu>
11820
11821 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
11822 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
11823 Remove from CVS. These files are automatically generated.
11824 * examples/extexi: Clarify that this file is now part of Bison,
11825 not GNU M4, and that it works with any POSIX-compatible Awk.
11826 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
11827 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
11828 so that we also get calc++-parser.yy. Geneate it.
11829 Use $(AWK), not gawk, since any conforming Awk will do.
11830 Put comment before action, since older 'make' can't handle comment
11831 in action.
11832 $(BUILT_SOURCES): List all built sources, not just some of them.
11833 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
11834 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
11835 $($(calc_sources_generated)): Remove unnecessary test for existence
11836 of target. (This had a shell syntax error anyway; a stray "x".)
11837 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
11838 calc++-parser.yy.
11839 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
11840
11841 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
11842 implied by the other modules.
11843
118442005-07-06 Akim Demaille <akim@epita.fr>
11845
11846 Bind examples/calc++ to the package.
11847 * examples/calc++/Makefile: Remove, replaced by...
11848 * examples/calc++/Makefile.am: ... this new file.
11849 * examples/calc++/test: Remove input.
11850 * examples/calc++/compile: Remove.
11851 * examples/Makefile.am: New.
11852 * configure.ac, Makefile.am: Adjust.
11853 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
11854
118552005-07-05 Paul Eggert <eggert@cs.ucla.edu>
11856
11857 * data/glr.c (yyFail): Drastically simplify; since the format argument
11858 never had any % directives, we can simply pass it to yyerror.
11859 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
11860 be modified later, as that is the usual style in glr.c.
11861 Problems reported by Paul Hilfinger.
11862
11863 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
11864 and size overflow errors.
11865 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
11866 in case the user prolog sets feature-test macros like _GNU_SOURCE.
11867 (YYSIZEMAX): New macro.
11868 (yystpcpy): New function, taken from yacc.c.
11869 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
11870 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
11871 so that we don't have to maintain their signatures.
11872 (yyFail): Check for buffer overflow, by using vsnprintf rather
11873 than vsprintf. Allocate a bigger buffer if possible.
11874 Report an error if buffer allocation fails.
11875 (yyStackOverflow): New function.
11876 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
11877 the initialization was successful. It might fail if storage was
11878 exhausted.
11879 (yyexpandGLRStack): Add more checks for storage allocation failure.
11880 Use yyStackOverflow to report failures.
11881 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
11882 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
11883 Don't assume stack number fits in int.
11884 (yysplitStack): Check for storage allocation failure.
11885 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
11886 can print diagnostics on storage allocation failure. All callers
11887 changed.
11888 (yyresolveValue): Use yybool for boolean.
11889 (yyreportSyntaxError): Check for size-calculation overflow.
11890 This code is taken from yacc.c.
11891 (yyparse): Check for storage allocation errors when allocating
11892 the initial stack.
11893
118942005-07-05 Akim Demaille <akim@epita.fr>
11895
11896 Extract calc++ from the documentation.
11897 * doc/bison.texinfo (Calc++): Add the extraction marks.
11898 * examples/extexi: New, from the aborted GNU Programming 2E.
11899 Separate the different paragraph of a file with empty lines.
11900 * examples/Makefile: Use it to extract the whole calc++ example.
11901
119022005-06-24 Akim Demaille <akim@epita.fr>
11903
11904 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
11905 class typedefs.
11906
119072005-06-22 Akim Demaille <akim@epita.fr>
11908
11909 * doc/bison.texinfo (C++ Language Interface): First stab.
11910 (C++ Parsers): Remove.
11911
119122005-06-22 Akim Demaille <akim@epita.fr>
11913
11914 * data/lalr1.cc (yylex_): Honor %lex-param.
11915
119162005-06-22 Akim Demaille <akim@epita.fr>
11917
11918 Start a set of simple examples.
11919 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
11920 * examples/calc++/calc++-driver.hh,
11921 * examples/calc++/calc++-parser.yy,
11922 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
11923 * examples/calc++/compile, examples/calc++/test: New.
11924
119252005-06-09 Paul Eggert <eggert@cs.ucla.edu>
11926
11927 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
11928 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
11929 which stems from the 2005-05-27 patch.
11930
119312005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11932
11933 * data/glr.c: Modify treatment of unused parameters to permit use
11934 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
11935
119362005-05-30 Paul Eggert <eggert@cs.ucla.edu>
11937
11938 Fix infringement on user name space reported by Janos Zoltan Szabo.
11939 * data/yacc.c (yyparse): strlen -> yystrlen.
11940
119412005-05-30 Akim Demaille <akim@epita.fr>
11942
11943 * data/lalr1.cc (_): New.
11944 Translate the various messages.
11945
119462005-05-27 Paul Eggert <eggert@cs.ucla.edu>
11947
11948 Fix infringement on user name space reported by Bruno Haible.
11949 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
11950 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
11951 the user's name space.
11952 (alloca): Include <stdlib.h> to get it, if it's not built in.
11953 (YYMALLOC, YYFREE): Define only if needed.
11954 (malloc, free): Declare, but only if needed, as this infringes on
11955 the user name space.
11956
119572005-05-25 Paul Eggert <eggert@cs.ucla.edu>
11958
11959 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
11960 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
11961 with %d format.
11962 * lib/ebitset.c (min, max): Undef before defining.
11963 * lib/vbitset.c (min, max): Likewise.
11964 * lib/subpipe.c (create_subpipe): Save local variables in case
11965 vfork clobbers them.
11966
119672005-05-24 Bruno Haible <bruno@clisp.org>
11968
11969 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
11970 error message syntax used by gcc-4.0.
11971
119722005-05-23 Paul Eggert <eggert@cs.ucla.edu>
11973
11974 * README: Mention m4 1.4.3. Remove obsolete advice about
11975 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
11976
11977 * bootstrap: Remove workaround for problem I encountered with
11978 gettext 0.14.1; it seems to be fixed now.
11979
119802005-05-22 Paul Eggert <eggert@cs.ucla.edu>
11981
11982 * NEWS: Version 2.0a.
11983
11984 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
11985 the previous change.
11986
11987 Various maintainer cleanups.
11988 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
11989 conftest*, for benefit of CVS commands run at the same time as
11990 "configure". Add build-aux, since "bootstrap" now creates it and
11991 its subfiles.
11992 * Makefile.cfg (move_if_change): Remove.
11993 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
11994 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
11995 (po_repo, do-po-update, po-update, wget_files, get-targets):
11996 (config.guess-url_prefix, config.sub-url_prefix):
11997 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
11998 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
11999 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
12000 Remove.
12001 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
12002 this is now the recommended name.
12003 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
12004 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
12005 ylwrap. These files now go into build-aux.
12006 * config/move-if-change: Remove.
12007 * config/prev-version.txt: Bump from 1.75 to 2.0.
12008
12009 * bootstrap: Add stdio-safer, unistd-safer modules.
12010 Remove m4/glibc2.m4 (introduced by latest gnulib, but
12011 we don't need it).
12012 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
12013 fopen-safer.c, stdio-safer.h, unistd-safer.h.
12014 * lib/subpipe.c: Include "unistd-safer.h".
12015 (create_subpipe): Make sure all the newly-created
12016 file descriptors are > 2, so that diagnostics don't
12017 get sent down them (which might cause Bison to hang, in theory).
12018 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
12019 * src/files.c (xfopen): Use fopen_safer, not fopen.
12020
12021 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
12022 yesterday's yacc.c fix.
12023
120242005-05-21 Paul Eggert <eggert@cs.ucla.edu>
12025
12026 * data/glr.c, data/lalr1.cc: Update copyright date.
12027
12028 Fix a destructor bug reported by Wolfgang Spraul in
12029 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
12030 * data/yacc.c (yyabortlab): Don't call destructor, and
12031 don't set yychar to EMPTY.
12032 (yyoverflowlab): Don't call destructor.
12033 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
12034 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
12035 since we no longer output the message "discarding lookahead token
12036 end of input ()".
12037
120382005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12039
12040 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
12041 fix a small glitch in debugging output.
12042 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
12043 after YY_SYMBOL_PRINT where needed.
12044
12045 (struct yyGLRState): Add some comments.
12046 (struct yySemanticOption): Add some comments.
12047 (union yyGLRStackItem): Add comment.
12048
12049 (yymergeOptionSets): Correct this to properly perform the union,
12050 avoiding infinite reported by Michael Rosien.
12051 Update comment.
12052
12053 * tests/glr-regression.at: Add test for GLR merging error reported
12054 by M. Rosien.
12055
120562005-05-13 Paul Eggert <eggert@cs.ucla.edu>
12057
12058 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
12059 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
12060 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
12061 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
12062 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
12063 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
12064 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
12065 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
12066 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
12067 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
12068 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
12069 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
12070 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
12071 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
12072 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
12073 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
12074 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
12075 src/derives.h, src/files.c, src/files.h, src/getargs.c,
12076 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
12077 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
12078 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
12079 src/output.h, src/parse-gram.c, src/parse-gram.h,
12080 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
12081 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
12082 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
12083 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
12084 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
12085 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
12086 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
12087 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
12088 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
12089 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
12090 tests/reduce.at, tests/regression.at, tests/sets.at,
12091 tests/synclines.at, tests/testsuite.at, tests/torture.at:
12092 Update FSF postal mail address.
12093
120942005-05-11 Paul Eggert <eggert@cs.ucla.edu>
12095
12096 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
12097 Problem reported by Ralf Menzel.
12098
120992005-05-01 Paul Eggert <eggert@cs.ucla.edu>
12100
12101 * tests/actions.at: Test that stack overflow invokes destructors.
12102 From Marcus Holland-Moritz.
12103 * data/yacc.c (yyerrlab): Move the code that destroys the stack
12104 from here....
12105 (yyreturn): to here. That way, destructors are called properly
12106 even if the stack overflows, or the user calls YYACCEPT or
12107 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
12108 (yyoverflowlab): Destroy the lookahead.
12109
121102005-04-24 Paul Eggert <eggert@cs.ucla.edu>
12111
12112 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
12113
121142005-04-17 Paul Eggert <eggert@cs.ucla.edu>
12115
12116 * NEWS: Bison-generated C parsers no longer quote literal strings
12117 associated with tokens.
12118 * src/output.c (prepare_symbols): Don't escape strings,
12119 since users don't want to see C escapes.
12120 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
12121 in diagnostics.
12122 * tests/input.at (Torturing the Scanner): Likewise.
12123 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
12124
121252005-04-16 Paul Eggert <eggert@cs.ucla.edu>
12126
12127 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
12128 the data size is known to be too small and we can't increase it.
12129 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
12130
121312005-04-15 Paul Eggert <eggert@cs.ucla.edu>
12132
12133 * src/parse-gram.y: Include quotearg.h.
12134 (string_as_id): Quote $1 before using it as a key, since the
12135 lexer no longer quotes it for us.
12136 (string_content): Don't strip quotes, since lexer no longer
12137 quotes it for us.
12138 * src/scan-gram.l: Include quotearg.h.
12139 ("\""): Omit quote.
12140 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
12141 a key, since the rest of the lexer doesn't quote it.
12142 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
12143 * tests/regression.at (Token definitions): Check for backslashes
12144 in token strings.
12145
12146 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
12147 (YYSIZE_T): Define to unsigned long int when using an older compiler.
12148 (yyparse): Revamp code to generate long syntax error message, to
12149 make it easier to translate, and to avoid problems with arithmetic
12150 overflow. Change "virtual memory" to "memory" in diagnostic, since
12151 we don't know whether the memory is virtual.
12152
121532005-04-13 Paul Eggert <eggert@cs.ucla.edu>
12154
12155 * NEWS: Bison-generated C parsers now use the _ macro to
12156 translate strings.
12157 * data/yacc.c (_) [!defined _]: New macro.
12158 All English strings wrapped inside this macro.
12159 * doc/bison.texinfo (Bison Parser): Document _.
12160 * po/POTFILES.in: Include src/parse-gram.c, since it now
12161 includes translateable strings that parse-gram.y doesn't.
12162
121632005-04-12 Paul Eggert <eggert@cs.ucla.edu>
12164
12165 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
12166 reverting the 2004-10-11 change to this function.
12167 (symbol_check_alias_consistency): Don't call symbol_type_set
12168 if the type name is already correct.
12169 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
12170
121712005-03-25 Paul Eggert <eggert@cs.ucla.edu>
12172
12173 * tests/regression.at (Token definitions): Don't use a token named
12174 c, as that generates a "#define c ..." that runs afoul of buggy
12175 stdlib.h that uses the identifier c as a member of struct
12176 drand48_data. Problem reported by Horst Wente.
12177
121782005-03-21 Paul Eggert <eggert@cs.ucla.edu>
12179
12180 * bootstrap: Change translation URL from
12181 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
12182 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
12183 redirection glitches. Problem reported by twlevo@xs4all.nl.
12184
121852005-03-20 Paul Eggert <eggert@cs.ucla.edu>
12186
12187 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
12188 after operands; POSIX says this isn't portable for the c99 command.
12189
121902005-03-18 Paul Eggert <eggert@cs.ucla.edu>
12191
12192 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
12193 immediately if a data overrun has occurred; this may help us track
12194 down what may be a spurious failure on MacOS.
12195
121962005-03-17 Paul Eggert <eggert@cs.ucla.edu>
12197
12198 Respond to problems reported by twlevo@xs4all.nl.
12199
12200 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
12201
12202 * src/vcg.h: Comment fix.
12203 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
12204 (G_CMAX): Change to -1 instead of INT_MAX.
12205
12206 * data/yacc.c (yyparse): Omit spaces before #line.
12207
122082005-03-15 Paul Eggert <eggert@cs.ucla.edu>
12209
12210 * src/tables.c (state_number_to_vector_number): Put it inside an
12211 "#if 0", since it's not currently used. Problem reported by
12212 Roland McGrath.
12213
122142005-03-06 Paul Eggert <eggert@cs.ucla.edu>
12215
12216 * src/output.c (escaped_output): Renamed from
12217 escaped_file_name_output, since we now use it for symbol tags as
12218 well. All uses changed.
12219 (symbol_destructors_output, symbol_printers_output):
12220 Escape symbol tags too.
12221 Problem reported by Matyas Forstner in
12222 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
12223
12224 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
12225 not needed.
12226 * src/output.c (user_actions_output, token_definitions_output,
12227 symbol_destructors_output, symbol_printers_output): Likewise.
12228 * src/reader.c (prologue_augment): Likewise.
12229 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
12230
12231 * src/vcg.c (output_edge): Don't quote linestyle arg.
12232 Problem reported by twlevo@xs4all.nl.
12233
122342005-02-28 Paul Eggert <eggert@cs.ucla.edu>
12235
12236 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
12237 example, reported by Derek M Jones. Also, make the example even
12238 more outrageous, to better illustrate how bad the problem is.
12239
122402005-02-24 Paul Eggert <eggert@cs.ucla.edu>
12241
12242 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
12243 putsym. Typo reported by Sebastian Piping.
12244
122452005-02-23 Paul Eggert <eggert@cs.ucla.edu>
12246
12247 * doc/bison.texinfo (Language and Grammar): some -> same
12248 (Epilogue): int he -> in the
12249 Typos reported by Sebastian Piping via Justin Pence.
12250
122512005-02-07 Paul Eggert <eggert@cs.ucla.edu>
12252
12253 * tests/glr-regression.at (Improper handling of embedded actions
12254 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
12255 embedded actions and $-N in GLR parsers", work around an Autoconf bug
12256 with dollar signs in test names.
12257 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
12258 for a similar reason.
12259
122602005-01-28 Paul Eggert <eggert@cs.ucla.edu>
12261
12262 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
12263 wants to redefine G_VIEW.
12264
122652005-01-27 Paul Eggert <eggert@cs.ucla.edu>
12266
12267 * src/vcg.c (get_view_str): Remove case for normal_view.
12268 Problem reported by twlevo@xs4all.nl.
12269
122702005-01-24 Paul Eggert <eggert@cs.ucla.edu>
12271
12272 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
12273 Problem reported by twlevo@xs4all.nl.
12274
12275 * doc/bison.texinfo: Change @dircategory from "GNU programming
12276 tools" to "Software development". Requested by Richard Stallman
12277 via Karl Berry.
12278
122792005-01-23 Paul Eggert <eggert@cs.ucla.edu>
12280
12281 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
12282 Problem reported by twlevo@xs4all.nl.
12283
122842005-01-21 Paul Eggert <eggert@cs.ucla.edu>
12285
12286 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
12287 keyword; it's not needed with modern compilers, and it doesn't
12288 affect correctness with older compilers. Suggested by
12289 twlevo@xs4all.nl.
12290
122912005-01-17 Paul Eggert <eggert@cs.ucla.edu>
12292
12293 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
12294 gcc -Wswitch-default.
12295 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
12296 * data/yacc.c (yyparse): Likewise.
12297
122982005-01-12 Paul Eggert <eggert@cs.ucla.edu>
12299
12300 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
12301 already. Let config.h define any nonstandard values.
12302
123032005-01-10 Paul Eggert <eggert@cs.ucla.edu>
12304
12305 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
12306 for the benefit of slower hosts. Problem reported by
12307 Nelson H. F. Beebe.
12308
123092005-01-07 Paul Eggert <eggert@cs.ucla.edu>
12310
12311 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
12312 being defined and not used.
12313 * data/lalr1.cc (yyparse): Likewise.
12314 Use "if (false)" rather than "if (0)".
12315
123162005-01-05 Paul Eggert <eggert@cs.ucla.edu>
12317
12318 * TODO: Mention that we should allow NUL bytes in tokens.
12319
123202005-01-02 Paul Eggert <eggert@cs.ucla.edu>
12321
12322 * src/scan-skel.l (<<EOF>>): Don't close standard output.
12323 Problem reported by Hans Aberg.
12324
123252005-01-01 Paul Eggert <eggert@cs.ucla.edu>
12326
12327 * src/getargs.c (version): Happy new year; update overall
12328 program copyright date from 2004 to 2005.
12329
12330 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
12331 Problem reported by Hans Aberg.
12332 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
12333 (Output file names.): Add a test for the case when standard output
12334 is closed.
12335
123362004-12-26 Paul Eggert <eggert@cs.ucla.edu>
12337
12338 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
12339 to fix an oversight in the Bison 2.0 manual.
12340
123412004-12-25 Paul Eggert <eggert@cs.ucla.edu>
12342
12343 * NEWS: Version 2.0. Reformat the existing news items since
12344 1.875, so that related items are grouped together.
12345 * configure.ac (AC_INIT): Bump version to 2.0.
12346 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
12347
12348 * tests/torture.at (Exploding the Stack Size with Alloca): Set
12349 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
12350 otherwise, we're not testing alloca. Unfortunately there's no
12351 simple way to consult HAVE_ALLOCA here.
12352
12353 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
12354 for yymsg, too.
12355
12356 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
12357 hand. This avoids a warning about comparing int to size_t when
12358 GCC warnings are enabled.
12359
123602004-12-22 Paul Eggert <eggert@cs.ucla.edu>
12361
12362 * NEWS: Bison-generated parsers no longer default to using the
12363 alloca function (when available) to extend the parser stack, due
12364 to widespread problems in unchecked stack-overflow detection.
12365 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
12366 responsibility to set it to a positive value. This lets the user
12367 specify a value that is not a preprocessor constant.
12368 * data/yacc.c (YYMAXDEPTH): Likewise.
12369 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
12370 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
12371 to be a compile-time constant. However, explain the constraints on it.
12372 Also, explain the constraints on YYINITDEPTH.
12373 (Table of Symbols): Explain that alloca is no longer the default.
12374 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
12375 to 1.
12376
12377 * doc/bison.texinfo (Location Default Action): Mention that n must
12378 be zero when k is zero. Suggested by Frank Heckenbach.
12379
123802004-12-22 Akim Demaille <akim@epita.fr>
12381
12382 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
12383 (parser::state_type, parser::semantic_type, parser::location_type):
12384 Private, not public.
12385 (parser::parse): Return ints, not bool.
12386 Returning a bool introduces a problem: 0 corresponds to false, and
12387 it seems weird to return false on success. Returning true changes
12388 the conventions for yyparse.
12389 Alternatively we could return void and send an exception.
12390 There is no clear consensus (yet?).
12391 (state_stack, semantic_stack, location_stack): Rename as...
12392 (state_stack_type, semantic_stack_type, location_stack_type): these.
12393 Private, not public.
12394 * tests/c++.at: New.
12395 * tests/testsuite.at, tests/Makefile.am: Adjust.
12396
123972004-12-21 Akim Demaille <akim@epita.fr>
12398
12399 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
12400
124012004-12-21 Akim Demaille <akim@epita.fr>
12402
12403 Don't impose std::string for filenames.
12404
12405 * data/lalr1.cc (b4_filename_type): New.
12406 (position::filename): Use it.
12407 (parser.hh): Move the inclusion of stack.hh and location.hh below
12408 the user code, so that needed headers for the filename type can be
12409 included first.
12410 Forward declare them before the user code.
12411 * tests/Makefile.am (check-local, installcheck-local): Pass
12412 TESTSUITEFLAGS to the TESTSUITE.
12413
124142004-12-20 Akim Demaille <akim@epita.fr>
12415
12416 Use more STL like names: my_class instead of MyClass.
12417
12418 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
12419 (SemanticStack, SemanticType, StateStack, StateType)
12420 (TokenNumberType, Stack, Slice, Traits, Parser::location)
12421 (Parser::value): Rename as...
12422 (location_stack, location_type, rhs_number_type, semantic_stack)
12423 (semantic_type, state_stack, state_type, token_number_type, stack)
12424 (slice, traits, parser::yylloc, parser::yylval): these.
12425
12426 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
12427
124282004-12-19 Paul Eggert <eggert@cs.ucla.edu>
12429
12430 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
12431 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12432
124332004-12-17 Paul Eggert <eggert@cs.ucla.edu>
12434
12435 Remove uses of 'short int' and 'unsigned short int'. This raises
12436 some arbitrary limits. It uses more memory but nowadays that's
12437 not much of an issue.
12438
12439 This change does not affect the generated parsers; that's a different
12440 task, as some users will want to conserve memory there.
12441
12442 Ideally we should use size_t to represent all object counts, and
12443 something like ptrdiff_t to represent signed differences of object
12444 counts; but that will require more code-cleanup than I have the
12445 time to do right now.
12446
12447 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
12448 Use size_t, not int or short int, to count objects.
12449 * src/closure.c (nritemset, closure): Likewise.
12450 * src/closure.h (nritemset, closure): Likewise.
12451 * src/nullable.c (nullable_compute): Likewise.
12452 * src/print.c (print_core): Likewise.
12453 * src/print_graph.c (print_core): Likewise.
12454 * src/state.c (state_compare, state_hash): Likewise.
12455 * src/state.h (struct state): Likewise.
12456 * src/tables.c (default_goto, goto_actions): Likewise.
12457
12458 * src/gram.h (rule_number, rule): Use int, not short int.
12459 * src/output.c (prepare_rules): Likewise.
12460 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
12461 errs, reductions): Likewise.
12462 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
12463 Likewise.
12464 * src/tables.c (vector_number, tally, action_number,
12465 ACTION_NUMBER_MINIMUM): Likewise.
12466 * src/output.c (muscle_insert_short_int_table): Remove.
12467
124682004-12-17 Akim Demaille <akim@epita.fr>
12469
12470 * data/lalr1.cc: Extensive Doxygenation.
12471 (error_): Rename as...
12472 (error): this, since it is visible to the user.
12473 Adjust callers.
12474 (Parser::message): Now an automatic variable from...
12475 (Parser::yyreport_syntax_error_): here.
12476 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
12477 Parser::error.
12478 * tests/input.at: Escape $.
12479
124802004-12-16 Paul Eggert <eggert@cs.ucla.edu>
12481
12482 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
12483 Parenthesize rhs to avoid obscure problems with mistakes like
12484 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
12485 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12486 b4_rhs_location): Likewise.
12487 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
12488 b4_rhs_location): Likewise.
12489
124902004-12-16 Akim Demaille <akim@epita.fr>
12491
12492 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
12493 yacc.c: be sure to stay within yycheck_.
12494 * tests/actions.at: Re-enable C++ tests.
12495
124962004-12-16 Akim Demaille <akim@epita.fr>
12497
12498 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
12499 real.
12500
125012004-12-16 Akim Demaille <akim@epita.fr>
12502
12503 Use #define to handle the %name-prefix.
12504
12505 * data/glr.c, data/yacc.c: Comment changes.
12506 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
12507 so that one can refer to yylex in the parser file, and have it
12508 renamed, as is the case with other skeletons.
12509
125102004-12-16 Akim Demaille <akim@epita.fr>
12511
12512 Move lalr1.cc internals into yy*.
12513
12514 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
12515 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
12516 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
12517 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
12518 (empty_, final_, terror_, errcode_, ntokens_)
12519 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
12520 (looka_, ilooka_, error_range_, nerrs_):
12521 Rename as...
12522 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
12523 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
12524 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
12525 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
12526 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
12527 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
12528 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
12529 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
12530 these.
12531
125322004-12-15 Paul Eggert <eggert@cs.ucla.edu>
12533
12534 Fix some problems reported by twlevo at xs4all.
12535 * src/symtab.c (symbol_new): Report an error if the input grammar
12536 contains too many symbols. This is better than calling abort() later.
12537 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
12538 (struct node, struct graph):
12539 Rename member expand to stretch. All uses changed.
12540 (struct graph): Remove member layoutalgorithm. All uses removed.
12541 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
12542 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
12543 All uses changed.
12544 (N_STRETCH): Rename from N_EXPAND. All uses changed.
12545
125462004-12-15 Akim Demaille <akim@epita.fr>
12547
12548 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
12549 Add more Doxygen comments.
12550 (symprint_, stack_print_, reduce_print_, destruct_, pop)
12551 (report_syntax_error_, translate_): Rename as...
12552 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
12553 (yypop_, yyreport_syntax_error_, yytranslate_): this.
12554
125552004-12-15 Akim Demaille <akim@epita.fr>
12556
12557 * data/lalr1.cc (lex_): Rename as...
12558 (yylex_): this.
12559 Move the trace here.
12560 Take the %name-prefix into account.
12561 Reported by Alexandre Duret-Lutz.
12562
125632004-12-15 Akim Demaille <akim@epita.fr>
12564
12565 Simplify the C++ parser constructor.
12566
12567 * data/lalr1.cc (debug_): Rename as...
12568 (yydebug_): so that the parser's internals are always in the yy*
12569 pseudo namespace.
12570 Adjust uses.
12571 (b4_parse_param_decl): Remove the leading comma as it is now only
12572 called as unique argument list.
12573 (Parser::Parser): Remove the constructor accepting a location and
12574 an initial debugging level.
12575 Remove from the other ctor the argument for the debugging level.
12576 (debug_level_type, debug_level, set_debug_level): New.
12577
12578 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
12579 constructor calls.
12580
125812004-12-15 Akim Demaille <akim@epita.fr>
12582
12583 Remove b4_root related material: failure experiment
12584 (which goal was to allow to derive from a class).
12585
12586 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
12587 definitions and uses.
12588
125892004-12-14 Paul Eggert <eggert@cs.ucla.edu>
12590
12591 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
12592 not 2, since it's not portable to subtract 1 from the start of an
12593 array. The new item 0 is never set or used. All uses changed.
12594
12595 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
12596 the default definition of YYLLOC_DEFAULT. Problem reported
12597 by Frank Heckenbach.
12598
125992004-12-12 Paul Eggert <eggert@cs.ucla.edu>
12600
12601 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
12602 the normal case and one for the error case. Just use the
12603 first one uniformly. Problem reported by Frank Heckenbach.
12604 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
12605 use exactly the same macro in both places.
12606 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
12607 so that the normal-case YYRHSLOC works for the error case too.
12608 All uses changed.
12609 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
12610 (YYLLOC_DEFAULT): Use the same macro as glr.c.
12611 * doc/bison.texinfo (Location Default Action): Don't claim that
12612 we have an array of locations. Use the same macro for both glr
12613 and lalr parsers. Mention YYRHSLOC. Mention what happens when
12614 the index is 0.
12615
126162004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12617
12618 * HACKING: Update email addresses to send announcements to.
12619
12620 * configure.ac (AC_INIT): Bump version to 1.875f.
12621
126222004-12-10 Paul Eggert <eggert@cs.ucla.edu>
12623
12624 * NEWS: Version 1.875e.
12625 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
12626
12627 * src/scan-skel.l: Include "complain.h", for "fatal".
12628
12629 * src/relation.h (relation_print, relation_digraph):
12630 Relation sizes are of type relation_node, not size_t (this is
12631 merely a doc fix, since the two types are equivalent).
12632 (relation_transpose): Relation sizes are of type relation_node,
12633 not int.
12634 * src/relation.c: Likewise.
12635 (top, infinity): Now of type relation_node, not int.
12636 (traverse, relation_transpose): Use relation_node, not int.
12637
12638 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
12639 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
12640 (yyparse): Remove unused local introduced in 2004-10-25 patch.
12641
12642 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
12643 specifying whether the test should be skipped. Use it tp
12644 specify that the [%defines %skeleton "lalr1.cc"] tests currently
12645 fail on some hosts, and should be skipped.
12646
126472004-12-08 Paul Eggert <eggert@cs.ucla.edu>
12648
12649 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
12650 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
12651 unless otherwise specified below.
12652
12653 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
12654 to allocate kernel_base, kernel_items, kernel_size, since
12655 they needn't be initialized to 0.
12656 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
12657 * src/closure.c (new_closure): Likewise, for itemset.
12658 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
12659 * src/lalr.c (set_goto_map): Likewise, for temp_map.
12660 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
12661 (build_relations): Likewise for edge, states1, includes.
12662 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
12663 * src/reader.c (packgram): Likewise, for ritem, rules.
12664 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
12665 * src/relation.c (relation_digraph): Likewise for VERTICES.
12666 (relation_transpose): Likewise for new_R, end_R.
12667 * src/symtab.c (symbols_token_translations_init): Likewise for
12668 token_translations.
12669 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
12670 (token_actions): Likewise for yydefact, actrow, conflrow,
12671 conflict_list.
12672 (save_column): Likewise for froms[symno], tos[symno].
12673 (goto_actions): Likewise for state_count.
12674 (pack_table): Likewise for base, pos, check.
12675 (tables_generate): Likewise for width.
12676
12677 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
12678 for initial core. Just have a separate core, so we needn't worry
12679 about whether kernel_size and kernel_base are initialized.
12680
12681 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
12682 kernel_size, kernel_items): Remove unnecessary initialization.
12683 * src/conflicts.c (conflicts): Likewise.
12684 * src/derives.c (derives): Likewise.
12685 * src/muscle_tablc (muscle_insert): Likewise.
12686 * src/relation.c (relation_digraph): Likewise.
12687 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
12688 conflrow, conflict_table, conflict_list, table, check):
12689 Likewise.
12690
12691 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
12692 This is because all callers pass unsigned int.
12693 * src/closure.h (new_closure): Likewise.
12694
12695 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
12696 (build_relations): Initialize includes[i] in all cases.
12697 * src/reader.c (packgram): Always initialize rules[ruleno].prec
12698 and rules[ruleno].precsym. Initialize members in order.
12699 * src/relation.c (relation_transpose): Always initialize new_R[i]
12700 and end_R[i].
12701 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
12702
12703 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
12704 conflict_list[0] was always 0, but now it isn't initialized.
12705
12706 * src/table.c (table_grow): When conflict_table grew, the grown
12707 area wasn't cleared. Fix this.
12708
12709 * lib/.cvsignore: Add strdup.c, strdup.h.
12710 * m4/.cvsignore: Add strdup.m4.
12711
127122004-12-07 Paul Eggert <eggert@cs.ucla.edu>
12713
12714 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
12715 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
12716 GOTO_NUMBER_MAXIMUM, since we occasionally compute
12717 ngotos + 1 without checking for overflow.
12718 (build_relations): Use END_NODE, not -1, to denote end of edges.
12719 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
12720 build_relations): Use goto_number, not int, for goto numbers.
12721 * src/tables.c (save_column, default_goto): Likewise.
12722
127232004-11-23 Akim Demaille <akim@epita.fr>
12724
12725 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
12726 of #defining from yystype.
12727 Don't typedef yystype, C++ does not need it.
12728 This lets it possible to forward declare it as union.
12729
127302004-11-23 Paul Eggert <eggert@cs.ucla.edu>
12731
12732 * bootstrap (gnulib_modules): Add extensions.
12733 Problem reported by Jim Meyering.
12734
127352004-11-22 Paul Eggert <eggert@cs.ucla.edu>
12736
12737 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
12738 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
12739 src/system.h, src/tables.c: XFREE -> free, to accommodate
12740 recent change to gnulib xalloc.h.
12741 Problem reported by Jim Meyering.
12742
127432004-11-17 Akim Demaille <akim@epita.fr>
12744
12745 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
12746
127472004-11-17 Akim Demaille <akim@epita.fr>,
12748 Alexandre Duret-Lutz <adl@gnu.org>
12749
12750 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
12751 changes.
12752 (YYCDEBUG): Adjust.
12753 Use it instead of cdebug_.
12754 (Parser::debug_stream, Parser::set_debug_stream): New.
12755 (Parser::symprint_): Define cdebug_ for temporary backward
12756 compatibility.
12757 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
12758 debug_stream ().
12759
127602004-11-17 Akim Demaille <akim@epita.fr>
12761
12762 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
12763 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
12764 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
12765 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12766
127672004-10-27 Paul Eggert <eggert@cs.ucla.edu>
12768
12769 * data/glr.c (yyloc_default): Remove; not used.
12770 Problem reported by Frank Heckenbach.
12771
127722004-10-25 Akim Demaille <akim@epita.fr>
12773
12774 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
12775 Introduce another definition to address simple location arrays.
12776 (yyGLRStack): New member: yyerror_range.
12777 (yyrecoverSyntaxError, yyparse): Update it.
12778 (yyrecoverSyntaxError): Use it when shifting the error token to
12779 have an accurate range, equivalent to the one computed by both
12780 yacc.c and lalr1.cc.
12781 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
12782 that column numbers start at column 0, as per GNU Coding
12783 Standards, the others tests, and the doc.
12784 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
12785 Adjust to the above change (first column is 0).
12786 And adjust the location of the "<error>", now covering the whole
12787 line.
12788
127892004-10-22 Akim Demaille <akim@epita.fr>
12790 and Paul Eggert <eggert@cs.ucla.edu>
12791
12792 Remove some arbitrary limits on goto numbers and relations.
12793 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
12794 initial values, since they're never used.
12795 (set_goto_map): ngotos is now unsigned, so test for overflow
12796 by seeing whether it wraps around to zero.
12797 * src/lalr.h (goto_number): Now size_t, not short int.
12798 (GOTO_NUMBER_MAXIMUM): Remove.
12799 * src/relation.c (relation_print, traverse, relation_transpose):
12800 Check for END_NODE rather than looking at sign.
12801 * src/relation.h (END_NODE): New macro.
12802 (relation_node): Now size_t, not short int.
12803
128042004-10-22 Paul Eggert <eggert@cs.ucla.edu>
12805
12806 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
12807 keyword, not an identifier. Problem reported by Baron Schwartz in
12808 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
12809
128102004-10-11 Akim Demaille <akim@epita.fr>
12811
12812 * src/symtab.c (symbol_check_alias_consistency): Also check
12813 type names, destructors, and printers.
12814 Reported by Alexandre Duret-Lutz.
12815 Recode the handling of associativity and precedence in terms
12816 of symbol_precedence_set.
12817 Accept no redeclaration at all, not even equal to the previous
12818 value.
12819 (redeclaration): New.
12820 Use it to factor redeclaration complaints.
12821 (symbol_make_alias): Don't set the type of the alias, let
12822 symbol_check_alias_consistency do it as for other features.
12823 * src/symtab.h (symbol): Add new member prec_location, and
12824 type_location.
12825 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
12826 * tests/input.at (Incompatible Aliases): New.
12827
128282004-10-09 Paul Eggert <eggert@cs.ucla.edu>
12829
12830 .cvsignore fixes to accommodate gnulib changes,
12831 and the practice of naming build directories "_build".
12832 * .cvsignore: Add "_*". Sort.
12833 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
12834 * m4/.cvsignore: Add "*_gl.m4".
12835
128362004-10-06 Akim Demaille <akim@epita.fr>
12837
12838 * src/parse-gram.y (add_param): Fix the truncation of trailing
12839 spaces.
12840
128412004-10-05 Akim Demaille <akim@epita.fr>
12842
12843 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
12844 whether the reducion was empty or not. This leaves room to
12845 improve the use of YYLLOC_DEFAULT in such a case.
12846 lalr1.cc is still experimental, so changing this is acceptable.
12847 And finally, there are probably not many users who changed the
12848 handling of locations in GLR, so changing is admissible too.
12849
12850 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
12851 empty reduction, set @$ to an empty location ending the previously
12852 stacked symbol.
12853 Adjust uses to make sure the code is triggered on empty
12854 reductions.
12855 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
12856 expected output: empty reductions have empty locations.
12857
128582004-09-29 Akim Demaille <akim@epita.fr>
12859
12860 * data/lalr1.cc: Move towards a more standard C++ coding style
12861 for templates: Class < T > -> Class<T>.
12862
128632004-09-29 Akim Demaille <akim@epita.fr>
12864
12865 * data/lalr1.cc: Reinstall the former ctor, for sake of
12866 compatibility, but warn it will be removed.
12867 Move towards a more standard C++ coding style (i.e., type *var ->
12868 type* var).
12869
128702004-09-27 Paul Eggert <eggert@cs.ucla.edu>
12871
12872 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
12873 since it's less likely to work if NULs are involved in the future.
12874
128752004-09-27 Akim Demaille <akim@epita.fr>
12876
12877 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
12878
128792004-09-27 Akim Demaille <akim@epita.fr>
12880
12881 * data/lalr1.cc (b4_parse_param_decl_1): New.
12882 (b4_parse_param_decl): Use it to have different names between attribute
12883 and argument names.
12884 (b4_cc_constructor_call): Likewise.
12885
128862004-09-24 Akim Demaille <akim@epita.fr>
12887
12888 * src/parse-gram.y (add_param): Strip the leading and trailing
12889 blanks from a formal argument declaration.
12890 (YY_LOCATION_PRINT): New.
12891
128922004-09-24 Akim Demaille <akim@epita.fr>
12893
12894 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
12895 after the location.
12896
128972004-09-24 Akim Demaille <akim@epita.fr>
12898
12899 * doc/bison.texinfo (Table of Symbols): Sort.
12900
129012004-09-21 Akim Demaille <akim@epita.fr>
12902
12903 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
12904 the useless parentheses.
12905 Suggested by Paul Eggert.
12906
129072004-09-20 Akim Demaille <akim@epita.fr>
12908
12909 Let the initial-action act on the look-ahead, and use it for the
12910 "initial push" (corresponding to an hypothetical beginning-of-file).
12911 And let lalr1.cc honor %initial-action.
12912
12913 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
12914 example.
12915 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
12916 (Parser::Parser): Remove the ctor that used to initialize it.
12917 (Parser::parse): Like in the other skeletons, issue the "starting
12918 parse" message before any action.
12919 Honor %initial-action.
12920 Initialize the stacks with the lookahead.
12921 * data/yacc.c: Let $$ and @$ in %initial-action designate the
12922 look-ahead.
12923 Push them in the stacks.
12924 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
12925
129262004-09-20 Akim Demaille <akim@epita.fr>
12927
12928 * doc/bison.texinfo (Initial Action Decl): New.
12929
129302004-09-20 Akim Demaille <akim@epita.fr>
12931
12932 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
12933 clearer criterion to define it.
12934 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
12935 When reducing on an empty RHS, use the latest stacked location as
12936 location.
12937 yylloc is not always available.
12938 * data/glr.c: Likewise.
12939 Also, honor initial-actions.
12940
129412004-09-20 Akim Demaille <akim@epita.fr>
12942
12943 * data/yacc.c (YY_LOCATION_PRINT): New.
12944 Define when we know YYLTYPE's structure, i.e., when the default
12945 YYLLOC_DEFAULT is used.
12946 * data/c.m4 (b4_yysymprint_generate): Use it.
12947 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
12948 value of the result.
12949 (error_start_): Replace with...
12950 (error_range_): this location array.
12951 This allows to replace code relying on the implementation of
12952 locations by portable code.
12953 * data/yacc.c (yylerrsp): Replace with...
12954 (yyerror_range): this.
12955 Every time a token is popped, update yyerror_range[0], to have an
12956 accurate location for the error token.
12957 * data/glr.c (YY_LOCATION_PRINT): New.
12958 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
12959 deference a pointer.
12960 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
12961 report the location in %printers.
12962
12963 * src/scan-skel.l: Instead of abort, report error messages to ease
12964 understanding skeleton scanning failures.
12965
129662004-09-16 Akim Demaille <akim@epita.fr>
12967
12968 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
12969 (iterator, const_iterator): these, to be more in the C++ spirit.
12970 Also, return reverse iterators so that when displaying the stack
12971 we display its bottom first.
12972 (Parser::stack_print_, Parser::reduce_print_): Match the messages
12973 from yacc.c.
12974 We should probably use vector here though.
12975
129762004-09-16 Akim Demaille <akim@epita.fr>
12977
12978 Have more complete shift traces.
12979
12980 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
12981 to report Shifts instead of ad hoc YYDPRINTF invocations,
12982 including for the error token.
12983 * data/lalr1.cc (symprint_): Output the location.
12984 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
12985 output the location within the %printer.
12986 Activate GLR tests, at least to make sure they compile properly.
12987 They still don't pass though.
12988 * tests/calc.at: Adjust expect verbose output, since now "Entering
12989 state..." is on a different line than the "Shifting" message.
12990
129912004-09-08 Akim Demaille <akim@epita.fr>
12992
12993 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
12994 Bison directive from the Bison file to the invocation of this
12995 macro, so that these directives are passed to
12996 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
12997 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
12998 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
12999 the extra Bison directives instead of the whole series.
13000 Change the grammar so that there are recoverable errors, and
13001 unrecoverable errors. Now we can have the parser give up before
13002 consuming the whole input. As a result we now can observe that
13003 the lookahead is freed when needed.
13004 Change the parser source to parse argv[1] instead of a hard coded
13005 string.
13006 Simplify yylex, and give a value and location to EOF.
13007 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
13008 passed directives already coded in the file.
13009 Add some tests to check the location of "error".
13010 For some tests, the C++ parser is correct, and not yacc.c.
13011 For other tests, they provide different, but unsatisfying, values,
13012 so keep the C++ value so that at least one parser is "correct"
13013 according to the test suite.
13014 (Actions after errors): Remove, this is subsumed by the
13015 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
13016
130172004-09-06 Akim Demaille <akim@epita.fr>
13018
13019 * data/lalr1.cc: Adjust the indentation of the labels.
13020 (Parser::pop): New.
13021 Use it.
13022
130232004-09-06 Akim Demaille <akim@epita.fr>
13024
13025 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
13026 argument, an informative message.
13027 Call YY_SYMBOL_PRINT.
13028 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
13029 * data/lalr1.cc (destruct_): Likewise.
13030 In addition, no longer depend on b4_yysymprint_generate and
13031 b4_yydestruct_generate to generate these functions, do it "by
13032 hand".
13033
130342004-09-03 Akim Demaille <akim@epita.fr>
13035
13036 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
13037 invoked, yydestruct the lookahead.
13038 * tests/calc.at (Calculator $1): Update the expected lengths of
13039 traces: there is an added line for the discarded lookahead.
13040 * doc/bison.texinfo (Destructor Decl): Some rewording.
13041 Define "discarded" symbols.
13042
130432004-09-02 Akim Demaille <akim@epita.fr>
13044
13045 * data/lalr1.cc (translate_, destruct_): No reason to be static.
13046
130472004-09-02 Akim Demaille <akim@epita.fr>
13048
13049 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
13050 (YYDSYMPRINTF): Rename as...
13051 (YY_SYMBOL_PRINT): this.
13052 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
13053 two.
13054 Use it instead of direct symprint_ calls.
13055 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
13056 one.
13057
130582004-09-02 Akim Demaille <akim@epita.fr>
13059
13060 * data/lalr1.cc (b4_yysymprint_generate): New.
13061 (symprint_): New member function, defined when YYDEBUG.
13062 Use it consistently instead of token/nterm debugging output by
13063 hand.
13064 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
13065 %printer calls to use cdebug_ when using lalr1.cc.
13066
130672004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
13068
13069 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
13070 with #ifdef YYDEBUG.
13071
130722004-08-26 Akim Demaille <akim@epita.fr>
13073
13074 * doc/bison.texinfo (Implementing Loops): Rename as...
13075 (Implementing Gotos/Loops): this.
13076
130772004-08-13 Paul Eggert <eggert@cs.ucla.edu>
13078
13079 Adjust to latest gnulib.
13080 * bootstrap (gnulib_modules): Add xalloc-die.
13081 Set LC_ALL=C so that file names sort consistently.
13082 Prefer the gnulib copies of gettext.m4, glibc21.m4,
13083 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
13084 uintmax_t.m4, ulonglong.m4.
13085 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
13086 po.m4 since we are now using _gl.m4 instead.
13087
130882004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
13089
13090 * src/scan-action.l: Remove. Scanning of semantic actions is
13091 handled in scan-gram.l.
13092
130932004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
13094
13095 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
13096
13097 * src/location.h (struct): The file member is a uniqstr.
13098 (equal_boundaries): Use UNIQSTR_EQ for comparison.
13099
131002004-07-22 Paul Eggert <eggert@cs.ucla.edu>
13101
13102 Fix bug with non-%union parsers that have printers or destructors,
13103 which led to a Bison core dump. Reported by Peter Fales in
13104 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
13105
13106 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
13107 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
13108 not to our own type.
13109 * src/output.c (symbol_destructors_output, symbol_printers_output):
13110 Don't assume %union.
13111 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
13112 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
13113 UNION-FLAG. All callers changed.
13114 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
13115 Use type char, not unsigned int, when declaring an array of char;
13116 this lets us remove a cast.
13117 (Printers and Destructors): Add non-%union test cases.
13118
131192004-06-21 Paul Eggert <eggert@cs.ucla.edu>
13120
13121 * doc/bison.texinfo: Minor editorial changes, mostly to the new
13122 GLR writeups. E.g., avoid frenchspacing and the future tense,
13123 change "lookahead" to "look-ahead", and change "wrt" to "with
13124 respect to".
13125
131262004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
13127
13128 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
13129 New sections, split off from the GLR Parsers section. Put the new
13130 Simple GLR Parser near the start of the GLR section, for clarity.
13131 Rewrite connective text.
13132
131332004-06-21 Frank Heckenbach <frank@g-n-u.de>
13134
13135 * doc/bison.texinfo (Simple GLR Parsers): New section.
13136
131372004-06-21 Paul Eggert <eggert@cs.ucla.edu>
13138
13139 * NEWS, TODO, doc/bison.texinfo:
13140 Use "look-ahead" instead of "lookahead", to be consistent.
13141 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
13142 while we're fixing "look-ahead".
13143 * src/conflicts.c (shift_set): Renamed from shiftset.
13144 (look_ahead_set): Renamed from lookaheadset.
13145 * src/print.c: Likewise.
13146 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
13147 name for "lookahead".
13148 (report_types, usage): Likewise.
13149 * src/getargs.h (report_look_ahead_tokens): Renamed from
13150 report_lookaheads.
13151 * src/lalr.c (compute_look_ahead_tokens): Renamed from
13152 compute_lookaheads.
13153 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
13154 (look_ahead_tokens_print): Renamed from lookaheads_print.
13155 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
13156 state_rule_lookaheads_print.
13157 * src/state.h: Likewise.
13158 (reductions.look_ahead_tokens): Renamed from lookaheads.
13159 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
13160 AT_DATA_LOOKAHEADS_GRAMMAR.
13161
131622004-06-03 Paul Eggert <eggert@cs.ucla.edu>
13163
13164 * README: Update location of patched M4 distribution.
13165
131662004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
13167
13168 Don't assume the C++ compiler takes the same arguments as the C compiler
13169 (trivial change).
13170 * configure.ac (O0CXXFLAGS): New var.
13171 * tests/atlocal.in (CXXFLAGS): Use it.
13172
131732004-05-29 Paul Eggert <eggert@cs.ucla.edu>
13174
13175 Fix some "make check" problems with C++ reported by
13176 Albert Chin-A-Young for Tru64 C++ in this thread:
13177 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
13178
13179 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
13180 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
13181 Output to a .cc file for C++, not to a .c file.
13182 * tests/calc.at (AT_CHECK_CALC): Likewise.
13183 * tests/regression.at (AT_CHECK_DANCER): Likewise.
13184 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
13185
131862004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
13187
13188 * tests/calc.at, tests/actions.at: Workaround for SGI
13189 C++ compiler. (trivial change)
13190
131912004-05-27 Paul Eggert <eggert@cs.ucla.edu>
13192
13193 Spent a few hours checking out which prerequisite versions the
13194 current sources actually require. I went all the way back to
13195 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
13196 a seemingly endless set of combinations of versions more recent
13197 than that. The bottom line is that the current sources require
13198 fairly recent versions of the build tools, and it'll be some work
13199 to change this.
13200 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
13201 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
13202 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
13203 Add comments explaining why those particular versions are
13204 currently needed.
13205
13206 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
13207 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
13208 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
13209
13210 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
13211 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
13212
132132004-05-26 Paul Eggert <eggert@cs.ucla.edu>
13214
13215 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
13216 0.11.5. Suggested by Bruno Haible.
13217 * bootstrap: Remove gettext version checking.
13218
13219 * doc/bison.texinfo (Decl Summary): Also mention that %union
13220 can depend on prerequisite types. Problem reported by Tim
13221 Van Holder.
13222
132232004-05-25 Paul Eggert <eggert@cs.ucla.edu>
13224
13225 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
13226 * README-alpha: Don't tell people not to package this.
13227
13228 * bootstrap: Don't assume $(...) works; use `...` instead.
13229 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
13230 gettext better.
13231
13232 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
13233 put into the -d output file, and mention what to do if YYSTYPE is
13234 defined as a macro.
13235
132362004-05-24 Paul Eggert <eggert@cs.ucla.edu>
13237
13238 Undo change made earlier today: it caused autopoint to not bring
13239 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
13240 autopoint's.
13241
13242 * bootstrap: Check that gettext version matches what's in
13243 configure.ac. Warn users to ignore robots.txt ERROR 404.
13244 * bootstrap: Undo today's earlier change (logged below).
13245 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
13246
13247 The gettext version checking is causing more trouble than it's
13248 curing; remove it. Problem reported by Paul Hilfinger.
13249
13250 * bootstrap: Issue a warning that one can expect a message
13251 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
13252 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
13253
132542004-05-23 Paul Eggert <eggert@cs.ucla.edu>
13255
13256 Ensure that the C++ compiler used for testing actually works on a
13257 simple test program; if not, skip the C++-related tests. Problem
13258 reported by Vin Shelton in:
13259 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
13260
13261 * m4/cxx.m4: New file.
13262 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
13263 * tests/atlocal.in (BISON_CXX_WORKS): Add.
13264 * tests/local.at (AT_COMPILE_CXX): Use it.
13265
132662004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13267
13268 * data/glr.c (yylloc): Output this macro even if locations are not
13269 being generated, as the GLR parser needs it even in that case.
13270 Problem reported by Troy A. Johnson
13271 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
13272
13273 * configure.ac (AC_INIT): Update to 1.875e.
13274
132752004-05-21 Paul Eggert <eggert@cs.ucla.edu>
13276
13277 * NEWS: Version 1.875d.
13278 * configure.ac (AC_INIT): Likewise.
13279 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
13280
13281 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
13282 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
13283 lalr1.cc runs afoul of the first, and the last two are no longer
13284 supported by GCC 3.4.0.
13285 * README: Mention GNU m4 1.4 or later; mention m4 patches.
13286 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
13287
132882004-05-06 Paul Eggert <eggert@cs.ucla.edu>
13289
13290 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
13291 unsigned int, for compatibility with latest gnulib hash module.
13292 * src/state.c (state_hash, state_hasher): Likewise.
13293 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
13294 * src/uniqstr.c (hash_uniqstr): Likewise.
13295
132962004-05-03 Paul Eggert <eggert@cs.ucla.edu>
13297
13298 * NEWS: Unescaped newlines are no longer allowed in char & strings.
13299
13300 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
13301 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
13302 character and string literals.
13303 (unexpected_end): New function.
13304 (unexpected_eof): Use it.
13305 (unexpected_newline): New function.
13306 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
13307 actions.
13308
13309 * NEWS: Document %expect-rr.
13310
13311 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
13312 Fix typo by replacing $1 with $option.
13313 Remove more 'intl'-related files.
13314 Don't DEFUN AM_INTL_SUBDIR twice.
13315
13316 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
13317 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
13318 strtoul.c.
13319 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
13320 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
13321 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
13322 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
13323 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
13324 * src/.cvsignore: Add *.output.
13325
13326 * src/parse-gram.y: Put copyright notice inside %{ %} so it
13327 gets copied to the output file.
13328
133292004-04-28 Paul Eggert <eggert@twinsun.com>
13330
13331 Get files from the gnulib and po repositories, instead of relying
13332 on them being in our CVS. Upgrade to latest versions of gnulib
13333 and Automake.
13334
13335 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
13336 * bootstrap: Bootstrap from gnulib and po repositories.
13337 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
13338 * README-cvs: Document these changes. Remove version numbers from
13339 mentions of build tools, since they change so often. Mention Flex.
13340
13341 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
13342 (gl_USE_SYSTEM_EXTENSIONS): Add.
13343 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
13344 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
13345 does this for us.
13346 (AC_ISC_POSIX): Remove; we no longer support this
13347 ancient OS, as it gets in the way of latest Autoconf & gnulib.
13348 (AC_HEADER_STDC): Remove: we now assume C89 or better.
13349 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
13350 Do not check for C89 headers, except for locale.h which is used
13351 by the Yacc library and must port to K&R hosts.
13352 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
13353 Do not check for C89 functions, except for setlocale which is
13354 used by the Yacc library.
13355 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
13356 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
13357 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
13358 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
13359 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
13360 AM_GNU_GETTEXT): Remove; now done by:
13361 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
13362 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
13363 for us.
13364
13365 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
13366 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
13367 Define to empty, as gnulib.mk will do the rest for us.
13368 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
13369 for us.
13370 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
13371 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
13372
13373 * src/files.c: Include gnulib's xstrndup.h.
13374
13375 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
13376 (REALLOC): Use xnrealloc, for likewise.
13377 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
13378 (strnlen, memrchr): Remove decls; functions no longer used.
13379 Include <stpcpy.h>.
13380
13381 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
13382 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
13383 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
13384 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
13385 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
13386 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
13387 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
13388 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
13389 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
13390 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
13391 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
13392 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13393 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
13394 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
13395 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
13396 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
13397 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
13398 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
13399 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
13400 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
13401 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
13402 Remove, as these files are now generated automatically
13403 by bootstrap or automake.
13404
13405 * po/ChangeLog: Remove: all but one entry was a duplicate
13406 of this file, and I moved that 2000-11-02 entry here.
13407
13408 * config/.cvsignore: Add Makefile, depcomp, install-sh.
13409 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
13410 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
13411 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
13412 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
13413 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
13414 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
13415 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
13416 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
13417 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
13418 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
13419 xstrndup.h.
13420 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
13421 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
13422 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
13423 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
13424 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
13425 * src/.cvsignore: Remove *_.c.
13426
13427
13428 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
13429 support it. (The latest stable gzip doesn't.)
13430
134312004-04-27 Paul Eggert <eggert@twinsun.com>
13432
13433 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
13434 case, as stos_ is now used by destructors due to the 2004-02-09
13435 change.
13436
13437 Remove more K&R C support.
13438 * lib/libiberty.y (PARAMS): Remove. All uses removed.
13439 * lib/subpipe.c (errno): Remove decl.
13440 Include <stdlib.h> unconditionally.
13441 (EXIT_FAILURE): Remove macro.
13442 * src/complain.c (vfprintf, strerror): Remove.
13443 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
13444 unconditionally.
13445 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
13446 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
13447 (strchr, strspn, memchr): Remove decls.
13448 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
13449 unconditionally. Do not declare perror.
13450 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
13451 unconditionally.
13452
13453 * src/complain.c (_): Remove useless defn, as system.h defines this.
13454
13455 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
13456 with latest obstack.h.
13457 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
13458 to procedure types, as obstack.h now does that for us.
13459 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
13460
13461 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
13462 so that this include file can stand alone.
13463 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
13464 does this now. Include subpipe.h first after config.h, to
13465 test whether it can stand alone.
13466
13467 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
13468 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
13469 unused declaration.
13470
13471 * tests/synclines.at (%union synch line): Put a dummy member in
13472 the union, because empty unions aren't allowed in C. Caught
13473 by GCC 3.4.0.
13474
134752004-04-13 Jim Meyering <jim@meyering.net>
13476
13477 * src/conflicts.c (conflicts_print): Correct format string typo:
13478 use `%%' to produce literal `%'. (trivial change)
13479
134802004-03-30 Paul Eggert <eggert@twinsun.com>
13481
13482 * src/getargs.c (version): Update copyright year to 2004.
13483
13484 * data/c.m4 (b4_int_type): Use 'short int' rather than
13485 'short', and similarly for 'long', 'unsigned', etc.
13486 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
13487 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
13488 yy_yypstack, yydumpstack): Likewise.
13489 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
13490 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
13491 Likewise.
13492 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
13493 yy_stack_print, yyparse): Likewise.
13494 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
13495 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
13496 * lib/bitset.c (bitset_print): Likewise.
13497 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
13498 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
13499 * lib/bitsetv.c (bitsetv_dump): Likewise.
13500 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
13501 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
13502 Likewise.
13503 * src/LR0.c (allocate_itemsets): Likewise.
13504 * src/gram.h (rule_number, rule): Likewise.
13505 * src/lalr.h (goto_number): Likewise.
13506 * src/nullable.c (nullable_compute): Likewise.
13507 * src/output.c (prepare_rules): Likewise.
13508 * src/relation.c (relation_print, relation_digraph): Likewise.
13509 * src/relation.h (relation_node): Likewise.
13510 * src/state.h (state_number, transitions, errs, reductions,
13511 struct state): Likewise.
13512 * src/symtab.h (symbol_number, struct symbol): Likewise.
13513 * src/tables.c (vector_number, tally, action_number,
13514 default_goto, goto_actions): Likewise.
13515 * tests/existing.at (GNU Cim Grammar): Likewise.
13516 * tests/regression.at (Web2c Actions): Likewise.
13517
13518 * src/output.c (muscle_insert_short_int_table): Renamed from
13519 muscle_insert_short_table. All uses changed.
13520
135212004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
13522
13523 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
13524 (declaration): Replace expected_conflicts with expected_sr_conflicts.
13525 Add %expect-rr rule.
13526
13527 * src/scan-gram.l: Recognize %expect-rr.
13528
13529 * src/conflicts.h (expected_sr_conflicts): Rename from
13530 expected_conflicts.
13531 (expected_rr_conflicts): Declare.
13532
13533 * src/conflicts.c (expected_sr_conflicts): Rename from
13534 expected_conflicts.
13535 (expected_rr_conflicts): Define.
13536 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
13537 for GLR parsers.
13538 Use expected_sr_conflicts in place of expected_conflicts.
13539 Warn if expected_rr_conflicts used in non-GLR parser.
13540
13541 * doc/bison.texinfo: Add documentation for %expect-rr.
13542
135432004-03-08 Paul Eggert <eggert@gnu.org>
13544
13545 Add support for hex token numbers. Suggested by Odd Arild Olsen in
13546 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
13547
13548 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
13549 in lalr1.cc.
13550 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
13551 * src/scan-gram.l (scan_integer): New function.
13552 ({int}): Use it.
13553 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
13554 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
13555 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
13556 Say "long int", not "long", for uniformity with GNU style.
13557
135582004-02-25 Paul Eggert <eggert@twinsun.com>
13559
13560 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
13561 compilers. This fixes a problem with Intel's C++ compiler being
13562 chatty, reported by Guido Trentalancia in
13563 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
13564
135652004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
13566
13567 Support %destructor and merge error locations in lalr1.cc.
13568
13569 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
13570 (Parser::stos_): Define unconditionally.
13571 (Parser::destruct_): New method. Generate its body with
13572 b4_yydestruct_generate.
13573 (Parser::error_start_): New attribute.
13574 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
13575 token which are discarded.
13576 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
13577 error_start_ when erroneous token are discarded.
13578 (Parser::parse) <yyerrlab1>: Compute the location of the error
13579 token so that it covers all the discarded tokens.
13580 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
13581 it can be called with `%skeleton "lalr1.cc"', and do that.
13582
135832004-02-02 Paul Eggert <eggert@twinsun.com>
13584
13585 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
13586 $(top_srcdir)/lib and ../lib. This fixes a bug reported
13587 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
13588 There's no need to mention top_builddir since Automake does that
13589 for us.
13590 (INCLUDES): Remove, as Automake says it's obsolescent.
13591 Contents migrated into AM_CPPFLAGS as described above.
13592 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
13593
135942004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
13595
13596 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
13597 (yyreportSyntaxError): Handle case where lookahead token is
13598 YYEMPTY.
13599
136002004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13601
13602 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
13603 resulting parsers are compilable with C++.
13604
136052003-12-23 Paul Eggert <eggert@twinsun.com>
13606
13607 * config/depcomp, config/install-sh: Sync with Automake 1.8.
13608 * src/output.c (output_skeleton): Rename local var.
13609 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
13610 Bison tokens, as this runs afoul of the 2003-10-07 change that
13611 disallowed NUL bytes in character constants or string literals.
13612
13613 * tests/local.at: Require Autoconf 2.59's Autotest.
13614 * tests/testsuite.at: Don't include local.at, since we now assume
13615 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
13616 including it.
13617 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
13618 multiple inclusion warnings.
13619
136202003-12-02 Akim Demaille <akim@epita.fr>
13621
13622 * doc/bison.texinfo (How Can I Reset the Parser): More about start
13623 conditions.
13624 From Bruno Haible.
13625
136262003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
13627
13628 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
13629
136302003-10-07 Paul Eggert <eggert@twinsun.com>
13631
13632 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
13633 if testsuite doesn't exist.
13634
13635 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
13636 literals, unfortunately.
13637 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
13638 Complain about NUL bytes in character constants or string literals.
13639
136402003-10-05 Paul Eggert <eggert@twinsun.com>
13641
13642 * NEWS: Don't document %no-default-prec, as it's still
13643 too experimental.
13644 * doc/bison.texinfo: Document %no-default-prec only if
13645 the defaultprec flag is set. Normally it's not.
13646
136472003-10-04 Paul Eggert <eggert@twinsun.com>
13648
13649 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
13650 non-modifiable lvalue, instead of a modifiable one.
13651 * doc/bison.texinfo (Actions): Document that $$ can
13652 be assigned to. Do not claim that $$ and $N are
13653 array element references: user code should not rely on this.
13654
136552003-10-01 Paul Eggert <eggert@twinsun.com>
13656
13657 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
13658 (grammar_declaration): Use it.
13659 * src/scan-gram.l: New token %no-default-prec.
13660 * tests/conflicts.at: Revamp tests to use %no-default-prec.
13661 * NEWS, doc/bison.texinfo: Document the above.
13662
136632003-10-01 Akim Demaille <akim@epita.fr>
13664
13665 VCG no longer supports long_straight_phase.
13666
13667 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
13668 * src/print_graph.c (print_graph): Adjust.
13669
136702003-09-30 Frank Heckenbach <frank@g-n-u.de>
13671 and Paul Eggert <eggert@twinsun.com>
13672
13673 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
13674 Table of Symbols): Document %default-prec.
13675 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
13676 (grammar_declaration): Set default_prec on %default-prec.
13677 * src/scan-gram.l (%default-prec): New token.
13678 * src/reader.h (default_prec): New flag.
13679 * src/reader.c: Likewise.
13680 (packgram): Handle it.
13681 * tests/conflicts.at (%default-prec without %prec,
13682 %default-prec with %prec, %default-prec 1): New tests.
13683
136842003-09-30 Paul Eggert <eggert@twinsun.com>
13685
13686 * tests/testsuite.at: Include local.at, not input.at, fixing
13687 a typo in the 2003-08-25 patch.
13688
136892003-08-27 Akim Demaille <akim@epita.fr>
13690
13691 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
13692 GCC warnings.
13693
136942003-08-26 Akim Demaille <akim@epita.fr>
13695
13696 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
13697 "<\#" to avoid magic from Gnus when posting parts of this script.
13698
136992003-08-26 Akim Demaille <akim@epita.fr>
13700
13701 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
13702 (Parser::parse): here.
13703 Adjust: nerrs and errstatus is now replaced by...
13704 (Parser::nerrs_, Parser::errstatus_): New.
13705
137062003-08-25 Akim Demaille <akim@epita.fr>
13707
13708 * config/announce-gen, Makefile.cfg: New.
13709 * Makefile.am: Adjust.
13710 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
13711 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
13712
137132003-08-25 Akim Demaille <akim@epita.fr>
13714
13715 When reducing initial empty rules, Bison parser read an initial
13716 location that is not defined. This results in garbage, and that
13717 affects Bison's own parser. Therefore we need (i) to extend Bison
13718 to support a means to initialize this location, and (ii) to use
13719 this CVS Bison to fix CVS Bison's parser.
13720
13721 * src/reader.h, reader.c (epilogue_augment): Remove, replace
13722 with...
13723 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
13724 * src/parse-gram.y: Adjust.
13725 (%initial-action): New.
13726 (%error-verbose): Since we require CVS Bison, there is no reason
13727 not to use it.
13728 * src/scan-gram.l: Adjust.
13729 * src/Makefile.am (YACC): New, to make sure we use our own parser.
13730 * data/yacc.c (yyparse): Use b4_initial_action.
13731
137322003-08-25 Akim Demaille <akim@epita.fr>
13733
13734 * doc/bison.texinfo: Don't promote stdout for error messages.
13735
137362003-08-25 Akim Demaille <akim@epita.fr>
13737
13738 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
13739 From Alexandre Duret-Lutz.
13740
137412003-08-25 Akim Demaille <akim@epita.fr>
13742
13743 Version 1.875c.
13744
137452003-08-25 Akim Demaille <akim@epita.fr>
13746
13747 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
13748 Use them.
13749
137502003-08-25 Akim Demaille <akim@epita.fr>
13751
13752 * data/lalr1.cc (Parser::reduce_print_): New.
13753 Use it.
13754
137552003-08-25 Akim Demaille <akim@epita.fr>
13756
13757 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
13758 error recovery loops. This patch is based on
13759 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
13760 Also, augment the similarity between lalr1.cc and yacc.c.
13761 Note: the locations of error recovery rules are not correct yet.
13762
13763 * data/lalr1.cc: Comment changes to augment the similarity between
13764 lalr1.cc and yacc.c.
13765 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
13766 (yyerrlab1): Remove, but where it used to be (now the bottom part of
13767 yyerrlab), when hitting EOF, pop the whole stack here instead of
13768 merely falling thru the default error handling mechanism.
13769 (yyerrorlab): New label, with the old contents of YYERROR,
13770 plus the following change: pop the stack of rhs corresponding
13771 to the production that invoked YYERROR. That is how Yacc
13772 behaves (required by POSIX).
13773 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
13774 fail.
13775
137762003-08-25 Akim Demaille <akim@epita.fr>
13777
13778 Tune local.at so that people can "autom4te -l autotest calc.at -o
13779 calc" for instance, to extract a sub test suite.
13780
13781 * tests/testsuite.at: Move the initialization, Autotest version
13782 requirement, and AT_TESTED invocation into...
13783 * tests/local.at: here.
13784 * tests/testsuite.at: Include it for compatibility with Autoconf
13785 2.57.
13786 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
13787 be ignore.
13788
137892003-08-04 Paul Eggert <eggert@twinsun.com>
13790
13791 Rework code slightly to avoid gcc -Wtraditional warnings.
13792 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
13793 The returned value is now stored in *YY0. All callers changed.
13794 * src/output.c (merge_output): Adjust to the above change.
13795
137962003-07-26 Paul Eggert <eggert@twinsun.com>
13797
13798 * data/glr.c (YYASSERT): New macro.
13799 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
13800 yyresolveStates, yyprocessOneStack):
13801 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
13802 Derived from a suggestion by Frank Heckenbach.
13803
138042003-07-25 Paul Eggert <eggert@twinsun.com>
13805
13806 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
13807 for portability to K&R C (after ansi2knr, presumably). See
13808 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
13809 by Frank Heckenbach, though I have omitted the structure-initialization
13810 part of his glr-knr.diff patch since I recall that the Portable
13811 C Compiler didn't require that change.
13812
13813 Let the user specify how to allocate and free memory.
13814 Derived from a suggestion by Frank Heckenbach in
13815 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
13816 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
13817 All uses of free, malloc, realloc changed to use these macros,
13818 and unnecessary casts removed.
13819 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
13820
138212003-07-06 Matthias Mann <MatthiasMann@gmx.de>
13822
13823 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
13824 use s.empty() rather than s == "" to test for empty string; see
13825 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
13826 (trivial change)
13827
138282003-06-25 Akim Demaille <akim@epita.fr>
13829
13830 * config/depcomp, config/install-sh: Update from masters.
13831
138322003-06-20 Paul Eggert <eggert@twinsun.com>
13833
13834 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
13835 and return properly parenthesized result.
13836 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
13837 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
13838 Remove unnecessary parentheses from uses.
13839 * doc/bison.texinfo (Location Default Action): Describe the
13840 conventions for parentheses.
13841
138422003-06-19 Paul Eggert <eggert@twinsun.com>
13843
13844 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
13845 yyreportTree): Do not assume that size_t is the same width as int,
13846 when printing sizes. Print sizes using an unsigned format.
13847 Problem reported by Frank Heckenbach in
13848 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
13849
13850 Port to Forte Developer 7 C compiler.
13851 * data/glr.c (struct YYLTYPE): If locations are not being used,
13852 declare a single dummy member, as empty structs do not conform
13853 to the C standard.
13854 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
13855 the Forte Developer 7 C compiler complains that end-of-loop
13856 code is not reached.
13857
138582003-06-17 Paul Eggert <eggert@twinsun.com>
13859
13860 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
13861 avoid warnings from picky compilers about redefinition of PARAMS.
13862
138632003-06-17 Paul Eggert <eggert@twinsun.com>
13864
13865 Version 1.875b.
13866
13867 * NEWS: Document 1.875b.
13868
13869 * lib/bbitset.h: Do not include config.h; that's the includer's job.
13870 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
13871 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
13872 Don't use 'index' in comments, as it's a builtin fn on some hosts.
13873 * lib/bitset_stats.c: Include gettext.h unconditionally, as
13874 per recent gettext manual's suggestion.
13875 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
13876 Use prototypes, not old-style definitions.
13877 * lib/lbitset.c (lbitset_unused_clear): Likewise.
13878 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
13879 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
13880 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
13881 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
13882 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
13883 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
13884 vbitset_or_and_cmp, vbitset_copy): Likewise.
13885
13886 * lib/libiberty.h: Do not include config.h; that's the includer's job.
13887 Do not include <stdlib.h>.
13888 (PARAMS): Define unconditionally for C89.
13889 (ATTRIBUTE_NORETURN): Remove.
13890 (ATTRIBUTE_UNUSED): Define unconditionally.
13891
13892 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
13893 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
13894 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
13895 * lib/vbitset.c, lib/vbitset.h: New files.
13896 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13897 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
13898 from libbitset.
13899
13900 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
13901 `How Can I Reset @code{yyparse}', since texinfo does not allow
13902 arbitrary @ in node names.
13903
13904 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
13905 shouldn't be needed according to the gettext 0.12.1 documentation
13906 but which seem to be needed anyway: codeset.m4 glibc21.m4
13907 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
13908 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
13909 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
13910
13911 * lib/.cvsignore: Add stdbool.h.
13912 * m4/.cvsignore: Add nls.m4, po.m4.
13913
13914 Upgrade to CVS gnulib.
13915 * stdbool_.h: File renamed from stdbool.h.in.
13916 * configure.ac (AM_STDBOOL_H): Invoke this instead of
13917 AC_HEADER_STDBOOL.
13918 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
13919 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
13920 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
13921 (MOSTLYCLEANFILES): New var.
13922 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
13923 (stdbool.h): New rule.
13924 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
13925 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
13926 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
13927 m4/quote.m4: Upgrade to today's gnulib.
13928
13929 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
13930 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
13931 the tests right now.
13932 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
13933 yyerror are declared before use; C99 requires this.
13934
139352003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13936
13937 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
13938 first.
13939 (yyrecoverSyntaxError): Correct the logic for setting and testing
13940 yyerrState.
13941 Correct comment on handling EOF.
13942 Allow states with only a default reduction, rather than failing
13943 (I can't quite reconstruct why these were not allowed before).
13944
13945 Fixes to avoid problem that $-N rules in GLR parsers can cause
13946 buffer overruns, corrupting state.
13947
13948 * src/output.c (prepare_rules): Output max_left_semantic_context
13949 definition.
13950 * src/reader.h (max_left_semantic_context): New variable declaration.
13951 * src/scan-gram.l (max_left_semantic_context): Define.
13952 (handle_action_dollar): Update max_left_semantic_context.
13953 * data/glr.c (YYMAXLEFT): New definition.
13954 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
13955 (yyresolveAction): Ditto.
13956
13957 Fixes to problems with location handling in GLR parsers reported by
13958 Frank Heckenbach (2003/06/05).
13959
13960 * data/glr.c (YYLTYPE): Make trivial if locations not used.
13961 (YYRHSLOC): Add parentheses, and define only if locations used.
13962 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
13963 locations not used.
13964 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
13965 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
13966
13967 * tests/cxx-type.at: Exercise location information; update tests
13968 to differentiate output with and without locations.
13969 Remove forward declarations of yylex and yyerror---caused errors
13970 because default YYLTYPE not yet defined.
13971 Change semantic actions to compute strings, rather than printing
13972 them directly (to test proper passing of semantics values). Change
13973 output to prefix notation and update test data and expected results.
13974 (yylex): Track locations.
13975 (stmtMerge): Return value rather than printing, and include arguments
13976 in value.
13977
139782003-06-03 Paul Eggert <eggert@twinsun.com>
13979
13980 Avoid warnings generated by GCC 2.95.4 when Bison is
13981 configured with --enable-gcc-warnings.
13982 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
13983 yy::]b4_parser_class_name[::translate_,
13984 yy::Stack::operator[] (unsigned),
13985 yy::Stack::operator[] (unsigned) const,
13986 yy::Slice::operator[] (unsigned),
13987 yy::Slice::operator[] (unsigned) const):
13988 Rename local vars to avoid warnings.
13989 * tests/glr-regression.at (Improper handling of embedded actions
13990 and $-N in GLR parsers): Remove unused local variable from yylex.
13991 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
13992 (void) as arg when not pure, since we now assume C89 when building
13993 Bison. Pacify GCC by using parameter.
13994
139952003-06-02 Paul Eggert <eggert@twinsun.com>
13996
13997 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
13998 yy::Location::lines, yy::Location::columns): Rename arguments
13999 to avoid shadowing; this removes a warning generated by GCC 3.3.
14000
140012003-06-01 Paul Eggert <eggert@twinsun.com>
14002
14003 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
14004 to g++, as GCC 3.3 complains if you do it.
14005 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
14006 everything that WARNING_CFLAGS has, except omit warnings
14007 not suitable for C++.
14008 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
14009 * tests/atlocal.in (CXXFLAGS): New var.
14010 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
14011
14012 Fix a GLR parser bug I reported in February; see
14013 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
14014 The problem was that GLR parsers did not conform to the C standard,
14015 because actions like { $1 = $2 + $3; } expanded to expressions
14016 that invoked YYFILL in separate subexpressions, and YYFILL assigned
14017 to a local variable. The C standard says that expressions
14018 like (var = f ()) + (var = f ()) have undefined behavior.
14019 Another problem was that GCC sometimes issues warnings that
14020 yyfill and its parameters are unused.
14021
14022 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
14023 as possibly unused.
14024 (yyfill): New function.
14025 (YYFILL): Use it.
14026 (yyuserAction): Change type of yynormal to bool, so that it matches
14027 the new yyfill signature. Mark it as possibly unused.
14028
14029
14030 Follow up on a bug I reported in February, where a Bison-generated
14031 parser can loop. Provide a test case and a fix for yacc.c. I
14032 don't have a fix for lalr1.cc or for glr.c, unfortunately.
14033 The original bug report is in:
14034 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
14035
14036 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
14037 macro's size was becoming unwieldy.
14038 (yyerrlab): Do not discard an empty lookahead symbol, as this
14039 might destroy garbage.
14040 (yyerrorlab): New label, with the old contents of YYERROR,
14041 plus the following change: pop the stack of rhs corresponding
14042 to the production that invoked YYERROR. That is how Yacc
14043 behaves, and POSIX requires this behavior.
14044 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
14045 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
14046 Define 'alarm' to do nothing if unistd.h is not available.
14047 Add a new rule "exp: '-' error;" to test the above change to
14048 data/yacc.c. Use 'alarm' to abort any test taking longer than
14049 10 seconds, as it's probably looping.
14050 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
14051 Also, the new yacc.c generates two fewer diagnostics for an
14052 existing test.
14053
140542003-05-24 Paul Eggert <eggert@twinsun.com>
14055
14056 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
14057 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
14058 This fixes a problem reported by John Bowman when the Compaq/HP
14059 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
14060 -ansi -Wall -gall).
14061 * data/yacc.c (union yyalloc): Likewise.
14062 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
14063
14064 Switch from 'int' to 'bool' where that makes sense.
14065
14066 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
14067 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
14068 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
14069 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
14070 Return or accept bool, not int. All callers changed.
14071 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
14072 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
14073 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
14074 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
14075 bitset_or_and_cmp_): Likewise.
14076 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
14077 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
14078 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
14079 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
14080 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
14081 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
14082 bitset_stats_or_and_cmp): Likewise.
14083 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
14084 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
14085 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
14086 ebitset_xor_cmp): Likewise.
14087 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
14088 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
14089 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
14090 lbitset_xor_cmp): Likewise.
14091 * lib/bbitset.h: Include <stdbool.h>.
14092 (struct bitset_vtable): The following members now return bool, not
14093 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
14094 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
14095 or_and_cmp).
14096 * src/conflicts.c (count_rr_conflicts): Likewise.
14097 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
14098 All uses changed.
14099 * lib/ebitset.c (ebitset_obstack_init): Likewise.
14100 * lib/lbitset.c (lbitset_obstack_init): Likewise.
14101 * src/getargs.c (debug_flag, defines_flag, locations_flag,
14102 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
14103 graph_flag): Likewise.
14104 * src/getargs.h (debug_flag, defines_flag, locations_flag,
14105 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
14106 graph_flag): Likewise.
14107 * src/output.c (error_verbose): Likewise.
14108 * src/output.h (error_verbose): Likewise.
14109 * src/reader.c (start_flag, typed): Likewise.
14110 * src/reader.h (typed): Likewise.
14111 * src/getargs.c (LOCATIONS_OPTION): New constant.
14112 (long_options, getargs): Use it.
14113 * src/lalr.c (build_relations): Use bool, not int.
14114 * src/nullable.c (nullable_compute): Likewise.
14115 * src/print.c (print_reductions): Likewise.
14116 * src/tables.c (action_row, pack_vector): Likewise.
14117 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
14118 * src/output.c (prepare): Use it.
14119 * src/output.c (token_definitions_output,
14120 symbol_destructors_output, symbol_destructors_output): Use string,
14121 not boolean integer, to keep track of whether to output separator.
14122 * src/print_graph.c (print_core): Likewise.
14123 * src/state.c (state_rule_lookaheads_print): Likewise.
14124
14125 * config/install-sh: Sync from automake 1.7.5.
14126
141272003-05-14 Paul Eggert <eggert@twinsun.com>
14128
14129 * src/parse-gram.y (rules_or_grammar_declaration): Require a
14130 semicolon after a grammar declaration, in the interest of possible
14131 future changes to the Bison input language.
14132 Do not allow a stray semicolon at the start of the grammar.
14133 (rhses.1): Allow one or more semicolons after any rule, including
14134 just before "|" as required by POSIX.
14135 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
14136 grammar.
14137
141382003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
14139
14140 %parse-param support for lalr1.cc.
14141
14142 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
14143 b4_cc_constructor_calls, b4_cc_constructor_call,
14144 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
14145 definitions.
14146 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
14147 parse-param arguments.
14148 (yy::b4_parser_class_name): Declare instance variables to
14149 hold parse-param arguments.
14150 * tests/calc.at: s/value/semantic_value/ because value clashes
14151 with a member of yy::b4_parser_class_name. Adjust C++ code
14152 to handle %parse-param. Enable %parse-param test in C++.
14153
141542003-05-12 Paul Eggert <eggert@twinsun.com>
14155
14156 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
14157 English a bit. Fix fclose typo. Change "const char" to "char
14158 const", and use ANSI C rather than K&R for "main". Suggest
14159 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
14160 and suggest yy_switch_to_buffer.
14161
141622003-05-05 Paul Eggert <eggert@twinsun.com>
14163
14164 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
14165 C89. This avoids a diagnostic on compilers that define __STDC__
14166 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
14167 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
14168
141692003-05-03 Paul Eggert <eggert@twinsun.com>
14170
14171 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
14172 Do not overrun array bounds.
14173 This should fix a bug reported today by Olatunji Oluwabukunmi in
14174 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
14175
141762003-04-29 Akim Demaille <akim@epita.fr>
14177
14178 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
14179 * src/getargs.c, src/getargs.h: here, as bool, not int.
14180 (nondeterministic_parser): New.
14181 * src/parse-gram.y, src/scan-gram.l: Support
14182 %nondeterministic-parser.
14183 * src/output.c (prepare): Use nondeterministic_parser instead
14184 of glr_parser where appropriate.
14185 * src/tables.c (conflict_row, action_row, save_row)
14186 (token_actions, token_actions, pack_vector): Ditto.
14187
141882003-04-29 Akim Demaille <akim@epita.fr>
14189
14190 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
14191
141922003-04-29 Akim Demaille <akim@epita.fr>
14193
14194 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
14195 with %pure-parser and %locations to exercise the patch from Yakov
14196 Markovitch below.
14197
141982003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
14199
14200 * data/yacc.c: (b4_lex_param): Corrected for the case where
14201 %lex-param is provided and %pure-parser isn't.
14202
142032003-04-27 Paul Eggert <eggert@twinsun.com>
14204
14205 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
14206 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
14207 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
14208 if it is not defined.
14209 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
14210
142112003-04-26 Paul Eggert <eggert@twinsun.com>
14212
14213 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
14214 Declare to be of type suitable for the ninf value itself, not of
14215 type suitable for the corresponding table, since the latter might
14216 be unsigned but the ninf value might be negative. This fixes a
14217 bug reported by Alexandre Duret-Lutz in
14218 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
14219
14220 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
14221 invokes it. We shouldn't invoke it twice because it will attempt
14222 to put error.o in the archive twice. This fixes a glitch reported
14223 by Martin Mokrejs in
14224 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
14225
142262003-04-21 Paul Eggert <eggert@twinsun.com>
14227
14228 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
14229 to gnulib.
14230
142312003-04-21 Yakov Markovitch <Markovitch@iso.ru>
14232
14233 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
14234 Fix obvious typo that results in uncompilable GLR parsers
14235 when both %pure-parser and %locations are used. (trivial change)
14236
142372003-04-17 Paul Eggert <eggert@twinsun.com>
14238
14239 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
14240 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
14241 Do not insert the expected token via unput, as this runs afoul
14242 of a POSIX-compatibility bug in flex 2.5.31.
14243 All uses changed to BEGIN the parent state,
14244 since we no longer insert the expected token via unput.
14245 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
14246 that is no longer emitted after the above change.
14247
14248 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
14249 the first one. This change is from Paul Hilfinger, and it fixes
14250 regression reported by Werner Lemberg in
14251 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
14252
14253 (resolve_sr_conflict): Don't invoke state_errs_set
14254 unless one or more tokens have been explicitly made errors.
14255 Otherwise, the above change causes Bison to abort.
14256
14257 * tests/existing.at (GNU pic Grammar): New test case, taken from
14258 Lemberg's email.
14259
142602003-03-31 Akim Demaille <akim@epita.fr>
14261
14262 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
14263
142642003-03-31 Akim Demaille <akim@epita.fr>
14265
14266 * src/output.c (prepare_symbols): Avoid trailing spaces in the
14267 output.
14268
142692003-03-31 Akim Demaille <akim@epita.fr>
14270
14271 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
14272 From Paul Hilfinger.
14273
142742003-03-29 Akim Demaille <akim@epita.fr>
14275
14276 * m4/error.m4: Do not put under dynamic conditions some code which
14277 expansion is under static control.
14278
142792003-03-29 Akim Demaille <akim@epita.fr>
14280
14281 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
14282
142832003-03-29 Akim Demaille <akim@epita.fr>
14284
14285 * doc/bison.texinfo (Strings are Destroyed): New.
14286
142872003-03-13 Paul Eggert <eggert@twinsun.com>
14288
14289 * .cvsignore: Add configure.lineno.
14290 * src/.cvsignore: Add yacc.
14291 * tests/.cvsignore: Add testsuite.log.
14292 * doc/fdl.texi: Sync with latest FSF version.
14293
142942003-03-12 Paul Eggert <eggert@twinsun.com>
14295
14296 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
14297 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
14298 cursor, instead of leaving it undefined. This fixes a bug
14299 reported by Tim Van Holder in
14300 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
14301 * tests/input.at (Torturing the Scanner): Test the scanner on
14302 an empty input file, which was Tim Van Holder's test case.
14303
14304 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
14305 <sys/resource.h> can be included, include sys/time.h and
14306 sys/times.h first, if available. This works around the SunOS
14307 4.1.4 porting bug reported by Bruce Becker in
14308 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
14309
14310 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
14311 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
14312 AC_HEADER_SYS_WAIT.
14313
14314 Merge changes from gnulib. This was prompted because the CVS
14315 snapshot didn't build on Solaris 7 due to strnlen problems.
14316
14317 These changes need to be merged back into gnulib:
14318 * lib/hash.c: Include <stdbool.h> unconditionally.
14319 * m4/onceonly.m4 (m4_quote): New macro.
14320 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
14321 Quote AC_FOREACH variable-expansions properly.
14322 The 2003-01-03 obstack.h change also needs merging.
14323 {end of changes requiring merging}
14324
14325 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
14326 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
14327 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
14328 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
14329 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
14330 New files, imported from gnulib.
14331 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
14332 above.
14333
14334 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
14335 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
14336 gnulib sources.
14337
14338 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
14339 Add.
14340 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
14341 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
14342 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
14343 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
14344 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
14345 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
14346 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
14347 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
14348 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
14349 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
14350 (jm_PREREQ_ARGMATCH): Remove.
14351 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
14352 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
14353
14354 * src/system.h: Include <stdbool.h> unconditionally.
14355
14356 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
14357 assuming at least C89 in the bitset code for some time now.
14358
143592003-03-03 Akim Demaille <akim@epita.fr>
14360
14361 * ro.po: New.
14362
143632003-03-02 Akim Demaille <akim@epita.fr>
14364
14365 * doc/bison.texinfo (Table of Symbols): Reactivate the
14366 documentation for %lex-param, and %parse-param.
14367
143682003-03-02 Akim Demaille <akim@epita.fr>
14369
14370 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
14371 generate verbose error messages.
14372 Use the number of tokens as an upper bound in yytname, as it
14373 cannot be a non terminal.
14374
143752003-03-02 Akim Demaille <akim@epita.fr>
14376
14377 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
14378 message.
14379
143802003-03-02 Akim Demaille <akim@epita.fr>
14381
14382 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
14383 Use them to exercise yycheck overrun.
14384 Based on Andrew Suffield's grammar.
14385
143862003-03-02 Akim Demaille <akim@epita.fr>
14387
14388 Create tests/local.at for Bison generic testing macros.
14389
14390 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
14391 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
14392 This new file.
14393 * tests/calc.at (AT_CHECK_CALC): Adjust.
14394 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
14395 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
14396 * tests/local.at: here.
14397 (AT_COMPILE_CXX): Tags the tests using it as c++.
14398 Ignore the test if CXX is not functional.
14399
144002003-03-01 Paul Eggert <eggert@twinsun.com>
14401
14402 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
14403 not loc->end, since loc->end might contain garbage and this leads
14404 to undefined behavior on some platforms.
14405 (id_loc, token_start): Use (IF_LINTed) initial values that do not
14406 depend on *loc, so that the reader doesn't give the the false
14407 impression that *loc is initialized.
14408 (<INITIAL>"%%"): Do not bother setting code_start, since its value
14409 does not survive the return.
14410
144112003-03-01 Akim Demaille <akim@epita.fr>
14412
14413 * src/scan-gram.l (code_start): Always initialize it when entering
14414 into yylex, as SC_EPILOGUE is activated *before* the corresponding
14415 yylex invocation. An alternative would be making it static, but
14416 then it starts with the second %%'s beginning, instead of its end.
14417
144182003-02-28 Paul Eggert <eggert@twinsun.com>
14419
14420 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
14421 around a UnixWare 7.1.1 porting bug reported by John Hughes in
14422 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
14423
144242003-02-26 Paul Eggert <eggert@twinsun.com>
14425
14426 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
14427 Remove Sequent/Pyramid discussion (nobody uses them any more).
14428 Merge VMS and MS-DOS discussion; these ports may well be dead
14429 but let's keep mentioning them for now. Put <> around email
14430 addresses. Add copyright notice.
14431
144322003-02-24 Paul Eggert <eggert@twinsun.com>
14433
14434 * data/glr.c (yy_reduce_print): yylineno -> yylno,
14435 to avoid collision with flex use of yylineno.
14436 Problem reported by Bruce Lilly in
14437 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
14438 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
14439 * data/yacc.c (yy_reduce_print): Likewise.
14440
14441 * config/depcomp: Sync with Automake 1.7.3.
14442
144432003-02-21 Akim Demaille <akim@epita.fr>
14444
14445 * data/lalr1.cc: Use temporary variables instead of casts to
14446 change integer types.
14447 Suggested by Paul Eggert.
14448
144492003-02-21 Akim Demaille <akim@epita.fr>
14450
14451 * doc/bison.texinfo: Use "location" consistently to refer to @n,
14452 to avoid confusions with lalr1.cc's notion of Position.
14453 Suggested by Paul Eggert.
14454
144552003-02-20 Akim Demaille <akim@epita.fr>
14456
14457 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
14458 before initial_columns.
14459 (location.hh): Use consistent variable names when defining the
14460 operator<<.
14461 Use "last" so that we subtract from Positions, not from unsigned.
14462
144632003-02-20 Akim Demaille <akim@epita.fr>
14464
14465 * data/lalr1.cc (position.hh): New subfile, including the extended
14466 and Doxygen'ed documentation of class Position.
14467 (location.hh): Use it.
14468 Document a` la Doxygen.
14469 With the help of Benoit Perrot.
14470
144712003-02-20 Akim Demaille <akim@epita.fr>
14472
14473 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
14474 AT_YACC_IF.
14475 Redefine AT_YYERROR_SEES_LOC_IF using it.
14476 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
14477 not defined.
14478 Don't use the location in yy::Parser::error_ and
14479 yy::Parser::print_ when not %locations.
14480 Activate more lalr1.cc tests.
14481
144822003-02-19 Akim Demaille <akim@epita.fr>
14483
14484 * data/lalr1.cc: When displaying a line number, be sure to make it
14485 an int.
14486
144872003-02-19 Akim Demaille <akim@epita.fr>
14488
14489 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
14490 Remove, useless.
14491 (YYABORT, YYACCEPT, YYERROR): New.
14492 * tests/calc.at: Renable the lalr1.cc test.
14493
144942003-02-19 Akim Demaille <akim@epita.fr>
14495
14496 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
14497 error recovery, mixing with/without pops and discarding of the
14498 lookahead.
14499 Exercise YYERROR.
14500 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
14501
145022003-02-17 Paul Eggert <eggert@twinsun.com>
14503
14504 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
14505 * tests/testsuite.at (AT_COMPILE): Use them.
14506 This fixes the testsuite problem reported by Robert Lentz in
14507 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
14508
145092003-02-12 Paul Eggert <eggert@twinsun.com>
14510
14511 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
14512 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
14513 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
14514 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
14515 Check for malloc failure, for consistency with yacc.c.
14516 (yytname_size): Remove, for consistency with yacc.c.
14517
14518 The bug still remains in data/lalr1.cc, as I didn't have time
14519 to fix it there.
14520
145212003-02-06 Akim Demaille <akim@epita.fr>
14522
14523 * configure.ac (GXX): Rename as...
14524 (CXX): this, to keep the original Autoconf semantics.
14525 Require 2.57.
14526 * data/lalr1.cc: Fix b4_copyright invocations.
14527 If YYDEBUG is not defined, don't depend upon name_ being defined.
14528 (location.hh): Include string and iostream.
14529 (Position::filename): New member.
14530 (Position::Position ()): New.
14531 (operator<< (Position)): New.
14532 (operator- (Position, int)): New.
14533 (Location::first, Location::last): Rename as...
14534 (Location::begin, Location::end): these, to mock the conventional
14535 iterator names.
14536 (operator<< (Location)): New.
14537 * tests/atlocal.in (CXX): New.
14538 * tests/testsuite.at (AT_COMPILE_CXX): New.
14539 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
14540 locations in a more synthetic way.
14541 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
14542 lalr1.cc is used.
14543 Adjust the C locations to match those from Emacs: first column is
14544 column 0.
14545 Change all the expected results.
14546 Conform to the GCS: simplify the locations when applicable.
14547 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
14548 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
14549 these CPP macros with the m4 macros new defined by...
14550 (AT_CHECK_PUSHDEFS): this, i.e.:
14551 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
14552 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
14553 New macros.
14554 (AT_CHECK_POPDEFS): Undefine them.
14555 (AT_CHECK_CALC_LALR1_CC): New.
14556 Use it for the first lalr1.cc test.
14557
145582003-02-04 Akim Demaille <akim@epita.fr>
14559
14560 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
14561 Location as is defined.
14562
145632003-02-04 Akim Demaille <akim@epita.fr>
14564
14565 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
14566 name_ being defined.
14567
145682003-02-03 Paul Eggert <eggert@twinsun.com>
14569
14570 * src/gram.h (start_symbol): Remove unused decl.
14571
14572 Use more-consistent naming conventions for local vars.
14573
14574 * src/derives.c (derives_compute): Change type of local var from
14575 int to rule_number.
14576 * src/gram.c (grammar_rules_partial_print): Likewise.
14577 * src/print.c (print_core): Likewise.
14578 * src/reduce.c (reduce_grammar_tables): Likewise.
14579
14580 * src/gram.c (grammar_dump): Change name of item_number *
14581 local var from r to rp.
14582 * src/nullable.c (nullable_compute): Likewise.
14583
14584 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
14585
14586 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
14587 for symbol or symbol_number var.
14588 * src/reader.c (grammar_start_symbol_set): Likewise.
14589 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
14590 Likewise.
14591 * src/state.c (transitions_to): Likewise.
14592 * src/state.h: Likewise.
14593 * src/tables.c (symbol_number_to_vector_number): Likewise.
14594
14595 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
14596 char * var.
14597
14598 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
14599 var.
14600
14601 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
14602 var.
14603
14604 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
14605 Use str, not s, for char * var. Use ch, not c, for character var.
14606 Use size for size var.
14607
14608 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
14609 char * var.
14610 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
14611 uniqstr var.
14612 * src/uniqstr.h: Likewise.
14613
14614 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
14615 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
14616 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
14617 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
14618 param to have same name as that of enum, so that we don't use
14619 "s" to stand for a non-state.
14620
146212003-02-02 Akim Demaille <akim@epita.fr>
14622
14623 * src/scan-skel.l: Scan more than one inert character per yylex
14624 invocation.
14625
146262003-02-01 Paul Eggert <eggert@twinsun.com>
14627
14628 Version 1.875a.
14629
14630 * po/LINGUAS: Add ms.
14631
146322003-01-30 Akim Demaille <akim@epita.fr>
14633
14634 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
14635
146362003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14637
14638 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
14639 of $1.
14640
14641 Changes in response to error report by S. Eken: GLR mode does not
14642 handle negative $ indices or $ indices in embedded rules correctly.
14643 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
14644
14645 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
14646 (b4_rhs_location): Ditto.
14647 (yyfill): New function to copy from stack tree into array
14648 incrementally.
14649 (yyuserAction): Modify to allow incremental move of semantic values
14650 to rhs array when in GLR mode.
14651 Define YYFILL to use in user-defined actions to fill semantic array
14652 as needed.
14653 Remove dummy use of yystack, as there is now a guaranteed use.
14654 (yydoAction): Modify to allow incremental move of semantic values
14655 to rhs array when in GLR mode.
14656 (yyresolveAction): Ditto.
14657 (yyglrShiftDefer): Update comment.
14658 (yyresolveStates): Use X == NULL for pointers, not !X.
14659 (yyglrReduce): Ditto.
14660 (yydoAction): Ditto
14661
14662 * tests/glr-regr1.at: Rename to ...
14663 * tests/glr-regression.at: Add new regression test for the problems
14664 described above (adapted from S. Eken).
14665 Update copyright notice.
14666 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
14667 * tests/Makefile.am: Ditto.
14668
146692003-01-28 Paul Eggert <eggert@twinsun.com>
14670
14671 * data/lalr1.cc: Do not use @output_header_name@ unless
14672 b4_defines_flag is set. This fixes two bugs reported by
14673 Tim Van Holder in
14674 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
14675 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
14676
146772003-01-21 Paul Eggert <eggert@twinsun.com>
14678
14679 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
14680 we don't need to worry about yyerrlab1 being reported as an
14681 "unused label" by non-GCC C compilers. The downside is that if
14682 locations are used then a couple of statements are duplicated each
14683 time YYERROR is invoked, but the upside is that the warnings
14684 should vanish.
14685 (yyerrlab1): Move code to YERROR.
14686 (yyerrlab2): Remove. Change uses back to yyerrlab1.
14687 This reverts some of the 2002-12-27 change.
14688
146892003-01-17 Paul Eggert <eggert@twinsun.com>
14690
14691 * src/output.c (symbol_printers_output): Fix typo that led
14692 to core dump. Problem reported by Antonio Rus in
14693 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
14694
146952003-01-13 Akim Demaille <akim@epita.fr>,
14696 Quoc Peyrot <chojin@lrde.epita.fr>,
14697 Robert Anisko <anisko_r@lrde.epita.fr>
14698
14699 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
14700 when the stacks contain one element, as the loop would otherwise
14701 free the last state, and then use the top state (the one we just
14702 popped). This means that the initial elements will not be freed
14703 explicitly, as is the case in yacc.c; it is not a problem, as
14704 these elements have fake values.
14705
147062003-01-11 Paul Eggert <eggert@twinsun.com>
14707
14708 * NEWS: %expect-violations are now just warnings, reverting
14709 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
14710 bootstrapping problem reported by Matthias Klose; see
14711 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
14712 * src/conflicts.c (conflicts_print): Likewise.
14713 * tests/conflicts.at (%expect not enough, %expect too much,
14714 %expect with reduce conflicts): Likewise.
14715 * doc/bison.texinfo (Expect Decl): Document this. Also mention
14716 that the warning is enabled if the number of conflicts changes
14717 (not necessarily increases).
14718
14719 * src/getargs.c (version): Update copyright year.
14720
147212003-01-09 Akim Demaille <akim@epita.fr>
14722
14723 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
14724
147252003-01-08 Paul Eggert <eggert@twinsun.com>
14726
14727 * Makefile.maint (WGETFLAGS):
14728 New macro, containing "-C off" to disable proxy caches.
14729 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
14730 (rel-check): Use $(WGET) instead of wget.
14731
147322003-01-06 Paul Eggert <eggert@twinsun.com>
14733
14734 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
14735 the GLR paper of Scott, Johnstone and Hussain.
14736
147372003-01-04 Paul Eggert <eggert@twinsun.com>
14738
14739 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
14740 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
14741 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
14742 (EXTRA_LIBRARIES): New var, for liby.a.
14743 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
14744 (EXTRA_SCRIPTS): New var, for yacc.
14745
14746 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
14747 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
14748 Problem reported by Nelson H. F. Beebe.
14749
147502003-01-03 Paul Eggert <eggert@twinsun.com>
14751
14752 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
14753 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
14754 when compiling Bison 1.875's `bitset bset = obstack_alloc
14755 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
14756
14757 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
14758 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
14759 grow to a huge size with typical invocation.
14760
14761 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
14762 Use the pattern recommended by Autoconf 2.57, except also protect
14763 against double-definition.
14764 * src/system.h: Likewise.
14765 Portability issues reported by Nelson H. F. Beebe.
14766
14767 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
14768 All uses changed. Provide a definition in both C and C++.
14769 (yytrue, yyfalse): Define even if defined (__cplusplus).
14770
14771 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
14772 Reported by Nelson H. F. Beebe.
14773
14774 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
14775
147762003-01-02 Paul Eggert <eggert@twinsun.com>
14777
14778 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
14779 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
14780 Bug reported by Nelson H. F. Beebe.
14781
147822003-01-01 Paul Eggert <eggert@twinsun.com>
14783
14784 * Version 1.875.
14785
147862002-12-30 Paul Eggert <eggert@twinsun.com>
14787
14788 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
14789 Moved here from...
14790 (<INITIAL>","): Here. This causes stray "," to be treated
14791 more uniformly.
14792
14793 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
14794 last brace in braced code when not in Yacc mode, for compatibility
14795 with Bison 1.35. This resurrects the 2001-12-15 patch to
14796 src/reader.c.
14797
14798 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
14799 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
14800
148012002-12-28 Paul Eggert <eggert@twinsun.com>
14802
14803 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
14804 that of SYM's type. This fixes Debian bug 168069, reported by
14805 Thomas Olsson.
14806
148072002-12-28 Paul Eggert <eggert@twinsun.com>
14808
14809 Version 1.75f.
14810
14811 Switch back to the Yacc style of conflict reports, undoing some
14812 of the 2002-07-30 change.
14813 * doc/bison.texinfo (Understanding): Use Yacc style for
14814 conflict reports. Also, use new way of locating rules.
14815 * src/conflicts.c (conflict_report):
14816 Renamed from conflict_report_yacc, removing the old
14817 'conflict_report'. Translate the entire conflict report at once,
14818 so that we don't assume that "," has the same interpretation in
14819 all languages.
14820 (conflicts_output): Use Yacc-style conflict report for each state,
14821 instead of our more-complicated style.
14822 (conflicts_print): Use Yacc-style conflict report, except print
14823 the input file name when not emulating Yacc.
14824 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
14825 Conflicted Reduction, %expect not enough, %expect too much,
14826 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
14827 * tests/existing.at (GNU Cim Grammar): Likewise.
14828 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
14829
14830 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
14831 fatal): Don't invoke fflush; it's not needed and it might even be
14832 harmful for stdout, as stdout might not be open.
14833 * src/reduce.c (reduce_print): Likewise.
14834
148352002-12-27 Paul Eggert <eggert@twinsun.com>
14836
14837 Fix a bug where error locations were not being recorded correctly.
14838 This problem was originally reported by Paul Hilfinger in
14839 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
14840
14841 * data/yacc.c (yyparse): New local var yylerrsp, to record the
14842 top of the location stack's error locations.
14843 (yyerrlab): Set it. When discarding a token, push its location
14844 onto yylerrsp so that we don't lose track of the error's end.
14845 (yyerrlab1): Now is only the target of YYERROR, so that we can
14846 properly record the location of the action that failed. For GCC
14847 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
14848 GCC warning about yyerrlab1 being unused if YYERROR is unused.
14849 (yyerrlab2): New label, which yyerrlab now falls through to.
14850 Compute the error's location by applying YYLLOC_DEFAULT to
14851 the locations of all the symbols that went into the error.
14852 * doc/bison.texinfo (Location Default Action): Mention that
14853 YYLLOC_DEFAULT is also invoked for syntax errors.
14854 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
14855 Error locations include the locations of all the tokens that were
14856 discarded, not just the last token.
14857
148582002-12-26 Paul Eggert <eggert@twinsun.com>
14859
14860 * src/files.c: Include quote.h.
14861 (compute_output_file_names): Warn if we detect conflicting
14862 outputs to the same file. This should catch the misunderstanding
14863 exemplified by Debian Bug 165349, reported by Bruce Stephens..
14864
14865 * src/conflicts.c (conflicts_print): If the user specifies
14866 "%expect N", report an error if there are any reduce/reduce
14867 conflicts. This is what the manual says should happen.
14868 This fixes Debian bug 130890, reported by Anthony DeRobertis.
14869 * tests/conflicts.at (%expect with reduce conflicts): New test.
14870
14871 Don't use m4_include on relative file names, as it doesn't work as
14872 desired if there happens to be a file with that name under ".".
14873
14874 * m4sugar/version.m4: Remove; it was included but it wasn't used.
14875 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
14876 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
14877 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
14878 * src/output.c (output_skeleton): Use full path names when
14879 specifying a file to include; don't rely on include path, as
14880 it's unreliable when the working file contains a file with
14881 that name.
14882
148832002-12-25 Paul Eggert <eggert@twinsun.com>
14884
14885 Remove obsolete references to bison.simple and bison.hairy.
14886 Problem mentioned by Aubin Mahe in
14887 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
14888 * data/glr.c: Comment fix.
14889 * doc/bison.1: Remove references. Also, mention "yacc".
14890
14891 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
14892 with -g option.
14893
14894 * src/parse-gram.y (declaration): Use enum "report_states" rather
14895 than its numeric value 1.
14896
14897 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
14898 opening a new one. This fixes Debian bug 165349, reported by
14899 Bruce Stephens.
14900
149012002-12-24 Paul Eggert <eggert@twinsun.com>
14902
14903 Version 1.75e.
14904
14905 * Makefile.maint (cvs-update): Don't assume that the shell
14906 supports $(...), as Solaris sh doesn't.
14907
14908 * src/parse-gram.y (lloc_default): Remove test for empty
14909 nonterminals at the end, since it didn't change the result.
14910
149112002-12-24 Paul Eggert <eggert@twinsun.com>
14912
14913 If the user does not define YYSTYPE as a macro, Bison now declares it
14914 using typedef instead of defining it as a macro. POSIX requires this.
14915 For consistency, YYLTYPE is also declared instead of defined.
14916
14917 %union directives can now have a tag before the `{', e.g., the
14918 directive `%union foo {...}' now generates the C code
14919 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
14920 The default union tag is `YYSTYPE', for compatibility with Solaris 9
14921 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
14922 instead of `yyltype'.
14923
14924 `yystype' and `yyltype' are now obsolescent macros instead of being
14925 typedefs or tags; they are no longer documented and will be
14926 withdrawn in a future release.
14927
14928 * data/glr.c (b4_location_type): Remove.
14929 (YYSTYPE): Renamed from yystype.
14930 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
14931 (struct YYLTYPE): Renamed from struct yyltype.
14932 (YYLTYPE): Renamed from yyltype.
14933 (yyltype, yystype): New (and obsolescent) macros,
14934 for backward compatibility.
14935 * data/yacc.c: Likewise.
14936
14937 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
14938 does not specify a union tag. This is for compatibility with
14939 Solaris 9 yacc.
14940
14941 * src/parse-gram.y (add_param): 2nd arg is now char * not char
14942 const *, since it is now modified by stripping surrounding { }.
14943 (current_braced_code): Remove.
14944 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
14945 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
14946 trailing " {...}". Now of type <chars>.
14947 (grammar_declaration): Adjust to bundled tokens.
14948 (code_content): Remove; stripping is now done by add_param.
14949 (print_token_value): Print contents of bundled tokens.
14950 (token_name): New function.
14951
14952 * src/reader.h (braced_code, current_braced_code): Remove.
14953 (token_name): New decl.
14954
14955 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
14956 token_type, not braced_code code_kind. All uses changed.
14957 (SC_PRE_CODE): New state, for scanning after a keyword that
14958 has (or usually has) an immediately-following braced code.
14959 (token_type): New local var, to keep track of which token type
14960 to return when scanning braced code.
14961 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
14962 <INITIAL>"%parse-param", <INITIAL>"%printer",
14963 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
14964 instead of returning a token type immediately.
14965 (<INITIAL>"{"): Set token type.
14966 (<SC_BRACED_CODE>"}"): Use it.
14967 (handle_action_dollar, handle_action_at): Now returns bool
14968 indicating success. Fail if ! current_rule; this prevents a core dump.
14969 (handle_symbol_code_dollar, handle_symbol_code_at):
14970 Remove; merge body into caller.
14971 (handle_dollar, handle_at): Complain in invalid contexts.
14972
14973 * NEWS, doc/bison.texinfo: Document the above.
14974 * NEWS: Fix years and program names in copyright notice.
14975
149762002-12-17 Paul Eggert <eggert@twinsun.com>
14977
14978 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
14979 Reporting, Table of Symbols): Omit mentions of %lex-param and
14980 %parse-param from the documentation for now.
14981
149822002-12-15 Paul Eggert <eggert@twinsun.com>
14983
14984 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
14985 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
14986 lookahead symbol, and which sets yychar in parser actions) and it
14987 disagreed with the Bison documentation. Bug
14988 reported by Andrew Walrond.
14989
14990 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
14991 as the caller now does that.
14992 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
14993 (YYEMPTY): Parenthesize right hand side, since others use it.
14994 (yyparse): Don't assume that our generated code is the only code
14995 that sets yychar.
14996
149972002-12-13 Paul Eggert <eggert@twinsun.com>
14998
14999 Version 1.75d.
15000
15001 POSIX requires a "yacc" command.
15002 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
15003 (MOSTLYCLEANFILES): Add yacc.
15004 (yacc): New rule.
15005 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
15006 as an alias for bison y.
15007
15008 * po/LINGUAS: Add da.
15009
15010 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
15011 problem with latest <getopt.h>.
15012 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
15013
15014 * doc/fdl.texi: Upgrade to 1.2.
15015 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
15016 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
15017 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
15018 gnulib.
15019 * config/install-sh: Sync with autotools.
15020
15021 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
15022 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
15023 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
15024 locations are requested.
15025 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
15026 locations are requested.
15027
150282002-12-12 Paul Eggert <eggert@twinsun.com>
15029
15030 Remove unportable casts and storage allocation tricks.
15031 While we're at it, remove almost all casts, since they
15032 usually aren't needed and are a sign of trouble.
15033
15034 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
15035
15036 * src/derives.c (derives_compute): Do not subtract NTOKENS from
15037 the pointer DSET returned by malloc; this isn't portable.
15038 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
15039 Similarly for DERIVES.
15040 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
15041 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
15042 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
15043
15044 * src/derives.c (derives_compute): Do not bother invoking
15045 int_of_rule_number, since rule numbers are integers.
15046
15047 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
15048 rather than XMALLOC (char, N).
15049
15050 * src/files.c (filename_split): Rewrite to avoid cast.
15051
15052 * src/gram.h (symbol_number_as_item_number,
15053 item_number_as_symbol_number, rule_number_as_item_number,
15054 item_number_as_rule_number):
15055 Now inline functions rather than macros, to avoid casts.
15056 * src/state.h (state_number_as_int): Likewise.
15057 * src/tables.c (state_number_to_vector_number,
15058 symbol_number_to_vector_number): Likewise.
15059
15060 * src/gram.h (int_of_rule_number): Remove; no longer used.
15061
15062 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
15063 since the resulting storage is always stored into.
15064
15065 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
15066 where it's needed.
15067
15068 * src/muscle_tab.c (muscle_m4_output):
15069 Now inline. Return bool, not int.
15070 * src/state.c (state_compare): Likewise.
15071 * src/symtab.c (symbol_check_defined,
15072 symbol_check_alias_consistency, symbol_pack, symbol_translation,
15073 hash_compare_symbol, hash_symbol):
15074 Likewise.
15075 * src/uniqstr.c (uniqstr_print): Likewise.
15076 * src/muscle_tab.c (muscle_m4_output_processor):
15077 New function, to avoid casts.
15078 * src/state.c (state_comparator, stage_hasher): Likewise.
15079 * src/symtab.c (symbol_check_defined_processor,
15080 symbol_check_alias_consistency_processor, symbol_pack_processor,
15081 symbol_translation_processor, hash_symbol_comparator,
15082 hash_symbol_hasher): Likewise.
15083 * src/uniqstr.c (uniqstr_print_processor): Likewise.
15084 * src/muscle_tab.c (muscles_m4_output):
15085 Use new functions instead of casting old functions unportably.
15086 * src/state.c (state_hash_new): Likewise.
15087 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
15088 symbols_token_translations_init):
15089 Likewise.
15090 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
15091
15092 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
15093 var instead of casting to long, to avoid casts.
15094 (prepare_states): Use MALLOC rather than alloca, so that we don't
15095 have to worry about alloca.
15096 * src/state.c (state_hash_lookup): Likewise.
15097
15098 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
15099 local var instead of casting to unsigned char, to avoid casts.
15100
15101 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
15102 STATE_ALLOC): Remove.
15103 (transitions_new, errs_new, reductions_new, state_new): Use malloc
15104 rather than calloc, and use offsetof to avoid allocating slightly
15105 too much storage.
15106 (state_new): Initialize all members.
15107
15108 * src/state.c (state_hash): Use unsigned accumulator, not signed.
15109
15110 * src/symtab.c (symbol_free): Remove; unused.
15111 (symbol_get): Remove cast in lhs of assignment.
15112 (symbols_do): Now static. Accept generic arguments, not
15113 hashing-related ones.
15114
15115 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
15116 (symbol_processor): Remove.
15117 (symbols_do): Remove decl; now static.
15118
15119 * src/system.h (alloca): Remove; decl no longer needed.
15120 (<stddef.h>): Include, for offsetof.
15121 (<inttypes.>, <stdint.h>): Include if available.
15122 (uintptr_t): New type, if system lacks it.
15123 (CALLOC, MALLOC, REALLOC): New macros.
15124 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
15125 new macros.
15126
15127 * src/tables.c (table_size): Now int, to pacify GCC.
15128 (table_grow, table_ninf_remap): Use signed table size.
15129 (save_row): Don't bother initializing locals when not needed.
15130 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
15131 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
15132
15133 * src/vcg.h: Correct misspellings.
15134
15135 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
15136
15137
15138 * src/getargs.c (getargs): Don't assume EOF == -1.
15139
151402002-12-09 Paul Eggert <eggert@twinsun.com>
15141
15142 Change identifier spellings to avoid collisions with names
15143 that are reserved by POSIX.
15144
15145 Don't use names ending in _t, since POSIX reserves them.
15146 For consistency, remove _e and _s endings -- they're weren't
15147 needed to remove ambiguity. All uses changed.
15148 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
15149 turn was just renamed from struniq_t.
15150 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
15151 which in turn was just renamed from struniq_processor_t.
15152 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
15153 in turn was renamed from hash_compare_struniq_t.
15154 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
15155 (state_list): Renamed from state_list_t.
15156 * src/assoc.h (assoc): Renamed from assoc_t.
15157 * src/conflicts.c (enum conflict_resolution): Renamed from
15158 enum conflict_resolution_e.
15159 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
15160 (rule_list): Renamed from rule_list_t.
15161 * src/getargs.h (enum trace): Renamed from enum trace_e.
15162 (enum report): Renamed from enum report_e.
15163 * src/gram.h (item_number): Renamed from item_number_t.
15164 (rule_number): Renamed from rule_number_t.
15165 (struct rule_s): Remove the "rule_s" part; not used.
15166 (rule): Renamed from rule_t.
15167 (rule_filter): Renamed from rule_filter_t.
15168 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
15169 (goto_list): Renamed from goto_list_t.
15170 * src/lalr.h (goto_number): Renamed from goto_number_t.
15171 * src/location.h (location): Renamed from location_t.
15172 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
15173 and moved here from:
15174 * src/muscle_tab.h (muscle_entry_t): here.
15175 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
15176 (rule_list): Renamed from rule_list_t.
15177 * src/print_graph.c (static_graph): Renamed from graph.
15178 * src/reader.h (braced_code): Renamed from braced_code_t.
15179 Remove brace_code_e tag.
15180 * src/relation.h (relation_node): Renamed from relation_node_t.
15181 (relation_nodes): Renamed from relation_nodes_t.
15182 (relation): Renamed from relation_t.
15183 * src/state.h (state_number): Renamed from state_number_t.
15184 (struct state): Renamed from struct state_s.
15185 (state): Renamed from state_t.
15186 (transitions): Renamed from transitions_t. Unused (and
15187 misspelled) transtion_s tag removed.
15188 (errs): Renamed from errs_t. Unused errs_s tag removed.
15189 (reductions): Renamed from reductions_t. Unused tag
15190 reductions_s removed.
15191 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
15192 (struct symbol_list): Renamed from struct symbol_list_s.
15193 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
15194 (struct symbol): Renamed from struct symbol_s.
15195 (symbol): Renamed from symbol_t.
15196 * src/tables.c (vector_number): Renamed from vector_number_t.
15197 (action_number): Renamed from action_t.
15198 * src/tables.h (base_number): Renamed from base_t.
15199 * src/vcg.h (enum color): Renamed from enum color_e.
15200 (enum textmode): Renamed from enum textmode_e.
15201 (enum shape): Renamed from enum shape_e.
15202 (struct colorentry): Renamed from struct colorentry_s.
15203 (struct classname): Renamed from struct classname_s.
15204 (struct infoname): Renamed from struct infoname_s.
15205 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
15206 (enum decision): Renamed from enum decision_e.
15207 (enum orientation): Renamed from enum orientation_e.
15208 (enum alignment): Renamed from enum alignment_e.
15209 (enum arrow_mode): Renamed from enum arrow_mode_e.
15210 (enum crossing_type): Renamed from enum crossing_type_e.
15211 (enum view): Renamed from enum view_e.
15212 (struct node): Renamed from struct node_s.
15213 (node): Renamed from node_t.
15214 (enum linestyle): Renamed from enum linestyle_e.
15215 (enum arrowstyle): Renamed from enum arrowstyle_e.
15216 (struct edge): Renamed from struct edge.
15217 (edge): Renamed from edge_t.
15218 (struct graph): Renamed from struct graph_s.
15219 (graph): Renamed from graph_t.
15220 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
15221 Rename value_t -> value.
15222 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
15223 value_t_as_yystype -> value_as_yystype.
15224
15225 Don't include <errno.h> in the mainstream code, since it
15226 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
15227 * lib/get-errno.c, lib/get-errno.h: New files.
15228 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
15229 get-errno.c.
15230 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
15231 * src/output.c (output_skeleton): Likewise.
15232 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
15233 instead of errno.
15234 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
15235 Likewise.
15236 (handle_action_dollar, handle_action_at): Likewise.
15237 * src/system.h: Do not include <errno.h>.
15238 (TAB_EXT): Renamed from EXT_TAB.
15239 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
15240
15241 Avoid str[a-z]*, since <string.h> reserves that name space.
15242 Change all instances of "struniq" in names to "uniqstr", and
15243 likewise for "STRUNIQ" and "UNIQSTR".
15244 * src/uniqstr.c: Renamed from src/struniq.c.
15245 * src/uniqstr.h: Renamed from src/struniq.h.
15246 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
15247 * src/files.c (strsuffix): Remove; unused.
15248 (concat2): Renamed from stringappend. Now static.
15249 * src/files.h (strsuffix, stringappend): Remove; unused.
15250 * src/parse-gram.y (<chars>): Renamed from <string>.
15251 (<uniqstr>): Renamed from <struniq>.
15252 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
15253 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
15254 (struct graph_s.expand): Renamed from struct graph_s.stretch.
15255 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
15256 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
15257 (N_EXPAND): Renamed from N_STRETCH.
15258
15259 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
15260 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
15261 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
15262 Remove; unused.
15263 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
15264 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
15265 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
15266 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
15267 (BASE_MAXIMUM): Renamed from BASE_MAX.
15268 (BASE_MINIMUM): Renamed from BASE_MIN.
15269 (ACTION_MAX): Remove; unused.
15270 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
15271 Unnecessary casts removed from above defines.
15272
15273
15274 Fix misspelling in names.
15275 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
15276 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
15277 G_NODE_ALIGNEMENT.
15278
15279
15280 * lib/timevar.c (timevar_report): Renamed from time_report,
15281 for consistency with other names.
15282 * lib/timevar.h (timevar_report): New decl.
15283 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
15284
15285
15286 Sort include-file uses.
15287
15288 Reorder all include files under src to be in the order "system.h".
15289 then the ../lib include files in angle brackets (alphabetized),
15290 then the . include files in double-quotes (alphabetized). Fix
15291 dependency breakages encountered in this process, as follows:
15292 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
15293 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
15294 * src/state.h: Include "symtab.h".
15295
152962002-12-08 Paul Eggert <eggert@twinsun.com>
15297
15298 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
15299 since this causes problems when __file__ contains character
15300 sequences like "@" that are treated specially by src/scan-skel.l.
15301 Instead, just use the file's basename. This fixes the bug
15302 reported by Martin Mokrejs in
15303 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
15304
153052002-12-06 Paul Eggert <eggert@twinsun.com>
15306
15307 Add support for rules that do not have trailing semicolons, as
15308 POSIX requires. Improve the quality of locations in Bison
15309 diagnostics.
15310
15311 * src/location.c: Include <quotearg.h>.
15312 (empty_location): Now const.
15313 (location_print): New function. Follow the recommendation of the
15314 GNU Coding Standards for locations that span file boundaries.
15315 * src/location.h: Do not include <quotearg.h>; no longer needed.
15316 (boundary): New type.
15317 (location_t): Use it. This allows locations to span file boundaries.
15318 All member uses changed: file -> start.file or end.file (as needed),
15319 first_line -> start.line, first_column -> start.column,
15320 last_line -> end.line, last_column -> end.column.
15321 (equal_boundaries): New function.
15322 (LOCATION_RESET, LOCATION_STEP): Remove.
15323 (LOCATION_PRINT): Remove. All callers changed to use location_print.
15324 (empty_location): Now const.
15325 (location_print): New decl.
15326 * src/parse-gram.y (lloc_default): New function, which handles
15327 empty locations more accurately.
15328 (YYLLOC_DEFAULT): Use it.
15329 (%token COLON): Remove.
15330 (%token ID_COLON): New token.
15331 (rules): Use it.
15332 (declarations, rules): Remove trailing semicolon.
15333 (declaration, rules_or_grammar_declaration):
15334 Allow empty (";") declaration.
15335 (symbol_def): Remove empty actions; no longer needed.
15336 (rules_or_grammar_declaration): Remove trailing semicolon.
15337 (semi_colon.opt): Remove.
15338 * src/reader.h: Include location.h.
15339 (scanner_cursor): New decl.
15340 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
15341 rolling our own.
15342 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
15343 of *loc.
15344 (STEP): Remove. No longer needed, now that adjust_location does
15345 the work. All uses removed.
15346 (scanner_cursor): New var.
15347 (adjust_location): Renamed from extend_location. It now sets
15348 *loc and adjusts the scanner cursor. All uses changed.
15349 Don't bother testing for CR.
15350 (handle_syncline): Remove location arg; now updates scanner cursor.
15351 All callers changed.
15352 (unexpected_end_of_file): Now accepts start boundary of token or
15353 comment, not location. All callers changed. Update scanner cursor,
15354 not the location.
15355 (SC_AFTER_IDENTIFIER): New state.
15356 (context_state): Renamed from c_context. All uses changed.
15357 (id_loc, code_start, token_start): New local vars.
15358 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
15359 processing of Yacc white space and equivalents here.
15360 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
15361 instead of returning ID immediately, since we need to search for
15362 a subsequent colon.
15363 (<INITIAL>"'", "\""): Save token_start.
15364 (<INITIAL>"%{", "{", "%%"): Save code_start.
15365 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
15366 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
15367 BEGIN context_state at end, not INITIAL.
15368 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
15369 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
15370 Return correct token start.
15371 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
15372 the start of a character, string or multiline comment is found.
15373 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
15374 Reduction): Adjust reported locations to match the more-precise
15375 results now expected.
15376 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
15377 * tests/reduce.at (Useless Rules, Reduced Automaton,
15378 Underivable Rules): Likewise.
15379 * tests/regression.at (Invalid inputs): No longer `expecting ";"
15380 or "|"' now that so many other tokens are allowed by the new grammar.
15381
15382 * src/complain.h (current_file): Remove duplicate decl;
15383 current_file is now owned by files.h.
15384 * src/complain.c, src/scan-gram.l: Include files.h.
15385
153862002-12-06 Paul Eggert <eggert@twinsun.com>
15387
15388 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
15389 promotes to int; it might be unsigned int.
15390 * data/yacc.c (yy_reduce_print): Likewise.
15391
15392 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
15393 be #defined in the prologue, not in the Bison declarations.
15394 This fixes Debian Bug 102878, reported by Shaul Karl.
15395
153962002-12-02 Paul Eggert <eggert@twinsun.com>
15397
15398 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
15399 * lib/strtoul.c: New file, from gnulib.
15400 This fixes a porting bug reported by Peter Klein in
15401 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
15402
154032002-11-30 Paul Eggert <eggert@twinsun.com>
15404
15405 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
15406 and put only a forward declaration in the prologue. This is for
15407 consistency with the other scanner helper functions.
15408
15409 Type clashes now generate warnings, not errors, since it
15410 appears that POSIX may allow some grammars with type clashes.
15411 * src/reader.c (grammar_current_rule_check): Warn about
15412 type clashes instead of complaining.
15413 * tests/input.at (Type Clashes): Expect warnings, not complaints.
15414
15415 Add Yacc library, since POSIX requires it.
15416 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
15417 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
15418 * lib/main.c, lib/yyerror.c: New files.
15419
15420 gram_error can be static; it need not be extern.
15421 * src/reader.h (gram_error): Remove decl.
15422 * src/parse-gram.y (gram_error): Now static. Add static decl.
15423 (print_token_value): Omit parameter names from forward decl,
15424 for consistency.
15425
154262002-11-29 Paul Eggert <eggert@twinsun.com>
15427
15428 * doc/bison.texinfo: Emphasize that yylex and yyerror must
15429 be declared before being used. E.g., one should typically
15430 declare them in the prologue. Use GNU coding style in examples.
15431 Put "const" consistently after the type it modifies. Mention
15432 that C99 supports "inline". Mention that yyerror traditionally
15433 returns "int".
15434
15435 %parse-param and %lex-param now take just one argument, the
15436 declaration; the argument name is deduced from the declaration.
15437
15438 * doc/bison.texinfo (Parser Function, Pure Calling, Error
15439 Reporting, Table of Symbols): Document this.
15440 * src/parse-gram.y (add_param): New function.
15441 (COMMA): Remove.
15442 (declaration): Implement new rule for %parse-param and %lex-param.
15443 * src/scan-gram.l: "," now elicits a warning, rather than being
15444 a token; this is more compatible with byacc.
15445 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
15446
154472002-11-27 Paul Eggert <eggert@twinsun.com>
15448
15449 Rename identifiers to avoid real and potential collisions.
15450
15451 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
15452 to avoid collision with lex macro described by Bruce Lilly in
15453 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
15454 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
15455 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
15456 * src/parse-gram.y (print_token_value): Renamed from yyprint.
15457 All uses changed.
15458 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
15459 The name "yycontrol" violates the name space rules, and this stuff
15460 wasn't being used anyway.
15461 (input): Remove action; this stuff wasn't being used.
15462 (gram_error): Rename local variable yylloc -> loc.
15463 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
15464 (YY_DECL): Don't use "yy" at start of local variables.
15465 All uses changed, e.g., yylloc -> loc.
15466 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
15467 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
15468 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
15469 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
15470
15471 * src/parse-gram.y (gram_error): loc is now const *.
15472 * src/reader.h (gram_error): Likewise.
15473
154742002-11-24 Paul Eggert <eggert@twinsun.com>
15475
15476 Version 1.75c.
15477
15478 * tests/actions.at (Actions after errors): Use an output format
15479 more similar to that of the Printers and Destructors test.
15480 Test the position of the ';' token too.
15481 (Printers and Destructors): Likewise.
15482 (Printers and Destructors: %glr-parser): Remove for now, to avoid
15483 unnecessarily alarming people when the test fails.
15484
15485 * data/yacc.c (yyerrlab1): Move this label down, so that the
15486 parser does not discard the lookahead token if the user code
15487 invokes YYERROR. This change is required for POSIX conformance.
15488
15489 * lib/error.c: Sync with gnulib.
15490
154912002-11-22 Paul Eggert <eggert@twinsun.com>
15492
15493 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
15494 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
15495 * lib/xmalloc.c: Likewise.
15496
154972002-11-20 Paul Eggert <eggert@twinsun.com>
15498
15499 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
15500
155012002-11-20 Paul Eggert <eggert@twinsun.com>
15502
15503 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
15504 should use `if (! x) abort ();' rather than `assert (x);', and
15505 anyway it's one less thing to worry about configuring.
15506
15507 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
15508 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
15509 and replace all instances of assert with abort.
15510 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
15511 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
15512
15513 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
15514 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
15515 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
15516 hash_find_entry, hash_rehash, hash_insert): Likewise.
15517 * src/conflicts.c (resolve_sr_conflict): Likewise.
15518 * src/lalr.c (set_goto_map, map_goto): Likewise.
15519 * src/nullable.c (nullable_compute): Likewise.
15520 * src/output.c (prepare_rules, token_definitions_output): Likewise.
15521 * src/reader.c (packgram, reader): Likewise.
15522 * src/state.c (state_new, state_free, state_transitions_set,
15523 state_reduction_find): Likewise.
15524 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
15525 symbol_pack): Likewise.
15526 * src/tables.c (conflict_row, pack_vector): Likewise.
15527 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
15528 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
15529 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
15530 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
15531
15532 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
15533 (ARGMATCH_CONSTRAINT): New macro.
15534 (ARGMATCH_ASSERT): Use it.
15535
15536 * src/system.h (verify): New macro.
15537 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
15538 rather than assert.
15539 * src/tables.c (tables_generate): Likewise.
15540
15541 * src/struniq.c (struniq_assert): Now returns void, and aborts
15542 if the assertion is false.
15543 (struniq_assert_p): Remove.
15544 * src/struniq.h: Likewise.
15545
155462002-11-18 Paul Eggert <eggert@twinsun.com>
15547
15548 * data/glr.c (yygetLRActions): Replace `yyindex' with
15549 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
15550 This fixes the regression with Sun ONE Studio 7 cc that I reported in
15551 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
15552
155532002-11-18 Akim Demaille <akim@epita.fr>
15554
15555 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
15556 space.
15557 From Tim Van Holder.
15558
155592002-11-17 Paul Eggert <eggert@twinsun.com>
15560
15561 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
15562 to "SyntaxError" for consistency with my 2002-11-15 change.
15563
15564 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
15565 not define to {}, since this breaks the common use of `YYDPRINTF
15566 ((...));' if a single statement is desired (e.g. before `else').
15567 Work around GCC warnings by surrounding corresponding calls with
15568 {} if needed.
15569 (yyhasResolvedValue): Remove unused function.
15570 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
15571 loop body.
15572 (yyreportSyntaxError): Renamed from yyreportParseError.
15573 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
15574 All uses changed.
15575 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
15576 extern when possible. Remove unused initializations.
15577
155782002-11-16 Akim Demaille <akim@epita.fr>
15579
15580 Augment the similarity between GLR and LALR traces.
15581
15582 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
15583 (YY_REDUCE_PRINT): New.
15584 (yyparse): Use them.
15585 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
15586 YYDPRINT here.
15587 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
15588 state reached after the reduction/recovery, since...
15589 (yyparse, yyprocessOneStack): Report the state we are entering in.
15590
155912002-11-16 Akim Demaille <akim@epita.fr>
15592
15593 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
15594 Add support for --trace=skeleton.
15595 * src/scan-skel.l: %option debug.
15596 Scan strings of non-@ or \n instead of character by character.
15597 (scan_skel): Handle trace_skeleton.
15598 (QPUTS): New.
15599 (@output_parser_name@, @output_header_name@): ``Restore'' their
15600 support (used to be M4 macros).
15601 * data/yacc.c: Quote larger chunks, a la glr.c.
15602 * data/lalr1.cc: Likewise.
15603 The header guards are no longer available, so use some other
15604 string than `YYLSP_NEEDED'.
15605
156062002-11-16 Akim Demaille <akim@epita.fr>
15607
15608 Make the ``Printers and Destructors'' test more verbose, taking
15609 `yacc.c''s behavior as (possibly wrong) reference.
15610
15611 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
15612 instead of fprint on stdout.
15613 Set and report the last_line of the symbols.
15614 Consistently display values and locations.
15615
156162002-11-16 Paul Eggert <eggert@twinsun.com>
15617
15618 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
15619
156202002-11-15 Paul Eggert <eggert@twinsun.com>
15621
15622 * tests/actions.at (Actions after errors): New test case.
15623
15624 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
15625 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
15626 tests/action.at, tests/calc.at, tests/conflicts.at,
15627 tests/cxx-type.at, tests/regression.at:
15628 "parse error" -> "syntax error" for POSIX compatibility.
15629 "parsing stack overflow..." -> "parser stack overflow" so
15630 that code matches Bison documentation.
15631
156322002-11-15 Akim Demaille <akim@epita.fr>
15633
15634 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
15635 take two BRACED_CODE, not two string_content.
15636 Free the scanner's obstack when we are done.
15637 (code_content): New.
15638 * tests/calc.at: Adjust.
15639 * doc/bison.texinfo: Adjust.
15640 Also, make sure to include the `,' for these declarations.
15641
156422002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
15643
15644 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
15645 definition; avoids potential autoreconf problems.
15646
156472002-11-15 Akim Demaille <akim@epita.fr>
15648
15649 Always check the value returned by yyparse.
15650
15651 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
15652 returned by yyparse.
15653 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
15654 Adjust calls.
15655 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
15656 returned by yyparse.
15657
156582002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15659
15660 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
15661 on input.at test.
15662
156632002-11-14 Paul Eggert <eggert@twinsun.com>
15664
15665 * src/output.c (output_skeleton): Call xfopen instead of
15666 duplicating xfopen's body.
15667
15668 Fix bugs reported by Nelson H. F. Beebe in
15669 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
15670
15671 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
15672 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
15673 Group compiler. Instead, use "$CC -E bar.c". Include the .h
15674 file twice in the grammar, as an extra check.
15675
15676 * tests/input.at (Torturing the Scanner): Surround the
15677 backslash-newline tests with "#if 0", to make it less likely that
15678 we'll run into compiler bugs. Bring back solitary \ inside
15679 comment, but add a closing comment to work around HP C bug. Don't
15680 test backslash-newline in C character constant.
15681
156822002-11-14 Akim Demaille <akim@epita.fr>
15683
15684 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
15685 status of the compiler.
15686 Calling `exit 1' is no longer needed.
15687 Reported by Nelson H. F. Beebe.
15688
156892002-11-14 Akim Demaille <akim@epita.fr>
15690
15691 * tests/atlocal.in (CPPFLAGS): We have config.h.
15692 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
15693 New.
15694 * tests/actions.at, tests/calc.at, tests/conflicts.at,
15695 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
15696 * tests/regression.at, tests/torture.at: Use them for all the
15697 grammars that are to be compiled.
15698 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
15699 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
15700 * doc/bison.texinfo (GLR Parsers): Document `inline'.
15701
157022002-11-14 Akim Demaille <akim@epita.fr>
15703
15704 * doc/bison.texinfo: Various formatting changes (alignments in
15705 samples, additional @group/@end group, GCS in samples.
15706 Use @deffn instead of simple @table to define the directives,
15707 macros, variables etc.
15708
157092002-11-13 Paul Eggert <eggert@twinsun.com>
15710
15711 Fix some bugs reported by Albert Chin-A-Young in
15712 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
15713
15714 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
15715 -o c"; the HP C compiler chatters during compilation.
15716 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
15717 * tests/headers.at (export YYLTYPE): Likewise.
15718
15719 * tests/input.at (Torturing the Scanner): Remove lines containing
15720 solitary backslashes, as they tickle a bug in the HP C compiler.
15721
15722 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
15723 comments, since they're not portable. Use GNU coding style.
15724
157252002-11-13 Akim Demaille <akim@epita.fr>
15726
15727 * data/yacc.c: Leave bigger chunks of quoted text.
15728 (YYDSYMPRINTF): New.
15729 Use it to report symbol activities.
15730 * data/glr.c (YYDSYMPRINTF): New.
15731 Use it.
15732
157332002-11-12 Paul Eggert <eggert@twinsun.com>
15734
15735 Version 1.75b.
15736
15737 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
15738 (yyglrReduce): Return yyok, not 0.
15739 This should avoid the enumerated-type warnings reported
15740 by Nelson H. F. Beebe in
15741 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
15742
15743 * lib/bbitset.h (BITSET_INLINE): Remove.
15744 * lib/bitset.h [! BITSET_INLINE]: Remove.
15745 (bitset_set, bitset_reset, bitset_test): Rename local vars
15746 to avoid shadowing warnings by GCC.
15747
15748 * data/glr.c (inline): Remove #define. It's the user's
15749 responsibility to #define it away, just like 'const'.
15750 This fixes one of the bugs reported by Nelson H. F. Beebe in
15751 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
15752
15753 * Makefile.maint (po-check): Scan .l and .y files instead of the
15754 .c and the .h files that they generate. This fixes the bug
15755 reported by Tim Van Holder in:
15756 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
15757 Look for N_ as well as for _. Try to avoid matching #define for
15758 N_ and _.
15759 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
15760 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
15761 * src/scan-gram.l: Revamp regular expressions so that " and '
15762 do not confuse xgettext.
15763
15764 * src/struniq.h (struniq_new): Do not declare the return type
15765 to be 'const'; this violates the C standard.
15766 * src/struniq.c (struniq_new): Likewise.
15767
157682002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
15769
15770 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
15771 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
15772 linker.
15773
157742002-11-12 Akim Demaille <akim@epita.fr>
15775
15776 * Makefile.maint: Sync with Autoconf:
15777 (local_updates): New.
15778
157792002-11-12 Akim Demaille <akim@epita.fr>
15780
15781 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
15782
157832002-11-12 Akim Demaille <akim@epita.fr>
15784
15785 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
15786 locations.
15787
157882002-11-12 Akim Demaille <akim@epita.fr>
15789
15790 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
15791 not yyvalue.
15792
157932002-11-12 Akim Demaille <akim@epita.fr>
15794
15795 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
15796 Use it to test the GLR parser.
15797
157982002-11-12 Akim Demaille <akim@epita.fr>
15799
15800 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
15801 defines it.
15802 * data/glr.c (yystos): New.
15803 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
15804 (YYDSYMPRINT): New.
15805 (yyval): Don't define it, it is handled via M4.
15806 (yyrecoverParseError): Free verbosely the discarded symbols.
15807 * data/yacc.c (yysymprint): Remove, rather...
15808 (b4_yysymprint_generate): invoke.
15809 * data/c.m4 (b4_yysymprint_generate): New.
15810 Accept pointers as arguments, as opposed to the version from
15811 yacc.c.
15812 (b4_yydestruct_generate): Likewise.
15813 * tests/cations.at (Printers and Destructors): Use Bison directives
15814 instead of CPP macros.
15815 Don't rely on internal details.
15816
158172002-11-12 Akim Demaille <akim@epita.fr>
15818
15819 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
15820 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
15821 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
15822 it against YYEMPTY and so forth), work on yytoken (i.e., set
15823 it to YYEMPTY etc.).
15824 (yydestruct): Replace with a b4_yydestruct_generate invocation.
15825 (b4_symbol_actions): Remove.
15826 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
15827 for 0, end-of-input.
15828
158292002-11-12 Akim Demaille <akim@epita.fr>
15830
15831 * doc/bison.texinfo (Destructor Decl): New.
15832
158332002-11-12 Akim Demaille <akim@epita.fr>
15834
15835 * src/tables.c (tables_generate): Use free for pointers that
15836 cannot be NULL, not XFREE.
15837 (pack_vector): Use assert, not fatal, for bound violations.
15838 * src/state.c (state_new): Likewise.
15839 * src/reader.c (reader): Likewise.
15840 * src/lalr.c (set_goto_map): Likewise.
15841 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
15842 the file name.
15843
158442002-11-12 Akim Demaille <akim@epita.fr>
15845
15846 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
15847 Restore.
15848 * src/scan-gram.l (last_string): Is global to the file, not to
15849 yylex.
15850 * src/parse-gram.y (input): Don't append the epilogue here,
15851 (epilogue.opt): do it here, and free the scanner's obstack.
15852 * src/reader.c (epilogue_set): Rename as...
15853 (epilogue_augment): this.
15854 * data/c.m4 (b4_epilogue): Defaults to empty.
15855
158562002-11-12 Akim Demaille <akim@epita.fr>
15857
15858 * src/getargs.c (long_options): Remove duplicates.
15859 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
15860 Remove.
15861 * doc/bison.rnh: Remove.
15862 * doc/bison.texinfo (VMS Invocation): Remove.
15863
158642002-11-12 Akim Demaille <akim@epita.fr>
15865
15866 * src/struniq.h, src/struniq.c (struniq_t): Is const.
15867 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
15868
15869 Use struniq for symbols.
15870
15871 * src/symtab.h (symbol_t): The tag member is a struniq.
15872 (symbol_type_set): Adjust.
15873 * src/symtab.c (symbol_new): Takes a struniq.
15874 (symbol_free): Don't free the tag member.
15875 (hash_compare_symbol_t, hash_symbol_t): Rename as...
15876 (hash_compare_symbol, hash_symbol): these.
15877 Use the fact that tags as struniqs.
15878 (symbol_get): Use struniq_new.
15879 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
15880 Returns a strniq.
15881 * src/reader.h (merger_list, grammar_currentmerge_set): The name
15882 and type members are struniqs.
15883 * src/reader.c (get_merge_function)
15884 (grammar_current_rule_merge_set): Adjust.
15885 (TYPE, current_type): Are struniq.
15886
15887 Use struniq for file names.
15888
15889 * src/files.h, src/files.c (infile): Split into...
15890 (grammar_file, current_file): these.
15891 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
15892 * src/reduce.c (reduce_print): Likewise.
15893 * src/getargs.c (getargs): Likewise.
15894 * src/complain.h, src/complain.c: Likewise.
15895 * src/main.c (main): Call struniqs_new early enough to use it for
15896 file names.
15897 Don't free the input file name.
15898
158992002-11-12 Akim Demaille <akim@epita.fr>
15900
15901 * src/symtab.c (symbol_free): Remove dead deactivated code:
15902 type_name are properly removed.
15903 Don't use XFREE to free items that cannot be NULL.
15904 * src/struniq.h, src/struniq.c: New.
15905 * src/main.c (main): Initialize/free struniqs.
15906 * src/parse-gram.y (%union): Add astruniq member.
15907 (yyprint): Adjust.
15908 * src/scan-gram.l (<{tag}>): Return a struniq.
15909 Free the obstack bit that used to store it.
15910 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
15911
159122002-11-11 Paul Eggert <eggert@twinsun.com>
15913
15914 Revamp to fix many (but not all) of the C- and M4-related quoting
15915 problems. Among other things, this fixes the Bison bug reported
15916 by Jan Hubicka when processing the Bash grammar; see:
15917 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
15918
15919 Use new @ escapes consistently. Represent brackets with @{ and @}
15920 rather than @<:@ and @:>@, since this works a bit better with dumb
15921 editors like vi. Represent @ with @@, since @ is now consistently
15922 an escape. Use @oline@ and @ofile@ rather than __oline__ and
15923 __ofile__, to avoid unexpected expansions. Similarly, use @output
15924 rather than #output.
15925
15926 * data/c.m4 (b4_copyright): Omit file name from comment, since
15927 the file name could contain "*/".
15928 (b4_synclines_flag): Don't quote the 2nd argument; it should already
15929 be quoted. All uses changed.
15930
15931 * data/glr.c: Use new @ escapes consistently.
15932 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
15933 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
15934 Remove, since they couldn't handle arbitrary characters in file
15935 names.
15936 * data/lalr1.cc: Likewise.
15937 * data/yacc.c: Likewise.
15938
15939 * src/files.c (output_infix): Remove; all uses removed.
15940 * src/files.h: Likewise.
15941
15942 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
15943 mishandled funny characters in file names, and anyway it isn't
15944 needed any more.
15945 * data/yacc.c: Likewise.
15946 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
15947
15948 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
15949 * data/yacc.c: Likewise.
15950
15951 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
15952 strings now.
15953 (muscle_init): Quote filename as a C string.
15954 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
15955 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
15956 * src/output.c (escaped_file_name_output): New function.
15957 (prepare_symbols): Quote tokens for M4.
15958 (prepare): Don't insert output_infix, output_prefix,
15959 output_parser_name, output_header_name; this is now down by scan-skel.
15960 Insert skeleton as a C string.
15961
15962 * src/output.c (user_actions_output, symbol_destructors_output,
15963 symbol_printers_output): Quote filenames for C and M4.
15964 * src/reader.c (prologue_augment, epilogue_set): Likewise.
15965
15966 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
15967 escapes other than \\ and \'; this simplifies the code.
15968 (<SC_STRING>): Likewise, for \\ and \".
15969 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
15970 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
15971 Use new escapes @{ and @} for [ and ].
15972
15973 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
15974 them with auto vars.
15975 Switch to new escape scheme, where @ is the escape character uniformly.
15976 Abort if a stray escape character is found. Avoid unbounded input
15977 buffer when parsing non-escaped text.
15978
15979 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
15980 __oline__, #output, $@, and @{ do not have unintended meanings.
15981
159822002-11-09 Paul Eggert <eggert@twinsun.com>
15983
15984 Fix the test failure due to GCC warnings described in
15985 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
15986 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
15987 evaluate to 0 if it's impossible for NINF to be in the respective
15988 table.
15989 (yygetLRActions, yyrecoverParseError): Use them.
15990
15991 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
15992 counted in the token inserted at end of file. Now takes
15993 location_t *, not location_t, so that the location can be
15994 adjusted. All uses changed.
15995
15996 * tests/regression.at (Invalid inputs): Adjust wording in
15997 diagnostic to match the new behavior.
15998
15999 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
16000 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
16001 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
16002 abort ();'. This reduces the runtime of the "Many lookaheads"
16003 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
16004 GCC 3.2.
16005
160062002-11-07 Paul Eggert <eggert@twinsun.com>
16007
16008 * src/parse-gram.y (CHARACTER): Remove unused token.
16009 All uses removed.
16010
16011 * src/scan-gram.l: Remove stack option. We no longer use the
16012 stack, since the stack was never deeper than 1; instead, use the
16013 new auto var c_context to record the stacked value.
16014
16015 Remove nounput option. At an unexpected end of file, we now unput
16016 the minimal input necessary to end cleanly; this simplifies the
16017 code.
16018
16019 Avoid unbounded token sizes where this is easy.
16020
16021 (unexpected_end_of_file): New function.
16022 Use it to systematize the error message on unexpected EOF.
16023 (last-string): Now auto, not static.
16024 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
16025 (scanner_last_string_free): Remove; not used.
16026 (percent_percent_count): Move decl to just before use.
16027 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
16028 not the (never otherwised-used) CHARACTER.
16029
160302002-11-07 Akim Demaille <akim@epita.fr>
16031
16032 Let yyerror always receive the msg as last argument, so that
16033 yyerror can be variadic.
16034
16035 * data/yacc.c (b4_yyerror_args): New.
16036 Use it when calling yyerror.
16037 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
16038 Use it when calling yyerror.
16039 * doc/bison.texinfo (Error Reporting): Adjust.
16040 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
16041 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
16042
160432002-11-06 Akim Demaille <akim@epita.fr>
16044
16045 #line should have quoted strings.
16046 Ideally, this should be done by m4_quotearg.
16047
16048 * src/scan-skel.l: Include quotearg.h.
16049 Quote __ofile__.
16050 * src/output.c (symbol_printers_output)
16051 (symbol_destructors_output): Quote the file name.
16052
160532002-11-06 Akim Demaille <akim@epita.fr>
16054
16055 * tests/regression.at (Invalid inputs): Adjust to the recent
16056 messages.
16057
160582002-11-06 Akim Demaille <akim@epita.fr>
16059
16060 Restore --no-lines.
16061 Reported by Jim Kent.
16062
16063 * data/c.m4 (b4_syncline): New.
16064 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
16065 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
16066 * src/output.c (user_actions_output): Likewise.
16067 (prepare): Define 'b4_synclines_flag'.
16068 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
16069
160702002-11-06 Akim Demaille <akim@epita.fr>
16071
16072 * src/main.c (main): Free `infile'.
16073 * src/scan-gram.l (handle_syncline): New.
16074 Recognize `#line'.
16075 * src/output.c (user_actions_output, symbol_destructors_output)
16076 (symbol_printers_output): Use the location's file name, not
16077 infile.
16078 * src/reader.c (prologue_augment, epilogue_set): Likewise.
16079
160802002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16081
16082 * src/tables.c (matching_state): Don't allow states to match if
16083 either has GLR conflict entries.
16084
160852002-11-05 Paul Eggert <eggert@twinsun.com>
16086
16087 * src/scan-gram.l: Use more accurate diagnostics, e.g.
16088 "integer out of range" rather than "invalid value".
16089 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
16090 accordingly.
16091
16092 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
16093 Also, remove one static variable in the scanner.
16094
16095 * src/scan-gram.l (braces_level): Now auto, not static.
16096 Initialize to zero if the compiler is being picky.
16097 (INITIAL): Clear braces_level instead of incrementing it.
16098 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
16099 as POSIX 1003.1-2001 requires.
16100 * src/system.h (IF_LINT): New macro, taken from coreutils.
16101 * configure.ac: Define "lint" if --enable-gcc-warnings.
16102
161032002-11-05 Akim Demaille <akim@epita.fr>
16104
16105 * src/scan-gram.l: When it starts with `%', complain about the
16106 whole directive, not just that `invalid character: %'.
16107
161082002-11-04 Akim Demaille <akim@epita.fr>
16109
16110 * Makefile.maint: Update from Autoconf.
16111 (update, cvs-update, po-update, do-po-update): New.
16112
161132002-11-04 Akim Demaille <akim@epita.fr>
16114
16115 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
16116 and yyerror.
16117 Have yyerror `use' its arguments.
16118 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
16119 returns true when location & yacc & pure & parse-param.
16120 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
16121
161222002-11-04 Akim Demaille <akim@epita.fr>
16123
16124 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
16125 clashes.
16126 * src/scan-gram.l: Use [\'] instead of ['] to pacify
16127 font-lock-mode.
16128 Use complain_at.
16129 Use quote, not quote_n since LOCATION_PRINT no longer uses the
16130 slot 0.
16131
161322002-11-03 Paul Eggert <eggert@twinsun.com>
16133
16134 * src/reader.c (get_merge_function, grammar_current_rule_check):
16135 Use consistent diagnostics for reporting type name clashes.
16136 Quote the types with <>, for consistency with Yacc.
16137 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
16138
161392002-11-03 Akim Demaille <akim@epita.fr>
16140
16141 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
16142 New.
16143 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
16144 (b4_parse_param): Remove.
16145 Use b4_identification.
16146 Propagate b4_pure_args where needed to pass them to yyerror.
16147 * data/glr.m4 (b4_parse_param): Remove.
16148 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
16149 (b4_lpure_formals): New.
16150 Use b4_identification.
16151 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
16152 b4_user_formals and b4_user_args.
16153 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
16154 (yyreportAmbiguity): When using a pure parser, also need
16155 the location, and the parse-params.
16156 Adjust callers.
16157 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
16158 When using a pure parser, also need the parse-params.
16159 Adjust callers.
16160 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
16161 (%pure-parser + %parse-param) LALR and GLR parsers.
16162 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
16163 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
16164 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
16165 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
16166 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
16167 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
16168 * doc/bison.texinfo: Untabify the whole file.
16169 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
16170 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
16171 (Error Reporting): Adjust to these new directives.
16172 Document %error-verbose, deprecate YYERROR_VERBOSE.
16173
161742002-11-03 Akim Demaille <akim@epita.fr>
16175
16176 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
16177 AT_CHECK_CALC_GLR invocations to use % directives, instead of
16178 command line options.
16179 * tests/cxx-type.at: Formatting changes.
16180
161812002-11-03 Paul Eggert <eggert@twinsun.com>
16182
16183 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
16184 to count columns correctly, and to check for invalid inputs.
16185
16186 Use mbsnwidth to count columns correctly. Account for tabs, too.
16187 Include mbswidth.h.
16188 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
16189 (extend_location): New function.
16190 (YY_LINES): Remove.
16191
16192 Handle CRLF in C code rather than in Lex code.
16193 (YY_INPUT): New macro.
16194 (no_cr_read): New function.
16195
16196 Scan UCNs, even though we don't fully handle them yet.
16197 (convert_ucn_to_byte): New function.
16198
16199 Handle backslash-newline correctly in C code.
16200 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
16201 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
16202 all uses changed.
16203 (tag, splice): New EREs. Do not allow NUL or newline in tags.
16204 Use {splice} wherever C allows backslash-newline.
16205 YY_STEP after space, newline, vertical-tab.
16206 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
16207
16208 (letter, id): Don't assume ASCII; e.g., spell out a-z.
16209
16210 ({int}, handle_action_dollar, handle_action_at): Check for integer
16211 overflow.
16212
16213 (YY_STEP): Omit trailing semicolon, so that it's more like C.
16214
16215 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
16216 as well as \000. Check for UCHAR_MAX, not 255.
16217 Allow \x with an arbitrary positive number of digits, as in C.
16218 Check for overflow here.
16219 Allow \? and UCNs, for compatibility with C.
16220
16221 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
16222 with quote slot used by complain_at.
16223
16224 * tests/input.at: Add tests for backslash-newline, m4 quotes
16225 in symbols, long literals, and funny escapes in strings.
16226
16227 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
16228 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
16229 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
16230 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
16231 * m4/mbswidth.m4: New file, from GNU coreutils.
16232
16233 * doc/bison.texinfo (Grammar Outline): Document // comments.
16234 (Symbols): Document that trigraphs have no special meaning in Bison,
16235 nor is backslash-newline allowed.
16236 (Actions): Document that trigraphs have no special meaning.
16237
16238 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
16239 no longer used.
16240
162412002-11-02 Paul Eggert <eggert@twinsun.com>
16242
16243 * src/reader.c: Don't include quote.h; not needed.
16244 (get_merge_function): Reword warning to be consistent with
16245 type clash diagnostic in grammar_current_rule_check.
16246
16247 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
16248 bug in trigraph handling.
16249
16250 * src/output.c (prepare_symbols): When printing token names,
16251 escape "[" as "@<:@" and likewise for "]".
16252
16253 * src/system.h (errno): Remove declaration, as we are now
16254 assuming C89 or better, and C89 guarantees errno.
16255
162562002-10-30 Paul Eggert <eggert@twinsun.com>
16257
16258 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
16259 Check for close failures.
16260 * src/files.h (xfclose): Return void, not int, since it always
16261 returned zero.
16262 * src/files.c (xfclose): Likewise. Report I/O error if ferror
16263 indicates one.
16264 * src/output.c (output_skeleton): Use xfclose rather than fclose
16265 and ferror. xfclose now checks ferror.
16266
16267 * data/glr.c (YYLEFTMOST_STATE): Remove.
16268 (yyreportTree): Use a stack-based leftmost state. This avoids
16269 our continuing battles with bogus warnings about initializers.
16270
162712002-10-30 Akim Demaille <akim@epita.fr>
16272
16273 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
16274 #if.
16275
162762002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16277
16278 * tests/glr-regr1.at: New test for reported regressions.
16279 * tests/testsuite.at: Add glr-regr1.at test.
16280 * tests/Makefile.am: Add glr-regr1.at test.
16281
162822002-10-24 Paul Eggert <eggert@twinsun.com>
16283
16284 Version 1.75a.
16285
16286 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
16287 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
16288 we use malloc. Don't assume 'A' through 'Z' are contiguous.
16289 Don't assume strdup exists; POSIX says its an XSI extension.
16290 Check for buffer overflow on input.
16291
162922002-10-24 Akim Demaille <akim@epita.fr>
16293
16294 * src/output.c (output_skeleton): Don't disable M4sugar comments
16295 too soon: it results in comments being expanded.
16296 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
16297 first output.
16298
162992002-10-24 Akim Demaille <akim@epita.fr>
16300
16301 * data/yacc.c (m4_int_type): New.
16302 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
16303 char' as only yacc.c wants K&R portability.
16304 * data/glr.c (yysigned_char): Remove.
16305 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
16306 Reported by Quoc Peyrot.
16307
163082002-10-23 Paul Eggert <eggert@twinsun.com>
16309
16310 * src/main.c (main): With --trace=time, report times even if a
16311 non-fatal error occurs. Formerly, the times were reported in some
16312 such cases but not in others.
16313 * src/reader.c (reader): Just return if a complaint has been issued,
16314 instead of exiting, so that 'main' can report times.
16315
163162002-10-22 Akim Demaille <akim@epita.fr>
16317
16318 * src/system.h: Include sys/types.
16319 Reported by Bert Deknuydt.
16320
163212002-10-23 Paul Eggert <eggert@twinsun.com>
16322
16323 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
16324 Suggested by Art Haas.
16325
163262002-10-22 Paul Eggert <eggert@twinsun.com>
16327
16328 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
16329 decl; not needed any more.
16330 * src/main.c (main): Use return to exit, undoing yesterday's change.
16331 The last OS that we could find where this wouldn't work is
16332 SunOS 3.5, and that's too old to worry about now.
16333
16334 * data/glr.c (struct yyltype): Define members even when not
16335 doing locations. This is more consistent with yacc.c, and it
16336 works around the following bug reports:
16337 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
16338 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
16339
16340 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
16341 @acronym consistently. Standardize on "Yacc" instead of "YACC",
16342 "Algol" instead of "ALGOL". Give a bit more history about BNF.
16343
163442002-10-22 Akim Demaille <akim@epita.fr>
16345
16346 * data/README: New.
16347
163482002-10-21 Paul Eggert <eggert@twinsun.com>
16349
16350 Be consistent about 'bool'; the old code used an enum in one
16351 module and an int in another, and this violates the C standard.
16352 * m4/stdbool.m4: New file, from coreutils 4.5.3.
16353 * configure.ac (AC_HEADER_STDBOOL): Add.
16354 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
16355 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
16356 * src/symtab.c (hash_compare_symbol_t): Likewise.
16357 * src/system.h (bool, false, true): Use a definition consistent
16358 with ../lib/hash.c. All uses changed.
16359
16360 * src/complain.c (warning_issued): Renamed from warn_message_count,
16361 so that we needn't worry about integer overflow (!).
16362 Now of type bool. All uses changed.
16363 (complaint_issued): Renamed from complain_message_count; likewise.
16364
16365 * src/main.c (main): Use exit to exit with failure.
16366
16367 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
16368 rather than 1 and 0.
16369 * src/main.c (main): Likewise.
16370 * src/getargs.c (getargs): Likewise.
16371 * src/reader.c (reader): Likewise.
16372
16373 * src/getarg.c (getargs): Remove duplicate code for
16374 "Try `bison --help'".
16375
16376 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
16377 What was that "2" for?
16378
16379 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
16380 * src/getargs.c (usage): Likewise.
16381
16382 * src/getargs.c (getargs): When there are too few operands, report
16383 the last one. When there are too many, report the first extra
16384 one. This is how diffutils does it.
16385
163862002-10-20 Paul Eggert <eggert@twinsun.com>
16387
16388 Remove K&R vestiges.
16389 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
16390 * src/complain.c (VA_START): Remove. Assume prototypes.
16391 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
16392 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
16393 fatal): Assume prototypes.
16394 * src/complain.h: Assume prototypes.
16395 * src/system.h (PARAMS): Remove.
16396 Include <limits.h> unconditionally, since it's guaranteeed even
16397 for a freestanding C89 compiler.
16398 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
16399 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
16400
164012002-10-20 Akim Demaille <akim@epita.fr>
16402
16403 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
16404 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
16405 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
16406 (yyresolveStates, yyresolveAction, yyresolveStack)
16407 (yyprocessOneStack): Use them.
16408 (yy_reduce_print): New.
16409 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
16410
164112002-10-20 Akim Demaille <akim@epita.fr>
16412
16413 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
16414 arguments and output `void'.
16415 (b4_c_function): Rename as...
16416 (b4_c_function_def): this.
16417 (b4_c_function_decl, b4_c_ansi_function_def)
16418 (b4_c_ansi_function_decl): New.
16419 Change the interpretation of the arguments: before `int, foo', now
16420 `int foo, foo'.
16421 * data/yacc.c (yyparse): Prototype and define thanks to these.
16422 Adjust b4_c_function_def uses.
16423 * data/glr.c (yyparse): Likewise, but ANSI only.
16424
164252002-10-20 Akim Demaille <akim@epita.fr>
16426
16427 * src/output.c (prepare): Move the definition of `tokens_number',
16428 `nterms_number', `undef_token_number', `user_token_number_max'
16429 to...
16430 (prepare_tokens): Here.
16431 (prepare_tokens): Rename as...
16432 (prepare_symbols): this.
16433 (prepare): Move the definition of `rules_number' to...
16434 (prepare_rules): here.
16435 (prepare): Move the definition of `last', `final_state_number',
16436 `states_number' to...
16437 (prepare_states): here.
16438 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
16439
164402002-10-20 Akim Demaille <akim@epita.fr>
16441
16442 * src/tables.h, src/tables.c, src/output.c: Comment changes.
16443
164442002-10-20 Akim Demaille <akim@epita.fr>
16445
16446 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
16447 * data/c.m4: here.
16448
164492002-10-20 Akim Demaille <akim@epita.fr>
16450
16451 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
16452 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
16453 `pair'.
16454 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
16455 `name' to...
16456 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
16457 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
16458 These.
16459
164602002-10-19 Paul Eggert <eggert@twinsun.com>
16461
16462 Do not create a temporary file, as that involves security and
16463 cleanup headaches. Instead, use a pair of pipes.
16464 Derived from a suggestion by Florian Krohm.
16465 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
16466 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
16467 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
16468 (BISON_PREREQ_SUBPIPE): Add.
16469 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
16470 Add subpipe.h, subpipe.c.
16471 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
16472 * po/POTFILES.in: Add lib/subpipe.c.
16473 * src/output.c: Include "subpipe.h".
16474 (m4_invoke): Remove decl.
16475 (scan_skel): New decl.
16476 (output_skeleton): Use pipe rather than temporary file for m4 input.
16477 Check that m4sugar.m4 is readable, to avoid deadlock.
16478 Check for pipe I/O error.
16479 * src/scan-skel.l (readpipe): Remove decl.
16480 (scan_skel): New function, to be used in place of m4_invoke.
16481 Read from stream rather than file.
16482
16483 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
16484 float, as this generates a warning on Solaris 8 + GCC 3.2 with
16485 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
16486 this generates a more-accurate value anyway.
16487
16488 * lib/timevar.c (timervar_accumulate): Rename locals to
16489 avoid confusion with similarly-named more-global.
16490 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
16491
16492 * src/output.c (prepare): Use xstrdup to convert char const *
16493 to char *, to avoid GCC warning.
16494
164952002-10-19 Akim Demaille <akim@epita.fr>
16496
16497 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
16498 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
16499 Use them to have `calc.y' ready for %pure-parser.
16500 * data/yacc.c (YYLEX): Pass a yylex return type to
16501 b4_c_function_call.
16502
165032002-10-19 Akim Demaille <akim@epita.fr>
16504
16505 Prototype support of %lex-param and %parse-param.
16506
16507 * src/parse-gram.y: Add the definition of the %lex-param and
16508 %parse-param tokens, plus their rules.
16509 Drop the `_' version of %glr-parser.
16510 Add the "," token.
16511 * src/scan-gram.l (INITIAL): Scan them.
16512 * src/muscle_tab.c: Comment changes.
16513 (muscle_insert, muscle_find): Rename `pair' as `probe'.
16514 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
16515 (muscle_entry_s): The `value' member is no longer const.
16516 Adjust all dependencies.
16517 * src/muscle_tab.c (muscle_init): Adjust: use
16518 MUSCLE_INSERT_STRING.
16519 Initialize the obstack earlier.
16520 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
16521 (muscle_pair_list_grow): New.
16522 * data/c.m4 (b4_c_function_call, b4_c_args): New.
16523 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
16524 * tests/calc.at: Use %locations, not --locations.
16525 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
16526
165272002-10-19 Akim Demaille <akim@epita.fr>
16528
16529 * src/getargs.c (usage): Take status as argument and exit
16530 accordingly.
16531 Report the traditional `Try ... --help' message when status != 0.
16532 (usage, version): Don't take a FILE * as arg, it is pointless.
16533 (getargs): When there is an incorrect number of arguments, make it
16534 an error, and report it GNUlically thanks to `usage ()'.
16535
165362002-10-18 Paul Eggert <eggert@twinsun.com>
16537
16538 * data/glr.c (yyreportParseError): Don't assume that sprintf
16539 yields the length of the printed string, as this is not true
16540 on SunOS 4.1.4. Reported by Peter Klein.
16541
16542 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
16543 * tests/conflicts.at (%nonassoc and eof): Likewise.
16544 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
16545
165462002-10-17 Akim Demaille <akim@epita.fr>
16547
16548 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
16549 * src/getargs.c (trace_types, trace_args): Adjust.
16550 * src/reader.c (grammar_current_rule_prec_set)
16551 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
16552 Standardize error messages.
16553 And s/@prec/%prec/!
16554 (reader): Use trace_flag to enable scanner/parser debugging,
16555 instead of an adhoc scheme.
16556 * src/scan-gram.l: Remove trailing debugging code.
16557
165582002-10-16 Paul Eggert <eggert@twinsun.com>
16559
16560 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
16561 MUSCLE_TAB_H.
16562
16563 * NEWS: Officially drop support for building Bison with K&R C,
16564 since it didn't work anyway and it's not worth worrying about.
16565 * Makefile.maint (wget_files): Remove ansi2knr.c.
16566 (ansi2knr.c-url_prefix): Remove.
16567 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
16568 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16569 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
16570
165712002-10-15 Paul Eggert <eggert@twinsun.com>
16572
16573 Stop using the "enum_" trick for K&R-style function definitions;
16574 it confused me, and I was the author! Instead, assume that people
16575 who want to use K&R C compilers (when using these modules in GCC,
16576 perhaps?) will run ansi2knr.
16577
16578 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
16579 All uses of "enum_" changed to "enum ".
16580 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
16581 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
16582
16583 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
16584 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
16585 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
16586 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
16587 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
16588 abitset_not, abitset_ones, abitset_or, abitset_or_and,
16589 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
16590 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
16591 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
16592 Use function prototypes; this removes the need for declaring
16593 static functions simply to provide their prototypes.
16594 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
16595 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
16596 bitset_count_, bitset_create, bitset_dump, bitset_first,
16597 bitset_free, bitset_init, bitset_last, bitset_next,
16598 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
16599 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
16600 bitset_print, bitset_release_memory, bitset_toggle_,
16601 bitset_type_choose, bitset_type_get, bitset_type_name_get,
16602 debug_bitset): Likewise.
16603 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
16604 * lib/bitset_stats.c (bitset_log_histogram_print,
16605 bitset_percent_histogram_print, bitset_stats_and,
16606 bitset_stats_and_cmp, bitset_stats_and_or,
16607 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
16608 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
16609 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
16610 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
16611 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
16612 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
16613 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
16614 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
16615 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
16616 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
16617 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
16618 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
16619 bitset_stats_zero): Likewise.
16620 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
16621 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
16622 bitsetv_dump, debug_bitsetv): Likewise.
16623 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
16624 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
16625 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
16626 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
16627 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
16628 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
16629 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
16630 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
16631 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
16632 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
16633 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
16634 Likewise.
16635 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
16636 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
16637 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
16638 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
16639 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
16640 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
16641 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
16642 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
16643 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
16644 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
16645 lbitset_xor_cmp, lbitset_zero): Likewise.
16646
166472002-10-14 Akim Demaille <akim@epita.fr>
16648
16649 Version 1.75.
16650
166512002-10-14 Akim Demaille <akim@epita.fr>
16652
16653 * tests/Makefile.am (maintainer-check-posix): New.
16654
166552002-10-14 Akim Demaille <akim@epita.fr>
16656
16657 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
16658 member.
16659
166602002-10-14 Akim Demaille <akim@epita.fr>
16661
16662 * src/tables.c (table_ninf_remap): base -> tab.
16663 Reported by Matt Rosing.
16664
166652002-10-14 Paul Eggert <eggert@twinsun.com>
16666
16667 * tests/action.at, tests/calc.at, tests/conflicts.at,
16668 tests/cxx-type.at, tests/headers.at, tests/input.at,
16669 tests/regression.at, tests/synclines.at, tests/torture.at:
16670 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
16671 so that the tests still work even if POSIXLY_CORRECT is set.
16672 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
16673
16674 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
16675 for portability to K&R hosts. Fix typo: signed char is guaranteed
16676 only to 127, not to 128.
16677 * data/glr.c (yysigned_char): New type.
16678 * data/yacc.c (yysigned_char): Likewise.
16679 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
16680
166812002-10-13 Paul Eggert <eggert@twinsun.com>
16682
16683 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
16684 true due to limited range of data type" warning from GCC.
16685
16686 * data/c.m4 (b4_token_defines): Protect against double-inclusion
16687 by wrapping enum yytokentype's definition inside #ifndef
16688 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
16689
166902002-10-13 Akim Demaille <akim@epita.fr>
16691
16692 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
16693 Un yy- yyrhs to avoid the name clash with the global YYRHS.
16694
166952002-10-13 Akim Demaille <akim@epita.fr>
16696
16697 * Makefile.maint: Update from Autoconf 2.54.
16698 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
16699
167002002-10-13 Akim Demaille <akim@epita.fr>
16701
16702 * src/print.c (print_state): Separate the list of solved conflicts
16703 from the other items.
16704 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
16705
167062002-10-13 Akim Demaille <akim@epita.fr>
16707
16708 Let nondeterministic skeletons be usable with deterministic
16709 tables.
16710
16711 With the patch, GAWK compiled by GCC without -O2 passes its test
16712 suite using a GLR parser driven by LALR tables. It fails with -O2
16713 because `struct stat' gives two different answers on my machine:
16714 88 (definition of an auto var) and later 96 (memset on this var).
16715 Hence the stack is badly corrumpted. The headers inclusion is to
16716 blame: if I move the awk.h inclusion before GLR's system header
16717 inclusion, the two struct stat have the same size.
16718
16719 * src/tables.c (pack_table): Always create conflict_table.
16720 (token_actions): Always create conflict_list.
16721 * data/glr.c (YYFLAG): Remove, unused.
16722
167232002-10-13 Akim Demaille <akim@epita.fr>
16724
16725 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
16726 (O0FLAGS): New.
16727 (VALGRIND, GXX): New.
16728 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
16729 * tests/bison.in: Run $PREBISON a pre-command.
16730 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
16731 (maintainer-check-g++): New.
16732 * Makefile.am (maintainer-check): New.
16733
167342002-10-13 Akim Demaille <akim@epita.fr>
16735
16736 * data/glr.c: Formatting changes.
16737 Tweak some trace messages to match yacc.c's.
16738
167392002-10-13 Akim Demaille <akim@epita.fr>
16740
16741 GLR parsers sometimes raise parse errors instead of performing the
16742 default reduction.
16743 Reported by Charles-Henry de Boysson.
16744
16745 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
16746 check the length of the traces when %glr.
16747 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
16748 GLR's traces.
16749 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
16750 Test GLR parsers.
16751 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
16752 (yyltype): Remove the yy prefix from the member names.
16753 (yytable): Complete its comment.
16754 (yygetLRActions): Map error action number from YYTABLE from
16755 YYTABLE_NINF to 0.
16756 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
16757 (which was a bug: it should have been YYTABEL_NINF, and yet it was
16758 not satisfying as we could compare an YYACTION computed from
16759 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
16760 only value for error actions.
16761 (yyreportParseError): In verbose parse error messages, don't issue
16762 `error' in the list of expected tokens.
16763 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
16764 next action to perform to match glr.c's decoding.
16765 (yytable): Complete its comment.
16766
167672002-10-13 Paul Eggert <eggert@twinsun.com>
16768
16769 Fix problem reported by Henrik Grubbstroem in
16770 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
16771 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
16772 because the Bison parser reads the second action before reducing
16773 the first one.
16774 * src/scan-gram.l (rule_length): New static var.
16775 Use it to keep track of the rule length in the scanner, since
16776 we can't expect the parser to be in lock-step sync with the scanner.
16777 (handle_action_dollar, handle_action_at): Use this var.
16778 * tests/actions.at (Exotic Dollars): Test for the problem.
16779
167802002-10-12 Paul Eggert <eggert@twinsun.com>
16781
16782 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
16783 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
16784 Include <sys/time.h> when checking for clock_t and struct tms.
16785 Use same include order as source.
16786 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
16787 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
16788
16789 * lib/timevar.c: Update copyright date and clarify comments.
16790 (get_time) [IN_GCC]: Keep the GCC version for reference.
16791
16792 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
16793 GCC version as of today, then merge Bison's changes.
16794 Change "GCC" to "Bison" in copyright notice. timevar.def's
16795 author is Akim, so change that too.
16796
16797 * src/reader.c (grammar_current_rule_check):
16798 Don't worry about the default action if $$ is untyped.
16799 Prevents bogus warnings reported by Jim Gifford in
16800 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
16801
16802 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
16803 * data/glr.c, data/lalr1.cc, data/yacc.c:
16804 Output token definitions before the first part of user declarations.
16805 Fixes compatibility problem reported by Jim Gifford for kbd in
16806 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
16807
168082002-10-11 Paul Eggert <eggert@twinsun.com>
16809
16810 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
16811 (yyparse): here. This undoes some of the 2002-07-25 change.
16812 Compatibility problem reported by Ralf S. Engelschall with
16813 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
16814
168152002-10-11 Akim Demaille <akim@epita.fr>
16816
16817 * tests/regression.at Characters Escapes): New.
16818 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
16819 characters.
16820 Reported by Jan Nieuwenhuizen.
16821
168222002-10-11 Akim Demaille <akim@epita.fr>
16823
16824 * po/id.po: New.
16825
168262002-10-10 Paul Eggert <eggert@twinsun.com>
16827
16828 Portability fixes for bitsets; this also avoids several GCC
16829 warnings.
16830
16831 * lib/abitset.c: Include <stddef.h>, for offsetof.
16832 * lib/lbitset.c: Likewise.
16833
16834 * lib/abitset.c (abitset_bytes): Return a size that is aligned
16835 properly for vectors of objects. Do not assume that adding a
16836 header size to a multiple of a word size yields a value that is
16837 properly aligned for the whole union.
16838 * lib/bitsetv.c (bitsetv_alloc): Likewise.
16839
16840 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
16841 unique names for structures.
16842 * lib/ebitset.c (ebitset_bytes): Likewise.
16843 * lib/lbitset.c (lbitset_bytes): Likewise.
16844
16845 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
16846 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
16847 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
16848 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
16849 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
16850 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
16851 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
16852 to improve the type-checking that GCC can do.
16853 * lib/bitset.c (bitset_op4_cmp): Likewise.
16854 * lib/bitset_stats.c (bitset_stats_count,
16855 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
16856 bitset_stats_copy, bitset_stats_disjoint_p,
16857 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
16858 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
16859 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
16860 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
16861 bitset_stats_and_or_cmp, bitset_stats_andn_or,
16862 bitset_stats_andn_or_cmp, bitset_stats_or_and,
16863 bitset_stats_or_and_cmp): Likewise.
16864 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
16865 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
16866 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
16867 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
16868
16869 * lib/abitset.h: Include bitset.h, not bbitset.h.
16870 * lib/ebitset.h: Likewise.
16871 * lib/lbitset.h: Likewise.
16872
16873 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
16874 All instances of parameters of type enum bitset_opts are now of
16875 type enum_bitset_opts, to conform to the C Standard, and similarly
16876 for enum_bitset_type.
16877 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
16878 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
16879
16880 Do not use "struct bitset_struct" to mean different things in
16881 different modules. Not only is this confusing, it violates
16882 the C Standard, which requires that structure types in different
16883 modules must be compatible if one is to be passed to the other.
16884 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
16885 All instances of "struct bitset_struct *" replaced with "bitset".
16886 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
16887 (union bitset_union, struct abitset_struct, struct ebitset_struct,
16888 struct lbitset_struct, struct bitset_stats_struct): New types.
16889 All uses of struct bitset_struct changed to union bitset_union,
16890 etc.
16891 * lib/abitset.c (struct abitset_struct, abitset,
16892 struct bitset_struct): Remove.
16893 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
16894 struct bitset_struct): Remove.
16895 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
16896 bitset_struct): Remove.
16897 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
16898 Likewise.
16899
16900 Do not call a function of type T using a call that assumes the
16901 function is of a different type U. Standard C requires that a
16902 function must be called with a type that is compatible with its
16903 definition.
16904 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
16905 New decls.
16906 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
16907 New functions.
16908 * lib/ebitset.c (PFV): Remove.
16909 * lib/lbitset.c (PFV): Likewise.
16910 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
16911 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
16912 decls.
16913 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
16914 (ebitset_vtable): Use them.
16915 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
16916 lbitset_xor): New functions.
16917 (lbitset_vtable): Use them.
16918
16919 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
16920 Declare.
16921
16922 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
16923 GCC warning.
16924 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
16925 Use offsetof, for simplicity.
16926
169272002-10-06 Paul Eggert <eggert@twinsun.com>
16928
16929 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
16930 the same width as int. This reapplies a hunk of the 2002-08-12 patch
16931 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
16932 which was inadvertently undone by the 2002-09-30 patch.
16933 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
16934 the same width as int.
16935
169362002-10-04 Paul Eggert <eggert@twinsun.com>
16937
16938 Version 1.50.
16939
16940 * configure.ac (AC_INIT), NEWS: Increment version number.
16941
16942 * doc/bison.texinfo: Minor spelling, grammar, and white space
16943 fixes.
16944 (Symbols): Mention that any negative value returned from yylex
16945 signifies end-of-input. Warn about negative chars. Mention
16946 the portable Standard C character set.
16947
16948 The GNU coding standard says CFLAGS and YFLAGS are reserved
16949 for the installer to set.
16950 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
16951 * src/Makefile.am (AM_CFLAGS): Likewise.
16952 (AM_YFLAGS): Renamed from YFLAGS.
16953
16954 Fix some MAX and MIN problems.
16955 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
16956 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
16957 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
16958 * src/reader.c (reader): Use it.
16959
16960 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
16961 POSIX 1003.1-2001 has removed fgrep.
16962
169632002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
16964
16965 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
16966 interpreted as signed.
16967 * lib/ebitset.c (ebitset_list): Fix bug.
16968
169692002-10-01 Paul Eggert <eggert@twinsun.com>
16970
16971 More fixes for 64-bit hosts and large bitsets.
16972
16973 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
16974 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
16975 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
16976 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
16977 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
16978 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
16979 bitset_count_): Likewise.
16980 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
16981 bitset_first, bitset_last): Likewise.
16982 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
16983 bitset_stats_list_reverse, bitset_stats_size,
16984 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
16985 Likewise.
16986 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
16987 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
16988 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
16989 bitsetv_reflexive_transitive_closure): Likewise.
16990 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
16991 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
16992 Likewise.
16993 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
16994 Likewise.
16995
16996 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
16997 Use size_t, not unsigned int, to count bytes.
16998 * lib/abitset.h (abitset_bytes): Likewise.
16999 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
17000 Likewise.
17001 * lib/bitset.h (bitset_bytes): Likewise.
17002 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
17003 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
17004 * lib/bitsetv.c (bitsetv_alloc): Likewise.
17005 * lib/ebitset.c (ebitset_bytes): Likewise.
17006 * lib/ebitset.h (ebitset_bytes): Likewise.
17007 * lib/lbitset.c (lbitset_bytes): Likewise.
17008 * lib/lbitset.h (lbitset_bytes): Likewise.
17009
17010 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
17011 abitset_subset_p, abitset_disjoint_p, abitset_and,
17012 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
17013 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
17014 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
17015 abitset_or_and, abitset_or_and_cmp):
17016 Use bitset_windex instead of unsigned int.
17017 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
17018 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
17019 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
17020 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
17021 Likewise.
17022 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
17023
17024 * lib/bitset.c (bitset_print):
17025 Use proper printf formats for widths of integer types.
17026 * lib/bitset_stats.c (bitset_percent_histogram_print,
17027 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
17028 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
17029 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
17030 * lib/lbitset.c (lbitset_bytes): Likewise.
17031
17032 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
17033 BITSET_SIZE_MAX): New macros.
17034 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
17035 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
17036 to BITSET_WINDEX_MAX.
17037
17038 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
17039 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
17040 since we now return the bitset_bindex type (not int).
17041
17042 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
17043 when computing sizes.
17044 * lib/ebitset.c (ebitset_elts_grow): Likewise.
17045
17046 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
17047 and avoid cast to unsigned.
17048
170492002-09-30 Akim Demaille <akim@epita.fr>
17050
17051 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
17052 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
17053 Updates from Michael Hayes.
17054
170552002-09-30 Art Haas <ahaas@neosoft.com>
17056
17057 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
17058 invocations.
17059 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
17060 defined.
17061
170622002-09-27 Akim Demaille <akim@epita.fr>
17063
17064 Version 1.49c.
17065
170662002-09-27 Akim Demaille <akim@epita.fr>
17067
17068 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
17069 (Because of AC_LIBSOURCE).
17070
170712002-09-27 Akim Demaille <akim@epita.fr>
17072
17073 Playing with Autoscan.
17074
17075 * configure.ac: Remove the old LIBOBJ tweaks.
17076 (AC_REPLACE_FUNCS): Add strrchr and strtol.
17077 * lib/strrchr.c: New.
17078 * lib/strtol.c: New, from the Coreutils 4.5.1.
17079
170802002-09-27 Akim Demaille <akim@epita.fr>
17081
17082 Playing with Autoscan.
17083
17084 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
17085 * lib/Makefile.am (libbison_a_SOURCES): No longer include
17086 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
17087 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
17088 Coreutils 4.5.1.
17089
170902002-09-24 Akim Demaille <akim@epita.fr>
17091
17092 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
17093 (Frequently Asked Questions, Parser Stack Overflow): New.
17094
170952002-09-13 Akim Demaille <akim@epita.fr>
17096
17097 Playing with autoscan.
17098
17099 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
17100 * src/files.c (skeleton_find): Remove, unused.
17101 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
17102 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
17103
171042002-09-13 Akim Demaille <akim@epita.fr>
17105
17106 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
17107 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
17108
171092002-09-13 Akim Demaille <akim@epita.fr>
17110
17111 * configure.ac: Require 2.54.
17112 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
17113 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
17114 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
17115 Remove, provided by Autoconf macros.
17116
171172002-09-12 Akim Demaille <akim@epita.fr>
17118
17119 * m4/prereq.m4: Update, from Coreutils 4.5.1.
17120
171212002-09-12 Akim Demaille <akim@epita.fr>
17122
17123 * m4/prereq.m4: Update, from Fileutils 4.1.5.
17124 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
17125 Reported by Martin Mokrejs.
17126
171272002-09-10 Akim Demaille <akim@epita.fr>
17128
17129 * src/parse-gram.y: Associate a human readable string to each
17130 token type.
17131 * tests/regression.at (Invalid inputs): Adjust.
17132
171332002-09-10 Gary V. Vaughan <gary@gnu.org>
17134
17135 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
17136 with an Autoconf-2.5x style configure.ac.
17137
171382002-09-06 Paul Eggert <eggert@twinsun.com>
17139
17140 * doc/bison.texinfo (Conditions): Make explicit that the GPL
17141 exception applies only to yacc.c. This is a modification of a
17142 patch originally suggested by Akim Demaille.
17143
171442002-09-06 Akim Demaille <akim@epita.fr>
17145
17146 * data/c.m4 (b4_copyright): Move the GPL exception comment from
17147 here to...
17148 * data/yacc.c: here.
17149
17150 * data/lalr1.cc (struct yyltype): Don't define it, since we use
17151 LocationType.
17152 (b4_ltype): Default to yy::Location from location.hh.
17153
171542002-09-04 Jim Meyering <jim@meyering.net>
17155
17156 * data/yacc.c: Guard the declaration of yytoknum also with
17157 `#ifdef YYPRINT', so it is declared only when used.
17158
171592002-09-04 Akim Demaille <akim@epita.fr>
17160
17161 * configure.in: Rename as...
17162 * configure.ac: this.
17163 Bump to 1.49c.
17164
171652002-09-04 Akim Demaille <akim@epita.fr>
17166
17167 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
17168 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
17169 translate maintainer only messages.
17170
171712002-08-12 Paul Eggert <eggert@twinsun.com>
17172
17173 Version 1.49b.
17174
17175 * Makefile.am (SUBDIRS): Remove intl.
17176 (DISTCLEANFILES): Remove.
17177 * NEWS: Mention that GNU M4 is now required. Clarify what is
17178 meant by "larger grammars". Mention the pt_BR translation.
17179 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
17180 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
17181 Bump version from 0.11.2 to 0.11.5.
17182 (BISON_PREREQ_STAGE): Remove.
17183 (AM_GNU_GETTEXT): Use external gettext.
17184 (AC_OUTPUT): Remove intl/Makefile.
17185
17186 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
17187
17188 * data/glr.c: Include string.h, for strlen.
17189 (yyreportParseError): Use size_t for yysize.
17190 (yy_yypstack): No longer nested inside yypstates, as nested
17191 functions are not portable. Do not assume size_t is the
17192 same width as int.
17193 (yypstates): Do not assume that ptrdiff_t is the same width
17194 as int, and similarly for yyposn and YYINDEX.
17195
17196 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
17197
17198 * lib/Makefile.am (INCLUDES): Do not include from the intl
17199 directory, which has been removed.
17200 * src/Makefile.am (INCLUDES): Likewise.
17201
17202 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
17203 (bitsets_sources, additional_bitsets_sources, timevars_sources):
17204 New vars.
17205
17206 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
17207 * tests/Makefile.am (EXTRA_DIST): Likewise.
17208
17209 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
17210 Do not assume that bitset_windex is the same width as unsigned.
17211
17212 * lib/abitset.c (abitset_unused_clear): Do not assume that
17213 bitset_word is the same width as int.
17214 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
17215 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
17216 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
17217 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
17218 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
17219
17220 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
17221 portability to one's complement hosts!).
17222 * lib/ebitset.c (ebitset_op1): Likewise.
17223 * lib/lbitset.c (lbitset_op1): Likewise.
17224
17225 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
17226 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
17227 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
17228 Sync with fileutils.
17229 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
17230 lib/gettext.h: Sync with diffutils.
17231
17232 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
17233 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
17234
17235 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
17236 PROTOTYPES to check for prototypes, and "defined __STDC__" to
17237 check for void *.
17238
17239 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
17240 size_t; the old version tried to do this but casted improperly.
17241 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
17242 (bitset_test): Now returns int, not unsigned long.
17243
17244 * lib/bitset_stats.c: Include "gettext.h".
17245 (_): New macro.
17246 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
17247 name locals "index", as it generates unnecessary warnings on some
17248 hosts that have an "index" function.
17249
17250 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
17251 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
17252 they need translation.
17253 * src/LR0.c (state_list_append, new_itemsets, get_state,
17254 append_states, generate_states): Likewise.
17255 * src/assoc.c (assoc_to_string): Likewise.
17256 * src/closure.c (print_closure, set_firsts, closure): Likewise.
17257 * src/gram.c (grammar_dump): Likewise.
17258 * src/injections.c (injections_compute): Likewise.
17259 * src/lalr.c (lookaheads_print): Likewise.
17260 * src/relation.c (relation_transpose): Likewise.
17261 * src/scan-gram.l: Likewise.
17262 * src/tables.c (table_grow, pack_vector): Likewise.
17263
17264 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
17265 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
17266 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
17267 * m4/mbstate_t.m4: Sync with fileutils.
17268 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
17269
17270 * po/LINGUAS: Add pt_BR.
17271 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
17272 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
17273 lib/timevar.c.
17274 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
17275 manual recommends.
17276 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
17277
17278 * src/complain.c (strerror_r): Remove decl; not needed.
17279 (strerror): Use same pattern as ../lib/error.c.
17280
17281 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
17282
17283 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
17284
17285 * src/main.c (main): Cast result of bindtextdomain and textdomain
17286 to void, to avoid a GCC warning when --disable-nls is in effect.
17287
17288 * src/scan-gram.l: Use strings rather than escapes when possible,
17289 to minimize the number of warnings from xgettext.
17290 (handle_action_dollar, handle_action_at): Don't use isdigit,
17291 as it mishandles negative chars and it may not work as expected
17292 outside the C locale.
17293
17294 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
17295 this is a GCC extension and is not portable to other compilers.
17296
17297 * src/system.h (alloca): Use same pattern as ../lib/error.c.
17298 Do not include <ctype.h>; no longer needed.
17299 Do not include <malloc.h>; no longer needed (and generates
17300 warnings on OpenBSD 3.0).
17301
17302 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
17303 it's not portable.
17304
17305 * tests/regression.at: Do not use 'cc -c input.c -o input';
17306 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
17307
17308 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
17309 exit status as failure, not just exit status 1. Sun C exits
17310 with status 2 sometimes.
17311
17312 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
17313 Use it for the two large tests.
17314
173152002-08-02 Akim Demaille <akim@epita.fr>
17316
17317 * src/conflicts.c (conflicts_output): Don't output rules never
17318 reduced here, since anyway that computation doesn't work.
17319 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
17320 (rule_useless_p, rule_never_reduced_p): New.
17321 (grammar_rules_partial_print): Use a filter instead of a range.
17322 Display the title only if needed.
17323 (grammar_rules_print): Adjust.
17324 (grammar_rules_never_reduced_report): New.
17325 * src/tables.c (action_row): Move the computation of rules never
17326 reduced to...
17327 (token_actions): here.
17328 * src/main.c (main): Make the parser before making the report, so
17329 that rules never reduced are computed.
17330 Call grammar_rules_never_reduced_report.
17331 * src/print.c (print_results): Report rules never reduced.
17332 * tests/conflicts.at, tests/reduce.at: Adjust.
17333
173342002-08-01 Akim Demaille <akim@epita.fr>
17335
17336 Instead of attaching lookaheads and duplicating the rules being
17337 reduced by a state, attach the lookaheads to the reductions.
17338
17339 * src/state.h (state_t): Remove the `lookaheads',
17340 `lookaheads_rule' member.
17341 (reductions_t): Add a `lookaheads' member.
17342 Use a regular array for the `rules'.
17343 * src/state.c (reductions_new): Initialize the lookaheads member
17344 to 0.
17345 (state_rule_lookaheads_print): Adjust.
17346 * src/state.h, src/state.c (state_reductions_find): New.
17347 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
17348 (count_rr_conflicts): Adjust.
17349 * src/lalr.c (LArule): Remove.
17350 (add_lookback_edge): Adjust.
17351 (state_lookaheads_count): New.
17352 (states_lookaheads_initialize): Merge into...
17353 (initialize_LA): this.
17354 (lalr_free): Adjust.
17355 * src/main.c (main): Don't free nullable and derives too early: it
17356 is used by --verbose.
17357 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
17358
173592002-08-01 Akim Demaille <akim@epita.fr>
17360
17361 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
17362 `rule_number_t**'.
17363 (set_derives, free_derives): Rename as...
17364 (derives_compute, derives_free): this.
17365 Adjust all dependencies.
17366 * src/nullable.c (set_nullable, free_nullable): Rename as...
17367 (nullable_compute, nullable_free): these.
17368 (rule_list_t): Store rule_t *, not rule_number_t.
17369 * src/state.c (state_rule_lookaheads_print): Directly compare rule
17370 pointers, instead of their numbers.
17371 * src/main.c (main): Call nullable_free, and derives_free earlier,
17372 as they were lo longer used.
17373
173742002-08-01 Akim Demaille <akim@epita.fr>
17375
17376 * lib/timevar.c (get_time): Include children time.
17377 * src/lalr.h (LA, LArule): Don't export them: used with the
17378 state_t.
17379 * src/lalr.c (LA, LArule): Static.
17380 * src/lalr.h, src/lalr.c (lalr_free): New.
17381 * src/main.c (main): Call it.
17382 * src/tables.c (pack_vector): Check whether loc is >= to the
17383 table_size, not >.
17384 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
17385 (tables_generate): do it, since that's also it which allocates
17386 them.
17387 Don't free LA and LArule, main does.
17388
173892002-07-31 Akim Demaille <akim@epita.fr>
17390
17391 Separate parser tables computation and output.
17392
17393 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
17394 (conflict_list, conflict_list_cnt, table, check, table_ninf)
17395 (yydefgoto, yydefact, high): Move to...
17396 * src/tables.h, src/tables.c: here.
17397 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17398 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17399 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
17400 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
17401 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
17402 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
17403 (action_row, save_row, token_actions, save_column, default_goto)
17404 (goto_actions, sort_actions, matching_state, pack_vector)
17405 (table_ninf_remap, pack_table, prepare_actions): Move to...
17406 * src/tables.c: here.
17407 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
17408 * src/output.c (token_actions, output_base, output_conflicts)
17409 (output_check): Merge into...
17410 (prepare_actions): this.
17411 (actions_output): Rename as...
17412 (user_actions_output): this.
17413 * src/main.c (main): Call tables_generate and tables_free.
17414
174152002-07-31 Akim Demaille <akim@epita.fr>
17416
17417 Steal GCC's --time-report support.
17418
17419 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
17420 stolen/adjusted from GCC.
17421 * m4/stage.m4: Remove time related checks.
17422 * m4/timevar.m4: New.
17423 * configure.in: Adjust.
17424 * src/system.h: Adjust to using timevar.h.
17425 * src/getargs.h, src/getargs.c: Support trace_time for
17426 --trace=time.
17427 * src/main.c (stage): Remove.
17428 (main): Replace `stage' invocations with timevar calls.
17429 * src/output.c: Insert pertinent timevar calls.
17430
174312002-07-31 Akim Demaille <akim@epita.fr>
17432
17433 Let --trace have arguments.
17434
17435 * src/getargs.h (enum trace_e): New.
17436 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
17437 (long_options, short_options): --trace/-T takes an optional
17438 argument.
17439 Change all the uses of trace_flag to reflect the new flags.
17440 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
17441
17442 Strengthen `stage' portability.
17443
17444 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
17445 * configure.in: Use it.
17446 Don't check for malloc.h and sys/times.h.
17447 * src/system.h: Include them when appropriate.
17448 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
17449 times and struct tms are available.
17450
174512002-07-30 Akim Demaille <akim@epita.fr>
17452
17453 In verbose parse error message, don't report `error' as an
17454 expected token.
17455 * tests/actions.at (Printers and Destructors): Adjust.
17456 * tests/calc.at (Calculator $1): Adjust.
17457 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
17458 error message, do not report the parser accepts the error token in
17459 that state.
17460
174612002-07-30 Akim Demaille <akim@epita.fr>
17462
17463 Normalize conflict related messages.
17464
17465 * src/complain.h, src/complain.c (warn, complain): New.
17466 * src/conflicts.c (conflicts_print): Use them.
17467 (conflict_report_yacc): New, extracted from...
17468 (conflicts_print): here.
17469 * tests/conflicts.at, tests/existing.at: Adjust.
17470
174712002-07-30 Akim Demaille <akim@epita.fr>
17472
17473 Report rules which are never reduced by the parser: those hidden
17474 by conflicts.
17475
17476 * src/LR0.c (save_reductions): Don't make the final state too
17477 different: save its reduction (accept) instead of having a state
17478 without any action (no shift or goto, no reduce).
17479 Note: the final state is now a ``regular'' state, i.e., the
17480 parsers now contain `reduce 0' as default reduction.
17481 Nevertheless, since they decide to `accept' when yystate =
17482 final_state, they still will not reduce rule 0.
17483 * src/print.c (print_actions, print_reduction): Adjust.
17484 * src/output.c (action_row): Track reduced rules.
17485 (token_actions): Report rules never reduced.
17486 * tests/conflicts.at, tests/regression.at: Adjust.
17487
174882002-07-30 Akim Demaille <akim@epita.fr>
17489
17490 `stage' was accidently included in a previous patch.
17491 Initiate its autoconfiscation.
17492
17493 * configure.in: Look for malloc.h and sys/times.h.
17494 * src/main.c (stage): Adjust.
17495 Report only when trace_flag.
17496
174972002-07-29 Akim Demaille <akim@epita.fr>
17498
17499 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
17500 state_number_t.
17501 (errs_t): symbol_t*, not symbol_number_t.
17502 (reductions_t): rule_t*, not rule_number_t.
17503 (FOR_EACH_SHIFT): New.
17504 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
17505 * src/print.c, src/print_graph.c: Adjust.
17506
175072002-07-29 Akim Demaille <akim@epita.fr>
17508
17509 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
17510
17511 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
17512 (endtoken, accept): these.
17513 * src/reader.c (reader): Set endtoken's default tag to "$end".
17514 Set undeftoken's tag to "$undefined" instead of "$undefined.".
17515 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
17516 Adjust.
17517
175182002-07-29 Akim Demaille <akim@epita.fr>
17519
17520 * src/reduce.c (reduce_grammar): When the language is empty,
17521 complain about the start symbol, not the axiom.
17522 Use its location.
17523 * tests/reduce.at (Empty Language): New.
17524
175252002-07-26 Akim Demaille <akim@epita.fr>
17526
17527 * src/reader.h, src/reader.c (gram_error): ... can't get
17528 yycontrol without making too strong assumptions on the parser
17529 itself.
17530 * src/output.c (prepare_tokens): Use the real 0th value of
17531 token_translations instead of `0'.
17532 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
17533 visible here.
17534 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
17535 for the time being: %locations ought to provide it to yyerror.
17536
175372002-07-25 Akim Demaille <akim@epita.fr>
17538
17539 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
17540 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
17541 * tests/regression.at (Web2c Actions): Adjust.
17542
175432002-07-25 Akim Demaille <akim@epita.fr>
17544
17545 Stop storing rules from 1 to nrules + 1.
17546
17547 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
17548 * src/nullable.c, src/output.c, src/print.c, src/reader.c
17549 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
17550 Iterate from 0 to nrules.
17551 Use rule_number_as_item_number and item_number_as_rule_number.
17552 Adjust to `derive' now containing possibly 0.
17553 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
17554 Handle the `- 1' part in rule numbers from/to item numbers.
17555 * src/conflicts.c (log_resolution): Fix the message which reversed
17556 shift and reduce.
17557 * src/output.c (action_row): Initialize default_rule to -1.
17558 (token_actions): Adjust.
17559 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
17560 expected output.
17561 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
17562
175632002-07-25 Akim Demaille <akim@epita.fr>
17564
17565 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
17566 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
17567 (b4_c_knr_arg_decl): New.
17568 * data/yacc.c: Use it to define yysymprint, yydestruct, and
17569 yyreport_parse_error.
17570
175712002-07-25 Akim Demaille <akim@epita.fr>
17572
17573 * data/yacc.c (yyreport_parse_error): New, extracted from...
17574 (yyparse): here.
17575 (yydestruct, yysymprint): Move above yyparse.
17576 Be K&R compliant.
17577
175782002-07-25 Akim Demaille <akim@epita.fr>
17579
17580 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
17581 replace...
17582 (b4_sint_type, b4_uint_type): these.
17583 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
17584 * tests/regression.at (Web2c Actions): Adjust.
17585
175862002-07-25 Akim Demaille <akim@epita.fr>
17587
17588 * src/gram.h (TIEM_NUMBER_MAX): New.
17589 (item_number_of_rule_number, rule_number_of_item_number): Rename
17590 as...
17591 (rule_number_as_item_number, item_number_as_rule_number): these.
17592 Adjust dependencies.
17593 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
17594 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
17595 (symbol_number_to_vector_number): New.
17596 (order): Of vector_number_t* type.
17597 (base_t, BASE_MAX, BASE_MIN): New.
17598 (froms, tos, width, pos, check): Of base_t type.
17599 (action_number_t, ACTION_MIN, ACTION_MAX): New.
17600 (actrow): Of action_number_t type.
17601 (conflrow): Of unsigned int type.
17602 (table_ninf, base_ninf): New.
17603 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
17604 (muscle_insert_int_table, muscle_insert_base_table)
17605 (muscle_insert_rule_number_table): New.
17606 (prepare_tokens): Output `toknum' as int_table.
17607 (action_row): Returns a rule_number_t.
17608 Use ACTION_MIN, not SHRT_MIN.
17609 (token_actions): yydefact is rule_number_t*.
17610 (table_ninf_remap): New.
17611 (pack_table): Use it for `base' and `table'.
17612 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
17613 replaced with...
17614 (YYPACT_NINF, YYTABLE_NINF): these.
17615 (yypact, yytable): Compute their types instead of hard-coded
17616 `short'.
17617 * tests/regression.at (Web2c Actions): Adjust.
17618
176192002-07-19 Akim Demaille <akim@epita.fr>
17620
17621 * src/scan-gram.l (id): Can start with an underscore.
17622
176232002-07-16 Akim Demaille <akim@epita.fr>
17624
17625 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
17626 Adjust all former `associativity' dependencies.
17627 * src/symtab.c (symbol_new): Default associativity is `undef', not
17628 `right'.
17629 (symbol_check_alias_consistence): Adjust.
17630
176312002-07-09 Akim Demaille <akim@epita.fr>
17632
17633 * doc/bison.texinfo: Properly set the ``header'' part.
17634 Use @dircategory ``GNU programming tools'' as per Texinfo's
17635 documentation.
17636 Use @copying.
17637
176382002-07-09 Akim Demaille <akim@epita.fr>
17639
17640 * lib/quotearg.h: Protect against multiple inclusions.
17641 * src/location.h (location_t): Add a `file' member.
17642 (LOCATION_RESET, LOCATION_PRINT): Adjust.
17643 * src/complain.c (warn_at, complain_at, fatal_at): Drop
17644 `error_one_per_line' support.
17645
176462002-07-09 Akim Demaille <akim@epita.fr>
17647
17648 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
17649 * src/reader.c (lineno): Remove.
17650 Adjust all dependencies.
17651 (get_merge_function): Take a location and use complain_at.
17652 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
17653 * tests/regression.at (Invalid inputs, Mixing %token styles):
17654 Adjust.
17655
176562002-07-09 Akim Demaille <akim@epita.fr>
17657
17658 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
17659 recovery rule, and forbid extensions when --yacc.
17660 (gram_error): Use complain_at.
17661 * src/reader.c (reader): Exit if there were parse errors.
17662
176632002-07-09 Akim Demaille <akim@epita.fr>
17664
17665 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
17666 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
17667 Reported by R Blake <blakers@mac.com>.
17668
176692002-07-09 Akim Demaille <akim@epita.fr>
17670
17671 * data/yacc.c: Output the copyright notive in the header.
17672
176732002-07-03 Akim Demaille <akim@epita.fr>
17674
17675 * src/output.c (froms, tos): Are state_number_t.
17676 (save_column): sp, sp1, and sp2 are state_number_t.
17677 (prepare): Rename `final' as `final_state_number', `nnts' as
17678 `nterms_number', `nrules' as `rules_number', `nstates' as
17679 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
17680 unused.
17681 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
17682 * data/lalr1.cc (nsym_): Remove, unused.
17683
176842002-07-03 Akim Demaille <akim@epita.fr>
17685
17686 * src/lalr.h, src/lalr.c (goto_number_t): New.
17687 * src/lalr.c (goto_list_t): New.
17688 Propagate them.
17689 * src/nullable.c (rule_list_t): New.
17690 Propagate.
17691 * src/types.h: Remove.
17692
176932002-07-03 Akim Demaille <akim@epita.fr>
17694
17695 * src/closure.c (print_fderives): Use rule_rhs_print.
17696 * src/derives.c (print_derives): Use rule_rhs_print.
17697 (rule_list_t): New, replaces `shorts'.
17698 (set_derives): Add comments.
17699 * tests/sets.at (Nullable, Firsts): Adjust.
17700
177012002-07-03 Akim Demaille <akim@epita.fr>
17702
17703 * src/output.c (prepare_actions): Free `tally' and `width'.
17704 (prepare_actions): Allocate and free `order'.
17705 * src/symtab.c (symbols_free): Free `symbols'.
17706 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
17707 * src/output.c (m4_invoke): Move to...
17708 * src/scan-skel.l: here.
17709 (<<EOF>>): Close yyout, and free its name.
17710
177112002-07-03 Akim Demaille <akim@epita.fr>
17712
17713 Fix some memory leaks, and fix a bug: state 0 was examined twice.
17714
17715 * src/LR0.c (new_state): Merge into...
17716 (state_list_append): this.
17717 (new_states): Merge into...
17718 (generate_states): here.
17719 (set_states): Don't ensure a proper `errs' state member here, do it...
17720 * src/conflicts.c (conflicts_solve): here.
17721 * src/state.h, src/state.c: Comment changes.
17722 (state_t): Rename member `shifts' as `transitions'.
17723 Adjust all dependencies.
17724 (errs_new): For consistency, also take the values as argument.
17725 (errs_dup): Remove.
17726 (state_errs_set): New.
17727 (state_reductions_set, state_transitions_set): Assert that no
17728 previous value was assigned.
17729 (state_free): New.
17730 (states_free): Use it.
17731 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
17732 temporary storage: use `errs' and `nerrs' as elsewhere.
17733 (set_conflicts): Allocate and free this `errs'.
17734
177352002-07-02 Akim Demaille <akim@epita.fr>
17736
17737 * lib/libiberty.h: New.
17738 * lib: Update the bitset implementation from upstream.
17739 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
17740 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
17741 * src/main.c: Adjust bitset stats calls.
17742
177432002-07-01 Paul Eggert <eggert@twinsun.com>
17744
17745 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
17746 char, so that negative chars don't collide with $.
17747
177482002-06-30 Akim Demaille <akim@epita.fr>
17749
17750 Have the GLR tests be `warning' checked, and fix the warnings.
17751
17752 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
17753 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
17754 (yyremoveDeletes): `yyi' and `yyj' are size_t.
17755 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
17756 (yyaddDeferredAction): static.
17757 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
17758 (yyreportParseError): yyprefix is const.
17759 yytokenp is used only when verbose.
17760 (yy__GNUC__): Replace with __GNUC__.
17761 (yypdumpstack): yyi is size_t.
17762 (yypreference): Un-yy local variables and arguments, to avoid
17763 clashes with `yyr1'. Anyway, we are not in the user name space.
17764 (yytname_size): be an int, as is compared with ints.
17765 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
17766 Use them.
17767 * tests/cxx-gram.at: Use quotation to protect $1.
17768 Use AT_COMPILE to enable warnings hunts.
17769 Prototype yylex and yyerror.
17770 `Use' argc.
17771 Include `string.h', not `strings.h'.
17772 Produce and prototype stmtMerge only when used.
17773 yylex takes a location.
17774
177752002-06-30 Akim Demaille <akim@epita.fr>
17776
17777 We spend a lot of time in quotearg, in particular when --verbose.
17778
17779 * src/symtab.c (symbol_get): Store a quoted version of the key.
17780 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
17781 Adjust all callers.
17782
177832002-06-30 Akim Demaille <akim@epita.fr>
17784
17785 * src/state.h (reductions_t): Rename member `nreds' as num.
17786 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
17787 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
17788
177892002-06-30 Akim Demaille <akim@epita.fr>
17790
17791 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
17792 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
17793 (shifts_to): Rename as...
17794 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
17795 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
17796 (TRANSITION_IS_DISABLED, transitions_to): these.
17797
177982002-06-30 Akim Demaille <akim@epita.fr>
17799
17800 * src/print.c (print_shifts, print_gotos): Merge into...
17801 (print_transitions): this.
17802 (print_transitions, print_errs, print_reductions): Align the
17803 lookaheads columns.
17804 (print_core, print_transitions, print_errs, print_state,
17805 print_grammar): Output empty lines separator before, not after.
17806 (state_default_rule_compute): Rename as...
17807 (state_default_rule): this.
17808 * tests/conflicts.at (Defaulted Conflicted Reduction),
17809 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
17810 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
17811
178122002-06-30 Akim Demaille <akim@epita.fr>
17813
17814 Display items as we display rules.
17815
17816 * src/gram.h, src/gram.c (rule_lhs_print): New.
17817 * src/gram.c (grammar_rules_partial_print): Use it.
17818 * src/print.c (print_core): Likewise.
17819 * tests/conflicts.at (Defaulted Conflicted Reduction),
17820 (Unresolved SR Conflicts): Adjust.
17821 (Unresolved SR Conflicts): Adjust and rename as...
17822 (Resolved SR Conflicts): this, as was meant.
17823 * tests/regression.at (Web2c Report): Adjust.
17824
178252002-06-30 Akim Demaille <akim@epita.fr>
17826
17827 * src/print.c (state_default_rule_compute): New, extracted from...
17828 (print_reductions): here.
17829 Pessimize, but clarify the code.
17830 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
17831
178322002-06-30 Akim Demaille <akim@epita.fr>
17833
17834 * src/output.c (action_row): Let default_rule be always a rule
17835 number.
17836
178372002-06-30 Akim Demaille <akim@epita.fr>
17838
17839 * src/closure.c (print_firsts, print_fderives, closure):
17840 Use BITSET_EXECUTE.
17841 * src/lalr.c (lookaheads_print): Likewise.
17842 * src/state.c (state_rule_lookaheads_print): Likewise.
17843 * src/print_graph.c (print_core): Likewise.
17844 * src/print.c (print_reductions): Likewise.
17845 * src/output.c (action_row): Likewise.
17846 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
17847
178482002-06-30 Akim Demaille <akim@epita.fr>
17849
17850 * src/print_graph.c: Use report_flag.
17851
178522002-06-30 Akim Demaille <akim@epita.fr>
17853
17854 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
17855 to...
17856 * src/relation.h, src/relation.c (traverse, relation_digraph)
17857 (relation_print, relation_transpose): New.
17858
178592002-06-30 Akim Demaille <akim@epita.fr>
17860
17861 * src/state.h, src/state.c (shifts_to): New.
17862 * src/lalr.c (build_relations): Use it.
17863
178642002-06-30 Akim Demaille <akim@epita.fr>
17865
17866 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
17867 (item_number_of_rule_number, rule_number_of_item_number): New.
17868 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
17869 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
17870 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
17871 Propagate their use.
17872 Much remains to be done, in particular wrt `shorts' from types.h.
17873
178742002-06-30 Akim Demaille <akim@epita.fr>
17875
17876 * src/symtab.c (symbol_new): Initialize the `printer' member.
17877
178782002-06-30 Akim Demaille <akim@epita.fr>
17879
17880 * src/LR0.c (save_reductions): Remove, replaced by...
17881 * src/state.h, src/state.c (state_reductions_set): New.
17882 (reductions, errs): Rename as...
17883 (reductions_t, errs_t): these.
17884 Adjust all dependencies.
17885
178862002-06-30 Akim Demaille <akim@epita.fr>
17887
17888 * src/LR0.c (state_list_t, state_list_append): New.
17889 (first_state, last_state): Now symbol_list_t.
17890 (this_state): Remove.
17891 (new_itemsets, append_states, save_reductions): Take a state_t as
17892 argument.
17893 (set_states, generate_states): Adjust.
17894 (save_shifts): Remove, replaced by...
17895 * src/state.h, src/state.c (state_shifts_set): New.
17896 (shifts): Rename as...
17897 (shifts_t): this.
17898 Adjust all dependencies.
17899 * src/state.h (state_t): Remove the `next' member.
17900
179012002-06-30 Akim Demaille <akim@epita.fr>
17902
17903 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
17904 escaped in slot 0.
17905
179062002-06-30 Akim Demaille <akim@epita.fr>
17907
17908 Use hash.h for the state hash table.
17909
17910 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
17911 (allocate_storage): Use state_hash_new.
17912 (free_storage): Use state_hash_free.
17913 (new_state, get_state): Adjust.
17914 * src/lalr.h, src/lalr.c (states): Move to...
17915 * src/states.h (state_t): Remove the `link' member, no longer
17916 used.
17917 * src/states.h, src/states.c: here.
17918 (state_hash_new, state_hash_free, state_hash_lookup)
17919 (state_hash_insert, states_free): New.
17920 * src/states.c (state_table, state_compare, state_hash): New.
17921 * src/output.c (output_actions): Do not free states now, since we
17922 still need to know the final_state number in `prepare', called
17923 afterwards. Do it...
17924 * src/main.c (main): here: call states_free after `output'.
17925
179262002-06-30 Akim Demaille <akim@epita.fr>
17927
17928 * src/state.h, src/state.c (state_new): New, extracted from...
17929 * src/LR0.c (new_state): here.
17930 * src/state.h (STATE_ALLOC): Move to...
17931 * src/state.c: here.
17932 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
17933 * src/state.h, src/state.c: here.
17934
179352002-06-30 Akim Demaille <akim@epita.fr>
17936
17937 * src/reader.c (gensym): Rename as...
17938 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
17939 (getsym): Rename as...
17940 (symbol_get): this.
17941
179422002-06-30 Akim Demaille <akim@epita.fr>
17943
17944 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
17945 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
17946 * src/output.c, src/print.c, src/print_graph.c: Propagate.
17947 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
17948
179492002-06-30 Akim Demaille <akim@epita.fr>
17950
17951 Make the test suite pass with warnings checked.
17952
17953 * tests/actions.at (Printers and Destructors): Improve.
17954 Avoid unsigned vs. signed issues.
17955 * tests/calc.at: Don't exercise the scanner here, do it...
17956 * tests/input.at (Torturing the Scanner): here.
17957
179582002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17959
17960 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
17961 reorganize first lines parallel to yacc.c.
17962
179632002-06-28 Akim Demaille <akim@epita.fr>
17964
17965 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
17966 (b4_token_enum, b4_token_defines): New, factored from...
17967 * data/lalr1.cc, data/yacc.c, glr.c: here.
17968
179692002-06-28 Akim Demaille <akim@epita.fr>
17970
17971 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
17972 unused variables.
17973 * src/output.c (merger_output): static.
17974
179752002-06-28 Akim Demaille <akim@epita.fr>
17976
17977 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
17978 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
17979 pacify GCC.
17980 * src/output.c (save_row): Initialize all the variables to pacify GCC.
17981
179822002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17983
17984 Accumulated changelog for new GLR parsing features.
17985
17986 * src/conflicts.c (count_total_conflicts): Change name to
17987 conflicts_total_count.
17988 * src/conflicts.h: Ditto.
17989 * src/output.c (token_actions): Use the new name.
17990 (output_conflicts): Change conflp => conflict_list_heads, and
17991 confl => conflict_list for better readability.
17992 * data/glr.c: Use the new names.
17993 * NEWS: Add self to GLR announcement.
17994
17995 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
17996
17997 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
17998 Akim Demaille.
17999
18000 * data/bison.glr: Change name to glr.c
18001 * data/glr.c: Renamed from bison.glr.
18002 * data/Makefile.am: Add glr.c
18003
18004 * src/getargs.c:
18005
18006 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
18007 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
18008
18009 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18010
18011 * data/bison.glr: Be sure to restore the
18012 current #line when returning to the skeleton contents after having
18013 exposed the input file's #line.
18014
18015 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18016
18017 * data/bison.glr: Bring up to date with changes to bison.simple.
18018
18019 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18020
18021 * data/bison.glr: Correct definitions that use b4_prefix.
18022 Various reformatting.
18023 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
18024 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
18025 yytokenp argument; now part of stack.
18026 (yychar): Define to behave as documented.
18027 (yyclearin): Ditto.
18028
18029 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18030
18031 * src/reader.h: Add declaration for free_merger_functions.
18032
18033 * src/reader.c (merge_functions): New variable.
18034 (get_merge_function): New function.
18035 (free_merger_functions): New function.
18036 (readgram): Check for %prec that is not followed by a symbol.
18037 Handle %dprec and %merge declarations.
18038 (packgram): Initialize dprec and merger fields in rules array.
18039
18040 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
18041 conflict_list_cnt, conflict_list_free): New variables.
18042 (table_grow): Also grow conflict_table.
18043 (prepare_rules): Output dprec and merger tables.
18044 (conflict_row): New function.
18045 (action_row): Output conflict lists for GLR parser. Don't use
18046 default reduction in conflicted states for GLR parser so that there
18047 are spaces for the conflict lists.
18048 (save_row): Also save conflict information.
18049 (token_actions): Allocate conflict list.
18050 (merger_output): New function.
18051 (pack_vector): Pack conflict table, too.
18052 (output_conflicts): New function to output yyconflp and yyconfl.
18053 (output_check): Allocate conflict_tos.
18054 (output_actions): Output conflict tables, also.
18055 (output_skeleton): Output b4_mergers definition.
18056 (prepare): Output b4_max_rhs_length definition.
18057 Use 'bison.glr' as default skeleton for GLR parsers.
18058
18059 * src/gram.c (glr_parser): New flag.
18060 (grammar_free): Call free_merger_functions.
18061
18062 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
18063 all pairs of conflicting reductions, rather than just all tokens
18064 causing conflicts. Needed to size conflict tables.
18065 (conflicts_output): Modify call to count_rr_conflicts for new
18066 interface.
18067 (conflicts_print): Ditto.
18068 (count_total_conflicts): New function.
18069
18070 * src/reader.h (merger_list): New type.
18071 (merge_functions): New variable.
18072
18073 * src/lex.h (tok_dprec, tok_merge): New token types.
18074
18075 * src/gram.h (rule_s): Add dprec and merger fields.
18076 (glr_parser): New flag.
18077
18078 * src/conflicts.h (count_total_conflicts): New function.
18079
18080 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
18081
18082 * doc/bison.texinfo (Generalized LR Parsing): New section.
18083 (GLR Parsers): New section.
18084 (Language and Grammar): Mention GLR parsing.
18085 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
18086 Correct typo ("tge" -> "the").
18087
18088 * data/bison.glr: New skeleton for GLR parsing.
18089
18090 * tests/cxx-gram.at: New tests for GLR parsing.
18091
18092 * tests/testsuite.at: Include cxx-gram.at.
18093
18094 * tests/Makefile.am: Add cxx-gram.at.
18095
18096 * src/parse-gram.y:
18097
18098 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
18099
18100 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
18101
181022002-06-27 Akim Demaille <akim@epita.fr>
18103
18104 * src/options.h, src/options.c: Remove.
18105 * src/getargs.c (short_options, long_options): New.
18106
181072002-06-27 Akim Demaille <akim@epita.fr>
18108
18109 * data/bison.simple, data/bison.c++: Rename as...
18110 * data/yacc.c, data/lalr1.cc: these.
18111 * doc/bison.texinfo (Environment Variables): Remove.
18112
181132002-06-25 Raja R Harinath <harinath@cs.umn.edu>
18114
18115 * src/getargs.c (report_argmatch): Initialize strtok().
18116
181172002-06-20 Akim Demaille <akim@epita.fr>
18118
18119 * data/bison.simple (b4_symbol_actions): New, replaces...
18120 (b4_symbol_destructor, b4_symbol_printer): these.
18121 (yysymprint): Be sure to call YYPRINT only for tokens, and using
18122 user token numbers.
18123
181242002-06-20 Akim Demaille <akim@epita.fr>
18125
18126 * data/bison.simple (yydestructor): Rename as...
18127 (yydestruct): this.
18128
181292002-06-20 Akim Demaille <akim@epita.fr>
18130
18131 * src/symtab.h, src/symtab.c (symbol_type_set)
18132 (symbol_destructor_set, symbol_precedence_set): The location is
18133 the last argument.
18134 Adjust all callers.
18135
181362002-06-20 Akim Demaille <akim@epita.fr>
18137
18138 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
18139 internals.
18140 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
18141 Takes a location.
18142 * src/symtab.h, src/symtab.c (symbol_class_set)
18143 (symbol_user_token_number_set): Likewise.
18144 Adjust all callers.
18145 Promote complain_at.
18146 * tests/input.at (Type Clashes): Adjust.
18147
181482002-06-20 Akim Demaille <akim@epita.fr>
18149
18150 * data/bison.simple (YYLEX): Fix the declaration when
18151 %pure-parser.
18152
181532002-06-20 Akim Demaille <akim@epita.fr>
18154
18155 * data/bison.simple (yysymprint): Don't print the token number,
18156 just its name.
18157 * tests/actions.at (Destructors): Rename as...
18158 (Printers and Destructors): this.
18159 Also exercise %printer.
18160
181612002-06-20 Akim Demaille <akim@epita.fr>
18162
18163 * data/bison.simple (YYDSYMPRINT): New.
18164 Use it to remove many of the #if YYDEBUG/if (yydebug).
18165
181662002-06-20 Akim Demaille <akim@epita.fr>
18167
18168 * src/symtab.h, src/symtab.c (symbol_t): printer and
18169 printer_location are new members.
18170 (symbol_printer_set): New.
18171 * src/parse-gram.y (PERCENT_PRINTER): New token.
18172 Handle its associated rule.
18173 * src/scan-gram.l: Adjust.
18174 (handle_destructor_at, handle_destructor_dollar): Rename as...
18175 (handle_symbol_code_at, handle_symbol_code_dollar): these.
18176 * src/output.c (symbol_printers_output): New.
18177 (output_skeleton): Call it.
18178 * data/bison.simple (yysymprint): New. Cannot be named yyprint
18179 since there are already many grammar files with a user `yyprint'.
18180 Replace the calls to YYPRINT to calls to yysymprint.
18181 * tests/calc.at: Adjust.
18182 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
18183 taking advantage of parser very internal details (stack size!).
18184
181852002-06-20 Akim Demaille <akim@epita.fr>
18186
18187 * src/scan-gram.l: Complete the scanner with the missing patterns
18188 to pacify Flex.
18189 Use `quote' and `symbol_tag_get' where appropriate.
18190
181912002-06-19 Akim Demaille <akim@epita.fr>
18192
18193 * tests/actions.at (Destructors): Augment to test locations.
18194 * data/bison.simple (yydestructor): Pass it the current location
18195 if locations are enabled.
18196 Prototype only when __STDC__ or C++.
18197 Change the argument names to move into the yy name space: there is
18198 user code here.
18199
182002002-06-19 Akim Demaille <akim@epita.fr>
18201
18202 * data/bison.simple (b4_pure_if): New.
18203 Use it instead of #ifdef YYPURE.
18204
182052002-06-19 Akim Demaille <akim@epita.fr>
18206
18207 * data/bison.simple (b4_location_if): New.
18208 Use it instead of #ifdef YYLSP_NEEDED.
18209
182102002-06-19 Akim Demaille <akim@epita.fr>
18211
18212 Prepare @$ in %destructor, but currently don't bind it in the
18213 skeleton, as %location use is not cleaned up yet.
18214
18215 * src/scan-gram.l (handle_dollar, handle_destructor_at)
18216 (handle_action_at): New.
18217 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
18218 a braced_code_t and a location as additional arguments.
18219 (handle_destructor_dollar): Instead of requiring `b4_eval', just
18220 unquote one when outputting `b4_dollar_dollar'.
18221 Adjust callers.
18222 * data/bison.simple (b4_eval): Remove.
18223 (b4_symbol_destructor): Adjust.
18224 * tests/input.at (Invalid @n): Adjust.
18225
182262002-06-19 Zack Weinberg <zack@codesourcery.com>
18227
18228 * doc/bison.texinfo: Document ability to have multiple
18229 prologue sections.
18230
182312002-06-18 Akim Demaille <akim@epita.fr>
18232
18233 * src/files.c (compute_base_names): When computing the output file
18234 names from the input file name, strip the directory part.
18235
182362002-06-18 Akim Demaille <akim@epita.fr>
18237
18238 * data/bison.simple.new: Comment changes.
18239 Reported by Andreas Schwab.
18240
182412002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
18242
18243 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
18244 there are no `label `yyoverflowlab' defined but not used' warnings
18245 when yyoverflow is defined.
18246
182472002-06-18 Akim Demaille <akim@epita.fr>
18248
18249 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
18250 new member.
18251 (symbol_destructor_set): Adjust.
18252 * src/output.c (symbol_destructors_output): Output the destructor
18253 locations.
18254 Output the symbol name.
18255 * data/bison.simple (b4_symbol_destructor): Adjust.
18256
182572002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
18258 and Akim Demaille <akim@epita.fr>
18259
18260 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
18261 what's left on the stack when the error recovery hits EOF.
18262 * tests/actions.at (Destructors): Complete to exercise this case.
18263
182642002-06-17 Akim Demaille <akim@epita.fr>
18265
18266 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
18267 arguments is really empty, not only equal to `[]'.
18268 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
18269 member.
18270 (symbol_destructor_set): New.
18271 * src/output.c (symbol_destructors_output): New.
18272 * src/reader.h (brace_code_t, current_braced_code): New.
18273 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
18274 (handle_dollar): Rename as...
18275 (handle_action_dollar): this.
18276 (handle_destructor_dollar): New.
18277 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
18278 (grammar_declaration): Use it.
18279 * data/bison.simple (yystos): Is always defined.
18280 (yydestructor): New.
18281 * tests/actions.at (Destructors): New.
18282 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
18283
182842002-06-17 Akim Demaille <akim@epita.fr>
18285
18286 * src/symlist.h, src/symlist.c (symbol_list_length): New.
18287 * src/scan-gram.l (handle_dollar, handle_at): Compute the
18288 rule_length only when needed.
18289 * src/output.c (actions_output, token_definitions_output): Output
18290 the full M4 block.
18291 * src/symtab.c: Don't access directly to the symbol tag, use
18292 symbol_tag_get.
18293 * src/parse-gram.y: Use symbol_list_free.
18294
182952002-06-17 Akim Demaille <akim@epita.fr>
18296
18297 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
18298 (symbol_list_prepend, get_type_name): Move to...
18299 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
18300 (symbol_list_prepend, symbol_list_n_type_name_get): here.
18301 Adjust all callers.
18302 (symbol_list_free): New.
18303 * src/scan-gram.l (handle_dollar): Takes a location.
18304 * tests/input.at (Invalid $n): Adjust.
18305
183062002-06-17 Akim Demaille <akim@epita.fr>
18307
18308 * src/reader.h, src/reader.c (symbol_list_new): Export it.
18309 (symbol_list_prepend): New.
18310 * src/parse-gram.y (%union): `list' is a new member.
18311 (symbols.1): New, replaces...
18312 (terms_to_prec.1, nterms_to_type.1): these.
18313 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
18314 Take a location as additional argument.
18315 Adjust all callers.
18316
183172002-06-15 Akim Demaille <akim@epita.fr>
18318
18319 * src/parse-gram.y: Move %token in the declaration section so that
18320 we don't depend upon CVS Bison.
18321
183222002-06-15 Akim Demaille <akim@epita.fr>
18323
18324 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
18325 * src/print.c (print_core): Use it.
18326
183272002-06-15 Akim Demaille <akim@epita.fr>
18328
18329 * src/conflicts.c (log_resolution): Accept the rule involved in
18330 the sr conflicts instead of the lookahead number that points to
18331 that rule.
18332 (flush_reduce): Accept the current lookahead vector as argument,
18333 instead of the index in LA.
18334 (resolve_sr_conflict): Accept the current number of lookahead
18335 bitset to consider for the STATE, instead of the index in LA.
18336 (set_conflicts): Adjust.
18337 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
18338
183392002-06-15 Akim Demaille <akim@epita.fr>
18340
18341 * src/state.h (state_t): Replace the `lookaheadsp' member, a
18342 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
18343 Adjust all dependencies.
18344 * src/lalr.c (initialize_lookaheads): Split into...
18345 (states_lookaheads_count, states_lookaheads_initialize): these.
18346 (lalr): Adjust.
18347
183482002-06-15 Akim Demaille <akim@epita.fr>
18349
18350 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
18351 out of...
18352 (grammar_rules_print): here.
18353 * src/reduce.c (reduce_output): Use it.
18354 * tests/reduce.at (Useless Rules, Reduced Automaton)
18355 (Underivable Rules): Adjust.
18356
183572002-06-15 Akim Demaille <akim@epita.fr>
18358
18359 Copy BYacc's nice way to report the grammar.
18360
18361 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
18362 New.
18363 Don't print the rules' location, it is confusing and useless.
18364 (rule_print): Use grammar_rhs_print.
18365 * src/print.c (print_grammar): Use grammar_rules_print.
18366
183672002-06-15 Akim Demaille <akim@epita.fr>
18368
18369 Complete and rationalize `useless thing' warnings.
18370
18371 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
18372 (symbol_tag_print): New.
18373 Use them everywhere in place of accessing directly the tag member.
18374 * src/gram.h, src/gram.c (rule_print): New.
18375 Use it where a rule used to be printed `by hand'.
18376 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
18377 (reduce_grammar_tables): Report the useless rules.
18378 (reduce_print): Useless things are a warning, not an error.
18379 Report it as such.
18380 * tests/reduce.at (Useless Nonterminals, Useless Rules):
18381 (Reduced Automaton, Underivable Rules): Adjust.
18382 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
18383 * tests/conflicts.at (Unresolved SR Conflicts)
18384 (Solved SR Conflicts): Adjust.
18385
183862002-06-15 Akim Demaille <akim@epita.fr>
18387
18388 Let symbols have a location.
18389
18390 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
18391 (getsym): Adjust.
18392 Adjust all callers.
18393 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
18394 Use location_t, not int.
18395 * src/symtab.c (symbol_check_defined): Take advantage of the
18396 location.
18397 * tests/regression.at (Invalid inputs): Adjust.
18398
183992002-06-15 Akim Demaille <akim@epita.fr>
18400
18401 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
18402 (input): Don't try to initialize yylloc here, do it in the
18403 scanner.
18404 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
18405 * src/gram.h (rule_t): Change line and action_line into location
18406 and action_location, of location_t type.
18407 Adjust all dependencies.
18408 * src/location.h, src/location.c (empty_location): New.
18409 * src/reader.h, src/reader.c (grammar_start_symbol_set)
18410 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
18411 (grammar_current_rule_symbol_append)
18412 (grammar_current_rule_action_append): Expect a location as argument.
18413 * src/reader.c (grammar_midrule_action): Adjust to attach an
18414 action's location as dummy symbol location.
18415 * src/symtab.h, src/symtab.c (startsymbol_location): New.
18416 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
18417 the line numbers.
18418
184192002-06-14 Akim Demaille <akim@epita.fr>
18420
18421 Grammar declarations may be found in the grammar section.
18422
18423 * src/parse-gram.y (rules_or_grammar_declaration): New.
18424 (declarations): Each declaration may end with a semicolon, not
18425 just...
18426 (grammar_declaration): `"%union"'.
18427 (grammar): Branch to rules_or_grammar_declaration.
18428
184292002-06-14 Akim Demaille <akim@epita.fr>
18430
18431 * src/main.c (main): Invoke scanner_free.
18432
184332002-06-14 Akim Demaille <akim@epita.fr>
18434
18435 * src/output.c (m4_invoke): Extracted from...
18436 (output_skeleton): here.
18437 Free tempfile.
18438
184392002-06-14 Akim Demaille <akim@epita.fr>
18440
18441 * src/parse-gram.y (directives, directive, gram)
18442 (grammar_directives, precedence_directives, precedence_directive):
18443 Rename as...
18444 (declarations, declaration, grammar, grammar_declaration)
18445 (precedence_declaration, precedence_declarator): these.
18446 (symbol_declaration): New.
18447
184482002-06-14 Akim Demaille <akim@epita.fr>
18449
18450 * src/files.c (action_obstack): Remove, unused.
18451 (output_obstack): Remove it, and all its dependencies, as it is no
18452 longer needed.
18453 * src/reader.c (epilogue_set): Build the epilogue in the
18454 muscle_obstack.
18455 * src/output.h, src/output.c (muscle_obstack): Move to...
18456 * src/muscle_tab.h, src/muscle_tab.h: here.
18457 (muscle_init): Initialize muscle_obstack.
18458 (muscle_free): New.
18459 * src/main.c (main): Call it.
18460
184612002-06-14 Akim Demaille <akim@epita.fr>
18462
18463 * src/location.h: New, extracted from...
18464 * src/reader.h: here.
18465 * src/Makefile.am (noinst_HEADERS): Merge into
18466 (bison_SOURCES): this.
18467 Add location.h.
18468 * src/parse-gram.y: Use location_t instead of Bison's.
18469 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
18470 Use location_t instead of ints.
18471
184722002-06-14 Akim Demaille <akim@epita.fr>
18473
18474 * data/bison.simple, data/bison.c++: Be sure to restore the
18475 current #line when returning to the skeleton contents after having
18476 exposed the input file's #line.
18477
184782002-06-12 Akim Demaille <akim@epita.fr>
18479
18480 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
18481 eager.
18482 * tests/actions.at (Exotic Dollars): New.
18483
184842002-06-12 Akim Demaille <akim@epita.fr>
18485
18486 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
18487 ['"/] too eagerly.
18488 * tests/input.at (Torturing the Scanner): New.
18489
184902002-06-11 Akim Demaille <akim@epita.fr>
18491
18492 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
18493 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
18494 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
18495 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
18496 * src/reader.c (reader): Use it.
18497
184982002-06-11 Akim Demaille <akim@epita.fr>
18499
18500 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
18501 Adjust all callers.
18502 (scanner_last_string_free): New.
18503
185042002-06-11 Akim Demaille <akim@epita.fr>
18505
18506 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
18507 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
18508 (last_string, YY_OBS_FREE): New.
18509 Use them when returning an ID.
18510
185112002-06-11 Akim Demaille <akim@epita.fr>
18512
18513 Have Bison grammars parsed by a Bison grammar.
18514
18515 * src/reader.c, src/reader.h (prologue_augment): New.
18516 * src/reader.c (copy_definition): Remove.
18517
18518 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
18519 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
18520 (grammar_current_rule_prec_set, grammar_current_rule_check)
18521 (grammar_current_rule_symbol_append)
18522 (grammar_current_rule_action_append): Export.
18523 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
18524 (symbol_list_action_append): Remove.
18525 Hook the routines from reader.
18526 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
18527 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
18528
18529 * src/reader.c (read_declarations): Remove, unused.
18530
18531 * src/parse-gram.y: Handle the epilogue.
18532 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
18533 (grammar_start_symbol_set): this.
18534 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
18535 * src/reader.c (readgram): Remove, unused.
18536 (reader): Adjust to insert eoftoken and axiom where appropriate.
18537
18538 * src/reader.c (copy_dollar): Replace with...
18539 * src/scan-gram.h (handle_dollar): this.
18540 * src/parse-gram.y: Remove `%thong'.
18541
18542 * src/reader.c (copy_at): Replace with...
18543 * src/scan-gram.h (handle_at): this.
18544
18545 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
18546 New.
18547
18548 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
18549 time being.
18550
18551 * src/reader.h, src/reader.c (grammar_rule_end): New.
18552
18553 * src/parse.y (current_type, current_class): New.
18554 Implement `%nterm', `%token' support.
18555 Merge `%term' into `%token'.
18556 (string_as_id): New.
18557 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
18558 type name.
18559
18560 * src/parse-gram.y: Be sure to handle properly the beginning of
18561 rules.
18562
18563 * src/parse-gram.y: Handle %type.
18564 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
18565
18566 * src/parse-gram.y: More directives support.
18567 * src/options.c: No longer handle source directives.
18568
18569 * src/parse-gram.y: Fix %output.
18570
18571 * src/parse-gram.y: Handle %union.
18572 Use the prologue locations.
18573 * src/reader.c (parse_union_decl): Remove.
18574
18575 * src/reader.h, src/reader.c (epilogue_set): New.
18576 * src/parse-gram.y: Use it.
18577
18578 * data/bison.simple, data/bison.c++: b4_stype is now either not
18579 defined, then default to int, or to the contents of %union,
18580 without `union' itself.
18581 Adjust.
18582 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
18583
18584 * src/output.c (actions_output): Don't output braces, as they are
18585 already handled by the scanner.
18586
18587 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
18588 characters to themselves.
18589
18590 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
18591 that the epilogue has a proper #line.
18592
18593 * src/parse-gram.y: Handle precedence/associativity.
18594
18595 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
18596 a terminal.
18597 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
18598 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
18599 at all to define terminals that cannot be emitted.
18600
18601 * src/scan-gram.l: Escape M4 characters.
18602
18603 * src/scan-gram.l: Working properly with escapes in user
18604 strings/characters.
18605
18606 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
18607 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
18608 grammar.
18609 Use more modest sizes, as for the time being the parser does not
18610 release memory, and therefore the process swallows a huge amount
18611 of memory.
18612
18613 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
18614 stricter %token grammar.
18615
18616 * src/symtab.h (associativity): Add `undef_assoc'.
18617 (symbol_precedence_set): Do nothing when passed an undef_assoc.
18618 * src/symtab.c (symbol_check_alias_consistence): Adjust.
18619
18620 * tests/regression.at (Invalid %directive): Remove, as it is now
18621 meaningless.
18622 (Invalid inputs): Adjust to the new error messages.
18623 (Token definitions): The new grammar doesn't allow too many
18624 eccentricities.
18625
18626 * src/lex.h, src/lex.c: Remove.
18627 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
18628 (copy_character, copy_string2, copy_string, copy_identifier)
18629 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
18630 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
18631 (parse_action): Remove.
18632 * po/POTFILES.in: Adjust.
18633
186342002-06-11 Akim Demaille <akim@epita.fr>
18635
18636 * src/reader.c (parse_action): Don't store directly into the
18637 rule's action member: return the action as a string.
18638 Don't require `rule_length' as an argument: compute it.
18639 (grammar_current_rule_symbol_append)
18640 (grammar_current_rule_action_append): New, eved out from
18641 (readgram): here.
18642 Remove `action_flag', `rulelength', unused now.
18643
186442002-06-11 Akim Demaille <akim@epita.fr>
18645
18646 * src/reader.c (grammar_current_rule_prec_set).
18647 (grammar_current_rule_check): New, eved out from...
18648 (readgram): here.
18649 Remove `xaction', `first_rhs': useless.
18650 * tests/input.at (Type clashes): New.
18651 * tests/existing.at (GNU Cim Grammar): Adjust.
18652
186532002-06-11 Akim Demaille <akim@epita.fr>
18654
18655 * src/reader.c (grammar_midrule_action): New, Eved out from
18656 (readgram): here.
18657
186582002-06-11 Akim Demaille <akim@epita.fr>
18659
18660 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
18661 New.
18662 (readgram): Use them as replacement of inlined code, crule and
18663 crule1.
18664
186652002-06-11 Akim Demaille <akim@epita.fr>
18666
18667 * src/reader.c (grammar_end, grammar_symbol_append): New.
18668 (readgram): Use them.
18669 Make the use of `p' as local as possible.
18670
186712002-06-10 Akim Demaille <akim@epita.fr>
18672
18673 GCJ's parser requires the tokens to be defined before the prologue.
18674
18675 * data/bison.simple: Output the token definition before the user's
18676 prologue.
18677 * tests/regression.at (Braces parsing, Duplicate string)
18678 (Mixing %token styles): Check the output from bison.
18679 (Early token definitions): New.
18680
186812002-06-10 Akim Demaille <akim@epita.fr>
18682
18683 * src/symtab.c (symbol_user_token_number_set): Don't complain when
18684 assigning twice the same user number to a token, so that we can
18685 use it in...
18686 * src/lex.c (lex): here.
18687 Also use `symbol_class_set' instead of hand written code.
18688 * src/reader.c (parse_assoc_decl): Likewise.
18689
186902002-06-10 Akim Demaille <akim@epita.fr>
18691
18692 * src/symtab.c, src/symtab.c (symbol_class_set)
18693 (symbol_user_token_number_set): New.
18694 * src/reader.c (parse_token_decl): Use them.
18695 Use a switch instead of ifs.
18696 Use a single argument.
18697
186982002-06-10 Akim Demaille <akim@epita.fr>
18699
18700 Remove `%thong' support as it is undocumented, unused, duplicates
18701 `%token's job, and creates useless e-mail traffic with people who
18702 want to know what it is, why it is undocumented, unused, and
18703 duplicates `%token's job.
18704
18705 * src/reader.c (parse_thong_decl): Remove.
18706 * src/options.c (option_table): Remove "thong".
18707 * src/lex.h (tok_thong): Remove.
18708
187092002-06-10 Akim Demaille <akim@epita.fr>
18710
18711 * src/symtab.c, src/symtab.c (symbol_type_set)
18712 (symbol_precedence_set): New.
18713 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
18714 (value_components_used): Remove, unused.
18715
187162002-06-09 Akim Demaille <akim@epita.fr>
18717
18718 Move symbols handling code out of the reader.
18719
18720 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
18721 (axiom): Move to...
18722 * src/symtab.h, src/symtab.c: here.
18723
18724 * src/gram.c (start_symbol): Remove: use startsymbol->number.
18725 * src/reader.c (startval): Rename as...
18726 * src/symtab.h, src/symtab.c (startsymbol): this.
18727 * src/reader.c: Adjust.
18728
18729 * src/reader.c (symbol_check_defined, symbol_make_alias)
18730 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
18731 (token_translations_init)
18732 Move to...
18733 * src/symtab.c: here.
18734 * src/reader.c (packsymbols): Move to...
18735 * src/symtab.h, src/symtab.c (symbols_pack): here.
18736 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
18737 argument.
18738
187392002-06-03 Akim Demaille <akim@epita.fr>
18740
18741 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
18742 then statements.
18743
187442002-06-03 Akim Demaille <akim@epita.fr>
18745
18746 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
18747 structs with non literals.
18748 * src/scan-skel.l: never-interactive.
18749 * src/conflicts.c (enum conflict_resolution_e): No trailing
18750 comma.
18751 * src/getargs.c (usage): Split long literal strings.
18752 Reported by Hans Aberg.
18753
187542002-05-28 Akim Demaille <akim@epita.fr>
18755
18756 * data/bison.c++: Use C++ ostreams.
18757 (cdebug_): New member.
18758
187592002-05-28 Akim Demaille <akim@epita.fr>
18760
18761 * src/output.c (output_skeleton): Be sure to allocate enough room
18762 for `/' _and_ for `\0' in full_skeleton.
18763
187642002-05-28 Akim Demaille <akim@epita.fr>
18765
18766 * data/bison.c++: Catch up with bison.simple:
18767 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18768 and Paul Eggert <eggert@twinsun.com>: `error' handing.
18769 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
18770 and popping traces.
18771
187722002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18773
18774 * src/output.c (output_skeleton): Put an explicit path in front of
18775 the skeleton file name, rather than relying on the -I directory,
18776 to partially alleviate effects of having a skeleton file lying around
18777 in the current directory.
18778
187792002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18780
18781 * src/conflicts.c (log_resolution): Correct typo:
18782 obstack_printf should be obstack_fgrow1.
18783
187842002-05-26 Akim Demaille <akim@epita.fr>
18785
18786 * src/state.h (state_t): `solved_conflicts' is a new member.
18787 * src/LR0.c (new_state): Set it to 0.
18788 * src/conflicts.h, src/conflicts.c (print_conflicts)
18789 (free_conflicts, solve_conflicts): Rename as...
18790 (conflicts_print, conflicts_free, conflicts_solve): these.
18791 Adjust callers.
18792 * src/conflicts.c (enum conflict_resolution_e)
18793 (solved_conflicts_obstack): New, used by...
18794 (log_resolution): this.
18795 Adjust to attach the conflict resolution to each state.
18796 Complete the description with the precedence/associativity
18797 information.
18798 (resolve_sr_conflict): Adjust.
18799 * src/print.c (print_state): Output its solved_conflicts.
18800 * tests/conflicts.at (Unresolved SR Conflicts)
18801 (Solved SR Conflicts): Exercise --report=all.
18802
188032002-05-26 Akim Demaille <akim@epita.fr>
18804
18805 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
18806 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
18807 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
18808 (token_number_t, item_number_as_token_number)
18809 (token_number_as_item_number, muscle_insert_token_number_table):
18810 Rename as...
18811 (symbol_number_t, item_number_as_symbol_number)
18812 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
18813 these, since it is more appropriate.
18814
188152002-05-26 Akim Demaille <akim@epita.fr>
18816
18817 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
18818 `Error:' lines.
18819 * data/bison.simple (yystos) [YYDEBUG]: New.
18820 (yyparse) [YYDEBUG]: Display the symbols which are popped during
18821 error recovery.
18822 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
18823
188242002-05-25 Akim Demaille <akim@epita.fr>
18825
18826 * doc/bison.texinfo (Debugging): Split into...
18827 (Tracing): this new section, its former contents, and...
18828 (Understanding): this new section.
18829 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
18830 by...
18831 (report_flag): this.
18832 Adjust all dependencies.
18833 (report_args, report_types, report_argmatch): New.
18834 (usage, getargs): Report/support -r, --report.
18835 * src/options.h
18836 (struct option_table_struct): Rename as..,
18837 (struct option_table_s): this.
18838 Rename the `set_flag' member to `flag' to match with getopt_long's
18839 struct.
18840 * src/options.c (option_table): Split verbose into an entry for
18841 %verbose, and another for --verbose.
18842 Support --report/-r, so remove -r from the obsolete --raw.
18843 * src/print.c: Attach full item sets and lookaheads reports to
18844 report_flag instead of trace_flag.
18845 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
18846
188472002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18848 and Paul Eggert <eggert@twinsun.com>
18849
18850 * data/bison.simple (yyparse): Correct error handling to conform to
18851 POSIX and yacc. Specifically, after syntax error is discovered,
18852 do not reduce further before shifting the error token.
18853 Clean up the code a bit by removing the labels yyerrdefault,
18854 yyerrhandle, yyerrpop.
18855 * NEWS: Document the above.
18856
188572002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18858
18859 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
18860 type; it isn't always big enough, since it doesn't necessarily
18861 include non-terminals.
18862 (yytranslate): Expand definition of yy_token_number_type, so that
18863 the latter can be removed.
18864 (yy_token_number_type): Remove, only one use.
18865 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
18866 don't use TokenNumberType as element type.
18867
18868 * tests/regression.at: Modify expected output to agree with change
18869 to yyr1 and yytranslate.
18870
188712002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
18872
18873 * src/reader.c (parse_action): Use copy_character instead of
18874 obstack_1grow.
18875
188762002-05-13 Akim Demaille <akim@epita.fr>
18877
18878 * tests/regression.at (Token definitions): Prototype yylex and
18879 yyerror.
18880
188812002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18882
18883 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
18884 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
18885 32-bit arithmetic.
18886 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
18887
188882002-05-07 Akim Demaille <akim@epita.fr>
18889
18890 * tests/synclines.at: Be sure to prototype yylex and yyerror to
18891 avoid GCC warnings.
18892
188932002-05-07 Akim Demaille <akim@epita.fr>
18894
18895 Kill GCC warnings.
18896
18897 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
18898 over the RHS of each rule.
18899 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
18900 * src/state.h (state_t): Member `nitems' is unsigned short.
18901 * src/LR0.c (get_state): Adjust.
18902 * src/reader.c (packgram): Likewise.
18903 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
18904 `Type'.
18905 (muscle_insert_int_table): Remove, unused.
18906 (prepare_rules): Remove `max'.
18907
189082002-05-06 Akim Demaille <akim@epita.fr>
18909
18910 * src/closure.c (print_firsts): Display of the symbol tags.
18911 (bitmatrix_print): Move to...
18912 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
18913 here.
18914 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
18915
189162002-05-06 Akim Demaille <akim@epita.fr>
18917
18918 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
18919 hash_do_for_each.
18920
189212002-05-06 Akim Demaille <akim@epita.fr>
18922
18923 * src/LR0.c (new_state, get_state): Instead of using the global
18924 `kernel_size' and `kernel_base', have two new arguments:
18925 `core_size' and `core'.
18926 Adjust callers.
18927
189282002-05-06 Akim Demaille <akim@epita.fr>
18929
18930 * src/reader.c (packgram): No longer end `ritem' with a 0
18931 sentinel: it is not used.
18932
189332002-05-05 Akim Demaille <akim@epita.fr>
18934
18935 New experimental feature: display the lookaheads in the report and
18936 graph.
18937
18938 * src/print (print_core): When --trace-flag, display the rules
18939 lookaheads.
18940 * src/print_graph.c (print_core): Likewise.
18941 Swap the arguments.
18942 Adjust caller.
18943
189442002-05-05 Akim Demaille <akim@epita.fr>
18945
18946 * tests/torture.at (Many lookaheads): New test.
18947
189482002-05-05 Akim Demaille <akim@epita.fr>
18949
18950 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
18951 (GENERATE_MUSCLE_INSERT_TABLE): this.
18952 (output_int_table, output_unsigned_int_table, output_short_table)
18953 (output_token_number_table, output_item_number_table): Replace with...
18954 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
18955 (muscle_insert_short_table, muscle_insert_token_number_table)
18956 (muscle_insert_item_number_table): these.
18957 Adjust all callers.
18958 (prepare_tokens): Don't free `translations', since...
18959 * src/reader.h, src/reader.c (grammar_free): do it.
18960 Move to...
18961 * src/gram.h, src/gram.c (grammar_free): here.
18962 * data/bison.simple, data/bison.c++: b4_token_number_max is now
18963 b4_translate_max.
18964
189652002-05-05 Akim Demaille <akim@epita.fr>
18966
18967 * src/output.c (output_unsigned_int_table): New.
18968 (prepare_rules): `i' is unsigned.
18969 `prhs', `rline', `r2' are unsigned int.
18970 Rename muscle `rhs_number_max' as `rhs_max'.
18971 Output muscles `prhs_max', `rline_max', and `r2_max'.
18972 Free rline and r1.
18973 * data/bison.simple, data/bison.c++: Adjust to use these muscles
18974 to compute types instead of constant types.
18975 * tests/regression.at (Web2c Actions): Adjust.
18976
189772002-05-04 Akim Demaille <akim@epita.fr>
18978
18979 * src/symtab.h (SALIAS, SUNDEF): Rename as...
18980 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
18981 Adjust dependencies.
18982 * src/output.c (token_definitions_output): Be sure not to output a
18983 `#define 'a'' when fed with `%token 'a' "a"'.
18984 * tests/regression.at (Token definitions): New.
18985
189862002-05-03 Paul Eggert <eggert@twinsun.com>
18987
18988 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
18989 for K&R C.
18990
189912002-05-03 gettextize <bug-gnu-gettext@gnu.org>
18992
18993 * Makefile.am (SUBDIRS): Remove intl.
18994 (EXTRA_DIST): Add config/config.rpath.
18995
189962002-05-03 Akim Demaille <akim@epita.fr>
18997
18998 * data/bison.simple (m4_if): Don't output empty enums.
18999 And actually, output valid enum definitions :(.
19000
190012002-05-03 Akim Demaille <akim@epita.fr>
19002
19003 * configure.bat: Remove, completely obsolete.
19004 * Makefile.am (EXTRA_DIST): Adjust.
19005 Don't distribute config.rpath...
19006 * config/Makefile.am (EXTRA_DIST): Do it.
19007
190082002-05-03 Akim Demaille <akim@epita.fr>
19009
19010 * configure.in (GETTEXT_VERSION): New.
19011 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
19012
190132002-05-03 Akim Demaille <akim@epita.fr>
19014
19015 * data/bison.simple (b4_token_enum): New.
19016 (b4_token_defines): Use it to output tokens both as #define and
19017 enums.
19018 Suggested by Paul Eggert.
19019 * src/output.c (token_definitions_output): Don't output spurious
19020 white spaces.
19021
190222002-05-03 Akim Demaille <akim@epita.fr>
19023
19024 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19025
190262002-05-02 Robert Anisko <robert@lrde.epita.fr>
19027
19028 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
19029 Update the stack class, give a try to deque as the default container.
19030
190312002-05-02 Akim Demaille <akim@epita.fr>
19032
19033 * data/bison.simple (yyparse): Do not implement @$ = @1.
19034 (YYLLOC_DEFAULT): Adjust to do it.
19035 * doc/bison.texinfo (Location Default Action): Fix.
19036
190372002-05-02 Akim Demaille <akim@epita.fr>
19038
19039 * src/reader.c (parse_braces): Merge into...
19040 (parse_action): this.
19041
190422002-05-02 Akim Demaille <akim@epita.fr>
19043
19044 * configure.in (ALL_LINGUAS): Remove.
19045 * po/LINGUAS, hr.po: New.
19046
190472002-05-02 Akim Demaille <akim@epita.fr>
19048
19049 Remove the so called hairy (semantic) parsers.
19050
19051 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
19052 * src/gram.h, src/gram.c (semantic_parser): Remove.
19053 (rule_t): Remove the guard and guard_line members.
19054 * src/lex.h (token_t): remove tok_guard.
19055 * src/options.c (option_table): Remove %guard and %semantic_parser
19056 support.
19057 * src/output.c, src/output.h (guards_output): Remove.
19058 (prepare): Adjust.
19059 (token_definitions_output): Don't output the `T'
19060 tokens (???).
19061 (output_skeleton): Don't output the guards.
19062 * src/files.c, src/files.c (attrsfile): Remove.
19063 * src/reader.c (symbol_list): Remove the guard and guard_line
19064 members.
19065 Adjust dependencies.
19066 (parse_guard): Remove.
19067 * data/bison.hairy: Remove.
19068 * doc/bison.texinfo (Environment Variables): Remove occurrences of
19069 BISON_HAIRY.
19070
190712002-05-02 Akim Demaille <akim@epita.fr>
19072
19073 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
19074 (parse_guard): Rename the formal argument `stack_offset' as
19075 `rule_length', which is more readable.
19076 Adjust callers.
19077 (copy_at, copy_dollar): Instead of outputting the hard coded
19078 values of $$, $n and so forth, output invocation to b4_lhs_value,
19079 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
19080 Note: this patch partially drops `semantic-parser' support: it
19081 always does `rule_length - n', where semantic parsers ought to
19082 always use `-n'.
19083 * data/bison.simple, data/bison.c++ (b4_lhs_value)
19084 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
19085
190862002-05-02 Akim Demaille <akim@epita.fr>
19087
19088 * configure.in (AC_INIT): Bump to 1.49b.
19089 (AM_INIT_AUTOMAKE): Short invocation.
19090
190912002-05-02 Akim Demaille <akim@epita.fr>
19092
19093 Version 1.49a.
19094
190952002-05-01 Akim Demaille <akim@epita.fr>
19096
19097 * src/skeleton.h: Remove.
19098
190992002-05-01 Akim Demaille <akim@epita.fr>
19100
19101 * src/skeleton.h: Fix the #endif.
19102 Reported by Magnus Fromreide.
19103
191042002-04-26 Paul Eggert <eggert@twinsun.com>
19105
19106 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
19107 Define if we define YYSTYPE and YYLTYPE, respectively.
19108 (YYCOPY): Fix [] quoting problem in the non-GCC case.
19109
191102002-04-25 Robert Anisko <robert@lrde.epita.fr>
19111
19112 * src/scan-skel.l: Postprocess quadrigraphs.
19113
19114 * src/reader.c (copy_character): New function, used to output
19115 single characters while replacing `[' and `]' with quadrigraphs, to
19116 avoid troubles with M4 quotes.
19117 (copy_comment): Output characters with copy_character.
19118 (read_additionnal_code): Likewise.
19119 (copy_string2): Likewise.
19120 (copy_definition): Likewise.
19121
19122 * tests/calc.at: Exercise M4 quoting.
19123
191242002-04-25 Akim Demaille <akim@epita.fr>
19125
19126 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
19127 between `!' and the command.
19128 Reported by Paul Eggert.
19129
191302002-04-24 Robert Anisko <robert@lrde.epita.fr>
19131
19132 * tests/calc.at: Exercise prologue splitting.
19133
19134 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
19135 `b4_post_prologue' instead of `b4_prologue'.
19136
19137 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
19138 muscles.
19139 (output): Free pre_prologue_obstack and post_prologue_obstack.
19140 * src/files.h, src/files.c (attrs_obstack): Remove.
19141 (pre_prologue_obstack, post_prologue_obstack): New.
19142 * src/reader.c (copy_definition): Add a parameter to specify the
19143 obstack to fill, instead of using attrs_obstack unconditionally.
19144 (read_declarations): Pass pre_prologue_obstack to copy_definition if
19145 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
19146
191472002-04-23 Paul Eggert <eggert@twinsun.com>
19148
19149 * data/bison.simple: Remove unnecessary commentary and white
19150 space differences from 1_29-branch.
19151 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
19152
19153 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
19154 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
19155 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
19156 constructors or destructors.
19157
19158 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
19159
191602002-04-23 Akim Demaille <akim@epita.fr>
19161
19162 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
19163 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
19164 location with columns.
19165 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
19166 All reported by Paul Eggert.
19167
191682002-04-22 Akim Demaille <akim@epita.fr>
19169
19170 * src/reduce.c (dump_grammar): Move to...
19171 * src/gram.h, src/gram.c (grammar_dump): here.
19172 Be sure to separate long item numbers.
19173 Don't read the members of a rule's prec if its nil.
19174
191752002-04-22 Akim Demaille <akim@epita.fr>
19176
19177 * src/output.c (table_size, table_grow): New.
19178 (MAXTABLE): Remove, replace uses with table_size.
19179 (pack_vector): Instead of dying when the table is too big, grow it.
19180
191812002-04-22 Akim Demaille <akim@epita.fr>
19182
19183 * data/bison.simple (yyr1): Its type is that of a token number.
19184 * data/bison.c++ (r1_): Likewise.
19185 * tests/regression.at (Web2c Actions): Adjust.
19186
191872002-04-22 Akim Demaille <akim@epita.fr>
19188
19189 * src/reader.c (token_translations_init): 256 is now the default
19190 value for the error token, i.e., it will be assigned another
19191 number if the user assigned 256 to one of her tokens.
19192 (reader): Don't force 256 to error.
19193 * doc/bison.texinfo (Symbols): Adjust.
19194 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
19195 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
19196 etc. instead of 10, 20, 30 (which was used to `jump' over error
19197 (256) and undefined (2)).
19198
191992002-04-22 Akim Demaille <akim@epita.fr>
19200
19201 Propagate more token_number_t.
19202
19203 * src/gram.h (token_number_as_item_number)
19204 (item_number_as_token_number): New.
19205 * src/output.c (GENERATE_OUTPUT_TABLE): New.
19206 Use it to create output_item_number_table and
19207 output_token_number_table.
19208 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
19209 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
19210 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
19211 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
19212
192132002-04-22 Akim Demaille <akim@epita.fr>
19214
19215 * src/output.h, src/output.c (get_lines_number): Remove.
19216
192172002-04-19 Akim Demaille <akim@epita.fr>
19218
19219 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
19220 as Lex/Flex'.
19221 (Debugging): More details about enabling the debugging features.
19222 (Table of Symbols): Describe $$, $n, @$, and @n.
19223 Suggested by Tim Josling.
19224
192252002-04-19 Akim Demaille <akim@epita.fr>
19226
19227 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
19228
192292002-04-10 Akim Demaille <akim@epita.fr>
19230
19231 * src/system.h: Rely on HAVE_LIMITS_H.
19232 Suggested by Paul Eggert.
19233
192342002-04-09 Akim Demaille <akim@epita.fr>
19235
19236 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
19237 full stderr, and strip it according to the bison options, instead
19238 of composing the error message from different bits.
19239 This makes it easier to check for several error messages.
19240 Adjust all the invocations.
19241 Add an invocation exercising the error token.
19242 Add an invocation demonstrating a stupid error message.
19243 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
19244 Adjust the tests.
19245 Error message are for stderr, not stdout.
19246
192472002-04-09 Akim Demaille <akim@epita.fr>
19248
19249 * src/gram.h, src/gram.c (error_token_number): Remove, use
19250 errtoken->number.
19251 * src/reader.c (reader): Don't specify the user token number (2)
19252 for $undefined, as it uselessly prevents using it.
19253 * src/gram.h (token_number_t): Move to...
19254 * src/symtab.h: here.
19255 (state_t.number): Is a token_number_t.
19256 * src/print.c, src/reader.c: Use undeftoken->number instead of
19257 hard coded 2.
19258 (Even though this 2 is not the same as above: the number of the
19259 undeftoken remains being 2, it is its user token number which
19260 might not be 2).
19261 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
19262 `user_token_number_max'.
19263 Output `undef_token_number'.
19264 * data/bison.simple, data/bison.c++: Use them.
19265 Be sure to map invalid yylex return values to
19266 `undef_token_number'. This saves us from gratuitous SEGV.
19267
19268 * tests/conflicts.at (Solved SR Conflicts)
19269 (Unresolved SR Conflicts): Adjust.
19270 * tests/regression.at (Web2c Actions): Adjust.
19271
192722002-04-08 Akim Demaille <akim@epita.fr>
19273
19274 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
19275 Adding #line.
19276 Remove the duplicate `typedefs'.
19277 (RhsNumberType): Fix the declaration and various other typos.
19278 Use __ofile__.
19279 * data/bison.simple: Use __ofile__.
19280 * src/scan-skel.l: Handle __ofile__.
19281
192822002-04-08 Akim Demaille <akim@epita.fr>
19283
19284 * src/gram.h (item_number_t): New, the type of item numbers in
19285 RITEM. Note that it must be able to code symbol numbers as
19286 positive number, and the negation of rule numbers as negative
19287 numbers.
19288 Adjust all dependencies (pretty many).
19289 * src/reduce.c (rule): Remove this `short *' pointer: use
19290 item_number_t.
19291 * src/system.h (MINSHORT, MAXSHORT): Remove.
19292 Include `limits.h'.
19293 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
19294 (shortcpy): Remove.
19295 (MAXTABLE): Move to...
19296 * src/output.c (MAXTABLE): here.
19297 (prepare_rules): Use output_int_table to output rhs.
19298 * data/bison.simple, data/bison.c++: Adjust.
19299 * tests/torture.at (Big triangle): Move the limit from 254 to
19300 500.
19301 * tests/regression.at (Web2c Actions): Ajust.
19302
19303 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
19304 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
19305 passes, but produces negative #line number, once fixed, GCC is
19306 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
19307 C), it passes.
19308 * src/state.h (state_h): Code input lines on ints, not shorts.
19309
193102002-04-08 Akim Demaille <akim@epita.fr>
19311
19312 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
19313 and then the grammar.
19314
193152002-04-08 Akim Demaille <akim@epita.fr>
19316
19317 * src/system.h: No longer using strndup.
19318
193192002-04-07 Akim Demaille <akim@epita.fr>
19320
19321 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
19322 * src/output.c (output_table_data): Return the longest number.
19323 (prepare_tokens): Output `token_number_max').
19324 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
19325 New.
19326 Use them to define yy_token_number_type/TokenNumberType.
19327 Use this type for yytranslate.
19328 * tests/torture.at (Big triangle): Push the limit from 124 to
19329 253.
19330 * tests/regression.at (Web2c Actions): Adjust.
19331
193322002-04-07 Akim Demaille <akim@epita.fr>
19333
19334 * tests/torture.at (Big triangle): New.
19335 (GNU AWK Grammar, GNU Cim Grammar): Move to...
19336 * tests/existing.at: here.
19337
193382002-04-07 Akim Demaille <akim@epita.fr>
19339
19340 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
19341 nritems.
19342 Adjust dependencies.
19343
193442002-04-07 Akim Demaille <akim@epita.fr>
19345
19346 * src/reader.c: Normalize increments to prefix form.
19347
193482002-04-07 Akim Demaille <akim@epita.fr>
19349
19350 * src/reader.c, symtab.c: Remove debugging code.
19351
193522002-04-07 Akim Demaille <akim@epita.fr>
19353
19354 Rename all the `bucket's as `symbol_t'.
19355
19356 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
19357 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
19358 * src/symtab.c, src/symtab.h (bucket): Rename as...
19359 (symbol_t): this.
19360 (symbol_list_new, bucket_check_defined, bucket_make_alias)
19361 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
19362 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
19363 (buckets_new, buckets_free, buckets_do): Rename as...
19364 (symbol_list_new, symbol_check_defined, symbol_make_alias)
19365 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
19366 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
19367 (symbols_new, symbols_free, symbols_do): these.
19368
193692002-04-07 Akim Demaille <akim@epita.fr>
19370
19371 Use lib/hash for the symbol table.
19372
19373 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
19374 EOF.
19375 * src/lex.c (lex): Set the `number' member of new terminals.
19376 * src/reader.c (bucket_check_defined, bucket_make_alias)
19377 (bucket_check_alias_consistence, bucket_translation): New.
19378 (reader, grammar_free, readgram, token_translations_init)
19379 (packsymbols): Adjust.
19380 (reader): Number the predefined tokens.
19381 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
19382 for predefined tokens.
19383 * src/symtab.h (bucket): Remove all the hash table related
19384 members.
19385 * src/symtab.c (symtab): Replace by...
19386 (bucket_table): this.
19387 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
19388 (buckets_new, buckets_do): New.
19389
193902002-04-07 Akim Demaille <akim@epita.fr>
19391
19392 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
19393 (start_symbol, max_user_token_number, semantic_parser)
19394 (error_token_number): Initialize.
19395 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
19396 Initialize.
19397 (reader): Don't.
19398 (errtoken, eoftoken, undeftoken, axiom): Extern.
19399
194002002-04-07 Akim Demaille <akim@epita.fr>
19401
19402 * src/gram.h (rule_s): prec and precsym are now pointers
19403 to the bucket giving the priority/associativity.
19404 Member `associativity' removed: useless.
19405 * src/reduce.c, src/conflicts.c: Adjust.
19406
194072002-04-07 Akim Demaille <akim@epita.fr>
19408
19409 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
19410 Properly escape the symbols' TAG when outputting them.
19411
194122002-04-07 Akim Demaille <akim@epita.fr>
19413
19414 * src/lalr.h (LA): Is a bitsetv, not bitset*.
19415
194162002-04-07 Akim Demaille <akim@epita.fr>
19417
19418 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
19419 (LArule): this, which is an array to rule_t*.
19420 * src/print.c, src/conflicts.c: Adjust.
19421
194222002-04-07 Akim Demaille <akim@epita.fr>
19423
19424 * src/gram.h (rule_t): Rename `number' as `user_number'.
19425 `number' is a new member.
19426 Adjust dependencies.
19427 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
19428
194292002-04-07 Akim Demaille <akim@epita.fr>
19430
19431 As a result of the previous patch, it is no longer needed
19432 to reorder ritem itself.
19433
19434 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
19435
194362002-04-07 Akim Demaille <akim@epita.fr>
19437
19438 Be sure never to walk through RITEMS, but use only data related to
19439 the rules themselves. RITEMS should be banished.
19440
19441 * src/output.c (output_token_translations): Rename as...
19442 (prepare_tokens): this.
19443 In addition to `translate', prepare the muscles `tname' and
19444 `toknum', which were handled by...
19445 (output_rule_data): this.
19446 Remove, and move the remainder of its outputs into...
19447 (prepare_rules): this new routines, which also merges content from
19448 (output_gram): this.
19449 (prepare_rules): Be sure never to walk through RITEMS.
19450 (output_stos): Rename as...
19451 (prepare_stos): this.
19452 (output): Always invoke prepare_states, after all, just don't use it
19453 in the output if you don't need it.
19454
194552002-04-07 Akim Demaille <akim@epita.fr>
19456
19457 * src/LR0.c (new_state): Display `nstates' as the name of the
19458 newly created state.
19459 Adjust to initialize first_state and last_state if needed.
19460 Be sure to distinguish the initial from the final state.
19461 (new_states): Create the itemset of the initial state, and use
19462 new_state.
19463 * src/closure.c (closure): Now that the initial state has its
19464 items properly set, there is no need for a special case when
19465 creating `ruleset'.
19466
19467 As a result, now the rule 0, reducing to $axiom, is visible in the
19468 outputs. Adjust the test suite.
19469
19470 * tests/conflicts.at (Solved SR Conflicts)
19471 (Unresolved SR Conflicts): Adjust.
19472 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
19473 * tests/conflicts.at (S/R in initial): New.
19474
194752002-04-07 Akim Demaille <akim@epita.fr>
19476
19477 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
19478 the RHS of the rules.
19479 * src/output.c (output_gram): Likewise.
19480
194812002-04-07 Akim Demaille <akim@epita.fr>
19482
19483 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
19484 bucket.
19485 Adjust all dependencies.
19486 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
19487 `number' of the buckets too.
19488 * src/gram.h: Include `symtab.h'.
19489 (associativity): Move to...
19490 * src/symtab.h: here.
19491 No longer include `gram.h'.
19492
194932002-04-07 Akim Demaille <akim@epita.fr>
19494
19495 * src/gram.h, src/gram.c (rules_rhs_length): New.
19496 (ritem_longest_rhs): Use it.
19497 * src/gram.h (rule_t): `number' is a new member.
19498 * src/reader.c (packgram): Set it.
19499 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
19500 the end of `rules', and count them out of `nrules'.
19501 (reduce_output, dump_grammar): Adjust.
19502 * src/print.c (print_grammar): It is no longer needed to check for
19503 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
19504 * tests/reduce.at (Reduced Automaton): New test.
19505
195062002-04-07 Akim Demaille <akim@epita.fr>
19507
19508 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
19509 lacking `+ 1' to nrules, Bison reported as useless a token if it
19510 was used solely to set the precedence of the last rule...
19511
195122002-04-07 Akim Demaille <akim@epita.fr>
19513
19514 * data/bison.c++, data/bison.simple: Don't output the current file
19515 name in #line, to avoid useless diffs between two identical
19516 outputs under different names.
19517
195182002-04-07 Akim Demaille <akim@epita.fr>
19519
19520 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
19521 Normalize loops to using `< nrules + 1', not `<= nrules'.
19522
195232002-04-07 Akim Demaille <akim@epita.fr>
19524
19525 * TODO: Update.
19526
195272002-04-07 Akim Demaille <akim@epita.fr>
19528
19529 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
19530 bucket.value as bucket.number.
19531
195322002-04-07 Akim Demaille <akim@epita.fr>
19533
19534 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
19535 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
19536 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
19537 RHS, instead of being an index in RITEMS.
19538
195392002-04-04 Paul Eggert <eggert@twinsun.com>
19540
19541 * doc/bison.texinfo: Update copyright date.
19542 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
19543 (Symbols): Warn about running Bison in one character set,
19544 but compiling and/or running in an incompatible one.
19545 Warn about character code 256, too.
19546
195472002-04-03 Paul Eggert <eggert@twinsun.com>
19548
19549 * src/bison.data (YYSTACK_ALLOC): Depend on whether
19550 YYERROR_VERBOSE is nonzero, not whether it is defined.
19551
19552 Merge changes from bison-1_29-branch.
19553
195542002-03-20 Paul Eggert <eggert@twinsun.com>
19555
19556 Merge fixes from Debian bison_1.34-1.diff.
19557
19558 * configure.in (AC_PREREQ): 2.53.
19559
195602002-03-20 Akim Demaille <akim@epita.fr>
19561
19562 * src/conflicts.c (log_resolution): Argument `resolution' is const.
19563
195642002-03-19 Paul Eggert <eggert@twinsun.com>
19565
19566 * src/bison.simple (YYCOPY): New macro.
19567 (YYSTACK_RELOCATE): Use it.
19568 Remove Type arg; no longer needed. All callers changed.
19569 (yymemcpy): Remove; no longer needed.
19570
19571 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
19572 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
19573
195742002-03-19 Akim Demaille <akim@epita.fr>
19575
19576 Test and fix the #line outputs.
19577
19578 * tests/atlocal.at (GCC): New.
19579 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
19580 (Prologue synch line, %union synch line, Postprologue synch line)
19581 (Action synch line, Epilogue synch line): New tests.
19582 * src/reader.c (parse_union_decl): Define the muscle stype_line.
19583 * data/bison.simple, data/bison.c++: Use it.
19584
195852002-03-19 Akim Demaille <akim@epita.fr>
19586
19587 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
19588 (Solved SR Conflicts, %expect not enough, %expect right)
19589 (%expect too much): Move to...
19590 * tests/conflicts.at: this new file.
19591
195922002-03-19 Akim Demaille <akim@epita.fr>
19593
19594 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
19595 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
19596 that we can move to enums for instance.
19597 * src/output.c (token_definitions_output): Output a list of
19598 `token-name, token-number' instead of the #define.
19599 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
19600
196012002-03-14 Akim Demaille <akim@epita.fr>
19602
19603 Use Gettext 0.11.1.
19604
196052002-03-09 Robert Anisko <robert@lrde.epita.fr>
19606
19607 * data/bison.c++: Make the user able to add members to the generated
19608 parser by subclassing.
19609
196102002-03-05 Robert Anisko <robert@lrde.epita.fr>
19611
19612 * src/reader.c (read_additionnal_code): `c' should be an integer, not
19613 a character.
19614 Reported by Nicolas Tisserand and Nicolas Burrus.
19615
196162002-03-04 Robert Anisko <robert@lrde.epita.fr>
19617
19618 * src/reader.c: Warn about lacking semi-colons, do not complain.
19619
196202002-03-04 Robert Anisko <robert@lrde.epita.fr>
19621
19622 * data/bison.c++: Remove a debug line.
19623
196242002-03-04 Robert Anisko <robert@lrde.epita.fr>
19625
19626 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
19627 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
19628 provide a default implementation.
19629
196302002-03-04 Akim Demaille <akim@epita.fr>
19631
19632 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
19633 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
19634 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
19635 * tests/semantic.at (Parsing Guards): Similarly.
19636 * src/reader.at (readgram): Complain if the last rule is not ended
19637 with a semi-colon.
19638
196392002-03-04 Akim Demaille <akim@epita.fr>
19640
19641 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
19642 * src/closure.c: here.
19643 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
19644 RTC.
19645 * src/warshall.h, src/warshall.c: Remove.
19646 * tests/sets.at (Broken Closure): Adjust.
19647
196482002-03-04 Akim Demaille <akim@epita.fr>
19649
19650 * src/output.c (output_skeleton): tempdir is const.
19651 bytes_read is unused.
19652
196532002-03-04 Akim Demaille <akim@epita.fr>
19654
19655 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19656 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
19657 Update.
19658 From Michael Hayes.
19659
196602002-03-04 Akim Demaille <akim@epita.fr>
19661
19662 * src/closure.c (closure): `r' is unused.
19663
196642002-03-04 Akim Demaille <akim@epita.fr>
19665
19666 * tests/sets.at (Broken Closure): Add the ending `;'.
19667 * src/reader.at (readgram): Complain if a rule is not ended with a
19668 semi-colon.
19669
196702002-03-04 Akim Demaille <akim@epita.fr>
19671
19672 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
19673 (count_sr_conflicts): Use bitset_count.
19674 * src/reduce.c (inaccessable_symbols): Ditto.
19675 (bits_size): Remove.
19676 * src/warshall.h, src/warshall.c: Convert to bitsetv.
19677
196782002-03-04 Akim Demaille <akim@epita.fr>
19679
19680 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
19681 * src/reduce.c: Remove the `bitset_zero's following the
19682 `bitset_create's, as now it is performed by the latter.
19683
196842002-03-04 Akim Demaille <akim@epita.fr>
19685
19686 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
19687 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
19688 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
19689 latest sources from Michael.
19690
196912002-03-04 Akim Demaille <akim@epita.fr>
19692
19693 * src/output.c (output): Don't free the grammar.
19694 * src/reader.c (grammar_free): New.
19695 * src/main.c (main): Call it and don't free symtab here.
19696
196972002-03-04 Akim Demaille <akim@epita.fr>
19698
19699 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
19700 before returning.
19701 Reported by Benoit Perrot.
19702
197032002-03-04 Akim Demaille <akim@epita.fr>
19704
19705 Use bitset operations when possible, not loops over bits.
19706
19707 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
19708 bitset_or.
19709 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
19710 * src/reduce.c (useless_nonterminals): Formatting changes.
19711 * src/warshall.c (TC): Use bitset_or.
19712
197132002-03-04 Akim Demaille <akim@epita.fr>
19714
19715 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
19716 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
19717 Ditto.
19718
197192002-03-04 Akim Demaille <akim@epita.fr>
19720
19721 * src/lalr.c (F): Now a bitset*.
19722 Adjust all dependencies.
19723
197242002-03-04 Akim Demaille <akim@epita.fr>
19725
19726 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
19727 Adjust all dependencies.
19728
197292002-03-04 Akim Demaille <akim@epita.fr>
19730
19731 * src/L0.c, src/LR0.h (nstates): Be size_t.
19732 Adjust comparisons (signed vs unsigned).
19733 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
19734 bitset*.
19735 Adjust all dependencies.
19736
197372002-03-04 Akim Demaille <akim@epita.fr>
19738
19739 * src/closure.c (firsts): Now, also a bitset.
19740 Adjust all dependencies.
19741 (varsetsize): Remove, now unused.
19742 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
19743
197442002-03-04 Akim Demaille <akim@epita.fr>
19745
19746 * src/print.c: Convert to use bitset.h, not hand coded iterations
19747 over ints.
19748
197492002-03-04 Akim Demaille <akim@epita.fr>
19750
19751 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
19752
197532002-03-04 Akim Demaille <akim@epita.fr>
19754
19755 * src/closure.c (ruleset): Be a bitset.
19756 (rulesetsize): Remove.
19757
197582002-03-04 Akim Demaille <akim@epita.fr>
19759
19760 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19761 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
19762 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
19763 * src/closure.c (fderives): Be an array of bitsets.
19764
197652002-02-28 Robert Anisko <robert@lrde.epita.fr>
19766
19767 * data/bison.c++: Merge the two generated headers. Insert a copyright
19768 notice in each output file.
19769
197702002-02-28 Akim Demaille <akim@epita.fr>
19771
19772 * data/bison.c++: Copy the prologue of bison.simple to fetch
19773 useful M4 definitions, such as b4_header_guard.
19774
197752002-02-25 Akim Demaille <akim@epita.fr>
19776
19777 * src/getargs.c (version): Give the name of the authors, and use a
19778 translator friendly scheme for the bgr
19779 copyright notice.
19780
197812002-02-25 Akim Demaille <akim@epita.fr>
19782
19783 * src/output.c (header_output): Remove, now handled completely via
19784 M4.
19785
197862002-02-25 Akim Demaille <akim@epita.fr>
19787
19788 * m4/m4.m4: New, from CVS Autoconf.
19789 * configure.in: Invoke it.
19790 * src/output.c (output_skeleton): Use its result instead of the
19791 hard coded name.
19792
197932002-02-25 Akim Demaille <akim@epita.fr>
19794
19795 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
19796 Fileutils 4.1.5.
19797 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
19798 * src/output.c (output_skeleton): Use mkstemp to create a real
19799 temporary file.
19800 Move the filling of `skeleton' and its muscle to...
19801 (prepare): here.
19802 (output): Move the definition of the prologue muscle to...
19803 (prepare): here.
19804 * src/system.h (DEFAULT_TMPDIR): New.
19805
198062002-02-14 Paul Eggert <eggert@twinsun.com>
19807
19808 Remove the support for C++ namespace cleanliness; it was
19809 causing more problems than it was curing, since it didn't work
19810 properly on some nonstandard C++ compilers. This can wait
19811 for a proper C++ parser.
19812
19813 * NEWS: Document this.
19814 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
19815 of C++, as it's treated like C now.
19816 * src/bison.simple (YYSTD): Remove.
19817 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
19818 Treat C++ just like Standard C instead of trying to support
19819 namespace cleanliness.
19820
198212002-02-14 Akim Demaille <akim@epita.fr>
19822
19823 * tests/regression.at (else): Adjust to Andreas' change.
19824
198252002-02-14 Akim Demaille <akim@epita.fr>
19826
19827 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
19828
198292002-02-13 Andreas Schwab <schwab@suse.de>
19830
19831 * src/output.c (output_rule_data): Don't output NULL, it might
19832 not be defined yet.
19833
198342002-02-11 Robert Anisko <robert@lrde.epita.fr>
19835
19836 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
19837 (Copyright notice): Update.
19838
198392002-02-11 Akim Demaille <akim@epita.fr>
19840
19841 * tests/regression.at (%nonassoc and eof): Don't include
19842 nonportable headers.
19843
198442002-02-08 Robert Anisko <robert@lrde.epita.fr>
19845
19846 * data/bison.c++: Correct error recovery. Make the user able to
19847 initialize the starting location.
19848
198492002-02-07 Akim Demaille <akim@epita.fr>
19850
19851 * tests/input.at: New.
19852
198532002-02-07 Robert Anisko <robert@lrde.epita.fr>
19854
19855 * data/bison.c++: Replace some direct m4 expansions by constants. Be
19856 more consistent when naming methods and variables. Put preprocessor
19857 directives around tables only needed for debugging.
19858
198592002-02-07 Robert Anisko <robert@lrde.epita.fr>
19860
19861 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
19862 C++ parsers.
19863 (yy::b4_name::parse): Use print_.
19864
198652002-02-07 Robert Anisko <robert@lrde.epita.fr>
19866
19867 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
19868
198692002-02-07 Robert Anisko <robert@lrde.epita.fr>
19870
19871 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
19872 C++ parsers.
19873 (yy::b4_name::parse): Build verbose error messages, and use error_.
19874
198752002-02-06 Robert Anisko <robert@lrde.epita.fr>
19876
19877 * data/bison.c++: Fix m4 quoting in comments.
19878
198792002-02-06 Robert Anisko <robert@lrde.epita.fr>
19880
19881 * data/bison.c++: Adjust the parser code. Fix some muscles that were
19882 not expanded by m4.
19883
198842002-02-05 Akim Demaille <akim@epita.fr>
19885
19886 * data/bison.c++: Adjust to the M4 back end.
19887 More is certainly needed.
19888
198892002-02-05 Akim Demaille <akim@epita.fr>
19890
19891 Give a try to M4 as a back end.
19892
19893 * lib/readpipe.c: New, from wdiff.
19894 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
19895 BISON_HAIRY.
19896 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
19897 specific values. Now it is m4 that performs the lookup.
19898 * src/parse-skel.y: Remove.
19899 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
19900 * src/output.c (actions_output, guards_output)
19901 (token_definitions_output): No longer keeps track of the output
19902 line number, hence remove the second argument.
19903 (guards_output): Check against the guard member of a rule, not the
19904 action member.
19905 Adjust callers.
19906 (output_skeleton): Don't look for the skeleton location, let m4 do
19907 that.
19908 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
19909 file will be used.
19910 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
19911 (prepare): Given that for the time being changesyntax is not
19912 usable in M4, rename the muscles using `-' to `_'.
19913 Define `defines_flag', `output_parser_name' and `output_header_name'.
19914 * src/output.h (actions_output, guards_output)
19915 (token_definitions_output): Adjust prototypes.
19916 * src/scan-skel.l: Instead of scanning the skeletons, it now
19917 processes the output of m4: `__oline__' and `#output'.
19918 * data/bison.simple: Adjust to be used by M4(sugar).
19919 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
19920 to date.
19921 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
19922 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
19923 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
19924 shamelessly stolen from CVS Autoconf.
19925
199262002-02-05 Akim Demaille <akim@epita.fr>
19927
19928 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
19929 * configure.in: Check for the declarations of free and malloc.
19930 * src/muscle_tab.c: Adjust.
19931
199322002-02-05 Akim Demaille <akim@epita.fr>
19933
19934 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
19935 which have no values.
19936
199372002-02-05 Akim Demaille <akim@epita.fr>
19938
19939 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
19940 * data/: here.
19941
199422002-01-29 Paul Eggert <eggert@twinsun.com>
19943
19944 * src/bison.simple (YYSIZE_T): Do not define merely because
19945 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
19946 On some platforms, <alloca.h> does not declare YYSTD (size_t).
19947
199482002-01-27 Akim Demaille <akim@epita.fr>
19949
19950 Fix `%nonassoc and eof'.
19951
19952 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
19953 which were not properly copied! Replace
19954 memcpy (res->errs, src->errs, src->nerrs);
19955 with
19956 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
19957 !!!
19958 * tests/regression.at (%nonassoc and eof): Adjust to newest
19959 Autotest: `.' is not in the PATH.
19960
199612002-01-27 Akim Demaille <akim@epita.fr>
19962
19963 * tests/sets.at (AT_EXTRACT_SETS): New.
19964 (Nullable): Use it.
19965 (Firsts): New.
19966
199672002-01-26 Akim Demaille <akim@epita.fr>
19968
19969 * tests/actions.at, tests/calc.at, tests/headers.at,
19970 * tests/torture.at: Adjust to the newest Autotest which no longer
19971 forces `.' in the PATH.
19972
199732002-01-25 Akim Demaille <akim@epita.fr>
19974
19975 * tests/regression.at (%nonassoc and eof): New.
19976 Suggested by Robert Anisko.
19977
199782002-01-24 Akim Demaille <akim@epita.fr>
19979
19980 Bison dumps core when trying to complain about broken input files.
19981 Reported by Cris van Pelt.
19982
19983 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
19984 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
19985 into...
19986 (Invalid inputs): Strengthen: exercise parse_percent_token.
19987
199882002-01-24 Robert Anisko <robert.anisko@epita.fr>
19989
19990 * src/Makefile.am: Add bison.c++.
19991 * src/bison.c++: New skeleton.
19992
199932002-01-21 Paolo Bonzini <bonzini@gnu.org>
19994
19995 * po/it.po: New.
19996
199972002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
19998
19999 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
20000
200012002-01-20 Marc Autret <marc@gnu.org>
20002
20003 * src/files.c (compute_output_file_names): Fix
20004
200052002-01-20 Marc Autret <marc@gnu.org>
20006
20007 * tests/output.at: New test.
20008 * src/files.c (compute_base_names): Don't map extensions when
20009 the YACC flag is set, use defaults.
20010 Reported by Evgeny Stambulchik.
20011
200122002-01-20 Marc Autret <marc@gnu.org>
20013
20014 * src/system.h: Need to define __attribute__ away for non-GCC
20015 compilers as well (i.e., the vendor C compiler).
20016 Suggested by Albert Chin-A-Young.
20017
200182002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
20019
20020 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
20021 canonical definition.
20022 * src/system.h: Use the canonical definition for PARAMS (avoids
20023 a conflict with the macro from lib/hash.h).
20024
200252002-01-11 Akim Demaille <akim@epita.fr>
20026
20027 * configure.in: Use AC_FUNC_STRNLEN.
20028 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
20029
200302002-01-09 Akim Demaille <akim@epita.fr>
20031
20032 * src/files.c, src/files.h (output_infix): New.
20033 (tab_extension): Remove.
20034 (compute_base_names): Compute the former, drop the latter.
20035 * src/output.c (prepare): Insert the muscles `output-infix', and
20036 `output-suffix'.
20037 * src/parse-skel.y (string, string.1): New.
20038 (section.header): Use it.
20039 (section.yacc): Remove.
20040 (prefix): Remove too.
20041 * src/scan-skel.l: Adjust.
20042 * src/bison.simple, src/bison.hairy: Adjust.
20043
200442002-01-09 Akim Demaille <akim@epita.fr>
20045
20046 * configure.in (WERROR_CFLAGS): Compute it.
20047 * src/Makefile.am (CFLAGS): Pass it.
20048 * tests/atlocal.in (CFLAGS): Idem.
20049 * src/files.c: Fix a few warnings.
20050 (get_extension_index): Remove, unused.
20051
200522002-01-08 Akim Demaille <akim@epita.fr>
20053
20054 * src/getargs.c (AS_FILE_NAME): New.
20055 (getargs): Use it to convert DOSish file names.
20056 * src/files.c (base_name): Rename as full_base_name to avoid
20057 clashes with `base_name ()'.
20058 (filename_split): New.
20059 (compute_base_names): N-th rewrite, using filename_split.
20060
200612002-01-08 Akim Demaille <akim@epita.fr>
20062
20063 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
20064 New, stolen from the Fileutils 4.1.
20065 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20066 * configure.in: Check for the presence of memrchr, and of its
20067 prototype.
20068
200692002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
20070
20071 * lib/hash.h (__P): Added definition for this macro.
20072 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
20073 BUILT_SOURCES, to ensure they are generated first.
20074 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
20075 %error-verbose to allow bootstrapping with bison 1.30x.
20076
200772002-01-06 Akim Demaille <akim@epita.fr>
20078
20079 * src/reader.c (parse_braces): Don't fetch the next char, the
20080 convention is to fetch on entry.
20081 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
20082 'switch' without a following semicolon.
20083 * tests/regression.at (braces parsing): New.
20084
200852002-01-06 Akim Demaille <akim@epita.fr>
20086
20087 Bison is dead wrong in its RR conflict reports.
20088
20089 * tests/torture.at (GNU Cim Grammar): New.
20090 * src/conflicts.c (count_rr_conflicts): Fix.
20091
200922002-01-06 Akim Demaille <akim@epita.fr>
20093
20094 Creating package.m4 from configure.ac causes too many problems.
20095
20096 * tests/Makefile.am (package.m4): Create it by hand,
20097 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
20098
200992002-01-06 Akim Demaille <akim@epita.fr>
20100
20101 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
20102 skeleton.h.
20103
201042002-01-04 Paul Eggert <eggert@twinsun.com>
20105
20106 * doc/bison.texinfo (Debugging):
20107 Remove YYSTDERR; it's no longer defined or used.
20108 Also, s/cstdio.h/cstdio/.
20109
201102002-01-03 Akim Demaille <akim@epita.fr>
20111
20112 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
20113
201142002-01-03 Akim Demaille <akim@epita.fr>
20115
20116 * src/parse-skel.y (process_skeleton): Don't bind the parser's
20117 tracing code to --trace, wait for a better --trace option, with
20118 args.
20119
201202002-01-03 Akim Demaille <akim@epita.fr>
20121
20122 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
20123 The ISO C++ standard is extremely clear about it: stderr is
20124 considered a macro, not a regular symbol (see table 94 `Header
20125 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
20126 Therefore std:: does not apply to it. It still does with fprintf.
20127 Also, s/cstdio.h/cstdio/.
20128
201292002-01-03 Akim Demaille <akim@epita.fr>
20130
20131 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
20132 for non system headers.
20133
201342002-01-02 Akim Demaille <akim@epita.fr>
20135
20136 Equip the skeleton chain with location tracking, runtime trace,
20137 pure parser and scanner.
20138
20139 * src/parse-skel.y: Request a pure parser, locations, and prefix
20140 renaming.
20141 (%union): Having several members with the same type does not help
20142 type mismatches, simplify.
20143 (YYPRINT, yyprint): New.
20144 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
20145 (skel_error): this.
20146 Handle locations.
20147 * src/scan-skel.l: Adjust to these changes.
20148 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
20149 (LOCATION_PRINT, skel_control_t): New.
20150
201512001-12-30 Akim Demaille <akim@epita.fr>
20152
20153 * src/parse-skel.y: Get rid of the shift/reduce conflict:
20154 replace `gb' with BLANKS.
20155 * src/scan-skel.l: Adjust.
20156
201572001-12-30 Akim Demaille <akim@epita.fr>
20158
20159 * src/system.h: We don't need nor want bcopy.
20160 Throw away MS-DOS crap: we don't need getpid.
20161 * configure.in: We don't need strndup. It was even causing
20162 problems: because Flex includes the headers *before* us,
20163 _GNU_SOURCE is not defined by config.h, and therefore strndup was
20164 not visible.
20165 * lib/xstrndup.c: New.
20166 * src/scan-skel.l: Use it.
20167 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
20168 * src/parse-skel.y: Use %directives instead of #defines.
20169
201702001-12-30 Akim Demaille <akim@epita.fr>
20171
20172 * src/skeleton.h: New.
20173 * src/output.c (output_parser, output_master_parser): Remove, dead
20174 code.
20175 * src/output.h (get_lines_number, actions_output, guards_output)
20176 (token_definitions_output): Prototype them.
20177 * src/parse-skel.y: Add the license notice.
20178 Include output.h and skeleton.h.
20179 (process_skeleton): Returns void, and takes a single parameter.
20180 * src/scan-skel.l: Add the license notice.
20181 Include skeleton.h.
20182 Don't use %option yylineno: it seems that then Flex imagines
20183 REJECT has been used, and therefore it won't reallocate its
20184 buffers (which makes no other sense to me than a bug). It results
20185 in warnings for `unused: yy_flex_realloc'.
20186
201872001-12-30 Robert Anisko <robert.anisko@epita.fr>
20188
20189 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
20190 (MUSCLE_INSERT_PREFIX): ...to there.
20191 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
20192 (MUSCLE_INSERT_PREFIX): Move from here...
20193
20194 * src/bison.hairy: Add a section directive. Put braces around muscle
20195 names. This parser skeleton is still broken, but Bison should not
20196 choke on a bad muscle 'syntax'.
20197 * src/bison.simple: Add a section directive. Put braces around muscle
20198 names.
20199
20200 * src/files.h (strsuffix, stringappend): Add declarations.
20201 (tab_extension): Add declaration.
20202 (short_base_name): Add declaration.
20203
20204 * src/files.c (strsuffix, stringappend): No longer static. These
20205 functions are used in the skeleton parser.
20206 (tab_extension): New.
20207 (compute_base_names): Use the computations done in this function
20208 to guess if the generated parsers should have '.tab' in their
20209 names.
20210 (short_base_name): No longer static.
20211
20212 * src/output.c (output_skeleton): New.
20213 (output): Disable call to output_master_parser, and give a try to
20214 a new skeleton handling system.
20215 (guards_output, actions_output): No longer static.
20216 (token_definitions_output, get_lines_number): No longer static.
20217
20218 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
20219
20220 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
20221 parse-skel.y.
20222
20223 * src/parse-skel.y: New file.
20224 * src/scan-skel.l: New file.
20225
202262001-12-29 Akim Demaille <akim@epita.fr>
20227
20228 %name-prefix is broken.
20229
20230 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
20231 Adjust all dependencies.
20232 * tests/headers.at (export YYLTYPE): Strengthen this test: use
20233 %name-prefix.
20234
20235 Renaming yylval but not yylloc is not consistent. Now we do.
20236
20237 * src/bison.simple: Prefix yylloc if used.
20238 * doc/bison.texinfo (Decl Summary): Document that.
20239
202402001-12-29 Akim Demaille <akim@epita.fr>
20241
20242 * doc/bison.texinfo: Promote `%long-directive' over
20243 `%long_directive'.
20244 Remove all references to fixed-output-files, yacc is enough.
20245
202462001-12-29 Akim Demaille <akim@epita.fr>
20247
20248 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
20249 user prologue. These are defaults.
20250 * tests/actions.at (Mid-rule actions): Make sure the user can
20251 define YYDEBUG and YYERROR_VERBOSE.
20252
202532001-12-29 Akim Demaille <akim@epita.fr>
20254
20255 * src/output.c (header_output): Don't forget to export YYLTYPE and
20256 yylloc.
20257 * tests/headers.at (export YYLTYPE): New, make sure it does.
20258 * tests/regression.at (%union and --defines, Invalid CPP headers):
20259 Move to...
20260 * tests/headers.at: here.
20261
202622001-12-29 Akim Demaille <akim@epita.fr>
20263
20264 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
20265
202662001-12-29 Akim Demaille <akim@epita.fr>
20267
20268 * tests/actions.at (Mid-rule actions): Output on a single line
20269 instead of several.
20270
202712001-12-29 Akim Demaille <akim@epita.fr>
20272
20273 * doc/bison.texinfo: Formatting changes.
20274
202752001-12-29 Akim Demaille <akim@epita.fr>
20276
20277 Don't store the token defs in a muscle, just be ready to output it
20278 on command. Now possible via `symbols'. Fixes a memory leak.
20279
20280 * src/output.c (token_definitions_output): New.
20281 (output_parser, header_output): Use it.
20282 * src/reader.c (symbols_save): Remove.
20283
202842001-12-29 Akim Demaille <akim@epita.fr>
20285
20286 * src/bison.simple: Do not provide a default for YYSTYPE and
20287 YYLTYPE before the user's prologue. Otherwise it's hardly... a
20288 default.
20289
202902001-12-29 Akim Demaille <akim@epita.fr>
20291
20292 Mid-rule actions are simply... ignored!
20293
20294 * src/reader.c (readgram): Be sure to attach mid-rule actions to
20295 the empty-rule associated to the dummy symbol, not to the host
20296 rule.
20297 * tests/actions.at (Mid-rule actions): New.
20298
202992001-12-29 Akim Demaille <akim@epita.fr>
20300
20301 Memory leak.
20302
20303 * src/reader.c (reader): Free grammar.
20304
203052001-12-29 Akim Demaille <akim@epita.fr>
20306
20307 Memory leak.
20308
20309 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
20310 since it allocates it for each state, although only one is needed.
20311 (allocate_storage): Do it here.
20312
203132001-12-29 Akim Demaille <akim@epita.fr>
20314
20315 * src/options.h, src/options.c (create_long_option_table): Rename
20316 as...
20317 (long_option_table_new): this, with a clearer prototype.
20318 (percent_table): Remove, unused,
20319 * src/getargs.c (getargs): Adjust.
20320
203212001-12-29 Akim Demaille <akim@epita.fr>
20322
20323 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
20324 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
20325 as states.
20326
203272001-12-29 Akim Demaille <akim@epita.fr>
20328
20329 * src/lalr.c (build_relations): Rename `states' as `states1'.
20330 Sorry, I don't understand exactly what it is, no better name...
20331
203322001-12-29 Akim Demaille <akim@epita.fr>
20333
20334 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
20335 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
20336 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
20337 as rules.
20338
203392001-12-29 Akim Demaille <akim@epita.fr>
20340
20341 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
20342 ago.
20343
203442001-12-29 Akim Demaille <akim@epita.fr>
20345
20346 * src/reader.c, src/reader.h (user_toknums): Remove.
20347 Adjust all users to use symbols[i]->user_token_number.
20348
203492001-12-29 Akim Demaille <akim@epita.fr>
20350
20351 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
20352 Adjust all users to use symbols[i]->prec or ->assoc.
20353
203542001-12-29 Akim Demaille <akim@epita.fr>
20355
20356 * src/reader.c, src/reader.h (tags): Remove.
20357 Adjust all users to use symbols[i]->tag.
20358
203592001-12-29 Akim Demaille <akim@epita.fr>
20360
20361 * src/gram.h, src/gram.c (symbols): New, similar to state_table
20362 and rule_table.
20363 * src/reader.c (packsymbols): Fill this table.
20364 Drop sprec.
20365 * src/conflicts.c (resolve_sr_conflict): Adjust.
20366 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
20367 single table.
20368 Use symbols[i]->tag instead of tags[i].
20369
203702001-12-29 Akim Demaille <akim@epita.fr>
20371
20372 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
20373 In addition, put a comment in there, to replace...
20374 * tests/regression.at (%union and C comments): Remove.
20375
203762001-12-29 Akim Demaille <akim@epita.fr>
20377
20378 * tests/regression.at (Web2c Actions): Blindly move the actual
20379 output as expected output. The contents *seem* right to me, but I
20380 can't pretend reading perfectly parser tables... Nonetheless, all
20381 the other tests pass correctly, the table look OK, even though the
20382 presence of `$axiom' is to be noted: AFAICS it is useless (but
20383 harmless).
20384
203852001-12-29 Akim Demaille <akim@epita.fr>
20386
20387 * src/reader.c (readgram): Don't add the rule 0 if there were no
20388 rules read. In other words, add it _after_ having performed
20389 grammar sanity checks.
20390 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
20391
203922001-12-29 Akim Demaille <akim@epita.fr>
20393
20394 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
20395 visible, and some states have now a different number.
20396
203972001-12-29 Akim Demaille <akim@epita.fr>
20398
20399 * src/reader.c (readgram): Bind the initial rule's lineno to that
20400 of the first rule.
20401 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
20402 (Solved SR Conflicts): Adjust rule 0's line number.
20403
204042001-12-29 Akim Demaille <akim@epita.fr>
20405
20406 Fix the `GAWK Grammar' failure.
20407
20408 * src/LR0.c (final_state): Initialize to -1 so that we do compute
20409 the reductions of the first state which was mistakenly confused
20410 with the final state because precisely final_state was initialized
20411 to 0.
20412 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
20413 now noticed by Bison.
20414 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
20415 have a reduction on $default.
20416
204172001-12-29 Akim Demaille <akim@epita.fr>
20418
20419 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
20420 rule line numbers.
20421 * src/closure.c (print_closure): Likewise.
20422 * src/derives.c (print_derives): Likewise.
20423 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
20424 now.
20425
204262001-12-29 Akim Demaille <akim@epita.fr>
20427
20428 * src/lalr.c (lookaheads_print): New.
20429 (lalr): Call it when --trace-flag.
20430 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
20431 are dumped.
20432
204332001-12-29 Akim Demaille <akim@epita.fr>
20434
20435 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
20436 when walking through ritem, even via rule->rhs.
20437 * src/reduce.c (dump_grammar, useful_production, reduce_output)
20438 (useful_production, useless_nonterminals): Likewise.
20439 (reduce_grammar_tables): Likewise, plus update nritems.
20440 * src/nullable.c (set_nullable): Likewise.
20441 * src/lalr.c (build_relations): Likewise.
20442 * tests/sets.at (Nullable): Adjust.
20443 Fortunately, now, the $axiom is no longer nullable.
20444
204452001-12-29 Akim Demaille <akim@epita.fr>
20446
20447 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
20448 the 0-sentinel.
20449 * src/gram.c (ritem_longest_rhs): Likewise.
20450 * src/reduce.c (nonterminals_reduce): Likewise.
20451 * src/print_graph.c (print_graph): Likewise.
20452 * src/output.c (output_rule_data): Likewise.
20453 * src/nullable.c (set_nullable): Likewise.
20454
204552001-12-29 Akim Demaille <akim@epita.fr>
20456
20457 * src/output.c: Comment changes.
20458
204592001-12-27 Paul Eggert <eggert@twinsun.com>
20460
20461 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
20462 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
20463 Sparc, as they were causing more porting problems than the
20464 (minor) performance improvement was worth.
20465
20466 Also, catch up with 1.31's YYSTD.
20467
204682001-12-27 Akim Demaille <akim@epita.fr>
20469
20470 * src/output.c (output_gram): Rely on nritems, not the
20471 0-sentinel. See below.
20472 Use -1 as separator, not 0.
20473 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
20474 Rely on -1 as separator in yyrhs, instead of 0.
20475 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
20476 twice `Now at end of input', therefore there are two lines less to
20477 expect.
20478
204792001-12-27 Akim Demaille <akim@epita.fr>
20480
20481 * tests/regression.at (Unresolved SR Conflicts):
20482 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
20483 below.
20484
204852001-12-27 Akim Demaille <akim@epita.fr>
20486
20487 * src/LR0.c (new_state): Recognize the final state by the fact it
20488 is reached by eoftoken.
20489 (insert_start_shifting_state, insert_eof_shifting_state)
20490 (insert_accepting_state, augment_automaton): Remove, since now
20491 these states are automatically computed from the initial state.
20492 (generate_states): Adjust.
20493 * src/print.c: When reporting a rule number to the user, substract
20494 1, so that the axiom rule is rule 0, and the first user rule is 1.
20495 * src/reduce.c: Likewise.
20496 * src/print_graph.c (print_core): For the time being, just as for
20497 the report, depend upon --trace-flags to dump the full set of
20498 items.
20499 * src/reader.c (readgram): Once the grammar read, insert the rule
20500 0: `$axiom: START-SYMBOL $'.
20501 * tests/set.at: Adjust: rule 0 is now displayed, and since the
20502 number of the states has changed (the final state is no longer
20503 necessarily the last), catch up.
20504
205052001-12-27 Akim Demaille <akim@epita.fr>
20506
20507 Try to make the use of the eoftoken valid. Given that its value
20508 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
20509 is used instead of > 0 where appropriate, (ii), depend upon nritems
20510 instead of the 0-sentinel.
20511
20512 * src/gram.h, src/gram.c (nritems): New.
20513 Expected to be duplication of nitems, but for the time being...
20514 * src/reader.c (packgram): Assert nritems and nitems are equal.
20515 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
20516 * src/closure.c (print_closure, print_fderives): Likewise.
20517 * src/gram.c (ritem_print): Likewise.
20518 * src/print.c (print_core, print_grammar): Likewise.
20519 * src/print_graph.c: Likewise.
20520
205212001-12-27 Akim Demaille <akim@epita.fr>
20522
20523 * src/main.c (main): If there are complains after grammar
20524 reductions, then output the report anyway if requested, then die.
20525 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
20526 * src/reader.c (eoftoken): New.
20527 (parse_token_decl): If the token being defined has value `0', it
20528 is the eoftoken.
20529 (packsymbols): No longer hack `tags' to insert `$' by hand.
20530 Be sure to preserve the value of the eoftoken.
20531 (reader): Make sure eoftoken is defined.
20532 Initialize nsyms to 0: now eoftoken is created just like the others.
20533 * src/print.c (print_grammar): Don't special case the eof token.
20534 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
20535 lie anyway, albeit pleasant.
20536 * tests/calc.at: Exercise error messages with eoftoken.
20537 Change the grammar so that empty input is invalid.
20538 Adjust expectations.
20539 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
20540
205412001-12-27 Akim Demaille <akim@epita.fr>
20542
20543 * configure.in: Check the protos of strchr ans strspn.
20544 Replace strchr if needed.
20545 * src/system.h: Provide the protos of strchr, strspn and memchr if
20546 missing.
20547 * lib/strchr.c: New.
20548 * src/reader.c (symbols_save): Use strchr.
20549
205502001-12-27 Akim Demaille <akim@epita.fr>
20551
20552 * src/print.c, src/print_graph.c (escape): New.
20553 Use it to quote the TAGS outputs.
20554 * src/print_graph.c (print_state): Now errors are in red, and
20555 reductions in green.
20556 Prefer high to wide: output the state number on a line of its own.
20557
205582001-12-27 Akim Demaille <akim@epita.fr>
20559
20560 * src/state.h, src/state.c (reductions_new): New.
20561 * src/LR0.c (set_state_table): Let all the states have a
20562 `reductions', even if reduced to 0.
20563 (save_reductions): Adjust.
20564 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
20565 * src/print.c (print_reductions, print_actions): Adjust.
20566 * src/output.c (action_row): Adjust.
20567
205682001-12-27 Akim Demaille <akim@epita.fr>
20569
20570 * src/state.h, src/state.c (errs_new, errs_dup): New.
20571 * src/LR0.c (set_state_table): Let all the states have an errs,
20572 even if reduced to 0.
20573 * src/print.c (print_errs, print_reductions): Adjust.
20574 * src/output.c (output_actions, action_row): Adjust.
20575 * src/conflicts.c (resolve_sr_conflict): Adjust.
20576
205772001-12-27 Akim Demaille <akim@epita.fr>
20578
20579 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
20580
205812001-12-27 Akim Demaille <akim@epita.fr>
20582
20583 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
20584 * src/print.c: here.
20585 (lookaheadset, shiftset): New, used as additional storage by
20586 print_reductions.
20587 (print_results): Adjust.
20588 (print_shifts, print_gotos, print_errs): New, extracted from...
20589 (print_actions): here.
20590 * src/print_graph.c (print_actions): Remove dead code.
20591
205922001-12-27 Akim Demaille <akim@epita.fr>
20593
20594 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
20595 `$n' and `@n'.
20596
205972001-12-27 Akim Demaille <akim@epita.fr>
20598
20599 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
20600 (build_relations): Adjust.
20601
206022001-12-27 Akim Demaille <akim@epita.fr>
20603
20604 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
20605 duplication.
20606
206072001-12-27 Akim Demaille <akim@epita.fr>
20608
20609 * src/reader.c (packgram): Catch nitems overflows.
20610
206112001-12-27 Akim Demaille <akim@epita.fr>
20612
20613 * src/files.c, src/files.h (guard_obstack): Remove.
20614 * src/output.c (output): Adjust.
20615 * src/reader.c (parse_braces): New, factoring...
20616 (copy_action, copy_guard): these two which are renamed as...
20617 (parse_action, parse_guard): these.
20618 As a voluntary consequence, using braces around guards is now
20619 mandatory.
20620
206212001-12-27 Akim Demaille <akim@epita.fr>
20622
20623 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
20624 * src/reader.c (symbol_list): `guard' and `guard_line' are new
20625 members.
20626 (symbol_list_new): Adjust.
20627 (copy_action): action_line is the first line, not the last.
20628 (copy_guard): Just as for actions, store the `action' only, not
20629 the switch/case/break flesh.
20630 Don't parse the user action that might follow the guard, let...
20631 (readgram): do it, i.e., now, there can be an action after a
20632 guard.
20633 In other words the guard is just explicitly optional.
20634 (packgram): Adjust.
20635 * src/output.c (guards_output): New.
20636 (output_parser): Call it when needed.
20637 (output): Also free the guard and attrs obstacks.
20638 * src/files.c, src/files.h (obstack_save): Remove.
20639 (output_files): Remove.
20640 As a result, if one needs the former `.act' file, using an
20641 appropriate skeleton which requires actions and guards is now
20642 required.
20643 * src/main.c (main): Adjust.
20644 * tests/semantic.at: New.
20645 * tests/regression.at: Use `input.y' as input file name.
20646 Avoid 8+3 problems by requiring input.c when the test needs the
20647 parser.
20648
206492001-12-27 Akim Demaille <akim@epita.fr>
20650
20651 * src/reader.c (symbol_list_new): Be sure to initialize all the
20652 fields.
20653
206542001-12-27 Akim Demaille <akim@epita.fr>
20655
20656 All the hacks using a final pseudo state are now useless.
20657
20658 * src/LR0.c (set_state_table): state_table holds exactly nstates.
20659 * src/lalr.c (nLA): New.
20660 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
20661 instead of lookaheadsp from the pseudo state (nstate + 1).
20662
206632001-12-27 Akim Demaille <akim@epita.fr>
20664
20665 * src/output.c (action_row, token_actions): Use a state_t instead
20666 of a integer, and nlookaheads instead of the following state's
20667 lookaheadsp.
20668
206692001-12-27 Akim Demaille <akim@epita.fr>
20670
20671 * src/conflicts.c (log_resolution, flush_shift)
20672 (resolve_sr_conflict, set_conflicts, solve_conflicts)
20673 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
20674 (conflicts_print, print_reductions): Use a state_t instead of an
20675 integer when referring to a state.
20676 As much as possible, depend upon nlookaheads, instead of the
20677 `lookaheadsp' member of the following state (since lookaheads of
20678 successive states are successive, the difference between state n + 1
20679 and n served as the number of lookaheads for state n).
20680 * src/lalr.c (add_lookback_edge): Likewise.
20681 * src/print.c (print_core, print_actions, print_state)
20682 (print_results): Likewise.
20683 * src/print_graph.c (print_core, print_actions, print_state)
20684 (print_graph): Likewise.
20685 * src/conflicts.h: Adjust.
20686
206872001-12-27 Akim Demaille <akim@epita.fr>
20688
20689 * src/bison.hairy: Formatting/comment changes.
20690 ANSIfy.
20691 Remove `register' indications.
20692 Add plenty of `static'.
20693
206942001-12-27 Akim Demaille <akim@epita.fr>
20695
20696 * src/output.c (prepare): Drop the muscle `ntbase' which
20697 duplicates ntokens.
20698 * src/bison.simple: Formatting/comment changes.
20699 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
20700 is an undocumented synonym.
20701
207022001-12-22 Akim Demaille <akim@epita.fr>
20703
20704 * src/output.c (output_table_data): Change the prototype to use
20705 `int' for array ranges: some invocations do pass an int, not a
20706 short.
20707 Reported by Wayne Green.
20708
207092001-12-22 Akim Demaille <akim@epita.fr>
20710
20711 Some actions of web2c.y are improperly triggered.
20712 Reported by Mike Castle.
20713
20714 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
20715 * tests/regression.at (Web2c): Rename as...
20716 (Web2c Report): this.
20717 (Web2c Actions): New.
20718
207192001-12-22 Akim Demaille <akim@epita.fr>
20720
20721 Reductions in web2c.y are improperly reported.
20722 Reported by Mike Castle.
20723
20724 * src/conflicts.c (print_reductions): Fix.
20725 * tests/regression.at (Web2c): New.
20726
207272001-12-18 Akim Demaille <akim@epita.fr>
20728
20729 Some host fail on `assert (!"foo")', which expands to
20730 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
20731 Reported by Nelson Beebee.
20732
20733 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
20734 `#define it_succeeded 0' and `assert (it_succeeded)'.
20735
207362001-12-17 Marc Autret <autret_m@epita.fr>
20737
20738 * src/bison.simple: Don't hard code the skeleton line and filename.
20739 * src/output.c (output_parser): Rename 'line' as 'output_line'.
20740 New line counter 'skeleton_line' (skeleton-line muscle).
20741
207422001-12-17 Paul Eggert <eggert@twinsun.com>
20743
20744 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
20745 YYDEBUG must be defined to a nonzero value.
20746
20747 * src/bison.simple (yytname): Do not assume that the user defines
20748 YYDEBUG to a properly parenthesized expression.
20749
207502001-12-17 Akim Demaille <akim@epita.fr>
20751
20752 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
20753 nlookaheads is a new member.
20754 Adjust all users.
20755 * src/lalr.h (nlookaheads): Remove this orphan declaration.
20756 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
20757 state.
20758
207592001-12-17 Akim Demaille <akim@epita.fr>
20760
20761 * src/files.h, src/files.c (open_files, close_files): Remove.
20762 * src/main.c (main): Don't open/close files, nor invoke lex_free,
20763 let...
20764 * src/reader.c (reader): Do it.
20765
207662001-12-17 Akim Demaille <akim@epita.fr>
20767
20768 * src/conflicts.c (print_reductions): Formatting changes.
20769
207702001-12-17 Akim Demaille <akim@epita.fr>
20771
20772 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
20773 (flush_reduce): New.
20774 (resolve_sr_conflict): Adjust.
20775
207762001-12-17 Akim Demaille <akim@epita.fr>
20777
20778 * src/output.c (output_obstack): Be static and rename as...
20779 (format_obstack): this, to avoid any confusion with files.c's
20780 output_obstack.
20781 * src/reader.h (muscle_obstack): Move to...
20782 * src/output.h: here, since it's defined in output.c.
20783
207842001-12-17 Akim Demaille <akim@epita.fr>
20785
20786 * src/output.c (action_row, save_column, default_goto)
20787 (sort_actions, matching_state, pack_vector): Better variable
20788 locality.
20789
207902001-12-17 Akim Demaille <akim@epita.fr>
20791
20792 * src/output.c: Various formatting changes.
20793
207942001-12-17 Akim Demaille <akim@epita.fr>
20795
20796 * src/files.c (output_files): Free the output_obstack.
20797 * src/main.c (main): Call print and print_graph conditionally.
20798 * src/print.c (print): Work unconditionally.
20799 * src/print_graph.c (print_graph): Work unconditionally.
20800 * src/conflicts.c (log_resolution): Output only if verbose_flag.
20801
208022001-12-16 Marc Autret <autret_m@epita.fr>
20803
20804 * src/output.c (actions_output): Fix. When we use %no-lines,
20805 there is one less line per action.
20806
208072001-12-16 Marc Autret <autret_m@epita.fr>
20808
20809 * src/bison.simple: Remove a useless #line directive.
20810 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
20811 * src/output.c (get_lines_number): New.
20812 (output_parser): Adjust, now takes care about the lines of a
20813 output muscles.
20814 Fix line numbering.
20815 (actions_output): Computes the number of lines taken by actions.
20816 (output_master_parser): Insert new skeleton which is the name of
20817 the output parser file name.
20818
208192001-12-15 Marc Autret <autret_m@epita.fr>
20820
20821 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
20822
208232001-12-15 Marc Autret <autret_m@epita.fr>
20824
20825 * src/output.c (output_gram): Keep track of the hairy one.
20826
208272001-12-15 Akim Demaille <akim@epita.fr>
20828
20829 Make `make distcheck' work.
20830
20831 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
20832 system.h which uses libgettext.h.
20833
208342001-12-15 Akim Demaille <akim@epita.fr>
20835
20836 * src/nullable.c (set_nullable): Useless rules must be skipped,
20837 otherwise, since we range over their symbols, we might look at a
20838 nonterminal which no longer ``exists'', i.e., it is not counted in
20839 `nvars', hence we overflow our arrays.
20840
208412001-12-15 Akim Demaille <akim@epita.fr>
20842
20843 The header can also be produced directly, without any obstack!
20844 Yahoo!
20845
20846 * src/files.c, src/files.h (defines_obstack): Remove.
20847 (compute_header_macro): Global.
20848 (defines_obstack_save): Remove.
20849 * src/reader.c (parse_union_decl): No longer output to
20850 defines_obstack: its content can be found in the `stype' muscle
20851 anyway.
20852 (output_token_translations): Merge into...
20853 (symbols_output): this.
20854 Rename as...
20855 (symbols_save): this.
20856 (reader): Adjust.
20857 * src/output.c (header_output): New.
20858 (output): Call it.
20859
208602001-12-15 Akim Demaille <akim@epita.fr>
20861
20862 * src/reader.c (parse_union_decl): Instead of handling two obstack
20863 simultaneously, use one to define the `stype' muscle, and use the
20864 value of the latter to fill defines_obstack.
20865 (copy_comment): Remove.
20866 (copy_comment2): Work for a single obstack.
20867 Rename as...
20868 (copy_comment): this.
20869
208702001-12-15 Akim Demaille <akim@epita.fr>
20871
20872 * src/lex.c, src/lex.h (xgetc): No longer static.
20873 * src/reader.c (parse_union_decl): Revamp.
20874
208752001-12-15 Akim Demaille <akim@epita.fr>
20876
20877 Still making progress in separating Bison into (i) input, (ii)
20878 process, (iii) output: now we can directly output the parser file
20879 without using table_obstack at all.
20880
20881 * src/files.c, src/files.h (table_obstack): Bye bye.
20882 (parser_file_name): New.
20883 * src/files.c (compute_output_file_names): Compute it.
20884 * src/output.c (actions_output, output_parser)
20885 (output_master_parser): To a file instead of an obstack.
20886
208872001-12-15 Akim Demaille <akim@epita.fr>
20888
20889 Attach actions to rules, instead of pre-outputting them to
20890 actions_obstack.
20891
20892 * src/gram.h (rule_t): action and action_line are new members.
20893 * src/reader.c (symbol_list): Likewise.
20894 (copy_action): Save the actions within the rule.
20895 (packgram): Save them in rule_table.
20896 * src/output.c (actions_output): New.
20897 (output_parser): Use it on `%%actions'.
20898 (output_rule_data): Don't free rule_table.
20899 (output): Do it.
20900 (prepare): Don't save the `action' muscle.
20901 * src/bison.simple: s/%%action/%%actions/.
20902
209032001-12-15 Akim Demaille <akim@epita.fr>
20904
20905 * src/reader.c (copy_action): When --yacc, don't append a `;'
20906 to the user action: let it fail if lacking.
20907 Suggested by Arnold Robbins and Tom Tromey.
20908
209092001-12-14 Akim Demaille <akim@epita.fr>
20910
20911 * src/lex.c (literalchar): Simply return the char you decoded, non
20912 longer mess around with obstacks and int pointers.
20913 Adjust all callers.
20914
209152001-12-14 Akim Demaille <akim@epita.fr>
20916
20917 * src/lex.c (literalchar): Don't escape the special characters,
20918 just decode them, and keep them as char (before, eol was output as
20919 the 2 char string `\n' etc.).
20920 * src/output.c (output_rule_data): Use quotearg to output the
20921 token strings.
20922
209232001-12-13 Paul Eggert <eggert@twinsun.com>
20924
20925 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
20926 Do not infringe on the global user namespace when using C++.
20927 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
20928 All uses of `fprintf' and `stderr' changed.
20929
20930 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
20931
209322001-12-13 Akim Demaille <akim@epita.fr>
20933
20934 The computation of nullable is broken: it doesn't handle empty
20935 RHS's properly.
20936
20937 * tests/torture.at (GNU AWK Grammar): New.
20938 * tests/sets.at (Nullable): New.
20939 * src/nullable.c (set_nullable): Instead of blindly looping over
20940 `ritems', loop over the rules, and then over their rhs's.
20941
20942 Work around Autotest bugs.
20943
20944 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
20945 frame, because Autotest understand lines starting with a `+' as
20946 traces from the shell. Then, they are not processed properly.
20947 Admittedly an Autotest bug, but we don't have time to wait for
20948 Autotest to catch up.
20949 * tests/regression.at (Broken Closure): Adjust to the new table
20950 frames.
20951 Move to...
20952 * tests/sets.at: here.
20953
209542001-12-13 Akim Demaille <akim@epita.fr>
20955
20956 * src/closure.c (closure): Use nrules instead of playing tricks
20957 with BITS_PER_WORD.
20958
209592001-12-13 Akim Demaille <akim@epita.fr>
20960
20961 * src/print.c (print_actions): Output the handling of `$' as the
20962 traces do: shifting the token EOF. Before EOF was treated as a
20963 nonterminal.
20964 * tests/regression.at: Adjust some tests.
20965 * src/print_graph.c (print_core): Complete the set of items via
20966 closure. The next-to-final and final states are still unsatisfying,
20967 but that's to be addressed elsewhere.
20968 No longer output the rule numbers, but do output the state number.
20969 A single loop for the shifts + gotos is enough, but picked a
20970 distinct color for each.
20971 (print_graph): Initialize and finalize closure.
20972
209732001-12-13 Akim Demaille <akim@epita.fr>
20974
20975 * src/reader.c (readgram): Remove dead code, an strip useless
20976 braces.
20977 (get_type): Remove, unused.
20978
209792001-12-12 Akim Demaille <akim@epita.fr>
20980
20981 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
20982 on that of lib/error.c.
20983
209842001-12-12 Akim Demaille <akim@epita.fr>
20985
20986 Some hosts don't like `/' in includes.
20987
20988 * src/system.h: Include libgettext.h without qualifying the path.
20989 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
20990 $(top_srcdir).
20991
209922001-12-11 Marc Autret <autret_m@epita.fr>
20993
20994 * src/output.c (output_parser): Remove useless muscle.
20995
209962001-12-11 Marc Autret <autret_m@epita.fr>
20997
20998 * src/bison.simple: Remove #line just before %%epilogue. It
20999 is now handled in ...
21000 * src/reader.c (read_additionnal_code): Add the output of a
21001 #line for the epilogue.
21002
210032001-12-10 Marc Autret <autret_m@epita.fr>
21004
21005 * src/reader.c (copy_definition): Re-use CPP-outed code which
21006 replace precedent remove.
21007 * src/bison.simple: Remove #line before %%prologue because
21008 %%input-line is wrong at this time.
21009
210102001-12-10 Marc Autret <autret_m@epita.fr>
21011
21012 * src/reader.c (symbols_output): Clean up.
21013 * src/output.c (output_gram, output): Clean up.
21014
210152001-12-10 Akim Demaille <akim@epita.fr>
21016
21017 * src/lalr.c (initialize_lookaheads): New. Extracted from...
21018 * src/LR0.c (set_state_table): here.
21019 * src/lalr.c (lalr): Call it.
21020
210212001-12-10 Akim Demaille <akim@epita.fr>
21022
21023 * src/state.h (shifts): Remove the `number' member: shifts are
21024 attached to state, hence no longer need to be labelled with a
21025 state number.
21026
210272001-12-10 Akim Demaille <akim@epita.fr>
21028
21029 Now that states have a complete set of members, the linked list of
21030 shifts is useless: just fill directly the state's shifts member.
21031
21032 * src/state.h (shifts): Remove the `next' member.
21033 * src/LR0.c (first_state, last_state): Remove.
21034 Adjust the callers.
21035 (augment_automaton): Don't look for the shifts that must be added
21036 a shift on EOF: it is those of the state we looked for! But now,
21037 since shifts are attached, it is no longer needed to looking
21038 merely by its id: its number.
21039
210402001-12-10 Akim Demaille <akim@epita.fr>
21041
21042 * src/LR0.c (augment_automaton): Better variable locality.
21043 Remove an impossible branch: if there is a state corresponding to
21044 the start symbol being shifted, then there is shift for the start
21045 symbol from the initial state.
21046
210472001-12-10 Akim Demaille <akim@epita.fr>
21048
21049 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
21050 only when appropriate: when insert_start_shifting_state' is not
21051 invoked.
21052 * tests/regression.at (Rule Line Numbers): Adjust.
21053
210542001-12-10 Akim Demaille <akim@epita.fr>
21055
21056 * src/LR0.c (augment_automaton): Now that all states have shifts,
21057 merge the two cases addition shifts to the initial state.
21058
210592001-12-10 Akim Demaille <akim@epita.fr>
21060
21061 * src/lalr.c (set_state_table): Move to...
21062 * src/LR0.c: here.
21063 * src/lalr.c (lalr): Don't call it...
21064 * src/LR0.c (generate_states): do it.
21065 * src/LR0.h (first_state): Remove, only the table is used.
21066
210672001-12-10 Akim Demaille <akim@epita.fr>
21068
21069 * src/LR0.h (first_shift, first_reduction): Remove.
21070 * src/lalr.c: Don't use first_shift: find shifts through the
21071 states.
21072
210732001-12-10 Akim Demaille <akim@epita.fr>
21074
21075 * src/LR0.c: Attach shifts to states as soon as they are
21076 computed.
21077 * src/lalr.c (set_state_table): Instead of assigning shifts to
21078 state, just assert that the mapping was properly done.
21079
210802001-12-10 Akim Demaille <akim@epita.fr>
21081
21082 * src/LR0.c (insert_start_shift): Rename as...
21083 (insert_start_shifting_state): this.
21084 (insert_eof_shifting_state, insert_accepting_state): New.
21085 (augment_automaton): Adjust.
21086 Better locality of the variables.
21087 When looking if the start_symbol is shifted from the initial
21088 state, using `while (... symbol != start_symbol ...)' sounds
21089 better than `while (... symbol < start_symbol ...)': If fail
21090 to see how the order between symbols could be relevant!
21091
210922001-12-10 Akim Demaille <akim@epita.fr>
21093
21094 * src/getargs.h: Don't declare `spec_name_prefix' and
21095 `spec_file_prefix', declared by src/files.h.
21096 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
21097 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
21098 * src/output.c (prepare): Adjust.
21099 * src/reader.c (symbols_output): Likewise.
21100 * src/vmsgetargs.c: Vaguely adjust, but who cares?
21101
211022001-12-10 Akim Demaille <akim@epita.fr>
21103
21104 * src/muscle_tab.c (muscle_init): NULL is a better default than
21105 `"0"'.
21106
211072001-12-10 Akim Demaille <akim@epita.fr>
21108
21109 * src/reader.c (reader): Calling symbols_output once is enough.
21110
211112001-12-10 Akim Demaille <akim@epita.fr>
21112
21113 Now that states have a complete set of members, the linked list of
21114 reductions is useless: just fill directly the state's reductions
21115 member.
21116
21117 * src/state.h (struct reductions): Remove member `number' and
21118 `next'.
21119 * src/LR0.c (first_reduction, last_reduction): Remove.
21120 (save_reductions): Don't link the new reductions, store them in
21121 this_state.
21122 * src/lalr.c (set_state_table): No need to attach reductions to
21123 states, it's already done.
21124 * src/output.c (output_actions): No longer free the shifts, then
21125 the reductions, then the states: free all the states and their
21126 members.
21127
211282001-12-10 Akim Demaille <akim@epita.fr>
21129
21130 * src/options.c (OPTN, DRTV, BOTH): New.
21131 (option_table): Use them.
21132
21133 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
21134 the job of system.h.
21135 * src/options.c: Don't include stdio.h and xalloc.h for the same
21136 reasons.
21137
211382001-12-10 Akim Demaille <akim@epita.fr>
21139
21140 * src/output.c (output, prepare): Make sure the values of the
21141 muscles `action' and `prologue' are 0-terminated.
21142
211432001-12-10 Akim Demaille <akim@epita.fr>
21144
21145 Clean up GCC warnings.
21146
21147 * src/reader.c (copy_action): `buf' is not used.
21148 (parse_skel_decl): Be static.
21149 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
21150 * src/options.h (create_long_option_table): Have a real prototype.
21151 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
21152 (hash_delete_at): Return const void *.
21153 Adjust casts to preserve the const.
21154
211552001-12-10 Akim Demaille <akim@epita.fr>
21156
21157 * configure.in: Require 2.52g.
21158 M4 is not needed, but AUTOM4TE is.
21159 * m4/m4.m4: Remove.
21160 * tests/Makefile.am: Adjust.
21161
211622001-12-10 Akim Demaille <akim@epita.fr>
21163
21164 One structure for states is enough, even though theoretically
21165 there are LR(0) states and LALR(1) states.
21166
21167 * src/lalr.h (state_t): Remove.
21168 (state_table): Be state_t **, not state_t *.
21169 * src/state.h (core, CORE_ALLOC): Rename as...
21170 (state_t, STATE_ALLOC): this.
21171 Add the LALR(1) members: shifts, reductions, errs.
21172 * src/LR0.c (state_table): Rename as...
21173 (state_hash): this, to avoid name clashes with the global
21174 `state_table'.
21175 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
21176 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
21177
211782001-12-10 Akim Demaille <akim@epita.fr>
21179
21180 Bison dumps core on bash.y.
21181 Reported by Pascal Bart.
21182
21183 * src/warshall.c (bitmatrix_print): New.
21184 (TC): Use it.
21185 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
21186 j must be the outer loop.
21187 * tests/regression.at (Broken Closure): New.
21188
211892001-12-05 Akim Demaille <akim@epita.fr>
21190
21191 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
21192 its argument.
21193 Reported by Peter Hamorsky.
21194
211952001-12-05 Akim Demaille <akim@epita.fr>
21196
21197 * src/conflicts.c (err_table): Remove.
21198 (resolve_sr_conflict): Adjust.
21199 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
21200 Rename as...
21201 (state_t.reductions, state_t.shifts): this.
21202
212032001-12-05 Akim Demaille <akim@epita.fr>
21204
21205 * src/reduce.c (reduce_grammar_tables): No longer disable the
21206 removal of useless rules via CPP but via `if (0)', so that the
21207 compiler still check the code is valid.
21208 For instance, it should have noticed `rline' no longer exists: use
21209 the `line' member of rule_t.
21210 * src/gram.c (dummy, rline): Remove, unused.
21211
212122001-12-05 Akim Demaille <akim@epita.fr>
21213
21214 * src/output.c (pack_vector): Use assert, not berror.
21215 * src/main.c (berror): Remove, unused.
21216
212172001-12-05 Akim Demaille <akim@epita.fr>
21218
21219 New experimental feature: if --verbose --trace output all the
21220 items of a state, not only its kernel.
21221
21222 * src/print.c (print_core): If `trace_flag', then invoke closure
21223 before outputting the items of the state (print_core is no longer
21224 a correct name them).
21225 (print_results): Invoke new_closure/free_closure if needed.
21226
212272001-12-05 Akim Demaille <akim@epita.fr>
21228
21229 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
21230 * src/closure.c, src/closure.h (itemsetsize): Rename as...
21231 (nitemset): for consistency with the rest of the project.
21232
212332001-12-05 Akim Demaille <akim@epita.fr>
21234
21235 * src/closure.c (print_closure): Improve.
21236 (closure): Use it for printing input and output.
21237
212382001-12-05 Akim Demaille <akim@epita.fr>
21239
21240 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
21241 indexed by nonterminals.
21242
212432001-12-05 Akim Demaille <akim@epita.fr>
21244
21245 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
21246 what it was!).
21247 * src/warshall.h: Remove accidental duplication of the content.
21248
212492001-12-05 Akim Demaille <akim@epita.fr>
21250
21251 * src/closure.c (set_fderives): De-obfuscate.
21252
212532001-12-05 Akim Demaille <akim@epita.fr>
21254
21255 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
21256
212572001-12-05 Akim Demaille <akim@epita.fr>
21258
21259 * src/closure.c (set_firsts): De-obfuscate.
21260
212612001-12-05 Akim Demaille <akim@epita.fr>
21262
21263 * src/output.c (action_row): De-obfuscate
21264 using the good o' techniques: arrays not pointers, variable
21265 locality, BITISSET, RESETBIT etc.
21266
212672001-12-05 Akim Demaille <akim@epita.fr>
21268
21269 Pessimize the code to simplify it: from now on, all the states
21270 have a valid SHIFTS, which NSHIFTS is possibly 0.
21271
21272 * src/LR0.c (shifts_new): Be global and move to..
21273 * src/state.c, src/state.h: here.
21274 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
21275 * src/print_graph: Adjust.
21276
212772001-12-05 Akim Demaille <akim@epita.fr>
21278
21279 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
21280 * src/conflicts.c: Use it.
21281 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
21282 incorrectly ``simplified''.
21283
212842001-12-05 Akim Demaille <akim@epita.fr>
21285
21286 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
21287 using the good o' techniques: arrays not pointers, variable
21288 locality, BITISSET, RESETBIT etc.
21289
212902001-12-05 Akim Demaille <akim@epita.fr>
21291
21292 * src/state.h (SHIFT_SYMBOL): New.
21293 * src/conflicts.c: Use it to deobfuscate.
21294
212952001-12-05 Akim Demaille <akim@epita.fr>
21296
21297 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
21298 (print_reductions): De-obfuscate using the good o' techniques:
21299 arrays not pointers, variable locality, BITISSET.
21300
213012001-12-05 Akim Demaille <akim@epita.fr>
21302
21303 * src/conflicts.c (print_reductions): Arrays, not pointers.
21304 Use BITISSET.
21305
213062001-12-05 Akim Demaille <akim@epita.fr>
21307
21308 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21309
213102001-12-05 Akim Demaille <akim@epita.fr>
21311
21312 * src/conflicts.c (print_reductions): Improve variable locality.
21313
213142001-12-05 Akim Demaille <akim@epita.fr>
21315
21316 * src/conflicts.c (print_reductions): Pessimize, but clarify.
21317
213182001-12-05 Akim Demaille <akim@epita.fr>
21319
21320 * src/conflicts.c (print_reductions): Improve variable locality.
21321
213222001-12-05 Akim Demaille <akim@epita.fr>
21323
21324 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
21325 * src/lalr.c: Use them.
21326
213272001-12-05 Akim Demaille <akim@epita.fr>
21328
21329 * src/LR0.c (augment_automaton): Formatting changes.
21330 Better variable locality.
21331
213322001-12-05 Akim Demaille <akim@epita.fr>
21333
21334 * src/lalr.c (matrix_print): New.
21335 (transpose): Use it.
21336 Use arrays instead of pointers.
21337
213382001-12-05 Akim Demaille <akim@epita.fr>
21339
21340 * src/lalr.c (maxrhs): Move to...
21341 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
21342 * src/lalr.c (build_relations): Adjust.
21343
213442001-12-05 Akim Demaille <akim@epita.fr>
21345
21346 * src/lalr.c (transpose): Free the memory allocated to the
21347 argument, as it is replaced by the results by the unique caller.
21348 (build_relations): Merely invoke transpose: it handles the memory
21349 deallocation.
21350 Improve variable locality.
21351 Avoid variables used as mere abbreviations.
21352 (compute_lookaheads): Use arrays instead of pointers.
21353
213542001-12-05 Akim Demaille <akim@epita.fr>
21355
21356 * src/lalr.c (initialize_F): Improve variable locality.
21357 Avoid variables used as mere abbreviations.
21358
213592001-12-05 Akim Demaille <akim@epita.fr>
21360
21361 * src/derives.c (print_derives): Display the ruleno.
21362 * src/lalr.c (initialize_F, transpose): Better variable locality
21363 to improve readability.
21364 Avoid variables used as mere abbreviations.
21365
213662001-12-05 Akim Demaille <akim@epita.fr>
21367
21368 * src/lalr.c (traverse): Use arrays instead of pointers.
21369
213702001-12-05 Akim Demaille <akim@epita.fr>
21371
21372 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
21373 the handling of squeue.
21374 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21375
213762001-12-05 Akim Demaille <akim@epita.fr>
21377
21378 Because useless nonterminals are now kept alive (instead of being
21379 `destroyed'), we now sometimes examine them, and store information
21380 related to them. Hence we need to know their number, and adjust
21381 memory allocations.
21382
21383 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
21384 static.
21385 * src/LR0.c (allocate_itemsets): The memory allocated to
21386 `symbol_count' was used for two different purpose: once to count
21387 the number of occurrences of each symbol, and later reassigned to
21388 `shift_symbol', containing the symbol that can be shifted from a
21389 given state.
21390 Deobfuscate, i.e., allocate, use and free `symbol_count' here
21391 only, and...
21392 (new_itemsets): Allocate `shift_symbol' here.
21393 (allocate_itemsets): symbol_count includes useless nonterminals.
21394 Make room for them.
21395 (free_storage): Use `free', not `XFREE', for pointers that cannot
21396 be null.
21397
213982001-12-05 Akim Demaille <akim@epita.fr>
21399
21400 * src/nullable.c (set_nullable): Deobfuscate the handling of
21401 ritem.
21402 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
21403
214042001-12-05 Akim Demaille <akim@epita.fr>
21405
21406 * src/gram.c, src/gram.h (ritem_print): New.
21407 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
21408 (This useless function was defined only to work around VMS linkers
21409 that can't handle compilation units with variables only).
21410 * src/reduce.c (dump_grammar): Use it to trace the construction of
21411 ritem.
21412
214132001-12-04 Paul Eggert <eggert@twinsun.com>
21414
21415 * src/bison.simple (union yyalloc): Change member names
21416 to be the same as the stack names.
21417 (yyparse): yyptr is now union yyalloc *, not char *.
21418 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
21419 and may generate better code on some machines.
21420 (yystpcpy): Use prototype if __STDC__ is defined, not just
21421 if __cplusplus is defined.
21422
214232001-11-30 Akim Demaille <akim@epita.fr>
21424
21425 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
21426 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
21427 Gettext doesn't compile cleanly, and dies with -Werror.
21428 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
21429 Include WARNING_CFLAGS here.
21430 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
21431 before being defined.
21432
214332001-11-27 Paul Eggert <eggert@twinsun.com>
21434
21435 * lib/quotearg.h (quotearg_n, quotearg_n_style):
21436 First arg is int, not unsigned.
21437 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
21438 (SIZE_MAX, UINT_MAX): New macros.
21439 (quotearg_n_options): Abort if N is negative.
21440 Avoid overflow check on hosts where size_t is 64 bits and int
21441 is 32 bits, as overflow is impossible there.
21442 Fix off-by-one typo that caused unnecessary reallocation.
21443
214442001-11-29 Paul Eggert <eggert@twinsun.com>
21445
21446 Name space cleanup in generated parser.
21447
21448 * doc/bison.texinfo (Bison Parser): Discuss system headers
21449 and their effect on the user name space.
21450
21451 * src/bison.simple:
21452 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
21453 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
21454 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
21455
21456 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
21457 on user names when possible.
21458
21459 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
21460 Simplify test for whather <alloca.h> exists.
21461
21462 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
21463
21464 (<stdio.h>): Include if YYDEBUG.
21465
21466 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
21467 ! defined (yyoverflow) && ! defined (yymemcpy).
21468
21469 (yymemcpy, yyparse): Rename local variables as needed so that
21470 they all begin with 'yy'.
21471
21472 (yystrlen, yystpcpy): New functions.
21473
21474 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
21475 All uses changed.
21476
21477 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
21478 instead of relying on string.h functions. Use YYSTACK_ALLOC
21479 and YYSTACK_FREE instead of malloc and free.
21480
214812001-11-30 Akim Demaille <akim@epita.fr>
21482
21483 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
21484 before their first uses.
21485 (YYBISON, YYPURE): Move to the top of the output.
21486
214872001-11-30 Akim Demaille <akim@epita.fr>
21488
21489 * tests/reduce.at (Useless Nonterminals): Fix.
21490
214912001-11-30 Akim Demaille <akim@epita.fr>
21492
21493 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
21494 if body instead of `;' to pacify GCC's warnings.
21495
214962001-11-30 Akim Demaille <akim@epita.fr>
21497
21498 Instead of mapping the LHS of unused rules to -1, keep the LHS
21499 valid, but flag the rules as invalid.
21500
21501 * src/gram.h (rule_t): `useful' is a new member.
21502 * src/print.c (print_grammar): Adjust.
21503 * src/derives.c (set_derives): Likewise.
21504 * src/reader.c (packgram, reduce_output): Likewise.
21505 * src/reduce.c (reduce_grammar_tables): Likewise.
21506 * tests/reduce.at (Underivable Rules, Useless Rules): New.
21507
215082001-11-30 Akim Demaille <akim@epita.fr>
21509
21510 * src/reduce.c (reduce_output): Formatting changes.
21511 * src/print.c (print_results, print_grammar): Likewise.
21512 * tests/regression.at (Rule Line Numbers)
21513 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
21514
215152001-11-30 Akim Demaille <akim@epita.fr>
21516
21517 * src/reduce.c (nonterminals_reduce): Instead of throwing away
21518 useless nonterminals, move them at the end of the symbol arrays.
21519 (reduce_output): Adjust.
21520 * tests/reduce.at (Useless Nonterminals): Adjust.
21521
215222001-11-30 Akim Demaille <akim@epita.fr>
21523
21524 * src/reduce.c: Various comment/formatting changes.
21525 (nonterminals_reduce): New, extracted from...
21526 (reduce_grammar_tables): here.
21527 (reduce_grammar): Call nonterminals_reduce.
21528
215292001-11-29 Paul Eggert <eggert@twinsun.com>
21530
21531 * src/bison.simple (YYSTACK_REALLOC): Remove.
21532 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
21533 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
21534 New macros.
21535 (union yyalloc): New type.
21536 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
21537 an arbitrary restriction on hosts where size_t is wider than int.
21538
21539 (yyparse): Don't dump core if alloca or malloc fails; instead, report
21540 a parser stack overflow. Allocate just one block of memory for all
21541 three stacks, instead of allocating three blocks; this typically is
21542 faster and reduces fragmentation.
21543
21544 Do not limit the number of items in the stack to a value that fits
21545 in 'int', as this is an arbitrary limit on hosts with 64-bit
21546 size_t and 32-bit int.
21547
215482001-11-29 Marc Autret <autret_m@epita.fr>
21549
21550 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
21551 of defining YYERROR_VERBOSE.
21552 [AT_DATA]: $4 is now out of C declarations in the prologue.
21553
215542001-11-28 Marc Autret <autret_m@epita.fr>
21555
21556 * src/reader.c (parse_dquoted_param): New.
21557 (parse_skel_decl): Use it.
21558 * src/lex.h: Add its prototype.
21559 * src/lex.c (literalchar): Become not static.
21560
215612001-11-28 Marc Autret <autret_m@epita.fr>
21562
21563 * src/output.h: And put its extern declaration here.
21564 * src/output.c (error_verbose): Define here.
21565 (prepare): Echo name modification.
21566 * src/getargs.h: Clean its extern declaration.
21567 * src/getargs.c (error_verbose_flag): Remove.
21568 (getargs): Remove case 'e'.
21569 * src/options.c (option_table): 'error-verbose' is now seen as simple
21570 percent option.
21571 Include output.h.
21572
21573 * src/reader.c (read_declarations): Remove case tok_include.
21574 (parse_include_decl): Remove.
21575 * src/lex.h (token_t): Remove tok_include.
21576 * src/options.c (option_table): 'include' is now a simple command line
21577 option.
21578
215792001-11-28 Marc Autret <autret_m@epita.fr>
21580
21581 * src/bison.simple: Adjust muscle names.
21582 * src/muscle_tab.c (muscle_init): Also rename the muscles.
21583 * src/output.c (prepare): s/_/-/ for the muscles names.
21584 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
21585
215862001-11-28 Marc Autret <autret_m@epita.fr>
21587
21588 * src/bison.simple: Fix debug.
21589 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
21590
215912001-11-28 Akim Demaille <akim@epita.fr>
21592
21593 * src/LR0.c (shifts_new): New.
21594 (save_shifts, insert_start_shift, augment_automaton): Use it.
21595
215962001-11-28 Akim Demaille <akim@epita.fr>
21597
21598 * src/closure.c (closure): `b' and `ruleno' denote the same value:
21599 keep ruleno only.
21600
216012001-11-28 Akim Demaille <akim@epita.fr>
21602
21603 * src/closure.c (closure): Instead of looping over word in array
21604 then bits in words, loop over bits in array.
21605
216062001-11-28 Akim Demaille <akim@epita.fr>
21607
21608 * src/closure.c (closure): No longer optimize the special case
21609 where all the bits of `ruleset[r]' are set to 0, to make the code
21610 clearer.
21611
216122001-11-28 Akim Demaille <akim@epita.fr>
21613
21614 * src/closure.c (closure): `r' and `c' are new variables, used to
21615 de-obfuscate accesses to RULESET and CORE.
21616
216172001-11-28 Akim Demaille <akim@epita.fr>
21618
21619 * src/reduce.c (reduce_print): Use ngettext.
21620 (dump_grammar): Improve the trace accuracy.
21621
216222001-11-28 Akim Demaille <akim@epita.fr>
21623
21624 * src/reduce.c (dump_grammar): Don't translate trace messages.
21625
216262001-11-28 Akim Demaille <akim@epita.fr>
21627
21628 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
21629 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
21630 as all tags are free'ed afterwards.
21631 From Enrico Scholz.
21632
216332001-11-27 Paul Eggert <eggert@twinsun.com>
21634
21635 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
21636 use alloca when we didn't want to, and vice versa.
21637
216382001-11-27 Marc Autret <autret_m@epita.fr>
21639
21640 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
21641 initialization.
21642 * src/output.c (prepare): Remove its update.
21643
216442001-11-27 Marc Autret <autret_m@epita.fr>
21645
21646 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
21647 Use %error-verbose.
21648
216492001-11-27 Marc Autret <autret_m@epita.fr>
21650
21651 * src/bison.simple: Remove YYERROR_VERBOSE using.
21652 Use %%error_verbose.
21653 (yyparse): Likewise.
21654 * src/output.c (prepare): Give its final value.
21655 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
21656 * src/getargs.h: Add its extern declaration.
21657 * src/getargs.c (error_verbose_flag): New int.
21658 (getargs): Update to catch new case.
21659 * src/options.c (option_table): 'error-verbose' is a new option.
21660 (shortopts): Update.
21661
216622001-11-27 Akim Demaille <akim@epita.fr>
21663
21664 * src/system.h: Use intl/libgettext.h.
21665 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
21666
216672001-11-27 Akim Demaille <akim@epita.fr>
21668
21669 * tests/torture.at (Exploding the Stack Size with Malloc):
21670 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
21671
216722001-11-27 Akim Demaille <akim@epita.fr>
21673
21674 * src/files.c: Include error.h.
21675 Reported by Hans Aberg.
21676
216772001-11-26 Marc Autret <autret_m@epita.fr>
21678
21679 * src/reader.c (parse_include_decl): New, not yet implemented.
21680 (read_declarations): Add case tok_include.
21681 * src/getargs.h (include): Add its extern definition.
21682 * src/getargs.c (include): New const char *.
21683 (getargs): Add case '-I'.
21684 * src/options.c (option_table): Add include as command line and
21685 percent option.
21686 * src/lex.h (token_t): Add tok_include.
21687
216882001-11-26 Akim Demaille <akim@epita.fr>
21689
21690 * src/reader.c (readgram): Make sure rules for mid-rule actions
21691 have a lineno equal to that of their host rule.
21692 Reported by Hans Aberg.
21693 * tests/regression.at (Rule Line Numbers): New.
21694
216952001-11-26 Akim Demaille <akim@epita.fr>
21696
21697 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
21698 size_ts.
21699
217002001-11-26 Akim Demaille <akim@epita.fr>
21701
21702 * src/complain.c, src/complain.h (error): Remove, provided by
21703 lib/error.[ch].
21704
217052001-11-26 Akim Demaille <akim@epita.fr>
21706
21707 * src/reader.c (read_declarations): Don't abort on tok_illegal,
21708 issue an error message.
21709 * tests/regression.at (Invalid %directive): New.
21710 Reported by Hans Aberg.
21711
217122001-11-26 Akim Demaille <akim@epita.fr>
21713
21714 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
21715 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
21716
217172001-11-26 Akim Demaille <akim@epita.fr>
21718
21719 * src/conflicts.c (conflicts_print): Don't complain at all when
21720 there are no reduce/reduce conflicts, and as many shift/reduce
21721 conflicts as expected.
21722 * tests/regression.at (%expect right): Adjust.
21723
217242001-11-23 Akim Demaille <akim@epita.fr>
21725
21726 * lib/alloca.c: Update, from fileutils.
21727
217282001-11-23 Akim Demaille <akim@epita.fr>
21729
21730 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
21731
217322001-11-23 Akim Demaille <akim@epita.fr>
21733
21734 * src/system.h: Include alloca.h.
21735 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
21736
217372001-11-23 Akim Demaille <akim@epita.fr>
21738
21739 * src/print_graph.c (print_actions): Remove `rule', unused.
21740 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
21741 pacify GCC's signed < unsigned warnings.
21742 * src/closure.c (itemsetsize): Likewise.
21743 * src/reader.c (symbol_list_new): Static.
21744
217452001-11-23 Akim Demaille <akim@epita.fr>
21746
21747 Attaching lineno to buckets is stupid, since only one copy of each
21748 symbol is kept, only the line of the first occurrence is kept too.
21749
21750 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
21751 * src/reader.c (rline_allocated): Remove, unused.
21752 (symbol_list): Have a `line' member.
21753 (symbol_list_new): New.
21754 (readgram): Use it.
21755 * src/print.c (print_grammar): Output the rule line numbers.
21756 * tests/regression.at (Solved SR Conflicts)
21757 (Unresolved SR Conflicts): Adjust.
21758 Reported by Hans Aberg.
21759
217602001-11-22 Marc Autret <autret_m@epita.fr>
21761
21762 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
21763
217642001-11-22 Marc Autret <autret_m@epita.fr>
21765
21766 * src/muscle_tab.c (muscle_init): Remove initialization of
21767 skeleton muscle.
21768 * src/output.c (output_master_parser): Do it here.
21769
217702001-11-20 Akim Demaille <akim@epita.fr>
21771
21772 * po/sv.po: New.
21773 * configure.in (ALL_LINGUAS): Adjust.
21774 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
21775 longer contains strings to translate.
21776
217772001-11-19 Akim Demaille <akim@epita.fr>
21778
21779 * src/conflicts.c (conflicts_print): Add a missing \n.
21780
217812001-11-19 Akim Demaille <akim@epita.fr>
21782
21783 * src/nullable.c (nullable_print): New.
21784 (set_nullable): Call it when tracing.
21785 Better locality of variables.
21786
217872001-11-19 Akim Demaille <akim@epita.fr>
21788
21789 * src/print.c (print_actions): Better locality of variables.
21790
217912001-11-19 Akim Demaille <akim@epita.fr>
21792
21793 * src/derives.c (print_derives): Fix and enrich.
21794 * src/closure.c (print_fderives): Likewise.
21795
217962001-11-19 Akim Demaille <akim@epita.fr>
21797
21798 * src/closure.c (itemsetend): Remove, replaced with...
21799 (itemsetsize): new.
21800
218012001-11-19 Akim Demaille <akim@epita.fr>
21802
21803 * src/LR0.c (kernel_end): Remove, replaced with...
21804 (kernel_size): new.
21805
218062001-11-19 Akim Demaille <akim@epita.fr>
21807
21808 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
21809 to clarify.
21810
218112001-11-19 Akim Demaille <akim@epita.fr>
21812
21813 * src/closure.c (closure): Use arrays instead of pointers to clarify.
21814
218152001-11-19 Akim Demaille <akim@epita.fr>
21816
21817 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
21818 trace messages.
21819 * src/LR0.c: Likewise.
21820 (allocate_itemsets): Use arrays instead of pointers to clarify.
21821
218222001-11-19 Akim Demaille <akim@epita.fr>
21823
21824 * src/getargs.c (statistics_flag): Replace with...
21825 (trace_flag): New.
21826 (longopts): Accept --trace instead of --statistics.
21827 * src/getargs.h, src/options.c: Adjust.
21828 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
21829 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
21830
218312001-11-19 Akim Demaille <akim@epita.fr>
21832
21833 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
21834 pointers to clarify the code.
21835 (save_reductions, save_shifts): Factor common parts of alternatives.
21836
218372001-11-19 Akim Demaille <akim@epita.fr>
21838
21839 * src/LR0.c (new_state, get_state): Complete TRACE code.
21840 * src/closure.c: Include `reader.h' to get `tags', needed by the
21841 trace code.
21842 Rename the conditional DEBUG as TRACE.
21843 Output consistently TRACEs to stderr, not stdout.
21844 * src/derives.c: Likewise.
21845 * src/reduce.c: (inaccessable_symbols): Using if is better style
21846 than goto.
21847 Use `#if TRACE' instead of `#if 0' for tracing code.
21848
218492001-11-19 Akim Demaille <akim@epita.fr>
21850
21851 * src/system.h (LIST_FREE, shortcpy): New.
21852 * src/LR0.c: Use them.
21853 * src/output.c (free_itemsets, free_reductions, free_shifts):
21854 Remove, replaced by LIST_FREE.
21855
218562001-11-19 Akim Demaille <akim@epita.fr>
21857
21858 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
21859 (REDUCTIONS_ALLOC): New.
21860 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
21861 allocation.
21862
218632001-11-19 Akim Demaille <akim@epita.fr>
21864
21865 * src/LR0.c (new_state): Complete trace code.
21866 * src/nullable.c (set_nullable): Don't translate traces.
21867
218682001-11-19 Akim Demaille <akim@epita.fr>
21869
21870 * src/print_graph.c (print_core): Better locality of variables.
21871 * src/print.c (print_core): Likewise.
21872
218732001-11-19 Akim Demaille <akim@epita.fr>
21874
21875 * src/vcg.c: You do the output, so you are responsible of the
21876 handling of VCG syntax, in particular: use quotearg.
21877 * src/print_graph.c: Don't.
21878 (print_actions): Don't output the actions as part of the nodes,
21879 since that's the job of the edges.
21880 (print_state): Don't output by hand: fill the node description,
21881 and ask for its output.
21882
218832001-11-19 Akim Demaille <akim@epita.fr>
21884
21885 * src/bison.simple (yyparse): When verbosely reporting an error,
21886 no longer put additional quotes around token names.
21887 * tests/calc.at: Adjust.
21888
218892001-11-19 Akim Demaille <akim@epita.fr>
21890
21891 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
21892 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
21893 * src/output.c: Adjust.
21894
218952001-11-19 Akim Demaille <akim@epita.fr>
21896
21897 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
21898 (rule_t): this.
21899 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
21900
219012001-11-19 Akim Demaille <akim@epita.fr>
21902
21903 * src/gram.h (rule_t): New.
21904 (rule_table): New.
21905 (rrhs, rlhs): Remove, part of state_t.
21906 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
21907 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
21908 * src/reader.c, src/reduce.c: Adjust.
21909
219102001-11-19 Akim Demaille <akim@epita.fr>
21911
21912 * src/reader.c (symbols_output): New, extracted from...
21913 (packsymbols): Here.
21914 (reader): Call it.
21915
219162001-11-19 Akim Demaille <akim@epita.fr>
21917
21918 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
21919 (maxrhs): this new function.
21920
219212001-11-19 Akim Demaille <akim@epita.fr>
21922
21923 * src/lalr.c (F): New macro to access the variable F.
21924 Adjust.
21925
219262001-11-19 Akim Demaille <akim@epita.fr>
21927
21928 * src/lalr.h (LA): New macro to access the variable LA.
21929 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21930 * src/lalr.c: Adjust.
21931
219322001-11-19 Akim Demaille <akim@epita.fr>
21933
21934 * src/lalr.c (initialize_LA): Only initialize LA. Let...
21935 (set_state_table): handle the `lookaheads' members.
21936
219372001-11-19 Akim Demaille <akim@epita.fr>
21938
21939 * src/lalr.h (lookaheads): Removed array, whose contents is now
21940 a member of...
21941 (state_t): this structure.
21942 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21943 Adjust.
21944
219452001-11-19 Akim Demaille <akim@epita.fr>
21946
21947 * src/lalr.h (consistent): Removed array, whose contents is now
21948 a member of...
21949 (state_t): this structure.
21950 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21951 Adjust.
21952
219532001-11-19 Akim Demaille <akim@epita.fr>
21954
21955 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
21956 contents are now members of...
21957 (state_t): this structure.
21958 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21959 Adjust.
21960
219612001-11-19 Akim Demaille <akim@epita.fr>
21962
21963 * src/lalr.h (state_t): New.
21964 (state_table): Be a state_t * instead of a core **.
21965 (accessing_symbol): Remove, part of state_t.
21966 * src/lalr.c: Adjust.
21967 (set_accessing_symbol): Merge into...
21968 (set_state_table): this.
21969 * src/print_graph.c, src/conflicts.c: Adjust.
21970
219712001-11-14 Akim Demaille <akim@epita.fr>
21972
21973 * tests/calc.at, tests/output.at, tests/regression.at,
21974 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
21975 now the tests are run in private dirs, therefore AC_CLEANUP and
21976 family can be simplified to 0-ary.
21977 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
21978 use abs. path to find config.h.
21979 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
21980 stderr, there can be way too much random noise.
21981 Instead pass -Werror to GCC and rely on the exit status.
21982 Reported by Wolfram Wagner.
21983
219842001-11-14 Akim Demaille <akim@epita.fr>
21985
21986 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
21987 defined only if yyoverflow is defined, to avoid `warning: unused
21988 variable `yyvs1''.
21989 Reported by The Test Suite.
21990
219912001-11-14 Akim Demaille <akim@epita.fr>
21992
21993 * src/print.c: Include reduce.h.
21994 Reported by Hans Aberg.
21995
219962001-11-14 Akim Demaille <akim@epita.fr>
21997
21998 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
21999 Revert a previous patch: these are really const.
22000 * src/conflicts.c (conflict_report): Additional useless pair of
22001 braces to pacify GCC's warnings for `if () if () {} else {}'.
22002 * src/lex.c (parse_percent_token): Replace equal_offset with
22003 arg_offset.
22004 arg is const.
22005 Be sure to strdup `arg' when used, since there is no reason for
22006 token_buffer not to change.
22007
220082001-11-14 Akim Demaille <akim@epita.fr>
22009
22010 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
22011 definition.
22012 * src/main.c (main): Use them.
22013 Suggested by Hans Aberg.
22014
220152001-11-12 Akim Demaille <akim@epita.fr>
22016
22017 * src/system.h (ngettext): Now that we use ngettext, be sure to
22018 provide a default definition when NLS are not used.
22019
220202001-11-12 Akim Demaille <akim@epita.fr>
22021
22022 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
22023 Use @kbd to denote user input.
22024 (Language and Grammar): ANSIfy the example.
22025 Adjust its layout for info/notinfo.
22026 (Location Tracking Calc): Output error messages to stderr.
22027 Output locations in a more GNUtically correct way.
22028 Fix a couple of Englishos.
22029 Adjust @group/@end group pairs.
22030
220312001-11-12 Akim Demaille <akim@epita.fr>
22032
22033 %expect was not functioning at all.
22034
22035 * src/conflicts.c (expected_conflicts): Set to -1.
22036 (conflict_report): Use ngettext.
22037 (conflicts_print): Check %expect and make its violation an error.
22038 * doc/bison.texinfo (Expect Decl): Adjust.
22039 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
22040 * tests/regression.at (%expect not enough, %expect right)
22041 (%expect too much): New.
22042
220432001-11-12 Akim Demaille <akim@epita.fr>
22044
22045 * tests/regression.at (Conflicts): Rename as...
22046 (Unresolved SR Conflicts): this.
22047 (Solved SR Conflicts): New.
22048
220492001-11-12 Akim Demaille <akim@epita.fr>
22050
22051 * src/reduce.c (print_results): Rename as...
22052 (reduce_output): This.
22053 Output to OUT, passed as argument, instead of output_obstack.
22054 (dump_grammar): Likewise.
22055 (reduce_free): New.
22056 Also free V1.
22057 (reduce_grammar): No longer call reduce_output, since...
22058 * src/print.c (print_results): do it.
22059 * src/main.c (main): Call reduce_free;
22060
220612001-11-12 Akim Demaille <akim@epita.fr>
22062
22063 * src/conflicts.c (print_reductions): Accept OUT as argument.
22064 Output to it, not to output_obstack.
22065 * src/print.c (print_actions): Adjust.
22066
220672001-11-12 Akim Demaille <akim@epita.fr>
22068
22069 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
22070 the result instead of using...
22071 (src_total, rrc_total, src_count, rrc_count): Remove.
22072 (any_conflicts): Remove.
22073 (print_conflicts): Split into...
22074 (conflicts_print, conflicts_output): New.
22075 * src/conflicts.h: Adjust.
22076 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
22077 * src/print.c (print_grammar): Issue `\n' between two rules.
22078 * tests/regression.at (Conflicts): New.
22079 Reported by Tom Lane.
22080
220812001-11-12 Akim Demaille <akim@epita.fr>
22082
22083 * tests/regression.at (Invalid input): Remove, duplicate with
22084 ``Invalid input: 1''.
22085
220862001-11-12 Akim Demaille <akim@epita.fr>
22087
22088 * tests/torture.at (AT_DATA_STACK_TORTURE)
22089 (Exploding the Stack Size with Alloca)
22090 (Exploding the Stack Size with Malloc): New.
22091
220922001-11-12 Akim Demaille <akim@epita.fr>
22093
22094 * src/bison.simple (YYSTACK_REALLOC): New.
22095 (yyparse) [!yyoverflow]: Use it and free the old stack.
22096 Reported by Per Allansson.
22097
220982001-11-12 Pascal Bart <pascal.bart@epita.fr>
22099
22100 * src/bison.simple: Define type yystype instead of YYSTYPE, and
22101 define CPP macro, which substitute YYSTYPE by yystype.
22102 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
22103 with yyltype/YYLTYPE. This allows inclusion of the generated
22104 header within the parser if the compiler, such as GGC, accepts
22105 multiple equivalent #defines.
22106 From Akim.
22107
221082001-11-05 Akim Demaille <akim@epita.fr>
22109
22110 * src/reader.c (symbols_output): New, extracted from...
22111 (packsymbols): here.
22112 (reader): Adjust.
22113
221142001-11-05 Akim Demaille <akim@epita.fr>
22115
22116 * src/lex.c (parse_percent_token): s/quotearg/quote/.
22117
221182001-11-05 Akim Demaille <akim@epita.fr>
22119
22120 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
22121 pattern.
22122
221232001-11-05 Akim Demaille <akim@epita.fr>
22124
22125 * src/options.h (struct option_table_struct): set_flags is void*.
22126 * src/options.c (longopts): Support `--output' and `%output'.
22127 (usage): Adjust.
22128 * src/lex.h (tok_setopt): Remove, replaced with...
22129 (tok_intopt, tok_stropt): these new guys.
22130 * src/lex.c (getopt.h): Not needed.
22131 (token_buffer, unlexed_token_buffer): Not const.
22132 (percent_table): Promote `-' over `_' in directive names.
22133 Active `%name-prefix', `file-prefix', and `output'.
22134 (parse_percent_token): Accept possible arguments to directives.
22135 Promote `-' over `_' in directive names.
22136
221372001-11-04 Akim Demaille <akim@epita.fr>
22138
22139 * doc/bison.texinfo (Decl Summary): Split the list into
22140 `directives for grammars' and `directives for bison'.
22141 Sort'em.
22142 Add description of `%name-prefix', `file-prefix', and `output'.
22143 Promote `-' over `_' in directive names.
22144 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
22145 Simplify the description of `--name-prefix'.
22146 Promote `-' over `_' in directive names.
22147 Promote `--output' over `--output-file'.
22148 Fix the description of `--defines'.
22149 * tests/output.at: Exercise %file-prefix and %output.
22150
221512001-11-02 Akim Demaille <akim@epita.fr>
22152
22153 * doc/refcard.tex: Update.
22154
221552001-11-02 Akim Demaille <akim@epita.fr>
22156
22157 * src/symtab.h (SUNDEF): New.
22158 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
22159 stand for `uninitialized', instead of 0.
22160 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
22161 * src/lex.c (lex): Adjust.
22162
22163 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
22164 Number it 0.
22165 Let yylex return it instead of a plain 0.
22166 Reported by Dick Streefland.
22167
221682001-11-02 Akim Demaille <akim@epita.fr>
22169
22170 * tests/regression.at (Mixing %token styles): New test.
22171
221722001-11-02 Akim Demaille <akim@epita.fr>
22173
22174 * src/reader.c (parse_thong_decl): Formatting changes.
22175 (token_translations_init): New, extracted from...
22176 (packsymbols): Here.
22177 Adjust.
22178
221792001-11-01 Akim Demaille <akim@epita.fr>
22180
22181 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
22182 Check that `9foo.y' produces correct cpp guards.
22183 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
22184 guards.
22185 Reported by Wwp.
22186
221872001-11-01 Akim Demaille <akim@epita.fr>
22188
22189 * tests/regression.at (Invalid input: 2): New.
22190 * src/lex.c (unlexed_token_buffer): New.
22191 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
22192 too.
22193 Reported by Wwp.
22194
221952001-11-01 Akim Demaille <akim@epita.fr>
22196
22197 * tests/calc.at: Catch up with 1.30.
22198 * configure.in: Bump to 1.49a.
22199 Adjust to newer Autotest.
22200
222012001-10-19 Pascal Bart <pascal.bart@epita.fr>
22202
22203 * src/conflicts.c: Move global variables rrc_total and src_total ...
22204 (print_conflicts): here.
22205 * src/output.c (output): Free global variable user_toknums.
22206 * src/lex.c (token_obstack): Become static.
22207
222082001-10-18 Akim Demaille <akim@epita.fr>
22209
22210 * tests/atlocal.in (GCC): Add.
22211 * tests/calc.at: s/m4_match/m4_bmatch/.
22212 s/m4_patsubst/m4_bpatsubst/.
22213 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
22214 * configure.in: AC_SUBST(GCC).
22215
222162001-10-14 Marc Autret <autret_m@epita.fr>
22217
22218 * src/options.c (create_long_option_table): Fix.
22219
222202001-10-10 Akim Demaille <akim@epita.fr>
22221
22222 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
22223
222242001-10-04 Akim Demaille <akim@epita.fr>
22225
22226 * src/reader.c (parse_union_decl): Push the caracters in
22227 union_obstack, not attrs_obstack.
22228
222292001-10-04 Akim Demaille <akim@epita.fr>
22230
22231 Merge in the branch 1.29.
22232
22233 * src/reader.c (packsymbols): Use a temporary obstack for
22234 `%%tokendef', since output_stack is already used elsewhere.
22235
22236 2001-10-02 Akim Demaille <akim@epita.fr>
22237
22238 Bump 1.29d.
22239
22240 2001-10-02 Akim Demaille <akim@epita.fr>
22241
22242 Version 1.29c.
22243
22244 2001-10-02 Akim Demaille <akim@epita.fr>
22245
22246 * tests/regression.at (Invalid CPP headers): New.
22247 From Alexander Belopolsky.
22248 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
22249
22250 2001-10-02 Akim Demaille <akim@epita.fr>
22251
22252 * tests/regression.at (Invalid input): New.
22253 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
22254 Reported by Shura.
22255
22256 2001-10-02 Akim Demaille <akim@epita.fr>
22257
22258 * tests/calc.at: Now that --debug works, the tests must be adjusted.
22259
22260 2001-10-02 Akim Demaille <akim@epita.fr>
22261
22262 * src/output.c (output_parser): Assert `skeleton'.
22263 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
22264 systems.
22265 From Shura.
22266
22267 2001-10-01 Marc Autret <autret_m@epita.fr>
22268
22269 * src/lex.h: Echo modifications.
22270 * src/lex.c (unlex): Parameter is now token_t.
22271 From Hans Aberg.
22272
22273 2001-10-01 Marc Autret <autret_m@epita.fr>
22274
22275 * src/main.c: Include lex.h.
22276 From Hans Aberg.
22277
22278 2001-09-29 Akim Demaille <akim@epita.fr>
22279
22280 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
22281
22282 2001-09-28 Akim Demaille <akim@epita.fr>
22283
22284 * tests/testsuite.at: Update to newer Autotest.
22285 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
22286
22287 2001-09-27 Akim Demaille <akim@epita.fr>
22288
22289 Position independent wrapper.
22290
22291 * tests/bison: Remove.
22292 * tests/bison.in: New.
22293 * configure.in: Adjust.
22294
22295 2001-09-27 Paul Eggert <eggert@twinsun.com>
22296
22297 Port quotearg fixes from tar 1.13.24.
22298
22299 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
22300 tm to be declared.
22301 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
22302 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
22303
22304 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
22305 * m4/mbrtowc.m4: New file.
22306 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
22307 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
22308
22309 2001-09-27 Akim Demaille <akim@epita.fr>
22310
22311 Bump to 1.29c.
22312
22313 2001-09-27 Akim Demaille <akim@epita.fr>
22314
22315 Version 1.29b.
22316
22317 2001-09-25 Akim Demaille <akim@epita.fr>
22318
22319 * src/system.h: Include `xalloc.h'.
22320 Remove it from the C files.
22321 * src/files.c (output_files): Free the obstacks.
22322 * src/lex.c (init_lex): Rename as...
22323 (lex_init): this.
22324 (lex_free): New.
22325 * src/main.c (main): Use it.
22326
22327 2001-09-24 Marc Autret <autret_m@epita.fr>
22328
22329 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
22330 to output informations in fout (FILE*).
22331 (open_graph, close_graph): Likewise.
22332 (output_graph, output_edge, output_node): Likewise.
22333 * src/vcg.h: Update function prototypes.
22334 * src/print_graph.c (print_graph): Open output graph file.
22335 (print_actions): Adjust.
22336 * src/files.h: Remove extern declaration.
22337 * src/files.c: Remove graph_obstack declaration.
22338 (open_files): Remove graph_obstack initialization.
22339 (output_files): Remove graph_obstack saving.
22340
22341 2001-09-24 Marc Autret <autret_m@epita.fr>
22342
22343 * src/files.c (compute_output_file_names): Fix.
22344
22345 2001-09-24 Marc Autret <autret_m@epita.fr>,
22346 Akim Demaille <akim@epita.fr>
22347
22348 * src/reader.c (reader): Remove call to free_symtab ().
22349 * src/main.c (main): Call it here.
22350 Include symtab.h.
22351 * src/conflicts.c (initialize_conflicts): Rename as...
22352 (solve_conflicts): this.
22353 * src/print.c (print_core, print_actions, print_state)
22354 (print_grammar): Dump to a file instead a `output_obstack'.
22355 (print_results): Dump `output_obstack', and then proceed with the
22356 FILE *.
22357 * src/files.c (compute_output_file_names, close_files): New.
22358 (output_files): Adjust.
22359 * src/main.c (main): Adjust.
22360
22361 2001-09-23 Marc Autret <autret_m@epita.fr>
22362
22363 * src/files.c (compute_header_macro): Computes header macro name
22364 from spec_defines_file when given.
22365
22366 2001-09-23 Marc Autret <autret_m@epita.fr>
22367
22368 * src/files.c (output_files): Add default extensions.
22369
22370 2001-09-22 Akim Demaille <akim@epita.fr>
22371
22372 * src/conflicts.c (finalize_conflicts): Rename as...
22373 (free_conflicts): this.
22374
22375 2001-09-22 Akim Demaille <akim@epita.fr>
22376
22377 * src/gram.c (gram_free): Rename back as...
22378 (dummy): this.
22379 (output_token_translations): Free `token_translations'.
22380 * src/symtab.c (free_symtab): Free the tag field.
22381
22382 2001-09-22 Akim Demaille <akim@epita.fr>
22383
22384 Remove `translations' as it is always set to true.
22385
22386 * src/gram.h: Adjust.
22387 * src/reader.c (packsymbols, parse_token_decl): Adjust
22388 * src/print.c (print_grammar): Adjust.
22389 * src/output.c (output_token_translations): Adjust.
22390 * src/lex.c (lex): Adjust.
22391 * src/gram.c: Be sure the set pointers to NULL.
22392 (dummy): Rename as...
22393 (gram_free): this.
22394
22395 2001-09-22 Akim Demaille <akim@epita.fr>
22396
22397 * configure.in: Invoke AM_LIB_DMALLOC.
22398 * src/system.h: Use dmalloc.
22399 * src/LR0.c: Be sure to have pointers initialized to NULL.
22400 (allocate_itemsets): Allocate kernel_items only if needed.
22401
22402 2001-09-22 Akim Demaille <akim@epita.fr>
22403
22404 * configure.in: Bump to 1.29b.
22405 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
22406 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
22407 need xmalloc.c in calc.y.
22408 From Pascal Bart.
22409
22410 2001-09-21 Akim Demaille <akim@epita.fr>
22411
22412 Version 1.29a.
22413 * Makefile.maint, config/config.guess, config/config.sub,
22414 * config/missing: Update from masters.
22415 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
22416 upon package.m4.
22417 * configure.in (ALL_LINGUAS): Add `tr'.
22418
22419 2001-09-21 Akim Demaille <akim@epita.fr>
22420
22421 * tests/Makefile.am (package.m4): Move to...
22422 ($(srcdir)/$(TESTSUITE)): here.
22423
22424 2001-09-20 Akim Demaille <akim@epita.fr>
22425
22426 * src/complain.c: No longer try to be standalone: use system.h.
22427 Don't assume __STDC__ is defined to 1. Just test if it is defined.
22428 * src/complain.h: Likewise.
22429 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
22430 Remove the unused variable `n'.
22431 From Albert Chin-A-Young.
22432
22433 2001-09-18 Marc Autret <autret_m@epita.fr>
22434
22435 * doc/bison.1: Update.
22436 * doc/bison.texinfo (Bison Options): Update --defines and --graph
22437 descriptions.
22438 (Option Cross Key): Update.
22439 Add --graph.
22440
22441 2001-09-18 Marc Autret <autret_m@epita.fr>
22442
22443 * tests/regression.at: New test (comment in %union).
22444
22445 2001-09-18 Marc Autret <autret_m@epita.fr>
22446
22447 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
22448 do that.
22449 Reported by Keith Browne.
22450
22451 2001-09-18 Marc Autret <autret_m@epita.fr>
22452
22453 * tests/output.at: Add tests for --defines and --graph.
22454
22455 2001-09-18 Marc Autret <autret_m@epita.fr>
22456
22457 * tests/output.at: Removes tests of %{header,src}_extension features.
22458
22459 2001-09-18 Akim Demaille <akim@epita.fr>
22460
22461 * tests/Makefile.am (package.m4): New.
22462 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
22463 (_AT_CHECK_CALC_ERROR): Likewise.
22464 Factor the `, ' part of verbose error messages.
22465
22466 2001-09-18 Marc Autret <autret_m@epita.fr>
22467
22468 * src/getargs.c (longopts): Declare --defines and --graph as options
22469 with optional arguments.
22470 * src/files.h: Add extern declarations.
22471 * src/files.c (spec_graph_file, spec_defines_file): New.
22472 (output_files): Update.
22473 Remove CPP-outed code.
22474
22475 2001-09-18 Marc Autret <autret_m@epita.fr>
22476
22477 Turn off %{source,header}_extension feature.
22478
22479 * src/files.c (compute_exts_from_gf): Update.
22480 (compute_exts_from_src): Update.
22481 (output_files): CPP-out useless code.
22482 * src/files.h: Remove {header,source}_extension extern declarations.
22483 * src/reader.c (parse_dquoted_param): CPP-out.
22484 (parse_header_extension_decl): Remove.
22485 (parse_source_extension_decl): Remove.
22486 (read_declarations): Remove cases tok_{hdrext,srcext}.
22487 * src/lex.c (percent_table): Remove {header,source}_extension entries.
22488 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
22489
22490 2001-09-10 Akim Demaille <akim@epita.fr>
22491
22492 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
22493 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
22494 (AT_CHECK_OUTPUT): this.
22495 Merely check ls' exit status, its output is useless.
22496
22497 2001-09-10 Akim Demaille <akim@epita.fr>
22498
22499 * tests/calc.at: Use m4_match.
22500 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
22501
22502 2001-09-10 Marc Autret <autret_m@epita.fr>,
22503 Akim Demaille <akim@epita.fr>
22504
22505 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
22506 enum color_e.
22507 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
22508 to `normal'.
22509 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
22510 * src/lex.h: Adjust prototype.
22511 (token_t): Add `tok_undef'.
22512 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
22513 (parse_percent_token): Now returns token_t.
22514 Add default statement in switch.
22515 (lex): Separate `c' as an input variable, from the token_t result
22516 part.
22517 (unlexed): Is a token_t.
22518
22519 2001-09-10 Akim Demaille <akim@epita.fr>
22520
22521 * configure.in: Bump to 1.29a.
22522
22523 2001-09-07 Akim Demaille <akim@epita.fr>
22524
22525 Version 1.29.
22526
22527 2001-08-30 Akim Demaille <akim@epita.fr>
22528
22529 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
22530 * m4/atconfig.m4: Remove.
22531 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
22532 * tests/bison: New.
22533 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
22534 m4_if, m4_patsubst, and m4_regexp.
22535 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
22536 `input' file instead of echo.
22537
22538 2001-08-29 Akim Demaille <akim@epita.fr>
22539
22540 Bump to 1.28e.
22541
22542 2001-08-29 Akim Demaille <akim@epita.fr>
22543
22544 Version 1.28d.
22545
22546 2001-08-29 Paul Eggert <eggert@twinsun.com>
22547
22548 * src/bison.simple (yyparse): Don't take the address of an
22549 item before the start of an array, as that doesn't conform to
22550 the C Standard.
22551
22552 2001-08-29 Robert Anisko <anisko_r@epita.fr>
22553
22554 * doc/bison.texinfo (Location Tracking Calc): New node.
22555
22556 2001-08-29 Paul Eggert <eggert@twinsun.com>
22557
22558 * src/output.c (output): Do not define const, as this now
22559 causes more problems than it cures.
22560
22561 2001-08-29 Akim Demaille <akim@epita.fr>
22562
22563 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
22564 the nodes.
22565 Be sure to tag the `detailmenu'.
22566
22567 2001-08-29 Akim Demaille <akim@epita.fr>
22568
22569 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
22570 download in a tmp dir.
22571
22572 2001-08-28 Marc Autret <autret_m@epita.fr>
22573
22574 * config/depcomp: New file.
22575
22576 2001-08-28 Marc Autret <autret_m@epita.fr>
22577
22578 * doc/bison.1 (mandoc): Adjust.
22579 From Juan Manuel Guerrero.
22580
22581 2001-08-28 Marc Autret <autret_m@epita.fr>
22582
22583 * src/print_graph.c (print_state): Fix.
22584
22585 2001-08-27 Marc Autret <autret_m@epita.fr>
22586
22587 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
22588 char * members.
22589 Echo modifications to the functions prototypes.
22590 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
22591
22592 2001-08-27 Marc Autret <autret_m@epita.fr>
22593
22594 * src/vcg.c: Include `xalloc.h'.
22595 (add_colorentry): New.
22596 (add_classname): New.
22597 (add_infoname): New.
22598 * src/vcg.h: Add new prototypes.
22599
22600 2001-08-27 Akim Demaille <akim@epita.fr>
22601
22602 * Makefile.maint: Sync. again with CVS Autoconf.
22603
22604 2001-08-27 Akim Demaille <akim@epita.fr>
22605
22606 * Makefile.maint: Formatting changes.
22607 (po-update, cvs-update, update): New targets.
22608 (AMTAR): Remove.
22609
22610 2001-08-27 Akim Demaille <akim@epita.fr>
22611
22612 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
22613 * Makefile.maint: Sync. with CVS Autoconf.
22614
22615 2001-08-27 Marc Autret <autret_m@epita.fr>
22616
22617 * src/vcg.h (struct infoname_s): New.
22618 (struct colorentry_s): New.
22619 (graph_s): New fields {vertical,horizontal}_order in structure.
22620 Add `infoname' field.
22621 Add `colorentry' field;
22622 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
22623 (G_HORIZONTAL_ORDER): New.
22624 (G_INFONAME): New.
22625 (G_COLORENTRY): New.
22626 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
22627 Add output of `infoname'.
22628 Add output of `colorentry'.
22629
22630 2001-08-27 Marc Autret <autret_m@epita.fr>
22631
22632 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
22633 This one shadowed a global parameter.
22634
22635 2001-08-24 Marc Autret <autret_m@epita.fr>
22636
22637 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
22638 instead of `unsigned'.
22639 (print_state): Do not call obstack_object_size () in obstack_grow ()
22640 to avoid macro variables shadowing.
22641
22642 2001-08-23 Marc Autret <autret_m@epita.fr>
22643
22644 * src/lex.c (percent_table): Typo: s/naem/name/.
22645 Add graph option.
22646 Normalize new options declarations.
22647
22648 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
22649
22650 * tests/suite.at: Exercise %header_extension and %source_extension.
22651
22652 2001-08-16 Marc Autret <autret_m@epita.fr>
22653
22654 * src/reader.c (parse_dquoted_param): New.
22655 (parse_header_extension_decl): Use it.
22656 (parse_source_extension_decl): Likewise.
22657
22658 2001-08-16 Marc Autret <autret_m@epita.fr>
22659
22660 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
22661 (get_xxxx_str): Use assert () instead of complain ().
22662 Remove return invokations in default cases.
22663 (get_decision_str): Modify default behaviour. Remove second argument.
22664 Echo modifications on calls.
22665 (output_graph): Fix.
22666
22667 2001-08-16 Marc Autret <autret_m@epita.fr>
22668
22669 * src/getargs.c (usage): Update with ``-g, --graph''.
22670
22671 2001-08-16 Marc Autret <autret_m@epita.fr>
22672
22673 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
22674 (Option Cross Key): Likewise.
22675 * doc/bison.1: Update.
22676
226772001-09-25 Pascal Bart <pascal.bart@epita.fr>
22678
22679 * src/output.c (output_master_parser): Don't finish action_obstack.
22680 (output_parser): Don't care about the muscle action, here.
22681 (prepare): Copy the action_obstack in the action muscle.
22682 (output): Free action_obstack.
22683
226842001-09-23 Pascal Bart <pascal.bart@epita.fr>
22685
22686 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
22687 will contain `%union' declaration.
22688 (parse_union_decl): Delete #line directive output.
22689 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
22690 informations about %union.
22691 (parse_union_decl): Copy the union_obstack in the muscle stype.
22692 * src/bison.simple: Add new #line directive.
22693 Add typdef %%stype YYSTYPE.
22694
226952001-09-23 Pascal Bart <pascal.bart@epita.fr>
22696
22697 * src/bison.simple: Add new `#line' directive.
22698
226992001-09-22 Pascal Bart <pascal.bart@epita.fr>
22700
22701 * src/bison.simple: New `#line' directive.
22702 * src/output.c (output_parser): Support new dynamic muscle input_line.
22703
227042001-09-22 Marc Autret <autret_m@epita.fr>
22705
22706 * src/output.c (output_master_parser): New.
22707 (output_parser): Be more re-entrant.
22708
227092001-09-21 Marc Autret <autret_m@epita.fr>
22710
22711 * src/reader.c (copy_definition, parse_union_decl): Update and use
22712 `linef' muscle.
22713 (copy_action): Likewise.
22714 Use obstack_1grow ().
22715 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
22716
227172001-09-21 Marc Autret <autret_m@epita.fr>
22718
22719 * src/options.c (option_table): Adjust.
22720 * src/lex.c (parse_percent_token): Fix.
22721
227222001-09-20 Pascal Bart <pascal.bart@epita.fr>
22723
22724 * src/options.c (symtab.h): Include it, need by lex.h.
22725
227262001-09-20 Pascal Bart <pascal.bart@epita.fr>
22727
22728 * src/lex.c (parse_percent_token): Change type of variable `tx', which
22729 is now an option_table_struct*.
22730 (option_strcmp): New function option_strcmp.
22731 (parse_percent_token): Call option_strcmp.
22732 * src/getargs.c (xalloc.h, options.h): Include it.
22733 (getargs): Call create_long_option_table.
22734 (getargs): Free longopts at the end of the function.
22735 (shortopts): Move in options.c.
22736 * src/options.c (create_long_option_table): New function. Convert
22737 information from option_table to option structure.
22738 * src/reader.c (options.h): Include it.
22739
22740 * src/Makefile.am: Adjust.
22741 * src/options.c (option_table): Create from longopts and percent_table.
22742 * src/getargs.c (longopts): Delete.
22743 * src/lex.c (struct percent_table_struct): Delete.
22744 (percent_table): Delete.
22745 (options.h): Include it.
22746 * src/options.c: Create.
22747 * src/options.h: Create.
22748 Declare enum opt_access_e.
22749 Define struct option_table_struct.
22750
227512001-09-20 Marc Autret <autret_m@epita.fr>
22752
22753 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
22754 sections of Bison.
22755
227562001-09-19 Pascal Bart <pascal.bart@epita.fr>
22757
22758 * src/bison.simple: s/%%filename/%%skeleton.
22759 * src/muscle_tab.c (getargs.h): Include it.
22760 (muscle_init): Insert new muscle skeleton.
22761
227622001-09-18 Pascal Bart <pascal.bart@epita.fr>
22763
22764 * src/output.c (output_parser): Delete unused variable actions_dumped.
22765
227662001-09-07 Pascal Bart <pascal.bart@epita.fr>
22767
22768 * src/output.c (output): Delete call to reader_output_yylsp.
22769 * src/reader.c (reader): Likewise.
22770 * src/reader.h: Delete declaration of reader_output_yylsp.
22771
227722001-09-02 Marc Autret <autret_m@epita.fr>
22773
22774 * src/reader.c: Include muscle_tab.h.
22775 (parse_union_decl): Update.
22776 (parse_macro_decl): Rename parse_muscle_decl.
22777 Update to use renamed functions and variable.
22778 (read_declarations, copy_action, read_additionnal_code, : Updated
22779 with correct variables and functions names.
22780 (packsymbols, reader): Likewise.
22781
22782 * src/reader.h (muscle_obstack): Extern declaration update.
22783
22784 * src/output.c: Include muscle_tab.h
22785 In all functions using macro_insert, change by using muscle_insert ().
22786 (macro_obstack): Rename muscle_obstack.
22787 Echo modifications in the whole file.
22788 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
22789 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
22790 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
22791
22792 * src/muscle_tab.h: Update double inclusion macros.
22793 (macro_entry_s): Rename muscle_entry_s.
22794 Update prototypes.
22795
22796 * src/muscle_tab.c: Include muscle_tab.h.
22797 Rename macro_tabble to muscle_table.
22798 (mhash1, mhash2, mcmp): Use muscle_entry.
22799 (macro_init): Rename muscle_init. Update.
22800 (macro_insert): Rename muscle_insert. Update.
22801 (macro_find): Rename muscle_find. Update.
22802
22803 * src/main.c: Include muscle_tab.h.
22804 (main): Call muscle_init ().
22805 * src/Makefile.am (bison_SOURCES): Echo modifications.
22806
228072001-09-02 Marc Autret <autret_m@epita.fr>
22808
22809 Now the files macro_tab.[ch] are named muscle_tab.[ch].
22810
22811 * src/muscle_tab.c, src/muscle_tab.h: Add files.
22812
228132001-09-02 Marc Autret <autret_m@epita.fr>
22814
22815 * src/macrotab.c, src/macrotab.h: Remove.
22816
228172001-09-01 Pascal Bart <pascal.bart@epita.fr>
22818
22819 * src/reader.c (copy_guard): Use muscle to specify the `#line'
22820 filename.
22821
228222001-09-01 Marc Autret <autret_m@epita.fr>
22823
22824 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
22825 to an explicit value to activate the feature. We do it here.
22826
228272001-08-31 Pascal Bart <pascal.bart@epita.fr>
22828
22829 * src/output.c (prepare): Delete the `filename' muscule insertion.
22830 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
22831 (parse_union_decl): Likewise.
22832 * src/macrotab.c (macro_init): Initialize filename by infile.
22833
228342001-08-31 Marc Autret <autret_m@epita.fr>
22835
22836 * src/bison.simple (YYLSP_NEEDED): New definition.
22837 * src/output.c (prepare): Add macro insertion of `locations_flag'
22838
228392001-08-31 Pascal Bart <pascal.bart@epita.fr>
22840
22841 * src/output.c (prepare): Delete insertion of previous muscles,
22842 and insert the `prefix' muscles.
22843 * src/macrotab.c (macro_init): Likewise.
22844 (macro_init): Initialization prefix directive by `yy'.
22845 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
22846 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
22847 yylval, yydebug, yyerror, yynerrs and yyparse.
22848 New directive `#define' to substitute yydebug, ... with option
22849 name_prefix.
22850
228512001-08-31 Pascal Bart <pascal.bart@epita.fr>
22852
22853 * src/main.c (main): Standardize.
22854 * src/output.c (output_table_data, output_parser): Likewise.
22855 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
22856
228572001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
22858
22859 * src/reader.c (read_additionnal_code): Rename %%user_code to
22860 %%epilogue.
22861 * src/output.c (output): Rename %%declarations to %%prologue.
22862 * src/bison.simple: Echo modifications.
22863
228642001-08-31 Marc Autret <autret_m@epita.fr>
22865
22866 * src/reader.c (readgram): CleanUp.
22867 (output_token_defines): Likewise.
22868 (packsymbols): Likewise.
22869 (reader): Likewise.
22870 * src/output.c (output): CPP-out useless code.
22871
228722001-08-31 Pascal Bart <pascal.bart@epita.fr>
22873
22874 * src/reader.c (reader): Delete obsolete call to function
22875 output_trailers and output_headers.
22876 * src/output.h: Remove obsolete functions prototypes of output_headers
22877 and output_trailers.
22878
228792001-08-30 Pascal Bart <pascal.bart@epita.fr>
22880
22881 * src/main.c: Include macrotab.h.
22882 * src/macrotab.h (macro_entry_s): Constify fields.
22883 Adjust functions prototypes.
22884 * src/macrotab.c (macro_insert): Constify key and value.
22885 (macro_find): Constify key.
22886 (macro_insert): Include 'xalloc.h'
22887 (macro_insert): Use XMALLOC.
22888 (macro_find): Constify return value.
22889 * src/output.c (output_table_data): Rename table to table_data.
22890 (output_parser): Constify macro_key, macro_value.
22891
228922001-08-30 Marc Autret <autret_m@epita.fr>
22893
22894 * src/reader.c (parse_skel_decl): New.
22895 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
22896 * src/lex.h (token_t): New token `tok_skel'.
22897 * src/lex.c (percent_table): Add skeleton option entry.
22898 Standardize.
22899
229002001-08-29 Marc Autret <autret_m@epita.fr>
22901
22902 * src/bison.simple: Add %%user_code directive at the end.
22903 * src/reader.c (read_additionnal_code): New.
22904 (reader): Use it.
22905 * src/output.c (output_program): Remove.
22906 (output): Update.
22907
229082001-08-28 Marc Autret <autret_m@epita.fr>
22909
22910 * src/output.c (output_actions): Clean up.
22911 (output_gram): CPP-out useless code.
22912 * src/reader.c (reader): Clean up, CPP-out useless code.
22913
229142001-08-28 Pascal Bart <pascal.bart@epita.fr>
22915
22916 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
22917 directive.
22918 * src/bison.simple: Add `%%definitions'.
22919
229202001-08-28 Marc Autret <autret_m@epita.fr>
22921
22922 * config/depcomp: New file.
22923
229242001-08-27 Paul Eggert <eggert@twinsun.com>
22925
22926 * src/bison.simple (yyparse): Don't take the address of an
22927 item before the start of an array, as that doesn't conform to
22928 the C Standard.
22929
229302001-08-27 Robert Anisko <robert.anisko@epita.fr>
22931
22932 * src/output.c (output): Remove the initialization of the macro
22933 obstack. It was done too late here.
22934
22935 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
22936 completely wrong.
22937 (reader): Initialize the macro obstack here, since we need it to grow
22938 '%define' directives.
22939
22940 * src/reader.h: Declare the macro obstack as extern.
22941
229422001-08-27 Robert Anisko <robert.anisko@epita.fr>
22943
22944 * src/output.c (output_parser): Fix. Store single '%' characters in
22945 the output obstack instead of throwing them away.
22946
229472001-08-27 Akim Demaille <akim@epita.fr>
22948
22949 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
22950
229512001-08-25 Robert Anisko <robert.anisko@epita.fr>
22952
22953 * lib/Makefile.am: Adjust.
22954
229552001-08-25 Robert Anisko <robert.anisko@epita.fr>
22956
22957 * src/bison.simple: Update and add '%%' directives.
22958
229592001-08-25 Robert Anisko <robert.anisko@epita.fr>
22960
22961 * src/reader.c (reader): Remove calls to 'output_headers' and
22962 'output_trailers'. Remove some C output.
22963 (readgram): Disable a piece of code that was writing a default
22964 definition for 'YYSTYPE'.
22965 (reader_output_yylsp): Remove.
22966 (packsymbols): Output token defintions to a macro.
22967 (copy_definition): Disable C output.
22968
22969 * src/reader.c (parse_macro_decl): New function used to parse macro
22970 declarations.
22971 (copy_string2): Put the body of copy_string into this new function.
22972 Add a parameter to let the caller choose whether he wants to copy the
22973 string delimiters or not.
22974 (copy_string): Be a simple call to copy_string2 with the last argument
22975 bound to true.
22976 (read_declarations): Add case for macro definition.
22977 (copy_identifier): New.
22978 (parse_macro_decl): Read macro identifiers using copy_identifier
22979 rather than lex.
22980
229812001-08-25 Robert Anisko <robert.anisko@epita.fr>
22982
22983 * src/output.c (prepare): Add prefixed names.
22984 (output_parser): Output semantic actions.
22985 (output_parser): Fix bug on '%%line' directives.
22986
22987 * src/output.c (output_headers): Remove. The C code printed by this
22988 function should now be in the skeletons.
22989 (output_trailers): Remove.
22990 (output): Disable call to 'reader_output_yylsp'.
22991 (output_rule_data): Do not output tables to the table obstack.
22992
22993 * src/output.c: Remove some C dedicated output.
22994 Improve the use of macro and output obstacks.
22995 (output_defines): Remove.
22996
22997 * src/output.c (output_token_translations): Associate 'translate'
22998 table with a macro. No output to the table obstack.
22999 (output_gram): Same for 'rhs' and 'prhs'.
23000 (output_stos): Same for 'stos'.
23001 (output_rule_data): Same for 'r1' and 'r2'.
23002 (token_actions): Same for 'defact'.
23003 (goto_actions): Same for 'defgoto'.
23004 (output_base): Same for 'pact' and 'pgoto'.
23005 (output_table): Same for 'table'.
23006 (output_check): Same for 'check'.
23007
23008 * src/output.c (output_table_data): New function.
23009 (output_short_table): Remove.
23010 (output_short_or_char_table): Remove.
23011
23012 * src/output.c (output_parser): Replace most of the skeleton copy code
23013 with something new. Skeletons are now processed character by character
23014 rather than line by line, and Bison looks for '%%' macros. This is the
23015 first step in making Bison's output process (a lot) more flexible.
23016 (output_parser): Use the macro table.
23017
230182001-08-25 Robert Anisko <robert.anisko@epita.fr>
23019
23020 * src/main.c (main): Initialize the macro table.
23021
230222001-08-25 Robert Anisko <robert.anisko@epita.fr>
23023
23024 * src/lex.c (percent_table): Add tok_define.
23025 * src/lex.h: Add tok_define.
23026
230272001-08-25 Robert Anisko <robert.anisko@epita.fr>
23028
23029 * src/macrotab.c: New file.
23030 * src/macrotab.h: New file.
23031 * src/Makefile.am: Update.
23032
230332001-08-25 Robert Anisko <robert.anisko@epita.fr>
23034
23035 * lib/hash.c: New file.
23036 * lib/hash.h: New file.
23037 * lib/Makefile.am: Update.
23038
230392001-08-15 Akim Demaille <akim@epita.fr>
23040
23041 Version 1.28c.
23042
230432001-08-15 Marc Autret <autret_m@epita.fr>
23044
23045 * src/reader.c (readgram): Indent output macro YYSTYPE.
23046 (packsymbols): Likewise.
23047 (output_token_defines): Likewise.
23048 * src/files.c: Standardize.
23049 (compute_header_macro): New.
23050 (defines_obstack_save): New. Use compute_header_macro.
23051 (output_files): Update. Use defines_obstack_save.
23052
230532001-08-15 Akim Demaille <akim@epita.fr>
23054
23055 * doc/bison.texinfo (Table of Symbols): Document
23056 YYSTACK_USE_ALLOCA.
23057
230582001-08-15 Akim Demaille <akim@epita.fr>
23059
23060 * missing: Update from CVS Automake.
23061 * config/config.guess, config/config.sub, config/texinfo.tex:
23062 Update from gnu.org.
23063
230642001-08-15 Akim Demaille <akim@epita.fr>
23065
23066 * Makefile.maint: Sync with CVS Autoconf.
23067
230682001-08-14 Pascal Bart <pascal.bart@epita.fr>
23069
23070 * doc/bison.texinfo: Include GNU Free Documentation License from
23071 `fdl.texi'.
23072 * doc/fdl.texi: Add to package.
23073
230742001-08-14 Marc Autret <autret_m@epita.fr>
23075
23076 Turn on %{source,header}_extension features.
23077
23078 * src/lex.c (percent_table): Un-CPP out header_extension and
23079 source_extension.
23080 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
23081 (compute_exts_from_src): Remove conditions. It restores priorities
23082 between options.
23083
230842001-08-14 Marc Autret <autret_m@epita.fr>
23085
23086 * src/files.c (compute_base_names): Add extensions computing when
23087 `--file-prefix' used.
23088 Standardize function calls.
23089
230902001-08-13 Marc Autret <autret_m@epita.fr>
23091
23092 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
23093 defining it (defined but null disables alloca).
23094
230952001-08-13 Marc Autret <autret_m@epita.fr>
23096
23097 * src/bison.simple (_yy_memcpy): CPP reformat.
23098
230992001-08-13 Pascal Bart <pascal.bart@epita.fr>
23100
23101 * tests/atconfig.in (CPPFLAGS): Fix.
23102
231032001-08-10 Pascal Bart <pascal.bart@epita.fr>
23104
23105 * doc/bison.texinfo: Include GNU General Public License from
23106 `gpl.texi'.
23107 * doc/gpl.texi: Add to package.
23108
231092001-08-10 Marc Autret <autret_m@epita.fr>
23110
23111 * src/print_graph.h: Fix.
23112 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
23113
231142001-08-10 Akim Demaille <akim@epita.fr>
23115
23116 * src/system.h: Provide default declarations for stpcpy, strndup,
23117 and strnlen.
23118
231192001-08-10 Robert Anisko <anisko_r@epita.fr>
23120
23121 * doc/bison.texinfo (Locations): Update @$ stuff.
23122
231232001-08-09 Robert Anisko <anisko_r@epita.fr>
23124
23125 * src/bison.simple (YYLLOC_DEFAULT): Update.
23126 (yyparse): Adjust.
23127
231282001-08-08 Marc Autret <autret_m@epita.fr>
23129
23130 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
23131 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
23132 Reported by Fabrice Bauzac.
23133
231342001-08-08 Marc Autret <autret_m@epita.fr>
23135
23136 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
23137 * src/vcg.c (output_node): Fix.
23138 * src/vcg.h: Cleanup.
23139 * src/print_graph.c: Add comments.
23140 (node_output_size): New global variable. Simplify the formatting of
23141 the VCG graph output.
23142 (print_actions): Unused code is now used. It notifies the final state
23143 and no action states in the VCG graph. It also give the reduce actions.
23144 The `shift and goto' edges are red and the `go to state' edges are
23145 blue.
23146 Get the current node name and node_obstack by argument.
23147 (node_obstack): New variable.
23148 (print_state): Manage node_obstack.
23149 (print_core): Use node_obstack given by argument.
23150 A node is not only computed here but in print_actions also.
23151 (print_graph): CPP out useless code instead of commenting it.
23152
231532001-08-07 Pascal Bart <pascal.bart@epita.fr>
23154
23155 * tests/atconfig.in (CPPFLAGS): Fix.
23156
231572001-08-07 Akim Demaille <akim@epita.fr>
23158
23159 * src/print_graph.c (quote): New.
23160 (print_core): Use it.
23161
231622001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
23163
23164 * src/vcg.c (complain.h): Include it.
23165 Unepitaize `return' invocations.
23166 [NDEBUG] (main): Remove.
23167 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
23168 * src/files.c (open_files): Initialize graph_obstack.
23169 * src/print_graph.c (print_actions): CPP out useless code.
23170 (print_core): Don't output the last `\n' in labels.
23171 Use `quote'.
23172 * src/files.c (output_files): Output the VCG file.
23173 * src/main.c (main): Invoke print_graph ();
23174
231752001-08-06 Marc Autret <autret_m@epita.fr>
23176
23177 Automaton VCG graph output.
23178 Using option ``-g'' or long option ``--graph'', you can generate
23179 a gram_filename.vcg file containing a VCG description of the LALR (1)
23180 automaton of your grammar.
23181
23182 * src/main.c: Call to print_graph() function.
23183 * src/getargs.h: Update.
23184 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
23185 (graph_flag): New flag.
23186 (longopts): Update.
23187 (getargs): Add case `g'.
23188 * src/files.c (graph_obstack): New obstack struct.
23189 (open_files): Initialize new obstack.
23190 (output_files): Saves graph_obstack if required.
23191 * src/files.h (graph_obstack): New extern declaration.
23192 * src/Makefile.am: Add new source files.
23193
231942001-08-06 Marc Autret <autret_m@epita.fr>
23195
23196 * src/print_graph.c, src/print_graph.h (graph): New.
23197 * src/vcg.h: New file.
23198 * src/vcg.c: New file, VCG graph handling.
23199
232002001-08-06 Marc Autret <autret_m@epita.fr>
23201
23202 Add of %source_extension and %header_extension which specify
23203 the source or/and the header output file extension.
23204
23205 * src/files.c (compute_base_names): Remove initialisation of
23206 src_extension and header_extension.
23207 (compute_exts_from_gf): Update.
23208 (compute_exts_from_src): Update.
23209 (output_files): Update.
23210 * src/reader.c (parse_header_extension_decl): New.
23211 (parse_source_extension_decl): New.
23212 (read_declarations): New case statements for the new tokens.
23213 * src/lex.c (percent_table): Add entries for %source_extension
23214 and %header_extension.
23215 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
23216
232172001-08-06 Marc Autret <autret_m@epita.fr>
23218
23219 * configure.in: Bump to 1.28c.
23220 * doc/bison.texinfo: Texinfo thingies.
23221
232222001-08-04 Pascal Bart <pascal.bart@epita.fr>
23223
23224 * tests/atconfig.in (CPPFLAGS): Add.
23225 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
23226
232272001-08-03 Akim Demaille <akim@epita.fr>
23228
23229 Version 1.28b.
23230
232312001-08-03 Akim Demaille <akim@epita.fr>
23232
23233 * tests/Makefile.am (check-local): Ship testsuite.
23234 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
23235 Include `string.h'.
23236
232372001-08-03 Akim Demaille <akim@epita.fr>
23238
23239 * configure.in: Try using -Wformat when compiling.
23240
232412001-08-03 Akim Demaille <akim@epita.fr>
23242
23243 * configure.in: Bump to 1.28b.
23244
232452001-08-03 Akim Demaille <akim@epita.fr>
23246
23247 * src/complain.c: Adjust strerror_r portability issues.
23248
232492001-08-03 Akim Demaille <akim@epita.fr>
23250
23251 Version 1.28a.
23252
232532001-08-03 Akim Demaille <akim@epita.fr>
23254
23255 * src/getargs.c, src/getarg.h (skeleton)): Constify.
23256 * src/lex.c (literalchar): Avoid name clashes on `buf'.
23257 * src/getargs.c: Include complain.h.
23258 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
23259 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
23260
232612001-08-03 Akim Demaille <akim@epita.fr>
23262
23263 * src/reader.c (readgram): Display hidden chars in error messages.
23264
232652001-08-03 Akim Demaille <akim@epita.fr>
23266
23267 Update to gettext 0.10.39.
23268
232692001-08-03 Akim Demaille <akim@epita.fr>
23270
23271 * lib/strspn.c: New.
23272
232732001-08-01 Marc Autret <autret_m@epita.fr>
23274
23275 * doc/bison.texinfo: Update.
23276 * doc/bison.1 (mandoc): Update.
23277 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
23278 * src/files.c: Support output files extensions computing.
23279 (src_extension): New static variable.
23280 (header_extension): New static variable.
23281 (tr): New function.
23282 (get_extension_index): New function, gets the index of an extension
23283 filename in a string.
23284 (compute_exts_from_gf): New function, computes extensions from the
23285 grammar file extension.
23286 (compute_exts_from_src): New functions, computes extensions from the
23287 C source file extension, file given by ``-o'' option.
23288 (compute_base_names): Update.
23289 (output_files): Update.
23290
232912001-08-01 Robert Anisko <anisko_r@epita.fr>
23292
23293 * doc/bison.texi: Document @$.
23294 (Locations): New section.
23295
232962001-07-18 Akim Demaille <akim@epita.fr>
23297
23298 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
23299 * config/prev-version.txt, config/move-if-change: New.
23300 * Makefile.am: Adjust.
23301
233022001-07-08 Pascal Bart <pascal.bart@epita.fr>
23303
23304 * src/bison.simple (yyparse): Suppress warning `comparaison
23305 between signed and unsigned'.
23306
233072001-07-05 Pascal Bart <pascal.bart@epita.fr>
23308
23309 * src/getargs.h (raw_flag): Remove.
23310 * src/getargs.c: Die on `-r'/`--raw'.
23311 * src/lex.c (parse_percent_token): Die on `%raw'.
23312 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
23313 * tests/calc.at: Suppress test with option `--raw'.
23314
233152001-07-14 Akim Demaille <akim@epita.fr>
23316
23317 * config/: New.
23318 * configure.in: Require Autoconf 2.50.
23319 Update to gettext 0.10.38.
23320
233212001-03-16 Akim Demaille <akim@epita.fr>
23322
23323 * doc/bison.texinfo: ANSIfy the examples.
23324
233252001-03-16 Akim Demaille <akim@epita.fr>
23326
23327 * getargs.c (skeleton): New variable.
23328 (longopts): --skeleton is a new option.
23329 (shortopts, getargs): -S is a new option.
23330 * getargs.h: Declare skeleton.
23331 * output.c (output_parser): Use it.
23332
233332001-03-16 Akim Demaille <akim@epita.fr>
23334
23335 * m4/strerror_r.m4: New.
23336 * m4/error.m4: Run AC_FUNC_STRERROR_R.
23337 * lib/error.h, lib/error.c: Update.
23338
233392001-03-16 Akim Demaille <akim@epita.fr>
23340
23341 * src/getargs.c (longopts): Clean up.
23342
233432001-02-21 Akim Demaille <akim@epita.fr>
23344
23345 * src/reader.c (gensym): `gensym_count' is your own.
23346 Use a static buf to create the symbol name, as token_buffer is no
23347 longer a buffer.
23348
233492001-02-08 Akim Demaille <akim@epita.fr>
23350
23351 * src/conflicts.c (conflict_report): Be sure not to append to res
23352 between two calls, which could happen if both first sprintf were
23353 skipped, but not the first cp += strlen.
23354
233552001-02-08 Akim Demaille <akim@epita.fr>
23356
23357 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
23358 New, from fileutils 4.0.37.
23359 * configure.in: Require Autoconf 2.49c. I took some time before
23360 making this decision. This is the only way out for portability
23361 issues in Bison, it would mean way too much duplicate effort to
23362 import in Bison features implemented in 2.49c since 2.13.
23363 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
23364
233652001-02-02 Akim Demaille <akim@epita.fr>
23366
23367 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
23368 * lib/xalloc.h, lib/xmalloc.c: Update.
23369
233702001-01-19 Akim Demaille <akim@epita.fr>
23371
23372 Get rid of the ad hoc handling of token_buffer in the scanner: use
23373 the obstacks.
23374
23375 * src/lex.c (token_obstack): New.
23376 (init_lex): Initialize it. No longer call...
23377 (grow_token_buffer): this. Remove it.
23378 Adjust all the places which used it to use the obstack.
23379
233802001-01-19 Akim Demaille <akim@epita.fr>
23381
23382 * src/lex.h: Rename all the tokens:
23383 s/\bENDFILE\b/tok_eof/g;
23384 s/\bIDENTIFIER\b/tok_identifier/g;
23385 etc.
23386 Let them be enums, not #define, to ease debugging.
23387 Adjust all the code.
23388
233892001-01-18 Akim Demaille <akim@epita.fr>
23390
23391 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
23392 * src/lex.c (maxtoken, grow_token_buffer): Static.
23393
233942001-01-18 Akim Demaille <akim@epita.fr>
23395
23396 Since we now use obstacks, more % directives can be enabled.
23397
23398 * src/lex.c (percent_table): Also accept `%yacc',
23399 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
23400 `%debug'.
23401 Handle the actions for `%semantic_parser' and `%pure_parser' here,
23402 instead of returning a token.
23403 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
23404 * src/reader.c (read_declarations): Adjust.
23405 * src/files.c (open_files): Don't call `compute_base_names', don't
23406 compute `attrsfile' since they depend upon data which might be
23407 *in* the input file now.
23408 (output_files): Do it here.
23409 * src/output.c (output_headers): Document the fact that this patch
23410 introduces a guaranteed SEGV for semantic parsers.
23411 * doc/bison.texinfo: Document them.
23412 * tests/suite.at: Exercise these %options.
23413
234142000-12-20 Akim Demaille <akim@epita.fr>
23415
23416 Also handle the output file (--verbose) with obstacks.
23417
23418 * files.c (foutput): Remove.
23419 (output_obstack): New.
23420 Adjust all dependencies.
23421 * src/conflicts.c: Return a string.
23422 * src/system.h (obstack_grow_string): Rename as...
23423 (obstack_sgrow): this. Be ready to work with non literals.
23424 (obstack_fgrow4): New.
23425
234262000-12-20 Akim Demaille <akim@epita.fr>
23427
23428 * src/files.c (open_files): Fix the computation of short_base_name
23429 in the case of `-o foo.tab.c'.
23430
234312000-12-20 Akim Demaille <akim@epita.fr>
23432
23433 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
23434 (copy_dollar): Now that everything uses obstacks, get rid of the
23435 FILE * parameters.
23436
234372000-12-20 Akim Demaille <akim@epita.fr>
23438
23439 * src/files.c (open_files): Actually the `.output' file is based
23440 on the short_base_name, not base_name.
23441 * tests/suite.at (Checking output file names): Adjust.
23442
234432000-12-20 Akim Demaille <akim@epita.fr>
23444
23445 * src/bison.s1: Remove, we now use directly...
23446 * src/bison.simple: this.
23447 * src/Makefile.am: Use pkgdata instead of data.
23448
234492000-12-20 Akim Demaille <akim@epita.fr>
23450
23451 * src/files.c (guard_obstack): New.
23452 (open_files): Initialize it.
23453 (output_files): Dump it...
23454 * src/files.h: Export it.
23455 * src/reader.c (copy_guard): Use it.
23456
234572000-12-19 Akim Demaille <akim@epita.fr>
23458
23459 * src/files.c (outfile, defsfile, actfile): Removed as global
23460 vars.
23461 (open_files): Don't compute them.
23462 (output_files): Adjust.
23463 (base_name, short_base_name): Be global.
23464 Adjust dependencies.
23465
234662000-12-19 Akim Demaille <akim@epita.fr>
23467
23468 * src/files.c (strsuffix): New.
23469 (stringappend): Be just like strcat but allocate.
23470 (base_names): Eve out from open_files.
23471 Try to simplify the rather hairy computation of base_name and
23472 short_base_name.
23473 (open_files): Use it.
23474 * tests/suite.at (Checking output file names): New test.
23475
234762000-12-19 Akim Demaille <akim@epita.fr>
23477
23478 * src/system.h (obstack_grow_literal_string): Rename as...
23479 (obstack_grow_string): this.
23480 * src/output.c (output_parser): Recognize `%% actions' instead of
23481 `$'.
23482 * src/bison.s1: s/$/%% actions/.
23483 * src/bison.hairy: Likewise.
23484
234852000-12-19 Akim Demaille <akim@epita.fr>
23486
23487 * src/output.c (output_parser): Compute the `#line' lines when
23488 there are.
23489 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
23490 Suggested by Hans Aberg.
23491
234922000-12-19 Akim Demaille <akim@epita.fr>
23493
23494 Let the handling of the skeleton files be local to the procedures
23495 that use it.
23496
23497 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
23498 longer static.
23499 (fparser, open_extra_files): Remove.
23500 (open_files, output_files): Don't take care of fparser.
23501 * src/files.h: Adjust.
23502 * src/output.c (output_parser): Open and close the file to the
23503 skeleton.
23504 * src/reader.c (read_declarations): When %semantic_parser, open
23505 fguard.
23506
235072000-12-19 Akim Demaille <akim@epita.fr>
23508
23509 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
23510 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
23511
235122000-12-19 Akim Demaille <akim@epita.fr>
23513
23514 * src/files.c (open_files): Yipee! We no longer need all the code
23515 looking for `/tmp' since we have no tmp file.
23516
235172000-12-19 Akim Demaille <akim@epita.fr>
23518
23519 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
23520 New macros.
23521 * src/files.c (open_files): Less dependency on MSDOS etc.
23522
235232000-12-14 Akim Demaille <akim@epita.fr>
23524
23525 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
23526 Provide a default definition.
23527 Use it when executing the default @ action.
23528 * src/reader.c (reader_output_yylsp): No longer include
23529 `timestamp' and `text' in the default YYLTYPE.
23530
235312000-12-12 Akim Demaille <akim@epita.fr>
23532
23533 * src/reader.c (copy_definition, parse_union_decl, copy_action)
23534 (copy_guard): Quote the file names.
23535 Reported by Laurent Mascherpa.
23536
235372000-12-12 Akim Demaille <akim@epita.fr>
23538
23539 * src/output.c (output_headers, output_program, output): Be sure
23540 to escape special characters when outputting filenames.
23541 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
23542 (output_headers): Don't depend on them, Use ACTSTR.
23543
235442000-11-17 Akim Demaille <akim@epita.fr>
23545
23546 * lib/obstack.h: Formatting changes.
23547 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
23548 prevents type checking.
23549 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
23550 cast the value to (void *): assigning a `foo *' to a `void *'
23551 variable is valid.
23552 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
23553 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
23554 append characters.
23555
235562000-11-17 Akim Demaille <akim@epita.fr>
23557
23558 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
23559 as...
23560 (suite.m4, regression.m4, calc.m4): these.
23561 * tests/atgeneral.m4: Update from CVS Autoconf.
23562
235632000-11-17 Akim Demaille <akim@epita.fr>
23564
23565 * tests/regression.m4 (%union and --defines): New test,
23566 demonstrating a current bug in the obstack implementation.
23567
235682000-11-17 Akim Demaille <akim@epita.fr>
23569
23570 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
23571 macros.
23572 Use them to declare the variables which are global or local to
23573 `yyparse'.
23574
235752000-11-17 Akim Demaille <akim@epita.fr>
23576
23577 * acconfig.h: Remove, no longer used.
23578
235792000-11-07 Akim Demaille <akim@epita.fr>
23580
23581 * src: s/Copyright (C)/Copyright/g.
23582
235832000-11-07 Akim Demaille <akim@epita.fr>
23584
23585 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
23586 defining.
23587 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
23588
235892000-11-07 Akim Demaille <akim@epita.fr>
23590
23591 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
23592 Merge in a single CPP if/else.
23593
235942000-11-07 Akim Demaille <akim@epita.fr>
23595
23596 * src/output.c (output): Remove useless variables.
23597 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
23598 argument `data' for consistency with the prototypes.
23599 Qualify it `const'.
23600 (obstack_copy, obstack_copy0): Rename the second argument as
23601 `address' for consistency. Qualify it `const'.
23602 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
23603 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
23604 `const' their input argument (`data' or `address').
23605 Adjust the corresponding macros to include `const' in casts.
23606
236072000-11-03 Akim Demaille <akim@epita.fr>
23608
23609 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
23610 s/PFILE1/BISON_HAIRY/.
23611 Adjust dependencies.
23612
236132000-11-03 Akim Demaille <akim@epita.fr>
23614
23615 For some reason, this was not applied.
23616
23617 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23618 `unlink': it's no longer used.
23619
236202000-11-03 Akim Demaille <akim@epita.fr>
23621
23622 * src/files.c (skeleton_find): New function, eved out of...
23623 (open_files, open_extra_files): here.
23624
236252000-11-03 Akim Demaille <akim@epita.fr>
23626
23627 Don't use `atexit'.
23628
23629 * src/files.c (obstack_save): New function.
23630 (done): Rename as...
23631 (output_files): this.
23632 Use `obstack_save'.
23633 * src/main.c (main): Don't use `atexit' to register `done', since
23634 it no longer has to remove tmp files, just call `output_files'
23635 when there are no errors.
23636
236372000-11-02 Akim Demaille <akim@epita.fr>
23638
23639 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
23640 `unlink': it's no longer used.
23641 * src/files.h: Formatting changes.
23642
236432000-11-02 Akim Demaille <akim@epita.fr>
23644
23645 Remove the last uses of mktemp and unlink/delete.
23646
23647 * src/files.c (fdefines, ftable): Removed.
23648 (defines_ostack, table_obstack): New.
23649 Adjust dependencies of the former into uses of the latter.
23650 * src/output.c (output_short_or_char_table, output_short_table):
23651 Convert to using obstacks.
23652 * src/reader.c (copy_comment2): Accept one FILE * and two
23653 obstacks.
23654 (output_token_defines, reader_output_yylsp): Use obstacks.
23655 * src/system.h (obstack_fgrow3): New.
23656 * po/POTFILES.in: Adjust.
23657
236582000-11-01 Akim Demaille <akim@epita.fr>
23659
23660 Change each use of `fattrs' into a use of `attrs_obstack'.
23661
23662 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
23663 * src/files.c (fattrs): Remove.
23664 (attrs_obstack): New.
23665 Adjust all dependencies.
23666 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
23667
236682000-11-01 Akim Demaille <akim@epita.fr>
23669
23670 Introduce obstacks.
23671 Change each use of `faction' into a use of `action_obstack'.
23672
23673 * lib/obstack.h, lib/obstack.c: New files.
23674 * src/files.c (faction): Remove.
23675 (action_obstack): New.
23676 Adjust all dependencies.
23677
236782000-10-20 Akim Demaille <akim@epita.fr>
23679
23680 * lib/quote.h (PARAMS): New macro. Use it.
23681
236822000-10-16 Akim Demaille <akim@epita.fr>
23683
23684 * src/output.c (output_short_or_char_table): New function.
23685 (output_short_table, output_token_translations): Use it.
23686 (goto_actions): Use output_short_table.
23687
236882000-10-16 Akim Demaille <akim@epita.fr>
23689
23690 * src/symtab.c (bucket_new): New function.
23691 (getsym): Use it.
23692
23693 * src/output.c (output_short_table): New argument to display the
23694 comment associated with the table.
23695 Adjust dependencies.
23696 (output_gram): Use it.
23697 (output_rule_data): Nicer output layout for YYTNAME.
23698
236992000-10-16 Akim Demaille <akim@epita.fr>
23700
23701 * src/lex.c (read_typename): New function.
23702 (lex): Use it.
23703 * src/reader.c (copy_dollar): Likewise.
23704
237052000-10-16 Akim Demaille <akim@epita.fr>
23706
23707 * src/reader.c (copy_comment2): Expect the input stream to be on
23708 the `/' which is suspected to open a comment, instead of being
23709 called after `//' or `/*' was read.
23710 (copy_comment, copy_definition, parse_union_decl, copy_action)
23711 (copy_guard): Adjust.
23712
237132000-10-16 Akim Demaille <akim@epita.fr>
23714
23715 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
23716 `read_signed_integer'.
23717
237182000-10-16 Akim Demaille <akim@epita.fr>
23719
23720 * src/reader.c (copy_dollar): New function.
23721 (copy_guard, copy_action): Use it.
23722
237232000-10-16 Akim Demaille <akim@epita.fr>
23724
23725 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
23726 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
23727 New files, from Fileutils 4.0.27.
23728 * src/main.c (printable_version): Remove.
23729 * src/lex.c, src/reader.c: Use `quote'.
23730
237312000-10-04 Akim Demaille <akim@epita.fr>
23732
23733 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
23734
237352000-10-04 Akim Demaille <akim@epita.fr>
23736
23737 * doc/bison.texinfo: Various typos spotted by Neil Booth.
23738
237392000-10-04 Akim Demaille <akim@epita.fr>
23740
23741 When a literal string is used to define two different tokens,
23742 `bison -v' segfaults.
23743 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
23744
23745 * tests/regression.m4: New file.
23746 Include the core of the sample provided by Piotr Gackiewicz.
23747 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
23748 properly.
23749
237502000-10-04 Akim Demaille <akim@epita.fr>
23751
23752 * src/reader.c (parse_expect_decl): Keep `count' within the size
23753 of `buffer'.
23754 From Neil Booth.
23755
237562000-10-02 Paul Eggert <eggert@twinsun.com>
23757
23758 * bison.s1 (yyparse): Assign the default value
23759 unconditionally, to avoid a GCC warning and make the parser a
23760 tad smaller.
23761
237622000-10-02 Akim Demaille <akim@epita.fr>
23763
23764 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
23765 options.
23766
237672000-10-02 Akim Demaille <akim@epita.fr>
23768
23769 * src/derives.c, src/print.c, src/reduce.c: To ease the
23770 translation, move some `\n' out of the translated strings.
23771
237722000-10-02 Akim Demaille <akim@epita.fr>
23773
23774 The location tracking mechanism is precious for parse error
23775 messages. Nevertheless, it is enabled only when `@n' is used in
23776 the grammar, which is a different issue (you can use it in error
23777 message, but not in the grammar per se). Therefore, there should
23778 be another means to enable it.
23779
23780 * src/getargs.c (getargs): Support `--locations'.
23781 (usage): Report it.
23782 * src/getargs.h (locationsflag): Export it.
23783 * src/lex.c (percent_table): Support `%locations'.
23784 * src/reader.c (yylsp_needed): Remove this variable, now replaced
23785 with `locationsflag'.
23786 * doc/bison.texinfo: Document `--locations' and `%locations'.
23787 Sort the options.
23788 * tests/calc.m4: Test it.
23789
23790 For regularity of the names, replace each
23791 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
23792 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
23793 In addition replace each `flag' with `_flag'.
23794
237952000-10-02 Akim Demaille <akim@epita.fr>
23796
23797 Also test parse error messages, including with YYERROR_VERBOSE.
23798
23799 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
23800 associative).
23801 Use it to check the computations.
23802 Use it to check `nonassoc' is honored.
23803 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
23804 `--yyerror-verbose'.
23805 (_AT_CHECK_CALC): Adjust to this option.
23806 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
23807
238082000-10-02 Akim Demaille <akim@epita.fr>
23809
23810 Test also `--verbose', `--defines' and `--name-prefix'. Testing
23811 the latter demonstrates a flaw in the handling of non debugging
23812 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
23813 was used in order to simplify:
23814
23815 #if YYDEBUG
23816 if (yydebug)
23817 {
23818 ...
23819 }
23820 #endif
23821
23822 into
23823
23824 if (yydebug)
23825 {
23826 ...
23827 }
23828
23829 unfortunately this leads to a CPP conflict when
23830 `--name-prefix=foo' is used since it produces `#define yydebug
23831 foodebug'.
23832
23833 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
23834 (YYDPRINTF): New macro.
23835 Spread its use.
23836 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
23837 the bison options.
23838 Also test `--verbose', `--defines' and `--name-prefix'.
23839
238402000-10-02 Akim Demaille <akim@epita.fr>
23841
23842 Improve the readability of the produced parsers.
23843
23844 * src/bison.s1: Formatting changes.
23845 Improve the comment related to the `$' mark.
23846 (yydefault): Don't fall through to `yyresume': `goto' there.
23847 * src/output.c (output_parser): When the `$' is met, skip the end
23848 of its line.
23849 New variable, `number_of_dollar_signs', to check there's exactly
23850 one `$' in the parser skeleton.
23851
238522000-10-02 Akim Demaille <akim@epita.fr>
23853
23854 * lib/xstrdup.c: New file, from the fileutils.
23855 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
23856 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
23857 instead of strlen + xmalloc + strcpy.
23858 * src/symtab.c (copys): Remove, use xstrdup instead.
23859
238602000-10-02 Akim Demaille <akim@epita.fr>
23861
23862 * src/gram.h (associativity): New enum type which replaces the
23863 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
23864 `right_assoc', `left_assoc' and `non_assoc'.
23865 Adjust all dependencies.
23866 * src/reader.c: Formatting changes.
23867 (LTYPESTR): Don't define it, use it as a literal in
23868 `reader_output_yylsp'.
23869 * src/symtab.h (symbol_class): New enum type which replaces the
23870 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
23871 `sunknown', `stoken and `snterm'.
23872
238732000-10-02 Akim Demaille <akim@epita.fr>
23874
23875 * src/getargs.c (fixed_outfiles): Rename as...
23876 (yaccflag): for consistency and accuracy.
23877 Adjust dependencies.
23878
238792000-10-02 Akim Demaille <akim@epita.fr>
23880
23881 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
23882 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
23883 difficult and introduced a lot of core dump. It turns out that
23884 Bison used an implementation of `xmalloc' based on `calloc', and
23885 at various places it does depend upon the initialization to 0. I
23886 have not tried to isolate the pertinent places, and all the former
23887 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
23888 someone should address this issue.
23889
23890 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
23891 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
23892 files.
23893 Adjust dependencies.
23894 * src/warshall.h: New file.
23895 Propagate.
23896
238972000-10-02 Akim Demaille <akim@epita.fr>
23898
23899 Various anti-`extern in *.c' changes.
23900
23901 * src/system.h: Include `assert.h'.
23902
239032000-10-02 Akim Demaille <akim@epita.fr>
23904
23905 * src/state.h (nstates, final_state, first_state, first_shift)
23906 (first_reduction): Move their exportation from here...
23907 * src/LR0.h: to here.
23908 Adjust dependencies.
23909 * src/getargs.c (statisticsflag): New variable.
23910 Add support for `--statistics'.
23911 Adjust dependencies.
23912
23913 Remove a lot of now useless `extern' statements in most files.
23914
239152000-10-02 Akim Demaille <akim@epita.fr>
23916
23917 * src/LR0.h: New file.
23918 Propagate its use.
23919
239202000-10-02 Akim Demaille <akim@epita.fr>
23921
23922 * src/print.h: New file.
23923 Propagate its use.
23924 * src/print.c: Formatting and ordering changes.
23925 (verbose, terse): Replace with...
23926 (print_results): this new function.
23927 Adjust dependencies.
23928
239292000-10-02 Akim Demaille <akim@epita.fr>
23930
23931 * src/conflicts.c (conflict_report): New function.
23932 (conflict_log, verbose_conflict_log): Replace with...
23933 (print_conflicts): this function.
23934 Adjust dependencies.
23935 * src/conflicts.h: New file.
23936 Propagate its inclusion.
23937
239382000-10-02 Akim Demaille <akim@epita.fr>
23939
23940 * src/nullable.h: New file.
23941 Propagate its inclusion.
23942 * src/nullable.c: Formatting changes.
23943
239442000-10-02 Akim Demaille <akim@epita.fr>
23945
23946 * src/reduce.h: New file.
23947 Propagate its inclusion.
23948 * src/reduce.c: Topological sort and other formatting changes.
23949 (bool, TRUE, FALSE): Move their definition to...
23950 * src/system.h: here.
23951
239522000-10-02 Akim Demaille <akim@epita.fr>
23953
23954 * src/files.c: Formatting changes.
23955 (tryopen, tryclose, openfiles): Rename as...
23956 (xfopen, xfclose, open_files): this.
23957 (stringappend): static.
23958 * src/files.h: Complete the list of exported symbols.
23959 Propagate its use.
23960
239612000-10-02 Akim Demaille <akim@epita.fr>
23962
23963 * src/reader.h: New file.
23964 Propagate its use instead of tedious list of `extern' and
23965 prototypes.
23966 * src/reader.c: Formatting changes, topological sort,
23967 s/register//.
23968
239692000-10-02 Akim Demaille <akim@epita.fr>
23970
23971 * src/lex.h: Prototype `lex.c' exported functions.
23972 * src/reader.c: Adjust.
23973 * src/lex.c: Formatting changes.
23974 (safegetc): Rename as...
23975 (xgetc): this.
23976
239772000-10-02 Akim Demaille <akim@epita.fr>
23978
23979 * src/lalr.h: New file.
23980 Propagate its inclusion instead of prototypes and `extern'.
23981 * src/lalr.c: Formatting changes, topological sorting etc.
23982
239832000-10-02 Akim Demaille <akim@epita.fr>
23984
23985 * src/output.c (token_actions): Introduce a temporary array,
23986 YYDEFACT, that makes it possible for this function to use
23987 output_short_table.
23988
239892000-10-02 Akim Demaille <akim@epita.fr>
23990
23991 `user_toknums' is output as a `short[]' in `output.c', while it is
23992 defined as a `int[]' in `reader.c'. For consistency with the
23993 other output tables, `user_toknums' is now defined as a table of
23994 shorts.
23995
23996 * src/reader.c (user_toknums): Be a short table instead of an int
23997 table.
23998 Adjust dependencies.
23999
24000 Factor the short table outputs.
24001
24002 * src/output.c (output_short_table): New function.
24003 * src/output.c (output_gram, output_stos, output_rule_data)
24004 (output_base, output_table, output_check): Use it.
24005
240062000-10-02 Akim Demaille <akim@epita.fr>
24007
24008 * src/output.c (output): Topological sort of the functions, in
24009 order to get rid of the `static' prototypes.
24010 No longer use `register'.
24011 * src/output.h: New file.
24012 Propagate its inclusion in files explicitly prototyping functions
24013 from output.c.
24014
240152000-09-21 Akim Demaille <akim@epita.fr>
24016
24017 * src/atgeneral.m4: Update from Autoconf.
24018
240192000-09-21 Akim Demaille <akim@epita.fr>
24020
24021 * src/closure.h: New file.
24022 * src/closure.c: Formatting changes, topological sort over the
24023 functions, use of closure.h.
24024 (initialize_closure, finalize_closure): Rename as...
24025 (new_closure, free_closure): these. Adjust dependencies.
24026 * src/LR0.c: Formatting changes, topological sort, use of
24027 cloture.h.
24028 (initialize_states): Rename as...
24029 (new_states): this.
24030 * src/Makefile.am (noinst_HEADERS): Adjust.
24031
240322000-09-20 Akim Demaille <akim@epita.fr>
24033
24034 * src/acconfig.h: Don't protect config.h against multiple
24035 inclusion.
24036 Don't define PARAMS.
24037 * src/system.h: Define PARAMS.
24038 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
24039 purpose of config.h. system.h must not try to fix wrong
24040 definitions in config.h.
24041
240422000-09-20 Akim Demaille <akim@epita.fr>
24043
24044 * src/derives.h: New file.
24045 * src/main.c, src/derives.h: Use it.
24046 Formatting changes.
24047 * src/Makefile.am (noinst_HEADERS): Adjust.
24048
240492000-09-20 Akim Demaille <akim@epita.fr>
24050
24051 * tests/atgeneral.m4: Update from Autoconf.
24052 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
24053 (AT_CHECK_CALC): New macros.
24054 Use these macros to test bison with options `', `--raw',
24055 `--debug', `--yacc', `--yacc --debug'.
24056
240572000-09-19 Akim Demaille <akim@epita.fr>
24058
24059 * src/output.c: Formatting changes.
24060 * src/machine.h: Remove, leaving its contents in...
24061 * src/system.h: here.
24062 Include stdio.h.
24063 Adjust all dependencies on stdio.h and machine.h.
24064 * src/getargs.h: New file.
24065 Let all `extern' declarations about getargs.c be replaced with
24066 inclusion of `getargs.h'.
24067 * src/Makefile.am (noinst_HEADERS): Adjust.
24068
24069 * tests/calc.m4 (yyin): Be initialized in main, not on the global
24070 scope.
24071 (yyerror): Returns void, not int.
24072 * doc/bison.texinfo: Formatting changes.
24073
240742000-09-19 Akim Demaille <akim@epita.fr>
24075
24076 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
24077 portable.
24078
240792000-09-18 Akim Demaille <akim@epita.fr>
24080
24081 * configure.in: Append WARNING_CFLAGS to CFLAGS.
24082 * src/Makefile.am (INCLUDES): Don't.
24083 Be ready to fetch headers in lib/.
24084
240852000-09-18 Akim Demaille <akim@epita.fr>
24086
24087 * doc/bison.texinfo: Update the copyright.
24088 ANSIfy and GNUify the examples.
24089 Remove the old menu.
24090
240912000-09-18 Akim Demaille <akim@epita.fr>
24092
24093 First set of tests: use the `calc' example from the documentation.
24094
24095 * src/bison.s1 (yyparse): Condition the code using `yytname' which
24096 is defined only when YYDEBUG is.
24097 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
24098 * src/files.c (tryopen, tryclose): Formatting changes.
24099 Move to the top and be static.
24100 * src/reader.c (read_signed_integer): Likewise.
24101 * tests/calc.m4: New file.
24102 * Makefile.am, suite.m4: Adjust.
24103 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
24104
241052000-09-18 Akim Demaille <akim@epita.fr>
24106
24107 Add support for an Autotest test suite for Bison.
24108
24109 * m4/m4.m4, m4/atconfig.m4: New files.
24110 * m4/Makefile.am (EXTRA_DIST): Adjust.
24111 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
24112 files.
24113 * src/getargs.c: Display a more standard --version message.
24114 * src/reader.c (reader): Formatting changes.
24115 No longer depend upon VERSION_STRING.
24116 * configure.in: No longer use `dnl'.
24117 Set up the test suite and the new directory `tests/.
24118 (VERSION_STRING): Remove.
24119
241202000-04-14 Akim Demaille <akim@epita.fr>
24121
24122 * src/reader.c (copy_comment2): New function, same as former
24123 `copy_comment', but outputs into two FILE *.
24124 (copy_comment): Use it.
24125 (parse_union_decl): Use it.
24126 (get_type, parse_start_decl): Use the same `invalid' message.
24127 (parse_start_decl, parse_union_decl): Use the same `multiple'
24128 message.
24129 (parse_union_decl, copy_guard, copy_action): Use the same
24130 `unmatched' message.
24131 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
24132
241332000-03-31 Akim Demaille <akim@epita.fr>
24134
24135 * src/files.c (tryopen, tryclose): Move to the top.
24136 Be static.
24137
241382000-03-31 Akim Demaille <akim@epita.fr>
24139
24140 * src/main.c (main): Don't call `done', exit does it.
24141
241422000-03-31 Akim Demaille <akim@epita.fr>
24143
24144 * allocate.c: s/return (foo)/return foo/.
24145 * lalr.c: Likewise.
24146 * LR0.c: Likewise.
24147 * output.c: Likewise.
24148 * reader.c: Likewise.
24149 * symtab.c: Likewise.
24150 * vmsgetargs.c: Likewise.
24151
241522000-03-31 Akim Demaille <akim@epita.fr>
24153
24154 Clean up the error reporting functions.
24155
24156 * src/report.c: New file.
24157 * src/report.h: Likewise.
24158 * src/Makefile.am: Adjust.
24159 * m4/error.m4: New file.
24160 * m4/Makefile.am: Adjust.
24161 * configure.in (jm_PREREQ_ERROR): Call it.
24162 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
24163 Remove.
24164 (fatal, fatals): Remove. All callers use complain.c::fatal.
24165 (warn, warni, warns, warnss, warnss): Remove. All callers use
24166 complain.c::complain.
24167 (toomany): Remove, use fatal instead.
24168 * src/files.c (done): No argument, use complain_message_count.
24169 * src/main.c (main): Register `done' to `atexit'.
24170
24171 * src/getargs.c (usage): More `fputs', less `fprintf'.
24172
241732000-03-28 Akim Demaille <akim@epita.fr>
24174
24175 * lib/: New directory.
24176 * Makefile.am (SUBDIRS): Adjust.
24177 * configure.in: Adjust.
24178 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
24179 useless.
24180 * src/alloca.c: Moved to lib/.
24181 * src/getopt.c: Likewise.
24182 * src/getopt1.c: Likewise.
24183 * src/getopt.h: Likewise.
24184 * src/ansi2knr.c: Likewise.
24185 * src/ansi2knr.1: Likewise.
24186 * src/Makefile.am: Adjust.
24187 * lib/Makefile.am: New file.
24188
241892000-03-28 Akim Demaille <akim@epita.fr>
24190
24191 * src/getargs.c (usage): Refresh the help message.
24192
241932000-03-17 Akim Demaille <akim@epita.fr>
24194
24195 * src/getopt1.c: Updated from textutils 2.0e
24196 * src/getopt.c: Likewise.
24197 * src/getopt.h: Likewise.
24198
241992000-03-17 Akim Demaille <akim@epita.fr>
24200
24201 * src/Makefile.am (bison.simple): Fix the awk program: quote only
24202 the file name, not the whole `#line LINE FILE'.
24203
242042000-03-17 Akim Demaille <akim@epita.fr>
24205
24206 On syntax errors, report the token on which we choked.
24207
24208 * src/bison.s1 (yyparse): In the label yyerrlab, when
24209 YYERROR_VERBOSE, add yychar in msg.
24210
242112000-03-17 Akim Demaille <akim@epita.fr>
24212
24213 * src/reader.c (copy_at): New function.
24214 (copy_guard): Use it.
24215 (copy_action): Use it.
24216
242172000-03-17 Akim Demaille <akim@epita.fr>
24218
24219 Be kind to translators, save some useless translations.
24220
24221 * src/main.c (banner): New function.
24222 (fatal_banner): Use it.
24223 (warn_banner): Use it.
24224
242252000-03-17 Akim Demaille <akim@epita.fr>
24226
24227 * src/reader.c (copy_definition): Use copy_string and
24228 copy_comment. Removed now unused `match', `ended',
24229 `cplus_comment'.
24230 (copy_comment, copy_string): Moved, to be visible from
24231 copy_definition.
24232
242332000-03-17 Akim Demaille <akim@epita.fr>
24234
24235 * src/reader.c (copy_string): Declare `static inline'. No
24236 problems with inline, since it is checked by configure.
24237 (copy_comment): Likewise.
24238
242392000-03-17 Akim Demaille <akim@epita.fr>
24240
24241 * src/reader.c (packsymbols): Formatting changes.
24242
242432000-03-17 Akim Demaille <akim@epita.fr>
24244
24245 * src/reader.c (copy_comment): New function, factored out from:
24246 (copy_action): Use it. Removed now unused `match', `ended',
24247 `cplus_comment'.
24248 (copy_guard): Likewise.
24249
242502000-03-17 Akim Demaille <akim@epita.fr>
24251
24252 * src/reader.c (copy_string): New function, factored out from:
24253 (copy_action): Use it.
24254 (copy_guard): Likewise.
24255
242562000-03-17 Akim Demaille <akim@epita.fr>
24257
24258 Change the handling of @s so that they behave exactly like $s.
24259 There is now a pseudo variable @$ (readble and writable), location
24260 of the lhs of the rule (by default ranging from the location of
24261 the first symbol of the rhs, to the location of the last symbol,
24262 or, if the rhs is empty, YYLLOC).
24263
24264 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
24265 yyval.
24266 (yyparse): When providing a default semantic action, provide a
24267 default location action.
24268 (after the $): No longer change `*YYLSP', just stack YYLOC the
24269 same way you stack YYVAL.
24270 * src/reader.c (read_declarations): Use warns.
24271 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
24272 (copy_action, case '@'): Likewise.
24273 Use a standard error message, to save useless work from
24274 translators.
24275
242762000-03-17 Akim Demaille <akim@epita.fr>
24277
24278 * src/bison.s1: Formatting and cosmetics changes.
24279 * src/reader.c: Likewise.
24280 Update the Copyright notice.
24281
242822000-03-17 Akim Demaille <akim@epita.fr>
24283
24284 * src/bison.s1 (#line): All set to `#line' only, since the
24285 Makefile now handles them.
24286
242872000-03-16 Akim Demaille <akim@epita.fr>
24288
24289 * src/output.c (output_rule_data): Output the documentation of
24290 some of the tables.
24291 (Copyright notice): Update.
24292 Formatting changes.
24293
242942000-03-16 Akim Demaille <akim@epita.fr>
24295
24296 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
24297 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
24298 One `#if YYDEBUG' remains, since it uses variables which are
24299 defined only if `YYDEBUG != 0'.
24300
243012000-03-16 Akim Demaille <akim@epita.fr>
24302
24303 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
24304 and related variables so that the similarities are highlighted.
24305
243062000-03-16 Akim Demaille <akim@epita.fr>
24307
24308 * src/bison.s1: Properly indent CPP directives.
24309
243102000-03-16 Akim Demaille <akim@epita.fr>
24311
24312 * src/bison.s1: Properly indent the `alloca' CPP section.
24313
243142000-03-16 Akim Demaille <akim@epita.fr>
24315
24316 Do not hard code values of directories in `configure.in'.
24317 Update the `configure' tool chain.
24318
24319 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
24320 src/makefile.am.
24321 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
24322 (AC_OUTPUT): Add m4/Makefile.
24323 Bump to bison 1.28a, 1.29 has never been released.
24324 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
24325 handled via src/Makefile.am.
24326 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
24327 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
24328 autoheader.
24329 * Makefile.am (SUBDIRS): Add m4.
24330 (ACLOCAL_AM_FLAGS): New variable.
24331 (AUTOMAKE_OPTIONS): Add check-news.
24332 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
24333 the proper line number and file name.
24334 (DEFS): Propagate the location of bison library files and of the
24335 locale files.
24336 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
24337 builddir.
24338 * acinclude.m4: Remove, replaced by the directory m4.
24339 * m4/Makefile.am (EXTRA_DIST): New variable.
24340 * m4/gettext.m4: New file, from the fileutils.
24341 * m4/lcmessage.m4: Likewise
24342 * m4/progtest.m4: Likewise.
24343 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
24344
243452000-03-10 Akim Demaille <akim@epita.fr>
24346
24347 * src/closure.c:
24348 Formatting changes of various comments.
24349 Respect the GNU coding standards at various places.
24350 Don't use `_()' when no translation is needed.
24351
243521999-12-13 Jesse Thilo <jthilo@gnu.org>
24353
24354 * src/files.c:
24355 OS/2 honors TMPDIR environment variable.
24356
243571999-12-13 Jesse Thilo <jthilo@gnu.org>
24358
24359 * doc/bison.texinfo: Tweaked spelling and grammar.
24360 Updated ISBN.
24361 Removed reference to price of printed copy.
24362 Mention BISON_SIMPLE and BISON_HAIRY.
24363
243641999-12-13 Jesse Thilo <jthilo@gnu.org>
24365
24366 * configure.in, NEWS:
24367 Bison 1.29 released.
24368
243691999-10-27 Jesse Thilo <jthilo@gnu.org>
24370
24371 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
24372 Added reference card.
24373
243741999-07-26 Jesse Thilo <jthilo@gnu.org>
24375
24376 * po/ru.po: Added Russian translation.
24377
243781999-07-26 Jesse Thilo <jthilo@gnu.org>
24379
24380 * configure.in: Added Russian translation.
24381
243821999-07-06 Jesse Thilo <jthilo@gnu.org>
24383
24384 * configure.in, NEWS, README:
24385 Released version 1.28.
24386
243871999-06-14 Jesse Thilo <jthilo@gnu.org>
24388
24389 * src/system.h:
24390 Squashed redefinition warning on some systems.
24391
24392 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
24393 Have configure build version string instead of relying on ANSI string
24394 concatentation.
24395
243961999-06-14 Jesse Thilo <jthilo@gnu.org>
24397
24398 * po/POTFILES.in: Got rid of version.c.
24399
244001999-06-14 Jesse Thilo <jthilo@gnu.org>
24401
24402 * acconfig.h, configure.in:
24403 Have configure build version string instead of relying on ANSI string
24404 concatentation.
24405
244061999-06-08 Jesse Thilo <jthilo@gnu.org>
24407
24408 * doc/bison.1:
24409 Dropped mention of `+' for long-named options.
24410
244111999-05-30 Jesse Thilo <jthilo@gnu.org>
24412
24413 * src/files.c: Added <unistd.h> for unlink().
24414
24415 * src/Makefile.am, src/system.h:
24416 I18n fixes.
24417
244181999-05-30 Jesse Thilo <jthilo@gnu.org>
24419
24420 * README: Added a FAQ list.
24421
24422 * configure.in, acconfig.h:
24423 I18n fixes.
24424
244251999-05-30 Jesse Thilo <jthilo@gnu.org>
24426
24427 * doc/FAQ, doc/Makefile.am:
24428 Added a FAQ list.
24429
244301999-05-19 Jesse Thilo <jthilo@gnu.org>
24431
24432 * src/alloc.h, src/symtab.h, src/version.c:
24433 Protected inclusion of "config.h" with HAVE_CONFIG_H.
24434
244351999-04-18 Jesse Thilo <jthilo@gnu.org>
24436
24437 * src/.cvsignore, src/Makefile.am:
24438 Reorganized: sources in `src', documentation in `doc'.
24439
24440 * src/lex.c (literalchar):
24441 fixed the code for escaping double quotes (thanks
24442 Jonathan Czisny.)
24443
244441999-04-18 Jesse Thilo <jthilo@gnu.org>
24445
24446 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
24447 Adjusted paths to reflect directory reorganization.
24448
244491999-04-18 Jesse Thilo <jthilo@gnu.org>
24450
24451 * doc/.cvsignore, doc/Makefile.am:
24452 Reorganized: sources in `src', documentation in `doc'.
24453
244541999-04-18 Jesse Thilo <jthilo@gnu.org>
24455
24456 * configure.in:
24457 Updated AC_INIT file to reflect directory reorganization.
24458
24459 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
24460 Reorganized: sources in `src', documentation in `doc'.
24461
244621999-04-13 Jesse Thilo <jthilo@gnu.org>
24463
24464 * src/allocate.c:
24465 Don't declare calloc() and realloc() if not necessary.
24466
244671999-04-13 Jesse Thilo <jthilo@gnu.org>
24468
24469 * configure.in, acconfig.h, acinclude.m4:
24470 Don't declare calloc() and realloc() if not necessary.
24471
244721999-03-23 Jesse Thilo <jthilo@gnu.org>
24473
24474 * po/.cvsignore: Added i18n support.
24475
244761999-03-23 Jesse Thilo <jthilo@gnu.org>
24477
24478 * acconfig.h, configure.in, Makefile.am:
24479 Added i18n support.
24480
244811999-03-22 Jesse Thilo <jthilo@gnu.org>
24482
24483 * src/bison.s1: Fixed #line numbers.
24484
244851999-03-15 Jesse Thilo <jthilo@gnu.org>
24486
24487 * po/es.po, po/fr.po, po/nl.po, po/de.po:
24488 Added PO files from Translation Project.
24489
244901999-03-03 Jesse Thilo <jthilo@gnu.org>
24491
24492 * Makefile.am:
24493 Added support for non-ANSI compilers (ansi2knr).
24494
244951999-02-16 Jesse Thilo <jthilo@gnu.org>
24496
24497 * configure.in: Bumped version number to 1.27.
24498
24499 * Makefile.am:
24500 Added `bison.simple' to list of files removed by `make distclean'.
24501
245021999-02-12 Jesse Thilo <jthilo@gnu.org>
24503
24504 * src/files.c, src/files.h:
24505 Defined locations of parser files in config.h instead of Makefile.
24506
245071999-02-12 Jesse Thilo <jthilo@gnu.org>
24508
24509 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
24510 Defined locations of parser files in config.h instead of Makefile.
24511
245121999-02-09 Jesse Thilo <jthilo@gnu.org>
24513
24514 * Makefile.am:
24515 Removed inappropriate use of $< macro.
24516
245171999-02-05 Jesse Thilo <jthilo@gnu.org>
24518
24519 * po/Makefile.in.in, po/POTFILES.in:
24520 Add `po' directory skeleton.
24521
245221999-01-27 Jesse Thilo <jthilo@gnu.org>
24523
24524 * README: Document help-bison list.
24525
24526 * configure.in: Add check for mkstemp().
24527
245281999-01-20 Jesse Thilo <jthilo@gnu.org>
24529
24530 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
24531 Hush a few compiler warnings.
24532
24533 * src/files.c:
24534 Add tryclose(), which verifies that fclose was successful.
24535 Hush a couple of compiler warnings.
24536
245371999-01-20 Jesse Thilo <jthilo@gnu.org>
24538
24539 * Makefile.am, OChangeLog:
24540 ChangeLog is now automatically generated. Include the old version as
24541 OChangeLog.
24542
245431999-01-14 Jesse Thilo <jthilo@gnu.org>
24544
24545 * 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:
24546 Update FSF address.
24547
245481999-01-14 Jesse Thilo <jthilo@gnu.org>
24549
24550 * doc/bison.texinfo: Fix formatting glitch.
24551
24552 * doc/bison.texinfo: Update FSF address.
24553
245541999-01-14 Jesse Thilo <jthilo@gnu.org>
24555
24556 * acconfig.h: Update FSF address.
24557
245581999-01-08 Jesse Thilo <jthilo@gnu.org>
24559
24560 * src/system.h:
24561 Don't define PACKAGE here, since config.h defines it.
24562
245631998-12-30 Jesse Thilo <jthilo@gnu.org>
24564
24565 * src/reader.c: Update copyright date.
24566
24567 * src/main.c:
24568 Ditch sprintf to statically-sized buffers in fatal/warn functions in
24569 favor of output directly to stderr (avoids buffer overruns).
24570
24571 * src/reader.c: Some checks for premature EOF.
24572
24573 * 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:
24574 Use prototypes if the compiler understands them.
24575
24576 * src/files.c: Honor TMPDIR on Unix hosts.
24577 Use prototypes if the compiler understands them.
24578
24579 * src/reader.c:
24580 Fix a couple of buffer overrun bugs.
24581 Use prototypes if the compiler understands them.
24582
24583 * src/system.h: Include unistd.h and ctype.h.
24584 Use #ifdef instead of #if for NLS symbols.
24585
245861998-12-30 Jesse Thilo <jthilo@gnu.org>
24587
24588 * doc/bison.texinfo:
24589 Delete comment "consider using @set for edition number, etc..." since
24590 we now are doing so.
24591
245921998-12-30 Jesse Thilo <jthilo@gnu.org>
24593
24594 * configure.in:
24595 Use prototypes if the compiler understands them.
24596
24597 * NEWS: Document 1.26 highlights.
24598
24599 * Makefile.am: Require Automake 1.3 or later.
24600
24601 * acconfig.h:
24602 Use prototypes if the compiler understands them.
24603
246041998-12-29 Jesse Thilo <jthilo@gnu.org>
24605
24606 * src/version.c:
24607 Use VERSION symbol from automake for version number.
24608
246091998-12-29 Jesse Thilo <jthilo@gnu.org>
24610
24611 * acconfig.h, configure.in, version.cin:
24612 Use VERSION symbol from automake for version number.
24613
246141998-11-28 Jesse Thilo <jthilo@gnu.org>
24615
24616 * Makefile.am:
24617 Distribute original version of simple parser (bison.s1), not built
24618 version (bison.simple).
24619
246201998-11-28 Jesse Thilo <jthilo@gnu.org>
24621
24622 * doc/bison.texinfo: Add info dir entry.
24623
24624 * doc/bison.texinfo:
24625 Let automake put version number into documentation.
24626
246271998-11-26 Jesse Thilo <jthilo@gnu.org>
24628
24629 * src/bison.cld, src/build.com, src/vmshlp.mar:
24630 Add non-RCS files from /gd/gnu/bison.
24631
246321998-11-26 Jesse Thilo <jthilo@gnu.org>
24633
24634 * doc/bison.1:
24635 Document the BISON_HAIRY and BISON_SIMPLE variables.
24636
246371998-11-25 Jesse Thilo <jthilo@gnu.org>
24638
24639 * src/version.c: Build version.c automatically.
24640
24641 * src/reader.c:
24642 Fix token numbering (used to start at 258, not 257).
24643
24644 * src/system.h: Include config.h.
24645
24646 * src/getargs.c: Update bug report address.
24647
24648 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
24649 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
24650
246511998-11-25 Jesse Thilo <jthilo@gnu.org>
24652
24653 * Makefile.am:
24654 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24655
24656 * configure.in, version.cin:
24657 Build version.c automatically.
24658
24659 * AUTHORS: Add AUTHORS file.
24660
24661 * README: Update bug report address.
24662
24663 * bison.simple:
24664 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
24665
24666 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
24667 Add automake stuff.
24668
246691998-11-25 Jesse Thilo <jthilo@gnu.org>
24670
24671 * doc/bison.texinfo: Clean up some formatting.
24672
246731998-05-05 Richard Stallman <rms@gnu.org>
24674
24675 * doc/bison.texinfo:
24676 Explain better why to make a pure parser.
24677
246781998-01-05 Richard Stallman <rms@gnu.org>
24679
24680 * src/files.c (openfiles):
24681 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
24682 find a temporary directory, if possible. Do not unlink files while
24683 they are open.
24684
246851997-08-25 Richard Stallman <rms@gnu.org>
24686
24687 * src/reader.c (stack_offset;):
24688 Change some warni to warns.
24689
24690 * src/lex.c (literalchar): Use warns, not warni.
24691
246921997-06-28 Richard Stallman <rms@gnu.org>
24693
24694 * src/bison.s1: Add a Bison version comment.
24695
24696 * src/main.c (fatal, warn, berror):
24697 Use program_name.
24698
246991997-06-28 Richard Stallman <rms@gnu.org>
24700
24701 * Makefile.in (bison_version): New variable.
24702 (dist): Use that variable.
24703 (bison.s1): Substitute the Bison version into bison.simple.
24704
24705 * bison.simple: Add a Bison version comment.
24706
247071997-06-18 Richard Stallman <rms@gnu.org>
24708
24709 * src/main.c (fatal, warn, berror):
24710 Make error messages standard.
24711 (toomany): Improve error message text.
24712
24713 * 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:
24714 new.h renamed to alloc.h.
24715
247161997-06-18 Richard Stallman <rms@gnu.org>
24717
24718 * Makefile.in: new.h renamed to alloc.h.
24719
247201997-05-24 Richard Stallman <rms@gnu.org>
24721
24722 * src/lex.c (literalchar):
24723 Fix the code for escaping \, " and '.
24724
24725 (lex): Avoid trouble when there are many chars
24726 to discard in a char literal with just several chars in it.
24727
247281997-05-17 Richard Stallman <rms@gnu.org>
24729
24730 * src/bison.s1:
24731 Use malloc, if using alloca is troublesome.
24732 (YYSTACK_USE_ALLOCA): New flag macro.
24733 Define it for some systems and compilers.
24734 (YYSTACK_ALLOC): New macro.
24735 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24736 If it was malloc'd, free it.
24737
247381997-05-17 Richard Stallman <rms@gnu.org>
24739
24740 * bison.simple:
24741 Use malloc, if using alloca is troublesome.
24742 (YYSTACK_USE_ALLOCA): New flag macro.
24743 Define it for some systems and compilers.
24744 (YYSTACK_ALLOC): New macro.
24745 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24746 If it was malloc'd, free it.
24747
247481997-04-23 Richard Stallman <rms@gnu.org>
24749
24750 * src/bison.s1:
24751 (alloca) [__hpux]: Always define as __builtin_alloca.
24752
247531997-04-23 Richard Stallman <rms@gnu.org>
24754
24755 * bison.simple:
24756 (alloca) [__hpux]: Always define as __builtin_alloca.
24757
247581997-04-22 Richard Stallman <rms@gnu.org>
24759
24760 * src/bison.s1:
24761 [__hpux]: Include alloca.h (right for HPUX 10)
24762 instead of declaring alloca (right for HPUX 9).
24763
24764 * src/bison.s1 (__yy_memcpy):
24765 Declare arg `count' as unsigned int.
24766 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24767
247681997-04-22 Richard Stallman <rms@gnu.org>
24769
24770 * bison.simple:
24771 [__hpux]: Include alloca.h (right for HPUX 10)
24772 instead of declaring alloca (right for HPUX 9).
24773
24774 * bison.simple (__yy_memcpy):
24775 Declare arg `count' as unsigned int.
24776 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24777
247781997-01-03 Richard Stallman <rms@gnu.org>
24779
24780 * src/allocate.c: [__STDC__ or _MSC_VER]:
24781 Declare calloc and realloc to return void *.
24782
247831997-01-02 Richard Stallman <rms@gnu.org>
24784
24785 * src/system.h:
24786 [_MSC_VER]: Include stdlib.h and process.h.
24787 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
24788
24789 * src/main.c (main): Return FAILURE as a value.
24790 (printable_version): Declare arg as int, not char.
24791
247921997-01-02 Richard Stallman <rms@gnu.org>
24793
24794 * Makefile.in (dist):
24795 Explicitly check for symlinks, and copy them.
24796
247971996-12-19 Richard Stallman <rms@gnu.org>
24798
24799 * src/files.c:
24800 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
24801
248021996-12-18 Paul Eggert <eggert@gnu.org>
24803
24804 * src/bison.s1 (yyparse):
24805 If __GNUC__ and YYPARSE_PARAM are both defined,
24806 declare yyparse to have a void * argument.
24807
248081996-12-18 Paul Eggert <eggert@gnu.org>
24809
24810 * bison.simple (yyparse):
24811 If __GNUC__ and YYPARSE_PARAM are both defined,
24812 declare yyparse to have a void * argument.
24813
248141996-12-17 Richard Stallman <rms@gnu.org>
24815
24816 * src/reduce.c (nbits): Add some casts.
24817
248181996-08-12 Richard Stallman <rms@gnu.org>
24819
24820 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
24821
248221996-08-12 Richard Stallman <rms@gnu.org>
24823
24824 * bison.simple: Test _MSDOS as well as _MSDOS_.
24825
248261996-07-31 Richard Stallman <rms@gnu.org>
24827
24828 * src/bison.s1:
24829 [__sun && __i386]: Include alloca.h.
24830
248311996-07-31 Richard Stallman <rms@gnu.org>
24832
24833 * bison.simple:
24834 [__sun && __i386]: Include alloca.h.
24835
248361996-07-30 Richard Stallman <rms@gnu.org>
24837
24838 * src/bison.s1: Comment change.
24839
24840 * src/bison.s1: Test _MSDOS_, not MSDOS.
24841
248421996-07-30 Richard Stallman <rms@gnu.org>
24843
24844 * bison.simple: Comment change.
24845
24846 * bison.simple: Test _MSDOS_, not MSDOS.
24847
248481996-06-01 Richard Stallman <rms@gnu.org>
24849
24850 * 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:
24851 Insert `_' macro around many string constants.
24852
24853 * src/main.c:
24854 Insert `_' macro around many string constants.
24855
24856 (main): Call setlocale, bindtextdomain and textdomain.
24857
24858 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
24859 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
24860 [ENABLE_NLS]: Include libintl.h.
24861 [ENABLE_NLS] (gettext): Define.
24862 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
24863 (N_, PACKAGE, LOCALEDIR): New macros.
24864
248651996-06-01 Richard Stallman <rms@gnu.org>
24866
24867 * POTFILES.in: New file.
24868
24869 * Makefile.in (allocate.o):
24870 Define target explicitly.
24871
24872 * Makefile.in (CFLAGS): Set to @CFLAGS@.
24873 (LDFLAGS): Set to @LDFLAGS@.
24874 (configure): Run autoconf only if preceding `cd' succeeds.
24875 (bison.s1): Redirect output to temporary file then move the
24876 temporary to the target, rather than redirecting directly to bison.s1.
24877 (clean): Remove config.status and config.log.
24878 (distclean): Don't remove config.status here.
24879
248801996-05-12 Richard Stallman <rms@gnu.org>
24881
24882 * src/bison.s1:
24883 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24884
248851996-05-12 Richard Stallman <rms@gnu.org>
24886
24887 * bison.simple:
24888 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24889
248901996-05-11 Richard Stallman <rms@gnu.org>
24891
24892 * src/bison.s1 (__yy_memcpy):
24893 Really reorder the args, as was supposedly done on Feb 14 1995.
24894 (yyparse): Calls changed accordingly.
24895
248961996-05-11 Richard Stallman <rms@gnu.org>
24897
24898 * Makefile.in (dist): Don't use $(srcdir).
24899
24900 * bison.simple (__yy_memcpy):
24901 Really reorder the args, as was supposedly done on Feb 14 1995.
24902 (yyparse): Calls changed accordingly.
24903
249041996-01-27 Richard Stallman <rms@gnu.org>
24905
24906 * src/output.c (output_rule_data):
24907 Test YYERROR_VERBOSE in the conditional
24908 around the definition of ttyname.
24909
249101995-12-29 Richard Stallman <rms@gnu.org>
24911
24912 * src/bison.s1:
24913 Fix line numbers in #line commands.
24914
249151995-12-29 Richard Stallman <rms@gnu.org>
24916
24917 * bison.simple:
24918 Fix line numbers in #line commands.
24919
249201995-12-27 Richard Stallman <rms@gnu.org>
24921
24922 * src/bison.s1 (YYPARSE_PARAM_DECL):
24923 In C++, make it always null.
24924 (YYPARSE_PARAM_ARG): New macro.
24925 (yyparse): Use YYPARSE_PARAM_ARG.
24926
249271995-12-27 Richard Stallman <rms@gnu.org>
24928
24929 * bison.simple (YYPARSE_PARAM_DECL):
24930 In C++, make it always null.
24931 (YYPARSE_PARAM_ARG): New macro.
24932 (yyparse): Use YYPARSE_PARAM_ARG.
24933
249341995-11-29 Richard Stallman <rms@gnu.org>
24935
24936 * doc/bison.texinfo:
24937 Describe literal string tokens, %raw, %no_lines, %token_table.
24938
249391995-11-29 Daniel Hagerty <hag@gnu.org>
24940
24941 * doc/bison.texinfo: Fixed update date
24942
249431995-10-16 Richard Stallman <rms@gnu.org>
24944
24945 * src/version.c: Version 1.25.
24946
249471995-10-16 Richard Stallman <rms@gnu.org>
24948
24949 * NEWS: *** empty log message ***
24950
249511995-10-16 Richard Stallman <rms@gnu.org>
24952
24953 * doc/bison.1, doc/bison.rnh:
24954 Add new options.
24955
249561995-10-15 Richard Stallman <rms@gnu.org>
24957
24958 * src/vmsgetargs.c, src/getargs.c:
24959 Added -n, -k, and -raw switches.
24960 (noparserflag, toknumflag, rawtoknumflag): New variables.
24961
24962 * src/symtab.h (SALIAS):
24963 New #define for adding aliases to %token.
24964 (struct bucket): Added `alias' field.
24965
24966 * src/reduce.c (reduce_grammar):
24967 Revise error message.
24968 (print_notices): Remove final `.' from error message.
24969
24970 * src/reader.c (reader_output_yylsp):
24971 New function.
24972 (readgram): Use `#if 0' around code that accepted %command
24973 inside grammar rules: The documentation doesn't allow it,
24974 and it will fail since the %command processors scan for the next %.
24975 (parse_token_decl): Extended the %token
24976 declaration to allow a multi-character symbol as an alias.
24977 (parse_thong_decl): New function.
24978 (read_declarations): Added %thong declarations.
24979 (read_declarations): Handle NOOP to deal with allowing
24980 % declarations as another means to specify the flags.
24981 (readgram): Allow %prec prior to semantics embedded in a rule.
24982 (skip_to_char, read_declarations, copy_definition)
24983 (parse_token_decl, parse_start_decl, parse_type_decl)
24984 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
24985 (get_type_name, copy_guard, copy_action, readgram)
24986 (get_type, packsymbols): Revised most error messages.
24987 Changed `fatal' to `warnxxx' to avoid aborting for error.
24988 Revised and use multiple warnxxx functions to avoid using VARARGS1.
24989 (read_declarations): Improve the error message for
24990 an invalid character. Do not abort.
24991 (read_declarations, copy_guard, copy_action): Use
24992 printable_version to avoid unprintable characters in printed output.
24993 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
24994 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
24995 Allow the type of a non-terminal can be given
24996 more than once, as long as all specifications give the same type.
24997
24998 * src/output.c:
24999 (output_headers, output_trailers, output, output_gram)
25000 (output_rule_data): Implement noparserflag variable.
25001 Implement toknumflag variable.
25002 (output): Call reader_output_yylsp to output LTYPESTR.
25003
25004 * src/main.c (main):
25005 If reader sees an error, don't process the grammar.
25006 (fatals): Updated to not use VARARGS1.
25007 (printable_version, int_to_string, warn, warni, warns, warnss)
25008 (warnsss): New error reporting functions. Avoid abort for error.
25009
25010 * src/lex.h:
25011 Added THONG and NOOP for alias processing.
25012 Added SETOPT for the new code that allows setting options with %flags.
25013
25014 * src/lex.c:
25015 Include getopt.h. Add some extern decls.
25016 (safegetc): New function to deal with EOF gracefully.
25017 (literalchar); new function to deal with reading \ escapes.
25018 (lex): Use literalchar.
25019 (lex): Implemented "..." tokens.
25020 (literalchar, lex, parse_percent_token): Made tokenbuffer
25021 always contain the token. This includes growing the token
25022 buffer while reading an integer.
25023 (parse_percent_token): Replaced if-else statement with percent_table.
25024 (parse_percent_token): Added % declarations as another
25025 way to specify the flags -n, -l, and -r. Also added hooks for
25026 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
25027 major changes to files.c.
25028 (lex) Retain in the incoming stream a character following
25029 an incorrect '/'.
25030 (skip_white_space, lex): Revised most error messages
25031 and changed fatal to warn to avoid aborting.
25032 (percent_table): Added %thong declarations.
25033
25034 * src/gram.h: Comment changes.
25035
25036 * src/files.c (openfiles, open_extra_files, done):
25037 Add faction flag
25038 and actfile file. Handle noparserflag. Both for -n switch.
25039
25040 * src/conflicts.c (resolve_sr_conflict):
25041 Remove use of alloca.
25042
250431995-06-01 Jim Meyering <meyering@gnu.org>
25044
25045 * doc/bison.texinfo: *** empty log message ***
25046
250471995-05-06 Richard Stallman <rms@gnu.org>
25048
25049 * src/bison.s1: Comment change.
25050
250511995-05-06 Richard Stallman <rms@gnu.org>
25052
25053 * bison.simple: Comment change.
25054
250551995-05-03 Richard Stallman <rms@gnu.org>
25056
25057 * src/version.c: Version now 1.24.
25058
25059 * src/bison.s1: Change distribution terms.
25060
25061 * src/version.c: Version now 1.23.
25062
250631995-05-03 Richard Stallman <rms@gnu.org>
25064
25065 * doc/bison.texinfo:
25066 Rewrite "Conditions for Using Bison".
25067 Update version to 1.24.
25068
250691995-05-03 Richard Stallman <rms@gnu.org>
25070
25071 * bison.simple: Change distribution terms.
25072
250731995-02-23 Richard Stallman <rms@gnu.org>
25074
25075 * src/files.c: Test __VMS_POSIX as well as VMS.
25076
250771995-02-14 Jim Meyering <meyering@gnu.org>
25078
25079 * src/bison.s1 (__yy_memcpy):
25080 Renamed from __yy_bcopy to avoid
25081 confusion. Reverse FROM and TO arguments to be consistent with
25082 those of memcpy.
25083
250841995-02-14 Jim Meyering <meyering@gnu.org>
25085
25086 * bison.simple (__yy_memcpy):
25087 Renamed from __yy_bcopy to avoid
25088 confusion. Reverse FROM and TO arguments to be consistent with
25089 those of memcpy.
25090
250911994-11-10 David J. MacKenzie <djm@gnu.org>
25092
25093 * NEWS: reformat
25094
25095 * NEWS: New file.
25096
25097 * Makefile.in (DISTFILES): Include NEWS.
25098
25099 * Makefile.in (DISTFILES):
25100 Include install-sh, not install.sh.
25101
25102 * configure.in: Update to Autoconf v2 macro names.
25103
251041994-10-05 David J. MacKenzie <djm@gnu.org>
25105
25106 * Makefile.in: fix typo
25107
25108 * Makefile.in (prefix, exec_prefix):
25109 Let configure set them.
25110
251111994-09-28 David J. MacKenzie <djm@gnu.org>
25112
25113 * Makefile.in: Set datadir to $(prefix)/share.
25114
251151994-09-15 Richard Stallman <rms@gnu.org>
25116
25117 * src/bison.s1:
25118 Update copyright notice and GPL version.
25119
251201994-09-15 Richard Stallman <rms@gnu.org>
25121
25122 * bison.simple:
25123 Update copyright notice and GPL version.
25124
251251994-07-12 Richard Stallman <rms@gnu.org>
25126
25127 * src/reduce.c, src/reader.c:
25128 entered into RCS
25129
251301994-05-05 David J. MacKenzie <djm@gnu.org>
25131
25132 * Makefile.in: entered into RCS
25133
251341994-03-26 Richard Stallman <rms@gnu.org>
25135
25136 * src/bison.s1: entered into RCS
25137
251381994-03-26 Richard Stallman <rms@gnu.org>
25139
25140 * bison.simple: entered into RCS
25141
251421994-03-25 Richard Stallman <rms@gnu.org>
25143
25144 * src/main.c: entered into RCS
25145
251461994-03-24 Richard Stallman <rms@gnu.org>
25147
25148 * src/conflicts.c: entered into RCS
25149
251501994-01-02 Richard Stallman <rms@gnu.org>
25151
25152 * Makefile.in: *** empty log message ***
25153
251541993-11-21 Richard Stallman <rms@gnu.org>
25155
25156 * src/bison.s1: *** empty log message ***
25157
251581993-11-21 Richard Stallman <rms@gnu.org>
25159
25160 * doc/bison.texinfo: entered into RCS
25161
25162 * doc/bison.texinfo: *** empty log message ***
25163
251641993-11-21 Richard Stallman <rms@gnu.org>
25165
25166 * bison.simple: *** empty log message ***
25167
251681993-10-25 David J. MacKenzie <djm@gnu.org>
25169
25170 * doc/bison.texinfo: *** empty log message ***
25171
251721993-10-19 Richard Stallman <rms@gnu.org>
25173
25174 * src/bison.s1: *** empty log message ***
25175
251761993-10-19 Richard Stallman <rms@gnu.org>
25177
25178 * bison.simple: *** empty log message ***
25179
251801993-10-14 Richard Stallman <rms@gnu.org>
25181
25182 * src/bison.s1: *** empty log message ***
25183
251841993-10-14 Richard Stallman <rms@gnu.org>
25185
25186 * bison.simple: *** empty log message ***
25187
251881993-09-14 David J. MacKenzie <djm@gnu.org>
25189
25190 * doc/bison.texinfo: *** empty log message ***
25191
251921993-09-13 Noah Friedman <friedman@gnu.org>
25193
25194 * Makefile.in: *** empty log message ***
25195
251961993-09-10 Richard Stallman <rms@gnu.org>
25197
25198 * src/conflicts.c: *** empty log message ***
25199
25200 * src/system.h: entered into RCS
25201
252021993-09-10 Richard Stallman <rms@gnu.org>
25203
25204 * doc/bison.1: entered into RCS
25205
252061993-09-06 Noah Friedman <friedman@gnu.org>
25207
25208 * src/version.c: entered into RCS
25209
252101993-09-06 Noah Friedman <friedman@gnu.org>
25211
25212 * Makefile.in: *** empty log message ***
25213
252141993-07-30 David J. MacKenzie <djm@gnu.org>
25215
25216 * Makefile.in: *** empty log message ***
25217
252181993-07-24 Richard Stallman <rms@gnu.org>
25219
25220 * src/bison.s1: *** empty log message ***
25221
252221993-07-24 Richard Stallman <rms@gnu.org>
25223
25224 * bison.simple: *** empty log message ***
25225
252261993-07-08 David J. MacKenzie <djm@gnu.org>
25227
25228 * Makefile.in: *** empty log message ***
25229
252301993-07-04 Richard Stallman <rms@gnu.org>
25231
25232 * src/bison.s1: *** empty log message ***
25233
252341993-07-04 Richard Stallman <rms@gnu.org>
25235
25236 * bison.simple: *** empty log message ***
25237
252381993-06-26 David J. MacKenzie <djm@gnu.org>
25239
25240 * src/getargs.c: entered into RCS
25241
252421993-06-26 David J. MacKenzie <djm@gnu.org>
25243
25244 * doc/bison.texinfo: *** empty log message ***
25245
25246 * doc/bison.1: New file.
25247
252481993-06-25 Richard Stallman <rms@gnu.org>
25249
25250 * src/getargs.c: New file.
25251
252521993-06-16 Richard Stallman <rms@gnu.org>
25253
25254 * src/bison.s1: *** empty log message ***
25255
252561993-06-16 Richard Stallman <rms@gnu.org>
25257
25258 * bison.simple: *** empty log message ***
25259
252601993-06-03 Richard Stallman <rms@gnu.org>
25261
25262 * src/bison.s1: New file.
25263
252641993-06-03 Richard Stallman <rms@gnu.org>
25265
25266 * doc/bison.texinfo: *** empty log message ***
25267
252681993-06-03 Richard Stallman <rms@gnu.org>
25269
25270 * bison.simple: New file.
25271
252721993-05-19 Richard Stallman <rms@gnu.org>
25273
25274 * doc/bison.texinfo: New file.
25275
252761993-05-07 Noah Friedman <friedman@gnu.org>
25277
25278 * Makefile.in: *** empty log message ***
25279
252801993-04-28 Noah Friedman <friedman@gnu.org>
25281
25282 * src/reader.c: *** empty log message ***
25283
252841993-04-23 Noah Friedman <friedman@gnu.org>
25285
25286 * src/alloc.h: entered into RCS
25287
252881993-04-20 David J. MacKenzie <djm@gnu.org>
25289
25290 * src/version.c: *** empty log message ***
25291
25292 * src/files.c, src/allocate.c:
25293 entered into RCS
25294
25295 * src/reader.c: *** empty log message ***
25296
25297 * src/lex.c: entered into RCS
25298
25299 * src/conflicts.c: New file.
25300
25301 * src/symtab.c: entered into RCS
25302
25303 * src/alloc.h: New file.
25304
25305 * src/LR0.c: entered into RCS
25306
253071993-04-18 Noah Friedman <friedman@gnu.org>
25308
25309 * src/reader.c: New file.
25310
25311 * src/version.c: *** empty log message ***
25312
253131993-04-18 Noah Friedman <friedman@gnu.org>
25314
25315 * Makefile.in: *** empty log message ***
25316
253171993-04-17 Noah Friedman <friedman@gnu.org>
25318
25319 * Makefile.in: *** empty log message ***
25320
253211993-04-15 Richard Stallman <rms@gnu.org>
25322
25323 * src/main.c, src/files.c:
25324 New file.
25325
253261993-04-15 Noah Friedman <friedman@gnu.org>
25327
25328 * configure.in: entered into RCS
25329
25330 * configure.in: *** empty log message ***
25331
25332 * configure.in: New file.
25333
253341993-04-14 Richard Stallman <rms@gnu.org>
25335
25336 * Makefile.in: New file.
25337
253381993-04-13 Richard Stallman <rms@gnu.org>
25339
25340 * src/version.c: New file.
25341
253421993-03-25 Richard Stallman <rms@gnu.org>
25343
25344 * src/output.c: entered into RCS
25345
253461992-09-25 Richard Stallman <rms@gnu.org>
25347
25348 * configure.bat: entered into RCS
25349
253501992-06-22 Richard Stallman <rms@gnu.org>
25351
25352 * src/vmsgetargs.c: entered into RCS
25353
253541992-06-22 Richard Stallman <rms@gnu.org>
25355
25356 * doc/bison.rnh: entered into RCS
25357
253581992-04-20 David J. MacKenzie <djm@gnu.org>
25359
25360 * README: entered into RCS
25361
253621992-01-22 Richard Stallman <rms@gnu.org>
25363
25364 * src/machine.h: entered into RCS
25365
253661991-12-21 Richard Stallman <rms@gnu.org>
25367
25368 * src/lalr.c, src/closure.c:
25369 entered into RCS
25370
253711991-12-20 Richard Stallman <rms@gnu.org>
25372
25373 * src/state.h: entered into RCS
25374
253751991-12-18 Richard Stallman <rms@gnu.org>
25376
25377 * src/print.c, src/nullable.c, src/derives.c:
25378 entered into RCS
25379
253801991-11-03 David J. MacKenzie <djm@gnu.org>
25381
25382 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
25383 entered into RCS
25384
253851988-09-09 Richard Stallman <rms@gnu.org>
25386
25387 * src/bison.hairy: entered into RCS
25388
253891987-12-16 Richard Stallman <rms@gnu.org>
25390
25391 * REFERENCES: entered into RCS
25392
25393
25394 -----
25395
25396 Copyright (C) 1987-1988, 1991-2010 Free Software Foundation,
25397 Inc.
25398
25399 Copying and distribution of this file, with or without
25400 modification, are permitted provided the copyright notice and this
25401 notice are preserved.